(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **//*! #__NO_SIDE_EFFECTS__ */function Lu(i){const e=Object.create(null);for(const t of i.split(","))e[t]=1;return t=>t in e}const Ae={},qs=[],ji=()=>{},wx=()=>!1,pc=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),Nu=i=>i.startsWith("onUpdate:"),wt=Object.assign,Iu=(i,e)=>{const t=i.indexOf(e);t>-1&&i.splice(t,1)},xx=Object.prototype.hasOwnProperty,Qe=(i,e)=>xx.call(i,e),le=Array.isArray,Us=i=>zo(i)==="[object Map]",mc=i=>zo(i)==="[object Set]",pp=i=>zo(i)==="[object Date]",pe=i=>typeof i=="function",et=i=>typeof i=="string",gi=i=>typeof i=="symbol",Ne=i=>i!==null&&typeof i=="object",u0=i=>(Ne(i)||pe(i))&&pe(i.then)&&pe(i.catch),d0=Object.prototype.toString,zo=i=>d0.call(i),vx=i=>zo(i).slice(8,-1),p0=i=>zo(i)==="[object Object]",ju=i=>et(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,io=Lu(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),gc=i=>{const e=Object.create(null);return t=>e[t]||(e[t]=i(t))},_x=/-(\w)/g,ai=gc(i=>i.replace(_x,(e,t)=>t?t.toUpperCase():"")),kx=/\B([A-Z])/g,_s=gc(i=>i.replace(kx,"-$1").toLowerCase()),Oc=gc(i=>i.charAt(0).toUpperCase()+i.slice(1)),eh=gc(i=>i?`on${Oc(i)}`:""),Cn=(i,e)=>!Object.is(i,e),ea=(i,...e)=>{for(let t=0;t{Object.defineProperty(i,e,{configurable:!0,enumerable:!1,writable:n,value:t})},va=i=>{const e=parseFloat(i);return isNaN(e)?i:e};let mp;const bc=()=>mp||(mp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Xu(i){if(le(i)){const e={};for(let t=0;t{if(t){const n=t.split(Px);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function rn(i){let e="";if(et(i))e=i;else if(le(i))for(let t=0;tyc(t,e))}const O0=i=>!!(i&&i.__v_isRef===!0),Le=i=>et(i)?i:i==null?"":le(i)||Ne(i)&&(i.toString===d0||!pe(i.toString))?O0(i)?Le(i.value):JSON.stringify(i,b0,2):String(i),b0=(i,e)=>O0(e)?b0(i,e.value):Us(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[n,s],r)=>(t[th(n,r)+" =>"]=s,t),{})}:mc(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>th(t))}:gi(e)?th(e):Ne(e)&&!le(e)&&!p0(e)?String(e):e,th=(i,e="")=>{var t;return gi(i)?`Symbol(${(t=i.description)!=null?t:e})`:i};/** * @vue/reactivity v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let _t;class y0{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=_t,!e&&_t&&(this.index=(_t.scopes||(_t.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0)return;if(so){let e=so;for(so=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let i;for(;no;){let e=no;for(no=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){i||(i=n)}e=t}}if(i)throw i}function k0(i){for(let e=i.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function $0(i){let e,t=i.depsTail,n=t;for(;n;){const s=n.prevDep;n.version===-1?(n===t&&(t=s),Wu(n),Zx(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=s}i.deps=e,i.depsTail=t}function cf(i){for(let e=i.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(P0(e.dep.computed)||e.dep.version!==e.version))return!0;return!!i._dirty}function P0(i){if(i.flags&4&&!(i.flags&16)||(i.flags&=-17,i.globalVersion===So))return;i.globalVersion=So;const e=i.dep;if(i.flags|=2,e.version>0&&!i.isSSR&&i.deps&&!cf(i)){i.flags&=-3;return}const t=Ze,n=mi;Ze=i,mi=!0;try{k0(i);const s=i.fn(i._value);(e.version===0||Cn(s,i._value))&&(i._value=s,e.version++)}catch(s){throw e.version++,s}finally{Ze=t,mi=n,$0(i),i.flags&=-3}}function Wu(i,e=!1){const{dep:t,prevSub:n,nextSub:s}=i;if(n&&(n.nextSub=s,i.prevSub=void 0),s&&(s.prevSub=n,i.nextSub=void 0),t.subs===i&&(t.subs=n,!n&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)Wu(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Zx(i){const{prevDep:e,nextDep:t}=i;e&&(e.nextDep=t,i.prevDep=void 0),t&&(t.prevDep=e,i.nextDep=void 0)}let mi=!0;const Q0=[];function Vn(){Q0.push(mi),mi=!1}function Bn(){const i=Q0.pop();mi=i===void 0?!0:i}function gp(i){const{cleanup:e}=i;if(i.cleanup=void 0,e){const t=Ze;Ze=void 0;try{e()}finally{Ze=t}}}let So=0;class Dx{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class qu{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Ze||!mi||Ze===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Ze)t=this.activeLink=new Dx(Ze,this),Ze.deps?(t.prevDep=Ze.depsTail,Ze.depsTail.nextDep=t,Ze.depsTail=t):Ze.deps=Ze.depsTail=t,E0(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const n=t.nextDep;n.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=n),t.prevDep=Ze.depsTail,t.nextDep=void 0,Ze.depsTail.nextDep=t,Ze.depsTail=t,Ze.deps===t&&(Ze.deps=n)}return t}trigger(e){this.version++,So++,this.notify(e)}notify(e){Vu();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Bu()}}}function E0(i){if(i.dep.sc++,i.sub.flags&4){const e=i.dep.computed;if(e&&!i.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)E0(n)}const t=i.dep.subs;t!==i&&(i.prevSub=t,t&&(t.nextSub=i)),i.dep.subs=i}}const _a=new WeakMap,as=Symbol(""),hf=Symbol(""),wo=Symbol("");function Ot(i,e,t){if(mi&&Ze){let n=_a.get(i);n||_a.set(i,n=new Map);let s=n.get(t);s||(n.set(t,s=new qu),s.map=n,s.key=t),s.track()}}function tn(i,e,t,n,s,r){const o=_a.get(i);if(!o){So++;return}const l=a=>{a&&a.trigger()};if(Vu(),e==="clear")o.forEach(l);else{const a=le(i),c=a&&ju(t);if(a&&t==="length"){const h=Number(n);o.forEach((f,u)=>{(u==="length"||u===wo||!gi(u)&&u>=h)&&l(f)})}else switch((t!==void 0||o.has(void 0))&&l(o.get(t)),c&&l(o.get(wo)),e){case"add":a?c&&l(o.get("length")):(l(o.get(as)),Us(i)&&l(o.get(hf)));break;case"delete":a||(l(o.get(as)),Us(i)&&l(o.get(hf)));break;case"set":Us(i)&&l(o.get(as));break}}Bu()}function Lx(i,e){const t=_a.get(i);return t&&t.get(e)}function Qs(i){const e=xe(i);return e===i?e:(Ot(e,"iterate",wo),ri(i)?e:e.map(bt))}function Sc(i){return Ot(i=xe(i),"iterate",wo),i}const Nx={__proto__:null,[Symbol.iterator](){return nh(this,Symbol.iterator,bt)},concat(...i){return Qs(this).concat(...i.map(e=>le(e)?Qs(e):e))},entries(){return nh(this,"entries",i=>(i[1]=bt(i[1]),i))},every(i,e){return Gi(this,"every",i,e,void 0,arguments)},filter(i,e){return Gi(this,"filter",i,e,t=>t.map(bt),arguments)},find(i,e){return Gi(this,"find",i,e,bt,arguments)},findIndex(i,e){return Gi(this,"findIndex",i,e,void 0,arguments)},findLast(i,e){return Gi(this,"findLast",i,e,bt,arguments)},findLastIndex(i,e){return Gi(this,"findLastIndex",i,e,void 0,arguments)},forEach(i,e){return Gi(this,"forEach",i,e,void 0,arguments)},includes(...i){return sh(this,"includes",i)},indexOf(...i){return sh(this,"indexOf",i)},join(i){return Qs(this).join(i)},lastIndexOf(...i){return sh(this,"lastIndexOf",i)},map(i,e){return Gi(this,"map",i,e,void 0,arguments)},pop(){return Dr(this,"pop")},push(...i){return Dr(this,"push",i)},reduce(i,...e){return Op(this,"reduce",i,e)},reduceRight(i,...e){return Op(this,"reduceRight",i,e)},shift(){return Dr(this,"shift")},some(i,e){return Gi(this,"some",i,e,void 0,arguments)},splice(...i){return Dr(this,"splice",i)},toReversed(){return Qs(this).toReversed()},toSorted(i){return Qs(this).toSorted(i)},toSpliced(...i){return Qs(this).toSpliced(...i)},unshift(...i){return Dr(this,"unshift",i)},values(){return nh(this,"values",bt)}};function nh(i,e,t){const n=Sc(i),s=n[e]();return n!==i&&!ri(i)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const Ix=Array.prototype;function Gi(i,e,t,n,s,r){const o=Sc(i),l=o!==i&&!ri(i),a=o[e];if(a!==Ix[e]){const f=a.apply(i,r);return l?bt(f):f}let c=t;o!==i&&(l?c=function(f,u){return t.call(this,bt(f),u,i)}:t.length>2&&(c=function(f,u){return t.call(this,f,u,i)}));const h=a.call(o,c,n);return l&&s?s(h):h}function Op(i,e,t,n){const s=Sc(i);let r=t;return s!==i&&(ri(i)?t.length>3&&(r=function(o,l,a){return t.call(this,o,l,a,i)}):r=function(o,l,a){return t.call(this,o,bt(l),a,i)}),s[e](r,...n)}function sh(i,e,t){const n=xe(i);Ot(n,"iterate",wo);const s=n[e](...t);return(s===-1||s===!1)&&Yu(t[0])?(t[0]=xe(t[0]),n[e](...t)):s}function Dr(i,e,t=[]){Vn(),Vu();const n=xe(i)[e].apply(i,t);return Bu(),Bn(),n}const jx=Lu("__proto__,__v_isRef,__isVue"),C0=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(gi));function Xx(i){gi(i)||(i=String(i));const e=xe(this);return Ot(e,"has",i),e.hasOwnProperty(i)}class A0{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return n===(s?r?Gx:Z0:r?M0:R0).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=le(e);if(!s){let a;if(o&&(a=Nx[t]))return a;if(t==="hasOwnProperty")return Xx}const l=Reflect.get(e,t,Ye(e)?e:n);return(gi(t)?C0.has(t):jx(t))||(s||Ot(e,"get",t),r)?l:Ye(l)?o&&ju(t)?l:l.value:Ne(l)?s?L0(l):Yo(l):l}}class T0 extends A0{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const a=ms(r);if(!ri(n)&&!ms(n)&&(r=xe(r),n=xe(n)),!le(e)&&Ye(r)&&!Ye(n))return a?!1:(r.value=n,!0)}const o=le(e)&&ju(t)?Number(t)i,yl=i=>Reflect.getPrototypeOf(i);function Ux(i,e,t){return function(...n){const s=this.__v_raw,r=xe(s),o=Us(r),l=i==="entries"||i===Symbol.iterator&&o,a=i==="keys"&&o,c=s[i](...n),h=t?ff:e?uf:bt;return!e&&Ot(r,"iterate",a?hf:as),{next(){const{value:f,done:u}=c.next();return u?{value:f,done:u}:{value:l?[h(f[0]),h(f[1])]:h(f),done:u}},[Symbol.iterator](){return this}}}}function Sl(i){return function(...e){return i==="delete"?!1:i==="clear"?void 0:this}}function zx(i,e){const t={get(s){const r=this.__v_raw,o=xe(r),l=xe(s);i||(Cn(s,l)&&Ot(o,"get",s),Ot(o,"get",l));const{has:a}=yl(o),c=e?ff:i?uf:bt;if(a.call(o,s))return c(r.get(s));if(a.call(o,l))return c(r.get(l));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!i&&Ot(xe(s),"iterate",as),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=xe(r),l=xe(s);return i||(Cn(s,l)&&Ot(o,"has",s),Ot(o,"has",l)),s===l?r.has(s):r.has(s)||r.has(l)},forEach(s,r){const o=this,l=o.__v_raw,a=xe(l),c=e?ff:i?uf:bt;return!i&&Ot(a,"iterate",as),l.forEach((h,f)=>s.call(r,c(h),c(f),o))}};return wt(t,i?{add:Sl("add"),set:Sl("set"),delete:Sl("delete"),clear:Sl("clear")}:{add(s){!e&&!ri(s)&&!ms(s)&&(s=xe(s));const r=xe(this);return yl(r).has.call(r,s)||(r.add(s),tn(r,"add",s,s)),this},set(s,r){!e&&!ri(r)&&!ms(r)&&(r=xe(r));const o=xe(this),{has:l,get:a}=yl(o);let c=l.call(o,s);c||(s=xe(s),c=l.call(o,s));const h=a.call(o,s);return o.set(s,r),c?Cn(r,h)&&tn(o,"set",s,r):tn(o,"add",s,r),this},delete(s){const r=xe(this),{has:o,get:l}=yl(r);let a=o.call(r,s);a||(s=xe(s),a=o.call(r,s)),l&&l.call(r,s);const c=r.delete(s);return a&&tn(r,"delete",s,void 0),c},clear(){const s=xe(this),r=s.size!==0,o=s.clear();return r&&tn(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=Ux(s,i,e)}),t}function Uu(i,e){const t=zx(i,e);return(n,s,r)=>s==="__v_isReactive"?!i:s==="__v_isReadonly"?i:s==="__v_raw"?n:Reflect.get(Qe(t,s)&&s in n?t:n,s,r)}const Yx={get:Uu(!1,!1)},Fx={get:Uu(!1,!0)},Hx={get:Uu(!0,!1)};const R0=new WeakMap,M0=new WeakMap,Z0=new WeakMap,Gx=new WeakMap;function Kx(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Jx(i){return i.__v_skip||!Object.isExtensible(i)?0:Kx(vx(i))}function Yo(i){return ms(i)?i:zu(i,!1,Bx,Yx,R0)}function D0(i){return zu(i,!1,qx,Fx,M0)}function L0(i){return zu(i,!0,Wx,Hx,Z0)}function zu(i,e,t,n,s){if(!Ne(i)||i.__v_raw&&!(e&&i.__v_isReactive))return i;const r=s.get(i);if(r)return r;const o=Jx(i);if(o===0)return i;const l=new Proxy(i,o===2?n:t);return s.set(i,l),l}function An(i){return ms(i)?An(i.__v_raw):!!(i&&i.__v_isReactive)}function ms(i){return!!(i&&i.__v_isReadonly)}function ri(i){return!!(i&&i.__v_isShallow)}function Yu(i){return i?!!i.__v_raw:!1}function xe(i){const e=i&&i.__v_raw;return e?xe(e):i}function Fu(i){return!Qe(i,"__v_skip")&&Object.isExtensible(i)&&m0(i,"__v_skip",!0),i}const bt=i=>Ne(i)?Yo(i):i,uf=i=>Ne(i)?L0(i):i;function Ye(i){return i?i.__v_isRef===!0:!1}function Te(i){return N0(i,!1)}function ro(i){return N0(i,!0)}function N0(i,e){return Ye(i)?i:new ev(i,e)}class ev{constructor(e,t){this.dep=new qu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:xe(e),this._value=t?e:bt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||ri(e)||ms(e);e=n?e:xe(e),Cn(e,t)&&(this._rawValue=e,this._value=n?e:bt(e),this.dep.trigger())}}function Xi(i){return Ye(i)?i.value:i}const tv={get:(i,e,t)=>e==="__v_raw"?i:Xi(Reflect.get(i,e,t)),set:(i,e,t,n)=>{const s=i[e];return Ye(s)&&!Ye(t)?(s.value=t,!0):Reflect.set(i,e,t,n)}};function I0(i){return An(i)?i:new Proxy(i,tv)}function iv(i){const e=le(i)?new Array(i.length):{};for(const t in i)e[t]=sv(i,t);return e}class nv{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Lx(xe(this._object),this._key)}}function sv(i,e,t){const n=i[e];return Ye(n)?n:new nv(i,e,t)}class rv{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new qu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=So-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Ze!==this)return _0(this,!0),!0}get value(){const e=this.dep.track();return P0(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ov(i,e,t=!1){let n,s;return pe(i)?n=i:(n=i.get,s=i.set),new rv(n,s,t)}const wl={},ka=new WeakMap;let Kn;function lv(i,e=!1,t=Kn){if(t){let n=ka.get(t);n||ka.set(t,n=[]),n.push(i)}}function av(i,e,t=Ae){const{immediate:n,deep:s,once:r,scheduler:o,augmentJob:l,call:a}=t,c=x=>s?x:ri(x)||s===!1||s===0?nn(x,1):nn(x);let h,f,u,d,p=!1,m=!1;if(Ye(i)?(f=()=>i.value,p=ri(i)):An(i)?(f=()=>c(i),p=!0):le(i)?(m=!0,p=i.some(x=>An(x)||ri(x)),f=()=>i.map(x=>{if(Ye(x))return x.value;if(An(x))return c(x);if(pe(x))return a?a(x,2):x()})):pe(i)?e?f=a?()=>a(i,2):i:f=()=>{if(u){Vn();try{u()}finally{Bn()}}const x=Kn;Kn=h;try{return a?a(i,3,[d]):i(d)}finally{Kn=x}}:f=ji,e&&s){const x=f,v=s===!0?1/0:s;f=()=>nn(x(),v)}const g=w0(),O=()=>{h.stop(),g&&g.active&&Iu(g.effects,h)};if(r&&e){const x=e;e=(...v)=>{x(...v),O()}}let S=m?new Array(i.length).fill(wl):wl;const _=x=>{if(!(!(h.flags&1)||!h.dirty&&!x))if(e){const v=h.run();if(s||p||(m?v.some(($,P)=>Cn($,S[P])):Cn(v,S))){u&&u();const $=Kn;Kn=h;try{const P=[v,S===wl?void 0:m&&S[0]===wl?[]:S,d];a?a(e,3,P):e(...P),S=v}finally{Kn=$}}}else h.run()};return l&&l(_),h=new x0(f),h.scheduler=o?()=>o(_,!1):_,d=x=>lv(x,!1,h),u=h.onStop=()=>{const x=ka.get(h);if(x){if(a)a(x,4);else for(const v of x)v();ka.delete(h)}},e?n?_(!0):S=h.run():o?o(_.bind(null,!0),!0):h.run(),O.pause=h.pause.bind(h),O.resume=h.resume.bind(h),O.stop=O,O}function nn(i,e=1/0,t){if(e<=0||!Ne(i)||i.__v_skip||(t=t||new Set,t.has(i)))return i;if(t.add(i),e--,Ye(i))nn(i.value,e,t);else if(le(i))for(let n=0;n{nn(n,e,t)});else if(p0(i)){for(const n in i)nn(i[n],e,t);for(const n of Object.getOwnPropertySymbols(i))Object.prototype.propertyIsEnumerable.call(i,n)&&nn(i[n],e,t)}return i}/** * @vue/runtime-core v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/function Fo(i,e,t,n){try{return n?i(...n):i()}catch(s){wc(s,e,t)}}function qi(i,e,t,n){if(pe(i)){const s=Fo(i,e,t,n);return s&&u0(s)&&s.catch(r=>{wc(r,e,t)}),s}if(le(i)){const s=[];for(let r=0;r>>1,s=kt[n],r=xo(s);r=xo(t)?kt.push(i):kt.splice(hv(e),0,i),i.flags|=1,X0()}}function X0(){$a||($a=j0.then(B0))}function fv(i){le(i)?zs.push(...i):Sn&&i.id===-1?Sn.splice(Rs+1,0,i):i.flags&1||(zs.push(i),i.flags|=1),X0()}function bp(i,e,t=Ti+1){for(;txo(t)-xo(n));if(zs.length=0,Sn){Sn.push(...e);return}for(Sn=e,Rs=0;Rsi.id==null?i.flags&2?-1:1/0:i.id;function B0(i){try{for(Ti=0;Ti{n._d&&Qp(-1);const r=Pa(e);let o;try{o=i(...s)}finally{Pa(r),n._d&&Qp(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function $n(i,e){if(lt===null)return i;const t=$c(lt),n=i.dirs||(i.dirs=[]);for(let s=0;si.__isTeleport;function Gu(i,e){i.shapeFlag&6&&i.component?(i.transition=e,Gu(i.component.subTree,e)):i.shapeFlag&128?(i.ssContent.transition=e.clone(i.ssContent),i.ssFallback.transition=e.clone(i.ssFallback)):i.transition=e}/*! #__NO_SIDE_EFFECTS__ */function it(i,e){return pe(i)?wt({name:i.name},e,{setup:i}):i}function q0(i){i.ids=[i.ids[0]+i.ids[2]+++"-",0,0]}function Qa(i,e,t,n,s=!1){if(le(i)){i.forEach((p,m)=>Qa(p,e&&(le(e)?e[m]:e),t,n,s));return}if(Ys(n)&&!s){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Qa(i,e,t,n.component.subTree);return}const r=n.shapeFlag&4?$c(n.component):n.el,o=s?null:r,{i:l,r:a}=i,c=e&&e.r,h=l.refs===Ae?l.refs={}:l.refs,f=l.setupState,u=xe(f),d=f===Ae?()=>!1:p=>Qe(u,p);if(c!=null&&c!==a&&(et(c)?(h[c]=null,d(c)&&(f[c]=null)):Ye(c)&&(c.value=null)),pe(a))Fo(a,l,12,[o,h]);else{const p=et(a),m=Ye(a);if(p||m){const g=()=>{if(i.f){const O=p?d(a)?f[a]:h[a]:a.value;s?le(O)&&Iu(O,r):le(O)?O.includes(r)||O.push(r):p?(h[a]=[r],d(a)&&(f[a]=h[a])):(a.value=[r],i.k&&(h[i.k]=a.value))}else p?(h[a]=o,d(a)&&(f[a]=o)):m&&(a.value=o,i.k&&(h[i.k]=o))};o?(g.id=-1,Ut(g,t)):g()}}}bc().requestIdleCallback;bc().cancelIdleCallback;const Ys=i=>!!i.type.__asyncLoader,U0=i=>i.type.__isKeepAlive;function pv(i,e){z0(i,"a",e)}function mv(i,e){z0(i,"da",e)}function z0(i,e,t=ut){const n=i.__wdc||(i.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return i()});if(vc(e,n,t),t){let s=t.parent;for(;s&&s.parent;)U0(s.parent.vnode)&&gv(n,e,t,s),s=s.parent}}function gv(i,e,t,n){const s=vc(e,i,n,!0);F0(()=>{Iu(n[e],s)},t)}function vc(i,e,t=ut,n=!1){if(t){const s=t[i]||(t[i]=[]),r=e.__weh||(e.__weh=(...o)=>{Vn();const l=Ho(t),a=qi(e,t,i,o);return l(),Bn(),a});return n?s.unshift(r):s.push(r),r}}const pn=i=>(e,t=ut)=>{(!ko||i==="sp")&&vc(i,(...n)=>e(...n),t)},Ov=pn("bm"),ks=pn("m"),bv=pn("bu"),yv=pn("u"),Y0=pn("bum"),F0=pn("um"),Sv=pn("sp"),wv=pn("rtg"),xv=pn("rtc");function vv(i,e=ut){vc("ec",i,e)}const _v="components";function kv(i,e){return Pv(_v,i,!0,e)||i}const $v=Symbol.for("v-ndc");function Pv(i,e,t=!0,n=!1){const s=lt||ut;if(s){const r=s.type;{const l=g_(r,!1);if(l&&(l===e||l===ai(e)||l===Oc(ai(e))))return r}const o=yp(s[i]||r[i],e)||yp(s.appContext[i],e);return!o&&n?r:o}}function yp(i,e){return i&&(i[e]||i[ai(e)]||i[Oc(ai(e))])}function _r(i,e,t,n){let s;const r=t,o=le(i);if(o||et(i)){const l=o&&An(i);let a=!1;l&&(a=!ri(i),i=Sc(i)),s=new Array(i.length);for(let c=0,h=i.length;ce(l,a,void 0,r));else{const l=Object.keys(i);s=new Array(l.length);for(let a=0,c=l.length;a_o(e)?!(e.type===Rn||e.type===ze&&!H0(e.children)):!0)?i:null}const df=i=>i?Ob(i)?$c(i):df(i.parent):null,oo=wt(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>df(i.parent),$root:i=>df(i.root),$host:i=>i.ce,$emit:i=>i.emit,$options:i=>K0(i),$forceUpdate:i=>i.f||(i.f=()=>{Hu(i.update)}),$nextTick:i=>i.n||(i.n=xc.bind(i.proxy)),$watch:i=>Hv.bind(i)}),rh=(i,e)=>i!==Ae&&!i.__isScriptSetup&&Qe(i,e),Ev={get({_:i},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:n,data:s,props:r,accessCache:o,type:l,appContext:a}=i;let c;if(e[0]!=="$"){const d=o[e];if(d!==void 0)switch(d){case 1:return n[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(rh(n,e))return o[e]=1,n[e];if(s!==Ae&&Qe(s,e))return o[e]=2,s[e];if((c=i.propsOptions[0])&&Qe(c,e))return o[e]=3,r[e];if(t!==Ae&&Qe(t,e))return o[e]=4,t[e];pf&&(o[e]=0)}}const h=oo[e];let f,u;if(h)return e==="$attrs"&&Ot(i.attrs,"get",""),h(i);if((f=l.__cssModules)&&(f=f[e]))return f;if(t!==Ae&&Qe(t,e))return o[e]=4,t[e];if(u=a.config.globalProperties,Qe(u,e))return u[e]},set({_:i},e,t){const{data:n,setupState:s,ctx:r}=i;return rh(s,e)?(s[e]=t,!0):n!==Ae&&Qe(n,e)?(n[e]=t,!0):Qe(i.props,e)||e[0]==="$"&&e.slice(1)in i?!1:(r[e]=t,!0)},has({_:{data:i,setupState:e,accessCache:t,ctx:n,appContext:s,propsOptions:r}},o){let l;return!!t[o]||i!==Ae&&Qe(i,o)||rh(e,o)||(l=r[0])&&Qe(l,o)||Qe(n,o)||Qe(oo,o)||Qe(s.config.globalProperties,o)},defineProperty(i,e,t){return t.get!=null?i._.accessCache[e]=0:Qe(t,"value")&&this.set(i,e,t.value,null),Reflect.defineProperty(i,e,t)}};function Sp(i){return le(i)?i.reduce((e,t)=>(e[t]=null,e),{}):i}let pf=!0;function Cv(i){const e=K0(i),t=i.proxy,n=i.ctx;pf=!1,e.beforeCreate&&wp(e.beforeCreate,i,"bc");const{data:s,computed:r,methods:o,watch:l,provide:a,inject:c,created:h,beforeMount:f,mounted:u,beforeUpdate:d,updated:p,activated:m,deactivated:g,beforeDestroy:O,beforeUnmount:S,destroyed:_,unmounted:x,render:v,renderTracked:$,renderTriggered:P,errorCaptured:Z,serverPrefetch:N,expose:Y,inheritAttrs:H,components:B,directives:J,filters:ce}=e;if(c&&Av(c,n,null),o)for(const K in o){const he=o[K];pe(he)&&(n[K]=he.bind(t))}if(s){const K=s.call(t,t);Ne(K)&&(i.data=Yo(K))}if(pf=!0,r)for(const K in r){const he=r[K],ye=pe(he)?he.bind(t,t):pe(he.get)?he.get.bind(t,t):ji,Me=!pe(he)&&pe(he.set)?he.set.bind(t):ji,Xe=dt({get:ye,set:Me});Object.defineProperty(n,K,{enumerable:!0,configurable:!0,get:()=>Xe.value,set:we=>Xe.value=we})}if(l)for(const K in l)G0(l[K],n,t,K);if(a){const K=pe(a)?a.call(t):a;Reflect.ownKeys(K).forEach(he=>{ta(he,K[he])})}h&&wp(h,i,"c");function ne(K,he){le(he)?he.forEach(ye=>K(ye.bind(t))):he&&K(he.bind(t))}if(ne(Ov,f),ne(ks,u),ne(bv,d),ne(yv,p),ne(pv,m),ne(mv,g),ne(vv,Z),ne(xv,$),ne(wv,P),ne(Y0,S),ne(F0,x),ne(Sv,N),le(Y))if(Y.length){const K=i.exposed||(i.exposed={});Y.forEach(he=>{Object.defineProperty(K,he,{get:()=>t[he],set:ye=>t[he]=ye})})}else i.exposed||(i.exposed={});v&&i.render===ji&&(i.render=v),H!=null&&(i.inheritAttrs=H),B&&(i.components=B),J&&(i.directives=J),N&&q0(i)}function Av(i,e,t=ji){le(i)&&(i=mf(i));for(const n in i){const s=i[n];let r;Ne(s)?"default"in s?r=Ht(s.from||n,s.default,!0):r=Ht(s.from||n):r=Ht(s),Ye(r)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[n]=r}}function wp(i,e,t){qi(le(i)?i.map(n=>n.bind(e.proxy)):i.bind(e.proxy),e,t)}function G0(i,e,t,n){let s=n.includes(".")?ub(t,n):()=>t[n];if(et(i)){const r=e[i];pe(r)&&ht(s,r)}else if(pe(i))ht(s,i.bind(t));else if(Ne(i))if(le(i))i.forEach(r=>G0(r,e,t,n));else{const r=pe(i.handler)?i.handler.bind(t):e[i.handler];pe(r)&&ht(s,r,i)}}function K0(i){const e=i.type,{mixins:t,extends:n}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=i.appContext,l=r.get(e);let a;return l?a=l:!s.length&&!t&&!n?a=e:(a={},s.length&&s.forEach(c=>Ea(a,c,o,!0)),Ea(a,e,o)),Ne(e)&&r.set(e,a),a}function Ea(i,e,t,n=!1){const{mixins:s,extends:r}=e;r&&Ea(i,r,t,!0),s&&s.forEach(o=>Ea(i,o,t,!0));for(const o in e)if(!(n&&o==="expose")){const l=Tv[o]||t&&t[o];i[o]=l?l(i[o],e[o]):e[o]}return i}const Tv={data:xp,props:vp,emits:vp,methods:Fr,computed:Fr,beforeCreate:vt,created:vt,beforeMount:vt,mounted:vt,beforeUpdate:vt,updated:vt,beforeDestroy:vt,beforeUnmount:vt,destroyed:vt,unmounted:vt,activated:vt,deactivated:vt,errorCaptured:vt,serverPrefetch:vt,components:Fr,directives:Fr,watch:Mv,provide:xp,inject:Rv};function xp(i,e){return e?i?function(){return wt(pe(i)?i.call(this,this):i,pe(e)?e.call(this,this):e)}:e:i}function Rv(i,e){return Fr(mf(i),mf(e))}function mf(i){if(le(i)){const e={};for(let t=0;t1)return t&&pe(e)?e.call(n&&n.proxy):e}}function Lv(){return!!(ut||lt||cs)}const eb={},tb=()=>Object.create(eb),ib=i=>Object.getPrototypeOf(i)===eb;function Nv(i,e,t,n=!1){const s={},r=tb();i.propsDefaults=Object.create(null),nb(i,e,s,r);for(const o in i.propsOptions[0])o in s||(s[o]=void 0);t?i.props=n?s:D0(s):i.type.props?i.props=s:i.props=r,i.attrs=r}function Iv(i,e,t,n){const{props:s,attrs:r,vnode:{patchFlag:o}}=i,l=xe(s),[a]=i.propsOptions;let c=!1;if((n||o>0)&&!(o&16)){if(o&8){const h=i.vnode.dynamicProps;for(let f=0;f{a=!0;const[u,d]=sb(f,e,!0);wt(o,u),d&&l.push(...d)};!t&&e.mixins.length&&e.mixins.forEach(h),i.extends&&h(i.extends),i.mixins&&i.mixins.forEach(h)}if(!r&&!a)return Ne(i)&&n.set(i,qs),qs;if(le(r))for(let h=0;hi[0]==="_"||i==="$stable",Ku=i=>le(i)?i.map(Ri):[Ri(i)],Xv=(i,e,t)=>{if(e._n)return e;const n=ir((...s)=>Ku(e(...s)),t);return n._c=!1,n},ob=(i,e,t)=>{const n=i._ctx;for(const s in i){if(rb(s))continue;const r=i[s];if(pe(r))e[s]=Xv(s,r,n);else if(r!=null){const o=Ku(r);e[s]=()=>o}}},lb=(i,e)=>{const t=Ku(e);i.slots.default=()=>t},ab=(i,e,t)=>{for(const n in e)(t||n!=="_")&&(i[n]=e[n])},Vv=(i,e,t)=>{const n=i.slots=tb();if(i.vnode.shapeFlag&32){const s=e._;s?(ab(n,e,t),t&&m0(n,"_",s,!0)):ob(e,n)}else e&&lb(i,e)},Bv=(i,e,t)=>{const{vnode:n,slots:s}=i;let r=!0,o=Ae;if(n.shapeFlag&32){const l=e._;l?t&&l===1?r=!1:ab(s,e,t):(r=!e.$stable,ob(e,s)),o=e}else e&&(lb(i,e),o={default:1});if(r)for(const l in s)!rb(l)&&o[l]==null&&delete s[l]},Ut=n_;function Wv(i){return qv(i)}function qv(i,e){const t=bc();t.__VUE__=!0;const{insert:n,remove:s,patchProp:r,createElement:o,createText:l,createComment:a,setText:c,setElementText:h,parentNode:f,nextSibling:u,setScopeId:d=ji,insertStaticContent:p}=i,m=(b,y,k,T=null,M=null,R=null,W=void 0,j=null,I=!!y.dynamicChildren)=>{if(b===y)return;b&&!Lr(b,y)&&(T=C(b),we(b,M,R,!0),b=null),y.patchFlag===-2&&(I=!1,y.dynamicChildren=null);const{type:L,ref:re,shapeFlag:z}=y;switch(L){case kc:g(b,y,k,T);break;case Rn:O(b,y,k,T);break;case ia:b==null&&S(y,k,T,W);break;case ze:B(b,y,k,T,M,R,W,j,I);break;default:z&1?v(b,y,k,T,M,R,W,j,I):z&6?J(b,y,k,T,M,R,W,j,I):(z&64||z&128)&&L.process(b,y,k,T,M,R,W,j,I,ee)}re!=null&&M&&Qa(re,b&&b.ref,R,y||b,!y)},g=(b,y,k,T)=>{if(b==null)n(y.el=l(y.children),k,T);else{const M=y.el=b.el;y.children!==b.children&&c(M,y.children)}},O=(b,y,k,T)=>{b==null?n(y.el=a(y.children||""),k,T):y.el=b.el},S=(b,y,k,T)=>{[b.el,b.anchor]=p(b.children,y,k,T,b.el,b.anchor)},_=({el:b,anchor:y},k,T)=>{let M;for(;b&&b!==y;)M=u(b),n(b,k,T),b=M;n(y,k,T)},x=({el:b,anchor:y})=>{let k;for(;b&&b!==y;)k=u(b),s(b),b=k;s(y)},v=(b,y,k,T,M,R,W,j,I)=>{y.type==="svg"?W="svg":y.type==="math"&&(W="mathml"),b==null?$(y,k,T,M,R,W,j,I):N(b,y,M,R,W,j,I)},$=(b,y,k,T,M,R,W,j)=>{let I,L;const{props:re,shapeFlag:z,transition:ie,dirs:ae}=b;if(I=b.el=o(b.type,R,re&&re.is,re),z&8?h(I,b.children):z&16&&Z(b.children,I,null,T,M,oh(b,R),W,j),ae&&Fn(b,null,T,"created"),P(I,b,b.scopeId,W,T),re){for(const Ee in re)Ee!=="value"&&!io(Ee)&&r(I,Ee,null,re[Ee],R,T);"value"in re&&r(I,"value",null,re.value,R),(L=re.onVnodeBeforeMount)&&$i(L,T,b)}ae&&Fn(b,null,T,"beforeMount");const Oe=Uv(M,ie);Oe&&ie.beforeEnter(I),n(I,y,k),((L=re&&re.onVnodeMounted)||Oe||ae)&&Ut(()=>{L&&$i(L,T,b),Oe&&ie.enter(I),ae&&Fn(b,null,T,"mounted")},M)},P=(b,y,k,T,M)=>{if(k&&d(b,k),T)for(let R=0;R{for(let L=I;L{const j=y.el=b.el;let{patchFlag:I,dynamicChildren:L,dirs:re}=y;I|=b.patchFlag&16;const z=b.props||Ae,ie=y.props||Ae;let ae;if(k&&Hn(k,!1),(ae=ie.onVnodeBeforeUpdate)&&$i(ae,k,y,b),re&&Fn(y,b,k,"beforeUpdate"),k&&Hn(k,!0),(z.innerHTML&&ie.innerHTML==null||z.textContent&&ie.textContent==null)&&h(j,""),L?Y(b.dynamicChildren,L,j,k,T,oh(y,M),R):W||he(b,y,j,null,k,T,oh(y,M),R,!1),I>0){if(I&16)H(j,z,ie,k,M);else if(I&2&&z.class!==ie.class&&r(j,"class",null,ie.class,M),I&4&&r(j,"style",z.style,ie.style,M),I&8){const Oe=y.dynamicProps;for(let Ee=0;Ee{ae&&$i(ae,k,y,b),re&&Fn(y,b,k,"updated")},T)},Y=(b,y,k,T,M,R,W)=>{for(let j=0;j{if(y!==k){if(y!==Ae)for(const R in y)!io(R)&&!(R in k)&&r(b,R,y[R],null,M,T);for(const R in k){if(io(R))continue;const W=k[R],j=y[R];W!==j&&R!=="value"&&r(b,R,j,W,M,T)}"value"in k&&r(b,"value",y.value,k.value,M)}},B=(b,y,k,T,M,R,W,j,I)=>{const L=y.el=b?b.el:l(""),re=y.anchor=b?b.anchor:l("");let{patchFlag:z,dynamicChildren:ie,slotScopeIds:ae}=y;ae&&(j=j?j.concat(ae):ae),b==null?(n(L,k,T),n(re,k,T),Z(y.children||[],k,re,M,R,W,j,I)):z>0&&z&64&&ie&&b.dynamicChildren?(Y(b.dynamicChildren,ie,k,M,R,W,j),(y.key!=null||M&&y===M.subTree)&&cb(b,y,!0)):he(b,y,k,re,M,R,W,j,I)},J=(b,y,k,T,M,R,W,j,I)=>{y.slotScopeIds=j,b==null?y.shapeFlag&512?M.ctx.activate(y,k,T,W,I):ce(y,k,T,M,R,W,I):ue(b,y,I)},ce=(b,y,k,T,M,R,W)=>{const j=b.component=f_(b,T,M);if(U0(b)&&(j.ctx.renderer=ee),u_(j,!1,W),j.asyncDep){if(M&&M.registerDep(j,ne,W),!b.el){const I=j.subTree=ke(Rn);O(null,I,y,k)}}else ne(j,b,y,k,M,R,W)},ue=(b,y,k)=>{const T=y.component=b.component;if(t_(b,y,k))if(T.asyncDep&&!T.asyncResolved){K(T,y,k);return}else T.next=y,T.update();else y.el=b.el,T.vnode=y},ne=(b,y,k,T,M,R,W)=>{const j=()=>{if(b.isMounted){let{next:z,bu:ie,u:ae,parent:Oe,vnode:Ee}=b;{const _i=hb(b);if(_i){z&&(z.el=Ee.el,K(b,z,W)),_i.asyncDep.then(()=>{b.isUnmounted||j()});return}}let _e=z,Vt;Hn(b,!1),z?(z.el=Ee.el,K(b,z,W)):z=Ee,ie&&ea(ie),(Vt=z.props&&z.props.onVnodeBeforeUpdate)&&$i(Vt,Oe,z,Ee),Hn(b,!0);const At=$p(b),vi=b.subTree;b.subTree=At,m(vi,At,f(vi.el),C(vi),b,M,R),z.el=At.el,_e===null&&i_(b,At.el),ae&&Ut(ae,M),(Vt=z.props&&z.props.onVnodeUpdated)&&Ut(()=>$i(Vt,Oe,z,Ee),M)}else{let z;const{el:ie,props:ae}=y,{bm:Oe,m:Ee,parent:_e,root:Vt,type:At}=b,vi=Ys(y);Hn(b,!1),Oe&&ea(Oe),!vi&&(z=ae&&ae.onVnodeBeforeMount)&&$i(z,_e,y),Hn(b,!0);{Vt.ce&&Vt.ce._injectChildStyle(At);const _i=b.subTree=$p(b);m(null,_i,k,T,b,M,R),y.el=_i.el}if(Ee&&Ut(Ee,M),!vi&&(z=ae&&ae.onVnodeMounted)){const _i=y;Ut(()=>$i(z,_e,_i),M)}(y.shapeFlag&256||_e&&Ys(_e.vnode)&&_e.vnode.shapeFlag&256)&&b.a&&Ut(b.a,M),b.isMounted=!0,y=k=T=null}};b.scope.on();const I=b.effect=new x0(j);b.scope.off();const L=b.update=I.run.bind(I),re=b.job=I.runIfDirty.bind(I);re.i=b,re.id=b.uid,I.scheduler=()=>Hu(re),Hn(b,!0),L()},K=(b,y,k)=>{y.component=b;const T=b.vnode.props;b.vnode=y,b.next=null,Iv(b,y.props,T,k),Bv(b,y.children,k),Vn(),bp(b),Bn()},he=(b,y,k,T,M,R,W,j,I=!1)=>{const L=b&&b.children,re=b?b.shapeFlag:0,z=y.children,{patchFlag:ie,shapeFlag:ae}=y;if(ie>0){if(ie&128){Me(L,z,k,T,M,R,W,j,I);return}else if(ie&256){ye(L,z,k,T,M,R,W,j,I);return}}ae&8?(re&16&&Be(L,M,R),z!==L&&h(k,z)):re&16?ae&16?Me(L,z,k,T,M,R,W,j,I):Be(L,M,R,!0):(re&8&&h(k,""),ae&16&&Z(z,k,T,M,R,W,j,I))},ye=(b,y,k,T,M,R,W,j,I)=>{b=b||qs,y=y||qs;const L=b.length,re=y.length,z=Math.min(L,re);let ie;for(ie=0;iere?Be(b,M,R,!0,!1,z):Z(y,k,T,M,R,W,j,I,z)},Me=(b,y,k,T,M,R,W,j,I)=>{let L=0;const re=y.length;let z=b.length-1,ie=re-1;for(;L<=z&&L<=ie;){const ae=b[L],Oe=y[L]=I?wn(y[L]):Ri(y[L]);if(Lr(ae,Oe))m(ae,Oe,k,null,M,R,W,j,I);else break;L++}for(;L<=z&&L<=ie;){const ae=b[z],Oe=y[ie]=I?wn(y[ie]):Ri(y[ie]);if(Lr(ae,Oe))m(ae,Oe,k,null,M,R,W,j,I);else break;z--,ie--}if(L>z){if(L<=ie){const ae=ie+1,Oe=aeie)for(;L<=z;)we(b[L],M,R,!0),L++;else{const ae=L,Oe=L,Ee=new Map;for(L=Oe;L<=ie;L++){const Bt=y[L]=I?wn(y[L]):Ri(y[L]);Bt.key!=null&&Ee.set(Bt.key,L)}let _e,Vt=0;const At=ie-Oe+1;let vi=!1,_i=0;const Zr=new Array(At);for(L=0;L=At){we(Bt,M,R,!0);continue}let ki;if(Bt.key!=null)ki=Ee.get(Bt.key);else for(_e=Oe;_e<=ie;_e++)if(Zr[_e-Oe]===0&&Lr(Bt,y[_e])){ki=_e;break}ki===void 0?we(Bt,M,R,!0):(Zr[ki-Oe]=L+1,ki>=_i?_i=ki:vi=!0,m(Bt,y[ki],k,null,M,R,W,j,I),Vt++)}const up=vi?zv(Zr):qs;for(_e=up.length-1,L=At-1;L>=0;L--){const Bt=Oe+L,ki=y[Bt],dp=Bt+1{const{el:R,type:W,transition:j,children:I,shapeFlag:L}=b;if(L&6){Xe(b.component.subTree,y,k,T);return}if(L&128){b.suspense.move(y,k,T);return}if(L&64){W.move(b,y,k,ee);return}if(W===ze){n(R,y,k);for(let z=0;zj.enter(R),M);else{const{leave:z,delayLeave:ie,afterLeave:ae}=j,Oe=()=>n(R,y,k),Ee=()=>{z(R,()=>{Oe(),ae&&ae()})};ie?ie(R,Oe,Ee):Ee()}else n(R,y,k)},we=(b,y,k,T=!1,M=!1)=>{const{type:R,props:W,ref:j,children:I,dynamicChildren:L,shapeFlag:re,patchFlag:z,dirs:ie,cacheIndex:ae}=b;if(z===-2&&(M=!1),j!=null&&Qa(j,null,k,b,!0),ae!=null&&(y.renderCache[ae]=void 0),re&256){y.ctx.deactivate(b);return}const Oe=re&1&&ie,Ee=!Ys(b);let _e;if(Ee&&(_e=W&&W.onVnodeBeforeUnmount)&&$i(_e,y,b),re&6)He(b.component,k,T);else{if(re&128){b.suspense.unmount(k,T);return}Oe&&Fn(b,null,y,"beforeUnmount"),re&64?b.type.remove(b,y,k,ee,T):L&&!L.hasOnce&&(R!==ze||z>0&&z&64)?Be(L,y,k,!1,!0):(R===ze&&z&384||!M&&re&16)&&Be(I,y,k),T&&We(b)}(Ee&&(_e=W&&W.onVnodeUnmounted)||Oe)&&Ut(()=>{_e&&$i(_e,y,b),Oe&&Fn(b,null,y,"unmounted")},k)},We=b=>{const{type:y,el:k,anchor:T,transition:M}=b;if(y===ze){qe(k,T);return}if(y===ia){x(b);return}const R=()=>{s(k),M&&!M.persisted&&M.afterLeave&&M.afterLeave()};if(b.shapeFlag&1&&M&&!M.persisted){const{leave:W,delayLeave:j}=M,I=()=>W(k,R);j?j(b.el,R,I):I()}else R()},qe=(b,y)=>{let k;for(;b!==y;)k=u(b),s(b),b=k;s(y)},He=(b,y,k)=>{const{bum:T,scope:M,job:R,subTree:W,um:j,m:I,a:L}=b;kp(I),kp(L),T&&ea(T),M.stop(),R&&(R.flags|=8,we(W,b,y,k)),j&&Ut(j,y),Ut(()=>{b.isUnmounted=!0},y),y&&y.pendingBranch&&!y.isUnmounted&&b.asyncDep&&!b.asyncResolved&&b.suspenseId===y.pendingId&&(y.deps--,y.deps===0&&y.resolve())},Be=(b,y,k,T=!1,M=!1,R=0)=>{for(let W=R;W{if(b.shapeFlag&6)return C(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const y=u(b.anchor||b.el),k=y&&y[uv];return k?u(k):y};let q=!1;const V=(b,y,k)=>{b==null?y._vnode&&we(y._vnode,null,null,!0):m(y._vnode||null,b,y,null,null,null,k),y._vnode=b,q||(q=!0,bp(),V0(),q=!1)},ee={p:m,um:we,m:Xe,r:We,mt:ce,mc:Z,pc:he,pbc:Y,n:C,o:i};return{render:V,hydrate:void 0,createApp:Dv(V)}}function oh({type:i,props:e},t){return t==="svg"&&i==="foreignObject"||t==="mathml"&&i==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Hn({effect:i,job:e},t){t?(i.flags|=32,e.flags|=4):(i.flags&=-33,e.flags&=-5)}function Uv(i,e){return(!i||i&&!i.pendingBranch)&&e&&!e.persisted}function cb(i,e,t=!1){const n=i.children,s=e.children;if(le(n)&&le(s))for(let r=0;r>1,i[t[l]]0&&(e[n]=t[r-1]),t[r]=n)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function hb(i){const e=i.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:hb(e)}function kp(i){if(i)for(let e=0;eHt(Yv);function ht(i,e,t){return fb(i,e,t)}function fb(i,e,t=Ae){const{immediate:n,deep:s,flush:r,once:o}=t,l=wt({},t),a=e&&n||!e&&r!=="post";let c;if(ko){if(r==="sync"){const d=Fv();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!a){const d=()=>{};return d.stop=ji,d.resume=ji,d.pause=ji,d}}const h=ut;l.call=(d,p,m)=>qi(d,h,p,m);let f=!1;r==="post"?l.scheduler=d=>{Ut(d,h&&h.suspense)}:r!=="sync"&&(f=!0,l.scheduler=(d,p)=>{p?d():Hu(d)}),l.augmentJob=d=>{e&&(d.flags|=4),f&&(d.flags|=2,h&&(d.id=h.uid,d.i=h))};const u=av(i,e,l);return ko&&(c?c.push(u):a&&u()),u}function Hv(i,e,t){const n=this.proxy,s=et(i)?i.includes(".")?ub(n,i):()=>n[i]:i.bind(n,n);let r;pe(e)?r=e:(r=e.handler,t=e);const o=Ho(this),l=fb(s,r.bind(n),t);return o(),l}function ub(i,e){const t=e.split(".");return()=>{let n=i;for(let s=0;se==="modelValue"||e==="model-value"?i.modelModifiers:i[`${e}Modifiers`]||i[`${ai(e)}Modifiers`]||i[`${_s(e)}Modifiers`];function Kv(i,e,...t){if(i.isUnmounted)return;const n=i.vnode.props||Ae;let s=t;const r=e.startsWith("update:"),o=r&&Gv(n,e.slice(7));o&&(o.trim&&(s=t.map(h=>et(h)?h.trim():h)),o.number&&(s=t.map(va)));let l,a=n[l=eh(e)]||n[l=eh(ai(e))];!a&&r&&(a=n[l=eh(_s(e))]),a&&qi(a,i,6,s);const c=n[l+"Once"];if(c){if(!i.emitted)i.emitted={};else if(i.emitted[l])return;i.emitted[l]=!0,qi(c,i,6,s)}}function db(i,e,t=!1){const n=e.emitsCache,s=n.get(i);if(s!==void 0)return s;const r=i.emits;let o={},l=!1;if(!pe(i)){const a=c=>{const h=db(c,e,!0);h&&(l=!0,wt(o,h))};!t&&e.mixins.length&&e.mixins.forEach(a),i.extends&&a(i.extends),i.mixins&&i.mixins.forEach(a)}return!r&&!l?(Ne(i)&&n.set(i,null),null):(le(r)?r.forEach(a=>o[a]=null):wt(o,r),Ne(i)&&n.set(i,o),o)}function _c(i,e){return!i||!pc(e)?!1:(e=e.slice(2).replace(/Once$/,""),Qe(i,e[0].toLowerCase()+e.slice(1))||Qe(i,_s(e))||Qe(i,e))}function $p(i){const{type:e,vnode:t,proxy:n,withProxy:s,propsOptions:[r],slots:o,attrs:l,emit:a,render:c,renderCache:h,props:f,data:u,setupState:d,ctx:p,inheritAttrs:m}=i,g=Pa(i);let O,S;try{if(t.shapeFlag&4){const x=s||n,v=x;O=Ri(c.call(v,x,h,f,d,u,p)),S=l}else{const x=e;O=Ri(x.length>1?x(f,{attrs:l,slots:o,emit:a}):x(f,null)),S=e.props?l:Jv(l)}}catch(x){lo.length=0,wc(x,i,1),O=ke(Rn)}let _=O;if(S&&m!==!1){const x=Object.keys(S),{shapeFlag:v}=_;x.length&&v&7&&(r&&x.some(Nu)&&(S=e_(S,r)),_=sr(_,S,!1,!0))}return t.dirs&&(_=sr(_,null,!1,!0),_.dirs=_.dirs?_.dirs.concat(t.dirs):t.dirs),t.transition&&Gu(_,t.transition),O=_,Pa(g),O}const Jv=i=>{let e;for(const t in i)(t==="class"||t==="style"||pc(t))&&((e||(e={}))[t]=i[t]);return e},e_=(i,e)=>{const t={};for(const n in i)(!Nu(n)||!(n.slice(9)in e))&&(t[n]=i[n]);return t};function t_(i,e,t){const{props:n,children:s,component:r}=i,{props:o,children:l,patchFlag:a}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&a>=0){if(a&1024)return!0;if(a&16)return n?Pp(n,o,c):!!o;if(a&8){const h=e.dynamicProps;for(let f=0;fi.__isSuspense;function n_(i,e){e&&e.pendingBranch?le(i)?e.effects.push(...i):e.effects.push(i):fv(i)}const ze=Symbol.for("v-fgt"),kc=Symbol.for("v-txt"),Rn=Symbol.for("v-cmt"),ia=Symbol.for("v-stc"),lo=[];let Yt=null;function oe(i=!1){lo.push(Yt=i?null:[])}function s_(){lo.pop(),Yt=lo[lo.length-1]||null}let vo=1;function Qp(i,e=!1){vo+=i,i<0&&Yt&&e&&(Yt.hasOnce=!0)}function mb(i){return i.dynamicChildren=vo>0?Yt||qs:null,s_(),vo>0&&Yt&&Yt.push(i),i}function de(i,e,t,n,s,r){return mb(E(i,e,t,n,s,r,!0))}function nr(i,e,t,n,s){return mb(ke(i,e,t,n,s,!0))}function _o(i){return i?i.__v_isVNode===!0:!1}function Lr(i,e){return i.type===e.type&&i.key===e.key}const gb=({key:i})=>i??null,na=({ref:i,ref_key:e,ref_for:t})=>(typeof i=="number"&&(i=""+i),i!=null?et(i)||Ye(i)||pe(i)?{i:lt,r:i,k:e,f:!!t}:i:null);function E(i,e=null,t=null,n=0,s=null,r=i===ze?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:i,props:e,key:e&&gb(e),ref:e&&na(e),scopeId:W0,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:n,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:lt};return l?(Ju(a,t),r&128&&i.normalize(a)):t&&(a.shapeFlag|=et(t)?8:16),vo>0&&!o&&Yt&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&Yt.push(a),a}const ke=r_;function r_(i,e=null,t=null,n=0,s=null,r=!1){if((!i||i===$v)&&(i=Rn),_o(i)){const l=sr(i,e,!0);return t&&Ju(l,t),vo>0&&!r&&Yt&&(l.shapeFlag&6?Yt[Yt.indexOf(i)]=l:Yt.push(l)),l.patchFlag=-2,l}if(O_(i)&&(i=i.__vccOpts),e){e=o_(e);let{class:l,style:a}=e;l&&!et(l)&&(e.class=rn(l)),Ne(a)&&(Yu(a)&&!le(a)&&(a=wt({},a)),e.style=Xu(a))}const o=et(i)?1:pb(i)?128:dv(i)?64:Ne(i)?4:pe(i)?2:0;return E(i,e,t,n,s,o,r,!0)}function o_(i){return i?Yu(i)||ib(i)?wt({},i):i:null}function sr(i,e,t=!1,n=!1){const{props:s,ref:r,patchFlag:o,children:l,transition:a}=i,c=e?a_(s||{},e):s,h={__v_isVNode:!0,__v_skip:!0,type:i.type,props:c,key:c&&gb(c),ref:e&&e.ref?t&&r?le(r)?r.concat(na(e)):[r,na(e)]:na(e):r,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:l,target:i.target,targetStart:i.targetStart,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:e&&i.type!==ze?o===-1?16:o|16:o,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:a,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&sr(i.ssContent),ssFallback:i.ssFallback&&sr(i.ssFallback),el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce};return a&&n&&Gu(h,a.clone(h)),h}function on(i=" ",e=0){return ke(kc,null,i,e)}function l_(i,e){const t=ke(ia,null,i);return t.staticCount=e,t}function rr(i="",e=!1){return e?(oe(),nr(Rn,null,i)):ke(Rn,null,i)}function Ri(i){return i==null||typeof i=="boolean"?ke(Rn):le(i)?ke(ze,null,i.slice()):_o(i)?wn(i):ke(kc,null,String(i))}function wn(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:sr(i)}function Ju(i,e){let t=0;const{shapeFlag:n}=i;if(e==null)e=null;else if(le(e))t=16;else if(typeof e=="object")if(n&65){const s=e.default;s&&(s._c&&(s._d=!1),Ju(i,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!ib(e)?e._ctx=lt:s===3&<&&(lt.slots._===1?e._=1:(e._=2,i.patchFlag|=1024))}else pe(e)?(e={default:e,_ctx:lt},t=32):(e=String(e),n&64?(t=16,e=[on(e)]):t=8);i.children=e,i.shapeFlag|=t}function a_(...i){const e={};for(let t=0;t{let s;return(s=i[t])||(s=i[t]=[]),s.push(n),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};Ca=e("__VUE_INSTANCE_SETTERS__",t=>ut=t),Of=e("__VUE_SSR_SETTERS__",t=>ko=t)}const Ho=i=>{const e=ut;return Ca(i),i.scope.on(),()=>{i.scope.off(),Ca(e)}},Ep=()=>{ut&&ut.scope.off(),Ca(null)};function Ob(i){return i.vnode.shapeFlag&4}let ko=!1;function u_(i,e=!1,t=!1){e&&Of(e);const{props:n,children:s}=i.vnode,r=Ob(i);Nv(i,n,r,e),Vv(i,s,t);const o=r?d_(i,e):void 0;return e&&Of(!1),o}function d_(i,e){const t=i.type;i.accessCache=Object.create(null),i.proxy=new Proxy(i.ctx,Ev);const{setup:n}=t;if(n){Vn();const s=i.setupContext=n.length>1?m_(i):null,r=Ho(i),o=Fo(n,i,0,[i.props,s]),l=u0(o);if(Bn(),r(),(l||i.sp)&&!Ys(i)&&q0(i),l){if(o.then(Ep,Ep),e)return o.then(a=>{Cp(i,a)}).catch(a=>{wc(a,i,0)});i.asyncDep=o}else Cp(i,o)}else bb(i)}function Cp(i,e,t){pe(e)?i.type.__ssrInlineRender?i.ssrRender=e:i.render=e:Ne(e)&&(i.setupState=I0(e)),bb(i)}function bb(i,e,t){const n=i.type;i.render||(i.render=n.render||ji);{const s=Ho(i);Vn();try{Cv(i)}finally{Bn(),s()}}}const p_={get(i,e){return Ot(i,"get",""),i[e]}};function m_(i){const e=t=>{i.exposed=t||{}};return{attrs:new Proxy(i.attrs,p_),slots:i.slots,emit:i.emit,expose:e}}function $c(i){return i.exposed?i.exposeProxy||(i.exposeProxy=new Proxy(I0(Fu(i.exposed)),{get(e,t){if(t in e)return e[t];if(t in oo)return oo[t](i)},has(e,t){return t in e||t in oo}})):i.proxy}function g_(i,e=!0){return pe(i)?i.displayName||i.name:i.name||e&&i.__name}function O_(i){return pe(i)&&"__vccOpts"in i}const dt=(i,e)=>ov(i,e,ko);function ed(i,e,t){const n=arguments.length;return n===2?Ne(e)&&!le(e)?_o(e)?ke(i,null,[e]):ke(i,e):ke(i,null,e):(n>3?t=Array.prototype.slice.call(arguments,2):n===3&&_o(t)&&(t=[t]),ke(i,e,t))}const b_="3.5.13";/** * @vue/runtime-dom v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let bf;const Ap=typeof window<"u"&&window.trustedTypes;if(Ap)try{bf=Ap.createPolicy("vue",{createHTML:i=>i})}catch{}const yb=bf?i=>bf.createHTML(i):i=>i,y_="http://www.w3.org/2000/svg",S_="http://www.w3.org/1998/Math/MathML",Ji=typeof document<"u"?document:null,Tp=Ji&&Ji.createElement("template"),w_={insert:(i,e,t)=>{e.insertBefore(i,t||null)},remove:i=>{const e=i.parentNode;e&&e.removeChild(i)},createElement:(i,e,t,n)=>{const s=e==="svg"?Ji.createElementNS(y_,i):e==="mathml"?Ji.createElementNS(S_,i):t?Ji.createElement(i,{is:t}):Ji.createElement(i);return i==="select"&&n&&n.multiple!=null&&s.setAttribute("multiple",n.multiple),s},createText:i=>Ji.createTextNode(i),createComment:i=>Ji.createComment(i),setText:(i,e)=>{i.nodeValue=e},setElementText:(i,e)=>{i.textContent=e},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>Ji.querySelector(i),setScopeId(i,e){i.setAttribute(e,"")},insertStaticContent(i,e,t,n,s,r){const o=t?t.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===r||!(s=s.nextSibling)););else{Tp.innerHTML=yb(n==="svg"?`${i}`:n==="mathml"?`${i}`:i);const l=Tp.content;if(n==="svg"||n==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}e.insertBefore(l,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},x_=Symbol("_vtc");function v_(i,e,t){const n=i[x_];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?i.removeAttribute("class"):t?i.setAttribute("class",e):i.className=e}const Rp=Symbol("_vod"),__=Symbol("_vsh"),k_=Symbol(""),$_=/(^|;)\s*display\s*:/;function P_(i,e,t){const n=i.style,s=et(t);let r=!1;if(t&&!s){if(e)if(et(e))for(const o of e.split(";")){const l=o.slice(0,o.indexOf(":")).trim();t[l]==null&&sa(n,l,"")}else for(const o in e)t[o]==null&&sa(n,o,"");for(const o in t)o==="display"&&(r=!0),sa(n,o,t[o])}else if(s){if(e!==t){const o=n[k_];o&&(t+=";"+o),n.cssText=t,r=$_.test(t)}}else e&&i.removeAttribute("style");Rp in i&&(i[Rp]=r?n.display:"",i[__]&&(n.display="none"))}const Mp=/\s*!important$/;function sa(i,e,t){if(le(t))t.forEach(n=>sa(i,e,n));else if(t==null&&(t=""),e.startsWith("--"))i.setProperty(e,t);else{const n=Q_(i,e);Mp.test(t)?i.setProperty(_s(n),t.replace(Mp,""),"important"):i[n]=t}}const Zp=["Webkit","Moz","ms"],lh={};function Q_(i,e){const t=lh[e];if(t)return t;let n=ai(e);if(n!=="filter"&&n in i)return lh[e]=n;n=Oc(n);for(let s=0;sah||(T_.then(()=>ah=0),ah=Date.now());function M_(i,e){const t=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=t.attached)return;qi(Z_(n,t.value),e,5,[n])};return t.value=i,t.attached=R_(),t}function Z_(i,e){if(le(e)){const t=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{t.call(i),i._stopped=!0},e.map(n=>s=>!s._stopped&&n&&n(s))}else return e}const Xp=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&i.charCodeAt(2)>96&&i.charCodeAt(2)<123,D_=(i,e,t,n,s,r)=>{const o=s==="svg";e==="class"?v_(i,n,o):e==="style"?P_(i,t,n):pc(e)?Nu(e)||C_(i,e,t,n,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):L_(i,e,n,o))?(Np(i,e,n),!i.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Lp(i,e,n,o,r,e!=="value")):i._isVueCE&&(/[A-Z]/.test(e)||!et(n))?Np(i,ai(e),n,r,e):(e==="true-value"?i._trueValue=n:e==="false-value"&&(i._falseValue=n),Lp(i,e,n,o))};function L_(i,e,t,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in i&&Xp(e)&&pe(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&i.tagName==="INPUT"||e==="type"&&i.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=i.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Xp(e)&&et(t)?!1:e in i}const Aa=i=>{const e=i.props["onUpdate:modelValue"]||!1;return le(e)?t=>ea(e,t):e};function N_(i){i.target.composing=!0}function Vp(i){const e=i.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Fs=Symbol("_assign"),$o={created(i,{modifiers:{lazy:e,trim:t,number:n}},s){i[Fs]=Aa(s);const r=n||s.props&&s.props.type==="number";Jn(i,e?"change":"input",o=>{if(o.target.composing)return;let l=i.value;t&&(l=l.trim()),r&&(l=va(l)),i[Fs](l)}),t&&Jn(i,"change",()=>{i.value=i.value.trim()}),e||(Jn(i,"compositionstart",N_),Jn(i,"compositionend",Vp),Jn(i,"change",Vp))},mounted(i,{value:e}){i.value=e??""},beforeUpdate(i,{value:e,oldValue:t,modifiers:{lazy:n,trim:s,number:r}},o){if(i[Fs]=Aa(o),i.composing)return;const l=(r||i.type==="number")&&!/^0\d/.test(i.value)?va(i.value):i.value,a=e??"";l!==a&&(document.activeElement===i&&i.type!=="range"&&(n&&e===t||s&&i.value.trim()===a)||(i.value=a))}},yf={deep:!0,created(i,{value:e,modifiers:{number:t}},n){const s=mc(e);Jn(i,"change",()=>{const r=Array.prototype.filter.call(i.options,o=>o.selected).map(o=>t?va(Ta(o)):Ta(o));i[Fs](i.multiple?s?new Set(r):r:r[0]),i._assigning=!0,xc(()=>{i._assigning=!1})}),i[Fs]=Aa(n)},mounted(i,{value:e}){Bp(i,e)},beforeUpdate(i,e,t){i[Fs]=Aa(t)},updated(i,{value:e}){i._assigning||Bp(i,e)}};function Bp(i,e){const t=i.multiple,n=le(e);if(!(t&&!n&&!mc(e))){for(let s=0,r=i.options.length;sString(c)===String(l)):o.selected=Rx(e,l)>-1}else o.selected=e.has(l);else if(yc(Ta(o),e)){i.selectedIndex!==s&&(i.selectedIndex=s);return}}!t&&i.selectedIndex!==-1&&(i.selectedIndex=-1)}}function Ta(i){return"_value"in i?i._value:i.value}const I_=["ctrl","shift","alt","meta"],j_={stop:i=>i.stopPropagation(),prevent:i=>i.preventDefault(),self:i=>i.target!==i.currentTarget,ctrl:i=>!i.ctrlKey,shift:i=>!i.shiftKey,alt:i=>!i.altKey,meta:i=>!i.metaKey,left:i=>"button"in i&&i.button!==0,middle:i=>"button"in i&&i.button!==1,right:i=>"button"in i&&i.button!==2,exact:(i,e)=>I_.some(t=>i[`${t}Key`]&&!e.includes(t))},ao=(i,e)=>{const t=i._withMods||(i._withMods={}),n=e.join(".");return t[n]||(t[n]=(s,...r)=>{for(let o=0;o{const e=V_().createApp(...i),{mount:t}=e;return e.mount=n=>{const s=q_(n);if(!s)return;const r=e._component;!pe(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,W_(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e};function W_(i){if(i instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&i instanceof MathMLElement)return"mathml"}function q_(i){return et(i)?document.querySelector(i):i}/*! * pinia v2.3.0 * (c) 2024 Eduardo San Martin Morote * @license MIT */let Sb;const Pc=i=>Sb=i,wb=Symbol();function Sf(i){return i&&typeof i=="object"&&Object.prototype.toString.call(i)==="[object Object]"&&typeof i.toJSON!="function"}var co;(function(i){i.direct="direct",i.patchObject="patch object",i.patchFunction="patch function"})(co||(co={}));function U_(){const i=S0(!0),e=i.run(()=>Te({}));let t=[],n=[];const s=Fu({install(r){Pc(s),s._a=r,r.provide(wb,s),r.config.globalProperties.$pinia=s,n.forEach(o=>t.push(o)),n=[]},use(r){return this._a?t.push(r):n.push(r),this},_p:t,_a:null,_e:i,_s:new Map,state:e});return s}const xb=()=>{};function qp(i,e,t,n=xb){i.push(e);const s=()=>{const r=i.indexOf(e);r>-1&&(i.splice(r,1),n())};return!t&&w0()&&Mx(s),s}function Es(i,...e){i.slice().forEach(t=>{t(...e)})}const z_=i=>i(),Up=Symbol(),ch=Symbol();function wf(i,e){i instanceof Map&&e instanceof Map?e.forEach((t,n)=>i.set(n,t)):i instanceof Set&&e instanceof Set&&e.forEach(i.add,i);for(const t in e){if(!e.hasOwnProperty(t))continue;const n=e[t],s=i[t];Sf(s)&&Sf(n)&&i.hasOwnProperty(t)&&!Ye(n)&&!An(n)?i[t]=wf(s,n):i[t]=n}return i}const Y_=Symbol();function F_(i){return!Sf(i)||!i.hasOwnProperty(Y_)}const{assign:yn}=Object;function H_(i){return!!(Ye(i)&&i.effect)}function G_(i,e,t,n){const{state:s,actions:r,getters:o}=e,l=t.state.value[i];let a;function c(){l||(t.state.value[i]=s?s():{});const h=iv(t.state.value[i]);return yn(h,r,Object.keys(o||{}).reduce((f,u)=>(f[u]=Fu(dt(()=>{Pc(t);const d=t._s.get(i);return o[u].call(d,d)})),f),{}))}return a=vb(i,c,e,t,n,!0),a}function vb(i,e,t={},n,s,r){let o;const l=yn({actions:{}},t),a={deep:!0};let c,h,f=[],u=[],d;const p=n.state.value[i];!r&&!p&&(n.state.value[i]={}),Te({});let m;function g(Z){let N;c=h=!1,typeof Z=="function"?(Z(n.state.value[i]),N={type:co.patchFunction,storeId:i,events:d}):(wf(n.state.value[i],Z),N={type:co.patchObject,payload:Z,storeId:i,events:d});const Y=m=Symbol();xc().then(()=>{m===Y&&(c=!0)}),h=!0,Es(f,N,n.state.value[i])}const O=r?function(){const{state:N}=t,Y=N?N():{};this.$patch(H=>{yn(H,Y)})}:xb;function S(){o.stop(),f=[],u=[],n._s.delete(i)}const _=(Z,N="")=>{if(Up in Z)return Z[ch]=N,Z;const Y=function(){Pc(n);const H=Array.from(arguments),B=[],J=[];function ce(K){B.push(K)}function ue(K){J.push(K)}Es(u,{args:H,name:Y[ch],store:v,after:ce,onError:ue});let ne;try{ne=Z.apply(this&&this.$id===i?this:v,H)}catch(K){throw Es(J,K),K}return ne instanceof Promise?ne.then(K=>(Es(B,K),K)).catch(K=>(Es(J,K),Promise.reject(K))):(Es(B,ne),ne)};return Y[Up]=!0,Y[ch]=N,Y},x={_p:n,$id:i,$onAction:qp.bind(null,u),$patch:g,$reset:O,$subscribe(Z,N={}){const Y=qp(f,Z,N.detached,()=>H()),H=o.run(()=>ht(()=>n.state.value[i],B=>{(N.flush==="sync"?h:c)&&Z({storeId:i,type:co.direct,events:d},B)},yn({},a,N)));return Y},$dispose:S},v=Yo(x);n._s.set(i,v);const P=(n._a&&n._a.runWithContext||z_)(()=>n._e.run(()=>(o=S0()).run(()=>e({action:_}))));for(const Z in P){const N=P[Z];if(Ye(N)&&!H_(N)||An(N))r||(p&&F_(N)&&(Ye(N)?N.value=p[Z]:wf(N,p[Z])),n.state.value[i][Z]=N);else if(typeof N=="function"){const Y=_(N,Z);P[Z]=Y,l.actions[Z]=N}}return yn(v,P),yn(xe(v),P),Object.defineProperty(v,"$state",{get:()=>n.state.value[i],set:Z=>{g(N=>{yn(N,Z)})}}),n._p.forEach(Z=>{yn(v,o.run(()=>Z({store:v,app:n._a,pinia:n,options:l})))}),p&&r&&t.hydrate&&t.hydrate(v.$state,p),c=!0,h=!0,v}/*! #__NO_SIDE_EFFECTS__ */function K_(i,e,t){let n,s;const r=typeof e=="function";n=i,s=r?t:e;function o(l,a){const c=Lv();return l=l||(c?Ht(wb,null):null),l&&Pc(l),l=Sb,l._s.has(n)||(r?vb(n,e,s,l):G_(n,s,l)),l._s.get(n)}return o.$id=n,o}/*! * vue-router v4.5.0 * (c) 2024 Eduardo San Martin Morote * @license MIT */const Ms=typeof document<"u";function _b(i){return typeof i=="object"||"displayName"in i||"props"in i||"__vccOpts"in i}function J_(i){return i.__esModule||i[Symbol.toStringTag]==="Module"||i.default&&_b(i.default)}const Pe=Object.assign;function hh(i,e){const t={};for(const n in e){const s=e[n];t[n]=Oi(s)?s.map(i):i(s)}return t}const ho=()=>{},Oi=Array.isArray,kb=/#/g,ek=/&/g,tk=/\//g,ik=/=/g,nk=/\?/g,$b=/\+/g,sk=/%5B/g,rk=/%5D/g,Pb=/%5E/g,ok=/%60/g,Qb=/%7B/g,lk=/%7C/g,Eb=/%7D/g,ak=/%20/g;function td(i){return encodeURI(""+i).replace(lk,"|").replace(sk,"[").replace(rk,"]")}function ck(i){return td(i).replace(Qb,"{").replace(Eb,"}").replace(Pb,"^")}function xf(i){return td(i).replace($b,"%2B").replace(ak,"+").replace(kb,"%23").replace(ek,"%26").replace(ok,"`").replace(Qb,"{").replace(Eb,"}").replace(Pb,"^")}function hk(i){return xf(i).replace(ik,"%3D")}function fk(i){return td(i).replace(kb,"%23").replace(nk,"%3F")}function uk(i){return i==null?"":fk(i).replace(tk,"%2F")}function Po(i){try{return decodeURIComponent(""+i)}catch{}return""+i}const dk=/\/$/,pk=i=>i.replace(dk,"");function fh(i,e,t="/"){let n,s={},r="",o="";const l=e.indexOf("#");let a=e.indexOf("?");return l=0&&(a=-1),a>-1&&(n=e.slice(0,a),r=e.slice(a+1,l>-1?l:e.length),s=i(r)),l>-1&&(n=n||e.slice(0,l),o=e.slice(l,e.length)),n=bk(n??e,t),{fullPath:n+(r&&"?")+r+o,path:n,query:s,hash:Po(o)}}function mk(i,e){const t=e.query?i(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function zp(i,e){return!e||!i.toLowerCase().startsWith(e.toLowerCase())?i:i.slice(e.length)||"/"}function gk(i,e,t){const n=e.matched.length-1,s=t.matched.length-1;return n>-1&&n===s&&or(e.matched[n],t.matched[s])&&Cb(e.params,t.params)&&i(e.query)===i(t.query)&&e.hash===t.hash}function or(i,e){return(i.aliasOf||i)===(e.aliasOf||e)}function Cb(i,e){if(Object.keys(i).length!==Object.keys(e).length)return!1;for(const t in i)if(!Ok(i[t],e[t]))return!1;return!0}function Ok(i,e){return Oi(i)?Yp(i,e):Oi(e)?Yp(e,i):i===e}function Yp(i,e){return Oi(e)?i.length===e.length&&i.every((t,n)=>t===e[n]):i.length===1&&i[0]===e}function bk(i,e){if(i.startsWith("/"))return i;if(!i)return e;const t=e.split("/"),n=i.split("/"),s=n[n.length-1];(s===".."||s===".")&&n.push("");let r=t.length-1,o,l;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+n.slice(o).join("/")}const On={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Qo;(function(i){i.pop="pop",i.push="push"})(Qo||(Qo={}));var fo;(function(i){i.back="back",i.forward="forward",i.unknown=""})(fo||(fo={}));function yk(i){if(!i)if(Ms){const e=document.querySelector("base");i=e&&e.getAttribute("href")||"/",i=i.replace(/^\w+:\/\/[^\/]+/,"")}else i="/";return i[0]!=="/"&&i[0]!=="#"&&(i="/"+i),pk(i)}const Sk=/^[^#]+#/;function wk(i,e){return i.replace(Sk,"#")+e}function xk(i,e){const t=document.documentElement.getBoundingClientRect(),n=i.getBoundingClientRect();return{behavior:e.behavior,left:n.left-t.left-(e.left||0),top:n.top-t.top-(e.top||0)}}const Qc=()=>({left:window.scrollX,top:window.scrollY});function vk(i){let e;if("el"in i){const t=i.el,n=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?n?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=xk(s,i)}else e=i;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Fp(i,e){return(history.state?history.state.position-e:-1)+i}const vf=new Map;function _k(i,e){vf.set(i,e)}function kk(i){const e=vf.get(i);return vf.delete(i),e}let $k=()=>location.protocol+"//"+location.host;function Ab(i,e){const{pathname:t,search:n,hash:s}=e,r=i.indexOf("#");if(r>-1){let l=s.includes(i.slice(r))?i.slice(r).length:1,a=s.slice(l);return a[0]!=="/"&&(a="/"+a),zp(a,"")}return zp(t,i)+n+s}function Pk(i,e,t,n){let s=[],r=[],o=null;const l=({state:u})=>{const d=Ab(i,location),p=t.value,m=e.value;let g=0;if(u){if(t.value=d,e.value=u,o&&o===p){o=null;return}g=m?u.position-m.position:0}else n(d);s.forEach(O=>{O(t.value,p,{delta:g,type:Qo.pop,direction:g?g>0?fo.forward:fo.back:fo.unknown})})};function a(){o=t.value}function c(u){s.push(u);const d=()=>{const p=s.indexOf(u);p>-1&&s.splice(p,1)};return r.push(d),d}function h(){const{history:u}=window;u.state&&u.replaceState(Pe({},u.state,{scroll:Qc()}),"")}function f(){for(const u of r)u();r=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",h)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",h,{passive:!0}),{pauseListeners:a,listen:c,destroy:f}}function Hp(i,e,t,n=!1,s=!1){return{back:i,current:e,forward:t,replaced:n,position:window.history.length,scroll:s?Qc():null}}function Qk(i){const{history:e,location:t}=window,n={value:Ab(i,t)},s={value:e.state};s.value||r(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(a,c,h){const f=i.indexOf("#"),u=f>-1?(t.host&&document.querySelector("base")?i:i.slice(f))+a:$k()+i+a;try{e[h?"replaceState":"pushState"](c,"",u),s.value=c}catch(d){console.error(d),t[h?"replace":"assign"](u)}}function o(a,c){const h=Pe({},e.state,Hp(s.value.back,a,s.value.forward,!0),c,{position:s.value.position});r(a,h,!0),n.value=a}function l(a,c){const h=Pe({},s.value,e.state,{forward:a,scroll:Qc()});r(h.current,h,!0);const f=Pe({},Hp(n.value,a,null),{position:h.position+1},c);r(a,f,!1),n.value=a}return{location:n,state:s,push:l,replace:o}}function Ek(i){i=yk(i);const e=Qk(i),t=Pk(i,e.state,e.location,e.replace);function n(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=Pe({location:"",base:i,go:n,createHref:wk.bind(null,i)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function Ck(i){return typeof i=="string"||i&&typeof i=="object"}function Tb(i){return typeof i=="string"||typeof i=="symbol"}const Rb=Symbol("");var Gp;(function(i){i[i.aborted=4]="aborted",i[i.cancelled=8]="cancelled",i[i.duplicated=16]="duplicated"})(Gp||(Gp={}));function lr(i,e){return Pe(new Error,{type:i,[Rb]:!0},e)}function Ki(i,e){return i instanceof Error&&Rb in i&&(e==null||!!(i.type&e))}const Kp="[^/]+?",Ak={sensitive:!1,strict:!1,start:!0,end:!0},Tk=/[.+*?^${}()[\]/\\]/g;function Rk(i,e){const t=Pe({},Ak,e),n=[];let s=t.start?"^":"";const r=[];for(const c of i){const h=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function Mb(i,e){let t=0;const n=i.score,s=e.score;for(;t0&&e[e.length-1]<0}const Zk={type:0,value:""},Dk=/[a-zA-Z0-9_]/;function Lk(i){if(!i)return[[]];if(i==="/")return[[Zk]];if(!i.startsWith("/"))throw new Error(`Invalid path "${i}"`);function e(d){throw new Error(`ERR (${t})/"${c}": ${d}`)}let t=0,n=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let l=0,a,c="",h="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(a==="*"||a==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:h,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):e("Invalid state to consume buffer"),c="")}function u(){c+=a}for(;l{o(_)}:ho}function o(f){if(Tb(f)){const u=n.get(f);u&&(n.delete(f),t.splice(t.indexOf(u),1),u.children.forEach(o),u.alias.forEach(o))}else{const u=t.indexOf(f);u>-1&&(t.splice(u,1),f.record.name&&n.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function l(){return t}function a(f){const u=Vk(f,t);t.splice(u,0,f),f.record.name&&!im(f)&&n.set(f.record.name,f)}function c(f,u){let d,p={},m,g;if("name"in f&&f.name){if(d=n.get(f.name),!d)throw lr(1,{location:f});g=d.record.name,p=Pe(em(u.params,d.keys.filter(_=>!_.optional).concat(d.parent?d.parent.keys.filter(_=>_.optional):[]).map(_=>_.name)),f.params&&em(f.params,d.keys.map(_=>_.name))),m=d.stringify(p)}else if(f.path!=null)m=f.path,d=t.find(_=>_.re.test(m)),d&&(p=d.parse(m),g=d.record.name);else{if(d=u.name?n.get(u.name):t.find(_=>_.re.test(u.path)),!d)throw lr(1,{location:f,currentLocation:u});g=d.record.name,p=Pe({},u.params,f.params),m=d.stringify(p)}const O=[];let S=d;for(;S;)O.unshift(S.record),S=S.parent;return{name:g,path:m,params:p,matched:O,meta:Xk(O)}}i.forEach(f=>r(f));function h(){t.length=0,n.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:h,getRoutes:l,getRecordMatcher:s}}function em(i,e){const t={};for(const n of e)n in i&&(t[n]=i[n]);return t}function tm(i){const e={path:i.path,redirect:i.redirect,name:i.name,meta:i.meta||{},aliasOf:i.aliasOf,beforeEnter:i.beforeEnter,props:jk(i),children:i.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in i?i.components||null:i.component&&{default:i.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function jk(i){const e={},t=i.props||!1;if("component"in i)e.default=t;else for(const n in i.components)e[n]=typeof t=="object"?t[n]:t;return e}function im(i){for(;i;){if(i.record.aliasOf)return!0;i=i.parent}return!1}function Xk(i){return i.reduce((e,t)=>Pe(e,t.meta),{})}function nm(i,e){const t={};for(const n in i)t[n]=n in e?e[n]:i[n];return t}function Vk(i,e){let t=0,n=e.length;for(;t!==n;){const r=t+n>>1;Mb(i,e[r])<0?n=r:t=r+1}const s=Bk(i);return s&&(n=e.lastIndexOf(s,n-1)),n}function Bk(i){let e=i;for(;e=e.parent;)if(Zb(e)&&Mb(i,e)===0)return e}function Zb({record:i}){return!!(i.name||i.components&&Object.keys(i.components).length||i.redirect)}function Wk(i){const e={};if(i===""||i==="?")return e;const n=(i[0]==="?"?i.slice(1):i).split("&");for(let s=0;sr&&xf(r)):[n&&xf(n)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function qk(i){const e={};for(const t in i){const n=i[t];n!==void 0&&(e[t]=Oi(n)?n.map(s=>s==null?null:""+s):n==null?n:""+n)}return e}const Uk=Symbol(""),rm=Symbol(""),Ec=Symbol(""),id=Symbol(""),_f=Symbol("");function Nr(){let i=[];function e(n){return i.push(n),()=>{const s=i.indexOf(n);s>-1&&i.splice(s,1)}}function t(){i=[]}return{add:e,list:()=>i.slice(),reset:t}}function xn(i,e,t,n,s,r=o=>o()){const o=n&&(n.enterCallbacks[s]=n.enterCallbacks[s]||[]);return()=>new Promise((l,a)=>{const c=u=>{u===!1?a(lr(4,{from:t,to:e})):u instanceof Error?a(u):Ck(u)?a(lr(2,{from:e,to:u})):(o&&n.enterCallbacks[s]===o&&typeof u=="function"&&o.push(u),l())},h=r(()=>i.call(n&&n.instances[s],e,t,c));let f=Promise.resolve(h);i.length<3&&(f=f.then(c)),f.catch(u=>a(u))})}function uh(i,e,t,n,s=r=>r()){const r=[];for(const o of i)for(const l in o.components){let a=o.components[l];if(!(e!=="beforeRouteEnter"&&!o.instances[l]))if(_b(a)){const h=(a.__vccOpts||a)[e];h&&r.push(xn(h,t,n,o,l,s))}else{let c=a();r.push(()=>c.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${l}" at "${o.path}"`);const f=J_(h)?h.default:h;o.mods[l]=h,o.components[l]=f;const d=(f.__vccOpts||f)[e];return d&&xn(d,t,n,o,l,s)()}))}}return r}function om(i){const e=Ht(Ec),t=Ht(id),n=dt(()=>{const a=Xi(i.to);return e.resolve(a)}),s=dt(()=>{const{matched:a}=n.value,{length:c}=a,h=a[c-1],f=t.matched;if(!h||!f.length)return-1;const u=f.findIndex(or.bind(null,h));if(u>-1)return u;const d=lm(a[c-2]);return c>1&&lm(h)===d&&f[f.length-1].path!==d?f.findIndex(or.bind(null,a[c-2])):u}),r=dt(()=>s.value>-1&&Hk(t.params,n.value.params)),o=dt(()=>s.value>-1&&s.value===t.matched.length-1&&Cb(t.params,n.value.params));function l(a={}){if(Fk(a)){const c=e[Xi(i.replace)?"replace":"push"](Xi(i.to)).catch(ho);return i.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:n,href:dt(()=>n.value.href),isActive:r,isExactActive:o,navigate:l}}function zk(i){return i.length===1?i[0]:i}const Yk=it({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:om,setup(i,{slots:e}){const t=Yo(om(i)),{options:n}=Ht(Ec),s=dt(()=>({[am(i.activeClass,n.linkActiveClass,"router-link-active")]:t.isActive,[am(i.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&zk(e.default(t));return i.custom?r:ed("a",{"aria-current":t.isExactActive?i.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),Db=Yk;function Fk(i){if(!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)&&!i.defaultPrevented&&!(i.button!==void 0&&i.button!==0)){if(i.currentTarget&&i.currentTarget.getAttribute){const e=i.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return i.preventDefault&&i.preventDefault(),!0}}function Hk(i,e){for(const t in e){const n=e[t],s=i[t];if(typeof n=="string"){if(n!==s)return!1}else if(!Oi(s)||s.length!==n.length||n.some((r,o)=>r!==s[o]))return!1}return!0}function lm(i){return i?i.aliasOf?i.aliasOf.path:i.path:""}const am=(i,e,t)=>i??e??t,Gk=it({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(i,{attrs:e,slots:t}){const n=Ht(_f),s=dt(()=>i.route||n.value),r=Ht(rm,0),o=dt(()=>{let c=Xi(r);const{matched:h}=s.value;let f;for(;(f=h[c])&&!f.components;)c++;return c}),l=dt(()=>s.value.matched[o.value]);ta(rm,dt(()=>o.value+1)),ta(Uk,l),ta(_f,s);const a=Te();return ht(()=>[a.value,l.value,i.name],([c,h,f],[u,d,p])=>{h&&(h.instances[f]=c,d&&d!==h&&c&&c===u&&(h.leaveGuards.size||(h.leaveGuards=d.leaveGuards),h.updateGuards.size||(h.updateGuards=d.updateGuards))),c&&h&&(!d||!or(h,d)||!u)&&(h.enterCallbacks[f]||[]).forEach(m=>m(c))},{flush:"post"}),()=>{const c=s.value,h=i.name,f=l.value,u=f&&f.components[h];if(!u)return cm(t.default,{Component:u,route:c});const d=f.props[h],p=d?d===!0?c.params:typeof d=="function"?d(c):d:null,g=ed(u,Pe({},p,e,{onVnodeUnmounted:O=>{O.component.isUnmounted&&(f.instances[h]=null)},ref:a}));return cm(t.default,{Component:g,route:c})||g}}});function cm(i,e){if(!i)return null;const t=i(e);return t.length===1?t[0]:t}const Lb=Gk;function Kk(i){const e=Ik(i.routes,i),t=i.parseQuery||Wk,n=i.stringifyQuery||sm,s=i.history,r=Nr(),o=Nr(),l=Nr(),a=ro(On);let c=On;Ms&&i.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const h=hh.bind(null,C=>""+C),f=hh.bind(null,uk),u=hh.bind(null,Po);function d(C,q){let V,ee;return Tb(C)?(V=e.getRecordMatcher(C),ee=q):ee=C,e.addRoute(ee,V)}function p(C){const q=e.getRecordMatcher(C);q&&e.removeRoute(q)}function m(){return e.getRoutes().map(C=>C.record)}function g(C){return!!e.getRecordMatcher(C)}function O(C,q){if(q=Pe({},q||a.value),typeof C=="string"){const k=fh(t,C,q.path),T=e.resolve({path:k.path},q),M=s.createHref(k.fullPath);return Pe(k,T,{params:u(T.params),hash:Po(k.hash),redirectedFrom:void 0,href:M})}let V;if(C.path!=null)V=Pe({},C,{path:fh(t,C.path,q.path).path});else{const k=Pe({},C.params);for(const T in k)k[T]==null&&delete k[T];V=Pe({},C,{params:f(k)}),q.params=f(q.params)}const ee=e.resolve(V,q),$e=C.hash||"";ee.params=h(u(ee.params));const b=mk(n,Pe({},C,{hash:ck($e),path:ee.path})),y=s.createHref(b);return Pe({fullPath:b,hash:$e,query:n===sm?qk(C.query):C.query||{}},ee,{redirectedFrom:void 0,href:y})}function S(C){return typeof C=="string"?fh(t,C,a.value.path):Pe({},C)}function _(C,q){if(c!==C)return lr(8,{from:q,to:C})}function x(C){return P(C)}function v(C){return x(Pe(S(C),{replace:!0}))}function $(C){const q=C.matched[C.matched.length-1];if(q&&q.redirect){const{redirect:V}=q;let ee=typeof V=="function"?V(C):V;return typeof ee=="string"&&(ee=ee.includes("?")||ee.includes("#")?ee=S(ee):{path:ee},ee.params={}),Pe({query:C.query,hash:C.hash,params:ee.path!=null?{}:C.params},ee)}}function P(C,q){const V=c=O(C),ee=a.value,$e=C.state,b=C.force,y=C.replace===!0,k=$(V);if(k)return P(Pe(S(k),{state:typeof k=="object"?Pe({},$e,k.state):$e,force:b,replace:y}),q||V);const T=V;T.redirectedFrom=q;let M;return!b&&gk(n,ee,V)&&(M=lr(16,{to:T,from:ee}),Xe(ee,ee,!0,!1)),(M?Promise.resolve(M):Y(T,ee)).catch(R=>Ki(R)?Ki(R,2)?R:Me(R):he(R,T,ee)).then(R=>{if(R){if(Ki(R,2))return P(Pe({replace:y},S(R.to),{state:typeof R.to=="object"?Pe({},$e,R.to.state):$e,force:b}),q||T)}else R=B(T,ee,!0,y,$e);return H(T,ee,R),R})}function Z(C,q){const V=_(C,q);return V?Promise.reject(V):Promise.resolve()}function N(C){const q=qe.values().next().value;return q&&typeof q.runWithContext=="function"?q.runWithContext(C):C()}function Y(C,q){let V;const[ee,$e,b]=Jk(C,q);V=uh(ee.reverse(),"beforeRouteLeave",C,q);for(const k of ee)k.leaveGuards.forEach(T=>{V.push(xn(T,C,q))});const y=Z.bind(null,C,q);return V.push(y),Be(V).then(()=>{V=[];for(const k of r.list())V.push(xn(k,C,q));return V.push(y),Be(V)}).then(()=>{V=uh($e,"beforeRouteUpdate",C,q);for(const k of $e)k.updateGuards.forEach(T=>{V.push(xn(T,C,q))});return V.push(y),Be(V)}).then(()=>{V=[];for(const k of b)if(k.beforeEnter)if(Oi(k.beforeEnter))for(const T of k.beforeEnter)V.push(xn(T,C,q));else V.push(xn(k.beforeEnter,C,q));return V.push(y),Be(V)}).then(()=>(C.matched.forEach(k=>k.enterCallbacks={}),V=uh(b,"beforeRouteEnter",C,q,N),V.push(y),Be(V))).then(()=>{V=[];for(const k of o.list())V.push(xn(k,C,q));return V.push(y),Be(V)}).catch(k=>Ki(k,8)?k:Promise.reject(k))}function H(C,q,V){l.list().forEach(ee=>N(()=>ee(C,q,V)))}function B(C,q,V,ee,$e){const b=_(C,q);if(b)return b;const y=q===On,k=Ms?history.state:{};V&&(ee||y?s.replace(C.fullPath,Pe({scroll:y&&k&&k.scroll},$e)):s.push(C.fullPath,$e)),a.value=C,Xe(C,q,V,y),Me()}let J;function ce(){J||(J=s.listen((C,q,V)=>{if(!He.listening)return;const ee=O(C),$e=$(ee);if($e){P(Pe($e,{replace:!0,force:!0}),ee).catch(ho);return}c=ee;const b=a.value;Ms&&_k(Fp(b.fullPath,V.delta),Qc()),Y(ee,b).catch(y=>Ki(y,12)?y:Ki(y,2)?(P(Pe(S(y.to),{force:!0}),ee).then(k=>{Ki(k,20)&&!V.delta&&V.type===Qo.pop&&s.go(-1,!1)}).catch(ho),Promise.reject()):(V.delta&&s.go(-V.delta,!1),he(y,ee,b))).then(y=>{y=y||B(ee,b,!1),y&&(V.delta&&!Ki(y,8)?s.go(-V.delta,!1):V.type===Qo.pop&&Ki(y,20)&&s.go(-1,!1)),H(ee,b,y)}).catch(ho)}))}let ue=Nr(),ne=Nr(),K;function he(C,q,V){Me(C);const ee=ne.list();return ee.length?ee.forEach($e=>$e(C,q,V)):console.error(C),Promise.reject(C)}function ye(){return K&&a.value!==On?Promise.resolve():new Promise((C,q)=>{ue.add([C,q])})}function Me(C){return K||(K=!C,ce(),ue.list().forEach(([q,V])=>C?V(C):q()),ue.reset()),C}function Xe(C,q,V,ee){const{scrollBehavior:$e}=i;if(!Ms||!$e)return Promise.resolve();const b=!V&&kk(Fp(C.fullPath,0))||(ee||!V)&&history.state&&history.state.scroll||null;return xc().then(()=>$e(C,q,b)).then(y=>y&&vk(y)).catch(y=>he(y,C,q))}const we=C=>s.go(C);let We;const qe=new Set,He={currentRoute:a,listening:!0,addRoute:d,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:m,resolve:O,options:i,push:x,replace:v,go:we,back:()=>we(-1),forward:()=>we(1),beforeEach:r.add,beforeResolve:o.add,afterEach:l.add,onError:ne.add,isReady:ye,install(C){const q=this;C.component("RouterLink",Db),C.component("RouterView",Lb),C.config.globalProperties.$router=q,Object.defineProperty(C.config.globalProperties,"$route",{enumerable:!0,get:()=>Xi(a)}),Ms&&!We&&a.value===On&&(We=!0,x(s.location).catch($e=>{}));const V={};for(const $e in On)Object.defineProperty(V,$e,{get:()=>a.value[$e],enumerable:!0});C.provide(Ec,q),C.provide(id,D0(V)),C.provide(_f,a);const ee=C.unmount;qe.add(C),C.unmount=function(){qe.delete(C),qe.size<1&&(c=On,J&&J(),J=null,a.value=On,We=!1,K=!1),ee()}}};function Be(C){return C.reduce((q,V)=>q.then(()=>N(V)),Promise.resolve())}return He}function Jk(i,e){const t=[],n=[],s=[],r=Math.max(e.matched.length,i.matched.length);for(let o=0;oor(c,l))?n.push(l):t.push(l));const a=i.matched[o];a&&(e.matched.find(c=>or(c,a))||s.push(a))}return[t,n,s]}function Nb(){return Ht(Ec)}function Go(i){return Ht(id)}const e$={class:"d-flex flex-column align-items-start"},t$={class:"row w-100"},i$={class:"mt-2 row w-100"},n$={class:"mt-2 row w-100"},s$={class:"p-0 d-flex gap-3 flex-column flex-auto-m"},r$={class:"col-auto d-flex"},o$=["max"],l$={class:"col-auto d-flex"},a$=["min"],c$=it({__name:"task-filter",props:{filters:{},categories:{}},emits:["update:filters"],setup(i,{emit:e}){const t=i,n=e,s=dt({get:()=>t.filters,set:r=>n("update:filters",r)});return ht(s,r=>{n("update:filters",r)},{deep:!0}),(r,o)=>(oe(),de("form",e$,[o[11]||(o[11]=E("div",{class:"row"},[E("h2",null,[E("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"currentColor",class:"bi bi-filter",viewBox:"0 0 16 16"},[E("path",{d:"M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5"})]),on(" Фильтр ")])],-1)),E("div",t$,[o[5]||(o[5]=E("label",{class:"form-label mb-2"},"Сложность",-1)),$n(E("select",{class:"form-select","aria-label":"Сложность","onUpdate:modelValue":o[0]||(o[0]=l=>s.value.difficulty=l)},o[4]||(o[4]=[E("option",{value:""},"Все",-1),E("option",{value:"easy"},"Легкая",-1),E("option",{value:"medium"},"Средняя",-1),E("option",{value:"hard"},"Сложная",-1)]),512),[[yf,s.value.difficulty]])]),E("div",i$,[o[7]||(o[7]=E("label",{class:"form-label mb-2"},"Категория",-1)),$n(E("select",{class:"form-select","aria-label":"Категории","onUpdate:modelValue":o[1]||(o[1]=l=>s.value.category=l)},[o[6]||(o[6]=E("option",{value:""},"Все",-1)),(oe(!0),de(ze,null,_r(r.categories,l=>(oe(),de("option",{key:l},Le(l),1))),128))],512),[[yf,s.value.category]])]),E("div",n$,[o[10]||(o[10]=E("p",{class:"mb-2"},"Популярность",-1)),E("div",s$,[E("div",r$,[o[8]||(o[8]=E("label",{class:"col-form-label me-2",for:"popularity-from"},"От",-1)),$n(E("input",{class:"form-control",type:"number",name:"popularity-from",id:"popularity-from","onUpdate:modelValue":o[2]||(o[2]=l=>s.value.popularityMin=l),min:1,max:s.value.popularityMax},null,8,o$),[[$o,s.value.popularityMin]])]),E("div",l$,[o[9]||(o[9]=E("label",{class:"col-form-label me-2",for:"popularity-to"},"До",-1)),$n(E("input",{class:"form-control",type:"number",name:"popularity-to",id:"popularity-to","onUpdate:modelValue":o[3]||(o[3]=l=>s.value.popularityMax=l),min:s.value.popularityMin,max:5},null,8,a$),[[$o,s.value.popularityMax]])])])])]))}}),h$={class:"col-9"},f$={key:0,class:"d-flex justify-content-center"},u$={key:0,class:"spinner-border text-primary",role:"status"},d$={key:1},p$={key:0,class:"task-list d-flex flex-wrap gap-4"},m$={class:"card",style:{width:"18rem"}},g$={class:"card-body"},O$={class:"card-title"},b$={class:"card-subtitle mb-2 text-body-secondary"},y$={class:"card-text"},S$={key:1},w$=it({__name:"task-list",props:{tasks:{},loading:{type:Boolean}},setup(i){return(e,t)=>(oe(),de("div",h$,[t[2]||(t[2]=E("h2",null,"Список задач",-1)),e.loading?(oe(),de("div",f$,[e.loading?(oe(),de("div",u$,t[0]||(t[0]=[E("span",{class:"visually-hidden"},"Loading...",-1)]))):rr("",!0)])):(oe(),de("div",d$,[e.tasks&&e.tasks.length>0?(oe(),de("ul",p$,[(oe(!0),de(ze,null,_r(e.tasks,n=>(oe(),de("li",{class:"task-list-item",key:n.id},[E("div",m$,[E("div",g$,[E("h5",O$,Le(n.title),1),E("h6",b$,Le(n.category),1),E("p",y$,Le(n.description),1),ke(Xi(Db),{to:"/tasks/"+n.id},{default:ir(()=>t[1]||(t[1]=[on("Открыть задание")])),_:2},1032,["to"])])])]))),128))])):(oe(),de("p",S$,"Задачи не найдены."))]))]))}});function Ib(i,e){return function(){return i.apply(e,arguments)}}const{toString:x$}=Object.prototype,{getPrototypeOf:nd}=Object,Cc=(i=>e=>{const t=x$.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Si=i=>(i=i.toLowerCase(),e=>Cc(e)===i),Ac=i=>e=>typeof e===i,{isArray:kr}=Array,Eo=Ac("undefined");function v$(i){return i!==null&&!Eo(i)&&i.constructor!==null&&!Eo(i.constructor)&&Gt(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const jb=Si("ArrayBuffer");function _$(i){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(i):e=i&&i.buffer&&jb(i.buffer),e}const k$=Ac("string"),Gt=Ac("function"),Xb=Ac("number"),Tc=i=>i!==null&&typeof i=="object",$$=i=>i===!0||i===!1,ra=i=>{if(Cc(i)!=="object")return!1;const e=nd(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},P$=Si("Date"),Q$=Si("File"),E$=Si("Blob"),C$=Si("FileList"),A$=i=>Tc(i)&&Gt(i.pipe),T$=i=>{let e;return i&&(typeof FormData=="function"&&i instanceof FormData||Gt(i.append)&&((e=Cc(i))==="formdata"||e==="object"&&Gt(i.toString)&&i.toString()==="[object FormData]"))},R$=Si("URLSearchParams"),[M$,Z$,D$,L$]=["ReadableStream","Request","Response","Headers"].map(Si),N$=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ko(i,e,{allOwnKeys:t=!1}={}){if(i===null||typeof i>"u")return;let n,s;if(typeof i!="object"&&(i=[i]),kr(i))for(n=0,s=i.length;n0;)if(s=t[n],e===s.toLowerCase())return s;return null}const ns=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Bb=i=>!Eo(i)&&i!==ns;function kf(){const{caseless:i}=Bb(this)&&this||{},e={},t=(n,s)=>{const r=i&&Vb(e,s)||s;ra(e[r])&&ra(n)?e[r]=kf(e[r],n):ra(n)?e[r]=kf({},n):kr(n)?e[r]=n.slice():e[r]=n};for(let n=0,s=arguments.length;n(Ko(e,(s,r)=>{t&&Gt(s)?i[r]=Ib(s,t):i[r]=s},{allOwnKeys:n}),i),j$=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),X$=(i,e,t,n)=>{i.prototype=Object.create(e.prototype,n),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:e.prototype}),t&&Object.assign(i.prototype,t)},V$=(i,e,t,n)=>{let s,r,o;const l={};if(e=e||{},i==null)return e;do{for(s=Object.getOwnPropertyNames(i),r=s.length;r-- >0;)o=s[r],(!n||n(o,i,e))&&!l[o]&&(e[o]=i[o],l[o]=!0);i=t!==!1&&nd(i)}while(i&&(!t||t(i,e))&&i!==Object.prototype);return e},B$=(i,e,t)=>{i=String(i),(t===void 0||t>i.length)&&(t=i.length),t-=e.length;const n=i.indexOf(e,t);return n!==-1&&n===t},W$=i=>{if(!i)return null;if(kr(i))return i;let e=i.length;if(!Xb(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=i[e];return t},q$=(i=>e=>i&&e instanceof i)(typeof Uint8Array<"u"&&nd(Uint8Array)),U$=(i,e)=>{const n=(i&&i[Symbol.iterator]).call(i);let s;for(;(s=n.next())&&!s.done;){const r=s.value;e.call(i,r[0],r[1])}},z$=(i,e)=>{let t;const n=[];for(;(t=i.exec(e))!==null;)n.push(t);return n},Y$=Si("HTMLFormElement"),F$=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,s){return n.toUpperCase()+s}),hm=(({hasOwnProperty:i})=>(e,t)=>i.call(e,t))(Object.prototype),H$=Si("RegExp"),Wb=(i,e)=>{const t=Object.getOwnPropertyDescriptors(i),n={};Ko(t,(s,r)=>{let o;(o=e(s,r,i))!==!1&&(n[r]=o||s)}),Object.defineProperties(i,n)},G$=i=>{Wb(i,(e,t)=>{if(Gt(i)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=i[t];if(Gt(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},K$=(i,e)=>{const t={},n=s=>{s.forEach(r=>{t[r]=!0})};return kr(i)?n(i):n(String(i).split(e)),t},J$=()=>{},eP=(i,e)=>i!=null&&Number.isFinite(i=+i)?i:e,dh="abcdefghijklmnopqrstuvwxyz",fm="0123456789",qb={DIGIT:fm,ALPHA:dh,ALPHA_DIGIT:dh+dh.toUpperCase()+fm},tP=(i=16,e=qb.ALPHA_DIGIT)=>{let t="";const{length:n}=e;for(;i--;)t+=e[Math.random()*n|0];return t};function iP(i){return!!(i&&Gt(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const nP=i=>{const e=new Array(10),t=(n,s)=>{if(Tc(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[s]=n;const r=kr(n)?[]:{};return Ko(n,(o,l)=>{const a=t(o,s+1);!Eo(a)&&(r[l]=a)}),e[s]=void 0,r}}return n};return t(i,0)},sP=Si("AsyncFunction"),rP=i=>i&&(Tc(i)||Gt(i))&&Gt(i.then)&&Gt(i.catch),Ub=((i,e)=>i?setImmediate:e?((t,n)=>(ns.addEventListener("message",({source:s,data:r})=>{s===ns&&r===t&&n.length&&n.shift()()},!1),s=>{n.push(s),ns.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Gt(ns.postMessage)),oP=typeof queueMicrotask<"u"?queueMicrotask.bind(ns):typeof process<"u"&&process.nextTick||Ub,Q={isArray:kr,isArrayBuffer:jb,isBuffer:v$,isFormData:T$,isArrayBufferView:_$,isString:k$,isNumber:Xb,isBoolean:$$,isObject:Tc,isPlainObject:ra,isReadableStream:M$,isRequest:Z$,isResponse:D$,isHeaders:L$,isUndefined:Eo,isDate:P$,isFile:Q$,isBlob:E$,isRegExp:H$,isFunction:Gt,isStream:A$,isURLSearchParams:R$,isTypedArray:q$,isFileList:C$,forEach:Ko,merge:kf,extend:I$,trim:N$,stripBOM:j$,inherits:X$,toFlatObject:V$,kindOf:Cc,kindOfTest:Si,endsWith:B$,toArray:W$,forEachEntry:U$,matchAll:z$,isHTMLForm:Y$,hasOwnProperty:hm,hasOwnProp:hm,reduceDescriptors:Wb,freezeMethods:G$,toObjectSet:K$,toCamelCase:F$,noop:J$,toFiniteNumber:eP,findKey:Vb,global:ns,isContextDefined:Bb,ALPHABET:qb,generateString:tP,isSpecCompliantForm:iP,toJSONObject:nP,isAsyncFn:sP,isThenable:rP,setImmediate:Ub,asap:oP};function me(i,e,t,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}Q.inherits(me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Q.toJSONObject(this.config),code:this.code,status:this.status}}});const zb=me.prototype,Yb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{Yb[i]={value:i}});Object.defineProperties(me,Yb);Object.defineProperty(zb,"isAxiosError",{value:!0});me.from=(i,e,t,n,s,r)=>{const o=Object.create(zb);return Q.toFlatObject(i,o,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),me.call(o,i.message,e,t,n,s),o.cause=i,o.name=i.name,r&&Object.assign(o,r),o};const lP=null;function $f(i){return Q.isPlainObject(i)||Q.isArray(i)}function Fb(i){return Q.endsWith(i,"[]")?i.slice(0,-2):i}function um(i,e,t){return i?i.concat(e).map(function(s,r){return s=Fb(s),!t&&r?"["+s+"]":s}).join(t?".":""):e}function aP(i){return Q.isArray(i)&&!i.some($f)}const cP=Q.toFlatObject(Q,{},null,function(e){return/^is[A-Z]/.test(e)});function Rc(i,e,t){if(!Q.isObject(i))throw new TypeError("target must be an object");e=e||new FormData,t=Q.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,g){return!Q.isUndefined(g[m])});const n=t.metaTokens,s=t.visitor||h,r=t.dots,o=t.indexes,a=(t.Blob||typeof Blob<"u"&&Blob)&&Q.isSpecCompliantForm(e);if(!Q.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(Q.isDate(p))return p.toISOString();if(!a&&Q.isBlob(p))throw new me("Blob is not supported. Use a Buffer instead.");return Q.isArrayBuffer(p)||Q.isTypedArray(p)?a&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function h(p,m,g){let O=p;if(p&&!g&&typeof p=="object"){if(Q.endsWith(m,"{}"))m=n?m:m.slice(0,-2),p=JSON.stringify(p);else if(Q.isArray(p)&&aP(p)||(Q.isFileList(p)||Q.endsWith(m,"[]"))&&(O=Q.toArray(p)))return m=Fb(m),O.forEach(function(_,x){!(Q.isUndefined(_)||_===null)&&e.append(o===!0?um([m],x,r):o===null?m:m+"[]",c(_))}),!1}return $f(p)?!0:(e.append(um(g,m,r),c(p)),!1)}const f=[],u=Object.assign(cP,{defaultVisitor:h,convertValue:c,isVisitable:$f});function d(p,m){if(!Q.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(p),Q.forEach(p,function(O,S){(!(Q.isUndefined(O)||O===null)&&s.call(e,O,Q.isString(S)?S.trim():S,m,u))===!0&&d(O,m?m.concat(S):[S])}),f.pop()}}if(!Q.isObject(i))throw new TypeError("data must be an object");return d(i),e}function dm(i){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function sd(i,e){this._pairs=[],i&&Rc(i,this,e)}const Hb=sd.prototype;Hb.append=function(e,t){this._pairs.push([e,t])};Hb.toString=function(e){const t=e?function(n){return e.call(this,n,dm)}:dm;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function hP(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Gb(i,e,t){if(!e)return i;const n=t&&t.encode||hP;Q.isFunction(t)&&(t={serialize:t});const s=t&&t.serialize;let r;if(s?r=s(e,t):r=Q.isURLSearchParams(e)?e.toString():new sd(e,t).toString(n),r){const o=i.indexOf("#");o!==-1&&(i=i.slice(0,o)),i+=(i.indexOf("?")===-1?"?":"&")+r}return i}class pm{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Q.forEach(this.handlers,function(n){n!==null&&e(n)})}}const Kb={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fP=typeof URLSearchParams<"u"?URLSearchParams:sd,uP=typeof FormData<"u"?FormData:null,dP=typeof Blob<"u"?Blob:null,pP={isBrowser:!0,classes:{URLSearchParams:fP,FormData:uP,Blob:dP},protocols:["http","https","file","blob","url","data"]},rd=typeof window<"u"&&typeof document<"u",Pf=typeof navigator=="object"&&navigator||void 0,mP=rd&&(!Pf||["ReactNative","NativeScript","NS"].indexOf(Pf.product)<0),gP=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",OP=rd&&window.location.href||"http://localhost",bP=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:rd,hasStandardBrowserEnv:mP,hasStandardBrowserWebWorkerEnv:gP,navigator:Pf,origin:OP},Symbol.toStringTag,{value:"Module"})),yt={...bP,...pP};function yP(i,e){return Rc(i,new yt.classes.URLSearchParams,Object.assign({visitor:function(t,n,s,r){return yt.isNode&&Q.isBuffer(t)?(this.append(n,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function SP(i){return Q.matchAll(/\w+|\[(\w*)]/g,i).map(e=>e[0]==="[]"?"":e[1]||e[0])}function wP(i){const e={},t=Object.keys(i);let n;const s=t.length;let r;for(n=0;n=t.length;return o=!o&&Q.isArray(s)?s.length:o,a?(Q.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!l):((!s[o]||!Q.isObject(s[o]))&&(s[o]=[]),e(t,n,s[o],r)&&Q.isArray(s[o])&&(s[o]=wP(s[o])),!l)}if(Q.isFormData(i)&&Q.isFunction(i.entries)){const t={};return Q.forEachEntry(i,(n,s)=>{e(SP(n),s,t,0)}),t}return null}function xP(i,e,t){if(Q.isString(i))try{return(e||JSON.parse)(i),Q.trim(i)}catch(n){if(n.name!=="SyntaxError")throw n}return(0,JSON.stringify)(i)}const Jo={transitional:Kb,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,r=Q.isObject(e);if(r&&Q.isHTMLForm(e)&&(e=new FormData(e)),Q.isFormData(e))return s?JSON.stringify(Jb(e)):e;if(Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e)||Q.isReadableStream(e))return e;if(Q.isArrayBufferView(e))return e.buffer;if(Q.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return yP(e,this.formSerializer).toString();if((l=Q.isFileList(e))||n.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return Rc(l?{"files[]":e}:e,a&&new a,this.formSerializer)}}return r||s?(t.setContentType("application/json",!1),xP(e)):e}],transformResponse:[function(e){const t=this.transitional||Jo.transitional,n=t&&t.forcedJSONParsing,s=this.responseType==="json";if(Q.isResponse(e)||Q.isReadableStream(e))return e;if(e&&Q.isString(e)&&(n&&!this.responseType||s)){const o=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(l){if(o)throw l.name==="SyntaxError"?me.from(l,me.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Q.forEach(["delete","get","head","post","put","patch"],i=>{Jo.headers[i]={}});const vP=Q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_P=i=>{const e={};let t,n,s;return i&&i.split(` `).forEach(function(o){s=o.indexOf(":"),t=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!t||e[t]&&vP[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},mm=Symbol("internals");function Ir(i){return i&&String(i).trim().toLowerCase()}function oa(i){return i===!1||i==null?i:Q.isArray(i)?i.map(oa):String(i)}function kP(i){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(i);)e[n[1]]=n[2];return e}const $P=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function ph(i,e,t,n,s){if(Q.isFunction(n))return n.call(this,e,t);if(s&&(e=t),!!Q.isString(e)){if(Q.isString(n))return e.indexOf(n)!==-1;if(Q.isRegExp(n))return n.test(e)}}function PP(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function QP(i,e){const t=Q.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(i,n+t,{value:function(s,r,o){return this[n].call(this,e,s,r,o)},configurable:!0})})}class It{constructor(e){e&&this.set(e)}set(e,t,n){const s=this;function r(l,a,c){const h=Ir(a);if(!h)throw new Error("header name must be a non-empty string");const f=Q.findKey(s,h);(!f||s[f]===void 0||c===!0||c===void 0&&s[f]!==!1)&&(s[f||a]=oa(l))}const o=(l,a)=>Q.forEach(l,(c,h)=>r(c,h,a));if(Q.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Q.isString(e)&&(e=e.trim())&&!$P(e))o(_P(e),t);else if(Q.isHeaders(e))for(const[l,a]of e.entries())r(a,l,n);else e!=null&&r(t,e,n);return this}get(e,t){if(e=Ir(e),e){const n=Q.findKey(this,e);if(n){const s=this[n];if(!t)return s;if(t===!0)return kP(s);if(Q.isFunction(t))return t.call(this,s,n);if(Q.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ir(e),e){const n=Q.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||ph(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let s=!1;function r(o){if(o=Ir(o),o){const l=Q.findKey(n,o);l&&(!t||ph(n,n[l],l,t))&&(delete n[l],s=!0)}}return Q.isArray(e)?e.forEach(r):r(e),s}clear(e){const t=Object.keys(this);let n=t.length,s=!1;for(;n--;){const r=t[n];(!e||ph(this,this[r],r,e,!0))&&(delete this[r],s=!0)}return s}normalize(e){const t=this,n={};return Q.forEach(this,(s,r)=>{const o=Q.findKey(n,r);if(o){t[o]=oa(s),delete t[r];return}const l=e?PP(r):String(r).trim();l!==r&&delete t[r],t[l]=oa(s),n[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Q.forEach(this,(n,s)=>{n!=null&&n!==!1&&(t[s]=e&&Q.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(s=>n.set(s)),n}static accessor(e){const n=(this[mm]=this[mm]={accessors:{}}).accessors,s=this.prototype;function r(o){const l=Ir(o);n[l]||(QP(s,o),n[l]=!0)}return Q.isArray(e)?e.forEach(r):r(e),this}}It.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Q.reduceDescriptors(It.prototype,({value:i},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>i,set(n){this[t]=n}}});Q.freezeMethods(It);function mh(i,e){const t=this||Jo,n=e||t,s=It.from(n.headers);let r=n.data;return Q.forEach(i,function(l){r=l.call(t,r,s.normalize(),e?e.status:void 0)}),s.normalize(),r}function ey(i){return!!(i&&i.__CANCEL__)}function $r(i,e,t){me.call(this,i??"canceled",me.ERR_CANCELED,e,t),this.name="CanceledError"}Q.inherits($r,me,{__CANCEL__:!0});function ty(i,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?i(t):e(new me("Request failed with status code "+t.status,[me.ERR_BAD_REQUEST,me.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function EP(i){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return e&&e[1]||""}function CP(i,e){i=i||10;const t=new Array(i),n=new Array(i);let s=0,r=0,o;return e=e!==void 0?e:1e3,function(a){const c=Date.now(),h=n[r];o||(o=c),t[s]=a,n[s]=c;let f=r,u=0;for(;f!==s;)u+=t[f++],f=f%i;if(s=(s+1)%i,s===r&&(r=(r+1)%i),c-o{t=h,s=null,r&&(clearTimeout(r),r=null),i.apply(null,c)};return[(...c)=>{const h=Date.now(),f=h-t;f>=n?o(c,h):(s=c,r||(r=setTimeout(()=>{r=null,o(s)},n-f)))},()=>s&&o(s)]}const Ra=(i,e,t=3)=>{let n=0;const s=CP(50,250);return AP(r=>{const o=r.loaded,l=r.lengthComputable?r.total:void 0,a=o-n,c=s(a),h=o<=l;n=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:a,rate:c||void 0,estimated:c&&l&&h?(l-o)/c:void 0,event:r,lengthComputable:l!=null,[e?"download":"upload"]:!0};i(f)},t)},gm=(i,e)=>{const t=i!=null;return[n=>e[0]({lengthComputable:t,total:i,loaded:n}),e[1]]},Om=i=>(...e)=>Q.asap(()=>i(...e)),TP=yt.hasStandardBrowserEnv?((i,e)=>t=>(t=new URL(t,yt.origin),i.protocol===t.protocol&&i.host===t.host&&(e||i.port===t.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,RP=yt.hasStandardBrowserEnv?{write(i,e,t,n,s,r){const o=[i+"="+encodeURIComponent(e)];Q.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),Q.isString(n)&&o.push("path="+n),Q.isString(s)&&o.push("domain="+s),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(i){const e=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function MP(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function ZP(i,e){return e?i.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):i}function iy(i,e){return i&&!MP(e)?ZP(i,e):e}const bm=i=>i instanceof It?{...i}:i;function gs(i,e){e=e||{};const t={};function n(c,h,f,u){return Q.isPlainObject(c)&&Q.isPlainObject(h)?Q.merge.call({caseless:u},c,h):Q.isPlainObject(h)?Q.merge({},h):Q.isArray(h)?h.slice():h}function s(c,h,f,u){if(Q.isUndefined(h)){if(!Q.isUndefined(c))return n(void 0,c,f,u)}else return n(c,h,f,u)}function r(c,h){if(!Q.isUndefined(h))return n(void 0,h)}function o(c,h){if(Q.isUndefined(h)){if(!Q.isUndefined(c))return n(void 0,c)}else return n(void 0,h)}function l(c,h,f){if(f in e)return n(c,h);if(f in i)return n(void 0,c)}const a={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(c,h,f)=>s(bm(c),bm(h),f,!0)};return Q.forEach(Object.keys(Object.assign({},i,e)),function(h){const f=a[h]||s,u=f(i[h],e[h],h);Q.isUndefined(u)&&f!==l||(t[h]=u)}),t}const ny=i=>{const e=gs({},i);let{data:t,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:r,headers:o,auth:l}=e;e.headers=o=It.from(o),e.url=Gb(iy(e.baseURL,e.url),i.params,i.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let a;if(Q.isFormData(t)){if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((a=o.getContentType())!==!1){const[c,...h]=a?a.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...h].join("; "))}}if(yt.hasStandardBrowserEnv&&(n&&Q.isFunction(n)&&(n=n(e)),n||n!==!1&&TP(e.url))){const c=s&&r&&RP.read(r);c&&o.set(s,c)}return e},DP=typeof XMLHttpRequest<"u",LP=DP&&function(i){return new Promise(function(t,n){const s=ny(i);let r=s.data;const o=It.from(s.headers).normalize();let{responseType:l,onUploadProgress:a,onDownloadProgress:c}=s,h,f,u,d,p;function m(){d&&d(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let g=new XMLHttpRequest;g.open(s.method.toUpperCase(),s.url,!0),g.timeout=s.timeout;function O(){if(!g)return;const _=It.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),v={data:!l||l==="text"||l==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:_,config:i,request:g};ty(function(P){t(P),m()},function(P){n(P),m()},v),g=null}"onloadend"in g?g.onloadend=O:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(O)},g.onabort=function(){g&&(n(new me("Request aborted",me.ECONNABORTED,i,g)),g=null)},g.onerror=function(){n(new me("Network Error",me.ERR_NETWORK,i,g)),g=null},g.ontimeout=function(){let x=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const v=s.transitional||Kb;s.timeoutErrorMessage&&(x=s.timeoutErrorMessage),n(new me(x,v.clarifyTimeoutError?me.ETIMEDOUT:me.ECONNABORTED,i,g)),g=null},r===void 0&&o.setContentType(null),"setRequestHeader"in g&&Q.forEach(o.toJSON(),function(x,v){g.setRequestHeader(v,x)}),Q.isUndefined(s.withCredentials)||(g.withCredentials=!!s.withCredentials),l&&l!=="json"&&(g.responseType=s.responseType),c&&([u,p]=Ra(c,!0),g.addEventListener("progress",u)),a&&g.upload&&([f,d]=Ra(a),g.upload.addEventListener("progress",f),g.upload.addEventListener("loadend",d)),(s.cancelToken||s.signal)&&(h=_=>{g&&(n(!_||_.type?new $r(null,i,g):_),g.abort(),g=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const S=EP(s.url);if(S&&yt.protocols.indexOf(S)===-1){n(new me("Unsupported protocol "+S+":",me.ERR_BAD_REQUEST,i));return}g.send(r||null)})},NP=(i,e)=>{const{length:t}=i=i?i.filter(Boolean):[];if(e||t){let n=new AbortController,s;const r=function(c){if(!s){s=!0,l();const h=c instanceof Error?c:this.reason;n.abort(h instanceof me?h:new $r(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,r(new me(`timeout ${e} of ms exceeded`,me.ETIMEDOUT))},e);const l=()=>{i&&(o&&clearTimeout(o),o=null,i.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),i=null)};i.forEach(c=>c.addEventListener("abort",r));const{signal:a}=n;return a.unsubscribe=()=>Q.asap(l),a}},IP=function*(i,e){let t=i.byteLength;if(t{const s=jP(i,e);let r=0,o,l=a=>{o||(o=!0,n&&n(a))};return new ReadableStream({async pull(a){try{const{done:c,value:h}=await s.next();if(c){l(),a.close();return}let f=h.byteLength;if(t){let u=r+=f;t(u)}a.enqueue(new Uint8Array(h))}catch(c){throw l(c),c}},cancel(a){return l(a),s.return()}},{highWaterMark:2})},Mc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",sy=Mc&&typeof ReadableStream=="function",VP=Mc&&(typeof TextEncoder=="function"?(i=>e=>i.encode(e))(new TextEncoder):async i=>new Uint8Array(await new Response(i).arrayBuffer())),ry=(i,...e)=>{try{return!!i(...e)}catch{return!1}},BP=sy&&ry(()=>{let i=!1;const e=new Request(yt.origin,{body:new ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type");return i&&!e}),Sm=64*1024,Qf=sy&&ry(()=>Q.isReadableStream(new Response("").body)),Ma={stream:Qf&&(i=>i.body)};Mc&&(i=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ma[e]&&(Ma[e]=Q.isFunction(i[e])?t=>t[e]():(t,n)=>{throw new me(`Response type '${e}' is not supported`,me.ERR_NOT_SUPPORT,n)})})})(new Response);const WP=async i=>{if(i==null)return 0;if(Q.isBlob(i))return i.size;if(Q.isSpecCompliantForm(i))return(await new Request(yt.origin,{method:"POST",body:i}).arrayBuffer()).byteLength;if(Q.isArrayBufferView(i)||Q.isArrayBuffer(i))return i.byteLength;if(Q.isURLSearchParams(i)&&(i=i+""),Q.isString(i))return(await VP(i)).byteLength},qP=async(i,e)=>{const t=Q.toFiniteNumber(i.getContentLength());return t??WP(e)},UP=Mc&&(async i=>{let{url:e,method:t,data:n,signal:s,cancelToken:r,timeout:o,onDownloadProgress:l,onUploadProgress:a,responseType:c,headers:h,withCredentials:f="same-origin",fetchOptions:u}=ny(i);c=c?(c+"").toLowerCase():"text";let d=NP([s,r&&r.toAbortSignal()],o),p;const m=d&&d.unsubscribe&&(()=>{d.unsubscribe()});let g;try{if(a&&BP&&t!=="get"&&t!=="head"&&(g=await qP(h,n))!==0){let v=new Request(e,{method:"POST",body:n,duplex:"half"}),$;if(Q.isFormData(n)&&($=v.headers.get("content-type"))&&h.setContentType($),v.body){const[P,Z]=gm(g,Ra(Om(a)));n=ym(v.body,Sm,P,Z)}}Q.isString(f)||(f=f?"include":"omit");const O="credentials"in Request.prototype;p=new Request(e,{...u,signal:d,method:t.toUpperCase(),headers:h.normalize().toJSON(),body:n,duplex:"half",credentials:O?f:void 0});let S=await fetch(p);const _=Qf&&(c==="stream"||c==="response");if(Qf&&(l||_&&m)){const v={};["status","statusText","headers"].forEach(N=>{v[N]=S[N]});const $=Q.toFiniteNumber(S.headers.get("content-length")),[P,Z]=l&&gm($,Ra(Om(l),!0))||[];S=new Response(ym(S.body,Sm,P,()=>{Z&&Z(),m&&m()}),v)}c=c||"text";let x=await Ma[Q.findKey(Ma,c)||"text"](S,i);return!_&&m&&m(),await new Promise((v,$)=>{ty(v,$,{data:x,headers:It.from(S.headers),status:S.status,statusText:S.statusText,config:i,request:p})})}catch(O){throw m&&m(),O&&O.name==="TypeError"&&/fetch/i.test(O.message)?Object.assign(new me("Network Error",me.ERR_NETWORK,i,p),{cause:O.cause||O}):me.from(O,O&&O.code,i,p)}}),Ef={http:lP,xhr:LP,fetch:UP};Q.forEach(Ef,(i,e)=>{if(i){try{Object.defineProperty(i,"name",{value:e})}catch{}Object.defineProperty(i,"adapterName",{value:e})}});const wm=i=>`- ${i}`,zP=i=>Q.isFunction(i)||i===null||i===!1,oy={getAdapter:i=>{i=Q.isArray(i)?i:[i];const{length:e}=i;let t,n;const s={};for(let r=0;r`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let o=e?r.length>1?`since : `+r.map(wm).join(` `):" "+wm(r[0]):"as no adapter specified";throw new me("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Ef};function gh(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new $r(null,i)}function xm(i){return gh(i),i.headers=It.from(i.headers),i.data=mh.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),oy.getAdapter(i.adapter||Jo.adapter)(i).then(function(n){return gh(i),n.data=mh.call(i,i.transformResponse,n),n.headers=It.from(n.headers),n},function(n){return ey(n)||(gh(i),n&&n.response&&(n.response.data=mh.call(i,i.transformResponse,n.response),n.response.headers=It.from(n.response.headers))),Promise.reject(n)})}const ly="1.7.9",Zc={};["object","boolean","number","function","string","symbol"].forEach((i,e)=>{Zc[i]=function(n){return typeof n===i||"a"+(e<1?"n ":" ")+i}});const vm={};Zc.transitional=function(e,t,n){function s(r,o){return"[Axios v"+ly+"] Transitional option '"+r+"'"+o+(n?". "+n:"")}return(r,o,l)=>{if(e===!1)throw new me(s(o," has been removed"+(t?" in "+t:"")),me.ERR_DEPRECATED);return t&&!vm[o]&&(vm[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(r,o,l):!0}};Zc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function YP(i,e,t){if(typeof i!="object")throw new me("options must be an object",me.ERR_BAD_OPTION_VALUE);const n=Object.keys(i);let s=n.length;for(;s-- >0;){const r=n[s],o=e[r];if(o){const l=i[r],a=l===void 0||o(l,r,i);if(a!==!0)throw new me("option "+r+" must be "+a,me.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new me("Unknown option "+r,me.ERR_BAD_OPTION)}}const la={assertOptions:YP,validators:Zc},Pi=la.validators;class hs{constructor(e){this.defaults=e,this.interceptors={request:new pm,response:new pm}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const r=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?r&&!String(n.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+r):n.stack=r}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=gs(this.defaults,t);const{transitional:n,paramsSerializer:s,headers:r}=t;n!==void 0&&la.assertOptions(n,{silentJSONParsing:Pi.transitional(Pi.boolean),forcedJSONParsing:Pi.transitional(Pi.boolean),clarifyTimeoutError:Pi.transitional(Pi.boolean)},!1),s!=null&&(Q.isFunction(s)?t.paramsSerializer={serialize:s}:la.assertOptions(s,{encode:Pi.function,serialize:Pi.function},!0)),la.assertOptions(t,{baseUrl:Pi.spelling("baseURL"),withXsrfToken:Pi.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=r&&Q.merge(r.common,r[t.method]);r&&Q.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),t.headers=It.concat(o,r);const l=[];let a=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(a=a&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let h,f=0,u;if(!a){const p=[xm.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,c),u=p.length,h=Promise.resolve(t);f{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](s);n._listeners=null}),this.promise.then=s=>{let r;const o=new Promise(l=>{n.subscribe(l),r=l}).then(s);return o.cancel=function(){n.unsubscribe(r)},o},e(function(r,o,l){n.reason||(n.reason=new $r(r,o,l),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new od(function(s){e=s}),cancel:e}}}function FP(i){return function(t){return i.apply(null,t)}}function HP(i){return Q.isObject(i)&&i.isAxiosError===!0}const Cf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cf).forEach(([i,e])=>{Cf[e]=i});function ay(i){const e=new hs(i),t=Ib(hs.prototype.request,e);return Q.extend(t,hs.prototype,e,{allOwnKeys:!0}),Q.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return ay(gs(i,s))},t}const tt=ay(Jo);tt.Axios=hs;tt.CanceledError=$r;tt.CancelToken=od;tt.isCancel=ey;tt.VERSION=ly;tt.toFormData=Rc;tt.AxiosError=me;tt.Cancel=tt.CanceledError;tt.all=function(e){return Promise.all(e)};tt.spread=FP;tt.isAxiosError=HP;tt.mergeConfig=gs;tt.AxiosHeaders=It;tt.formToJSON=i=>Jb(Q.isHTMLForm(i)?new FormData(i):i);tt.getAdapter=oy.getAdapter;tt.HttpStatusCode=Cf;tt.default=tt;const GP=()=>"https://nvtsk.ru:13000";function KP(i){return new URLSearchParams(Object.entries(i).reduce((e,[t,n])=>({...e,[t]:String(n)}),{}))}const JP=i=>{const{host:e=GP(),path:t="",params:n}={},s=n?"?"+KP(n).toString():"";return new URL(`${t}${s}`,e).href},ii=tt.create({baseURL:JP(),withCredentials:!0});class Za{static async getAllCategories(){try{const{data:e}=await ii.get("/api/tasks/categories");return e}catch{throw new Error("Ошибка при получении категорий")}}static async getAllTasks({startFrom:e=0,limit:t=10,category:n="",difficulty:s="",popularity:r={min:1,max:5}}){const o={offset:e,limit:t,category:n,difficulty:s,popularity:r};try{return(await ii.get("/api/tasks",{params:o})).data}catch{return[]}}static async getTask(e){try{const{data:t}=await ii.get(`/api/tasks/${e}`);return t}catch{throw new Error("Ошибка при получении задачи")}}static async createTask(e){const{data:t}=await ii.post("/api/tasks",e);return t.status===201}static async getTaskSolution(e,t){try{const{data:n}=await ii.get(`/api/solutions?task_id=${e}&user_id=${t}`);return n}catch{throw new Error("Ошибка при получении решения")}}}const eQ={class:"filtered-list d-flex flex-sm-row flex-column gap-5"},tQ={key:0,class:"mt-2 d-flex justify-content-end","aria-label":"Page navigation"},iQ={class:"pagination"},nQ=["onClick"],xl=10,sQ=it({__name:"filtered-list",setup(i){const e=Nb(),t=Go(),n=Te({category:"",difficulty:"",popularityMin:1,popularityMax:5}),s=Te([]),r=Te([]),o=Te(!0),l=Te(1);let a;async function c(p=!1){o.value=!0,s.value=await Za.getAllTasks(n.value)||[],o.value=!1,p||(l.value=1)}function h(){const p=Object.entries(n.value).reduce((m,[g,O])=>({...m,[g]:String(O)}),{});e.replace({path:t.path,query:{...p,page:l.value}})}const f=dt(()=>Math.ceil(s.value.length/xl)),u=dt(()=>{const p=(l.value-1)*xl;return s.value.slice(p,p+xl)});function d(p){p>=1&&p<=f.value&&(l.value=p,h())}return ht(n,()=>{clearTimeout(a),a=setTimeout(()=>{c().then(()=>{h()})},500)},{deep:!0}),ks(async()=>{r.value=await Za.getAllCategories();const p=e.currentRoute.value.query;if(Object.keys(n.value).forEach(m=>{const g=m,O=p[g];if(O!==void 0){const S=Array.isArray(O)?O[0]:O;S!==null&&(g==="popularityMin"||g==="popularityMax"?n.value[g]=Number(S):n.value[g]=S)}}),await c(!0),p.page){const m=parseInt(p.page,10);!isNaN(m)&&m>0&&(l.value=m)}}),(p,m)=>(oe(),de(ze,null,[E("div",eQ,[ke(c$,{filters:n.value,"onUpdate:filters":m[0]||(m[0]=g=>n.value=g),categories:r.value,"onUpdate:categories":m[1]||(m[1]=g=>r.value=g)},null,8,["filters","categories"]),ke(w$,{tasks:u.value,loading:o.value},null,8,["tasks","loading"])]),s.value.length>xl?(oe(),de("nav",tQ,[E("ul",iQ,[E("li",{class:rn(["page-item",{disabled:l.value===1}])},[E("a",{class:"page-link",href:"#",onClick:m[2]||(m[2]=ao(g=>d(l.value-1),["prevent"]))},"Previous")],2),(oe(!0),de(ze,null,_r(f.value,g=>(oe(),de("li",{key:g,class:rn(["page-item",{active:l.value===g}])},[E("a",{class:"page-link",href:"#",onClick:ao(O=>d(g),["prevent"])},Le(g),9,nQ)],2))),128)),E("li",{class:rn(["page-item",{disabled:l.value===f.value}])},[E("a",{class:"page-link",href:"#",onClick:m[3]||(m[3]=ao(g=>d(l.value+1),["prevent"]))}," Next ")],2)])])):rr("",!0)],64))}}),rQ={class:"main-view"},oQ=it({__name:"main-page",setup(i){return(e,t)=>(oe(),de("main",rQ,[ke(sQ)]))}}),ld=(i,e)=>{const t=i.__vccOpts||i;for(const[n,s]of e)t[n]=s;return t},lQ=ld(oQ,[["__scopeId","data-v-d9c0dab0"]]);let Af=[],cy=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=cy[n])e=n+1;else return!0;if(e==t)return!1}}function _m(i){return i>=127462&&i<=127487}const km=8205;function cQ(i,e,t=!0,n=!0){return(t?hy:hQ)(i,e,n)}function hy(i,e,t){if(e==i.length)return e;e&&fy(i.charCodeAt(e))&&uy(i.charCodeAt(e-1))&&e--;let n=Oh(i,e);for(e+=$m(n);e=0&&_m(Oh(i,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function hQ(i,e,t){for(;e>0;){let n=hy(i,e-2,t);if(n=56320&&i<57344}function uy(i){return i>=55296&&i<56320}function $m(i){return i<65536?1:2}class Se{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=ar(this,e,t);let s=[];return this.decompose(0,e,s,2),n.length&&n.decompose(0,n.length,s,3),this.decompose(t,this.length,s,1),Mi.from(s,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ar(this,e,t);let n=[];return this.decompose(e,t,n,0),Mi.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),s=new uo(this),r=new uo(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=n)return!0}}iter(e=1){return new uo(this,e)}iterRange(e,t=this.length){return new dy(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;n=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new py(n)}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]?Se.empty:e.length<=32?new Ue(e):Mi.from(Ue.split(e,[]))}}class Ue extends Se{constructor(e,t=fQ(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?n:l)>=e)return new uQ(s,l,n,o);s=l+1,n++}}decompose(e,t,n,s){let r=e<=0&&t>=this.length?this:new Ue(Pm(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=n.pop(),l=aa(r.text,o.text.slice(),0,r.length);if(l.length<=32)n.push(new Ue(l,o.length+r.length));else{let a=l.length>>1;n.push(new Ue(l.slice(0,a)),new Ue(l.slice(a)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof Ue))return super.replace(e,t,n);[e,t]=ar(this,e,t);let s=aa(this.text,aa(n.text,Pm(this.text,0,e)),t),r=this.length+n.length-(t-e);return s.length<=32?new Ue(s,r):Mi.from(Ue.split(s,[]),r)}sliceString(e,t=this.length,n=` `){[e,t]=ar(this,e,t);let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=n),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],s=-1;for(let r of e)n.push(r),s+=r.length+1,n.length==32&&(t.push(new Ue(n,s)),n=[],s=-1);return s>-1&&t.push(new Ue(n,s)),t}}class Mi extends Se{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,s);s=l+1,n=a+1}}decompose(e,t,n,s){for(let r=0,o=0;o<=t&&r=o){let c=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!c?n.push(l):l.decompose(e-o,t-o,n,c)}o=a+1}}replace(e,t,n){if([e,t]=ar(this,e,t),n.lines=r&&t<=l){let a=o.replace(e-r,t-r,n),c=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>c>>6){let h=this.children.slice();return h[s]=a,new Mi(h,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){[e,t]=ar(this,e,t);let s="";for(let r=0,o=0;re&&r&&(s+=n),eo&&(s+=l.sliceString(e-o,t-o,n)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Mi))return 0;let n=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return n;let a=this.children[s],c=e.children[r];if(a!=c)return n+a.scanIdentical(c,t);n+=a.length+1}}static from(e,t=e.reduce((n,s)=>n+s.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new Ue(d,t)}let s=Math.max(32,n>>5),r=s<<1,o=s>>1,l=[],a=0,c=-1,h=[];function f(d){let p;if(d.lines>r&&d instanceof Mi)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof Ue&&a&&(p=h[h.length-1])instanceof Ue&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,h[h.length-1]=new Ue(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,c+=d.length+1,h.push(d))}function u(){a!=0&&(l.push(h.length==1?h[0]:Mi.from(h,c)),c=-1,a=h.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Mi(l,t)}}Se.empty=new Ue([""],0);function fQ(i){let e=-1;for(let t of i)e+=t.length+1;return e}function aa(i,e,t=0,n=1e9){for(let s=0,r=0,o=!0;r=t&&(a>n&&(l=l.slice(0,n-s)),s0?1:(e instanceof Ue?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,s=this.nodes[n],r=this.offsets[n],o=r>>1,l=s instanceof Ue?s.text.length:s.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(s instanceof Ue){let a=s.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Ue?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)}}class dy{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new uo(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=n?s:t<0?s.slice(s.length-n):s.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class py{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Se.prototype[Symbol.iterator]=function(){return this.iter()},uo.prototype[Symbol.iterator]=dy.prototype[Symbol.iterator]=py.prototype[Symbol.iterator]=function(){return this});class uQ{constructor(e,t,n,s){this.from=e,this.to=t,this.number=n,this.text=s}get length(){return this.to-this.from}}function ar(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function mt(i,e,t=!0,n=!0){return cQ(i,e,t,n)}function dQ(i){return i>=56320&&i<57344}function pQ(i){return i>=55296&&i<56320}function Rt(i,e){let t=i.charCodeAt(e);if(!pQ(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return dQ(n)?(t-55296<<10)+(n-56320)+65536:t}function ad(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function Zi(i){return i<65536?1:2}const Tf=/\r\n?|\n/;var pt=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(pt||(pt={}));class Vi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(n!=pt.Simple&&c>=e&&(n==pt.TrackDel&&se||n==pt.TrackBefore&&se))return null;if(c>e||c==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=c}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let n=0,s=0;n=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Vi(e)}static create(e){return new Vi(e)}}class nt extends Vi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Rf(this,(t,n,s,r,o)=>e=e.replace(s,s+(n-t),o),!1),e}mapDesc(e,t=!1){return Mf(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;n.length0&&Pn(n,t,r.text),r.forward(h),l+=h}let c=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,n){let s=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?Se.of(d.split(n||Tf)):d:Se.empty,m=p.length;if(f==u&&m==0)return;fo&>(s,f-o,-1),gt(s,u-f,m),Pn(r,s,p),o=u}}return c(e),a(!l),l}static empty(e){return new nt(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;n.length=0&&t<=0&&t==i[s+1]?i[s]+=e:s>=0&&e==0&&i[s]==0?i[s+1]+=t:n?(i[s]+=e,i[s+1]+=t):i.push(e,t)}function Pn(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(s,c,r,h,f),s=c,r=h}}}function Mf(i,e,t,n=!1){let s=[],r=n?[]:null,o=new Co(i),l=new Co(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);gt(s,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let f=Math.min(h,l.len);c+=f,h-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>c),r.forward2(a),o.forward(a)}}}}class Co{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?Se.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Se.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ss{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,s;return this.empty?n=s=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),n==this.from&&s==this.to?this:new ss(n,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return A.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return A.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return A.range(e.anchor,e.head)}static create(e,t,n){return new ss(e,t,n)}}class A{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:A.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.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 A(e.ranges.map(t=>ss.fromJSON(t)),e.main)}static single(e,t=e){return new A([A.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,s=0;se?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(n);for(let s=1;sr.head?A.range(a,l):A.range(l,a))}}return new A(e,t)}}function gy(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let cd=0;class G{constructor(e,t,n,s,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=s,this.id=cd++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new G(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:hd),!!e.static,e.enables)}of(e){return new ca([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ca(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ca(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function hd(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class ca{constructor(e,t,n,s){this.dependencies=e,this.facet=t,this.type=n,this.value=s,this.id=cd++}dynamicSlot(e){var t;let n=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||h.push(e[f.id]);return{create(f){return f.values[o]=n(f),1},update(f,u){if(a&&u.docChanged||c&&(u.docChanged||u.selection)||Zf(f,h)){let d=n(f);if(l?!Qm(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=La(u,p);if(this.dependencies.every(g=>g instanceof G?u.facet(g)===f.facet(g):g instanceof at?u.field(g,!1)==f.field(g,!1):!0)||(l?Qm(d=n(f),m,s):s(d=n(f),m)))return f.values[o]=m,0}else d=n(f);return f.values[o]=d,1}}}}function Qm(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[a.id]),s=t.map(a=>a.type),r=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let c=[];for(let h=0;hn===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Em).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,s)=>{let r=n.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(n.values[t]=o,1)},reconfigure:(n,s)=>s.config.address[this.id]!=null?(n.values[t]=s.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,Em.of({field:this,create:e})]}get extension(){return this}}const es={lowest:4,low:3,default:2,high:1,highest:0};function jr(i){return e=>new Oy(e,i)}const Wn={highest:jr(es.highest),high:jr(es.high),default:jr(es.default),low:jr(es.low),lowest:jr(es.lowest)};class Oy{constructor(e,t){this.inner=e,this.prec=t}}class el{of(e){return new Df(this,e)}reconfigure(e){return el.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Df{constructor(e,t){this.compartment=e,this.inner=t}}class Da{constructor(e,t,n,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let s=[],r=Object.create(null),o=new Map;for(let u of gQ(e,t,o))u instanceof at?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],c=[];for(let u of s)l[u.id]=c.length<<1,c.push(d=>u.slot(d));let h=n==null?void 0:n.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=h&&h[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,hd(m,d))a.push(n.facet(p));else{let g=p.combine(d.map(O=>O.value));a.push(n&&p.compare(g,n.facet(p))?n.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=c.length<<1,c.push(O=>g.dynamicSlot(O)));l[p.id]=c.length<<1,c.push(g=>mQ(g,p,d))}}let f=c.map(u=>u(l));return new Da(e,o,f,l,a,r)}}function gQ(i,e,t){let n=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let c=n[a].indexOf(o);c>-1&&n[a].splice(c,1),o instanceof Df&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof Df){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),r(c,l)}else if(o instanceof Oy)r(o.inner,o.prec);else if(o instanceof at)n[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof ca)n[l].push(o),o.facet.extensions&&r(o.facet.extensions,es.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(i,es.default),n.reduce((o,l)=>o.concat(l))}function po(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let s=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|s}function La(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const by=G.define(),Lf=G.define({combine:i=>i.some(e=>e),static:!0}),yy=G.define({combine:i=>i.length?i[0]:void 0,static:!0}),Sy=G.define(),wy=G.define(),xy=G.define(),vy=G.define({combine:i=>i.length?i[0]:!1});class mn{constructor(e,t){this.type=e,this.value=t}static define(){return new OQ}}class OQ{of(e){return new mn(this,e)}}class bQ{constructor(e){this.map=e}of(e){return new fe(this,e)}}class fe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new fe(this.type,t)}is(e){return this.type==e}static define(e={}){return new bQ(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let s of e){let r=s.map(t);r&&n.push(r)}return n}}fe.reconfigure=fe.define();fe.appendConfig=fe.define();class Ke{constructor(e,t,n,s,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&gy(n,t.newLength),r.some(l=>l.type==Ke.time)||(this.annotations=r.concat(Ke.time.of(Date.now())))}static create(e,t,n,s,r,o){return new Ke(e,t,n,s,r,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 t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Ke.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Ke.time=mn.define();Ke.userEvent=mn.define();Ke.addToHistory=mn.define();Ke.remote=mn.define();function yQ(i,e){let t=[];for(let n=0,s=0;;){let r,o;if(n=i[n]))r=i[n++],o=i[n++];else if(s=0;s--){let r=n[s](i);r instanceof Ke?i=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Ke?i=r[0]:i=ky(e,Hs(r),!1)}return i}function wQ(i){let e=i.startState,t=e.facet(xy),n=i;for(let s=t.length-1;s>=0;s--){let r=t[s](i);r&&Object.keys(r).length&&(n=_y(n,Nf(e,r,i.changes.newLength),!0))}return n==i?i:Ke.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const xQ=[];function Hs(i){return i==null?xQ:Array.isArray(i)?i:[i]}var Ve=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(Ve||(Ve={}));const vQ=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let If;try{If=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function _Q(i){if(If)return If.test(i);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||vQ.test(t)))return!0}return!1}function kQ(i){return e=>{if(!/\S/.test(e))return Ve.Space;if(_Q(e))return Ve.Word;for(let t=0;t-1)return Ve.Word;return Ve.Other}}class be{constructor(e,t,n,s,r,o){this.config=e,this.doc=t,this.selection=n,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(c,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(fe.reconfigure)?(t=null,n=l.value):l.is(fe.appendConfig)&&(t=null,n=Hs(n).concat(l.value));let r;t?r=e.startState.values.slice():(t=Da.resolve(n,s,this),r=new be(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(Lf)?e.newSelection:e.newSelection.asSingle();new be(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:A.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),s=this.changes(n.changes),r=[n.range],o=Hs(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return be.create({doc:e.doc,selection:A.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Da.resolve(e.extensions||[],new Map),n=e.doc instanceof Se?e.doc:Se.of((e.doc||"").split(t.staticFacet(be.lineSeparator)||Tf)),s=e.selection?e.selection instanceof A?e.selection:A.single(e.selection.anchor,e.selection.head):A.single(0);return gy(s,n.length),t.staticFacet(Lf)||(s=s.asSingle()),new be(t,n,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(be.tabSize)}get lineBreak(){return this.facet(be.lineSeparator)||` `}get readOnly(){return this.facet(vy)}phrase(e,...t){for(let n of this.facet(be.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?n:t[r-1]})),e}languageDataAt(e,t,n=-1){let s=[];for(let r of this.facet(by))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return kQ(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=mt(t,o,!1);if(r(t.slice(a,o))!=Ve.Word)break;o=a}for(;li.length?i[0]:4});be.lineSeparator=yy;be.readOnly=vy;be.phrases=G.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(s=>i[s]==e[s])}});be.languageData=by;be.changeFilter=Sy;be.transactionFilter=wy;be.transactionExtender=xy;el.reconfigure=fe.define();function Yi(i,e,t={}){let n={};for(let s of i)for(let r of Object.keys(s)){let o=s[r],l=n[r];if(l===void 0)n[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))n[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)n[s]===void 0&&(n[s]=e[s]);return n}class Os{eq(e){return this==e}range(e,t=e){return jf.create(e,t,this)}}Os.prototype.startSide=Os.prototype.endSide=0;Os.prototype.point=!1;Os.prototype.mapMode=pt.TrackDel;let jf=class $y{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new $y(e,t,n)}};function Xf(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class fd{constructor(e,t,n,s){this.from=e,this.to=t,this.value=n,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,s=0){let r=n?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,n,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);rd||u==d&&c.startSide>0&&c.endSide<=0)continue;(d-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(l=Math.max(l,d-u)),n.push(c),s.push(u-o),r.push(d-o))}return{mapped:n.length?new fd(s,r,n,l):null,pos:o}}}class ve{constructor(e,t,n,s){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=s}static create(e,t,n,s){return new ve(e,t,n,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Xf)),this.isEmpty)return t.length?ve.of(t):this;let l=new Py(this,null,-1).goto(0),a=0,c=[],h=new hn;for(;l.value||a=0){let f=t[a++];h.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Ao.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ao.from(e).goto(t)}static compare(e,t,n,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Cm(o,l,n),c=new Xr(o,a,r),h=new Xr(l,a,r);n.iterGaps((f,u,d)=>Am(c,f,h,u,d,s)),n.empty&&n.length==0&&Am(c,0,h,0,0,s)}static eq(e,t,n=0,s){s==null&&(s=999999999);let r=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Cm(r,o),a=new Xr(r,l,0).goto(n),c=new Xr(o,l,0).goto(n);for(;;){if(a.to!=c.to||!Vf(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>s)return!0;a.next(),c.next()}}static spans(e,t,n,s,r=-1){let o=new Xr(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let c=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new hn;for(let s of e instanceof jf?[e]:t?$Q(e):e)n.add(s.from,s.to,s.value);return n.finish()}static join(e){if(!e.length)return ve.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let s=e[n];s!=ve.empty;s=s.nextLayer)t=new ve(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}}ve.empty=new ve([],[],null,-1);function $Q(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(Xf);e=n}return i}ve.empty.nextLayer=ve.empty;class hn{finishChunk(e){this.chunks.push(new fd(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new hn)).add(e,t,n)}addInner(e,t,n){let s=e-this.lastTo||n.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(ve.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=ve.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Cm(i,e,t){let n=new Map;for(let r of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&s.push(new Py(o,t,n,r));return s.length==1?s[0]:new Ao(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)bh(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)bh(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),bh(this.heap,0)}}}function bh(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let s=i[n];if(n+1=0&&(s=i[n+1],n++),t.compare(s)<0)break;i[n]=t,i[e]=s,e=n}}class Xr{constructor(e,t,n){this.minPoint=n,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=Ao.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){vl(this.active,e),vl(this.activeTo,e),vl(this.activeRank,e),this.minActive=Tm(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:s,rank:r}=this.cursor;for(;t0;)t++;_l(this.active,t,n),_l(this.activeTo,t,s),_l(this.activeRank,t,r),e&&_l(e,t,this.cursor.from),this.minActive=Tm(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),n&&vl(n,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[s]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Am(i,e,t,n,s,r){i.goto(e),t.goto(n);let o=n+s,l=n,a=n-e;for(;;){let c=i.to+a-t.to,h=c||i.endSide-t.endSide,f=h<0?i.to+a:t.to,u=Math.min(f,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Vf(i.activeForPoint(i.to),t.activeForPoint(t.to))||r.comparePoint(l,u,i.point,t.point):u>l&&!Vf(i.active,t.active)&&r.compareRange(l,u,i.active,t.active),f>o)break;(c||i.openEnd!=t.openEnd)&&r.boundChange&&r.boundChange(f),l=f,h<=0&&i.next(),h>=0&&t.next()}}function Vf(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function Tm(i,e){let t=-1,n=1e9;for(let s=0;s=e)return s;if(s==i.length)break;r+=i.charCodeAt(s)==9?t-r%t:1,s=mt(i,s)}return n===!0?-1:i.length}const Wf="ͼ",Rm=typeof Symbol>"u"?"__"+Wf:Symbol.for(Wf),qf=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Mm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Mn{constructor(e,t){this.rules=[];let{finish:n}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let h=[],f=/^@(\w+)\b/.exec(o[0]),u=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))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,h,u)}else p!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(h.length||u)&&a.push((n&&!f&&!c?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=Mm[Rm]||1;return Mm[Rm]=e+1,Wf+e.toString(36)}static mount(e,t,n){let s=e[qf],r=n&&n.nonce;s?r&&s.setNonce(r):s=new PQ(e,r),s.mount(Array.isArray(t)?t:[t],e)}}let Zm=new Map;class PQ{constructor(e,t){let n=e.ownerDocument||e,s=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=Zm.get(n);if(r)return e[qf]=r;this.sheet=new s.CSSStyleSheet,Zm.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[qf]=this}mount(e,t){let n=this.sheet,s=0,r=0;for(let o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),n)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},QQ=typeof navigator<"u"&&/Mac/.test(navigator.platform),EQ=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ft=0;ft<10;ft++)Zn[48+ft]=Zn[96+ft]=String(ft);for(var ft=1;ft<=24;ft++)Zn[ft+111]="F"+ft;for(var ft=65;ft<=90;ft++)Zn[ft]=String.fromCharCode(ft+32),To[ft]=String.fromCharCode(ft);for(var yh in Zn)To.hasOwnProperty(yh)||(To[yh]=Zn[yh]);function CQ(i){var e=QQ&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||EQ&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?To:Zn)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Ro(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Uf(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function ha(i,e){if(!e.anchorNode)return!1;try{return Uf(i,e.anchorNode)}catch{return!1}}function cr(i){return i.nodeType==3?ys(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function mo(i,e,t,n){return t?Dm(i,e,t,n,-1)||Dm(i,e,t,n,1):!1}function bs(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function Na(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function Dm(i,e,t,n,s){for(;;){if(i==t&&e==n)return!0;if(e==(s<0?0:Ui(i))){if(i.nodeName=="DIV")return!1;let r=i.parentNode;if(!r||r.nodeType!=1)return!1;e=bs(i)+(s<0?0:1),i=r}else if(i.nodeType==1){if(i=i.childNodes[e+(s<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=s<0?Ui(i):0}else return!1}}function Ui(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function tl(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function AQ(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Qy(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function TQ(i,e,t,n,s,r,o,l){let a=i.ownerDocument,c=a.defaultView||window;for(let h=i,f=!1;h&&!f;)if(h.nodeType==1){let u,d=h==a.body,p=1,m=1;if(d)u=AQ(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(f=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let S=h.getBoundingClientRect();({scaleX:p,scaleY:m}=Qy(h,S)),u={left:S.left,right:S.left+h.clientWidth*p,top:S.top,bottom:S.top+h.clientHeight*m}}let g=0,O=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+O&&(O=e.bottom-u.bottom+O+o)):e.bottom>u.bottom&&(O=e.bottom-u.bottom+o,t<0&&e.top-O0&&e.right>u.right+g&&(g=e.right-u.right+g+r)):e.right>u.right&&(g=e.right-u.right+r,t<0&&e.lefts.clientHeight&&(n=s),!t&&s.scrollWidth>s.clientWidth&&(t=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:t,y:n}}class MQ{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Ui(t):0),n,Math.min(e.focusOffset,n?Ui(n):0))}set(e,t,n,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=s}}let Cs=null;function Ey(i){if(i.setActive)return i.setActive();if(Cs)return i.focus(Cs);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(Cs==null?{get preventScroll(){return Cs={preventScroll:!0},!0}}:void 0),!Cs){Cs=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function Ty(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Ui(t)}else if(t.parentNode&&!Na(t))n=bs(t),t=t.parentNode;else return null}}function Ry(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&nt)return f.domBoundsAround(e,t,c);if(u>=e&&s==-1&&(s=a,r=c),c>t&&f.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+f.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=ud){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Zy(i,e,t,n,s,r,o,l,a){let{children:c}=i,h=c.length?c[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==n&&h&&!o&&!u&&r.length<2&&h.merge(t,s,r.length?f:null,t==0,l,a))){if(n0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t2);var F={mac:Xm||/Mac/.test(Mt.platform),windows:/Win/.test(Mt.platform),linux:/Linux|X11/.test(Mt.platform),ie:Dc,ie_version:Ly?zf.documentMode||6:Ff?+Ff[1]:Yf?+Yf[1]:0,gecko:Im,gecko_version:Im?+(/Firefox\/(\d+)/.exec(Mt.userAgent)||[0,0])[1]:0,chrome:!!Sh,chrome_version:Sh?+Sh[1]:0,ios:Xm,android:/Android\b/.test(Mt.userAgent),webkit:jm,safari:Ny,webkit_version:jm?+(/\bAppleWebKit\/(\d+)/.exec(Mt.userAgent)||[0,0])[1]:0,tabSize:zf.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const LQ=256;class bi extends Re{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof bi)||this.length-(t-e)+n.length>LQ||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new bi(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new St(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return NQ(this.dom,e,t)}}class fn extends Re{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let s of t)s.setParent(this)}setAttrs(e){if(Cy(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,s,r,o){return n&&(!(n instanceof fn&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(s=r),n=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new fn(this.mark,t,o)}domAtPos(e){return Iy(this,e)}coordsAt(e,t){return Xy(this,e,t)}}function NQ(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let s=e,r=e,o=0;e==0&&t<0||e==n&&t>=0?F.chrome||F.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return F.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?tl(a,o<0):a||null}class Qn extends Re{static create(e,t,n){return new Qn(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=Qn.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,s,r,o){return n&&(!(n instanceof Qn)||!this.widget.compare(n.widget)||e>0&&r<=0||t0)?St.before(this.dom):St.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?St.before(this.dom):St.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Se.empty}get isHidden(){return!0}}bi.prototype.children=Qn.prototype.children=hr.prototype.children=ud;function Iy(i,e){let t=i.dom,{children:n}=i,s=0;for(let r=0;sr&&e0;r--){let o=n[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof fn&&s.length&&(n=s[s.length-1])instanceof fn&&n.mark.eq(e.mark)?jy(n,e.children[0],t-1):(s.push(e),e.setParent(i)),i.length+=e.length}function Xy(i,e,t){let n=null,s=-1,r=null,o=-1;function l(c,h){for(let f=0,u=0;f=h&&(d.children.length?l(d,h-u):(!r||r.isHidden&&t>0)&&(p>h||u==p&&d.getSide()>0)?(r=d,o=h-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of n)if(r!=t&&(s.indexOf(r)==-1||i[r]!==e[r]))return!1;return!0}function Gf(i,e,t){let n=!1;if(e)for(let s in e)t&&s in t||(n=!0,s=="style"?i.style.cssText="":i.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(n=!0,s=="style"?i.style.cssText=t[s]:i.setAttribute(s,t[s]));return n}function jQ(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Dn(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,s;if(e.isBlockGap)n=-5e8,s=4e8;else{let{start:r,end:o}=Vy(e,t);n=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Dn(e,n,s,t,e.widget||null,!0)}static line(e){return new nl(e)}static set(e,t=!1){return ve.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}te.none=ve.empty;class il extends te{constructor(e){let{start:t,end:n}=Vy(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof il&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Ia(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}il.prototype.point=!1;class nl extends te{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof nl&&this.spec.class==e.spec.class&&Ia(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}nl.prototype.mapMode=pt.TrackBefore;nl.prototype.point=!0;class Dn extends te{constructor(e,t,n,s,r,o){super(t,n,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?pt.TrackBefore:pt.TrackAfter:pt.TrackDel}get type(){return this.startSide!=this.endSide?Pt.WidgetRange:this.startSide<=0?Pt.WidgetBefore:Pt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Dn&&XQ(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Dn.prototype.point=!0;function Vy(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function XQ(i,e){return i==e||!!(i&&e&&i.compare(e))}function fa(i,e,t,n=0){let s=t.length-1;s>=0&&t[s]+n>=i?t[s]=Math.max(t[s],e):t.push(i,e)}class Ge extends Re{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,s,r,o){if(n){if(!(n instanceof Ge))return!1;this.dom||n.transferDOM(this)}return s&&this.setDeco(n?n.attrs:null),Dy(this,e,t,n?n.children.slice():[],r,o),!0}split(e){let t=new Ge;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:s}=this.childPos(e);s&&(t.append(this.children[n].split(s),0),this.children[n].merge(s,this.children[n].length,null,!1,0,0),n++);for(let r=n;r0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Ia(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){jy(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Hf(t,this.attrs||{})),n&&(this.attrs=Hf({class:n},this.attrs||{}))}domAtPos(e){return Iy(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Cy(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Gf(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&Re.get(s)instanceof fn;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((n=Re.get(s))===null||n===void 0?void 0:n.isEditable)==!1&&(!F.ios||!this.children.some(r=>r instanceof bi))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof bi)||/[^ -~]/.test(n.text))return null;let s=cr(n.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Xy(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=n.bottom-n.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof Ge)return r;if(o>t)break}s=o+r.breakAfter}return null}}class ln extends Re{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,s,r,o){return n&&(!(n instanceof ln)||!this.widget.compare(n.widget)||e>0&&r<=0||t0}}class Kf extends Fi{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class go{constructor(e,t,n,s){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ln&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ge),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(kl(new hr(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ln)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(kl(new bi(this.text.slice(this.textOff,this.textOff+s)),t),n),this.atCursorPos=!0,this.textOff+=s,e-=s,n=0}}span(e,t,n,s){this.buildText(t-e,n,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,n,s,r,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Dn){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof Dn)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ln(n.widget||fr.block,l,n));else{let a=Qn.create(n.widget||fr.inline,l,l?0:n.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),h=!a.isEditable&&(es.length||n.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(f.append(kl(new hr(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(kl(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,s,r){let o=new go(e,t,n,r);return o.openEnd=ve.spans(s,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function kl(i,e){for(let t of e)i=new fn(t,[i],i.length);return i}class fr extends Fi{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}}fr.inline=new fr("span");fr.block=new fr("div");var je=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(je||(je={}));const Ss=je.LTR,dd=je.RTL;function By(i){let e=[];for(let t=0;t=t){if(l.level==n)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function qy(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(Qi[m+1]==-d){let g=Qi[m+2],O=g&2?s:g&4?g&1?r:s:0;O&&(Ce[f]=Ce[Qi[m]]=O),l=m;break}}else{if(Qi.length==189)break;Qi[l++]=f,Qi[l++]=u,Qi[l++]=a}else if((p=Ce[f])==2||p==1){let m=p==s;a=m?0:1;for(let g=l-3;g>=0;g-=3){let O=Qi[g+2];if(O&2)break;if(m)Qi[g+2]|=2;else{if(O&4)break;Qi[g+2]|=4}}}}}function zQ(i,e,t,n){for(let s=0,r=n;s<=t.length;s++){let o=s?t[s-1].to:i,l=sa;)p==g&&(p=t[--m].from,g=m?t[m-1].to:i),Ce[--p]=d;a=h}else r=c,a++}}}function eu(i,e,t,n,s,r,o){let l=n%2?2:1;if(n%2==s%2)for(let a=e,c=0;aa&&o.push(new En(a,m.from,d));let g=m.direction==Ss!=!(d%2);tu(i,g?n+1:n,s,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==t||(h?Ce[p]!=l:Ce[p]==l))break;p++}u?eu(i,a,p,n+1,s,u,o):ae;){let h=!0,f=!1;if(!c||a>r[c-1].to){let m=Ce[a-1];m!=l&&(h=!1,f=m==16)}let u=!h&&l==1?[]:null,d=h?n:n+1,p=a;e:for(;;)if(c&&p==r[c-1].to){if(f)break e;let m=r[--c];if(!h)for(let g=m.from,O=c;;){if(g==e)break e;if(O&&r[O-1].to==g)g=r[--O].from;else{if(Ce[g-1]==l)break e;break}}if(u)u.push(m);else{m.toCe.length;)Ce[Ce.length]=256;let n=[],s=e==Ss?0:1;return tu(i,s,s,t,0,i.length,n),n}function Uy(i){return[new En(0,i,0)]}let zy="";function FQ(i,e,t,n,s){var r;let o=n.head-i.from,l=En.find(e,o,(r=n.bidiLevel)!==null&&r!==void 0?r:-1,n.assoc),a=e[l],c=a.side(s,t);if(o==c){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),c=a.side(s,t)}let h=mt(i.text,o,a.forward(s,t));(ha.to)&&(h=c),zy=i.text.slice(Math.min(o,h),Math.max(o,h));let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return f&&h==c&&f.level+(s?0:1)i.some(e=>e)}),tS=G.define({combine:i=>i.some(e=>e)}),iS=G.define();class Ks{constructor(e,t="nearest",n="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Ks(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 Ks(A.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $l=fe.define({map:(i,e)=>i.map(e)}),nS=fe.define();function Lt(i,e,t){let n=i.facet(Gy);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const sn=G.define({combine:i=>i.length?i[0]:!0});let GQ=0;const Hr=G.define();class Fe{constructor(e,t,n,s,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:s,provide:r,decorations:o}=t||{};return new Fe(GQ++,e,n,s,l=>{let a=[Hr.of(l)];return o&&a.push(Mo.of(c=>{let h=c.plugin(l);return h?o(h):te.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return Fe.define(n=>new e(n),t)}}class wh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Lt(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Lt(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){Lt(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const sS=G.define(),gd=G.define(),Mo=G.define(),rS=G.define(),Od=G.define(),oS=G.define();function Bm(i,e){let t=i.state.facet(oS);if(!t.length)return t;let n=t.map(r=>r instanceof Function?r(i):r),s=[];return ve.spans(n,e.from,e.to,{point(){},span(r,o,l,a){let c=r-e.from,h=o-e.from,f=s;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=HQ(e.text,c,h)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=h,f=p.inner;else{let m={from:c,to:h,direction:d,inner:[]};f.push(m),f=m.inner}}}}),s}const lS=G.define();function bd(i){let e=0,t=0,n=0,s=0;for(let r of i.state.facet(lS)){let o=r(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:n,bottom:s}}const Gr=G.define();class oi{constructor(e,t,n,s){this.fromA=e,this.toA=t,this.fromB=n,this.toB=s}join(e){return new oi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>n.toA)){if(s.toAh)break;r+=2}if(!a)return n;new oi(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,l=a.toB}}}class ja{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=nt.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new oi(r,o,l,a))),this.changedRanges=s}static create(e,t,n){return new ja(e,t,n)}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}}class Wm extends Re{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=te.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Ge],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new oi(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:h})=>hthis.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 s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!sE(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?JQ(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;n=new oi(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(F.ie||F.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=iE(o,l,e.changes);return n=oi.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=F.chrome||F.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:f}=l,u,d,p,m;if(n&&n.range.fromBh){let x=go.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),v=go.build(this.view.state.doc,n.range.toB,f,this.decorations,this.dynamicDecorationMap);d=x.breakAtStart,p=x.openStart,m=v.openEnd;let $=this.compositionView(n);v.breakAtStart?$.breakAfter=1:v.content.length&&$.merge($.length,$.length,v.content[0],!1,v.openStart,0)&&($.breakAfter=v.content[0].breakAfter,v.content.shift()),x.content.length&&$.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),u=x.content.concat($).concat(v.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=go.build(this.view.state.doc,h,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:O}=r.findPos(c,1),{i:S,off:_}=r.findPos(a,-1);Zy(this,S,_,g,O,u,d,p,m)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(nS)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new bi(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new fn(s,[t],t.length);let n=new Ge;return n.append(t,0),n}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=Re.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},n=this.childPos(e.range.fromB,1),s=this.children[n.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)n=s.childPos(n.off,1),s=s.children[n.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,s=n==this.dom,r=!s&&!(this.view.state.facet(sn)||this.dom.tabIndex>-1)&&ha(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(F.gecko&&l.empty&&!this.hasComposition&&KQ(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=c=new St(f,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!mo(a.node,a.offset,h.anchorNode,h.anchorOffset)||!mo(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{F.android&&F.chrome&&this.dom.contains(h.focusNode)&&nE(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=Ro(this.view.root);if(f)if(l.empty){if(F.gecko){let u=eE(a.node,a.offset);if(u&&u!=3){let d=(u==1?Ty:Ry)(a.node,a.offset);d&&(a=new St(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new St(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new St(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&mo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Ro(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=Ge.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&n.collapse(s,r)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let s=e.offset;!n&&s=0;s--){let r=Re.get(t.childNodes[s]);r instanceof Ge&&(n=r.domAtPos(r.length))}return n?new St(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=Re.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof Ge&&!(n instanceof Ge&&t>=0)))n=l,s=c;else if(n&&c==e&&a==e&&l instanceof ln&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(n=null)}r=c}return n?n.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),s=this.children[t];if(!(s instanceof Ge))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(n,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}n=a}if(!(s instanceof bi))return null;let r=mt(s.text,n);if(r==n)return null;let o=ys(s.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==je.LTR;for(let c=0,h=0;hs)break;if(c>=n){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?cr(p):[];if(m.length){let g=m[m.length-1],O=a?g.right-d.left:d.right-g.left;O>l&&(l=O,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?je.RTL:je.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Ge){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=cr(e.firstChild)[0];t=e.getBoundingClientRect().height,n=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new My(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(te.replace({widget:new Kf(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return te.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Mo).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),n=!1,s=this.view.state.facet(rS).map((r,o)=>{let l=typeof r=="function";return l&&(n=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=n,t.push(ve.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),s;if(!n)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,s.left),top:Math.min(n.top,s.top),right:Math.max(n.right,s.right),bottom:Math.max(n.bottom,s.bottom)});let r=bd(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;TQ(this.view.scrollDOM,o,t.head{ne.from&&(t=!0)}),t}function rE(i,e,t=1){let n=i.charCategorizer(e),s=i.doc.lineAt(e),r=e-s.from;if(s.length==0)return A.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=mt(s.text,r,!1):l=mt(s.text,r);let a=n(s.text.slice(o,l));for(;o>0;){let c=mt(s.text,o,!1);if(n(s.text.slice(c,o))!=a)break;o=c}for(;li?e.left-i:Math.max(0,i-e.right)}function lE(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function xh(i,e){return i.tope.top+1}function qm(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function nu(i,e,t){let n,s,r,o,l=!1,a,c,h,f;for(let p=i.firstChild;p;p=p.nextSibling){let m=cr(p);for(let g=0;g_||o==_&&r>S){n=p,s=O,r=S,o=_;let x=_?t0?g0)}S==0?t>O.bottom&&(!h||h.bottomO.top)&&(c=p,f=O):h&&xh(h,O)?h=Um(h,O.bottom):f&&xh(f,O)&&(f=qm(f,O.top))}}if(h&&h.bottom>=t?(n=a,s=h):f&&f.top<=t&&(n=c,s=f),!n)return{node:i,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(n.nodeType==3)return zm(n,u,t);if(l&&n.contentEditable!="false")return nu(n,u,t);let d=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(s.left+s.right)/2?1:0);return{node:i,offset:d}}function zm(i,e,t){let n=i.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&f=(h.left+h.right)/2,d=u;if((F.chrome||F.gecko)&&ys(i,l).getBoundingClientRect().left==h.right&&(d=!u),f<=0)return{node:i,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:i,offset:s>-1?s:o>0?i.nodeValue.length:0}}function cS(i,e,t,n=-1){var s,r;let o=i.contentDOM.getBoundingClientRect(),l=o.top+i.viewState.paddingTop,a,{docHeight:c}=i.viewState,{x:h,y:f}=e,u=f-l;if(u<0)return 0;if(u>c)return i.state.doc.length;for(let x=i.viewState.heightOracle.textHeight/2,v=!1;a=i.elementAtHeight(u),a.type!=Pt.Text;)for(;u=n>0?a.bottom+x:a.top-x,!(u>=0&&u<=c);){if(v)return t?null:0;v=!0,n=-n}f=l+u;let d=a.from;if(di.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:Ym(i,o,a,h,f);let p=i.dom.ownerDocument,m=i.root.elementFromPoint?i.root:p,g=m.elementFromPoint(h,f);g&&!i.contentDOM.contains(g)&&(g=null),g||(h=Math.max(o.left+1,Math.min(o.right-1,h)),g=m.elementFromPoint(h,f),g&&!i.contentDOM.contains(g)&&(g=null));let O,S=-1;if(g&&((s=i.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let x=p.caretPositionFromPoint(h,f);x&&({offsetNode:O,offset:S}=x)}else if(p.caretRangeFromPoint){let x=p.caretRangeFromPoint(h,f);x&&({startContainer:O,startOffset:S}=x,(!i.contentDOM.contains(O)||F.safari&&aE(O,S,h)||F.chrome&&cE(O,S,h))&&(O=void 0))}O&&(S=Math.min(Ui(O),S))}if(!O||!i.docView.dom.contains(O)){let x=Ge.find(i.docView,d);if(!x)return u>a.top+a.height/2?a.to:a.from;({node:O,offset:S}=nu(x.dom,h,f))}let _=i.docView.nearest(O);if(!_)return null;if(_.isWidget&&((r=_.dom)===null||r===void 0?void 0:r.nodeType)==1){let x=_.dom.getBoundingClientRect();return e.yi.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(i.defaultLineHeight-l)*.5)/l);r+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+Bf(o,r,i.state.tabSize)}function aE(i,e,t){let n;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(let s=i.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return ys(i,n-1,n).getBoundingClientRect().left>t}function cE(i,e,t){if(e!=0)return!1;for(let s=i;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let n=i.nodeType==1?i.getBoundingClientRect():ys(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function su(i,e){let t=i.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==Pt.Text))return n}return t}function hE(i,e,t,n){let s=su(i,e.head),r=!n||s.type!=Pt.Text||!(i.lineWrapping||s.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(s.from),a=i.posAtCoords({x:t==(l==je.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return A.cursor(a,t?-1:1)}return A.cursor(t?s.to:s.from,t?-1:1)}function Fm(i,e,t,n){let s=i.state.doc.lineAt(e.head),r=i.bidiSpans(s),o=i.textDirectionAt(s.from);for(let l=e,a=null;;){let c=FQ(s,r,o,l,t),h=zy;if(!c){if(s.number==(t?i.state.doc.lines:1))return l;h=` `,s=i.state.doc.line(s.number+(t?1:-1)),r=i.bidiSpans(s),c=i.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!n)return c;a=n(h)}l=c}}function fE(i,e,t){let n=i.state.charCategorizer(e),s=n(t);return r=>{let o=n(r);return s==Ve.Space&&(s=o),s==o}}function uE(i,e,t,n){let s=e.head,r=t?1:-1;if(s==(t?i.state.doc.length:0))return A.cursor(s,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),c=i.coordsAtPos(s,e.assoc||-1),h=i.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let d=i.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+h}let f=a.left+o,u=n??i.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=cS(i,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms)){let g=i.docView.coordsForChar(m),O=!g||p{if(e>r&&es(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:A.cursor(n,nr)&&this.lineBreak(),s=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(n,r<0?t.length:r)),r<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);n=r+o}}readNode(e){if(e.cmIgnore)return;let t=Re.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let s=n.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(pE(e,n.node,n.offset)?t:0))}}function pE(i,e,t){for(;;){if(!e||t-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let l=r||o?[]:bE(e),a=new dE(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=yE(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Uf(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Uf(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((F.ios||F.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.toDate.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,c=null;(r===8||F.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:i.state.doc.slice(s.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,s.to))}:F.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` `&&i.lineWrapping&&(n&&(n=A.single(n.main.anchor-1,n.main.head-1)),t={from:s.from,to:s.to,insert:Se.of([" "])}),t)return yd(i,t,n,r);if(n&&!n.main.eq(s)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function yd(i,e,t,n=-1){if(F.ios&&i.inputState.flushIOSKey(e))return!0;let s=i.state.selection.main;if(F.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&i.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Gs(i.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||n==8&&e.insert.lengths.head)&&Gs(i.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Gs(i.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=gE(i,e,t));return i.state.facet(Ky).some(a=>a(i,e.from,e.to,r,l))||i.dispatch(l()),!0}function gE(i,e,t){let n,s=i.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";n=s.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let c=i.state.sliceDoc(e.from,e.to),h,f=t&&aS(i,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-p}}else h=i.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;n=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let m=p.to-u,g=m-c.length;if(p.to-p.from!=d||i.state.sliceDoc(g,m)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let O=s.changes({from:g,to:m,insert:e.insert}),S=p.to-r.to;return{changes:O,range:a?A.range(Math.max(0,a.anchor+S),Math.max(0,a.head+S)):p.map(O)}})}else n={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),s.update(n,{userEvent:o,scrollIntoView:!0})}function OE(i,e,t,n){let s=Math.min(i.length,e.length),r=0;for(;r0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function bE(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:s,focusOffset:r}=i.observer.selectionRange;return t&&(e.push(new Hm(t,n)),(s!=t||r!=n)&&e.push(new Hm(s,r))),e}function yE(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?A.single(t+e,n+e):null}class SE{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,F.safari&&e.contentDOM.addEventListener("input",()=>null),F.gecko&&DE(e.contentDOM.ownerDocument)}handleEvent(e){!QE(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let s of n.observers)s(this.view,t);for(let s of n.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=wE(e),n=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=n[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in n)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&uS.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),F.android&&F.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return F.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=fS.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||xE.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:F.safari&&!F.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Gm(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(s){Lt(t.state,s)}}}function wE(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let s=n.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(Gm(n.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(Gm(n.value,o))}}for(let n in yi)t(n).handlers.push(yi[n]);for(let n in ci)t(n).observers.push(ci[n]);return e}const fS=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],xE="dthko",uS=[16,17,18,20,91,92,224,225],Pl=6;function Ql(i){return Math.max(0,i)*.7+8}function vE(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}class _E{constructor(e,t,n,s){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=RQ(e.contentDOM),this.atoms=e.state.facet(Od).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(be.allowMultipleSelections)&&kE(e,t),this.dragging=PE(e,t)&&mS(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&vE(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=bd(this.view);e.clientX-a.left<=s+Pl?t=-Ql(s-e.clientX):e.clientX+a.right>=o-Pl&&(t=Ql(e.clientX-o)),e.clientY-a.top<=r+Pl?n=-Ql(r-e.clientY):e.clientY+a.bottom>=l-Pl&&(n=Ql(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function kE(i,e){let t=i.state.facet(Yy);return t.length?t[0](e):F.mac?e.metaKey:e.ctrlKey}function $E(i,e){let t=i.state.facet(Fy);return t.length?t[0](e):F.mac?!e.altKey:!e.ctrlKey}function PE(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=Ro(i.root);if(!n||n.rangeCount==0)return!0;let s=n.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function QE(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=Re.get(t))&&n.ignoreEvent(e))return!1;return!0}const yi=Object.create(null),ci=Object.create(null),dS=F.ie&&F.ie_version<15||F.ios&&F.webkit_version<604;function EE(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),pS(i,t.value)},50)}function Lc(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function pS(i,e){e=Lc(i.state,pd,e);let{state:t}=i,n,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(ru!=null&&t.selection.ranges.every(a=>a.empty)&&ru==r.toString()){let a=-1;n=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:f},range:A.cursor(c.from+f.length)}})}else o?n=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:A.cursor(a.from+c.length)}}):n=t.replaceSelection(r);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}ci.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};yi.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);ci.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};ci.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};yi.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(Hy))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=TE(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new _E(i,e,t,n)),n&&i.observer.ignore(()=>{Ey(i.contentDOM);let r=i.root.activeElement;r&&!r.contains(i.contentDOM)&&r.blur()});let s=i.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function Km(i,e,t,n){if(n==1)return A.cursor(e,t);if(n==2)return rE(i.state,e,t);{let s=Ge.find(i.docView,e),r=i.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return le>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function CE(i,e,t,n){let s=Ge.find(i.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Jm(t,n,o))return-1;let l=s.coordsAt(r,1);return l&&Jm(t,n,l)?1:o&&o.bottom>=n?-1:1}function eg(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:CE(i,t,e.clientX,e.clientY)}}const AE=F.ie&&F.ie_version<=11;let tg=null,ig=0,ng=0;function mS(i){if(!AE)return i.detail;let e=tg,t=ng;return tg=i,ng=Date.now(),ig=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(ig+1)%3:1}function TE(i,e){let t=eg(i,e),n=mS(e),s=i.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=eg(i,r),c,h=Km(i,a.pos,a.bias,n);if(t.pos!=a.pos&&!o){let f=Km(i,t.pos,t.bias,n),u=Math.min(f.from,h.from),d=Math.max(f.to,h.to);h=u1&&(c=RE(s,a.pos))?c:l?s.addRange(h):A.create([h])}}}function RE(i,e){for(let t=0;t=e)return A.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}yi.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let s=i.docView.nearest(e.target);if(s&&s.isWidget){let r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=A.range(r,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Lc(i.state,md,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};yi.dragend=i=>(i.inputState.draggedContent=null,!1);function sg(i,e,t,n){if(t=Lc(i.state,pd,t),!t)return;let s=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=i.inputState,o=n&&r&&$E(i,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}yi.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),s=0,r=()=>{++s==t.length&&sg(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return sg(i,e,n,!0),!0}return!1};yi.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=dS?null:e.clipboardData;return t?(pS(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(EE(i),!1)};function ME(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function ZE(i){let e=[],t=[],n=!1;for(let s of i.selection.ranges)s.empty||(e.push(i.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of i.selection.ranges){let o=i.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),s=o.number}n=!0}return{text:Lc(i,md,e.join(i.lineBreak)),ranges:t,linewise:n}}let ru=null;yi.copy=yi.cut=(i,e)=>{let{text:t,ranges:n,linewise:s}=ZE(i.state);if(!t&&!s)return!1;ru=s?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=dS?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(ME(i,t),!1)};const gS=mn.define();function OS(i,e){let t=[];for(let n of i.facet(Jy)){let s=n(i,e);s&&t.push(s)}return t?i.update({effects:t,annotations:gS.of(!0)}):null}function bS(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=OS(i.state,e);t?i.dispatch(t):i.update([])}},10)}ci.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),bS(i)};ci.blur=i=>{i.observer.clearSelectionRange(),bS(i)};ci.compositionstart=ci.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};ci.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,F.chrome&&F.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};ci.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};yi.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let r=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),c=i.posAtDOM(l.endContainer,l.endOffset);return yd(i,{from:a,to:c,insert:i.state.toText(r)},null),!0}}let s;if(F.chrome&&F.android&&(s=fS.find(r=>r.inputType==e.inputType))&&(i.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return F.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),F.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>ci.compositionend(i,e),20),!1};const rg=new Set;function DE(i){rg.has(i)||(rg.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}const og=["pre-wrap","normal","pre-line","break-spaces"];let ur=!1;function lg(){ur=!1}class LE{constructor(e){this.lineWrapping=e,this.doc=Se.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return og.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>da&&(ur=!0),this.height=e)}replace(e,t,n){return Qt.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,s){let r=this,o=n.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:f}=s[l],u=r.lineAt(a,Ie.ByPosNoHeight,n.setDoc(t),0,0),d=u.to>=c?u:r.lineAt(c,Ie.ByPosNoHeight,n,0,0);for(f+=d.to-c,c=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,s-=l.size}else if(r>s*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,n,s,r))}updateHeight(e,t=0,n=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class zt extends yS{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,s){return new Di(s,this.length,n,this.height,this.breaks)}replace(e,t,n){let s=n[0];return n.length==1&&(s instanceof zt||s instanceof ct&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ct?s=new zt(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):Qt.of(n)}updateHeight(e,t=0,n=!1,s){return s&&s.from<=t&&s.more?this.setHeight(s.heights[s.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ct extends Qt{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,n,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let c=s+(e0){let r=n[n.length-1];r instanceof ct?n[n.length-1]=new ct(r.length+s):n.push(null,new ct(s-1))}if(e>0){let r=n[0];r instanceof ct?n[0]=new ct(e+r.length):n.unshift(new ct(e-1),null)}return Qt.of(n)}decomposeLeft(e,t){t.push(new ct(e-1),null)}decomposeRight(e,t){t.push(null,new ct(this.length-e-1))}updateHeight(e,t=0,n=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new ct(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=da&&(a=-2);let u=new zt(h,f);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new ct(r-l).updateHeight(e,l));let c=Qt.of(o);return(a<0||Math.abs(c.height-this.height)>=da||Math.abs(a-this.heightMetrics(e,t).perLine)>=da)&&(ur=!0),Xa(this,c)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class IE extends Qt{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,s){let r=n+this.left.height;return el))return c;let h=t==Ie.ByPosNoHeight?Ie.ByPosNoHeight:Ie.ByPos;return a?c.join(this.right.lineAt(l,h,n,o,l)):this.left.lineAt(l,h,n,s,r).join(c)}forEachLine(e,t,n,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,o);else{let c=this.lineAt(a,Ie.ByPos,n,s,r);e=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,l,a,o)}}replace(e,t,n){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of n)r.push(l);if(e>0&&ag(r,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,s=n+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?Qt.of(this.break?[e,null,t]:[e,t]):(this.left=Xa(this.left,e),this.right=Xa(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,n,s):r.updateHeight(e,t,n),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,n,s):o.updateHeight(e,l,n),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ag(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof ct&&(n=i[e+1])instanceof ct&&i.splice(e-1,3,new ct(t.length+1+n.length))}const jE=5;class Sd{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof zt?s.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new zt(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=jE)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new zt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new ct(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof zt)return e;let t=new zt(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let s=this.ensureLine();s.length+=n,s.collapsed+=n,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof zt)&&!this.isCovered?this.nodes.push(new zt(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&f.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(c==i.parentNode?s.innerHeight:a,u.bottom)}c=f.position=="absolute"||f.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function WE(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function qE(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class _h{constructor(e,t,n,s){this.from=e,this.to=t,this.size=n,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new LE(t),this.stateDeco=e.facet(Mo).filter(n=>typeof n!="function"),this.heightMap=Qt.empty().applyChanges(this.stateDeco,Se.empty,this.heightOracle.setDoc(e.doc),[new oi(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=te.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let s=n?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new El(r,o))}}return this.viewports=e.sort((n,s)=>n.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?hg:new wd(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(Jr(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(Mo).filter(h=>typeof h!="function");let s=e.changedRanges,r=oi.extendWithRanges(s,XE(n,this.stateDeco,e?e.changes:nt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);lg(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||ur)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));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),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(tS)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),s=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?je.RTL:je.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:x,scaleY:v}=Qy(t,l);(x>.005&&Math.abs(this.scaleX-x)>.005||v>.005&&Math.abs(this.scaleY-v)>.005)&&(this.scaleX=x,this.scaleY=v,c|=16,o=a=!0)}let f=(parseInt(n.paddingTop)||0)*this.scaleY,u=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Ay(e.scrollDOM);let p=(this.printing?qE:BE)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(a=!0)),!this.inView&&!this.scrollTarget&&!WE(e.dom))return 0;let S=l.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let x=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(x)&&(o=!0),o||s.lineWrapping&&Math.abs(S-this.contentDOMWidth)>s.charWidth){let{lineHeight:v,charWidth:$,textHeight:P}=e.docView.measureTextSize();o=v>0&&s.refresh(r,v,$,P,S/$,x),o&&(e.docView.minWidth=0,c|=16)}m>0&&g>0?h=Math.max(m,g):m<0&&g<0&&(h=Math.min(m,g)),lg();for(let v of this.viewports){let $=v.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(v);this.heightMap=(o?Qt.empty().applyChanges(this.stateDeco,Se.empty,this.heightOracle,[new oi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new NE(v.from,$))}ur&&(c|=2)}let _=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return _&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||_)&&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,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new El(s.lineAt(o-n*1e3,Ie.ByHeight,r,0,0).from,s.lineAt(l+(1-n)*1e3,Ie.ByHeight,r,0,0).to);if(t){let{head:c}=t.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(c,Ie.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c=l+Math.max(10,Math.min(n,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=je.LTR&&!n)return[];let l=[],a=(h,f,u,d)=>{if(f-hh&&OO.from>=u.from&&O.to<=u.to&&Math.abs(O.from-h)O.fromS));if(!g){if(f_.from<=f&&_.to>=f)){let _=t.moveToLineBoundary(A.cursor(f),!1,!0).head;_>h&&(f=_)}let O=this.gapSize(u,h,f,d),S=n||O<2e6?O:2e6;g=new _h(h,f,O,S)}l.push(g)},c=h=>{if(h.length2e6)for(let $ of e)$.from>=h.from&&$.fromh.from&&a(h.from,d,h,f),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];ve.spans(t,this.viewport.from,this.viewport.to,{span(r,o){n.push({from:r,to:o})},point(){}},20);let s=0;if(n.length!=this.visibleRanges.length)s=12;else for(let r=0;r=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Jr(this.heightMap.lineAt(e,Ie.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Jr(this.heightMap.lineAt(this.scaler.fromDOM(e),Ie.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Jr(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class El{constructor(e,t){this.from=e,this.to=t}}function zE(i,e,t){let n=[],s=i,r=0;return ve.spans(t,i,e,{span(){},point(o,l){o>s&&(n.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(n<=l)return r+n;n-=l}}function Al(i,e){let t=0;for(let{from:n,to:s}of i.ranges){if(e<=s){t+=e-n;break}t+=s-n}return t/i.total}function YE(i,e){for(let t of i)if(e(t))return t}const hg={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};class wd{constructor(e,t,n){let s=0,r=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let c=t.lineAt(l,Ie.ByPos,e,0,0).top,h=t.lineAt(a,Ie.ByPos,e,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,s=0;;t++){let r=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}}function Jr(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new Di(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(s=>Jr(s,e)):i._content)}const Tl=G.define({combine:i=>i.join(" ")}),ou=G.define({combine:i=>i.indexOf(!0)>-1}),lu=Mn.newName(),SS=Mn.newName(),wS=Mn.newName(),xS={"&light":"."+SS,"&dark":"."+wS};function au(i,e,t){return new Mn(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,s=>{if(s=="&")return i;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):i+" "+n}})}const FE=au("."+lu,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},xS),HE={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},kh=F.ie&&F.ie_version<=11;class GE{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new MQ,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(F.ie&&F.ie_version<=11||F.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(F.chrome&&F.chrome_version<126)&&(this.editContext=new JE(e),e.state.facet(sn)&&(e.contentDOM.editContext=this.editContext.editContext)),kh&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,s=this.selectionRange;if(n.state.facet(sn)?n.root.activeElement!=this.dom:!ha(this.dom,s))return;let r=s.anchorNode&&n.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(F.ie&&F.ie_version<=11||F.android&&F.chrome)&&!n.state.selection.main.empty&&s.focusNode&&mo(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Ro(e.root);if(!t)return!1;let n=F.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&KE(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let s=ha(this.dom,n);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Gs(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:s}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),s=this.selectionChanged&&ha(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new mE(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,s=hS(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=fg(t,e.previousSibling||e.target.previousSibling,-1),s=fg(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(sn)!=e.state.facet(sn)&&(e.view.contentDOM.editContext=e.state.facet(sn)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let s of this.scrollTargets)s.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 fg(i,e,t){for(;e;){let n=Re.get(e);if(n&&n.parent==i)return n;let s=e.parentNode;e=s!=i.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function ug(i,e){let t=e.startContainer,n=e.startOffset,s=e.endContainer,r=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return mo(o.node,o.offset,s,r)&&([t,n,s,r]=[s,r,t,n]),{anchorNode:t,anchorOffset:n,focusNode:s,focusOffset:r}}function KE(i,e){if(e.getComposedRanges){let s=e.getComposedRanges(i.root)[0];if(s)return ug(i,s)}let t=null;function n(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?ug(i,t):null}class JE{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let s=e.state.selection.main,{anchor:r,head:o}=s,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let c={from:l,to:a,insert:Se.of(n.text.split(` `))};if(c.from==this.from&&rthis.to&&(c.to=r),c.from==c.to&&!c.insert.length){let h=A.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(s)||e.dispatch({selection:h,userEvent:"select"});return}if((F.mac||F.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:l,to:a,insert:Se.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let h=this.to-this.from+(c.to-c.from+c.insert.length);yd(e,c,A.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let s=[],r=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o{let s=[];for(let r of n.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);if(a{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:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let s=Ro(n.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,c)=>{if(n)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),s&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange;this.composing&&(this.composing.drifted||e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(n,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class U{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(s=>s.forEach(r=>n(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||ZQ(e.parent)||document,this.viewState=new cg(e.state||be.create(e)),e.scrollTo&&e.scrollTo.is($l)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Hr).map(s=>new wh(s));for(let s of this.plugins)s.update(this);this.observer=new GE(this),this.inputState=new SE(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Wm(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof Ke?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(gS))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=OS(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(be.phrases)!=this.state.facet(be.phrases))return this.setState(r);s=ja.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Ks(d.empty?d:A.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is($l)&&(f=d.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=Va.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Gr)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Tl)!=s.state.facet(Tl)&&(this.viewState.mustMeasureContent=!0),(t||n||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(iu))try{u(s)}catch(d){Lt(this.state,d,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!hS(this,h)&&c.force&&Gs(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 t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new cg(e),this.plugins=e.facet(Hr).map(n=>new wh(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new Wm(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Hr),n=e.state.facet(Hr);if(t!=n){let s=[];for(let r of n){let o=t.indexOf(r);if(o<0)s.push(new wh(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,s=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Ay(n))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);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 h=c.map(d=>{try{return d.read(this)}catch(p){return Lt(this.state,p),dg}}),f=ja.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1){s=s+p,n.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(iu))l(t)}get themeClasses(){return lu+" "+(this.state.facet(ou)?wS:SS)+" "+this.state.facet(Tl)}updateAttrs(){let e=pg(this,sS,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(sn)?"true":"false",class:"cm-content",style:`${F.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),pg(this,gd,t);let n=this.observer.ignore(()=>{let s=Gf(this.contentDOM,this.contentAttrs,t),r=Gf(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let s of n.effects)if(s.is(U.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Gr);let e=this.state.facet(U.cspNonce);Mn.mount(this.root,this.styleModules.concat(FE).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return vh(this,e,Fm(this,e,t,n))}moveByGroup(e,t){return vh(this,e,Fm(this,e,t,n=>fE(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return A.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,n=!0){return hE(this,e,t,n)}moveVertically(e,t,n){return vh(this,e,uE(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),cS(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[En.find(r,e-s.from,-1,t)];return tl(n,o.dir==je.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(eS)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>eC)return Uy(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||qy(r.isolates,n=Bm(this,e))))return r.order;n||(n=Bm(this,e));let s=YQ(e.text,t,n);return this.bidiCache.push(new Va(e.from,e.to,t,n,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||F.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ey(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return $l.of(new Ks(typeof e=="number"?A.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return $l.of(new Ks(A.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Fe.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Fe.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Mn.newName(),s=[Tl.of(n),Gr.of(au(`.${n}`,e))];return t&&t.dark&&s.push(ou.of(!0)),s}static baseTheme(e){return Wn.lowest(Gr.of(au("."+lu,e,xS)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),s=n&&Re.get(n)||Re.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}U.styleModule=Gr;U.inputHandler=Ky;U.clipboardInputFilter=pd;U.clipboardOutputFilter=md;U.scrollHandler=iS;U.focusChangeEffect=Jy;U.perLineTextDirection=eS;U.exceptionSink=Gy;U.updateListener=iu;U.editable=sn;U.mouseSelectionStyle=Hy;U.dragMovesSelection=Fy;U.clickAddsSelectionRange=Yy;U.decorations=Mo;U.outerDecorations=rS;U.atomicRanges=Od;U.bidiIsolatedRanges=oS;U.scrollMargins=lS;U.darkTheme=ou;U.cspNonce=G.define({combine:i=>i.length?i[0]:""});U.contentAttributes=gd;U.editorAttributes=sS;U.lineWrapping=U.contentAttributes.of({class:"cm-lineWrapping"});U.announce=fe.define();const eC=4096,dg={};class Va{constructor(e,t,n,s,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let n=[],s=e.length?e[e.length-1].dir:je.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=n[s],o=typeof r=="function"?r(i):r;o&&Hf(o,t)}return t}const tC=F.mac?"mac":F.windows?"win":F.linux?"linux":"key";function iC(i,e){const t=i.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let s,r,o,l;for(let a=0;an.concat(s),[]))),t}function sC(i,e,t){return _S(vS(i.state),e,i,t)}let kn=null;const rC=4e3;function oC(i,e=tC){let t=Object.create(null),n=Object.create(null),s=(o,l)=>{let a=n[o];if(a==null)n[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")},r=(o,l,a,c,h)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(O=>iC(O,e));for(let O=1;O{let x=kn={view:_,prefix:S,scope:o};return setTimeout(()=>{kn==x&&(kn=null)},rC),!0}]})}let m=p.join(" ");s(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),c&&(g.preventDefault=!0),h&&(g.stopPropagation=!0)};for(let o of i){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=t[c]||(t[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in h)h[u].run.push(d=>f(d,cu))}let a=o[e]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let cu=null;function _S(i,e,t,n){cu=e;let s=CQ(e),r=Rt(s,0),o=Zi(r)==s.length&&s!=" ",l="",a=!1,c=!1,h=!1;kn&&kn.view==t&&kn.scope==n&&(l=kn.prefix+" ",uS.indexOf(e.keyCode)<0&&(c=!0,kn=null));let f=new Set,u=g=>{if(g){for(let O of g.run)if(!f.has(O)&&(f.add(O),O(t)))return g.stopPropagation&&(h=!0),!0;g.preventDefault&&(g.stopPropagation&&(h=!0),c=!0)}return!1},d=i[n],p,m;return d&&(u(d[l+Rl(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(F.windows&&e.ctrlKey&&e.altKey)&&(p=Zn[e.keyCode])&&p!=s?(u(d[l+Rl(p,e,!0)])||e.shiftKey&&(m=To[e.keyCode])!=s&&m!=p&&u(d[l+Rl(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Rl(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),c&&(a=!0),a&&h&&e.stopPropagation(),cu=null,a}class rl{constructor(e,t,n,s,r){this.className=e,this.left=t,this.top=n,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let s=e.coordsAtPos(n.head,n.assoc||1);if(!s)return[];let r=kS(e);return[new rl(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return lC(e,t,n)}}function kS(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==je.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function gg(i,e,t,n){let s=i.coordsAtPos(e,t*2);if(!s)return n;let r=i.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=i.posAtCoords({x:r.left+1,y:o}),a=i.posAtCoords({x:r.right-1,y:o});return l==null||a==null?n:{from:Math.max(n.from,Math.min(l,a)),to:Math.min(n.to,Math.max(l,a))}}function lC(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),s=Math.min(t.to,i.viewport.to),r=i.textDirection==je.LTR,o=i.contentDOM,l=o.getBoundingClientRect(),a=kS(i),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),f=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=l.right-(h?parseInt(h.paddingRight):0),d=su(i,n),p=su(i,s),m=d.type==Pt.Text?d:null,g=p.type==Pt.Text?p:null;if(m&&(i.lineWrapping||d.widgetLineBreaks)&&(m=gg(i,n,1,m)),g&&(i.lineWrapping||p.widgetLineBreaks)&&(g=gg(i,s,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return S(_(t.from,t.to,m));{let v=m?_(t.from,null,m):x(d,!1),$=g?_(null,t.to,g):x(p,!0),P=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&v.bottom+i.defaultLineHeight/2<$.top?P.push(O(f,v.bottom,u,$.top)):v.bottom<$.top&&i.elementAtHeight((v.bottom+$.top)/2).type==Pt.Text&&(v.bottom=$.top=(v.bottom+$.top)/2),S(v).concat(P).concat(S($))}function O(v,$,P,Z){return new rl(e,v-a.left,$-a.top,P-v,Z-$)}function S({top:v,bottom:$,horizontal:P}){let Z=[];for(let N=0;NB&&ce.from=ne)break;Me>ue&&H(Math.max(ye,ue),v==null&&ye<=B,Math.min(Me,ne),$==null&&Me>=J,he.dir)}if(ue=K.to+1,ue>=ne)break}return Y.length==0&&H(B,v==null,J,$==null,i.textDirection),{top:Z,bottom:N,horizontal:Y}}function x(v,$){let P=l.top+($?v.top:v.bottom);return{top:P,bottom:P,horizontal:[]}}}function aC(i,e){return i.constructor==e.constructor&&i.eq(e)}class cC{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(pa)!=e.state.facet(pa)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(pa);for(;t!aC(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[n].constructor&&s.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const pa=G.define();function $S(i){return[Fe.define(e=>new cC(e,i)),pa.of(i)]}const PS=!(F.ios&&F.webkit&&F.webkit_version<534),Zo=G.define({combine(i){return Yi(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function hC(i={}){return[Zo.of(i),fC,uC,dC,tS.of(!0)]}function QS(i){return i.startState.facet(Zo)!=i.state.facet(Zo)}const fC=$S({above:!0,markers(i){let{state:e}=i,t=e.facet(Zo),n=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||PS:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:A.cursor(s.head,s.head>s.anchor?-1:1);for(let a of rl.forRange(i,o,l))n.push(a)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=QS(i);return t&&Og(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){Og(e.state,i)},class:"cm-cursorLayer"});function Og(i,e){e.style.animationDuration=i.facet(Zo).cursorBlinkRate+"ms"}const uC=$S({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:rl.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||QS(i)},class:"cm-selectionLayer"}),hu={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};PS&&(hu[".cm-line"].caretColor=hu[".cm-content"].caretColor="transparent !important");const dC=Wn.highest(U.theme(hu)),ES=fe.define({map(i,e){return i==null?null:e.mapPos(i)}}),eo=at.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(ES)?n.value:t,i)}}),pC=Fe.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(eo);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(eo)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(eo),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(eo)!=i&&this.view.dispatch({effects:ES.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function mC(){return[eo,pC]}function bg(i,e,t,n,s){e.lastIndex=0;for(let r=i.iterRange(t,n),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function gC(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let n=[];for(let{from:s,to:r}of t)s=Math.max(i.state.doc.lineAt(s).from,s-e),r=Math.min(i.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=s?n[n.length-1].to=r:n.push({from:s,to:r});return n}class OC{constructor(e){const{regexp:t,decoration:n,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,c,h)=>s(h,c,c+l[0].length,l,a);else if(typeof n=="function")this.addMatch=(l,a,c,h)=>{let f=n(l,a,c);f&&h(c,c+l[0].length,f)};else if(n)this.addMatch=(l,a,c,h)=>h(c,c+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new hn,n=t.add.bind(t);for(let{from:s,to:r}of gC(e,this.maxLength))bg(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(n=Math.min(l,n),s=Math.max(a,s))}),e.viewportMoved||s-n>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),n,s):t}updateRange(e,t,n,s){for(let r of e.visibleRanges){let o=Math.max(r.from,n),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),c=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;lu.push(O.range(m,g));if(a==c)for(this.regexp.lastIndex=h-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:h,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const fu=/x/.unicode!=null?"gu":"g",bC=new RegExp(`[\0-\b --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,fu),yC={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let $h=null;function SC(){var i;if($h==null&&typeof document<"u"&&document.body){let e=document.body.style;$h=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return $h||!1}const ma=G.define({combine(i){let e=Yi(i,{render:null,specialChars:bC,addSpecialChars:null});return(e.replaceTabs=!SC())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,fu)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,fu)),e}});function wC(i={}){return[ma.of(i),xC()]}let yg=null;function xC(){return yg||(yg=Fe.fromClass(class{constructor(i){this.view=i,this.decorations=te.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(ma)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new OC({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:s}=t.state,r=Rt(e[0],0);if(r==9){let o=s.lineAt(n),l=t.state.tabSize,a=Pr(o.text,l,n-o.from);return te.replace({widget:new $C((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=te.replace({widget:new kC(i,r)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(ma);i.startState.facet(ma)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}const vC="•";function _C(i){return i>=32?vC:i==10?"␤":String.fromCharCode(9216+i)}class kC extends Fi{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=_C(this.code),n=e.state.phrase("Control character")+" "+(yC[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,n,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class $C extends Fi{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function PC(){return EC}const QC=te.line({class:"cm-activeLine"}),EC=Fe.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let s=i.lineBlockAt(n.head);s.from>e&&(t.push(QC.range(s.from)),e=s.from)}return te.set(t)}},{decorations:i=>i.decorations});class CC extends Fi{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),typeof this.content=="string"?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?cr(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),s=tl(t[0],n.direction!="rtl"),r=parseInt(n.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function AC(i){return Fe.fromClass(class{constructor(e){this.view=e,this.placeholder=i?te.set([te.widget({widget:new CC(i),side:1}).range(0)]):te.none}get decorations(){return this.view.state.doc.length?te.none:this.placeholder}},{decorations:e=>e.decorations})}const uu=2e3;function TC(i,e,t){let n=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>uu||t.off>uu||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=n;a<=s;a++){let c=i.doc.line(a);c.length<=l&&r.push(A.range(c.from+o,c.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=n;a<=s;a++){let c=i.doc.line(a),h=Bf(c.text,o,i.tabSize,!0);if(h<0)r.push(A.cursor(c.to));else{let f=Bf(c.text,l,i.tabSize);r.push(A.range(c.from+h,c.from+f))}}}return r}function RC(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function Sg(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),s=t-n.from,r=s>uu?-1:s==n.length?RC(i,e.clientX):Pr(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:r,off:s}}function MC(i,e){let t=Sg(i,e),n=i.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(s.changes)}},get(s,r,o){let l=Sg(i,s);if(!l)return n;let a=TC(i.state,t,l);return a.length?o?A.create(a.concat(n.ranges)):A.create(a):n}}:null}function ZC(i){let e=t=>t.altKey&&t.button==0;return U.mouseSelectionStyle.of((t,n)=>e(n)?MC(t,n):null)}const DC={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},LC={style:"cursor: crosshair"};function NC(i={}){let[e,t]=DC[i.key||"Alt"],n=Fe.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[n,U.contentAttributes.of(s=>{var r;return!((r=s.plugin(n))===null||r===void 0)&&r.isDown?LC:null})]}const Vr="-10000px";class CS{constructor(e,t,n,s){this.facet=t,this.createTooltipView=n,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=n(o,r))}update(e,t){var n;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[c]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function IC(i){let{win:e}=i;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Ph=G.define({combine:i=>{var e,t,n;return{position:F.ios?"absolute":((e=i.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(s=>s.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||IC}}}),wg=new WeakMap,xd=Fe.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(Ph);this.position=e.position,this.parent=e.parent,this.classes=i.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 CS(i,vd,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.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 i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(Ph);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=Vr,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(F.gecko)t=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==Vr&&r.style.left=="0px"){let o=r.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(t||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(i=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:i,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),s=bd(this.view);return{visible:{left:n.left+s.left,top:n.top+s.top,right:n.right-s.right,bottom:n.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Ph).tooltipSpace(this.view),scaleX:i,scaleY:e,makeAbsolute:t}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:n,scaleX:s,scaleY:r}=i,o=[];for(let l=0;l=Math.min(t.bottom,n.bottom)||f.rightMath.min(t.right,n.right)+.1)){h.style.top=Vr;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=wg.get(c))!==null&&e!==void 0?e:u.bottom-u.top,O=c.offset||XC,S=this.view.textDirection==je.LTR,_=u.width>n.right-n.left?S?n.left:n.right-u.width:S?Math.max(n.left,Math.min(f.left-(d?14:0)+O.x,n.right-m)):Math.min(Math.max(n.left,f.left-m+(d?14:0)-O.x),n.right-m),x=this.above[l];!a.strictSide&&(x?f.top-g-p-O.yn.bottom)&&x==n.bottom-f.bottom>f.top-n.top&&(x=this.above[l]=!x);let v=(x?f.top-n.top:n.bottom-f.bottom)-p;if(v_&&Z.top<$+g&&Z.bottom>$&&($=x?Z.top-g-2-p:Z.bottom+p+2);if(this.position=="absolute"?(h.style.top=($-i.parent.top)/r+"px",xg(h,(_-i.parent.left)/s)):(h.style.top=$/r+"px",xg(h,_/s)),d){let Z=f.left+(S?O.x:-O.x)-(_+14-7);d.style.left=Z/s+"px"}c.overlap!==!0&&o.push({left:_,top:$,right:P,bottom:$+g}),h.classList.toggle("cm-tooltip-above",x),h.classList.toggle("cm-tooltip-below",!x),c.positioned&&c.positioned(i.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 i of this.manager.tooltipViews)i.dom.style.top=Vr}},{eventObservers:{scroll(){this.maybeMeasure()}}});function xg(i,e){let t=parseInt(i.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(i.style.left=e+"px")}const jC=U.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:`${7*2}px`,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"}}}),XC={x:0,y:0},vd=G.define({enables:[xd,jC]}),Ba=G.define({combine:i=>i.reduce((e,t)=>e.concat(t),[])});class Nc{static create(e){return new Nc(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new CS(e,Ba,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let s=n[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const VC=vd.compute([Ba],i=>{let e=i.facet(Ba);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:Nc.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class BC{constructor(e,t,n,s,r){this.view=e,this.source=t,this.field=n,this.setHover=s,this.hoverTime=r,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(){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;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),c=a&&a.dir==je.RTL?-1:1;r=t.x{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>Lt(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(xd),t=e?e.manager.tooltips.findIndex(n=>n.create==Nc.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;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:s,tooltip:r}=this;if(s.length&&r&&!WC(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(n=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!qC(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:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Ml=4;function WC(i,e){let{left:t,right:n,top:s,bottom:r}=i.getBoundingClientRect(),o;if(o=i.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=t-Ml&&e.clientX<=n+Ml&&e.clientY>=s-Ml&&e.clientY<=r+Ml}function qC(i,e,t,n,s,r){let o=i.scrollDOM.getBoundingClientRect(),l=i.documentTop+i.documentPadding.top+i.contentHeight;if(o.left>n||o.rights||Math.min(o.bottom,l)=e&&a<=t}function UC(i,e={}){let t=fe.define(),n=at.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let a=r.changes.mapPos(l.pos,-1,pt.TrackDel);if(a!=null){let c=Object.assign(Object.create(null),l);c.pos=a,c.end!=null&&(c.end=r.changes.mapPos(c.end)),o.push(c)}}s=o}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(zC)&&(s=[]);return s},provide:s=>Ba.from(s)});return{active:n,extension:[n,Fe.define(s=>new BC(s,i,n,t,e.hoverTime||300)),VC]}}function AS(i,e){let t=i.plugin(xd);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const zC=fe.define(),vg=G.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Do(i,e){let t=i.plugin(TS),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const TS=Fe.fromClass(class{constructor(i){this.input=i.state.facet(Lo),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(vg);this.top=new Zl(i,!0,e.topContainer),this.bottom=new Zl(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(vg);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Zl(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Zl(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(Lo);if(t!=this.input){let n=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of n){let c=this.specs.indexOf(a),h;c<0?(h=a(i.view),l.push(h)):(h=this.panels[c],h.update&&h.update(i)),s.push(h),(h.top?r:o).push(h)}this.specs=n,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>U.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Zl{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=_g(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=_g(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 _g(i){let e=i.nextSibling;return i.remove(),e}const Lo=G.define({enables:TS});class un extends Os{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=pt.TrackBefore;un.prototype.startSide=un.prototype.endSide=-1;un.prototype.point=!0;const ga=G.define(),YC=G.define(),FC={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ve.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Oo=G.define();function HC(i){return[RS(),Oo.of(Object.assign(Object.assign({},FC),i))]}const kg=G.define({combine:i=>i.some(e=>e)});function RS(i){return[GC]}const GC=Fe.fromClass(class{constructor(i){this.view=i,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(Oo).map(e=>new Pg(i,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!i.state.facet(kg),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}i.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(kg)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&this.dom.remove();let t=ve.iter(this.view.state.facet(ga),this.view.viewport.from),n=[],s=this.gutters.map(r=>new KC(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Pt.Text&&o){du(t,n,l.from);for(let a of s)a.line(this.view,l,n);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==Pt.Text){du(t,n,r.from);for(let o of s)o.line(this.view,r,n)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();i&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(i){let e=i.startState.facet(Oo),t=i.state.facet(Oo),n=i.docChanged||i.heightChanged||i.viewportChanged||!ve.eq(i.startState.facet(ga),i.state.facet(ga),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(i)&&(n=!0);else{n=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new Pg(this.view,r)):(this.gutters[o].update(i),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove()}},{provide:i=>U.scrollMargins.of(e=>{let t=e.plugin(i);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==je.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function $g(i){return Array.isArray(i)?i:[i]}function du(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}class KC{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=ve.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new MS(e,o,r,n);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let s=[];du(this.cursor,s,t.from),n.length&&(s=s.concat(n));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),s=n?[n]:null;for(let r of e.state.facet(YC)){let o=r(e,t.widget,t);o&&(s||(s=[])).push(o)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Pg{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,l,s)&&s.preventDefault()});this.markers=$g(t.markers(e)),t.initialSpacer&&(this.spacer=new MS(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=$g(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let n=e.view.viewport;return!ve.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class MS{constructor(e,t,n,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,s)}update(e,t,n,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),JC(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let n="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,c)||o(l,a,c):o}return n}})}});class Qh extends un{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Eh(i,e){return i.state.facet(Xs).formatNumber(e,i.state)}const iA=Oo.compute([Xs],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(eA)},lineMarker(e,t,n){return n.some(s=>s.toDOM)?null:new Qh(Eh(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let s of e.state.facet(tA)){let r=s(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Xs)!=e.state.facet(Xs),initialSpacer(e){return new Qh(Eh(e,Qg(e.state.doc.lines)))},updateSpacer(e,t){let n=Eh(t.view,Qg(t.view.state.doc.lines));return n==e.number?e:new Qh(n)},domEventHandlers:i.facet(Xs).domEventHandlers}));function nA(i={}){return[Xs.of(i),RS(),iA]}function Qg(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let s=i.doc.lineAt(n.head).from;s>t&&(t=s,e.push(sA.range(s)))}return ve.of(e)});function oA(){return rA}const ZS=1024;let lA=0;class Ch{constructor(e,t){this.from=e,this.to=t}}class ge{constructor(e={}){this.id=lA++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Xt.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}ge.closedBy=new ge({deserialize:i=>i.split(" ")});ge.openedBy=new ge({deserialize:i=>i.split(" ")});ge.group=new ge({deserialize:i=>i.split(" ")});ge.isolate=new ge({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});ge.contextHash=new ge({perNode:!0});ge.lookAhead=new ge({perNode:!0});ge.mounted=new ge({perNode:!0});class Wa{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[ge.mounted.id]}}const aA=Object.create(null);class Xt{constructor(e,t,n,s=0){this.name=e,this.props=t,this.id=n,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):aA,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new Xt(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ge.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let s of n.split(" "))t[s]=e[n];return n=>{for(let s=n.prop(ge.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?n.name:s[r]];if(o)return o}}}}Xt.none=new Xt("",Object.create(null),0,8);class _d{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|st.IncludeAnonymous);;){let c=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&n&&(l||!a.type.isAnonymous)&&n(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 t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Pd(Xt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,s)=>new Je(this.type,t,n,s,this.propValues),e.makeTree||((t,n,s)=>new Je(Xt.none,t,n,s)))}static build(e){return uA(e)}}Je.empty=new Je(Xt.none,[],[],0);class kd{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new kd(this.buffer,this.index)}}class Ln{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Xt.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function No(i,e,t,n){for(var s;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=c;e+=t){let h=l[e],f=a[e]+o.from;if(DS(s,n,f,f+h.length)){if(h instanceof Ln){if(r&st.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,t,n-f,s);if(u>-1)return new Li(new cA(o,h,e,f),null,u)}else if(r&st.IncludeAnonymous||!h.type.isAnonymous||$d(h)){let u;if(!(r&st.IgnoreMounts)&&(u=Wa.get(h))&&!u.overlay)return new jt(u.tree,f,e,o);let d=new jt(h,f,e,o);return r&st.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?h.children.length-1:0,t,n,s)}}}if(r&st.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<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)}enter(e,t,n=0){let s;if(!(n&st.IgnoreOverlays)&&(s=Wa.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new jt(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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 Cg(i,e,t,n){let s=i.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return r}for(;;){if(n!=null&&s.type.is(n))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return n==null?r:[]}}function pu(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class cA{constructor(e,t,n,s){this.parent=e,this.buffer=t,this.index=n,this.start=s}}class Li extends LS{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new Li(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&st.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Li(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Li(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Li(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,s=this.index+4,r=n.buffer[this.index+3];if(r>s){let o=n.buffer[this.index+1];e.push(n.slice(s,r,o)),t.push(0)}return new Je(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function NS(i){if(!i.length)return null;let e=0,t=i[0];for(let r=1;rt.from||o.to=e){let l=new jt(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[n])).push(No(l,e,t,!1))}}return s?NS(s):n}class mu{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof jt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=n+s.buffer[e+1],this.to=n+s.buffer[e+2],!0}yield(e){return e?e instanceof jt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&st.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&st.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&st.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let s=n<0?0:this.stack[n]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(s)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let l=n._tree.children[r];if(this.mode&st.IncludeAnonymous||l instanceof Ln||!l.type.isAnonymous||$d(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,n=r+1;break e}s=this.stack[--r]}for(let s=n;s=0;r--){if(r<0)return pu(this._tree,e,s);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function $d(i){return i.children.some(e=>e instanceof Ln||!e.type.isAnonymous||$d(e))}function uA(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:s=ZS,reused:r=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new kd(t,t.length):t,a=n.types,c=0,h=0;function f(v,$,P,Z,N,Y){let{id:H,start:B,end:J,size:ce}=l,ue=h,ne=c;for(;ce<0;)if(l.next(),ce==-1){let Xe=r[H];P.push(Xe),Z.push(B-v);return}else if(ce==-3){c=H;return}else if(ce==-4){h=H;return}else throw new RangeError(`Unrecognized record size: ${ce}`);let K=a[H],he,ye,Me=B-v;if(J-B<=s&&(ye=g(l.pos-$,N))){let Xe=new Uint16Array(ye.size-ye.skip),we=l.pos-ye.size,We=Xe.length;for(;l.pos>we;)We=O(ye.start,Xe,We);he=new Ln(Xe,J-ye.start,n),Me=ye.start-v}else{let Xe=l.pos-ce;l.next();let we=[],We=[],qe=H>=o?H:-1,He=0,Be=J;for(;l.pos>Xe;)qe>=0&&l.id==qe&&l.size>=0?(l.end<=Be-s&&(p(we,We,B,He,l.end,Be,qe,ue,ne),He=we.length,Be=l.end),l.next()):Y>2500?u(B,Xe,we,We):f(B,Xe,we,We,qe,Y+1);if(qe>=0&&He>0&&He-1&&He>0){let C=d(K,ne);he=Pd(K,we,We,0,we.length,0,J-B,C,C)}else he=m(K,we,We,J-B,ue-J,ne)}P.push(he),Z.push(Me)}function u(v,$,P,Z){let N=[],Y=0,H=-1;for(;l.pos>$;){let{id:B,start:J,end:ce,size:ue}=l;if(ue>4)l.next();else{if(H>-1&&J=0;ce-=3)B[ue++]=N[ce],B[ue++]=N[ce+1]-J,B[ue++]=N[ce+2]-J,B[ue++]=ue;P.push(new Ln(B,N[2]-J,n)),Z.push(J-v)}}function d(v,$){return(P,Z,N)=>{let Y=0,H=P.length-1,B,J;if(H>=0&&(B=P[H])instanceof Je){if(!H&&B.type==v&&B.length==N)return B;(J=B.prop(ge.lookAhead))&&(Y=Z[H]+B.length+J)}return m(v,P,Z,N,Y,$)}}function p(v,$,P,Z,N,Y,H,B,J){let ce=[],ue=[];for(;v.length>Z;)ce.push(v.pop()),ue.push($.pop()+P-N);v.push(m(n.types[H],ce,ue,Y-N,B-Y,J)),$.push(N-P)}function m(v,$,P,Z,N,Y,H){if(Y){let B=[ge.contextHash,Y];H=H?[B].concat(H):[B]}if(N>25){let B=[ge.lookAhead,N];H=H?[B].concat(H):[B]}return new Je(v,$,P,Z,H)}function g(v,$){let P=l.fork(),Z=0,N=0,Y=0,H=P.end-s,B={size:0,start:0,skip:0};e:for(let J=P.pos-v;P.pos>J;){let ce=P.size;if(P.id==$&&ce>=0){B.size=Z,B.start=N,B.skip=Y,Y+=4,Z+=4,P.next();continue}let ue=P.pos-ce;if(ce<0||ue=o?4:0,K=P.start;for(P.next();P.pos>ue;){if(P.size<0)if(P.size==-3)ne+=4;else break e;else P.id>=o&&(ne+=4);P.next()}N=K,Z+=ce,Y+=ne}return($<0||Z==v)&&(B.size=Z,B.start=N,B.skip=Y),B.size>4?B:void 0}function O(v,$,P){let{id:Z,start:N,end:Y,size:H}=l;if(l.next(),H>=0&&Z4){let J=l.pos-(H-4);for(;l.pos>J;)P=O(v,$,P)}$[--P]=B,$[--P]=Y-v,$[--P]=N-v,$[--P]=Z}else H==-3?c=Z:H==-4&&(h=Z);return P}let S=[],_=[];for(;l.pos>0;)f(i.start||0,i.bufferStart||0,S,_,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:S.length?_[0]+S[0].length:0;return new Je(a[i.topID],S.reverse(),_.reverse(),x)}const Ag=new WeakMap;function Oa(i,e){if(!i.isAnonymous||e instanceof Ln||e.type!=i)return 1;let t=Ag.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof Je)){t=1;break}t+=Oa(i,n)}Ag.set(e,t)}return t}function Pd(i,e,t,n,s,r,o,l,a){let c=0;for(let p=n;p=h)break;$+=P}if(_==x+1){if($>h){let P=p[x];d(P.children,P.positions,0,P.children.length,m[x]+S);continue}f.push(p[x])}else{let P=m[_-1]+p[_-1].length-v;f.push(Pd(i,p,m,x,_,v,P,null,a))}u.push(v+S-r)}}return d(e,t,n,s,0),(l||a)(f,u,o)}class dA{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Li?this.setBuffer(e.context.buffer,e.index,t):e instanceof jt&&this.map.set(e.tree,t)}get(e){return e instanceof Li?this.getBuffer(e.context.buffer,e.index):e instanceof jt?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class fs{constructor(e,t,n,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let s=[new fs(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,n=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let h=l=n)for(;o&&o.from=u.from||f<=u.to||c){let d=Math.max(u.from,a)-c,p=Math.min(u.to,f)-c;u=d>=p?null:new fs(d,p,u.tree,u.offset+c,l>0,!!h)}if(u&&s.push(u),o.to>f)break;o=rnew Ch(s.from,s.to)):[new Ch(0,0)]:[new Ch(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let s=this.startParse(e,t,n);for(;;){let r=s.advance();if(r)return r}}}class pA{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new ge({perNode:!0});let mA=0;class ti{constructor(e,t,n,s){this.name=e,this.set=t,this.base=n,this.modified=s,this.id=mA++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof ti&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let s=new ti(n,[],null,[]);if(s.set.push(s),t)for(let r of t.set)s.set.push(r);return s}static defineModifier(e){let t=new qa(e);return n=>n.modified.indexOf(t)>-1?n:qa.get(n.base||n,n.modified.concat(t).sort((s,r)=>s.id-r.id))}}let gA=0;class qa{constructor(e){this.name=e,this.instances=[],this.id=gA++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&OA(t,l.modified));if(n)return n;let s=[],r=new ti(e.name,s,e,t);for(let l of t)l.instances.push(r);let o=bA(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(qa.get(l,a));return r}}function OA(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function bA(i){let e=[[]];for(let t=0;tn.length-t.length)}function jS(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+s);let h=new Ua(n,o,a>0?r.slice(0,a):null);e[c]=h.sort(e[c])}}return XS.add(e)}const XS=new ge;class Ua{constructor(e,t,n,s){this.tags=e,this.mode=t,this.context=n,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let c=t[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:n}}function yA(i,e){let t=null;for(let n of i){let s=n.style(e);s&&(t=t?t+" "+s:s)}return t}function SA(i,e,t,n=0,s=i.length){let r=new wA(n,Array.isArray(e)?e:[e],t);r.highlightRange(i.cursor(),n,s,"",r.highlighters),r.flush(s)}class wA{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,s,r){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=s,h=xA(e)||Ua.empty,f=yA(r,h.tags);if(f&&(c&&(c+=" "),c+=f,h.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),c),h.opaque)return;let u=e.tree&&e.tree.prop(ge.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,O=l;;g++){let S=g=_||!e.nextSibling())););if(!S||_>n)break;O=S.to+l,O>t&&(this.highlightRange(d.cursor(),Math.max(t,S.from+l),Math.min(n,O),"",p),this.startSpan(Math.min(n,O),c))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,s,r),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function xA(i){let e=i.type.prop(XS);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const X=ti.define,Ll=X(),vn=X(),Tg=X(vn),Rg=X(vn),_n=X(),Nl=X(_n),Ah=X(_n),Ai=X(),Gn=X(Ai),Ei=X(),Ci=X(),gu=X(),Br=X(gu),Il=X(),w={comment:Ll,lineComment:X(Ll),blockComment:X(Ll),docComment:X(Ll),name:vn,variableName:X(vn),typeName:Tg,tagName:X(Tg),propertyName:Rg,attributeName:X(Rg),className:X(vn),labelName:X(vn),namespace:X(vn),macroName:X(vn),literal:_n,string:Nl,docString:X(Nl),character:X(Nl),attributeValue:X(Nl),number:Ah,integer:X(Ah),float:X(Ah),bool:X(_n),regexp:X(_n),escape:X(_n),color:X(_n),url:X(_n),keyword:Ei,self:X(Ei),null:X(Ei),atom:X(Ei),unit:X(Ei),modifier:X(Ei),operatorKeyword:X(Ei),controlKeyword:X(Ei),definitionKeyword:X(Ei),moduleKeyword:X(Ei),operator:Ci,derefOperator:X(Ci),arithmeticOperator:X(Ci),logicOperator:X(Ci),bitwiseOperator:X(Ci),compareOperator:X(Ci),updateOperator:X(Ci),definitionOperator:X(Ci),typeOperator:X(Ci),controlOperator:X(Ci),punctuation:gu,separator:X(gu),bracket:Br,angleBracket:X(Br),squareBracket:X(Br),paren:X(Br),brace:X(Br),content:Ai,heading:Gn,heading1:X(Gn),heading2:X(Gn),heading3:X(Gn),heading4:X(Gn),heading5:X(Gn),heading6:X(Gn),contentSeparator:X(Ai),list:X(Ai),quote:X(Ai),emphasis:X(Ai),strong:X(Ai),link:X(Ai),monospace:X(Ai),strikethrough:X(Ai),inserted:X(),deleted:X(),changed:X(),invalid:X(),meta:Il,documentMeta:X(Il),annotation:X(Il),processingInstruction:X(Il),definition:ti.defineModifier("definition"),constant:ti.defineModifier("constant"),function:ti.defineModifier("function"),standard:ti.defineModifier("standard"),local:ti.defineModifier("local"),special:ti.defineModifier("special")};for(let i in w){let e=w[i];e instanceof ti&&(e.name=i)}VS([{tag:w.link,class:"tok-link"},{tag:w.heading,class:"tok-heading"},{tag:w.emphasis,class:"tok-emphasis"},{tag:w.strong,class:"tok-strong"},{tag:w.keyword,class:"tok-keyword"},{tag:w.atom,class:"tok-atom"},{tag:w.bool,class:"tok-bool"},{tag:w.url,class:"tok-url"},{tag:w.labelName,class:"tok-labelName"},{tag:w.inserted,class:"tok-inserted"},{tag:w.deleted,class:"tok-deleted"},{tag:w.literal,class:"tok-literal"},{tag:w.string,class:"tok-string"},{tag:w.number,class:"tok-number"},{tag:[w.regexp,w.escape,w.special(w.string)],class:"tok-string2"},{tag:w.variableName,class:"tok-variableName"},{tag:w.local(w.variableName),class:"tok-variableName tok-local"},{tag:w.definition(w.variableName),class:"tok-variableName tok-definition"},{tag:w.special(w.variableName),class:"tok-variableName2"},{tag:w.definition(w.propertyName),class:"tok-propertyName tok-definition"},{tag:w.typeName,class:"tok-typeName"},{tag:w.namespace,class:"tok-namespace"},{tag:w.className,class:"tok-className"},{tag:w.macroName,class:"tok-macroName"},{tag:w.propertyName,class:"tok-propertyName"},{tag:w.operator,class:"tok-operator"},{tag:w.comment,class:"tok-comment"},{tag:w.meta,class:"tok-meta"},{tag:w.invalid,class:"tok-invalid"},{tag:w.punctuation,class:"tok-punctuation"}]);var Th;const Vs=new ge;function BS(i){return G.define({combine:i?e=>e.concat(i):void 0})}const Qd=new ge;class pi{constructor(e,t,n=[],s=""){this.data=e,this.name=s,be.prototype.hasOwnProperty("tree")||Object.defineProperty(be.prototype,"tree",{get(){return rt(this)}}),this.parser=t,this.extension=[Nn.of(this),be.languageData.of((r,o,l)=>{let a=Mg(r,o,l),c=a.type.prop(Vs);if(!c)return[];let h=r.facet(c),f=a.type.prop(Qd);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(h)}}return h})].concat(n)}isActiveAt(e,t,n=-1){return Mg(e,t,n).type.prop(Vs)==this.data}findRegions(e){let t=e.facet(Nn);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],s=(r,o)=>{if(r.prop(Vs)==this.data){n.push({from:o,to:o+r.length});return}let l=r.prop(ge.mounted);if(l){if(l.tree.prop(Vs)==this.data){if(l.overlay)for(let a of l.overlay)n.push({from:a.from+o,to:a.to+o});else n.push({from:o,to:o+r.length});return}else if(l.overlay){let a=n.length;if(s(l.tree,l.overlay[0].from+o),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new za(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function rt(i){let e=i.field(pi.state,!1);return e?e.tree:Je.empty}class vA{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Wr=null;class Ya{constructor(e,t,n=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new Ya(e,t,[],Je.empty,0,n,[],null)}startParse(){return this.parser.startParse(new vA(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Je.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(fs.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Wr;Wr=this;try{return e()}finally{Wr=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Zg(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,h,f,u)=>a.push({fromA:c,toA:h,fromB:f,toB:u})),n=fs.applyChanges(n,a),s=Je.empty,r=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 h=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);he.from&&(this.fragments=Zg(this.fragments,s,r),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends IS{createParse(t,n,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Wr;if(a){for(let c of s)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new Je(Xt.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Wr}}function Zg(i,e,t){return fs.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}class dr{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new dr(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Ya.create(e.facet(Nn).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new dr(n)}}pi.state=at.define({create:dr.init,update(i,e){for(let t of e.effects)if(t.is(pi.setState))return t.value;return e.startState.facet(Nn)!=e.state.facet(Nn)?dr.init(e.state):i.apply(e)}});let WS=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(WS=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Rh=typeof navigator<"u"&&(!((Th=navigator.scheduling)===null||Th===void 0)&&Th.isInputPending)?()=>navigator.scheduling.isInputPending():null,_A=Fe.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(pi.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(pi.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=WS(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Rh&&Rh()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:pi.setState.of(new dr(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Lt(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Nn=G.define({combine(i){return i.length?i[0]:null},enables:i=>[pi.state,_A,U.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]});class kA{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const $A=G.define(),ol=G.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Fa(i){let e=i.facet(ol);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function Io(i,e){let t="",n=i.tabSize,s=i.facet(ol)[0];if(s==" "){for(;e>=n;)t+=" ",e-=n;s=" "}for(let r=0;r=e?PA(i,t,e):null}class Ic{constructor(e,t={}){this.state=e,this.options=t,this.unit=Fa(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=n.from&&s<=n.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return Pr(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const qS=new ge;function PA(i,e,t){let n=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=n.node){let r=[];for(let o=s;o&&!(o.from==n.node.from&&o.type==n.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)n={node:r[o],next:n}}return US(n,i,t)}function US(i,e,t){for(let n=i;n;n=n.next){let s=EA(n.node);if(s)return s(Cd.create(e,t,n))}return 0}function QA(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function EA(i){let e=i.type.prop(qS);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(ge.closedBy))){let s=i.lastChild,r=s&&n.indexOf(s.name)>-1;return o=>zS(o,!0,1,void 0,r&&!QA(o)?s.from:void 0)}return i.parent==null?CA:null}function CA(){return 0}class Cd extends Ic{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Cd(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(AA(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return US(this.context.next,this.base,this.pos)}}function AA(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function TA(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let s=i.options.simulateBreak,r=i.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==n)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+c}}l=a.to}}function RA({closing:i,align:e=!0,units:t=1}){return n=>zS(n,e,t,i)}function zS(i,e,t,n,s){let r=i.textAfter,o=r.match(/^\s*/)[0].length,l=n&&r.slice(o,o+n.length)==n||s==i.pos+o,a=e?TA(i):null;return a?l?i.column(a.from):i.column(a.to):i.baseIndent+(l?0:i.unit*t)}const MA=i=>i.baseIndent;function Mh({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const ZA=200;function DA(){return be.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:n}=i.newSelection.main,s=t.lineAt(n);if(n>s.from+ZA)return i;let r=t.sliceString(s.from,n);if(!e.some(c=>c.test(r)))return i;let{state:o}=i,l=-1,a=[];for(let{head:c}of o.selection.ranges){let h=o.doc.lineAt(c);if(h.from==l)continue;l=h.from;let f=Ed(o,h.from);if(f==null)continue;let u=/^\s*/.exec(h.text)[0],d=Io(o,f);u!=d&&a.push({from:h.from,to:h.from+u.length,insert:d})}return a.length?[i,{changes:a,sequential:!0}]:i})}const LA=G.define(),YS=new ge;function NA(i){let e=i.firstChild,t=i.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&c.to>t&&(r=c)}}return r}function jA(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function Ha(i,e,t){for(let n of i.facet(LA)){let s=n(i,e,t);if(s)return s}return IA(i,e,t)}function FS(i,e){let t=e.mapPos(i.from,1),n=e.mapPos(i.to,-1);return t>=n?void 0:{from:t,to:n}}const jc=fe.define({map:FS}),ll=fe.define({map:FS});function HS(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(i.lineBlockAt(t));return e}const ws=at.define({create(){return te.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(jc)&&!XA(i,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(JS),s=n?te.replace({widget:new YA(n(e.state,t.value))}):Dg;i=i.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(ll)&&(i=i.update({filter:(n,s)=>t.value.from!=n||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;i.between(n,n,(s,r)=>{sn&&(t=!0)}),t&&(i=i.update({filterFrom:n,filterTo:n,filter:(s,r)=>r<=n||s>=n}))}return i},provide:i=>U.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(n,s)=>{t.push(n,s)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!s||s.from>r)&&(s={from:r,to:o})}),s}function XA(i,e,t){let n=!1;return i.between(e,e,(s,r)=>{s==e&&r==t&&(n=!0)}),n}function GS(i,e){return i.field(ws,!1)?e:e.concat(fe.appendConfig.of(ew()))}const VA=i=>{for(let e of HS(i)){let t=Ha(i.state,e.from,e.to);if(t)return i.dispatch({effects:GS(i.state,[jc.of(t),KS(i,t)])}),!0}return!1},BA=i=>{if(!i.state.field(ws,!1))return!1;let e=[];for(let t of HS(i)){let n=Ga(i.state,t.from,t.to);n&&e.push(ll.of(n),KS(i,n,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function KS(i,e,t=!0){let n=i.state.doc.lineAt(e.from).number,s=i.state.doc.lineAt(e.to).number;return U.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${i.state.phrase("to")} ${s}.`)}const WA=i=>{let{state:e}=i,t=[];for(let n=0;n{let e=i.state.field(ws,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(n,s)=>{t.push(ll.of({from:n,to:s}))}),i.dispatch({effects:t}),!0},UA=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:VA},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:BA},{key:"Ctrl-Alt-[",run:WA},{key:"Ctrl-Alt-]",run:qA}],zA={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},JS=G.define({combine(i){return Yi(i,zA)}});function ew(i){return[ws,GA]}function tw(i,e){let{state:t}=i,n=t.facet(JS),s=o=>{let l=i.lineBlockAt(i.posAtDOM(o.target)),a=Ga(i.state,l.from,l.to);a&&i.dispatch({effects:ll.of(a)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(i,s,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const Dg=te.replace({widget:new class extends Fi{toDOM(i){return tw(i,null)}}});class YA extends Fi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return tw(e,this.value)}}const FA={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Zh extends un{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function HA(i={}){let e=Object.assign(Object.assign({},FA),i),t=new Zh(e,!0),n=new Zh(e,!1),s=Fe.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Nn)!=o.state.facet(Nn)||o.startState.field(ws,!1)!=o.state.field(ws,!1)||rt(o.startState)!=rt(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new hn;for(let a of o.viewportLineBlocks){let c=Ga(o.state,a.from,a.to)?n:Ha(o.state,a.from,a.to)?t:null;c&&l.add(a.from,a.from,c)}return l.finish()}}),{domEventHandlers:r}=e;return[s,HC({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||ve.empty},initialSpacer(){return new Zh(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let c=Ga(o.state,l.from,l.to);if(c)return o.dispatch({effects:ll.of(c)}),!0;let h=Ha(o.state,l.from,l.to);return h?(o.dispatch({effects:jc.of(h)}),!0):!1}})}),ew()]}const GA=U.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class al{constructor(e,t){this.specs=e;let n;function s(l){let a=Mn.newName();return(n||(n=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof pi?l=>l.prop(Vs)==o.data:o?l=>l==o:void 0,this.style=VS(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=n?new Mn(n):null,this.themeType=t.themeType}static define(e,t){return new al(e,t||{})}}const Ou=G.define(),iw=G.define({combine(i){return i.length?[i[0]]:null}});function Dh(i){let e=i.facet(Ou);return e.length?e:i.facet(iw)}function nw(i,e){let t=[JA],n;return i instanceof al&&(i.module&&t.push(U.styleModule.of(i.module)),n=i.themeType),e!=null&&e.fallback?t.push(iw.of(i)):n?t.push(Ou.computeN([U.darkTheme],s=>s.facet(U.darkTheme)==(n=="dark")?[i]:[])):t.push(Ou.of(i)),t}class KA{constructor(e){this.markCache=Object.create(null),this.tree=rt(e.state),this.decorations=this.buildDeco(e,Dh(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=rt(e.state),n=Dh(e.state),s=n!=Dh(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return te.none;let n=new hn;for(let{from:s,to:r}of e.visibleRanges)SA(this.tree,t,(o,l,a)=>{n.add(o,l,this.markCache[a]||(this.markCache[a]=te.mark({class:a})))},s,r);return n.finish()}}const JA=Wn.high(Fe.fromClass(KA,{decorations:i=>i.decorations})),eT=al.define([{tag:w.meta,color:"#404740"},{tag:w.link,textDecoration:"underline"},{tag:w.heading,textDecoration:"underline",fontWeight:"bold"},{tag:w.emphasis,fontStyle:"italic"},{tag:w.strong,fontWeight:"bold"},{tag:w.strikethrough,textDecoration:"line-through"},{tag:w.keyword,color:"#708"},{tag:[w.atom,w.bool,w.url,w.contentSeparator,w.labelName],color:"#219"},{tag:[w.literal,w.inserted],color:"#164"},{tag:[w.string,w.deleted],color:"#a11"},{tag:[w.regexp,w.escape,w.special(w.string)],color:"#e40"},{tag:w.definition(w.variableName),color:"#00f"},{tag:w.local(w.variableName),color:"#30a"},{tag:[w.typeName,w.namespace],color:"#085"},{tag:w.className,color:"#167"},{tag:[w.special(w.variableName),w.macroName],color:"#256"},{tag:w.definition(w.propertyName),color:"#00c"},{tag:w.comment,color:"#940"},{tag:w.invalid,color:"#f00"}]),tT=U.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),sw=1e4,rw="()[]{}",ow=G.define({combine(i){return Yi(i,{afterCursor:!0,brackets:rw,maxScanDistance:sw,renderMatch:sT})}}),iT=te.mark({class:"cm-matchingBracket"}),nT=te.mark({class:"cm-nonmatchingBracket"});function sT(i){let e=[],t=i.matched?iT:nT;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}const rT=at.define({create(){return te.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet(ow);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=Ni(e.state,s.head,-1,n)||s.head>0&&Ni(e.state,s.head-1,1,n)||n.afterCursor&&(Ni(e.state,s.head,1,n)||s.headU.decorations.from(i)}),oT=[rT,tT];function lT(i={}){return[ow.of(i),oT]}const aT=new ge;function bu(i,e,t){let n=i.prop(e<0?ge.openedBy:ge.closedBy);if(n)return n;if(i.name.length==1){let s=t.indexOf(i.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function yu(i){let e=i.type.prop(aT);return e?e(i.node):i}function Ni(i,e,t,n={}){let s=n.maxScanDistance||sw,r=n.brackets||rw,o=rt(i),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let c=bu(a.type,t,r);if(c&&a.from0?e>=h.from&&eh.from&&e<=h.to))return cT(i,e,t,a,h,c,r)}}return hT(i,e,t,o,l.type,s,r)}function cT(i,e,t,n,s,r,o){let l=n.parent,a={from:s.from,to:s.to},c=0,h=l==null?void 0:l.cursor();if(h&&(t<0?h.childBefore(n.from):h.childAfter(n.to)))do if(t<0?h.to<=n.from:h.from>=n.to){if(c==0&&r.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},h=i.doc.iterRange(e,t>0?i.doc.length:0),f=0;for(let u=0;!h.next().done&&u<=r;){let d=h.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let O=o.indexOf(d[m]);if(!(O<0||n.resolveInner(p+m,1).type!=s))if(O%2==0==t>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:O>>1==a>>1};f--}}t>0&&(u+=d.length)}return h.done?{start:c,matched:!1}:null}const fT=Object.create(null),Lg=[Xt.none],Ng=[],Ig=Object.create(null),uT=Object.create(null);for(let[i,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"]])uT[i]=dT(fT,e);function Lh(i,e){Ng.indexOf(i)>-1||(Ng.push(i),console.warn(e))}function dT(i,e){let t=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let h=i[c]||w[c];h?typeof h=="function"?a.length?a=a.map(h):Lh(c,`Modifier ${c} used at start of tag`):a.length?Lh(c,`Tag ${c} used as modifier`):a=Array.isArray(h)?h:[h]:Lh(c,`Unknown highlighting tag ${c}`)}for(let c of a)t.push(c)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+t.map(l=>l.id),r=Ig[s];if(r)return r.id;let o=Ig[s]=Xt.define({id:Lg.length,name:n,props:[jS({[n]:t})]});return Lg.push(o),o.id}je.RTL,je.LTR;const pT=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=Td(i.state,t.from);return n.line?mT(i):n.block?OT(i):!1};function Ad(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let s=i(e,t);return s?(n(t.update(s)),!0):!1}}const mT=Ad(ST,0),gT=Ad(lw,0),OT=Ad((i,e)=>lw(i,e,yT(e)),0);function Td(i,e){let t=i.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const qr=50;function bT(i,{open:e,close:t},n,s){let r=i.sliceDoc(n-qr,n),o=i.sliceDoc(s,s+qr),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-e.length,c)==e&&o.slice(a,a+t.length)==t)return{open:{pos:n-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,f;s-n<=2*qr?h=f=i.sliceDoc(n,s):(h=i.sliceDoc(n,n+qr),f=i.sliceDoc(s-qr,s));let u=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return h.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:n+u+e.length,margin:/\s/.test(h.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function yT(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),s=t.to<=n.to?n:i.doc.lineAt(t.to);s.from>n.from&&s.from==t.to&&(s=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=s.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return e}function lw(i,e,t=e.selection.ranges){let n=t.map(r=>Td(e,r.from).block);if(!n.every(r=>r))return null;let s=t.map((r,o)=>bT(e,n[o],r.from,r.to));if(i!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:n[o].open+" "},{from:r.to,insert:" "+n[o].close}]))};if(i!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+c.length)==c?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:h,single:f}of n)(f||!h)&&r.push({from:l.from+c,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of n)if(l>=0){let c=o.from+l,h=c+a.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const Su=mn.define(),wT=mn.define(),xT=G.define(),aw=G.define({combine(i){return Yi(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,s)=>e(n,s)||t(n,s)})}}),cw=at.define({create(){return Ii.empty},update(i,e){let t=e.state.facet(aw),n=e.annotation(Su);if(n){let a=Nt.fromTransaction(e,n.selection),c=n.side,h=c==0?i.undone:i.done;return a?h=Ka(h,h.length,t.minDepth,a):h=uw(h,e.startState.selection),new Ii(c==0?n.rest:h,c==0?h:n.rest)}let s=e.annotation(wT);if((s=="full"||s=="before")&&(i=i.isolate()),e.annotation(Ke.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let r=Nt.fromTransaction(e),o=e.annotation(Ke.time),l=e.annotation(Ke.userEvent);return r?i=i.addChanges(r,o,l,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new Ii(i.done.map(Nt.fromJSON),i.undone.map(Nt.fromJSON))}});function vT(i={}){return[cw,aw.of(i),U.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?hw:e.inputType=="historyRedo"?wu:null;return n?(e.preventDefault(),n(t)):!1}})]}function Xc(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let s=t.field(cw,!1);if(!s)return!1;let r=s.pop(i,t,e);return r?(n(r),!0):!1}}const hw=Xc(0,!1),wu=Xc(1,!1),_T=Xc(0,!0),kT=Xc(1,!0);class Nt{constructor(e,t,n,s,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Nt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Nt(e.changes&&nt.fromJSON(e.changes),[],e.mapped&&Vi.fromJSON(e.mapped),e.startSelection&&A.fromJSON(e.startSelection),e.selectionsAfter.map(A.fromJSON))}static fromTransaction(e,t){let n=ni;for(let s of e.startState.facet(xT)){let r=s(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new Nt(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,ni)}static selection(e){return new Nt(void 0,ni,void 0,void 0,e)}}function Ka(i,e,t,n){let s=e+1>t+20?e-t-1:0,r=i.slice(s,e);return r.push(n),r}function $T(i,e){let t=[],n=!1;return i.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=c&&o<=h&&(n=!0)}}),n}function PT(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function fw(i,e){return i.length?e.length?i.concat(e):i:e}const ni=[],QT=200;function uw(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-QT));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Ka(i,i.length-1,1e9,t.setSelAfter(n)))}else return[Nt.selection([e])]}function ET(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Nh(i,e){if(!i.length)return i;let t=i.length,n=ni;for(;t;){let s=CT(i[t-1],e,n);if(s.changes&&!s.changes.empty||s.effects.length){let r=i.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,n=s.selectionsAfter}return n.length?[Nt.selection(n)]:ni}function CT(i,e,t){let n=fw(i.selectionsAfter.length?i.selectionsAfter.map(l=>l.map(e)):ni,t);if(!i.changes)return Nt.selection(n);let s=i.changes.map(e),r=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(r):r;return new Nt(s,fe.mapEffects(i.effects,e),o,i.startSelection.map(r),n)}const AT=/^(input\.type|delete)($|\.)/;class Ii{constructor(e,t,n=0,s=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new Ii(this.done,this.undone):this}addChanges(e,t,n,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||AT.test(n))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):Vc(t,e))}function xt(i){return i.textDirectionAt(i.state.selection.main.head)==je.LTR}const pw=i=>dw(i,!xt(i)),mw=i=>dw(i,xt(i));function gw(i,e){return wi(i,t=>t.empty?i.moveByGroup(t,e):Vc(t,e))}const RT=i=>gw(i,!xt(i)),MT=i=>gw(i,xt(i));function ZT(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function Bc(i,e,t){let n=rt(i).resolveInner(e.head),s=t?ge.closedBy:ge.openedBy;for(let a=e.head;;){let c=t?n.childAfter(a):n.childBefore(a);if(!c)break;ZT(i,c,s)?n=c:a=t?c.to:c.from}let r=n.type.prop(s),o,l;return r&&(o=t?Ni(i,n.from,1):Ni(i,n.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?n.to:n.from,A.cursor(l,t?-1:1)}const DT=i=>wi(i,e=>Bc(i.state,e,!xt(i))),LT=i=>wi(i,e=>Bc(i.state,e,xt(i)));function Ow(i,e){return wi(i,t=>{if(!t.empty)return Vc(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}const bw=i=>Ow(i,!1),yw=i=>Ow(i,!0);function Sw(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):Vc(o,e));if(s.eq(n.selection))return!1;let r;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),l=i.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,c=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomww(i,!1),xu=i=>ww(i,!0);function qn(i,e,t){let n=i.lineBlockAt(e.head),s=i.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?n.to:n.from)&&(s=i.moveToLineBoundary(e,t,!1)),!t&&s.head==n.from&&n.length){let r=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(s=A.cursor(n.from+r))}return s}const NT=i=>wi(i,e=>qn(i,e,!0)),IT=i=>wi(i,e=>qn(i,e,!1)),jT=i=>wi(i,e=>qn(i,e,!xt(i))),XT=i=>wi(i,e=>qn(i,e,xt(i))),VT=i=>wi(i,e=>A.cursor(i.lineBlockAt(e.head).from,1)),BT=i=>wi(i,e=>A.cursor(i.lineBlockAt(e.head).to,-1));function WT(i,e,t){let n=!1,s=Qr(i.selection,r=>{let o=Ni(i,r.head,-1)||Ni(i,r.head,1)||r.head>0&&Ni(i,r.head-1,1)||r.headWT(i,e);function ui(i,e){let t=Qr(i.state.selection,n=>{let s=e(n);return A.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(Hi(i.state,t)),!0)}function xw(i,e){return ui(i,t=>i.moveByChar(t,e))}const vw=i=>xw(i,!xt(i)),_w=i=>xw(i,xt(i));function kw(i,e){return ui(i,t=>i.moveByGroup(t,e))}const UT=i=>kw(i,!xt(i)),zT=i=>kw(i,xt(i)),YT=i=>ui(i,e=>Bc(i.state,e,!xt(i))),FT=i=>ui(i,e=>Bc(i.state,e,xt(i)));function $w(i,e){return ui(i,t=>i.moveVertically(t,e))}const Pw=i=>$w(i,!1),Qw=i=>$w(i,!0);function Ew(i,e){return ui(i,t=>i.moveVertically(t,e,Sw(i).height))}const Xg=i=>Ew(i,!1),Vg=i=>Ew(i,!0),HT=i=>ui(i,e=>qn(i,e,!0)),GT=i=>ui(i,e=>qn(i,e,!1)),KT=i=>ui(i,e=>qn(i,e,!xt(i))),JT=i=>ui(i,e=>qn(i,e,xt(i))),eR=i=>ui(i,e=>A.cursor(i.lineBlockAt(e.head).from)),tR=i=>ui(i,e=>A.cursor(i.lineBlockAt(e.head).to)),Bg=({state:i,dispatch:e})=>(e(Hi(i,{anchor:0})),!0),Wg=({state:i,dispatch:e})=>(e(Hi(i,{anchor:i.doc.length})),!0),qg=({state:i,dispatch:e})=>(e(Hi(i,{anchor:i.selection.main.anchor,head:0})),!0),Ug=({state:i,dispatch:e})=>(e(Hi(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),iR=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),nR=({state:i,dispatch:e})=>{let t=Wc(i).map(({from:n,to:s})=>A.range(n,Math.min(s+1,i.doc.length)));return e(i.update({selection:A.create(t),userEvent:"select"})),!0},sR=({state:i,dispatch:e})=>{let t=Qr(i.selection,n=>{let s=rt(i),r=s.resolveStack(n.from,1);if(n.empty){let o=s.resolveStack(n.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return A.range(l.to,l.from)}return n});return t.eq(i.selection)?!1:(e(Hi(i,t)),!0)},rR=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=A.create([t.main]):t.main.empty||(n=A.create([A.cursor(t.main.head)])),n?(e(Hi(i,n)),!0):!1};function cl(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,s=n.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=jl(i,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=jl(i,o,!1),l=jl(i,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:A.cursor(o,os(i)))n.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const Cw=(i,e,t)=>cl(i,n=>{let s=n.from,{state:r}=i,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&sCw(i,!1,!0),Aw=i=>Cw(i,!0,!1),Tw=(i,e)=>cl(i,t=>{let n=t.head,{state:s}=i,r=s.doc.lineAt(n),o=s.charCategorizer(n);for(let l=null;;){if(n==(e?r.to:r.from)){n==t.head&&r.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let a=mt(r.text,n-r.from,e)+r.from,c=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),h=o(c);if(l!=null&&h!=l)break;(c!=" "||n!=t.head)&&(l=h),n=a}return n}),Rw=i=>Tw(i,!1),oR=i=>Tw(i,!0),lR=i=>cl(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headcl(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),cR=i=>cl(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Se.of(["",""])},range:A.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},fR=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let s=n.from,r=i.doc.lineAt(s),o=s==r.from?s-1:mt(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:mt(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:i.doc.slice(s,l).append(i.doc.slice(o,s))},range:A.cursor(l)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Wc(i){let e=[],t=-1;for(let n of i.selection.ranges){let s=i.doc.lineAt(n.from),r=i.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=i.doc.lineAt(n.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(n)}else e.push({from:s.from,to:r.to,ranges:[n]});t=r.number+1}return e}function Mw(i,e,t){if(i.readOnly)return!1;let n=[],s=[];for(let r of Wc(i)){if(t?r.to==i.doc.length:r.from==0)continue;let o=i.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){n.push({from:r.to,to:o.to},{from:r.from,insert:o.text+i.lineBreak});for(let a of r.ranges)s.push(A.range(Math.min(i.doc.length,a.anchor+l),Math.min(i.doc.length,a.head+l)))}else{n.push({from:o.from,to:r.from},{from:r.to,insert:i.lineBreak+o.text});for(let a of r.ranges)s.push(A.range(a.anchor-l,a.head-l))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:A.create(s,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}const uR=({state:i,dispatch:e})=>Mw(i,e,!1),dR=({state:i,dispatch:e})=>Mw(i,e,!0);function Zw(i,e,t){if(i.readOnly)return!1;let n=[];for(let s of Wc(i))t?n.push({from:s.from,insert:i.doc.slice(s.from,s.to)+i.lineBreak}):n.push({from:s.to,insert:i.lineBreak+i.doc.slice(s.from,s.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const pR=({state:i,dispatch:e})=>Zw(i,e,!1),mR=({state:i,dispatch:e})=>Zw(i,e,!0),gR=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(Wc(e).map(({from:s,to:r})=>(s>0?s--:r{let r;if(i.lineWrapping){let o=i.lineBlockAt(s.head),l=i.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+i.documentTop-l.bottom+i.defaultLineHeight/2)}return i.moveVertically(s,!0,r)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function OR(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=rt(i).resolveInner(e),n=t.childBefore(e),s=t.childAfter(e),r;return n&&s&&n.to<=e&&s.from>=e&&(r=n.type.prop(ge.closedBy))&&r.indexOf(s.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(s.from).from&&!/\S/.test(i.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const zg=Dw(!1),bR=Dw(!0);function Dw(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!i&&r==o&&OR(e,r);i&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new Ic(e,{simulateBreak:r,simulateDoubleBreak:!!a}),h=Ed(c,r);for(h==null&&(h=Pr(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=n.from;o<=n.to;){let l=i.doc.lineAt(o);l.number>t&&(n.empty||n.to>l.from)&&(e(l,s,n),t=l.number),o=l.to+1}let r=i.changes(s);return{changes:s,range:A.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}const yR=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new Ic(i,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=Rd(i,(r,o,l)=>{let a=Ed(n,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],h=Io(i,a);(c!=h||l.fromi.readOnly?!1:(e(i.update(Rd(i,(t,n)=>{n.push({from:t.from,insert:i.facet(ol)})}),{userEvent:"input.indent"})),!0),Nw=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Rd(i,(t,n)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=Pr(s,i.tabSize),o=0,l=Io(i,Math.max(0,r-Fa(i)));for(;o(i.setTabFocusMode(),!0),wR=[{key:"Ctrl-b",run:pw,shift:vw,preventDefault:!0},{key:"Ctrl-f",run:mw,shift:_w},{key:"Ctrl-p",run:bw,shift:Pw},{key:"Ctrl-n",run:yw,shift:Qw},{key:"Ctrl-a",run:VT,shift:eR},{key:"Ctrl-e",run:BT,shift:tR},{key:"Ctrl-d",run:Aw},{key:"Ctrl-h",run:vu},{key:"Ctrl-k",run:lR},{key:"Ctrl-Alt-h",run:Rw},{key:"Ctrl-o",run:hR},{key:"Ctrl-t",run:fR},{key:"Ctrl-v",run:xu}],xR=[{key:"ArrowLeft",run:pw,shift:vw,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:RT,shift:UT,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:jT,shift:KT,preventDefault:!0},{key:"ArrowRight",run:mw,shift:_w,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:MT,shift:zT,preventDefault:!0},{mac:"Cmd-ArrowRight",run:XT,shift:JT,preventDefault:!0},{key:"ArrowUp",run:bw,shift:Pw,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Bg,shift:qg},{mac:"Ctrl-ArrowUp",run:jg,shift:Xg},{key:"ArrowDown",run:yw,shift:Qw,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Wg,shift:Ug},{mac:"Ctrl-ArrowDown",run:xu,shift:Vg},{key:"PageUp",run:jg,shift:Xg},{key:"PageDown",run:xu,shift:Vg},{key:"Home",run:IT,shift:GT,preventDefault:!0},{key:"Mod-Home",run:Bg,shift:qg},{key:"End",run:NT,shift:HT,preventDefault:!0},{key:"Mod-End",run:Wg,shift:Ug},{key:"Enter",run:zg,shift:zg},{key:"Mod-a",run:iR},{key:"Backspace",run:vu,shift:vu},{key:"Delete",run:Aw},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Rw},{key:"Mod-Delete",mac:"Alt-Delete",run:oR},{mac:"Mod-Backspace",run:aR},{mac:"Mod-Delete",run:cR}].concat(wR.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),vR=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:DT,shift:YT},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:LT,shift:FT},{key:"Alt-ArrowUp",run:uR},{key:"Shift-Alt-ArrowUp",run:pR},{key:"Alt-ArrowDown",run:dR},{key:"Shift-Alt-ArrowDown",run:mR},{key:"Escape",run:rR},{key:"Mod-Enter",run:bR},{key:"Alt-l",mac:"Ctrl-l",run:nR},{key:"Mod-i",run:sR,preventDefault:!0},{key:"Mod-[",run:Nw},{key:"Mod-]",run:Lw},{key:"Mod-Alt-\\",run:yR},{key:"Shift-Mod-k",run:gR},{key:"Shift-Mod-\\",run:qT},{key:"Mod-/",run:pT},{key:"Alt-A",run:gT},{key:"Ctrl-m",mac:"Shift-Alt-m",run:SR}].concat(xR),_R={key:"Tab",run:Lw,shift:Nw};function De(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var s=t[n];typeof s=="string"?i.setAttribute(n,s):s!=null&&(i[n]=s)}e++}for(;ei.normalize("NFKD"):i=>i;class pr{constructor(e,t,n=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=r?l=>r(Yg(l)):Yg,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Rt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ad(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Zi(e);let s=this.normalize(t);if(s.length)for(let r=0,o=n;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,s=n+t[0].length;if(this.matchPos=Ja(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,s,t)))return this.value={from:n,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||s.to<=t){let l=new Js(t,e.sliceString(t,n));return Ih.set(e,l),l}if(s.from==t&&s.to==n)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,s=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,t)))return this.value={from:n,to:s,match:t},this.matchPos=Ja(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Js.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Xw.prototype[Symbol.iterator]=Vw.prototype[Symbol.iterator]=function(){return this});function kR(i){try{return new RegExp(i,Md),!0}catch{return!1}}function Ja(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function _u(i){let e=String(i.state.doc.lineAt(i.state.selection.main.head).number),t=De("input",{class:"cm-textfield",name:"line",value:e}),n=De("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),i.dispatch({effects:ec.of(!1)}),i.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},De("label",i.state.phrase("Go to line"),": ",t)," ",De("button",{class:"cm-button",type:"submit"},i.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=i,l=o.doc.lineAt(o.selection.main.head),[,a,c,h,f]=r,u=h?+h.slice(1):0,d=c?+c:l.number;if(c&&f){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),m=A.cursor(p.from+Math.max(0,Math.min(u,p.length)));i.dispatch({effects:[ec.of(!1),U.scrollIntoView(m.from,{y:"center"})],selection:m}),i.focus()}return{dom:n}}const ec=fe.define(),Fg=at.define({create(){return!0},update(i,e){for(let t of e.effects)t.is(ec)&&(i=t.value);return i},provide:i=>Lo.from(i,e=>e?_u:null)}),$R=i=>{let e=Do(i,_u);if(!e){let t=[ec.of(!0)];i.state.field(Fg,!1)==null&&t.push(fe.appendConfig.of([Fg,PR])),i.dispatch({effects:t}),e=Do(i,_u)}return e&&e.dom.querySelector("input").select(),!0},PR=U.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),QR={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ER=G.define({combine(i){return Yi(i,QR,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function CR(i){return[ZR,MR]}const AR=te.mark({class:"cm-selectionMatch"}),TR=te.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Hg(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=Ve.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=Ve.Word)}function RR(i,e,t,n){return i(e.sliceDoc(t,t+1))==Ve.Word&&i(e.sliceDoc(n-1,n))==Ve.Word}const MR=Fe.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(ER),{state:t}=i,n=t.selection;if(n.ranges.length>1)return te.none;let s=n.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return te.none;let a=t.wordAt(s.head);if(!a)return te.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return te.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Hg(o,t,s.from,s.to)&&RR(o,t,s.from,s.to)))return te.none}else if(r=t.sliceDoc(s.from,s.to),!r)return te.none}let l=[];for(let a of i.visibleRanges){let c=new pr(t.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:f}=c.value;if((!o||Hg(o,t,h,f))&&(s.empty&&h<=s.from&&f>=s.to?l.push(TR.range(h,f)):(h>=s.to||f<=s.from)&&l.push(AR.range(h,f)),l.length>e.maxMatches))return te.none}}return te.set(l)}},{decorations:i=>i.decorations}),ZR=U.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),DR=({state:i,dispatch:e})=>{let{selection:t}=i,n=A.create(t.ranges.map(s=>i.wordAt(s.head)||A.cursor(s.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function LR(i,e){let{main:t,ranges:n}=i.selection,s=i.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new pr(i.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new pr(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(a=>a.from==l.value.from))continue;if(r){let a=i.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const NR=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(r=>r.from===r.to))return DR({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(r=>i.sliceDoc(r.from,r.to)!=n))return!1;let s=LR(i,n);return s?(e(i.update({selection:i.selection.addRange(A.range(s.from,s.to),!1),effects:U.scrollIntoView(s.to)})),!0):!1},Er=G.define({combine(i){return Yi(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new HR(e),scrollToMatch:e=>U.scrollIntoView(e)})}});class Bw{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||kR(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?` `:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new VR(this):new jR(this)}getCursor(e,t=0,n){let s=e.doc?e:be.create({doc:e});return n==null&&(n=s.doc.length),this.regexp?Ds(this,s,t,n):Zs(this,s,t,n)}}class Ww{constructor(e){this.spec=e}}function Zs(i,e,t,n){return new pr(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:s=>s.toLowerCase(),i.wholeWord?IR(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function IR(i,e){return(t,n,s,r)=>((r>t||r+s.length=t)return null;s.push(n.value)}return s}highlight(e,t,n,s){let r=Zs(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Ds(i,e,t,n){return new Xw(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:i.wholeWord?XR(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function tc(i,e){return i.slice(mt(i,e,!1),e)}function ic(i,e){return i.slice(e,mt(i,e))}function XR(i){return(e,t,n)=>!n[0].length||(i(tc(n.input,n.index))!=Ve.Word||i(ic(n.input,n.index))!=Ve.Word)&&(i(ic(n.input,n.index+n[0].length))!=Ve.Word||i(tc(n.input,n.index+n[0].length))!=Ve.Word)}class VR extends Ww{nextMatch(e,t,n){let s=Ds(this.spec,e,n,e.doc.length).next();return s.done&&(s=Ds(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,n){for(let s=1;;s++){let r=Math.max(t,n-s*1e4),o=Ds(this.spec,e,r,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n=t)return null;s.push(n.value)}return s}highlight(e,t,n,s){let r=Ds(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const jo=fe.define(),Zd=fe.define(),Tn=at.define({create(i){return new jh(ku(i).create(),null)},update(i,e){for(let t of e.effects)t.is(jo)?i=new jh(t.value.create(),i.panel):t.is(Zd)&&(i=new jh(i.query,t.value?Dd:null));return i},provide:i=>Lo.from(i,e=>e.panel)});class jh{constructor(e,t){this.query=e,this.panel=t}}const BR=te.mark({class:"cm-searchMatch"}),WR=te.mark({class:"cm-searchMatch cm-searchMatch-selected"}),qR=Fe.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(Tn))}update(i){let e=i.state.field(Tn);(e!=i.startState.field(Tn)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return te.none;let{view:t}=this,n=new hn;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;i.highlight(t.state,l,a,(c,h)=>{let f=t.state.selection.ranges.some(u=>u.from==c&&u.to==h);n.add(c,h,f?WR:BR)})}return n.finish()}},{decorations:i=>i.decorations});function hl(i){return e=>{let t=e.state.field(Tn,!1);return t&&t.query.spec.valid?i(e,t):zw(e)}}const nc=hl((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let s=A.single(n.from,n.to),r=i.state.facet(Er);return i.dispatch({selection:s,effects:[Ld(i,n),r.scrollToMatch(s.main,i)],userEvent:"select.search"}),Uw(i),!0}),sc=hl((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,s=e.prevMatch(t,n,n);if(!s)return!1;let r=A.single(s.from,s.to),o=i.state.facet(Er);return i.dispatch({selection:r,effects:[Ld(i,s),o.scrollToMatch(r.main,i)],userEvent:"select.search"}),Uw(i),!0}),UR=hl((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:A.create(t.map(n=>A.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),zR=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:s}=t.main,r=[],o=0;for(let l=new pr(i.doc,i.sliceDoc(n,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==n&&(o=r.length),r.push(A.range(l.value.from,l.value.to))}return e(i.update({selection:A.create(r,o),userEvent:"select.search.matches"})),!0},Gg=hl((i,{query:e})=>{let{state:t}=i,{from:n,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,n,n);if(!r)return!1;let o=r,l=[],a,c,h=[];if(o.from==n&&o.to==s&&(c=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),h.push(U.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+"."))),o){let f=l.length==0||l[0].from>=r.to?0:r.to-r.from-c.length;a=A.single(o.from-f,o.to-f),h.push(Ld(i,o)),h.push(t.facet(Er).scrollToMatch(a.main,i))}return i.dispatch({changes:l,selection:a,effects:h,userEvent:"input.replace"}),!0}),YR=hl((i,{query:e})=>{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:U.announce.of(n),userEvent:"input.replace.all"}),!0});function Dd(i){return i.state.facet(Er).createPanel(i)}function ku(i,e){var t,n,s,r,o;let l=i.selection.main,a=l.empty||l.to>l.from+100?"":i.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=i.facet(Er);return new Bw({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:c.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function qw(i){let e=Do(i,Dd);return e&&e.dom.querySelector("[main-field]")}function Uw(i){let e=qw(i);e&&e==i.root.activeElement&&e.select()}const zw=i=>{let e=i.state.field(Tn,!1);if(e&&e.panel){let t=qw(i);if(t&&t!=i.root.activeElement){let n=ku(i.state,e.query.spec);n.valid&&i.dispatch({effects:jo.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[Zd.of(!0),e?jo.of(ku(i.state,e.query.spec)):fe.appendConfig.of(KR)]});return!0},Yw=i=>{let e=i.state.field(Tn,!1);if(!e||!e.panel)return!1;let t=Do(i,Dd);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:Zd.of(!1)}),!0},FR=[{key:"Mod-f",run:zw,scope:"editor search-panel"},{key:"F3",run:nc,shift:sc,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:nc,shift:sc,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Yw,scope:"editor search-panel"},{key:"Mod-Shift-l",run:zR},{key:"Mod-Alt-g",run:$R},{key:"Mod-d",run:NR,preventDefault:!0}];class HR{constructor(e){this.view=e;let t=this.query=e.state.field(Tn).query.spec;this.commit=this.commit.bind(this),this.searchField=De("input",{value:t.search,placeholder:Wt(e,"Find"),"aria-label":Wt(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=De("input",{value:t.replace,placeholder:Wt(e,"Replace"),"aria-label":Wt(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=De("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=De("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=De("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(s,r,o){return De("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=De("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>nc(e),[Wt(e,"next")]),n("prev",()=>sc(e),[Wt(e,"previous")]),n("select",()=>UR(e),[Wt(e,"all")]),De("label",null,[this.caseField,Wt(e,"match case")]),De("label",null,[this.reField,Wt(e,"regexp")]),De("label",null,[this.wordField,Wt(e,"by word")]),...e.state.readOnly?[]:[De("br"),this.replaceField,n("replace",()=>Gg(e),[Wt(e,"replace")]),n("replaceAll",()=>YR(e),[Wt(e,"replace all")])],De("button",{name:"close",onclick:()=>Yw(e),"aria-label":Wt(e,"close"),type:"button"},["×"])])}commit(){let e=new Bw({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:jo.of(e)}))}keydown(e){sC(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?sc:nc)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Gg(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(jo)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Er).top}}function Wt(i,e){return i.state.phrase(e)}const Xl=30,Vl=/[\s\.,:;?!]/;function Ld(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),s=i.state.doc.lineAt(t).to,r=Math.max(n.from,e-Xl),o=Math.min(s,t+Xl),l=i.state.sliceDoc(r,o);if(r!=n.from){for(let a=0;al.length-Xl;a--)if(!Vl.test(l[a-1])&&Vl.test(l[a])){l=l.slice(0,a);break}}return U.announce.of(`${i.state.phrase("current match")}. ${l} ${i.state.phrase("on line")} ${n.number}.`)}const GR=U.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),KR=[Tn,Wn.low(qR),GR];class Fw{constructor(e,t,n,s){this.state=e,this.pos=t,this.explicit=n,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=rt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),s=t.text.slice(n-t.from,this.pos-t.from),r=s.search(Gw(e,!1));return r<0?null:{from:n+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function Kg(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function JR(i){let e=Object.create(null),t=Object.create(null);for(let{label:s}of i){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,n]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:JR(e);return s=>{let r=s.matchBefore(n);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function eM(i,e){return t=>{for(let n=rt(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}class Jg{constructor(e,t,n,s){this.completion=e,this.source=t,this.match=n,this.score=s}}function us(i){return i.selection.main.from}function Gw(i,e){var t;let{source:n}=i,s=e&&n[0]!="^",r=n[n.length-1]!="$";return!s&&!r?i:new RegExp(`${s?"^":""}(?:${n})${r?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}const Nd=mn.define();function tM(i,e,t,n){let{main:s}=i.selection,r=t-s.from,o=n-s.from;return Object.assign(Object.assign({},i.changeByRange(l=>{if(l!=s&&t!=n&&i.sliceDoc(l.from+r,l.from+o)!=i.sliceDoc(t,n))return{range:l};let a=i.toText(e);return{changes:{from:l.from+r,to:n==s.from?l.to:l.from+o,insert:a},range:A.cursor(l.from+r+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const eO=new WeakMap;function iM(i){if(!Array.isArray(i))return i;let e=eO.get(i);return e||eO.set(i,e=Hw(i)),e}const rc=fe.define(),Xo=fe.define();class nM{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&v<=57||v>=97&&v<=122?2:v>=65&&v<=90?1:0:($=ad(v))!=$.toLowerCase()?1:$!=$.toUpperCase()?2:0;(!S||P==1&&g||x==0&&P!=0)&&(t[f]==v||n[f]==v&&(u=!0)?o[f++]=S:o.length&&(O=!1)),x=P,S+=Zi(v)}return f==a&&o[0]==0&&O?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(O?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,n){let s=[],r=0;for(let o of t){let l=o+(this.astral?Zi(Rt(n,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-n.length,s)}}class sM{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:rM,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>tO(e(n),t(n)),optionClass:(e,t)=>n=>tO(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function tO(i,e){return i?e?i+" "+e:i:e}function rM(i,e,t,n,s,r){let o=i.textDirection==je.RTL,l=o,a=!1,c="top",h,f,u=e.left-s.left,d=s.right-e.right,p=n.right-n.left,m=n.bottom-n.top;if(l&&u=m||S>e.top?h=t.bottom-e.top:(c="bottom",h=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,O=(e.right-e.left)/r.offsetWidth;return{style:`${c}: ${h/g}px; max-width: ${f/O}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function oM(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let c=0;ca&&o.appendChild(document.createTextNode(l.slice(a,h)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(h,f))),u.className="cm-completionMatchedText",a=f}return at.position-n.position).map(t=>t.render)}function Xh(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}class lM{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(ot);this.optionContent=oM(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Xh(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(t).open;for(let h=a.target,f;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(f=/-(\d+)$/.exec(h.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(ot).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Xo.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=s){let{options:r,selected:o,disabled:l}=n.open;(!s.open||s.open.options!=r)&&(this.range=Xh(r.length,o,e.state.facet(ot).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Xh(t.options.length,t.selected,this.view.state.facet(ot).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:s}=n;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(n);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,n)}).catch(o=>Lt(this.view.state,o,"completion info")):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;n.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,s=this.range.from;n;n=n.nextSibling,s++)n.nodeName!="LI"||!n.id?s--:s==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&cM(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomn.from||n.from==0))if(r=u,typeof c!="string"&&c.header)s.appendChild(c.header(c));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const h=s.appendChild(document.createElement("li"));h.id=t+"-"+o,h.setAttribute("role","option");let f=this.optionClass(l);f&&(h.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&h.appendChild(d)}}return n.from&&s.classList.add("cm-completionListIncompleteTop"),n.tonew lM(t,i,e)}function cM(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),s=t.height/i.offsetHeight;n.topt.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/s)}function iO(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function hM(i,e){let t=[],n=null,s=c=>{t.push(c);let{section:h}=c.completion;if(h){n||(n=[]);let f=typeof h=="string"?h:h.name;n.some(u=>u.name==f)||n.push(typeof h=="string"?{name:f}:h)}},r=e.facet(ot);for(let c of i)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)s(new Jg(f,c.source,h?h(f):[],1e9-t.length));else{let f=e.sliceDoc(c.from,c.to),u,d=r.filterStrict?new sM(f):new nM(f);for(let p of c.result.options)if(u=d.match(p.label)){let m=p.displayLabel?h?h(p,u.matched):[]:u.matched;s(new Jg(p,c.source,m,u.score+(p.boost||0)))}}}if(n){let c=Object.create(null),h=0,f=(u,d)=>{var p,m;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((m=d.rank)!==null&&m!==void 0?m:1e9)||(u.namef.score-h.score||a(h.completion,f.completion))){let h=c.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(c):iO(c.completion)>iO(l)&&(o[o.length-1]=c),l=c.completion}return o}class Bs{constructor(e,t,n,s,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Bs(this.options,nO(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,s,r,o){if(s&&!o&&e.some(c=>c.isPending))return s.setDisabled();let l=hM(e,t);if(!l.length)return s&&e.some(c=>c.isPending)?s.setDisabled():null;let a=t.facet(ot).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let c=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(c,h.from):c,1e8),create:gM,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new Bs(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new Bs(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class oc{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new oc(pM,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(ot),r=(n.override||t.languageDataAt("autocomplete",us(t)).map(iM)).map(a=>(this.active.find(h=>h.source==a)||new si(a,this.active.some(h=>h.state!=0)?1:0)).update(e,n));r.length==this.active.length&&r.every((a,c)=>a==this.active[c])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(Id));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!fM(r,this.active)||l?o=Bs.build(r,t,this.id,o,n,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new si(a.source,0):a));for(let a of e.effects)a.is(Jw)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new oc(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?uM:dM}}function fM(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t-1&&(t["aria-activedescendant"]=i+"-"+e),t}const pM=[];function Kw(i,e){if(i.isUserEvent("input.complete")){let n=i.annotation(Nd);if(n&&e.activateOnCompletion(n))return 12}let t=i.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}class si{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let n=Kw(e,t),s=this;(n&8||n&16&&this.touches(e))&&(s=new si(s.source,0)),n&4&&s.state==0&&(s=new si(this.source,1)),s=s.updateFor(e,n);for(let r of e.effects)if(r.is(rc))s=new si(s.source,1,r.value);else if(r.is(Xo))s=new si(s.source,0);else if(r.is(Id))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(us(e.state))}}class er extends si{constructor(e,t,n,s,r,o){super(e,3,t),this.limit=n,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=us(e.state);if(l>o||!s||t&2&&(us(e.startState)==this.from||lt.map(e))}}),Jw=fe.define(),Zt=at.define({create(){return oc.start()},update(i,e){return i.update(e)},provide:i=>[vd.from(i,e=>e.tooltip),U.contentAttributes.from(i,e=>e.attrs)]});function jd(i,e){const t=e.completion.apply||e.completion.label;let n=i.state.field(Zt).active.find(s=>s.source==e.source);return n instanceof er?(typeof t=="string"?i.dispatch(Object.assign(Object.assign({},tM(i.state,t,n.from,n.to)),{annotations:Nd.of(e.completion)})):t(i,e.completion,n.from,n.to),!0):!1}const gM=aM(Zt,jd);function Bl(i,e="option"){return t=>{let n=t.state.field(Zt,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+s*(i?1:-1):i?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Jw.of(l)}),!0}}const OM=i=>{let e=i.state.field(Zt,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(Zt,!1)?(i.dispatch({effects:rc.of(!0)}),!0):!1,bM=i=>{let e=i.state.field(Zt,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:Xo.of(null)}),!0)};class yM{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const SM=50,wM=1e3,xM=Fe.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(Zt).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(Zt),t=i.state.facet(ot);if(!i.selectionSet&&!i.docChanged&&i.startState.field(Zt)==e)return;let n=i.transactions.some(r=>{let o=Kw(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rSM&&Date.now()-o.time>wM){for(let l of o.context.abortListeners)try{l()}catch(a){Lt(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(r=>r.effects.some(o=>o.is(rc)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of i.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(Zt);for(let t of e.active)t.isPending&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ot).updateSyncTime))}startQuery(i){let{state:e}=this.view,t=us(e),n=new Fw(e,t,i.explicit,this.view),s=new yM(i,n);this.running.push(s),Promise.resolve(i.source(n)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Xo.of(null)}),Lt(this.view.state,r)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ot).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ot),n=this.view.state.field(Zt);for(let s=0;sl.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new si(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:Id.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(Zt,!1);if(e&&e.tooltip&&this.view.state.facet(ot).closeOnBlur){let t=e.open&&AS(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Xo.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:rc.of(!1)}),20),this.composing=0}}}),vM=typeof navigator=="object"&&/Win/.test(navigator.platform),_M=Wn.highest(U.domEventHandlers({keydown(i,e){let t=e.state.field(Zt,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(vM&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],s=t.active.find(o=>o.source==n.source),r=n.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(i.key)>-1&&jd(e,n),!1}})),e1=U.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class kM{constructor(e,t,n,s){this.field=e,this.line=t,this.from=n,this.to=s}}class Xd{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,pt.TrackDel),n=e.mapPos(this.to,1,pt.TrackDel);return t==null||n==null?null:new Xd(this.field,t,n)}}class Vd{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(n.length){let c=o,h=/^\t*/.exec(a)[0].length;for(let f=0;fnew Xd(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:n,ranges:l}}static parse(e){let t=[],n=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",c=-1,h=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&u.field++}s.push(new kM(c,n.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let h of s)h.line==n.length&&h.from>c&&(h.from--,h.to--);return a}),n.push(o)}return new Vd(n,s)}}let $M=te.widget({widget:new class extends Fi{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),PM=te.mark({class:"cm-snippetField"});class Cr{constructor(e,t){this.ranges=e,this.active=t,this.deco=te.set(e.map(n=>(n.from==n.to?$M:PM).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let s=n.map(e);if(!s)return null;t.push(s)}return new Cr(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}}const fl=fe.define({map(i,e){return i&&i.map(e)}}),QM=fe.define(),Vo=at.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(fl))return t.value;if(t.is(QM)&&i)return new Cr(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>U.decorations.from(i,e=>e?e.deco:te.none)});function Bd(i,e){return A.create(i.filter(t=>t.field==e).map(t=>A.range(t.from,t.to)))}function EM(i){let e=Vd.parse(i);return(t,n,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,c={changes:{from:s,to:r==a.from?a.to:r,insert:Se.of(o)},scrollIntoView:!0,annotations:n?[Nd.of(n),Ke.userEvent.of("input.complete")]:void 0};if(l.length&&(c.selection=Bd(l,0)),l.some(h=>h.field>0)){let h=new Cr(l,0),f=c.effects=[fl.of(h)];t.state.field(Vo,!1)===void 0&&f.push(fe.appendConfig.of([Vo,MM,ZM,e1]))}t.dispatch(t.state.update(c))}}function t1(i){return({state:e,dispatch:t})=>{let n=e.field(Vo,!1);if(!n||i<0&&n.active==0)return!1;let s=n.active+i,r=i>0&&!n.ranges.some(o=>o.field==s+i);return t(e.update({selection:Bd(n.ranges,s),effects:fl.of(r?null:new Cr(n.ranges,s)),scrollIntoView:!0})),!0}}const CM=({state:i,dispatch:e})=>i.field(Vo,!1)?(e(i.update({effects:fl.of(null)})),!0):!1,AM=t1(1),TM=t1(-1),RM=[{key:"Tab",run:AM,shift:TM},{key:"Escape",run:CM}],rO=G.define({combine(i){return i.length?i[0]:RM}}),MM=Wn.highest(sl.compute([rO],i=>i.facet(rO)));function Tt(i,e){return Object.assign(Object.assign({},e),{apply:EM(i)})}const ZM=U.domEventHandlers({mousedown(i,e){let t=e.state.field(Vo,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=n&&r.to>=n);return!s||s.field==t.active?!1:(e.dispatch({selection:Bd(t.ranges,s.field),effects:fl.of(t.ranges.some(r=>r.field>s.field)?new Cr(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Bo={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},rs=fe.define({map(i,e){let t=e.mapPos(i,-1,pt.TrackAfter);return t??void 0}}),Wd=new class extends Os{};Wd.startSide=1;Wd.endSide=-1;const i1=at.define({create(){return ve.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(rs)&&(i=i.update({add:[Wd.range(t.value,t.value+1)]}));return i}});function DM(){return[NM,i1]}const Vh="()[]{}<>";function n1(i){for(let e=0;e{if((LM?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let s=i.state.selection.main;if(n.length>2||n.length==2&&Zi(Rt(n,0))==1||e!=s.from||t!=s.to)return!1;let r=XM(i.state,n);return r?(i.dispatch(r),!0):!1}),IM=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=s1(i,i.selection.main.head).brackets||Bo.brackets,s=null,r=i.changeByRange(o=>{if(o.empty){let l=VM(i.doc,o.head);for(let a of n)if(a==l&&qc(i.doc,o.head)==n1(Rt(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:A.cursor(o.head-a.length)}}return{range:s=o}});return s||e(i.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},jM=[{key:"Backspace",run:IM}];function XM(i,e){let t=s1(i,i.selection.main.head),n=t.brackets||Bo.brackets;for(let s of n){let r=n1(Rt(s,0));if(e==s)return r==s?qM(i,s,n.indexOf(s+s+s)>-1,t):BM(i,s,r,t.before||Bo.before);if(e==r&&r1(i,i.selection.main.from))return WM(i,s,r)}return null}function r1(i,e){let t=!1;return i.field(i1).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function qc(i,e){let t=i.sliceString(e,e+2);return t.slice(0,Zi(Rt(t,0)))}function VM(i,e){let t=i.sliceString(e-2,e);return Zi(Rt(t,0))==t.length?t:t.slice(1)}function BM(i,e,t,n){let s=null,r=i.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:rs.of(o.to+e.length),range:A.range(o.anchor+e.length,o.head+e.length)};let l=qc(i.doc,o.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:rs.of(o.head+e.length),range:A.cursor(o.head+e.length)}:{range:s=o}});return s?null:i.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function WM(i,e,t){let n=null,s=i.changeByRange(r=>r.empty&&qc(i.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:A.cursor(r.head+t.length)}:n={range:r});return n?null:i.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function qM(i,e,t,n){let s=n.stringPrefixes||Bo.stringPrefixes,r=null,o=i.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:rs.of(l.to+e.length),range:A.range(l.anchor+e.length,l.head+e.length)};let a=l.head,c=qc(i.doc,a),h;if(c==e){if(oO(i,a))return{changes:{insert:e+e,from:a},effects:rs.of(a+e.length),range:A.cursor(a+e.length)};if(r1(i,a)){let u=t&&i.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:A.cursor(a+u.length)}}}else{if(t&&i.sliceDoc(a-2*e.length,a)==e+e&&(h=lO(i,a-2*e.length,s))>-1&&oO(i,h))return{changes:{insert:e+e+e+e,from:a},effects:rs.of(a+e.length),range:A.cursor(a+e.length)};if(i.charCategorizer(a)(c)!=Ve.Word&&lO(i,a,s)>-1&&!UM(i,a,e,s))return{changes:{insert:e+e,from:a},effects:rs.of(a+e.length),range:A.cursor(a+e.length)}}return{range:r=l}});return r?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function oO(i,e){let t=rt(i).resolveInner(e+1);return t.parent&&t.from==e}function UM(i,e,t,n){let s=rt(i).resolveInner(e,-1),r=n.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=i.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&n.indexOf(l.slice(0,a))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>t.length+a;){if(i.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let c=s.to==e&&s.parent;if(!c)break;s=c}return!1}function lO(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=Ve.Word)return e;for(let s of t){let r=e-s.length;if(i.sliceDoc(r,e)==s&&n(i.sliceDoc(r-1,r))!=Ve.Word)return r}return-1}function zM(i={}){return[_M,Zt,ot.of(i),xM,YM,e1]}const o1=[{key:"Ctrl-Space",run:sO},{mac:"Alt-`",run:sO},{key:"Escape",run:bM},{key:"ArrowDown",run:Bl(!0)},{key:"ArrowUp",run:Bl(!1)},{key:"PageDown",run:Bl(!0,"page")},{key:"PageUp",run:Bl(!1,"page")},{key:"Enter",run:OM}],YM=Wn.highest(sl.computeN([ot],i=>i.facet(ot).defaultKeymap?[o1]:[]));class aO{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class ts{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let s=e,r=n.facet(Wo).markerFilter;r&&(s=r(s,n));let o=e.slice().sort((f,u)=>f.from-u.from||f.to-u.to),l=new hn,a=[],c=0;for(let f=0;;){let u=f==o.length?null:o[f];if(!u&&!a.length)break;let d,p;for(a.length?(d=c,p=a.reduce((g,O)=>Math.min(g,O.to),u&&u.from>d?u.from:1e8)):(d=u.from,p=u.to,a.push(u),f++);fg.from||g.to==d))a.push(g),f++,p=Math.min(g.to,p);else{p=Math.min(g.from,p);break}}let m=lZ(a);if(a.some(g=>g.from==g.to||g.from==g.to-1&&n.doc.lineAt(g.from).to==g.from))l.add(d,d,te.widget({widget:new nZ(m),diagnostics:a.slice()}));else{let g=a.reduce((O,S)=>S.markClass?O+" "+S.markClass:O,"");l.add(d,p,te.mark({class:"cm-lintRange cm-lintRange-"+m+g,diagnostics:a.slice(),inclusiveEnd:a.some(O=>O.to>p)}))}c=p;for(let g=0;g{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new aO(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new aO(n.from,r,n.diagnostic)}}),n}function FM(i,e){let t=e.pos,n=e.end||t,s=i.state.facet(Wo).hideOn(i,t,n);if(s!=null)return s;let r=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(o=>o.is(l1))||i.changes.touchesRange(r.from,Math.max(r.to,n)))}function HM(i,e){return i.field(Ft,!1)?e:e.concat(fe.appendConfig.of(aZ))}const l1=fe.define(),qd=fe.define(),a1=fe.define(),Ft=at.define({create(){return new ts(te.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,s=i.panel;if(i.selected){let r=e.changes.mapPos(i.selected.from,1);n=mr(t,i.selected.diagnostic,r)||mr(t,null,r)}!t.size&&s&&e.state.facet(Wo).autoPanel&&(s=null),i=new ts(t,s,n)}for(let t of e.effects)if(t.is(l1)){let n=e.state.facet(Wo).autoPanel?t.value.length?qo.open:null:i.panel;i=ts.init(t.value,n,e.state)}else t.is(qd)?i=new ts(i.diagnostics,t.value?qo.open:null,i.selected):t.is(a1)&&(i=new ts(i.diagnostics,i.panel,t.value));return i},provide:i=>[Lo.from(i,e=>e.panel),U.decorations.from(i,e=>e.diagnostics)]}),GM=te.mark({class:"cm-lintRange cm-lintRange-active"});function KM(i,e,t){let{diagnostics:n}=i.state.field(Ft),s,r=-1,o=-1;n.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:h})=>{if(e>=a&&e<=c&&(a==c||(e>a||t>0)&&(eh1(i,t,!1)))}const eZ=i=>{let e=i.state.field(Ft,!1);(!e||!e.panel)&&i.dispatch({effects:HM(i.state,[qd.of(!0)])});let t=Do(i,qo.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},cO=i=>{let e=i.state.field(Ft,!1);return!e||!e.panel?!1:(i.dispatch({effects:qd.of(!1)}),!0)},tZ=i=>{let e=i.state.field(Ft,!1);if(!e)return!1;let t=i.state.selection.main,n=e.diagnostics.iter(t.to+1);return!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},iZ=[{key:"Mod-Shift-m",run:eZ,preventDefault:!0},{key:"F8",run:tZ}],Wo=G.define({combine(i){return Object.assign({sources:i.map(e=>e.source).filter(e=>e!=null)},Yi(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function c1(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;nr.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function h1(i,e,t){var n;let s=t?c1(e.actions):[];return De("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},De("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((r,o)=>{let l=!1,a=u=>{if(u.preventDefault(),l)return;l=!0;let d=mr(i.state.field(Ft).diagnostics,e);d&&r.apply(i,d.from,d.to)},{name:c}=r,h=s[o]?c.indexOf(s[o]):-1,f=h<0?c:[c.slice(0,h),De("u",c.slice(h,h+1)),c.slice(h+1)];return De("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${s[o]})"`}.`},f)}),e.source&&De("div",{class:"cm-diagnosticSource"},e.source))}class nZ extends Fi{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return De("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class hO{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=h1(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class qo{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)cO(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=c1(r.actions);for(let l=0;l{for(let r=0;rcO(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ft).selected;if(!e)return-1;for(let t=0;t{for(let h of c.diagnostics){if(o.has(h))continue;o.add(h);let f=-1,u;for(let d=n;dn&&(this.items.splice(n,f-n),s=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),r=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),n++}});n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Ft),n=mr(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:a1.of(n)})}static open(e){return new qo(e)}}function sZ(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(i)}')`}function Wl(i){return sZ(``,'width="6" height="3"')}const rZ=U.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:Wl("#d11")},".cm-lintRange-warning":{backgroundImage:Wl("orange")},".cm-lintRange-info":{backgroundImage:Wl("#999")},".cm-lintRange-hint":{backgroundImage:Wl("#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}}});function oZ(i){return i=="error"?4:i=="warning"?3:i=="info"?2:1}function lZ(i){let e="hint",t=1;for(let n of i){let s=oZ(n.severity);s>t&&(t=s,e=n.severity)}return e}const aZ=[Ft,U.decorations.compute([Ft],i=>{let{selected:e,panel:t}=i.field(Ft);return!e||!t||e.from==e.to?te.none:te.set([GM.range(e.from,e.to)])}),UC(KM,{hideOn:FM}),rZ],cZ=[nA(),oA(),wC(),vT(),HA(),hC(),mC(),be.allowMultipleSelections.of(!0),DA(),nw(eT,{fallback:!0}),lT(),DM(),zM(),ZC(),NC(),PC(),CR(),sl.of([...jM,...vR,...FR,...TT,...UA,...o1,...iZ])];/*! * VueCodemirror v6.1.1 * Copyright (c) Surmon. All rights reserved. * Released under the MIT License. * Surmon */var hZ=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[cZ]}),fZ=Symbol("vue-codemirror-global-config"),$t,uZ=function(i){var e=i.onUpdate,t=i.onChange,n=i.onFocus,s=i.onBlur,r=function(o,l){var a={};for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&l.indexOf(c)<0&&(a[c]=o[c]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function"){var h=0;for(c=Object.getOwnPropertySymbols(o);ht%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let s=e.parser.context;return new lc(e,[],t,n,n,0,[],0,s?new dO(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,s=e&65535,{parser:r}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(s,c)}storeNode(e,t,n,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==n)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=n;return}}}if(!r||this.pos==n)this.buffer.push(e,t,n,s);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)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,s>4&&(s-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=s}}shift(e,t,n,s){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=s,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,s,4);else{let r=e,{parser:o}=this.p;(s>this.pos||t<=o.maxNode)&&(this.pos=s,o.stateFlag(r,1)||(this.reducePos=s)),this.pushState(r,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,s,4)}}apply(e,t,n,s){e&65536?this.reduce(e):this.shift(e,t,n,s)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(n,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new lc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new yZ(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;ra&1&&l==o)||s.push(t[r],o)}t=s}let n=[];for(let s=0;s>19,s=t&65535,r=this.stack.length-n*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;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=n(o,r+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class dO{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class yZ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class ac{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new ac(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ac(this.stack,this.pos,this.index)}}function to(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,s=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}t?t[s++]=r:t=new e(r)}return t}class ba{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const pO=new ba;class SZ{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=pO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,s=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-n.to,n=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,s;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),s=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),s}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=pO,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(n+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return n}}class tr{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;u1(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}tr.prototype.contextual=tr.prototype.fallback=tr.prototype.extend=!1;class $u{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?to(e):e}token(e,t){let n=e.pos,s=0;for(;;){let r=e.next<0,o=e.resolveOffset(1,1);if(u1(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(r||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(n,e.token),e.acceptToken(this.elseToken,s))}}$u.prototype.contextual=tr.prototype.fallback=tr.prototype.extend=!1;class ul{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function u1(i,e,t,n,s,r){let o=0,l=1<0){let p=i[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||wZ(p,e.token.value,s,r))){e.acceptToken(p);break}}let h=e.next,f=0,u=i[o+2];if(e.next<0&&u>f&&i[c+u*3-3]==65535){o=i[c+u*3-1];continue e}for(;f>1,p=c+d+(d<<1),m=i[p],g=i[p+1]||65536;if(h=g)f=d+1;else{o=i[p+2],e.advance();continue e}}break}}function mO(i,e,t){for(let n=e,s;(s=i[n])!=65535;n++)if(s==t)return n-e;return-1}function wZ(i,e,t,n){let s=mO(t,n,e);return s<0||mO(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}class xZ{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?gO(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?gO(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(r instanceof Je){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class vZ{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new ba)}getActions(e){let t=0,n=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;cf.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!h.extend&&(n=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new ba,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ba,{pos:n,p:s}=e;return t.start=n,t.end=Math.min(n+1,s.stream.end),t.value=n==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,n){let s=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(s,e),n),e.value>-1){let{parser:r}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,n,s){for(let r=0;re.bufferLength*4?new xZ(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],s,r;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;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{s||(s=[],r=[]),s.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!n.length){let o=s&&PZ(s);if(o)return qt&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw qt&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,n);if(o)return qt&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,h=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(s);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?r.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!c||(f.prop(ge.contextHash)||0)==h))return e.useNode(f,u),qt&&console.log(o+this.stackID(e)+` (via reuse of ${r.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=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),qt&&console.log(o+this.stackID(e)+` (via always-reduce ${r.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;cs?t.push(p):n.push(p)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return OO(e,t),!0}}runRecovery(e,t,n){let s=null,r=!1;for(let o=0;o ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),qt&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let f=l.split(),u=h;for(let d=0;f.forceReduce()&&d<10&&(qt&&console.log(u+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,n));d++)qt&&(u=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))qt&&console.log(h+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),qt&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),OO(l,n)):(!s||s.scorei;class $Z{constructor(e){this.start=e.start,this.shift=e.shift||Wh,this.reduce=e.reduce||Wh,this.reuse=e.reuse||Wh,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class cc extends IS{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),s=[];for(let l=0;l=0)r(h,a,l[c++]);else{let f=l[c+-h];for(let u=-h;u>0;u--)r(l[c++],a,f);c++}}}this.nodeSet=new _d(t.map((l,a)=>Xt.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:s[a],top:n.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=ZS;let o=to(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new tr(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,t,n){let s=new _Z(this,e,t,n);for(let r of this.wrappers)s=r(s,e,t,n);return s}getGoto(e,t,n=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],l=o&1,a=s[r++];if(l&&n)return a;for(let c=r+(o>>1);r0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),s=n?t(n):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=en(this.data,r+2);else break;s=t(en(this.data,r+1))}return s}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=en(this.data,n+2);else break;if(!(this.data[n+2]&1)){let s=this.data[n+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[n],s)}}return t}configure(e){let t=Object.assign(Object.create(cc.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let s=e.tokenizers.find(r=>r.from==n);return s?s.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,s)=>{let r=e.specializers.find(l=>l.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[s]=bO(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(n[o]=!0)}let s=null;for(let r=0;rn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}const QZ=314,EZ=315,yO=1,CZ=2,AZ=3,TZ=4,RZ=316,MZ=318,ZZ=319,DZ=5,LZ=6,NZ=0,Pu=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],d1=125,IZ=59,Qu=47,jZ=42,XZ=43,VZ=45,BZ=60,WZ=44,qZ=63,UZ=46,zZ=91,YZ=new $Z({start:!1,shift(i,e){return e==DZ||e==LZ||e==MZ?i:e==ZZ},strict:!1}),FZ=new ul((i,e)=>{let{next:t}=i;(t==d1||t==-1||e.context)&&i.acceptToken(RZ)},{contextual:!0,fallback:!0}),HZ=new ul((i,e)=>{let{next:t}=i,n;Pu.indexOf(t)>-1||t==Qu&&((n=i.peek(1))==Qu||n==jZ)||t!=d1&&t!=IZ&&t!=-1&&!e.context&&i.acceptToken(QZ)},{contextual:!0}),GZ=new ul((i,e)=>{i.next==zZ&&!e.context&&i.acceptToken(EZ)},{contextual:!0}),KZ=new ul((i,e)=>{let{next:t}=i;if(t==XZ||t==VZ){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(yO);i.acceptToken(n?yO:CZ)}}else t==qZ&&i.peek(1)==UZ&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(AZ))},{contextual:!0});function qh(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const JZ=new ul((i,e)=>{if(i.next!=BZ||!e.dialectEnabled(NZ)||(i.advance(),i.next==Qu))return;let t=0;for(;Pu.indexOf(i.next)>-1;)i.advance(),t++;if(qh(i.next,!0)){for(i.advance(),t++;qh(i.next,!1);)i.advance(),t++;for(;Pu.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==WZ)return;for(let n=0;;n++){if(n==7){if(!qh(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(TZ,-t)}),e2=jS({"get set async static":w.modifier,"for while do if else switch try catch finally return throw break continue default case":w.controlKeyword,"in of await yield void typeof delete instanceof":w.operatorKeyword,"let var const using function class extends":w.definitionKeyword,"import export from":w.moduleKeyword,"with debugger as new":w.keyword,TemplateString:w.special(w.string),super:w.atom,BooleanLiteral:w.bool,this:w.self,null:w.null,Star:w.modifier,VariableName:w.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":w.function(w.variableName),VariableDefinition:w.definition(w.variableName),Label:w.labelName,PropertyName:w.propertyName,PrivatePropertyName:w.special(w.propertyName),"CallExpression/MemberExpression/PropertyName":w.function(w.propertyName),"FunctionDeclaration/VariableDefinition":w.function(w.definition(w.variableName)),"ClassDeclaration/VariableDefinition":w.definition(w.className),"NewExpression/VariableName":w.className,PropertyDefinition:w.definition(w.propertyName),PrivatePropertyDefinition:w.definition(w.special(w.propertyName)),UpdateOp:w.updateOperator,"LineComment Hashbang":w.lineComment,BlockComment:w.blockComment,Number:w.number,String:w.string,Escape:w.escape,ArithOp:w.arithmeticOperator,LogicOp:w.logicOperator,BitOp:w.bitwiseOperator,CompareOp:w.compareOperator,RegExp:w.regexp,Equals:w.definitionOperator,Arrow:w.function(w.punctuation),": Spread":w.punctuation,"( )":w.paren,"[ ]":w.squareBracket,"{ }":w.brace,"InterpolationStart InterpolationEnd":w.special(w.brace),".":w.derefOperator,", ;":w.separator,"@":w.meta,TypeName:w.typeName,TypeDefinition:w.definition(w.typeName),"type enum interface implements namespace module declare":w.definitionKeyword,"abstract global Privacy readonly override":w.modifier,"is keyof unique infer asserts":w.operatorKeyword,JSXAttributeValue:w.attributeValue,JSXText:w.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":w.angleBracket,"JSXIdentifier JSXNameSpacedName":w.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":w.attributeName,"JSXBuiltin/JSXIdentifier":w.standard(w.tagName)}),t2={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,const:52,extends:56,this:60,true:68,false:68,null:80,void:84,typeof:88,super:104,new:138,delete:150,yield:159,await:163,class:168,public:231,private:231,protected:231,readonly:233,instanceof:252,satisfies:255,in:256,import:290,keyof:347,unique:351,infer:357,asserts:393,is:395,abstract:415,implements:417,type:419,let:422,var:424,using:427,interface:433,enum:437,namespace:443,module:445,declare:449,global:453,for:472,of:481,while:484,with:488,do:492,if:496,else:498,switch:502,case:508,try:514,catch:518,finally:522,return:526,throw:530,break:534,continue:538,debugger:542},i2={__proto__:null,async:125,get:127,set:129,declare:191,public:193,private:193,protected:193,static:195,abstract:197,override:199,readonly:205,accessor:207,new:399},n2={__proto__:null,"<":189},s2=cc.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D_O.QQlO'#DeO.bQlO'#DpO%[QlO'#DxO0fQlO'#EQOOQ!0Lf'#EY'#EYO1PQ`O'#EVOOQO'#En'#EnOOQO'#Ij'#IjO1XQ`O'#GrO1dQ`O'#EmO1iQ`O'#EmO3hQ!0MxO'#JpO6[Q!0MxO'#JqO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#F{O9UQ`O'#FzOOQ!0Lf'#Jq'#JqOOQ!0Lb'#Jp'#JpO9ZQ`O'#GvOOQ['#K]'#K]O9fQ`O'#IWO9kQ!0LrO'#IXOOQ['#J^'#J^OOQ['#I]'#I]Q`QlOOQ`QlOOO9sQ!L^O'#DtO9zQlO'#D|O:RQlO'#EOO9aQ`O'#GrO:YQMhO'#CoO:hQ`O'#ElO:sQ`O'#EwO:xQMhO'#FdO;gQ`O'#GrOOQO'#K^'#K^O;lQ`O'#K^O;zQ`O'#GzO;zQ`O'#G{O;zQ`O'#G}O9aQ`O'#HQOYQ`O'#CeO>jQ`O'#HaO>rQ`O'#HgO>rQ`O'#HiO`QlO'#HkO>rQ`O'#HmO>rQ`O'#HpO>wQ`O'#HvO>|Q!0LsO'#H|O%[QlO'#IOO?XQ!0LsO'#IQO?dQ!0LsO'#ISO9kQ!0LrO'#IUO?oQ!0MxO'#CiO@qQpO'#DjQOQ`OOO%[QlO'#EOOAXQ`O'#ERO:YQMhO'#ElOAdQ`O'#ElOAoQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Do'#DoOOQ!0Lb'#Jt'#JtO%[QlO'#JtOOQO'#Jw'#JwOOQO'#If'#IfOBoQpO'#EeOOQ!0Lb'#Ed'#EdOOQ!0Lb'#J{'#J{OCkQ!0MSO'#EeOCuQpO'#EUOOQO'#Jv'#JvODZQpO'#JwOEhQpO'#EUOCuQpO'#EePEuO&2DjO'#CbPOOO)CD{)CD{OOOO'#I^'#I^OFQO#tO,59UOOQ!0Lh,59U,59UOOOO'#I_'#I_OF`O&jO,59UOFnQ!L^O'#DaOOOO'#Ia'#IaOFuO#@ItO,59yOOQ!0Lf,59y,59yOGTQlO'#IbOGhQ`O'#JrOIgQ!fO'#JrO+}QlO'#JrOInQ`O,5:POJUQ`O'#EnOJcQ`O'#KROJnQ`O'#KQOJnQ`O'#KQOJvQ`O,5;[OJ{Q`O'#KPOOQ!0Ln,5:[,5:[OKSQlO,5:[OMQQ!0MxO,5:dOMqQ`O,5:lON[Q!0LrO'#KOONcQ`O'#J}O9ZQ`O'#J}ONwQ`O'#J}O! PQ`O,5;ZO! UQ`O'#J}O!#ZQ!fO'#JqOOQ!0Lh'#Ci'#CiO%[QlO'#EQO!#yQ!fO,5:qOOQS'#Jx'#JxOOQO-ErOOQ['#Jf'#JfOOQ[,5>s,5>sOOQ[-EbQ!0MxO,5:hO%[QlO,5:hO!@xQ!0MxO,5:jOOQO,5@x,5@xO!AiQMhO,5=^O!AwQ!0LrO'#JgO9UQ`O'#JgO!BYQ!0LrO,59ZO!BeQpO,59ZO!BmQMhO,59ZO:YQMhO,59ZO!BxQ`O,5;XO!CQQ`O'#H`O!CfQ`O'#KbO%[QlO,5;|O!9lQpO,5wQ`O'#HVO9aQ`O'#HXO!D}Q`O'#HXO:YQMhO'#HZO!ESQ`O'#HZOOQ[,5=o,5=oO!EXQ`O'#H[O!EjQ`O'#CoO!EoQ`O,59PO!EyQ`O,59PO!HOQlO,59POOQ[,59P,59PO!H`Q!0LrO,59PO%[QlO,59PO!JkQlO'#HcOOQ['#Hd'#HdOOQ['#He'#HeO`QlO,5={O!KRQ`O,5={O`QlO,5>RO`QlO,5>TO!KWQ`O,5>VO`QlO,5>XO!K]Q`O,5>[O!KbQlO,5>bOOQ[,5>h,5>hO%[QlO,5>hO9kQ!0LrO,5>jOOQ[,5>l,5>lO# lQ`O,5>lOOQ[,5>n,5>nO# lQ`O,5>nOOQ[,5>p,5>pO#!YQpO'#D]O%[QlO'#JtO#!{QpO'#JtO##VQpO'#DkO##hQpO'#DkO#%yQlO'#DkO#&QQ`O'#JsO#&YQ`O,5:UO#&_Q`O'#ErO#&mQ`O'#KSO#&uQ`O,5;]O#&zQpO'#DkO#'XQpO'#ETOOQ!0Lf,5:m,5:mO%[QlO,5:mO#'`Q`O,5:mO>wQ`O,5;WO!BeQpO,5;WO!BmQMhO,5;WO:YQMhO,5;WO#'hQ`O,5@`O#'mQ07dO,5:qOOQO-E|O+}QlO,5>|OOQO,5?S,5?SO#*uQlO'#IbOOQO-E<`-E<`O#+SQ`O,5@^O#+[Q!fO,5@^O#+cQ`O,5@lOOQ!0Lf1G/k1G/kO%[QlO,5@mO#+kQ`O'#IhOOQO-ErQ`O1G3qO$4rQlO1G3sO$8vQlO'#HrOOQ[1G3v1G3vO$9TQ`O'#HxO>wQ`O'#HzOOQ[1G3|1G3|O$9]QlO1G3|O9kQ!0LrO1G4SOOQ[1G4U1G4UOOQ!0Lb'#G^'#G^O9kQ!0LrO1G4WO9kQ!0LrO1G4YO$=dQ`O,5@`O!(yQlO,5;^O9ZQ`O,5;^O>wQ`O,5:VO!(yQlO,5:VO!BeQpO,5:VO$=iQ?MtO,5:VOOQO,5;^,5;^O$=sQpO'#IcO$>ZQ`O,5@_OOQ!0Lf1G/p1G/pO$>cQpO'#IiO$>mQ`O,5@nOOQ!0Lb1G0w1G0wO##hQpO,5:VOOQO'#Ie'#IeO$>uQpO,5:oOOQ!0Ln,5:o,5:oO#'cQ`O1G0XOOQ!0Lf1G0X1G0XO%[QlO1G0XOOQ!0Lf1G0r1G0rO>wQ`O1G0rO!BeQpO1G0rO!BmQMhO1G0rOOQ!0Lb1G5z1G5zO!BYQ!0LrO1G0[OOQO1G0k1G0kO%[QlO1G0kO$>|Q!0LrO1G0kO$?XQ!0LrO1G0kO!BeQpO1G0[OCuQpO1G0[O$?gQ!0LrO1G0kOOQO1G0[1G0[O$?{Q!0MxO1G0kPOOO-E|O$@iQ`O1G5xO$@qQ`O1G6WO$@yQ!fO1G6XO9ZQ`O,5?SO$ATQ!0MxO1G6UO%[QlO1G6UO$AeQ!0LrO1G6UO$AvQ`O1G6TO$AvQ`O1G6TO9ZQ`O1G6TO$BOQ`O,5?VO9ZQ`O,5?VOOQO,5?V,5?VO$BdQ`O,5?VO$)iQ`O,5?VOOQO-E^OOQ[,5>^,5>^O%[QlO'#HsO%=zQ`O'#HuOOQ[,5>d,5>dO9ZQ`O,5>dOOQ[,5>f,5>fOOQ[7+)h7+)hOOQ[7+)n7+)nOOQ[7+)r7+)rOOQ[7+)t7+)tO%>PQpO1G5zO%>kQ?MtO1G0xO%>uQ`O1G0xOOQO1G/q1G/qO%?QQ?MtO1G/qO>wQ`O1G/qO!(yQlO'#DkOOQO,5>},5>}OOQO-EwQ`O7+&^O!BeQpO7+&^OOQO7+%v7+%vO$?{Q!0MxO7+&VOOQO7+&V7+&VO%[QlO7+&VO%?[Q!0LrO7+&VO!BYQ!0LrO7+%vO!BeQpO7+%vO%?gQ!0LrO7+&VO%?uQ!0MxO7++pO%[QlO7++pO%@VQ`O7++oO%@VQ`O7++oOOQO1G4q1G4qO9ZQ`O1G4qO%@_Q`O1G4qOOQS7+%{7+%{O#'cQ`O<_OOQ[,5>a,5>aO&=aQ`O1G4OO9ZQ`O7+&dO!(yQlO7+&dOOQO7+%]7+%]O&=fQ?MtO1G6XO>wQ`O7+%]OOQ!0Lf<wQ`O<]Q`O<= ZOOQO7+*]7+*]O9ZQ`O7+*]OOQ[ANAjANAjO&>eQ!fOANAjO!&iQMhOANAjO#'cQ`OANAjO4UQ!fOANAjO&>lQ`OANAjO%[QlOANAjO&>tQ!0MzO7+'yO&AVQ!0MzO,5?_O&CbQ!0MzO,5?aO&EmQ!0MzO7+'{O&HOQ!fO1G4jO&HYQ?MtO7+&_O&J^Q?MvO,5=WO&LeQ?MvO,5=YO&LuQ?MvO,5=WO&MVQ?MvO,5=YO&MgQ?MvO,59sO' mQ?MvO,5wQ`O7+)jO'-]Q`O<|AN>|O%[QlOAN?]OOQO<PPPP!>XHwPPPPPPPPPP!AhP!BuPPHw!DWPHwPHwHwHwHwHwPHw!EjP!HtP!KzP!LO!LY!L^!L^P!HqP!Lb!LbP# hP# lHwPHw# r#$wCV@yP@yP@y@yP#&U@y@y#(h@y#+`@y#-l@y@y#.[#0p#0p#0u#1O#0p#1ZPP#0pP@y#1s@y#5r@y@y6aPPP#9wPPP#:b#:bP#:bP#:x#:bPP#;OP#:uP#:u#;c#:u#;}#R#>X#>c#>i#>s#>y#?Z#?a#@R#@e#@k#@q#AP#Af#CZ#Ci#Cp#E[#Ej#G[#Gj#Gp#Gv#G|#HW#H^#Hd#Hn#IQ#IWPPPPPPPPPPP#I^PPPPPPP#JR#MY#Nr#Ny$ RPPP$&mP$&v$)o$0Y$0]$0`$1_$1b$1i$1qP$1w$1zP$2h$2l$3d$4r$4w$5_PP$5d$5j$5n$5q$5u$5y$6u$7^$7u$7y$7|$8P$8V$8Y$8^$8bR!|RoqOXst!Z#d%l&p&r&s&u,n,s2S2VY!vQ'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R < TypeParamList const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:378,context:YZ,nodeProps:[["isolate",-8,5,6,14,35,37,49,51,53,""],["group",-26,9,17,19,66,206,210,214,215,217,220,223,233,235,241,243,245,247,250,256,262,264,266,268,270,272,273,"Statement",-34,13,14,30,33,34,40,49,52,53,55,60,68,70,74,78,80,82,83,108,109,118,119,135,138,140,141,142,143,144,146,147,166,168,170,"Expression",-23,29,31,35,39,41,43,172,174,176,177,179,180,181,183,184,185,187,188,189,200,202,204,205,"Type",-3,86,101,107,"ClassItem"],["openedBy",23,"<",36,"InterpolationStart",54,"[",58,"{",71,"(",159,"JSXStartCloseTag"],["closedBy",-2,24,167,">",38,"InterpolationEnd",48,"]",59,"}",72,")",164,"JSXEndTag"]],propSources:[e2],skippedNodes:[0,5,6,276],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(UpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(UpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Up(X!b'z0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(V#S$h&j'{0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Up(X!b'{0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!n),Q(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(T':f$h&j(X!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(X!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(X!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Up(X!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(X!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(UpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(UpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Up(X!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!V7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!V7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!V7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(X!b!V7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(X!b!V7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(X!b!V7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(X!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(X!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!e$b$h&j#})Lv(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#P-v$?V_![(CdtBr$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!o7`$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Up(X!b'z0/l$[#t(R,2j(c$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$h&j(Up(X!b'{0/l$[#t(R,2j(c$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[HZ,GZ,KZ,JZ,2,3,4,5,6,7,8,9,10,11,12,13,14,FZ,new $u("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOv~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!S~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(a~~",141,338),new $u("j~RQYZXz{^~^O(O~~aP!P!Qd~iO(P~~",25,321)],topRules:{Script:[0,7],SingleExpression:[1,274],SingleClassItem:[2,275]},dialects:{jsx:0,ts:15091},dynamicPrecedences:{78:1,80:1,92:1,168:1,198:1},specialized:[{term:325,get:i=>t2[i]||-1},{term:341,get:i=>i2[i]||-1},{term:93,get:i=>n2[i]||-1}],tokenPrec:15116}),p1=[Tt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Tt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Tt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Tt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Tt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Tt(`try { \${} } catch (\${error}) { \${} }`,{label:"try",detail:"/ catch block",type:"keyword"}),Tt("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Tt(`if (\${}) { \${} } else { \${} }`,{label:"if",detail:"/ else block",type:"keyword"}),Tt(`class \${name} { constructor(\${params}) { \${} } }`,{label:"class",detail:"definition",type:"keyword"}),Tt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Tt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],r2=p1.concat([Tt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Tt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Tt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),SO=new dA,m1=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ur(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}const o2=["FunctionDeclaration"],l2={FunctionDeclaration:Ur("function"),ClassDeclaration:Ur("class"),ClassExpression:()=>!0,EnumDeclaration:Ur("constant"),TypeAliasDeclaration:Ur("type"),NamespaceDeclaration:Ur("namespace"),VariableDefinition(i,e){i.matchContext(o2)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function g1(i,e){let t=SO.get(e);if(t)return t;let n=[],s=!0;function r(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(st.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let l=l2[o.name];if(l&&l(o,r)||m1.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of g1(i,o.node))n.push(l);return!1}}),SO.set(e,n),n}const wO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,O1=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function a2(i){let e=rt(i.state).resolveInner(i.pos,-1);if(O1.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&wO.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let s=e;s;s=s.parent)m1.has(s.name)&&(n=n.concat(g1(i.state.doc,s)));return{options:n,from:t?e.from:i.pos,validFor:wO}}const ds=za.define({name:"javascript",parser:s2.configure({props:[qS.add({IfStatement:Mh({except:/^\s*({|else\b)/}),TryStatement:Mh({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:MA,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:RA({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":Mh({except:/^{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),YS.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":NA,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),b1={test:i=>/^JSX/.test(i.name),facet:BS({commentTokens:{block:{open:"{/*",close:"*/}"}}})},c2=ds.configure({dialect:"ts"},"typescript"),h2=ds.configure({dialect:"jsx",props:[Qd.add(i=>i.isTop?[b1]:void 0)]}),f2=ds.configure({dialect:"jsx ts",props:[Qd.add(i=>i.isTop?[b1]:void 0)]},"typescript");let y1=i=>({label:i,type:"keyword"});const S1="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(y1),u2=S1.concat(["declare","implements","private","protected","public"].map(y1));function d2(i={}){let e=i.jsx?i.typescript?f2:h2:i.typescript?c2:ds,t=i.typescript?r2.concat(u2):p1.concat(S1);return new kA(e,[ds.data.of({autocomplete:eM(O1,Hw(t))}),ds.data.of({autocomplete:a2}),i.jsx?g2:[]])}function p2(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function xO(i,e,t=i.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}const m2=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),g2=U.inputHandler.of((i,e,t,n,s)=>{if((m2?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!ds.isActiveAt(i.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(a=>{var c;let{head:h}=a,f=rt(o).resolveInner(h-1,-1),u;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.doc.sliceString(h-1,h)!=n||f.name=="JSXAttributeValue"&&f.to>h)){if(n==">"&&f.name=="JSXFragmentTag")return{range:a,changes:{from:h,insert:""}};if(n=="/"&&f.name=="JSXStartCloseTag"){let d=f.parent,p=d.parent;if(p&&d.from==h-2&&((u=xO(o.doc,p.firstChild,h))||((c=p.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let m=`${u}>`;return{range:A.cursor(h+m.length,-1),changes:{from:h,insert:m}}}}else if(n==">"){let d=p2(f);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(h,h+2))&&(u=xO(o.doc,d,h)))return{range:a,changes:{from:h,insert:``}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),O2="#e5c07b",vO="#e06c75",b2="#56b6c2",y2="#ffffff",ya="#abb2bf",Eu="#7d8799",S2="#61afef",w2="#98c379",_O="#d19a66",x2="#c678dd",v2="#21252b",kO="#2c313a",$O="#282c34",Uh="#353a42",_2="#3E4451",PO="#528bff",k2=U.theme({"&":{color:ya,backgroundColor:$O},".cm-content":{caretColor:PO},".cm-cursor, .cm-dropCursor":{borderLeftColor:PO},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:_2},".cm-panels":{backgroundColor:v2,color:ya},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:$O,color:Eu,border:"none"},".cm-activeLineGutter":{backgroundColor:kO},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Uh},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Uh,borderBottomColor:Uh},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:kO,color:ya}}},{dark:!0}),$2=al.define([{tag:w.keyword,color:x2},{tag:[w.name,w.deleted,w.character,w.propertyName,w.macroName],color:vO},{tag:[w.function(w.variableName),w.labelName],color:S2},{tag:[w.color,w.constant(w.name),w.standard(w.name)],color:_O},{tag:[w.definition(w.name),w.separator],color:ya},{tag:[w.typeName,w.className,w.number,w.changed,w.annotation,w.modifier,w.self,w.namespace],color:O2},{tag:[w.operator,w.operatorKeyword,w.url,w.escape,w.regexp,w.link,w.special(w.string)],color:b2},{tag:[w.meta,w.comment],color:Eu},{tag:w.strong,fontWeight:"bold"},{tag:w.emphasis,fontStyle:"italic"},{tag:w.strikethrough,textDecoration:"line-through"},{tag:w.link,color:Eu,textDecoration:"underline"},{tag:w.heading,fontWeight:"bold",color:vO},{tag:[w.atom,w.bool,w.special(w.variableName)],color:_O},{tag:[w.processingInstruction,w.string,w.inserted],color:w2},{tag:w.invalid,color:y2}]),P2=[k2,nw($2)],Q2=it({__name:"code-editor",props:{solution:{}},setup(i){const e=i,t=Te(e.solution),n=[d2(),P2],s=ro(),r=o=>{s.value=o.view};return ht(()=>e.solution,o=>{t.value=o}),(o,l)=>(oe(),nr(Xi(bZ),{modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),placeholder:"Code goes here...",style:{height:"600px"},autofocus:!0,"indent-with-tab":!0,"tab-size":2,extensions:n,onReady:r},null,8,["modelValue"]))}}),E2={class:"mt-2"},C2=it({__name:"task-info",props:{task:{}},setup(i){return(e,t)=>{var n,s;return oe(),de("div",E2,[t[0]||(t[0]=E("h3",{class:"h5"},"Описание:",-1)),(oe(!0),de(ze,null,_r((n=e.task)==null?void 0:n.description.split(` `),(r,o)=>(oe(),de("p",{key:o},Le(r),1))),128)),t[1]||(t[1]=E("h3",{class:"h5"},"Примеры входных данных и ожидаемый результат:",-1)),E("p",null,Le((s=e.task)==null?void 0:s.examples),1)])}}}),A2={key:1},QO=it({__name:"ui-spinner",props:{isLoading:{type:Boolean},spinnerClass:{},classNames:{}},setup(i){var n;const t=Te("d-flex justify-content-start"+((n=i.classNames||[""])==null?void 0:n.join(" ")));return(s,r)=>(oe(),de("div",{class:rn(t.value)},[s.isLoading?(oe(),de("div",{key:0,class:rn(["spinner-border",s.spinnerClass||"text-primary"]),role:"status"},r[0]||(r[0]=[E("span",{class:"visually-hidden"},"Loading...",-1)]),2)):(oe(),de("div",A2,[Qv(s.$slots,"default")]))],2))}});class EO{static async getTaskComments(e){const t=Number(e);if(isNaN(t))throw new Error("Ошибка при получении комментариев: некорректный id");try{const{data:n}=await ii.get(`/api/comments/${t}`);return n.map(s=>({...s,created_at:new Date(s.created_at)}))}catch{throw new Error("Ошибка при получении комментариев")}}static async addComment(e,t){try{const{data:n}=await ii.post("/api/comments/",{task_id:e,content:t});return{...n,created_at:new Date(n.created_at)}}catch{throw new Error}}}const T2=["width","height"],Ud=it({__name:"user-icon",props:{size:{},className:{}},setup(i){return(e,t)=>(oe(),de("div",{class:rn(e.className)},[(oe(),de("svg",{xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size,fill:"currentColor",class:"bi bi-person-circle",viewBox:"0 0 16 16"},t[0]||(t[0]=[E("path",{d:"M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0"},null,-1),E("path",{"fill-rule":"evenodd",d:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8m8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1"},null,-1)]),8,T2))],2))}}),R2={class:"card-body p-4"},M2={class:"d-flex flex-start"},Z2={class:"fw-bold mb-1"},D2={class:"d-flex align-items-center mb-3"},L2={class:"mb-0"},N2={class:"mb-0"},I2=it({__name:"comments-item",props:{username:{},date:{},content:{}},setup(i){const e=i,t=Te("");return ks(()=>{t.value=typeof e.date=="string"?e.date:e.date.toLocaleDateString("ru-RU",{month:"short",day:"numeric",year:"numeric"})}),(n,s)=>(oe(),de("div",R2,[E("div",M2,[ke(Ud,{className:"rounded-circle shadow-1-strong me-3",size:60}),E("div",null,[E("h6",Z2,Le(n.username),1),E("div",D2,[E("p",L2,Le(t.value),1),s[0]||(s[0]=l_('',3))]),E("p",N2,Le(n.content),1)])])]))}}),j2={class:"card-footer py-3 border-0"},X2={class:"d-flex flex-start w-100"},V2={"data-mdb-input-init":"",class:"form-outline w-100"},B2={class:"float-end mt-2 pt-1"},W2=["disabled"],q2=it({__name:"add-comment-form",props:{submitHandler:{type:Function},isSubmitting:{type:Boolean}},setup(i){const e=i,t=Te(""),n=()=>{e.submitHandler(t.value),t.value=""};return(s,r)=>(oe(),de("div",j2,[E("div",X2,[ke(Ud,{className:"rounded-circle shadow-1-strong me-3",size:40}),E("div",V2,[$n(E("textarea",{class:"form-control",id:"textAreaExample",rows:"4",placeholder:"Добавьте ваш комментарий","onUpdate:modelValue":r[0]||(r[0]=o=>t.value=o),style:{background:"#fff"}},null,512),[[$o,t.value]])])]),E("div",B2,[E("button",{type:"button",class:"btn btn-primary btn-sm",disabled:s.isSubmitting,onClick:n},Le(s.isSubmitting?"Отправка...":"Отправить"),9,W2)])]))}}),U2={class:"container my-3 py-2"},z2={class:"row d-flex justify-content-center"},Y2={class:"col-md-12 col-lg-10"},F2={class:"card text-body"},H2={class:"card-body p-4"},G2=it({__name:"task-comments",props:{taskId:{}},setup(i){const e=i,t=Te([]),n=Te(!1),s=async r=>{if(!r.trim()){console.warn("Комментарий не может быть пустым");return}n.value=!0;try{const o=await EO.addComment(e.taskId,r);t.value=[...t.value,o]}catch(o){console.error("Ошибка при отправке комментария:",o)}finally{n.value=!1}};return ks(async()=>{try{t.value=await EO.getTaskComments(e.taskId)}catch(r){console.error(r)}}),(r,o)=>(oe(),de("section",null,[E("div",U2,[E("div",z2,[E("div",Y2,[E("div",F2,[E("div",H2,[o[0]||(o[0]=E("h4",{class:"mb-0"},"Комментарии",-1)),o[1]||(o[1]=E("p",{class:"fw-light mb-4 pb-2"},"Добавьте свои комментарии к задаче",-1)),(oe(!0),de(ze,null,_r(t.value,l=>(oe(),nr(I2,{key:l.id,username:l.username,date:l.created_at,content:l.content},null,8,["username","date","content"]))),128))]),ke(q2,{submitHandler:s,isSubmitting:n.value},null,8,["isSubmitting"])])])])])]))}});class Ul{static async login(e,t){try{const n=await ii.post("api/auth/login",{username:e,password:t});return localStorage.setItem("token",n.data.accessToken),n.data}catch{throw new Error("Неверное имя пользователя или пароль")}}static async register(e,t,n){return(await ii.post("/api/auth/register",{username:e,password:t,role:n})).status===200}static async logout(){localStorage.removeItem("token");try{await ii.get("api/auth/logout")}catch{throw new Error("Failed to register new user")}}static async updateSession(){try{const e=localStorage.getItem("token");if(!e)return;try{const t=await ii.post("/api/auth/refresh",{accessToken:e});if(t.status===200)return localStorage.setItem("token",t.data.accessToken),t.data}catch{localStorage.removeItem("token")}}catch{throw new Error("Failed to update session...")}}}const dl=K_("user",()=>{const i=Te(!1),e=Te({}),t=Te(!0),n=Te(!1);Ul.updateSession().then(l=>{l&&(i.value=!0,e.value=l)}).finally(()=>{t.value=!1,n.value=!0});async function s(l,a){const c=await Ul.login(l,a);if(c)return i.value=!0,e.value=c,!0;throw new Error("authorization failed")}async function r(){await Ul.logout(),i.value=!1,gr.push({path:"/auth",query:{redirect:location.pathname}})}async function o(l,a,c){if(await Ul.register(l,a,c))return i.value=!0,!0;throw new Error("registration failed")}return{isAuthenticated:i,isLoading:t,isInitialized:n,profile:e,login:s,register:o,logout:r}}),K2={key:0,class:"bg-red-100"},J2={class:"tab-content",id:"myTabContent"},eD={class:"tab-pane fade show active",id:"task",role:"tabpanel","aria-labelledby":"task-tab"},tD={class:"d-flex flex-row gap-4 p-2"},iD={class:"col-5"},nD={class:"col-7"},sD={class:"tab-pane fade",id:"discussion",role:"tabpanel","aria-labelledby":"discussion-tab"},rD={key:1,class:"d-flex flex-row gap-4 p-2"},oD=it({__name:"task-page",setup(i){const e=Go(),t=dl(),n=e.params.id,s=Te(null),r=Te(!0),o=Te(null),l=Te("");return ks(async()=>{var a;try{s.value=await Za.getTask(Number(n))}catch{o.value="Ошибка при загрузке задачи id: "+n,console.error(o.value)}finally{r.value=!1,document.title=(a=s.value)!=null&&a.title?"BleedCode - "+s.value.title:"BleedCode"}try{const c=await Za.getTaskSolution(Number(n),t.profile.id);l.value=c.source_code}catch{console.error("Ошибка при получении решения задачи id: "+n)}}),(a,c)=>s.value?(oe(),de("main",K2,[ke(QO,{isLoading:r.value},{default:ir(()=>{var h;return[E("h2",null,Le(((h=s.value)==null?void 0:h.title)||""),1)]}),_:1},8,["isLoading"]),c[1]||(c[1]=E("ul",{class:"nav nav-tabs",id:"myTab",role:"tablist"},[E("li",{class:"nav-item",role:"presentation"},[E("button",{class:"nav-link active",id:"task-tab","data-bs-toggle":"tab","data-bs-target":"#task",type:"button",role:"tab","aria-controls":"task","aria-selected":"true"}," Задача ")]),E("li",{class:"nav-item",role:"presentation"},[E("button",{class:"nav-link",id:"discussion-tab","data-bs-toggle":"tab","data-bs-target":"#discussion",type:"button",role:"tab","aria-controls":"discussion","aria-selected":"false"}," Обсуждение ")])],-1)),E("div",J2,[E("div",eD,[E("div",tD,[E("div",iD,[ke(QO,{isLoading:r.value},{default:ir(()=>[ke(C2,{task:s.value},null,8,["task"])]),_:1},8,["isLoading"])]),E("div",nD,[ke(Q2,{solution:l.value,"onUpdate:solution":c[0]||(c[0]=h=>l.value=h)},null,8,["solution"])])])]),E("div",sD,[ke(G2,{taskId:s.value.id},null,8,["taskId"])])])])):(oe(),de("div",rD,[E("p",null,Le(o.value),1)]))}});class lD{static async getProfile(e){try{const{data:t}=await ii.get(`api/profiles/${e}`);return t}catch{throw new Error("Ошибка при получении профиля")}}}const aD={class:"mt-3 border-bottom-1"},cD={class:"mt-3 d-flex flex-wrap gap-5 justify-content-between"},hD={class:"col-auto d-flex justify-content-center align-items-center p-5 profile-header rounded shadow-sm"},fD={class:"col-9 mt-4"},uD={class:"row"},dD={class:"col-md-6"},pD={class:"list-unstyled"},mD={class:"mt-3"},gD={key:0,class:"table"},OD={scope:"row"},bD=it({__name:"user-profile",props:{id:{}},setup(i){const e=i,t=Te({username:"",role:"",status:"",rating:0,solutions:[]});return ks(async()=>{t.value=await lD.getProfile(e.id)}),(n,s)=>(oe(),de(ze,null,[E("h2",aD,Le(t.value.username),1),E("div",cD,[E("div",hD,[ke(Ud,{size:160})]),E("div",fD,[E("div",uD,[E("div",dD,[s[3]||(s[3]=E("h5",null,"Информация о пользователе",-1)),E("ul",pD,[E("li",null,[s[0]||(s[0]=E("strong",null,"Роль: ",-1)),on(Le(t.value.role),1)]),E("li",null,[s[1]||(s[1]=E("strong",null,"Статус: ",-1)),on(Le(t.value.status),1)]),E("li",null,[s[2]||(s[2]=E("strong",null,"Рейтинг: ",-1)),on(Le(t.value.rating),1)])])]),s[4]||(s[4]=E("div",{class:"d-flex gap-3 profile-actions mt-4 text-center"},[E("button",{class:"btn btn-primary"},"Редактировать")],-1))])])]),E("div",mD,[s[6]||(s[6]=E("h5",{class:"h3-ns"},"Решенные задачи",-1)),t.value.solutions.length>0?(oe(),de("table",gD,[s[5]||(s[5]=E("thead",null,[E("tr",null,[E("th",{scope:"col"},"#"),E("th",{scope:"col"},"Название"),E("th",{scope:"col"},"Оценка")])],-1)),E("tbody",null,[(oe(!0),de(ze,null,_r(t.value.solutions,(r,o)=>(oe(),de("tr",{key:r.id},[E("th",OD,Le(o+1),1),E("td",null,Le(r.title),1),E("td",null,Le(r.mark),1)]))),128))])])):rr("",!0)])],64))}}),yD=it({__name:"profile-page",setup(i){const e=dl(),t=Go(),n=Number(t.params.id),s=Te(isNaN(n)?e.profile.id:n);return(r,o)=>(oe(),nr(bD,{id:s.value},null,8,["id"]))}}),SD={class:"auth-page d-flex justify-content-center align-items-center"},wD={class:"auth-container position-absolute top-50 translate-middle-y border rounded shadow p-4 bg-light"},xD={class:"text-center mb-4"},vD={class:"error-message text-danger text-center mb-3"},_D={key:0},kD={class:"form-group mb-3"},$D={class:"form-group mb-4"},PD={key:0,class:"form-group mb-4"},QD={type:"submit",class:"btn btn-primary w-100"},ED={class:"text-center mt-3"},CD=it({__name:"auth-page",setup(i){const e=dl(),t=Go(),n=Te(!0),s=Te(""),r=Te({username:"",password:"",role:"user"});function o(){e.login(r.value.username,r.value.password).then(()=>{const h=t.query.redirect?String(t.query.redirect):"/";gr.replace(h)}).catch(h=>{s.value=h.message,console.error(h)})}function l(){e.register(r.value.username,r.value.password,r.value.role).then(()=>{const h=t.query.redirect?String(t.query.redirect):"/";gr.replace(h)}).catch(h=>{s.value=h.message,console.error(h)})}function a(){n.value=!n.value,n.value&&(r.value.role="user")}function c(){n.value?o():l()}return(h,f)=>(oe(),de("div",SD,[E("div",wD,[E("h1",xD,Le(n.value?"Вход":"Регистрация"),1),E("form",{onSubmit:ao(c,["prevent"])},[E("div",vD,[s.value?(oe(),de("span",_D,Le(s.value),1)):rr("",!0)]),E("div",kD,[f[3]||(f[3]=E("label",{for:"username",class:"form-label"},"Имя пользователя",-1)),$n(E("input",{id:"username","onUpdate:modelValue":f[0]||(f[0]=u=>r.value.username=u),type:"text",class:"form-control",placeholder:"Введите имя пользователя",required:""},null,512),[[$o,r.value.username]])]),E("div",$D,[f[4]||(f[4]=E("label",{for:"password",class:"form-label"},"Пароль",-1)),$n(E("input",{id:"password","onUpdate:modelValue":f[1]||(f[1]=u=>r.value.password=u),type:"password",class:"form-control",placeholder:"Введите пароль",required:""},null,512),[[$o,r.value.password]])]),n.value?rr("",!0):(oe(),de("div",PD,[f[6]||(f[6]=E("label",{class:"form-label",for:"role"},"Роль пользователя",-1)),$n(E("select",{class:"form-select",id:"role","onUpdate:modelValue":f[2]||(f[2]=u=>r.value.role=u),required:""},f[5]||(f[5]=[E("option",{value:"user"},"Пользователь",-1),E("option",{value:"interviewer"},"Интервьюер",-1)]),512),[[yf,r.value.role]])])),E("button",QD,Le(n.value?"Вход":"Регистрация"),1)],32),E("p",ED,[on(Le(n.value?"Ещё нет аккаунта?":"Уже есть аккаунт?")+" ",1),E("a",{href:"#",onClick:ao(a,["prevent"])},Le(n.value?"Регистрация":"Вход"),1)])])]))}}),AD=ld(CD,[["__scopeId","data-v-6e62f014"]]),TD={};function RD(i,e){return oe(),de("main",null,e[0]||(e[0]=[E("p",null,"404 - Not Found",-1)]))}const MD=ld(TD,[["render",RD]]),gr=Kk({history:Ek("/bleedcode-frontend/"),routes:[{path:"/",name:"Главная",component:lQ,meta:{title:"BleedCode"}},{path:"/auth",name:"Аутентификация",component:AD,meta:{title:"Аутентификация"}},{path:"/tasks/:id",name:"Задача",component:oD,meta:{title:"Задача",requiresAuth:!0}},{path:"/profiles/:id",name:"Профиль пользователя",component:yD,meta:{title:"Профиль пользователя",requiresAuth:!0}},{path:"/me",redirect:()=>({path:"/profiles/me"})},{path:"/:pathMatch(.*)*",name:"404",component:MD,meta:{title:"Не найдено"}}]});gr.beforeEach(async(i,e,t)=>{const n=dl();if(n.isInitialized||await new Promise(s=>{const r=ht(()=>n.isInitialized,o=>{o&&(r(),s())})}),i.meta.requiresAuth&&!n.isAuthenticated)return t({path:"/auth",query:{redirect:i.path}});t()});gr.beforeEach(i=>{document.title=i.meta.title||"BleedCode"});const ZD={class:"container-fluid bg-body-tertiary"},DD={class:"navbar navbar-expand-lg bg-body-tertiary"},LD={class:"container"},ND={class:"collapse navbar-collapse ms-5",id:"navbarSupportedContent"},ID={class:"navbar-nav mb-2 mb-lg-0 w-100"},jD={key:0,class:"nav-item"},XD={key:1,class:"nav-item ms-auto"},VD={key:2,class:"nav-item ms-auto"},BD=it({__name:"main-header",setup(i){const e=dl(),t=Go(),n=Nb(),s=dt(()=>e.isAuthenticated),r=()=>{n.push({path:"/auth",query:{redirect:t.fullPath}})};return(o,l)=>{const a=kv("RouterLink");return oe(),de("header",ZD,[E("nav",DD,[E("div",LD,[ke(a,{class:"navbar-brand",to:"/"},{default:ir(()=>l[2]||(l[2]=[on("BleedCode")])),_:1}),l[4]||(l[4]=E("button",{class:"navbar-toggler",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation"},[E("span",{class:"navbar-toggler-icon"})],-1)),E("div",ND,[E("ul",ID,[s.value?(oe(),de("li",jD,[ke(a,{class:"nav-link active","aria-current":"page",to:"/me"},{default:ir(()=>l[3]||(l[3]=[on("Мой профиль")])),_:1})])):rr("",!0),s.value?(oe(),de("li",XD,[E("button",{class:"btn btn-outline-primary",onClick:l[0]||(l[0]=c=>Xi(e).logout())},"Выйти")])):(oe(),de("li",VD,[E("button",{onClick:l[1]||(l[1]=c=>r()),class:"nav-link active","aria-current":"page",to:"/auth"},"Войти")]))])])])])])}}}),WD={class:"container"},qD=it({__name:"App",setup(i){return(e,t)=>(oe(),de(ze,null,[ke(BD),E("div",WD,[ke(Xi(Lb))])],64))}});var Et="top",Kt="bottom",Jt="right",Ct="left",Uc="auto",Ar=[Et,Kt,Jt,Ct],xs="start",Or="end",w1="clippingParents",zd="viewport",Ns="popper",x1="reference",Cu=Ar.reduce(function(i,e){return i.concat([e+"-"+xs,e+"-"+Or])},[]),Yd=[].concat(Ar,[Uc]).reduce(function(i,e){return i.concat([e,e+"-"+xs,e+"-"+Or])},[]),v1="beforeRead",_1="read",k1="afterRead",$1="beforeMain",P1="main",Q1="afterMain",E1="beforeWrite",C1="write",A1="afterWrite",T1=[v1,_1,k1,$1,P1,Q1,E1,C1,A1];function zi(i){return i?(i.nodeName||"").toLowerCase():null}function ei(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function vs(i){var e=ei(i).Element;return i instanceof e||i instanceof Element}function li(i){var e=ei(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Fd(i){if(typeof ShadowRoot>"u")return!1;var e=ei(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function UD(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},s=e.attributes[t]||{},r=e.elements[t];!li(r)||!zi(r)||(Object.assign(r.style,n),Object.keys(s).forEach(function(o){var l=s[o];l===!1?r.removeAttribute(o):r.setAttribute(o,l===!0?"":l)}))})}function zD(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var s=e.elements[n],r=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]),l=o.reduce(function(a,c){return a[c]="",a},{});!li(s)||!zi(s)||(Object.assign(s.style,l),Object.keys(r).forEach(function(a){s.removeAttribute(a)}))})}}const Hd={name:"applyStyles",enabled:!0,phase:"write",fn:UD,effect:zD,requires:["computeStyles"]};function Bi(i){return i.split("-")[0]}var ps=Math.max,hc=Math.min,br=Math.round;function Au(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function R1(){return!/^((?!chrome|android).)*safari/i.test(Au())}function yr(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var n=i.getBoundingClientRect(),s=1,r=1;e&&li(i)&&(s=i.offsetWidth>0&&br(n.width)/i.offsetWidth||1,r=i.offsetHeight>0&&br(n.height)/i.offsetHeight||1);var o=vs(i)?ei(i):window,l=o.visualViewport,a=!R1()&&t,c=(n.left+(a&&l?l.offsetLeft:0))/s,h=(n.top+(a&&l?l.offsetTop:0))/r,f=n.width/s,u=n.height/r;return{width:f,height:u,top:h,right:c+f,bottom:h+u,left:c,x:c,y:h}}function Gd(i){var e=yr(i),t=i.offsetWidth,n=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:n}}function M1(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Fd(t)){var n=e;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function dn(i){return ei(i).getComputedStyle(i)}function YD(i){return["table","td","th"].indexOf(zi(i))>=0}function Un(i){return((vs(i)?i.ownerDocument:i.document)||window.document).documentElement}function zc(i){return zi(i)==="html"?i:i.assignedSlot||i.parentNode||(Fd(i)?i.host:null)||Un(i)}function CO(i){return!li(i)||dn(i).position==="fixed"?null:i.offsetParent}function FD(i){var e=/firefox/i.test(Au()),t=/Trident/i.test(Au());if(t&&li(i)){var n=dn(i);if(n.position==="fixed")return null}var s=zc(i);for(Fd(s)&&(s=s.host);li(s)&&["html","body"].indexOf(zi(s))<0;){var r=dn(s);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||e&&r.willChange==="filter"||e&&r.filter&&r.filter!=="none")return s;s=s.parentNode}return null}function pl(i){for(var e=ei(i),t=CO(i);t&&YD(t)&&dn(t).position==="static";)t=CO(t);return t&&(zi(t)==="html"||zi(t)==="body"&&dn(t).position==="static")?e:t||FD(i)||e}function Kd(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function bo(i,e,t){return ps(i,hc(e,t))}function HD(i,e,t){var n=bo(i,e,t);return n>t?t:n}function Z1(){return{top:0,right:0,bottom:0,left:0}}function D1(i){return Object.assign({},Z1(),i)}function L1(i,e){return e.reduce(function(t,n){return t[n]=i,t},{})}var GD=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,D1(typeof e!="number"?e:L1(e,Ar))};function KD(i){var e,t=i.state,n=i.name,s=i.options,r=t.elements.arrow,o=t.modifiersData.popperOffsets,l=Bi(t.placement),a=Kd(l),c=[Ct,Jt].indexOf(l)>=0,h=c?"height":"width";if(!(!r||!o)){var f=GD(s.padding,t),u=Gd(r),d=a==="y"?Et:Ct,p=a==="y"?Kt:Jt,m=t.rects.reference[h]+t.rects.reference[a]-o[a]-t.rects.popper[h],g=o[a]-t.rects.reference[a],O=pl(r),S=O?a==="y"?O.clientHeight||0:O.clientWidth||0:0,_=m/2-g/2,x=f[d],v=S-u[h]-f[p],$=S/2-u[h]/2+_,P=bo(x,$,v),Z=a;t.modifiersData[n]=(e={},e[Z]=P,e.centerOffset=P-$,e)}}function JD(i){var e=i.state,t=i.options,n=t.element,s=n===void 0?"[data-popper-arrow]":n;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||M1(e.elements.popper,s)&&(e.elements.arrow=s))}const N1={name:"arrow",enabled:!0,phase:"main",fn:KD,effect:JD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(i){return i.split("-")[1]}var eL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tL(i,e){var t=i.x,n=i.y,s=e.devicePixelRatio||1;return{x:br(t*s)/s||0,y:br(n*s)/s||0}}function AO(i){var e,t=i.popper,n=i.popperRect,s=i.placement,r=i.variation,o=i.offsets,l=i.position,a=i.gpuAcceleration,c=i.adaptive,h=i.roundOffsets,f=i.isFixed,u=o.x,d=u===void 0?0:u,p=o.y,m=p===void 0?0:p,g=typeof h=="function"?h({x:d,y:m}):{x:d,y:m};d=g.x,m=g.y;var O=o.hasOwnProperty("x"),S=o.hasOwnProperty("y"),_=Ct,x=Et,v=window;if(c){var $=pl(t),P="clientHeight",Z="clientWidth";if($===ei(t)&&($=Un(t),dn($).position!=="static"&&l==="absolute"&&(P="scrollHeight",Z="scrollWidth")),$=$,s===Et||(s===Ct||s===Jt)&&r===Or){x=Kt;var N=f&&$===v&&v.visualViewport?v.visualViewport.height:$[P];m-=N-n.height,m*=a?1:-1}if(s===Ct||(s===Et||s===Kt)&&r===Or){_=Jt;var Y=f&&$===v&&v.visualViewport?v.visualViewport.width:$[Z];d-=Y-n.width,d*=a?1:-1}}var H=Object.assign({position:l},c&&eL),B=h===!0?tL({x:d,y:m},ei(t)):{x:d,y:m};if(d=B.x,m=B.y,a){var J;return Object.assign({},H,(J={},J[x]=S?"0":"",J[_]=O?"0":"",J.transform=(v.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",J))}return Object.assign({},H,(e={},e[x]=S?m+"px":"",e[_]=O?d+"px":"",e.transform="",e))}function iL(i){var e=i.state,t=i.options,n=t.gpuAcceleration,s=n===void 0?!0:n,r=t.adaptive,o=r===void 0?!0:r,l=t.roundOffsets,a=l===void 0?!0:l,c={placement:Bi(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,AO(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,AO(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Jd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:iL,data:{}};var zl={passive:!0};function nL(i){var e=i.state,t=i.instance,n=i.options,s=n.scroll,r=s===void 0?!0:s,o=n.resize,l=o===void 0?!0:o,a=ei(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach(function(h){h.addEventListener("scroll",t.update,zl)}),l&&a.addEventListener("resize",t.update,zl),function(){r&&c.forEach(function(h){h.removeEventListener("scroll",t.update,zl)}),l&&a.removeEventListener("resize",t.update,zl)}}const ep={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:nL,data:{}};var sL={left:"right",right:"left",bottom:"top",top:"bottom"};function Sa(i){return i.replace(/left|right|bottom|top/g,function(e){return sL[e]})}var rL={start:"end",end:"start"};function TO(i){return i.replace(/start|end/g,function(e){return rL[e]})}function tp(i){var e=ei(i),t=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:t,scrollTop:n}}function ip(i){return yr(Un(i)).left+tp(i).scrollLeft}function oL(i,e){var t=ei(i),n=Un(i),s=t.visualViewport,r=n.clientWidth,o=n.clientHeight,l=0,a=0;if(s){r=s.width,o=s.height;var c=R1();(c||!c&&e==="fixed")&&(l=s.offsetLeft,a=s.offsetTop)}return{width:r,height:o,x:l+ip(i),y:a}}function lL(i){var e,t=Un(i),n=tp(i),s=(e=i.ownerDocument)==null?void 0:e.body,r=ps(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ps(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),l=-n.scrollLeft+ip(i),a=-n.scrollTop;return dn(s||t).direction==="rtl"&&(l+=ps(t.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:l,y:a}}function np(i){var e=dn(i),t=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+n)}function I1(i){return["html","body","#document"].indexOf(zi(i))>=0?i.ownerDocument.body:li(i)&&np(i)?i:I1(zc(i))}function yo(i,e){var t;e===void 0&&(e=[]);var n=I1(i),s=n===((t=i.ownerDocument)==null?void 0:t.body),r=ei(n),o=s?[r].concat(r.visualViewport||[],np(n)?n:[]):n,l=e.concat(o);return s?l:l.concat(yo(zc(o)))}function Tu(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function aL(i,e){var t=yr(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function RO(i,e,t){return e===zd?Tu(oL(i,t)):vs(e)?aL(e,t):Tu(lL(Un(i)))}function cL(i){var e=yo(zc(i)),t=["absolute","fixed"].indexOf(dn(i).position)>=0,n=t&&li(i)?pl(i):i;return vs(n)?e.filter(function(s){return vs(s)&&M1(s,n)&&zi(s)!=="body"}):[]}function hL(i,e,t,n){var s=e==="clippingParents"?cL(i):[].concat(e),r=[].concat(s,[t]),o=r[0],l=r.reduce(function(a,c){var h=RO(i,c,n);return a.top=ps(h.top,a.top),a.right=hc(h.right,a.right),a.bottom=hc(h.bottom,a.bottom),a.left=ps(h.left,a.left),a},RO(i,o,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function j1(i){var e=i.reference,t=i.element,n=i.placement,s=n?Bi(n):null,r=n?Sr(n):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,a;switch(s){case Et:a={x:o,y:e.y-t.height};break;case Kt:a={x:o,y:e.y+e.height};break;case Jt:a={x:e.x+e.width,y:l};break;case Ct:a={x:e.x-t.width,y:l};break;default:a={x:e.x,y:e.y}}var c=s?Kd(s):null;if(c!=null){var h=c==="y"?"height":"width";switch(r){case xs:a[c]=a[c]-(e[h]/2-t[h]/2);break;case Or:a[c]=a[c]+(e[h]/2-t[h]/2);break}}return a}function wr(i,e){e===void 0&&(e={});var t=e,n=t.placement,s=n===void 0?i.placement:n,r=t.strategy,o=r===void 0?i.strategy:r,l=t.boundary,a=l===void 0?w1:l,c=t.rootBoundary,h=c===void 0?zd:c,f=t.elementContext,u=f===void 0?Ns:f,d=t.altBoundary,p=d===void 0?!1:d,m=t.padding,g=m===void 0?0:m,O=D1(typeof g!="number"?g:L1(g,Ar)),S=u===Ns?x1:Ns,_=i.rects.popper,x=i.elements[p?S:u],v=hL(vs(x)?x:x.contextElement||Un(i.elements.popper),a,h,o),$=yr(i.elements.reference),P=j1({reference:$,element:_,strategy:"absolute",placement:s}),Z=Tu(Object.assign({},_,P)),N=u===Ns?Z:$,Y={top:v.top-N.top+O.top,bottom:N.bottom-v.bottom+O.bottom,left:v.left-N.left+O.left,right:N.right-v.right+O.right},H=i.modifiersData.offset;if(u===Ns&&H){var B=H[s];Object.keys(Y).forEach(function(J){var ce=[Jt,Kt].indexOf(J)>=0?1:-1,ue=[Et,Kt].indexOf(J)>=0?"y":"x";Y[J]+=B[ue]*ce})}return Y}function fL(i,e){e===void 0&&(e={});var t=e,n=t.placement,s=t.boundary,r=t.rootBoundary,o=t.padding,l=t.flipVariations,a=t.allowedAutoPlacements,c=a===void 0?Yd:a,h=Sr(n),f=h?l?Cu:Cu.filter(function(p){return Sr(p)===h}):Ar,u=f.filter(function(p){return c.indexOf(p)>=0});u.length===0&&(u=f);var d=u.reduce(function(p,m){return p[m]=wr(i,{placement:m,boundary:s,rootBoundary:r,padding:o})[Bi(m)],p},{});return Object.keys(d).sort(function(p,m){return d[p]-d[m]})}function uL(i){if(Bi(i)===Uc)return[];var e=Sa(i);return[TO(i),e,TO(e)]}function dL(i){var e=i.state,t=i.options,n=i.name;if(!e.modifiersData[n]._skip){for(var s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,l=o===void 0?!0:o,a=t.fallbackPlacements,c=t.padding,h=t.boundary,f=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,p=d===void 0?!0:d,m=t.allowedAutoPlacements,g=e.options.placement,O=Bi(g),S=O===g,_=a||(S||!p?[Sa(g)]:uL(g)),x=[g].concat(_).reduce(function(qe,He){return qe.concat(Bi(He)===Uc?fL(e,{placement:He,boundary:h,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}):He)},[]),v=e.rects.reference,$=e.rects.popper,P=new Map,Z=!0,N=x[0],Y=0;Y=0,ue=ce?"width":"height",ne=wr(e,{placement:H,boundary:h,rootBoundary:f,altBoundary:u,padding:c}),K=ce?J?Jt:Ct:J?Kt:Et;v[ue]>$[ue]&&(K=Sa(K));var he=Sa(K),ye=[];if(r&&ye.push(ne[B]<=0),l&&ye.push(ne[K]<=0,ne[he]<=0),ye.every(function(qe){return qe})){N=H,Z=!1;break}P.set(H,ye)}if(Z)for(var Me=p?3:1,Xe=function(He){var Be=x.find(function(C){var q=P.get(C);if(q)return q.slice(0,He).every(function(V){return V})});if(Be)return N=Be,"break"},we=Me;we>0;we--){var We=Xe(we);if(We==="break")break}e.placement!==N&&(e.modifiersData[n]._skip=!0,e.placement=N,e.reset=!0)}}const X1={name:"flip",enabled:!0,phase:"main",fn:dL,requiresIfExists:["offset"],data:{_skip:!1}};function MO(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function ZO(i){return[Et,Jt,Kt,Ct].some(function(e){return i[e]>=0})}function pL(i){var e=i.state,t=i.name,n=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=wr(e,{elementContext:"reference"}),l=wr(e,{altBoundary:!0}),a=MO(o,n),c=MO(l,s,r),h=ZO(a),f=ZO(c);e.modifiersData[t]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":f})}const V1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:pL};function mL(i,e,t){var n=Bi(i),s=[Ct,Et].indexOf(n)>=0?-1:1,r=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=r[0],l=r[1];return o=o||0,l=(l||0)*s,[Ct,Jt].indexOf(n)>=0?{x:l,y:o}:{x:o,y:l}}function gL(i){var e=i.state,t=i.options,n=i.name,s=t.offset,r=s===void 0?[0,0]:s,o=Yd.reduce(function(h,f){return h[f]=mL(f,e.rects,r),h},{}),l=o[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=o}const B1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gL};function OL(i){var e=i.state,t=i.name;e.modifiersData[t]=j1({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const sp={name:"popperOffsets",enabled:!0,phase:"read",fn:OL,data:{}};function bL(i){return i==="x"?"y":"x"}function yL(i){var e=i.state,t=i.options,n=i.name,s=t.mainAxis,r=s===void 0?!0:s,o=t.altAxis,l=o===void 0?!1:o,a=t.boundary,c=t.rootBoundary,h=t.altBoundary,f=t.padding,u=t.tether,d=u===void 0?!0:u,p=t.tetherOffset,m=p===void 0?0:p,g=wr(e,{boundary:a,rootBoundary:c,padding:f,altBoundary:h}),O=Bi(e.placement),S=Sr(e.placement),_=!S,x=Kd(O),v=bL(x),$=e.modifiersData.popperOffsets,P=e.rects.reference,Z=e.rects.popper,N=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,Y=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,B={x:0,y:0};if($){if(r){var J,ce=x==="y"?Et:Ct,ue=x==="y"?Kt:Jt,ne=x==="y"?"height":"width",K=$[x],he=K+g[ce],ye=K-g[ue],Me=d?-Z[ne]/2:0,Xe=S===xs?P[ne]:Z[ne],we=S===xs?-Z[ne]:-P[ne],We=e.elements.arrow,qe=d&&We?Gd(We):{width:0,height:0},He=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Z1(),Be=He[ce],C=He[ue],q=bo(0,P[ne],qe[ne]),V=_?P[ne]/2-Me-q-Be-Y.mainAxis:Xe-q-Be-Y.mainAxis,ee=_?-P[ne]/2+Me+q+C+Y.mainAxis:we+q+C+Y.mainAxis,$e=e.elements.arrow&&pl(e.elements.arrow),b=$e?x==="y"?$e.clientTop||0:$e.clientLeft||0:0,y=(J=H==null?void 0:H[x])!=null?J:0,k=K+V-y-b,T=K+ee-y,M=bo(d?hc(he,k):he,K,d?ps(ye,T):ye);$[x]=M,B[x]=M-K}if(l){var R,W=x==="x"?Et:Ct,j=x==="x"?Kt:Jt,I=$[v],L=v==="y"?"height":"width",re=I+g[W],z=I-g[j],ie=[Et,Ct].indexOf(O)!==-1,ae=(R=H==null?void 0:H[v])!=null?R:0,Oe=ie?re:I-P[L]-Z[L]-ae+Y.altAxis,Ee=ie?I+P[L]+Z[L]-ae-Y.altAxis:z,_e=d&&ie?HD(Oe,I,Ee):bo(d?Oe:re,I,d?Ee:z);$[v]=_e,B[v]=_e-I}e.modifiersData[n]=B}}const W1={name:"preventOverflow",enabled:!0,phase:"main",fn:yL,requiresIfExists:["offset"]};function SL(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function wL(i){return i===ei(i)||!li(i)?tp(i):SL(i)}function xL(i){var e=i.getBoundingClientRect(),t=br(e.width)/i.offsetWidth||1,n=br(e.height)/i.offsetHeight||1;return t!==1||n!==1}function vL(i,e,t){t===void 0&&(t=!1);var n=li(e),s=li(e)&&xL(e),r=Un(e),o=yr(i,s,t),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(n||!n&&!t)&&((zi(e)!=="body"||np(r))&&(l=wL(e)),li(e)?(a=yr(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):r&&(a.x=ip(r))),{x:o.left+l.scrollLeft-a.x,y:o.top+l.scrollTop-a.y,width:o.width,height:o.height}}function _L(i){var e=new Map,t=new Set,n=[];i.forEach(function(r){e.set(r.name,r)});function s(r){t.add(r.name);var o=[].concat(r.requires||[],r.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var a=e.get(l);a&&s(a)}}),n.push(r)}return i.forEach(function(r){t.has(r.name)||s(r)}),n}function kL(i){var e=_L(i);return T1.reduce(function(t,n){return t.concat(e.filter(function(s){return s.phase===n}))},[])}function $L(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function PL(i){var e=i.reduce(function(t,n){var s=t[n.name];return t[n.name]=s?Object.assign({},s,n,{options:Object.assign({},s.options,n.options),data:Object.assign({},s.data,n.data)}):n,t},{});return Object.keys(e).map(function(t){return e[t]})}var DO={placement:"bottom",modifiers:[],strategy:"absolute"};function LO(){for(var i=arguments.length,e=new Array(i),t=0;t(i&&window.CSS&&window.CSS.escape&&(i=i.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),i),ML=i=>i==null?`${i}`:Object.prototype.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase(),ZL=i=>{do i+=Math.floor(Math.random()*TL);while(document.getElementById(i));return i},DL=i=>{if(!i)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(i);const n=Number.parseFloat(e),s=Number.parseFloat(t);return!n&&!s?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*RL)},z1=i=>{i.dispatchEvent(new Event(Ru))},an=i=>!i||typeof i!="object"?!1:(typeof i.jquery<"u"&&(i=i[0]),typeof i.nodeType<"u"),In=i=>an(i)?i.jquery?i[0]:i:typeof i=="string"&&i.length>0?document.querySelector(U1(i)):null,Tr=i=>{if(!an(i)||i.getClientRects().length===0)return!1;const e=getComputedStyle(i).getPropertyValue("visibility")==="visible",t=i.closest("details:not([open])");if(!t)return e;if(t!==i){const n=i.closest("summary");if(n&&n.parentNode!==t||n===null)return!1}return e},jn=i=>!i||i.nodeType!==Node.ELEMENT_NODE||i.classList.contains("disabled")?!0:typeof i.disabled<"u"?i.disabled:i.hasAttribute("disabled")&&i.getAttribute("disabled")!=="false",Y1=i=>{if(!document.documentElement.attachShadow)return null;if(typeof i.getRootNode=="function"){const e=i.getRootNode();return e instanceof ShadowRoot?e:null}return i instanceof ShadowRoot?i:i.parentNode?Y1(i.parentNode):null},fc=()=>{},ml=i=>{i.offsetHeight},F1=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Yh=[],LL=i=>{document.readyState==="loading"?(Yh.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of Yh)e()}),Yh.push(i)):i()},hi=()=>document.documentElement.dir==="rtl",di=i=>{LL(()=>{const e=F1();if(e){const t=i.NAME,n=e.fn[t];e.fn[t]=i.jQueryInterface,e.fn[t].Constructor=i,e.fn[t].noConflict=()=>(e.fn[t]=n,i.jQueryInterface)}})},Dt=(i,e=[],t=i)=>typeof i=="function"?i(...e):t,H1=(i,e,t=!0)=>{if(!t){Dt(i);return}const s=DL(e)+5;let r=!1;const o=({target:l})=>{l===e&&(r=!0,e.removeEventListener(Ru,o),Dt(i))};e.addEventListener(Ru,o),setTimeout(()=>{r||z1(e)},s)},op=(i,e,t,n)=>{const s=i.length;let r=i.indexOf(e);return r===-1?!t&&n?i[s-1]:i[0]:(r+=t?1:-1,n&&(r=(r+s)%s),i[Math.max(0,Math.min(r,s-1))])},NL=/[^.]*(?=\..*)\.|.*/,IL=/\..*/,jL=/::\d+$/,Fh={};let NO=1;const G1={mouseenter:"mouseover",mouseleave:"mouseout"},XL=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function K1(i,e){return e&&`${e}::${NO++}`||i.uidEvent||NO++}function J1(i){const e=K1(i);return i.uidEvent=e,Fh[e]=Fh[e]||{},Fh[e]}function VL(i,e){return function t(n){return lp(n,{delegateTarget:i}),t.oneOff&&D.off(i,n.type,e),e.apply(i,[n])}}function BL(i,e,t){return function n(s){const r=i.querySelectorAll(e);for(let{target:o}=s;o&&o!==this;o=o.parentNode)for(const l of r)if(l===o)return lp(s,{delegateTarget:o}),n.oneOff&&D.off(i,s.type,e,t),t.apply(o,[s])}}function ex(i,e,t=null){return Object.values(i).find(n=>n.callable===e&&n.delegationSelector===t)}function tx(i,e,t){const n=typeof e=="string",s=n?t:e||t;let r=ix(i);return XL.has(r)||(r=i),[n,s,r]}function IO(i,e,t,n,s){if(typeof e!="string"||!i)return;let[r,o,l]=tx(e,t,n);e in G1&&(o=(p=>function(m){if(!m.relatedTarget||m.relatedTarget!==m.delegateTarget&&!m.delegateTarget.contains(m.relatedTarget))return p.call(this,m)})(o));const a=J1(i),c=a[l]||(a[l]={}),h=ex(c,o,r?t:null);if(h){h.oneOff=h.oneOff&&s;return}const f=K1(o,e.replace(NL,"")),u=r?BL(i,t,o):VL(i,o);u.delegationSelector=r?t:null,u.callable=o,u.oneOff=s,u.uidEvent=f,c[f]=u,i.addEventListener(l,u,r)}function Mu(i,e,t,n,s){const r=ex(e[t],n,s);r&&(i.removeEventListener(t,r,!!s),delete e[t][r.uidEvent])}function WL(i,e,t,n){const s=e[t]||{};for(const[r,o]of Object.entries(s))r.includes(n)&&Mu(i,e,t,o.callable,o.delegationSelector)}function ix(i){return i=i.replace(IL,""),G1[i]||i}const D={on(i,e,t,n){IO(i,e,t,n,!1)},one(i,e,t,n){IO(i,e,t,n,!0)},off(i,e,t,n){if(typeof e!="string"||!i)return;const[s,r,o]=tx(e,t,n),l=o!==e,a=J1(i),c=a[o]||{},h=e.startsWith(".");if(typeof r<"u"){if(!Object.keys(c).length)return;Mu(i,a,o,r,s?t:null);return}if(h)for(const f of Object.keys(a))WL(i,a,f,e.slice(1));for(const[f,u]of Object.entries(c)){const d=f.replace(jL,"");(!l||e.includes(d))&&Mu(i,a,o,u.callable,u.delegationSelector)}},trigger(i,e,t){if(typeof e!="string"||!i)return null;const n=F1(),s=ix(e),r=e!==s;let o=null,l=!0,a=!0,c=!1;r&&n&&(o=n.Event(e,t),n(i).trigger(o),l=!o.isPropagationStopped(),a=!o.isImmediatePropagationStopped(),c=o.isDefaultPrevented());const h=lp(new Event(e,{bubbles:l,cancelable:!0}),t);return c&&h.preventDefault(),a&&i.dispatchEvent(h),h.defaultPrevented&&o&&o.preventDefault(),h}};function lp(i,e={}){for(const[t,n]of Object.entries(e))try{i[t]=n}catch{Object.defineProperty(i,t,{configurable:!0,get(){return n}})}return i}function jO(i){if(i==="true")return!0;if(i==="false")return!1;if(i===Number(i).toString())return Number(i);if(i===""||i==="null")return null;if(typeof i!="string")return i;try{return JSON.parse(decodeURIComponent(i))}catch{return i}}function Hh(i){return i.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const cn={setDataAttribute(i,e,t){i.setAttribute(`data-bs-${Hh(e)}`,t)},removeDataAttribute(i,e){i.removeAttribute(`data-bs-${Hh(e)}`)},getDataAttributes(i){if(!i)return{};const e={},t=Object.keys(i.dataset).filter(n=>n.startsWith("bs")&&!n.startsWith("bsConfig"));for(const n of t){let s=n.replace(/^bs/,"");s=s.charAt(0).toLowerCase()+s.slice(1,s.length),e[s]=jO(i.dataset[n])}return e},getDataAttribute(i,e){return jO(i.getAttribute(`data-bs-${Hh(e)}`))}};class gl{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=an(t)?cn.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof n=="object"?n:{},...an(t)?cn.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[n,s]of Object.entries(t)){const r=e[n],o=an(r)?"element":ML(r);if(!new RegExp(s).test(o))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${o}" but expected type "${s}".`)}}}const qL="5.3.3";class xi extends gl{constructor(e,t){super(),e=In(e),e&&(this._element=e,this._config=this._getConfig(t),zh.set(this._element,this.constructor.DATA_KEY,this))}dispose(){zh.remove(this._element,this.constructor.DATA_KEY),D.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){H1(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return zh.get(In(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return qL}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const Gh=i=>{let e=i.getAttribute("data-bs-target");if(!e||e==="#"){let t=i.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?t.trim():null}return e?e.split(",").map(t=>U1(t)).join(","):null},se={find(i,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,i))},findOne(i,e=document.documentElement){return Element.prototype.querySelector.call(e,i)},children(i,e){return[].concat(...i.children).filter(t=>t.matches(e))},parents(i,e){const t=[];let n=i.parentNode.closest(e);for(;n;)t.push(n),n=n.parentNode.closest(e);return t},prev(i,e){let t=i.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(i,e){let t=i.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(i){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,i).filter(t=>!jn(t)&&Tr(t))},getSelectorFromElement(i){const e=Gh(i);return e&&se.findOne(e)?e:null},getElementFromSelector(i){const e=Gh(i);return e?se.findOne(e):null},getMultipleElementsFromSelector(i){const e=Gh(i);return e?se.find(e):[]}},Fc=(i,e="hide")=>{const t=`click.dismiss${i.EVENT_KEY}`,n=i.NAME;D.on(document,t,`[data-bs-dismiss="${n}"]`,function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),jn(this))return;const r=se.getElementFromSelector(this)||this.closest(`.${n}`);i.getOrCreateInstance(r)[e]()})},UL="alert",zL="bs.alert",nx=`.${zL}`,YL=`close${nx}`,FL=`closed${nx}`,HL="fade",GL="show";class Hc extends xi{static get NAME(){return UL}close(){if(D.trigger(this._element,YL).defaultPrevented)return;this._element.classList.remove(GL);const t=this._element.classList.contains(HL);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),D.trigger(this._element,FL),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Hc.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Fc(Hc,"close");di(Hc);const KL="button",JL="bs.button",eN=`.${JL}`,tN=".data-api",iN="active",XO='[data-bs-toggle="button"]',nN=`click${eN}${tN}`;class Gc extends xi{static get NAME(){return KL}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(iN))}static jQueryInterface(e){return this.each(function(){const t=Gc.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}D.on(document,nN,XO,i=>{i.preventDefault();const e=i.target.closest(XO);Gc.getOrCreateInstance(e).toggle()});di(Gc);const sN="swipe",Rr=".bs.swipe",rN=`touchstart${Rr}`,oN=`touchmove${Rr}`,lN=`touchend${Rr}`,aN=`pointerdown${Rr}`,cN=`pointerup${Rr}`,hN="touch",fN="pen",uN="pointer-event",dN=40,pN={endCallback:null,leftCallback:null,rightCallback:null},mN={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class uc extends gl{constructor(e,t){super(),this._element=e,!(!e||!uc.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return pN}static get DefaultType(){return mN}static get NAME(){return sN}dispose(){D.off(this._element,Rr)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Dt(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=dN)return;const t=e/this._deltaX;this._deltaX=0,t&&Dt(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(D.on(this._element,aN,e=>this._start(e)),D.on(this._element,cN,e=>this._end(e)),this._element.classList.add(uN)):(D.on(this._element,rN,e=>this._start(e)),D.on(this._element,oN,e=>this._move(e)),D.on(this._element,lN,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===fN||e.pointerType===hN)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const gN="carousel",ON="bs.carousel",zn=`.${ON}`,sx=".data-api",bN="ArrowLeft",yN="ArrowRight",SN=500,zr="next",As="prev",Is="left",wa="right",wN=`slide${zn}`,Kh=`slid${zn}`,xN=`keydown${zn}`,vN=`mouseenter${zn}`,_N=`mouseleave${zn}`,kN=`dragstart${zn}`,$N=`load${zn}${sx}`,PN=`click${zn}${sx}`,rx="carousel",Yl="active",QN="slide",EN="carousel-item-end",CN="carousel-item-start",AN="carousel-item-next",TN="carousel-item-prev",ox=".active",lx=".carousel-item",RN=ox+lx,MN=".carousel-item img",ZN=".carousel-indicators",DN="[data-bs-slide], [data-bs-slide-to]",LN='[data-bs-ride="carousel"]',NN={[bN]:wa,[yN]:Is},IN={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},jN={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Ol extends xi{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=se.findOne(ZN,this._element),this._addEventListeners(),this._config.ride===rx&&this.cycle()}static get Default(){return IN}static get DefaultType(){return jN}static get NAME(){return gN}next(){this._slide(zr)}nextWhenVisible(){!document.hidden&&Tr(this._element)&&this.next()}prev(){this._slide(As)}pause(){this._isSliding&&z1(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){D.one(this._element,Kh,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){D.one(this._element,Kh,()=>this.to(e));return}const n=this._getItemIndex(this._getActive());if(n===e)return;const s=e>n?zr:As;this._slide(s,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&D.on(this._element,xN,e=>this._keydown(e)),this._config.pause==="hover"&&(D.on(this._element,vN,()=>this.pause()),D.on(this._element,_N,()=>this._maybeEnableCycle())),this._config.touch&&uc.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const n of se.find(MN,this._element))D.on(n,kN,s=>s.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(Is)),rightCallback:()=>this._slide(this._directionToOrder(wa)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),SN+this._config.interval))}};this._swipeHelper=new uc(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=NN[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=se.findOne(ox,this._indicatorsElement);t.classList.remove(Yl),t.removeAttribute("aria-current");const n=se.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add(Yl),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const n=this._getActive(),s=e===zr,r=t||op(this._getItems(),n,s,this._config.wrap);if(r===n)return;const o=this._getItemIndex(r),l=d=>D.trigger(this._element,d,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:o});if(l(wN).defaultPrevented||!n||!r)return;const c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=r;const h=s?CN:EN,f=s?AN:TN;r.classList.add(f),ml(r),n.classList.add(h),r.classList.add(h);const u=()=>{r.classList.remove(h,f),r.classList.add(Yl),n.classList.remove(Yl,f,h),this._isSliding=!1,l(Kh)};this._queueCallback(u,n,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains(QN)}_getActive(){return se.findOne(RN,this._element)}_getItems(){return se.find(lx,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return hi()?e===Is?As:zr:e===Is?zr:As}_orderToDirection(e){return hi()?e===As?Is:wa:e===As?wa:Is}static jQueryInterface(e){return this.each(function(){const t=Ol.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}D.on(document,PN,DN,function(i){const e=se.getElementFromSelector(this);if(!e||!e.classList.contains(rx))return;i.preventDefault();const t=Ol.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");if(n){t.to(n),t._maybeEnableCycle();return}if(cn.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});D.on(window,$N,()=>{const i=se.find(LN);for(const e of i)Ol.getOrCreateInstance(e)});di(Ol);const XN="collapse",VN="bs.collapse",bl=`.${VN}`,BN=".data-api",WN=`show${bl}`,qN=`shown${bl}`,UN=`hide${bl}`,zN=`hidden${bl}`,YN=`click${bl}${BN}`,Jh="show",Ws="collapse",Fl="collapsing",FN="collapsed",HN=`:scope .${Ws} .${Ws}`,GN="collapse-horizontal",KN="width",JN="height",e5=".collapse.show, .collapse.collapsing",Zu='[data-bs-toggle="collapse"]',t5={parent:null,toggle:!0},i5={parent:"(null|element)",toggle:"boolean"};class Uo extends xi{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=se.find(Zu);for(const s of n){const r=se.getSelectorFromElement(s),o=se.find(r).filter(l=>l===this._element);r!==null&&o.length&&this._triggerArray.push(s)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return t5}static get DefaultType(){return i5}static get NAME(){return XN}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(e5).filter(l=>l!==this._element).map(l=>Uo.getOrCreateInstance(l,{toggle:!1}))),e.length&&e[0]._isTransitioning||D.trigger(this._element,WN).defaultPrevented)return;for(const l of e)l.hide();const n=this._getDimension();this._element.classList.remove(Ws),this._element.classList.add(Fl),this._element.style[n]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const s=()=>{this._isTransitioning=!1,this._element.classList.remove(Fl),this._element.classList.add(Ws,Jh),this._element.style[n]="",D.trigger(this._element,qN)},o=`scroll${n[0].toUpperCase()+n.slice(1)}`;this._queueCallback(s,this._element,!0),this._element.style[n]=`${this._element[o]}px`}hide(){if(this._isTransitioning||!this._isShown()||D.trigger(this._element,UN).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,ml(this._element),this._element.classList.add(Fl),this._element.classList.remove(Ws,Jh);for(const s of this._triggerArray){const r=se.getElementFromSelector(s);r&&!this._isShown(r)&&this._addAriaAndCollapsedClass([s],!1)}this._isTransitioning=!0;const n=()=>{this._isTransitioning=!1,this._element.classList.remove(Fl),this._element.classList.add(Ws),D.trigger(this._element,zN)};this._element.style[t]="",this._queueCallback(n,this._element,!0)}_isShown(e=this._element){return e.classList.contains(Jh)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=In(e.parent),e}_getDimension(){return this._element.classList.contains(GN)?KN:JN}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(Zu);for(const t of e){const n=se.getElementFromSelector(t);n&&this._addAriaAndCollapsedClass([t],this._isShown(n))}}_getFirstLevelChildren(e){const t=se.find(HN,this._config.parent);return se.find(e,this._config.parent).filter(n=>!t.includes(n))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle(FN,!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const n=Uo.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof n[e]>"u")throw new TypeError(`No method named "${e}"`);n[e]()}})}}D.on(document,YN,Zu,function(i){(i.target.tagName==="A"||i.delegateTarget&&i.delegateTarget.tagName==="A")&&i.preventDefault();for(const e of se.getMultipleElementsFromSelector(this))Uo.getOrCreateInstance(e,{toggle:!1}).toggle()});di(Uo);const VO="dropdown",n5="bs.dropdown",$s=`.${n5}`,ap=".data-api",s5="Escape",BO="Tab",r5="ArrowUp",WO="ArrowDown",o5=2,l5=`hide${$s}`,a5=`hidden${$s}`,c5=`show${$s}`,h5=`shown${$s}`,ax=`click${$s}${ap}`,cx=`keydown${$s}${ap}`,f5=`keyup${$s}${ap}`,js="show",u5="dropup",d5="dropend",p5="dropstart",m5="dropup-center",g5="dropdown-center",os='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',O5=`${os}.${js}`,xa=".dropdown-menu",b5=".navbar",y5=".navbar-nav",S5=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",w5=hi()?"top-end":"top-start",x5=hi()?"top-start":"top-end",v5=hi()?"bottom-end":"bottom-start",_5=hi()?"bottom-start":"bottom-end",k5=hi()?"left-start":"right-start",$5=hi()?"right-start":"left-start",P5="top",Q5="bottom",E5={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},C5={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Wi extends xi{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=se.next(this._element,xa)[0]||se.prev(this._element,xa)[0]||se.findOne(xa,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return E5}static get DefaultType(){return C5}static get NAME(){return VO}toggle(){return this._isShown()?this.hide():this.show()}show(){if(jn(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!D.trigger(this._element,c5,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(y5))for(const n of[].concat(...document.body.children))D.on(n,"mouseover",fc);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(js),this._element.classList.add(js),D.trigger(this._element,h5,e)}}hide(){if(jn(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!D.trigger(this._element,l5,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const n of[].concat(...document.body.children))D.off(n,"mouseover",fc);this._popper&&this._popper.destroy(),this._menu.classList.remove(js),this._element.classList.remove(js),this._element.setAttribute("aria-expanded","false"),cn.removeDataAttribute(this._menu,"popper"),D.trigger(this._element,a5,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!an(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${VO.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof q1>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:an(this._config.reference)?e=In(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=rp(e,this._menu,t)}_isShown(){return this._menu.classList.contains(js)}_getPlacement(){const e=this._parent;if(e.classList.contains(d5))return k5;if(e.classList.contains(p5))return $5;if(e.classList.contains(m5))return P5;if(e.classList.contains(g5))return Q5;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(u5)?t?x5:w5:t?_5:v5}_detectNavbar(){return this._element.closest(b5)!==null}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(cn.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...Dt(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const n=se.find(S5,this._menu).filter(s=>Tr(s));n.length&&op(n,t,e===WO,!n.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Wi.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===o5||e.type==="keyup"&&e.key!==BO)return;const t=se.find(O5);for(const n of t){const s=Wi.getInstance(n);if(!s||s._config.autoClose===!1)continue;const r=e.composedPath(),o=r.includes(s._menu);if(r.includes(s._element)||s._config.autoClose==="inside"&&!o||s._config.autoClose==="outside"&&o||s._menu.contains(e.target)&&(e.type==="keyup"&&e.key===BO||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const l={relatedTarget:s._element};e.type==="click"&&(l.clickEvent=e),s._completeHide(l)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n=e.key===s5,s=[r5,WO].includes(e.key);if(!s&&!n||t&&!n)return;e.preventDefault();const r=this.matches(os)?this:se.prev(this,os)[0]||se.next(this,os)[0]||se.findOne(os,e.delegateTarget.parentNode),o=Wi.getOrCreateInstance(r);if(s){e.stopPropagation(),o.show(),o._selectMenuItem(e);return}o._isShown()&&(e.stopPropagation(),o.hide(),r.focus())}}D.on(document,cx,os,Wi.dataApiKeydownHandler);D.on(document,cx,xa,Wi.dataApiKeydownHandler);D.on(document,ax,Wi.clearMenus);D.on(document,f5,Wi.clearMenus);D.on(document,ax,os,function(i){i.preventDefault(),Wi.getOrCreateInstance(this).toggle()});di(Wi);const hx="backdrop",A5="fade",qO="show",UO=`mousedown.bs.${hx}`,T5={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},R5={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class fx extends gl{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return T5}static get DefaultType(){return R5}static get NAME(){return hx}show(e){if(!this._config.isVisible){Dt(e);return}this._append();const t=this._getElement();this._config.isAnimated&&ml(t),t.classList.add(qO),this._emulateAnimation(()=>{Dt(e)})}hide(e){if(!this._config.isVisible){Dt(e);return}this._getElement().classList.remove(qO),this._emulateAnimation(()=>{this.dispose(),Dt(e)})}dispose(){this._isAppended&&(D.off(this._element,UO),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(A5),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=In(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),D.on(e,UO,()=>{Dt(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){H1(e,this._getElement(),this._config.isAnimated)}}const M5="focustrap",Z5="bs.focustrap",dc=`.${Z5}`,D5=`focusin${dc}`,L5=`keydown.tab${dc}`,N5="Tab",I5="forward",zO="backward",j5={autofocus:!0,trapElement:null},X5={autofocus:"boolean",trapElement:"element"};class ux extends gl{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return j5}static get DefaultType(){return X5}static get NAME(){return M5}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),D.off(document,dc),D.on(document,D5,e=>this._handleFocusin(e)),D.on(document,L5,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,D.off(document,dc))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=se.focusableChildren(t);n.length===0?t.focus():this._lastTabNavDirection===zO?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){e.key===N5&&(this._lastTabNavDirection=e.shiftKey?zO:I5)}}const YO=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",FO=".sticky-top",Hl="padding-right",HO="margin-right";class Du{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Hl,t=>t+e),this._setElementAttributes(YO,Hl,t=>t+e),this._setElementAttributes(FO,HO,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Hl),this._resetElementAttributes(YO,Hl),this._resetElementAttributes(FO,HO)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const s=this.getWidth(),r=o=>{if(o!==this._element&&window.innerWidth>o.clientWidth+s)return;this._saveInitialAttribute(o,t);const l=window.getComputedStyle(o).getPropertyValue(t);o.style.setProperty(t,`${n(Number.parseFloat(l))}px`)};this._applyManipulationCallback(e,r)}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&cn.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){const n=s=>{const r=cn.getDataAttribute(s,t);if(r===null){s.style.removeProperty(t);return}cn.removeDataAttribute(s,t),s.style.setProperty(t,r)};this._applyManipulationCallback(e,n)}_applyManipulationCallback(e,t){if(an(e)){t(e);return}for(const n of se.find(e,this._element))t(n)}}const V5="modal",B5="bs.modal",fi=`.${B5}`,W5=".data-api",q5="Escape",U5=`hide${fi}`,z5=`hidePrevented${fi}`,dx=`hidden${fi}`,px=`show${fi}`,Y5=`shown${fi}`,F5=`resize${fi}`,H5=`click.dismiss${fi}`,G5=`mousedown.dismiss${fi}`,K5=`keydown.dismiss${fi}`,J5=`click${fi}${W5}`,GO="modal-open",eI="fade",KO="show",ef="modal-static",tI=".modal.show",iI=".modal-dialog",nI=".modal-body",sI='[data-bs-toggle="modal"]',rI={backdrop:!0,focus:!0,keyboard:!0},oI={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class xr extends xi{constructor(e,t){super(e,t),this._dialog=se.findOne(iI,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Du,this._addEventListeners()}static get Default(){return rI}static get DefaultType(){return oI}static get NAME(){return V5}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||D.trigger(this._element,px,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(GO),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||D.trigger(this._element,U5).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(KO),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){D.off(window,fi),D.off(this._dialog,fi),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new fx({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ux({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=se.findOne(nI,this._dialog);t&&(t.scrollTop=0),ml(this._element),this._element.classList.add(KO);const n=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,D.trigger(this._element,Y5,{relatedTarget:e})};this._queueCallback(n,this._dialog,this._isAnimated())}_addEventListeners(){D.on(this._element,K5,e=>{if(e.key===q5){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),D.on(window,F5,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),D.on(this._element,G5,e=>{D.one(this._element,H5,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(GO),this._resetAdjustments(),this._scrollBar.reset(),D.trigger(this._element,dx)})}_isAnimated(){return this._element.classList.contains(eI)}_triggerBackdropTransition(){if(D.trigger(this._element,z5).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,n=this._element.style.overflowY;n==="hidden"||this._element.classList.contains(ef)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(ef),this._queueCallback(()=>{this._element.classList.remove(ef),this._queueCallback(()=>{this._element.style.overflowY=n},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const s=hi()?"paddingLeft":"paddingRight";this._element.style[s]=`${t}px`}if(!n&&e){const s=hi()?"paddingRight":"paddingLeft";this._element.style[s]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const n=xr.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof n[e]>"u")throw new TypeError(`No method named "${e}"`);n[e](t)}})}}D.on(document,J5,sI,function(i){const e=se.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&i.preventDefault(),D.one(e,px,s=>{s.defaultPrevented||D.one(e,dx,()=>{Tr(this)&&this.focus()})});const t=se.findOne(tI);t&&xr.getInstance(t).hide(),xr.getOrCreateInstance(e).toggle(this)});Fc(xr);di(xr);const lI="offcanvas",aI="bs.offcanvas",gn=`.${aI}`,mx=".data-api",cI=`load${gn}${mx}`,hI="Escape",JO="show",e0="showing",t0="hiding",fI="offcanvas-backdrop",gx=".offcanvas.show",uI=`show${gn}`,dI=`shown${gn}`,pI=`hide${gn}`,i0=`hidePrevented${gn}`,Ox=`hidden${gn}`,mI=`resize${gn}`,gI=`click${gn}${mx}`,OI=`keydown.dismiss${gn}`,bI='[data-bs-toggle="offcanvas"]',yI={backdrop:!0,keyboard:!0,scroll:!1},SI={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Xn extends xi{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return yI}static get DefaultType(){return SI}static get NAME(){return lI}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||D.trigger(this._element,uI,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new Du().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(e0);const n=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(JO),this._element.classList.remove(e0),D.trigger(this._element,dI,{relatedTarget:e})};this._queueCallback(n,this._element,!0)}hide(){if(!this._isShown||D.trigger(this._element,pI).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(t0),this._backdrop.hide();const t=()=>{this._element.classList.remove(JO,t0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new Du().reset(),D.trigger(this._element,Ox)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){D.trigger(this._element,i0);return}this.hide()},t=!!this._config.backdrop;return new fx({className:fI,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new ux({trapElement:this._element})}_addEventListeners(){D.on(this._element,OI,e=>{if(e.key===hI){if(this._config.keyboard){this.hide();return}D.trigger(this._element,i0)}})}static jQueryInterface(e){return this.each(function(){const t=Xn.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}D.on(document,gI,bI,function(i){const e=se.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),jn(this))return;D.one(e,Ox,()=>{Tr(this)&&this.focus()});const t=se.findOne(gx);t&&t!==e&&Xn.getInstance(t).hide(),Xn.getOrCreateInstance(e).toggle(this)});D.on(window,cI,()=>{for(const i of se.find(gx))Xn.getOrCreateInstance(i).show()});D.on(window,mI,()=>{for(const i of se.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(i).position!=="fixed"&&Xn.getOrCreateInstance(i).hide()});Fc(Xn);di(Xn);const wI=/^aria-[\w-]*$/i,bx={"*":["class","dir","id","lang","role",wI],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},xI=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),vI=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,_I=(i,e)=>{const t=i.nodeName.toLowerCase();return e.includes(t)?xI.has(t)?!!vI.test(i.nodeValue):!0:e.filter(n=>n instanceof RegExp).some(n=>n.test(t))};function kI(i,e,t){if(!i.length)return i;if(t&&typeof t=="function")return t(i);const s=new window.DOMParser().parseFromString(i,"text/html"),r=[].concat(...s.body.querySelectorAll("*"));for(const o of r){const l=o.nodeName.toLowerCase();if(!Object.keys(e).includes(l)){o.remove();continue}const a=[].concat(...o.attributes),c=[].concat(e["*"]||[],e[l]||[]);for(const h of a)_I(h,c)||o.removeAttribute(h.nodeName)}return s.body.innerHTML}const $I="TemplateFactory",PI={allowList:bx,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},QI={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},EI={entry:"(string|element|function|null)",selector:"(string|element)"};class CI extends gl{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return PI}static get DefaultType(){return QI}static get NAME(){return $I}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[s,r]of Object.entries(this._config.content))this._setContent(e,r,s);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},EI)}_setContent(e,t,n){const s=se.findOne(n,e);if(s){if(t=this._resolvePossibleFunction(t),!t){s.remove();return}if(an(t)){this._putElementInTemplate(In(t),s);return}if(this._config.html){s.innerHTML=this._maybeSanitize(t);return}s.textContent=t}}_maybeSanitize(e){return this._config.sanitize?kI(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Dt(e,[this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const AI="tooltip",TI=new Set(["sanitize","allowList","sanitizeFn"]),tf="fade",RI="modal",Gl="show",MI=".tooltip-inner",n0=`.${RI}`,s0="hide.bs.modal",Yr="hover",nf="focus",ZI="click",DI="manual",LI="hide",NI="hidden",II="show",jI="shown",XI="inserted",VI="click",BI="focusin",WI="focusout",qI="mouseenter",UI="mouseleave",zI={AUTO:"auto",TOP:"top",RIGHT:hi()?"left":"right",BOTTOM:"bottom",LEFT:hi()?"right":"left"},YI={allowList:bx,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},FI={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Mr extends xi{constructor(e,t){if(typeof q1>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return YI}static get DefaultType(){return FI}static get NAME(){return AI}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),D.off(this._element.closest(n0),s0,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const e=D.trigger(this._element,this.constructor.eventName(II)),n=(Y1(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!n)return;this._disposePopper();const s=this._getTipElement();this._element.setAttribute("aria-describedby",s.getAttribute("id"));const{container:r}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(s),D.trigger(this._element,this.constructor.eventName(XI))),this._popper=this._createPopper(s),s.classList.add(Gl),"ontouchstart"in document.documentElement)for(const l of[].concat(...document.body.children))D.on(l,"mouseover",fc);const o=()=>{D.trigger(this._element,this.constructor.eventName(jI)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(o,this.tip,this._isAnimated())}hide(){if(!this._isShown()||D.trigger(this._element,this.constructor.eventName(LI)).defaultPrevented)return;if(this._getTipElement().classList.remove(Gl),"ontouchstart"in document.documentElement)for(const s of[].concat(...document.body.children))D.off(s,"mouseover",fc);this._activeTrigger[ZI]=!1,this._activeTrigger[nf]=!1,this._activeTrigger[Yr]=!1,this._isHovered=null;const n=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),D.trigger(this._element,this.constructor.eventName(NI)))};this._queueCallback(n,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(tf,Gl),t.classList.add(`bs-${this.constructor.NAME}-auto`);const n=ZL(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(tf),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new CI({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[MI]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(tf)}_isShown(){return this.tip&&this.tip.classList.contains(Gl)}_createPopper(e){const t=Dt(this._config.placement,[this,e,this._element]),n=zI[t.toUpperCase()];return rp(this._element,e,this._getPopperConfig(n))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return Dt(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:n=>{this._getTipElement().setAttribute("data-popper-placement",n.state.placement)}}]};return{...t,...Dt(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")D.on(this._element,this.constructor.eventName(VI),this._config.selector,n=>{this._initializeOnDelegatedTarget(n).toggle()});else if(t!==DI){const n=t===Yr?this.constructor.eventName(qI):this.constructor.eventName(BI),s=t===Yr?this.constructor.eventName(UI):this.constructor.eventName(WI);D.on(this._element,n,this._config.selector,r=>{const o=this._initializeOnDelegatedTarget(r);o._activeTrigger[r.type==="focusin"?nf:Yr]=!0,o._enter()}),D.on(this._element,s,this._config.selector,r=>{const o=this._initializeOnDelegatedTarget(r);o._activeTrigger[r.type==="focusout"?nf:Yr]=o._element.contains(r.relatedTarget),o._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},D.on(this._element.closest(n0),s0,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=cn.getDataAttributes(this._element);for(const n of Object.keys(t))TI.has(n)&&delete t[n];return e={...t,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:In(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=Mr.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}di(Mr);const HI="popover",GI=".popover-header",KI=".popover-body",JI={...Mr.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},ej={...Mr.DefaultType,content:"(null|string|element|function)"};class cp extends Mr{static get Default(){return JI}static get DefaultType(){return ej}static get NAME(){return HI}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[GI]:this._getTitle(),[KI]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=cp.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}di(cp);const tj="scrollspy",ij="bs.scrollspy",hp=`.${ij}`,nj=".data-api",sj=`activate${hp}`,r0=`click${hp}`,rj=`load${hp}${nj}`,oj="dropdown-item",Ts="active",lj='[data-bs-spy="scroll"]',sf="[href]",aj=".nav, .list-group",o0=".nav-link",cj=".nav-item",hj=".list-group-item",fj=`${o0}, ${cj} > ${o0}, ${hj}`,uj=".dropdown",dj=".dropdown-toggle",pj={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},mj={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Kc extends xi{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return pj}static get DefaultType(){return mj}static get NAME(){return tj}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=In(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(D.off(this._config.target,r0),D.on(this._config.target,r0,sf,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,s=t.offsetTop-this._element.offsetTop;if(n.scrollTo){n.scrollTo({top:s,behavior:"smooth"});return}n.scrollTop=s}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=o=>this._targetLinks.get(`#${o.target.id}`),n=o=>{this._previousScrollData.visibleEntryTop=o.target.offsetTop,this._process(t(o))},s=(this._rootElement||document.documentElement).scrollTop,r=s>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=s;for(const o of e){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(o));continue}const l=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&l){if(n(o),!s)return;continue}!r&&!l&&n(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=se.find(sf,this._config.target);for(const t of e){if(!t.hash||jn(t))continue;const n=se.findOne(decodeURI(t.hash),this._element);Tr(n)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,n))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Ts),this._activateParents(e),D.trigger(this._element,sj,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(oj)){se.findOne(dj,e.closest(uj)).classList.add(Ts);return}for(const t of se.parents(e,aj))for(const n of se.prev(t,fj))n.classList.add(Ts)}_clearActiveClass(e){e.classList.remove(Ts);const t=se.find(`${sf}.${Ts}`,e);for(const n of t)n.classList.remove(Ts)}static jQueryInterface(e){return this.each(function(){const t=Kc.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}D.on(window,rj,()=>{for(const i of se.find(lj))Kc.getOrCreateInstance(i)});di(Kc);const gj="tab",Oj="bs.tab",Ps=`.${Oj}`,bj=`hide${Ps}`,yj=`hidden${Ps}`,Sj=`show${Ps}`,wj=`shown${Ps}`,xj=`click${Ps}`,vj=`keydown${Ps}`,_j=`load${Ps}`,kj="ArrowLeft",l0="ArrowRight",$j="ArrowUp",a0="ArrowDown",rf="Home",c0="End",ls="active",h0="fade",of="show",Pj="dropdown",yx=".dropdown-toggle",Qj=".dropdown-menu",lf=`:not(${yx})`,Ej='.list-group, .nav, [role="tablist"]',Cj=".nav-item, .list-group-item",Aj=`.nav-link${lf}, .list-group-item${lf}, [role="tab"]${lf}`,Sx='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',af=`${Aj}, ${Sx}`,Tj=`.${ls}[data-bs-toggle="tab"], .${ls}[data-bs-toggle="pill"], .${ls}[data-bs-toggle="list"]`;class vr extends xi{constructor(e){super(e),this._parent=this._element.closest(Ej),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),D.on(this._element,vj,t=>this._keydown(t)))}static get NAME(){return gj}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?D.trigger(t,bj,{relatedTarget:e}):null;D.trigger(e,Sj,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(ls),this._activate(se.getElementFromSelector(e));const n=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(of);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),D.trigger(e,wj,{relatedTarget:t})};this._queueCallback(n,e,e.classList.contains(h0))}_deactivate(e,t){if(!e)return;e.classList.remove(ls),e.blur(),this._deactivate(se.getElementFromSelector(e));const n=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(of);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),D.trigger(e,yj,{relatedTarget:t})};this._queueCallback(n,e,e.classList.contains(h0))}_keydown(e){if(![kj,l0,$j,a0,rf,c0].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(s=>!jn(s));let n;if([rf,c0].includes(e.key))n=t[e.key===rf?0:t.length-1];else{const s=[l0,a0].includes(e.key);n=op(t,e.target,s,!0)}n&&(n.focus({preventScroll:!0}),vr.getOrCreateInstance(n).show())}_getChildren(){return se.find(af,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const n of t)this._setInitialAttributesOnChild(n)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=se.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains(Pj))return;const s=(r,o)=>{const l=se.findOne(r,n);l&&l.classList.toggle(o,t)};s(yx,ls),s(Qj,of),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(ls)}_getInnerElement(e){return e.matches(af)?e:se.findOne(af,e)}_getOuterElement(e){return e.closest(Cj)||e}static jQueryInterface(e){return this.each(function(){const t=vr.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}D.on(document,xj,Sx,function(i){["A","AREA"].includes(this.tagName)&&i.preventDefault(),!jn(this)&&vr.getOrCreateInstance(this).show()});D.on(window,_j,()=>{for(const i of se.find(Tj))vr.getOrCreateInstance(i)});di(vr);const Rj="toast",Mj="bs.toast",Yn=`.${Mj}`,Zj=`mouseover${Yn}`,Dj=`mouseout${Yn}`,Lj=`focusin${Yn}`,Nj=`focusout${Yn}`,Ij=`hide${Yn}`,jj=`hidden${Yn}`,Xj=`show${Yn}`,Vj=`shown${Yn}`,Bj="fade",f0="hide",Kl="show",Jl="showing",Wj={animation:"boolean",autohide:"boolean",delay:"number"},qj={animation:!0,autohide:!0,delay:5e3};class Jc extends xi{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return qj}static get DefaultType(){return Wj}static get NAME(){return Rj}show(){if(D.trigger(this._element,Xj).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(Bj);const t=()=>{this._element.classList.remove(Jl),D.trigger(this._element,Vj),this._maybeScheduleHide()};this._element.classList.remove(f0),ml(this._element),this._element.classList.add(Kl,Jl),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||D.trigger(this._element,Ij).defaultPrevented)return;const t=()=>{this._element.classList.add(f0),this._element.classList.remove(Jl,Kl),D.trigger(this._element,jj)};this._element.classList.add(Jl),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Kl),super.dispose()}isShown(){return this._element.classList.contains(Kl)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){D.on(this._element,Zj,e=>this._onInteraction(e,!0)),D.on(this._element,Dj,e=>this._onInteraction(e,!1)),D.on(this._element,Lj,e=>this._onInteraction(e,!0)),D.on(this._element,Nj,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Jc.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}Fc(Jc);di(Jc);const fp=B_(qD),Uj=U_();fp.use(Uj);fp.use(gr);fp.mount("#app");