From 6be1c75d8f147fd0d987de0e138234f23613baea Mon Sep 17 00:00:00 2001
From: "renovate[bot]" "+e+"o){if(t.charCodeAt(1+a)===Ri)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>o&&(e.charCodeAt(1+a)===Ri?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==Ri||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(Fi(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ri;let i=-1,n=!0;for(let s=e.length-1;s>=1;--s)if(e.charCodeAt(s)===Ri){if(!n){i=s;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&Fi(t,"ext"),Fi(e,"path");let i,n=0,s=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===Ri){if(!o){n=i+1;break}}else-1===a&&(o=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(s=i):(r=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===Ri){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(n,s)},extname(e){Fi(e,"path");let t=-1,i=0,n=-1,s=!0,o=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(a!==Ri)-1===n&&(s=!1,n=r+1),a===Ti?-1===t?t=r:1!==o&&(o=1):-1!==t&&(o=-1);else if(!s){i=r+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===i+1?"":e.slice(t,n)},format:Ui.bind(null,"/"),parse(e){Fi(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===Ri;let n;i?(t.root="/",n=1):n=0;let s=-1,o=0,r=-1,a=!0,l=e.length-1,h=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==Ri)-1===r&&(a=!1,r=l+1),t===Ti?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!a){o=l+1;break}}if(-1!==r){const n=0===o&&i?1:o;-1===s||0===h||1===h&&s===r-1&&s===o+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,s),t.base=e.slice(n,r),t.ext=e.slice(s,r))}return o>0?t.dir=e.slice(0,o-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};qi.win32=Ki.win32=Ki,qi.posix=Ki.posix=qi;const $i=Bi?Ki.normalize:qi.normalize,Gi=Bi?Ki.resolve:qi.resolve,Zi=Bi?Ki.relative:qi.relative,Yi=Bi?Ki.dirname:qi.dirname,Xi=Bi?Ki.basename:qi.basename,Qi=Bi?Ki.extname:qi.extname,Ji=Bi?Ki.sep:qi.sep,en=/^\w[\w\d+.-]*$/,tn=/^\//,nn=/^\/\//;const sn="",on="/",rn=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class an{static isUri(e){return e instanceof an||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}constructor(e,t,i,n,s,o=!1){"object"==typeof e?(this.scheme=e.scheme||sn,this.authority=e.authority||sn,this.path=e.path||sn,this.query=e.query||sn,this.fragment=e.fragment||sn):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||sn,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==on&&(t=on+t):t=on}return t}(this.scheme,i||sn),this.query=n||sn,this.fragment=s||sn,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!en.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!tn.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(nn.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,o))}get fsPath(){return gn(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:s,fragment:o}=e;return void 0===t?t=this.scheme:null===t&&(t=sn),void 0===i?i=this.authority:null===i&&(i=sn),void 0===n?n=this.path:null===n&&(n=sn),void 0===s?s=this.query:null===s&&(s=sn),void 0===o?o=this.fragment:null===o&&(o=sn),t===this.scheme&&i===this.authority&&n===this.path&&s===this.query&&o===this.fragment?this:new hn(t,i,n,s,o)}static parse(e,t=!1){const i=rn.exec(e);return i?new hn(i[2]||sn,_n(i[4]||sn),_n(i[5]||sn),_n(i[7]||sn),_n(i[9]||sn),t):new hn(sn,sn,sn,sn,sn)}static file(e){let t=sn;if(Oe&&(e=e.replace(/\\/g,on)),e[0]===on&&e[1]===on){const i=e.indexOf(on,2);-1===i?(t=e.substring(2),e=on):(t=e.substring(2,i),e=e.substring(i)||on)}return new hn("file",t,e,sn,sn)}static from(e,t){return new hn(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return i=Oe&&"file"===e.scheme?an.file(Ki.join(gn(e,!0),...t)).path:qi.join(e.path,...t),e.with({path:i})}toString(e=!1){return pn(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof an)return e;{const n=new hn(e);return n._formatted=null!==(t=e.external)&&void 0!==t?t:null,n._fsPath=e._sep===ln&&null!==(i=e.fsPath)&&void 0!==i?i:null,n}}return e}}const ln=Oe?1:void 0;class hn extends an{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=gn(this,!1)),this._fsPath}toString(e=!1){return e?pn(this,!0):(this._formatted||(this._formatted=pn(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ln),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const dn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function cn(e,t,i){let n,s=-1;for(let o=0;o0?[{start:0,end:t.length}]:[]:null}function Zo(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function Yo(e,t){return Xo(e.toLowerCase(),t.toLowerCase(),0,0)}function Xo(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let s=null;return(s=Xo(e,t,i+1,n+1))?or({start:n,end:n+1},s):null}return Xo(e,t,i,n+1)}function Qo(e){return 97<=e&&e<=122}function Jo(e){return 65<=e&&e<=90}function er(e){return 48<=e&&e<=57}function tr(e){return 32===e||9===e||10===e||13===e}const ir=new Set;function nr(e){return tr(e)||ir.has(e)}function sr(e){return Qo(e)||Jo(e)||er(e)}function or(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function rr(e,t){for(let i=t;i0))return e;n=e-1}}return-(i+1)}(e.length,(n=>i(e[n],t)))}function Ad(e,t,i){if((e|=0)>=t.length)throw new TypeError("invalid index");const n=t[Math.floor(t.length*Math.random())],s=[],o=[],r=[];for(const a of t){const e=i(a,n);e<0?s.push(a):e>0?o.push(a):r.push(a)}return e1e3)break}if(i>1500)break}const n=(s=e,o=t,r=this.lineIdx,a=this.lineCharOffset,s!==r?vg(r-s,a):vg(0,a-o));var s,o,r,a;return new Zg(n,0,-1,Rg.getEmpty(),new jg(n))}}class Qg{constructor(e,t){this.text=e,this._offset=mg,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,s=[];let o,r=0,a=0,l=0,h=0;const d=[];for(let g=0;g<60;g++)d.push(new Zg(vg(0,g),0,-1,Rg.getEmpty(),new jg(vg(0,g))));const c=[];for(let g=0;g<60;g++)c.push(new Zg(vg(1,g),0,-1,Rg.getEmpty(),new jg(vg(1,g))));if(n)for(n.lastIndex=0;null!==(o=n.exec(e));){const e=o.index,i=o[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(h===r){const i=e-l;if(i=a)break;if(Fc(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){a=e;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),o=n.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(o)).brackets;if(r&&!Fc(n.getStandardTokenType(o))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,o),h=null;for(;;){const n=hu.findNextBracketInRange(r.forwardRegex,i,s,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=s.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof Cp)return null;h=i}}a=n.endColumn-1}if(h)return h}if(o>0&&n.getStartOffset(o)===e.column-1){const r=o-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Fc(n.getStandardTokenType(r))){const{searchStartOffset:o,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),h=hu.findPrevBracketInRange(a.reversedRegex,i,s,o,l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const e=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),i=this._matchFoundBracket(h,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof Cp?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const s=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return s?s instanceof Cp?s:[e,s]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,s=e.reversedRegex;let o=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return Cp.INSTANCE;const h=hu.findPrevBracketInRange(s,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?o++:e.isClose(d)&&o--,0===o)return h;l=h.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this.textModel.tokenization.getLineTokens(l),i=e.getCount(),s=this.textModel.getLineContent(l);let o=i-1,r=s.length,h=s.length;l===t.lineNumber&&(o=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,h=t.column-1);let d=!0;for(;o>=0;o--){const t=e.getLanguageId(o)===n&&!Fc(e.getStandardTokenType(o));if(t)d?r=e.getStartOffset(o):(r=e.getStartOffset(o),h=e.getEndOffset(o));else if(d&&r!==h){const e=a(l,s,r,h);if(e)return e}d=t}if(d&&r!==h){const e=a(l,s,r,h);if(e)return e}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,s=e.forwardRegex;let o=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return Cp.INSTANCE;const h=hu.findNextBracketInRange(s,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?o++:e.isClose(d)&&o--,0===o)return h;a=h.endColumn-1}return null},l=this.textModel.getLineCount();for(let h=t.lineNumber;h<=l;h++){const e=this.textModel.tokenization.getLineTokens(h),i=e.getCount(),s=this.textModel.getLineContent(h);let o=0,r=0,l=0;h===t.lineNumber&&(o=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,l=t.column-1);let d=!0;for(;o=1;r--){const e=this.textModel.tokenization.getLineTokens(r),t=e.getCount(),a=this.textModel.getLineContent(r);let l=t-1,h=a.length,d=a.length;if(r===i.lineNumber){l=e.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const t=e.getLanguageId(l);n!==t&&(n=t,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let c=!0;for(;l>=0;l--){const t=e.getLanguageId(l);if(n!==t){if(s&&o&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e);c=!1}n=t,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const i=!!s&&!Fc(e.getStandardTokenType(l));if(i)c?h=e.getStartOffset(l):(h=e.getStartOffset(l),d=e.getEndOffset(l));else if(o&&s&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e)}c=i}if(o&&s&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let s=null,o=null,r=null;for(let a=i.lineNumber;a<=n;a++){const e=this.textModel.tokenization.getLineTokens(a),t=e.getCount(),n=this.textModel.getLineContent(a);let l=0,h=0,d=0;if(a===i.lineNumber){l=e.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const t=e.getLanguageId(l);s!==t&&(s=t,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let c=!0;for(;ln)throw new f("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=Boolean(s&&s.offSide);let r=-2,a=-1,l=-2,h=-1;const d=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,h=-1;for(let t=e;t0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=Gg.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return Gg.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return Gg.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return Gg.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return Gg.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return Gg.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return PC.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new FC(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let n=0;n>>1)-1;for(;i>>1;let o=PC.findIndexInTokensArray(n,t);if(o>0){n[o-1<<1]===t&&o--}for(let r=o;r0}getTokens(e,t,i){let n=null;if(t>>0}class YC{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),s=t[t.length-1].getRange();if(!n||!s)return e;i=e.plusRange(n).plusRange(s)}let n=null;for(let s=0,o=this._pieces.length;st)){for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}n=s-1}}return i}acceptEdit(e,t,i,n,s){for(const o of this._pieces)o.acceptEdit(e,t,i,n,s)}}class XC extends Yv{constructor(e,t,i,n,s,o){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=s,this._attachedViews=o,this._semanticTokens=new YC(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new U),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new U),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new U),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new QC(this._languageService.languageIdCodec,this._textModel,(()=>this._languageId),this._attachedViews)),this._register(this._languageConfigurationService.onDidChange((e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}))),this._register(this.grammarTokens.onDidChangeTokens((e=>{this._emitModelTokensChangedEvent(e)}))),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState((e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[e,i,n]=hc(t.text);this._semanticTokens.acceptEdit(t.range,e,i,n,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new f("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),s=n.findTokenIndexAtOffset(t.column-1),[o,r]=XC._findLanguageBoundaries(n,s),a=Ec(t.column,this.getLanguageConfiguration(n.getLanguageId(s)).getWordDefinition(),i.substring(o,r),o);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(s>0&&o===t.column-1){const[o,r]=XC._findLanguageBoundaries(n,s-1),a=Ec(t.column,this.getLanguageConfiguration(n.getLanguageId(s-1)).getWordDefinition(),i.substring(o,r),o);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let s=e.getLineContent().length;for(let o=t,r=e.getCount();os.endLineNumber,r=s.startLineNumber>t.endLineNumber;if(!n&&!r){o=!0;break}}if(!o){n=!1;break}}if(n)for(let e=0,s=this._trimAutoWhitespaceLines.length;et.endLineNumber)&&!(n===t.startLineNumber&&t.startColumn===s&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){o=!1;break}}if(o){const e=new Rh(n,1,n,s);t.push(new xd(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const s=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new Rh(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new Rh(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),s=this._buffer.getLineCount(),o=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==o.length){for(let i=0,n=o.length;io?o:n}}class Kw{static fromModelState(e){return new jw(e)}static fromViewState(e){return new qw(e)}static fromModelSelection(e){const t=Ah.liftSelection(e),i=new $w(Rh.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Kw.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;i=d.length+1)return!1;const c=d.charAt(h.column-2),u=n.get(c);if(!u)return!1;if(Zw(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=d.charAt(h.column-1);let p=!1;for(const e of u)e.open===c&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t1){const e=t.getLineContent(n.lineNumber),s=ro(e),o=-1===s?e.length+1:s+1;if(n.column<=o){const e=i.visibleColumnFromColumn(t,n),s=dc.prevIndentTabStop(e,i.indentSize),o=i.columnFromVisibleColumn(t,n.lineNumber,s);return new Rh(n.lineNumber,o,n.lineNumber,n.column)}}return Rh.fromPositions(oy.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=zo(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new Va(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let s=null;i.sort(((e,t)=>Va.compare(e.getStartPosition(),t.getEndPosition())));for(let o=0,r=i.length;o=0;s--){const n=e.charCodeAt(s),o=t.get(n);if(1===o)return s+1;if(1===i&&2===o)return s+1;if(2===i&&0===o)return s+1}return 0}static moveWordLeft(e,t,i,n){let s=i.lineNumber,o=i.column;1===o&&s>1&&(s-=1,o=t.getLineMaxColumn(s));let r=ry._findPreviousWordOnLine(e,t,new Va(s,o));if(0===n)return new Va(s,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1))),new Va(s,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1));return new Va(s,r?r.start+1:1)}return r&&o<=r.end+1&&(r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1))),new Va(s,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new Va(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let o=t.column-1;o>1;o--){const e=s.charCodeAt(o-2),t=s.charCodeAt(o-1);if(95===e&&95!==t)return new Va(i,o);if(45===e&&45!==t)return new Va(i,o);if((mo(e)||po(e))&&fo(t))return new Va(i,o);if(fo(e)&&fo(t)&&o+11&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=ry._findPreviousWordOnLine(e,t,i);if(l&&o(l))return a(l);const h=ry._findNextWordOnLine(e,t,i);return h&&o(h)?a(h):l&&h?r(l.end+1,h.start+1):l?r(l.start+1,l.end+1):h?r(h.start+1,h.end+1):r(1,s+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=ry._moveWordPartLeft(e,i);return new Rh(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=c.start+1&&(c=ry._findNextWordOnLine(i,n,new Va(a,c.end+1))),c?l=c.start+1:lSy.shiftIndent(e,t),unshiftIndent:t=>Sy.unshiftIndent(e,t)},e.languageConfigurationService);if(null===o)return null;if(o!==e.normalizeIndentation(s)){const s=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===s?Sy._typeCommand(new Rh(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+n,!1):Sy._typeCommand(new Rh(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+t.getLineContent(i.startLineNumber).substring(s-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,s){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let o=0,r=i.length;oe.length)&&(t=e.length);for(var i=0,n=new Array(t);i1)return!0;return!1}));!_.loose&&L.length&&k&&(_.loose=!0,_.items[a].loose=!0)}return _}},i.html=function(e){var t=this.rules.block.html.exec(e);if(t){var i={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){var n=this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]);i.type="paragraph",i.text=n,i.tokens=this.lexer.inline(n)}return i}},i.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},i.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:k(t[1]).map((function(e){return{text:e}})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,s,o,r,a=i.align.length;for(n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]):t[0]}},i.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;var n=D(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var s=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,n=0,s=0;s-1){var o=(0===t[0].indexOf("!")?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r.slice(1):r.slice(1,-1)),E(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},i.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return E(i,n,i[0],this.lexer)}},i.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\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F3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDF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DE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var s=n[1]||n[2]||"";if(!s||s&&(""===i||this.rules.inline.punctuation.exec(i))){var o,r,a=n[0].length-1,l=a,h=0,d="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=d.exec(t));)if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=o.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(r=Math.min(r,r+l+h),Math.min(a,r)%2){var c=e.slice(1,a+n.index+r);return{type:"em",raw:e.slice(0,a+n.index+r+1),text:c,tokens:this.lexer.inlineTokens(c)}}var u=e.slice(2,a+n.index+r-1);return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:u,tokens:this.lexer.inlineTokens(u)}}}else h+=r}}},i.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=c(i,!0),{type:"codespan",raw:t[0],text:i}}},i.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},i.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},i.autolink=function(e,t){var i,n,s=this.rules.inline.autolink.exec(e);if(s)return n="@"===s[2]?"mailto:"+(i=c(this.options.mangle?t(s[1]):s[1])):i=c(s[1]),{type:"link",raw:s[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},i.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,s;if("@"===i[2])s="mailto:"+(n=c(this.options.mangle?t(i[0]):i[0]));else{var o;do{o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(o!==i[0]);n=c(i[0]),s="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}},i.inlineText=function(e,t){var i,n=this.rules.inline.text.exec(e);if(n)return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):c(n[0]):n[0]:c(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),M={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};M.def=m(M.def).replace("label",M._label).replace("title",M._title).getRegex(),M.bullet=/(?:[*+-]|\d{1,9}[.)])/,M.listItemStart=m(/^( *)(bull) */).replace("bull",M.bullet).getRegex(),M.list=m(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex(),M._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",M._comment=/|$)/,M.html=m(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),M.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.blockquote=m(M.blockquote).replace("paragraph",M.paragraph).getRegex(),M.normal=L({},M),M.gfm=L({},M.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),M.gfm.table=m(M.gfm.table).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.gfm.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",M.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.pedantic=L({},M.normal,{html:m("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|
\n":"'+(i?e:c(e,!0))+"
\n"},i.blockquote=function(e){return""+(i?e:c(e,!0))+"
\n"+e+"
\n"},i.html=function(e){return e},i.heading=function(e,t,i,n){return this.options.headerIds?"
\n":"
\n"},i.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+""+n+">\n"},i.listitem=function(e){return"\n\n"+e+"\n"+t+"
\n"},i.tablerow=function(e){return"\n"+e+" \n"},i.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+""+i+">\n"},i.strong=function(e){return""+e+""},i.em=function(e){return""+e+""},i.codespan=function(e){return""+e+"
"},i.br=function(){return this.options.xhtml?"
":"
"},i.del=function(e){return""+e+""},i.link=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='"+i+""},i.image=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='":">"},i.text=function(e){return e},t}(),F=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),B=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),W=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new F,this.slugger=new B}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var i=t.prototype;return i.parse=function(e,t){void 0===t&&(t=!0);var i,n,s,o,r,a,l,h,d,c,u,p,m,f,_,v,b,C,w,y="",S=e.length;for(i=0;i0&&"paragraph"===_.tokens[0].type?(_.tokens[0].text=C+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&"text"===_.tokens[0].tokens[0].type&&(_.tokens[0].tokens[0].text=C+" "+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:"text",text:C}):f+=C),f+=this.parse(_.tokens,m),d+=this.renderer.listitem(f,b,v);y+=this.renderer.list(d,u,p);continue;case"html":y+=this.renderer.html(c.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(d=c.tokens?this.parseInline(c.tokens):c.text;i+1An error occurred:
"+c(e.message+"",!0)+"";throw e}try{var l=O.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(V.walkTokens(l,t.walkTokens)).then((function(){return W.parse(l,t)})).catch(a);V.walkTokens(l,t.walkTokens)}return W.parse(l,t)}catch(Mre){a(Mre)}}V.options=V.setOptions=function(t){var i;return L(V.defaults,t),i=V.defaults,e.defaults=i,V},V.getDefaults=s,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),i=0;i
"+c(Mre.message+"",!0)+"";throw Mre}},V.Parser=W,V.parser=W.parse,V.Renderer=P,V.TextRenderer=F,V.Lexer=O,V.lexer=O.lex,V.Tokenizer=I,V.Slugger=B,V.parse=V;var H=V.options,z=V.setOptions,U=V.use,K=V.walkTokens,j=V.parseInline,q=V,$=W.parse,G=O.lex;e.Lexer=O,e.Parser=W,e.Renderer=P,e.Slugger=B,e.TextRenderer=F,e.Tokenizer=I,e.getDefaults=s,e.lexer=G,e.marked=V,e.options=H,e.parse=q,e.parseInline=j,e.parser=$,e.setOptions=z,e.use=U,e.walkTokens=K,Object.defineProperty(e,"__esModule",{value:!0})},e.amd?e(0,i):"object"==typeof exports?i(exports):i((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}();uk.Lexer||exports.Lexer,uk.Parser||exports.Parser,uk.Renderer||exports.Renderer,uk.Slugger||exports.Slugger,uk.TextRenderer||exports.TextRenderer,uk.Tokenizer||exports.Tokenizer,uk.getDefaults||exports.getDefaults,uk.lexer||exports.lexer;var gk=uk.marked||exports.marked;uk.options||exports.options,uk.parse||exports.parse,uk.parseInline||exports.parseInline,uk.parser||exports.parser,uk.setOptions||exports.setOptions,uk.use||exports.use,uk.walkTokens||exports.walkTokens;function pk(e){let t=JSON.parse(e);return t=fk(t),t}function mk(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function fk(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return an.revive(e);case 2:return new RegExp(e.source,e.flags);case 17:return new Date(e.source)}if(e instanceof Kc||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i
${e}
`,link:(e,t,i)=>"string"!=typeof e?"":(e===i&&(i=Pa(i)),t="string"==typeof t?Oa(Pa(t)):"",`/g,">").replace(/"/g,""").replace(/'/g,"'")}" title="${t||e}">${i}`)});function vk(e,t={},i={}){var n,s;const o=new N;let a=!1;const l=ik(t),h=function(t){let i;try{i=pk(decodeURIComponent(t))}catch(Mre){}return i?(i=md(i,(t=>e.uris&&e.uris[t]?an.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(i))):t},d=function(t,i){const n=e.uris&&e.uris[t];let s=an.revive(n);return i?t.startsWith(vn.data+":")?t:(s||(s=an.parse(t)),wn.uriToBrowserUri(s).toString(!0)):s?an.parse(t).toString()===s.toString()?t:(s.query&&(s=s.with({query:h(s.query)})),s.toString()):t},c=new gk.Renderer;c.image=_k.image,c.link=_k.link,c.paragraph=_k.paragraph;const u=[],g=[];if(t.codeBlockRendererSync?c.code=(e,i)=>{const n=ck.nextId(),s=t.codeBlockRendererSync(bk(i),e);return g.push([n,s]),`