PATH:
home
/
sparklp6
/
public_html
/
website_356c8563
/
wp-content
/
plugins
/
templately
/
assets
/
js
/
chunks
(globalThis.webpackChunktemplately=globalThis.webpackChunktemplately||[]).push([[415],{4361(e,t,n){var i=n(8829),r=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;function o(){this._array=[],this._set=s?new Map:Object.create(null)}o.fromArray=function(e,t){for(var n=new o,i=0,r=e.length;i<r;i++)n.add(e[i],t);return n},o.prototype.size=function(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length},o.prototype.add=function(e,t){var n=s?e:i.toSetString(e),o=s?this.has(e):r.call(this._set,n),a=this._array.length;o&&!t||this._array.push(e),o||(s?this._set.set(e,a):this._set[n]=a)},o.prototype.has=function(e){if(s)return this._set.has(e);var t=i.toSetString(e);return r.call(this._set,t)},o.prototype.indexOf=function(e){if(s){var t=this._set.get(e);if(t>=0)return t}else{var n=i.toSetString(e);if(r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},o.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},o.prototype.toArray=function(){return this._array.slice()},t.C=o},582(e,t,n){var i=n(1642);t.encode=function(e){var t,n="",r=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&r,(r>>>=5)>0&&(t|=32),n+=i.encode(t)}while(r>0);return n},t.decode=function(e,t,n){var r,s,o,a,l=e.length,h=0,c=0;do{if(t>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(s=i.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(32&s),h+=(s&=31)<<c,c+=5}while(r);n.value=(a=(o=h)>>1,1&~o?a:-a),n.rest=t}},1642(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},6260(e,t,n){var i=n(8829);function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},r.prototype.add=function(e){var t,n,r,s,o,a;n=e,r=(t=this._last).generatedLine,s=n.generatedLine,o=t.generatedColumn,a=n.generatedColumn,s>r||s==r&&a>=o||i.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.P=r},1527(e,t,n){var i=n(582),r=n(8829),s=n(4361).C,o=n(6260).P;function a(e){e||(e={}),this._file=r.getArg(e,"file",null),this._sourceRoot=r.getArg(e,"sourceRoot",null),this._skipValidation=r.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=r.getArg(e,"ignoreInvalidMapping",!1),this._sources=new s,this._names=new s,this._mappings=new o,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e,t){var n=e.sourceRoot,i=new a(Object.assign(t||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=r.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),i.addMapping(t)}),e.sources.forEach(function(t){var s=t;null!==n&&(s=r.relative(n,t)),i._sources.has(s)||i._sources.add(s);var o=e.sourceContentFor(t);null!=o&&i.setSourceContent(t,o)}),i},a.prototype.addMapping=function(e){var t=r.getArg(e,"generated"),n=r.getArg(e,"original",null),i=r.getArg(e,"source",null),s=r.getArg(e,"name",null);(this._skipValidation||!1!==this._validateMapping(t,n,i,s))&&(null!=i&&(i=String(i),this._sources.has(i)||this._sources.add(i)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:i,name:s}))},a.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=r.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[r.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[r.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},a.prototype.applySourceMap=function(e,t,n){var i=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');i=e.file}var o=this._sourceRoot;null!=o&&(i=r.relative(o,i));var a=new s,l=new s;this._mappings.unsortedForEach(function(t){if(t.source===i&&null!=t.originalLine){var s=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=s.source&&(t.source=s.source,null!=n&&(t.source=r.join(n,t.source)),null!=o&&(t.source=r.relative(o,t.source)),t.originalLine=s.line,t.originalColumn=s.column,null!=s.name&&(t.name=s.name))}var h=t.source;null==h||a.has(h)||a.add(h);var c=t.name;null==c||l.has(c)||l.add(c)},this),this._sources=a,this._names=l,e.sources.forEach(function(t){var i=e.sourceContentFor(t);null!=i&&(null!=n&&(t=r.join(n,t)),null!=o&&(t=r.relative(o,t)),this.setSourceContent(t,i))},this)},a.prototype._validateMapping=function(e,t,n,i){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column){var r="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return"undefined"!=typeof console&&console.warn&&console.warn(r),!1;throw new Error(r)}if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||i)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)){if(r="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:i}),this._ignoreInvalidMapping)return"undefined"!=typeof console&&console.warn&&console.warn(r),!1;throw new Error(r)}},a.prototype._serializeMappings=function(){for(var e,t,n,s,o=0,a=1,l=0,h=0,c=0,u=0,d="",f=this._mappings.toArray(),p=0,m=f.length;p<m;p++){if(e="",(t=f[p]).generatedLine!==a)for(o=0;t.generatedLine!==a;)e+=";",a++;else if(p>0){if(!r.compareByGeneratedPositionsInflated(t,f[p-1]))continue;e+=","}e+=i.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(s=this._sources.indexOf(t.source),e+=i.encode(s-u),u=s,e+=i.encode(t.originalLine-1-h),h=t.originalLine-1,e+=i.encode(t.originalColumn-l),l=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=i.encode(n-c),c=n)),d+=e}return d},a.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=r.relative(t,e));var n=r.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.x=a},8829(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,i=/^data:.+\,.+$/;function r(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function s(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}t.urlParse=r,t.urlGenerate=s;var o,a,l=(o=function(e){var n=e,i=r(e);if(i){if(!i.path)return e;n=i.path}for(var o=t.isAbsolute(n),a=[],l=0,h=0;;){if(l=h,-1===(h=n.indexOf("/",l))){a.push(n.slice(l));break}for(a.push(n.slice(l,h));h<n.length&&"/"===n[h];)h++}var c,u=0;for(h=a.length-1;h>=0;h--)"."===(c=a[h])?a.splice(h,1):".."===c?u++:u>0&&(""===c?(a.splice(h+1,u),u=0):(a.splice(h,2),u--));return""===(n=a.join("/"))&&(n=o?"/":"."),i?(i.path=n,s(i)):n},a=[],function(e){for(var t=0;t<a.length;t++)if(a[t].input===e){var n=a[0];return a[0]=a[t],a[t]=n,a[0].result}var i=o(e);return a.unshift({input:e,result:i}),a.length>32&&a.pop(),i});function h(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),o=r(e);if(o&&(e=o.path||"/"),n&&!n.scheme)return o&&(n.scheme=o.scheme),s(n);if(n||t.match(i))return t;if(o&&!o.host&&!o.path)return o.host=t,s(o);var a="/"===t.charAt(0)?t:l(e.replace(/\/+$/,"")+"/"+t);return o?(o.path=a,s(o)):a}t.normalize=l,t.join=h,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var i=e.lastIndexOf("/");if(i<0)return t;if((e=e.slice(0,i)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var c=!("__proto__"in Object.create(null));function u(e){return e}function d(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=c?u:function(e){return d(e)?"$"+e:e},t.fromSetString=c?u:function(e){return d(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var i=f(e.source,t.source);return 0!==i||0!==(i=e.originalLine-t.originalLine)||0!==(i=e.originalColumn-t.originalColumn)||n||0!==(i=e.generatedColumn-t.generatedColumn)||0!==(i=e.generatedLine-t.generatedLine)?i:f(e.name,t.name)},t.compareByOriginalPositionsNoSource=function(e,t,n){var i;return 0!==(i=e.originalLine-t.originalLine)||0!==(i=e.originalColumn-t.originalColumn)||n||0!==(i=e.generatedColumn-t.generatedColumn)||0!==(i=e.generatedLine-t.generatedLine)?i:f(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var i=e.generatedLine-t.generatedLine;return 0!==i||0!==(i=e.generatedColumn-t.generatedColumn)||n||0!==(i=f(e.source,t.source))||0!==(i=e.originalLine-t.originalLine)||0!==(i=e.originalColumn-t.originalColumn)?i:f(e.name,t.name)},t.compareByGeneratedPositionsDeflatedNoLine=function(e,t,n){var i=e.generatedColumn-t.generatedColumn;return 0!==i||n||0!==(i=f(e.source,t.source))||0!==(i=e.originalLine-t.originalLine)||0!==(i=e.originalColumn-t.originalColumn)?i:f(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=f(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:f(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var i=r(n);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var o=i.path.lastIndexOf("/");o>=0&&(i.path=i.path.substring(0,o+1))}t=h(s(i),t)}return l(t)}},8730(e,t,n){"use strict";n.r(t),n.d(t,{css:()=>le,cssCompletionSource:()=>oe,cssLanguage:()=>ae,defineCSSCompletionSource:()=>se});var i=n(365);class r{constructor(e,t,n,i,r,s,o,a,l,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new r(e,[],t,n,n,0,[],0,i?new s(i,i.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,i=65535&e,{parser:r}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),o=r.dynamicPrecedence(i);if(o&&(this.score+=o),0==n)return i<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i<r.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),void this.reduceContext(i,this.reducePos);let a=this.stack.length-3*(n-1)-(262144&e?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from;i<r.minRepeatTerm&&l==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let h=this.reducePos-l;h>=2e3&&!(null===(t=this.p.parser.nodeSet.types[i])||void 0===t?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=h));let c=a?this.stack[a-1]:0,u=this.bufferBase+this.buffer.length-c;if(i<r.minRepeatTerm||131072&e){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,l,e,u+4,!0)}if(262144&e)this.state=this.stack[a];else{let e=this.stack[a-3];this.state=r.getGoto(e,i,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(i,l)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&0==this.buffer[e-4]&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t)return void(this.buffer[e-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&(0!=this.buffer[r-4]||this.buffer[r-1]<0)){let e=!1;for(let t=r;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n,i){if(131072&e)this.pushState(65535&e,this.pos);else if(262144&e)this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4);else{let r=e,{parser:s}=this.p;this.pos=i;let o=s.stateFlag(r,1);!o&&(i>n||t<=s.maxNode)&&(this.reducePos=i),this.pushState(r,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=s.maxNode&&this.buffer.push(t,n,i,4)}}apply(e,t,n,i){65536&e?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&0==e.buffer[t-4]&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new r(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,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 o(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(!(65536&n))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 n=[];for(let i,r=0;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let i=t[e+1];n.some((e,t)=>1&t&&e==i)||n.push(t[e],i)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let i=t[e+1];if(i==this.state)continue;let r=this.split();r.pushState(i,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[e],this.pos),r.reducePos=this.pos,r.score-=200,n.push(r)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(65536&t))return!1;if(!e.validAction(this.state,t)){let n=t>>19,i=65535&t,r=this.stack.length-3*n;if(r<0||e.getGoto(this.stack[r],i,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}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=(i,r)=>{if(!t.includes(i))return t.push(i),e.allActions(i,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let i=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],i,!1)>=0)return n<<19|65536|i}}else{let e=n(t,r+1);if(null!=e)return e}})};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(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new s(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead||(this.emitLookAhead(),this.lookAhead=e,0))}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class s{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class o{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class a{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new a(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(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,0==this.index&&this.maybeNext()}fork(){return new a(this.stack,this.pos,this.index)}}function l(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i<e.length;){let s=0;for(;;){let t=e.charCodeAt(i++),n=!1;if(126==t){s=65535;break}t>=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),s+=r,n)break;s*=46}n?n[r++]=s:n=new t(s)}return n}class h{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const c=new h;class u{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=c,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,i=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!i)return null;let e=this.ranges[--i];r-=n.from-e.to,n=e}for(;t<0?r>n.to:r>=n.to;){if(i==this.ranges.length-1)return null;let e=this.ranges[++i];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t,n,i=this.chunkOff+e;if(i>=0&&i<this.chunk.length)t=this.pos+e,n=this.chunk.charCodeAt(i);else{let i=this.resolveOffset(e,1);if(null==i)return-1;if(t=i,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let e=this.rangeIndex,i=this.range;for(;i.to<=t;)i=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>i.to&&(this.chunk2=this.chunk2.slice(0,i.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=c,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}}class d{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;m(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}d.prototype.contextual=d.prototype.fallback=d.prototype.extend=!1;class f{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?l(e):e}token(e,t){let n=e.pos,i=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(m(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||i++,null==r)break;e.reset(r,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}f.prototype.contextual=d.prototype.fallback=d.prototype.extend=!1;class p{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function m(e,t,n,i,r,s){let o=0,a=1<<i,{dialect:l}=n.p.parser;e:for(;0!=(a&e[o]);){let n=e[o+1];for(let i=o+3;i<n;i+=2)if((e[i+1]&a)>0){let n=e[i];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||b(n,t.token.value,r,s))){t.acceptToken(n);break}}let i=t.next,h=0,c=e[o+2];if(!(t.next<0&&c>h&&65535==e[n+3*c-3])){for(;h<c;){let r=h+c>>1,s=n+r+(r<<1),a=e[s],l=e[s+1]||65536;if(i<a)c=r;else{if(!(i>=l)){o=e[s+2],t.advance();continue e}h=r+1}}break}o=e[n+3*c-1]}}function g(e,t,n){for(let i,r=t;65535!=(i=e[r]);r++)if(i==n)return r-t;return-1}function b(e,t,n,i){let r=g(n,i,t);return r<0||g(n,i,e)<r}const y="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let v=null;function k(e,t,n){let r=e.cursor(i.Qj.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class w{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?k(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?k(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof i.PH){if(o==e){if(o<this.safeFrom)return null;let e=o+s.length;if(e<=this.safeTo){let t=s.prop(i.uY.lookAhead);if(!t||e+t<this.fragment.to)return s}}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}}class x{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new h)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,s=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let i=0;i<r.length;i++){if(!(1<<i&s))continue;let l=r[i],h=this.tokens[i];if((!n||l.fallback)&&((l.contextual||h.start!=e.pos||h.mask!=s||h.context!=o)&&(this.updateCachedToken(h,l,e),h.mask=s,h.context=o),h.lookAhead>h.end+25&&(a=Math.max(h.lookAhead,a)),0!=h.value)){let i=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!l.extend&&(n=h,t>i))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new h,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 h,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:t}=n.p;for(let i=0;i<t.specialized.length;i++)if(t.specialized[i]==e.value){let r=t.specializers[i](this.stream.read(e.start,e.end),n);if(r>=0&&n.p.parser.dialect.allows(r>>1)){1&r?e.extended=r>>1:e.value=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let t=0;t<i;t+=3)if(this.actions[t]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:r}=e,{parser:s}=e.p,{data:o}=s;for(let e=0;e<2;e++)for(let a=s.stateSlot(r,e?2:1);;a+=3){if(65535==o[a]){if(1!=o[a+1]){0==i&&2==o[a+1]&&(i=this.putAction(T(o,a+2),t,n,i));break}a=T(o,a+2)}o[a]==t&&(i=this.putAction(T(o,a+1),t,n,i))}return i}}class O{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new u(t,i),this.tokens=new x(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[r.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>4*e.bufferLength?new w(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<n.length;s++){let o=n[s];for(;;){if(this.tokens.mainToken=null,o.pos>i)r.push(o);else{if(this.advanceStack(o,r,n))continue;{e||(e=[],t=[]),e.push(o);let n=this.tokens.getMainToken(o);t.push(n.value,n.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return y&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw y&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return y&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort((e,t)=>t.score-e.score);r.length>e;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}else if(r.length>1){e:for(let e=0;e<r.length-1;e++){let t=r[e];for(let n=e+1;n<r.length;n++){let i=r[n];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if(!((t.score-i.score||t.buffer.length-i.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(n--,1)}}}r.length>12&&(r.sort((e,t)=>t.score-e.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let e=1;e<r.length;e++)r[e].pos<this.minStackPos&&(this.minStackPos=r[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:s}=this,o=y?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(r);a;){let r=this.parser.nodeSet.types[a.type.id]==a.type?s.getGoto(e.state,a.type.id):-1;if(r>-1&&a.length&&(!t||(a.prop(i.uY.contextHash)||0)==n))return e.useNode(a,r),y&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(a.type.id)})`),!0;if(!(a instanceof i.PH)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof i.PH&&0==a.positions[0]))break;a=l}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),y&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(65535&a)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let i=0;i<l.length;){let a=l[i++],h=l[i++],c=l[i++],u=i==l.length||!n,d=u?e:e.split(),f=this.tokens.mainToken;if(d.apply(a,h,f?f.start:d.pos,c),y&&console.log(o+this.stackID(d)+` (via ${65536&a?`reduce of ${s.getName(65535&a)}`:"shift"} for ${s.getName(h)} @ ${r}${d==e?"":", split"})`),u)return!0;d.pos>r?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return S(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let s=0;s<e.length;s++){let o=e[s],a=t[s<<1],l=t[1+(s<<1)],h=y?this.stackID(o)+" -> ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),y&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,n))continue}let c=o.split(),u=h;for(let e=0;e<10&&c.forceReduce()&&(y&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)y&&(u=this.stackID(c)+" -> ");for(let e of o.recoverByInsert(a))y&&console.log(h+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),y&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),S(o,n)):(!i||i.score<c.score)&&(i=c)}return i}stackToTree(e){return e.close(),i.PH.build({buffer:a.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(v||(v=new WeakMap)).get(e);return t||v.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function S(e,t){for(let n=0;n<t.length;n++){let i=t[n];if(i.pos==e.pos&&i.sameState(e))return void(t[n].score<e.score&&(t[n]=e))}t.push(e)}class C{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class A extends i.iX{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function s(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=i.uY[e]);for(let n=1;n<t.length;){let i=t[n++];if(i>=0)s(i,e,t[n++]);else{let r=t[n+-i];for(let o=-i;o>0;o--)s(t[n++],e,r);n++}}}this.nodeSet=new i.fI(t.map((t,s)=>i.Z6.define({name:s>=this.minRepeatTerm?void 0:t,id:s,props:r[s],top:n.indexOf(s)>-1,error:0==s,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=i.cF;let o=l(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(M),this.states=l(e.states,Uint32Array),this.data=l(e.stateData),this.goto=l(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new d(o,e):e),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 i=new O(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return-1;for(let r=i[t+1];;){let t=i[r++],s=1&t,o=i[r++];if(s&&n)return o;for(let n=r+(t>>1);r<n;r++)if(i[r]==e)return o;if(s)return-1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let r,s=this.stateSlot(e,i?2:1);;s+=3){if(65535==(r=n[s])){if(1!=n[s+1]){if(2==n[s+1])return T(n,s+2);break}r=n[s=T(n,s+2)]}if(r==t||0==r)return T(n,s+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==i;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=T(this.data,n+2)}i=t(T(this.data,n+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=T(this.data,n+2)}if(!(1&this.data[n+2])){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(A.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(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let s=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=M(s),s})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(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 null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let e=t.indexOf(i);e>=0&&(n[e]=!0)}let i=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n,r=this.dialects[t[e]];65535!=(n=this.data[r++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[n]=1;return new C(e,n,i)}static deserialize(e){return new A(e)}}function T(e,t){return e[t]|e[t+1]<<16}function M(e){if(e.external){let t=e.extend?1:0;return(n,i)=>e.external(n,i)<<1|t}return e.get}var P=n(3720);const z=[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];function D(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function L(e){return e>=48&&e<=57}function R(e){return L(e)||e>=97&&e<=102||e>=65&&e<=70}const E=(e,t,n)=>(i,r)=>{for(let s=!1,o=0,a=0;;a++){let{next:l}=i;if(D(l)||45==l||95==l||s&&L(l))!s&&(45!=l||a>0)&&(s=!0),o===a&&45==l&&o++,i.advance();else{if(92!=l||10==i.peek(1)){s&&i.acceptToken(2==o&&r.canShift(2)?t:40==l?n:e);break}if(i.advance(),R(i.next)){do{i.advance()}while(R(i.next));32==i.next&&i.advance()}else i.next>-1&&i.advance();s=!0}}},B=new p(E(136,2,137),{contextual:!0}),j=new p(E(138,3,4),{contextual:!0}),N=new p(e=>{if(z.includes(e.peek(-1))){let{next:t}=e;(D(t)||95==t||35==t||46==t||42==t||91==t||58==t&&D(e.peek(1))||45==t||38==t)&&e.acceptToken(135)}}),I=new p(e=>{if(!z.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),D(t)){do{e.advance()}while(D(e.next)||L(e.next));e.acceptToken(1)}}}),$=(0,P.pn)({"AtKeyword import charset namespace keyframes media supports font-feature-values":P._A.definitionKeyword,"from to selector scope MatchFlag":P._A.keyword,NamespaceName:P._A.namespace,KeyframeName:P._A.labelName,KeyframeRangeName:P._A.operatorKeyword,TagName:P._A.tagName,ClassName:P._A.className,PseudoClassName:P._A.constant(P._A.className),IdName:P._A.labelName,"FeatureName PropertyName":P._A.propertyName,AttributeName:P._A.attributeName,NumberLiteral:P._A.number,KeywordQuery:P._A.keyword,UnaryQueryOp:P._A.operatorKeyword,"CallTag ValueName FontName":P._A.atom,VariableName:P._A.variableName,Callee:P._A.operatorKeyword,Unit:P._A.unit,"UniversalSelector NestingSelector":P._A.definitionOperator,"MatchOp CompareOp":P._A.compareOperator,"ChildOp SiblingOp, LogicOp":P._A.logicOperator,BinOp:P._A.arithmeticOperator,Important:P._A.modifier,Comment:P._A.blockComment,ColorLiteral:P._A.color,"ParenthesizedContent StringLiteral":P._A.string,":":P._A.punctuation,"PseudoOp #":P._A.derefOperator,"; , |":P._A.separator,"( )":P._A.paren,"[ ]":P._A.squareBracket,"{ }":P._A.brace}),Q={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},F={__proto__:null,or:104,and:104,not:112,only:112,layer:186},W={__proto__:null,selector:118,layer:182},_={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},V={__proto__:null,to:223},q=A.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[$],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[N,I,B,j,1,2,3,4,new f("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>Q[e]||-1},{term:138,get:e=>F[e]||-1},{term:4,get:e=>W[e]||-1},{term:28,get:e=>_[e]||-1},{term:136,get:e=>V[e]||-1}],tokenPrec:2256});var H=n(5874);let X=null;function U(){if(!X&&"object"==typeof document&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let i in e)"cssText"!=i&&"cssFloat"!=i&&"string"==typeof e[i]&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())),n.has(i)||(t.push(i),n.add(i)));X=t.sort().map(e=>({type:"property",label:e,apply:e+": "}))}return X||[]}const Y=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),K=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),G=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Z=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),J=/^(\w[\w-]*|-\w[\w-]*|)$/,ee=/^-(-[\w-]*)?$/,te=new i.RY,ne=["Declaration"];function ie(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function re(e,t,n){if(t.to-t.from>4096){let r=te.get(t);if(r)return r;let s=[],o=new Set,a=t.cursor(i.Qj.IncludeAnonymous);if(a.firstChild())do{for(let t of re(e,a.node,n))o.has(t.label)||(o.add(t.label),s.push(t))}while(a.nextSibling());return te.set(t,s),s}{let i=[],r=new Set;return t.cursor().iterate(t=>{var s;if(n(t)&&t.matchContext(ne)&&":"==(null===(s=t.node.nextSibling)||void 0===s?void 0:s.name)){let n=e.sliceString(t.from,t.to);r.has(n)||(r.add(n),i.push({label:n,type:"variable"}))}}),i}}const se=e=>t=>{let{state:n,pos:i}=t,r=(0,H.mv)(n).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&"-"==n.doc.sliceString(r.from,r.to);if("PropertyName"==r.name||(s||"TagName"==r.name)&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:U(),validFor:J};if("ValueName"==r.name)return{from:r.from,options:K,validFor:J};if("PseudoClassName"==r.name)return{from:r.from,options:Y,validFor:J};if(e(r)||(t.explicit||s)&&function(e,t){var n;if(("("==e.name||e.type.isError)&&(e=e.parent||e),"ArgList"!=e.name)return!1;let i=null===(n=e.parent)||void 0===n?void 0:n.firstChild;return"Callee"==(null==i?void 0:i.name)&&"var"==t.sliceString(i.from,i.to)}(r,n.doc))return{from:e(r)||s?r.from:i,options:re(n.doc,ie(r),e),validFor:ee};if("TagName"==r.name){for(let{parent:e}=r;e;e=e.parent)if("Block"==e.name)return{from:r.from,options:U(),validFor:J};return{from:r.from,options:G,validFor:J}}if("AtKeyword"==r.name)return{from:r.from,options:Z,validFor:J};if(!t.explicit)return null;let o=r.resolve(i),a=o.childBefore(i);return a&&":"==a.name&&"PseudoClassSelector"==o.name?{from:i,options:Y,validFor:J}:a&&":"==a.name&&"Declaration"==o.name||"ArgList"==o.name?{from:i,options:K,validFor:J}:"Block"==o.name||"Styles"==o.name?{from:i,options:U(),validFor:J}:null},oe=se(e=>"VariableName"==e.name),ae=H.bj.define({name:"css",parser:q.configure({props:[H.Oh.add({Declaration:(0,H.mz)()}),H.b_.add({"Block KeyframeList":H.yd})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function le(){return new H.Yy(ae,ae.data.of({autocomplete:oe}))}},5874(e,t,n){"use strict";n.d(t,{EI:()=>M,KB:()=>z,Lv:()=>he,Oh:()=>D,SG:()=>Te,WD:()=>I,Xt:()=>A,Yy:()=>S,Zt:()=>ye,_v:()=>P,b_:()=>Q,bj:()=>f,cr:()=>ue,f7:()=>ee,jU:()=>De,mv:()=>p,mz:()=>N,tp:()=>T,y9:()=>me,yd:()=>F});var i,r=n(365),s=n(1638),o=n(6898),a=n(3720),l=n(7417);const h=new r.uY;const c=new r.uY;class u{constructor(e,t,n=[],i=""){this.data=e,this.name=i,s.$t.prototype.hasOwnProperty("tree")||Object.defineProperty(s.$t.prototype,"tree",{get(){return p(this)}}),this.parser=t,this.extension=[O.of(this),s.$t.languageData.of((e,t,n)=>{let i=d(e,t,n),r=i.type.prop(h);if(!r)return[];let s=e.facet(r),o=i.type.prop(c);if(o){let r=i.resolve(t-i.from,n);for(let t of o)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(s)}}return s})].concat(n)}isActiveAt(e,t,n=-1){return d(e,t,n).type.prop(h)==this.data}findRegions(e){let t=e.facet(O);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],i=(e,t)=>{if(e.prop(h)==this.data)return void n.push({from:t,to:t+e.length});let s=e.prop(r.uY.mounted);if(s){if(s.tree.prop(h)==this.data){if(s.overlay)for(let e of s.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(s.overlay){let e=n.length;if(i(s.tree,s.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let s=e.children[n];s instanceof r.PH&&i(s,e.positions[n]+t)}};return i(p(e),0),n}get allowsNesting(){return!0}}function d(e,t,n){let i=e.facet(O),s=p(e).topNode;if(!i||i.allowsNesting)for(let e=s;e;e=e.enter(t,n,r.Qj.ExcludeBuffers|r.Qj.EnterBracketed))e.type.isTop&&(s=e);return s}u.setState=s.Pe.define();class f extends u{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=(n=e.languageData,s.sj.define({combine:n?e=>e.concat(n):void 0}));var n;return new f(t,e.parser.configure({props:[h.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new f(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function p(e){let t=e.field(u.state,!1);return t?t.tree:r.PH.empty}class m{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<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let g=null;class b{constructor(e,t,n=[],i,r,s,o,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=s,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new b(e,t,[],r.PH.empty,0,n,[],null)}startParse(){return this.parser.startParse(new m(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=r.PH.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(r.rr.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||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(r.rr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=g;g=this;try{return e()}finally{g=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=y(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,i,r)=>t.push({fromA:e,toA:n,fromB:i,toB:r})),n=r.rr.applyChanges(n,t),i=r.PH.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&a.push({from:n,to:i})}}}return new b(this.parser,t,n,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=y(this.fragments,n,i),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(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 r.iX{createParse(t,n,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let t=g;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new r.PH(r.Z6.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return g}}function y(e,t,n){return r.rr.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class v{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 v(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=b.create(e.facet(O).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new v(n)}}u.state=s.sU.define({create:v.init,update(e,t){for(let e of t.effects)if(e.is(u.setState))return e.value;return t.startState.facet(O)!=t.state.facet(O)?v.init(t.state):e.apply(t)}});let k=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(k=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const w="undefined"!=typeof navigator&&(null===(i=navigator.scheduling)||void 0===i?void 0:i.isInputPending)?()=>navigator.scheduling.isInputPending():null,x=o.Z9.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(u.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(u.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=k(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,r=n.field(u.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!w?Math.max(25,e.timeRemaining()-5):1e9),o=r.context.treeLen<i&&n.doc.length>i+1e3,a=r.context.work(()=>w&&w()||Date.now()>s,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:u.setState.of(new v(r.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,o.c_)(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),O=s.sj.define({combine:e=>e.length?e[0]:null,enables:e=>[u.state,x,o.Lz.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class S{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const C=s.sj.define(),A=s.sj.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function T(e){let t=e.facet(A);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function M(e,t){let n="",i=e.tabSize,r=e.facet(A)[0];if("\t"==r){for(;t>=i;)n+="\t",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function P(e,t){e instanceof s.$t&&(e=new z(e));for(let n of e.state.facet(C)){let i=n(e,t);if(void 0!==i)return i}let n=p(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),r=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let e=[];for(let t=r;t&&!(t.from<i.node.from||t.to>i.node.to||t.from==i.node.from&&t.type==i.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return L(i,e,n)}(e,n,t):null}class z{constructor(e,t={}){this.state=e,this.options=t,this.unit=T(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return null!=i&&i>=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.countColumn(n,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(r+=s-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return(0,s.y$)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const D=new r.uY;function L(e,t,n){for(let i=e;i;i=i.next){let e=R(i.node);if(e)return e(B.create(t,n,i))}return 0}function R(e){let t=e.type.prop(D);if(t)return t;let n,i=e.firstChild;if(i&&(n=i.type.prop(r.uY.closedBy))){let t=e.lastChild,i=t&&n.indexOf(t.name)>-1;return e=>function(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,a=i&&s.slice(o,o+i.length)==i||r==e.pos+o,l=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=null==r||r<=s.from?s.to:Math.min(s.to,r);for(let e=n.to;;){let r=t.childAfter(e);if(!r||r==i)return null;if(!r.type.isSkipped){if(r.from>=o)return null;let e=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+e}}e=r.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}(e,!0,1,void 0,i&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?E:null}function E(){return 0}class B extends z{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 B(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(j(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return L(this.context.next,this.base,this.pos)}}function j(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function N({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}function I(){return s.$t.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let s=n.sliceString(r.from,i);if(!t.some(e=>e.test(s)))return e;let{state:o}=e,a=-1,l=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=P(o,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=M(o,n);i!=r&&l.push({from:t.from,to:t.from+i.length,insert:r})}return l.length?[e,{changes:l,sequential:!0}]:e})}const $=s.sj.define(),Q=new r.uY;function F(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function W(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function _(e,t,n){for(let i of e.facet($)){let r=i(e,t,n);if(r)return r}return function(e,t,n){let i=p(e);if(i.length<n)return null;let r=null;for(let s=i.resolveStack(n,1);s;s=s.next){let o=s.node;if(o.to<=n||o.from>n)continue;if(r&&o.from<t)break;let a=o.type.prop(Q);if(a&&(o.to<i.length-50||i.length==e.doc.length||!W(o))){let i=a(o,e);i&&i.from<=n&&i.from>=t&&i.to>n&&(r=i)}}return r}(e,t,n)}function V(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}const q=s.Pe.define({map:V}),H=s.Pe.define({map:V});function X(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}const U=s.sU.define({create:()=>o.NZ.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=Y(e,t,n)),e=e.map(t.changes);for(let n of t.effects)if(n.is(q)&&!G(e,n.value.from,n.value.to)){let{preparePlaceholder:i}=t.state.facet(ne),r=i?o.NZ.replace({widget:new oe(i(t.state,n.value))}):se;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(H)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=Y(e,t.selection.main.head)),e},provide:e=>o.Lz.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let i=e[n++],r=e[n++];if("number"!=typeof i||"number"!=typeof r)throw new RangeError("Invalid JSON for fold state");t.push(se.range(i,r))}return o.NZ.set(t,!0)}});function Y(e,t,n=t){let i=!1;return e.between(t,n,(e,r)=>{e<n&&r>t&&(i=!0)}),i?e.update({filterFrom:t,filterTo:n,filter:(e,i)=>e>=n||i<=t}):e}function K(e,t,n){var i;let r=null;return null===(i=e.field(U,!1))||void 0===i||i.between(t,n,(e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})}),r}function G(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}function Z(e,t){return e.field(U,!1)?t:t.concat(s.Pe.appendConfig.of(ie()))}function J(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return o.Lz.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const ee=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of X(e)){let n=_(e.state,t.from,t.to);if(n)return e.dispatch({effects:Z(e.state,[q.of(n),J(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(U,!1))return!1;let t=[];for(let n of X(e)){let i=K(e.state,n.from,n.to);i&&t.push(H.of(i),J(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let i=0;i<t.doc.length;){let r=e.lineBlockAt(i),s=_(t,r.from,r.to);s&&n.push(q.of(s)),i=(s?e.lineBlockAt(s.to):r).to+1}return n.length&&e.dispatch({effects:Z(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(U,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(H.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],te={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ne=s.sj.define({combine:e=>(0,s.QR)(e,te)});function ie(e){let t=[U,ce];return e&&t.push(ne.of(e)),t}function re(e,t){let{state:n}=e,i=n.facet(ne),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=K(e.state,n.from,n.to);i&&e.dispatch({effects:H.of(i)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,r,t);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const se=o.NZ.replace({widget:new class extends o.xO{toDOM(e){return re(e,null)}}});class oe extends o.xO{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return re(e,this.value)}}const ae={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class le extends o.wJ{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 he(e={}){let t={...ae,...e},n=new le(t,!0),i=new le(t,!1),r=o.Z9.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(O)!=e.state.facet(O)||e.startState.field(U,!1)!=e.state.field(U,!1)||p(e.startState)!=p(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new s.vB;for(let r of e.viewportLineBlocks){let s=K(e.state,r.from,r.to)?i:_(e.state,r.from,r.to)?n:null;s&&t.add(r.from,r.from,s)}return t.finish()}}),{domEventHandlers:a}=t;return[r,(0,o.cU)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||s.om.empty},initialSpacer:()=>new le(t,!1),domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let i=K(e.state,t.from,t.to);if(i)return e.dispatch({effects:H.of(i)}),!0;let r=_(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:q.of(r)}),!0)}}}),ie()]}const ce=o.Lz.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 ue{constructor(e,t){let n;function i(e){let t=l.G.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?i(t.all):void 0,s=t.scope;this.scope=s instanceof u?e=>e.prop(h)==s.data:s?e=>e==s:void 0,this.style=(0,a.az)(e.map(e=>({tag:e.tag,class:e.class||i(Object.assign({},e,{tag:null}))})),{all:r}).style,this.module=n?new l.G(n):null,this.themeType=t.themeType}static define(e,t){return new ue(e,t||{})}}const de=s.sj.define(),fe=s.sj.define({combine:e=>e.length?[e[0]]:null});function pe(e){let t=e.facet(de);return t.length?t:e.facet(fe)}function me(e,t){let n,i=[be];return e instanceof ue&&(e.module&&i.push(o.Lz.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?i.push(fe.of(e)):n?i.push(de.computeN([o.Lz.darkTheme],t=>t.facet(o.Lz.darkTheme)==("dark"==n)?[e]:[])):i.push(de.of(e)),i}class ge{constructor(e){this.markCache=Object.create(null),this.tree=p(e.state),this.decorations=this.buildDeco(e,pe(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=p(e.state),n=pe(e.state),i=n!=pe(e.startState),{viewport:r}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&s>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return o.NZ.none;let n=new s.vB;for(let{from:i,to:r}of e.visibleRanges)(0,a.DM)(this.tree,t,(e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=o.NZ.mark({class:i})))},i,r);return n.finish()}}const be=s.Nb.high(o.Z9.fromClass(ge,{decorations:e=>e.decorations})),ye=ue.define([{tag:a._A.meta,color:"#404740"},{tag:a._A.link,textDecoration:"underline"},{tag:a._A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a._A.emphasis,fontStyle:"italic"},{tag:a._A.strong,fontWeight:"bold"},{tag:a._A.strikethrough,textDecoration:"line-through"},{tag:a._A.keyword,color:"#708"},{tag:[a._A.atom,a._A.bool,a._A.url,a._A.contentSeparator,a._A.labelName],color:"#219"},{tag:[a._A.literal,a._A.inserted],color:"#164"},{tag:[a._A.string,a._A.deleted],color:"#a11"},{tag:[a._A.regexp,a._A.escape,a._A.special(a._A.string)],color:"#e40"},{tag:a._A.definition(a._A.variableName),color:"#00f"},{tag:a._A.local(a._A.variableName),color:"#30a"},{tag:[a._A.typeName,a._A.namespace],color:"#085"},{tag:a._A.className,color:"#167"},{tag:[a._A.special(a._A.variableName),a._A.macroName],color:"#256"},{tag:a._A.definition(a._A.propertyName),color:"#00c"},{tag:a._A.comment,color:"#940"},{tag:a._A.invalid,color:"#f00"}]),ve=o.Lz.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ke="()[]{}",we=s.sj.define({combine:e=>(0,s.QR)(e,{afterCursor:!0,brackets:ke,maxScanDistance:1e4,renderMatch:Se})}),xe=o.NZ.mark({class:"cm-matchingBracket"}),Oe=o.NZ.mark({class:"cm-nonmatchingBracket"});function Se(e){let t=[],n=e.matched?xe:Oe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function Ce(e){let t=[],n=e.facet(we);for(let i of e.selection.ranges){if(!i.empty)continue;let r=De(e,i.head,-1,n)||i.head>0&&De(e,i.head-1,1,n)||n.afterCursor&&(De(e,i.head,1,n)||i.head<e.doc.length&&De(e,i.head+1,-1,n));r&&(t=t.concat(n.renderMatch(r,e)))}return o.NZ.set(t,!0)}const Ae=[o.Z9.fromClass(class{constructor(e){this.paused=!1,this.decorations=Ce(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=Ce(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),ve];function Te(e={}){return[we.of(e),Ae]}const Me=new r.uY;function Pe(e,t,n){let i=e.prop(t<0?r.uY.openedBy:r.uY.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function ze(e){let t=e.type.prop(Me);return t?t(e.node):e}function De(e,t,n,i={}){let r=i.maxScanDistance||1e4,s=i.brackets||ke,o=p(e),a=o.resolveInner(t,n);for(let e=a;e;e=e.parent){let i=Pe(e.type,n,s);if(i&&e.from<e.to){let r=ze(e);if(r&&(n>0?t>=r.from&&t<r.to:t>r.from&&t<=r.to))return Le(0,0,n,e,r,i,s)}}return function(e,t,n,i,r,s,o){if(n<0?!t:t==e.doc.length)return null;let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=o.indexOf(a);if(l<0||l%2==0!=n>0)return null;let h={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),u=0;for(let e=0;!c.next().done&&e<=s;){let s=c.value;n<0&&(e+=s.length);let a=t+e*n;for(let e=n>0?0:s.length-1,t=n>0?s.length:-1;e!=t;e+=n){let t=o.indexOf(s[e]);if(!(t<0||i.resolveInner(a+e,1).type!=r))if(t%2==0==n>0)u++;else{if(1==u)return{start:h,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};u--}}n>0&&(e+=s.length)}return c.done?{start:h,matched:!1}:null}(e,t,n,o,a.type,r,s)}function Le(e,t,n,i,r,s,o){let a=i.parent,l={from:r.from,to:r.to},h=0,c=null==a?void 0:a.cursor();if(c&&(n<0?c.childBefore(i.from):c.childAfter(i.to)))do{if(n<0?c.to<=i.from:c.from>=i.to){if(0==h&&s.indexOf(c.type.name)>-1&&c.from<c.to){let e=ze(c);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(Pe(c.type,n,o))h++;else if(Pe(c.type,-n,o)){if(0==h){let e=ze(c);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}h--}}}while(n<0?c.prevSibling():c.nextSibling());return{start:l,matched:!1}}const Re=Object.create(null),Ee=[r.Z6.none],Be=[],je=Object.create(null),Ne=Object.create(null);for(let[e,t]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"]])Ne[e]=$e(Re,t);function Ie(e,t){Be.indexOf(e)>-1||(Be.push(e),console.warn(t))}function $e(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||a._A[n];i?"function"==typeof i?t.length?t=t.map(i):Ie(n,`Modifier ${n} used at start of tag`):t.length?Ie(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:Ie(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),s=i+" "+n.map(e=>e.id),o=je[s];if(o)return o.id;let l=je[s]=r.Z6.define({id:Ee.length,name:i,props:[(0,a.pn)({[i]:n})]});return Ee.push(l),l.id}o.OP.RTL,o.OP.LTR},1419(e,t,n){"use strict";n.r(t),n.d(t,{closeLintPanel:()=>w,diagnosticCount:()=>g,forEachDiagnostic:()=>K,forceLinting:()=>P,lintGutter:()=>Y,lintKeymap:()=>S,linter:()=>M,nextDiagnostic:()=>x,openLintPanel:()=>k,previousDiagnostic:()=>O,setDiagnostics:()=>u,setDiagnosticsEffect:()=>d});var i=n(6898),r=n(1638),s=n(3748);class o{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class a{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let s=n.facet(A).markerFilter;s&&(e=s(e,n));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),h=new r.vB,c=[],u=0,d=n.doc.iter(),f=0,p=n.doc.length;for(let e=0;;){let t,n,r=e==o.length?null:o[e];if(!r&&!c.length)break;if(c.length)t=u,n=c.reduce((e,t)=>Math.min(e,t.to),r&&r.from>t?r.from:1e8);else{if(t=r.from,t>p)break;n=r.to,c.push(r),e++}for(;e<o.length;){let i=o[e];if(i.from!=t||!(i.to>i.from||i.to==t)){n=Math.min(i.from,n);break}c.push(i),e++,n=Math.min(i.to,n)}n=Math.min(n,p);let s=!1;if(c.some(e=>e.from==t&&(e.to==n||n==p))&&(s=t==n,!s&&n-t<10)){let e=t-(f+d.value.length);e>0&&(d.next(e),f=t);for(let e=t;;){if(e>=n){s=!0;break}if(!d.lineBreak&&f+d.value.length>e)break;e=f+d.value.length,f+=d.value.length,d.next()}}let a=$(c);if(s)h.add(t,t,i.NZ.widget({widget:new L(a),diagnostics:c.slice()}));else{let e=c.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");h.add(t,n,i.NZ.mark({class:"cm-lintRange cm-lintRange-"+a+e,diagnostics:c.slice(),inclusiveEnd:c.some(e=>e.to>n)}))}if(u=n,u==p)break;for(let e=0;e<c.length;e++)c[e].to<=u&&c.splice(e--,1)}let m=h.finish();return new a(m,t,l(m))}}function l(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!(t&&r.diagnostics.indexOf(t)<0))if(i){if(r.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new o(i.from,n,i.diagnostic)}else i=new o(e,n,t||r.diagnostics[0])}),i}function h(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(A).hideOn(e,n,i);if(null!=r)return r;let s=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(d))&&!e.changes.touchesRange(s.from,Math.max(s.to,i)))}function c(e,t){return e.field(m,!1)?t:t.concat(r.Pe.appendConfig.of(X))}function u(e,t){return{effects:c(e,[d.of(t)])}}const d=r.Pe.define(),f=r.Pe.define(),p=r.Pe.define(),m=r.sU.define({create:()=>new a(i.NZ.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=l(n,e.selected.diagnostic,r)||l(n,null,r)}!n.size&&r&&t.state.facet(A).autoPanel&&(r=null),e=new a(n,r,i)}for(let n of t.effects)if(n.is(d)){let i=t.state.facet(A).autoPanel?n.value.length?E.open:null:e.panel;e=a.init(n.value,i,t.state)}else n.is(f)?e=new a(e.diagnostics,n.value?E.open:null,e.selected):n.is(p)&&(e=new a(e.diagnostics,e.panel,n.value));return e},provide:e=>[i.S7.from(e,e=>e.panel),i.Lz.decorations.from(e,e=>e.diagnostics)]});function g(e){let t=e.field(m,!1);return t?t.diagnostics.size:0}const b=i.NZ.mark({class:"cm-lintRange cm-lintRange-active"});function y(e,t,n){let i,{diagnostics:r}=e.state.field(m),s=-1,o=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(e,r,{spec:a})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=a.diagnostics,s=e,o=r,!1});let a=e.state.facet(A).tooltipFilter;return i&&a&&(i=a(i,e.state)),i?{pos:s,end:o,above:e.state.doc.lineAt(s).to<o,create:()=>({dom:v(e,i)})}:null}function v(e,t){return(0,s.A)("ul",{class:"cm-tooltip-lint"},t.map(t=>D(e,t,!1)))}const k=e=>{let t=e.state.field(m,!1);t&&t.panel||e.dispatch({effects:c(e.state,[f.of(!0)])});let n=(0,i.ld)(e,E.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},w=e=>{let t=e.state.field(m,!1);return!(!t||!t.panel||(e.dispatch({effects:f.of(!1)}),0))},x=e=>{let t=e.state.field(m,!1);if(!t)return!1;let n=e.state.selection.main,i=l(t.diagnostics,null,n.to+1);return!(!i&&(i=l(t.diagnostics,null,0),!i||i.from==n.from&&i.to==n.to)||(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),0))},O=e=>{let{state:t}=e,n=t.field(m,!1);if(!n)return!1;let i,r,s,o,a=t.selection.main;return n.diagnostics.between(0,t.doc.length,(e,t)=>{t<a.to&&(null==i||i<e)&&(i=e,r=t),(null==s||e>s)&&(s=e,o=t)}),null!=s&&(null!=i||s!=a.from)&&(e.dispatch({selection:{anchor:null!=i?i:s,head:null!=r?r:o},scrollIntoView:!0}),!0)},S=[{key:"Mod-Shift-m",run:k,preventDefault:!0},{key:"F8",run:x}],C=i.Z9.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(A);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(A);t.length&&function(e,t,n){let i=[],r=-1;for(let s of e)s.then(n=>{i.push(n),clearTimeout(r),i.length==e.length?t(i):r=setTimeout(()=>t(i),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(u(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{(0,i.c_)(this.view.state,e)})}}update(e){let t=e.state.facet(A);(e.docChanged||t!=e.startState.facet(A)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),A=r.sj.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...(0,r.QR)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:T,tooltipFilter:T,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,i,r)=>e(n,i,r)||t(n,i,r):e:t,autoPanel:(e,t)=>e||t})})});function T(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function M(e,t={}){return[A.of({source:e,config:t}),C,X]}function P(e){let t=e.plugin(C);t&&t.force()}function z(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some(e=>e.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function D(e,t,n){var i;let r=n?z(t.actions):[];return(0,s.A)("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},(0,s.A)("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(i=t.actions)||void 0===i?void 0:i.map((n,i)=>{let o=!1,a=i=>{if(i.preventDefault(),o)return;o=!0;let r=l(e.state.field(m).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:h}=n,c=r[i]?h.indexOf(r[i]):-1,u=c<0?h:[h.slice(0,c),(0,s.A)("u",h.slice(c,c+1)),h.slice(c+1)],d=n.markClass?" "+n.markClass:"";return(0,s.A)("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${r[i]})"`}.`},u)}),t.source&&(0,s.A)("div",{class:"cm-diagnosticSource"},t.source))}class L extends i.xO{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return(0,s.A)("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class R{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=D(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class E{constructor(e){this.view=e,this.items=[],this.list=(0,s.A)("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(27==t.keyCode)w(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],i=z(n.actions);for(let r=0;r<i.length;r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=l(this.view.state.field(m).diagnostics,n);t&&n.actions[r].apply(e,t.from,t.to)}}}t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=(0,s.A)("div",{class:"cm-panel-lint"},this.list,(0,s.A)("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>w(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(m).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(m),n=0,i=!1,r=null,s=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:a})=>{for(let e of a.diagnostics){if(s.has(e))continue;s.add(e);let o,a=-1;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){a=t;break}a<0?(o=new R(this.view,e),this.items.splice(n,0,o),i=!0):(o=this.items[a],a>n&&(this.items.splice(n,a-n),i=!0)),t&&o.diagnostic==t.diagnostic?o.dom.hasAttribute("aria-selected")||(o.dom.setAttribute("aria-selected","true"),r=o):o.dom.hasAttribute("aria-selected")&&o.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new R(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.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=l(this.view.state.field(m).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:p.of(t)})}static open(e){return new E(e)}}function B(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function j(e){return B(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const N=i.Lz.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:j("#d11")},".cm-lintRange-warning":{backgroundImage:j("orange")},".cm-lintRange-info":{backgroundImage:j("#999")},".cm-lintRange-hint":{backgroundImage:j("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function I(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function $(e){let t="hint",n=1;for(let i of e){let e=I(i.severity);e>n&&(n=e,t=i.severity)}return t}class Q extends i.wJ{constructor(e){super(),this.diagnostics=e,this.severity=$(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,i=e.state.facet(U).tooltipFilter;return i&&(n=i(n,e.state)),n.length&&(t.onmouseover=()=>function(e,t,n){function i(){let i=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(i.from)&&e.dispatch({effects:V.of({pos:i.from,above:!1,clip:!1,create:()=>({dom:v(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=i=>{let r=t.getBoundingClientRect();if(!(i.clientX>r.left-10&&i.clientX<r.right+10&&i.clientY>r.top-10&&i.clientY<r.bottom+10)){for(let e=i.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),e.state.field(q)&&e.dispatch({effects:V.of(null)})}};window.addEventListener("mousemove",n)}(e,t)}let{hoverTime:r}=e.state.facet(U),s=setTimeout(i,r);t.onmouseout=()=>{clearTimeout(s),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(s),s=setTimeout(i,r)}}(e,t,n)),t}}function F(e,t){let n=Object.create(null);for(let i of t){let t=e.lineAt(i.from);(n[t.from]||(n[t.from]=[])).push(i)}let i=[];for(let e in n)i.push(new Q(n[e]).range(+e));return r.om.of(i,!0)}const W=(0,i.cU)({class:"cm-gutter-lint",markers:e=>e.state.field(_),widgetMarker:(e,t,n)=>{let i=[];return e.state.field(_).between(n.from,n.to,(e,t,r)=>{e>n.from&&e<n.to&&i.push(...r.diagnostics)}),i.length?new Q(i):null}}),_=r.sU.define({create:()=>r.om.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(U).markerFilter;for(let i of t.effects)if(i.is(d)){let r=i.value;n&&(r=n(r||[],t.state)),e=F(t.state.doc,r.slice(0))}return e}}),V=r.Pe.define(),q=r.sU.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=h(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(V)?t.value:e,e)),provide:e=>i.DK.from(e)}),H=i.Lz.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:B('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:B('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:B('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),X=[m,i.Lz.decorations.compute([m],e=>{let{selected:t,panel:n}=e.field(m);return t&&n&&t.from!=t.to?i.NZ.set([b.range(t.from,t.to)]):i.NZ.none}),(0,i.Ux)(y,{hideOn:h}),N],U=r.sj.define({combine:e=>(0,r.QR)(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function Y(e={}){return[U.of(e),_,W,H,q]}function K(e,t){let n=e.field(m,!1);if(n&&n.diagnostics.size){let e=[],i=[],s=-1;for(let o=r.om.iter([n.diagnostics]);;o.next()){for(let n=0;n<e.length;n++)(!o.value||o.value.spec.diagnostics.indexOf(e[n])<0)&&(t(e[n],i[n],s),e.splice(n,1),i.splice(n--,1));if(!o.value)break;for(let t of o.value.spec.diagnostics)e.indexOf(t)<0&&(e.push(t),i.push(o.from));s=o.to}}}},1638(e,t,n){"use strict";n.d(t,{YH:()=>ue,UJ:()=>de,Gu:()=>z,VR:()=>D,Je:()=>xe,xx:()=>J,OF:()=>$,$t:()=>Ce,sj:()=>W,N1:()=>x,iR:()=>P,Nb:()=>G,Q6:()=>Pe,om:()=>Le,vB:()=>Re,FB:()=>Te,yn:()=>I,Pe:()=>pe,DA:()=>fe,sU:()=>Y,EY:()=>p,ZX:()=>me,vS:()=>C,Fh:()=>T,QR:()=>Ae,y$:()=>Ve,zK:()=>S,kn:()=>qe,MK:()=>A});let i=[],r=[];function s(e){if(e<768)return!1;for(let t=0,n=i.length;;){let s=t+n>>1;if(e<i[s])n=s;else{if(!(e>=r[s]))return!0;t=s+1}if(t==n)return!1}}function o(e){return e>=127462&&e<=127487}function a(e,t,n=!0,i=!0){return(n?l:h)(e,t,i)}function l(e,t,n){if(t==e.length)return t;t&&u(e.charCodeAt(t))&&d(e.charCodeAt(t-1))&&t--;let i=c(e,t);for(t+=f(i);t<e.length;){let r=c(e,t);if(8205==i||8205==r||n&&s(r))t+=f(r),i=r;else{if(!o(r))break;{let n=0,i=t-2;for(;i>=0&&o(c(e,i));)n++,i-=2;if(n%2==0)break;t+=2}}}return t}function h(e,t,n){for(;t>0;){let i=l(e,t-2,n);if(i<t)return i;t--}return 0}function c(e,t){let n=e.charCodeAt(t);if(!d(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return u(i)?i-56320+(n-55296<<10)+65536:n}function u(e){return e>=56320&&e<57344}function d(e){return e>=55296&&e<56320}function f(e){return e<65536?1:2}(()=>{let e="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 t=0,n=0;t<e.length;t++)(t%2?r:i).push(n+=e[t])})();class p{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]=O(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),g.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=O(this,e,t);let n=[];return this.decompose(e,t,n,0),g.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),i=new v(this),r=new v(e);for(let e=t,s=t;;){if(i.next(e),r.next(e),e=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(s+=i.value.length,i.done||s>=n)return!0}}iter(e=1){return new v(this,e)}iterRange(e,t=this.length){return new k(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new w(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new m(e):g.from(m.split(e,[])):p.empty}}class m extends p{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let s=this.text[r],o=i+s.length;if((t?n:o)>=e)return new x(i,o,n,s);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new m(y(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=b(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new m(t,e.length+r.length));else{let e=t.length>>1;n.push(new m(t.slice(0,e)),new m(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof m))return super.replace(e,t,n);[e,t]=O(this,e,t);let i=b(this.text,b(n.text,y(this.text,0,e)),t),r=this.length+n.length-(t-e);return i.length<=32?new m(i,r):g.from(m.split(i,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=O(this,e,t);let i="";for(let r=0,s=0;r<=t&&s<this.text.length;s++){let o=this.text[s],a=r+o.length;r>e&&s&&(i+=n),e<a&&t>r&&(i+=o.slice(Math.max(0,e-r),t-r)),r=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new m(n,i)),n=[],i=-1);return i>-1&&t.push(new m(n,i)),t}}class g extends p{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,i){for(let r=0;;r++){let s=this.children[r],o=i+s.length,a=n+s.lines-1;if((t?a:o)>=e)return s.lineInner(e,t,n,i);i=o+1,n=a+1}}decompose(e,t,n,i){for(let r=0,s=0;s<=t&&r<this.children.length;r++){let o=this.children[r],a=s+o.length;if(e<=a&&t>=s){let r=i&((s<=e?1:0)|(a>=t?2:0));s>=e&&a<=t&&!r?n.push(o):o.decompose(e-s,t-s,n,r)}s=a+1}}replace(e,t,n){if([e,t]=O(this,e,t),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let s=this.children[i],o=r+s.length;if(e>=r&&t<=o){let a=s.replace(e-r,t-r,n),l=this.lines-s.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let r=this.children.slice();return r[i]=a,new g(r,this.length-(t-e)+n.length)}return super.replace(r,o,a)}r=o+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=O(this,e,t);let i="";for(let r=0,s=0;r<this.children.length&&s<=t;r++){let o=this.children[r],a=s+o.length;s>e&&r&&(i+=n),e<a&&t>s&&(i+=o.sliceString(e-s,t-s,n)),s=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof g))return 0;let n=0,[i,r,s,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==s||r==o)return n;let a=this.children[i],l=e.children[r];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new m(n,t)}let i=Math.max(32,n>>5),r=i<<1,s=i>>1,o=[],a=0,l=-1,h=[];function c(e){let t;if(e.lines>r&&e instanceof g)for(let t of e.children)c(t);else e.lines>s&&(a>s||!a)?(u(),o.push(e)):e instanceof m&&a&&(t=h[h.length-1])instanceof m&&e.lines+t.lines<=32?(a+=e.lines,l+=e.length+1,h[h.length-1]=new m(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>i&&u(),a+=e.lines,l+=e.length+1,h.push(e))}function u(){0!=a&&(o.push(1==h.length?h[0]:g.from(h,l)),l=-1,a=h.length=0)}for(let t of e)c(t);return u(),1==o.length?o[0]:new g(o,t)}}function b(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s<e.length&&r<=i;s++){let a=e[s],l=r+a.length;l>=n&&(l>i&&(a=a.slice(0,i-r)),r<n&&(a=a.slice(n-r)),o?(t[t.length-1]+=a,o=!1):t.push(a)),r=l+1}return t}function y(e,t,n){return b(e,[""],t,n)}p.empty=new m([""],0);class v{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof m?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],s=r>>1,o=i instanceof m?i.text.length:i.children.length;if(s==(t>0?o:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof m){let r=i.text[s+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=i.children[s+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof m?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class k{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new v(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:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.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 w{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=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=i,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(p.prototype[Symbol.iterator]=function(){return this.iter()},v.prototype[Symbol.iterator]=k.prototype[Symbol.iterator]=w.prototype[Symbol.iterator]=function(){return this});class x{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function O(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function S(e,t,n=!0,i=!0){return a(e,t,n,i)}function C(e,t){let n=e.charCodeAt(t);if(!((i=n)>=55296&&i<56320&&t+1!=e.length))return n;var i;let r=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(r)?r-56320+(n-55296<<10)+65536:n}function A(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function T(e){return e<65536?1:2}const M=/\r\n?|\n/;var P=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(P||(P={}));class z{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let r=this.sections[t++],s=this.sections[t++];s<0?(e(n,i,r),i+=r):i+=s,n+=r}}iterChangedRanges(e,t=!1){E(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new z(e)}composeDesc(e){return this.empty?e:e.empty?this:j(this,e)}mapDesc(e,t=!1){return e.empty?this:B(this,e,t)}mapPos(e,t=-1,n=P.Simple){let i=0,r=0;for(let s=0;s<this.sections.length;){let o=this.sections[s++],a=this.sections[s++],l=i+o;if(a<0){if(l>e)return r+(e-i);r+=o}else{if(n!=P.Simple&&l>=e&&(n==P.TrackDel&&i<e&&l>e||n==P.TrackBefore&&i<e||n==P.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!o)return e==i||t<0?r:r+a;r+=a}i=l}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let r=i+this.sections[n++];if(this.sections[n++]>=0&&i<=t&&r>=e)return!(i<e&&r>t)||"cover";i=r}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeDesc");return new z(e)}static create(e){return new z(e)}}class D extends z{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 E(this,(t,n,i,r,s)=>e=e.replace(i,i+(n-t),s),!1),e}mapDesc(e,t=!1){return B(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i<t.length;i+=2){let s=t[i],o=t[i+1];if(o>=0){t[i]=o,t[i+1]=s;let a=i>>1;for(;n.length<a;)n.push(p.empty);n.push(s?e.slice(r,r+s):p.empty)}r+=s}return new D(t,n)}compose(e){return this.empty?e:e.empty?this:j(this,e,!0)}map(e,t=!1){return e.empty?this:B(this,e,t,!0)}iterChanges(e,t=!1){E(this,e,t)}get desc(){return z.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new N(this);e:for(let s=0,o=0;;){let a=s==e.length?1e9:e[s++];for(;o<a||o==a&&0==r.len;){if(r.done)break e;let e=Math.min(r.len,a-o);L(i,e,-1);let s=-1==r.ins?-1:0==r.off?r.ins:0;L(t,e,s),s>0&&R(n,t,r.text),r.forward(e),o+=e}let l=e[s++];for(;o<l;){if(r.done)break e;let e=Math.min(r.len,l-o);L(t,e,-1),L(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),o+=e}}return{changes:new D(t,n),filtered:z.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],s=0,o=null;function a(e=!1){if(!e&&!i.length)return;s<t&&L(i,t-s,-1);let n=new D(i,r);o=o?o.compose(n.map(o)):n,i=[],r=[],s=0}return function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof D){if(l.length!=t)throw new RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);a(),o=o?o.compose(l.map(o)):l}else{let{from:e,to:o=e,insert:h}=l;if(e>o||e<0||o>t)throw new RangeError(`Invalid change range ${e} to ${o} (in doc of length ${t})`);let c=h?"string"==typeof h?p.of(h.split(n||M)):h:p.empty,u=c.length;if(e==o&&0==u)return;e<s&&a(),e>s&&L(i,e-s,-1),L(i,o-e,u),R(r,i,c),s=o}}(e),a(!o),o}static empty(e){return new D(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let r=e[i];if("number"==typeof r)t.push(r,-1);else{if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length<i;)n.push(p.empty);n[i]=p.of(r.slice(1)),t.push(r[0],n[i].length)}}}return new D(t,n)}static createSet(e,t){return new D(e,t)}}function L(e,t,n,i=!1){if(0==t&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:r>=0&&0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function R(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(p.empty);e.push(n)}}function E(e,t,n){let i=e.inserted;for(let r=0,s=0,o=0;o<e.sections.length;){let a=e.sections[o++],l=e.sections[o++];if(l<0)r+=a,s+=a;else{let h=r,c=s,u=p.empty;for(;h+=a,c+=l,l&&i&&(u=u.append(i[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)a=e.sections[o++],l=e.sections[o++];t(r,h,s,c,u),r=h,s=c}}}function B(e,t,n,i=!1){let r=[],s=i?[]:null,o=new N(e),a=new N(t);for(let e=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(-1==o.ins&&-1==a.ins){let e=Math.min(o.len,a.len);L(r,e,-1),o.forward(e),a.forward(e)}else if(a.ins>=0&&(o.ins<0||e==o.i||0==o.off&&(a.len<o.len||a.len==o.len&&!n))){let t=a.len;for(L(r,a.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(L(r,0,o.ins),s&&R(s,r,o.text),e=o.i),o.forward(n),t-=n}a.next()}else{if(!(o.ins>=0)){if(o.done&&a.done)return s?D.createSet(r,s):z.create(r);throw new Error("Mismatched change set lengths")}{let t=0,n=o.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else{if(!(0==a.ins&&a.len<n))break;n-=a.len,a.next()}L(r,t,e<o.i?o.ins:0),s&&e<o.i&&R(s,r,o.text),e=o.i,o.forward(o.len-n)}}}}function j(e,t,n=!1){let i=[],r=n?[]:null,s=new N(e),o=new N(t);for(let e=!1;;){if(s.done&&o.done)return r?D.createSet(i,r):z.create(i);if(0==s.ins)L(i,s.len,0,e),s.next();else if(0!=o.len||o.done){if(s.done||o.done)throw new Error("Mismatched change set lengths");{let t=Math.min(s.len2,o.len),n=i.length;if(-1==s.ins){let n=-1==o.ins?-1:o.off?0:o.ins;L(i,t,n,e),r&&n&&R(r,i,o.text)}else-1==o.ins?(L(i,s.off?0:s.len,t,e),r&&R(r,i,s.textBit(t))):(L(i,s.off?0:s.len,o.off?0:o.ins,e),r&&!o.off&&R(r,i,o.text));e=(s.ins>t||o.ins>=0&&o.len>t)&&(e||i.length>n),s.forward2(t),o.forward(t)}}else L(i,0,o.ins,e),r&&R(r,i,o.text),o.next()}}class N{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?p.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?p.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class I{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new I(n,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return $.range(e,t,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return $.range(this.anchor,i,void 0,void 0,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||this.goalColumn!=e.goalColumn||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return $.range(e.anchor,e.head)}static create(e,t,n){return new I(e,t,n)}}class ${constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:$.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;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new $([this.main],0)}addRange(e,t=!0){return $.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,$.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new $(e.ranges.map(e=>I.fromJSON(e)),e.main)}static single(e,t=e){return new $([$.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=n:r.from<n)return $.normalized(e.slice(),t);n=r.to}return new $(e,t)}static cursor(e,t=0,n,i){return I.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:16777215)<<6)}static range(e,t,n,i,r){let s=(null!=n?n:16777215)<<6|(null==i?7:Math.min(6,i));return r||e==t||(r=t<e?1:-1),t<e?I.create(t,e,48|s):I.create(e,t,(r?r<0?8:16:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let i=e[n],r=e[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let s=r.from,o=Math.max(i.to,r.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?$.range(o,s):$.range(s,o))}}return new $(e,t)}}function Q(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let F=0;class W{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=F++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new W(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:_),!!e.static,e.enables)}of(e){return new V([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new V(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new V(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function _(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class V{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=F++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,s=e[r]>>1,o=2==this.type,a=!1,l=!1,h=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:1&(null!==(t=e[n.id])&&void 0!==t?t:1)||h.push(e[n.id]);return{create:e=>(e.values[s]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||H(e,h)){let t=n(e);if(o?!q(t,e.values[s],i):!i(t,e.values[s]))return e.values[s]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[r];if(null!=l){let r=ie(t,l);if(this.dependencies.every(n=>n instanceof W?t.facet(n)===e.facet(n):!(n instanceof Y)||t.field(n,!1)==e.field(n,!1))||(o?q(a=n(e),r,i):i(a=n(e),r)))return e.values[s]=r,0}else a=n(e);return e.values[s]=a,1}}}}function q(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function H(e,t){let n=!1;for(let i of t)1&ne(e,i)&&(n=!0);return n}function X(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),s=i.filter(e=>!(1&e)),o=e[t.id]>>1;function a(e){let n=[];for(let t=0;t<i.length;t++){let s=ie(e,i[t]);if(2==r[t])for(let e of s)n.push(e);else n.push(s)}return t.combine(n)}return{create(e){for(let t of i)ne(e,t);return e.values[o]=a(e),1},update(e,n){if(!H(e,s))return 0;let i=a(e);return t.compare(i,e.values[o])?0:(e.values[o]=i,1)},reconfigure(e,r){let s=H(e,i),l=r.config.facets[t.id],h=r.facet(t);if(l&&!s&&_(n,l))return e.values[o]=h,0;let c=a(e);return t.compare(c,h)?(e.values[o]=h,0):(e.values[o]=c,1)}}}const U=W.define({static:!0});class Y{constructor(e,t,n,i,r){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new Y(F++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(U).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>{let i,r=e.facet(U),s=n.facet(U);return(i=r.find(e=>e.field==this))&&i!=s.find(e=>e.field==this)?(e.values[t]=i.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,U.of({field:this,create:e})]}get extension(){return this}}function K(e){return t=>new Z(t,e)}const G={highest:K(0),high:K(1),default:K(2),low:K(3),lowest:K(4)};class Z{constructor(e,t){this.inner=e,this.prec=t}}class J{of(e){return new ee(this,e)}reconfigure(e){return J.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ee{constructor(e,t){this.compartment=e,this.inner=t}}class te{constructor(e,t,n,i,r,s){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i=[],r=Object.create(null),s=new Map;for(let n of function(e,t,n){let i=[[],[],[],[],[]],r=new Map;return function e(s,o){let a=r.get(s);if(null!=a){if(a<=o)return;let e=i[a].indexOf(s);e>-1&&i[a].splice(e,1),s instanceof ee&&n.delete(s.compartment)}if(r.set(s,o),Array.isArray(s))for(let t of s)e(t,o);else if(s instanceof ee){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let i=t.get(s.compartment)||s.inner;n.set(s.compartment,i),e(i,o)}else if(s instanceof Z)e(s.inner,s.prec);else if(s instanceof Y)i[o].push(s),s.provides&&e(s.provides,o);else if(s instanceof V)i[o].push(s),s.facet.extensions&&e(s.facet.extensions,2);else{let t=s.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,o)}}(e,2),i.reduce((e,t)=>e.concat(t))}(e,t,s))n instanceof Y?i.push(n):(r[n.facet.id]||(r[n.facet.id]=[])).push(n);let o=Object.create(null),a=[],l=[];for(let e of i)o[e.id]=l.length<<1,l.push(t=>e.slot(t));let h=null==n?void 0:n.config.facets;for(let e in r){let t=r[e],i=t[0].facet,s=h&&h[e]||[];if(t.every(e=>0==e.type))if(o[i.id]=a.length<<1|1,_(s,t))a.push(n.facet(i));else{let e=i.combine(t.map(e=>e.value));a.push(n&&i.compare(e,n.facet(i))?n.facet(i):e)}else{for(let e of t)0==e.type?(o[e.id]=a.length<<1|1,a.push(e.value)):(o[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));o[i.id]=l.length<<1,l.push(e=>X(e,i,t))}}let c=l.map(e=>e(o));return new te(e,s,c,o,a,r)}}function ne(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw new Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function ie(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const re=W.define(),se=W.define({combine:e=>e.some(e=>e),static:!0}),oe=W.define({combine:e=>e.length?e[0]:void 0,static:!0}),ae=W.define(),le=W.define(),he=W.define(),ce=W.define({combine:e=>!!e.length&&e[0]});class ue{constructor(e,t){this.type=e,this.value=t}static define(){return new de}}class de{of(e){return new ue(this,e)}}class fe{constructor(e){this.map=e}of(e){return new pe(this,e)}}class pe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new pe(this.type,t)}is(e){return this.type==e}static define(e={}){return new fe(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}}pe.reconfigure=pe.define(),pe.appendConfig=pe.define();class me{constructor(e,t,n,i,r,s){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,n&&Q(n,t.newLength),r.some(e=>e.type==me.time)||(this.annotations=r.concat(me.time.of(Date.now())))}static create(e,t,n,i,r,s){return new me(e,t,n,i,r,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let 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(me.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function ge(e,t){let n=[];for(let i=0,r=0;;){let s,o;if(i<e.length&&(r==t.length||t[r]>=e[i]))s=e[i++],o=e[i++];else{if(!(r<t.length))return n;s=t[r++],o=t[r++]}!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function be(e,t,n){var i;let r,s,o;return n?(r=t.changes,s=D.empty(t.changes.length),o=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),s=e.changes.mapDesc(t.changes,!0),o=e.changes.compose(r)),{changes:o,selection:t.selection?t.selection.map(s):null===(i=e.selection)||void 0===i?void 0:i.map(r),effects:pe.mapEffects(e.effects,r).concat(pe.mapEffects(t.effects,s)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function ye(e,t,n){let i=t.selection,r=we(t.annotations);return t.userEvent&&(r=r.concat(me.userEvent.of(t.userEvent))),{changes:t.changes instanceof D?t.changes:D.of(t.changes||[],n,e.facet(oe)),selection:i&&(i instanceof $?i:$.single(i.anchor,i.head)),effects:we(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}function ve(e,t,n){let i=ye(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(let r=1;r<t.length;r++){!1===t[r].filter&&(n=!1);let s=!!t[r].sequential;i=be(i,ye(e,t[r],s?i.changes.newLength:e.doc.length),s)}let r=me.create(e,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(he),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=be(i,ye(t,s,e.changes.newLength),!0))}return i==e?e:me.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let i of t.facet(ae)){let t=i(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:ge(n,t))}if(!0!==n){let i,r;if(!1===n)r=e.changes.invertedDesc,i=D.empty(t.doc.length);else{let t=e.changes.filter(n);i=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=me.create(t,i,e.selection&&e.selection.map(r),pe.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let i=t.facet(le);for(let n=i.length-1;n>=0;n--){let r=i[n](e);e=r instanceof me?r:Array.isArray(r)&&1==r.length&&r[0]instanceof me?r[0]:ve(t,we(r),!1)}return e}(r):r)}me.time=ue.define(),me.userEvent=ue.define(),me.addToHistory=ue.define(),me.remote=ue.define();const ke=[];function we(e){return null==e?ke:Array.isArray(e)?e:[e]}var xe=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(xe||(xe={}));const Oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Se;try{Se=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class Ce{constructor(e,t,n,i,r,s){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,s&&(s._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)ne(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null!=n)return ne(this,n),ie(this,n);if(t)throw new RangeError("Field is not present in this state")}update(...e){return ve(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let t of e.effects)t.is(J.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(t.value.compartment,t.value.extension)):t.is(pe.reconfigure)?(n=null,i=t.value):t.is(pe.appendConfig)&&(n=null,i=we(i).concat(t.value));n?t=e.startState.values.slice():(n=te.resolve(i,r,this),t=new Ce(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let s=e.startState.facet(se)?e.newSelection:e.newSelection.asSingle();new Ce(n,e.newDoc,s,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:$.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],s=we(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),a=this.changes(o.changes),l=a.map(i);for(let e=0;e<n;e++)r[e]=r[e].map(l);let h=i.mapDesc(a,!0);r.push(o.range.map(h)),i=i.compose(l),s=pe.mapEffects(s,l).concat(pe.mapEffects(we(o.effects),h))}return{changes:i,selection:$.create(r,t.mainIndex),effects:s}}changes(e=[]){return e instanceof D?e:D.of(e,this.doc.length,this.facet(Ce.lineSeparator))}toText(e){return p.of(e.split(this.facet(Ce.lineSeparator)||M))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(ne(this,t),ie(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof Y&&null!=this.config.address[i.id]&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n)for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let r=n[t],s=e[t];i.push(r.init(e=>r.spec.fromJSON(s,e)))}return Ce.create({doc:e.doc,selection:$.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=te.resolve(e.extensions||[],new Map),n=e.doc instanceof p?e.doc:p.of((e.doc||"").split(t.staticFacet(Ce.lineSeparator)||M)),i=e.selection?e.selection instanceof $?e.selection:$.single(e.selection.anchor,e.selection.head):$.single(0);return Q(i,n.length),t.staticFacet(se)||(i=i.asSingle()),new Ce(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(Ce.tabSize)}get lineBreak(){return this.facet(Ce.lineSeparator)||"\n"}get readOnly(){return this.facet(ce)}phrase(e,...t){for(let t of this.facet(Ce.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(re))for(let s of r(this,t,n))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return n=t.length?t[0]:"",e=>{if(!/\S/.test(e))return xe.Space;if(function(e){if(Se)return Se.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Oe.test(n)))return!0}return!1}(e))return xe.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return xe.Word;return xe.Other};var n}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),s=e-n,o=e-n;for(;s>0;){let e=S(t,s,!1);if(r(t.slice(e,s))!=xe.Word)break;s=e}for(;o<i;){let e=S(t,o);if(r(t.slice(o,e))!=xe.Word)break;o=e}return s==o?null:$.range(s+n,o+n)}}function Ae(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],s=i[e];if(void 0===s)i[e]=r;else if(s===r||void 0===r);else{if(!Object.hasOwnProperty.call(n,e))throw new Error("Config merge conflict for field "+e);i[e]=n[e](s,r)}}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}Ce.allowMultipleSelections=se,Ce.tabSize=W.define({combine:e=>e.length?e[0]:4}),Ce.lineSeparator=oe,Ce.readOnly=ce,Ce.phrases=W.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),Ce.languageData=re,Ce.changeFilter=ae,Ce.transactionFilter=le,Ce.transactionExtender=he,J.reconfigure=pe.define();class Te{eq(e){return this==e}range(e,t=e){return Pe.create(e,t,this)}}function Me(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}Te.prototype.startSide=Te.prototype.endSide=0,Te.prototype.point=!1,Te.prototype.mapMode=P.TrackDel;class Pe{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new Pe(e,t,n)}}function ze(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class De{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let s=i,o=r.length;;){if(s==o)return s;let i=s+o>>1,a=r[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==s)return a>=0?s:o;a>=0?o=i:s=i+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),s=this.findIndex(n,1e9,!1,r);r<s;r++)if(!1===i(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t){let n=[],i=[],r=[],s=-1,o=-1;for(let a=0;a<this.value.length;a++){let l,h,c=this.value[a],u=this.from[a]+e,d=this.to[a]+e;if(u==d){let e=t.mapPos(u,c.startSide,c.mapMode);if(null==e)continue;if(l=h=e,c.startSide!=c.endSide&&(h=t.mapPos(u,c.endSide),h<l))continue}else if(l=t.mapPos(u,c.startSide),h=t.mapPos(d,c.endSide),l>h||l==h&&c.startSide>0&&c.endSide<=0)continue;(h-l||c.endSide-c.startSide)<0||(s<0&&(s=l),c.point&&(o=Math.max(o,h-l)),n.push(c),i.push(l-s),r.push(h-s))}return{mapped:n.length?new De(i,r,n,o):null,pos:s}}}class Le{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new Le(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let 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:i=0,filterTo:r=this.length}=e,s=e.filter;if(0==t.length&&!s)return this;if(n&&(t=t.slice().sort(ze)),this.isEmpty)return t.length?Le.of(t):this;let o=new Be(this,null,-1).goto(0),a=0,l=[],h=new Re;for(;o.value||a<t.length;)if(a<t.length&&(o.from-t[a].from||o.startSide-t[a].value.startSide)>=0){let e=t[a++];h.addInner(e.from,e.to,e.value)||l.push(e)}else 1==o.rangeIndex&&o.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(o.chunkIndex)<t[a].from)&&(!s||i>this.chunkEnd(o.chunkIndex)||r<this.chunkPos[o.chunkIndex])&&h.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!s||i>o.to||r<o.from||s(o.from,o.to,o.value))&&(h.addInner(o.from,o.to,o.value)||l.push(Pe.create(o.from,o.to,o.value))),o.next());return h.finishInner(this.nextLayer.isEmpty&&!l.length?Le.empty:this.nextLayer.update({add:l,filter:s,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r],a=e.touchesRange(s,s+o.length);if(!1===a)i=Math.max(i,o.maxPoint),t.push(o),n.push(e.mapPos(s));else if(!0===a){let{mapped:r,pos:a}=o.map(s,e);r&&(i=Math.max(i,r.maxPoint),t.push(r),n.push(a))}}let r=this.nextLayer.map(e);return 0==t.length?r:new Le(n,t,r||Le.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],s=this.chunk[i];if(t>=r&&e<=r+s.length&&!1===s.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return je.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return je.from(e).goto(t)}static compare(e,t,n,i,r=-1){let s=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),a=Ee(s,o,n),l=new Ie(s,a,r),h=new Ie(o,a,r);n.iterGaps((e,t,n)=>$e(l,e,h,t,n,i)),n.empty&&0==n.length&&$e(l,0,h,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=999999999);let r=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),s=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(r.length!=s.length)return!1;if(!r.length)return!0;let o=Ee(r,s),a=new Ie(r,o,0).goto(n),l=new Ie(s,o,0).goto(n);for(;;){if(a.to!=l.to||!Qe(a.active,l.active)||a.point&&(!l.point||!Me(a.point,l.point)))return!1;if(a.to>i)return!0;a.next(),l.next()}}static spans(e,t,n,i,r=-1){let s=new Ie(e,null,r).goto(t),o=t,a=s.openStart;for(;;){let e=Math.min(s.to,n);if(s.point){let n=s.activeForPoint(s.to),r=s.pointFrom<t?n.length+1:s.point.startSide<0?n.length:Math.min(n.length,a);i.point(o,e,s.point,n,r,s.pointRank),a=Math.min(s.openEnd(e),n.length)}else e>o&&(i.span(o,e,s.active,a),a=s.openEnd(e));if(s.to>n)return a+(s.point&&s.to>n?1:0);o=s.to,s.next()}}static of(e,t=!1){let n=new Re;for(let i of e instanceof Pe?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(ze(t,i)>0)return e.slice().sort(ze);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return Le.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=Le.empty;i=i.nextLayer)t=new Le(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}Le.empty=new Le([],[],null,-1),Le.empty.nextLayer=Le.empty;class Re{finishChunk(e){this.chunks.push(new De(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 Re)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0||(250==this.from.length&&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(Le.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Le.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Ee(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let s=i.get(e.chunk[t]);null==s||(n?n.mapPos(s):s)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(s,s+e.chunk[t].length))||r.add(e.chunk[t])}return r}class Be{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class je{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let r=0;r<e.length;r++)for(let s=e[r];!s.isEmpty;s=s.nextLayer)s.maxPoint>=n&&i.push(new Be(s,t,n,r));return 1==i.length?i[0]:new je(i)}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 e=this.heap.length>>1;e>=0;e--)Ne(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)Ne(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)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(),Ne(this.heap,0)}}}function Ne(e,t){for(let n=e[t];;){let i=1+(t<<1);if(i>=e.length)break;let r=e[i];if(i+1<e.length&&r.compare(e[i+1])>=0&&(r=e[i+1],i++),n.compare(r)<0)break;e[i]=n,e[t]=r,t=i}}class Ie{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=je.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){Fe(this.active,e),Fe(this.activeTo,e),Fe(this.activeRank,e),this.minActive=_e(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;We(this.active,t,n),We(this.activeTo,t,i),We(this.activeRank,t,r),e&&We(e,t,this.cursor.from),this.minActive=_e(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&Fe(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[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 $e(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,a=i,l=i-t,h=!!s.boundChange;for(let t=!1;;){let i=e.to+l-n.to,r=i||e.endSide-n.endSide,c=r<0?e.to+l:n.to,u=Math.min(c,o);if(e.point||n.point?(e.point&&n.point&&Me(e.point,n.point)&&Qe(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(a,u,e.point,n.point),t=!1):(t&&s.boundChange(a),u>a&&!Qe(e.active,n.active)&&s.compareRange(a,u,e.active,n.active),h&&u<o&&(i||e.openEnd(c)!=n.openEnd(c))&&(t=!0)),c>o)break;a=c,r<=0&&e.next(),r>=0&&n.next()}}function Qe(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!Me(e[n],t[n]))return!1;return!0}function Fe(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function We(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function _e(e,t){let n=-1,i=1e9;for(let r=0;r<t.length;r++)(t[r]-i||e[r].endSide-e[n].endSide)<0&&(n=r,i=t[r]);return n}function Ve(e,t,n=e.length){let i=0;for(let r=0;r<n&&r<e.length;)9==e.charCodeAt(r)?(i+=t-i%t,r++):(i++,r=S(e,r));return i}function qe(e,t,n,i){for(let i=0,r=0;;){if(r>=t)return i;if(i==e.length)break;r+=9==e.charCodeAt(i)?n-r%n:1,i=S(e,i)}return!0===i?-1:e.length}},6898(e,t,n){"use strict";n.d(t,{tF:()=>be,uF:()=>Rn,_B:()=>z,l_:()=>N,NZ:()=>D,OP:()=>ae,Lz:()=>vi,wJ:()=>ts,dT:()=>Ji,Ip:()=>Ei,Z9:()=>He,X3:()=>ot,xO:()=>P,rU:()=>Rs,vo:()=>Fr,HJ:()=>wr,VH:()=>Fi,A:()=>Gi,rC:()=>Gr,$G:()=>Wi,ld:()=>qr,Eg:()=>Ir,cU:()=>os,EV:()=>ns,QO:()=>is,Hm:()=>ls,n6:()=>$r,dz:()=>ur,Wu:()=>Cs,N$:()=>sr,wu:()=>Ls,Yq:()=>zs,Ux:()=>Nr,w4:()=>Ti,qd:()=>$i,pK:()=>ms,qy:()=>gs,$K:()=>ws,c_:()=>We,C3:()=>Vr,qf:()=>mr,D4:()=>yr,Pq:()=>Wr,TS:()=>zi,BE:()=>cr,ui:()=>Kr,S7:()=>Yr,DK:()=>Lr,vX:()=>Sr});for(var i=n(1638),r=n(7417),s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),h=0;h<10;h++)s[48+h]=s[96+h]=String(h);for(h=1;h<=24;h++)s[h+111]="F"+h;for(h=65;h<=90;h++)s[h]=String.fromCharCode(h+32),o[h]=String.fromCharCode(h);for(var c in s)o.hasOwnProperty(c)||(o[c]=s[c]);var u=n(3748);let d="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},f="undefined"!=typeof document?document:{documentElement:{style:{}}};const p=/Edge\/(\d+)/.exec(d.userAgent),m=/MSIE \d/.test(d.userAgent),g=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(d.userAgent),b=!!(m||g||p),y=!b&&/gecko\/(\d+)/i.test(d.userAgent),v=!b&&/Chrome\/(\d+)/.exec(d.userAgent),k="webkitFontSmoothing"in f.documentElement.style,w=!b&&/Apple Computer/.test(d.vendor),x=w&&(/Mobile\/\w+/.test(d.userAgent)||d.maxTouchPoints>2);var O={mac:x||/Mac/.test(d.platform),windows:/Win/.test(d.platform),linux:/Linux|X11/.test(d.platform),ie:b,ie_version:m?f.documentMode||6:g?+g[1]:p?+p[1]:0,gecko:y,gecko_version:y?+(/Firefox\/(\d+)/.exec(d.userAgent)||[0,0])[1]:0,chrome:!!v,chrome_version:v?+v[1]:0,ios:x,android:/Android\b/.test(d.userAgent),webkit:k,webkit_version:k?+(/\bAppleWebKit\/(\d+)/.exec(d.userAgent)||[0,0])[1]:0,safari:w,safari_version:w?+(/\bVersion\/(\d+(\.\d+)?)/.exec(d.userAgent)||[0,0])[1]:0,tabSize:null!=f.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function S(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const C=Object.create(null);function A(e,t,n){if(e==t)return!0;e||(e=C),t||(t=C);let i=Object.keys(e),r=Object.keys(t);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let s of i)if(s!=n&&(-1==r.indexOf(s)||e[s]!==t[s]))return!1;return!0}function T(e,t,n){let i=!1;if(t)for(let r in t)n&&r in n||(i=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(i=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return i}function M(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let i=e.attributes[n];t[i.name]=i.value}return t}class P{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var z=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(z||(z={}));class D extends i.FB{constructor(e,t,n,i){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=i}get heightRelevant(){return!1}static mark(e){return new L(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new E(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,i=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:s}=B(e,i);t=(r?i?-3e8:-1:5e8)-1,n=1+(s?i?2e8:1:-6e8)}return new E(e,t,n,i,e.widget||null,!0)}static line(e){return new R(e)}static set(e,t=!1){return i.om.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}D.none=i.om.empty;class L extends D{constructor(e){let{start:t,end:n}=B(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?S(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||C}eq(e){return this==e||e instanceof L&&this.tagName==e.tagName&&A(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}L.prototype.point=!1;class R extends D{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof R&&this.spec.class==e.spec.class&&A(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)}}R.prototype.mapMode=i.iR.TrackBefore,R.prototype.point=!0;class E extends D{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?i.iR.TrackBefore:i.iR.TrackAfter:i.iR.TrackDel}get type(){return this.startSide!=this.endSide?z.WidgetRange:this.startSide<=0?z.WidgetBefore:z.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof E&&((t=this.widget)==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}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)}}function B(e,t=!1){let{inclusiveStart:n,inclusiveEnd:i}=e;return null==n&&(n=e.inclusive),null==i&&(i=e.inclusive),{start:null!=n?n:t,end:null!=i?i:t}}function j(e,t,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=e?n[r]=Math.max(n[r],t):n.push(e,t)}E.prototype.point=!0;class N extends i.FB{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof N&&this.tagName==e.tagName&&A(this.attributes,e.attributes)}static create(e){return new N(e.tagName,e.attributes||C)}static set(e,t=!1){return i.om.of(e,t)}}function I(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function $(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function Q(e,t){if(!t.anchorNode)return!1;try{return $(e,t.anchorNode)}catch(e){return!1}}function F(e){return 3==e.nodeType?te(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function W(e,t,n,i){return!!n&&(q(e,t,n,i,-1)||q(e,t,n,i,1))}function _(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function V(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function q(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:H(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=_(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?H(e):0}}}function H(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function X(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function U(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function Y(e,t){let n=t.width/e.offsetWidth,i=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-e.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function K(e,t=!0){let n=e.ownerDocument,i=null,r=null;for(let s=e.parentNode;s&&s!=n.body&&(t&&!i||!r);)if(1==s.nodeType)!r&&s.scrollHeight>s.clientHeight&&(r=s),t&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else{if(11!=s.nodeType)break;s=s.host}return{x:i,y:r}}N.prototype.startSide=N.prototype.endSide=-1;class G{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?H(t):0),n,Math.min(e.focusOffset,n?H(n):0))}set(e,t,n,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=i}}let Z,J=null;function ee(e){if(e.setActive)return e.setActive();if(J)return e.focus(J);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==J?{get preventScroll(){return J={preventScroll:!0},!0}}:void 0),!J){J=!1;for(let e=0;e<t.length;){let n=t[e++],i=t[e++],r=t[e++];n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}}}function te(e,t,n=t){let i=Z||(Z=document.createRange());return i.setEnd(e,n),i.setStart(e,t),i}function ne(e,t,n,i){let r={key:t,code:t,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,e.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,e.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function ie(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function re(e,t){for(let n=e,i=t;;){if(3==n.nodeType&&i>0)return{node:n,offset:i};if(1==n.nodeType&&i>0){if("false"==n.contentEditable)return null;n=n.childNodes[i-1],i=H(n)}else{if(!n.parentNode||V(n))return null;i=_(n),n=n.parentNode}}}function se(e,t){for(let n=e,i=t;;){if(3==n.nodeType&&i<n.nodeValue.length)return{node:n,offset:i};if(1==n.nodeType&&i<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[i],i=0}else{if(!n.parentNode||V(n))return null;i=_(n)+1,n=n.parentNode}}}O.safari&&O.safari_version>=26&&(J=!1);class oe{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new oe(e.parentNode,_(e),t)}static after(e,t){return new oe(e.parentNode,_(e)+1,t)}}var ae=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(ae||(ae={}));const le=ae.LTR,he=ae.RTL;function ce(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const ue=ce("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),de=ce("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),fe=Object.create(null),pe=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);fe[t]=n,fe[n]=-t}function me(e){return e<=247?ue[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?de[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const ge=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class be{get dir(){return this.level%2?he:le}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,i){let r=-1;for(let s=0;s<e.length;s++){let o=e[s];if(o.from<=t&&o.to>=t){if(o.level==n)return s;(r<0||(0!=i?i<0?o.from<t:o.to>t:e[r].level>o.level))&&(r=s)}}if(r<0)throw new RangeError("Index out of range");return r}}function ye(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!ye(i.inner,r.inner))return!1}return!0}const ve=[];function ke(e,t,n,i,r,s,o){let a=i%2?2:1;if(i%2==r%2)for(let l=t,h=0;l<n;){let t=!0,c=!1;if(h==s.length||l<s[h].from){let e=ve[l];e!=a&&(t=!1,c=16==e)}let u=t||1!=a?null:[],d=t?i:i+1,f=l;e:for(;;)if(h<s.length&&f==s[h].from){if(c)break e;let p=s[h];if(!t)for(let e=p.to,t=h+1;;){if(e==n)break e;if(!(t<s.length&&s[t].from==e)){if(ve[e]==a)break e;break}e=s[t++].to}h++,u?u.push(p):(p.from>l&&o.push(new be(l,p.from,d)),we(e,p.direction==le!=!(d%2)?i+1:i,r,p.inner,p.from,p.to,o),l=p.to),f=p.to}else{if(f==n||(t?ve[f]!=a:ve[f]==a))break;f++}u?ke(e,l,f,i+1,r,u,o):l<f&&o.push(new be(l,f,d)),l=f}else for(let l=n,h=s.length;l>t;){let n=!0,c=!1;if(!h||l>s[h-1].to){let e=ve[l-1];e!=a&&(n=!1,c=16==e)}let u=n||1!=a?null:[],d=n?i:i+1,f=l;e:for(;;)if(h&&f==s[h-1].to){if(c)break e;let p=s[--h];if(!n)for(let e=p.from,n=h;;){if(e==t)break e;if(!n||s[n-1].to!=e){if(ve[e-1]==a)break e;break}e=s[--n].from}u?u.push(p):(p.to<l&&o.push(new be(p.to,l,d)),we(e,p.direction==le!=!(d%2)?i+1:i,r,p.inner,p.from,p.to,o),l=p.from),f=p.from}else{if(f==t||(n?ve[f-1]!=a:ve[f-1]==a))break;f--}u?ke(e,f,l,i+1,r,u,o):f<l&&o.push(new be(f,l,d)),l=f}}function we(e,t,n,i,r,s,o){let a=t%2?2:1;!function(e,t,n,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:t,a=s<i.length?i[s].from:n,l=s?256:r;for(let t=o,n=l,i=l;t<a;t++){let r=me(e.charCodeAt(t));512==r?r=n:8==r&&4==i&&(r=16),ve[t]=4==r?2:r,7&r&&(i=r),n=r}for(let e=o,t=l,i=l;e<a;e++){let r=ve[e];if(128==r)e<a-1&&t==ve[e+1]&&24&t?r=ve[e]=t:ve[e]=256;else if(64==r){let r=e+1;for(;r<a&&64==ve[r];)r++;let s=e&&8==t||r<n&&8==ve[r]?1==i?1:8:256;for(let t=e;t<r;t++)ve[t]=s;e=r-1}else 8==r&&1==i&&(ve[e]=1);t=r,7&r&&(i=r)}}}(e,r,s,i,a),function(e,t,n,i,r){let s=1==r?2:1;for(let o=0,a=0,l=0;o<=i.length;o++){let h=o?i[o-1].to:t,c=o<i.length?i[o].from:n;for(let t,n,i,o=h;o<c;o++)if(n=fe[t=e.charCodeAt(o)])if(n<0){for(let e=a-3;e>=0;e-=3)if(pe[e+1]==-n){let t=pe[e+2],n=2&t?r:4&t?1&t?s:r:0;n&&(ve[o]=ve[pe[e]]=n),a=e;break}}else{if(189==pe.length)break;pe[a++]=o,pe[a++]=t,pe[a++]=l}else if(2==(i=ve[o])||1==i){let e=i==r;l=e?0:1;for(let t=a-3;t>=0;t-=3){let n=pe[t+2];if(2&n)break;if(e)pe[t+2]|=2;else{if(4&n)break;pe[t+2]|=4}}}}}(e,r,s,i,a),function(e,t,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:e,a=r<n.length?n[r].from:t;for(let l=o;l<a;){let o=ve[l];if(256==o){let o=l+1;for(;;)if(o==a){if(r==n.length)break;o=n[r++].to,a=r<n.length?n[r].from:t}else{if(256!=ve[o])break;o++}let h=1==s,c=h==(1==(o<t?ve[o]:i))?h?1:2:i;for(let t=o,i=r,s=i?n[i-1].to:e;t>l;)t==s&&(t=n[--i].from,s=i?n[i-1].to:e),ve[--t]=c;l=o}else s=o,l++}}}(r,s,i,a),ke(e,r,s,t,n,i,o)}function xe(e,t,n){if(!e)return[new be(0,0,t==he?1:0)];if(t==le&&!n.length&&!ge.test(e))return Oe(e.length);if(n.length)for(;e.length>ve.length;)ve[ve.length]=256;let i=[],r=t==le?0:1;return we(e,r,r,n,0,e.length,i),i}function Oe(e){return[new be(0,e,0)]}let Se="";function Ce(e,t,n,r,s){var o;let a=r.head-e.from,l=be.find(t,a,null!==(o=r.bidiLevel)&&void 0!==o?o:-1,r.assoc),h=t[l],c=h.side(s,n);if(a==c){let e=l+=s?1:-1;if(e<0||e>=t.length)return null;h=t[l=e],a=h.side(!s,n),c=h.side(s,n)}let u=(0,i.zK)(e.text,a,h.forward(s,n));(u<h.from||u>h.to)&&(u=c),Se=e.text.slice(Math.min(a,u),Math.max(a,u));let d=l==(s?t.length-1:0)?null:t[l+(s?1:-1)];return d&&u==c&&d.level+(s?0:1)<h.level?i.OF.cursor(d.side(!s,n)+e.from,d.forward(s,n)?1:-1,d.level):i.OF.cursor(u+e.from,h.forward(s,n)?-1:1,h.level)}function Ae(e,t,n){for(let i=t;i<n;i++){let t=me(e.charCodeAt(i));if(1==t)return le;if(2==t||4==t)return he}return le}const Te=i.sj.define(),Me=i.sj.define(),Pe=i.sj.define(),ze=i.sj.define(),De=i.sj.define(),Le=i.sj.define(),Re=i.sj.define(),Ee=i.sj.define(),Be=i.sj.define(),je=i.sj.define({combine:e=>e.some(e=>e)}),Ne=i.sj.define({combine:e=>e.some(e=>e)}),Ie=i.sj.define();class $e{constructor(e,t,n,i,r,s=!1){this.range=e,this.y=t,this.x=n,this.yMargin=i,this.xMargin=r,this.isSnapshot=s}map(e){return e.empty?this:new $e(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 $e(i.OF.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Qe=i.Pe.define({map:(e,t)=>e.map(t)}),Fe=i.Pe.define();function We(e,t,n){let i=e.facet(ze);i.length?i[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const _e=i.sj.define({combine:e=>!e.length||e[0]});let Ve=0;const qe=i.sj.define({combine:e=>e.filter((t,n)=>{for(let i=0;i<n;i++)if(e[i].plugin==t.plugin)return!1;return!0})});class He{constructor(e,t,n,i,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=i,this.baseExtensions=r(this),this.extension=this.baseExtensions.concat(qe.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(qe.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:i,provide:r,decorations:s}=t||{};return new He(Ve++,e,n,i,e=>{let t=[];return s&&t.push(Ke.of(t=>{let n=t.plugin(e);return n?s(n):D.none})),r&&t.push(r(e)),t})}static fromClass(e,t){return He.define((t,n)=>new e(t,n),t)}}class Xe{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(We(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){We(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){We(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ue=i.sj.define(),Ye=i.sj.define(),Ke=i.sj.define(),Ge=i.sj.define(),Ze=i.sj.define(),Je=i.sj.define(),et=i.sj.define();function tt(e,t){let n=e.state.facet(et);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),s=[];return i.om.spans(r,t.from,t.to,{point(){},span(e,n,i,r){let o=e-t.from,a=n-t.from,l=s;for(let e=i.length-1;e>=0;e--,r--){let n,s=i[e].spec.bidiIsolate;if(null==s&&(s=Ae(t.text,o,a)),r>0&&l.length&&(n=l[l.length-1]).to==o&&n.direction==s)n.to=a,l=n.inner;else{let e={from:o,to:a,direction:s,inner:[]};l.push(e),l=e.inner}}}}),s}const nt=i.sj.define();function it(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(nt)){let o=s(e);o&&(null!=o.left&&(t=Math.max(t,o.left)),null!=o.right&&(n=Math.max(n,o.right)),null!=o.top&&(i=Math.max(i,o.top)),null!=o.bottom&&(r=Math.max(r,o.bottom)))}return{left:t,right:n,top:i,bottom:r}}const rt=i.sj.define();class st{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}join(e){return new st(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 i=e[t-1];if(!(i.fromA>n.toA)){if(i.toA<n.fromA)break;n=n.join(i),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let i=0,r=0,s=0;;){let o=i<e.length?e[i].fromB:1e9,a=r<t.length?t[r]:1e9,l=Math.min(o,a);if(1e9==l)break;let h=l+s,c=l,u=h;for(;;)if(r<t.length&&t[r]<=c){let n=t[r+1];r+=2,c=Math.max(c,n);for(let t=i;t<e.length&&e[t].fromB<=c;t++)s=e[t].toA-e[t].toB;u=Math.max(u,n+s)}else{if(!(i<e.length&&e[i].fromB<=c))break;{let t=e[i++];c=Math.max(c,t.toB),u=Math.max(u,t.toA),s=t.toA-t.toB}}n.push(new st(h,u,l,c))}return n}}class ot{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=i.VR.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new st(e,t,n,i))),this.changedRanges=r}static create(e,t,n){return new ot(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}const at=[];class lt{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return at}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let i=e.attributes[n].name;null==t[i]&&e.removeAttribute(i)}for(let n in t){let i=t[n];"style"==n?e.style.cssText=i:e.getAttribute(n)!=i&&e.setAttribute(n,i)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=_(this.dom),i=this.length?e>0:t>0;return new oe(this.parent.dom,n+(i?1:0),0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof ut)return e;return null}static get(e){return e.cmTile}}class ht extends lt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t,n=this.dom,i=null,r=(null==e?void 0:e.node)==n?e:null,s=0;for(let o of this.children){if(o.sync(e),s+=o.length+o.breakAfter,t=i?i.nextSibling:n.firstChild,r&&t!=o.dom&&(r.written=!0),o.dom.parentNode==n)for(;t&&t!=o.dom;)t=ct(t);else n.insertBefore(o.dom,t);i=o.dom}for(t=i?i.nextSibling:n.firstChild,r&&t&&(r.written=!0);t;)t=ct(t);this.length=s}}function ct(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ut extends ht{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=lt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,i=0,r=0;;)if(i==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&r++,i=t.pop()}else{let s=n.children[i++];if(s instanceof dt)t.push(i),n=s,i=0;else{let t=r+s.length,n=e(s,r);if(void 0!==n)return n;r=t+s.breakAfter}}}resolveBlock(e,t){let n,i,r=-1,s=-1;if(this.blockTiles((o,a)=>{let l=a+o.length;if(e>=a&&e<=l){if(o.isWidget()&&t>=-1&&t<=1){if(32&o.flags)return!0;16&o.flags&&(n=void 0)}(a<e||e==l&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-a),(l>e||e==a&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,s=e-a)}}),!n&&!i)throw new Error("No tile at position "+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:s}}}class dt extends ht{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new dt(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class ft extends ht{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let i=new ft(t||document.createElement("div"),e);return t&&n||(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let i=null,r=-1,s=null,o=-1;!function e(a,l){for(let h=0,c=0;h<a.children.length&&c<=l;h++){let u=a.children[h],d=c+u.length;d>=l&&(u.isComposite()?e(u,l-c):(!s||s.isHidden&&(t>0||n&&pt(s,u)))&&(d>l||32&u.flags)?(s=u,o=l-c):(c<l||16&u.flags&&!u.isHidden)&&(i=u,r=l-c)),c=d}}(this,e);let a=(t<0?i:s)||i||s;return a?{tile:a,offset:a==i?r:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=F(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:i}=n;if(this.dom.contains(e.dom))return e.isText()?new oe(e.dom,Math.min(e.dom.nodeValue.length,i)):e.domPosFor(i,16&e.flags?1:32&e.flags?-1:t);let r=n.tile.parent,s=!1;for(let e of r.children){if(s)return new oe(e.dom,0);e==n.tile&&(s=!0)}}return new oe(this.dom,0)}}function pt(e,t){let n=e.coordsIn(0,1),i=t.coordsIn(0,1);return n&&i&&i.top<n.bottom}class mt extends ht{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new mt(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class gt extends lt{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let i=e,r=e,s=0;0==e&&t<0||e==n&&t>=0?O.chrome||O.gecko||(e?(i--,s=1):r<n&&(r++,s=-1)):t<0?i--:r<n&&r++;let o=te(this.dom,i,r).getClientRects();if(!o.length)return null;let a=o[(s?s<0:t>=0)?0:o.length-1];return O.safari&&!s&&0==a.width&&(a=Array.prototype.find.call(o,e=>e.width)||a),s?X(a,s<0):a||null}static of(e,t){let n=new gt(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class bt extends lt{constructor(e,t,n,i){super(e,t,i),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;if(n)return X(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let i=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let r=i?t.length-1:0;n=t[r],!(e>0?0==r:r==t.length-1||n.top<n.bottom);r+=i?-1:1);return X(n,!i)}}get overrideDOMText(){if(!this.length)return i.EY.empty;let{root:e}=this;if(!e)return i.EY.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,i,r){return r||(r=e.toDOM(t),e.editable||(r.contentEditable="false")),new bt(r,n,e,i)}}class yt extends lt{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return i.EY.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class vt{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:i,index:r,beforeBreak:s,parents:o}=this;for(;e||t>0;)if(i.isComposite())if(s){if(!e)break;n&&n.break(),e--,s=!1}else if(r==i.children.length){if(!e&&!o.length)break;n&&n.leave(i),s=!!i.breakAfter,({tile:i,index:r}=o.pop()),r++}else{let a=i.children[r],l=a.breakAfter;!(t>0?a.length<=e:a.length<e)||n&&!1===n.skip(a,0,a.length)&&a.isComposite?(o.push({tile:i,index:r}),i=a,r=0,n&&a.isComposite()&&n.enter(a)):(s=!!l,r++,e-=a.length)}else if(r==i.length)s=!!i.breakAfter,({tile:i,index:r}=o.pop()),r++;else{if(!e)break;{let t=Math.min(e,i.length-r);n&&n.skip(i,r,r+t),e-=t,r+=t}}return this.tile=i,this.index=r,this.beforeBreak=s,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class kt{constructor(e,t,n,i){this.from=e,this.to=t,this.wrapper=n,this.rank=i}}class wt{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,i){var r;this.flushBuffer();let s=this.ensureMarks(t,n),o=s.lastChild;o&&o.isText()&&!(8&o.flags)&&o.length+e.length<512?(this.cache.reused.set(o,2),(s.children[s.children.length-1]=new gt(o.dom,o.text+e)).parent=s):s.append(i||gt.of(e,null===(r=this.cache.find(gt))||void 0===r?void 0:r.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Mt(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let i=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],r=i.lastChild;if(r instanceof mt&&r.mark.eq(n.mark))r.dom!=n.dom&&r.setDOM(Mt(n.dom)),i=r;else{if(this.cache.reused.get(n)){let e=lt.get(n.dom);e&&e.setDOM(Mt(n.dom))}let e=mt.of(n.mark,n.dom);i.append(e),i=e}this.cache.reused.set(n,2)}let r=lt.get(e.text);r&&this.cache.reused.set(r,2);let s=new gt(e.text,e.text.nodeValue);s.flags|=8,i.append(s)}addInlineWidget(e,t,n){let i=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);i||this.flushBuffer();let r=this.ensureMarks(t,n);i||16&e.flags||r.append(this.getBuffer(1)),r.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){(this.afterWidget||this.lastBlock).length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=Tt);let i=ft.start(e,t||(null===(n=this.cache.find(ft))||void 0===n?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let i=this.curLine;for(let r=e.length-1;r>=0;r--){let s,o=e[r];if(t>0&&(s=i.lastChild)&&s instanceof mt&&s.mark.eq(o))i=s,t--;else{let e=mt.of(o,null===(n=this.cache.find(mt,e=>e.mark.eq(o)))||void 0===n?void 0:n.dom);i.append(e),i=e,t=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;e&&At(this.curLine,!1)&&("BR"==e.dom.nodeName||!e.isWidget()||O.ios&&At(this.curLine,!0))||this.curLine.append(this.cache.findWidget(zt,0,32)||new bt(zt.toDOM(),0,zt,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new kt(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let i=t.lastChild;if(n.from<this.pos&&i instanceof dt&&i.wrapper.eq(n.wrapper))t=i;else{let i=dt.of(n.wrapper,null===(e=this.cache.find(dt,e=>e.wrapper.eq(n.wrapper)))||void 0===e?void 0:e.dom);t.append(i),t=i}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(yt,void 0,1);return n&&(n.flags=t),n||new yt(t)}flushBuffer(){!this.afterWidget||32&this.afterWidget.flags||(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class xt{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:i}=this.cursor.next(this.skipCount);if(this.skipCount=0,i)throw new Error("Ran out of text content when drawing inline views");this.text=t;let r=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,r)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}const Ot=[bt,ft,gt,mt,yt,dt,ut];for(let e=0;e<Ot.length;e++)Ot[e].bucket=e;class St{constructor(e){this.view=e,this.buckets=Ot.map(()=>[]),this.index=Ot.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let i=e.bucket,r=this.buckets[i],s=this.index[i];for(let e=r.length-1;e>=0;e--){let o=(e+s)%r.length,a=r[o];if((!t||t(a))&&!this.reused.has(a))return r.splice(o,1),o<s&&this.index[i]--,this.reused.set(a,n),a}return null}findWidget(e,t,n){let i=this.buckets[0];if(i.length)for(let r=0,s=0;;r++){if(r==i.length){if(s)return null;s=1,r=0}let o=i[r];if(!this.reused.has(o)&&(0==s?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return i.splice(r,1),r<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(497&o.flags)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new bt(o.dom,t,e,-498&o.flags|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Ct{constructor(e,t,n,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new St(e),this.text=new xt(e.state.doc),this.builder=new wt(this.cache,new ut(e,e.contentDOM),i.om.iter(n)),this.cache.reused.set(t,2),this.old=new vt(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let i=0,r=0,s=0;;){let o=s<e.length?e[s++]:null,a=o?o.fromA:this.old.root.length;if(a>i){let e=a-i;this.preserve(e,!s,!o),i=a,r+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(r,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(r,o.toB)),r=o.toB,i=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let i=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let i=n==e.parents.length?e.tile:e.parents[n].tile;i instanceof mt&&t.push(i.mark)}return t}(this.old),r=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let s=n>0||t<e.length?bt.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&s.flags?(s.flags&=-2,this.builder.addBlockWidget(s)):(this.builder.ensureLine(null),this.builder.addInlineWidget(s,i,r),r=i.length)}else if(e.isText())this.builder.ensureLine(null),t||n!=e.length||this.cache.reused.has(e)?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),i,r)):this.builder.addText(e.text,i,r,this.cache.reuse(e)),r=i.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof yt)this.cache.add(e);else{if(!(e instanceof mt))return!1;this.builder.ensureLine(null),this.builder.addMark(e,i,r),this.cache.reused.set(e,1),r=i.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof mt&&i.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?i.length&&(i.length=r=0):e instanceof mt&&(i.shift(),r=Math.min(r,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,s=0,o=i.om.spans(this.decorations,e,t,{point:(e,t,i,o,a,l)=>{if(i instanceof E){if(this.disallowBlockEffectsFor[l]){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=o.length,a>o.length)r.continueWidget(t-e);else{let s=i.widget||(i.block?Pt.block:Pt.inline),l=function(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}(i),h=this.cache.findWidget(s,t-e,l)||bt.of(s,this.view,t-e,l);i.block?(i.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(h)):(r.ensureLine(n),r.addInlineWidget(h,o,a))}n=null}else n=function(e,t){let n=t.spec.attributes,i=t.spec.class;return n||i?(e||(e={class:"cm-line"}),n&&S(n,e),i&&(e.class+=" "+i),e):e}(n,i);t>e&&this.text.skip(t-e)},span:(e,t,i,s)=>{for(let o=e;o<t;){let a=this.text.next(Math.min(512,t-o));null==a?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(a,i,o==e?s:i.length),o+=a.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=o>s,this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let i=e.parentNode;;i=i.parentNode){let e=lt.get(i);if(i==this.view.contentDOM)break;e instanceof mt?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof dt||("DIV"!=i.nodeName||n||i==this.view.contentDOM?n||t.push(mt.of(new L({tagName:i.nodeName.toLowerCase(),attributes:M(i)}),i)):n=new ft(i,Tt))}return{line:n,marks:t}}}function At(e,t){let n=e=>{for(let i of e.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}const Tt={class:"cm-line"};function Mt(e){let t=lt.get(e);return t&&t.setDOM(e.cloneNode()),e}class Pt extends P{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}}Pt.inline=new Pt("span"),Pt.block=new Pt("div");const zt=new class extends P{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Dt{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=D.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ut(e,e.contentDOM),this.updateInner([new st(0,0,0,e.state.doc.length)],null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?r=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges((e,i)=>{e<t.to&&i>t.from&&(n=!0)}),n}(e.changes,this.hasComposition)||e.selectionSet||(r=e.state.selection.main.head));let s=r>-1?function(e,t,n){let i=Rt(e,n);if(!i)return null;let{node:r,from:s,to:o}=i,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(i.from,i.to)!=a)return null;let l=t.invertedDesc;return{range:new st(l.mapPos(s),l.mapPos(o),s,o),text:r}}(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:i}=this.hasComposition;n=new st(t,i,e.changes.mapPos(t,-1),e.changes.mapPos(i,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(O.ie||O.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=function(e,t,n){let r=new Et;return i.om.compare(e,t,n,r),r.changes}(o,this.decorations,e.changes);l.length&&(n=st.extendWithRanges(n,l));let h=function(e,t,n){let r=new Bt;return i.om.compare(e,t,n,r),r.changes}(a,this.blockWrappers,e.changes);return h.length&&(n=st.extendWithRanges(n,h)),s&&!n.some(e=>e.fromA<=s.range.fromA&&e.toA>=s.range.toA)&&(n=s.range.addToSet(n.slice())),!(2&this.tile.flags&&0==n.length||(this.updateInner(n,s),e.transactions.length&&(this.lastUpdate=Date.now()),0))}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,i=new Ct(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&<.get(t.text)&&i.cache.reused.set(lt.get(t.text),2),this.tile=i.run(e,t),Lt(n,i.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=O.chrome||O.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),!i||!i.written&&n.selectionRange.focusNode==i.node&&this.tile.dom.contains(i.node)||(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof jt&&i.push(e.dom);n.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(Fe)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let{dom:n}=this.tile,i=this.view.root.activeElement,r=i==n,s=!r&&!(this.view.state.facet(_e)||n.tabIndex>-1)&&Q(n,this.view.observer.selectionRange)&&!(i&&n.contains(i));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a,l,h=this.view.state.selection.main;if(h.empty?l=a=this.inlineDOMNearPos(h.anchor,h.assoc||1):(l=this.inlineDOMNearPos(h.head,h.head==h.from?1:-1),a=this.inlineDOMNearPos(h.anchor,h.anchor==h.from?1:-1)),O.gecko&&h.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null)),a=l=new oe(e,0),o=!0}var c;let u=this.view.observer.selectionRange;!o&&u.focusNode&&(W(a.node,a.offset,u.anchorNode,u.anchorOffset)&&W(l.node,l.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,h))||(this.view.observer.ignore(()=>{O.android&&O.chrome&&n.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=I(this.view.root);if(e)if(h.empty){if(O.gecko){let e=(t=a.node,r=a.offset,1!=t.nodeType?0:(r&&"false"==t.childNodes[r-1].contentEditable?1:0)|(r<t.childNodes.length&&"false"==t.childNodes[r].contentEditable?2:0));if(e&&3!=e){let t=(1==e?re:se)(a.node,a.offset);t&&(a=new oe(t.node,t.offset))}}e.collapse(a.node,a.offset),null!=h.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=h.bidiLevel)}else if(e.extend){e.collapse(a.node,a.offset);try{e.extend(l.node,l.offset)}catch(e){}}else{let t=document.createRange();h.anchor>h.head&&([a,l]=[l,a]),t.setEnd(l.node,l.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,r;s&&this.view.root.activeElement==n&&(n.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new oe(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new oe(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&W(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=I(e.root),{anchorNode:i,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let s=this.lineAt(t.head,t.assoc);if(!s)return;let o=s.posAtStart;if(t.head==o||t.head==o+s.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let h=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(i,r)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let i=n.posAtStart;if(!n.isComposite())return n.isText()?e==n.dom?i+t:i+(t?n.length:0):i;{let r;if(e==n.dom)r=n.dom.childNodes[t];else{let i=0==H(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==i&&t.firstChild!=t.lastChild&&(i=e==t.firstChild?-1:1),e=t}r=i<0?e:e.nextSibling}if(r==n.dom.firstChild)return i;for(;r&&!lt.get(r);)r=r.nextSibling;if(!r)return i+n.length;for(let e=0,t=i;;e++){let i=n.children[e];if(i.dom==r)return t;t+=i.length+i.breakAfter}}}domAtPos(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(i,t)}inlineDOMNearPos(e,t){let n,i,r=-1,s=!1,o=-1,a=!1;return this.tile.blockTiles((t,l)=>{if(t.isWidget()){if(32&t.flags&&l>=e)return!0;16&t.flags&&(s=!0)}else{let h=l+t.length;if(l<=e&&(n=t,r=e-l,s=h<e),h>=e&&!i&&(i=t,o=e-l,a=l>e),l>e&&i)return!0}}),n||i?(s&&i?n=null:a&&n&&(i=null),n&&t<0||!i?n.domIn(r,t):i.domIn(o,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:i}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof jt?null:n.coordsInWidget(i,t,!0):n.coordsIn(i,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let i of t.children){if(i.length>=n){let t=e(i,n);if(t)return t}if((n-=i.length)<0)break}else if(t.isText()&&n<t.length){let e=(0,i.zK)(t.text,n);if(e==n)return null;let r=te(t.dom,n,e).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:i}=e,r=this.view.contentDOM.clientWidth,s=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==ae.LTR,l=0,h=(e,c,u)=>{for(let d=0;d<e.children.length&&!(c>i);d++){let i=e.children[d],f=c+i.length,p=i.dom.getBoundingClientRect(),{height:m}=p;if(u&&!d&&(l+=p.top-u.top),i instanceof dt)f>n&&h(i,c,p);else if(c>=n&&(l>0&&t.push(-l),t.push(m+l),l=0,s)){let e=i.dom.lastChild,t=e?F(e):[];if(t.length){let e=t[t.length-1],n=a?e.right-p.left:p.right-e.left;n>o&&(o=n,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=f)}}u&&d==e.children.length-1&&(l+=u.bottom-p.bottom),c=f+i.breakAfter}};return h(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?ae.RTL:ae.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t,n=0;for(let i of e.children){if(!i.isText()||/[^ -~]/.test(i.text))return;let e=F(i.dom);if(1!=e.length)return;n+=e[0].width,t=e[0].height}if(n)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:n/e.length,textHeight:t}}});if(e)return e;let t,n,i,r=document.createElement("div");return r.className="cm-line",r.style.width="99999px",r.style.position="absolute",r.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(r);let e=F(r.firstChild)[0];t=r.getBoundingClientRect().height,n=e&&e.width?e.width/27:7,i=e&&e.height?e.height:t,r.remove()}),{lineHeight:t,charWidth:n,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,i=0;;i++){let r=i==t.viewports.length?null:t.viewports[i],s=r?r.from-1:this.view.state.doc.length;if(s>n){let i=(t.lineBlockAt(s).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(D.replace({widget:new jt(i),block:!0,inclusive:!0,isBlockGap:!0}).range(n,s))}if(!r)break;n=r.to+1}return D.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Ke).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(Ze).map((e,t)=>{let i="function"==typeof e;return i&&(n=!0),i?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(i.om.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(Ge).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){var t;if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(Ie))try{if(t(this.view,e.range,e))return!0}catch(e){We(this.view.state,e,"scroll handler")}let n,{range:i}=e,r=this.coordsAt(i.head,null!==(t=i.assoc)&&void 0!==t?t:i.empty?0:i.head>i.anchor?-1:1);if(!r)return;!i.empty&&(n=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(r={left:Math.min(r.left,n.left),top:Math.min(r.top,n.top),right:Math.max(r.right,n.right),bottom:Math.max(r.bottom,n.bottom)});let s=it(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;if(function(e,t,n,i,r,s,o,a){let l=e.ownerDocument,h=l.defaultView||window;for(let c=e,u=!1;c&&!u;)if(1==c.nodeType){let e,d=c==l.body,f=1,p=1;if(d)e=U(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(u=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:f,scaleY:p}=Y(c,t)),e={left:t.left,right:t.left+c.clientWidth*f,top:t.top,bottom:t.top+c.clientHeight*p}}let m=0,g=0;if("nearest"==r)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let i=t.bottom-t.top,s=e.bottom-e.top;g=("center"==r&&i<=s?t.top+i/2-s/2:"start"==r||"center"==r&&n<0?t.top-o:t.bottom-s+o)-e.top}if("nearest"==i?t.left<e.left+s?(m=t.left-(e.left+s),n>0&&t.right>e.right+m&&(m=t.right-e.right+s)):t.right>e.right-s&&(m=t.right-e.right+s,n<0&&t.left<e.left+m&&(m=t.left-(e.left+s))):m=("center"==i?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==i==a?t.left-s:t.right-(e.right-e.left)+s)-e.left,m||g)if(d)h.scrollBy(m,g);else{let e=0,n=0;if(g){let e=c.scrollTop;c.scrollTop+=g/p,n=(c.scrollTop-e)*p}if(m){let t=c.scrollLeft;c.scrollLeft+=m/f,e=(c.scrollLeft-t)*f}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-m)<1&&(i="nearest"),n&&Math.abs(n-g)<1&&(r="nearest")}if(d)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else{if(11!=c.nodeType)break;c=c.host}}(this.view.scrollDOM,o,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==ae.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(i.head,1);e&&e.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Lt(this.tile)}}function Lt(e,t){let n=null==t?void 0:t.get(e);if(1!=n){null==n&&e.destroy();for(let n of e.children)Lt(n,t)}}function Rt(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=re(n.focusNode,n.focusOffset),r=se(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let t=lt.get(r.node);if(!t||t.isText()&&t.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let e=lt.get(i.node);!e||e.isText()&&e.text!=i.node.nodeValue||(s=r)}}if(e.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=t-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}let Et=class{constructor(){this.changes=[]}compareRange(e,t){j(e,t,this.changes)}comparePoint(e,t){j(e,t,this.changes)}boundChange(e){j(e,e,this.changes)}};class Bt{constructor(){this.changes=[]}compareRange(e,t){j(e,t,this.changes)}comparePoint(){}boundChange(e){j(e,e,this.changes)}}class jt extends P{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Nt(e,t,n){let i=e.lineBlockAt(t);if(Array.isArray(i.type)){let e;for(let r of i.type){if(r.from>t)break;if(!(r.to<t)){if(r.from<t&&r.to>t)return r;e&&(r.type!=z.Text||e.type==r.type&&!(n<0?r.from<t:r.to>t))||(e=r)}}return e||i}return i}function It(e,t,n,i){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let a=t,l=null;;){let t=Ce(r,s,o,a,n),h=Se;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;h="\n",r=e.state.doc.line(r.number+(n?1:-1)),s=e.bidiSpans(r),t=e.visualLineSide(r,!n)}if(l){if(!l(h))return a}else{if(!i)return t;l=i(h)}a=t}}function $t(e,t,n){for(;;){let i=0;for(let r of e)r.between(t-1,t+1,(e,r,s)=>{if(t>e&&t<r){let s=i||n||(t-e<r-t?-1:1);t=s<0?e:r,i=s}});if(!i)return t}}function Qt(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let s=t.ranges[r],o=null;if(s.empty){let t=$t(e,s.from,0);t!=s.from&&(o=i.OF.cursor(t,-1))}else{let t=$t(e,s.from,-1),n=$t(e,s.to,1);t==s.from&&n==s.to||(o=i.OF.range(s.from==s.anchor?t:n,s.from==s.head?t:n))}o&&(n||(n=t.ranges.slice()),n[r]=o)}return n?i.OF.create(n,t.mainIndex):t}function Ft(e,t,n){let r=$t(e.state.facet(Je).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:i.OF.cursor(r,r<n.from?1:-1)}class Wt{constructor(e,t){this.pos=e,this.assoc=t}}function _t(e,t,n,r){let s,o=e.contentDOM.getBoundingClientRect(),a=o.top+e.viewState.paddingTop,{x:l,y:h}=t,c=h-a;for(;;){if(c<0)return new Wt(0,1);if(c>e.viewState.docHeight)return new Wt(e.state.doc.length,-1);if(s=e.elementAtHeight(c),null==r)break;if(s.type==z.Text){if(r<0?s.to<e.viewport.from:s.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?s.from:s.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?s.bottom+t:s.top-t}if(e.viewport.from>=s.to||e.viewport.to<=s.from){if(n)return null;if(s.type==z.Text){let t=function(e,t,n,r,s){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((s-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+(0,i.kn)(a,o,e.state.tabSize)}(e,o,s,l,h);return new Wt(t,t==s.from?1:-1)}}if(s.type!=z.Text)return c<(s.top+s.bottom)/2?new Wt(s.from,1):new Wt(s.to,-1);let u=e.docView.lineAt(s.from,2);return u&&u.length==s.length||(u=e.docView.lineAt(s.from,-2)),new Vt(e,l,h,e.textDirectionAt(s.from)).scanTile(u,s.from)}class Vt{constructor(e,t,n,i){this.view=e,this.x=t,this.y=n,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[be.find(i,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:i}=this.bidiSpansAt(e);return i[be.find(i,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:i}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+i.from<t)}scan(e,t){let n,i,r,s=0,o=e.length-1,a=new Set,l=this.bidiIn(e[0],e[o]),h=-1,c=1e9;e:for(;s<o;){let u=o-s,d=s+o>>1;t:if(a.has(d)){let e=s+Math.floor(Math.random()*u);for(let t=0;t<u;t++){if(!a.has(e)){d=e;break t}e++,e==o&&(e=s)}break e}a.add(d);let f=t(d);if(f)for(let t=0;t<f.length;t++){let a=f[t],u=0;if(!(0==a.width&&f.length>1)){if(a.bottom<this.y)(!n||n.bottom<a.bottom)&&(n=a),u=1;else if(a.top>this.y)(!i||i.top>a.top)&&(i=a),u=-1;else{let e=a.left>this.x?this.x-a.left:a.right<this.x?this.x-a.right:0,t=Math.abs(e);t<c&&(h=d,c=t,r=a),e&&(u=e<0==(this.baseDir==ae.LTR)?-1:1)}-1!=u||l&&!this.baseDirAt(e[d],1)?1!=u||l&&!this.baseDirAt(e[d+1],-1)||(s=d+1):o=d}}}if(!r){let r=n&&(!i||this.y-n.bottom<i.top-this.y)?n:i;return this.y=(r.top+r.bottom)/2,this.scan(e,t)}if(c){let{top:s,bottom:o}=r;if(n&&n.bottom>(s+s+o)/3)return this.y=n.bottom-1,this.scan(e,t);if(i&&i.top<(s+o+o)/3)return this.y=i.top+1,this.scan(e,t)}let u=(l?this.dirAt(e[h],1):this.baseDir)==ae.LTR;return{i:h,after:this.x>(r.left+r.right)/2==u}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=(0,i.zK)(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,i=>{let r=n[i]-t,s=n[i+1]-t;return te(e.dom,r,s).getClientRects()});return r.after?new Wt(n[r.i+1],-1):new Wt(n[r.i],1)}scanTile(e,t){if(!e.length)return new Wt(t,1);if(1==e.children.length){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let i=0,r=t;i<e.children.length;i++)n.push(r+=e.children[i].length);let i=this.scan(n,t=>{let n=e.children[t];return 48&n.flags?null:(1==n.dom.nodeType?n.dom:te(n.dom,0,n.length)).getClientRects()}),r=e.children[i.i],s=n[i.i];return r.isText()?this.scanText(r,s):r.isComposite()?this.scanTile(r,s):i.after?new Wt(n[i.i+1],-1):new Wt(s,1)}}const qt="";class Ht{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(i.$t.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=qt}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let i=e;;){this.findPointBefore(n,i);let e=this.text.length;this.readNode(i);let r=lt.get(i),s=i.nextSibling;if(s==t){(null==r?void 0:r.breakAfter)&&!s&&n!=this.view.contentDOM&&this.lineBreak();break}let o=lt.get(s);(r&&o?r.breakAfter:(r?r.breakAfter:V(i))||V(s)&&("BR"!=i.nodeName||(null==r?void 0:r.isWidget()))&&this.text.length>e)&&!Ut(s,t)&&this.lineBreak(),i=s}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,i=this.lineSeparator?null:/\r\n?|\n/g;;){let r,s=-1,o=1;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(r=i.exec(t))&&(s=r.index,o=r[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);n=s+o}}readNode(e){let t=lt.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&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)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Xt(e,n.node,n.offset)?t:0))}}function Xt(e,t,n){for(;;){if(!t||n<H(t))return!1;if(t==e)return!0;n=_(t)+1,t=t.parentNode}}function Ut(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=lt.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}class Yt{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Kt{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Gt(e.docView.tile,t,n,0))){let t=s||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=e.observer.selectionRange;return n&&(t.push(new Yt(n,i)),r==n&&s==i||t.push(new Yt(r,s))),t}(e),n=new Ht(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?i.OF.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=s&&s.node==t.focusNode&&s.offset==t.focusOffset||!$(e.contentDOM,t.focusNode)?a.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!$(e.contentDOM,t.anchorNode)?a.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),l=e.viewport;if((O.ios||O.chrome)&&a.main.empty&&n!=r&&(l.from>0||l.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),s=l.from-t,o=l.to-i;0!=s&&1!=s&&0!=t||0!=o&&-1!=o&&i!=e.state.doc.length||(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(i.OF.range(r,n));else if(e.lineWrapping&&r==n&&(!a.main.empty||a.main.head!=n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=i.OF.create([i.OF.cursor(n,r)])}else this.newSel=i.OF.single(r,n)}}}function Gt(e,t,n,i){if(e.isComposite()){let r=-1,s=-1,o=-1,a=-1;for(let l=0,h=i,c=i;l<e.children.length;l++){let i=e.children[l],u=h+i.length;if(h<t&&u>n)return Gt(i,t,n,h);if(u>=t&&-1==r&&(r=l,s=h),h>n&&i.dom.parentNode==e.dom){o=l,a=c;break}c=u,h=u+i.breakAfter}return{from:s,to:a<0?i+e.length:a,startDOM:(r?e.children[r-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:i,to:i+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function Zt(e,t){let n,{newSel:r}=t,{state:s}=e,o=s.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,l=o.from,h=null;(8===a||O.android&&t.text.length<r-e)&&(l=o.to,h="end");let c,u,d=s.doc.sliceString(e,r,qt);!o.empty&&o.from>=e&&o.to<=r&&(t.typeOver||d!=t.text)&&d.slice(0,o.from-e)==t.text.slice(0,o.from-e)&&d.slice(o.to-e)==t.text.slice(c=t.text.length-(d.length-(o.to-e)))?n={from:o.from,to:o.to,insert:i.EY.of(t.text.slice(o.from-e,c).split(qt))}:(u=en(d,t.text,l-e,h))&&(O.chrome&&13==a&&u.toB==u.from+2&&t.text.slice(u.from,u.toB)==qt+qt&&u.toB--,n={from:e+u.from,to:e+u.toA,insert:i.EY.of(t.text.slice(u.from,u.toB).split(qt))})}else r&&(!e.hasFocus&&s.facet(_e)||tn(r,o))&&(r=null);if(!n&&!r)return!1;if((O.mac||O.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=i.OF.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:i.EY.of([n.insert.toString().replace("."," ")])}):s.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:s.toText(e.inputState.insertingText)}:O.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=i.OF.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:i.EY.of([" "])}),n)return Jt(e,n,r,a);if(r&&!tn(r,o)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin,"select.pointer"==n&&(r=Qt(s.facet(Je).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function Jt(e,t,n,r=-1){if(O.ios&&e.inputState.flushIOSKey(t))return!0;let s=e.state.selection.main;if(O.android&&(t.to==s.to&&(t.from==s.from||t.from==s.from-1&&" "==e.state.sliceDoc(t.from,s.from))&&1==t.insert.length&&2==t.insert.lines&&ne(e.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>s.head)&&ne(e.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&0==t.insert.length&&ne(e.contentDOM,"Delete",46)))return!0;let o,a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l=()=>o||(o=function(e,t,n){let r,s=e.state,o=s.selection.main,a=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let n=t.from<o.from?-1:1,i=n<0?o.from:o.to,r=$t(s.facet(Je).map(t=>t(e)),i,n);t.from==r&&(a=r)}if(a>-1)r={changes:t,selection:i.OF.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?s.sliceDoc(o.from,t.from):"",i=o.to>t.to?s.sliceDoc(t.to,o.to):"";r=s.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+i))}else{let a=s.changes(t),l=n&&n.main.to<=a.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let h,c=e.state.sliceDoc(t.from,t.to),u=n&&Rt(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);h={from:u.from,to:u.to-e}}else h=e.state.doc.lineAt(o.head);let d=o.to-t.to;r=s.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:a,range:l||n.map(a)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=h.from&&u<=h.to)return{range:n};let f=s.changes({from:u,to:r,insert:t.insert}),p=n.to-o.to;return{changes:f,range:l?i.OF.range(Math.max(0,l.anchor+p),Math.max(0,l.head+p)):n.map(f)}})}else r={changes:a,selection:l&&s.selection.replaceRange(l)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:l,scrollIntoView:!0})}(e,t,n));return e.state.facet(Le).some(n=>n(e,t.from,t.to,a,l))||e.dispatch(l()),!0}function en(e,t,n,i){let r=Math.min(e.length,t.length),s=0;for(;s<r&&e.charCodeAt(s)==t.charCodeAt(s);)s++;if(s==r&&e.length==t.length)return null;let o=e.length,a=t.length;for(;o>0&&a>0&&e.charCodeAt(o-1)==t.charCodeAt(a-1);)o--,a--;return"end"==i&&(n-=o+Math.max(0,s-Math.min(o,a))-s),o<s&&e.length<t.length?(s-=n<=s&&n>=o?s-n:0,a=s+(a-o),o=s):a<s&&(s-=n<=s&&n>=a?s-n:0,o=s+(o-a),a=s),{from:s,toA:o,toB:a}}function tn(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class nn{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,O.safari&&e.contentDOM.addEventListener("input",()=>null),O.gecko&&function(e){Tn.has(e)||(Tn.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,i=t.target;i!=e.contentDOM;i=i.parentNode)if(!i||11==i.nodeType||(n=lt.get(i))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=sn(e),n=this.handlers,i=this.view.contentDOM;for(let e in t)if("scroll"!=e){let r=!t[e].handlers.length,s=n[e];s&&r!=!s.handlers.length&&(i.removeEventListener(e,this.handleEvent),s=null),s||i.addEventListener(e,this.handleEvent,{passive:r})}for(let e in n)"scroll"==e||t[e]||i.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&ln.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),O.android&&O.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!O.ios||e.synthetic||e.altKey||e.metaKey||e.shiftKey||!((t=on.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||an.indexOf(e.key)>-1&&e.ctrlKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,ne(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!(!/^key/.test(e.type)||e.synthetic)&&(this.composing>0||!!(O.safari&&!O.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}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 rn(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(e){We(n.state,e)}}}function sn(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,i=e&&e.plugin.domEventHandlers,r=e&&e.plugin.domEventObservers;if(i)for(let e in i){let r=i[e];r&&n(e).handlers.push(rn(t.value,r))}if(r)for(let e in r){let i=r[e];i&&n(e).observers.push(rn(t.value,i))}}for(let e in un)n(e).handlers.push(un[e]);for(let e in dn)n(e).observers.push(dn[e]);return t}const on=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],an="dthko",ln=[16,17,18,20,91,92,224,225];function hn(e){return.7*Math.max(0,e)+8}class cn{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=K(e.contentDOM),this.atoms=e.state.facet(Je).map(t=>t(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(i.$t.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Te);return n.length?n[0](t):O.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=I(e.root);if(!i||0==i.rangeCount)return!0;let r=i.getRangeAt(0).getClientRects();for(let e=0;e<r.length;e++){let n=r[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=wn(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(t=this.startEvent,n=e,Math.max(Math.abs(t.clientX-n.clientX),Math.abs(t.clientY-n.clientY))<10))return;var t,n;this.select(this.lastEvent=e);let i=0,r=0,s=0,o=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:l}=this.scrollParents.y.getBoundingClientRect());let h=it(this.view);e.clientX-h.left<=s+6?i=-hn(s-e.clientX):e.clientX+h.right>=a-6&&(i=hn(e.clientX-a)),e.clientY-h.top<=o+6?r=-hn(o-e.clientY):e.clientY+h.bottom>=l-6&&(r=hn(e.clientY-l)),this.setScrollSpeed(i,r)}up(e){null==this.dragging&&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),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Qt(this.atoms,this.style.get(e,this.extend,this.multiple));!this.mustSelect&&n.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}const un=Object.create(null),dn=Object.create(null),fn=O.ie&&O.ie_version<15||O.ios&&O.webkit_version<604;function pn(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function mn(e,t){t=pn(e.state,Ee,t);let n,{state:r}=e,s=1,o=r.toText(t),a=o.lines==r.selection.ranges.length;if(null!=On&&r.selection.ranges.every(e=>e.empty)&&On==o.toString()){let e=-1;n=r.changeByRange(n=>{let l=r.doc.lineAt(n.from);if(l.from==e)return{range:n};e=l.from;let h=r.toText((a?o.line(s++).text:t)+r.lineBreak);return{changes:{from:l.from,insert:h},range:i.OF.cursor(n.from+h.length)}})}else n=a?r.changeByRange(e=>{let t=o.line(s++);return{changes:{from:e.from,to:e.to,insert:t.text},range:i.OF.cursor(e.from+t.length)}}):r.replaceSelection(o);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function gn(e,t,n,r){if(1==r)return i.OF.cursor(t,n);if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),s=e.doc.lineAt(t),o=t-s.from;if(0==s.length)return i.OF.cursor(t);0==o?n=1:o==s.length&&(n=-1);let a=o,l=o;n<0?a=(0,i.zK)(s.text,o,!1):l=(0,i.zK)(s.text,o);let h=r(s.text.slice(a,l));for(;a>0;){let e=(0,i.zK)(s.text,a,!1);if(r(s.text.slice(e,a))!=h)break;a=e}for(;l<s.length;){let e=(0,i.zK)(s.text,l);if(r(s.text.slice(l,e))!=h)break;l=e}return i.OF.range(a+s.from,l+s.from)}(e.state,t,n);{let r=e.docView.lineAt(t,n),s=e.state.doc.lineAt(r?r.posAtEnd:t),o=r?r.posAtStart:s.from,a=r?r.posAtEnd:s.to;return a<e.state.doc.length&&a==s.to&&a++,i.OF.range(o,a)}}dn.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},dn.wheel=dn.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},un.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),dn.touchstart=(e,t)=>{let n=e.inputState,i=t.targetTouches[0];n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")},dn.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},un.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of e.state.facet(Pe))if(n=i(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=wn(t),s=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),s=s.map(e.changes))},get(t,o,a){let l,h=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c=gn(e,h.pos,h.assoc,r);if(n.pos!=h.pos&&!o){let t=gn(e,n.pos,n.assoc,r),s=Math.min(t.from,c.from),o=Math.max(t.to,c.to);c=s<c.from?i.OF.range(s,o,c.assoc):i.OF.range(o,s,c.assoc)}return o?s.replaceRange(s.main.extend(c.from,c.to,c.assoc)):a&&1==r&&s.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:s}=e.ranges[n];if(r<=t&&s>=t)return i.OF.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(s,h.pos))?l:a?s.addRange(c):i.OF.create([c])}}}(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new cn(e,t,n,i)),i&&e.observer.ignore(()=>{ee(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};const bn=O.ie&&O.ie_version<=11;let yn=null,vn=0,kn=0;function wn(e){if(!bn)return e.detail;let t=yn,n=kn;return yn=e,kn=Date.now(),vn=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(vn+1)%3:1}function xn(e,t,n,i){if(!(n=pn(e.state,Ee,n)))return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,o=i&&s&&function(e,t){let n=e.state.facet(Me);return n.length?n[0](t):O.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:s.from,to:s.to}:null,a={from:r,insert:n},l=e.state.changes(o?[o,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),e.inputState.draggedContent=null}un.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=i.OF.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",pn(e.state,Be,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},un.dragend=e=>(e.inputState.draggedContent=null,!1),un.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&xn(e,t,i.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=s,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(i[e]=t.result),s()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return xn(e,t,n,!0),!0}return!1},un.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=fn?null:t.clipboardData;return n?(mn(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),mn(e,n.value)},50)}(e),!1)};let On=null;un.copy=un.cut=(e,t)=>{if(!Q(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=function(e){let t=[],n=[],i=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let r=-1;for(let{from:i}of e.selection.ranges){let s=e.doc.lineAt(i);s.number>r&&(t.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),r=s.number}i=!0}return{text:pn(e,Be,t.join(e.lineBreak)),ranges:n,linewise:i}}(e.state);if(!n&&!r)return!1;On=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=fn?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),e.focus()},50)}(e,n),!1)};const Sn=i.YH.define();function Cn(e,t){let n=[];for(let i of e.facet(Re)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:Sn.of(!0)}):null}function An(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Cn(e.state,t);n?e.dispatch(n):e.update([])}},10)}dn.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),An(e)},dn.blur=e=>{e.observer.clearSelectionRange(),An(e)},dn.compositionstart=dn.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},dn.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,O.chrome&&O.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},dn.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},un.beforeinput=(e,t)=>{var n,i;if("insertText"!=t.inputType&&"insertCompositionText"!=t.inputType||(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let i=null===(n=t.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),r=t.getTargetRanges();if(i&&r.length){let t=r[0],n=e.posAtDOM(t.startContainer,t.startOffset),s=e.posAtDOM(t.endContainer,t.endOffset);return Jt(e,{from:n,to:s,insert:e.state.toText(i)},null),!0}}let r;if(O.chrome&&O.android&&(r=on.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout(()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return O.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),O.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>dn.compositionend(e,t),20),!1};const Tn=new Set,Mn=["pre-wrap","normal","pre-line","break-spaces"];let Pn=!1;function zn(){Pn=!1}class Dn{constructor(e){this.lineWrapping=e,this.doc=i.EY.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)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Mn.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let i=e[n];i<0?n++:this.heightSamples[Math.floor(10*i)]||(t=!0,this.heightSamples[Math.floor(10*i)]=!0)}return t}refresh(e,t,n,i,r,s){let o=Mn.indexOf(e)>-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=i,this.lineLength=r,a){this.heightSamples={};for(let e=0;e<s.length;e++){let t=s[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class Ln{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Rn{constructor(e,t,n,i,r){this.from=e,this.length=t,this.top=n,this.height=i,this._content=r}get type(){return"number"==typeof this._content?z.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof E?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Rn(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var En=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(En||(En={}));const Bn=.001;class jn{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Bn&&(Pn=!0),this.height=e)}replace(e,t,n){return jn.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,i){let r=this,s=n.doc;for(let o=i.length-1;o>=0;o--){let{fromA:a,toA:l,fromB:h,toB:c}=i[o],u=r.lineAt(a,En.ByPosNoHeight,n.setDoc(t),0,0),d=u.to>=l?u:r.lineAt(l,En.ByPosNoHeight,n,0,0);for(c+=d.to-l,l=d.to;o>0&&u.from<=i[o-1].toA;)a=i[o-1].fromA,h=i[o-1].fromB,o--,a<u.from&&(u=r.lineAt(a,En.ByPosNoHeight,n,0,0));h+=u.from-a,a=u.from;let f=qn.build(n.setDoc(s),e,h,c);r=Nn(r,r.replace(a,l,f))}return r.updateHeight(n,0)}static empty(){return new Qn(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,i=0,r=0;for(;;)if(t==n)if(i>2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,i-=r.size}else{if(!(r>2*i))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(i<r){let n=e[t++];n&&(i+=n.size)}else{let t=e[--n];t&&(r+=t.size)}let s=0;return null==e[t-1]?(s=1,t--):null==e[t]&&(s=1,n++),new Wn(jn.of(e.slice(0,t)),s,jn.of(e.slice(n)))}}function Nn(e,t){return e==t?e:(e.constructor!=t.constructor&&(Pn=!0),t)}jn.prototype.size=1;const In=D.replace({});class $n extends jn{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new Rn(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,i){return this.spaceAbove&&e<n+this.spaceAbove?new Rn(i,0,n,this.spaceAbove,In):this.mainBlock(n,i)}lineAt(e,t,n,i,r){let s=this.mainBlock(i,r);return this.spaceAbove?this.blockAt(0,n,i,r).join(s):s}forEachLine(e,t,n,i,r,s){e<=r+this.length&&t>=r&&s(this.lineAt(0,En.ByPos,n,i,r))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Qn extends $n{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new Rn(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let i=n[0];return 1==n.length&&(i instanceof Qn||i instanceof Fn&&4&i.flags)&&Math.abs(this.length-i.length)<10?(i instanceof Fn?i=new Qn(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):jn.of(n)}updateHeight(e,t=0,n=!1,i){return i&&i.from<=t&&i.more?this.setMeasuredHeight(i):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Fn extends jn{constructor(e){super(e,0)}heightMetrics(e,t){let n,i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*s);n=t/s,this.length>s+1&&(o=(this.height-t)/(this.length-s-1))}else n=this.height/s;return{firstLine:i,lastLine:r,perLine:n,perChar:o}}blockAt(e,t,n,i){let{firstLine:r,lastLine:s,perLine:o,perChar:a}=this.heightMetrics(t,i);if(t.lineWrapping){let r=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),s=t.doc.lineAt(r),l=o+s.length*a,h=Math.max(n,e-l/2);return new Rn(s.from,s.length,h,l,0)}{let i=Math.max(0,Math.min(s-r,Math.floor((e-n)/o))),{from:a,length:l}=t.doc.line(r+i);return new Rn(a,l,n+o*i,o,0)}}lineAt(e,t,n,i,r){if(t==En.ByHeight)return this.blockAt(e,n,i,r);if(t==En.ByPosNoHeight){let{from:t,to:i}=n.doc.lineAt(e);return new Rn(t,i-t,0,0,0)}let{firstLine:s,perLine:o,perChar:a}=this.heightMetrics(n,r),l=n.doc.lineAt(e),h=o+l.length*a,c=l.number-s,u=i+o*c+a*(l.from-r-c);return new Rn(l.from,l.length,Math.max(i,Math.min(u,i+this.height-h)),h,0)}forEachLine(e,t,n,i,r,s){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(n,r);for(let h=e,c=i;h<=t;){let t=n.doc.lineAt(h);if(h==e){let n=t.number-o;c+=a*n+l*(e-r-n)}let i=a+l*t.length;s(new Rn(t.from,t.length,c,i,0)),c+=i,h=t.to+1}}replace(e,t,n){let i=this.length-t;if(i>0){let e=n[n.length-1];e instanceof Fn?n[n.length-1]=new Fn(e.length+i):n.push(null,new Fn(i-1))}if(e>0){let t=n[0];t instanceof Fn?n[0]=new Fn(e+t.length):n.unshift(new Fn(e-1),null)}return jn.of(n)}decomposeLeft(e,t){t.push(new Fn(e-1),null)}decomposeRight(e,t){t.push(null,new Fn(this.length-e-1))}updateHeight(e,t=0,n=!1,i){let r=t+this.length;if(i&&i.from<=t+this.length&&i.more){let n=[],s=Math.max(t,i.from),o=-1;for(i.from>t&&n.push(new Fn(i.from-t-1).updateHeight(e,t));s<=r&&i.more;){let t=e.doc.lineAt(s).length;n.length&&n.push(null);let r=i.heights[i.index++],a=0;r<0&&(a=-r,r=i.heights[i.index++]),-1==o?o=r:Math.abs(r-o)>=Bn&&(o=-2);let l=new Qn(t,r,a);l.outdated=!1,n.push(l),s+=t+1}s<=r&&n.push(null,new Fn(r-s).updateHeight(e,s));let a=jn.of(n);return(o<0||Math.abs(a.height-this.height)>=Bn||Math.abs(o-this.heightMetrics(e,t).perLine)>=Bn)&&(Pn=!0),Nn(this,a)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Wn extends jn{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 1&this.flags}blockAt(e,t,n,i){let r=n+this.left.height;return e<r?this.left.blockAt(e,t,n,i):this.right.blockAt(e,t,r,i+this.left.length+this.break)}lineAt(e,t,n,i,r){let s=i+this.left.height,o=r+this.left.length+this.break,a=t==En.ByHeight?e<s:e<o,l=a?this.left.lineAt(e,t,n,i,r):this.right.lineAt(e,t,n,s,o);if(this.break||(a?l.to<o:l.from>o))return l;let h=t==En.ByPosNoHeight?En.ByPosNoHeight:En.ByPos;return a?l.join(this.right.lineAt(o,h,n,s,o)):this.left.lineAt(o,h,n,i,r).join(l)}forEachLine(e,t,n,i,r,s){let o=i+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,i,r,s),t>=a&&this.right.forEachLine(e,t,n,o,a,s);else{let l=this.lineAt(a,En.ByPos,n,i,r);e<l.from&&this.left.forEachLine(e,l.from-1,n,i,r,s),l.to>=e&&l.from<=t&&s(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,o,a,s)}}replace(e,t,n){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,n));let r=[];e>0&&this.decomposeLeft(e,r);let s=r.length;for(let e of n)r.push(e);if(e>0&&Vn(r,s-1),t<this.length){let e=r.length;this.decomposeRight(t,r),Vn(r,e)}return jn.of(r)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,i=n+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?jn.of(this.break?[e,null,t]:[e,t]):(this.left=Nn(this.left,e),this.right=Nn(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,i){let{left:r,right:s}=this,o=t+r.length+this.break,a=null;return i&&i.from<=t+r.length&&i.more?a=r=r.updateHeight(e,t,n,i):r.updateHeight(e,t,n),i&&i.from<=o+s.length&&i.more?a=s=s.updateHeight(e,o,n,i):s.updateHeight(e,o,n),a?this.balanced(r,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Vn(e,t){let n,i;null==e[t]&&(n=e[t-1])instanceof Fn&&(i=e[t+1])instanceof Fn&&e.splice(t-1,3,new Fn(n.length+1+i.length))}class qn{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 e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Qn?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Qn(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let i=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=t-e;n.block?this.addBlock(new $n(s,i,n)):(s||r||i>=5)&&this.addLineDeco(i,r,s)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Qn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new Fn(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 Qn)return e;let t=new Qn(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let i=this.ensureLine();i.length+=n,i.collapsed+=n,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Qn||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Qn(0,-1,0));let n=e;for(let e of this.nodes)e instanceof Qn&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let s=new qn(n,e);return i.om.spans(t,n,r,s,0),s.finish(n)}}class Hn{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,i){(e<t||n&&n.heightRelevant||i&&i.heightRelevant)&&j(e,t,this.changes,5)}}function Xn(e,t){let n=e.getBoundingClientRect(),i=e.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),o=Math.min(r.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(r.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=i.body;)if(1==t.nodeType){let n=t,i=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=i.overflow){let i=n.getBoundingClientRect();s=Math.max(s,i.left),o=Math.min(o,i.right),a=Math.max(a,i.top),l=Math.min(t==e.parentNode?r.innerHeight:l,i.bottom)}t="absolute"==i.position||"fixed"==i.position?n.offsetParent:n.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:s-n.left,right:Math.max(s,o)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function Un(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class Yn{constructor(e,t,n,i){this.from=e,this.to=t,this.size=n,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i.from!=r.from||i.to!=r.to||i.size!=r.size)return!1}return!0}draw(e,t){return D.replace({widget:new Kn(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class Kn extends P{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Gn{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=ti,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ae.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(Ye).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new Dn(n),this.stateDeco=ni(t),this.heightMap=jn.empty().applyChanges(this.stateDeco,i.EY.empty,this.heightOracle.setDoc(t.doc),[new st(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=D.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let i=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>i>=e&&i<=t)){let{from:t,to:n}=this.lineBlockAt(i);e.push(new Zn(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?ti:new ii(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(ri(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=ni(this.state);let r=e.changedRanges,s=st.extendWithRanges(r,function(e,t,n){let r=new Hn;return i.om.compare(e,t,n,r,0),r.changes}(n,this.stateDeco,e?e.changes:i.VR.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);zn(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Pn)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let h=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(h||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Ne)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?ae.RTL:ae.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||"refresh"===this.mustMeasureContent,a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let h=0,c=0;if(a.width&&a.height){let{scaleX:e,scaleY:n}=Y(t,a);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,h|=16,o=l=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let f=K(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=ie(this.scrollParent||e.win);let m=(this.printing?Un:Xn)(t,this.paddingTop),g=m.top-this.pixelViewport.top,b=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}(e.dom))return 0;let v=a.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),l){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:i,textHeight:a}=e.docView.measureTextSize();o=n>0&&r.refresh(s,n,i,a,Math.max(5,v/i),t),o&&(e.docView.minWidth=0,h|=16)}g>0&&b>0?c=Math.max(g,b):g<0&&b<0&&(c=Math.min(g,b)),zn();for(let n of this.viewports){let s=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(o?jn.empty().applyChanges(this.stateDeco,i.EY.empty,this.heightOracle,[new st(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new Ln(n.from,s))}Pn&&(h|=2)}let k=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return k&&(2&h&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(2&h||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,r=this.heightOracle,{visibleTop:s,visibleBottom:o}=this,a=new Zn(i.lineAt(s-1e3*n,En.ByHeight,r,0,0).from,i.lineAt(o+1e3*(1-n),En.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let n,s=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=i.lineAt(e,En.ByPos,r,0,0);n="center"==t.y?(o.top+o.bottom)/2-s/2:"start"==t.y||"nearest"==t.y&&e<a.from?o.top:o.bottom-s,a=new Zn(i.lineAt(n-500,En.ByHeight,r,0,0).from,i.lineAt(n+s+500,En.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new Zn(this.heightMap.lineAt(n,En.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,En.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,En.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,En.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:o}=this;return(0==e||i<=s-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||r>=o+Math.max(10,Math.min(n,250)))&&i>s-2e3&&r<o+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let i of e)t.touchesRange(i.from,i.to)||n.push(new Yn(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=ae.LTR&&!n)return[];let a=[],l=(r,o,h,c)=>{if(o-r<s)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<o)return l(r,e-10,h,c),void l(e+10,o,h,c);let f=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=h.from&&e.to<=h.to&&Math.abs(e.from-r)<s&&Math.abs(e.to-o)<s&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(o<h.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(i.OF.cursor(o),!1,!0).head;e>r&&(o=e)}let e=this.gapSize(h,r,o,c);f=new Yn(r,o,e,n||e<2e6?e:2e6)}a.push(f)},h=t=>{if(t.length<o||t.type!=z.Text)return;let s=function(e,t,n){let r=[],s=e,o=0;return i.om.spans(n,e,t,{span(){},point(e,t){e>s&&(r.push({from:s,to:e}),o+=e-s),s=t}},20),s<t&&(r.push({from:s,to:t}),o+=t-s),{total:o,ranges:r}}(t.from,t.to,this.stateDeco);if(s.total<o)return;let a,h,c=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,i=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=c){let r=ei(s,c),o=((this.visibleBottom-this.visibleTop)/2+i)/t.height;e=r-o,n=r+o}else e=(this.visibleTop-t.top-i)/t.height,n=(this.visibleBottom-t.top+i)/t.height;a=Jn(s,e),h=Jn(s,n)}else{let n=s.total*this.heightOracle.charWidth,i=r*this.heightOracle.charWidth,o=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+o<this.pixelViewport.left&&(o=n.size-n.displaySize);let l,u,d=this.pixelViewport.left+o,f=this.pixelViewport.right+o;if(null!=c){let e=ei(s,c),t=((f-d)/2+i)/n;l=e-t,u=e+t}else l=(d-i)/n,u=(f+i)/n;a=Jn(s,l),h=Jn(s,u)}a>t.from&&l(t.from,a,t,s),h<t.to&&l(h,t.to,t,s)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(h):h(e);return a}gapSize(e,t,n,i){let r=ei(i,n)-ei(i,t);return this.heightOracle.lineWrapping?e.height*r:i.total*this.heightOracle.charWidth*r}updateLineGaps(e){Yn.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=D.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];i.om.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(8&r);t++){let i=this.visibleRanges[t],s=n[t];i.from==s.from&&i.to==s.to||(r|=4,e&&e.mapPos(i.from,-1)==s.from&&e.mapPos(i.to,1)==s.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ri(this.heightMap.lineAt(e,En.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)||ri(this.heightMap.lineAt(this.scaler.fromDOM(e),En.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ri(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 Zn{constructor(e,t){this.from=e,this.to=t}}function Jn({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let i=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:r}=t[e],s=r-n;if(i<=s)return n+i;i-=s}}function ei(e,t){let n=0;for(let{from:i,to:r}of e.ranges){if(t<=r){n+=t-i;break}n+=r-i}return n/e.total}const ti={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function ni(e){let t=e.facet(Ke).filter(e=>"function"!=typeof e),n=e.facet(Ze).filter(e=>"function"!=typeof e);return n.length&&t.push(i.om.join(n)),t}class ii{constructor(e,t,n){let i=0,r=0,s=0;this.viewports=n.map(({from:n,to:r})=>{let s=t.lineAt(n,En.ByPos,e,0,0).top,o=t.lineAt(r,En.ByPos,e,0,0).bottom;return i+=o-s,{from:n,to:r,top:s,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let e of this.viewports)e.domTop=s+(e.top-r)*this.scale,s=e.domBottom=e.domTop+(e.bottom-e.top),r=e.bottom}toDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return i+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,i=r.domBottom}}fromDOM(e){for(let t=0,n=0,i=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return n+(e-i)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,i=r.domBottom}}eq(e){return e instanceof ii&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function ri(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Rn(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(e=>ri(e,t)):e._content)}const si=i.sj.define({combine:e=>e.join(" ")}),oi=i.sj.define({combine:e=>e.indexOf(!0)>-1}),ai=r.G.newName(),li=r.G.newName(),hi=r.G.newName(),ci={"&light":"."+li,"&dark":"."+hi};function ui(e,t,n){return new r.G(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}const di=ui("."+ai,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ci),fi={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},pi=O.ie&&O.ie_version<=11;class mi{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new G,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 e of t)this.queue.push(e);(O.ie&&O.ie_version<=11||O.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!O.android||!1===e.constructor.EDIT_CONTEXT||O.chrome&&O.chrome_version<126||(this.editContext=new yi(e),e.state.facet(_e)&&(e.contentDOM.editContext=this.editContext.editContext)),pi&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.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(e=>{e.length>0&&e[e.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){("change"!=e.type&&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,i=this.selectionRange;if(n.state.facet(_e)?n.root.activeElement!=this.dom:!Q(this.dom,i))return;let r=i.anchorNode&&n.docView.tile.nearest(i.anchorNode);r&&r.isWidget()&&r.widget.ignoreEvent(e)?t||(this.selectionChanged=!1):(O.ie&&O.ie_version<=11||O.android&&O.chrome)&&!n.state.selection.main.empty&&i.focusNode&&W(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=I(e.root);if(!t)return!1;let n=O.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return bi(e,n)}let n=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",i,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),n?bi(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let i=Q(this.dom,n);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,i=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=i)return!1;for(i=Math.min(i,H(n));;)if(i){if(1!=n.nodeType)return!1;let e=n.childNodes[i-1];"false"==e.contentEditable?i--:(n=e,i=H(n))}else{if(n==e)return!0;i=_(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,fi),pi&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),pi&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&ne(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,i=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(i=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:i}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),i=this.selectionChanged&&Q(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Kt(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,i=Zt(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!tn(this.view.state.selection,t.newSel.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=gi(t,e.previousSibling||e.target.previousSibling,-1),i=gi(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{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(_e)!=e.state.facet(_e)&&(e.view.contentDOM.editContext=e.state.facet(_e)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.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 gi(e,t,n){for(;t;){let i=lt.get(t);if(i&&i.parent==e)return i;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}function bi(e,t){let n=t.startContainer,i=t.startOffset,r=t.endContainer,s=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return W(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}class yi{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 r=e.state.selection.main,{anchor:s,head:o}=r,a=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:a,drifted:!1});let h=l-a>n.text.length;a==this.from&&s<this.from?a=s:l==this.to&&s>this.to&&(l=s);let c=en(e.state.sliceDoc(a,l),n.text,(h?r.from:r.to)-a,h?"end":null);if(!c){let t=i.OF.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));return void(tn(t,r)||e.dispatch({selection:t,userEvent:"select"}))}let u={from:c.from+a,to:c.toA+a,insert:i.EY.of(n.text.slice(c.from,c.toB).split("\n"))};if((O.mac||O.android)&&u.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(u={from:a,to:l,insert:i.EY.of([n.text.replace("."," ")])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Jt(e,u,i.OF.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let i=[],r=null;for(let t=this.toEditorPos(n.rangeStart),s=this.toEditorPos(n.rangeEnd);t<s;t++){let n=e.coordsForChar(t);r=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||r||new DOMRect,i.push(r)}t.updateCharacterBounds(n.rangeStart,i)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,i=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(i)){let r=this.toEditorPos(e.rangeStart),s=this.toEditorPos(e.rangeEnd);if(r<s){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(i)?1:2}px`;n.push(D.mark({attributes:{style:e}}).range(r,s))}}}e.dispatch({effects:Fe.of(D.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=I(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,i=this.pendingContextChange;return e.changes.iterChanges((r,s,o,a,l)=>{if(n)return;let h=l.length-(s-r);if(i&&s>=i.to){if(i.from==r&&i.to==s&&i.insert.eq(l))return i=this.pendingContextChange=null,t+=h,void(this.to+=h);i=null,this.revertPending(e.state)}if(r+=t,(s+=t)<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||s>this.to||this.to-this.from+l.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(r),this.toContextPos(s),l.toString()),this.to+=h}t+=h}),i&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.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)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(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))),i=this.toContextPos(t.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==i||this.editContext.updateSelection(n,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}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 vi{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new Gn(this,e.state||i.$t.create(e)),e.scrollTo&&e.scrollTo.is(Qe)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(qe).map(e=>new Xe(e));for(let e of this.plugins)e.update(this);this.observer=new mi(this),this.inputState=new nn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Dt(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof i.ZX?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,r=!1,s=this.state;for(let t of e){if(t.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=t.state}if(this.destroyed)return void(this.viewState.state=s);let o=this.hasFocus,a=0,l=null;e.some(e=>e.annotation(Sn))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=Cn(s,o),l||(a=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(i.$t.phrases)!=this.state.facet(i.$t.phrases))return this.setState(s);t=ot.create(this,s,e),t.flags|=a;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection,{x:n,y:r}=this.state.facet(vi.cursorScrollMargin);u=new $e(e.empty?e:i.OF.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",r,n)}for(let e of t.effects)e.is(Qe)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=xi.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(rt)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(t.startState.facet(si)!=t.state.facet(si)&&(this.viewState.mustMeasureContent=!0),(n||r||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(De))try{e(t)}catch(e){We(this.state,e,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!Zt(this,c)&&h.force&&ne(this.contentDOM,h.key,h.keyCode)})}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new Gn(this,e),this.plugins=e.facet(qe).map(e=>new Xe(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new Dt(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(qe),n=e.state.facet(qe);if(t!=n){let i=[];for(let r of n){let n=t.indexOf(r);if(n<0)i.push(new Xe(r));else{let t=this.plugins[n];t.mustUpdate=e,i.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){We(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(s<0)if(ie(n||this.win))r=-1,s=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(i);r=e.from,s=e.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&o||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map(e=>{try{return e.read(this)}catch(e){return We(this.state,e),wi}}),h=ot.create(this,this.state,[]),c=!1;h.flags|=o,t?t.flags|=o:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),c=this.docView.update(h),c&&this.docViewUpdate());for(let e=0;e<a.length;e++)if(l[e]!=wi)try{let t=a[e];t.write&&t.write(l[e],this)}catch(e){We(this.state,e)}if(c&&this.docView.updateSelection(!0),!h.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}{let e=((r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-s)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),s=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(De))e(t)}get themeClasses(){return ai+" "+(this.state.facet(oi)?hi:li)+" "+this.state.facet(si)}updateAttrs(){let e=Oi(this,Ue,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(_e)?"true":"false",class:"cm-content",style:`${O.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Oi(this,Ye,t);let n=this.observer.ignore(()=>{let n=T(this.contentDOM,this.contentAttrs,t),i=T(this.dom,this.editorAttrs,e);return n||i});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(vi.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(rt);let e=this.state.facet(vi.cspNonce);r.G.mount(this.root,this.styleModules.concat(di).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&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(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Ft(this,e,It(this,e,t,n))}moveByGroup(e,t){return Ft(this,e,It(this,e,t,t=>function(e,t,n){let r=e.state.charCategorizer(t),s=r(n);return e=>{let t=r(e);return s==i.Je.Space&&(s=t),s==t}}(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return i.OF.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let s=Nt(e,t.head,t.assoc||-1),o=r&&s.type==z.Text&&(e.lineWrapping||s.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>s.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(s.from),a=e.posAtCoords({x:n==(r==ae.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=a)return i.OF.cursor(a,n?-1:1)}return i.OF.cursor(n?s.to:s.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return Ft(this,e,function(e,t,n,r){let s=t.head,o=n?1:-1;if(s==(n?e.state.doc.length:0))return i.OF.cursor(s,t.assoc);let a,l=t.goalColumn,h=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(s,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(c)null==l&&(l=c.left-h.left),a=o<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(s);null==l&&(l=Math.min(h.right-h.left,e.defaultCharacterWidth*(s-t.from))),a=(o<0?t.top:t.bottom)+u}let d=h.left+l,f=e.viewState.heightOracle.textHeight>>1,p=null!=r?r:f;for(let t=0;;t+=f){let r=a+(p+t)*o,s=_t(e,{x:d,y:r},!1,o);if(n?r>h.bottom:r<h.top)return i.OF.cursor(s.pos,s.assoc);let c=e.coordsAtPos(s.pos,s.assoc),u=c?(c.top+c.bottom)/2:0;if(!c||(n?u>a:u<a))return i.OF.cursor(s.pos,s.assoc,void 0,l)}}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=_t(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),_t(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 i=this.state.doc.lineAt(e),r=this.bidiSpans(i);return X(n,r[be.find(r,e-i.from,-1,t)].dir==ae.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(je)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>ki)return Oe(e.length);let t,n=this.textDirectionAt(e.from);for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||ye(i.isolates,t=tt(this,e))))return i.order;t||(t=tt(this,e));let i=xe(e.text,n,t);return this.bidiCache.push(new xi(e.from,e.to,n,t,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||O.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ee(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var n,r,s,o;return Qe.of(new $e("number"==typeof e?i.OF.cursor(e):e,null!==(n=t.y)&&void 0!==n?n:"nearest",null!==(r=t.x)&&void 0!==r?r:"nearest",null!==(s=t.yMargin)&&void 0!==s?s:5,null!==(o=t.xMargin)&&void 0!==o?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Qe.of(new $e(i.OF.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return He.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return He.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=r.G.newName(),i=[si.of(n),rt.of(ui(`.${n}`,e))];return t&&t.dark&&i.push(oi.of(!0)),i}static baseTheme(e){return i.Nb.lowest(rt.of(ui("."+ai,e,ci)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),i=n&<.get(n)||lt.get(e);return(null===(t=null==i?void 0:i.root)||void 0===t?void 0:t.view)||null}}vi.styleModule=rt,vi.inputHandler=Le,vi.clipboardInputFilter=Ee,vi.clipboardOutputFilter=Be,vi.scrollHandler=Ie,vi.focusChangeEffect=Re,vi.perLineTextDirection=je,vi.exceptionSink=ze,vi.updateListener=De,vi.editable=_e,vi.mouseSelectionStyle=Pe,vi.dragMovesSelection=Me,vi.clickAddsSelectionRange=Te,vi.decorations=Ke,vi.blockWrappers=Ge,vi.outerDecorations=Ze,vi.atomicRanges=Je,vi.bidiIsolatedRanges=et,vi.cursorScrollMargin=i.sj.define({combine:e=>{let t=5,n=5;for(let i of e)"number"==typeof i?t=n=i:({x:t,y:n}=i);return{x:t,y:n}}}),vi.scrollMargins=nt,vi.darkTheme=oi,vi.cspNonce=i.sj.define({combine:e=>e.length?e[0]:""}),vi.contentAttributes=Ye,vi.editorAttributes=Ue,vi.lineWrapping=vi.contentAttributes.of({class:"cm-lineWrapping"}),vi.announce=i.Pe.define();const ki=4096,wi={};class xi{constructor(e,t,n,i,r,s){this.from=e,this.to=t,this.dir=n,this.isolates=i,this.fresh=r,this.order=s}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:ae.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let s=e[r];s.dir!=i||t.touchesRange(s.from,s.to)||n.push(new xi(t.mapPos(s.from,1),t.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return n}}function Oi(e,t,n){for(let i=e.state.facet(t),r=i.length-1;r>=0;r--){let t=i[r],s="function"==typeof t?t(e):t;s&&S(s,n)}return n}const Si=O.mac?"mac":O.windows?"win":O.linux?"linux":"key";function Ci(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const Ai=i.Nb.default(vi.domEventHandlers({keydown:(e,t)=>Ri(Pi(t.state),e,t,"editor")})),Ti=i.sj.define({enables:Ai}),Mi=new WeakMap;function Pi(e){let t=e.facet(Ti),n=Mi.get(t);return n||Mi.set(t,n=function(e,t=Si){let n=Object.create(null),i=Object.create(null),r=(e,t)=>{let n=i[e];if(null==n)i[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},s=(e,i,s,o,a)=>{var l,h;let c=n[e]||(n[e]=Object.create(null)),u=i.split(/ (?!$)/).map(e=>function(e,t){const n=e.split(/-(?!$)/);let i,r,s,o,a=n[n.length-1];"Space"==a&&(a=" ");for(let e=0;e<n.length-1;++e){const a=n[e];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))i=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))s=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==t?o=!0:r=!0}}return i&&(a="Alt-"+a),r&&(a="Ctrl-"+a),o&&(a="Meta-"+a),s&&(a="Shift-"+a),a}(e,t));for(let t=1;t<u.length;t++){let n=u.slice(0,t).join(" ");r(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let i=Di={view:t,prefix:n,scope:e};return setTimeout(()=>{Di==i&&(Di=null)},4e3),!0}]})}let d=u.join(" ");r(d,!1);let f=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null===(h=null===(l=c._any)||void 0===l?void 0:l.run)||void 0===h?void 0:h.slice())||[]});s&&f.run.push(s),o&&(f.preventDefault=!0),a&&(f.stopPropagation=!0)};for(let i of e){let e=i.scope?i.scope.split(" "):["editor"];if(i.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=i;for(let t in e)e[t].run.push(e=>r(e,Li))}let r=i[t]||i.key;if(r)for(let t of e)s(t,r,i.run,i.preventDefault,i.stopPropagation),i.shift&&s(t,"Shift-"+r,i.shift,i.preventDefault,i.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}function zi(e,t,n){return Ri(Pi(e.state),t,e,n)}let Di=null,Li=null;function Ri(e,t,n,r){Li=t;let h=function(e){var t=!(a&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||l&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?o:s)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),c=(0,i.vS)(h,0),u=(0,i.Fh)(c)==h.length&&" "!=h,d="",f=!1,p=!1,m=!1;Di&&Di.view==n&&Di.scope==r&&(d=Di.prefix+" ",ln.indexOf(t.keyCode)<0&&(p=!0,Di=null));let g,b,y=new Set,v=e=>{if(e){for(let t of e.run)if(!y.has(t)&&(y.add(t),t(n)))return e.stopPropagation&&(m=!0),!0;e.preventDefault&&(e.stopPropagation&&(m=!0),p=!0)}return!1},k=e[r];return k&&(v(k[d+Ci(h,t,!u)])?f=!0:!u||!(t.altKey||t.metaKey||t.ctrlKey)||O.windows&&t.ctrlKey&&t.altKey||O.mac&&t.altKey&&!t.ctrlKey&&!t.metaKey||!(g=s[t.keyCode])||g==h?u&&t.shiftKey&&v(k[d+Ci(h,t,!0)])&&(f=!0):(v(k[d+Ci(g,t,!0)])||t.shiftKey&&(b=o[t.keyCode])!=h&&b!=g&&v(k[d+Ci(b,t,!1)]))&&(f=!0),!f&&v(k._any)&&(f=!0)),p&&(f=!0),f&&m&&t.stopPropagation(),Li=null,f}class Ei{constructor(e,t,n,i,r){this.className=e,this.left=t,this.top=n,this.width=i,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&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(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 i=e.coordsAtPos(n.head,n.assoc||1);if(!i)return[];let r=Bi(e);return[new Ei(t,i.left-r.left,i.top-r.top,null,i.bottom-i.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let i=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),s=e.textDirection==ae.LTR,o=e.contentDOM,a=o.getBoundingClientRect(),l=Bi(e),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),u=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),f=Nt(e,i,1),p=Nt(e,r,-1),m=f.type==z.Text?f:null,g=p.type==z.Text?p:null;if(m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=ji(e,i,1,m)),g&&(e.lineWrapping||p.widgetLineBreaks)&&(g=ji(e,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(v(n.from,n.to,m));{let t=m?v(n.from,null,m):k(f,!1),i=g?v(null,n.to,g):k(p,!0),r=[];return(m||f).to<(g||p).from-(m&&g?1:0)||f.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<i.top?r.push(b(u,t.bottom,d,i.top)):t.bottom<i.top&&e.elementAtHeight((t.bottom+i.top)/2).type==z.Text&&(t.bottom=i.top=(t.bottom+i.top)/2),y(t).concat(r).concat(y(i))}function b(e,n,i,r){return new Ei(t,e-l.left,n-l.top,Math.max(0,i-e),r-n)}function y({top:e,bottom:t,horizontal:n}){let i=[];for(let r=0;r<n.length;r+=2)i.push(b(n[r],e,n[r+1],t));return i}function v(t,n,i){let r=1e9,o=-1e9,a=[];function l(t,n,l,h,c){let f=e.coordsAtPos(t,t==i.to?-2:2),p=e.coordsAtPos(l,l==i.from?2:-2);f&&p&&(r=Math.min(f.top,p.top,r),o=Math.max(f.bottom,p.bottom,o),c==ae.LTR?a.push(s&&n?u:f.left,s&&h?d:p.right):a.push(!s&&h?u:p.left,!s&&n?d:f.right))}let h=null!=t?t:i.from,c=null!=n?n:i.to;for(let i of e.visibleRanges)if(i.to>h&&i.from<c)for(let r=Math.max(i.from,h),s=Math.min(i.to,c);;){let i=e.state.doc.lineAt(r);for(let o of e.bidiSpans(i)){let e=o.from+i.from,a=o.to+i.from;if(e>=s)break;a>r&&l(Math.max(e,r),null==t&&e<=h,Math.min(a,s),null==n&&a>=c,o.dir)}if(r=i.to+1,r>=s)break}return 0==a.length&&l(h,null==t,c,null==n,e.textDirection),{top:r,bottom:o,horizontal:a}}function k(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function Bi(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==ae.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function ji(e,t,n,i){let r=e.coordsAtPos(t,2*n);if(!r)return i;let s=e.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,a=e.posAtCoords({x:s.left+1,y:o}),l=e.posAtCoords({x:s.right-1,y:o});return null==a||null==l?i:{from:Math.max(i.from,Math.min(a,l)),to:Math.min(i.to,Math.max(a,l))}}class Ni{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(Ii)!=e.state.facet(Ii)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Ii);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;e==this.scaleX&&t==this.scaleY||(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{return n=e,i=this.drawn[t],!(n.constructor==i.constructor&&n.eq(i));var n,i})){let t=this.dom.firstChild,n=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[n].constructor&&i.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(i.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,O.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Ii=i.sj.define();function $i(e){return[He.define(t=>new Ni(t,e)),Ii.of(e)]}const Qi=i.sj.define({combine:e=>(0,i.QR)(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function Fi(e={}){return[Qi.of(e),Vi,Hi,Xi,Ne.of(!0)]}function Wi(e){return e.facet(Qi)}function _i(e){return e.startState.facet(Qi)!=e.state.facet(Qi)}const Vi=$i({above:!0,markers(e){let{state:t}=e,n=t.facet(Qi),r=[];for(let s of t.selection.ranges){let o=s==t.selection.main;if(s.empty||n.drawRangeCursor&&!(o&&O.ios&&n.iosSelectionHandles)){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=s.empty?s:i.OF.cursor(s.head,s.assoc);for(let i of Ei.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=_i(e);return n&&qi(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){qi(t.state,e)},class:"cm-cursorLayer"});function qi(e,t){t.style.animationDuration=e.facet(Qi).cursorBlinkRate+"ms"}const Hi=$i({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let i of Ei.forRange(e,"cm-selectionBackground",n))t.push(i);if(O.ios&&!n.empty&&e.state.facet(Qi).iosSelectionHandles){for(let r of Ei.forRange(e,"cm-selectionHandle cm-selectionHandle-start",i.OF.cursor(n.from,1)))t.push(r);for(let r of Ei.forRange(e,"cm-selectionHandle cm-selectionHandle-end",i.OF.cursor(n.to,1)))t.push(r)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||_i(e),class:"cm-selectionLayer"}),Xi=i.Nb.highest(vi.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),Ui=i.Pe.define({map:(e,t)=>null==e?null:t.mapPos(e)}),Yi=i.sU.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(Ui)?t.value:e,e))}),Ki=He.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Yi);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Yi)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Yi),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let i=e.scrollDOM.getBoundingClientRect();return{left:n.left-i.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-i.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Yi)!=e&&this.view.dispatch({effects:Ui.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Gi(){return[Yi,Ki]}function Zi(e,t,n,i,r){t.lastIndex=0;for(let s,o=e.iterRange(n,i),a=n;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=t.exec(o.value);)r(a+s.index,s)}class Ji{constructor(e){const{regexp:t,decoration:n,decorate:i,boundary:r,maxLength:s=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(e,t,n,r)=>i(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,i,r)=>{let s=n(e,t,i);s&&r(i,i+e[0].length,s)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,i,r)=>r(i,i+e[0].length,n)}this.boundary=r,this.maxLength=s}createDeco(e){let t=new i.vB,n=t.add.bind(t);for(let{from:t,to:i}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let i=[];for(let{from:r,to:s}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}(e,this.maxLength))Zi(e.state.doc,this.regexp,t,i,(t,i)=>this.addMatch(i,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((t,r,s,o)=>{o>=e.view.viewport.from&&s<=e.view.viewport.to&&(n=Math.min(s,n),i=Math.max(o,i))}),e.viewportMoved||i-n>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),n,i):t}updateRange(e,t,n,i){for(let r of e.visibleRanges){let s=Math.max(r.from,n),o=Math.min(r.to,i);if(o>=s){let n=e.state.doc.lineAt(s),i=n.to<o?e.state.doc.lineAt(o):n,a=Math.max(r.from,n.from),l=Math.min(r.to,i.to);if(this.boundary){for(;s>n.from;s--)if(this.boundary.test(n.text[s-1-n.from])){a=s;break}for(;o<i.to;o++)if(this.boundary.test(i.text[o-i.from])){l=o;break}}let h,c=[],u=(e,t,n)=>c.push(n.range(e,t));if(n==i)for(this.regexp.lastIndex=a-n.from;(h=this.regexp.exec(n.text))&&h.index<l-n.from;)this.addMatch(h,e,h.index+n.from,u);else Zi(e.state.doc,this.regexp,a,l,(t,n)=>this.addMatch(n,e,t,u));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>e<a||t>l,add:c})}}return t}}const er=null!=/x/.unicode?"gu":"g",tr=new RegExp("[\0-\b\n--\u2028\u2029\ufeff-]",er),nr={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 ir=null;const rr=i.sj.define({combine(e){let t=(0,i.QR)(e,{render:null,specialChars:tr,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==ir&&"undefined"!=typeof document&&document.body){let t=document.body.style;ir=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return ir||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,er)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,er)),t}});function sr(e={}){return[rr.of(e),or||(or=He.fromClass(class{constructor(e){this.view=e,this.decorations=D.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(rr)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Ji({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:s}=n.state,o=(0,i.vS)(t[0],0);if(9==o){let e=s.lineAt(r),t=n.state.tabSize,o=(0,i.y$)(e.text,t,r-e.from);return D.replace({widget:new lr((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=D.replace({widget:new ar(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(rr);e.startState.facet(rr)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let or=null;class ar extends P{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function(e){return e>=32?"•":10==e?"":String.fromCharCode(9216+e)}(this.code),n=e.state.phrase("Control character")+" "+(nr[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,n,t);if(i)return i;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 lr extends P{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const hr=He.fromClass(class{constructor(){this.height=1e3,this.attrs={style:"padding-bottom: 1000px"}}update(e){let{view:t}=e,n=t.viewState.editorHeight-t.defaultLineHeight-t.documentPadding.top-.5;n>=0&&n!=this.height&&(this.height=n,this.attrs={style:`padding-bottom: ${n}px`})}});function cr(){return[hr,Ye.of(e=>{var t;return(null===(t=e.plugin(hr))||void 0===t?void 0:t.attrs)||null})]}function ur(){return fr}const dr=D.line({class:"cm-activeLine"}),fr=He.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let i of e.state.selection.ranges){let r=e.lineBlockAt(i.head);r.from>t&&(n.push(dr.range(r.from)),t=r.from)}return D.set(n)}},{decorations:e=>e.decorations});class pr extends P{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?F(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),i=X(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return i.bottom-i.top>1.5*r?{left:i.left,right:i.right,top:i.top,bottom:i.top+r}:i}ignoreEvent(){return!1}}function mr(e){let t=He.fromClass(class{constructor(t){this.view=t,this.placeholder=e?D.set([D.widget({widget:new pr(e),side:1}).range(0)]):D.none}get decorations(){return this.view.state.doc.length?D.none:this.placeholder}},{decorations:e=>e.decorations});return"string"==typeof e?[t,vi.contentAttributes.of({"aria-placeholder":e})]:t}const gr=2e3;function br(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),s=n-r.from,o=s>gr?-1:s==r.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):(0,i.y$)(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:s}}function yr(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return vi.mouseSelectionStyle.of((e,n)=>t(n)?function(e,t){let n=br(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,s,o){let a=br(e,t);if(!a)return r;let l=function(e,t,n){let r=Math.min(t.line,n.line),s=Math.max(t.line,n.line),o=[];if(t.off>gr||n.off>gr||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let t=r;t<=s;t++){let n=e.doc.line(t);n.length<=l&&o.push(i.OF.range(n.from+a,n.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let t=r;t<=s;t++){let n=e.doc.line(t),r=(0,i.kn)(n.text,a,e.tabSize,!0);if(r<0)o.push(i.OF.cursor(n.to));else{let t=(0,i.kn)(n.text,l,e.tabSize);o.push(i.OF.range(n.from+r,n.from+t))}}}return o}(e.state,n,a);return l.length?o?i.OF.create(l.concat(r.ranges)):i.OF.create(l):r}}:null}(e,n):null)}const vr={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},kr={style:"cursor: crosshair"};function wr(e={}){let[t,n]=vr[e.key||"Alt"],i=He.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[i,vi.contentAttributes.of(e=>{var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.isDown)?kr:null})]}const xr="-10000px";class Or{constructor(e,t,n,i){this.facet=t,this.createTooltipView=n,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let r=null;this.tooltipViews=this.tooltips.map(e=>r=n(e,r))}update(e,t){var n;let i=e.state.facet(this.facet),r=i.filter(e=>e);if(i===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let s=[],o=t?[]:null;for(let n=0;n<r.length;n++){let i=r[n],a=-1;if(i){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==i.create&&(a=e)}if(a<0)s[n]=this.createTooltipView(i,n?s[n-1]:null),o&&(o[n]=!!i.above);else{let i=s[n]=this.tooltipViews[a];o&&(o[n]=t[a]),i.update&&i.update(e)}}}for(let e of this.tooltipViews)s.indexOf(e)<0&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=i,this.tooltips=r,this.tooltipViews=s,!0}}function Sr(e={}){return Ar.of(e)}function Cr(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const Ar=i.sj.define({combine:e=>{var t,n,i;return{position:O.ios?"absolute":(null===(t=e.find(e=>e.position))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find(e=>e.parent))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(i=e.find(e=>e.tooltipSpace))||void 0===i?void 0:i.tooltipSpace)||Cr}}}),Tr=new WeakMap,Mr=He.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(Ar);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Or(e,Lr,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.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 e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,i=e.state.facet(Ar);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),i=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=xr,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(O.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=it(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Ar).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=e,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],h=this.manager.tooltipViews[a],{dom:c}=h,u=e.pos[a],d=e.size[a];if(!u||!1!==l.clip&&(u.bottom<=Math.max(n.top,i.top)||u.top>=Math.min(n.bottom,i.bottom)||u.right<Math.max(n.left,i.left)-.1||u.left>Math.min(n.right,i.right)+.1)){c.style.top=xr;continue}let f=l.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=f?7:0,m=d.right-d.left,g=null!==(t=Tr.get(h))&&void 0!==t?t:d.bottom-d.top,b=h.offset||Dr,y=this.view.textDirection==ae.LTR,v=d.width>i.right-i.left?y?i.left:i.right-d.width:y?Math.max(i.left,Math.min(u.left-(f?14:0)+b.x,i.right-m)):Math.min(Math.max(i.left,u.left-m+(f?14:0)-b.x),i.right-m),k=this.above[a];!l.strictSide&&(k?u.top-g-p-b.y<i.top:u.bottom+g+p+b.y>i.bottom)&&k==i.bottom-u.bottom>u.top-i.top&&(k=this.above[a]=!k);let w=(k?u.top-i.top:i.bottom-u.bottom)-p;if(w<g&&!1!==h.resize){if(w<this.view.defaultLineHeight){c.style.top=xr;continue}Tr.set(h,g),c.style.height=(g=w)/s+"px"}else c.style.height&&(c.style.height="");let x=k?u.top-g-p-b.y:u.bottom+p+b.y,O=v+m;if(!0!==h.overlap)for(let e of o)e.left<O&&e.right>v&&e.top<x+g&&e.bottom>x&&(x=k?e.top-g-2-p:e.bottom+p+2);if("absolute"==this.position?(c.style.top=(x-e.parent.top)/s+"px",Pr(c,(v-e.parent.left)/r)):(c.style.top=x/s+"px",Pr(c,v/r)),f){let e=u.left+(y?b.x:-b.x)-(v+14-7);f.style.left=e/r+"px"}!0!==h.overlap&&o.push({left:v,top:x,right:O,bottom:x+g}),c.classList.toggle("cm-tooltip-above",k),c.classList.toggle("cm-tooltip-below",!k),h.positioned&&h.positioned(e.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 e of this.manager.tooltipViews)e.dom.style.top=xr}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Pr(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const zr=vi.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Dr={x:0,y:0},Lr=i.sj.define({enables:[Mr,zr]}),Rr=i.sj.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class Er{static create(e){return new Er(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Or(e,Rr,(e,t)=>this.createHostedView(e,t),e=>e.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)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let i=n[e];if(void 0!==i)if(void 0===t)t=i;else if(t!==i)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 Br=Lr.compute([Rr],e=>{let t=e.facet(Rr);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos})),create:Er.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class jr{constructor(e,t,n,i,r){this.view=e,this.source=t,this.field=n,this.setHover=i,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;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let i,r=1;if(n.isWidget())i=n.posAtStart;else{if(i=e.posAtCoords(t),null==i)return;let n=e.coordsAtPos(i);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let s=e.bidiSpans(e.state.doc.lineAt(i)).find(e=>e.from<=i&&e.to>=i),o=s&&s.dir==ae.RTL?-1:1;r=t.x<n.left?-o:o}let s=this.source(e,i,r);if(null==s?void 0:s.then){let t=this.pending={pos:i};s.then(n=>{this.pending==t&&(this.pending=null,!n||Array.isArray(n)&&!n.length||e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>We(e.state,t,"hover tooltip"))}else!s||Array.isArray(s)&&!s.length||e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(Mr),t=e?e.manager.tooltips.findIndex(e=>e.create==Er.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:i,tooltip:r}=this;if(i.length&&r&&!function(e,t){let n,{left:i,right:r,top:s,bottom:o}=e.getBoundingClientRect();if(n=e.querySelector(".cm-tooltip-arrow")){let e=n.getBoundingClientRect();s=Math.min(e.top,s),o=Math.max(e.bottom,o)}return t.clientX>=i-4&&t.clientX<=r+4&&t.clientY>=s-4&&t.clientY<=o+4}(r.dom,e)||this.pending){let{pos:r}=i[0]||this.pending,s=null!==(n=null===(t=i[0])||void 0===t?void 0:t.end)&&void 0!==n?n:r;(r==s?this.view.posAtCoords(this.lastMove)==r:function(e,t,n,i,r){let s=e.scrollDOM.getBoundingClientRect(),o=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>i||s.right<i||s.top>r||Math.min(s.bottom,o)<r)return!1;let a=e.posAtCoords({x:i,y:r},!1);return a>=t&&a<=n}(this.view,r,s,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:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.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),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function Nr(e,t={}){let n=i.Pe.define(),r=i.sU.define({create:()=>[],update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,i.iR.TrackDel);if(null!=e){let i=Object.assign(Object.create(null),n);i.pos=e,null!=i.end&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(Qr)&&(e=[]);return e},provide:e=>Rr.from(e)});return{active:r,extension:[r,He.define(i=>new jr(i,e,r,n,t.hoverTime||300)),Br]}}function Ir(e,t){let n=e.plugin(Mr);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}function $r(e){return e.facet(Rr).some(e=>e)}const Qr=i.Pe.define(),Fr=Qr.of(null);function Wr(e){let t=e.plugin(Mr);t&&t.maybeMeasure()}const _r=i.sj.define({combine(e){let t,n;for(let i of e)t=t||i.topContainer,n=n||i.bottomContainer;return{topContainer:t,bottomContainer:n}}});function Vr(e){return e?[_r.of(e)]:[]}function qr(e,t){let n=e.plugin(Hr),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const Hr=He.fromClass(class{constructor(e){this.input=e.state.facet(Yr),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(_r);this.top=new Xr(e,!0,t.topContainer),this.bottom=new Xr(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(_r);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Xr(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Xr(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Yr);if(n!=this.input){let t=n.filter(e=>e),i=[],r=[],s=[],o=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),o.push(t)):(t=this.panels[a],t.update&&t.update(e)),i.push(t),(t.top?r:s).push(t)}this.specs=t,this.panels=i,this.top.sync(r),this.bottom.sync(s);for(let e of o)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>vi.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Xr{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(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));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 e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Ur(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Ur(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 Ur(e){let t=e.nextSibling;return e.remove(),t}const Yr=i.sj.define({enables:Hr});function Kr(e,t){let n,r=new Promise(e=>n=e),s=e=>function(e,t,n){let i=t.content?t.content(e,()=>o(null)):null;if(!i){if(i=(0,u.A)("form"),t.input){let e=(0,u.A)("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),i.appendChild((0,u.A)("label",(t.label||"")+": ",e))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild((0,u.A)("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let r="FORM"==i.nodeName?[i]:i.querySelectorAll("form");for(let e=0;e<r.length;e++){let t=r[e];t.addEventListener("keydown",e=>{27==e.keyCode?(e.preventDefault(),o(null)):13==e.keyCode&&(e.preventDefault(),o(t))}),t.addEventListener("submit",e=>{e.preventDefault(),o(t)})}let s=(0,u.A)("div",i,(0,u.A)("button",{onclick:()=>o(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));function o(t){s.contains(s.ownerDocument.activeElement)&&e.focus(),n(t)}return t.class&&(s.className=t.class),s.classList.add("cm-dialog"),{dom:s,top:t.top,mount:()=>{if(t.focus){let e;e="string"==typeof t.focus?i.querySelector(t.focus):i.querySelector("input")||i.querySelector("button"),e&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}}(e,t,n);e.state.field(Zr,!1)?e.dispatch({effects:Jr.of(s)}):e.dispatch({effects:i.Pe.appendConfig.of(Zr.init(()=>[s]))});let o=es.of(s);return{close:o,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(Zr).indexOf(s)>-1&&e.dispatch({effects:o})}),t))}}function Gr(e,t){let n=e.state.field(Zr,!1)||[];for(let i of n){let n=qr(e,i);if(n&&n.dom.classList.contains(t))return n}return null}const Zr=i.sU.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(Jr)?e=[n.value].concat(e):n.is(es)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>Yr.computeN([e],t=>t.field(e))}),Jr=i.Pe.define(),es=i.Pe.define();class ts extends i.FB{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ts.prototype.elementClass="",ts.prototype.toDOM=void 0,ts.prototype.mapMode=i.iR.TrackBefore,ts.prototype.startSide=ts.prototype.endSide=-1,ts.prototype.point=!0;const ns=i.sj.define(),is=i.sj.define(),rs={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>i.om.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},ss=i.sj.define();function os(e){return[ls(),ss.of({...rs,...e})]}const as=i.sj.define({combine:e=>e.some(e=>e)});function ls(e){let t=[hs];return e&&!1===e.fixed&&t.push(as.of(!0)),t}const hs=He.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(ss).map(t=>new fs(e,t)),this.fixed=!e.state.facet(as);for(let e of this.gutters)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,i=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(i<.8*(n.to-n.from))}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(as)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=i.om.iter(this.view.state.facet(ns),this.view.viewport.from),r=[],s=this.gutters.map(e=>new ds(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let i of e.type)if(i.type==z.Text&&t){us(n,r,i.from);for(let e of s)e.line(this.view,i,r);t=!1}else if(i.widget)for(let e of s)e.widget(this.view,i)}else if(e.type==z.Text){us(n,r,e.from);for(let t of s)t.line(this.view,e,r)}else if(e.widget)for(let t of s)t.widget(this.view,e);for(let e of s)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(ss),n=e.state.facet(ss),r=e.docChanged||e.heightChanged||e.viewportChanged||!i.om.eq(e.startState.facet(ns),e.state.facet(ns),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new fs(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>vi.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let i=n.dom.offsetWidth*t.scaleX,r=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==ae.LTR?{left:i,right:r}:{right:i,left:r}})});function cs(e){return Array.isArray(e)?e:[e]}function us(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class ds{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=i.om.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:i}=this,r=(t.top-this.height)/e.scaleY,s=t.height/e.scaleY;if(this.i==i.elements.length){let t=new ps(e,s,r,n);i.elements.push(t),i.dom.appendChild(t.dom)}else i.elements[this.i].update(e,s,r,n);this.height=t.bottom,this.i++}line(e,t,n){let i=[];us(this.cursor,i,t.from),n.length&&(i=i.concat(n));let r=this.gutter.config.lineMarker(e,t,i);r&&i.unshift(r);let s=this.gutter;(0!=i.length||s.config.renderEmptyElements)&&this.addElement(e,t,i)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),i=n?[n]:null;for(let n of e.state.facet(is)){let r=n(e,t.widget,t);r&&(i||(i=[])).push(r)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class fs{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,i=>{let r,s=i.target;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let e=s.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=i.clientY;let o=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,o,i)&&i.preventDefault()});this.markers=cs(t.markers(e)),t.initialSpacer&&(this.spacer=new ps(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=cs(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!i.om.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class ps{constructor(e,t,n,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,i)}update(e,t,n,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let n="cm-gutterElement",i=this.dom.firstChild;for(let r=0,s=0;;){let o=s,a=r<t.length?t[r++]:null,l=!1;if(a){let e=a.elementClass;e&&(n+=" "+e);for(let e=s;e<this.markers.length;e++)if(this.markers[e].compare(a)){o=e,l=!0;break}}else o=this.markers.length;for(;s<o;){let e=this.markers[s++];if(e.toDOM){e.destroy(i);let t=i.nextSibling;i.remove(),i=t}}if(!a)break;a.toDOM&&(l?i=i.nextSibling:this.dom.insertBefore(a.toDOM(e),i)),l&&s++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}const ms=i.sj.define(),gs=i.sj.define(),bs=i.sj.define({combine:e=>(0,i.QR)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let i=n[e],r=t[e];n[e]=i?(e,t,n)=>i(e,t,n)||r(e,t,n):r}return n}})});class ys extends ts{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function vs(e,t){return e.state.facet(bs).formatNumber(t,e.state)}const ks=ss.compute([bs],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(ms),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new ys(vs(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let i of e.state.facet(gs)){let r=i(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(bs)!=e.state.facet(bs),initialSpacer:e=>new ys(vs(e,xs(e.state.doc.lines))),updateSpacer(e,t){let n=vs(t.view,xs(t.view.state.doc.lines));return n==e.number?e:new ys(n)},domEventHandlers:e.facet(bs).domEventHandlers,side:"before"}));function ws(e={}){return[bs.of(e),ls(),ks]}function xs(e){let t=9;for(;t<e;)t=10*t+9;return t}const Os=new class extends ts{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Ss=ns.compute(["selection"],e=>{let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.head).from;r>n&&(n=r,t.push(Os.range(r)))}return i.om.of(t)});function Cs(){return Ss}function As(e){return He.define(t=>({decorations:e.createDeco(t),update(t){this.decorations=e.updateDeco(t,this.decorations)}}),{decorations:e=>e.decorations})}const Ts=D.mark({class:"cm-highlightTab"}),Ms=D.mark({class:"cm-highlightSpace"}),Ps=As(new Ji({regexp:/\t| /g,decoration:e=>"\t"==e[0]?Ts:Ms,boundary:/\S/}));function zs(){return Ps}const Ds=As(new Ji({regexp:/\s+$/g,decoration:D.mark({class:"cm-trailingSpace"})}));function Ls(){return Ds}const Rs={HeightMap:jn,HeightOracle:Dn,MeasuredHeights:Ln,QueryType:En,ChangedRange:st,computeOrder:xe,moveVisually:Ce,clearHeightChangeFlag:zn,getHeightChangeFlag:()=>Pn}},365(e,t,n){"use strict";n.d(t,{PH:()=>p,Qj:()=>f,RY:()=>L,Z6:()=>h,cF:()=>i,fI:()=>c,iX:()=>E,rr:()=>R,uY:()=>o});const i=1024;let r=0;class s{constructor(e,t){this.from=e,this.to=t}}class o{constructor(e={}){this.id=r++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=h.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}o.closedBy=new o({deserialize:e=>e.split(" ")}),o.openedBy=new o({deserialize:e=>e.split(" ")}),o.group=new o({deserialize:e=>e.split(" ")}),o.isolate=new o({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),o.contextHash=new o({perNode:!0}),o.lookAhead=new o({perNode:!0}),o.mounted=new o({perNode:!0});class a{constructor(e,t,n,i=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=i}static get(e){return e&&e.props&&e.props[o.mounted.id]}}const l=Object.create(null);class h{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):l,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),i=new h(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(o.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(o.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}}h.none=new h("",Object.create(null),0,8);class c{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let t of e){let e=t(n);if(e){i||(i=Object.assign({},n.props));let t=e[1],r=e[0];r.combine&&r.id in i&&(t=r.combine(i[r.id],t)),i[r.id]=t}}t.push(i?new h(n.name,i,n.id,n.flags):n)}return new c(t)}}const u=new WeakMap,d=new WeakMap;var f;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"}(f||(f={}));class p{constructor(e,t,n,i,r){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,r&&r.length){this.props=Object.create(null);for(let[e,t]of r)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=a.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new T(this.topNode,e)}cursorAt(e,t=0,n=0){let i=u.get(this)||this.topNode,r=new T(i);return r.moveTo(e,t),u.set(this,r._tree),r}get topNode(){return new k(this,0,0,null)}resolve(e,t=0){let n=y(u.get(this)||this.topNode,e,t,!1);return u.set(this,n),n}resolveInner(e,t=0){let n=y(d.get(this)||this.topNode,e,t,!0);return d.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),r=null;for(let e=i instanceof k?i:i.context.parent;e;e=e.parent)if(e.index<0){let s=e.parent;(r||(r=[i])).push(s.resolve(t,n)),e=s}else{let s=a.get(e.tree);if(s&&s.overlay&&s.overlay[0].from<=t&&s.overlay[s.overlay.length-1].to>=t){let o=new k(s.tree,s.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(y(o,t,n,!1))}}return r?C(r):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:r=this.length}=e,s=e.mode||0,o=(s&f.IncludeAnonymous)>0;for(let e=this.cursor(s|f.IncludeAnonymous);;){let s=!1;if(e.from<=r&&e.to>=i&&(!o&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;s=!0}for(;s&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;s=!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:D(h.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new p(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new p(h.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:s=i,reused:a=[],minRepeatType:l=r.types.length}=e,h=Array.isArray(n)?new m(n,n.length):n,c=r.types,u=0,d=0;function f(e,t,n,i,m,w){let{id:x,start:O,end:S,size:C}=h,A=d,T=u;if(C<0){if(h.next(),-1==C){let t=a[x];return n.push(t),void i.push(O-e)}if(-3==C)return void(u=x);if(-4==C)return void(d=x);throw new RangeError(`Unrecognized record size: ${C}`)}let M,P,z=c[x],L=O-e;if(S-O<=s&&(P=function(e,t){let n=h.fork(),i=0,r=0,o=0,a=n.end-s,c={size:0,start:0,skip:0};e:for(let s=n.pos-e;n.pos>s;){let e=n.size;if(n.id==t&&e>=0){c.size=i,c.start=r,c.skip=o,o+=4,i+=4,n.next();continue}let h=n.pos-e;if(e<0||h<s||n.start<a)break;let u=n.id>=l?4:0,d=n.start;for(n.next();n.pos>h;){if(n.size<0){if(-3!=n.size&&-4!=n.size)break e;u+=4}else n.id>=l&&(u+=4);n.next()}r=d,i+=e,o+=u}return(t<0||i==e)&&(c.size=i,c.start=r,c.skip=o),c.size>4?c:void 0}(h.pos-t,m))){let t=new Uint16Array(P.size-P.skip),n=h.pos-P.size,i=t.length;for(;h.pos>n;)i=k(P.start,t,i);M=new g(t,S-P.start,r),L=P.start-e}else{let e=h.pos-C;h.next();let t=[],n=[],i=x>=l?x:-1,r=0,a=S;for(;h.pos>e;)i>=0&&h.id==i&&h.size>=0?(h.end<=a-s&&(y(t,n,O,r,h.end,a,i,A,T),r=t.length,a=h.end),h.next()):w>2500?b(O,e,t,n):f(O,e,t,n,i,w+1);if(i>=0&&r>0&&r<t.length&&y(t,n,O,r,O,a,i,A,T),t.reverse(),n.reverse(),i>-1&&r>0){let e=function(e,t){return(n,i,r)=>{let s,a,l=0,h=n.length-1;if(h>=0&&(s=n[h])instanceof p){if(!h&&s.type==e&&s.length==r)return s;(a=s.prop(o.lookAhead))&&(l=i[h]+s.length+a)}return v(e,n,i,r,l,t)}}(z,T);M=D(z,t,n,0,t.length,0,S-O,e,e)}else M=v(z,t,n,S-O,A-S,T)}n.push(M),i.push(L)}function b(e,t,n,i){let o=[],a=0,l=-1;for(;h.pos>t;){let{id:e,start:t,end:n,size:i}=h;if(i>4)h.next();else{if(l>-1&&t<l)break;l<0&&(l=n-s),o.push(e,t,n),a++,h.next()}}if(a){let t=new Uint16Array(4*a),s=o[o.length-2];for(let e=o.length-3,n=0;e>=0;e-=3)t[n++]=o[e],t[n++]=o[e+1]-s,t[n++]=o[e+2]-s,t[n++]=n;n.push(new g(t,o[2]-s,r)),i.push(s-e)}}function y(e,t,n,i,s,o,a,l,h){let c=[],u=[];for(;e.length>i;)c.push(e.pop()),u.push(t.pop()+n-s);e.push(v(r.types[a],c,u,o-s,l-o,h)),t.push(s-n)}function v(e,t,n,i,r,s,a){if(s){let e=[o.contextHash,s];a=a?[e].concat(a):[e]}if(r>25){let e=[o.lookAhead,r];a=a?[e].concat(a):[e]}return new p(e,t,n,i,a)}function k(e,t,n){let{id:i,start:r,end:s,size:o}=h;if(h.next(),o>=0&&i<l){let a=n;if(o>4){let i=h.pos-(o-4);for(;h.pos>i;)n=k(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=r-e,t[--n]=i}else-3==o?u=i:-4==o&&(d=i);return n}let w=[],x=[];for(;h.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let O=null!==(t=e.length)&&void 0!==t?t:w.length?x[0]+w[0].length:0;return new p(c[e.topID],w.reverse(),x.reverse(),O)}(e)}}p.empty=new p(h.none,[],[],0);class m{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 m(this.buffer,this.index)}}class g{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return h.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(e+=4))return r;let s=[];for(;e<n;)s.push(this.childString(e)),e=this.buffer[e+3];return r+"("+s.join(",")+")"}findChild(e,t,n,i,r){let{buffer:s}=this,o=-1;for(let a=e;a!=t&&!(b(r,i,s[a+1],s[a+2])&&(o=a,n>0));a=s[a+3]);return o}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),s=0;for(let o=e,a=0;o<t;){r[a++]=i[o++],r[a++]=i[o++]-n;let t=r[a++]=i[o++]-n;r[a++]=i[o++]-e,s=Math.max(s,t)}return new g(r,s,this.set)}}function b(e,t,n,i){switch(e){case-2:return n<t;case-1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function y(e,t,n,i){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!i&&e instanceof k&&e.index<0?null:e.parent;if(!t)return e;e=t}let s=i?0:f.IgnoreOverlays;if(i)for(let i=e,o=i.parent;o;i=o,o=i.parent)i instanceof k&&i.index<0&&(null===(r=o.enter(t,n,s))||void 0===r?void 0:r.from)!=i.from&&(e=o);for(;;){let i=e.enter(t,n,s);if(!i)return e;e=i}}class v{cursor(e=0){return new T(this,e)}getChild(e,t=null,n=null){let i=w(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return w(this,e,t,n)}resolve(e,t=0){return y(this,e,t,!1)}resolveInner(e,t=0){return y(this,e,t,!0)}matchContext(e){return x(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class k extends v{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,i,r=0){for(let s=this;;){for(let{children:o,positions:l}=s._tree,h=t>0?o.length:-1;e!=h;e+=t){let h,c=o[e],u=l[e]+s.from;if(r&f.EnterBracketed&&c instanceof p&&(h=a.get(c))&&!h.overlay&&h.bracketed&&n>=u&&n<=u+c.length||b(i,n,u,u+c.length))if(c instanceof g){if(r&f.ExcludeBuffers)continue;let o=c.findChild(0,c.buffer.length,t,n-u,i);if(o>-1)return new S(new O(s,c,e,u),null,o)}else if(r&f.IncludeAnonymous||!c.type.isAnonymous||M(c)){let o;if(!(r&f.IgnoreMounts)&&(o=a.get(c))&&!o.overlay)return new k(o.tree,u,e,s);let l=new k(c,u,e,s);return r&f.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(t<0?c.children.length-1:0,t,n,i,r)}}if(r&f.IncludeAnonymous||!s.type.isAnonymous)return null;if(e=s.index>=0?s.index+t:t<0?-1:s._parent._tree.children.length,s=s._parent,!s)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let i;if(!(n&f.IgnoreOverlays)&&(i=a.get(this._tree))&&i.overlay){let r=e-this.from,s=n&f.EnterBracketed&&i.bracketed;for(let{from:e,to:n}of i.overlay)if((t>0||s?e<=r:e<r)&&(t<0||s?n>=r:n>r))return new k(i.tree,i.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 w(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(null!=n)for(let e=!1;!e;)if(e=r.type.is(n),!r.nextSibling())return s;for(;;){if(null!=i&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return null==i?s:[]}}function x(e,t,n=t.length-1){for(let i=e;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}class O{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}}class S extends v{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:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new S(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)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&f.ExcludeBuffers)return null;let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new S(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 S(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 S(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let s=n.buffer[this.index+1];e.push(n.slice(i,r,s)),t.push(0)}return new p(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function C(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let r=e[i];(r.from>n.from||r.to<n.to)&&(n=r,t=i)}let i=n instanceof k&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new A(r,n)}class A{constructor(e,t){this.heads=e,this.node=t}get next(){return C(this.heads)}}class T{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~f.EnterBracketed,e instanceof k)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.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)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof k?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}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:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(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&f.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&f.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&f.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));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;({index:t,_parent:n}=n))if(t>-1)for(let i=t+e,r=e<0?-1:n._tree.children.length;i!=r;i+=e){let e=n._tree.children[i];if(this.mode&f.IncludeAnonymous||e instanceof g||!e.type.isAnonymous||M(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,r=this.stack.length;r>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,n=r+1;break e}i=this.stack[--r]}for(let e=n;e<this.stack.length;e++)t=new S(this.buffer,t,this.stack[e]);return this.bufferNode=new S(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return x(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return x(this._tree,e,i);let s=n[t.buffer[this.stack[r]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function M(e){return e.children.some(e=>e instanceof g||!e.type.isAnonymous||M(e))}const P=new WeakMap;function z(e,t){if(!e.isAnonymous||t instanceof g||t.type!=e)return 1;let n=P.get(t);if(null==n){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof p)){n=1;break}n+=z(e,i)}P.set(t,n)}return n}function D(e,t,n,i,r,s,o,a,l){let h=0;for(let n=i;n<r;n++)h+=z(e,t[n]);let c=Math.ceil(1.5*h/8),u=[],d=[];return function t(n,i,r,o,a){for(let h=r;h<o;){let r=h,f=i[h],p=z(e,n[h]);for(h++;h<o;h++){let t=z(e,n[h]);if(p+t>=c)break;p+=t}if(h==r+1){if(p>c){let e=n[r];t(e.children,e.positions,0,e.children.length,i[r]+a);continue}u.push(n[r])}else{let t=i[h-1]+n[h-1].length-f;u.push(D(e,n,i,r,h,f,t,null,l))}d.push(f+a-s)}}(t,n,i,r,0),(a||l)(u,d,o)}class L{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof S?this.setBuffer(e.context.buffer,e.index,t):e instanceof k&&this.map.set(e.tree,t)}get(e){return e instanceof S?this.getBuffer(e.context.buffer,e.index):e instanceof k?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 R{constructor(e,t,n,i,r=!1,s=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new R(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,s=e.length?e[0]:null;for(let o=0,a=0,l=0;;o++){let h=o<t.length?t[o]:null,c=h?h.fromA:1e9;if(c-a>=n)for(;s&&s.from<c;){let t=s;if(a>=t.from||c<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,c)-l;t=e>=n?null:new R(e,n,t.tree,t.offset+l,o>0,!!h)}if(t&&i.push(t),s.to>c)break;s=r<e.length?e[r++]:null}if(!h)break;a=h.toA,l=h.toA-h.toB}return i}}class E{startParse(e,t,n){return"string"==typeof e&&(e=new B(e)),n=n?n.length?n.map(e=>new s(e.from,e.to)):[new s(0,0)]:[new s(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}}class B{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 o({perNode:!0})},3720(e,t,n){"use strict";n.d(t,{DM:()=>d,_A:()=>P,az:()=>u,pn:()=>l});var i=n(365);let r=0;class s{constructor(e,t,n,i){this.name=e,this.set=t,this.base=n,this.modified=i,this.id=r++}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="string"==typeof e?e:"?";if(e instanceof s&&(t=e),null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let i=new s(n,[],null,[]);if(i.set.push(i),t)for(let e of t.set)i.set.push(e);return i}static defineModifier(e){let t=new a(e);return e=>e.modified.indexOf(t)>-1?e:a.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let o=0;class a{constructor(e){this.name=e,this.instances=[],this.id=o++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{return n.base==e&&(i=t,r=n.modified,i.length==r.length&&i.every((e,t)=>e==r[t]));var i,r});if(n)return n;let i=[],r=new s(e.name,i,e,t);for(let e of t)e.instances.push(r);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,r=t.length;i<r;i++)t.push(t[i].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)i.push(a.get(t,e));return r}}function l(e){let t=Object.create(null);for(let n in e){let i=e[n];Array.isArray(i)||(i=[i]);for(let e of n.split(" "))if(e){let n=[],r=2,s=e;for(let t=0;;){if("..."==s&&t>0&&t+3==e.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!i)throw new RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),t+=i[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&"!"==o){r=0;break}if("/"!=o)throw new RangeError("Invalid path: "+e);s=e.slice(t)}let o=n.length-1,a=n[o];if(!a)throw new RangeError("Invalid path: "+e);let l=new c(i,r,o>0?n.slice(0,o):null);t[a]=l.sort(t[a])}}return h.add(t)}const h=new i.uY({combine(e,t){let n,i,r;for(;e||t;){if(!e||t&&e.depth>=t.depth?(r=t,t=t.next):(r=e,e=e.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new c(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});class c{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function u(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:i,all:r=null}=t||{};return{style:e=>{let t=r;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}function d(e,t,n,i=0,r=e.length){let s=new f(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}c.empty=new c([],2,null);class f{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,r,s){let{type:o,from:a,to:l}=e;if(a>=n||l<=t)return;o.isTop&&(s=this.highlighters.filter(e=>!e.scope||e.scope(o)));let u=r,d=function(e){let t=e.type.prop(h);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||c.empty,f=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(s,d.tags);if(f&&(u&&(u+=" "),u+=f,1==d.mode&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(t,a),u),d.opaque)return;let p=e.tree&&e.tree.prop(i.uY.mounted);if(p&&p.overlay){let i=e.node.enter(p.overlay[0].from+a,1),o=this.highlighters.filter(e=>!e.scope||e.scope(p.tree.type)),h=e.firstChild();for(let c=0,d=a;;c++){let f=c<p.overlay.length?p.overlay[c]:null,m=f?f.from+a:l,g=Math.max(t,d),b=Math.min(n,m);if(g<b&&h)for(;e.from<b&&(this.highlightRange(e,g,b,r,s),this.startSpan(Math.min(b,e.to),u),!(e.to>=m)&&e.nextSibling()););if(!f||m>n)break;d=f.to+a,d>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+a),Math.min(n,d),"",o),this.startSpan(Math.min(n,d),u))}h&&e.parent()}else if(e.firstChild()){p&&(r="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),u)}}while(e.nextSibling());e.parent()}}}const p=s.define,m=p(),g=p(),b=p(g),y=p(g),v=p(),k=p(v),w=p(v),x=p(),O=p(x),S=p(),C=p(),A=p(),T=p(A),M=p(),P={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:b,tagName:p(b),propertyName:y,attributeName:p(y),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:v,string:k,docString:p(k),character:p(k),attributeValue:p(k),number:w,integer:p(w),float:p(w),bool:p(v),regexp:p(v),escape:p(v),color:p(v),url:p(v),keyword:S,self:p(S),null:p(S),atom:p(S),unit:p(S),modifier:p(S),operatorKeyword:p(S),controlKeyword:p(S),definitionKeyword:p(S),moduleKeyword:p(S),operator:C,derefOperator:p(C),arithmeticOperator:p(C),logicOperator:p(C),bitwiseOperator:p(C),compareOperator:p(C),updateOperator:p(C),definitionOperator:p(C),typeOperator:p(C),controlOperator:p(C),punctuation:A,separator:p(A),bracket:T,angleBracket:p(T),squareBracket:p(T),paren:p(T),brace:p(T),content:x,heading:O,heading1:p(O),heading2:p(O),heading3:p(O),heading4:p(O),heading5:p(O),heading6:p(O),contentSeparator:p(x),list:p(x),quote:p(x),emphasis:p(x),strong:p(x),link:p(x),monospace:p(x),strikethrough:p(x),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:M,documentMeta:p(M),annotation:p(M),processingInstruction:p(M),definition:s.defineModifier("definition"),constant:s.defineModifier("constant"),function:s.defineModifier("function"),standard:s.defineModifier("standard"),local:s.defineModifier("local"),special:s.defineModifier("special")};for(let e in P){let t=P[e];t instanceof s&&(t.name=e)}u([{tag:P.link,class:"tok-link"},{tag:P.heading,class:"tok-heading"},{tag:P.emphasis,class:"tok-emphasis"},{tag:P.strong,class:"tok-strong"},{tag:P.keyword,class:"tok-keyword"},{tag:P.atom,class:"tok-atom"},{tag:P.bool,class:"tok-bool"},{tag:P.url,class:"tok-url"},{tag:P.labelName,class:"tok-labelName"},{tag:P.inserted,class:"tok-inserted"},{tag:P.deleted,class:"tok-deleted"},{tag:P.literal,class:"tok-literal"},{tag:P.string,class:"tok-string"},{tag:P.number,class:"tok-number"},{tag:[P.regexp,P.escape,P.special(P.string)],class:"tok-string2"},{tag:P.variableName,class:"tok-variableName"},{tag:P.local(P.variableName),class:"tok-variableName tok-local"},{tag:P.definition(P.variableName),class:"tok-variableName tok-definition"},{tag:P.special(P.variableName),class:"tok-variableName2"},{tag:P.definition(P.propertyName),class:"tok-propertyName tok-definition"},{tag:P.typeName,class:"tok-typeName"},{tag:P.namespace,class:"tok-namespace"},{tag:P.className,class:"tok-className"},{tag:P.macroName,class:"tok-macroName"},{tag:P.propertyName,class:"tok-propertyName"},{tag:P.operator,class:"tok-operator"},{tag:P.comment,class:"tok-comment"},{tag:P.meta,class:"tok-meta"},{tag:P.invalid,class:"tok-invalid"},{tag:P.punctuation,class:"tok-punctuation"}])},4725(e,t,n){"use strict";n.r(t),n.d(t,{Annotation:()=>o.YH,AnnotationType:()=>o.UJ,BidiSpan:()=>a.tF,BlockInfo:()=>a.uF,BlockType:()=>a._B,BlockWrapper:()=>a.l_,ChangeDesc:()=>o.Gu,ChangeSet:()=>o.VR,CharCategory:()=>o.Je,Compartment:()=>o.xx,Decoration:()=>a.NZ,Direction:()=>a.OP,EditorSelection:()=>o.OF,EditorState:()=>o.$t,EditorView:()=>a.Lz,ExternalChange:()=>vi,Facet:()=>o.sj,GutterMarker:()=>a.wJ,Line:()=>o.N1,MapMode:()=>o.iR,MatchDecorator:()=>a.dT,Prec:()=>o.Nb,Range:()=>o.Q6,RangeSet:()=>o.om,RangeSetBuilder:()=>o.vB,RangeValue:()=>o.FB,RectangleMarker:()=>a.Ip,SelectionRange:()=>o.yn,StateEffect:()=>o.Pe,StateEffectType:()=>o.DA,StateField:()=>o.sU,Text:()=>o.EY,Transaction:()=>o.ZX,ViewPlugin:()=>a.Z9,ViewUpdate:()=>a.X3,WidgetType:()=>a.xO,__test:()=>a.rU,basicSetup:()=>Vn,closeHoverTooltips:()=>a.vo,codePointAt:()=>o.vS,codePointSize:()=>o.Fh,color:()=>hi,combineConfig:()=>o.QR,countColumn:()=>o.y$,crosshairCursor:()=>a.HJ,default:()=>Ci,defaultLightThemeOption:()=>fi,drawSelection:()=>a.VH,dropCursor:()=>a.A,findClusterBreak:()=>o.zK,findColumn:()=>o.kn,fromCodePoint:()=>o.MK,getDefaultExtensions:()=>pi,getDialog:()=>a.rC,getDrawSelectionConfig:()=>a.$G,getPanel:()=>a.ld,getStatistics:()=>mi,getTooltip:()=>a.Eg,gutter:()=>a.cU,gutterLineClass:()=>a.EV,gutterWidgetClass:()=>a.QO,gutters:()=>a.Hm,hasHoverTooltips:()=>a.n6,highlightActiveLine:()=>a.dz,highlightActiveLineGutter:()=>a.Wu,highlightSpecialChars:()=>a.N$,highlightTrailingWhitespace:()=>a.wu,highlightWhitespace:()=>a.Yq,hoverTooltip:()=>a.Ux,keymap:()=>a.w4,layer:()=>a.qd,lineNumberMarkers:()=>a.pK,lineNumberWidgetMarker:()=>a.qy,lineNumbers:()=>a.$K,logException:()=>a.c_,minimalSetup:()=>qn,oneDark:()=>di,oneDarkHighlightStyle:()=>ui,oneDarkTheme:()=>ci,panels:()=>a.C3,placeholder:()=>a.qf,rectangularSelection:()=>a.D4,repositionTooltips:()=>a.Pq,runScopeHandlers:()=>a.TS,scrollPastEnd:()=>a.BE,showDialog:()=>a.ui,showPanel:()=>a.S7,showTooltip:()=>a.DK,tooltips:()=>a.vX,useCodeMirror:()=>wi});var i=n(8168),r=n(8587),s=n(1609),o=n(1638),a=n(6898),l=n(5874),h=n(365);function c(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}const u=c(g,0),d=c(m,0),f=c((e,t)=>m(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:e.doc.lineAt(n.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}(t)),0);function p(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function m(e,t,n=t.selection.ranges){let i=n.map(e=>p(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>function(e,{open:t,close:n},i,r){let s,o,a=e.sliceDoc(i-50,i),l=e.sliceDoc(r,r+50),h=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,u=a.length-h;if(a.slice(u-t.length,u)==t&&l.slice(c,c+n.length)==n)return{open:{pos:i-h,margin:h&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?s=o=e.sliceDoc(i,r):(s=e.sliceDoc(i,i+50),o=e.sliceDoc(r-50,r));let d=/^\s*/.exec(s)[0].length,f=/\s*$/.exec(o)[0].length,p=o.length-f-n.length;return s.slice(d,d+t.length)==t&&o.slice(p,p+n.length)==n?{open:{pos:i+d+t.length,margin:/\s/.test(s.charAt(d+t.length))?1:0},close:{pos:r-f-n.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null}(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let e=[];for(let t,n=0;n<r.length;n++)if(t=r[n]){let r=i[n],{open:s,close:o}=t;e.push({from:s.pos-r.open.length,to:s.pos+s.margin},{from:o.pos-o.margin,to:o.pos+r.close.length})}return{changes:e}}return null}function g(e,t,n=t.selection.ranges){let i=[],r=-1;e:for(let{from:e,to:s}of n){let n,o=i.length,a=1e9;for(let o=e;o<=s;){let l=t.doc.lineAt(o);if(null==n&&(n=p(t,l.from).line,!n))continue e;if(l.from>r&&(e==s||s>l.from)){r=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,s=l.text.slice(e,e+n.length)==n?e:-1;e<l.text.length&&e<a&&(a=e),i.push({line:l,comment:s,token:n,indent:e,empty:t,single:!1})}o=l.to+1}if(a<1e9)for(let e=o;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=a);i.length==o+1&&(i[o].single=!0)}if(2!=e&&i.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:s,single:o}of i)!o&&s||e.push({from:t.from+r,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of i)if(n>=0){let i=t.from+n,s=i+r.length;" "==t.text[s-t.from]&&s++,e.push({from:i,to:s})}return{changes:e}}return null}const b=o.YH.define(),y=o.YH.define(),v=o.sj.define(),k=o.sj.define({combine:e=>(0,o.QR)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}),w=o.sU.define({create:()=>N.empty,update(e,t){let n=t.state.facet(k),i=t.annotation(b);if(i){let r=M.fromTransaction(t,i.selection),s=i.side,o=0==s?e.undone:e.done;return o=r?P(o,o.length,n.minDepth,r):L(o,t.startState.selection),new N(0==s?i.rest:o,0==s?o:i.rest)}let r=t.annotation(y);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(o.ZX.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=M.fromTransaction(t),a=t.annotation(o.ZX.time),l=t.annotation(o.ZX.userEvent);return s?e=e.addChanges(s,a,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new N(e.done.map(M.fromJSON),e.undone.map(M.fromJSON))});function x(e={}){return[w,k.of(e),a.Lz.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?S:"historyRedo"==e.inputType?C:null;return!!n&&(e.preventDefault(),n(t))}})]}function O(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(w,!1);if(!r)return!1;let s=r.pop(e,n,t);return!!s&&(i(s),!0)}}const S=O(0,!1),C=O(1,!1),A=O(0,!0),T=O(1,!0);class M{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new M(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new M(e.changes&&o.VR.fromJSON(e.changes),[],e.mapped&&o.Gu.fromJSON(e.mapped),e.startSelection&&o.OF.fromJSON(e.startSelection),e.selectionsAfter.map(o.OF.fromJSON))}static fromTransaction(e,t){let n=D;for(let t of e.startState.facet(v)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new M(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,D)}static selection(e){return new M(void 0,D,void 0,void 0,e)}}function P(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function z(e,t){return e.length?t.length?e.concat(t):e:t}const D=[];function L(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),P(e,e.length-1,1e9,n.setSelAfter(i)))}return[M.selection([t])]}function R(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function E(e,t){if(!e.length)return e;let n=e.length,i=D;for(;n;){let r=B(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[M.selection(i)]:D}function B(e,t,n){let i=z(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):D,n);if(!e.changes)return M.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new M(r,o.Pe.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const j=/^(input\.type|delete)($|\.)/;class N{constructor(e,t,n=0,i=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new N(this.done,this.undone):this}addChanges(e,t,n,i,r){let s=this.done,a=s[s.length-1];return s=a&&a.changes&&!a.changes.empty&&e.changes&&(!n||j.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,function(e,t){let n=[],i=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,r,s)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];s>=t&&r<=o&&(i=!0)}}),i}(a.changes,e.changes))||"input.type.compose"==n)?P(s,s.length-1,i.minDepth,new M(e.changes.compose(a.changes),z(o.Pe.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,D)):P(s,s.length,i.minDepth,e),new N(s,D,t,n)}addSelection(e,t,n,i){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:D;return r.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(s=r[r.length-1],o=e,s.ranges.length==o.ranges.length&&0===s.ranges.filter((e,t)=>e.empty!=o.ranges[t].empty).length)?this:new N(L(this.done,e),this.undone,t,n);var s,o}addMapping(e){return new N(E(this.done,e),E(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],s=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):t.selection);if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:b.of({side:e,rest:R(i),selection:s}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==i.length?D:i.slice(0,i.length-1);return r.mapped&&(n=E(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:b.of({side:e,rest:n,selection:s}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}N.empty=new N(D,D);const I=[{key:"Mod-z",run:S,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:C,preventDefault:!0},{linux:"Ctrl-Shift-z",run:C,preventDefault:!0},{key:"Mod-u",run:A,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:T,preventDefault:!0}];function $(e,t){return o.OF.create(e.ranges.map(t),e.mainIndex)}function Q(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function F({state:e,dispatch:t},n){let i=$(e.selection,n);return!i.eq(e.selection,!0)&&(t(Q(e,i)),!0)}function W(e,t){return o.OF.cursor(t?e.to:e.from)}function _(e,t){return F(e,n=>n.empty?e.moveByChar(n,t):W(n,t))}function V(e){return e.textDirectionAt(e.state.selection.main.head)==a.OP.LTR}const q=e=>_(e,!V(e)),H=e=>_(e,V(e));function X(e,t){return F(e,n=>n.empty?e.moveByGroup(n,t):W(n,t))}function U(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Y(e,t,n){let i,r,s=(0,l.mv)(e).resolveInner(t.head),a=n?h.uY.closedBy:h.uY.openedBy;for(let i=t.head;;){let t=n?s.childAfter(i):s.childBefore(i);if(!t)break;U(e,t,a)?s=t:i=n?t.to:t.from}return r=s.type.prop(a)&&(i=n?(0,l.jU)(e,s.from,1):(0,l.jU)(e,s.to,-1))&&i.matched?n?i.end.to:i.end.from:n?s.to:s.from,o.OF.cursor(r,n?-1:1)}function K(e,t){return F(e,n=>{if(!n.empty)return W(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;const G=e=>K(e,!1),Z=e=>K(e,!0);function J(e){let t,n=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,i=0,r=0;if(n){for(let t of e.state.facet(a.Lz.scrollMargins)){let n=t(e);(null==n?void 0:n.top)&&(i=Math.max(null==n?void 0:n.top,i)),(null==n?void 0:n.bottom)&&(r=Math.max(null==n?void 0:n.bottom,r))}t=e.scrollDOM.clientHeight-i-r}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:r,selfScroll:n,height:Math.max(e.defaultLineHeight,t-5)}}function ee(e,t){let n,i=J(e),{state:r}=e,s=$(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):W(n,t));if(s.eq(r.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),l=o.top+i.marginTop,h=o.bottom-i.marginBottom;t&&t.top>l&&t.bottom<h&&(n=a.Lz.scrollIntoView(s.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(Q(r,s),{effects:n}),!0}const te=e=>ee(e,!1),ne=e=>ee(e,!0);function ie(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=o.OF.cursor(i.from+n))}return r}function re(e,t){let n=$(e.state.selection,e=>{let n=t(e);return o.OF.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return!n.eq(e.state.selection)&&(e.dispatch(Q(e.state,n)),!0)}function se(e,t){return re(e,n=>e.moveByChar(n,t))}const oe=e=>se(e,!V(e)),ae=e=>se(e,V(e));function le(e,t){return re(e,n=>e.moveByGroup(n,t))}function he(e,t){return re(e,n=>e.moveVertically(n,t))}const ce=e=>he(e,!1),ue=e=>he(e,!0);function de(e,t){return re(e,n=>e.moveVertically(n,t,J(e).height))}const fe=e=>de(e,!1),pe=e=>de(e,!0),me=({state:e,dispatch:t})=>(t(Q(e,{anchor:0})),!0),ge=({state:e,dispatch:t})=>(t(Q(e,{anchor:e.doc.length})),!0),be=({state:e,dispatch:t})=>(t(Q(e,{anchor:e.selection.main.anchor,head:0})),!0),ye=({state:e,dispatch:t})=>(t(Q(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function ve(e,t){let{state:n}=e,i=n.selection,r=n.selection.ranges.slice();for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head);if(t?s.to<e.state.doc.length:s.from>0)for(let n=i;;){let i=e.moveVertically(n,t);if(i.head<s.from||i.head>s.to){r.some(e=>e.head==i.head)||r.push(i);break}if(i.head==n.head)break;n=i}}return r.length!=i.ranges.length&&(e.dispatch(Q(n,o.OF.create(r,r.length-1))),!0)}function ke(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:s}=i;if(r==s){let o=t(i);o<r?(n="delete.backward",o=we(e,o,!1)):o>r&&(n="delete.forward",o=we(e,o,!0)),r=Math.min(r,o),s=Math.max(s,o)}else r=we(e,r,!1),s=we(e,s,!0);return r==s?{range:i}:{changes:{from:r,to:s},range:o.OF.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?a.Lz.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function we(e,t,n){if(e instanceof a.Lz)for(let i of e.state.facet(a.Lz.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}const xe=(e,t,n)=>ke(e,i=>{let r,s,a=i.from,{state:h}=e,c=h.doc.lineAt(a);if(n&&!t&&a>c.from&&a<c.from+200&&!/[^ \t]/.test(r=c.text.slice(0,a-c.from))){if("\t"==r[r.length-1])return a-1;let e=(0,o.y$)(r,h.tabSize)%(0,l.tp)(h)||(0,l.tp)(h);for(let t=0;t<e&&" "==r[r.length-1-t];t++)a--;s=a}else s=(0,o.zK)(c.text,a-c.from,t,t)+c.from,s==a&&c.number!=(t?h.doc.lines:1)?s+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(c.text.slice(s-c.from,a-c.from))&&(s=(0,o.zK)(c.text,s-c.from,!1,!1)+c.from);return s}),Oe=e=>xe(e,!1,!0),Se=e=>xe(e,!0,!1),Ce=(e,t)=>ke(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),a=r.charCategorizer(i);for(let e=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let l=(0,o.zK)(s.text,i-s.from,t)+s.from,h=s.text.slice(Math.min(i,l)-s.from,Math.max(i,l)-s.from),c=a(h);if(null!=e&&c!=e)break;" "==h&&i==n.head||(e=c),i=l}return i}),Ae=e=>Ce(e,!1);function Te(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(i.empty||i.to!=s.from||(s=e.doc.lineAt(i.to-1)),n>=r.number){let e=t[t.length-1];e.to=s.to,e.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function Me(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of Te(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),a=s.length+1;if(n){i.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak});for(let n of t.ranges)r.push(o.OF.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)))}else{i.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text});for(let e of t.ranges)r.push(o.OF.range(e.anchor-a,e.head-a))}}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:o.OF.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Pe(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of Te(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let r=e.changes(i);return t(e.update({changes:r,selection:e.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ze=De(!1);function De(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,s=t.doc.lineAt(i),a=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,i=(0,l.mv)(e).resolveInner(t),r=i.childBefore(t),s=i.childAfter(t);return r&&s&&r.to<=t&&s.from>=t&&(n=r.type.prop(h.uY.closedBy))&&n.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from&&!/\S/.test(e.sliceDoc(r.to,s.from))?{from:r.to,to:s.from}:null}(t,i);e&&(i=r=(r<=s.to?s:t.doc.lineAt(r)).to);let c=new l.KB(t,{simulateBreak:i,simulateDoubleBreak:!!a}),u=(0,l._v)(c,i);for(null==u&&(u=(0,o.y$)(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));r<s.to&&/\s/.test(s.text[r-s.from]);)r++;a?({from:i,to:r}=a):i>s.from&&i<s.from+100&&!/\S/.test(s.text.slice(0,i))&&(i=s.from);let d=["",(0,l.EI)(t,u)];return a&&d.push((0,l.EI)(t,c.lineIndent(s.from,-1))),{changes:{from:i,to:r,insert:o.EY.of(d)},range:o.OF.cursor(i+1+d[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Le(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let s=i.from;s<=i.to;){let o=e.doc.lineAt(s);o.number>n&&(i.empty||i.to>o.from)&&(t(o,r,i),n=o.number),s=o.to+1}let s=e.changes(r);return{changes:r,range:o.OF.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const Re=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Le(e,(t,n)=>{n.push({from:t.from,insert:e.facet(l.Xt)})}),{userEvent:"input.indent"})),!0),Ee=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Le(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=(0,o.y$)(i,e.tabSize),s=0,a=(0,l.EI)(e,Math.max(0,r-(0,l.tp)(e)));for(;s<i.length&&s<a.length&&i.charCodeAt(s)==a.charCodeAt(s);)s++;n.push({from:t.from+s,to:t.from+i.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),Be=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>F(e,t=>Y(e.state,t,!V(e))),shift:e=>re(e,t=>Y(e.state,t,!V(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>F(e,t=>Y(e.state,t,V(e))),shift:e=>re(e,t=>Y(e.state,t,V(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Me(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Pe(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Me(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Pe(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>ve(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>ve(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=o.OF.create([n.main]):n.main.empty||(i=o.OF.create([o.OF.cursor(n.main.head)])),!!i&&(t(Q(e,i)),!0)}},{key:"Mod-Enter",run:De(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=Te(e).map(({from:t,to:n})=>o.OF.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:o.OF.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=$(e.selection,t=>{let n=(0,l.mv)(e),i=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=i.node.from&&e.node.to<=i.node.to&&(i=e)}for(let e=i;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return o.OF.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(Q(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:Ee},{key:"Mod-]",run:Re},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new l.KB(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=Le(e,(t,r,s)=>{let o=(0,l._v)(i,t.from);if(null==o)return;/\S/.test(t.text)||(o=0);let a=/^\s*/.exec(t.text)[0],h=(0,l.EI)(e,o);(a!=h||s.from<t.from+a.length)&&(n[t.from]=o,r.push({from:t.from,to:t.from+a.length,insert:h}))});return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Te(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=$(t.selection,t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(n=i.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let i=!1,r=$(e.selection,t=>{let r=(0,l.jU)(e,t.head,-1)||(0,l.jU)(e,t.head,1)||t.head>0&&(0,l.jU)(e,t.head-1,1)||t.head<e.doc.length&&(0,l.jU)(e,t.head+1,-1);if(!r||!r.end)return t;i=!0;let s=r.start.from==t.head?r.end.to:r.end.from;return n?o.OF.range(t.anchor,s):o.OF.cursor(s)});return!!i&&(t(Q(e,r)),!0)}(e,t,!1)},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=p(e.state,n.from);return i.line?u(e):!!i.block&&f(e)}},{key:"Alt-A",run:d},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:q,shift:oe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>X(e,!V(e)),shift:e=>le(e,!V(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>F(e,t=>ie(e,t,!V(e))),shift:e=>re(e,t=>ie(e,t,!V(e))),preventDefault:!0},{key:"ArrowRight",run:H,shift:ae,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>X(e,V(e)),shift:e=>le(e,V(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>F(e,t=>ie(e,t,V(e))),shift:e=>re(e,t=>ie(e,t,V(e))),preventDefault:!0},{key:"ArrowUp",run:G,shift:ce,preventDefault:!0},{mac:"Cmd-ArrowUp",run:me,shift:be},{mac:"Ctrl-ArrowUp",run:te,shift:fe},{key:"ArrowDown",run:Z,shift:ue,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ge,shift:ye},{mac:"Ctrl-ArrowDown",run:ne,shift:pe},{key:"PageUp",run:te,shift:fe},{key:"PageDown",run:ne,shift:pe},{key:"Home",run:e=>F(e,t=>ie(e,t,!1)),shift:e=>re(e,t=>ie(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:me,shift:be},{key:"End",run:e=>F(e,t=>ie(e,t,!0)),shift:e=>re(e,t=>ie(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:ge,shift:ye},{key:"Enter",run:ze,shift:ze},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Oe,shift:Oe,preventDefault:!0},{key:"Delete",run:Se,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Ae,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Ce(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>ke(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>ke(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat([{key:"Ctrl-b",run:q,shift:oe,preventDefault:!0},{key:"Ctrl-f",run:H,shift:ae},{key:"Ctrl-p",run:G,shift:ce},{key:"Ctrl-n",run:Z,shift:ue},{key:"Ctrl-a",run:e=>F(e,t=>o.OF.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>re(e,t=>o.OF.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>F(e,t=>o.OF.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>re(e,t=>o.OF.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:Se},{key:"Ctrl-h",run:Oe},{key:"Ctrl-k",run:e=>ke(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:Ae},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:o.EY.of(["",""])},range:o.OF.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:(0,o.zK)(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:(0,o.zK)(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(r,n))},range:o.OF.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:ne}].map(e=>({mac:e.key,run:e.run,shift:e.shift})))),je={key:"Tab",run:Re,shift:Ee};var Ne=n(3748);const Ie="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class $e{constructor(e,t,n=0,i=e.length,r,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r(Ie(e)):Ie,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(0,o.vS)(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=(0,o.MK)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,o.Fh)(e);let i=this.normalize(t);if(i.length)for(let e=0,r=n,s=!0;;e++){let n=i.charCodeAt(e),o=this.match(n,r,s,this.bufferPos+this.bufferStart,e==i.length-1);if(o)return this.value=o,this;if(e==i.length-1)break;s&&e<t.length&&t.charCodeAt(e)==n?r++:s=!1}}}match(e,t,n,i,r){let s=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?s={from:n.from,to:i,precise:r&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(1==this.query.length?s={from:t,to:i,precise:n&&r}:this.matches.push({from:t,index:1,precise:n})),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}"undefined"!=typeof Symbol&&($e.prototype[Symbol.iterator]=function(){return this});const Qe={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Fe="gm"+(null==/x/.unicode?"":"u");class We{constructor(e,t,n,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=Qe,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new qe(e,t,n,i,r);this.re=new RegExp(t,Fe+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let s=e.lineAt(i);this.curLineStart=s.from,this.matchPos=He(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=He(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const _e=new WeakMap;class Ve{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=_e.get(e);if(!i||i.from>=n||i.to<=t){let i=new Ve(t,e.sliceString(t,n));return _e.set(e,i),i}if(i.from==t&&i.to==n)return i;let{text:r,from:s}=i;return s>t&&(r=e.sliceString(t,s)+r,s=t),i.to<n&&(r+=e.sliceString(i.to,n)),_e.set(e,new Ve(s,r)),new Ve(t,r.slice(t-s,n-s))}}class qe{constructor(e,t,n,i,r){this.text=e,this.to=r,this.done=!1,this.value=Qe,this.matchPos=He(e,i),this.re=new RegExp(t,Fe+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Ve.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=He(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ve.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function He(e,t){if(t>=e.length)return t;let n,i=e.lineAt(t);for(;t<i.to&&(n=i.text.charCodeAt(t-i.from))>=56320&&n<57344;)t++;return t}"undefined"!=typeof Symbol&&(We.prototype[Symbol.iterator]=qe.prototype[Symbol.iterator]=function(){return this});const Xe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ue=o.sj.define({combine:e=>(0,o.QR)(e,Xe,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Ye=a.NZ.mark({class:"cm-selectionMatch"}),Ke=a.NZ.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ge(e,t,n,i){return!(0!=n&&e(t.sliceDoc(n-1,n))==o.Je.Word||i!=t.doc.length&&e(t.sliceDoc(i,i+1))==o.Je.Word)}const Ze=a.Z9.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Ue),{state:n}=e,i=n.selection;if(i.ranges.length>1)return a.NZ.none;let r,s=i.main,l=null;if(s.empty){if(!t.highlightWordAroundCursor)return a.NZ.none;let e=n.wordAt(s.head);if(!e)return a.NZ.none;l=n.charCategorizer(s.head),r=n.sliceDoc(e.from,e.to)}else{let e=s.to-s.from;if(e<t.minSelectionLength||e>200)return a.NZ.none;if(t.wholeWords){if(r=n.sliceDoc(s.from,s.to),l=n.charCategorizer(s.head),!Ge(l,n,s.from,s.to)||!function(e,t,n,i){return e(t.sliceDoc(n,n+1))==o.Je.Word&&e(t.sliceDoc(i-1,i))==o.Je.Word}(l,n,s.from,s.to))return a.NZ.none}else if(r=n.sliceDoc(s.from,s.to),!r)return a.NZ.none}let h=[];for(let i of e.visibleRanges){let e=new $e(n.doc,r,i.from,i.to);for(;!e.next().done;){let{from:i,to:r}=e.value;if((!l||Ge(l,n,i,r))&&(s.empty&&i<=s.from&&r>=s.to?h.push(Ke.range(i,r)):(i>=s.to||r<=s.from)&&h.push(Ye.range(i,r)),h.length>t.maxMatches))return a.NZ.none}}return a.NZ.set(h)}},{decorations:e=>e.decorations}),Je=a.Lz.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),et=o.sj.define({combine:e=>(0,o.QR)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Pt(e),scrollToMatch:e=>a.Lz.scrollIntoView(e)})});class tt{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||function(e){try{return new RegExp(e,Fe),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new lt(this):new rt(this)}getCursor(e,t=0,n){let i=e.doc?e:o.$t.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?st(this,i,t,n):it(this,i,t,n)}}class nt{constructor(e){this.spec=e}}function it(e,t,n,i){let r;var s,a;return e.wholeWord&&(s=t.doc,a=t.charCategorizer(t.selection.main.head),r=(e,t,n,i)=>((i>e||i+n.length<t)&&(i=Math.max(0,e-2),n=s.sliceString(i,Math.min(s.length,t+2))),!(a(ot(n,e-i))==o.Je.Word&&a(at(n,e-i))==o.Je.Word||a(at(n,t-i))==o.Je.Word&&a(ot(n,t-i))==o.Je.Word))),e.test&&(r=function(e,t,n){return(i,r,s,o)=>{if(n&&!n(i,r,s,o))return!1;let a=i>=o&&r<=o+s.length?s.slice(i-o,r-o):t.doc.sliceString(i,r);return e(a,t,i,r)}}(e.test,t,r)),new $e(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),r)}class rt extends nt{constructor(e){super(e)}nextMatch(e,t,n){let i=it(this.spec,e,n,e.doc.length).nextOverlapping();if(i.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);i=it(this.spec,e,0,n).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==n?null:i.value}prevMatchInRange(e,t,n){for(let i=n;;){let n=Math.max(t,i-1e4-this.spec.unquoted.length),r=it(this.spec,e,n,i),s=null;for(;!r.nextOverlapping().done;)s=r.value;if(s)return s;if(n==t)return null;i-=1e4}}prevMatch(e,t,n){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),!i||i.from==t&&i.to==n?null:i}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=it(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=it(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;)i(r.value.from,r.value.to)}}function st(e,t,n,i){let r;var s;return e.wholeWord&&(s=t.charCategorizer(t.selection.main.head),r=(e,t,n)=>!n[0].length||(s(ot(n.input,n.index))!=o.Je.Word||s(at(n.input,n.index))!=o.Je.Word)&&(s(at(n.input,n.index+n[0].length))!=o.Je.Word||s(ot(n.input,n.index+n[0].length))!=o.Je.Word)),e.test&&(r=function(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}(e.test,t,r)),new We(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function ot(e,t){return e.slice((0,o.zK)(e,t,!1),t)}function at(e,t){return e.slice(t,(0,o.zK)(e,t))}class lt extends nt{nextMatch(e,t,n){let i=st(this.spec,e,n,e.doc.length).next();return i.done&&(i=st(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),s=st(this.spec,e,r,n),o=null;for(;!s.next().done;)o=s.value;if(o&&(r==t||o.from>r+10))return o;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)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let i=+n.slice(0,t);if(i>0&&i<e.match.length)return e.match[i]+n.slice(t)}return t})}matchAll(e,t){let n=st(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=st(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}}const ht=o.Pe.define(),ct=o.Pe.define(),ut=o.sU.define({create:e=>new dt(Ot(e).create(),null),update(e,t){for(let n of t.effects)n.is(ht)?e=new dt(n.value.create(),e.panel):n.is(ct)&&(e=new dt(e.query,n.value?xt:null));return e},provide:e=>a.S7.from(e,e=>e.panel)});class dt{constructor(e,t){this.query=e,this.panel=t}}const ft=a.NZ.mark({class:"cm-searchMatch"}),pt=a.NZ.mark({class:"cm-searchMatch cm-searchMatch-selected"}),mt=a.Z9.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(ut))}update(e){let t=e.state.field(ut);(t!=e.startState.field(ut)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return a.NZ.none;let{view:n}=this,i=new o.vB;for(let t=0,r=n.visibleRanges,s=r.length;t<s;t++){let{from:o,to:a}=r[t];for(;t<s-1&&a>r[t+1].from-500;)a=r[++t].to;e.highlight(n.state,o,a,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?pt:ft)})}return i.finish()}},{decorations:e=>e.decorations});function gt(e){return t=>{let n=t.state.field(ut,!1);return n&&n.query.spec.valid?e(t,n):At(t)}}const bt=gt((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=o.OF.single(i.from,i.to),s=e.state.facet(et);return e.dispatch({selection:r,effects:[Lt(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),Ct(e),!0}),yt=gt((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=o.OF.single(r.from,r.to),a=e.state.facet(et);return e.dispatch({selection:s,effects:[Lt(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),Ct(e),!0}),vt=gt((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:o.OF.create(n.map(e=>o.OF.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),kt=gt((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let l,h,c=s,u=[],d=[];c.precise?c.from==i&&c.to==r&&(h=n.toText(t.getReplacement(c)),u.push({from:c.from,to:c.to,insert:h}),d.push(a.Lz.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))):c=t.nextMatch(n,c.from,c.to);let f=e.state.changes(u);return c&&(l=o.OF.single(c.from,c.to).map(f),d.push(Lt(e,c)),d.push(n.facet(et).scrollToMatch(l.main,e))),e.dispatch({changes:f,selection:l,effects:d,userEvent:"input.replace"}),!0}),wt=gt((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let i of t.matchAll(e.state,1e9)){let{from:e,to:r,precise:s}=i;s&&n.push({from:e,to:r,insert:t.getReplacement(i)})}if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:a.Lz.announce.of(i),userEvent:"input.replace.all"}),!0});function xt(e){return e.state.facet(et).createPanel(e)}function Ot(e,t){var n,i,r,s,o;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let h=e.facet(et);return new tt({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:h.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:h.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:h.literal,regexp:null!==(s=null==t?void 0:t.regexp)&&void 0!==s?s:h.regexp,wholeWord:null!==(o=null==t?void 0:t.wholeWord)&&void 0!==o?o:h.wholeWord})}function St(e){let t=(0,a.ld)(e,xt);return t&&t.dom.querySelector("[main-field]")}function Ct(e){let t=St(e);t&&t==e.root.activeElement&&t.select()}const At=e=>{let t=e.state.field(ut,!1);if(t&&t.panel){let n=St(e);if(n&&n!=e.root.activeElement){let i=Ot(e.state,t.query.spec);i.valid&&e.dispatch({effects:ht.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[ct.of(!0),t?ht.of(Ot(e.state,t.query.spec)):o.Pe.appendConfig.of(Et)]});return!0},Tt=e=>{let t=e.state.field(ut,!1);if(!t||!t.panel)return!1;let n=(0,a.ld)(e,xt);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:ct.of(!1)}),!0},Mt=[{key:"Mod-f",run:At,scope:"editor search-panel"},{key:"F3",run:bt,shift:yt,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:bt,shift:yt,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Tt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],a=0;for(let t=new $e(e.doc,e.sliceDoc(i,r));!t.next().done;){if(s.length>1e3)return!1;t.value.from==i&&(a=s.length),s.push(o.OF.range(t.value.from,t.value.to))}return t(e.update({selection:o.OF.create(s,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=(0,a.ui)(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return r.then(n=>{let r=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!r)return void e.dispatch({effects:i});let s=t.doc.lineAt(t.selection.main.head),[,l,h,c,u]=r,d=c?+c.slice(1):0,f=h?+h:s.number;if(h&&u){let e=f/100;l&&(e=e*("-"==l?-1:1)+s.number/t.doc.lines),f=Math.round(t.doc.lines*e)}else h&&l&&(f=f*("-"==l?-1:1)+s.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,f))),m=o.OF.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[i,a.Lz.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,i=o.OF.create(n.ranges.map(t=>e.wordAt(t.head)||o.OF.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)})({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new $e(e.doc,t,i[i.length-1].to);;){if(r.next(),!r.done){if(n&&i.some(e=>e.from==r.value.from))continue;if(s){let t=e.wordAt(r.value.from);if(!t||t.from!=r.value.from||t.to!=r.value.to)continue}return r.value}if(n)return null;r=new $e(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),n=!0}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(o.OF.range(r.from,r.to),!1),effects:a.Lz.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class Pt{constructor(e){this.view=e;let t=this.query=e.state.field(ut).query.spec;function n(e,t,n){return(0,Ne.A)("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=(0,Ne.A)("input",{value:t.search,placeholder:zt(e,"Find"),"aria-label":zt(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=(0,Ne.A)("input",{value:t.replace,placeholder:zt(e,"Replace"),"aria-label":zt(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=(0,Ne.A)("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=(0,Ne.A)("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=(0,Ne.A)("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=(0,Ne.A)("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>bt(e),[zt(e,"next")]),n("prev",()=>yt(e),[zt(e,"previous")]),n("select",()=>vt(e),[zt(e,"all")]),(0,Ne.A)("label",null,[this.caseField,zt(e,"match case")]),(0,Ne.A)("label",null,[this.reField,zt(e,"regexp")]),(0,Ne.A)("label",null,[this.wordField,zt(e,"by word")]),...e.state.readOnly?[]:[(0,Ne.A)("br"),this.replaceField,n("replace",()=>kt(e),[zt(e,"replace")]),n("replaceAll",()=>wt(e),[zt(e,"replace all")])],(0,Ne.A)("button",{name:"close",onclick:()=>Tt(e),"aria-label":zt(e,"close"),type:"button"},["×"])])}commit(){let e=new tt({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:ht.of(e)}))}keydown(e){(0,a.TS)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?yt:bt)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),kt(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(ht)&&!e.value.eq(this.query)&&this.setQuery(e.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(et).top}}function zt(e,t){return e.state.phrase(t)}const Dt=/[\s\.,:;?!]/;function Lt(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-30),o=Math.min(r,n+30),l=e.state.sliceDoc(s,o);if(s!=i.from)for(let e=0;e<30;e++)if(!Dt.test(l[e+1])&&Dt.test(l[e])){l=l.slice(e);break}if(o!=r)for(let e=l.length-1;e>l.length-30;e--)if(!Dt.test(l[e-1])&&Dt.test(l[e])){l=l.slice(0,e);break}return a.Lz.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const Rt=a.Lz.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"}}),Et=[ut,o.Nb.low(mt),Rt];class Bt{constructor(e,t,n,i){this.state=e,this.pos=t,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=(0,l.mv)(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),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search($t(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function jt(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class Nt{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}}function It(e){return e.selection.main.from}function $t(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],s="$"!=i[i.length-1];return r||s?new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const Qt=o.YH.define();function Ft(e,t,n,i){let{main:r}=e.selection,s=n-r.from,a=i-r.from;return{...e.changeByRange(l=>{if(l!=r&&n!=i&&e.sliceDoc(l.from+s,l.from+a)!=e.sliceDoc(n,i))return{range:l};let h=e.toText(t);return{changes:{from:l.from+s,to:i==r.from?l.to:l.from+a,insert:h},range:o.OF.cursor(l.from+s+h.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Wt=new WeakMap;function _t(e){if(!Array.isArray(e))return e;let t=Wt.get(e);return t||Wt.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=jt(t)+jt(n)+"*$";return[new RegExp("^"+i),new RegExp(i)]}(t);return e=>{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}(e)),t}const Vt=o.Pe.define(),qt=o.Pe.define();class Ht{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=(0,o.vS)(e,t),i=(0,o.Fh)(n);this.chars.push(n);let r=e.slice(t,t+i),s=r.toUpperCase();this.folded.push((0,o.vS)(s==r?r.toLowerCase():s,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:i,precise:r,byWord:s}=this;if(1==t.length){let i=(0,o.vS)(e,0),r=(0,o.Fh)(i),s=r==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;s+=-200}return this.ret(s,[0,r])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,h=0;if(a<0){for(let r=0,s=Math.min(e.length,200);r<s&&h<l;){let s=(0,o.vS)(e,r);s!=t[h]&&s!=n[h]||(i[h++]=r),r+=(0,o.Fh)(s)}if(h<l)return null}let c=0,u=0,d=!1,f=0,p=-1,m=-1,g=/[a-z]/.test(e),b=!0;for(let i=0,h=Math.min(e.length,200),y=0;i<h&&u<l;){let h=(0,o.vS)(e,i);a<0&&(c<l&&h==t[c]&&(r[c++]=i),f<l&&(h==t[f]||h==n[f]?(0==f&&(p=i),m=i+1,f++):f=0));let v,k=h<255?h>=48&&h<=57||h>=97&&h<=122?2:h>=65&&h<=90?1:0:(v=(0,o.MK)(h))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!i||1==k&&g||0==y&&0!=k)&&(t[u]==h||n[u]==h&&(d=!0)?s[u++]=i:s.length&&(b=!1)),y=k,i+=(0,o.Fh)(h)}return u==l&&0==s[0]&&b?this.result((d?-200:0)-100,s,e):f==l&&0==p?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):f==l?this.ret(-900-e.length,[p,m]):u==l?this.result((d?-200:0)-100-700+(b?0:-1100),s,e):2==t.length?null:this.result((i[0]?-700:0)-200-1100,i,e)}result(e,t,n){let i=[],r=0;for(let e of t){let t=e+(this.astral?(0,o.Fh)((0,o.vS)(n,e)):1);r&&i[r-1]==e?i[r-1]=t:(i[r++]=e,i[r++]=t)}return this.ret(e-n.length,i)}}class Xt{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const Ut=o.sj.define({combine:e=>(0,o.QR)(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Kt,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Yt(e(n),t(n)),optionClass:(e,t)=>n=>Yt(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function Yt(e,t){return e?t?e+" "+t:e:t}function Kt(e,t,n,i,r,s){let o,l,h=e.textDirection==a.OP.RTL,c=h,u=!1,d="top",f=t.left-r.left,p=r.right-t.right,m=i.right-i.left,g=i.bottom-i.top;if(c&&f<Math.min(m,p)?c=!1:!c&&p<Math.min(m,f)&&(c=!0),m<=(c?f:p))o=Math.max(r.top,Math.min(n.top,r.bottom-g))-t.top,l=Math.min(400,c?f:p);else{u=!0,l=Math.min(400,(h?t.right:r.right-t.left)-30);let e=r.bottom-t.bottom;e>=g||e>t.top?o=n.bottom-t.top:(d="bottom",o=t.bottom-n.top)}return{style:`${d}: ${o/((t.bottom-t.top)/s.offsetHeight)}px; max-width: ${l/((t.right-t.left)/s.offsetWidth)}px`,class:"cm-completionInfo-"+(u?h?"left-narrow":"right-narrow":c?"left":"right")}}const Gt=o.Pe.define();function Zt(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}class Jt{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:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:r,selected:s}=i.open,o=e.state.facet(Ut);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,i){let r=document.createElement("span");r.className="cm-completionLabel";let s=e.displayLabel||e.label,o=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>o&&r.appendChild(document.createTextNode(s.slice(o,t)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(s.slice(t,n))),a.className="cm-completionMatchedText",o=n}return o<s.length&&r.appendChild(document.createTextNode(s.slice(o))),r},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Zt(r.length,s,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]<i.length)return this.applyCompletion(e,i[+t[1]]),void n.preventDefault();if(n.target==this.list){let t=this.list.classList.contains("cm-completionListIncompleteTop")&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=t&&(e.dispatch({effects:Gt.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(Ut).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:qt.of(null)})}),this.showOptions(r,i.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),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:r,selected:s,disabled:o}=n.open;i.open&&i.open.options==r||(this.range=Zt(r.length,s,e.state.facet(Ut).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),o!=(null===(t=i.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Zt(t.options.length,t.selected,this.view.state.facet(Ut).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let s="string"==typeof r?document.createTextNode(r):r(i);if(!s)return;"then"in s?s.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,i)}).catch(e=>(0,a.c_)(this.view.state,e,"completion info")):(this.addInfoPane(s,i),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,i=this.range.from;n;n=n.nextSibling,i++)"LI"==n.nodeName&&n.id?i==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby")):i--;return t&&function(e,t){let n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=n.height/e.offsetHeight;i.top<n.top?e.scrollTop-=(n.top-i.top)/r:i.bottom>n.bottom&&(e.scrollTop+=(i.bottom-n.bottom)/r)}(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(),i=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(Ut).positionInfo(this.view,t,i,n,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",e=>{e.target==i&&e.preventDefault()});let r=null;for(let s=n.from;s<n.to;s++){let{completion:o,match:a}=e[s],{section:l}=o;if(l){let e="string"==typeof l?l:l.name;e!=r&&(s>n.from||0==n.from)&&(r=e,"string"!=typeof l&&l.header?i.appendChild(l.header(l)):i.appendChild(document.createElement("completion-section")).textContent=e)}const h=i.appendChild(document.createElement("li"));h.id=t+"-"+s,h.setAttribute("role","option");let c=this.optionClass(o);c&&(h.className=c);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,a);t&&h.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function en(e,t){return n=>new Jt(n,e,t)}function tn(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class nn{constructor(e,t,n,i,r,s){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=s}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new nn(this.options,an(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,r,s){if(i&&!s&&e.some(e=>e.isPending))return i.setDisabled();let o=function(e,t){let n=[],i=null,r=null,s=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some(t=>t.name==e)||i.push("string"==typeof t?{name:e}:t)}},o=t.facet(Ut);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)s(new Nt(t,i.source,e?e(t):[],1e9-n.length));else{let n,a=t.sliceDoc(i.from,i.to),l=o.filterStrict?new Xt(a):new Ht(a);for(let t of i.result.options)if(n=l.match(t.label)){let o=t.displayLabel?e?e(t,n.matched):[]:n.matched,a=n.score+(t.boost||0);if(s(new Nt(t,i.source,o,a)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;r||(r=Object.create(null)),r[e]=Math.max(a,r[e]||-1e9)}}}}if(i){let e=Object.create(null),t=0,s=(e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?r[t.name]-r[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of i.sort(s))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let a=[],l=null,h=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||h(e.completion,t.completion))){let t=e.completion;!l||l.label!=t.label||l.detail!=t.detail||null!=l.type&&null!=t.type&&l.type!=t.type||l.apply!=t.apply||l.boost!=t.boost?a.push(e):tn(e.completion)>tn(l)&&(a[a.length-1]=e),l=e.completion}return a}(e,t);if(!o.length)return i&&e.some(e=>e.isPending)?i.setDisabled():null;let a=t.facet(Ut).selectOnOpen?0:-1;if(i&&i.selected!=a&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<o.length;t++)if(o[t].completion==e){a=t;break}}return new nn(o,an(n,a),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:mn,above:r.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new nn(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new nn(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class rn{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new rn(ln,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(Ut),i=(n.override||t.languageDataAt("autocomplete",It(t)).map(_t)).map(t=>(this.active.find(e=>e.source==t)||new cn(t,this.active.some(e=>0!=e.state)?1:0)).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=this.open,s=e.effects.some(e=>e.is(dn));r&&e.docChanged&&(r=r.map(e.changes)),e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;i<t.length&&!t[i].hasResult();)i++;let r=n==e.length,s=i==t.length;if(r||s)return r==s;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)||s?r=nn.build(i,t,this.id,r,n,s):r&&r.disabled&&!i.some(e=>e.isPending)&&(r=null),!r&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new cn(e.source,0):e));for(let t of e.effects)t.is(Gt)&&(r=r&&r.setSelected(t.value,this.id));return i==this.active&&r==this.open?this:new rn(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?sn:on}}const sn={"aria-autocomplete":"list"},on={};function an(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const ln=[];function hn(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(Qt);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class cn{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=hn(e,t),i=this;(8&n||16&n&&this.touches(e))&&(i=new cn(i.source,0)),4&n&&0==i.state&&(i=new cn(this.source,1)),i=i.updateFor(e,n);for(let t of e.effects)if(t.is(Vt))i=new cn(i.source,1,t.value);else if(t.is(qt))i=new cn(i.source,0);else if(t.is(dn))for(let e of t.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(It(e.state))}}class un extends cn{constructor(e,t,n,i,r,s){super(e,3,t),this.limit=n,this.result=i,this.from=r,this.to=s}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let r=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),o=It(e.state);if(o>s||!i||2&t&&(It(e.startState)==this.from||o<this.limit))return new cn(this.source,4&t?1:0);let a=e.changes.mapPos(this.limit);return function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);return"function"==typeof e?e(r,n,i,t):$t(e,!0).test(r)}(i.validFor,e.state,r,s)?new un(this.source,this.explicit,a,i,r,s):i.update&&(i=i.update(i,r,s,new Bt(e.state,o,!1)))?new un(this.source,this.explicit,a,i,i.from,null!==(n=i.to)&&void 0!==n?n:It(e.state)):new cn(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new un(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new cn(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}const dn=o.Pe.define({map:(e,t)=>e.map(e=>e.map(t))}),fn=o.sU.define({create:()=>rn.start(),update:(e,t)=>e.update(t),provide:e=>[a.DK.from(e,e=>e.tooltip),a.Lz.contentAttributes.from(e,e=>e.attrs)]});function pn(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(fn).active.find(e=>e.source==t.source);return i instanceof un&&("string"==typeof n?e.dispatch({...Ft(e.state,n,i.from,i.to),annotations:Qt.of(t.completion)}):n(e,t.completion,i.from,i.to),!0)}const mn=en(fn,pn);function gn(e,t="option"){return n=>{let i=n.state.field(fn,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(Ut).interactionDelay)return!1;let r,s=1;"page"==t&&(r=(0,a.Eg)(n,i.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(e?1:-1):e?0:o-1;return l<0?l="page"==t?0:o-1:l>=o&&(l="page"==t?o-1:0),n.dispatch({effects:Gt.of(l)}),!0}}const bn=e=>!!e.state.field(fn,!1)&&(e.dispatch({effects:Vt.of(!0)}),!0);class yn{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const vn=a.Z9.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(fn).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(fn),n=e.state.facet(Ut);if(!e.selectionSet&&!e.docChanged&&e.startState.field(fn)==t)return;let i=e.transactions.some(e=>{let t=hn(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(i||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){(0,a.c_)(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(Vt)))&&(this.pendingStart=!0);let r=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),r):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(fn);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ut).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=It(t),i=new Bt(t,n,e.explicit,this.view),r=new yn(e,i);this.running.push(r),Promise.resolve(e.source(i)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:qt.of(null)}),(0,a.c_)(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ut).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Ut),i=this.view.state.field(fn);for(let r=0;r<this.running.length;r++){let s=this.running[r];if(void 0===s.done)continue;if(this.running.splice(r--,1),s.done){let i=It(s.updates.length?s.updates[0].startState:this.view.state),r=Math.min(i,s.done.from+(s.active.explicit?0:1)),o=new un(s.active.source,s.active.explicit,r,s.done,s.done.from,null!==(e=s.done.to)&&void 0!==e?e:i);for(let e of s.updates)o=o.update(e,n);if(o.hasResult()){t.push(o);continue}}let o=i.active.find(e=>e.source==s.active.source);if(o&&o.isPending)if(null==s.done){let e=new cn(s.active.source,0);for(let t of s.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:dn.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(fn,!1);if(t&&t.tooltip&&this.view.state.facet(Ut).closeOnBlur){let n=t.open&&(0,a.Eg)(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:qt.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:Vt.of(!1)}),20),this.composing=0}}}),kn="object"==typeof navigator&&/Win/.test(navigator.platform),wn=o.Nb.highest(a.Lz.domEventHandlers({keydown(e,t){let n=t.state.field(fn,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&(!kn||!e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(e=>e.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&pn(t,i),!1}})),xn=a.Lz.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"}}}),On={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Sn=o.Pe.define({map(e,t){let n=t.mapPos(e,-1,o.iR.TrackAfter);return null==n?void 0:n}}),Cn=new class extends o.FB{};Cn.startSide=1,Cn.endSide=-1;const An=o.sU.define({create:()=>o.om.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(Sn)&&(e=e.update({add:[Cn.range(n.value,n.value+1)]}));return e}}),Tn="()[]{}<>«»»«[]{}";function Mn(e){for(let t=0;t<16;t+=2)if(Tn.charCodeAt(t)==e)return Tn.charAt(t+1);return(0,o.MK)(e<128?e:e+1)}function Pn(e,t){return e.languageDataAt("closeBrackets",t)[0]||On}const zn="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Dn=a.Lz.inputHandler.of((e,t,n,i)=>{if((zn?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||2==i.length&&1==(0,o.Fh)((0,o.vS)(i,0))||t!=r.from||n!=r.to)return!1;let s=function(e,t){let n=Pn(e,e.selection.main.head),i=n.brackets||On.brackets;for(let r of i){let s=Mn((0,o.vS)(r,0));if(t==r)return s==r?Nn(e,r,i.indexOf(r+r+r)>-1,n):Bn(e,r,s,n.before||On.before);if(t==s&&Rn(e,e.selection.main.from))return jn(e,0,s)}return null}(e.state,i);return!!s&&(e.dispatch(s),!0)}),Ln=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Pn(e,e.selection.main.head).brackets||On.brackets,i=null,r=e.changeByRange(t=>{if(t.empty){let i=function(e,t){let n=e.sliceString(t-2,t);return(0,o.Fh)((0,o.vS)(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let r of n)if(r==i&&En(e.doc,t.head)==Mn((0,o.vS)(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:o.OF.cursor(t.head-r.length)}}return{range:i=t}});return i||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function Rn(e,t){let n=!1;return e.field(An).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function En(e,t){let n=e.sliceString(t,t+2);return n.slice(0,(0,o.Fh)((0,o.vS)(n,0)))}function Bn(e,t,n,i){let r=null,s=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:Sn.of(s.to+t.length),range:o.OF.range(s.anchor+t.length,s.head+t.length)};let a=En(e.doc,s.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:Sn.of(s.head+t.length),range:o.OF.cursor(s.head+t.length)}:{range:r=s}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function jn(e,t,n){let i=null,r=e.changeByRange(t=>t.empty&&En(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:o.OF.cursor(t.head+n.length)}:i={range:t});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Nn(e,t,n,i){let r=i.stringPrefixes||On.stringPrefixes,s=null,a=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:Sn.of(i.to+t.length),range:o.OF.range(i.anchor+t.length,i.head+t.length)};let a,h=i.head,c=En(e.doc,h);if(c==t){if(In(e,h))return{changes:{insert:t+t,from:h},effects:Sn.of(h+t.length),range:o.OF.cursor(h+t.length)};if(Rn(e,h)){let i=n&&e.sliceDoc(h,h+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:h,to:h+i.length,insert:i},range:o.OF.cursor(h+i.length)}}}else{if(n&&e.sliceDoc(h-2*t.length,h)==t+t&&(a=$n(e,h-2*t.length,r))>-1&&In(e,a))return{changes:{insert:t+t+t+t,from:h},effects:Sn.of(h+t.length),range:o.OF.cursor(h+t.length)};if(e.charCategorizer(h)(c)!=o.Je.Word&&$n(e,h,r)>-1&&!function(e,t,n,i){let r=(0,l.mv)(e).resolveInner(t,-1),s=i.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+s)),a=o.indexOf(n);if(!a||a>-1&&i.indexOf(o.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=r.to==t&&r.parent;if(!l)break;r=l}return!1}(e,h,t,r))return{changes:{insert:t+t,from:h},effects:Sn.of(h+t.length),range:o.OF.cursor(h+t.length)}}return{range:s=i}});return s?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function In(e,t){let n=(0,l.mv)(e).resolveInner(t+1);return n.parent&&n.from==t}function $n(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=o.Je.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&i(e.sliceDoc(n-1,n))!=o.Je.Word)return n}return-1}const Qn=[{key:"Ctrl-Space",run:bn},{mac:"Alt-`",run:bn},{mac:"Alt-i",run:bn},{key:"Escape",run:e=>{let t=e.state.field(fn,!1);return!(!t||!t.active.some(e=>0!=e.state)||(e.dispatch({effects:qt.of(null)}),0))}},{key:"ArrowDown",run:gn(!0)},{key:"ArrowUp",run:gn(!1)},{key:"PageDown",run:gn(!0,"page")},{key:"PageUp",run:gn(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(fn,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Ut).interactionDelay)&&pn(e,t.open.options[t.open.selected])}}],Fn=o.Nb.highest(a.w4.computeN([Ut],e=>e.facet(Ut).defaultKeymap?[Qn]:[]));var Wn=n(1419),Vn=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(Ln)),!1!==e.defaultKeymap&&(n=n.concat(Be)),!1!==e.searchKeymap&&(n=n.concat(Mt)),!1!==e.historyKeymap&&(n=n.concat(I)),!1!==e.foldKeymap&&(n=n.concat(l.f7)),!1!==e.completionKeymap&&(n=n.concat(Qn)),!1!==e.lintKeymap&&(n=n.concat(Wn.lintKeymap));var i=[];return!1!==e.lineNumbers&&i.push((0,a.$K)()),!1!==e.highlightActiveLineGutter&&i.push((0,a.Wu)()),!1!==e.highlightSpecialChars&&i.push((0,a.N$)()),!1!==e.history&&i.push(x()),!1!==e.foldGutter&&i.push((0,l.Lv)()),!1!==e.drawSelection&&i.push((0,a.VH)()),!1!==e.dropCursor&&i.push((0,a.A)()),!1!==e.allowMultipleSelections&&i.push(o.$t.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&i.push((0,l.WD)()),!1!==e.syntaxHighlighting&&i.push((0,l.y9)(l.Zt,{fallback:!0})),!1!==e.bracketMatching&&i.push((0,l.SG)()),!1!==e.closeBrackets&&i.push([Dn,An]),!1!==e.autocompletion&&i.push(function(e={}){return[wn,fn,Ut.of(e),vn,Fn,xn]}()),!1!==e.rectangularSelection&&i.push((0,a.D4)()),!1!==t&&i.push((0,a.HJ)()),!1!==e.highlightActiveLine&&i.push((0,a.dz)()),!1!==e.highlightSelectionMatches&&i.push(function(){let e=[Je,Ze];return e}()),e.tabSize&&"number"==typeof e.tabSize&&i.push(l.Xt.of(" ".repeat(e.tabSize))),i.concat([a.w4.of(n.flat())]).filter(Boolean)},qn=function(e){void 0===e&&(e={});var t=[];!1!==e.defaultKeymap&&(t=t.concat(Be)),!1!==e.historyKeymap&&(t=t.concat(I));var n=[];return!1!==e.highlightSpecialChars&&n.push((0,a.N$)()),!1!==e.history&&n.push(x()),!1!==e.drawSelection&&n.push((0,a.VH)()),!1!==e.syntaxHighlighting&&n.push((0,l.y9)(l.Zt,{fallback:!0})),n.concat([a.w4.of(t.flat())]).filter(Boolean)},Hn=n(3720);const Xn="#e5c07b",Un="#e06c75",Yn="#56b6c2",Kn="#ffffff",Gn="#abb2bf",Zn="#7d8799",Jn="#61afef",ei="#98c379",ti="#d19a66",ni="#c678dd",ii="#21252b",ri="#2c313a",si="#282c34",oi="#353a42",ai="#3E4451",li="#528bff",hi={chalky:Xn,coral:Un,cyan:Yn,invalid:Kn,ivory:Gn,stone:Zn,malibu:Jn,sage:ei,whiskey:ti,violet:ni,darkBackground:ii,highlightBackground:ri,background:si,tooltipBackground:oi,selection:ai,cursor:li},ci=a.Lz.theme({"&":{color:Gn,backgroundColor:si},".cm-content":{caretColor:li},".cm-cursor, .cm-dropCursor":{borderLeftColor:li},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ai},".cm-panels":{backgroundColor:ii,color:Gn},".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:si,color:Zn,border:"none"},".cm-activeLineGutter":{backgroundColor:ri},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:oi},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:oi,borderBottomColor:oi},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ri,color:Gn}}},{dark:!0}),ui=l.cr.define([{tag:Hn._A.keyword,color:ni},{tag:[Hn._A.name,Hn._A.deleted,Hn._A.character,Hn._A.propertyName,Hn._A.macroName],color:Un},{tag:[Hn._A.function(Hn._A.variableName),Hn._A.labelName],color:Jn},{tag:[Hn._A.color,Hn._A.constant(Hn._A.name),Hn._A.standard(Hn._A.name)],color:ti},{tag:[Hn._A.definition(Hn._A.name),Hn._A.separator],color:Gn},{tag:[Hn._A.typeName,Hn._A.className,Hn._A.number,Hn._A.changed,Hn._A.annotation,Hn._A.modifier,Hn._A.self,Hn._A.namespace],color:Xn},{tag:[Hn._A.operator,Hn._A.operatorKeyword,Hn._A.url,Hn._A.escape,Hn._A.regexp,Hn._A.link,Hn._A.special(Hn._A.string)],color:Yn},{tag:[Hn._A.meta,Hn._A.comment],color:Zn},{tag:Hn._A.strong,fontWeight:"bold"},{tag:Hn._A.emphasis,fontStyle:"italic"},{tag:Hn._A.strikethrough,textDecoration:"line-through"},{tag:Hn._A.link,color:Zn,textDecoration:"underline"},{tag:Hn._A.heading,fontWeight:"bold",color:Un},{tag:[Hn._A.atom,Hn._A.bool,Hn._A.special(Hn._A.variableName)],color:ti},{tag:[Hn._A.processingInstruction,Hn._A.string,Hn._A.inserted],color:ei},{tag:Hn._A.invalid,color:Kn}]),di=[ci,(0,l.y9)(ui)];var fi=a.Lz.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),pi=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:i=!1,theme:r="light",placeholder:s="",basicSetup:l=!0}=e,h=[];switch(t&&h.unshift(a.w4.of([je])),l&&("boolean"==typeof l?h.unshift(Vn()):h.unshift(Vn(l))),s&&h.unshift((0,a.qf)(s)),r){case"light":h.push(fi);break;case"dark":h.push(di);break;case"none":break;default:h.push(r)}return!1===n&&h.push(a.Lz.editable.of(!1)),i&&h.push(o.$t.readOnly.of(!0)),[...h]},mi=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)});class gi{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class bi{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var yi=null,vi=o.YH.define(),ki=[];function wi(e){var{value:t,selection:n,onChange:i,onStatistics:r,onCreateEditor:l,onUpdate:h,extensions:c=ki,autoFocus:u,theme:d="light",height:f=null,minHeight:p=null,maxHeight:m=null,width:g=null,minWidth:b=null,maxWidth:y=null,placeholder:v="",editable:k=!0,readOnly:w=!1,indentWithTab:x=!0,basicSetup:O=!0,root:S,initialState:C}=e,[A,T]=(0,s.useState)(),[M,P]=(0,s.useState)(),[z,D]=(0,s.useState)(),L=(0,s.useState)(()=>({current:null}))[0],R=(0,s.useState)(()=>({current:null}))[0],E=a.Lz.theme({"&":{height:f,minHeight:p,maxHeight:m,width:g,minWidth:b,maxWidth:y},"& .cm-scroller":{height:"100% !important"}}),B=[a.Lz.updateListener.of(e=>{if(e.docChanged&&"function"==typeof i&&!e.transactions.some(e=>e.annotation(vi))){L.current?L.current.reset():(L.current=new gi(()=>{if(R.current){var e=R.current;R.current=null,e()}L.current=null},200),("undefined"==typeof window?new bi:(yi||(yi=new bi),yi)).add(L.current));var t=e.state.doc.toString();i(t,e)}r&&r(mi(e))}),E,...pi({theme:d,editable:k,readOnly:w,placeholder:v,indentWithTab:x,basicSetup:O})];return h&&"function"==typeof h&&B.push(a.Lz.updateListener.of(h)),B=B.concat(c),(0,s.useLayoutEffect)(()=>{if(A&&!z){var e={doc:t,selection:n,extensions:B},i=C?o.$t.fromJSON(C.json,e,C.fields):o.$t.create(e);if(D(i),!M){var r=new a.Lz({state:i,parent:A,root:S});P(r),l&&l(r,i)}}return()=>{M&&(D(void 0),P(void 0))}},[A,z]),(0,s.useEffect)(()=>{e.container&&T(e.container)},[e.container]),(0,s.useEffect)(()=>()=>{M&&(M.destroy(),P(void 0)),L.current&&(L.current.cancel(),L.current=null)},[M]),(0,s.useEffect)(()=>{u&&M&&M.focus()},[u,M]),(0,s.useEffect)(()=>{M&&M.dispatch({effects:o.Pe.reconfigure.of(B)})},[d,c,f,p,m,g,b,y,v,k,w,x,O,i,h]),(0,s.useEffect)(()=>{if(void 0!==t){var e=M?M.state.doc.toString():"";if(M&&t!==e){var n=()=>{M&&t!==M.state.doc.toString()&&M.dispatch({changes:{from:0,to:M.state.doc.toString().length,insert:t||""},annotations:[vi.of(!0)]})};L.current&&!L.current.isDone?R.current=n:n()}}},[t,M]),{state:z,setState:D,view:M,setView:P,container:A,setContainer:T}}var xi=n(790),Oi=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Si=(0,s.forwardRef)((e,t)=>{var{className:n,value:o="",selection:a,extensions:l=[],onChange:h,onStatistics:c,onCreateEditor:u,onUpdate:d,autoFocus:f,theme:p="light",height:m,minHeight:g,maxHeight:b,width:y,minWidth:v,maxWidth:k,basicSetup:w,placeholder:x,indentWithTab:O,editable:S,readOnly:C,root:A,initialState:T}=e,M=(0,r.A)(e,Oi),P=(0,s.useRef)(null),{state:z,view:D,container:L,setContainer:R}=wi({root:A,value:o,autoFocus:f,theme:p,height:m,minHeight:g,maxHeight:b,width:y,minWidth:v,maxWidth:k,basicSetup:w,placeholder:x,indentWithTab:O,editable:S,readOnly:C,selection:a,onChange:h,onStatistics:c,onCreateEditor:u,onUpdate:d,extensions:l,initialState:T});(0,s.useImperativeHandle)(t,()=>({editor:P.current,state:z,view:D}),[P,L,z,D]);var E=(0,s.useCallback)(e=>{P.current=e,R(e)},[R]);if("string"!=typeof o)throw new Error("value must be typeof string but got "+typeof o);var B="string"==typeof p?"cm-theme-"+p:"cm-theme";return(0,xi.jsx)("div",(0,i.A)({ref:E,className:B+(n?" "+n:"")},M))});Si.displayName="CodeMirror";const Ci=Si},3748(e,t,n){"use strict";function i(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var s=n[i];"string"==typeof s?e.setAttribute(i,s):null!=s&&(e[i]=s)}t++}for(;t<arguments.length;t++)r(e,arguments[t]);return e}function r(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)r(e,t[n])}}n.d(t,{A:()=>i})},546(e,t,n){"use strict";n.r(t),n.d(t,{Lexer:()=>Ki,List:()=>ht,OffsetToLocation:()=>mt,TokenStream:()=>xt,clone:()=>oh,createLexer:()=>fh,createSyntax:()=>nr,definitionSyntax:()=>ae,find:()=>mh,findAll:()=>bh,findLast:()=>gh,fork:()=>kh,fromPlainObject:()=>vh,generate:()=>uh,ident:()=>le,isCustomProperty:()=>sn,keyword:()=>tn,lexer:()=>dh,parse:()=>ch,property:()=>nn,string:()=>U,toPlainObject:()=>yh,tokenNames:()=>gt,tokenTypes:()=>i,tokenize:()=>hh,url:()=>ee,vendorPrefix:()=>rn,version:()=>sh,walk:()=>ph});var i={};n.r(i),n.d(i,{AtKeyword:()=>de,BadString:()=>me,BadUrl:()=>be,CDC:()=>Se,CDO:()=>Oe,Colon:()=>Ce,Comma:()=>Te,Comment:()=>Ee,Delim:()=>ye,Dimension:()=>we,EOF:()=>he,Function:()=>ue,Hash:()=>fe,Ident:()=>ce,LeftCurlyBracket:()=>Le,LeftParenthesis:()=>ze,LeftSquareBracket:()=>Me,Number:()=>ve,Percentage:()=>ke,RightCurlyBracket:()=>Re,RightParenthesis:()=>De,RightSquareBracket:()=>Pe,Semicolon:()=>Ae,String:()=>pe,Url:()=>ge,WhiteSpace:()=>xe});var r={};n.r(r),n.d(r,{safe:()=>jt,spec:()=>Bt});var s={};n.r(s),n.d(s,{angle:()=>Wn,decibel:()=>Un,flex:()=>Xn,frequency:()=>qn,length:()=>Fn,resolution:()=>Hn,semitones:()=>Yn,time:()=>Vn});var o={};n.r(o),n.d(o,{getTrace:()=>Li,isKeyword:()=>Bi,isProperty:()=>Ei,isType:()=>Ri});var a={};n.r(a),n.d(a,{generate:()=>pr,name:()=>ur,parse:()=>fr,structure:()=>dr});var l={};n.r(l),n.d(l,{generate:()=>wr,name:()=>br,parse:()=>kr,structure:()=>vr,walkContext:()=>yr});var h={};n.r(h),n.d(h,{generate:()=>Ar,name:()=>xr,parse:()=>Cr,structure:()=>Sr,walkContext:()=>Or});var c={};n.r(c),n.d(c,{generate:()=>Lr,name:()=>Pr,parse:()=>Dr,structure:()=>zr});var u={};n.r(u),n.d(u,{generate:()=>Fr,name:()=>Nr,parse:()=>Qr,structure:()=>$r,walkContext:()=>Ir});var d={};n.r(d),n.d(d,{generate:()=>qr,name:()=>Wr,parse:()=>Vr,structure:()=>_r});var f={};n.r(f),n.d(f,{generate:()=>Yr,name:()=>Hr,parse:()=>Ur,structure:()=>Xr});var p={};n.r(p),n.d(p,{generate:()=>Jr,name:()=>Kr,parse:()=>Zr,structure:()=>Gr});var m={};n.r(m),n.d(m,{generate:()=>is,name:()=>es,parse:()=>ns,structure:()=>ts});var g={};n.r(g),n.d(g,{generate:()=>as,name:()=>rs,parse:()=>os,structure:()=>ss});var b={};n.r(b),n.d(b,{generate:()=>us,name:()=>ls,parse:()=>cs,structure:()=>hs});var y={};n.r(y),n.d(y,{generate:()=>ys,name:()=>fs,parse:()=>bs,structure:()=>ps});var v={};n.r(v),n.d(v,{generate:()=>As,name:()=>xs,parse:()=>Cs,structure:()=>Ss,walkContext:()=>Os});var k={};n.r(k),n.d(k,{generate:()=>Rs,name:()=>zs,parse:()=>Ls,structure:()=>Ds});var w={};n.r(w),n.d(w,{generate:()=>Ns,name:()=>Es,parse:()=>js,structure:()=>Bs});var x={};n.r(x),n.d(x,{generate:()=>Fs,name:()=>Is,parse:()=>Qs,structure:()=>$s});var O={};n.r(O),n.d(O,{generate:()=>Hs,name:()=>Ws,parse:()=>qs,structure:()=>_s});var S={};n.r(S),n.d(S,{generate:()=>Zs,name:()=>Xs,parse:()=>Gs,structure:()=>Us});var C={};n.r(C),n.d(C,{generate:()=>io,name:()=>Js,parse:()=>no,structure:()=>to,walkContext:()=>eo});var A={};n.r(A),n.d(A,{generate:()=>ao,name:()=>ro,parse:()=>oo,structure:()=>so});var T={};n.r(T),n.d(T,{generate:()=>fo,name:()=>ho,parse:()=>uo,structure:()=>co,xxx:()=>lo});var M={};n.r(M),n.d(M,{generate:()=>bo,name:()=>po,parse:()=>go,structure:()=>mo});var P={};n.r(P),n.d(P,{generate:()=>wo,name:()=>yo,parse:()=>ko,structure:()=>vo});var z={};n.r(z),n.d(z,{generate:()=>Co,name:()=>xo,parse:()=>So,structure:()=>Oo});var D={};n.r(D),n.d(D,{generate:()=>Po,name:()=>Ao,parse:()=>Mo,structure:()=>To});var L={};n.r(L),n.d(L,{generate:()=>Ro,name:()=>zo,parse:()=>Lo,structure:()=>Do});var R={};n.r(R),n.d(R,{generate:()=>No,name:()=>Eo,parse:()=>jo,structure:()=>Bo});var E={};n.r(E),n.d(E,{generate:()=>Fo,name:()=>Io,parse:()=>Qo,structure:()=>$o});var B={};n.r(B),n.d(B,{generate:()=>qo,name:()=>Wo,parse:()=>Vo,structure:()=>_o});var j={};n.r(j),n.d(j,{generate:()=>Yo,name:()=>Ho,parse:()=>Uo,structure:()=>Xo});var N={};n.r(N),n.d(N,{generate:()=>Jo,name:()=>Ko,parse:()=>Zo,structure:()=>Go});var I={};n.r(I),n.d(I,{generate:()=>ia,name:()=>ea,parse:()=>na,structure:()=>ta});var $={};n.r($),n.d($,{generate:()=>aa,name:()=>ra,parse:()=>oa,structure:()=>sa});var Q={};n.r(Q),n.d(Q,{generate:()=>da,name:()=>la,parse:()=>ua,structure:()=>ca,walkContext:()=>ha});var F={};n.r(F),n.d(F,{generate:()=>ba,name:()=>fa,parse:()=>ga,structure:()=>ma,walkContext:()=>pa});var W={};n.r(W),n.d(W,{generate:()=>xa,name:()=>va,parse:()=>wa,structure:()=>ka});var _={};n.r(_),n.d(_,{generate:()=>Ta,name:()=>Sa,parse:()=>Aa,structure:()=>Ca});var V={};n.r(V),n.d(V,{generate:()=>Ea,name:()=>za,parse:()=>Ra,structure:()=>La,walkContext:()=>Da});var q={};n.r(q),n.d(q,{generate:()=>Ia,name:()=>Ba,parse:()=>Na,structure:()=>ja});var H={};n.r(H),n.d(H,{generate:()=>Wa,name:()=>$a,parse:()=>Fa,structure:()=>Qa});var X={};n.r(X),n.d(X,{generate:()=>Xa,name:()=>_a,parse:()=>Ha,structure:()=>qa,walkContext:()=>Va});var U={};n.r(U),n.d(U,{decode:()=>Ua,encode:()=>Ya});var Y={};n.r(Y),n.d(Y,{generate:()=>Ja,name:()=>Ka,parse:()=>Za,structure:()=>Ga});var K={};n.r(K),n.d(K,{generate:()=>sl,name:()=>tl,parse:()=>rl,structure:()=>il,walkContext:()=>nl});var G={};n.r(G),n.d(G,{generate:()=>hl,name:()=>ol,parse:()=>ll,structure:()=>al});var Z={};n.r(Z),n.d(Z,{generate:()=>pl,name:()=>ul,parse:()=>fl,structure:()=>dl});var J={};n.r(J),n.d(J,{generate:()=>xl,name:()=>vl,parse:()=>wl,structure:()=>kl});var ee={};n.r(ee),n.d(ee,{decode:()=>Ol,encode:()=>Sl});var te={};n.r(te),n.d(te,{generate:()=>Ml,name:()=>Cl,parse:()=>Tl,structure:()=>Al});var ne={};n.r(ne),n.d(ne,{generate:()=>Ll,name:()=>Pl,parse:()=>Dl,structure:()=>zl});var ie={};n.r(ie),n.d(ie,{generate:()=>Nl,name:()=>El,parse:()=>jl,structure:()=>Bl});var re={};n.r(re),n.d(re,{AnPlusB:()=>a,Atrule:()=>l,AtrulePrelude:()=>h,AttributeSelector:()=>c,Block:()=>u,Brackets:()=>d,CDC:()=>f,CDO:()=>p,ClassSelector:()=>m,Combinator:()=>g,Comment:()=>b,Condition:()=>y,Declaration:()=>v,DeclarationList:()=>k,Dimension:()=>w,Feature:()=>x,FeatureFunction:()=>O,FeatureRange:()=>S,Function:()=>C,GeneralEnclosed:()=>A,Hash:()=>T,IdSelector:()=>P,Identifier:()=>M,Layer:()=>z,LayerList:()=>D,MediaQuery:()=>L,MediaQueryList:()=>R,NestingSelector:()=>E,Nth:()=>B,Number:()=>j,Operator:()=>N,Parentheses:()=>I,Percentage:()=>$,PseudoClassSelector:()=>Q,PseudoElementSelector:()=>F,Ratio:()=>W,Raw:()=>_,Rule:()=>V,Scope:()=>q,Selector:()=>H,SelectorList:()=>X,String:()=>Y,StyleSheet:()=>K,SupportsDeclaration:()=>G,TypeSelector:()=>Z,UnicodeRange:()=>J,Url:()=>te,Value:()=>ne,WhiteSpace:()=>ie});var se={};n.r(se),n.d(se,{AtrulePrelude:()=>Ql,Selector:()=>Fl,Value:()=>ql});var oe={};n.r(oe),n.d(oe,{AnPlusB:()=>fr,Atrule:()=>kr,AtrulePrelude:()=>Cr,AttributeSelector:()=>Dr,Block:()=>Qr,Brackets:()=>Vr,CDC:()=>Ur,CDO:()=>Zr,ClassSelector:()=>ns,Combinator:()=>os,Comment:()=>cs,Condition:()=>bs,Declaration:()=>Cs,DeclarationList:()=>Ls,Dimension:()=>js,Feature:()=>Qs,FeatureFunction:()=>qs,FeatureRange:()=>Gs,Function:()=>no,GeneralEnclosed:()=>oo,Hash:()=>uo,IdSelector:()=>ko,Identifier:()=>go,Layer:()=>So,LayerList:()=>Mo,MediaQuery:()=>Lo,MediaQueryList:()=>jo,NestingSelector:()=>Qo,Nth:()=>Vo,Number:()=>Uo,Operator:()=>Zo,Parentheses:()=>na,Percentage:()=>oa,PseudoClassSelector:()=>ua,PseudoElementSelector:()=>ga,Ratio:()=>wa,Raw:()=>Aa,Rule:()=>Ra,Scope:()=>Na,Selector:()=>Fa,SelectorList:()=>Ha,String:()=>Za,StyleSheet:()=>rl,SupportsDeclaration:()=>ll,TypeSelector:()=>fl,UnicodeRange:()=>wl,Url:()=>Tl,Value:()=>Dl,WhiteSpace:()=>jl});var ae={};n.r(ae),n.d(ae,{SyntaxError:()=>Kn,generate:()=>Xt,parse:()=>li,walk:()=>ui});var le={};n.r(le),n.d(le,{decode:()=>ah,encode:()=>lh});const he=0,ce=1,ue=2,de=3,fe=4,pe=5,me=6,ge=7,be=8,ye=9,ve=10,ke=11,we=12,xe=13,Oe=14,Se=15,Ce=16,Ae=17,Te=18,Me=19,Pe=20,ze=21,De=22,Le=23,Re=24,Ee=25;function Be(e){return e>=48&&e<=57}function je(e){return Be(e)||e>=65&&e<=70||e>=97&&e<=102}function Ne(e){return e>=65&&e<=90}function Ie(e){return function(e){return Ne(e)||function(e){return e>=97&&e<=122}(e)}(e)||function(e){return e>=128}(e)||95===e}function $e(e){return Ie(e)||Be(e)||45===e}function Qe(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function Fe(e){return 10===e||13===e||12===e}function We(e){return Fe(e)||32===e||9===e}function _e(e,t){return 92===e&&!Fe(t)&&0!==t}function Ve(e,t,n){return 45===e?Ie(t)||45===t||_e(t,n):!!Ie(e)||92===e&&_e(e,t)}function qe(e,t,n){return 43===e||45===e?Be(t)?2:46===t&&Be(n)?3:0:46===e?Be(t)?2:0:Be(e)?1:0}function He(e){return 65279===e||65534===e?1:0}const Xe=new Array(128),Ue=130;for(let e=0;e<Xe.length;e++)Xe[e]=(We(e)?Ue:Be(e)&&131)||Ie(e)&&132||Qe(e)&&133||e||128;function Ye(e){return e<128?Xe[e]:132}function Ke(e,t){return t<e.length?e.charCodeAt(t):0}function Ge(e,t,n){return 13===n&&10===Ke(e,t+1)?2:1}function Ze(e,t,n){let i=e.charCodeAt(t);return Ne(i)&&(i|=32),i===n}function Je(e,t,n,i){if(n-t!==i.length)return!1;if(t<0||n>e.length)return!1;for(let r=t;r<n;r++){const n=i.charCodeAt(r-t);let s=e.charCodeAt(r);if(Ne(s)&&(s|=32),s!==n)return!1}return!0}function et(e,t){for(;t<e.length&&We(e.charCodeAt(t));t++);return t}function tt(e,t){for(;t<e.length&&Be(e.charCodeAt(t));t++);return t}function nt(e,t){if(je(Ke(e,(t+=2)-1))){for(const n=Math.min(e.length,t+5);t<n&&je(Ke(e,t));t++);const n=Ke(e,t);We(n)&&(t+=Ge(e,t,n))}return t}function it(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!$e(n)){if(!_e(n,Ke(e,t+1)))break;t=nt(e,t)-1}}return t}function rt(e,t){let n=e.charCodeAt(t);if(43!==n&&45!==n||(n=e.charCodeAt(t+=1)),Be(n)&&(t=tt(e,t+1),n=e.charCodeAt(t)),46===n&&Be(e.charCodeAt(t+1))&&(t=tt(e,t+=2)),Ze(e,t,101)){let i=0;n=e.charCodeAt(t+1),45!==n&&43!==n||(i=1,n=e.charCodeAt(t+2)),Be(n)&&(t=tt(e,t+1+i+1))}return t}function st(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(41===n){t++;break}_e(n,Ke(e,t+1))&&(t=nt(e,t))}return t}function ot(e){if(1===e.length&&!je(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(0===t||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}function at(e,t){function n(t){return t<o?e.charCodeAt(t):0}function i(){return h=rt(e,h),Ve(n(h),n(h+1),n(h+2))?(a=we,void(h=it(e,h))):37===n(h)?(a=ke,void h++):void(a=ve)}function r(){const t=h;return h=it(e,h),Je(e,t,h,"url")&&40===n(h)?(h=et(e,h+1),34===n(h)||39===n(h)?(a=ue,void(h=t+4)):void function(){for(a=ge,h=et(e,h);h<e.length;h++){const t=e.charCodeAt(h);switch(Ye(t)){case 41:return void h++;case Ue:return h=et(e,h),41===n(h)||h>=e.length?void(h<e.length&&h++):(h=st(e,h),void(a=be));case 34:case 39:case 40:case 133:return h=st(e,h),void(a=be);case 92:if(_e(t,n(h+1))){h=nt(e,h)-1;break}return h=st(e,h),void(a=be)}}}()):40===n(h)?(a=ue,void h++):void(a=ce)}function s(t){for(t||(t=n(h++)),a=pe;h<e.length;h++){const i=e.charCodeAt(h);switch(Ye(i)){case t:return void h++;case Ue:if(Fe(i))return h+=Ge(e,h,i),void(a=me);break;case 92:if(h===e.length-1)break;const r=n(h+1);Fe(r)?h+=Ge(e,h+1,r):_e(i,r)&&(h=nt(e,h)-1)}}}const o=(e=String(e||"")).length;let a,l=He(n(0)),h=l;for(;h<o;){const o=e.charCodeAt(h);switch(Ye(o)){case Ue:a=xe,h=et(e,h+1);break;case 34:s();break;case 35:$e(n(h+1))||_e(n(h+1),n(h+2))?(a=fe,h=it(e,h+1)):(a=ye,h++);break;case 39:s();break;case 40:a=ze,h++;break;case 41:a=De,h++;break;case 43:qe(o,n(h+1),n(h+2))?i():(a=ye,h++);break;case 44:a=Te,h++;break;case 45:qe(o,n(h+1),n(h+2))?i():45===n(h+1)&&62===n(h+2)?(a=Se,h+=3):Ve(o,n(h+1),n(h+2))?r():(a=ye,h++);break;case 46:qe(o,n(h+1),n(h+2))?i():(a=ye,h++);break;case 47:42===n(h+1)?(a=Ee,h=e.indexOf("*/",h+2),h=-1===h?e.length:h+2):(a=ye,h++);break;case 58:a=Ce,h++;break;case 59:a=Ae,h++;break;case 60:33===n(h+1)&&45===n(h+2)&&45===n(h+3)?(a=Oe,h+=4):(a=ye,h++);break;case 64:Ve(n(h+1),n(h+2),n(h+3))?(a=de,h=it(e,h+1)):(a=ye,h++);break;case 91:a=Me,h++;break;case 92:_e(o,n(h+1))?r():(a=ye,h++);break;case 93:a=Pe,h++;break;case 123:a=Le,h++;break;case 125:a=Re,h++;break;case 131:i();break;case 132:r();break;default:a=ye,h++}t(a,l,l=h)}}let lt=null;class ht{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return ht.createItem(e)}allocateCursor(e,t){let n;return null!==lt?(n=lt,lt=lt.cursor,n.prev=e,n.next=t,n.cursor=this.cursor):n={prev:e,next:t,cursor:this.cursor},this.cursor=n,n}releaseCursor(){const{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=lt,lt=e}updateCursors(e,t,n,i){let{cursor:r}=this;for(;null!==r;)r.prev===e&&(r.prev=t),r.next===n&&(r.next=i),r=r.cursor}*[Symbol.iterator](){for(let e=this.head;null!==e;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;null!==t;t=t.next)e++;return e}get isEmpty(){return null===this.head}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let t=null;this.head=null;for(let n of e){const e=ht.createItem(n);null!==t?t.next=e:this.head=e,e.prev=t,t=e}return this.tail=t,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){const n=this.allocateCursor(null,this.head);for(;null!==n.next;){const i=n.next;n.next=i.next,e.call(t,i.data,i,this)}this.releaseCursor()}forEachRight(e,t=this){const n=this.allocateCursor(this.tail,null);for(;null!==n.prev;){const i=n.prev;n.prev=i.prev,e.call(t,i.data,i,this)}this.releaseCursor()}reduce(e,t,n=this){let i,r=this.allocateCursor(null,this.head),s=t;for(;null!==r.next;)i=r.next,r.next=i.next,s=e.call(n,s,i.data,i,this);return this.releaseCursor(),s}reduceRight(e,t,n=this){let i,r=this.allocateCursor(this.tail,null),s=t;for(;null!==r.prev;)i=r.prev,r.prev=i.prev,s=e.call(n,s,i.data,i,this);return this.releaseCursor(),s}some(e,t=this){for(let n=this.head;null!==n;n=n.next)if(e.call(t,n.data,n,this))return!0;return!1}map(e,t=this){const n=new ht;for(let i=this.head;null!==i;i=i.next)n.appendData(e.call(t,i.data,i,this));return n}filter(e,t=this){const n=new ht;for(let i=this.head;null!==i;i=i.next)e.call(t,i.data,i,this)&&n.appendData(i.data);return n}nextUntil(e,t,n=this){if(null===e)return;const i=this.allocateCursor(null,e);for(;null!==i.next;){const e=i.next;if(i.next=e.next,t.call(n,e.data,e,this))break}this.releaseCursor()}prevUntil(e,t,n=this){if(null===e)return;const i=this.allocateCursor(e,null);for(;null!==i.prev;){const e=i.prev;if(i.prev=e.prev,t.call(n,e.data,e,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const e=new ht;for(let t of this)e.appendData(t);return e}prepend(e){return this.updateCursors(null,e,this.head,e),null!==this.head?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(ht.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(ht.createItem(e))}insert(e,t=null){if(null!==t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,t){return this.insert(ht.createItem(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(null!==e.next)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(ht.createItem(e))}pop(){return null!==this.tail?this.remove(this.tail):null}unshift(e){this.prepend(ht.createItem(e))}shift(){return null!==this.head?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return null===e.head||(null!=t?(this.updateCursors(t.prev,e.tail,t,e.head),null!==t.prev?(t.prev.next=e.head,e.head.prev=t.prev):this.head=e.head,t.prev=e.tail,e.tail.next=t):(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null),this}replace(e,t){"head"in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}}function ct(e,t){const n=Object.create(SyntaxError.prototype),i=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(i.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}\n`)}})}function ut({source:e,line:t,column:n,baseLine:i,baseColumn:r},s){function o(e,t){return a.slice(e,t).map((t,n)=>String(e+n+1).padStart(c)+" |"+t).join("\n")}const a=("\n".repeat(Math.max(i-1,0))+" ".repeat(Math.max(r-1,0))+e).split(/\r\n?|\n|\f/),l=Math.max(1,t-s)-1,h=Math.min(t+s,a.length+1),c=Math.max(4,String(h).length)+1;let u=0;(n+=3*(a[t-1].substr(0,n-1).match(/\t/g)||[]).length)>100&&(u=n-60+3,n=58);for(let e=l;e<=h;e++)e>=0&&e<a.length&&(a[e]=a[e].replace(/\t/g," "),a[e]=(u>0&&a[e].length>u?"…":"")+a[e].substr(u,98)+(a[e].length>u+100-1?"…":""));return[o(l,t),new Array(n+c+2).join("-")+"^",o(t,h)].filter(Boolean).join("\n").replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function dt(e,t,n,i,r,s=1,o=1){return Object.assign(ct("SyntaxError",e),{source:t,offset:n,line:i,column:r,sourceFragment:e=>ut({source:t,line:i,column:r,baseLine:s,baseColumn:o},isNaN(e)?0:e),get formattedMessage(){return`Parse error: ${e}\n`+ut({source:t,line:i,column:r,baseLine:s,baseColumn:o},2)}})}function ft(e=null,t){return null===e||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}function pt(e){const t=e.source,n=t.length,i=t.length>0?He(t.charCodeAt(0)):0,r=ft(e.lines,n),s=ft(e.columns,n);let o=e.startLine,a=e.startColumn;for(let e=i;e<n;e++){const i=t.charCodeAt(e);r[e]=o,s[e]=a++,10!==i&&13!==i&&12!==i||(13===i&&e+1<n&&10===t.charCodeAt(e+1)&&(e++,r[e]=o,s[e]=a),o++,a=1)}r[n]=o,s[n]=a,e.lines=r,e.columns=s,e.computed=!0}class mt{constructor(e,t,n,i){this.setSource(e,t,n,i),this.lines=null,this.columns=null}setSource(e="",t=0,n=1,i=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=i,this.computed=!1}getLocation(e,t){return this.computed||pt(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||pt(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}}const gt=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"],bt=16777215,yt=24,vt=new Uint8Array(32);vt[ue]=De,vt[ze]=De,vt[Me]=Pe,vt[Le]=Re;const kt=new Uint8Array(32);function wt(e,t,n){return e<t?t:e>n?n:e}kt[ue]=1,kt[ze]=1,kt[Me]=1,kt[Le]=1,kt[De]=2,kt[Pe]=2,kt[Re]=2;class xt{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){const n=(e=String(e||"")).length,i=ft(this.offsetAndType,e.length+1),r=ft(this.balance,e.length+1);let s=0,o=-1,a=0,l=e.length;this.offsetAndType=null,this.balance=null,r.fill(0),t(e,(e,t,n)=>{const h=s++;if(i[h]=e<<yt|n,-1===o&&(o=t),r[h]=l,e===a){const e=r[l];r[l]=h,l=e,a=vt[i[e]>>yt]}else this.isBlockOpenerTokenType(e)&&(l=h,a=vt[e])}),i[s]=he<<yt|n,r[s]=s;for(let e=0;e<s;e++){const t=r[e];if(t<=e){const n=r[t];n!==e&&(r[e]=n)}else t>s&&(r[e]=s)}this.source=e,this.firstCharOffset=-1===o?0:o,this.tokenCount=s,this.offsetAndType=i,this.balance=r,this.reset(),this.next()}lookupType(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e]>>yt:he}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>yt;if(n!==xe&&n!==Ee&&0===e--)return n}return he}lookupOffset(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e-1]&bt:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>yt;if(n!==xe&&n!==Ee&&0===e--)return t-this.tokenIndex}return he}lookupValue(e,t){return(e+=this.tokenIndex)<this.tokenCount&&Je(this.source,this.offsetAndType[e-1]&bt,this.offsetAndType[e]&bt,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&bt:this.offsetAndType[this.tokenCount]&bt:this.firstCharOffset}getTokenEnd(e){return e===this.tokenIndex?this.tokenEnd:this.offsetAndType[wt(e,0,this.tokenCount)]&bt}getTokenType(e){return e===this.tokenIndex?this.tokenType:this.offsetAndType[wt(e,0,this.tokenCount)]>>yt}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBlockOpenerTokenType(e){return 1===kt[e]}isBlockCloserTokenType(e){return 2===kt[e]}getBlockTokenPairIndex(e){const t=this.getTokenType(e);if(1===kt[t]){const n=this.balance[e],i=this.getTokenType(n);return vt[t]===i?n:-1}if(2===kt[t]){const n=this.balance[e],i=this.getTokenType(n);return vt[i]===t?n:-1}return-1}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===ye&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===ye&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&bt,t=this.offsetAndType[t],this.tokenType=t>>yt,this.tokenEnd=t&bt):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>yt,this.tokenEnd=e&bt):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=he,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===xe||this.tokenType===Ee;)this.next()}skipUntilBalanced(e,t){let n=e,i=0,r=0;e:for(;n<this.tokenCount&&(i=this.balance[n],!(i<e));n++)switch(r=n>0?this.offsetAndType[n-1]&bt:this.firstCharOffset,t(this.source.charCodeAt(r))){case 1:break e;case 2:n++;break e;default:this.isBlockOpenerTokenType(this.offsetAndType[n]>>yt)&&(n=i)}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){const i=n,r=this.offsetAndType[t],s=r&bt;n=s,e(r>>yt,i,s,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,i,r)=>{e[r]={idx:r,type:gt[t],chunk:this.source.substring(n,i),balance:this.balance[r]}}),e}}function Ot(e){const t=this.createList();let n=!1;const i={recognizer:e};for(;!this.eof;){switch(this.tokenType){case Ee:this.next();continue;case xe:n=!0,this.next();continue}let r=e.getNode.call(this,i);if(void 0===r)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,r,t,i),n=!1),t.push(r)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,i),t}const St=()=>{},Ct={createList:()=>[],createSingleNodeList:e=>[e],getFirstListNode:e=>e&&e[0]||null,getLastListNode:e=>e&&e.length>0?e[e.length-1]:null},At={createList:()=>new ht,createSingleNodeList:e=>(new ht).appendData(e),getFirstListNode:e=>e&&e.first,getLastListNode:e=>e&&e.last};function Tt(e){return function(){return this[e]()}}function Mt(e){const t=Object.create(null);for(const n of Object.keys(e)){const i=e[n],r=i.parse||i;r&&(t[n]=r)}return t}var Pt=n(1527);const zt=new Set(["Atrule","Selector","Declaration"]),Dt=(e,t)=>(e===ye&&(e=t),"string"==typeof e&&(e=Math.min(e.charCodeAt(0),128)<<6),e<<1),Lt=[[ce,ce],[ce,ue],[ce,ge],[ce,be],[ce,"-"],[ce,ve],[ce,ke],[ce,we],[ce,Se],[ce,ze],[de,ce],[de,ue],[de,ge],[de,be],[de,"-"],[de,ve],[de,ke],[de,we],[de,Se],[fe,ce],[fe,ue],[fe,ge],[fe,be],[fe,"-"],[fe,ve],[fe,ke],[fe,we],[fe,Se],[we,ce],[we,ue],[we,ge],[we,be],[we,"-"],[we,ve],[we,ke],[we,we],[we,Se],["#",ce],["#",ue],["#",ge],["#",be],["#","-"],["#",ve],["#",ke],["#",we],["#",Se],["-",ce],["-",ue],["-",ge],["-",be],["-","-"],["-",ve],["-",ke],["-",we],["-",Se],[ve,ce],[ve,ue],[ve,ge],[ve,be],[ve,ve],[ve,ke],[ve,we],[ve,"%"],[ve,Se],["@",ce],["@",ue],["@",ge],["@",be],["@","-"],["@",Se],[".",ve],[".",ke],[".",we],["+",ve],["+",ke],["+",we],["/","*"]],Rt=Lt.concat([[ce,fe],[we,fe],[fe,fe],[de,ze],[de,pe],[de,Ce],[ke,ke],[ke,we],[ke,ue],[ke,"-"],[De,ce],[De,ue],[De,ke],[De,we],[De,fe],[De,"-"]]);function Et(e){const t=new Set(e.map(([e,t])=>Dt(e)<<16|Dt(t)));return function(e,n,i){const r=Dt(n,i),s=i.charCodeAt(0);return r|(45===s&&n!==ce&&n!==ue&&n!==Se||43===s?t.has((65534&e)<<16|s<<7):t.has((65534&e)<<16|r))}}const Bt=Et(Lt),jt=Et(Rt);function Nt(e,t){if("function"==typeof t){let n=null;return void e.children.forEach(e=>{null!==n&&t.call(this,n),this.node(e),n=e})}e.children.forEach(this.node,this)}const{hasOwnProperty:It}=Object.prototype,$t=function(){};function Qt(e){return"function"==typeof e?e:$t}function Ft(e,t){return function(n,i,r){n.type===t&&e.call(this,n,i,r)}}function Wt(e,t){const n=t.structure,i=[];for(const e in n){if(!1===It.call(n,e))continue;let t=n[e];const r={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(const e of t)null===e?r.nullable=!0:"string"==typeof e?r.type="node":Array.isArray(e)&&(r.type="list");r.type&&i.push(r)}return i.length?{context:t.walkContext,fields:i}:null}function _t(e,t){const n=e.fields.slice(),i=e.context,r="string"==typeof i;return t&&n.reverse(),function(e,s,o,a){let l;r&&(l=s[i],s[i]=e);for(const i of n){const n=e[i.name];if(!i.nullable||n)if("list"===i.type){if(t?n.reduceRight(a,!1):n.reduce(a,!1))return!0}else if(o(n))return!0}r&&(s[i]=l)}}function Vt({StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:r}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:i},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:i,DeclarationList:r}}}function qt(e){return e}function Ht(e,t,n,i){let r;switch(e.type){case"Group":r=function(e,t,n,i){const r=" "===e.combinator||i?e.combinator:" "+e.combinator+" ",s=e.terms.map(e=>Ht(e,t,n,i)).join(r);return e.explicit||n?(i||","===s[0]?"[":"[ ")+s+(i?"]":" ]"):s}(e,t,n,i)+(e.disallowEmpty?"!":"");break;case"Multiplier":return Ht(e.term,t,n,i)+t(function(e){const{min:t,max:n,comma:i}=e;return 0===t&&0===n?i?"#?":"*":0===t&&1===n?"?":1===t&&0===n?i?"#":"+":1===t&&1===n?"":(i?"#":"")+(t===n?"{"+t+"}":"{"+t+","+(0!==n?n:"")+"}")}(e),e);case"Boolean":r="<boolean-expr["+Ht(e.term,t,n,i)+"]>";break;case"Type":r="<"+e.name+(e.opts?t(function(e){if("Range"===e.type)return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}(e.opts),e.opts):"")+">";break;case"Property":r="<'"+e.name+"'>";break;case"Keyword":r=e.name;break;case"AtKeyword":r="@"+e.name;break;case"Function":r=e.name+"(";break;case"String":case"Token":r=e.value;break;case"Comma":r=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(r,e)}function Xt(e,t){let n=qt,i=!1,r=!1;return"function"==typeof t?n=t:t&&(i=Boolean(t.forceBraces),r=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),Ht(e,n,i,r)}const Ut={offset:0,line:1,column:1};function Yt(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Kt(n):n:null}function Kt({offset:e,line:t,column:n},i){const r={offset:e,line:t,column:n};if(i){const e=i.split(/\n|\r\n?|\f/);r.offset+=i.length,r.line+=e.length-1,r.column=1===e.length?r.column+i.length:e.pop().length+1}return r}const Gt=function(e,t){const n=ct("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},Zt=function(e,t,n,i){const r=ct("SyntaxMatchError",e),{css:s,mismatchOffset:o,mismatchLength:a,start:l,end:h}=function(e,t){const n=e.tokens,i=e.longestMatch,r=i<n.length&&n[i].node||null,s=r!==t?r:null;let o,a,l=0,h=0,c=0,u="";for(let e=0;e<n.length;e++){const t=n[e].value;e===i&&(h=t.length,l=u.length),null!==s&&n[e].node===s&&(e<=i?c++:c=0),u+=t}return i===n.length||c>1?(o=Yt(s||t,"end")||Kt(Ut,u),a=Kt(o)):(o=Yt(s,"start")||Kt(Yt(t,"start")||Ut,u.slice(0,l)),a=Yt(s,"end")||Kt(o,u.substr(l,h))),{css:u,mismatchOffset:l,mismatchLength:h,start:o,end:a}}(i,n);return r.rawMessage=e,r.syntax=t?Xt(t):"<generic>",r.css=s,r.mismatchOffset=o,r.mismatchLength=a,r.message=e+"\n syntax: "+r.syntax+"\n value: "+(s||"<empty string>")+"\n --------"+new Array(r.mismatchOffset+1).join("-")+"^",Object.assign(r,l),r.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:l,end:h},r},Jt=new Map,en=new Map,tn=function(e){if(Jt.has(e))return Jt.get(e);const t=e.toLowerCase();let n=Jt.get(t);if(void 0===n){const e=sn(t,0),i=e?"":on(t,0);n=Object.freeze({basename:t.substr(i.length),name:t,prefix:i,vendor:i,custom:e})}return Jt.set(e,n),n},nn=function(e){if(en.has(e))return en.get(e);let t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");const i=sn(t,n.length);if(!i&&(t=t.toLowerCase(),en.has(t))){const n=en.get(t);return en.set(e,n),n}const r=i?"":on(t,n.length),s=t.substr(0,n.length+r.length),o=Object.freeze({basename:t.substr(s.length),name:t.substr(n.length),hack:n,vendor:r,prefix:s,custom:i});return en.set(e,o),o},rn=on;function sn(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}function on(e,t){if(t=t||0,e.length-t>=3&&45===e.charCodeAt(t)&&45!==e.charCodeAt(t+1)){const n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}const an=["initial","inherit","unset","revert","revert-layer"],ln=45,hn=!0;function cn(e,t){return null!==e&&e.type===ye&&e.value.charCodeAt(0)===t}function un(e,t,n){for(;null!==e&&(e.type===xe||e.type===Ee);)e=n(++t);return t}function dn(e,t,n,i){if(!e)return 0;const r=e.value.charCodeAt(t);if(43===r||r===ln){if(n)return 0;t++}for(;t<e.value.length;t++)if(!Be(e.value.charCodeAt(t)))return 0;return i+1}function fn(e,t,n){let i=!1,r=un(e,t,n);if(null===(e=n(r)))return t;if(e.type!==ve){if(!cn(e,43)&&!cn(e,ln))return t;if(i=!0,r=un(n(++r),r,n),null===(e=n(r))||e.type!==ve)return 0}if(!i){const t=e.value.charCodeAt(0);if(43!==t&&t!==ln)return 0}return dn(e,i?0:1,i,r)}function pn(e,t){return null!==e&&e.type===ye&&e.value.charCodeAt(0)===t}function mn(e,t,n){let i=0;for(let r=t;r<e.value.length;r++){const s=e.value.charCodeAt(r);if(45===s&&n&&0!==i)return mn(e,t+i+1,!1),6;if(!je(s))return 0;if(++i>6)return 0}return i}function gn(e,t,n){if(!e)return 0;for(;pn(n(t),63);){if(++e>6)return 0;t++}return t}const bn=["calc(","-moz-calc(","-webkit-calc("],yn=["min(","max(","clamp("],vn=["round(","mod(","rem("],kn=["hypot("],wn=["abs("],xn=[...bn,...yn,...vn,"sin(","cos(","tan(","pow(","sqrt(","log(","exp(","sign(",...kn,...wn],On=[...bn,...yn,...vn,...kn,...wn],Sn=[...bn,...yn,...vn,"asin(","acos(","atan(","atan2(",...kn,...wn],Cn=new Map([[ue,De],[ze,De],[Me,Pe],[Le,Re]]);function An(e,t){return t<e.length?e.charCodeAt(t):0}function Tn(e,t){return Je(e,0,e.length,t)}function Mn(e,t){for(let n=0;n<t.length;n++)if(Tn(e,t[n]))return!0;return!1}function Pn(e,t){return t===e.length-2&&92===An(e,t)&&Be(An(e,t+1))}function zn(e,t,n){if(e&&"Range"===e.type){const i=Number(void 0!==n&&n!==t.length?t.substr(0,n):t);if(isNaN(i))return!0;if(null!==e.min&&i<e.min&&"string"!=typeof e.min)return!0;if(null!==e.max&&i>e.max&&"string"!=typeof e.max)return!0}return!1}function Dn(e,t){return function(n,i,r){return null===n?0:n.type===ue&&Mn(n.value,t)?function(e,t){let n=0,i=[],r=0;e:do{switch(e.type){case Re:case De:case Pe:if(e.type!==n)break e;if(n=i.pop(),0===i.length){r++;break e}break;case ue:case ze:case Me:case Le:i.push(n),n=Cn.get(e.type)}r++}while(e=t(r));return r}(n,i):e(n,i,r)}}function Ln(e){return function(t){return null===t||t.type!==e?0:1}}function Rn(e){return null===e||e.type!==ce||45!==An(e.value,0)||45!==An(e.value,1)?0:1}function En(e){return e&&(e=new Set(e)),function(t,n,i){if(null===t||t.type!==we)return 0;const r=rt(t.value,0);if(null!==e){const n=t.value.indexOf("\\",r),i=-1!==n&&Pn(t.value,n)?t.value.substring(r,n):t.value.substr(r);if(!1===e.has(i.toLowerCase()))return 0}return zn(i,t.value,r)?0:1}}function Bn(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,i){return null!==t&&t.type===ve&&0===Number(t.value)?1:e(t,n,i)}}const jn={"ident-token":Ln(ce),"function-token":Ln(ue),"at-keyword-token":Ln(de),"hash-token":Ln(fe),"string-token":Ln(pe),"bad-string-token":Ln(me),"url-token":Ln(ge),"bad-url-token":Ln(be),"delim-token":Ln(ye),"number-token":Ln(ve),"percentage-token":Ln(ke),"dimension-token":Ln(we),"whitespace-token":Ln(xe),"CDO-token":Ln(Oe),"CDC-token":Ln(Se),"colon-token":Ln(Ce),"semicolon-token":Ln(Ae),"comma-token":Ln(Te),"[-token":Ln(Me),"]-token":Ln(Pe),"(-token":Ln(ze),")-token":Ln(De),"{-token":Ln(Le),"}-token":Ln(Re)},Nn={string:Ln(pe),ident:Ln(ce),percentage:Dn(function(e,t,n){return null===e||e.type!==ke||zn(n,e.value,e.value.length-1)?0:1},On),zero:Bn(),number:Dn(function(e,t,n){if(null===e)return 0;const i=rt(e.value,0);return i===e.value.length||Pn(e.value,i)?zn(n,e.value,i)?0:1:0},xn),integer:Dn(function(e,t,n){if(null===e||e.type!==ve)return 0;let i=43===An(e.value,0)||45===An(e.value,0)?1:0;for(;i<e.value.length;i++)if(!Be(An(e.value,i)))return 0;return zn(n,e.value,i)?0:1},xn),"custom-ident":function(e){if(null===e||e.type!==ce)return 0;const t=e.value.toLowerCase();return Mn(t,an)||Tn(t,"default")?0:1},"dashed-ident":Rn,"custom-property-name":function(e){return Rn(e)?"--"===e.value?0:1:0},"hex-color":function(e){if(null===e||e.type!==fe)return 0;const t=e.value.length;if(4!==t&&5!==t&&7!==t&&9!==t)return 0;for(let n=1;n<t;n++)if(!je(An(e.value,n)))return 0;return 1},"id-selector":function(e){return null===e||e.type!==fe?0:Ve(An(e.value,1),An(e.value,2),An(e.value,3))?1:0},"an-plus-b":function(e,t){let n=0;if(!e)return 0;if(e.type===ve)return dn(e,0,!1,n);if(e.type===ce&&e.value.charCodeAt(0)===ln){if(!Ze(e.value,1,110))return 0;switch(e.value.length){case 2:return fn(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==ln?0:(n=un(t(++n),n,t),dn(e=t(n),0,hn,n));default:return e.value.charCodeAt(2)!==ln?0:dn(e,3,hn,n)}}else if(e.type===ce||cn(e,43)&&t(n+1).type===ce){if(e.type!==ce&&(e=t(++n)),null===e||!Ze(e.value,0,110))return 0;switch(e.value.length){case 1:return fn(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==ln?0:(n=un(t(++n),n,t),dn(e=t(n),0,hn,n));default:return e.value.charCodeAt(1)!==ln?0:dn(e,2,hn,n)}}else if(e.type===we){let i=e.value.charCodeAt(0),r=43===i||i===ln?1:0,s=r;for(;s<e.value.length&&Be(e.value.charCodeAt(s));s++);return s===r?0:Ze(e.value,s,110)?s+1===e.value.length?fn(t(++n),n,t):e.value.charCodeAt(s+1)!==ln?0:s+2===e.value.length?(n=un(t(++n),n,t),dn(e=t(n),0,hn,n)):dn(e,s+2,hn,n):0}return 0},urange:function(e,t){let n=0;if(null===e||e.type!==ce||!Ze(e.value,0,117))return 0;if(null===(e=t(++n)))return 0;if(pn(e,43))return null===(e=t(++n))?0:e.type===ce?gn(mn(e,0,!0),++n,t):pn(e,63)?gn(1,++n,t):0;if(e.type===ve){const i=mn(e,1,!0);return 0===i?0:null===(e=t(++n))?n:e.type===we||e.type===ve?function(e){return 45===e.value.charCodeAt(0)}(e)&&mn(e,1,!1)?n+1:0:gn(i,n,t)}return e.type===we?gn(mn(e,1,!0),++n,t):0},"declaration-value":function(e,t){if(!e)return 0;let n=0,i=[],r=0;e:do{switch(e.type){case me:case be:break e;case Re:case De:case Pe:if(e.type!==n)break e;n=i.pop();break;case Ae:if(0===n)break e;break;case ye:if(0===n&&"!"===e.value)break e;break;case ue:case ze:case Me:case Le:i.push(n),n=Cn.get(e.type)}r++}while(e=t(r));return r},"any-value":function(e,t){if(!e)return 0;let n=0,i=[],r=0;e:do{switch(e.type){case me:case be:break e;case Re:case De:case Pe:if(e.type!==n)break e;n=i.pop();break;case ue:case ze:case Me:case Le:i.push(n),n=Cn.get(e.type)}r++}while(e=t(r));return r}},In=["length","angle","time","frequency","resolution","flex","decibel","semitones"];function $n(e){const{angle:t,decibel:n,frequency:i,flex:r,length:s,resolution:o,semitones:a,time:l}=e||{};return{dimension:Dn(En(null),Sn),angle:Dn(En(t),Sn),decibel:Dn(En(n),Sn),frequency:Dn(En(i),Sn),flex:Dn(En(r),Sn),length:Dn(Bn(En(s)),Sn),resolution:Dn(En(o),Sn),semitones:Dn(En(a),Sn),time:Dn(En(l),Sn)}}function Qn(e){const t=new Set;for(const n of In)if(Array.isArray(e[n]))for(const i of e[n])t.add(i.toLowerCase());return function(e){return null===e?0:e.type===ye&&"%"===e.value||e.type===ce&&t.has(e.value.toLowerCase())?1:0}}const Fn=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],Wn=["deg","grad","rad","turn"],Vn=["s","ms"],qn=["hz","khz"],Hn=["dpi","dpcm","dppx","x"],Xn=["fr"],Un=["db"],Yn=["st"];function Kn(e,t,n){return Object.assign(ct("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+"\n "+t+"\n--"+new Array((n||t.length)+1).join("-")+"^"})}const Gn=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0);class Zn{constructor(e){this.str=e,this.pos=0}charCodeAt(e){return e<this.str.length?this.str.charCodeAt(e):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(e=this.charCode()){return e<128&&1===Gn[e]}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(e){return this.charCodeAt(this.findWsEnd(e))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(e){for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(13!==t&&10!==t&&12!==t&&32!==t&&9!==t)break}return e}substringToPos(e){return this.str.substring(this.pos,this.pos=e)}eat(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(e){throw new Kn(e,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let e=this.pos;for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t>=128||0===Gn[t])break}return this.pos===e&&this.error("Expect a keyword"),this.substringToPos(e)}scanNumber(){let e=this.pos;for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t<48||t>57)break}return this.pos===e&&this.error("Expect a number"),this.substringToPos(e)}scanString(){const e=this.str.indexOf("'",this.pos+1);return-1===e&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(e+1)}}const Jn=93,ei=123,ti={" ":1,"&&":2,"||":3,"|":4};function ni(e){let t=null,n=null;return e.eat(ei),e.skipWs(),t=e.scanNumber(e),e.skipWs(),44===e.charCode()?(e.pos++,e.skipWs(),125!==e.charCode()&&(n=e.scanNumber(e),e.skipWs())):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function ii(e,t){const n=function(e){let t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,e.charCode()===ei?t=ni(e):63===e.charCode()?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case ei:t=ni(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,35===e.charCode()&&43===e.charCodeAt(e.pos-1)||63===e.charCode()&&125===e.charCodeAt(e.pos-1)?ii(e,n):n):t}function ri(e){const t=e.peek();return""===t?null:ii(e,{type:"Token",value:t})}function si(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}let i;for(t=Object.keys(t).sort((e,t)=>ti[e]-ti[t]);t.length>0;){i=t.shift();let r=0,s=0;for(;r<e.length;r++){const t=e[r];"Combinator"===t.type&&(t.value===i?(-1===s&&(s=r-1),e.splice(r,1),r--):(-1!==s&&r-s>1&&(e.splice(s,r-s,n(e.slice(s,r),i)),r=s+1),s=-1))}-1!==s&&t.length&&e.splice(s,r-s,n(e.slice(s,r),i))}return i}function oi(e,t=-1){const n=Object.create(null),i=[];let r=null,s=e.pos,o=!1;for(;e.charCode()!==t;){let t=o?oi(e,41):ai(e);if(!t)break;if("Spaces"!==t.type){if(o){if(0===t.terms.length){o=!1;continue}if(" "===t.combinator){for(;t.terms.length>1;)n[" "]=!0,i.push({type:"Combinator",value:" "},t.terms.shift());t=t.terms[0]}}"Combinator"===t.type?(null!==r&&"Combinator"!==r.type||(e.pos=s,e.error("Unexpected combinator")),n[t.value]=!0):null!==r&&"Combinator"!==r.type&&(n[" "]=!0,i.push({type:"Combinator",value:" "})),i.push(t),r=t,s=e.pos,o="Function"===t.type}}return null!==r&&"Combinator"===r.type&&(e.pos-=s,e.error("Unexpected combinator")),{type:"Group",terms:i,combinator:si(i,n)||" ",disallowEmpty:!1,explicit:!1}}function ai(e){let t=e.charCode();switch(t){case Jn:break;case 91:return ii(e,function(e){let t;return e.eat(91),t=oi(e,Jn),e.eat(Jn),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));case 60:return 39===e.nextCharCode()?function(e){let t;return e.eat(60),e.eat(39),t=e.scanWord(),e.eat(39),e.eat(62),ii(e,{type:"Property",name:t})}(e):function(e){let t,n=null;if(e.eat(60),t=e.scanWord(),"boolean-expr"===t){e.eat(91);const t=oi(e,Jn);return e.eat(Jn),e.eat(62),ii(e,{type:"Boolean",term:1===t.terms.length?t.terms[0]:t})}return 40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(e.skipWs(),n=function(e){let t=null,n=null,i=1;return e.eat(91),45===e.charCode()&&(e.peek(),i=-1),-1==i&&8734===e.charCode()?e.peek():(t=i*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(44),e.skipWs(),8734===e.charCode()?e.peek():(i=1,45===e.charCode()&&(e.peek(),i=-1),n=i*Number(e.scanNumber(e)),e.isNameCharCode()&&(n+=e.scanWord())),e.eat(Jn),{type:"Range",min:t,max:n}}(e)),e.eat(62),ii(e,{type:"Type",name:t,opts:n})}(e);case 124:return{type:"Combinator",value:e.substringToPos(e.pos+(124===e.nextCharCode()?2:1))};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return ii(e,{type:"String",value:e.scanString()});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:e.scanSpaces()};case 64:return t=e.nextCharCode(),e.isNameCharCode(t)?(e.pos++,{type:"AtKeyword",name:e.scanWord()}):ri(e);case 42:case 43:case 63:case 35:case 33:break;case ei:if(t=e.nextCharCode(),t<48||t>57)return ri(e);break;default:return e.isNameCharCode(t)?function(e){const t=e.scanWord();return 40===e.charCode()?(e.pos++,{type:"Function",name:t}):ii(e,{type:"Keyword",name:t})}(e):ri(e)}}function li(e){const t=new Zn(e),n=oi(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type?n.terms[0]:n}const hi=function(){};function ci(e){return"function"==typeof e?e:hi}function ui(e,t,n){let i=hi,r=hi;if("function"==typeof t?i=t:t&&(i=ci(t.enter),r=ci(t.leave)),i===hi&&r===hi)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(i.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":case"Boolean":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}r.call(n,t)}(e)}Object.defineProperty(fi,"name",{value:"default",configurable:!0});const di={decorator(e){const t=[];let n=null;return{...e,node(t){const i=n;n=t,e.node.call(this,t),n=i},emit(e,i,r){t.push({type:i,value:e,node:r?null:n})},result:()=>t}}};function fi(e,t){return"string"==typeof e?function(e){const t=[];return at(e,(n,i,r)=>t.push({type:n,value:e.slice(i,r),node:null})),t}(e):t.generate(e,di)}const pi={type:"Match"},mi={type:"Mismatch"},gi={type:"DisallowEmpty"};function bi(e,t,n){return t===pi&&n===mi||e===pi&&t===pi&&n===pi?e:("If"===e.type&&e.else===mi&&t===pi&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function yi(e){return e.length>2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function vi(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&yi(e.name)}function ki(e,t=" ",n=!1){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:n}}function wi(e,t,n=new Set){if(!n.has(e))switch(n.add(e),e.type){case"If":e.match=wi(e.match,t,n),e.then=wi(e.then,t,n),e.else=wi(e.else,t,n);break;case"Type":return t[e.name]||e}return e}function xi(e,t,n){switch(e){case" ":{let e=pi;for(let n=t.length-1;n>=0;n--)e=bi(t[n],e,mi);return e}case"|":{let e=mi,n=null;for(let i=t.length-1;i>=0;i--){let r=t[i];if(vi(r)&&(null===n&&i>0&&vi(t[i-1])&&(n=Object.create(null),e=bi({type:"Enum",map:n},pi,e)),null!==n)){const e=(yi(r.name)?r.name.slice(0,-1):r.name).toLowerCase();if(e in n==0){n[e]=r;continue}}n=null,e=bi(r,pi,e)}return e}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let n=mi;for(let i=t.length-1;i>=0;i--){const r=t[i];let s;s=t.length>1?xi(e,t.filter(function(e){return e!==r}),!1):pi,n=bi(r,s,n)}return n}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let i=n?pi:mi;for(let n=t.length-1;n>=0;n--){const r=t[n];let s;s=t.length>1?xi(e,t.filter(function(e){return e!==r}),!0):pi,i=bi(r,s,i)}return i}}}function Oi(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=xi(e.combinator,e.terms.map(Oi),!1);return e.disallowEmpty&&(t=bi(t,gi,mi)),t}case"Multiplier":return function(e){let t=pi,n=Oi(e.term);if(0===e.max)n=bi(n,gi,mi),t=bi(n,null,mi),t.then=bi(pi,pi,t),e.comma&&(t.then.else=bi({type:"Comma",syntax:e},t,mi));else for(let i=e.min||1;i<=e.max;i++)e.comma&&t!==pi&&(t=bi({type:"Comma",syntax:e},t,mi)),t=bi(n,bi(pi,pi,t),mi);if(0===e.min)t=bi(pi,pi,t);else for(let i=0;i<e.min-1;i++)e.comma&&t!==pi&&(t=bi({type:"Comma",syntax:e},t,mi)),t=bi(n,t,mi);return t}(e);case"Boolean":{const t=Oi(e.term),n=Oi(ki([ki([{type:"Keyword",name:"not"},{type:"Type",name:"!boolean-group"}]),ki([{type:"Type",name:"!boolean-group"},ki([{type:"Multiplier",comma:!1,min:0,max:0,term:ki([{type:"Keyword",name:"and"},{type:"Type",name:"!boolean-group"}])},{type:"Multiplier",comma:!1,min:0,max:0,term:ki([{type:"Keyword",name:"or"},{type:"Type",name:"!boolean-group"}])}],"|")])],"|")),i=Oi(ki([{type:"Type",name:"!term"},ki([{type:"Token",value:"("},{type:"Type",name:"!self"},{type:"Token",value:")"}]),{type:"Type",name:"general-enclosed"}],"|"));return wi(i,{"!term":t,"!self":n}),wi(n,{"!boolean-group":i}),n}case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return 3===e.value.length?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function Si(e,t){return"string"==typeof e&&(e=li(e)),{type:"MatchGraph",match:Oi(e),syntax:t||null,source:e}}const{hasOwnProperty:Ci}=Object.prototype,Ai="Match";let Ti=0;function Mi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const i=t.charCodeAt(n);let r=e.charCodeAt(n);if(r>=65&&r<=90&&(r|=32),r!==i)return!1}return!0}function Pi(e){return null===e||e.type===Te||e.type===ue||e.type===ze||e.type===Me||e.type===Le||function(e){return e.type===ye&&"?"!==e.value}(e)}function zi(e){return null===e||e.type===De||e.type===Pe||e.type===Re||e.type===ye&&"/"===e.value}function Di(e,t,n){const i=function(e,t,n){function i(){do{y++,b=y<e.length?e[y]:null}while(null!==b&&(b.type===xe||b.type===Ee))}function r(t){const n=y+t;return n<e.length?e[n]:null}function s(e,t){return{nextState:e,matchStack:k,syntaxStack:u,thenStack:d,tokenIndex:y,prev:t}}function o(e){d={nextState:e,matchStack:k,syntaxStack:u,prev:d}}function a(e){f=s(e,f)}function l(){k={type:1,syntax:t.syntax,token:b,prev:k},i(),p=null,y>v&&(v=y)}function h(){u={syntax:t.syntax,opts:t.syntax.opts||null!==u&&u.opts||null,prev:u},k={type:2,syntax:t.syntax,token:k.token,prev:k}}function c(){k=2===k.type?k.prev:{type:3,syntax:u.syntax,token:k.token,prev:k},u=u.prev}let u=null,d=null,f=null,p=null,m=0,g=null,b=null,y=-1,v=0,k={type:0,syntax:null,token:null,prev:null};for(i();null===g&&++m<15e3;)switch(t.type){case"Match":if(null===d){if(null!==b&&(y!==e.length-1||"\\0"!==b.value&&"\\9"!==b.value)){t=mi;break}g=Ai;break}if((t=d.nextState)===gi){if(d.matchStack===k){t=mi;break}t=pi}for(;d.syntaxStack!==u;)c();d=d.prev;break;case"Mismatch":if(null!==p&&!1!==p)(null===f||y>f.tokenIndex)&&(f=p,p=!1);else if(null===f){g="Mismatch";break}t=f.nextState,d=f.thenStack,u=f.syntaxStack,k=f.matchStack,y=f.tokenIndex,b=y<e.length?e[y]:null,f=f.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==mi&&a(t.else),t.then!==pi&&o(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const e=t.syntax.terms;if(t.index===e.length){if(0===t.mask||t.syntax.all){t=mi;break}t=pi;break}if(t.mask===(1<<e.length)-1){t=pi;break}for(;t.index<e.length;t.index++){const n=1<<t.index;if(0===(t.mask&n)){a(t),o({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|n}),t=e[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(null!==b){let e=b.value.toLowerCase();if(-1!==e.indexOf("\\")&&(e=e.replace(/\\[09].*$/,"")),Ci.call(t.map,e)){t=t.map[e];break}}t=mi;break;case"Generic":{const e=null!==u?u.opts:null,n=y+Math.floor(t.fn(b,r,e));if(!isNaN(n)&&n>y){for(;y<n;)l();t=pi}else t=mi;break}case"Type":case"Property":{const e="Type"===t.type?"types":"properties",i=Ci.call(n,e)?n[e][t.name]:null;if(!i||!i.match)throw new Error("Bad syntax reference: "+("Type"===t.type?"<"+t.name+">":"<'"+t.name+"'>"));if(!1!==p&&null!==b&&"Type"===t.type&&("custom-ident"===t.name&&b.type===ce||"length"===t.name&&"0"===b.value)){null===p&&(p=s(t,f)),t=mi;break}h(),t=i.matchRef||i.match;break}case"Keyword":{const e=t.name;if(null!==b){let n=b.value;if(-1!==n.indexOf("\\")&&(n=n.replace(/\\[09].*$/,"")),Mi(n,e)){l(),t=pi;break}}t=mi;break}case"AtKeyword":case"Function":if(null!==b&&Mi(b.value,t.name)){l(),t=pi;break}t=mi;break;case"Token":if(null!==b&&b.value===t.value){l(),t=pi;break}t=mi;break;case"Comma":null!==b&&b.type===Te?Pi(k.token)?t=mi:(l(),t=zi(b)?mi:pi):t=Pi(k.token)||zi(b)?pi:mi;break;case"String":let i="",m=y;for(;m<e.length&&i.length<t.value.length;m++)i+=e[m].value;if(Mi(i,t.value)){for(;y<m;)l();t=pi}else t=mi;break;default:throw new Error("Unknown node type: "+t.type)}switch(Ti+=m,g){case null:console.warn("[csstree-match] BREAK after 15000 iterations"),g="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",k=null;break;case Ai:for(;null!==u;)c();break;default:k=null}return{tokens:e,reason:g,iterations:m,match:k,longestMatch:v}}(e,t,n||{});if(null===i.match)return i;let r=i.match,s=i.match={syntax:t.syntax||null,match:[]};const o=[s];for(r=function(e){let t=null,n=null,i=e;for(;null!==i;)n=i.prev,i.prev=t,t=i,i=n;return t}(r).prev;null!==r;){switch(r.type){case 2:s.match.push(s={syntax:r.syntax,match:[]}),o.push(s);break;case 3:o.pop(),s=o[o.length-1];break;default:s.match.push({syntax:r.syntax||null,token:r.token.value,node:r.token.node})}r=r.prev}return i}function Li(e){function t(e){return null!==e&&("Type"===e.type||"Property"===e.type||"Keyword"===e.type)}let n=null;return null!==this.matched&&function i(r){if(Array.isArray(r.match)){for(let e=0;e<r.match.length;e++)if(i(r.match[e]))return t(r.syntax)&&n.unshift(r.syntax),!0}else if(r.node===e)return n=t(r.syntax)?[r.syntax]:[],!0;return!1}(this.matched),n}function Ri(e,t){return ji(this,e,e=>"Type"===e.type&&e.name===t)}function Ei(e,t){return ji(this,e,e=>"Property"===e.type&&e.name===t)}function Bi(e){return ji(this,e,e=>"Keyword"===e.type)}function ji(e,t,n){const i=Li.call(e,t);return null!==i&&i.some(n)}function Ni(e){return"node"in e?e.node:Ni(e.match[0])}function Ii(e){return"node"in e?e.node:Ii(e.match[e.match.length-1])}function $i(e,t,n,i,r){const s=[];return null!==n.matched&&function n(o){if(null!==o.syntax&&o.syntax.type===i&&o.syntax.name===r){const n=Ni(o),i=Ii(o);e.syntax.walk(t,function(e,t,r){if(e===n){const e=new ht;do{if(e.appendData(t.data),t.data===i)break;t=t.next}while(null!==t);s.push({parent:r,nodes:e})}})}Array.isArray(o.match)&&o.match.forEach(n)}(n.matched),s}const{hasOwnProperty:Qi}=Object.prototype;function Fi(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0}function Wi(e){return Boolean(e)&&Fi(e.offset)&&Fi(e.line)&&Fi(e.column)}function _i(e,t){return function(n,i){if(!n||n.constructor!==Object)return i(n,"Type of node should be an Object");for(let r in n){let s=!0;if(!1!==Qi.call(n,r)){if("type"===r)n.type!==e&&i(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===r){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)r+=".source";else if(Wi(n.loc.start)){if(Wi(n.loc.end))continue;r+=".end"}else r+=".start";s=!1}else if(t.hasOwnProperty(r)){s=!1;for(let e=0;!s&&e<t[r].length;e++){const i=t[r][e];switch(i){case String:s="string"==typeof n[r];break;case Boolean:s="boolean"==typeof n[r];break;case null:s=null===n[r];break;default:"string"==typeof i?s=n[r]&&n[r].type===i:Array.isArray(i)&&(s=n[r]instanceof ht)}}}else i(n,"Unknown field `"+r+"` for "+e+" node type");s||i(n,"Bad value for `"+e+"."+r+"`")}}for(const r in t)Qi.call(t,r)&&!1===Qi.call(n,r)&&i(n,"Field `"+e+"."+r+"` is missed")}}function Vi(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];if(r===String||r===Boolean)n.push(r.name.toLowerCase());else if(null===r)n.push("null");else if("string"==typeof r)n.push(r);else{if(!Array.isArray(r))throw new Error("Wrong value `"+r+"` in `"+t+"` structure definition");n.push("List<"+(Vi(r,t)||"any")+">")}}return n.join(" | ")}function qi(e,t){const n=t.structure,i={type:String,loc:!0},r={type:'"'+e+'"'};for(const t in n){if(!1===Qi.call(n,t))continue;const s=i[t]=Array.isArray(n[t])?n[t].slice():[n[t]];r[t]=Vi(s,e+"."+t)}return{docs:r,check:_i(e,i)}}function Hi(e,t,n){const i={};for(const r in e)e[r].syntax&&(i[r]=n?e[r].syntax:Xt(e[r].syntax,{compact:t}));return i}function Xi(e,t,n){const i={};for(const[r,s]of Object.entries(e))i[r]={prelude:s.prelude&&(n?s.prelude.syntax:Xt(s.prelude.syntax,{compact:t})),descriptors:s.descriptors&&Hi(s.descriptors,t,n)};return i}function Ui(e,t,n){return{matched:e,iterations:n,error:t,...o}}function Yi(e,t,n,i){const r=fi(n,e.syntax);let s;return function(e){for(let t=0;t<e.length;t++)if("var("===e[t].value.toLowerCase())return!0;return!1}(r)?Ui(null,new Error("Matching for a tree with var() is not supported")):(i&&(s=Di(r,e.cssWideKeywordsSyntax,e)),i&&s.match||(s=Di(r,t.match,e),s.match)?Ui(s.match,null,s.iterations):Ui(null,new Zt(s.reason,t.syntax,n,s),s.iterations))}class Ki{constructor(e,t,n){if(this.cssWideKeywords=an,this.syntax=t,this.generic=!1,this.units={...s},this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||function(e){const t={};if(e.node)for(const n in e.node)if(Qi.call(e.node,n)){const i=e.node[n];if(!i.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=qi(n,i)}return t}(e),e){if(e.cssWideKeywords&&(this.cssWideKeywords=e.cssWideKeywords),e.units)for(const t of Object.keys(s))Array.isArray(e.units[t])&&(this.units[t]=e.units[t]);if(e.types)for(const[t,n]of Object.entries(e.types))this.addType_(t,n);if(e.generic){this.generic=!0;for(const[e,t]of Object.entries((i=this.units,{...jn,...Nn,...$n(i),"attr-unit":Qn(i)})))this.addType_(e,t)}if(e.atrules)for(const[t,n]of Object.entries(e.atrules))this.addAtrule_(t,n);if(e.properties)for(const[t,n]of Object.entries(e.properties))this.addProperty_(t,n)}var i;this.cssWideKeywordsSyntax=Si(this.cssWideKeywords.join(" | "))}checkStructure(e){function t(e,t){i.push({node:e,message:t})}const n=this.structure,i=[];return this.syntax.walk(e,function(e){n.hasOwnProperty(e.type)?n[e.type].check(e,t):t(e,"Unknown node type `"+e.type+"`")}),!!i.length&&i}createDescriptor(e,t,n,i=null){const r={type:t,name:n},s={type:t,name:n,parent:i,serializable:"string"==typeof e||e&&"string"==typeof e.type,syntax:null,match:null,matchRef:null};return"function"==typeof e?s.match=Si(e,r):("string"==typeof e?Object.defineProperty(s,"syntax",{get:()=>(Object.defineProperty(s,"syntax",{value:li(e)}),s.syntax)}):s.syntax=e,Object.defineProperty(s,"match",{get:()=>(Object.defineProperty(s,"match",{value:Si(s.syntax,r)}),s.match)}),"Property"===t&&Object.defineProperty(s,"matchRef",{get(){const e=s.syntax,t=function(e){const t=e.terms[0];return!1===e.explicit&&1===e.terms.length&&"Multiplier"===t.type&&!0===t.comma}(e)?Si({...e,terms:[e.terms[0].term]},r):null;return Object.defineProperty(s,"matchRef",{value:t}),t}})),s}addAtrule_(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce((n,i)=>(n[i]=this.createDescriptor(t.descriptors[i],"AtruleDescriptor",i,e),n),Object.create(null)):null})}addProperty_(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))}addType_(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e))}checkAtruleName(e){if(!this.getAtrule(e))return new Gt("Unknown at-rule","@"+e)}checkAtrulePrelude(e,t){const n=this.checkAtruleName(e);if(n)return n;const i=this.getAtrule(e);return!i.prelude&&t?new SyntaxError("At-rule `@"+e+"` should not contain a prelude"):!i.prelude||t||Yi(this,i.prelude,"",!1).matched?void 0:new SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){const n=this.checkAtruleName(e);if(n)return n;const i=this.getAtrule(e),r=tn(t);return i.descriptors?i.descriptors[r.name]||i.descriptors[r.basename]?void 0:new Gt("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")}checkPropertyName(e){if(!this.getProperty(e))return new Gt("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return Ui(null,n);const i=this.getAtrule(e);return i.prelude?Yi(this,i.prelude,t||"",!1):Ui(null,null)}matchAtruleDescriptor(e,t,n){const i=this.checkAtruleDescriptorName(e,t);if(i)return Ui(null,i);const r=this.getAtrule(e),s=tn(t);return Yi(this,r.descriptors[s.name]||r.descriptors[s.basename],n,!1)}matchDeclaration(e){return"Declaration"!==e.type?Ui(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(nn(e).custom)return Ui(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?Ui(null,n):Yi(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?Yi(this,n,t,!1):Ui(null,new Gt("Unknown type",e))}match(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),Yi(this,e,t,!1)):Ui(null,new Gt("Bad syntax"))}findValueFragments(e,t,n,i){return $i(this,t,this.matchProperty(e,t),n,i)}findDeclarationValueFragments(e,t,n){return $i(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){const i=[];return this.syntax.walk(e,{visit:"Declaration",enter:e=>{i.push.apply(i,this.findDeclarationValueFragments(e,t,n))}}),i}getAtrule(e,t=!0){const n=tn(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){const n=nn(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(e,t){return t?`<${e}>`:`<'${e}'>`}function t(s,o,a,l){if(a.has(o))return a.get(o);a.set(o,!1),null!==l.syntax&&ui(l.syntax,function(l){if("Type"!==l.type&&"Property"!==l.type)return;const h="Type"===l.type?s.types:s.properties,c="Type"===l.type?i:r;hasOwnProperty.call(h,l.name)?t(s,l.name,c,h[l.name])&&(n.push(`${e(o,a===i)} used broken syntax definition ${e(l.name,"Type"===l.type)}`),a.set(o,!0)):(n.push(`${e(o,a===i)} used missed syntax definition ${e(l.name,"Type"===l.type)}`),a.set(o,!0))},this)}const n=[];let i=new Map,r=new Map;for(const e in this.types)t(this,e,i,this.types[e]);for(const e in this.properties)t(this,e,r,this.properties[e]);const s=[...i.keys()].filter(e=>i.get(e)),o=[...r.keys()].filter(e=>r.get(e));return s.length||o.length?{errors:n,types:s,properties:o}:null}dump(e,t){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:Hi(this.types,!t,e),properties:Hi(this.properties,!t,e),atrules:Xi(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}}function Gi(e,t){return"string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Zi(e,t){const n=Object.create(null);for(const i of Object.keys(e))t.includes(i)&&(n[i]=e[i]);return n}function Ji(e,t,n){const i={...e};for(const[e,r]of Object.entries(t))i[e]={...i[e],...n?Zi(r,n):r};return i}function er(e,t){const n={...e};for(const[i,r]of Object.entries(t))switch(i){case"generic":n[i]=Boolean(r);break;case"cssWideKeywords":n[i]=e[i]?[...e[i],...r]:r||[];break;case"units":n[i]={...e[i]};for(const[e,t]of Object.entries(r))n[i][e]=Array.isArray(t)?t:[];break;case"atrules":n[i]={...e[i]};for(const[e,t]of Object.entries(r)){const r=n[i][e]||{},s=n[i][e]={prelude:r.prelude||null,descriptors:{...r.descriptors}};if(t){s.prelude=t.prelude?Gi(s.prelude,t.prelude):s.prelude||null;for(const[e,n]of Object.entries(t.descriptors||{}))s.descriptors[e]=n?Gi(s.descriptors[e],n):null;Object.keys(s.descriptors).length||(s.descriptors=null)}}break;case"types":case"properties":n[i]={...e[i]};for(const[e,t]of Object.entries(r))n[i][e]=Gi(n[i][e],t);break;case"parseContext":n[i]={...e[i],...r};break;case"scope":case"features":n[i]=Ji(e[i],r);break;case"atrule":case"pseudo":n[i]=Ji(e[i],r,["parse"]);break;case"node":n[i]=Ji(e[i],r,["name","structure","parse","generate","walkContext"])}return n}function tr(e){const t=function(e){let t="",n="<unknown>",i=!1,r=St,s=!1;const o=new mt,a=Object.assign(new xt,function(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:Mt(e.atrule),pseudo:Mt(e.pseudo),node:Mt(e.node)};for(const[n,i]of Object.entries(e.parseContext))switch(typeof i){case"function":t.context[n]=i;break;case"string":t.context[n]=Tt(i)}return{config:t,...t,...t.node}}(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Ot,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:e=>123===e?1:0,consumeUntilLeftCurlyBracketOrSemicolon:e=>123===e||59===e?1:0,consumeUntilExclamationMarkOrSemicolon:e=>33===e||59===e?1:0,consumeUntilSemicolonIncluded:e=>59===e?2:0,createList:St,createSingleNodeList:St,getFirstListNode:St,getLastListNode:St,parseWithFallback(e,t){const n=this.tokenIndex;try{return e.call(this)}catch(e){if(s)throw e;this.skip(n-this.tokenIndex);const i=t.call(this);return s=!0,r(e,i),s=!1,i}},lookupNonWSType(e){let t;do{if(t=this.lookupType(e++),t!==xe&&t!==Ee)return t}while(0!==t);return 0},charCodeAt:e=>e>=0&&e<t.length?t.charCodeAt(e):0,substring:(e,n)=>t.substring(e,n),substrToCursor(e){return this.source.substring(e,this.tokenStart)},cmpChar:(e,n)=>Ze(t,e,n),cmpStr:(e,n,i)=>Je(t,e,n,i),consume(e){const t=this.tokenStart;return this.eat(e),this.substrToCursor(t)},consumeFunctionName(){const e=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(ue),e},consumeNumber(e){const n=t.substring(this.tokenStart,rt(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){const t=gt[e].slice(0,-6).replace(/-/g," ").replace(/^./,e=>e.toUpperCase());let n=`${/[[\](){}]/.test(t)?`"${t}"`:t} is expected`,i=this.tokenStart;switch(e){case ce:this.tokenType===ue||this.tokenType===ge?(i=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case fe:this.isDelim(35)&&(this.next(),i++,n="Name is expected");break;case ke:this.tokenType===ve&&(i=this.tokenEnd,n="Percent sign is expected")}this.error(n,i)}this.next()},eatIdent(e){this.tokenType===ce&&!1!==this.lookupValue(0,e)||this.error(`Identifier "${e}" is expected`),this.next()},eatDelim(e){this.isDelim(e)||this.error(`Delim "${String.fromCharCode(e)}" is expected`),this.next()},getLocation:(e,t)=>i?o.getLocationRange(e,t,n):null,getLocationFromList(e){if(i){const t=this.getFirstListNode(e),i=this.getLastListNode(e);return o.getLocationRange(null!==t?t.loc.start.offset-o.startOffset:this.tokenStart,null!==i?i.loc.end.offset-o.startOffset:this.tokenStart,n)}return null},error(e,n){const i=void 0!==n&&n<t.length?o.getLocation(n):this.eof?o.getLocation(function(e,t){for(;t>=0&&We(e.charCodeAt(t));t--);return t+1}(t,t.length-1)):o.getLocation(this.tokenStart);throw new dt(e||"Unexpected input",t,i.offset,i.line,i.column,o.startLine,o.startColumn)}});return Object.assign(function(e,l){t=e,l=l||{},a.setSource(t,at),o.setSource(t,l.offset,l.line,l.column),n=l.filename||"<unknown>",i=Boolean(l.positions),r="function"==typeof l.onParseError?l.onParseError:St,s=!1,a.parseAtrulePrelude=!("parseAtrulePrelude"in l)||Boolean(l.parseAtrulePrelude),a.parseRulePrelude=!("parseRulePrelude"in l)||Boolean(l.parseRulePrelude),a.parseValue=!("parseValue"in l)||Boolean(l.parseValue),a.parseCustomProperty="parseCustomProperty"in l&&Boolean(l.parseCustomProperty);const{context:h="default",list:c=!0,onComment:u,onToken:d}=l;if(h in a.context==0)throw new Error("Unknown context `"+h+"`");Object.assign(a,c?At:Ct),Array.isArray(d)?a.forEachToken((e,t,n)=>{d.push({type:e,start:t,end:n})}):"function"==typeof d&&a.forEachToken(d.bind({filename:n,source:t,tokenCount:a.tokenCount,getTokenType:e=>a.getTokenType(e),getTokenTypeName:e=>gt[a.getTokenType(e)],getTokenStart:e=>a.getTokenStart(e),getTokenEnd:e=>a.getTokenEnd(e),getTokenValue:e=>a.source.substring(a.getTokenStart(e),a.getTokenEnd(e)),substring:(e,t)=>a.source.substring(e,t),balance:a.balance.subarray(0,a.tokenCount+1),isBlockOpenerTokenType:a.isBlockOpenerTokenType,isBlockCloserTokenType:a.isBlockCloserTokenType,getBlockTokenPairIndex:e=>a.getBlockTokenPairIndex(e),getLocation:e=>o.getLocation(e,n),getRangeLocation:(e,t)=>o.getLocationRange(e,t,n)})),"function"==typeof u&&a.forEachToken((e,n,i)=>{if(e===Ee){const e=a.getLocation(n,i),r=Je(t,i-2,i,"*/")?t.slice(n+2,i-2):t.slice(n+2,i);u(r,e)}});const f=a.context[h].call(a,l);return a.eof||a.error(),f},{SyntaxError:dt,config:a.config})}(e),n=function(e){const t=function(e){const t={};for(const n in e.node)if(It.call(e.node,n)){const i=e.node[n];if(!i.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Wt(0,i)}return t}(e),n={},i={},r=Symbol("break-walk"),s=Symbol("skip-node");for(const e in t)It.call(t,e)&&null!==t[e]&&(n[e]=_t(t[e],!1),i[e]=_t(t[e],!0));const o=Vt(n),a=Vt(i),l=function(e,l){function h(e,t,n){const i=c.call(p,e,t,n);return i===r||i!==s&&(!(!d.hasOwnProperty(e.type)||!d[e.type](e,p,h,f))||u.call(p,e,t,n)===r)}let c=$t,u=$t,d=n,f=(e,t,n,i)=>e||h(t,n,i);const p={break:r,skip:s,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof l)c=l;else if(l&&(c=Qt(l.enter),u=Qt(l.leave),l.reverse&&(d=i),l.visit)){if(o.hasOwnProperty(l.visit))d=l.reverse?a[l.visit]:o[l.visit];else if(!t.hasOwnProperty(l.visit))throw new Error("Bad value `"+l.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");c=Ft(c,l.visit),u=Ft(u,l.visit)}if(c===$t&&u===$t)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");h(e)};return l.break=r,l.skip=s,l.find=function(e,t){let n=null;return l(e,function(e,i,s){if(t.call(this,e,i,s))return n=e,r}),n},l.findLast=function(e,t){let n=null;return l(e,{reverse:!0,enter(e,i,s){if(t.call(this,e,i,s))return n=e,r}}),n},l.findAll=function(e,t){const n=[];return l(e,function(e,i,r){t.call(this,e,i,r)&&n.push(e)}),n},l}(e),i=function(e){const t=new Map;for(let[n,i]of Object.entries(e.node))"function"==typeof(i.generate||i)&&t.set(n,i.generate||i);return function(e,n){let i="",s=0,o={node(e){if(!t.has(e.type))throw new Error("Unknown node type: "+e.type);t.get(e.type).call(a,e)},tokenBefore:jt,token(e,t,n){s=this.tokenBefore(s,e,t),!n&&1&s&&this.emit(" ",xe,!0),this.emit(t,e,!1),e===ye&&92===t.charCodeAt(0)&&this.emit("\n",xe,!0)},emit(e){i+=e},result:()=>i};n&&("function"==typeof n.decorator&&(o=n.decorator(o)),n.sourceMap&&(o=function(e){const t=new Pt.x,n={line:1,column:0},i={line:0,column:0},r={line:1,column:0},s={generated:r};let o=1,a=0,l=!1;const h=e.node;e.node=function(e){if(e.loc&&e.loc.start&&zt.has(e.type)){const h=e.loc.start.line,c=e.loc.start.column-1;i.line===h&&i.column===c||(i.line=h,i.column=c,n.line=o,n.column=a,l&&(l=!1,n.line===r.line&&n.column===r.column||t.addMapping(s)),l=!0,t.addMapping({source:e.loc.source,original:i,generated:n}))}h.call(this,e),l&&zt.has(e.type)&&(r.line=o,r.column=a)};const c=e.emit;e.emit=function(e,t,n){for(let t=0;t<e.length;t++)10===e.charCodeAt(t)?(o++,a=0):a++;c(e,t,n)};const u=e.result;return e.result=function(){return l&&t.addMapping(s),{css:u(),map:t}},e}(o)),n.mode in r&&(o.tokenBefore=r[n.mode]));const a={node:e=>o.node(e),children:Nt,token:(e,t)=>o.token(e,t),tokenize:e=>at(e,(t,n,i)=>{o.token(t,e.slice(n,i),0!==n)})};return o.node(e),o.result()}}(e),{fromPlainObject:s,toPlainObject:o}=function(e){return{fromPlainObject:t=>(e(t,{enter(e){e.children&&e.children instanceof ht==0&&(e.children=(new ht).fromArray(e.children))}}),t),toPlainObject:t=>(e(t,{leave(e){e.children&&e.children instanceof ht&&(e.children=e.children.toArray())}}),t)}}(n),a={lexer:null,createLexer:e=>new Ki(e,a,a.lexer.structure),tokenize:at,parse:t,generate:i,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:s,toPlainObject:o,fork(t){const n=er({},e);return tr("function"==typeof t?t(n):er(n,t))}};return a.lexer=new Ki({generic:e.generic,cssWideKeywords:e.cssWideKeywords,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},a),a}const nr=e=>tr(er({},e));(Object.getOwnPropertyDescriptor(nr,"name")||{}).writable||Object.defineProperty(nr,"name",{value:"default",configurable:!0});const ir=43,rr=45,sr=110,or=!0;function ar(e,t){let n=this.tokenStart+e;const i=this.charCodeAt(n);for(i!==ir&&i!==rr||(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)Be(this.charCodeAt(n))||this.error("Integer is expected",n)}function lr(e){return ar.call(this,0,e)}function hr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case sr:n="N is expected";break;case rr:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function cr(){let e=0,t=0,n=this.tokenType;for(;n===xe||n===Ee;)n=this.lookupType(++e);if(n!==ve){if(!this.isDelim(ir,e)&&!this.isDelim(rr,e))return null;t=this.isDelim(ir,e)?ir:rr;do{n=this.lookupType(++e)}while(n===xe||n===Ee);n!==ve&&(this.skip(e),lr.call(this,or))}return e>0&&this.skip(e),0===t&&(n=this.charCodeAt(this.tokenStart),n!==ir&&n!==rr&&this.error("Number sign is expected")),lr.call(this,0!==t),t===rr?"-"+this.consume(ve):this.consume(ve)}const ur="AnPlusB",dr={a:[String,null],b:[String,null]};function fr(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===ve)lr.call(this,!1),n=this.consume(ve);else if(this.tokenType===ce&&this.cmpChar(this.tokenStart,rr))switch(t="-1",hr.call(this,1,sr),this.tokenEnd-this.tokenStart){case 2:this.next(),n=cr.call(this);break;case 3:hr.call(this,2,rr),this.next(),this.skipSC(),lr.call(this,or),n="-"+this.consume(ve);break;default:hr.call(this,2,rr),ar.call(this,3,or),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===ce||this.isDelim(ir)&&this.lookupType(1)===ce){let i=0;switch(t="1",this.isDelim(ir)&&(i=1,this.next()),hr.call(this,0,sr),this.tokenEnd-this.tokenStart){case 1:this.next(),n=cr.call(this);break;case 2:hr.call(this,1,rr),this.next(),this.skipSC(),lr.call(this,or),n="-"+this.consume(ve);break;default:hr.call(this,1,rr),ar.call(this,2,or),this.next(),n=this.substrToCursor(e+i+1)}}else if(this.tokenType===we){const i=this.charCodeAt(this.tokenStart),r=i===ir||i===rr;let s=this.tokenStart+r;for(;s<this.tokenEnd&&Be(this.charCodeAt(s));s++);s===this.tokenStart+r&&this.error("Integer is expected",this.tokenStart+r),hr.call(this,s-this.tokenStart,sr),t=this.substring(e,s),s+1===this.tokenEnd?(this.next(),n=cr.call(this)):(hr.call(this,s-this.tokenStart+1,rr),s+2===this.tokenEnd?(this.next(),this.skipSC(),lr.call(this,or),n="-"+this.consume(ve)):(ar.call(this,s-this.tokenStart+2,or),this.next(),n=this.substrToCursor(s+1)))}else this.error();return null!==t&&t.charCodeAt(0)===ir&&(t=t.substr(1)),null!==n&&n.charCodeAt(0)===ir&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function pr(e){if(e.a){const t=("+1"===e.a||"1"===e.a?"n":"-1"===e.a&&"-n")||e.a+"n";if(e.b){const n="-"===e.b[0]||"+"===e.b[0]?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}function mr(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function gr(){for(let e,t=1;e=this.lookupType(t);t++){if(e===Re)return!0;if(e===Le||e===de)return!1}return!1}const br="Atrule",yr="atrule",vr={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function kr(e=!1){const t=this.tokenStart;let n,i,r=null,s=null;switch(this.eat(de),n=this.substrToCursor(t+1),i=n.toLowerCase(),this.skipSC(),!1===this.eof&&this.tokenType!==Le&&this.tokenType!==Ae&&(r=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),mr):mr.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case Ae:this.next();break;case Le:s=hasOwnProperty.call(this.atrule,i)&&"function"==typeof this.atrule[i].block?this.atrule[i].block.call(this,e):this.Block(gr.call(this))}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:r,block:s}}function wr(e){this.token(de,"@"+e.name),null!==e.prelude&&this.node(e.prelude),e.block?this.node(e.block):this.token(Ae,";")}const xr="AtrulePrelude",Or="atrulePrelude",Sr={children:[[]]};function Cr(e){let t=null;return null!==e&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),!0!==this.eof&&this.tokenType!==Le&&this.tokenType!==Ae&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Ar(e){this.children(e)}function Tr(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(42)?(t=!0,this.next()):this.isDelim(124)||this.eat(ce),this.isDelim(124)?61!==this.charCodeAt(this.tokenStart+1)?(this.next(),this.eat(ce)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Mr(){const e=this.tokenStart,t=this.charCodeAt(e);return 61!==t&&126!==t&&94!==t&&36!==t&&42!==t&&124!==t&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),61!==t&&(this.isDelim(61)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const Pr="AttributeSelector",zr={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function Dr(){const e=this.tokenStart;let t,n=null,i=null,r=null;return this.eat(Me),this.skipSC(),t=Tr.call(this),this.skipSC(),this.tokenType!==Pe&&(this.tokenType!==ce&&(n=Mr.call(this),this.skipSC(),i=this.tokenType===pe?this.String():this.Identifier(),this.skipSC()),this.tokenType===ce&&(r=this.consume(ce),this.skipSC())),this.eat(Pe),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:i,flags:r}}function Lr(e){this.token(ye,"["),this.node(e.name),null!==e.matcher&&(this.tokenize(e.matcher),this.node(e.value)),null!==e.flags&&this.token(ce,e.flags),this.token(ye,"]")}function Rr(){return this.Raw(null,!0)}function Er(){return this.parseWithFallback(this.Rule,Rr)}function Br(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function jr(){if(this.tokenType===Ae)return Br.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,Br);return this.tokenType===Ae&&this.next(),e}const Nr="Block",Ir="block",$r={children:[["Atrule","Rule","Declaration"]]};function Qr(e){const t=e?jr:Er,n=this.tokenStart;let i=this.createList();this.eat(Le);e:for(;!this.eof;)switch(this.tokenType){case Re:break e;case xe:case Ee:this.next();break;case de:i.push(this.parseWithFallback(this.Atrule.bind(this,e),Rr));break;default:e&&this.isDelim(38)?i.push(Er.call(this)):i.push(t.call(this))}return this.eof||this.eat(Re),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:i}}function Fr(e){this.token(Le,"{"),this.children(e,e=>{"Declaration"===e.type&&this.token(Ae,";")}),this.token(Re,"}")}const Wr="Brackets",_r={children:[[]]};function Vr(e,t){const n=this.tokenStart;let i=null;return this.eat(Me),i=e.call(this,t),this.eof||this.eat(Pe),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:i}}function qr(e){this.token(ye,"["),this.children(e),this.token(ye,"]")}const Hr="CDC",Xr=[];function Ur(){const e=this.tokenStart;return this.eat(Se),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Yr(){this.token(Se,"--\x3e")}const Kr="CDO",Gr=[];function Zr(){const e=this.tokenStart;return this.eat(Oe),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function Jr(){this.token(Oe,"\x3c!--")}const es="ClassSelector",ts={name:String};function ns(){return this.eatDelim(46),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(ce)}}function is(e){this.token(ye,"."),this.token(ce,e.name)}const rs="Combinator",ss={name:String};function os(){const e=this.tokenStart;let t;switch(this.tokenType){case xe:t=" ";break;case ye:switch(this.charCodeAt(this.tokenStart)){case 62:case 43:case 126:this.next();break;case 47:this.next(),this.eatIdent("deep"),this.eatDelim(47);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function as(e){this.tokenize(e.name)}const ls="Comment",hs={value:String};function cs(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(Ee),t-e+2>=2&&42===this.charCodeAt(t-2)&&47===this.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function us(e){this.token(Ee,"/*"+e.value+"*/")}const ds=new Set([Ce,De,he]),fs="Condition",ps={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function ms(e){return this.lookupTypeNonSC(1)===ce&&ds.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const gs={media:ms,container:ms,supports(){return this.SupportsDeclaration()}};function bs(e="media"){const t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case Ee:case xe:this.next();continue;case ce:t.push(this.Identifier());break;case ze:{let n=this.parseWithFallback(()=>gs[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(ze);const t=this.Condition(e);return this.eat(De),t},()=>this.GeneralEnclosed(e))),t.push(n);break}case ue:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function ys(e){e.children.forEach(e=>{"Condition"===e.type?(this.token(ze,"("),this.node(e),this.token(De,")")):this.node(e)})}function vs(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function ks(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function ws(){const e=this.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.eof&&this.tokenType!==Ae&&!1===this.isDelim(33)&&!1===this.isBalanceEdge(e)&&this.error(),t}const xs="Declaration",Os="declaration",Ss={important:[Boolean,String],property:String,value:["Value","Raw"]};function Cs(){const e=this.tokenStart,t=this.tokenIndex,n=Ts.call(this),i=sn(n),r=i?this.parseCustomProperty:this.parseValue,s=i?ks:vs;let o,a=!1;this.skipSC(),this.eat(Ce);const l=this.tokenIndex;if(i||this.skipSC(),o=r?this.parseWithFallback(ws,s):s.call(this,this.tokenIndex),i&&"Value"===o.type&&o.children.isEmpty)for(let e=l-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===xe){o.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(33)&&(a=Ms.call(this),this.skipSC()),!1===this.eof&&this.tokenType!==Ae&&!1===this.isBalanceEdge(t)&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:a,property:n,value:o}}function As(e){this.token(ce,e.property),this.token(Ce,":"),this.node(e.value),e.important&&(this.token(ye,"!"),this.token(ce,!0===e.important?"important":e.important))}function Ts(){const e=this.tokenStart;if(this.tokenType===ye)switch(this.charCodeAt(this.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.next();break;case 47:this.next(),this.isDelim(47)&&this.next()}return this.tokenType===fe?this.eat(fe):this.eat(ce),this.substrToCursor(e)}function Ms(){this.eat(ye),this.skipSC();const e=this.consume(ce);return"important"===e||e}function Ps(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const zs="DeclarationList",Ds={children:[["Declaration","Atrule","Rule"]]};function Ls(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case xe:case Ee:case Ae:this.next();break;case de:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),Ps));break;default:this.isDelim(38)?e.push(this.parseWithFallback(this.Rule,Ps)):e.push(this.parseWithFallback(this.Declaration,Ps))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function Rs(e){this.children(e,e=>{"Declaration"===e.type&&this.token(Ae,";")})}const Es="Dimension",Bs={value:String,unit:String};function js(){const e=this.tokenStart,t=this.consumeNumber(we);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function Ns(e){this.token(we,e.value+e.unit)}const Is="Feature",$s={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function Qs(e){const t=this.tokenStart;let n,i=null;if(this.eat(ze),this.skipSC(),n=this.consume(ce),this.skipSC(),this.tokenType!==De){switch(this.eat(Ce),this.skipSC(),this.tokenType){case ve:i=this.lookupNonWSType(1)===ye?this.Ratio():this.Number();break;case we:i=this.Dimension();break;case ce:i=this.Identifier();break;case ue:i=this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(De),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:i}}function Fs(e){this.token(ze,"("),this.token(ce,e.name),null!==e.value&&(this.token(Ce,":"),this.node(e.value)),this.token(De,")")}const Ws="FeatureFunction",_s={kind:String,feature:String,value:["Declaration","Selector"]};function Vs(e,t){const n=(this.features[e]||{})[t];return"function"!=typeof n&&this.error(`Unknown feature ${t}()`),n}function qs(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),i=Vs.call(this,e,n.toLowerCase());this.skipSC();const r=this.parseWithFallback(()=>{const e=this.tokenIndex,t=i.call(this);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.Raw(null,!1));return this.eof||this.eat(De),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:r}}function Hs(e){this.token(ue,e.feature+"("),this.node(e.value),this.token(De,")")}const Xs="FeatureRange",Us={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function Ys(){switch(this.skipSC(),this.tokenType){case ve:return this.isDelim(47,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case we:return this.Dimension();case ce:return this.Identifier();case ue:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function Ks(e){if(this.skipSC(),this.isDelim(60)||this.isDelim(62)){const e=this.source[this.tokenStart];return this.next(),this.isDelim(61)?(this.next(),e+"="):e}if(this.isDelim(61))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function Gs(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(ze);const n=Ys.call(this),i=Ks.call(this,"Identifier"===n.type),r=Ys.call(this);let s=null,o=null;return this.lookupNonWSType(0)!==De&&(s=Ks.call(this),o=Ys.call(this)),this.skipSC(),this.eat(De),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:i,middle:r,rightComparison:s,right:o}}function Zs(e){this.token(ze,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(De,")")}const Js="Function",eo="function",to={name:String,children:[[]]};function no(e,t){const n=this.tokenStart,i=this.consumeFunctionName(),r=i.toLowerCase();let s;return s=t.hasOwnProperty(r)?t[r].call(this,t):e.call(this,t),this.eof||this.eat(De),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:i,children:s}}function io(e){this.token(ue,e.name+"("),this.children(e),this.token(De,")")}const ro="GeneralEnclosed",so={kind:String,function:[String,null],children:[[]]};function oo(e){const t=this.tokenStart;let n=null;this.tokenType===ue?n=this.consumeFunctionName():this.eat(ze);const i=this.parseWithFallback(()=>{const e=this.tokenIndex,t=this.readSequence(this.scope.Value);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(De),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:i}}function ao(e){e.function?this.token(ue,e.function+"("):this.token(ze,"("),this.children(e),this.token(De,")")}const lo="XXX",ho="Hash",co={value:String};function uo(){const e=this.tokenStart;return this.eat(fe),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function fo(e){this.token(fe,"#"+e.value)}const po="Identifier",mo={name:String};function go(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(ce)}}function bo(e){this.token(ce,e.name)}const yo="IdSelector",vo={name:String};function ko(){const e=this.tokenStart;return this.eat(fe),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function wo(e){this.token(ye,"#"+e.name)}const xo="Layer",Oo={name:String};function So(){let e=this.tokenStart,t=this.consume(ce);for(;this.isDelim(46);)this.eat(ye),t+="."+this.consume(ce);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Co(e){this.tokenize(e.name)}const Ao="LayerList",To={children:[["Layer"]]};function Mo(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===Te);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function Po(e){this.children(e,()=>this.token(Te,","))}const zo="MediaQuery",Do={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function Lo(){const e=this.tokenStart;let t=null,n=null,i=null;if(this.skipSC(),this.tokenType===ce&&this.lookupTypeNonSC(1)!==ze){const e=this.consume(ce),r=e.toLowerCase();switch("not"===r||"only"===r?(this.skipSC(),t=r,n=this.consume(ce)):n=e,this.lookupTypeNonSC(0)){case ce:this.skipSC(),this.eatIdent("and"),i=this.Condition("media");break;case Le:case Ae:case Te:case he:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case ce:case ze:case ue:i=this.Condition("media");break;case Le:case Ae:case he:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:i}}function Ro(e){e.mediaType?(e.modifier&&this.token(ce,e.modifier),this.token(ce,e.mediaType),e.condition&&(this.token(ce,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const Eo="MediaQueryList",Bo={children:[["MediaQuery"]]};function jo(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===Te);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function No(e){this.children(e,()=>this.token(Te,","))}const Io="NestingSelector",$o={};function Qo(){const e=this.tokenStart;return this.eatDelim(38),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Fo(){this.token(ye,"&")}const Wo="Nth",_o={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function Vo(){this.skipSC();const e=this.tokenStart;let t,n=e,i=null;return t=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),n=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),i=this.SelectorList(),n=this.tokenStart),{type:"Nth",loc:this.getLocation(e,n),nth:t,selector:i}}function qo(e){this.node(e.nth),null!==e.selector&&(this.token(ce,"of"),this.node(e.selector))}const Ho="Number",Xo={value:String};function Uo(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(ve)}}function Yo(e){this.token(ve,e.value)}const Ko="Operator",Go={value:String};function Zo(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Jo(e){this.tokenize(e.value)}const ea="Parentheses",ta={children:[[]]};function na(e,t){const n=this.tokenStart;let i=null;return this.eat(ze),i=e.call(this,t),this.eof||this.eat(De),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:i}}function ia(e){this.token(ze,"("),this.children(e),this.token(De,")")}const ra="Percentage",sa={value:String};function oa(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(ke)}}function aa(e){this.token(ke,e.value+"%")}const la="PseudoClassSelector",ha="function",ca={name:String,children:[["Raw"],null]};function ua(){const e=this.tokenStart;let t,n,i=null;return this.eat(Ce),this.tokenType===ue?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==De?i=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),i=this.pseudo[n].call(this),this.skipSC()):(i=this.createList(),i.push(this.Raw(null,!1))),this.eat(De)):t=this.consume(ce),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:i}}function da(e){this.token(Ce,":"),null===e.children?this.token(ce,e.name):(this.token(ue,e.name+"("),this.children(e),this.token(De,")"))}const fa="PseudoElementSelector",pa="function",ma={name:String,children:[["Raw"],null]};function ga(){const e=this.tokenStart;let t,n,i=null;return this.eat(Ce),this.eat(Ce),this.tokenType===ue?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==De?i=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),i=this.pseudo[n].call(this),this.skipSC()):(i=this.createList(),i.push(this.Raw(null,!1))),this.eat(De)):t=this.consume(ce),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:i}}function ba(e){this.token(Ce,":"),this.token(Ce,":"),null===e.children?this.token(ce,e.name):(this.token(ue,e.name+"("),this.children(e),this.token(De,")"))}function ya(){switch(this.skipSC(),this.tokenType){case ve:return this.Number();case ue:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const va="Ratio",ka={left:["Number","Function"],right:["Number","Function",null]};function wa(){const e=this.tokenStart,t=ya.call(this);let n=null;return this.skipSC(),this.isDelim(47)&&(this.eatDelim(47),n=ya.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function xa(e){this.node(e.left),this.token(ye,"/"),e.right?this.node(e.right):this.node(ve,1)}function Oa(){return this.tokenIndex>0&&this.lookupType(-1)===xe?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Sa="Raw",Ca={value:String};function Aa(e,t){const n=this.getTokenStart(this.tokenIndex);let i;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),i=t&&this.tokenStart>n?Oa.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(n,i),value:this.substring(n,i)}}function Ta(e){this.tokenize(e.value)}function Ma(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Pa(){const e=this.SelectorList();return"Raw"!==e.type&&!1===this.eof&&this.tokenType!==Le&&this.error(),e}const za="Rule",Da="rule",La={prelude:["SelectorList","Raw"],block:["Block"]};function Ra(){const e=this.tokenIndex,t=this.tokenStart;let n,i;return n=this.parseRulePrelude?this.parseWithFallback(Pa,Ma):Ma.call(this,e),i=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:i}}function Ea(e){this.node(e.prelude),this.node(e.block)}const Ba="Scope",ja={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function Na(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===ze&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(De)),this.lookupNonWSType(0)===ce&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(ze),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(De)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function Ia(e){e.root&&(this.token(ze,"("),this.node(e.root),this.token(De,")")),e.limit&&(this.token(ce,"to"),this.token(ze,"("),this.node(e.limit),this.token(De,")"))}const $a="Selector",Qa={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function Fa(){const e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function Wa(e){this.children(e)}const _a="SelectorList",Va="selector",qa={children:[["Selector","Raw"]]};function Ha(){const e=this.createList();for(;!this.eof&&(e.push(this.Selector()),this.tokenType===Te);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function Xa(e){this.children(e,()=>this.token(Te,","))}function Ua(e){const t=e.length,n=e.charCodeAt(0),i=34===n||39===n?1:0,r=1===i&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let s="";for(let n=i;n<=r;n++){let i=e.charCodeAt(n);if(92===i){if(n===r){n!==t-1&&(s=e.substr(n+1));break}if(i=e.charCodeAt(++n),_e(92,i)){const t=n-1,i=nt(e,t);n=i-1,s+=ot(e.substring(t+1,i))}else 13===i&&10===e.charCodeAt(n+1)&&n++}else s+=e[n]}return s}function Ya(e,t){const n=t?"'":'"',i=t?39:34;let r="",s=!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);0!==n?n<=31||127===n?(r+="\\"+n.toString(16),s=!0):n===i||92===n?(r+="\\"+e.charAt(t),s=!1):(s&&(je(n)||We(n))&&(r+=" "),r+=e.charAt(t),s=!1):r+="�"}return n+r+n}const Ka="String",Ga={value:String};function Za(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Ua(this.consume(pe))}}function Ja(e){this.token(pe,Ya(e.value))}function el(){return this.Raw(null,!1)}const tl="StyleSheet",nl="stylesheet",il={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function rl(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case xe:this.next();continue;case Ee:if(33!==this.charCodeAt(this.tokenStart+2)){this.next();continue}n=this.Comment();break;case Oe:n=this.CDO();break;case Se:n=this.CDC();break;case de:n=this.parseWithFallback(this.Atrule,el);break;default:n=this.parseWithFallback(this.Rule,el)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function sl(e){this.children(e)}const ol="SupportsDeclaration",al={declaration:"Declaration"};function ll(){const e=this.tokenStart;this.eat(ze),this.skipSC();const t=this.Declaration();return this.eof||this.eat(De),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function hl(e){this.token(ze,"("),this.node(e.declaration),this.token(De,")")}function cl(){this.tokenType!==ce&&!1===this.isDelim(42)&&this.error("Identifier or asterisk is expected"),this.next()}const ul="TypeSelector",dl={name:String};function fl(){const e=this.tokenStart;return this.isDelim(124)?(this.next(),cl.call(this)):(cl.call(this),this.isDelim(124)&&(this.next(),cl.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function pl(e){this.tokenize(e.name)}function ml(e,t){let n=0;for(let i=this.tokenStart+e;i<this.tokenEnd;i++){const r=this.charCodeAt(i);if(45===r&&t&&0!==n)return ml.call(this,e+n+1,!1),-1;je(r)||this.error(t&&0!==n?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",i),++n>6&&this.error("Too many hex digits",i)}return this.next(),n}function gl(e){let t=0;for(;this.isDelim(63);)++t>e&&this.error("Too many question marks"),this.next()}function bl(e){this.charCodeAt(this.tokenStart)!==e&&this.error((43===e?"Plus sign":"Hyphen minus")+" is expected")}function yl(){let e=0;switch(this.tokenType){case ve:if(e=ml.call(this,1,!0),this.isDelim(63)){gl.call(this,6-e);break}if(this.tokenType===we||this.tokenType===ve){bl.call(this,45),ml.call(this,1,!1);break}break;case we:e=ml.call(this,1,!0),e>0&&gl.call(this,6-e);break;default:if(this.eatDelim(43),this.tokenType===ce){e=ml.call(this,0,!0),e>0&&gl.call(this,6-e);break}if(this.isDelim(63)){this.next(),gl.call(this,5);break}this.error("Hex digit or question mark is expected")}}const vl="UnicodeRange",kl={value:String};function wl(){const e=this.tokenStart;return this.eatIdent("u"),yl.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function xl(e){this.tokenize(e.value)}function Ol(e){const t=e.length;let n=4,i=41===e.charCodeAt(t-1)?t-2:t-1,r="";for(;n<i&&We(e.charCodeAt(n));)n++;for(;n<i&&We(e.charCodeAt(i));)i--;for(let s=n;s<=i;s++){let n=e.charCodeAt(s);if(92===n){if(s===i){s!==t-1&&(r=e.substr(s+1));break}if(n=e.charCodeAt(++s),_e(92,n)){const t=s-1,n=nt(e,t);s=n-1,r+=ot(e.substring(t+1,n))}else 13===n&&10===e.charCodeAt(s+1)&&s++}else r+=e[s]}return r}function Sl(e){let t="",n=!1;for(let i=0;i<e.length;i++){const r=e.charCodeAt(i);0!==r?r<=31||127===r?(t+="\\"+r.toString(16),n=!0):32===r||92===r||34===r||39===r||40===r||41===r?(t+="\\"+e.charAt(i),n=!1):(n&&je(r)&&(t+=" "),t+=e.charAt(i),n=!1):t+="�"}return"url("+t+")"}const Cl="Url",Al={value:String};function Tl(){const e=this.tokenStart;let t;switch(this.tokenType){case ge:t=Ol(this.consume(ge));break;case ue:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(ue),this.skipSC(),t=Ua(this.consume(pe)),this.skipSC(),this.eof||this.eat(De);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function Ml(e){this.token(ge,Sl(e.value))}const Pl="Value",zl={children:[[]]};function Dl(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function Ll(e){this.children(e)}const Rl=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),El="WhiteSpace",Bl={value:String};function jl(){return this.eat(xe),Rl}function Nl(e){this.token(xe,e.value)}const Il={generic:!0,cssWideKeywords:an,generic:!0,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","an+b":"odd|even|<integer>|<n-dimension>|'+'? † n|-n|<ndashdigit-dimension>|'+'? † <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? † n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? † n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? † n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>","anchor()":"anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )","anchor-name":"<dashed-ident>","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-size()":"anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>|<zero>","angular-color-stop":"<color> <color-stop-angle>?","angular-color-stop-list":"<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?","animateable-feature":"scroll-position|contents|<custom-ident>","animation-action":"none|play|play-once|play-forwards|play-backwards|pause|reset|replay","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <attr-type>? , <declaration-value>? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attr-type":"type( <syntax> )|raw-string|number|<attr-unit>","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|x|y","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>","basic-shape-rect":"<inset()>|<rect()>|<xywh()>","bg-clip":"<visual-box>|border-area|text","bg-image":"<image>|none","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage [0,∞]>|auto]{1,2}|cover|contain","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity","blur()":"blur( <length>? )","brightness()":"brightness( [<number>|<percentage>]? )","calc()":"calc( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-size()":"calc-size( <calc-size-basis> , <calc-sum> )","calc-size-basis":"<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( <radial-size>? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>","color()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"[<angle-percentage>|<zero>]{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button","compat-special":"textfield|menulist-button","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>*]!","compound-selector-list":"<compound-selector>#","conic-gradient()":"conic-gradient( [<conic-gradient-syntax>] )","conic-gradient-syntax":"[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","container-name":"<custom-ident>","container-query":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contextual-alt-values":"[contextual|no-contextual]","contrast()":"contrast( [<number>|<percentage>]? )","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","corner-shape-value":"round|scoop|bevel|notch|square|squircle|<superellipse()>","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier()":"cubic-bezier( [<number [0,1]> , <number>]#{2} )","cubic-bezier-easing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","cursor-predefined":"auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing","custom-color-space":"<dashed-ident>","custom-params":"<dashed-ident> [<number>|<percentage>|none]+",dasharray:"[[<length-percentage>|<number>]+]#","dashndashdigit-ident":"<ident-token>","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( [<color>?&&<length>{2,3}] )","dynamic-range-limit-mix()":"dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )","easing-function":"<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( <radial-size>? [at <position>]? )","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-value-list":"[<filter-function>|<url>]+","final-bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>","fit-content()":"fit-content( <length-percentage [0,∞]> )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css2":"normal|small-caps","font-weight-absolute":"normal|bold|<number [1,1000]>","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","form-control-identifier":"select","frequency-percentage":"<frequency>|<percentage>","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( [<number>|<percentage>]? )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsl( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","hsla()":"hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",hue:"<number>|<angle>","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hue-rotate()":"hue-rotate( [<angle>|<zero>]? )","hwb()":"hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( [<number>|<percentage>]? )","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-selector":"from|to|<percentage [0,100]>|<timeline-range-name> <percentage>","keyframes-name":"<custom-ident>|<string>","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","light-dark()":"light-dark( <color> , <color> )","line-name-list":"[<line-names>|<name-repeat>]+","line-names":"'[' <custom-ident>* ']'","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear()":"linear( [<number>&&<percentage>{0,2}]# )","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-easing-function":"linear|<linear()>","linear-gradient()":"linear-gradient( [<linear-gradient-syntax>] )","linear-gradient-syntax":"[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","n-dimension":"<dimension-token>","name-repeat":"repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )","named-color":"aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen","namespace-prefix":"<ident>","ndash-dimension":"<dimension-token>","ndashdigit-dimension":"<dimension-token>","ndashdigit-ident":"<ident-token>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]","offset-path":"<ray()>|<url>|<basic-shape>","oklab()":"oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","oklch()":"oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","opacity()":"opacity( [<number>|<percentage>]? )","opacity-value":"<number>|<percentage>","outline-line-style":"none|dotted|dashed|solid|double|groove|ridge|inset|outset","outline-radius":"<length>|<percentage>","overflow-position":"unsafe|safe","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-selector-list":"[<page-selector>#]?","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","paint()":"paint( <ident> , <declaration-value>? )","paint-box":"<visual-box>|fill-box|stroke-box","palette-identifier":"<dashed-ident>","palette-mix()":"palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )","path()":"path( <'fill-rule'>? , <string> )","perspective()":"perspective( [<length [0,∞]>|none] )","polar-color-space":"hsl|hwb|lch|oklch","polygon()":"polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","position-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","pow()":"pow( <calc-sum> , <calc-sum> )","predefined-rgb":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>|<legacy-pseudo-element-selector>","pseudo-page":": [left|right|first|blank]","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-extent":"closest-corner|closest-side|farthest-corner|farthest-side","radial-gradient()":"radial-gradient( [<radial-gradient-syntax>] )","radial-gradient-syntax":"[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>","radial-shape":"circle|ellipse","radial-size":"<radial-extent>|<length [0,∞]>|<length-percentage [0,∞]>{2}",ratio:"<number [0,∞]> [/ <number [0,∞]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","rectangular-color-space":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [<conic-gradient-syntax>] )","repeating-linear-gradient()":"repeating-linear-gradient( [<linear-gradient-syntax>] )","repeating-radial-gradient()":"repeating-radial-gradient( [<radial-gradient-syntax>] )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","rgba()":"rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( [<number>|<percentage>]? )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )","scope-end":"<forgiving-selector-list>","scope-start":"<forgiving-selector-list>","scroll()":"scroll( [<scroller>||<axis>]? )",scroller:"root|nearest|self","scroll-state-feature":"<media-query-list>","scroll-state-in-parens":"( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>","scroll-state-query":"not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>","selector-list":"<complex-selector-list>","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","sepia()":"sepia( [<number>|<percentage>]? )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<visual-box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sign()":"sign( <calc-sum> )","signed-integer":"<number-token>","signless-integer":"<number-token>","sin()":"sin( <calc-sum> )","single-animation":"<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>","single-animation-composition":"replace|add|accumulate","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<dashed-ident>|<scroll()>|<view()>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-easing-function":"step-start|step-end|<steps()>","steps()":"steps( <integer> , <step-position>? )","style-feature":"<declaration>","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","style-query":"<style-condition>|<style-feature>","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","superellipse()":"superellipse( [<number>|infinity|-infinity] )","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-decl":"( <declaration> )","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","symbols()":"symbols( <symbols-type>? [<string>|<image>]+ )","symbols-type":"cyclic|numeric|alphabetic|symbolic|fixed","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","text-edge":"[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","transition-behavior-value":"normal|allow-discrete","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","view()":"view( [<axis>||<'view-timeline-inset'>]? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [round <'border-radius'>]? )",xyz:"xyz|xyz-d50|xyz-d65","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-size":"intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>",autospace:"no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont","intrinsic-size-keyword":"min-content|max-content|fit-content",left:"<length>|auto","device-cmyk()":"<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>","legacy-device-cmyk-syntax":"device-cmyk( <number>#{4} )","modern-device-cmyk-syntax":"device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )","cmyk-component":"<number>|<percentage>|none","color-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>",right:"<length>|auto","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-selector-list>","complex-real-selector-list":"<complex-real-selector>#","simple-selector-list":"<simple-selector>#","relative-real-selector-list":"<relative-real-selector>#","complex-selector-unit":"[<compound-selector>? <pseudo-compound-selector>*]!","complex-real-selector":"<compound-selector> [<combinator>? <compound-selector>]*","relative-real-selector":"<combinator>? <complex-real-selector>","pseudo-compound-selector":"<pseudo-element-selector> <pseudo-class-selector>*","simple-selector":"<type-selector>|<subclass-selector>","legacy-pseudo-element-selector":"':' [before|after|first-line|first-letter]","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,∞]>","xyz-space":"xyz|xyz-d50|xyz-d65","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box","inset-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",syntax:"'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>","syntax-component":"<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'","syntax-single-component":"'<' <syntax-type-name> '>'|<ident>","syntax-type-name":"angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function","syntax-combinator":"'|'","syntax-multiplier":"'#'|'+'","syntax-string":"<string>"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-content-zooming":"none|zoom","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<coord-box>|no-clip|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<coord-box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","-webkit-user-select":"auto|none|text|all","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]|anchor-center","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",all:"initial|inherit|unset|revert|revert-layer","anchor-name":"none|<dashed-ident>#","anchor-scope":"none|all|<dashed-ident>#",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"[auto|<time [0s,∞]>]#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-range":"[<'animation-range-start'> <'animation-range-end'>?]#","animation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-timeline":"<single-animation-timeline>#","animation-timing-function":"<easing-function>#","animation-trigger":"[none|[<dashed-ident> <animation-action>+]+]#",appearance:"none|auto|<compat-auto>|<compat-special>","aspect-ratio":"auto||<ratio>","backdrop-filter":"none|<filter-value-list>","backface-visibility":"visible|hidden",background:"<bg-layer>#? , <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<visual-box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","baseline-shift":"baseline|sub|super|<svg-length>","baseline-source":"auto|first|last","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-block-start'>","border-block-color":"<'border-top-color'>{1,2}","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-block-style":"<'border-top-style'>{1,2}","border-block-width":"<'border-top-width'>{1,2}","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage [0,∞]>{1,2}","border-bottom-right-radius":"<length-percentage [0,∞]>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"separate|collapse","border-color":"<color>{1,4}","border-end-end-radius":"<'border-top-left-radius'>","border-end-start-radius":"<'border-top-left-radius'>","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length [0,∞]>|<number [0,∞]>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"[<number [0,∞]>|<percentage [0,∞]>]{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage [0,∞]>|<number [0,∞]>|auto]{1,4}","border-inline":"<'border-block-start'>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-inline-style":"<'border-top-style'>{1,2}","border-inline-width":"<'border-top-width'>{1,2}","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage [0,∞]>{1,4} [/ <length-percentage [0,∞]>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length>{1,2}","border-start-end-radius":"<'border-top-left-radius'>","border-start-start-radius":"<'border-top-left-radius'>","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage [0,∞]>{1,2}","border-top-right-radius":"<length-percentage [0,∞]>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"auto|<length-percentage>|<anchor()>|<anchor-size()>","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom",caret:"<'caret-color'>||<'caret-animation'>||<'caret-shape'>","caret-animation":"auto|manual","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none","clip-rule":"nonzero|evenodd",color:"<color>","color-interpolation-filters":"auto|sRGB|linearRGB","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance","column-gap":"normal|<length-percentage>","column-height":"auto|<length [0,∞]>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"auto|<length [0,∞]>","column-wrap":"auto|nowrap|wrap",columns:"[<'column-width'>||<'column-count'>] [/ <'column-height'>]?",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","contain-intrinsic-width":"auto? [none|<length>]",container:"<'container-name'> [/ <'container-type'>]?","container-name":"none|<custom-ident>+","container-type":"normal||[size|inline-size]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>|<attr()>]+]?","content-visibility":"visible|auto|hidden","corner-block-end-shape":"<corner-shape-value>{1,2}","corner-block-start-shape":"<corner-shape-value>{1,2}","corner-bottom-shape":"<corner-shape-value>{1,2}","corner-bottom-left-shape":"<corner-shape-value>","corner-bottom-right-shape":"<corner-shape-value>","corner-end-end-shape":"<corner-shape-value>","corner-end-start-shape":"<corner-shape-value>","corner-inline-end-shape":"<corner-shape-value>{1,2}","corner-inline-start-shape":"<corner-shape-value>{1,2}","corner-left-shape":"<corner-shape-value>{1,2}","corner-right-shape":"<corner-shape-value>{1,2}","corner-shape":"<corner-shape-value>{1,4}","corner-start-start-shape":"<corner-shape-value>","corner-start-end-shape":"<corner-shape-value>","corner-top-shape":"<corner-shape-value>{1,2}","corner-top-left-shape":"<corner-shape-value>","corner-top-right-shape":"<corner-shape-value>","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",cx:"<length>|<percentage>",cy:"<length>|<percentage>",d:"none|path( <string> )",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge","dynamic-range-limit":"standard|no-limit|constrained|<dynamic-range-limit-mix()>","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>|<percentage>","fill-rule":"nonzero|evenodd",filter:"none|<filter-value-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end","flood-color":"<color>","flood-opacity":"<'opacity'>",font:"[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-palette":"normal|light|dark|<palette-identifier>|<palette-mix()>","font-size":"<absolute-size>|<relative-size>|<length-percentage [0,∞]>|math","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps||position]","font-synthesis-position":"auto|none","font-synthesis-small-caps":"auto|none","font-synthesis-style":"auto|none","font-synthesis-weight":"auto|none","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-emoji":"normal|text|emoji|unicode","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>|bolder|lighter","font-width":"normal|<percentage [0,∞]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","forced-color-adjust":"auto|none|preserve-parent-color",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","hyphenate-character":"auto|<string>","hyphenate-limit-chars":"[auto|<integer>]{1,3}",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|smooth|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>","interpolate-size":"numeric-only|allow-keywords",isolation:"auto|isolate",interactivity:"auto|inert","interest-delay":"<'interest-delay-start'>{1,2}","interest-delay-end":"normal|<time>","interest-delay-start":"normal|<time>","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]|anchor-center","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"auto|<length-percentage>|<anchor()>|<anchor-size()>","letter-spacing":"normal|<length-percentage>","lighting-color":"<color>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"<'margin-top'>{1,4}","margin-block":"<'margin-top'>{1,2}","margin-block-end":"<'margin-top'>","margin-block-start":"<'margin-top'>","margin-bottom":"<length-percentage>|auto|<anchor-size()>","margin-inline":"<'margin-top'>{1,2}","margin-inline-end":"<'margin-top'>","margin-inline-start":"<'margin-top'>","margin-left":"<length-percentage>|auto|<anchor-size()>","margin-right":"<length-percentage>|auto|<anchor-size()>","margin-top":"<length-percentage>|auto|<anchor-size()>","margin-trim":"none|in-flow|all",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<coord-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<coord-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-darker|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>","object-view-box":"none|<basic-shape-rect>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|<offset-path>||<coord-box>","offset-position":"normal|auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<opacity-value>",order:"<integer>",orphans:"<integer>",outline:"<'outline-width'>||<'outline-style'>||<'outline-color'>","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<outline-line-style>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,∞]>","overflow-inline":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-y":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>",overlay:"none|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"<'padding-top'>{1,4}","padding-block":"<'padding-top'>{1,2}","padding-block-end":"<'padding-top'>","padding-block-start":"<'padding-top'>","padding-bottom":"<length-percentage [0,∞]>","padding-inline":"<'padding-top'>{1,2}","padding-inline-end":"<'padding-top'>","padding-inline-start":"<'padding-top'>","padding-left":"<length-percentage [0,∞]>","padding-right":"<length-percentage [0,∞]>","padding-top":"<length-percentage [0,∞]>",page:"auto|<custom-ident>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky","position-anchor":"auto|none|<anchor-name>","position-area":"none|<position-area>","position-try":"<'position-try-order'>? <'position-try-fallbacks'>","position-try-fallbacks":"none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#","position-try-order":"normal|<try-size>","position-visibility":"always|[anchors-valid||anchors-visible||no-overflow]","print-color-adjust":"economy|exact",quotes:"none|auto|[<string> <string>]+",r:"<length>|<percentage>","reading-flow":"normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order","reading-order":"<integer>",resize:"none|both|horizontal|vertical|block|inline",right:"auto|<length-percentage>|<anchor()>|<anchor-size()>",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-overhang":"auto|none","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length>|<percentage>",ry:"<length>|<percentage>",scale:"none|[<number>|<percentage>]{1,3}","scroll-behavior":"auto|smooth","scroll-initial-target":"none|nearest","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-end":"<length>","scroll-margin-block-start":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-end":"<length>","scroll-margin-inline-start":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-marker-group":"none|before|after","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-target-group":"none|auto","scroll-timeline":"[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","shape-image-threshold":"<opacity-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","stop-color":"<'color'>","stop-opacity":"<'opacity'>",stroke:"<paint>","stroke-color":"<color>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<'opacity'>","stroke-width":"<svg-length>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-anchor":"start|middle|end","text-autospace":"normal|<autospace>|auto","text-box":"normal|<'text-box-trim'>||<'text-box-edge'>","text-box-edge":"auto|<text-edge>","text-box-trim":"none|trim-start|trim-end|trim-both","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-inset":"<length>{1,2}|auto","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"auto|[over|under]&&[right|left]?","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-spacing-trim":"space-all|normal|space-first|trim-start","text-transform":"none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]","text-wrap":"<'text-wrap-mode'>||<'text-wrap-style'>","text-wrap-mode":"wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#","timeline-trigger":"none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-range'> ['/' <'timeline-trigger-exit-range'>]?]#","timeline-trigger-name":"none|<dashed-ident>#","timeline-trigger-exit-range":"[<'timeline-trigger-exit-range-start'> <'timeline-trigger-exit-range-end'>?]#","timeline-trigger-exit-range-end":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-exit-range-start":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-range":"[<'timeline-trigger-range-start'> <'timeline-trigger-range-end'>?]#","timeline-trigger-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-source":"<single-animation-timeline>#",top:"auto|<length-percentage>|<anchor()>|<anchor-size()>","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-behavior":"<transition-behavior-value>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","trigger-scope":"none|all|<dashed-ident>#","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|all","vector-effect":"none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>","view-timeline":"[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"[none|<dashed-ident>]#","view-transition-class":"none|<custom-ident>+","view-transition-name":"none|<custom-ident>|match-element",visibility:"visible|hidden|collapse","white-space":"normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>","white-space-collapse":"collapse|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word|auto-phrase","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",x:"<length>|<percentage>",y:"<length>|<percentage>","z-index":"auto|<integer>",zoom:"normal|reset|<number [0,∞]>||<percentage [0,∞]>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<visual-box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto",behavior:"<url>+",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong","position-try-options":"<'position-try-fallbacks'>",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong",speak:"auto|never|always","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]","white-space-trim":"none|discard-before||discard-after||discard-inner"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer [0,∞]>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer [0,∞]>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"auto|block|swap|fallback|optional","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>{1,2}","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,∞]>","font-family":"<family-name>#","override-colors":"[<integer [0,∞]> <color>]#"}},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]","page-orientation":"upright|rotate-left|rotate-right",size:"<length [0,∞]>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},"position-try":{prelude:"<dashed-ident>",descriptors:{top:"<'top'>",left:"<'left'>",bottom:"<'bottom'>",right:"<'right'>","inset-block-start":"<'inset-block-start'>","inset-block-end":"<'inset-block-end'>","inset-inline-start":"<'inset-inline-start'>","inset-inline-end":"<'inset-inline-end'>","inset-block":"<'inset-block'>","inset-inline":"<'inset-inline'>",inset:"<'inset'>","margin-top":"<'margin-top'>","margin-left":"<'margin-left'>","margin-bottom":"<'margin-bottom'>","margin-right":"<'margin-right'>","margin-block-start":"<'margin-block-start'>","margin-block-end":"<'margin-block-end'>","margin-inline-start":"<'margin-inline-start'>","margin-inline-end":"<'margin-inline-end'>",margin:"<'margin'>","margin-block":"<'margin-block'>","margin-inline":"<'margin-inline'>",width:"<'width'>",height:"<'height'>","min-width":"<'min-width'>","min-height":"<'min-height'>","max-width":"<'max-width'>","max-height":"<'max-height'>","block-size":"<'block-size'>","inline-size":"<'inline-size'>","min-block-size":"<'min-block-size'>","min-inline-size":"<'min-inline-size'>","max-block-size":"<'max-block-size'>","max-inline-size":"<'max-inline-size'>","align-self":"<'align-self'>|anchor-center","justify-self":"<'justify-self'>|anchor-center"}},property:{prelude:"<custom-property-name>",descriptors:{inherits:"true|false","initial-value":"<declaration-value>?",syntax:"<string>"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},"view-transition":{prelude:null,descriptors:{navigation:"auto|none",types:"none|<custom-ident>+"}},"font-features-values":{prelude:"[<string>|<custom-ident>]+",descriptors:{"font-display":"auto|block|swap|fallback|optional"}}},node:re};function $l(e){switch(this.tokenType){case fe:return this.Hash();case Te:return this.Operator();case ze:return this.Parentheses(this.readSequence,e.recognizer);case Me:return this.Brackets(this.readSequence,e.recognizer);case pe:return this.String();case we:return this.Dimension();case ke:return this.Percentage();case ve:return this.Number();case ue:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case ge:return this.Url();case ce:return this.cmpChar(this.tokenStart,117)&&this.cmpChar(this.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case ye:{const e=this.charCodeAt(this.tokenStart);if(47===e||42===e||43===e||45===e)return this.Operator();35===e&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const Ql={getNode:$l},Fl={onWhiteSpace:function(e,t){null!==t.last&&"Combinator"!==t.last.type&&null!==e&&"Combinator"!==e.type&&t.push({type:"Combinator",loc:null,name:" "})},getNode:function(){switch(this.tokenType){case Me:return this.AttributeSelector();case fe:return this.IdSelector();case Ce:return this.lookupType(1)===Ce?this.PseudoElementSelector():this.PseudoClassSelector();case ce:return this.TypeSelector();case ve:case ke:return this.Percentage();case we:46===this.charCodeAt(this.tokenStart)&&this.error("Identifier is expected",this.tokenStart+1);break;case ye:switch(this.charCodeAt(this.tokenStart)){case 43:case 62:case 126:case 47:return this.Combinator();case 46:return this.ClassSelector();case 42:case 124:return this.TypeSelector();case 35:return this.IdSelector();case 38:return this.NestingSelector()}}}};function Wl(){return this.createSingleNodeList(this.Raw(null,!1))}function _l(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===Te){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if("Value"===n.type&&n.children.isEmpty)for(let e=t-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===xe){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}e.push(n)}return e}function Vl(e){return null!==e&&"Operator"===e.type&&("-"===e.value[e.value.length-1]||"+"===e.value[e.value.length-1])}Object.defineProperty(Wl,"name",{value:"default",configurable:!0}),Object.defineProperty(_l,"name",{value:"default",configurable:!0});const ql={getNode:$l,onWhiteSpace(e,t){Vl(e)&&(e.value=" "+e.value),Vl(t.last)&&(t.last.value+=" ")},expression:Wl,var:_l},Hl=new Set(["none","and","not","or"]),Xl={parse:{prelude(){const e=this.createList();if(this.tokenType===ce){const t=this.substring(this.tokenStart,this.tokenEnd);Hl.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},Ul={parse:{prelude:null,block(){return this.Block(!0)}}};function Yl(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==De&&this.error()}},t||(()=>this.Raw(null,!0)))}const Kl={layer(){this.skipSC();const e=this.createList(),t=Yl.call(this,this.Layer);return"Raw"===t.type&&""===t.value||e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=Yl.call(this,this.Declaration,()=>Yl.call(this,()=>this.Condition("supports")));return"Raw"===t.type&&""===t.value||e.push(t),e}},Gl={container:Xl,"font-face":Ul,import:{parse:{prelude(){const e=this.createList();switch(this.tokenType){case pe:e.push(this.String());break;case ge:case ue:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===ce&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===ue&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,Kl)),this.skipSC(),this.tokenType===ue&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Kl)),this.lookupNonWSType(0)!==ce&&this.lookupNonWSType(0)!==ze||e.push(this.MediaQueryList()),e},block:null}},layer:{parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},media:{parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},nest:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},page:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},scope:{parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},"starting-style":{parse:{prelude:null,block(e=!1){return this.Block(e)}}},supports:{parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}},Zl={parse(){return this.createSingleNodeList(this.SelectorList())}},Jl={parse(){return this.createSingleNodeList(this.Selector())}},eh={parse(){return this.createSingleNodeList(this.Identifier())}},th={parse:function(){const e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case ce:e.push(this.Identifier());break;case pe:e.push(this.String());break;case Te:e.push(this.Operator());break;case De:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}},nh={parse(){return this.createSingleNodeList(this.Nth())}},ih={dir:eh,has:Zl,lang:th,matches:Zl,is:Zl,"-moz-any":Zl,"-webkit-any":Zl,where:Zl,not:Zl,"nth-child":nh,"nth-last-child":nh,"nth-last-of-type":nh,"nth-of-type":nh,slotted:Jl,host:Jl,"host-context":Jl},rh=nr({...Il,parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:se,atrule:Gl,pseudo:ih,node:oe,node:re}),sh="3.2.1";function oh(e){const t={};for(const n of Object.keys(e)){let i=e[n];i&&(Array.isArray(i)||i instanceof ht?i=i.map(oh):i.constructor===Object&&(i=oh(i))),t[n]=i}return t}function ah(e){const t=e.length-1;let n="";for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);if(92===r){if(i===t)break;if(r=e.charCodeAt(++i),_e(92,r)){const t=i-1,r=nt(e,t);i=r-1,n+=ot(e.substring(t+1,r))}else 13===r&&10===e.charCodeAt(i+1)&&i++}else n+=e[i]}return n}function lh(e){let t="";if(1===e.length&&45===e.charCodeAt(0))return"\\-";for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);0!==i?i<=31||127===i||i>=48&&i<=57&&(0===n||1===n&&45===e.charCodeAt(0))?t+="\\"+i.toString(16)+" ":$e(i)?t+=e.charAt(n):t+="\\"+e.charAt(n):t+="�"}return t}const{tokenize:hh,parse:ch,generate:uh,lexer:dh,createLexer:fh,walk:ph,find:mh,findLast:gh,findAll:bh,toPlainObject:yh,fromPlainObject:vh,fork:kh}=rh},7417(e,t,n){"use strict";n.d(t,{G:()=>o});const i="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(e,t){this.rules=[];let{finish:n}=t||{};function i(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,s,o){let a=[],l=/^@(\w+)\b/.exec(e[0]),h=l&&"keyframes"==l[1];if(l&&null==t)return s.push(e[0]+";");for(let n in t){let o=t[n];if(/&/.test(n))r(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,s);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(i(n),o,a,h)}else null!=o&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+o+";")}(a.length||h)&&s.push((!n||l||o?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let t in e)r(i(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=s[i]||1;return s[i]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[r],s=n&&n.nonce;i?s&&i.setNonce(s):i=new l(e,s),i.mount(Array.isArray(t)?t:[t],e)}}let a=new Map;class l{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=a.get(n);if(t)return e[r]=t;this.sheet=new i.CSSStyleSheet,a.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[r]=this}mount(e,t){let n=this.sheet,i=0,r=0;for(let t=0;t<e.length;t++){let s=e[t],o=this.modules.indexOf(s);if(o<r&&o>-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,s),n)for(let e=0;e<s.rules.length;e++)n.insertRule(s.rules[e],i++)}else{for(;r<o;)i+=this.modules[r++].rules.length;i+=s.rules.length,r++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}}}]);
[-] konva-vendor.js
[edit]
[-] react-icons-tfi.js
[edit]
[-] .htaccess
[edit]
[-] react-icons-fa6.js
[edit]
[-] react-icons-md.js
[edit]
[-] react-icons-io5.js
[edit]
[-] settings-vendor.js
[edit]
[+]
..