diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9e16da1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/static/* linguist-vendored +/app/editor/vs/* linguist-vendored diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ce0c81 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# 发行包文件目录 +/release + +# 自定义样式 +/custom.css + +# 测试样式 +/style/test + +# 测试脚本 +/script/test + +# 编辑器 +# /app/editor +/app/min-maps diff --git a/app/comment2/comment.css b/app/comment2/comment.css deleted file mode 100644 index 4bca6a0..0000000 --- a/app/comment2/comment.css +++ /dev/null @@ -1,363 +0,0 @@ -/* Common */ -strong[style="blank"]{ - background-color: var(--b3-theme-on-background); - color: var(--b3-theme-on-background); - font-weight: normal; - /* border: 1px solid var(--b3-theme-on-background); */ - border-radius: 1px; - transition: all 300ms ease-in-out; - /* cursor: pointer; */ -} -strong[style="blank"]:hover{ - color: var(--b3-theme-on-background); - background-color: var(--b3-theme-background); - transition: all 300ms ease-in-out; -} -.lz-overlay, .lz-overlay-black{ - z-index: 999; - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: transparent; - transition: opacity 150ms linear; - display: none; - opacity: 1; -} -.lz-overlay-black{ - background-color: rgba(0, 0, 0, 0.2); -} - -/* flex card layout */ -.protyle-wysiwyg.card{ - display: flex; - flex-wrap: wrap; - /* background-color: var(--b3-theme-surface); */ -} -.protyle-wysiwyg.card div[data-node-id]{ - /* box-shadow: 0 0 2px rgba(0, 0, 0, 0.3); */ - margin: 5px; - padding: 10px; - border-radius: 3px; - flex-basis: 200px; - background-color: var(--b3-theme-surface); -} - - -/* Inline comment */ -strong[style*="quote"]{ - border-bottom: 2px solid rgb(255, 212, 0); - background-color: rgba(255,212,0,0.16); - padding-bottom: 1px; - font-weight: normal; -} -strong[style*="quote"]:hover{ - cursor: pointer; - /* background-color: rgb(255, 212, 0); */ -} - -#lz-comment-box{ - font-size: 15px; - display: none; - position: fixed; - z-index: 1000; - left: 800px; - top: 200px; - width: 480px; - border: 1px solid var(--b3-border-color); - box-shadow: var(--b3-dialog-shadow); - background-color: var(--b3-theme-background); - border-radius: 3px; - padding: 10px 0; -} -#lz-comment-box a{ - border-bottom: 1px solid var(--b3-theme-primary); -} -#lz-comment-box a:hover{ - text-decoration: none; -} -#lz-comment-box .list{ - width: 100%; - max-height: 370px; - overflow-y: scroll; -} -#lz-comment-box .list::-webkit-scrollbar{ - width: 3px; - border-radius: 5px; -} -#lz-comment-box .list .quote{ - border-left: 3px solid #F9DE6D; - padding: 2px 0 2px 8px; - margin: 10px 15px; - color: var(--b3-theme-on-surface); -} -#lz-comment-box .quote .delete-quote{ - color: #f56c6c; - font-size: 0.8em; - margin-left: 5px; - opacity: 0; -} -#lz-comment-box .quote:hover .delete-quote{ - opacity: 1; - cursor: pointer; -} -#lz-comment-box .list-item{ - /* width: calc(100% - 30px); */ - padding: 0px 15px 5px 15px; - border-bottom: 1px solid var(--b3-border-color); -} -#lz-comment-box .list-item:last-child{ - border-bottom: none; -} -#lz-comment-box .list-item .header{ - margin-top: 12px; - display: flex; - justify-content: space-between; - align-items: center; -} -#lz-comment-box .list-item .date{ - color: #999; - font-size: 0.9em; -} - -#lz-comment-box .list-item .actions{ - display: flex; -} -#lz-comment-box .list-item .delete-comment{ - color: #f56c6c; - font-size: 0.8em; - opacity: 0; - margin-left: 8px; -} -#lz-comment-box .list-item .actions a{ - border: none; -} -#lz-comment-box .list-item:hover .delete-comment{ - opacity: 1; - cursor: pointer; -} - -#lz-comment-box .list-item .comment{ - margin: 5px 0; - color: var(--b3-theme-on-background); -} -#lz-comment-box .add{ - display: flex; - padding: 0 15px ; -} -#lz-comment-box .add .input{ - min-height: 30px; - background-color: var(--b3-theme-surface); - padding: 4px 5px; - line-height: 30px; - color: var(--b3-theme-on-background); - border-radius: 3px; - outline: none; - flex-grow: 1; -} -#lz-comment-box .input:empty:before{ - content: attr(placeholder); - /* content: 'hello'; */ - color:var(--b3-theme-on-surface); - opacity: 0.4; -} -#lz-comment-box .add .btn{ - flex-shrink: 0; - height: 30px; - line-height: 30px; - text-align: center; - padding: 4px 10px; - background-color: var(--b3-theme-primary); - color: var(--b3-theme-on-primary); - border-radius: 3px; - margin-left: 8px; - cursor: pointer; -} - - -/* Toolbar */ -#lz-toolbar{ - font-size: 15px; - position: fixed; - right: 60px; - bottom: 25px; - background-color: #fefefe; - background-color: var(--b3-theme-background); - box-shadow: var(--b3-point-shadow); - /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); */ - /* border: 1px solid #efefef; */ - border-radius: 20px; - padding: 5px 10px; - z-index: 99; -} -#lz-toolbar.close i:not(.closeBtn){ - display: none; -} -#lz-toolbar .toolbar-btn{ - display:inline-block; - font-size:20px; - padding:5px; - margin: 0 5px; - cursor:pointer; -} -#lz-toolbar .toolbar-btn:hover,#lz-toolbar .toolbar-btn.show{ - color: var(--b3-theme-primary); - /* background-color: #efefef; */ -} - -#lz-toolbar .menu, #lz-toolbar .submenu{ - position: fixed; - padding: 10px 0px; - border-radius: 4px; - background-color: white; - background-color: var(--b3-theme-background); - /* box-shadow: 0 0px 2px rgba(0, 0, 0, 0.14); */ - box-shadow: var(--b3-point-shadow); - z-index: 99; - min-width: 100px; - max-width: 150px; - display: none; -} -#lz-toolbar .menu{ - bottom: 70px; -} -#lz-toolbar .submenu{ - right:-999px; - /* position: absolute; */ - -} -#lz-toolbar .menu.show,#lz-toolbar .submenu.show{ - display: block; -} - -.menu-mask{ - z-index: 98; - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: transparent; - display: none; -} -.menu-item{ - cursor: pointer; - padding: 5px 20px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -.menu-item:hover{ - background-color: var(--b3-list-hover); - color: var(--b3-theme-primary); -} - -#snackbar { - visibility: hidden; - min-width: 120px; - margin-left: -125px; - background-color: #666; - color: #fff; - text-align: center; - border-radius: 6px; - padding: 10px; - position: fixed; - z-index: 10000; - left: 50%; - top: 30px; - font-size: 14px; -} -#snackbar.info{ - background-color: #444; -} -#snackbar.success{ - background-color: #67c23a; -} -#snackbar.danger{ - background-color: #f56c6c; -} -#snackbar.warning{ - background-color: #e6a23c; -} - -#snackbar.show { - visibility: visible; - -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; - animation: fadein 0.5s, fadeout 0.5s 2.5s; -} - -@-webkit-keyframes fadein { - from {top: 0; opacity: 0;} - to {top: 30px; opacity: 1;} -} - -@keyframes fadein { - from {top: 0; opacity: 0;} - to {top: 30px; opacity: 1;} -} - -@-webkit-keyframes fadeout { - from {top: 30px; opacity: 1;} - to {top: 0; opacity: 0;} -} - -@keyframes fadeout { - from {top: 30px; opacity: 1;} - to {top: 0; opacity: 0;} -} - - -#popup{ - min-width: 120px; - max-height: 150px; - overflow-y: scroll; - position: absolute; - padding: 5px 0; - box-shadow: var(--b3-dialog-shadow); - background-color: var(--b3-menu-background); - color:var(--b3-theme-on-surface); - border-radius: 3px; - display: none; - z-index: 99; -} - -#popup::-webkit-scrollbar{ - width: 0px; - border-radius: 5px; -} -.popup-item{ - font-size: 15px; - padding: 5px 10px; -} -.popup-item:hover, .popup-item.on{ - background-color: var(--b3-border-color) ; - cursor: pointer; -} - - -.popup-mask{ - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - z-index: 98; - display: none; -} - -.popup-success{ - background-color: #67c23a23; - transition: all ease-in-out 500ms; -} - -.popup-error{ - background-color: #f56c6c23; - transition: all ease-in-out 500ms; -} - -/* 批注显示批注时间 */ -.protyle-wysiwyg div[data-node-id][custom-quote-time]::before { - content: attr(custom-quote-time); - font-size: 12px; -} diff --git a/app/comment2/comment.js b/app/comment2/comment.js deleted file mode 100644 index 27d0adc..0000000 --- a/app/comment2/comment.js +++ /dev/null @@ -1,674 +0,0 @@ -import config from './config.js' -import { - snackbar, - computeBoxPosition, - createBlockId, - saveViaTransaction, - formatSYDate, - dateFormat, -} from './utils.js' -import { - querySQL, - insertBlock, - appendBlock, - deleteBlock, - setBlockAttrs, -} from './network.js' - - -class Comment { - - constructor() { - this.icons = config.icons - this.isShow = false //是否弹出批注框 - setTimeout(() => this.appendToolbarBtn(), 1000) //添加 toolbar 批注按钮 - // setTimeout(()=>this.resolveCommentNodes(),1000) //等待文章内容加载完整后解析批注span todo - } - - async handleKeyDown(e) { - // 监听组合快捷键(暂时没用) - // if(e.shiftKey && e.altKey && e.code =='KeyC'){ - // e.preventDefault() - // e.stopPropagation() - // this.showBox(e) - // } - - // 回车键提交批注 - if (this.isShow && e.key == 'Enter') { - e.preventDefault() - e.stopPropagation() - await this.submitComment() - } - - // esc 关闭 box - if (this.isShow && e.key == 'Escape') { - this.hiddenBox() - } - } - - /** - * 渲染弹出框内的批注列表 - * @param {*} node - * @param {*} from 点击来源位置 - */ - async renderCommentsHtml(node, from) { - - let html = '' - - switch (from) { - case 'toolbar': - html = `
=0;const e="i-default";function A(p,L){let w;return L.length===0?w=p:w=p.replace(/\{(\d+)\}/g,(S,b)=>{const s=b[0],a=L[s];let f=S;return typeof a=="string"?f=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(f=String(a)),f}),N&&(w="\uFF3B"+w.replace(/[aouei]/g,"$&$&")+"\uFF3D"),w}function l(p,L){let w=p[L];return w||(w=p["*"],w)?w:null}function y(p){return p.charAt(p.length-1)==="/"?p:p+"/"}function C(p,L,w){return oe(this,void 0,void 0,function*(){const S=y(p)+y(L)+"vscode/"+y(w),b=yield fetch(S);if(b.ok)return yield b.json();throw new Error(`${b.status} - ${b.statusText}`)})}function c(p){return function(L,w){const S=Array.prototype.slice.call(arguments,2);return A(p[L],S)}}function h(p,L,...w){return A(L,w)}r.localize=h;function v(p){}r.getConfiguredDefaultLocale=v;function t(p){N=p}r.setPseudoTranslation=t;function g(p,L){var w;return{localize:c(L[p]),getConfiguredDefaultLocale:(w=L.getConfiguredDefaultLocale)!==null&&w!==void 0?w:S=>{}}}r.create=g;function m(p,L,w,S){var b;const s=(b=S["vs/nls"])!==null&&b!==void 0?b:{};if(!p||p.length===0)return w({localize:h,getConfiguredDefaultLocale:()=>{var i;return(i=s.availableLanguages)===null||i===void 0?void 0:i["*"]}});const a=s.availableLanguages?l(s.availableLanguages,p):null,f=a===null||a===e;let d=".nls";f||(d=d+"."+a);const o=i=>{Array.isArray(i)?i.localize=c(i):i.localize=c(i[p]),i.getConfiguredDefaultLocale=()=>{var u;return(u=s.availableLanguages)===null||u===void 0?void 0:u["*"]},w(i)};typeof s.loadBundle=="function"?s.loadBundle(p,a,(i,u)=>{i?L([p+".nls"],o):o(u)}):s.translationServiceUrl&&!f?(()=>oe(this,void 0,void 0,function*(){var i;try{const u=yield C(s.translationServiceUrl,a,p);return o(u)}catch(u){if(!a.includes("-"))return console.error(u),L([p+".nls"],o);try{const _=a.split("-")[0],E=yield C(s.translationServiceUrl,_,p);return(i=s.availableLanguages)!==null&&i!==void 0||(s.availableLanguages={}),s.availableLanguages["*"]=_,o(E)}catch(_){return console.error(_),L([p+".nls"],o)}}}))():L([p+d],o,i=>{if(d===".nls"){console.error("Failed trying to load default language strings",i);return}console.error(`Failed to load message bundle for language ${a}. Falling back to the default language:`,i),L([p+".nls"],o)})}r.load=m}),function(){var F,r;const N=self.MonacoEnvironment,e=N&&N.baseUrl?N.baseUrl:"../../../",A=typeof((F=self.trustedTypes)===null||F===void 0?void 0:F.createPolicy)=="function"?(r=self.trustedTypes)===null||r===void 0?void 0:r.createPolicy("amdLoader",{createScriptURL:t=>t,createScript:(t,...g)=>{const m=g.slice(0,-1).join(","),p=g.pop().toString();return`(function anonymous(${m}) {
+${p}
+})`}}):void 0;function l(){try{return(A?self.eval(A.createScript("","true")):new Function("true")).call(self),!0}catch{return!1}}function y(){return new Promise((t,g)=>{if(typeof self.define=="function"&&self.define.amd)return t();const m=e+"vs/loader.js";if(!(/^((http:)|(https:)|(file:))/.test(m)&&m.substring(0,self.origin.length)!==self.origin)&&l()){fetch(m).then(L=>{if(L.status!==200)throw new Error(L.statusText);return L.text()}).then(L=>{L=`${L}
+//# sourceURL=${m}`,(A?self.eval(A.createScript("",L)):new Function(L)).call(self),t()}).then(void 0,g);return}A?importScripts(A.createScriptURL(m)):importScripts(m),t()})}function C(){require.config({baseUrl:e,catchError:!0,trustedTypesPolicy:A,amdModulesPattern:/^vs\//})}function c(t){y().then(()=>{C(),require([t],function(g){setTimeout(function(){const m=g.create((p,L)=>{self.postMessage(p,L)},null);for(self.onmessage=p=>m.onmessage(p.data,p.ports);v.length>0;)self.onmessage(v.shift())},0)})})}typeof self.define=="function"&&self.define.amd&&C();let h=!0;const v=[];self.onmessage=t=>{if(!h){v.push(t);return}h=!1,c(t.data)}}(),Y(X[19],J([0,1]),function(F,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ArrayQueue=r.findMinBy=r.findLastMaxBy=r.findMaxBy=r.numberComparator=r.compareBy=r.CompareResult=r.splice=r.insertInto=r.asArray=r.pushMany=r.pushToEnd=r.pushToStart=r.arrayInsert=r.range=r.firstOrDefault=r.lastIndex=r.findLast=r.distinct=r.isNonEmptyArray=r.isFalsyOrEmpty=r.coalesce=r.groupBy=r.quickSelect=r.findFirstInSorted=r.binarySearch2=r.binarySearch=r.removeFastWithoutKeepingOrder=r.equals=r.tail2=r.tail=void 0;function N(P,U=0){return P[P.length-(1+U)]}r.tail=N;function e(P){if(P.length===0)throw new Error("Invalid tail call");return[P.slice(0,P.length-1),P[P.length-1]]}r.tail2=e;function A(P,U,T=(W,B)=>W===B){if(P===U)return!0;if(!P||!U||P.length!==U.length)return!1;for(let W=0,B=P.length;WT(P[W],U))}r.binarySearch=y;function C(P,U){let T=0,W=P-1;for(;T<=W;){const B=(T+W)/2|0,te=U(B);if(te<0)T=B+1;else if(te>0)W=B-1;else return B}return-(T+1)}r.binarySearch2=C;function c(P,U){let T=0,W=P.length;if(W===0)return 0;for(;T 0||this.m_modifiedCount>0)&&this.m_changes.push(new N.DiffChange(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(t,g){this.m_originalStart=Math.min(this.m_originalStart,t),this.m_modifiedStart=Math.min(this.m_modifiedStart,g),this.m_originalCount++}AddModifiedElement(t,g){this.m_originalStart=Math.min(this.m_originalStart,t),this.m_modifiedStart=Math.min(this.m_modifiedStart,g),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class h{constructor(t,g,m=null){this.ContinueProcessingPredicate=m,this._originalSequence=t,this._modifiedSequence=g;const[p,L,w]=h._getElements(t),[S,b,s]=h._getElements(g);this._hasStrings=w&&s,this._originalStringElements=p,this._originalElementsOrHash=L,this._modifiedStringElements=S,this._modifiedElementsOrHash=b,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(t){return t.length>0&&typeof t[0]=="string"}static _getElements(t){const g=t.getElements();if(h._isStringArray(g)){const m=new Int32Array(g.length);for(let p=0,L=g.length;p =0;g--){const m=t[g];let p=0,L=0;if(g>0){const f=t[g-1];p=f.originalStart+f.originalLength,L=f.modifiedStart+f.modifiedLength}const w=m.originalLength>0,S=m.modifiedLength>0;let b=0,s=this._boundaryScore(m.originalStart,m.originalLength,m.modifiedStart,m.modifiedLength);for(let f=1;;f++){const d=m.originalStart-f,o=m.modifiedStart-f;if(d s&&(s=u,b=f)}m.originalStart-=b,m.modifiedStart-=b;const a=[null];if(g>0&&this.ChangesOverlap(t[g-1],t[g],a)){t[g-1]=a[0],t.splice(g,1),g++;continue}}if(this._hasStrings)for(let g=1,m=t.length;g function(){const E=Array.prototype.slice.call(arguments,0);return o(_,E)},u={};for(const _ of d)u[_]=i(_);return u}r.createProxyObject=s;function a(d){return d===null?void 0:d}r.withNullAsUndefined=a;function f(d,o="Unreachable"){throw new Error(o)}r.assertNever=f}),Y(X[27],J([0,1,6]),function(F,r,N){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.equals=r.mixin=r.cloneAndChange=r.deepFreeze=r.deepClone=void 0;function e(v){if(!v||typeof v!="object"||v instanceof RegExp)return v;const t=Array.isArray(v)?[]:{};return Object.keys(v).forEach(g=>{v[g]&&typeof v[g]=="object"?t[g]=e(v[g]):t[g]=v[g]}),t}r.deepClone=e;function A(v){if(!v||typeof v!="object")return v;const t=[v];for(;t.length>0;){const g=t.shift();Object.freeze(g);for(const m in g)if(l.call(g,m)){const p=g[m];typeof p=="object"&&!Object.isFrozen(p)&&!(0,N.isTypedArray)(p)&&t.push(p)}}return v}r.deepFreeze=A;const l=Object.prototype.hasOwnProperty;function y(v,t){return C(v,t,new Set)}r.cloneAndChange=y;function C(v,t,g){if((0,N.isUndefinedOrNull)(v))return v;const m=t(v);if(typeof m!="undefined")return m;if((0,N.isArray)(v)){const p=[];for(const L of v)p.push(C(L,t,g));return p}if((0,N.isObject)(v)){if(g.has(v))throw new Error("Cannot clone recursive data-structure");g.add(v);const p={};for(const L in v)l.call(v,L)&&(p[L]=C(v[L],t,g));return g.delete(v),p}return v}function c(v,t,g=!0){return(0,N.isObject)(v)?((0,N.isObject)(t)&&Object.keys(t).forEach(m=>{m in v?g&&((0,N.isObject)(v[m])&&(0,N.isObject)(t[m])?c(v[m],t[m],g):v[m]=t[m]):v[m]=t[m]}),v):t}r.mixin=c;function h(v,t){if(v===t)return!0;if(v==null||t===null||t===void 0||typeof v!=typeof t||typeof v!="object"||Array.isArray(v)!==Array.isArray(t))return!1;let g,m;if(Array.isArray(v)){if(v.length!==t.length)return!1;for(g=0;g "+U+` n,d=g>i,l=gi||_ Boolean(i))}}),define(re[182],ae([1,0,19,61,180,156,11,3]),function($,e,w,C,k,I,L,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CursorMove=e.CursorMoveCommands=void 0;class v{static addCursorDown(n,i,t){const s=[];let d=0;for(let l=0,a=i.length;lo&&(c=o,f=n.model.getLineMaxColumn(c)),C.CursorState.fromModelState(new C.SingleCursorState(new b.Range(l.lineNumber,1,c,f),0,new L.Position(c,f),0))}const r=i.modelState.selectionStart.getStartPosition().lineNumber;if(l.lineNumber >0);o[p]>=r?f=p-1:o[p+1]>=r?(c=p,f=p):c=p+1}return c+1}}class i{static findMatches(r,o,c,f,p){const _=o.parseSearchRequest();return _?_.regex.multiline?this._doFindMatchesMultiline(r,c,new l(_.wordSeparators,_.regex),f,p):this._doFindMatchesLineByLine(r,c,_,f,p):[]}static _getMultilineMatchRange(r,o,c,f,p,_){let m,h=0;f?(h=f.findLineFeedCountBeforeOffset(p),m=o+p+h):m=o+p;let S;if(f){const T=f.findLineFeedCountBeforeOffset(p+_.length)-h;S=m+_.length+T}else S=m+_.length;const y=r.getPositionAt(m),E=r.getPositionAt(S);return new I.Range(y.lineNumber,y.column,E.lineNumber,E.column)}static _doFindMatchesMultiline(r,o,c,f,p){const _=r.getOffsetAt(o.getStartPosition()),m=r.getValueInRange(o,1),h=r.getEOL()===`\r
+`?new n(m):null,S=[];let y=0,E;for(c.reset(0);E=c.next(m);)if(S[y++]=g(this._getMultilineMatchRange(r,_,m,h,E.index,E[0]),E,f),y>=p)return S;return S}static _doFindMatchesLineByLine(r,o,c,f,p){const _=[];let m=0;if(o.startLineNumber===o.endLineNumber){const S=r.getLineContent(o.startLineNumber).substring(o.startColumn-1,o.endColumn-1);return m=this._findMatchesInLine(c,S,o.startLineNumber,o.startColumn-1,m,_,f,p),_}const h=r.getLineContent(o.startLineNumber).substring(o.startColumn-1);m=this._findMatchesInLine(c,h,o.startLineNumber,o.startColumn-1,m,_,f,p);for(let S=o.startLineNumber+1;S 0){a[f].lineStarts||(a[f].lineStarts=u(a[f].buffer));const _=new n(f+1,{line:0,column:0},{line:a[f].lineStarts.length-1,column:a[f].buffer.length-a[f].lineStarts[a[f].lineStarts.length-1]},a[f].lineStarts.length-1,a[f].buffer.length);this._buffers.push(a[f]),c=this.rbInsertRight(c,_)}this._searchCache=new s(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(a){const r=e.AverageBufferSize,o=r-Math.floor(r/3),c=o*2;let f="",p=0;const _=[];if(this.iterate(this.root,m=>{const h=this.getNodeContent(m),S=h.length;if(p<=o||p+S =i&&T>R&&a[S.lineNumber-i].push(new v.IndentGuide(R,-1,h,new v.IndentGuideHorizontalLine(!1,S.column),-1,-1)),y.lineNumber<=t&&N>R&&a[y.lineNumber-i].push(new v.IndentGuide(R,-1,h,new v.IndentGuideHorizontalLine(!F,y.column),-1,-1)))}for(const _ of a)_.sort((m,h)=>m.visibleColumn-h.visibleColumn);return a}getVisibleColumnFromPosition(i){return k.CursorColumns.visibleColumnFromColumn(this.textModel.getLineContent(i.lineNumber),i.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(i,t){this.assertNotDisposed();const s=this.textModel.getLineCount();if(i<1||i>s)throw new Error("Illegal value for startLineNumber");if(t<1||t>s)throw new Error("Illegal value for endLineNumber");const d=this.textModel.getOptions(),l=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=Boolean(l&&l.offSide),r=new Array(t-i+1);let o=-2,c=-1,f=-2,p=-1;for(let _=i;_<=t;_++){const m=_-i,h=this._computeIndentLevel(_-1);if(h>=0){o=_-1,c=h,r[m]=Math.ceil(h/d.indentSize);continue}if(o===-2){o=-1,c=-1;for(let S=_-2;S>=0;S--){const y=this._computeIndentLevel(S);if(y>=0){o=S,c=y;break}}}if(f!==-1&&(f===-2||f<_-1)){f=-1,p=-1;for(let S=_;S r&&(f=0)}}return f}}),define(re[245],ae([1,0]),function($,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OverviewZoneManager=e.OverviewRulerZone=e.ColorZone=void 0;class w{constructor(L,b,v){this._colorZoneBrand=void 0,this.from=L|0,this.to=b|0,this.colorId=v|0}static compare(L,b){return L.colorId===b.colorId?L.from===b.from?L.to-b.to:L.from-b.from:L.colorId-b.colorId}}e.ColorZone=w;class C{constructor(L,b,v,u){this._overviewRulerZoneBrand=void 0,this.startLineNumber=L,this.endLineNumber=b,this.heightInLines=v,this.color=u,this._colorZone=null}static compare(L,b){return L.color===b.color?L.startLineNumber===b.startLineNumber?L.heightInLines===b.heightInLines?L.endLineNumber-b.endLineNumber:L.heightInLines-b.heightInLines:L.startLineNumber-b.startLineNumber:L.colorS.toString(16).padStart(2,"0")).join(""):g((L>>>0).toString(16),w/4)}r.toHexString=m;class p{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(w){const S=w.length;if(S===0)return;const b=this._buff;let s=this._buffLen,a=this._leftoverHighSurrogate,f,d;for(a!==0?(f=a,d=-1,a=0):(f=w.charCodeAt(0),d=0);;){let o=f;if(N.isHighSurrogate(f))if(d+1>>6,w[S++]=128|(b&63)>>>0):b<65536?(w[S++]=224|(b&61440)>>>12,w[S++]=128|(b&4032)>>>6,w[S++]=128|(b&63)>>>0):(w[S++]=240|(b&1835008)>>>18,w[S++]=128|(b&258048)>>>12,w[S++]=128|(b&4032)>>>6,w[S++]=128|(b&63)>>>0),S>=64&&(this._step(),S-=64,this._totalLen+=64,w[0]=w[64+0],w[1]=w[64+1],w[2]=w[64+2]),S}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),m(this._h0)+m(this._h1)+m(this._h2)+m(this._h3)+m(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,t(this._buff,this._buffLen),this._buffLen>56&&(this._step(),t(this._buff));const w=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(w/4294967296),!1),this._buffDV.setUint32(60,w%4294967296,!1),this._step()}_step(){const w=p._bigBlock32,S=this._buffDV;for(let _=0;_<64;_+=4)w.setUint32(_,S.getUint32(_,!1),!1);for(let _=64;_<320;_+=4)w.setUint32(_,v(w.getUint32(_-12,!1)^w.getUint32(_-32,!1)^w.getUint32(_-56,!1)^w.getUint32(_-64,!1),1),!1);let b=this._h0,s=this._h1,a=this._h2,f=this._h3,d=this._h4,o,i,u;for(let _=0;_<80;_++)_<20?(o=s&a|~s&f,i=1518500249):_<40?(o=s^a^f,i=1859775393):_<60?(o=s&a|s&f|a&f,i=2400959708):(o=s^a^f,i=3395469782),u=v(b,5)+o+d+i+w.getUint32(_*4,!1)&4294967295,d=f,f=a,a=v(s,30),s=b,b=u;this._h0=this._h0+b&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+f&4294967295,this._h4=this._h4+d&4294967295}}r.StringSHA1=p,p._bigBlock32=new DataView(new ArrayBuffer(320))}),Y(X[13],J([0,1,22,26]),function(F,r,N,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.LcsDiff=r.MyArray=r.Debug=r.stringDiff=r.StringDiffSequence=void 0;class A{constructor(t){this.source=t}getElements(){const t=this.source,g=new Int32Array(t.length);for(let m=0,p=t.length;m0&&S.originalLength<20&&S.modifiedLength>0&&S.modifiedLength<20&&a()){const M=b.createCharSequence(w,S.originalStart,S.originalStart+S.originalLength-1),D=s.createCharSequence(w,S.modifiedStart,S.modifiedStart+S.modifiedLength-1);if(M.getElements().length>0&&D.getElements().length>0){let I=l(M,D,a,!0).changes;d&&(I=h(I)),E=[];for(let O=0,q=I.length;O1&&I>1;){const O=E.charCodeAt(D-2),q=M.charCodeAt(I-2);if(O!==q)break;D--,I--}(D>1||I>1)&&this._pushTrimWhitespaceCharChange(s,a+1,1,D,f+1,1,I)}{let D=m(E,1),I=m(M,1);const O=E.length+1,q=M.length+1;for(;D
=this._maxCharCode?0:this._states.get(g,m)}}r.StateMachine=A;let l=null;function y(){return l===null&&(l=new A([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),l}let C=null;function c(){if(C===null){C=new N.CharacterClassifier(0);const t=` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;for(let m=0;m=0?(C+=y?1:-1,C<0?C=A.length-1:C%=A.length,A[C]):null}}r.BasicInplaceReplace=N,N.INSTANCE=new N}),Y(X[33],J([0,1,27]),function(F,r,N){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shouldSynchronizeModel=r.ApplyEditsResult=r.SearchData=r.ValidAnnotatedEditOperation=r.isITextSnapshot=r.FindMatch=r.TextModelResolvedOptions=r.InjectedTextCursorStops=r.MinimapPosition=r.OverviewRulerLane=void 0;var e;(function(m){m[m.Left=1]="Left",m[m.Center=2]="Center",m[m.Right=4]="Right",m[m.Full=7]="Full"})(e=r.OverviewRulerLane||(r.OverviewRulerLane={}));var A;(function(m){m[m.Inline=1]="Inline",m[m.Gutter=2]="Gutter"})(A=r.MinimapPosition||(r.MinimapPosition={}));var l;(function(m){m[m.Both=0]="Both",m[m.Right=1]="Right",m[m.Left=2]="Left",m[m.None=3]="None"})(l=r.InjectedTextCursorStops||(r.InjectedTextCursorStops={}));class y{constructor(p){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,p.tabSize|0),this.indentSize=p.tabSize|0,this.insertSpaces=Boolean(p.insertSpaces),this.defaultEOL=p.defaultEOL|0,this.trimAutoWhitespace=Boolean(p.trimAutoWhitespace),this.bracketPairColorizationOptions=p.bracketPairColorizationOptions}equals(p){return this.tabSize===p.tabSize&&this.indentSize===p.indentSize&&this.insertSpaces===p.insertSpaces&&this.defaultEOL===p.defaultEOL&&this.trimAutoWhitespace===p.trimAutoWhitespace&&(0,N.equals)(this.bracketPairColorizationOptions,p.bracketPairColorizationOptions)}createChangeEvent(p){return{tabSize:this.tabSize!==p.tabSize,indentSize:this.indentSize!==p.indentSize,insertSpaces:this.insertSpaces!==p.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==p.trimAutoWhitespace}}}r.TextModelResolvedOptions=y;class C{constructor(p,L){this._findMatchBrand=void 0,this.range=p,this.matches=L}}r.FindMatch=C;function c(m){return m&&typeof m.read=="function"}r.isITextSnapshot=c;class h{constructor(p,L,w,S,b,s){this.identifier=p,this.range=L,this.text=w,this.forceMoveMarkers=S,this.isAutoWhitespaceEdit=b,this._isTracked=s}}r.ValidAnnotatedEditOperation=h;class v{constructor(p,L,w){this.regex=p,this.wordSeparators=L,this.simpleSearch=w}}r.SearchData=v;class t{constructor(p,L,w){this.reverseEdits=p,this.changes=L,this.trimAutoWhitespaceLineNumbers=w}}r.ApplyEditsResult=t;function g(m){return!m.isTooLargeForSyncing()&&!m.isForSimpleWidget}r.shouldSynchronizeModel=g}),Y(X[34],J([0,1,19,14]),function(F,r,N,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.PrefixSumIndexOfResult=r.ConstantTimePrefixSumComputer=r.PrefixSumComputer=void 0;class A{constructor(c){this.values=c,this.prefixSum=new Uint32Array(c.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(c,h){c=(0,e.toUint32)(c);const v=this.values,t=this.prefixSum,g=h.length;return g===0?!1:(this.values=new Uint32Array(v.length+g),this.values.set(v.subarray(0,c),0),this.values.set(v.subarray(c),c+g),this.values.set(h,c),c-1=s)break;const f=S.charCodeAt(b);if(f===110||f===114||f===87)return!0}}return!1}r.isMultilineRegexSource=h;function v(S,b,s){if(!s)return new y.FindMatch(S,null);const a=[];for(let f=0,d=b.length;f
+`:"'+(ce?U:s(U,!0))+`
+`},J.blockquote=function(U){return`"+(ce?U:s(U,!0))+`
+`+U+`
+`},J.html=function(U){return U},J.heading=function(U,j,ce,se){if(this.options.headerIds){var he=this.options.headerPrefix+se.slug(ce);return"
+`:`
+`},J.list=function(U,j,ce){var se=j?"ol":"ul",he=j&&ce!==1?' start="'+ce+'"':"";return"<"+se+he+`>
+`+U+""+se+`>
+`},J.listitem=function(U){return"
+
+`+U+`
+`+j+`
+`},J.tablerow=function(U){return`
+`+U+`
+`},J.tablecell=function(U,j){var ce=j.header?"th":"td",se=j.align?"<"+ce+' align="'+j.align+'">':"<"+ce+">";return se+U+(""+ce+`>
+`)},J.strong=function(U){return""+U+""},J.em=function(U){return""+U+""},J.codespan=function(U){return""+U+"
"},J.br=function(){return this.options.xhtml?"
":"
"},J.del=function(U){return""+U+""},J.link=function(U,j,ce){if(U=f(this.options.sanitize,this.options.baseUrl,U),U===null)return ce;var se='"+ce+"",se},J.image=function(U,j,ce){if(U=f(this.options.sanitize,this.options.baseUrl,U),U===null)return ce;var se='":">",se},J.text=function(U){return U},z}(),H=function(){function z(){}var J=z.prototype;return J.strong=function(U){return U},J.em=function(U){return U},J.codespan=function(U){return U},J.del=function(U){return U},J.html=function(U){return U},J.text=function(U){return U},J.link=function(U,j,ce){return""+ce},J.image=function(U,j,ce){return""+ce},J.br=function(){return""},z}(),q=function(){function z(){this.seen={}}var J=z.prototype;return J.serialize=function(U){return U.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},J.getNextSafeSlug=function(U,j){var ce=U,se=0;if(this.seen.hasOwnProperty(ce)){se=this.seen[U];do se++,ce=U+"-"+se;while(this.seen.hasOwnProperty(ce))}return j||(this.seen[U]=se,this.seen[ce]=0),ce},J.slug=function(U,j){j===void 0&&(j={});var ce=this.serialize(U);return this.getNextSafeSlug(ce,j.dryrun)},z}(),Z=function(){function z(G){this.options=G||$.defaults,this.options.renderer=this.options.renderer||new ee,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new H,this.slugger=new q}z.parse=function(U,j){var ce=new z(j);return ce.parse(U)},z.parseInline=function(U,j){var ce=new z(j);return ce.parseInline(U)};var J=z.prototype;return J.parse=function(U,j){j===void 0&&(j=!0);var ce="",se,he,me,Ce,Le,Ee,De,Ae,pe,ue,le,ge,_e,we,Ie,Me,Oe,be,ve,ye=U.length;for(se=0;se"+s(me.message+"",!0)+"
";throw me}}ie.options=ie.setOptions=function(z){return E(ie.defaults,z),b(ie.defaults),ie},ie.getDefaults=L,ie.defaults=$.defaults,ie.use=function(){for(var z=arguments.length,J=new Array(z),G=0;G"+s(U.message+"",!0)+"
";throw U}},ie.Parser=Z,ie.parser=Z.parse,ie.Renderer=ee,ie.TextRenderer=H,ie.Lexer=X,ie.lexer=X.lex,ie.Tokenizer=P,ie.Slugger=q,ie.parse=ie;var Y=ie.options,te=ie.setOptions,de=ie.use,x=ie.walkTokens,oe=ie.parseInline,Q=ie,K=Z.parse,ne=X.lex;$.Lexer=X,$.Parser=Z,$.Renderer=ee,$.Slugger=q,$.TextRenderer=H,$.Tokenizer=P,$.getDefaults=L,$.lexer=ne,$.marked=ie,$.options=Y,$.parse=Q,$.parseInline=oe,$.parser=K,$.setOptions=te,$.use=de,$.walkTokens=x,Object.defineProperty($,"__esModule",{value:!0})}),define(re[97],ae([1,0]),function($,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Mimes=void 0,e.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"})}),define(re[123],ae([1,0,97]),function($,e,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StaticDND=e.DataTransfers=void 0,e.DataTransfers={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:w.Mimes.text},e.StaticDND={CurrentDragAndDropData:void 0}}),define(re[330],ae([1,0]),function($,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ArrayNavigator=void 0;class w{constructor(k,I=0,L=k.length,b=I-1){this.items=k,this.start=I,this.end=L,this.index=b}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}e.ArrayNavigator=w}),define(re[331],ae([1,0,330]),function($,e,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HistoryNavigator=void 0;class C{constructor(I=[],L=10){this._initialize(I),this._limit=L,this._onChange()}getHistory(){return this._elements}add(I){this._history.delete(I),this._history.add(I),this._onChange()}next(){return this._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}has(I){return this._history.has(I)}_onChange(){this._reduceToLimit();const I=this._elements;this._navigator=new w.ArrayNavigator(I,0,I.length,I.length)}_reduceToLimit(){const I=this._elements;I.length>this._limit&&this._initialize(I.slice(I.length-this._limit))}_currentPosition(){const I=this._navigator.current();return I?this._elements.indexOf(I):-1}_initialize(I){this._history=new Set;for(const L of I)this._history.add(L)}get _elements(){const I=[];return this._history.forEach(L=>I.push(L)),I}}e.HistoryNavigator=C}),define(re[124],ae([1,0]),function($,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SlidingWindowAverage=e.MovingAverage=e.clamp=void 0;function w(I,L,b){return Math.min(Math.max(I,L),b)}e.clamp=w;class C{constructor(){this._n=1,this._val=0}update(L){return this._val=this._val+(L-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}e.MovingAverage=C;class k{constructor(L){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(L),this._values.fill(0,0,L)}update(L){const b=this._values[this._index];return this._values[this._index]=L,this._index=(this._index+1)%this._values.length,this._sum-=b,this._sum+=L,this._n=he.length?me:he[Le]})}e.format=b;function v(se){return se.replace(/[<>&]/g,function(he){switch(he){case"<":return"<";case">":return">";case"&":return"&";default:return he}})}e.escape=v;function u(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}e.escapeRegExpCharacters=u;function g(se,he=" "){const me=n(se,he);return i(me,he)}e.trim=g;function n(se,he){if(!se||!he)return se;const me=he.length;if(me===0||se.length===0)return se;let Ce=0;for(;se.indexOf(he,Ce)===Ce;)Ce=Ce+me;return se.substring(Ce)}e.ltrim=n;function i(se,he){if(!se||!he)return se;const me=he.length,Ce=se.length;if(me===0||Ce===0)return se;let Le=Ce,Ee=-1;for(;Ee=se.lastIndexOf(he,Le-1),!(Ee===-1||Ee+me!==Le);){if(Ee===0)return"";Le=Ee}return se.substring(0,Le)}e.rtrim=i;function t(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}e.convertSimple2RegExpPattern=t;function s(se){return se.replace(/\*/g,"")}e.stripWildcards=s;function d(se,he,me={}){if(!se)throw new Error("Cannot create regex from empty string");he||(se=u(se)),me.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let Ce="";return me.global&&(Ce+="g"),me.matchCase||(Ce+="i"),me.multiline&&(Ce+="m"),me.unicode&&(Ce+="u"),new RegExp(se,Ce)}e.createRegExp=d;function l(se){return se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$"?!1:!!(se.exec("")&&se.lastIndex===0)}e.regExpLeadsToEndlessLoop=l;function a(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}e.regExpFlags=a;function r(se){return se.split(/\r\n|\r|\n/)}e.splitLines=r;function o(se){for(let he=0,me=se.length;he0||this.m_modifiedCount>0)&&this.m_changes.push(new w.DiffChange(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(n,i){this.m_originalStart=Math.min(this.m_originalStart,n),this.m_modifiedStart=Math.min(this.m_modifiedStart,i),this.m_originalCount++}AddModifiedElement(n,i){this.m_originalStart=Math.min(this.m_originalStart,n),this.m_modifiedStart=Math.min(this.m_modifiedStart,i),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class u{constructor(n,i,t=null){this.ContinueProcessingPredicate=t,this._originalSequence=n,this._modifiedSequence=i;const[s,d,l]=u._getElements(n),[a,r,o]=u._getElements(i);this._hasStrings=l&&o,this._originalStringElements=s,this._originalElementsOrHash=d,this._modifiedStringElements=a,this._modifiedElementsOrHash=r,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(n){return n.length>0&&typeof n[0]=="string"}static _getElements(n){const i=n.getElements();if(u._isStringArray(i)){const t=new Int32Array(i.length);for(let s=0,d=i.length;s=0;i--){const t=n[i];let s=0,d=0;if(i>0){const f=n[i-1];s=f.originalStart+f.originalLength,d=f.modifiedStart+f.modifiedLength}const l=t.originalLength>0,a=t.modifiedLength>0;let r=0,o=this._boundaryScore(t.originalStart,t.originalLength,t.modifiedStart,t.modifiedLength);for(let f=1;;f++){const p=t.originalStart-f,_=t.modifiedStart-f;if(po&&(o=h,r=f)}t.originalStart-=r,t.modifiedStart-=r;const c=[null];if(i>0&&this.ChangesOverlap(n[i-1],n[i],c)){n[i-1]=c[0],n.splice(i,1),i++;continue}}if(this._hasStrings)for(let i=1,t=n.length;i=0;a--,this._valueLen--){const r=this._value.charCodeAt(a);if(!(r===47||this._splitOnBackslash&&r===92))break}return this.next()}hasNext(){return this._to0){const l=255/d;for(let a=0;a=_.start+1&&(_=v._findNextWordOnLine(s,d,new L.Position(o,_.end+1))),_?c=_.start+1:c>>0,this._cache.set(a,r)}return(r|l<<0)>>>0}}e.TokenTheme=v;const u=/\b(comment|string|regex|regexp)\b/;function g(d){const l=d.match(u);if(!l)return 0;switch(l[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}e.toStandardTokenType=g;function n(d,l){return d0&&(i=Math.max(0,i-this.wrappedTextIndentLength)),(n>0?this.breakOffsets[n-1]:0)+i}normalizeOffsetInInputWithInjectionsAroundInjections(n,i){const t=this.getInjectedTextAtOffset(n);if(!t)return n;if(i===2){if(n===t.offsetInInputWithInjections+t.length&&L(this.injectionOptions[t.injectedTextIndex].cursorStops))return t.offsetInInputWithInjections+t.length;{let s=t.offsetInInputWithInjections;if(b(this.injectionOptions[t.injectedTextIndex].cursorStops))return s;let d=t.injectedTextIndex-1;for(;d>=0&&this.injectionOffsets[d]===this.injectionOffsets[t.injectedTextIndex]&&!(L(this.injectionOptions[d].cursorStops)||(s-=this.injectionOptions[d].content.length,b(this.injectionOptions[d].cursorStops)));)d--;return s}}else if(i===1||i===4){let s=t.offsetInInputWithInjections+t.length,d=t.injectedTextIndex;for(;d+1d)throw new Error("Illegal value for lineNumber");const l=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,a=Boolean(l&&l.offSide);let r=-2,o=-1,c=-2,f=-1;const p=D=>{if(r!==-1&&(r===-2||r>D-1)){r=-1,o=-1;for(let M=D-2;M>=0;M--){const P=this._computeIndentLevel(M);if(P>=0){r=M,o=P;break}}}if(c===-2){c=-1,f=-1;for(let M=D;M=0){f=S,p=y;break}}}r[m]=this._getIndentLevelForWhitespaceLine(a,c,p)}return r}_getIndentLevelForWhitespaceLine(i,t,s){const d=this.textModel.getOptions();return t===-1||s===-1?0:t0){const b=this._tokens[this._tokens.length-1];if(b.endLineNumber+1===I){b.appendLineTokens(L);return}}this._tokens.push(new w.ContiguousMultilineTokens(I,[L]))}finalize(){return this._tokens}}e.ContiguousMultilineTokensBuilder=C}),define(re[82],ae([1,0,109]),function($,e,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LineTokens=void 0;class C{constructor(L,b,v){this._lineTokensBrand=void 0,this._tokens=L,this._tokensCount=this._tokens.length>>>1,this._text=b,this._languageIdCodec=v}static createEmpty(L,b){const v=C.defaultTokenMetadata,u=new Uint32Array(2);return u[0]=L.length,u[1]=v,new C(u,L,b)}equals(L){return L instanceof C?this.slicedEquals(L,0,this._tokensCount):!1}slicedEquals(L,b,v){if(this._text!==L._text||this._tokensCount!==L._tokensCount)return!1;const u=b<<1,g=u+(v<<1);for(let n=u;n',a=Math.max(d.range.startLineNumber,n),r=Math.min(d.range.endLineNumber,i);for(let o=a;o<=r;o++){const c=o-n;u[c]+=l}}}_renderNormalDecorations(b,v,u){const g=String(this._lineHeight),n=b.visibleRange.startLineNumber;let i=null,t=!1,s=null;for(let d=0,l=v.length;d1){const p=v.charCodeAt(l-2);w.isHighSurrogate(p)&&l--}if(a>1){const p=v.charCodeAt(a-2);w.isHighSurrogate(p)&&a--}const c=l-1,f=a-2;i=n.consumeLowerThan(c,i,g),n.count===0&&(i=c),n.insert(f,r,o)}return n.consumeLowerThan(1073741824,i,g),g}}e.LineDecorationsNormalizer=L}),define(re[441],ae([1,0]),function($,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinePart=void 0;class w{constructor(k,I,L,b){this.endIndex=k,this.type=I,this.metadata=L,this.containsRTL=b,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}e.LinePart=w}),define(re[442],ae([1,0,8]),function($,e,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinesLayout=e.EditorWhitespace=void 0;class C{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(b){this._hasPending=!0,this._inserts.push(b)}change(b){this._hasPending=!0,this._changes.push(b)}remove(b){this._hasPending=!0,this._removes.push(b)}mustCommit(){return this._hasPending}commit(b){if(!this._hasPending)return;const v=this._inserts,u=this._changes,g=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],b._commitPendingChanges(v,u,g)}}class k{constructor(b,v,u,g,n){this.id=b,this.afterLineNumber=v,this.ordinal=u,this.height=g,this.minWidth=n,this.prefixSum=0}}e.EditorWhitespace=k;class I{constructor(b,v,u,g){this._instanceId=w.singleLetterHash(++I.INSTANCE_COUNT),this._pendingChanges=new C,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=b,this._lineHeight=v,this._paddingTop=u,this._paddingBottom=g}static findInsertionIndex(b,v,u){let g=0,n=b.length;for(;gv&&S--,{bigNumbersDelta:c,startLineNumber:g,endLineNumber:i,relativeVerticalOffset:f,centeredLineNumber:_,completelyVisibleStartLineNumber:h,completelyVisibleEndLineNumber:S}}getVerticalOffsetForWhitespaceIndex(b){this._checkPendingChanges(),b=b|0;const v=this.getAfterLineNumberForWhitespaceIndex(b);let u;v>=1?u=this._lineHeight*v:u=0;let g;return b>0?g=this.getWhitespacesAccumulatedHeight(b-1):g=0,u+g+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(b){this._checkPendingChanges(),b=b|0;let v=0,u=this.getWhitespacesCount()-1;if(u<0)return-1;const g=this.getVerticalOffsetForWhitespaceIndex(u),n=this.getHeightForWhitespaceIndex(u);if(b>=g+n)return-1;for(;v=t+s)v=i+1;else{if(b>=t)return i;u=i}}return v}getWhitespaceAtVerticalOffset(b){this._checkPendingChanges(),b=b|0;const v=this.getWhitespaceIndexAtOrAfterVerticallOffset(b);if(v<0||v>=this.getWhitespacesCount())return null;const u=this.getVerticalOffsetForWhitespaceIndex(v);if(u>b)return null;const g=this.getHeightForWhitespaceIndex(v),n=this.getIdForWhitespaceIndex(v),i=this.getAfterLineNumberForWhitespaceIndex(v);return{id:n,afterLineNumber:i,verticalOffset:u,height:g}}getWhitespaceViewportData(b,v){this._checkPendingChanges(),b=b|0,v=v|0;const u=this.getWhitespaceIndexAtOrAfterVerticallOffset(b),g=this.getWhitespacesCount()-1;if(u<0)return[];const n=[];for(let i=u;i<=g;i++){const t=this.getVerticalOffsetForWhitespaceIndex(i),s=this.getHeightForWhitespaceIndex(i);if(t>=v)break;n.push({id:this.getIdForWhitespaceIndex(i),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(i),verticalOffset:t,height:s})}return n}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(b){return this._checkPendingChanges(),b=b|0,this._arr[b].id}getAfterLineNumberForWhitespaceIndex(b){return this._checkPendingChanges(),b=b|0,this._arr[b].afterLineNumber}getHeightForWhitespaceIndex(b){return this._checkPendingChanges(),b=b|0,this._arr[b].height}}e.LinesLayout=I,I.INSTANCE_COUNT=0}),define(re[443],ae([1,0,3]),function($,e,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewportData=void 0;class C{constructor(I,L,b,v){this.selections=I,this.startLineNumber=L.startLineNumber|0,this.endLineNumber=L.endLineNumber|0,this.relativeVerticalOffset=L.relativeVerticalOffset,this.bigNumbersDelta=L.bigNumbersDelta|0,this.whitespaceViewportData=b,this._model=v,this.visibleRange=new w.Range(L.startLineNumber,this._model.getLineMinColumn(L.startLineNumber),L.endLineNumber,this._model.getLineMaxColumn(L.endLineNumber))}getViewLineRenderingData(I){return this._model.getViewportViewLineRenderingData(this.visibleRange,I)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}e.ViewportData=C}),define(re[74],ae([1,0,8,3]),function($,e,w,C){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OverviewRulerDecorationsGroup=e.ViewModelDecoration=e.SingleLineInlineDecoration=e.InlineDecoration=e.ViewLineRenderingData=e.ViewLineData=e.MinimapLinesRenderingData=e.Viewport=void 0;class k{constructor(t,s,d,l){this._viewportBrand=void 0,this.top=t|0,this.left=s|0,this.width=d|0,this.height=l|0}}e.Viewport=k;class I{constructor(t,s){this.tabSize=t,this.data=s}}e.MinimapLinesRenderingData=I;class L{constructor(t,s,d,l,a,r,o){this._viewLineDataBrand=void 0,this.content=t,this.continuesWithWrappedLine=s,this.minColumn=d,this.maxColumn=l,this.startVisibleColumn=a,this.tokens=r,this.inlineDecorations=o}}e.ViewLineData=L;class b{constructor(t,s,d,l,a,r,o,c,f,p){this.minColumn=t,this.maxColumn=s,this.content=d,this.continuesWithWrappedLine=l,this.isBasicASCII=b.isBasicASCII(d,r),this.containsRTL=b.containsRTL(d,this.isBasicASCII,a),this.tokens=o,this.inlineDecorations=c,this.tabSize=f,this.startVisibleColumn=p}static isBasicASCII(t,s){return s?w.isBasicASCII(t):!0}static containsRTL(t,s,d){return!s&&d?w.containsRTL(t):!1}}e.ViewLineRenderingData=b;class v{constructor(t,s,d){this.range=t,this.inlineClassName=s,this.type=d}}e.InlineDecoration=v;class u{constructor(t,s,d,l){this.startOffset=t,this.endOffset=s,this.inlineClassName=d,this.inlineClassNameAffectsLetterSpacing=l}toInlineDecoration(t){return new v(new C.Range(t,this.startOffset+1,t,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}e.SingleLineInlineDecoration=u;class g{constructor(t,s){this._viewModelDecorationBrand=void 0,this.range=t,this.options=s}}e.ViewModelDecoration=g;class n{constructor(t,s,d){this.color=t,this.zIndex=s,this.data=d}static cmp(t,s){return t.zIndex===s.zIndex?t.colorD&&((F===0||B-O>E)&&(F=A,O=B-H),N[R]=F,T[R]=O,R++,D=O+E,F=0),M=X,P=ee}return R===0&&(!r||r.length===0)?null:(N[R]=S,T[R]=B,new I.ModelLineProjectionData(h,m,N,T,y))}function i(l,a,r,o){return l===9?r-a%r:w.isFullWidthCharacter(l)||l<32?o:1}function t(l,a){return a-l%a}function s(l,a,r,o){return r!==32&&(a===2&&o!==2||a!==1&&o===1||a===3&&o!==2||o===3&&a!==1)}function d(l,a,r,o,c){let f=0;if(c!==0){const p=w.firstNonWhitespaceIndex(l);if(p!==-1){for(let m=0;m