|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./highlight-vfeU4YAb-Cf9QqY4G.js","./index-bVOhw2NF.js","./index-DB_sRdQO.css","./vue-repl-jaFwbjhK.js","./vue-repl-B3ZhTsYW.css","./index.vue_vue_type_script_setup_true_lang-Q6sPmgzz.js","./toggleHighContrast-BiNrcRtm.js","./editorWorker-UB-8rWUJ.js","./toggleHighContrast-CaWkxAnq.css","./upload-DeP_4dQB.js","./http-D9Asdp-z.js","./light-Cua7cqmF.js","./context-KbjOeZY_.js","./_initCloneObject-K-Y0ueWp.js","./_baseFor-mOzdmxoL.js","./fade-in.cssr-CltBGdAW.js","./light-BKuBIbLH.js","./index-C-nsH7mf.js","./use-compitable-DMmt6sIs.js","./Loading-CByrJVhO.js","./icon-switch.cssr-BCTOxvoq.js","./use-is-mounted-wlrzLfZo.js","./use-style-qLHIyj3D.js","./Scrollbar-Db3aKfvv.js","./use-rtl-CRyak7TN.js","./light-uWHRDFKR.js","./light-CE5Kvs_2.js","./light-B00G814I.js","./Scrollbar-DVK2lT9w.js","./delegate-CI_DDEu_.js","./VResizeObserver-Tzd5ds8d.js","./get-precise-event-target-DhO46Lpt.js","./light-MOj96jwO.js","./use-locale-CFjRjALw.js","./index-Dn5RNViO.js","./use-merged-state-CzrzZJbg.js","./resolve-slot-Dzko3qih.js","./Input-CFQSA5NN.js","./browser-DLIXj5nt.js","./is-browser-DqcmxZSF.js","./use-form-item-CNgNT5jP.js","./use-memo-BgHp9YyU.js","./Suffix-BqBRFVnL.js","./Icon-Ck7Ij_E6.js","./upperFirst-Bq7Kgunw.js","./toString-eibgRg41.js","./call-f2ri57Kd.js","./Select-BpXzRZdb.js","./fade-in-scale-up.cssr-CTZmXn_X.js","./use-false-until-truthy-BNJRTcsy.js","./Follower-DJGS5Fnl.js","./cssr-CS9sbUmO.js","./utils-BKyMmInE.js","./render-BxFg9-7m.js","./light-BOD3MGQo.js","./color-to-class-B0iQgAn2.js","./Close-D6FODkWY.js","./Popover-DLIip8wF.js","./_baseEach-BwxcRWC6.js","./_getTag-BJ2nhJXz.js","./get-BuNGRF3A.js","./clickoutside-CCtiUDaG.js","./format-length-B-p6aW7q.js","./index-C9vhMoZJ.js","./flatten-7z_8MaI9.js","./index-L98eAIry.js","./keep-B1eBS8j0.js","./FocusDetector-DcygY9Tk.js","./happens-in-CM8LO42l.js","./index-DsSU6HIH.js","./Forward-B4Y9XmRi.js","./keysOf-HiGXOwLp.js","./omit-DbnPTcif.js","./context-CNWzaUOd.js","./Button-B7xQqa1N.js","./Tree-CzaEbcLe.js","./Checkbox-DAl6jmZx.js","./light-DU0-KyAX.js","./fade-in-height-expand.cssr-Bx380MfO.js","./light-D6zEcTvP.js","./FormItem-Cp_SJVoE.js","./Form-BZRGTIxb.js","./light-CUlEsFk3.js","./Modal-BHLPhdX-.js","./context-ELq7iLHP.js","./Card-BhgyLFi8.js","./light-BqIgj82_.js","./light-rvBL92Ju.js","./Warning-WCOp46KX.js","./Image-CAe7wDsQ.js","./light-jvBBpnb8.js","./light-C52Zdmem.js","./_createCompounder-D746aL6M.js","./Tooltip-C_3SXSAr.js","./download-C2161hUv.js","./noImage-CAsvTj-5.js","./light-Blmb_y9V.js","./Add-CgLKrdZy.js","./Progress-BpvQ1C2a.js","./light-DH15IGTV.js","./light-DWk6YUKo.js","./Icon-C8ZbiYW7.js","./light-DD97CHyt.js","./upload-CV8--ysU.css","./componentList-BKZexaIE.js","./dashboard-YyjCL4ge.js","./LayoutSider-DeJZf5oa.js","./ChevronRight-DjG_plXV.js","./light-kqX_tTNW.js","./helpers-CjmtV6uB.js","./common-CalHcBJp.js","./index-C8mAaM2V.js","./editor-ouq_SSv2.js","./cloneDeep-C6NKQlMO.js","./dayjs.min-tKPc2Ebd.js","./index-DJ3sd9uB.css","./Tabs-ZZwx8VB9.js","./light-B52QuVq1.js","./toNumber-C7_OyJEx.js","./route-block-B_A1xBdJ.js"])))=>i.map(i=>d[i]);var xY=Object.defineProperty;var DY=(o,e,t)=>e in o?xY(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var Zt=(o,e,t)=>DY(o,typeof e!="symbol"?e+"":e,t);import{i as IY,d as EY,u as NY,a as TY,_ as RY}from"./vue-repl-jaFwbjhK.js";import{d as S1,o as uh,b as SF,e as MY,Q as yF,_ as nz,f as WC,al as AY,s as Rc,Y as PY,i as OY,c as BC,v as LF,t as zu,am as FY,S as WY,an as vW,h as bW,E as BY,w as Ui,q as Ci,u as Pt,g as YT,D as HY,a as CW,ae as VY,ao as zY,J as wW,k as UY,N as zE,p as $Y}from"./index-bVOhw2NF.js";import{_ as p0}from"./index.vue_vue_type_script_setup_true_lang-Q6sPmgzz.js";import{U as jY}from"./upload-DeP_4dQB.js";import{c as XT}from"./componentList-BKZexaIE.js";import{d as KY}from"./dashboard-YyjCL4ge.js";import{_ as qY,a as GY}from"./LayoutSider-DeJZf5oa.js";import{u as sz}from"./Scrollbar-Db3aKfvv.js";import{_ as ZY}from"./Input-CFQSA5NN.js";import{_ as YY}from"./FormItem-Cp_SJVoE.js";import{_ as XY}from"./Select-BpXzRZdb.js";import{_ as QY}from"./Checkbox-DAl6jmZx.js";import{_ as JY}from"./Form-BZRGTIxb.js";import"./helpers-CjmtV6uB.js";import"./common-CalHcBJp.js";import"./index-C8mAaM2V.js";import{B as eX}from"./Button-B7xQqa1N.js";import{N as tX}from"./Icon-C8ZbiYW7.js";import{_ as iX,a as nX}from"./Tabs-ZZwx8VB9.js";import{b as SW}from"./route-block-B_A1xBdJ.js";const sX={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},oX=MY("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"M328 112L184 256l144 144"},null,-1),rX=[oX],aX=S1({name:"ChevronBack",render:function(e,t){return uh(),SF("svg",sX,rX)}});function lX(){const o=(i,n)=>{n.addEventListener("message",i)},e=(i,n,s)=>{s.postMessage({type:i,data:n})};function t(i){var s;const n=(s=document.querySelector(".config-iframe"))==null?void 0:s.contentWindow;if(!n){yF(t.bind(null,i));return}o(r=>{const{type:a,data:l}=r.data;if(a==="inited"){const c=i.config;c?e("initConfig",c,n):e("initConfig",JSON.stringify({schemaInfo:{},modelInfo:{}}),n)}else a==="updateConfig"&&(i.config=l,window.$popmessage({str:"配置已更新",type:"success"}))},n)}return{init:t}}var yW={};function oz(){return globalThis._VSCODE_NLS_MESSAGES}function kF(){return globalThis._VSCODE_NLS_LANGUAGE}const cX=kF()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Sy(o,e){let t;return e.length===0?t=o:t=o.replace(/\{(\d+)\}/g,(i,n)=>{const s=n[0],r=e[s];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),cX&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(o,e,...t){return Sy(typeof o=="number"?rz(o,e):e,t)}function rz(o,e){var i;const t=(i=oz())==null?void 0:i[o];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${o} !!!`)}return t}function Ee(o,e,...t){let i;typeof o=="number"?i=rz(o,e):i=e;const n=Sy(i,t);return{value:n,original:e===i?n:Sy(e,t)}}function dX(o,e){const t=o;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const xt=window,yx=class yx{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}};yx.INSTANCE=new yx;let QT=yx;function az(o,e,t){typeof e=="string"&&(e=o.matchMedia(e)),e.addEventListener("change",t)}function hX(o){return QT.INSTANCE.getZoomFactor(o)}const hv=navigator.userAgent,mr=hv.indexOf("Firefox")>=0,pg=hv.indexOf("AppleWebKit")>=0,y1=hv.indexOf("Chrome")>=0,ed=!y1&&hv.indexOf("Safari")>=0,lz=!y1&&!ed&&pg;hv.indexOf("Electron/")>=0;const LW=hv.indexOf("Android")>=0;let RS=!1;if(typeof xt.matchMedia=="function"){const o=xt.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=xt.matchMedia("(display-mode: fullscreen)");RS=o.matches,az(xt,o,({matches:t})=>{RS&&e.matches||(RS=t)})}function uX(){return RS}function Hs(o){return typeof o=="string"}function an(o){return typeof o==
`+e.stack):new Error(e.message+`
`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const _z=new EX;function Pe(o){wr(o)||_z.onUnexpectedError(o)}function yi(o){wr(o)||_z.onUnexpectedExternalError(o)}function EW(o){if(o instanceof Error){const{name:e,message:t}=o,i=o.stacktrace||o.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:k_.isErrorNoTelemetry(o)}}return o}const ky="Canceled";function wr(o){return o instanceof jr?!0:o instanceof Error&&o.name===ky&&o.message===ky}class jr extends Error{constructor(){super(ky),this.name=this.message}}function NX(){const o=new Error(ky);return o.name=o.message,o}function ur(o){return o?new Error(`Illegal argument: ${o}`):new Error("Illegal argument")}function TF(o){return o?new Error(`Illegal state: ${o}`):new Error("Illegal state")}class TX extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class k_ extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof k_)return e;const t=new k_;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class ft extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,ft.prototype)}}function tR(o,e){if(typeof o=="number"){if(o===0)return null;const t=(o&65535)>>>0,i=(o&4294901760)>>>16;return i!==0?new UE([v0(t,e),v0(i,e)]):new UE([v0(t,e)])}else{const t=[];for(let i=0;i<o.length;i++)t.push(v0(o[i],e));return new UE(t)}}function v0(o,e){const t=!!(o&2048),i=!!(o&256),n=e===2?i:t,s=!!(o&1024),r=!!(o&512),a=e===2?t:i,l=o&255;return new td(n,s,r,a,l)}class td{constructor(e,t,i,n,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=s}equals(e){return e instanceof td&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}}class UE{constructor(e){if(e.length===0)throw ur("chords");this.chords=e}}class RX{constructor(e,t,i,n,s,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=s,this.keyAriaLabel=r}}class MX{}function AX(o){if(o.charCode){const t=String.fromCharCode(o.charCode).toUpperCase();return Dc.fromString(t)}const e=o.keyCode;if(e===3)return 7;if(mr)switch(e){case 59:return 85;case 60:if(ws)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Xe)return 57;break}else if(pg){if(Xe&&e===93)return 57;if(!Xe&&e===92)return 57}return pz[e]||0}const PX=Xe?256:2048,OX=512,FX=1024,WX=Xe?2048:256;class Tt{constructor(e){var i;this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(i=t.getModifierState)==null?void 0:i.call(t,"AltGraph"),this.keyCode=AX(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=PX),this.altKey&&(t|=OX),this.shiftKey&&(t|=FX),this.metaKey&&(t|=WX),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==
`).slice(2).join(``))}}class jX extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class KX extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class $E{constructor(e){this.value=e}}const qX=2;let B=class{constructor(e){var t,i,n,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new nR((e==null?void 0:e.onListenerError)??Pe,((i=this._options)==null?void 0:i.leakWarningThreshold)??$X):void 0,this._perfMon=(n=this._options)!=null&&n._profName?new iR(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||i.call(t),(n=this._leakageMon)==null||n.dispose())}get event(){return this._event??(this._event=(e,t,i)=>{var a,l,c,d,h;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);const g=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new KX(`${u}. HINT: Stack shows most frequent listener (${g[1]}-times)`,g[0]);return(((a=this._options)==null?void 0:a.onListenerError)||Pe)(f),V.None}if(this._disposed)return V.None;t&&(e=e.bind(t));const n=new $E(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=MF.create(),s=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof $E?(this._deliveryQueue??(this._deliveryQueue=new vz),this._listeners=[this._listeners,n]):this._listeners.push(n):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=n,(h=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||h.call(d,this)),this._size++;const r=be(()=>{s==null||s(),this._removeListener(n)});return i instanceof K?i.add(r):Array.isArray(i)&&i.push(r),r}),this._event}_removeListener(e){var s,r,a,l;if((r=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||r.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const n=this._deliveryQueue.current===this;if(this._size*qX<=t.length){let c=0;for(let d=0;d<t.length;d++)t[d]?t[c++]=t[d]:n&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=c}}_deliver(e,t){var n;if(!e)return;const i=((n=this._options)==null?void 0:n.onListenerError)||Pe;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,i,n,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)==null||i.stop()),(n=this._perfMon)==null||n.start(this._size),this._listeners)if(this._listeners instanceof $E)this._deliver(this._listeners,e);else{const r=this._deliveryQueue;r.enqueue(this,e,this._listeners.length),this._deliverQueue(r)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}};const GX=()=>new vz;class vz{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Ef extends B{constructor(e){super(e),this._isPaused=0,this._eventQueue=new fs,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._e
`+qi),qn&&(qi=na(qi,P," "),qi=na(qi,M," "),qi=na(qi,H," ")),C&&wm?C.createHTML(qi):qi},e.setConfig=function(We){Bv(We),un=!0},e.clearConfig=function(){kd=null,un=!1},e.isValidAttribute=function(We,Z,we){kd||Bv({});const Me=Ln(We),li=Ln(Z);return Dt(Me,li,we)},e.addHook=function(We,Z){typeof Z=="function"&&(z[We]=z[We]||[],Hv(z[We],Z))},e.removeHook=function(We){if(z[We])return MW(z[We])},e.removeHooks=function(We){z[We]&&(z[We]=[])},e.removeAllHooks=function(){z={}},e}var Gl=Iz();Gl.version;Gl.isSupported;const Ez=Gl.sanitize;Gl.setConfig;Gl.clearConfig;Gl.isValidAttribute;const Nz=Gl.addHook,Tz=Gl.removeHook;Gl.removeHooks;Gl.removeAllHooks;function Rz(o){return o}class yQ{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=Rz):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class BW{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=Rz):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}}class Fa{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function Mz(o){return!o||typeof o!="string"?!0:o.trim().length===0}const LQ=/{(\d+)}/g;function Nf(o,...e){return e.length===0?o:o.replace(LQ,function(t,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=e.length?t:e[n]})}function kQ(o){return o.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function Ob(o){return o.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function $o(o){return o.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function xQ(o,e=" "){const t=x1(o,e);return Az(t,e)}function x1(o,e){if(!o||!e)return o;const t=e.length;if(t===0||o.length===0)return o;let i=0;for(;o.indexOf(e,i)===i;)i=i+t;return o.substring(i)}function Az(o,e){if(!o||!e)return o;const t=e.length,i=o.length;if(t===0||i===0)return o;let n=i,s=-1;for(;s=o.lastIndexOf(e,n-1),!(s===-1||s+t!==n);){if(s===0)return"";n=s}return o.substring(0,n)}function DQ(o){return o.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function IQ(o){return o.replace(/\*/g,"")}function Pz(o,e,t={}){if(!o)throw new Error("Cannot create regex from empty string");e||(o=$o(o)),t.wholeWord&&(/\B/.test(o.charAt(0))||(o="\\b"+o),/\B/.test(o.charAt(o.length-1))||(o=o+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(o,i)}function EQ(o){return o.source==="^"||o.source==="^$"||o.source==="$"||o.source==="^\\s*$"?!1:!!(o.exec("")&&o.lastIndex===0)}function Zl(o){return o.split(/\r\n|\r|\n/)}function NQ(o){const e=[],t=o.split(/(\r\n|\r|\n)/);for(let i=0;i<Math.ceil(t.length/2);i++)e.push(t[2*i]+(t[2*i+1]??""));return e}function ss(o){for(let e=0,t=o.length;e<t;e++){const i=o.charCodeAt(e);if(i!==32&&i!==9)return e}return-1}function It(o,e=0,t=o.length){for(let i=e;i<t;i++){const n=o.charCodeAt(i);if(n!==32&&n!==9)return o.substring(e,i)}return o.substring(e,t)}function Ia(o,e=o.length-1){for(let t=e;t>=0;t--){const i=o.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function VC(o,e){return o<e?-1:o>e?1:0}function OF(o,e,t=0,i=o.length,n=0,s=e.length){for(;t<i&&n<s;t++,n++){const l=o.charCodeAt(t),c=e.charCodeAt(n);if(l<c)return-1;if(l>c)return 1}const r=i-t,a=s-n;return r<a?-1:r>a?1:0}function cR(o,e){return D1(o,e,0,o.length,0,e.length)}function D1(o,e,t=0,i=o.length,n=0,s=e.length){for(;t<i&&n<s;t++,n++){let l=o.charCodeAt(t),c=e.charCodeAt(n);if(l===c)continu
| KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=m("contextkey.parser.error.expectedButGot",`Expected: {0}Received: '{1}'.`,e,Uv.getLexeme(t)),s=t.offset,r=Uv.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:r,additionalInfo:i}),Dl._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}},Dl._parseError=new Error,Dl);const cW=class cW{static false(){return ys.INSTANCE}static true(){return zs.INSTANCE}static has(e){return nm.create(e)}static equals(e,t){return fv.create(e,t)}static notEquals(e,t){return fI.create(e,t)}static regex(e,t){return $C.create(e,t)}static in(e,t){return uI.create(e,t)}static notIn(e,t){return gI.create(e,t)}static not(e){return sm.create(e)}static and(...e){return cg.create(e,null,!0)}static or(...e){return Ic.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}};cW._parser=new tee({regexParsingWithErrorRecovery:!1});let G=cW;function iee(o,e){const t=o?o.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function Fb(o,e){return o.cmp(e)}const Ix=class Ix{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return zs.INSTANCE}};Ix.INSTANCE=new Ix;let ys=Ix;const Ex=class Ex{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return ys.INSTANCE}};Ex.INSTANCE=new Ex;let zs=Ex;class nm{static create(e,t=null){const i=Vn.get(e);return typeof i=="boolean"?i?zs.INSTANCE:ys.INSTANCE:new nm(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:cU(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Vn.get(this.key);return typeof e=="boolean"?e?zs.INSTANCE:ys.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=sm.create(this.key,this)),this.negated}}class fv{static create(e,t,i=null){if(typeof t=="boolean")return t?nm.create(e,i):sm.create(e,i);const n=Vn.get(e);return typeof n=="boolean"?t===(n?"true":"false")?zs.INSTANCE:ys.INSTANCE:new fv(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:om(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Vn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?zs.INSTANCE:ys.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=fI.create(this.key,this.value,this)),this.negated}}class uI{static create(e,t){return new uI(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:om(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?KJ.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=gI.create(this.key,this.valueKey)),this.negated}}class gI{static create(e,t){return new gI(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=uI.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}
* 'to': A mandatory logical position value providing where to move the cursor. \`\`\`
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine', 'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter' 'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter' 'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside' \`\`\`
* 'by': Unit to move. Default is computed based on 'to' value. \`\`\`
'line', 'wrappedLine', 'character', 'halfLine' \`\`\`
* 'value': Number of units to move. Default is '1'. * 'select': If 'true' makes the selection. Default is 'false'. `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},o.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},o.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case o.RawDirection.Left:n=0;break;case o.RawDirection.Right:n=1;break;case o.RawDirection.Up:n=2;break;case o.RawDirection.Down:n=3;break;case o.RawDirection.PrevBlankLine:n=4;break;case o.RawDirection.NextBlankLine:n=5;break;case o.RawDirection.WrappedLineStart:n=6;break;case o.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case o.RawDirection.WrappedLineColumnCenter:n=8;break;case o.RawDirection.WrappedLineEnd:n=9;break;case o.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case o.RawDirection.ViewPortTop:n=11;break;case o.RawDirection.ViewPortBottom:n=13;break;case o.RawDirection.ViewPortCenter:n=12;break;case o.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let s=0;switch(i.by){case o.RawUnit.Line:s=1;break;case o.RawUnit.WrappedLine:s=2;break;case o.RawUnit.Character:s=3;break;case o.RawUnit.HalfLine:s=4;break}return{direction:n,unit:s,select:!!i.select,value:i.value||1}}o.parse=t})(Uy||(Uy={}));var Wi;(function(o){o[o.None=0]="None",o[o.Indent=1]="Indent",o[o.IndentOutdent=2]="IndentOutdent",o[o.Outdent=3]="Outdent"})(Wi||(Wi={}));class lN{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1;break}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(e.getTokenCount()===0)return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const n=String.fromCharCode(i);if(!this.open.includes(n)&&!this.close.includes(n))return n}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class Iee{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)$v(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),$v(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),$v(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),$v(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&$v(this.autoClosingPairsCloseSingleChar,t.close,t)}}function $v(o,e,t){o.has(e)?o.get(e).pu
`,Ip.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
`;let LR=Ip;function tr(o,e=0){return o[o.length-(1+e)]}function Tee(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function Qt(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;i<n;i++)if(!t(o[i],e[i]))return!1;return!0}function Ree(o,e){const t=o.length-1;e<t&&(o[e]=o[t]),o.pop()}function qC(o,e,t){return Mee(o.length,i=>t(o[i],e))}function Mee(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function kR(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o<n.length?kR(o,n,t):o<n.length+r.length?r[0]:kR(o-(n.length+r.length),s,t)}function i7(o,e){const t=[];let i;for(const n of o.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function*i5(o,e){let t,i;for(const n of o)i!==void 0&&e(i,n)?t.push(n):(t&&(yield t),t=[n]),i=n;t&&(yield t)}function bU(o,e){for(let t=0;t<=o.length;t++)e(t===0?void 0:o[t-1],t===o.length?void 0:o[t])}function Aee(o,e){for(let t=0;t<o.length;t++)e(t===0?void 0:o[t-1],o[t],t+1===o.length?void 0:o[t+1])}function qr(o){return o.filter(e=>!!e)}function n7(o){let e=0;for(let t=0;t<o.length;t++)o[t]&&(o[e]=o[t],e+=1);o.length=e}function CU(o){return!Array.isArray(o)||o.length===0}function os(o){return Array.isArray(o)&&o.length>0}function sd(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function n5(o,e){return o.length>0?o[0]:e}function As(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function yI(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function cN(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function L0(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function xR(o,e){for(const t of e)o.push(t)}function s5(o){return Array.isArray(o)?o:[o]}function Pee(o,e,t){const i=wU(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r<s;r++)o[r+i]=t[r]}function s7(o,e,t,i){const n=wU(o,e);let s=o.splice(n,t);return s===void 0&&(s=[]),Pee(o,n,i),s}function wU(o,e){return e<0?Math.max(e+o.length,0):Math.min(e,o.length)}var GC;(function(o){function e(s){return s<0}o.isLessThan=e;function t(s){return s<=0}o.isLessThanOrEqual=t;function i(s){return s>0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(GC||(GC={}));function vs(o,e){return(t,i)=>e(o(t),o(i))}function Oee(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!GC.isNeitherLessOrGreaterThan(n))return n}return GC.neitherLessOrGreaterThan}}const $r=(o,e)=>o-e,Fee=(o,e)=>$r(o?1:0,e?1:0);function SU(o){return(e,t)=>-o(e,t)}class od{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const Ep=class Ep{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Ep(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Ep(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||GC.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}};Ep.empty=new Ep(e
`){const r=[];for(let a=0,l=i.length;a<l;a++)r[a]=this._enter(e,t,!1,i[a]);return new Us(4,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}static _enter(e,t,i,n){if(e.autoIndent===0)return Ru(n,``,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),c=It(l).substring(0,n.startColumn-1);return Ru(n,``+e.normalizeIndentation(c),i)}const s=jp(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===Wi.None)return Ru(n,``+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Wi.Indent)return Ru(n,``+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Wi.IndentOutdent){const l=e.normalizeIndentation(s.indentation),c=e.normalizeIndentation(s.indentation+s.appendText),d=``+c+``+l;return i?new zS(n,d,!0):new Hy(n,d,-1,c.length-l.length,!0)}else if(s.indentAction===Wi.Outdent){const l=Gy(e,s.indentation);return Ru(n,``+e.normalizeIndentation(l+s.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=It(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=Lte(e.autoIndent,t,n,{unshiftIndent:c=>Gy(e,c),shiftIndent:c=>u5(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,h=t.getLineContent(n.endLineNumber),u=ss(h);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new zS(n,``+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return d<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),g=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new Hy(n,``+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return Ru(n,``+e.normalizeIndentation(a),i)}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){let a=i[s].positionLineNumber;if(a===1)n[s]=new zS(new k(1,1,1,1),``);else{a--;const l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new k(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s].positionLineNumber,l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new k(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class Mte{static getEdits(e,t,i,n,s,r){const a=this._distributePasteToCursors(e,i,n,s,r);return a?(i=i.sort(k.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,s)}static _distributePasteToCursors(e,t,i,n,s){if(n||t.length===1)return null;if(s&&s.length===t.length)return s;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substring(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substring(0,i.length-1));const r=Zl(i);if(r.length===t.length)return r}return null}static _distributedPaste(e,t,i,n){const s=[];for(let r=0,a=i.length;r<a;r++)s[r]=new Nn(i[r],n[r]);return new Us(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,s){const r=[];for(let a=0,l=i.length;a<l;a++){const c=i[a],d=c.getPosition();if(s&&!c.isEmpty()&&(s=!1),s&&n.indexOf(``)!==n.length-1&&(s=!1),s){const h=new k(d.lineNumber,1,d.lineNumber,1);r[a]=new QF(h,n,c,!0)}else r[a]=new Nn(c,n)}return new Us(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Ate{static getEdits(e,t,i,n,s,r,a,l){const c=n.map(d=>this._compositionType(i,d,s,r,a,l));return new Us(4,c,{shouldPushStackElementBefore:II(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),d=new k(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new Hy(d,i,0,r)}}class Pte{static getEdits(e,t,i){const n=[];for(let r=0,a=t.length;r<a;r++)n[r]=new Nn(t[r],i);const s=h5(i,e);return new Us(s,n,{shouldPushStackElementBefore:II(e,s),shouldPushStackElementAfter:!1})}}class Ote{static getCommands(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let c=this._goodIndentForLine(e,t,a.startLineNumber);c=c||" ";const d=e.normalizeIndentation(c);if(!l.startsWith(d)){n[s]=new Nn(new k(a.startLineNumber,1,a.startLineNumber,l.length+1),d,!0);continue}}n[s]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){n[s]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[s]=new vr(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static _goodIndentForLine(e,t,i){let n=null,s="";const r=ZC(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,s=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Ia(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=jp(e.autoIndent,t,new k(a,l,a,l),e.languageConfigurationService);c&&(s=c.indentation+c.appendText)}return n&&(n===Wi.Indent&&(s=u5(e,s)),n===Wi.Outdent&&(s=Gy(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;d<c;d++)s+=" "}else s=" ";return new Nn(i,s,n)}}class d5 extends Hy{constructor(e,t,i,n,s,r){super(e,t,i,n),this._openCharacter=s,this._closeCharacter=r,this.closeCharacterRange=null,this.enclosingRange=null}_computeCursorStateWithRange(e,t,i){return this.closeCharacterRange=new k(t.startLineNumber,t.endColumn-this._closeCharacter.length,t.endLineNumber,t.endColumn),this.enclosingRange=new k(t.startLineNumber,t.endColumn-this._openCharacter.length-this._closeCharacter.length,t.endLineNumber,t.endColumn),super.computeCursorState(e,i)}}class Fte extends d5{constructor(e,t,i,n){const s=(i?t:"")+n,r=0,a=-n.length;super(e,s,r,a,t,n)}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this._computeCursorStateWithRange(e,n,t)}}class Wte extends d5{constructor(e,t,i,n){const s=i+n,r=0,a=i.length;super(t,s,r,a,i,n),this._autoIndentationEdit=e,this._autoClosingEdit={range:t,text:s}}getEditOperations(e,t){t.addTrackedEditOperation(this._autoIndentationEdit.range,this._autoIndentationEdit.text),t.addTrackedEditOperation(this._autoClosingEdit.range,this._autoClosingEdit.text)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length!==2)throw new Error("There should be two inverse edit operations!");const n=i[0].range,s=i[1].range,r=n.plusRange(s);return this._computeCursorStateWithRange(e,r,t)}}function h5(o,e){return o===" "?e===5||e===6?6:5:4}function II(o,e){return v7(o)&&!v7(e)?!0:o===5?!1:_7(o)!==_7(e)}function _7(o){return o===6||o===5?"space":o}function v7(o){return o===4||o===5||o===6}function OU(o,e,t,i,n){if(o.autoClosingOvertype==="never"||!o.autoClosingPairs.autoClosingPairsCloseSingleChar.has(n))return!1;for(let s=0,r=t.length;s<r;s++){const a=t[s];if(!a.isEmpty())ret
- Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class pie extends Gt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:m("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:m("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[m("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),m("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),m("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:m("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:m("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:m("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:m("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:m("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:m("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:m("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:m("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:m("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:m("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),autohide:ve(t.autohide,this.defaultValue.autohide),size:ui(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:ui(t.side,this.defaultValue.side,["right","left"]),showSlider:ui(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ve(t.renderCharacters,this.defaultValue.renderCharacters),scale:Nt.clampedInt(t.scale,1,1,3),maxColumn:Nt.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:ve(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:ve(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:Wo.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:Wo.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function _ie(o){return o==="ctrlCmd"?Xe?"metaKey":"ctrlKey":"altKey"}class vie extends Gt{constructor(){super(8
`)}}const TI=new sne;ri.add($U.ColorContribution,TI);function E(o,e,t,i,n){return TI.registerColor(o,e,t,i,n)}function one(o,e){var t,i,n,s;switch(o.op){case 0:return(t=ra(o.value,e))==null?void 0:t.darken(o.factor);case 1:return(i=ra(o.value,e))==null?void 0:i.lighten(o.factor);case 2:return(n=ra(o.value,e))==null?void 0:n.transparent(o.factor);case 3:{const r=ra(o.background,e);return r?(s=ra(o.value,e))==null?void 0:s.makeOpaque(r):ra(o.value,e)}case 4:for(const r of o.values){const a=ra(r,e);if(a)return a}return;case 6:return ra(e.defines(o.if)?o.then:o.else,e);case 5:{const r=ra(o.value,e);if(!r)return;const a=ra(o.background,e);return a?r.isDarkerThan(a)?Y.getLighterColor(r,a,o.factor).transparent(o.transparency):Y.getDarkerColor(r,a,o.factor).transparent(o.transparency):r.transparent(o.factor*o.transparency)}default:throw CI()}}function am(o,e){return{op:0,value:o,factor:e}}function Na(o,e){return{op:1,value:o,factor:e}}function Ue(o,e){return{op:2,value:o,factor:e}}function JC(...o){return{op:4,values:o}}function rne(o,e,t){return{op:6,if:o,then:e,else:t}}function y7(o,e,t,i){return{op:5,value:o,background:e,factor:t,transparency:i}}function ra(o,e){if(o!==null){if(typeof o=="string")return o[0]==="#"?Y.fromHex(o):e.getColor(o);if(o instanceof Y)return o;if(typeof o=="object")return one(o,e)}}const jU="vscode://schemas/workbench-colors",KU=ri.as(xI.JSONContribution);KU.registerSchema(jU,TI.getColorSchema());const L7=new Lt(()=>KU.notifySchemaChanged(jU),200);TI.onDidChangeSchema(()=>{L7.isScheduled()||L7.schedule()});const Ge=E("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},m("foreground","Overall foreground color. This color is only used if not overridden by a component."));E("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},m("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));E("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},m("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));E("descriptionForeground",{light:"#717171",dark:Ue(Ge,.7),hcDark:Ue(Ge,.7),hcLight:Ue(Ge,.7)},m("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Xy=E("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m("iconForeground","The default color for icons in the workbench.")),Hl=E("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},m("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),rt=E("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Kt=E("contrastActiveBorder",{light:null,dark:null,hcDark:Hl,hcLight:Hl},m("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));E("selection.background",null,m("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const ane=E("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},m("textLinkForeground","Foreground color for links in text."));E("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},m("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));E("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:Y.black,hcLight:"#292929"},m("textSeparatorForeground","Color for text separators."));E("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},m("textPreformatForeground","Foreground color for preformatted text segments."));E("textPreformat.bac
${a}: ${r};`}return i+=`}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function Gse(o){return o.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class A1 extends V{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const s=e[i];switch(s.type){case 0:this.onCompositionStart(s)&&(t=!0);break;case 1:this.onCompositionEnd(s)&&(t=!0);break;case 2:this.onConfigurationChanged(s)&&(t=!0);break;case 3:this.onCursorStateChanged(s)&&(t=!0);break;case 4:this.onDecorationsChanged(s)&&(t=!0);break;case 5:this.onFlushed(s)&&(t=!0);break;case 6:this.onFocusChanged(s)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(s)&&(t=!0);break;case 8:this.onLineMappingChanged(s)&&(t=!0);break;case 9:this.onLinesChanged(s)&&(t=!0);break;case 10:this.onLinesDeleted(s)&&(t=!0);break;case 11:this.onLinesInserted(s)&&(t=!0);break;case 12:this.onRevealRangeRequest(s)&&(t=!0);break;case 13:this.onScrollChanged(s)&&(t=!0);break;case 15:this.onTokensChanged(s)&&(t=!0);break;case 14:this.onThemeChanged(s)&&(t=!0);break;case 16:this.onTokensColorsChanged(s)&&(t=!0);break;case 17:this.onZonesChanged(s)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(s)}}t&&(this._shouldRender=!0)}}class wo extends A1{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class Ba{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=i[n-r-1];return s}}class Zse{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class Yse extends Zse{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class Xse{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class BI{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const s=e[i];t[i]=new BI(s.left,s.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toStrin
target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?$i.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Qn.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Qn.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return Qn.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return Qn.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Qn.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Qn.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Qn.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Qn.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Qn.createOverlayWidget(this.target,this._getMouseColumn(),e)}}const O7={isAfterLines:!0};function vN(o){return{isAfterLines:!1,horizontalDistanceToText:o}}class Xn{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=Ba.collect(t,this._viewHelper.viewDomNode);return!!(ls.isChildOfContentWidgets(i)||ls.isChildOfOverflowingContentWidgets(i)||ls.isChildOfOverlayWidgets(i)||ls.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){const r=new M_(this._context,this._viewHelper,e),a=new _oe(r,t,i,n,s);try{const l=Xn._createMouseTarget(r,a);if(l.type===6&&r.stickyTabStops&&l.position!==null){const c=Xn._snapToSoftTabBoundary(l.position,r.viewModel),d=k.fromPositions(c,c).plusRange(l.range);return a.fulfillContentText(c,d,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t){if(t.target===null)return t.fulfillUnknown();const i=t;let n=null;return!ls.isChildOfOverflowGuard(t.targetPath)&&!ls.isChildOfOverflowingContentWidgets(t.targetPath)&&!ls.isChildOfOverflowingOverlayWidgets(t.targetPath)&&(n=n||t.fulfillUnknown()),n=n||Xn._hitTestContentWidget(e,i),n=n||Xn._hitTestOverlayWidget(e,i),n=n||Xn._hitTestMinimap(e,i),n=n||Xn._hitTestScrollbarSlider(e,i),n=n||Xn._hitTestViewZone(e,i),n=n||Xn._hitTestMargin(e,i),n=n||Xn._hitTestViewCursor(e,i),n=n||Xn._hitTestTextArea(e,i),n=n||Xn._hitTestViewLines(e,i),n=n||Xn._hitTestScrollbar(e,i),n||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(ls.isChildOfContentWidgets(t.targetPath)||ls.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(ls.isChildOfOverlayWidgets(t.targetPath)||ls.isChildOfOverflowingOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const n of i)if(t.target===n.domNode)return t.fulfillContentText(n.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,s=t.mouseVerticalOffset;for(const r of i){if(n<r.contentLeft||n>r.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=s&&s<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return ls.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillConten
`,s+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(zh(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(xy(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const r=t.value.substring(n,t.value.length-s),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,d=t.selectionEnd-n;if(c===d){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(zh(e.value,t.value),e.selectionEnd),n=Math.min(xy(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-r.length}}};Tp.EMPTY=new Tp("",0,0,null,void 0);let Jn=Tp;class rp{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,s=i+t;return new k(n,1,s+1,1)}static fromEditorSelection(e,t,i,n){const r=rp._getPageOfLine(t.startLineNumber,i),a=rp._getRangeForPage(r,i),l=rp._getPageOfLine(t.endLineNumber,i),c=rp._getRangeForPage(l,i);let d=a.intersectRanges(new k(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=k.fromPositions(v,d.getEndPosition())}const h=e.getValueInRange(d,1),u=e.getLineCount(),g=e.getLineMaxColumn(u);let f=c.intersectRanges(new k(t.endLineNumber,t.endColumn,u,g));if(n&&e.getValueLengthInRange(f,1)>500){const v=e.modifyPosition(f.getStartPosition(),500);f=k.fromPositions(f.getStartPosition(),v)}const p=e.getValueInRange(f,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+"…"+e.getValueInRange(b,1)}return n&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new Jn(h+_+p,h.length,h.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var Poe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},B7=function(o,e){return function(t,i){e(t,i,o)}},nL;(function(o){o.Tap="-monaco-textarea-synthetic-tap"})(nL||(nL={}));const ZR={forceCopyWithSyntaxHighlighting:!1},Px=class Px{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}};Px.INSTANCE=new Px;let rw=Px;class Ooe{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let YR=class extends V{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,s,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=s,this._logService=r,this._onFocus=this._register(new B),this.onFocus=this._onFocus.event,this._onBlur=this._register(new B),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new B),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new B),this.onCut=this._onCut.event,this._onPaste=this._register(new B),this.onPaste=this._onPaste.event,this._onType=this._regis
`):t.text,i),e.preventDefault(),e.clipboardData&&XR.setTextData(e.clipboardData,t.text,t.html,i)}};YR=Poe([B7(4,Co),B7(5,Pn)],YR);const XR={getTextData(o){const e=o.getData(wi.text);let t=null;const i=o.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&o.files.length>0?[Array.prototype.slice.call(o.files,0).map(s=>s.name).join(``),null]:[e,t]},setTextData(o,e,t,i){o.setData(wi.text,e),typeof t=="string"&&o.setData("text/html",t),o.setData("vscode-editor-data",JSON.stringify(i))}};class Foe extends V{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Je(this._actual,"keydown")).event,this.onKeyUp=this._register(new Je(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Je(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Je(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Je(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Je(this._actual,"beforeinput")).event,this.onInput=this._register(new Je(this._actual,"input")).event,this.onCut=this._register(new Je(this._actual,"cut")).event,this.onCopy=this._register(new Je(this._actual,"copy")).event,this.onPaste=this._register(new Je(this._actual,"paste")).event,this.onFocus=this._register(new Je(this._actual,"focus")).event,this.onBlur=this._register(new Je(this._actual,"blur")).event,this._onSyntheticTap=this._register(new B),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>eh.onKeyDown())),this._register(this.onBeforeInput(()=>eh.onBeforeInput())),this._register(this.onInput(()=>eh.onInput())),this._register(this.onKeyUp(()=>eh.onKeyUp())),this._register($(this._actual,nL.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Rf(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?Rn()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const r=Rf(n);r?s=r.activeElement:s=Rn();const a=ke(s),l=s===n,c=n.selectionStart,d=n.selectionEnd;if(l&&c===t&&d===i){mr&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),mr&&a.parent!==a&&n.focus();return}try{const h=TJ(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),RJ(n,h)}catch{}}}class Woe extends E5{constructor(e,t,i){super(e,t,i),this._register(zn.addTarget(this.viewHelper.linesContentDomNode)),this._register($(this.viewHelper.linesContentDomNode,Mt.Tap,s=>this.onTap(s))),this._register($(this.viewHelper.linesContentDomNode,Mt.Change,s=>this.onChange(s))),this._register($(this.viewHelper.linesContentDomNode,Mt.Contextmenu,s=>this._onContextMenu(new Gh(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register($(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const r=s.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new jse(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(s,r)=>this._onMouseDown(s,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatch
`),w=b.substring(C+1),S=w.lastIndexOf(" "),L=w.length-S-1,x=f.getStartPosition(),D=Math.min(x.column-1,L),N=x.column-1-D,z=w.substring(0,w.length-D),{tabSize:P}=this._context.viewModel.model.getOptions(),M=Pre(this.textArea.domNode.ownerDocument,z,this._fontInfo,P);return{distanceToModelLineStart:N,widthOfHiddenTextBefore:M}})(),{distanceToModelLineEnd:v}=(()=>{const b=g.value.substring(Math.max(g.selectionStart,g.selectionEnd)),C=b.indexOf(``),w=C===-1?b:b.substring(0,C),S=w.indexOf(" "),L=S===-1?w.length:w.length-S-1,x=f.getEndPosition(),D=Math.min(this._context.viewModel.model.getLineMaxColumn(x.lineNumber)-x.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(x.lineNumber)-x.column-D}})();this._context.viewModel.revealRange("keyboard",!0,k.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Are(this._context,f.startLineNumber,p,_,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Yp} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${Yp}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(Hb.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=_r(t,[]);let s=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(s||a);){if(s&&r<=1&&(s=!1),s){const d=i.charCodeAt(r-2);n.get(d)!==0?s=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);n.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=_r(this._context.configuration.options.get(132),[]);let n=e.column,s=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Yi(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var i,n,s;if(e.get(2)===1){const r=(i=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))==null?void 0:i.getAriaLabel(),a=(n=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))==null?void 0:n.getAriaLabel(),l=(s=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))==null?void 0:s.getAriaLabel(),c=m("accessibilityModeOff","The editor is not accessible at this time.");return r?m("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,r):a?m("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?m("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===ja.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(146).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const s=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=CN?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(146);this._setAccessibilityOptions(t),this._contentLeft=i.cont`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:CN?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;yn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?Y.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(57)?i.setClassName("monaco-editor-background textAreaCover "+oL.OUTER_CLASS_NAME):n.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+sL.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};iM=Mre([V7(3,vt),V7(4,Ce)],iM);function Pre(o,e,t,i){if(e.length===0)return 0;const n=o.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const s=o.createElement("span");yn(s,t),s.style.whiteSpace="pre",s.style.tabSize=`${i*t.spaceWidth}px`,s.append(e),n.appendChild(s),o.body.appendChild(n);const r=s.offsetWidth;return n.remove(),r}class Ore{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){nn.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new F(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(78)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(78)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=ws&&t.get(108),n=t.get(22);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){nn.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){nn.MoveToSelect.r
`?(t++,i=0):i++;return new Bd(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}createRange(e){return this.lineCount===0?new k(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new k(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new F(e.lineNumber,e.column+this.columnCount):new F(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};Bd.zero=new Bd(0,0);let Yr=Bd;function Xae(o,e,t,i){return o!==t?Mi(t-o,i):Mi(0,i-e)}const ps=0;function uL(o){return o===0}const Ho=2**26;function Mi(o,e){return o*Ho+e}function gr(o){const e=o,t=Math.floor(e/Ho),i=e-t*Ho;return new Yr(t,i)}function Qae(o){return Math.floor(o/Ho)}function mi(o,e){let t=o+e;return e>=Ho&&(t=t-o%Ho),t}function Jae(o,e){return o.reduce((t,i)=>mi(t,e(i)),ps)}function j$(o,e){return o===e}function vw(o,e){const t=o,i=e;if(i-t<=0)return ps;const s=Math.floor(t/Ho),r=Math.floor(i/Ho),a=i-r*Ho;if(s===r){const l=t-s*Ho;return Mi(0,a-l)}else return Mi(r-s,a)}function Jp(o,e){return o<e}function e_(o,e){return o<=e}function _b(o,e){return o>=e}function lp(o){return Mi(o.lineNumber-1,o.column-1)}function kg(o,e){const t=o,i=Math.floor(t/Ho),n=t-i*Ho,s=e,r=Math.floor(s/Ho),a=s-r*Ho;return new k(i+1,n+1,r+1,a+1)}function ele(o){const e=Zl(o);return Mi(e.length-1,e[e.length-1].length)}class Wc{static fromModelContentChanges(e){return e.map(i=>{const n=k.lift(i.range);return new Wc(lp(n.getStartPosition()),lp(n.getEndPosition()),ele(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${gr(this.startOffset)}...${gr(this.endOffset)}) -> ${gr(this.newLength)}`}}class tle{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>F5.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:vw(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Mi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Mi(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=gr(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Mi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Mi(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(e_(i,e)){this.nextEditIdx++;const n=gr(i),s=gr(this.translateOldToCur(t.endOffsetBeforeObj)),r=n.lineCount-s.lineCount;this.deltaOldToNewLineCount+=r;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=n.columnCount-s.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class F5{static from(e){return new F5(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=gr(t),this.endOffsetAfterObj=gr(mi(e,i)),this.offsetObj=gr(e)}}const N0=[],ir=class ir{static create(e,t){if(e<=128&&t.length===0){let i=ir.cache[e];return i||(i=new ir(e,t),ir.cache[e]=i),i}return new ir(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let n=i>>5;if(n===0){const r=1<<i|this.items;return r===this.items?this:ir.create(r,this.additionalItems)}n--;const s=this.additionalItems.slice(0);for(;s.length<n;)s.push(0);return s[n]|=1<<(i&31),ir.create(this.items,s)}merge(e){const t=this.items|e.items;if(this.additionalItems===N0&&e.additionalItems===N0)return t===this.items?this:t===e.items?e:ir.create(t,N0);const i=[];for(let n=0;n<Math.max(
`,"gi"):null,s=[];let r,a=0,l=0,c=0,d=0;const h=[];for(let f=0;f<60;f++)h.push(new Kd(Mi(0,f),0,-1,ro.getEmpty(),new qu(Mi(0,f))));const u=[];for(let f=0;f<60;f++)u.push(new Kd(Mi(1,f),0,-1,ro.getEmpty(),new qu(Mi(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,p=r[0];if(p===``)a++,l=f+1;else{if(c!==f){let _;if(d===a){const v=f-c;if(v<h.length)_=h[v];else{const b=Mi(0,v);_=new Kd(b,0,-1,ro.getEmpty(),new qu(b))}}else{const v=a-d,b=f-l;if(v===1&&b<u.length)_=u[b];else{const C=Mi(v,b);_=new Kd(C,0,-1,ro.getEmpty(),new qu(C))}}s.push(_)}s.push(t.getToken(p)),c=f+p.length,d=a}}const g=e.length;if(c!==g){const f=d===a?Mi(0,g-c):Mi(a-d,g-l);s.push(new Kd(f,0,-1,ro.getEmpty(),new qu(f)))}this.length=Mi(a,g-l),this.tokens=s}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new TX}}class H5{static createFromLanguage(e,t){function i(s){return t.getKey(`${s.languageId}:::${s.bracketText}`)}const n=new Map;for(const s of e.bracketsNew.openingBrackets){const r=Mi(0,s.bracketText.length),a=i(s),l=ro.getEmpty().add(a,nB);n.set(s.bracketText,new Kd(r,1,a,l,fL.create(r,s,l)))}for(const s of e.bracketsNew.closingBrackets){const r=Mi(0,s.bracketText.length);let a=ro.getEmpty();const l=s.getOpeningBrackets();for(const c of l)a=a.add(i(c),nB);n.set(s.bracketText,new Kd(r,2,i(l[0]),a,fL.create(r,s,a)))}return new H5(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>lle(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function lle(o){let e=$o(o);return/^[\w ]+/.test(o)&&(e=`\\b${e}`),/[\w ]+$/.test(o)&&(e=`${e}\\b`),e}class G${constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=H5.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function cle(o){if(o.length===0)return null;if(o.length===1)return o[0];let e=0;function t(){if(e>=o.length)return null;const r=e,a=o[r].listHeight;for(e++;e<o.length&&o[e].listHeight===a;)e++;return e-r>=2?Z$(r===0&&e===o.length?o:o.slice(r,e),!1):o[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())sB(i,n)<=sB(n,r)?(i=DN(i,n),n=r):n=DN(n,r);return DN(i,n)}function Z$(o,e=!1){if(o.length===0)return null;if(o.length===1)return o[0];let t=o.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const s=n<<1;o[n]=zl.create23(o[s],o[s+1],s+3===t?o[s+2]:null,e)}t=i}return zl.create23(o[0],o[1],t>=3?o[2]:null,e)}function sB(o,e){return Math.abs(o.listHeight-e.listHeight)}function DN(o,e){return o.listHeight===e.listHeight?zl.create23(o,e,null,!1):o.listHeight>e.listHeight?dle(o,e):hle(e,o)}function dle(o,e){o=o.toMutable();let t=o;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=zl.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?zl.create23(o,n,null,!1):o}function hle(o,e){o=o.toMutable();let t=o;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=zl.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?zl.create23(n,o,null,!1):o}class ule{constructor(e){this.lastOffset=ps,this.nextNodes=[e],this.offsets=[ps],this.idxs=[]}readLongestNodeAt(e,t){if(Jp(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=Gv(this.nextNodes);if(!i)return;const n=Gv(this.offsets);if(Jp(e,n))return;if(Jp(n,e))if(mi(n,i.length)<=e)this.nextNodeAf
`?0:1}function kc(o){return o?o instanceof tj||o instanceof Ile:!1}class V5{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);kc(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);kc(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(kc(i)&&i.canAppend(this._model))return i;const n=new tj(m("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],mM(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const s=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=V5._computeCursorState(i,r),l=r.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),s.append(this._model,l.map(c=>c.textChange),mM(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Pe(i),null}}}class Ele{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Nle(o,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s<e&&s<i;s++){const u=o.charCodeAt(s),g=t.charCodeAt(s);if(u!==g)break}let r=0,a=0;for(let u=s;u<e;u++)o.charCodeAt(u)===32?r++:a++;let l=0,c=0;for(let u=s;u<i;u++)t.charCodeAt(u)===32?l++:c++;if(r>0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),h=Math.abs(r-l);if(d===0){n.spacesDiff=h,h>0&&0<=l-1&&l-1<o.length&&l<t.length&&t.charCodeAt(l)!==32&&o.charCodeAt(l-1)===32&&o.charCodeAt(o.length-1)===44&&(n.looksLikeAlignment=!0);return}if(h%d===0){n.spacesDiff=h/d;return}}function dB(o,e,t){const i=Math.min(o.getLineCount(),1e4);let n=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],c=8,d=[0,0,0,0,0,0,0,0,0],h=new Ele;for(let f=1;f<=i;f++){const p=o.getLineLength(f),_=o.getLineContent(f),v=p<=65536;let b=!1,C=0,w=0,S=0;for(let x=0,D=p;x<D;x++){const N=v?_.charCodeAt(x):o.getLineCharCode(f,x);if(N===9)S++;else if(N===32)w++;else{b=!0,C=x;break}}if(!b||(S>0?n++:w>1&&s++,Nle(r,a,_,C,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const L=h.spacesDiff;L<=c&&d[L]++,r=_,a=C}let u=t;n!==s&&(u=n<s);let g=e;if(u){let f=u?0:.1*i;l.forEach(p=>{const _=d[p];_>f&&(f=_,g=p)}),g===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function Ms(o){return(o.metadata&1)>>>0}function Ut(o,e){o.metadata=o.metadata&254|e<<0}function Mn(o){return(o.metadata&2)>>>1===1}function Bt(o,e){o.metadata=o.metadata&253|(e?1:0)<<1}function ij(o){return(o.metadata&4)>>>2===1}function hB(o,e){o.metadata=o.metadata&251|(e?1:0)<<2}function nj(o){return(o.metadata&64)>>>6===1}function uB(o,e){o.metadata=o.metadata&191|(e?1:0)<<6}function Tle(o){return(o.metadata&24)>>>3}function gB(o,e){o.metadata=o.metadata&231|e<<3}function Rle(o){return(o.metadata&32)>>>5===1}function fB(o,e){o.metadata=o.metadata&223|(e?1:0)<<5}class sj{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Ut(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,hB(this,!1),uB(this,!1),gB(this,1),fB(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Bt(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;hB(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),uB(this,this.options.glyphMarginClassName!==null),gB(this,this.options.stickiness),fB(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd
`)>=0;let t=null;try{t=Pz(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Gre(t,this.wordSeparators?_r(this.wordSeparators,[]):null,i?this.searchString:null)}}function jle(o){if(!o||o.length===0)return!1;for(let e=0,t=o.length;e<t;e++){const i=o.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const n=o.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function Gu(o,e,t){if(!t)return new hw(o,null);const i=[];for(let n=0,s=e.length;n<s;n++)i[n]=e[n];return new hw(o,i)}class vB{constructor(e){const t=[];let i=0;for(let n=0,s=e.length;n<s;n++)e.charCodeAt(n)===10&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(n===-1||e<=t[0])return 0;for(;i<n;){const s=i+((n-i)/2>>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class A0{static findMatches(e,t,i,n,s){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new cp(r.wordSeparators,r.regex),n,s):this._doFindMatchesLineByLine(e,i,r,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let c;if(n){const g=n.findLineFeedCountBeforeOffset(s+r.length)-l;c=a+r.length+g}else c=a+r.length;const d=e.getPositionAt(a),h=e.getPositionAt(c);return new k(d.lineNumber,d.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,s){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r`?new vB(a):null,c=[];let d=0,h;for(i.reset(0);h=i.next(a);)if(c[d++]=Gu(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n),d>=s)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,s){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,s),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,s);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<s;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,r,n,s);if(a<s){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,r,n,s)}return r}static _findMatchesInLine(e,t,i,n,s,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const u=e.simpleSearch,g=u.length,f=t.length;let p=-g;for(;(p=t.indexOf(u,p+g))!==-1;)if((!c||j5(c,t,f,p,g))&&(r[s++]=new hw(new k(i,p+1+n,i,p+1+g+n),null),s>=l))return s;return s}const d=new cp(e.wordSeparators,e.regex);let h;d.reset(0);do if(h=d.next(t),h&&(r[s++]=Gu(new k(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),s>=l))return s;while(h);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new cp(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new F(t.lineNumber,1),r=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new k(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r`?new vB(l):null;i.reset(t.column-1);const d=i.next(l);return d?Gu(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new F(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=s;c++){const d=(r+c-1)%s,h=e.getLineContent(d+1),u=this._findFirstMatchInLine(i,h,d+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const r=e.next(t);return r?Gu(new k(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new cp(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new k(1,1,t.lineNumber,t.column),i,n,10*$le);if(s.length>0)return s[s.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new F(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=s;c++){const d=(s+r-c-1)%s,h=e.getLineContent(d+1),u=this._findLastMatchInLine(i,h,d+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let s=null,r;for(e.reset(0);r=e.next(t);)s=Gu(new k(i,r.index+1,i,r.index+1+r[0].length),r,n);return s}}function Kle(o,e,t,i,n){if(i===0)return!0;const s=e.charCodeAt(i-1);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i);if(o.get(r)!==0)return!0}return!1}function qle(o,e,t,i,n){if(i+n===t)return!0;const s=e.charCodeAt(i+n);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(o.get(r)!==0)return!0}return!1}function j5(o,e,t,i,n){return Kle(o,e,t,i,n)&&qle(o,e,t,i,n)}class cp{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){Dy(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||j5(this._wordSeparators,e,t,n,s))return i}while(i);return null}}const rc=65535;function aj(o){let e;return o[o.length-1]<65536?e=new Uint16Array(o.length):e=new Uint32Array(o.length),e.set(o,0),e}class Gle{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function uc(o,e=!0){const t=[0];let i=1;for(let n=0,s=o.length;n<s;n++){const r=o.charCodeAt(n);r===13?n+1<s&&o.charCodeAt(n+1)===10?(t[i++]=n+2,n++):t[i++]=n+1:r===10&&(t[i++]=n+1)}return e?aj(t):t}function Zle(o,e){o.length=0,o[0]=0;let t=1,i=0,n=0,s=0,r=!0;for(let l=0,c=e.length;l<c;l++){const d=e.charCodeAt(l);d===13?l+1<c&&e.charCodeAt(l+1)===10?(s++,o[t++]=l+2,l++):(i++,o[t++]=l+1):d===10?(n++,o[t++]=l+1):r&&d!==9&&(d<32||d>126)&&(r=!1)}const a=new Gle(aj(o),i,n,s,r);return o.length=0,a}class Xs{constructor(e,t,i,n,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=s}}class Zu{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Yle{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==He&&e.iterate(e.root,i=>(i!==He&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pi
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const p=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,p),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let g=n;for(let f=0;f<u.length;f++)g=this.rbInsertRight(g,u[f]);this.deleteNodes(d)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let s=this.rbInsertLeft(null,n[0]);for(let r=1;r<n.length;r++)s=this.rbInsertRight(s,n[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===He)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,r=n.node;if(s===r){const u=this.positionInBuffer(s,i.remainder),g=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const f=s.next();M0(this,s),this.validateCRLFWithPrevNode(f),this.computeBufferMetadata();return}this.deleteNodeHead(s,g),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),this.computeBufferMetadata();return}if(i.nodeStartOffset+s.piece.length===e+t){this.deleteNodeTail(s,u),this.validateCRLFWithNextNode(s),this.computeBufferMetadata();return}this.shrinkNode(s,u,g),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,l),this._searchCache.validate(e),s.piece.length===0&&a.push(s);const c=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,c),r.piece.length===0&&a.push(r);const d=s.next();for(let u=d;u!==He&&u!==r;u=u.next())a.push(u);const h=s.piece.length===0?s.prev():s;this.deleteNodes(a),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const r=t.piece,a={line:r.start.line+1,column:0},l=new Xs(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+=``,hc(this,t,-1,-1),t.piece.length===0&&i.push(t)}const n=this.createNewPieces(e);let s=this.rbInsertLeft(t,n[n.length-1]);for(let r=n.length-2;r>=0;r--)s=this.rbInsertLeft(s,n[r]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=``);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let r=1;r<i.length;r++)s=this.rbInsertRight(s,i[r]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,s=e.piece.bufferIndex,r=this._buffers[s].lineStarts,l=r[n.start.line]+n.start.column+t;let c=n.start.line,d=n.end.line,h=0,u=0,g=0;for(;c<=d&&(h=c+(d-c)/2|0,g=r[h],h!==d);)if(u=r[h+1],l<g)d=h-1;else if(l>=u)c=h+1;else break;return i?(i.line=h,i.column=l-g,null):{line:h,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],r=n[i.line]+i.column;if(s>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)M0(this,e[t])}createNewPieces(e){if(e.length>rc){const d=[];for(;e.length>rc;){const u=e.charCodeAt(rc-1);let g;u===13||u>=55296&&u<=56319?(g=e.substring(0,rc-1),e=e.substring(rc-1)):(g=e.substring(0,rc),e=e.substring(rc));const f=uc(g);d.push(new Xs(this._buffers.length,{line:0,column:0},{line:f.length-1,column:g.length-f[f.length-1]},f.length-1,g.length)),this._buffers.push(new Zu(g,f))}const h=uc(e);return d.push(new Xs(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new Zu(e,h)),d}let t=this._buffers[0].buffer.length;const i=uc(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let d=0;d<i.length;d++)i[d]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let d=0;d<i.length;d++)i[d]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const s=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,a=s-this._buffers[0].lineStarts[r],l={line:r,column:a},c=new Xs(0,n,l,this.getLineFeedCnt(0,n,l),s-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,n="";const s=this._searchCache.get2(e);if(s){i=s.node;const r=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+r,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return a.substring(l+r,l+c-t)}}else{let r=0;const a=e;for(;i!==He;)if(i.left!==He&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(h+l,h+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==He;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==He;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this.
`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=uc(t,!1);for(let g=0;g<s.length;g++)s[g]+=n;if(i){const g=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-g}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.slice(1));const r=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[r],l={line:r,column:a},c=e.piece.length+t.length,d=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,l),u=h-d;e.piece=new Xs(e.piece.bufferIndex,e.piece.start,l,h,c),this._lastChangeBufferPos=l,hc(this,e,t.length,u)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==He;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(s),s}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==He;)if(i.left!==He&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==He;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:r}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===``)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===He||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n===i.length-1||i[n+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===He||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:s={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Xs(e.piece.bufferIndex,e.piece.start,s,a,r),hc(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Xs(t.piece.bufferIndex,l,t.piece.end,d,c),hc(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r`);this.rbInsertRight(e,h[0]);for(let u=0;u<i.length;u++)M0(this,i[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=``,i.piece.length===1)M0(this,i);else{const n=i.piece,s={line:n.start.line+1,column:0},r=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,s,n.end);i.piece=new Xs(n.bufferIndex,s,n.end,a,r),hc(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===He)return t(He);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===He)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,s)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new pM(t,1);if(i.left=He,i.right=He,i.parent=He,i.size_left=0,i.lf_left=0,this.root===He)this.root=i,i.color=0;else if(e.right===He)e.right=i,i.parent=e;else{const s=z5(e.right);s.left=i,i.parent=s}return _B(this,i),i}rbInsertLeft(e,t){const i=new pM(t,1);if(i.left=He,i.right=He,i.parent=He,i.size_left=0,i.lf_left=0,this.root===He)this.root=i,i.color=0;else if(e.left===He)e.left=i,i.parent=e;else{const n=rj(e.left);n.right=i,i.parent=n}return _B(this,i),i}}class t_ extends V{constructor(e,t,i,n,s,r,a){super(),this._onDidChangeContent=this._register(new B),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new Qle(e,i,a)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),s=this.getPositionAt(i);return new k(n.lineNumber,n.column,s.lineNumber,s.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let s=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const l=r.length-a.length,c=e.endLineNumber-e.startLineNumber;s=l*c}return n-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,s=e.endLineNumber;for(let r=n;r<=s;r++){const a=this.getLineContent(r),l=r===n?e.startColumn-1:0,c=r===s?e.endColumn-1:a.length;for(let d=l;d<c;d++)Yi(a.charCodeAt(d))?(i=i+1,d=d+1):i=i+1}return i+=this._getEndOfLine(t).length*(s-n),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=ss(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Ia(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return``;case 2:return`\r`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let p=0;p<e.length;p++){const _=e[p];a&&_._isTracked&&(a=!1);const v=_.range;if(_.text){let L=!0;r||(L=!I1(_.text),r=L),!n&&L&&(n=x_(_.text)),!s&&L&&(s=Wz(_.text))}let b="",C=0,w=0,S=0;if(_.text){let L;[C,w,S,L]=Yh(_.text);const x=this.getEOL();L===0||L===(x===`\r`?2:1)?b=_.text:b=_.text.replace(/\r\n|\r|\n/g,x)}l[p]={sortIndex:p,identifier:_.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:b,eolCount:C,firstLineLength:w,lastLineLength:S,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(t_._sortOpsAscending);let c=!1;for(let p=0,_=l.length-1;p<_;p++){const v=l[p].range.getEndPosition(),b=l[p+1].range.getStartPosition();if(b.isBeforeOrEqual(v)){if(b.isBefore(v))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const d=i||t?t_._getInverseEditRanges(l):[],h=[];if(t)for(let p=0;p<l.length;p++){const _=l[p],v=d[p];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let b=v.startLineNumber;b<=v.endLineNumber;b++){let C="";b===v.startLineNumber&&(C=this.getLineContent(_.range.startLineNumber),ss(C)!==-1)||h.push({lineNumber:b,oldContent:C})}}let u=null;if(i){let p=0;u=[];for(let _=0;_<l.length;_++){const v=l[_],b=d[_],C=this.getValueInRange(v.range),w=v.rangeOffset+p;p+=v.text.length-C.length,u[_]={sortIndex:v.sortIndex,identifier:v.identifier,range:b,text:C,textChange:new En(v.rangeOffset,C,w,v.text)}}c||u.sort((_,v)=>_.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;const g=this._doApplyEdits(l);let f=null;if(t&&h.length>0){h.sort((p,_)=>_.lineNumber-p.lineNumber),f=[];for(let p=0,_=h.length;p<_;p++){const v=h[p].lineNumber;if(p>0&&h[p-1].lineNumber===v)continue;const b=h[p].oldContent,C=this.getLineContent(v);C.length===0||C===b||ss(C)!==-1||f.push(v)}}return this._onDidChangeContent.fire(),new Zre(u,g,f)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,s=new k(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,f=e.length;g<f;g++){const p=e[g],_=p.range;t=t||p.forceMoveMarkers,l.push(this.getValueInRange(new k(r,a,_.startLineNumber,_.startColumn))),p.text.length>0&&l.push(p.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,h,u]=Yh(c);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:c,eolCount:d,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(t_._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],s=n.range.startLineNumber,r=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(s===a&&r===l&&n.text.length===0)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const c=new k(s,r,a,l);t.push({range:c,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,s=null;for(let r=0,a=e.length;r<a;r++){const l=e[r];let c,d;s?s.range.endLineNumber===l.range.startLineNumber?(c=i,d=n+(l.range.startColumn-s.range.endColumn)):(c=i+(l.range.startLineNumber-s.range.endLineNumber),d=l.range.startColumn):(c=l.range.startLineNumber,d=l.range.startColumn);let h;if(l.text.length>0){const u=l.eolCount+1;u===1?h=new k(c,d,c,d+l.firstLineLength):h=new k(c,d,c+u-1,l.lastLineLength+1)}else h=new k(c,d,c,d);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=k.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=k.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Jle{constructor(e,t,i,n,s,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this.
`:`\r`:i>t/2?`\r`:``}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r`&&(this._cr>0||this._lf>0)||t===``&&(this._cr>0||this._crlf>0)))for(let s=0,r=i.length;s<r;s++){const a=i[s].buffer.replace(/\r\n|\r|\n/g,t),l=uc(a);i[s]=new Zu(a,l)}const n=new t_(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class lj{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&zF(e)&&(this.BOM=PQ,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=Zle(this._tmpLineStarts,e);this.chunks.push(new Zu(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=x_(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Wz(e)))}finish(e=!0){return this._finish(),new Jle(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=uc(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class qe{static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let n=i;for(;n<t.length&&t[n].start<=e.endExclusive;)n++;if(i===n)t.splice(i,0,e);else{const s=Math.min(e.start,t[i].start),r=Math.max(e.endExclusive,t[n-1].endExclusive);t.splice(i,n-i,new qe(s,r))}}static tryCreate(e,t){if(!(e>t))return new qe(e,t)}static ofLength(e){return new qe(0,e)}static ofStartAndLength(e,t){return new qe(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new ft(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new qe(this.start+e,this.endExclusive+e)}deltaStart(e){return new qe(this.start+e,this.endExclusive)}deltaEnd(e){return new qe(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new qe(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new qe(t,i)}intersects(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return t<i}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new ft(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new ft(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}}class K5{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const n=Math.min(e.start,this._sortedRanges[t].start),s=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new qe(n,s))}}toString(){return this._sortedRanges.map(e=
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=V.None}_assertNotDisposed(){if(this._isDisposed)throw new ft("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Lg(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw ur();const{textBuffer:t,disposable:i}=SB(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:s,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new yB,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Qp([new Vae],this._versionId,!1,!1),this._createContentChanged2(new k(1,1,s,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r`:``;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Qp([new $ae],this._versionId,!1,!1),this._createContentChanged2(new k(1,1,s,r),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const s=t[i],r=s.range,a=s.cachedAbsoluteStart-s.start,l=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),c=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);s.cachedAbsoluteStart=l,s.cachedAbsoluteEnd=c,s.cachedVersionId=e,s.start=l-a,s.end=c-a,Qh(s)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const s=this._buffer.getLineLength(n);s>=pce?t+=s:e+=s}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new qS({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=dB(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),XF(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(Fz.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ft("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ft("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ft("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(s);r>=h&&(r=h)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const h=this.getLineMaxColumn(c);d>=h&&(d=h)}return i===s&&n===r&&a===c&&l===d&&e instanceof k&&!(e instanceof pe)?e:new k(s,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(Yi(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new F(1,1);if(n>r)return new F(r,this.getLineMaxColumn(r));if(s<=1)return new F(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new F(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if(Yi(l))return new F(n,s-1)}return new F(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof F&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,c=Yi(a),d=Yi(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof k&&!(e instanceof pe)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(s,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=Yi(c),u=Yi(d);return!h&&!u?new k(s,r,a,l):s===a&&r===l?new k(s,r-1,a,l-1):h&&u?new k(s,r-1,a,l+1):h?new k(s,r-1,a,l):new k(s,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new k(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,r,a=mce){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>k.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const c=[];c.push(l.reduce((h,u)=>k.areIntersecting(h,u)?h.plusRange(u):(c.push(h),u)));let d;if(!i&&e.indexOf(``)<0){const u=new Au(e,i,n,s).parseSearchRequest();if(!u)return[];d=g=>this.findMatchesLineByLine(g,u,r,a)}else d=h=>A0.findMatches(this,new Au(e,i,n,s),h,r,a);return c.map(d).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(``)<0){const c=new Au(e,i,n,s).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let h=new k(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),u=this.findMatchesLineByLine(h,c,r,1);return A0.findNextMatch(this,new Au(e,i,n,s),a,r),u.length>0||(h=new k(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,c,r,1),u.length>0)?u[0]:null}return A0.findNextMatch(this,new Au(e,i,n,s),a,r)}findPreviousMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);return A0.findPreviousMatch(this,new Au(e,i,n,s),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===``?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof SN?e:new SN(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const s=t.map(a=>({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;a<l;a++){const c=e[a];let d=!1;for(let h=0,u=s.length;h<u;h++){const g=s[h].range,f=g.startLineNumber>c.endLineNumber,p=c.startLineNumber>g.endLineNumber;if(!f&&!p){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;a<l;a++){const c=this._trimAutoWhitespaceLines[a],d=this.getLineMaxColumn(c);let h=!0;for(let u=0,g=s.length;u<g;u++){const f=s[u].range,p=s[u].text;if(!(c<f.startLineNumber||c>f.endLineNumber)&&!(c===f.startLineNumber&&f.startColumn===d&&f.isEmpty()&&p&&p.length>0&&p.charAt(0)===``)&&!(c===f.startLineNumber&&f.startColumn===1&&f.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===``)){h=!1;break}}if(h){const u=new k(c,1,c,d);t.push(new SN(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new k(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new k(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,r){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(r),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(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c<d;c++){const h=r[c];this._decorationsTree.acceptReplace(h.rangeOffset,h.rangeLength,h.text.length,h.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let c=0,d=r.length;c<d;c++){const h=r[c],[u]=Yh(h.text);this._onDidChangeDecorations.fire();const g=h.range.startLineNumber,f=h.range.endLineNumber,p=f-g,_=u,v=Math.min(p,_),b=_-p,C=s-l-b+g,w=C,S=C+_,L=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new F(w,1)),this.getOffsetAt(new F(S,this.getLineMaxColumn(S))),0),x=Ha.fromDecorations(L),D=new od(x);for(let N=v;N>=0;N--){const z=g+N,P=C+N;D.takeFromEndWhile(H=>H.lineNumber>P);const M=D.takeFromEndWhile(H=>H.lineNumber===P);a.push(new tB(z,this.getLineContent(P),M))}if(v<p){const N=g+v;a.push(new zae(N+1,f))}if(v<_){const N=new od(x),z=g+v,P=_-v,M=s-l-P+z+1,H=[],O=[];for(let q=0;q<P;q++){const Q=M+q;O[q]=this.getLineContent(Q),N.takeWhile(te=>te.lineNumber<Q),H[q]=N.takeWhile(te=>te.lineNumber===Q)}a.push(new Uae(z+1,g+_,O,H))}l+=b}this._emitContentChangedEvent(new Qp(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(n=>new tB(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new U$(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(s,r)=>this._deltaDecorationsImpl(e,[],[{range:s,options:r}])[0],changeDecoration:(s,r)=>{this._changeDecorationImpl(s,r)},changeDecorationOptions:(s,r)=>{this._changeDecorationOptionsImpl(s,kB(r))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,r)=>s.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,s,r)};let n=null;try{n=t(i)}catch(s){Pe(s)}return i.addDecoration=Yv,i.changeDecoration=Yv,i.changeDecorationOptions=Yv,i.removeDecoration=Yv,i.
`)>=0)return null;const r=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=s.text.length-r[2].length-1,h=s.text.lastIndexOf(c,d-1);if(h===-1)return null;t.push([h,d])}return t}executeEdits(e,t,i,n){let s=null;t==="snippet"&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(s)for(let h=0,u=s.length;h<u;h++){const[g,f]=s[h],p=c[h],_=p.range.startLineNumber,v=p.range.startColumn-1+g,b=p.range.startColumn-1+f;r.push(new k(_,b+1,_,b+2)),a.push(new k(_,v+1,_,b+2))}const d=n(c);return d&&(this._isHandling=!0),d});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),r.length>0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=Qb.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Pe(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return EB.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new Jb(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation($d.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let s=0;for(;s<n;){const r=HF(t,s),a=t.substr(s,r);this._executeEditOperation($d.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),s+=r}}else this._executeEditOperation($d.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,s,r){if(t.length===0&&i===0&&n===0){if(s!==0){const a=this.getSelections().map(l=>{const c=l.getPosition();return new pe(c.lineNumber,c.column+s,c.lineNumber,c.column+s)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation($d.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s))},e,r)}paste(e,t,i,n,s){this._executeEdit(()=>{this._executeEditOperation($d.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,s,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Pf.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Us(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Us(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class Qb{static from(e,t){return new Qb(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class EB{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._mod`:this.model.getEOL();e=e.slice(0),e.sort(k.compareRangesUsingStarts);let s=!1,r=!1;for(const l of e)l.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d<l.length;d++)d>0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+n);return c}if(s&&t){const l=[];let c=0;for(const d of e){const h=d.startLineNumber;d.isEmpty()?h!==c&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(d,i?2:0)),c=h}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===bs||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new k(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const s=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===Cs.fontFamily;let c;return l?c=Cs.fontFamily:(c=s.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Cs.fontFamily}`),{mode:i,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${c};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,r)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=s;c++){const d=this.model.tokenization.getLineTokens(c),h=d.getLineContent(),u=c===i?n-1:0,g=c===s?r-1:h.length;h===""?l+="<br>":l+=ede(h,d.inflate(),t,u,g,a,An)}return l}_getColorMap(){const e=fi.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=Y.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new Uce);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new k(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new Xb(e,!1,i
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;try{this._beginUpdate();const i=e;if(this._modelData===null&&i===null||this._modelData&&this._modelData.model===i)return;const n={oldModelUrl:((t=this._modelData)==null?void 0:t.model.uri)||null,newModelUrl:(i==null?void 0:i.uri)||null};this._onWillChangeModel.fire(n);const s=this.hasTextFocus(),r=this._detachModel();this._attachModel(i),s&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(n),this._postDetachModelCleanup(r),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Ou._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Ou._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return Ou._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}setHiddenAreas(e,t){var i;(i=this._modelData)==null||i.viewModel.setHiddenAreas(e.map(n=>k.lift(n)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return $i.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!F.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!k.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new k(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!F.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new k(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._mode
`)n.type===2&&(n=s.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),s.push(n),n=c}else n.content+=a}return n.type===2&&(n=s.pop()),t}function che(o,e){return NM(o,e)!==0}function NM(o,e){switch(o){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const dhe=new RegExp(`(\\\\)?\\$\\((${xe.iconNameExpression}(?:${xe.iconModifierExpression})?)\\)`,"g");function ph(o){const e=new Array;let t,i=0,n=0;for(;(t=dhe.exec(o))!==null;){n=t.index||0,i<n&&e.push(o.substring(i,n)),i=(t.index||0)+t[0].length;const[,s,r]=t;e.push(s?`$(${r})`:Bf({id:r}))}return i<o.length&&e.push(o.substring(i)),e}function Bf(o){const e=ne("span");return e.classList.add(...xe.asClassNameArray(o)),e}function hhe(o){const e=uhe(o);if(e&&e.length>0)return new Uint32Array(e)}let Do=0;const qd=new Uint32Array(10);function uhe(o){if(Do=0,Ja(o,WN,4352),Do>0||(Ja(o,BN,4449),Do>0)||(Ja(o,HN,4520),Do>0)||(Ja(o,Su,12593),Do))return qd.subarray(0,Do);if(o>=44032&&o<=55203){const e=o-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),s=t%28-1;if(i<WN.length?Ja(i,WN,0):4352+i-12593<Su.length&&Ja(4352+i,Su,12593),n<BN.length?Ja(n,BN,0):4449+n-12593<Su.length&&Ja(4449+n-12593,Su,12593),s>=0&&(s<HN.length?Ja(s,HN,0):4520+s-12593<Su.length&&Ja(4520+s-12593,Su,12593)),Do>0)return qd.subarray(0,Do)}}function Ja(o,e,t){o>=t&&o<t+e.length&&ghe(e[o-t])}function ghe(o){o!==0&&(qd[Do++]=o&255,o>>8&&(qd[Do++]=o>>8&255),o>>16&&(qd[Do++]=o>>16&255))}const WN=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),BN=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),HN=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Su=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function a3(...o){return function(e,t){for(let i=0,n=o.length;i<n;i++){const s=o[i](e,t);if(s)return s}return null}}xj.bind(void 0,!1);const Dw=xj.bind(void 0,!0);function xj(o,e,t){if(!t||t.length<e.length)return null;let i;return o?i=FF(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function Dj(o,e){const t=e.toLowerCase().indexOf(o.toLowerCase());return t===-1?null:[{start:t,end:t+o.length}]}function Ij(o,e){return TM(o.toLowerCase(),e.toLowerCase(),0,0)}function TM(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]===e[i]){let n=null;return(n=TM(o,e,t+1,i+1))?d3({start:i,end:i+1},n):null}return TM(o,e,t,i+1)}function l3(o){return 97<=o&&o<=122}function QI(o){return 65<=o&&o<=90}function c3(o){return 48<=o&&o<=57}function Ej(o){return o===32||o===9||o===10||o===13}const Nj=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(o=>Nj.add(o.charCodeAt(0)));function SL(o){return Ej(o)||Nj.has(o)}function $B(o,e){return o===e||SL(o)&&SL(e)}const VN=new Map;function jB(o){if(VN.has(o))return VN.get(o);let e;const t=hhe(o);return t&&(e=t),VN.set(o,e),e}function Tj(o){return l3(o)||QI(o)||c3(o)}function d3(o,e){return e.length===0?e=[o]:o.end===e[0].start?e[0].start=o.start:e.unshift(o),e}function Rj(o,e){for(let t=e;t<o.length;t++){const i=o.charCodeAt(t);if(QI(i)||c3(i)||t>0&&!Tj(o.charCodeAt(t-1)))return t}return o.length}function RM(o,e,t,i){if(t===o.length)return[];if(i===e.length)return null;if(o[t]!==e[i].toLowerCase())return null;{let n=null,s=i+1;for(n=RM(o,e,t+1,i+1);!n&&(s=Rj(e,s))<e.length;)n=RM(o,e,t+1,s),s++;return n===null?null:d3({start:i,end:i+1},n)}}function fhe(o){let e=0,t=0,i=0,n=0,s=0;for(let d=0;d<o.length;d++)s=o.charCodeAt(d),QI(s)&&e++,l3(s)&&t++,Tj(s)&&i++,c3(s)&&n++;const r=e/o.length,a=t/o.length,l=i/o.length,c=n/o.length;return{upperPercent:r,lowerPercent:a,alphaPercent:l,numericPercent:c}}function mhe(o){const{upperPercent:e,lowerPercent:t}=o;return t===0&&e>.6}funct
`:`
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`${Whe(t,e)}`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp($o(t),"g");return e.replace(i,(n,s)=>e.charAt(s-1)!=="\\"?`\\${n}`:n)}}function H_(o){return Aa(o)?!o.value:Array.isArray(o)?o.every(H_):!0}function Aa(o){return o instanceof Hn?!0:o&&typeof o=="object"?typeof o.value=="string"&&(typeof o.isTrusted=="boolean"||typeof o.isTrusted=="object"||o.isTrusted===void 0)&&(typeof o.supportThemeIcons=="boolean"||o.supportThemeIcons===void 0):!1}function Ohe(o,e){return o===e?!0:!o||!e?!1:o.value===e.value&&o.isTrusted===e.isTrusted&&o.supportThemeIcons===e.supportThemeIcons&&o.supportHtml===e.supportHtml&&(o.baseUri===e.baseUri||!!o.baseUri&&!!e.baseUri&&ww(Le.from(o.baseUri),Le.from(e.baseUri)))}function Fhe(o){return o.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function Whe(o,e){var n;const t=((n=o.match(/^`+/gm))==null?void 0:n.reduce((s,r)=>s.length>r.length?s:r).length)??0,i=t>=3?t+1:3;return[`${"`".repeat(i)}${e}`,o,`${"`".repeat(i)}`].join(`
`)}function z0(o){return o.replace(/"/g,""")}function $N(o){return o&&o.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Bhe(o){const e=[],t=o.split("|").map(n=>n.trim());o=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),r=n?n[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:o,dimensions:e}}class f3{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const PM=new f3("id#");let jn={};(function(){function o(e,t){t(jn)}o.amd=!0,function(e,t){typeof o=="function"&&o.amd?o(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}e.defaults=t();function i(st){e.defaults=st}const n=/[&<>"']/,s=new RegExp(n.source,"g"),r=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,a=new RegExp(r.source,"g"),l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=st=>l[st];function d(st,R){if(R){if(n.test(st))return st.replace(s,c)}else if(r.test(st))return st.replace(a,c);return st}const h=/(^|[^\[])\^/g;function u(st,R){let A=typeof st=="string"?st:st.source;R=R||"";const W={replace:(U,j)=>{let se=typeof j=="string"?j:j.source;return se=se.replace(h,"$1"),A=A.replace(U,se),W},getRegex:()=>new RegExp(A,R)};return W}function g(st){try{st=encodeURI(st).replace(/%25/g,"%")}catch{return null}return st}const f={exec:()=>null};function p(st,R){const A=st.replace(/\|/g,(j,se,ce)=>{let ye=!1,Ie=se;for(;--Ie>=0&&ce[Ie]==="\\";)ye=!ye;return ye?"|":" |"}),W=A.split(/ \|/);let U=0;if(W[0].trim()||W.shift(),W.length>0&&!W[W.length-1].trim()&&W.pop(),R)if(W.length>R)W.splice(R);else for(;W.length<R;)W.push("");for(;U<W.length;U++)W[U]=W[U].trim().replace(/\\\|/g,"|");return W}function _(st,R,A){const W=st.length;if(W===0)return"";let U=0;for(;U<W;){const j=st.charAt(W-U-1);if(j===R&&!A)U++;else if(j!==R&&A)U++;else break}return st.slice(0,W-U)}function v(st,R){if(st.indexOf(R[1])===-1)return-1;let A=0;for(let W=0;W<st.length;W++)if(st[W]==="\\")W++;else if(st[W]===R[0])A++;else if(st[W]===R[1]&&(A--,A<0))return W;return-1}function b(st,R,A,W){const U=R.href,j=R.title?d(R.title):null,se=st[1].replace(/\\([\[\]])/g,"$1");if(st[0].charAt(0)!=="!"){W.state.inLink=!0;const ce={type:"link",raw:A,href:U,title:j,text:se,tokens:W.inlineTokens(se)};return W.state.inLink=!1,ce}return{type:"image",raw:A,href:U,title:j,text:d(se)}}function C(st,R){const A=st.match(/^(\s+)(?:```)/);if(A===null)return R;const W=A[1];return R.split(`
`).map(U=>{const j=U.match(/^\s+/);if(j===null)return U;const[se]=j;return se.length>=W.length?U.slice(W.length):U}).join(``)}class w{constructor(R){Zt(this,"options");Zt(this,"rules");Zt(this,"lexer");this.options=R||e.defaults}space(R){const A=this.rules.block.newline.exec(R);if(A&&A[0].length>0)return{type:"space",raw:A[0]}}code(R){const A=this.rules.block.code.exec(R);if(A){const W=A[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:A[0],codeBlockStyle:"indented",text:this.options.pedantic?W:_(W,``)}}}fences(R){const A=this.rules.block.fences.exec(R);if(A){const W=A[0],U=C(W,A[3]||"");return{type:"code",raw:W,lang:A[2]?A[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):A[2],text:U}}}heading(R){const A=this.rules.block.heading.exec(R);if(A){let W=A[2].trim();if(/#$/.test(W)){const U=_(W,"#");(this.options.pedantic||!U||/ $/.test(U))&&(W=U.trim())}return{type:"heading",raw:A[0],depth:A[1].length,text:W,tokens:this.lexer.inline(W)}}}hr(R){const A=this.rules.block.hr.exec(R);if(A)return{type:"hr",raw:_(A[0],``)}}blockquote(R){const A=this.rules.block.blockquote.exec(R);if(A){let W=_(A[0],``).split(``),U="",j="";const se=[];for(;W.length>0;){let ce=!1;const ye=[];let Ie;for(Ie=0;Ie<W.length;Ie++)if(/^ {0,3}>/.test(W[Ie]))ye.push(W[Ie]),ce=!0;else if(!ce)ye.push(W[Ie]);else break;W=W.slice(Ie);const ot=ye.join(``),Dt=ot.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` $1`).replace(/^ {0,3}>[ \t]?/gm,"");U=U?`${U}${ot}`:ot,j=j?`${j}${Dt}`:Dt;const _i=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(Dt,se,!0),this.lexer.state.top=_i,W.length===0)break;const Li=se[se.length-1];if((Li==null?void 0:Li.type)==="code")break;if((Li==null?void 0:Li.type)==="blockquote"){const Ti=Li,We=Ti.raw+``+W.join(``),Z=this.blockquote(We);se[se.length-1]=Z,U=U.substring(0,U.length-Ti.raw.length)+Z.raw,j=j.substring(0,j.length-Ti.text.length)+Z.text;break}else if((Li==null?void 0:Li.type)==="list"){const Ti=Li,We=Ti.raw+``+W.join(``),Z=this.list(We);se[se.length-1]=Z,U=U.substring(0,U.length-Li.raw.length)+Z.raw,j=j.substring(0,j.length-Ti.raw.length)+Z.raw,W=We.substring(se[se.length-1].raw.length).split(``);continue}}return{type:"blockquote",raw:U,tokens:se,text:j}}}list(R){let A=this.rules.block.list.exec(R);if(A){let W=A[1].trim();const U=W.length>1,j={type:"list",raw:"",ordered:U,start:U?+W.slice(0,-1):"",loose:!1,items:[]};W=U?`\\d{1,9}\\${W.slice(-1)}`:`\\${W}`,this.options.pedantic&&(W=U?W:"[*+-]");const se=new RegExp(`^( {0,3}${W})((?:[ ][^\\n]*)?(?:\\n|$))`);let ce=!1;for(;R;){let ye=!1,Ie="",ot="";if(!(A=se.exec(R))||this.rules.block.hr.test(R))break;Ie=A[0],R=R.substring(Ie.length);let Dt=A[2].split(``,1)[0].replace(/^\t+/,we=>" ".repeat(3*we.length)),_i=R.split(``,1)[0],Li=!Dt.trim(),Ti=0;if(this.options.pedantic?(Ti=2,ot=Dt.trimStart()):Li?Ti=A[1].length+1:(Ti=A[2].search(/[^ ]/),Ti=Ti>4?1:Ti,ot=Dt.slice(Ti),Ti+=A[1].length),Li&&/^ *$/.test(_i)&&(Ie+=_i+``,R=R.substring(_i.length+1),ye=!0),!ye){const we=new RegExp(`^ {0,${Math.min(3,Ti-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),Me=new RegExp(`^ {0,${Math.min(3,Ti-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),li=new RegExp(`^ {0,${Math.min(3,Ti-1)}}(?:\`\`\`|~~~)`),fn=new RegExp(`^ {0,${Math.min(3,Ti-1)}}#`);for(;R;){const Ts=R.split(`
`,1)[0];if(_i=Ts,this.options.pedantic&&(_i=_i.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),li.test(_i)||fn.test(_i)||we.test(_i)||Me.test(R))break;if(_i.search(/[^ ]/)>=Ti||!_i.trim())ot+=``+_i.slice(Ti);else{if(Li||Dt.search(/[^ ]/)>=4||li.test(Dt)||fn.test(Dt)||Me.test(Dt))break;ot+=``+_i}!Li&&!_i.trim()&&(Li=!0),Ie+=Ts+``,R=R.substring(Ts.length+1),Dt=_i.slice(Ti)}}j.loose||(ce?j.loose=!0:/\n *\n *$/.test(Ie)&&(ce=!0));let We=null,Z;this.options.gfm&&(We=/^\[[ xX]\] /.exec(ot),We&&(Z=We[0]!=="[ ] ",ot=ot.replace(/^\[[ xX]\] +/,""))),j.items.push({type:"list_item",raw:Ie,task:!!We,checked:Z,loose:!1,text:ot,tokens:[]}),j.raw+=Ie}j.items[j.items.length-1].raw=j.items[j.items.length-1].raw.trimEnd(),j.items[j.items.length-1].text=j.items[j.items.length-1].text.trimEnd(),j.raw=j.raw.trimEnd();for(let ye=0;ye<j.items.length;ye++)if(this.lexer.state.top=!1,j.items[ye].tokens=this.lexer.blockTokens(j.items[ye].text,[]),!j.loose){const Ie=j.items[ye].tokens.filter(Dt=>Dt.type==="space"),ot=Ie.length>0&&Ie.some(Dt=>/\n.*\n/.test(Dt.raw));j.loose=ot}if(j.loose)for(let ye=0;ye<j.items.length;ye++)j.items[ye].loose=!0;return j}}html(R){const A=this.rules.block.html.exec(R);if(A)return{type:"html",block:!0,raw:A[0],pre:A[1]==="pre"||A[1]==="script"||A[1]==="style",text:A[0]}}def(R){const A=this.rules.block.def.exec(R);if(A){const W=A[1].toLowerCase().replace(/\s+/g," "),U=A[2]?A[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",j=A[3]?A[3].substring(1,A[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):A[3];return{type:"def",tag:W,raw:A[0],href:U,title:j}}}table(R){const A=this.rules.block.table.exec(R);if(!A||!/[:|]/.test(A[2]))return;const W=p(A[1]),U=A[2].replace(/^\||\| *$/g,"").split("|"),j=A[3]&&A[3].trim()?A[3].replace(/\n[ \t]*$/,"").split(``):[],se={type:"table",raw:A[0],header:[],align:[],rows:[]};if(W.length===U.length){for(const ce of U)/^ *-+: *$/.test(ce)?se.align.push("right"):/^ *:-+: *$/.test(ce)?se.align.push("center"):/^ *:-+ *$/.test(ce)?se.align.push("left"):se.align.push(null);for(let ce=0;ce<W.length;ce++)se.header.push({text:W[ce],tokens:this.lexer.inline(W[ce]),header:!0,align:se.align[ce]});for(const ce of j)se.rows.push(p(ce,se.header.length).map((ye,Ie)=>({text:ye,tokens:this.lexer.inline(ye),header:!1,align:se.align[Ie]})));return se}}lheading(R){const A=this.rules.block.lheading.exec(R);if(A)return{type:"heading",raw:A[0],depth:A[2].charAt(0)==="="?1:2,text:A[1],tokens:this.lexer.inline(A[1])}}paragraph(R){const A=this.rules.block.paragraph.exec(R);if(A){const W=A[1].charAt(A[1].length-1)===``?A[1].slice(0,-1):A[1];return{type:"paragraph",raw:A[0],text:W,tokens:this.lexer.inline(W)}}}text(R){const A=this.rules.block.text.exec(R);if(A)return{type:"text",raw:A[0],text:A[0],tokens:this.lexer.inline(A[0])}}escape(R){const A=this.rules.inline.escape.exec(R);if(A)return{type:"escape",raw:A[0],text:d(A[1])}}tag(R){const A=this.rules.inline.tag.exec(R);if(A)return!this.lexer.state.inLink&&/^<a /i.test(A[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(A[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(A[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(A[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:A[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:A[0]}}link(R){const A=this.rules.inline.link.exec(R);if(A){const W=A[2].trim();if(!this.options.pedantic&&/^</.test(W)){if(!/>$/.test(W))return;const se=_(W.slice(0,-1),"\\");if((W.length-se.length)%2===0)return}else{const se=v(A[2],"()");if(se>-1){const ye=(A[0].indexOf("!")===0?5:4)+A[1].length+se;A[2]=A[2].substring(0,se),A[0]=A[0].substring(0,ye).trim(),A[3]=""}}let U=A[2],j="";if(this.options.pedantic){const se=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(U);se&&(U=se[1],j=se[3])}else j=A[3]?A[3].slice(1,-1):"";return U=U.trim(),/^</.test(U)&&(this.options.pedantic&&!/>$/.test(W)?U=U.slice(1):U=U.slice(1,-1)),b(A,{href:U&&U.replace(this.rules.inline.anyPunctuation,"$1"),title:j&&j.replace(this.rules.inline.anyPunctuation,"$1")},A[0],this.lexer)}}reflink(R,A){let W;if((W=this.rules.inline.reflink.exec(R))||(W=this.rules.inline.nolink.exec(R))){const U=(W[2]||W[1]).replace(/\s+/g," "),j=A[U.toLowerCase()];if(!j){const se=W[0].charAt(0);return{type:"text",raw:se,text:se}}return b(W,j,W[0],this.lexer)}}emStrong(R,A,W=""){let U=this.rules.inline.emStrongLDelim.exec(R);if(!U||U[3]&&W.match(/[\p{L}\p{N}]/u))return;if(!(U[1]||U[2]||"")||!W||this.rules.inline.punctuation.exec(W)){const se=[...U[0]].length-1;let ce,ye,Ie=se,ot=0;const Dt=U[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(Dt.lastIndex=0,A=A.slice(-1*R.length+se);(U=Dt.exec(A))!=null;){if(ce=U[1]||U[2]||U[3]||U[4]||U[5]||U[6],!ce)continue;if(ye=[...ce].length,U[3]||U[4]){Ie+=ye;continue}else if((U[5]||U[6])&&se%3&&!((se+ye)%3)){ot+=ye;continue}if(Ie-=ye,Ie>0)continue;ye=Math.min(ye,ye+Ie+ot);const _i=[...U[0]][0].length,Li=R.slice(0,se+U.index+_i+ye);if(Math.min(se,ye)%2){const We=Li.slice(1,-1);return{type:"em",raw:Li,text:We,tokens:this.lexer.inlineTokens(We)}}const Ti=Li.slice(2,-2);return{type:"strong",raw:Li,text:Ti,tokens:this.lexer.inlineTokens(Ti)}}}}codespan(R){const A=this.rules.inline.code.exec(R);if(A){let W=A[2].replace(/\n/g," ");const U=/[^ ]/.test(W),j=/^ /.test(W)&&/ $/.test(W);return U&&j&&(W=W.substring(1,W.length-1)),W=d(W,!0),{type:"codespan",raw:A[0],text:W}}}br(R){const A=this.rules.inline.br.exec(R);if(A)return{type:"br",raw:A[0]}}del(R){const A=this.rules.inline.del.exec(R);if(A)return{type:"del",raw:A[0],text:A[2],tokens:this.lexer.inlineTokens(A[2])}}autolink(R){const A=this.rules.inline.autolink.exec(R);if(A){let W,U;return A[2]==="@"?(W=d(A[1]),U="mailto:"+W):(W=d(A[1]),U=W),{type:"link",raw:A[0],text:W,href:U,tokens:[{type:"text",raw:W,text:W}]}}}url(R){var W;let A;if(A=this.rules.inline.url.exec(R)){let U,j;if(A[2]==="@")U=d(A[0]),j="mailto:"+U;else{let se;do se=A[0],A[0]=((W=this.rules.inline._backpedal.exec(A[0]))==null?void 0:W[0])??"";while(se!==A[0]);U=d(A[0]),A[1]==="www."?j="http://"+A[0]:j=A[0]}return{type:"link",raw:A[0],text:U,href:j,tokens:[{type:"text",raw:U,text:U}]}}}inlineText(R){const A=this.rules.inline.text.exec(R);if(A){let W;return this.lexer.state.inRawBlock?W=A[0]:W=d(A[0]),{type:"text",raw:A[0],text:W}}}}const S=/^(?: *(?:\n|$))+/,L=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,x=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,D=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,N=/]`).replace("lheading",P).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,as=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ns=/^( {2,}|\\)\n(?!\s*$)/,ia=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qn="\\p{P}\\p{S}",kr=u(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,qn).getRegex(),un=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,xr=u(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,qn).getRegex(),wd=u("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,qn).getRegex(),Cm=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,qn).getRegex(),wm=u(/\\([punct])/,"gu").replace(/punct/g,qn).getRegex(),l0=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),c0=u(fe).replace("(?:-->|$)","-->").getRegex(),WE=u("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",c0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Sd=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_u=u(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Sd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ic=u(/^!?\[(label)\]\[(ref)\]/).replace("label",Sd).replace("ref",O).getRegex(),nc=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",O).getRegex(),d0=u("reflink|nolink(?!\\()","g").replace("reflink",ic).replace("nolink",nc).getRegex(),Sm={_backpedal:f,anyPunctuation:wm,autolink:l0,blockSkip:un,br:Ns,code:as,del:f,emStrongLDelim:xr,emStrongRDelimAst:wd,emStrongRDelimUnd:Cm,escape:zi,link:_u,nolink:nc,punctuation:kr,reflink:ic,reflinkSearch:d0,tag:WE,text:ia,url:f},h0={...Sm,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",Sd).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Sd).getRegex()},vu={...Sm,escape:u(zi).replace("])","~|])").getRegex(),url:u(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},u0={...vu,br:u(Ns).replace("{2,}","*").getRegex(),text:u(vu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},sc={normal:di,gfm:bt,pedantic:Hi},Za={normal:Sm,gfm:vu,breaks:u0,pedantic:h0};class gn{constructor(R){Zt(this,"tokens");Zt(this,"options");Zt(this,"state");Zt(this,"tokenizer");Zt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=R||e.defaults,this.options.tokenizer=this.options.tokenizer||new w,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const A={block:sc.normal,inline:Za.normal};this.options.pedantic?(A.block=sc.pedantic,A.inline=Za.pedantic):this.options.gfm&`),this.blockTokens(R,this.tokens);for(let A=0;A<this.inlineQueue.length;A++){const W=this.inlineQueue[A];this.inlineTokens(W.src,W.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(R,A=[],W=!1){this.options.pedantic?R=R.replace(/\t/g," ").replace(/^ +$/gm,""):R=R.replace(/^( *)(\t+)/gm,(ce,ye,Ie)=>ye+" ".repeat(Ie.length));let U,j,se;for(;R;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(ce=>(U=ce.call({lexer:this},R,A))?(R=R.substring(U.raw.length),A.push(U),!0):!1))){if(U=this.tokenizer.space(R)){R=R.substring(U.raw.length),U.raw.length===1&&A.length>0?A[A.length-1].raw+=``:A.push(U);continue}if(U=this.tokenizer.code(R)){R=R.substring(U.raw.length),j=A[A.length-1],j&&(j.type==="paragraph"||j.type==="text")?(j.raw+=``+U.raw,j.text+=``+U.text,this.inlineQueue[this.inlineQueue.length-1].src=j.text):A.push(U);continue}if(U=this.tokenizer.fences(R)){R=R.substring(U.raw.length),A.push(U);continue}if(U=this.tokenizer.heading(R)){R=R.substring(U.raw.length),A.push(U);continue}if(U=this.tokenizer.hr(R)){R=R.substring(U.raw.length),A.push(U);continue}if(U=this.tokenizer.blockquote(R)){R=R.substring(U.raw.length),A.push(U);continue}if(U=this.tokenizer.list(R)){R=R.substring(U.raw.length),A.push(U);continue}if(U=this.tokenizer.html(R)){R=R.substring(U.raw.length),A.push(U);continue}if(U=this.tokenizer.def(R)){R=R.substring(U.raw.length),j=A[A.length-1],j&&(j.type==="paragraph"||j.type==="text")?(j.raw+=``+U.raw,j.text+=``+U.raw,this.inlineQueue[this.inlineQueue.length-1].src=j.text):this.tokens.links[U.tag]||(this.tokens.links[U.tag]={href:U.href,title:U.title});continue}if(U=this.tokenizer.table(R)){R=R.substring(U.raw.length),A.push(U);continue}if(U=this.tokenizer.lheading(R)){R=R.substring(U.raw.length),A.push(U);continue}if(se=R,this.options.extensions&&this.options.extensions.startBlock){let ce=1/0;const ye=R.slice(1);let Ie;this.options.extensions.startBlock.forEach(ot=>{Ie=ot.call({lexer:this},ye),typeof Ie=="number"&&Ie>=0&&(ce=Math.min(ce,Ie))}),ce<1/0&&ce>=0&&(se=R.substring(0,ce+1))}if(this.state.top&&(U=this.tokenizer.paragraph(se))){j=A[A.length-1],W&&(j==null?void 0:j.type)==="paragraph"?(j.raw+=``+U.raw,j.text+=``+U.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=j.text):A.push(U),W=se.length!==R.length,R=R.substring(U.raw.length);continue}if(U=this.tokenizer.text(R)){R=R.substring(U.raw.length),j=A[A.length-1],j&&j.type==="text"?(j.raw+=``+U.raw,j.text+=``+U.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=j.text):A.push(U);continue}if(R){const ce="Infinite loop on byte: "+R.charCodeAt(0);if(this.options.silent){console.error(ce);break}else throw new Error(ce)}}return this.state.top=!0,A}inline(R,A=[]){return this.inlineQueue.push({src:R,tokens:A}),A}inlineTokens(R,A=[]){let W,U,j,se=R,ce,ye,Ie;if(this.tokens.links){const ot=Object.keys(this.tokens.links);if(ot.length>0)for(;(ce=this.tokenizer.rules.inline.reflinkSearch.exec(se))!=null;)ot.includes(ce[0].slice(ce[0].lastIndexOf("[")+1,-1))&&(se=se.slice(0,ce.index)+"["+"a".repeat(ce[0].length-2)+"]"+se.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ce=this.tokenizer.rules.inline.blockSkip.exec(se))!=null;)se=se.slice(0,ce.index)+"["+"a".repeat(ce[0].length-2)+"]"+se.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(ce=this.tokenizer.rules.inline.anyPunctuation.exec(se))!=null;)se=se.slice(0,ce.index)+"++"+se.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;R;)if(ye||(Ie=""),ye=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(ot=>(W=ot.call({lexer:this},R,A))?(R=R.substring(W.raw.length),A.push(W),!0):!1))){if(W=this.tokenizer.escape(R)){R=R.substring(W.raw.length),A.push(W);continue}if(W=this.tokenizer.tag(R)){R=R.substring(W.raw.length),U=A[A.length-1],U&&W.type==="text"&&U.type==="text"?(U.raw+=W.raw,U.text+=W.text):A.push(W);continue}if(W=this.tokenizer.link(R)){R=R.substring(W.raw.length),A.push(W);continue}if(W=this.tokenizer.reflink(R,this.tokens.links)){R=R.substring(W.raw.length),U=A[A.length-1],U&&W.type==="text"&&U.type==="text"?(U.raw+=W.raw,U.text+=W.text):A.push(W);continue}if(W=this.tokenizer.emStrong(R,se,Ie)){R=R.substring(W.raw.length),A.push(W);continue}if(W=this.tokenizer.codespan(R)){R=R.substring(W.raw.length),A.push(W);continue}if(W=this.tokenizer.br(R)){R=R.substring(W.raw.length),A.push(W);continue}if(W=this.tokenizer.del(R)){R=R.substring(W.raw.length),A.push(W);continue}if(W=this.tokenizer.autolink(R)){R=R.substring(W.raw.length),A.push(W);continue}if(!this.state.inLink&&(W=this.tokenizer.url(R))){R=R.substring(W.raw.length),A.push(W);continue}if(j=R,this.options.extensions&&this.options.extensions.startInline){let ot=1/0;const Dt=R.slice(1);let _i;this.options.extensions.startInline.forEach(Li=>{_i=Li.call({lexer:this},Dt),typeof _i=="number"&&_i>=0&&(ot=Math.min(ot,_i))}),ot<1/0&&ot>=0&&(j=R.substring(0,ot+1))}if(W=this.tokenizer.inlineText(j)){R=R.substring(W.raw.length),W.raw.slice(-1)!=="_"&&(Ie=W.raw.slice(-1)),ye=!0,U=A[A.length-1],U&&U.type==="text"?(U.raw+=W.raw,U.text+=W.text):A.push(W);continue}if(R){const ot="Infinite loop on byte: "+R.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return A}}class Dr{constructor(R){Zt(this,"options");Zt(this,"parser");this.options=R||e.defaults}space(R){return""}code({text:R,lang:A,escaped:W}){var se;const U=(se=(A||"").match(/^\S*/))==null?void 0:se[0],j=R.replace(/\n$/,"")+``;return U?'<pre><code class="language-'+d(U)+'">'+(W?j:d(j,!0))+`</code></pre>`:"<pre><code>"+(W?j:d(j,!0))+`</code></pre>`}blockquote({tokens:R}){return`<blockquote>${this.parser.parse(R)}</blockquote>`}html({text:R}){return R}heading({tokens:R,depth:A}){return`<h${A}>${this.parser.parseInline(R)}</h${A}>`}hr(R){return`<hr>`}list(R){const A=R.ordered,W=R.start;let U="";for(let ce=0;ce<R.items.length;ce++){const ye=R.items[ce];U+=this.listitem(ye)}const j=A?"ol":"ul",se=A&&W!==1?' start="'+W+'"':"";return"<"+j+se+`>`+U+"</"+j+`>`}listitem(R){let A="";if(R.task){const W=this.checkbox({checked:!!R.checked});R.loose?R.tokens.length>0&&R.tokens[0].type==="paragraph"?(R.tokens[0].text=W+" "+R.tokens[0].text,R.tokens[0].tokens&&R.tokens[0].tokens.length>0&&R.tokens[0].tokens[0].type==="text"&&(R.tokens[0].tokens[0].text=W+" "+R.tokens[0].tokens[0].text)):R.tokens.unshift({type:"text",raw:W+" ",text:W+" "}):A+=W+" "}return A+=this.parser.parse(R.tokens,!!R.loose),`<li>${A}</li>`}checkbox({checked:R}){return"<input "+(R?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:R}){return`<p>${this.parser.parseInline(R)}</p>`}table(R){let A="",W="";for(let j=0;j<R.header.length;j++)W+=this.tablecell(R.header[j]);A+=this.tablerow({text:W});let U="";for(let j=0;j<R.rows.length;j++){const se=R.rows[j];W="";for(let ce=0;ce<se.length;ce++)W+=this.tablecell(se[ce]);U+=this.tablerow({text:W})}return U&&(U=`<tbody>${U}</tbody>`),`<table><thead>`+A+`</thead>`+U+`</table>`}tablerow({text:R}){return`<tr>${R}</tr>`}tablecell(R){const A=this.parser.parseInline(R.tokens),W=R.header?"th":"td";return(R.align?`<${W} align="${R.align}">`:`<${W}>`)+A+`</${W}>`}strong({tokens:R}){return`<strong>${this.parser.parseInline(R)}</strong>`}em({tokens:R}){return`<em>${this.parser.parseInline(R)}</em>`}codespan({text:R}){return`<code>${R}</code>`}br(R){return"<br>"}del({tokens:R}){return`<del>${this.parser.parseInline(R)}</del>`}link({href:R,title:A,tokens:W}){const U=this.parser.parseInline(W),j=g(R);if(j===null)return U;R=j;let se='<a href="'+R+'"';return A&&(se+=' title="'+A+'"'),se+=">"+U+"</a>",se}image({href:R,title:A,text:W}){const U=g(R);if(U===null)return W;R=U;let j=`<img src="${R}" alt="${W}"`;return A&&(j+=` title="${A}"`),j+=">",j}text(R){return"tokens"in R&&R.tokens?this.parser.parseInline(R.tokens):R.text}}class yd{strong({text:R}){return R}em({text:R}){return R}codespan({text:R}){return R}del({text:R}){return R}html({text:R}){return R}text({text:R}){return R}link({text:R}){return""+R}image({text:R}){return""+R}br(){return""}}class Ys{constructor(R){Zt(this,"options");Zt(this,"renderer");Zt(this,"textRenderer");this.options=R||e.defaults,this.options.renderer=this.options.renderer||new Dr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new yd}static parse(R,A){return new Ys(A).parse(R)}static parseInline(R,A){return new Ys(A).parseInline(R)}parse(R,A=!0){let W="";for(let U=0;U<R.length;U++){const j=R[U];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[j.type]){const ce=j,ye=this.options.extensions.renderers[ce.type].call({parser:this},ce);if(ye!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(ce.type)){W+=ye||"";continue}}const se=j;switch(se.type){case"space":{W+=this.renderer.space(se);continue}case"hr":{W+=this.renderer.hr(se);continue}case"heading":{W+=this.renderer.heading(se);continue}case"code":{W+=this.renderer.code(se);continue}case"table":{W+=this.renderer.table(se);continue}case"blockquote":{W+=this.renderer.blockquote(se);continue}case"list":{W+=this.renderer.list(se);continue}case"html":{W+=this.renderer.html(se);continue}case"paragraph":{W+=this.renderer.paragraph(se);continue}case"text":{let ce=se,ye=this.renderer.text(ce);for(;U+1<R.length&&R[U+1].type==="text";)ce=R[++U],ye+=``+this.renderer.text(ce);A?W+=this.renderer.paragraph({type:"paragraph",raw:ye,text:ye,tokens:[{type:"text",raw:ye,text:ye}]}):W+=ye;continue}default:{const ce='Token with "'+se.type+'" type was not found.';if(this.options.silent)return console.error(ce),"";throw new Error(ce)}}}return W}parseInline(R,A){A=A||this.renderer;let W="";for(let U=0;U<R.length;U++){const j=R[U];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[j.type]){const ce=this.options.extensions.renderers[j.type].call({parser:this},j);if(ce!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(j.type)){W+=ce||"";continue}}const se=j;switch(se.type){case"escape":{W+=A.text(se);break}case"html":{W+=A.html(se);break}case"link":{W+=A.link(se);break}case"image":{W+=A.image(se);break}case"strong":{W+=A.strong(se);break}case"em":{W+=A.em(se);break}case"codespan":{W+=A.codespan(se);break}case"br":{W+=A.br(se);break}case"del":{W+=A.del(se);break}case"text":{W+=A.text(se);break}default:{const ce='Token with "'+se.type+'" type was not found.';if(this.options.silent)return console.error(ce),"";throw new Error(ce)}}}return W}}class Ld{constructor(R){Zt(this,"options");this.options=R||e.defaults}preprocess(R){return R}postprocess(R){return R}processAllTokens(R){return R}}Zt(Ld,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Ya{constructor(...R){Zt(this,"defaults",t());Zt(this,"options",this.setOptions);Zt(this,"parse",this.parseMarkdown(gn.lex,Ys.parse));Zt(this,"parseInline",this.parseMarkdown(gn.lexInline,Ys.parseInline));Zt(this,"Parser",Ys);Zt(this,"Renderer",Dr);Zt(this,"TextRenderer",yd);Zt(this,"Lexer",gn);Zt(this,"Tokenizer",w);Zt(this,"Hooks",Ld);this.use(...R)}walkTokens(R,A){var U,j;let W=[];for(const se of R)switch(W=W.concat(A.call(this,se)),se.type){case"table":{const ce=se;for(const ye of ce.header)W=W.concat(this.walkTokens(ye.tokens,A));for(const ye of ce.rows)for(const Ie of ye)W=W.concat(this.walkTokens(Ie.tokens,A));break}case"list":{const ce=se;W=W.concat(this.walkTokens(ce.items,A));break}default:{const ce=se;(j=(U=this.defaults.extensions)==null?void 0:U.childTokens)!=null&&j[ce.type]?this.defaults.extensions.childTokens[ce.type].forEach(ye=>{const Ie=ce[ye].flat(1/0);W=W.concat(this.walkTokens(Ie,A))}):ce.tokens&&(W=W.concat(this.walkTokens(ce.tokens,A)))}}return W}use(...R){const A=this.defaults.extensions||{renderers:{},childTokens:{}};return R.forEach(W=>{const U={...W};if(U.async=this.defaults.async||U.async||!1,W.extensions&&(W.extensions.forEach(j=>{if(!j.name)throw new Error("extension name required");if("renderer"in j){const se=A.renderers[j.name];se?A.renderers[j.name]=function(...ce){let ye=j.renderer.apply(this,ce);return ye===!1&&(ye=se.apply(this,ce)),ye}:A.renderers[j.name]=j.renderer}if("tokenizer"in j){if(!j.level||j.level!=="block"&&j.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const se=A[j.level];se?se.unshift(j.tokenizer):A[j.level]=[j.tokenizer],j.start&&(j.level==="block"?A.startBlock?A.startBlock.push(j.start):A.startBlock=[j.start]:j.level==="inline"&&(A.startInline?A.startInline.push(j.start):A.startInline=[j.start]))}"childTokens"in j&&j.childTokens&&(A.childTokens[j.name]=j.childTokens)}),U.extensions=A),W.renderer){const j=this.defaults.renderer||new Dr(this.defaults);for(const se in W.renderer){if(!(se in j))throw new Error(`renderer '${se}' does not exist`);if(["options","parser"].includes(se))continue;const ce=se,ye=W.renderer[ce],Ie=j[ce];j[ce]=(...ot)=>{let Dt=ye.apply(j,ot);return Dt===!1&&(Dt=Ie.apply(j,ot)),Dt||""}}U.renderer=j}if(W.tokenizer){const j=this.defaults.tokenizer||new w(this.defaults);for(const se in W.tokenizer){if(!(se in j))throw new Error(`tokenizer '${se}' does not exist`);if(["options","rules","lexer"].includes(se))continue;const ce=se,ye=W.tokenizer[ce],Ie=j[ce];j[ce]=(...ot)=>{let Dt=ye.apply(j,ot);return Dt===!1&&(Dt=Ie.apply(j,ot)),Dt}}U.tokenizer=j}if(W.hooks){const j=this.defaults.hooks||new Ld;for(const se in W.hooks){if(!(se in j)
Please report this to https://github.com/markedjs/marked.`,R){const U="<p>An error occurred:</p><pre>"+d(W.message+"",!0)+"</pre>";return A?Promise.resolve(U):U}if(A)return Promise.reject(W);throw W}}}const oc=new Ya;function ei(st,R){return oc.parse(st,R)}ei.options=ei.setOptions=function(st){return oc.setOptions(st),ei.defaults=oc.defaults,i(ei.defaults),ei},ei.getDefaults=t,ei.defaults=e.defaults,ei.use=function(...st){return oc.use(...st),ei.defaults=oc.defaults,i(ei.defaults),ei},ei.walkTokens=function(st,R){return oc.walkTokens(st,R)},ei.parseInline=oc.parseInline,ei.Parser=Ys,ei.parser=Ys.parse,ei.Renderer=Dr,ei.TextRenderer=yd,ei.Lexer=gn,ei.lexer=gn.lex,ei.Tokenizer=w,ei.Hooks=Ld,ei.parse=ei;const Ln=ei.options,kd=ei.setOptions,BE=ei.use,g0=ei.walkTokens,Bv=ei.parseInline,f0=ei,m0=Ys.parse,HE=gn.lex;e.Hooks=Ld,e.Lexer=gn,e.Marked=Ya,e.Parser=Ys,e.Renderer=Dr,e.TextRenderer=yd,e.Tokenizer=w,e.getDefaults=t,e.lexer=HE,e.marked=ei,e.options=Ln,e.parse=f0,e.parseInline=Bv,e.parser=m0,e.setOptions=kd,e.use=BE,e.walkTokens=g0})})();jn.Hooks||exports.Hooks;jn.Lexer||exports.Lexer;jn.Marked||exports.Marked;jn.Parser||exports.Parser;var Fj=jn.Renderer||exports.Renderer;jn.TextRenderer||exports.TextRenderer;jn.Tokenizer||exports.Tokenizer;var Hhe=jn.defaults||exports.defaults;jn.getDefaults||exports.getDefaults;var JI=jn.lexer||exports.lexer;jn.marked||exports.marked;jn.options||exports.options;var Wj=jn.parse||exports.parse;jn.parseInline||exports.parseInline;var Vhe=jn.parser||exports.parser;jn.setOptions||exports.setOptions;jn.use||exports.use;jn.walkTokens||exports.walkTokens;function zhe(o){return JSON.stringify(o,Uhe)}function OM(o){let e=JSON.parse(o);return e=FM(e),e}function Uhe(o,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function FM(o,e=0){if(!o||e>200)return o;if(typeof o=="object"){switch(o.$mid){case 1:return Le.revive(o);case 2:return new RegExp(o.source,o.flags);case 17:return new Date(o.source)}if(o instanceof LI||o instanceof Uint8Array)return o;if(Array.isArray(o))for(let t=0;t<o.length;++t)o[t]=FM(o[t],e+1);else for(const t in o)Object.hasOwnProperty.call(o,t)&&(o[t]=FM(o[t],e+1))}return o}const jN=Object.freeze({image:({href:o,title:e,text:t})=>{let i=[],n=[];return o&&({href:o,dimensions:i}=Bhe(o),n.push(`src="${z0(o)}"`)),t&&n.push(`alt="${z0(t)}"`),e&&n.push(`title="${z0(e)}"`),i.length&&(n=n.concat(i)),"<img "+n.join(" ")+">"},paragraph({tokens:o}){return`<p>${this.parser.parseInline(o)}</p>`},link({href:o,title:e,tokens:t}){let i=this.parser.parseInline(t);return typeof o!="string"?"":(o===i&&(i=$N(i)),e=typeof e=="string"?z0($N(e)):"",o=$N(o),o=o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),`<a href="${o}" title="${e||o}" draggable="false">${i}</a>`)}});function eE(o,e={},t={}){const i=new K;let n=!1;const s=r3(e),r=function(p){let _;try{_=OM(decodeURIComponent(p))}catch{}return _?(_=HU(_,v=>{if(o.uris&&o.uris[v])return Le.revive(o.uris[v])}),encodeURIComponent(JSON.stringify(_))):p},a=function(p,_){const v=o.uris&&o.uris[p];let b=Le.revive(v);return _?p.startsWith(Oe.data+":")?p:(b||(b=Le.parse(p)),rI.uriToBrowserUri(b).toString(!0)):!b||Le.parse(p).toString()===b.toString()?p:(b.query&&(b=b.with({query:r(b.query)})),b.toString())},l=new Fj;l.image=jN.image,l.link=jN.link,l.paragraph=jN.paragraph;const c=[],d=[];if(e.codeBlockRendererSync?l.code=({text:p,lang:_})=>{const v=PM.nextId(),b=e.codeBlockRendererSync(ZB(_),p);return d.push([v,b]),`<div class="code" data-code="${v}">${Ob(p)}</div>`}:e.codeBlockRenderer&&(l.code=({text:p,lang:_})=>{const v=PM.nextId(),b=e.codeBlockRenderer(ZB(_),p);return c.push(b.then(C=>[v,C])),`<div class="code" data-code="${v}">${Ob(p)}</div>`}),e.actionHandler){const p=function(b){let C=b.target;if(!(C.tagName!=="A"&&(C=C.parentElement,!C||C.tagName!=="A")))try{let w=C.dataset.href;w&&(o.baseUri&&(w=KN(Le.from(o.baseUri),w)),e.actionHandler.callback(w,b))}catch(w){Pe(w)}finally{b.preventDefault()}},_=e.actionHandler.disposables.add(new Je(s,"click")),v=e.actionHandler.dispo
`,o.html=e=>"",o.heading=function({tokens:e}){return this.parser.parseInline(e)+``},o.hr=()=>"",o.list=function({items:e}){return e.map(t=>this.listitem(t)).join(``)+``},o.listitem=({text:e})=>e+``,o.paragraph=function({tokens:e}){return this.parser.parseInline(e)+``},o.table=function({header:e,rows:t}){return e.map(i=>this.tablecell(i)).join(" ")+``+t.map(i=>i.map(n=>this.tablecell(n)).join(" ")).join(``)+``},o.tablerow=({text:e})=>e,o.tablecell=function({tokens:e}){return this.parser.parseInline(e)},o.strong=({text:e})=>e,o.em=({text:e})=>e,o.codespan=({text:e})=>e,o.br=e=>``,o.del=({text:e})=>e,o.image=e=>"",o.text=({text:e})=>e,o.link=({text:e})=>e,o}const Xhe=new Fa(o=>Yhe());function yL(o){let e="";return o.forEach(t=>{e+=t.raw}),e}function Bj(o){var e,t;if(o.tokens)for(let i=o.tokens.length-1;i>=0;i--){const n=o.tokens[i];if(n.type==="text"){const s=n.raw.split(``),r=s[s.length-1];if(r.includes("`"))return sue(o);if(r.includes("**"))return due(o);if(r.match(/\*\w/))return oue(o);if(r.match(/(^|\s)__\w/))return hue(o);if(r.match(/(^|\s)_\w/))return rue(o);if(Qhe(r)||Jhe(r)&&o.tokens.slice(0,i).some(a=>a.type==="text"&&a.raw.match(/\[[^\]]*$/))){const a=o.tokens.slice(i+1);return((e=a[0])==null?void 0:e.type)==="link"&&((t=a[1])==null?void 0:t.type)==="text"&&a[1].raw.match(/^ *"[^"]*$/)||r.match(/^[^"]* +"[^"]*$/)?lue(o):aue(o)}else if(r.match(/(^|\s)\[\w*/))return cue(o)}}}function Qhe(o){return!!o.match(/(^|\s)\[.*\]\(\w*/)}function Jhe(o){return!!o.match(/^[^\[]*\]\([^\)]*$/)}function eue(o){var l;const e=o.items[o.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0;let i;if((t==null?void 0:t.type)==="text"&&!("inRawBlock"in e)&&(i=Bj(t)),!i||i.type!=="paragraph")return;const n=yL(o.items.slice(0,-1)),s=(l=e.raw.match(/^(\s*(-|\d+\.|\*) +)/))==null?void 0:l[0];if(!s)return;const r=s+yL(e.tokens.slice(0,-1))+i.raw,a=JI(n+r)[0];if(a.type==="list")return a}const tue=3;function iue(o){for(let e=0;e<tue;e++){const t=nue(o);if(t)o=t;else break}return o}function nue(o){let e,t;for(e=0;e<o.length;e++){const i=o[e];if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=uue(o.slice(e));break}if(e===o.length-1&&i.type==="list"){const n=eue(i);if(n){t=[n];break}}if(e===o.length-1&&i.type==="paragraph"){const n=Bj(i);if(n){t=[n];break}}}if(t){const i=[...o.slice(0,e),...t];return i.links=o.links,i}return null}function sue(o){return cu(o,"`")}function oue(o){return cu(o,"*")}function rue(o){return cu(o,"_")}function aue(o){return cu(o,")")}function lue(o){return cu(o,'")')}function cue(o){return cu(o,"](https://microsoft.com)")}function due(o){return cu(o,"**")}function hue(o){return cu(o,"__")}function cu(o,e){const t=yL(Array.isArray(o)?o:[o]);return JI(t+e)[0]}function uue(o){const e=yL(o),t=e.split(`
`);let i,n=!1;for(let s=0;s<t.length;s++){const r=t[s].trim();if(typeof i>"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(s!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const s=n?t.slice(0,-1).join(``):e,r=!!s.match(/\|\s*$/),a=s+(r?"":"|")+`|${" --- |".repeat(i)}`;return JI(a)}}function YB(o,e){return Nz(o,e),be(()=>Tz(o))}let Hj={showHover:()=>{},hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>null,showManagedHover:()=>{}};function gue(o){Hj=o}function qa(){return Hj}class fue{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function ds(o,e,t){return Math.min(Math.max(o,e),t)}class Vj{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class mue{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}class Lu extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}var Fn;(function(o){function e(s,r){if(s.start>=r.end||r.start>=s.end)return{start:0,end:0};const a=Math.max(s.start,r.start),l=Math.min(s.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}o.intersect=e;function t(s){return s.end-s.start<=0}o.isEmpty=t;function i(s,r){return!t(e(s,r))}o.intersects=i;function n(s,r){const a=[],l={start:s.start,end:Math.min(r.start,s.end)},c={start:Math.max(r.end,s.start),end:s.end};return t(l)||a.push(l),t(c)||a.push(c),a}o.relativeComplement=n})(Fn||(Fn={}));function XB(o,e){const t=[];for(const i of e){if(o.start>=i.range.end)continue;if(o.end<i.range.start)break;const n=Fn.intersect(o,i.range);Fn.isEmpty(n)||t.push({range:n,size:i.size})}return t}function BM({start:o,end:e},t){return{start:o+t,end:e+t}}function pue(o){const e=[];let t=null;for(const i of o){const n=i.range.start,s=i.range.end,r=i.size;if(t&&r===t.size){t.range.end=s;continue}t={range:{start:n,end:s},size:r},e.push(t)}return e}function _ue(...o){return pue(o.reduce((e,t)=>e.concat(t),[]))}class vue{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,s=XB({start:0,end:e},this.groups),r=XB({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:BM(l.range,n),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=_ue(s,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(const n of this.groups){const s=n.range.end-n.range.start,r=i+s*n.size;if(e<r)return t+Math.floor((e-i)/n.size);t+=s,i=r}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const s=n.range.end-n.range.start,r=i+s;if(e<r)return this._paddingTop+t+(e-i)*n.size;t+=s*n.size,i=r}return-1}}class bue{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const n=ne(".monaco-list-row"),r=this.getRenderer(e).renderTemplate(n);t={domNode:n,templateId:e,templateData:r}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const t of this.transactionNodesPendingRemoval)this.doRemoveNode(t);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTempla
.monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } `),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=Gc(e.listFocusAndSelectionOutline,Gc(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(` .monaco-drag-image, .monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } `);const s=Gc(e.listSelectionOutline,e.listInactiveFocusOutline??"");s&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(` .monaco-list${t}.drop-target, .monaco-list${t} .monaco-list-rows.drop-target, .monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; } `),e.listDropBetweenBackground&&(i.push(` .monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before, .monaco-list${t} .monaco-list-row.drop-target-before::before { content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`),i.push(` .monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after, .monaco-list${t} .monaco-list-row.drop-target-after::after { content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px; background-color: ${e.listDropBetweenBackground}; }`)),e.tableColumnsBorder&&i.push(` .monaco-table > .monaco-split-view2, .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { border-color: ${e.tableColumnsBorder}; }
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2, .monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before { border-color: transparent; } `),e.tableOddRowsBackgroundColor&&i.push(` .monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr, .monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr { background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=i.join(``)}}const Rue={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:Y.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:Y.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:Y.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},Mue={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Aue(o,e){const t=o.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&o[n]===e-(t-n);)i.push(o[n--]);for(i.reverse(),n=t;n<o.length&&o[n]===e+(n-t);)i.push(o[n++]);return i}function HM(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){t.push(o[i]),i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):t.push(e[n++]);return t}function Pue(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):n++;return t}const JB=(o,e)=>o-e;class Oue{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const r of this.renderers)r.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){var r;let s=0;for(const a of this.renderers)(r=a.disposeElement)==null||r.call(a,e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class Fue{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new K}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),s=n&&typeof n!="string"?n:hr(n);i.disposables.add(Ae(a=>{this.setAriaLabel(a.readObservable(s),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class Wue{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,n;(n=(i=this.dnd).onDragStart)==null||n.call(i,e,t)}onDragOver(e,t,i,n,s){return this.dnd.onDragOver(e,t,i,n,s)}onDragLeave(e,t,i,n){var s,r;(r=(s=this.dnd).onDragLeave)==null||r.call(s,e,t,i,n)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}drop(e,t,i,n,s){this.dnd.drop(e,t,i,n,s)}dispose(){this.dnd.dispose()}}class Xo{get onDidChangeFocus(){return re.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return re.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick
`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=Gc(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=ke(this.selectElement),i=Si(this.selectElement),n=ke(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-ul.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,g=h+s+u,f=Math.floor((r-s-u)/this.getHeight()),p=Math.floor((a-s-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.top<ul.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||f<1&&p<1?!1:(f<ul.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&p>f&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendCh
`&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new qe(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new Yr(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}class p3{constructor(e){this.edits=e,Af(()=>ZF(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}apply(e){let t="",i=new F(1,1);for(const s of this.edits){const r=s.range,a=r.getStartPosition(),l=r.getEndPosition(),c=n9(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=s.text,i=l}const n=n9(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new Xue(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const s of this.edits){const r=Yr.ofText(s.text),a=F.lift({lineNumber:s.range.startLineNumber+i,column:s.range.startColumn+(s.range.startLineNumber===t?n:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-s.range.endLineNumber,n=l.endColumn-s.range.endColumn,t=s.range.endLineNumber}return e}}class Ul{constructor(e,t){this.range=e,this.text=t}toSingleEditOperation(){return{range:this.range,text:this.text}}}function n9(o,e){if(o.lineNumber===e.lineNumber&&o.column===Number.MAX_SAFE_INTEGER)return k.fromPositions(e,e);if(!o.isBeforeOrEqual(e))throw new ft("start must be before end");return new k(o.lineNumber,o.column,e.lineNumber,e.column)}class Yj{get endPositionExclusive(){return this.length.addToPosition(new F(1,1))}}class Xue extends Yj{constructor(e){super(),this.value=e,this._t=new Yue(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class is{static inverse(e,t,i){const n=[];let s=1,r=1;for(const l of e){const c=new is(new Re(s,l.original.startLineNumber),new Re(r,l.modified.startLineNumber));c.modified.isEmpty||n.push(c),s=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new is(new Re(s,t+1),new Re(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const s of e){const r=s.original.intersect(t),a=s.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new is(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new is(this.modified,this.original)}join(e){return new is(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new No(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new ft("not a valid diff");return new No(new k(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new k(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new No(new k(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new k(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(s9(this.original.endLineNumberExclusive,e)&&s9(this.modified.endLineNumberExclusive,t))return new No(new k(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new k(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new No(k.fromPositions(new F(this.original.startLineNumber,1),Tm(new F(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),k.fromPositions(new F(this.modified.startLineNumber,1),Tm(new F(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new No(k.fromPositions(Tm(new F(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Tm(new F(this.origi
`)}}const cm=new ege;ri.add(Jue.IconContribution,cm);function zt(o,e,t,i){return cm.registerIcon(o,e,t,i)}function Xj(){return cm}function tge(){const o=aU();for(const e in o){const t="\\"+o[e].toString(16);cm.registerIcon(e,{fontCharacter:t})}}tge();const Qj="vscode://schemas/icons",Jj=ri.as(xI.JSONContribution);Jj.registerSchema(Qj,cm.getIconSchema());const a9=new Lt(()=>Jj.notifySchemaChanged(Qj),200);cm.onDidChange(()=>{a9.isScheduled()||a9.schedule()});const eK=zt("widget-close",ee.close,m("widgetClose","Icon for the close action in widgets."));zt("goto-previous-location",ee.arrowUp,m("previousChangeIcon","Icon for goto previous editor location."));zt("goto-next-location",ee.arrowDown,m("nextChangeIcon","Icon for goto next editor location."));xe.modify(ee.sync,"spin");xe.modify(ee.loading,"spin");var _3=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},v3=function(o,e){return function(t,i){e(t,i,o)}};const ige=zt("diff-review-insert",ee.add,m("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),nge=zt("diff-review-remove",ee.remove,m("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),sge=zt("diff-review-close",ee.close,m("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));var f_;let gg=(f_=class extends V{constructor(e,t,i,n,s,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=s,this._height=r,this._diffs=a,this._models=l,this._instantiationService=c,this._state=lu(this,(d,h)=>{const u=this._visible.read(d);if(this._parentNode.style.visibility=u?"visible":"hidden",!u)return null;const g=h.add(this._instantiationService.createInstance(UM,this._diffs,this._models,this._setVisible,this._canClose)),f=h.add(this._instantiationService.createInstance($M,this._parentNode,g,this._width,this._height,this._models));return{model:g,view:f}}).recomputeInitiallyAndOnChange(this._store)}next(){si(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){si(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){si(e=>{this._setVisible(!1,e)})}},f_._ttPolicy=md("diffReview",{createHTML:e=>e}),f_);gg=_3([v3(8,Ce)],gg);let UM=class extends V{constructor(e,t,i,n,s){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=s,this._groups=je(this,[]),this._currentGroupIdx=je(this,0),this._currentElementIdx=je(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))==null?void 0:l.lines[r]}),this._register(Ae(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=oge(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());si(c=>{const d=this._models.getModifiedPosition();if(d){const h=l.findIndex(u=>(d==null?void 0:d.lineNumber)<u.range.modified.endLineNumberExclusive);h!==-1&&this._currentGroupIdx.set(h,c)}this._groups.set(l,c)})})),this._register(Ae(r=>{const a=this.currentElement.read(r);(a==null?void 0:a.type)===us.Deleted?this._accessibilitySignalService.playSignal(To.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===us.Added&&this._accessibilitySignalService.playSignal(To.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ae(r=>{const a=this.currentElement.read(r);if(a&&a.type!==us.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(k.fromPositions(new F(l,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.lengt
`);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=n}computeSimilarity(e){let t=0;const i=Math.max(this.histogram.length,e.histogram.length);for(let n=0;n<i;n++)t+=Math.abs((this.histogram[n]??0)-(e.histogram[n]??0));return 1-t/(this.totalCount+e.totalCount)}};LC.chrKeys=new Map;let NL=LC;class pge{compute(e,t,i=Tw.instance,n){if(e.length===0||t.length===0)return Yc.trivial(e,t);const s=new GN(e.length,t.length),r=new GN(e.length,t.length),a=new GN(e.length,t.length);for(let f=0;f<e.length;f++)for(let p=0;p<t.length;p++){if(!i.isValid())return Yc.trivialTimedOut(e,t);const _=f===0?0:s.get(f-1,p),v=p===0?0:s.get(f,p-1);let b;e.getElement(f)===t.getElement(p)?(f===0||p===0?b=0:b=s.get(f-1,p-1),f>0&&p>0&&r.get(f-1,p-1)===3&&(b+=a.get(f-1,p-1)),b+=n?n(f,p):1):b=-1;const C=Math.max(_,v,b);if(C===b){const w=f>0&&p>0?a.get(f-1,p-1):0;a.set(f,p,w+1),r.set(f,p,3)}else C===_?(a.set(f,p,0),r.set(f,p,1)):C===v&&(a.set(f,p,0),r.set(f,p,2));s.set(f,p,C)}const l=[];let c=e.length,d=t.length;function h(f,p){(f+1!==c||p+1!==d)&&l.push(new Zi(new qe(f+1,c),new qe(p+1,d))),c=f,d=p}let u=e.length-1,g=t.length-1;for(;u>=0&&g>=0;)r.get(u,g)===3?(h(u,g),u--,g--):r.get(u,g)===1?u--:g--;return h(-1,-1),l.reverse(),new Yc(l,!1)}}class sK{compute(e,t,i=Tw.instance){if(e.length===0||t.length===0)return Yc.trivial(e,t);const n=e,s=t;function r(p,_){for(;p<n.length&&_<s.length&&n.getElement(p)===s.getElement(_);)p++,_++;return p}let a=0;const l=new _ge;l.set(0,r(0,0));const c=new vge;c.set(0,l.get(0)===0?null:new d9(null,0,0,l.get(0)));let d=0;e:for(;;){if(a++,!i.isValid())return Yc.trivialTimedOut(n,s);const p=-Math.min(a,s.length+a%2),_=Math.min(a,n.length+a%2);for(d=p;d<=_;d+=2){const v=d===_?-1:l.get(d+1),b=d===p?-1:l.get(d-1)+1,C=Math.min(Math.max(v,b),n.length),w=C-d;if(C>n.length||w>s.length)continue;const S=r(C,w);l.set(d,S);const L=C===v?c.get(d+1):c.get(d-1);if(c.set(d,S!==C?new d9(L,C,w,S-C):L),l.get(d)===n.length&&l.get(d)-d===s.length)break e}}let h=c.get(d);const u=[];let g=n.length,f=s.length;for(;;){const p=h?h.x+h.length:0,_=h?h.y+h.length:0;if((p!==g||_!==f)&&u.push(new Zi(new qe(p,g),new qe(_,f))),!h)break;g=h.x,f=h.y,h=h.prev}return u.reverse(),new Yc(u,!1)}}class d9{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class _ge{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class vge{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class TL{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let s=e[n-1],r=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(r=this.range.startColumn-1,s=s.substring(r)),this.lineStartOffsets.push(r);let a=0;if(!i){const c=s.trimStart();a=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(a);const l=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-r-a,s.length):s.length;for(let c=0;c<l;c++)this.elements.push(s.charCodeAt(c));n<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new qe(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(t=>String.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=u
`).length>=15&&wge(h,g=>g.length>=2)>=2}),r=kge(o,r),r}function wge(o,e){let t=0;for(const i of o)e(i)&&t++;return t}function Sge(o,e,t,i){const n=[],s=o.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new NL(l.original,e,l)),r=new Set(o.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new NL(l.modified,t,l))),a=new Set;for(const l of s){let c=-1,d;for(const h of r){const u=l.computeSimilarity(h);u>c&&(c=u,d=h)}if(c>.9&&d&&(r.delete(d),n.push(new is(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function yge(o,e,t,i,n,s){const r=[],a=new JF;for(const u of o)for(let g=u.original.startLineNumber;g<u.original.endLineNumberExclusive-2;g++){const f=`${e[g-1]}:${e[g+1-1]}:${e[g+2-1]}`;a.add(f,{range:new Re(g,g+3)})}const l=[];o.sort(vs(u=>u.modified.startLineNumber,$r));for(const u of o){let g=[];for(let f=u.modified.startLineNumber;f<u.modified.endLineNumberExclusive-2;f++){const p=`${t[f-1]}:${t[f+1-1]}:${t[f+2-1]}`,_=new Re(f,f+3),v=[];a.forEach(p,({range:b})=>{for(const w of g)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){w.originalLineRange=new Re(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Re(w.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(w);return}const C={modifiedLineRange:_,originalLineRange:b};l.push(C),v.push(C)}),g=v}if(!s.isValid())return[]}l.sort(SU(vs(u=>u.modifiedLineRange.length,$r)));const c=new cr,d=new cr;for(const u of l){const g=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,f=c.subtractFrom(u.modifiedLineRange),p=d.subtractFrom(u.originalLineRange).getWithDelta(g),_=f.getIntersection(p);for(const v of _.ranges){if(v.length<3)continue;const b=v,C=v.delta(-g);r.push(new is(C,b)),c.addRange(b),d.addRange(C)}}r.sort(vs(u=>u.original.startLineNumber,$r));const h=new cL(o);for(let u=0;u<r.length;u++){const g=r[u],f=h.findLastMonotonous(L=>L.original.startLineNumber<=g.original.startLineNumber),p=F_(o,L=>L.modified.startLineNumber<=g.modified.startLineNumber),_=Math.max(g.original.startLineNumber-f.original.startLineNumber,g.modified.startLineNumber-p.modified.startLineNumber),v=h.findLastMonotonous(L=>L.original.startLineNumber<g.original.endLineNumberExclusive),b=F_(o,L=>L.modified.startLineNumber<g.modified.endLineNumberExclusive),C=Math.max(v.original.endLineNumberExclusive-g.original.endLineNumberExclusive,b.modified.endLineNumberExclusive-g.modified.endLineNumberExclusive);let w;for(w=0;w<_;w++){const L=g.original.startLineNumber-w-1,x=g.modified.startLineNumber-w-1;if(L>i.length||x>n.length||c.contains(x)||d.contains(L)||!g9(i[L-1],n[x-1],s))break}w>0&&(d.addRange(new Re(g.original.startLineNumber-w,g.original.startLineNumber)),c.addRange(new Re(g.modified.startLineNumber-w,g.modified.startLineNumber)));let S;for(S=0;S<C;S++){const L=g.original.endLineNumberExclusive+S,x=g.modified.endLineNumberExclusive+S;if(L>i.length||x>n.length||c.contains(x)||d.contains(L)||!g9(i[L-1],n[x-1],s))break}S>0&&(d.addRange(new Re(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+S)),c.addRange(new Re(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+S))),(w>0||S>0)&&(r[u]=new is(new Re(g.original.startLineNumber-w,g.original.endLineNumberExclusive+S),new Re(g.modified.startLineNumber-w,g.modified.endLineNumberExclusive+S)))}return r}function g9(o,e,t){if(o.trim()===e.trim())return!0;if(o.length>300&&e.length>300)return!1;const n=new sK().compute(new TL([o],new k(1,1,1,o.length),!1),new TL([e],new k(1,1,1,e.length),!1),t);let s=0;const r=Zi.invert(n.diffs,o.length);for(const d of r)d.seq1Range.forEach(h=>{GM(o.charCodeAt(h))||s++});function a(d){let h=0;for(let u=0;u<o.length;u++)GM(d.charCodeAt(u))||h++;return h}const l=a(o.length>e.length?o:e);return s/l>.6&&l>10}function Lge(o){if(o.length===0)return o;o.sort(vs(t=>t.original.startLineNumber,$r));const e=[o[0]];for(let t=1;t<o.length;t++){co
`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}};function _9(o){let e=0;for(;e<o.length&&(o.charCodeAt(e)===32||o.charCodeAt(e)===9);)e++;return e}class XS{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class oK{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class rK{constructor(){this.dynamicProgrammingDiffing=new pge,this.myersDiffingAlgorithm=new sK}computeDiff(e,t,i){if(e.length<=1&&Qt(e,t,(S,L)=>S===L))return new XS([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new XS([new Uo(new Re(1,e.length+1),new Re(1,t.length+1),[new No(new k(1,1,e.length,e[e.length-1].length+1),new k(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?Tw.instance:new mge(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,r=new Map;function a(S){let L=r.get(S);return L===void 0&&(L=r.size,r.set(S,L)),L}const l=e.map(S=>a(S.trim())),c=t.map(S=>a(S.trim())),d=new p9(l,e),h=new p9(c,t),u=d.length+h.length<1700?this.dynamicProgrammingDiffing.compute(d,h,n,(S,L)=>e[S]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,h,n);let g=u.diffs,f=u.hitTimeout;g=ZM(d,h,g),g=Nge(d,h,g);const p=[],_=S=>{if(s)for(let L=0;L<S;L++){const x=v+L,D=b+L;if(e[x]!==t[D]){const N=this.refineDiff(e,t,new Zi(new qe(x,x+1),new qe(D,D+1)),n,s);for(const z of N.mappings)p.push(z);N.hitTimeout&&(f=!0)}}};let v=0,b=0;for(const S of g){Af(()=>S.seq1Range.start-v===S.seq2Range.start-b);const L=S.seq1Range.start-v;_(L),v=S.seq1Range.endExclusive,b=S.seq2Range.endExclusive;const x=this.refineDiff(e,t,S,n,s);x.hitTimeout&&(f=!0);for(const D of x.mappings)p.push(D)}_(e.length-v);const C=v9(p,e,t);let w=[];return i.computeMoves&&(w=this.computeMoves(C,e,t,l,c,n,s)),Af(()=>{function S(x,D){if(x.lineNumber<1||x.lineNumber>D.length)return!1;const N=D[x.lineNumber-1];return!(x.column<1||x.column>N.length+1)}function L(x,D){return!(x.startLineNumber<1||x.startLineNumber>D.length+1||x.endLineNumberExclusive<1||x.endLineNumberExclusive>D.length+1)}for(const x of C){if(!x.innerChanges)return!1;for(const D of x.innerChanges)if(!(S(D.modifiedRange.getStartPosition(),t)&&S(D.modifiedRange.getEndPosition(),t)&&S(D.originalRange.getStartPosition(),e)&&S(D.originalRange.getEndPosition(),e)))return!1;if(!L(x.modified,t)||!L(x.original,e))return!1}return!0}),new XS(C,w,f)}computeMoves(e,t,i,n,s,r,a){return Cge(e,t,i,n,s,r).map(d=>{const h=this.refineDiff(t,i,new Zi(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),u=v9(h.mappings,t,i,!0);return new oK(d,u)})}refineDiff(e,t,i,n,s){const a=Mge(i).toRangeMapping2(e,t),l=new TL(e,a.originalRange,s),c=new TL(t,a.modifiedRange,s),d=l.length+c.length<500?this.dynamicProgrammingDiffing.compute(l,c,n):this.myersDiffingAlgorithm.compute(l,c,n);let h=d.diffs;return h=ZM(l,c,h),h=Ige(l,c,h),h=Dge(l,c,h),h=Tge(l,c,h),{mappings:h.map(g=>new No(l.translateRange(g.seq1Range),c.translateRange(g.seq2Range))),hitTimeout:d.hitTimeout}}}function v9(o,e,t,i=!1){const n=[];for(const s of i5(o.map(r=>Rge(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=s[0],a=s[s.length-1];n.push(new Uo(r.original.join(a.original),r.modified.join(a.modified),s.map(l=>l.innerChanges[0])))}return Af(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length-n[n.length-1].modified.endLineNumberExclusive!==e.length-n[n.length-1].original.endLineNumberExclusive)?!1:ZF(n,(s,r)=>r.original.startLineNumber-s.original.endLineNumberExclusive===r.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive<r.original.startLineNumber&&s.modified.endLineNumberExclusive<r.modified.startLineNumber)),n}function Rge(o,e,t){let i=0,n=0;o.modifiedRange.endColumn===1&&o.originalRange.endColumn===1&&o.originalRange.startLineNumber+i<=o.originalRange.endLineNumber&&o.modifiedRange.startLineNumber+i<=o.modifiedRange.endLineNumber&&(n=-1),o.modifiedRange.startColumn-1>=t[o.modifiedRange.startLineNumber-1].length&&o.originalRange.startCo
`:`\r`),await this._clipboardService.writeText(C)})),i.getOption(92)||_.push(new co("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),_},autoSelectFirstItem:!0})};this._register(ci(this._diffActions,"mousedown",f=>{if(!f.leftButton)return;const{top:p,height:_}=Si(this._diffActions),v=Math.floor(d/3);f.preventDefault(),g(f.posx,p+_+v)})),this._register(i.onMouseMove(f=>{(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(f=>{f.event.leftButton&&(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()&&(f.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,d),g(f.event.posx,f.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=Si(e),s=t-n,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;c<this._viewLineCounts.length;c++)if(l+=this._viewLineCounts[c],r<l)return c}return r}}const b9=md("diffEditorWidget",{createHTML:o=>o});function Bge(o,e,t,i){yn(i,e.fontInfo);const n=t.length>0,s=new _v(1e4);let r=0,a=0;const l=[];for(let u=0;u<o.lineTokens.length;u++){const g=u+1,f=o.lineTokens[u],p=o.lineBreakData[u],_=ms.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(p){let v=0;for(const b of p.breakOffsets){const C=f.sliceAndInflate(v,b,0);r=Math.max(r,C9(a,C,ms.extractWrapped(_,v,b),n,o.mightContainNonBasicASCII,o.mightContainRTL,e,s)),a++,v=b}l.push(p.breakOffsets.length)}else l.push(1),r=Math.max(r,C9(a,f,_,n,o.mightContainNonBasicASCII,o.mightContainRTL,e,s)),a++}r+=e.scrollBeyondLastColumn;const c=s.build(),d=b9?b9.createHTML(c):c;i.innerHTML=d;const h=r*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:h,viewLineCounts:l}}class Hge{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class L3{static fromEditor(e){var s;const t=e.getOptions(),i=t.get(50),n=t.get(146);return new L3(((s=e.getModel())==null?void 0:s.getOptions().tabSize)||0,i,t.get(33),i.typicalHalfwidthCharacterWidth,t.get(105),t.get(67),n.decorationsWidth,t.get(118),t.get(100),t.get(95),t.get(51))}constructor(e,t,i,n,s,r,a,l,c,d,h){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h}}function C9(o,e,t,i,n,s,r,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(o*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=Ko.isBasicASCII(l,n),d=Ko.containsRTL(l,c,s),h=P1(new au(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==qh.OFF,null),a);return a.appendString("</div>"),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}const _d=Qe("clipboardService"),vd=Qe("contextViewService"),So=Qe("contextMenuService");var Vge=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},w9=function(o,e){return function(t,i){e(t,i,o)}};let XM=class extends V{constructor(e,t,i,n,s,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIg
[{1}] {2}`,n,E3.modifierLabels[lo].altKey,c)}return n}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&afe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(xe.isThemeIcon(n)){const s=xe.asClassNameArray(n);i.classList.add(...s),this._itemClassDispose.value=be(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=R_(this._themeService.getColorTheme().type)?nd(n.dark):nd(n.light),i.classList.add("icon"),this._itemClassDispose.value=Ur(be(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};eu=nE([Ws(2,vt),Ws(3,Ni),Ws(4,De),Ws(5,Ki),Ws(6,So),Ws(7,Co)],eu);class N3 extends eu{render(e){var t;this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",((t=this._options)==null?void 0:t.useComma)??!1)}updateLabel(){var t;const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const i=N3._symbolPrintEnter(e);(t=this._options)!=null&&t.conversational?this.label.textContent=m({key:"content2",comment:['A label with keybindg like "ESC to dismiss"']},"{1} to {0}",this._action.label,i):this.label.textContent=m({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,i)}}static _symbolPrintEnter(e){var t;return(t=e.getLabel())==null?void 0:t.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let JM=class extends AL{constructor(e,t,i,n,s){const r={...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!1,classNames:(t==null?void 0:t.classNames)??(xe.isThemeIcon(e.item.icon)?xe.asClassName(e.item.icon):void 0),keybindingProvider:(t==null?void 0:t.keybindingProvider)??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},n,r),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),ht(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!xe.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=R_(this._themeService.getColorTheme().type)?nd(i.dark):nd(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};JM=nE([Ws(2,vt),Ws(3,So),Ws(4,Ki)],JM);let eA=class extends ba{constructor(e,t,i,n,s,r,a,l){super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const d=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;d&&(c=e.actions.find(u=>d===u.id)),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(eu,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!0,classNames:(t==null?void 0:t.classNames)??["codicon","codicon-chevron-down"],actionRunner:(t==null?void 0:t.actionRunner)??new Mf};this._dropdown=new AL(e,e.actions,this._contextMenuService,h),this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof ho&&this.update(u.action)}))}update(e){var t;(t=this._options)!=null&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(eu,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Mf{async runAction(i,n){await i.run(void 0)}},this._container&&this._defaultAction.render(qF(this._container,ne(".action-container")))}_getDefaultActionKeybindingLabel(e){var i;let t;if((i=this._options)!=null
`),split:o=>o.split(`\r`),parse:o=>lE.split(o).filter(e=>!e.startsWith("#"))}),gl=class gl{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+gl.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new gl((this.value?[this.value,...e]:e).join(gl.sep))}};gl.sep=".",gl.None=new gl("@@none@@"),gl.Empty=new gl("");let Xt=gl;const A9={EDITORS:"CodeEditors",FILES:"CodeFiles"};class sme{}const ome={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ri.add(ome.DragAndDropContribution,new sme);const xC=class xC{constructor(){}static getInstance(){return xC.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};xC.INSTANCE=new xC;let fA=xC;function LK(o){const e=new wK;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,T3(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,rme(n))}}return e}function rme(o){const e=o.path?Le.parse(o.path):void 0;return nme(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const ame=Object.freeze([A9.EDITORS,A9.FILES,xw.RESOURCES,xw.INTERNAL_URI_LIST]);function kK(o,e=!1){const t=LK(o),i=t.get(xw.INTERNAL_URI_LIST);if(i)t.replace(wi.uriList,i);else if(e||!t.has(wi.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(Le.file(a).toString()):n.push(Le.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(wi.uriList,T3(lE.create(n)))}for(const n of ame)t.delete(n);return t}const Z1=Qe("IWorkspaceEditService");class R3{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(vh.is(t))return vh.lift(t);if(s_.is(t))return s_.lift(t);throw new Error("Unsupported edit")})}}class vh extends R3{static is(e){return e instanceof vh?!0:an(e)&&Le.isUri(e.resource)&&an(e.textEdit)}static lift(e){return e instanceof vh?e:new vh(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class s_ extends R3{static is(e){return e instanceof s_?!0:an(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof s_?e:new s_(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}class lme{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){const t=e.charCodeAt(0),i=this._value.charCodeAt(this._pos);return t-i}value(){return this._value[this._pos]}}class cme{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?OF(e,this._value,0,e.length,this._from,this._to):D1(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class dme{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(t===47||this._splitOnBackslash&&t===92)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?OF(e,this._value,0,e.length,this._from,this._to):D1(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class hme{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,
`):o}function H9(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?m("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function qL(o=null,e=!1){if(!o)return m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=qr(o),i=qL(t[0],e);return t.length>1?m("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Hs(o))return o;if(o.detail){const t=o.detail;if(t.error)return JN(t.error,e);if(t.exception)return JN(t.exception,e)}return o.stack?JN(o,e):o.message?o.message:m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var AK=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},r_=function(o,e){return function(t,i){e(t,i,o)}},yA,Fg;let LA=(Fg=class extends V{constructor(e,t,i,n,s,r,a,l,c,d){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=d,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(be(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(be(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(h=>{s.containsPosition(h.position)||this.dispose()})),this._register(re.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ne(".post-edit-widget"),this.button=this._register(new KL(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register($(this.domNode,ie.CLICK,()=>this.showSelector()))}getId(){return yA.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Si(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>vg({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},yA=Fg,Fg.baseId="editor.widget.postEditWidget",Fg);LA=yA=AK([r_(7,So),r_(8,De),r_(9,vt)],LA);let GL=class extends V{constructor(e,t,i,n,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new tn),this._register(re.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async _=>{const v=this._editor.getModel();v&&(await v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:t.allEdits},i,n,s))},c=(_,v)=>{wr(_)||(this._notificationService.error(v),i&&this.show(e[0],t,l))};let d;try{d=await n(a,s)}catch(_){return c(_,m("resolveError",`Error resolving edit '{0}':{1}`,a.title,qL(_)))}if(s.isCancellationRequested)return;const h=NK(r.uri,e,d),u=e[0],g=r.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let f,p;try{f=await this._bulkEditService.apply(h,{editor:this._editor,token:s}),p=r.getDecorationRange(g[0])}catch(_){return c(_,m("applyError",`Error applying edit '{0}':{1}`,a.title,qL(_)))}finally{r.deltaDecorations(g,[])}s.isCancellationRequested||i&&f.isApplied&&t.allEdits.length>1&&this.show(p??u,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(LA,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)==null||e.showSelector()}};GL=AK([r_(4,Ce),r_(5,Z1),r_(6,Ni)],GL);var Eme=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Rm=function(o,e){return function(t,i){e(t,i,o)}},Wu;const PK="editor.changePasteType",B3=new de("pasteWidgetVisible",!1,m("pasteWidgetVisible","Whether the paste widget is showing")),eT="application/vnd.code.copyMetadata";var Wg;let dd=(Wg=class extends V{static get(e){return e.getContribution(Wu.ID)}constructor(e,t,i,n,s,r,a){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=s,this._quickInputService=r,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register($(l,"copy",c=>this.handleCopy(c))),this._register($(l,"cut",c=>this.handleCopy(c))),this._register($(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new $L("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(GL,"pasteIntoEditor",e,B3,{id:PK,label:m("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferred:e},gv().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(85).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var p,_,v,b;if(!this._editor.hasTextFocus()||((_=(p=this._clipboardService).clearInternalState)==null||_.call(p),!e.clipboardData||!this.isPasteAsEnabled()))return;const t=this._editor.getModel(),i=this._editor.getSelections();if(!t||!(i!=null&&i.length))return;const n=this._editor.getOption(37);let s=i;const r=i.length===1&&i[0].isEmpty();if(r){if(!n)return;s=[new k(s[0].startLineNumber,1,s[0].startLineNumber,1+t.getLineLength(s[0].startLineNumber))]}const a=(v=this._editor._getViewModel())==null?void 0:v.getPlainTextToCopy(i,n,An),c={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:r,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(C=>!!C.prepareDocumentPaste);if(!d.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:c});return}const h=LK(e.clipboardData),u=d.flatMap(C=>C.copyMimeTypes??[]),g=aE();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:u,defaultPastePayload:c});const f=Qi(async C=>{const w=qr(await Promise.all(d.map(async S=>{try{return await S.prepareDocumentPaste(t,s,h,C)}catch(L){console.error(L);return}})));w.reverse();for(const S of w)for(const[L,x]of S)h.replace(L,x);return h});(b=Wu._currentCopyOperation)==null||b.dataTransferPromise.cancel(),Wu._currentCopyOperation={handle:g,dataTransferPromise:f}}async handlePaste(e){var l,c,d;if(!e.clipboardData||!this._editor.hasTextFocus())return;(l=go.get(this._editor))==null||l.closeMessage(),(c=this._currentPasteOperation)==null||c.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!(i!=null&&i.length)||!t||this._editor.getOption(92)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const n=this.fetchCopyMetadata(e),s=kK(e.clipboardData);s.delete(eT);const r=[...e.clipboardData.types,...(n==null?void 0:n.providerCopyMimeTypes)??[],wi.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(h=>{var g,f;const u=(g=this._pasteAs
top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(``),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}};sD.InstanceCount=0;let $A=sD;class Av extends Yo{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...xe.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._hover=this._register(qa().setupManagedHover(e.hoverDelegate??Ds("mouse"),this.domNode,this._opts.title)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const B_e=m("caseDescription","Match Case"),H_e=m("wordsDescription","Match Whole Word"),V_e=m("regexDescription","Use Regular Expression");class Aq extends Av{constructor(e){super({icon:ee.caseSensitive,title:B_e+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Ds("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Pq extends Av{constructor(e){super({icon:ee.wholeWord,title:H_e+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Ds("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Oq extends Av{constructor(e){super({icon:ee.regex,title:V_e+e.appendTitle,isChecked:e.isChecked,hoverDelegate:e.hoverDelegate??Ds("element"),inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class z_e{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}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()}}class U_e{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(
`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=Sc(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=Sc(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=Sc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Sc(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i;return((i=this.stickyScrollController)==null?void 0:i.height)??0})}focusLast(e,t=Sc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=Sc(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}dispose(){var e;Et(this.disposables),(e=this.stickyScrollController)==null||e.dispose(),this.view.dispose()}}class e6{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new q_e(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,s){return i.sorter.compare(n.element,s.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=it.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=it.empty(),i){const n=new Set,s=new Set,r=l=>{var d;if(l.element===null)return;const c=l;if(n.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();s.add(h),this.nodesByIdentity.set(h,c)}(d=i.onDidCreateNode)==null||d.call(i,c)},a=l=>{var d;if(l.element===null)return;const c=l;if(n.has(c.element)||this.nodes.delete(c.element),this.identityProvider){co
`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class tb{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||uo(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class dk extends V{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new tb(X(e,ne(".monaco-icon-label")))),this.labelContainer=X(this.domNode.element,ne(".monaco-icon-label-container")),this.nameContainer=X(this.labelContainer,ne("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new Bve(this.nameContainer,!!t.supportIcons)):this.nameNode=new Fve(this.nameContainer),this.hoverDelegate=(t==null?void 0:t.hoverDelegate)??Ds("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],s=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i!=null&&i.iconPath){let l;!a||!Ji(a)?(l=ne(".monaco-icon-label-iconpath"),this.domNode.element.prepend(l)):l=a,l.style.backgroundImage=nd(i==null?void 0:i.iconPath)}else a&&a.remove();if(this.domNode.classNames=n,this.domNode.element.setAttribute("aria-label",r),this.labelContainer.classList.value="",this.labelContainer.classList.add(...s),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const l=this.getOrCreateDescriptionNode();l instanceof bh?(l.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(l.element,i==null?void 0:i.descriptionTitle)):(l.textContent=t&&(i!=null&&i.labelEscapeNewLines)?bh.escapeNewLines(t,[]):t||"",this.setupHover(l.element,(i==null?void 0:i.descriptionTitle)||""),l.empty=!t)}if(i!=null&&i.suffix||this.suffixNode){const l=this.getOrCreateSuffixNode();l.textContent=(i==null?void 0:i.suffix)??""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(s,r){Hs(r)?s.title=g3(r):r!=null&&r.markdownNotSupportedFallback?s.title=r.markdownNotSupportedFallback:s.removeAttribute("title")})(e,t);else{const n=qa().setupManagedHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new tb(MJ(this.nameContainer,ne("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new tb(X(e.element,ne("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new tb(X(this.labelContainer,ne("span.monaco-icon-description-container"))));(e=this.creationOptions)!=null&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new bh(X(t.element,ne("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new tb(X(t.element,ne("span.label-description"))))}return this.descriptionNode}}class Fve{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&uo(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=X(this.container,ne("a.label-name",{id:t==nu
`),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=mc._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new pe(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.ignore||i.push(ni.delete(new k(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||i.push(ni.insert(new F(t+s,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let s=1073741824,r,a;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let h=0;for(let u=0,g=t[l].commentStrOffset;h<s&&u<g;u++)h=mc.nextVisibleColumn(h,n,d.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const d=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<s&&r<a;r++)h=mc.nextVisibleColumn(h,n,d.charCodeAt(r)===9,1);h>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class b6 extends ue{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(ai);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(23),l=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));l.sort((d,h)=>k.compareRangesUsingStarts(d.selection,h.selection));let c=l[0];for(let d=1;d<l.length;d++){const h=l[d];c.selection.endLineNumber===h.selection.startLineNumber&&(c.index<h.index?h.ignoreFirstLine=!0:(c.ignoreFirstLine=!0,c=h))}for(const d of l)s.push(new mc(i,d.selection,r.indentSize,this._type,a.insertSpace,a.ignoreEmptyLines,d.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class cbe extends b6{constructor(){super(0,{id:"editor.action.commentLine",label:m("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:me.MenubarEditMenu,group:"5_insert",title:m({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class dbe extends b6{constructor(){super(1,{id:"editor.action.addCommentLine",label:m("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2081),weight:100}})}}class hbe extends b6{constructor(){super(2,{id:"editor.action.removeCommentLine",label:m("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2099),weight:100}})}}class ube extends ue{constructor(){super({id:"editor.action.blockComment",label:m("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:me.MenubarEditMenu,group:"5_insert",title:m({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(ai);if(!t.hasModel())return;const n=t.getOption(23),s=[],r=t.getSelections();for(const a of r)s.push(new lh(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}J(cbe);J(dbe);J(hbe);J(ube);var gbe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;i
`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(s===36){if(i++,i>=n)break;const r=o.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1<n){const l=o.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const Cd=new de("findWidgetVisible",!1);Cd.toNegated();const yE=new de("findInputFocussed",!1),w6=new de("replaceInputFocussed",!1),eS={primary:545,mac:{primary:2593}},tS={primary:565,mac:{primary:2613}},iS={primary:560,mac:{primary:2608}},nS={primary:554,mac:{primary:2602}},sS={primary:558,mac:{primary:2606}},Wt={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},ch=19999,Lbe=240;class sC{constructor(e,t){this._toDispose=new K,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new Jr,this._decorations=new pP(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new Lt(()=>{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Et(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},Lbe)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new k(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,ch);this._decorations.set(n,i);const s=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(s);if(r===0&&n.length>0){const a=fw(n.map(l=>l.range),l=>k.compareRangesUsingStarts(l,s)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decoratio
`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return T8(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return R8(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(N8|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{An&&Da&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(m("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(E8,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(``),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return T8(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return R8(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new vP(null,this._contextViewProvider,{width:Ybe,label:Obe,placeholder:Fbe,appendCaseSensitiveLabel:this._keybindingLabelFor(Wt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Wt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Wt.ToggleRegexCommand),validation:d=>{if(d.length===0||!this._findInput.getRegex())return null;try{return new RegExp(d,"gu"),null}catch(h){return{content:h.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>k8(this._keybindingService),inputBoxStyles:OL,toggleStyles:PL},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(d=>this._onFindInputKeyDown(d))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(d=>{d.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),d.preventDefault())})),this._register(this._findInput.onRegexKeyDown(d=>{d.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),d.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(d=>{this._tryUpdateHeight()&&this._showViewZone()})),ws&&this._register(this._findInput.onMouseDown(d=>this._onFindInputMouseDown(d))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const i=this._register(B_());this._prevBtn=this._register(new Bm({label:Wbe+this._keybindingLabelFor(Wt.PreviousMatchFindAction),icon:Mbe,hoverDelegate:i,onTrigger:()=>{Qd(this._codeEditor.getAction(Wt.PreviousMatchFindAction)).run().then(void 0,Pe)}},this._hoverService)),this._nextBtn=this._register(new Bm({label:Bbe+this._keybindingLabelFor(Wt.NextMatchFindAction),icon:Abe,hoverDelegate:i,onTrigger:()=>{Qd(this._codeEditor.getAction(Wt.NextMatchFindAction)).run().then(void 0,Pe)}},this._hoverService));const n=document.createElement("div");n.className="find-part",n.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",n.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Av({icon:Nbe,title:Hbe+this._keybindingLabelFor(Wt.ToggleSearchScopeCommand),isChecked:!1,hoverDelegate:i,inputActiveOptionBackground:he(M1),inputActiveOptionBorder:he(PI),inputActiveOptionForeground:he(OI)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let d=this._codeEditor.getSelections();d=d.map(h=>(h.endColumn===1&&h.endLineNumber>h.startLineNumber&&(h=h.setEndPosition(h.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(h.endLineNumber-1))),h.isEmpty()?null:h)).filter(h=>!!h),d.length&&this._state.change({searchScope:d},!0)}}else this._state.change({searchScope:null},!0)})),s.appendChild(this._toggleSelectionFind.domNode),this._cl
* 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. `,constraint:xG,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?yG(t,!1,s,r):Pv(t,!1,s,r)}}class MCe extends Kn{constructor(){super({id:"editor.unfoldRecursively",label:m("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2142),weight:100}})}invoke(e,t,i,n){Pv(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class ACe extends Kn{constructor(){super({id:"editor.fold",label:m("foldAction.label","Fold"),alias:"Fold",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. `,constraint:xG,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?uCe(t,!0,s):a==="up"?yG(t,!0,r||1,s):Pv(t,!0,r||1,s)}}class PCe extends Kn{constructor(){super({id:"editor.toggleFold",label:m("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);L6(t,1,n)}}class OCe extends Kn{constructor(){super({id:"editor.foldRecursively",label:m("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);Pv(t,!0,Number.MAX_VALUE,n)}}class FCe extends Kn{constructor(){super({id:"editor.toggleFoldRecursively",label:m("toggleFoldRecursivelyAction.label","Toggle Fold Recursively"),alias:"Toggle Fold Recursively",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,3114),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);L6(t,Number.MAX_VALUE,n)}}class WCe extends Kn{constructor(){super({id:"editor.foldAllBlockComments",label:m("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())x6(t,Zh.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+$o(a.blockCommentStartToken));k6(t,l,!0)}}}}class BCe extends Kn{constructor(){super({id:"editor.foldAllMarkerRegions",label:m("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())x6(t,Zh.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);k6(t,l,!0)}}}}class HCe extends Kn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:m("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())x6(t,Zh.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);k6(t,l,!1)}}}}class VCe extends Kn{constructor(){super({id:"editor.foldAllExcept",label:m("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2136),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);LG(t,!0,n)}}class zCe extends Kn{constructor(){super({id:"editor.unfoldAllExcept",label:m("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2134),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);LG(t,!1,n)}}class UCe extends Kn{constructor(){super({id:"editor.foldAll",label:m("foldAllAction.label","Fold All"),alias:"Fold All",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2069),weight:100}})}invoke(e,t,i){Pv(t,!0)}}class $Ce extends Kn{constructor(){super({id:"editor.unfoldAll",label:m("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:On,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2088),weight:100}})}invoke(e,t,i){Pv(t,!1)}}const Op=class Op extends Kn{getFoldingLevel(){return parseInt(this.id.substr(Op.ID_PREFIX.length))}invoke(e,t,i){gCe(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};Op.ID_PREFIX="editor.
`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class Sk{constructor(e,t,i){this.column=e,this.text=t,this.preview=i,this.lines=Zl(this.text)}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class DP{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new Sk(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=Zl(this.text)}renderForScreenReader(e){return this.newLines.join(``)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function B8(o,e){return Qt(o,e,RG)}function RG(o,e){return o===e?!0:!o||!e?!1:o instanceof Xw&&e instanceof Xw||o instanceof DP&&e instanceof DP?o.equals(e):!1}const cwe=[];function dwe(){return cwe}class MG{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new ft(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new k(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function AG(o,e){const t=new K,i=o.createDecorationsCollection();return t.add(V1({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function hwe(o,e){return new F(o.lineNumber+e.lineNumber-1,e.lineNumber===1?o.column+e.column-1:e.column)}function H8(o,e){return new F(o.lineNumber-e.lineNumber+1,o.lineNumber-e.lineNumber===0?o.column-e.column+1:o.column)}var uwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gwe=function(o,e){return function(t,i){e(t,i,o)}};const V8="ghost-text";let IP=class extends V{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=je(this,!1),this.currentTextModel=wt(this,this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=_e(this,n=>{if(this.isDisposed.read(n))return;const s=this.currentTextModel.read(n);if(s!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;const a=r instanceof DP?r.columnRange:void 0,l=[],c=[];function d(p,_){if(c.length>0){const v=c[c.length-1];_&&v.decorations.push(new ms(v.content.length+1,v.content.length+1+p[0].length,_,0)),v.content+=p[0],p=p.slice(1)}for(const v of p)c.push({content:v,decorations:_?[new ms(1,v.length+1,_,0)]:[]})}const h=s.getLineContent(r.lineNumber);let u,g=0;for(const p of r.parts){let _=p.lines;u===void 0?(l.push({column:p.column,text:_[0],preview:p.preview}),_=_.slice(1)):d([h.substring(g,p.column-1)],void 0),_.length>0&&(d(_,V8),u===void 0&&p.column<=h.length&&(u=p.column)),g=p.column-1}u!==void 0&&d([h.substring(g)],void 0);const f=u!==void 0?new MG(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:f,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:s}}),this.decorations=_e(this,n=>{const s=this.uiState.read(n);if(!s)return[];const r=[];s.replacedRange&&r.push({range:s.replacedRange.toRange(s.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),s.hiddenRange&&r.push({range:s.hiddenRange.toRange(s.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of s.inlineTexts)r.push({range:k.fromPositions(new F(s.lineNumber,a.column)),options:{description:V8,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Vr.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new fwe(this.editor,this.languageService.languageIdCodec,_e(n=>{const s=this.uiState.read(n);return s?{lineNumber:s.lineNumber,additionalLines:s.additionalLines,minReservedLineCount:s.additionalReservedLineCount,targetTextModel:s.targetTextModel}:void 0}))),this._register(be(()=>{this.isDisposed.set(!0,void 0)})),this._register(AG(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.vie
`),n=e.replace(/\r\n|\r/g,``)}withRange(e){return new yk(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}toSingleTextEdit(){return new Ul(this.range,this.insertText)}}function Cwe(o,e){const t=e.getWordAtPosition(o),i=e.getLineMaxColumn(o.lineNumber);return t?new k(o.lineNumber,t.startColumn,o.lineNumber,i):k.fromPositions(o,o.with(void 0,i))}function U8(o,e,t,i){const s=t.getLineContent(e.lineNumber).substring(0,e.column-1)+o,r=t.tokenization.tokenizeLineWithEdit(e,s.length-(e.column-1),o),a=r==null?void 0:r.sliceAndInflate(e.column-1,s.length,0);return a?pwe(a,i):o}function Dg(o,e,t){const i=t?o.range.intersectRanges(t):o.range;if(!i)return o;const n=e.getValueInRange(i,1),s=zh(n,o.text),r=Yr.ofText(n.substring(0,s)).addToPosition(o.range.getStartPosition()),a=o.text.substring(s),l=k.fromPositions(r,o.range.getEndPosition());return new Ul(l,a)}function OG(o,e){return o.text.startsWith(e.text)&&wwe(o.range,e.range)}function $8(o,e,t,i,n=0){let s=Dg(o,e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const r=e.getLineContent(s.range.startLineNumber),a=It(r).length;if(s.range.startColumn-1<=a){const f=It(s.text).length,p=r.substring(s.range.startColumn-1,a),[_,v]=[s.range.getStartPosition(),s.range.getEndPosition()],b=_.column+p.length<=v.column?_.delta(0,p.length):v,C=k.fromPositions(b,v),w=s.text.startsWith(p)?s.text.substring(p.length):s.text.substring(f);s=new Ul(C,w)}const c=e.getValueInRange(s.range),d=Swe(c,s.text);if(!d)return;const h=s.range.startLineNumber,u=new Array;if(t==="prefix"){const f=d.filter(p=>p.originalLength===0);if(f.length>1||f.length===1&&f[0].originalStart!==c.length)return}const g=s.text.length-n;for(const f of d){const p=s.range.startColumn+f.originalStart+f.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&p<i.column||f.originalLength>0)return;if(f.modifiedLength===0)continue;const _=f.modifiedStart+f.modifiedLength,v=Math.max(f.modifiedStart,Math.min(_,g)),b=s.text.substring(f.modifiedStart,v),C=s.text.substring(v,Math.max(f.modifiedStart,_));b.length>0&&u.push(new Sk(p,b,!1)),C.length>0&&u.push(new Sk(p,C,!0))}return new Xw(h,u)}function wwe(o,e){return e.getStartPosition().equals(o.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(o.getEndPosition())}let nl;function Swe(o,e){if((nl==null?void 0:nl.originalValue)===o&&(nl==null?void 0:nl.newValue)===e)return nl==null?void 0:nl.changes;{let t=K8(o,e,!0);if(t){const i=j8(t);if(i>0){const n=K8(o,e,!1);n&&j8(n)<i&&(t=n)}}return nl={originalValue:o,newValue:e,changes:t},t}}function j8(o){let e=0;for(const t of o)e+=t.originalLength;return e}function K8(o,e,t){if(o.length>5e3||e.length>5e3)return;function i(c){let d=0;for(let h=0,u=c.length;h<u;h++){const g=c.charCodeAt(h);g>d&&(d=g)}return d}const n=Math.max(i(o),i(e));function s(c){if(c<0)throw new Error("unexpected");return n+c+1}function r(c){let d=0,h=0;const u=new Int32Array(c.length);for(let g=0,f=c.length;g<f;g++)if(t&&c[g]==="("){const p=h*100+d;u[g]=s(2*p),d++}else if(t&&c[g]===")"){d=Math.max(d-1,0);const p=h*100+d;u[g]=s(2*p+1),d===0&&h++}else u[g]=c.charCodeAt(g);return u}const a=r(o),l=r(e);return new xl({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var ywe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},q8=function(o,e){return function(t,i){e(t,i,o)}};let EP=class extends V{constructor(e,t,i,n,s){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=s,this._updateOperation=this._register(new tn),this.inlineCompletions=kw("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=kw("suggestWidgetInlineCompletions",void 0),this
Invalid subtraction between ${i.toString()} and ${s.toString()}`)),[];const c=Hwe(t.text,l);return n.map(d=>{const h=hwe(H8(d,s),r),u=o.getValueInRange(k.fromPositions(d,h)),g=zh(a,u),f=k.fromPositions(d,d.delta(0,g));return new Ul(f,c)})}function Hwe(o,e){let t="";const i=NQ(o);for(let n=e.lineNumber-1;n<i.length;n++)t+=i[n].substring(n===e.lineNumber-1?e.column-1:0);return t}function sH(o){const e=jy.createSortPermutation(o,vs(s=>s.range,k.compareRangesUsingStarts)),i=new p3(e.apply(o)).getNewRanges();return e.inverse().apply(i).map(s=>s.getEndPosition())}var Vwe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},oH=function(o,e){return function(t,i){e(t,i,o)}},kb;class T6{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let s=0;s<i.length;s++){const{score:r,completion:a}=i[s];if(r[0]!==n)break;if(a.preselect)return s}return 0}}class rH extends T6{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class zwe extends T6{constructor(){super("recentlyUsed"),this._cache=new Yl(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const s=i[0].score[0];let r=-1,a=-1,l=-1;for(let c=0;c<i.length&&i[c].score[0]===s;c++){const d=`${e.getLanguageId()}/${i[c].textLabel}`,h=this._cache.peek(d);if(h&&h.touch>l&&h.type===i[c].completion.kind&&h.insertText===i[c].completion.insertText&&(l=h.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:lw.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class Uwe extends T6{constructor(){super("recentlyUsedByPrefix"),this._trie=o_.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const s=`${e.getLanguageId()}/${n}`;let r=this._trie.get(s);if(r||(r=this._trie.findSubstr(s)),r)for(let a=0;a<i.length;a++){const{kind:l,insertText:c}=i[a].completion;if(l===r.type&&c===r.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:lw.fromString(i.type),this._trie.set(t,i)}}}var Th;let TP=(Th=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new K,this._persistSoon=new Lt(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===Mw.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var n;const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((n=this._strategy)==null?void 0:n.name)!==i){this._saveState();const s=kb._strategyCtors.get(i)||rH;this._strategy=new s;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${kb._storagePrefix}/${i}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}c
`,r+=`prefix: ${e.word??"(no prefix)"}`,r+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}`,r+=`distance: ${e.distance} (localityBonus-setting)`,r+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}`,r+=`commit_chars: ${(s=e.completion.commitCharacters)==null?void 0:s.join("")}`,n=new Hn().appendCodeblock("empty",r),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!R6(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const r=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=r,this._type.title=r,oo(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(r))}else wn(this._type),this._type.title="",hs(this._type),this.domNode.classList.add("no-type");if(wn(this._docs),typeof n=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),wn(this._docs);const r=this._markdownRenderer.render(n);this._docs.appendChild(r.element),this._renderDisposeable.add(r),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=r=>{r.preventDefault(),r.stopPropagation()},this._close.onclick=r=>{r.preventDefault(),r.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new St(e,t);St.equals(i,this._size)||(this._size=i,SJ(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};OP=Jwe([e1e(1,Ce)],OP);class t1e{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new K,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new K3,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,s=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=n.width-a.dimension.width,l=!0),a.north&&(s=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+r})}a.done&&(i=void 0,n=void 0,s=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=$h(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),r=new St(220,2*s.lineHeight),a=e.top,l=function(){const S=n.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),L=-s.borderWidth+e.left+e.width,x=new St(S,n.height-e.top-s.borderHeight-s.verticalPadding),D=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:a,left:L,fit:S-t.width,maxSizeTop:x,maxSizeBottom:D,minSize:r.with(Math.min(S,r.width))}}(),c=function(){const S=e.left-s.borderWidth-s.horizo
.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .ghost-text { font-family: ${g};}`}))),this._register(this._configurationService.onDidChangeConfiguration(u=>{u.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(150)&&(n=m("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),Ss(n?e+", "+n:e)}shouldShowHoverAt(e){var i;const t=(i=this.model.get())==null?void 0:i.primaryGhostText.get();return t?t.parts.some(n=>e.containsPosition(new F(t.lineNumber,n.column))):!1}shouldShowHoverAtViewZone(e){var t;return((t=this._ghostTextWidgets.get()[0])==null?void 0:t.ownsViewZone(e))??!1}},HP=of,of.ID="editor.contrib.inlineCompletionsController",of);Cr=HP=_1e([dc(1,Ce),dc(2,De),dc(3,Ke),dc(4,At),dc(5,Qo),dc(6,ge),dc(7,hu),dc(8,vt),dc(9,Co)],Cr);function v1e(o,e){const t=je("result",[]),i=[];return e.add(Ae(n=>{const s=o.read(n);si(r=>{if(s.length!==i.length){i.length=s.length;for(let a=0;a<i.length;a++)i[a]||(i[a]=je("item",s[a]));t.set([...i],r)}i.forEach((a,l)=>a.set(s[l],r))})})),t}const fD=class fD extends ue{constructor(){super({id:fD.ID,label:m("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:G.and(I.writable,mo.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const i=Cr.get(t);(n=i==null?void 0:i.model.get())==null||n.next()}};fD.ID=mq;let VP=fD;const mD=class mD extends ue{constructor(){super({id:mD.ID,label:m("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:G.and(I.writable,mo.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const i=Cr.get(t);(n=i==null?void 0:i.model.get())==null||n.previous()}};mD.ID=fq;let zP=mD;class b1e extends ue{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:m("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:I.writable})}async run(e,t){const i=Cr.get(t);await wj(async n=>{var s;await((s=i==null?void 0:i.model.get())==null?void 0:s.triggerExplicitly(n)),i==null||i.playAccessibilitySignal(n)})}}class C1e extends ue{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:m("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:G.and(I.writable,mo.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:G.and(I.writable,mo.inlineSuggestionVisible)},menuOpts:[{menuId:me.InlineSuggestionToolbar,title:m("acceptWord","Accept Word"),group:"primary",order:2}]})}async run(e,t){var n;const i=Cr.get(t);await((n=i==null?void 0:i.model.get())==null?void 0:n.acceptNextWord(i.editor))}}class w1e extends ue{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:m("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:G.and(I.writable,mo.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:me.InlineSuggestionToolbar,title:m("acceptLine","Accept Line"),group:"secondary",order:2}]})}async run(e,t){var n;const i=Cr.get(t);await((n=i==null?void 0:i.model.get())==null?void 0:n.acceptNextLine(i.editor))}}class S1e extends ue{constructor(){super({id:gq,label:m("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:mo.inlineSuggestionVisible,menuOpts:[{menuId:me.InlineSuggestionToolbar,title:m("accept","Accept"),group:"primary",order:1}],kbOpts:{pr
`);s===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new k(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":``):this._isCopyingDown?t.addEditOperation(new k(i.startLineNumber,1,i.startLineNumber,1),s+``):t.addEditOperation(new k(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),``+s),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let n=i.startLineNumber,s=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,s=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=pe.createWithDirection(n,s,r,a,this._selectionDirection)}return i}}var w0e=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},S0e=function(o,e){return function(t,i){e(t,i,o)}};let lO=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(h,u)=>e.getLanguageIdAtPosition(h,u),s=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===s){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumber<r.endLineNumber&&r.endColumn===1&&(this._moveEndPositionDown=!0,r=r.setEndPosition(r.endLineNumber-1,e.getLineMaxColumn(r.endLineNumber-1)));const{tabSize:a,indentSize:l,insertSpaces:c}=e.getOptions(),d=this.buildIndentConverter(a,l,c);if(r.startLineNumber===r.endLineNumber&&e.getLineMaxColumn(r.startLineNumber)===1){const h=r.startLineNumber,u=this._isMovingDown?h+1:h-1;e.getLineMaxColumn(u)===1?t.addEditOperation(new k(1,1,1,1),null):(t.addEditOperation(new k(h,1,h,1),e.getLineContent(u)),t.addEditOperation(new k(u,1,u,e.getLineMaxColumn(u)),null)),r=new pe(u,1,u,1)}else{let h,u;if(this._isMovingDown){h=r.endLineNumber+1,u=e.getLineContent(h),t.addEditOperation(new k(h-1,e.getLineMaxColumn(h-1),h,e.getLineMaxColumn(h)),null);let g=u;if(this.shouldAutoIndent(e,r)){const f=this.matchEnterRule(e,d,a,h,r.startLineNumber-1);if(f!==null){const _=It(e.getLineContent(h)),v=f+eo(_,a);g=aC(v,a,c)+this.trimStart(u)}else{const _={tokenization:{getLineTokens:b=>b===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(b),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:b=>b===r.startLineNumber?e.getLineContent(h):e.getLineContent(b)},v=Wb(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(v!==null){const b=It(e.getLineContent(h)),C=eo(v,a),w=eo(b,a);C!==w&&(g=aC(C,a,c)+this.trimStart(u))}}t.addEditOperation(new k(r.startLineNumber,1,r.startLineNumber,1),g+``);const p=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,g);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,p);else{const _={tokenization:{getLineTokens:b=>b===r.startLineNumber?e.tokenization.getLineTokens(h):b>=r.startLineNumber+1&&b<=r.endLineNumber+1?e.tokenization.getLineTokens(b-1):e.tokenization.getLineTokens(b),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:b=>b===r.startLineNumber?g:b>=r.startLineNumber+1&&b<=r.endLineNumber+1?e.getLineContent(b-1):e.getLineContent(b)},v=Wb(this._autoIndent,_,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(v!==null){const b=It(e.getLineContent(r.startLineNumber)),C=eo(v,a),w=eo(b,a);if(C!==w){const S=C-w;this.getIndentEditsOfMovingBlock(e,t,r,a,c,S)}}}}else t.addEditOperation(new k(r.startLineNumber,1,r.startLineNumber,1),g+``)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new k(h,1,h+1,1),null),t.addEditOperation(new k(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),``+u),this.shouldAutoIndent(e,r)){const g={tokenization:{getLineTokens:p=>p===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(p),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:p=>p===h?e.getLineContent(r.startLineNumber):e.getLineContent(p)},f=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,f);else{const p=Wb(this._autoIndent,g,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(p!==null){const _=It(e.getLineContent(r.startLineNumber)),v=eo(p,a),b=eo(_,a);if(v!==b){const C=v-b;this.getIndentEditsOfMovingBlock(e,t,r,a,c,C)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:n=>vr.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>vr.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let r=s.indentation;s.indentAction===Wi.None||s.indentAction===Wi.Indent?r=s.indentation+s.appendText:s.indentAction===Wi.IndentOutdent?r=s.indentation:s.indentAction===Wi.Outdent&&(r=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=It(e.getLineContent(n));let c=It(r);const d=PU(e,n,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const h=eo(c,i),u=eo(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,r){if(Ia(r)>=0){const a=e.getLineMaxColumn(s),l=jp(this._autoIndent,e,new k(s,a,s,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const d=e.getLineContent(a);if(Ia(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=jp(this._autoIndent,e,new k(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}}matchEnterRule(e,t,i,n,s,r){let a=s;for(;a>=1;){let d;if(a===s&&r!==void 0?d=r:d=e.getLineContent(a),Ia(d)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=jp(this._autoIndent,e,new k(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=It(l),h=eo(c,n)+r,u=aC(h,n,s);u!==c&&(t.addEditOperation(new k(a,1,a,c.length+1),u),a===i.endLineNumber&&i.endColumn<=c.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};lO=w0e([S0e(3,ai)],lO);const Fp=class Fp{static getCollator(){return Fp._COLLATOR||(Fp._COLLATOR=new Intl.Collator),Fp._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=y0e(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const n=$G(e,t,i);if(!n)return!1;for(let s=0,r=n.before.length;s<r;s++)if(n.before[s]!==n.after[s])return!0;return!1}};Fp._COLLATOR=null;let t1=Fp;function $G(o,e,t){const i=e.startLineNumber;let n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;const s=[];for(let a=i;a<=n;a++)s.push(o.getLineContent(a));let r=s.slice(0);return r.sort(t1.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:r}}function y0e(o,e,t){const i=$G(o,e,t);return i?ni.replace(new k(i.startLineNumber,1,i.endLineNumber,o
`)):null}class jG extends ue{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>k.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;r<i.length;r++){const a=i[r];n.selection.endLineNumber===a.selection.startLineNumber&&(n.index<a.index?a.ignore=!0:(n.ignore=!0,n=a))}const s=[];for(const r of i)s.push(new UG(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class L0e extends jG{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:m("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:me.MenubarSelectionMenu,group:"2_line",title:m({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class k0e extends jG{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:m("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:me.MenubarSelectionMenu,group:"2_line",title:m({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class x0e extends ue{constructor(){super({id:"editor.action.duplicateSelection",label:m("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:I.writable,menuOpts:{menuId:me.MenubarSelectionMenu,group:"2_line",title:m({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],s=t.getSelections(),r=t.getModel();for(const a of s)if(a.isEmpty())n.push(new UG(a,!0));else{const l=new pe(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new wee(l,r.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class KG extends ue{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(ai),n=[],s=t.getSelections()||[],r=t.getOption(12);for(const a of s)n.push(new lO(a,this.down,r,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class D0e extends KG{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:m("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:me.MenubarSelectionMenu,group:"2_line",title:m({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class I0e extends KG{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:m("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:me.MenubarSelectionMenu,group:"2_line",title:m({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class qG extends ue{constructor(e,t){super(t),this.descending=e}run(e,t){if(!t.hasModel())return;const i=t.getModel();let n=t.getSelections();n.length===1&&n[0].isEmpty()&&(n=[new pe(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);for(const r of n)if(!t1.canRun(t.getModel(),r,this.descending))return;const s=[];for(let r=0,a=n.length;r<a;r++)s[r]=new t1(n[r],this.descending);t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class E0e extends qG{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:m("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:I.writable})}}class N0e extends qG{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:m("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:I.writable})}}class T0e extends ue{constructor(){super({id:"editor.action.removeDuplicateLines",label:m("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:I.writable})}run(e,t){if
`))),s.push(f),r+=c.endLineNumber-c.startLineNumber+1-h.length}t.pushUndoStop(),t.executeEdits(this.id,n,a?s:void 0),t.pushUndoStop()}}const LD=class LD extends ue{constructor(){super({id:LD.ID,label:m("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:Bi(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(d=>new F(d.positionLineNumber,d.positionColumn)));const s=t.getSelection();if(s===null)return;const r=e.get(Ke),a=t.getModel(),l=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a==null?void 0:a.getLanguageId(),resource:a==null?void 0:a.uri}),c=new b0e(s,n,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}};LD.ID="editor.action.trimTrailingWhitespace";let cO=LD;class R0e extends ue{constructor(){super({id:"editor.action.deleteLines",label:m("lines.delete","Delete Line"),alias:"Delete Line",precondition:I.writable,kbOpts:{kbExpr:I.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0;const r=[],a=[];for(let l=0,c=i.length;l<c;l++){const d=i[l];let h=d.startLineNumber,u=d.endLineNumber,g=1,f=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,f=1):h>1&&(h-=1,g=n.getLineMaxColumn(h)),r.push(ni.replace(new pe(h,g,u,f),"")),a.push(new pe(h-s,d.positionColumn,h-s,d.positionColumn)),s+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let r=s.endLineNumber;return s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(r-=1),{startLineNumber:s.startLineNumber,selectionStartColumn:s.selectionStartColumn,endLineNumber:r,positionColumn:s.positionColumn}});t.sort((s,r)=>s.startLineNumber===r.startLineNumber?s.endLineNumber-r.endLineNumber:s.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let s=1;s<t.length;s++)n.endLineNumber+1>=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}class M0e extends ue{constructor(){super({id:"editor.action.indentLines",label:m("lines.indent","Indent Line"),alias:"Indent Line",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,$d.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class A0e extends ue{constructor(){super({id:"editor.action.outdentLines",label:m("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:2140,weight:100}})}run(e,t){Kp.Outdent.runEditorCommand(e,t,null)}}class P0e extends ue{constructor(){super({id:"editor.action.insertLineBefore",label:m("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,DI.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class O0e extends ue{constructor(){super({id:"editor.action.insertLineAfter",label:m("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:I.writable,kbOpts:{kbExpr:I.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,DI.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class GG extends ue{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let l=0,c=n.length-1;l<c;l++){const d=n[l],h=n[l+1];k.intersectRanges(d,h)===null?s.push(d):n[l+1]=k.plusRange(d,h)}s.push(n[n.length-1]);const r=this._getEndCursorState(i,s),a=s.map(l=>ni.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class F0e extends GG{constructor(){super({id:"deleteAllLeft",label:m("lines.deleteAllLeft","Delete All Lef
`);return new n1(e,t,n,c,s,r,d)}constructor(e,t,i,n,s,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new mS(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new mS(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1);return i?new pe(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new mS(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new mS(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1);return i?new pe(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(132):null,!1,1073741824)}}const DD=class DD extends V{static get(e){return e.getContribution(DD.ID)}constructor(e){super(),this._sessionDispose=this._register(new K),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=n1.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new pe(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>
`));return{text:l.text.join(``),shift:l.shift}}),this._originalModel=es(()=>this._modelService.createModel("",null,Eb._createUniqueUri())).keepObserved(this._store),this._modifiedModel=es(()=>this._modelService.createModel("",null,Eb._createUniqueUri())).keepObserved(this._store),this._diff=_e(this,r=>{var a,l;return(l=(a=this._diffPromise.read(r))==null?void 0:a.promiseResult.read(r))==null?void 0:l.data}),this._diffPromise=_e(this,r=>{const a=this._model.read(r);if(!a)return;const l=this._editor.getModel();if(!l)return;const c=DT(l.getValueInRange(a.range).split(``)).text.join(``),d=DT(a.text.split(``)).text.join(``);this._originalModel.get().setValue(c),this._modifiedModel.get().setValue(d);const h=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return YI.fromFn(async()=>{const u=await h.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},Ve.None);if(!u.identical)return u.changes})}),this._register(Vs((r,a)=>{if(!this._model.read(r)||this._position.get()===null)return;const c=a.add(this._instantiationService.createInstance(vO,this._editor,this._position,this._text.map(d=>d.text),this._text.map(d=>d.shift),this._diff));e.addOverlayWidget(c),a.add(be(()=>e.removeOverlayWidget(c)))}))}},Eb=hf,hf._modelId=0,hf);_O=Eb=JG([fy(2,Ce),fy(3,q1),fy(4,Vt)],_O);var uf;let vO=(uf=class extends V{constructor(e,t,i,n,s,r){var a;super(),this._editor=e,this._position=t,this._text=i,this._shift=n,this._diff=s,this._instantiationService=r,this.id=`InlineEditSideBySideContentWidget${pO.id++}`,this.allowEditorOverflow=!1,this._nodes=ne("div.inlineEditSideBySide",void 0),this._scrollChanged=Tn("editor.onDidScrollChange",this._editor.onDidScrollChange),this._previewEditor=this._register(this._instantiationService.createInstance(Qr,this._nodes,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off",wrappingIndent:"none",wrappingStrategy:void 0},{contributions:[],isSimpleWidget:!0},this._editor)),this._previewEditorObs=ao(this._previewEditor),this._editorObs=ao(this._editor),this._previewTextModel=this._register(this._instantiationService.createInstance(ka,"",((a=this._editor.getModel())==null?void 0:a.getLanguageId())??bs,ka.DEFAULT_CREATION_OPTIONS,null)),this._setText=_e(l=>{const c=this._text.read(l);c&&this._previewTextModel.setValue(c)}).recomputeInitiallyAndOnChange(this._store),this._decorations=_e(this,l=>{this._setText.read(l);const c=this._position.read(l);if(!c)return{org:[],mod:[]};const d=this._diff.read(l);if(!d)return{org:[],mod:[]};const h=[],u=[];if(d.length===1&&d[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return{org:[],mod:[]};const g=this._shift.get(),f=p=>new k(p.startLineNumber+c.top-1,p.startColumn+g,p.endLineNumber+c.top-1,p.endColumn+g);for(const p of d)if(p.original.isEmpty||h.push({range:f(p.original.toInclusiveRange()),options:Nw}),p.modified.isEmpty||u.push({range:p.modified.toInclusiveRange(),options:IL}),p.modified.isEmpty||p.original.isEmpty)p.original.isEmpty||h.push({range:f(p.original.toInclusiveRange()),options:w3}),p.modified.isEmpty||u.push({range:p.modified.toInclusiveRange(),options:b3});else for(const _ of p.innerChanges||[])p.original.contains(_.originalRange.startLineNumber)&&h.push({range:f(_.originalRange),options:_.originalRange.isEmpty()?S3:z_}),p.modified.contains(_.modifiedRange.startLineNumber)&&u.push({range:_.modifiedRange,options:_.modifiedRange.isEmpty()?C3:EL});return{org:h,mod:u}}),this._originalDecorations=_e(this,l=>this._decorations.read(l).org),this._modifiedDecorations=_e(this,l=>this._decorations.read(l).mod),this._previewEditor.setModel(this._previewTextModel),this._register(this._editorObs.setDecorations(this._originalDecorations)),this._register(this._previewEditorObs.setDecorations(this._modifiedDecorations)),this._register(Ae(l=>{const c=this._previewEditorObs.contentWidth.read(l),d=this._text.read(l).split(``).length-1,h=this._editor.getOption(67)*d;c<=0||this._previewEditor.layout({height:h,width:c})})),this._register(Ae(l=>{this._position.read(l),this._editor.layoutOverlayWidget(this)})),this._register(Ae(l=>{this._scrollChanged.read(l),this._position.read(l)&&this._editor.layoutOverlayWidget(this)}))}getId(){return this.id}getDomNode(){return this._nodes}getPosition(){const e=this._position.get();if(!e)return null;const t=this._editor.getLayoutInfo(),i=this._editor.getScrolledVisiblePosition(new F(e.top,1));if(!i)return null;const n=i.top-1,s=this._editor.getOffsetForColumn(e.left.lineNumber,e.left.column);return{preference:{left:t.contentLeft+s+10,top:n}}}},pO=uf,uf.id=0,uf);vO=pO=JG([fy(5,Ce)],vO);var MSe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Eu=function(o,e){return function(t,i){e(t,i,o)}},Nb,or;let _s=(or=class extends V{static get(e){return e.getContribution(Nb.ID)}constructor(e,t,i,n,s,r,a,l){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.languageFeaturesService=n,this._commandService=s,this._configurationService=r,this._diffProviderFactoryService=a,this._modelService=l,this._isVisibleContext=Nb.inlineEditVisibleContext.bindTo(this.contextKeyService),this._isCursorAtInlineEditContext=Nb.cursorAtInlineEditContext.bindTo(this.contextKeyService),this._currentEdit=je(this,void 0),this._currentWidget=es(this._currentEdit,f=>{const p=this._currentEdit.read(f);if(!p)return;const _=p.range.endLineNumber,v=p.range.endColumn,b=p.text.endsWith(``)&&!(p.range.startLineNumber===p.range.endLineNumber&&p.range.startColumn===p.range.endColumn)?p.text.slice(0,-1):p.text,C=new Xw(_,[new Sk(v,b,!1)]),w=p.range.startLineNumber===p.range.endLineNumber&&C.parts.length===1&&C.parts[0].lines.length===1,S=p.text==="";return!w&&!S?void 0:this.instantiationService.createInstance(uO,this.editor,{ghostText:hr(C),minReservedLineCount:hr(0),targetTextModel:hr(this.editor.getModel()??void 0),range:hr(p.range)})}),this._isAccepting=je(this,!1),this._enabled=wt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).enabled),this._fontFamily=wt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(63).fontFamily);const c=Tn("InlineEditController.modelContentChangedSignal",e.onDidChangeModelContent);this._register(Ae(f=>{this._enabled.read(f)&&(c.read(f),!this._isAccepting.read(f)&&this.getInlineEdit(e,!0))}));const d=wt(this,e.onDidChangeCursorPosition,()=>e.getPosition());this._register(Ae(f=>{if(!this._enabled.read(f))return;const p=d.read(f);p&&this.checkCursorPosition(p)})),this._register(Ae(f=>{const p=this._currentEdit.read(f);if(this._isCursorAtInlineEditContext.set(!1),!p){this._isVisibleContext.set(!1);return}this._isVisibleContext.set(!0);const _=e.getPosition();_&&this.checkCursorPosition(_)}));const h=Tn("InlineEditController.editorBlurSignal",e.onDidBlurEditorWidget);this._register(Ae(async f=>{var p;this._enabled.read(f)&&(h.read(f),!(this._configurationService.getValue("editor.experimentalInlineEdit.keepOnBlur")||e.getOption(63).keepOnBlur)&&((p=this._currentRequestCts)==null||p.dispose(!0),this._currentRequestCts=void 0,await this.clear(!1)))}));const u=Tn("InlineEditController.editorFocusSignal",e.onDidFocusEditorText);this._register(Ae(f=>{this._enabled.read(f)&&(u.read(f),this.getInlineEdit(e,!0))}));const g=this._register(tU());this._register(Ae(f=>{const p=this._fontFamily.read(f);g.setStyle(p===""||p==="default"?"":`.monaco-editor .inline-edit-decoration,.monaco-editor .inline-edit-decoration-preview,.monaco-editor .inline-edit { font-family: ${p};}`)})),this._register(new gO(this.editor,this._currentWidget,this.instantiationService)),this._register(new _O(this.editor,this._currentEdit,this.instantiationService,this._diffProviderFactoryService,this._modelService))}checkCursorPosition(e){if(!this._currentEdit){this._isCursorAtInlineEditContext.set(!1);return}const t=this._currentEdit.get();if(!t){this._isCursorAtInlineEditContext.set(!1);return}this._isCursorAtInlineEditContext.set(k.containsPosition(t.range,e))}validateInlineEdit(e,t){var i;if(t.text.includes(``)&&t.range.startLineNumber!==t.range.endLineNumber&&t.range.startColumn!==t.range.endColumn){if(t.range.startColumn!==1)return!1;const s=t.range.endLineNumber,r=t.range.endColumn,a=((i=e.getModel())==null?void 0:i.getLineLength(s))??0;if(r!==a+1)return!1}return!0}async fetchInlineEdit(e,t){this._currentRequestCts&&this._currentRequestCts.dispose(!0);const i=e.getModel();if(!i)return;const n=i.getVersionId(),s=this.languageFeaturesService.inlineEditProvider.all(i);if(s.length===0)return;const r=s[0];this._currentRequestCts=new oi;const a=this._currentRequestCts.token,l=t?lL.Automatic:lL.Invoke;if(t&&await ASe(50,a),a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)return;const d=await r.provideInlineEdit(i,{triggerKind:l},a);if(d&&!(a.isCancellationRequested||i.isDisposed()||i.getVersionId()!==n)&&this.validateInlineEdit(e,d))return d}async getInlineEdit(e,t){this._isCursorAtInlineEditContext.set(!1),await this.clear();const i=await this.fetchInlineEdit(e,t);i&&this._currentEdit.set(i,void 0)}async trigger(){await this.getInlineEdit(this.editor,!1)}async jumpBack(){this._jumpBackPosition&&(this.editor.setPosition(this._jumpBackPosition),this.editor.revealPositionInCenterIfOutsideViewport(this._jumpBackPosition))}async accept(){this._isAccepting.set(!0,void 0);const e=this._currentEdit.get();if(!e)return;let t=e.text;e.text.startsWith(``)&&(t=e.text.substring(1)),this.editor.pushUndoStop(),this.editor.executeEdits("acceptCurrent",[ni.replace(k.lift(e.range),t)]),e.accepted&&await this._commandService.executeCommand(e.accepted.id,...e.accepted.arguments||[]).then(void 0,yi),this.freeEdit(e),si(i=>{this._currentEdit.set(void 0,i),this._isAccepting.set(!1,i)})}jumpToCurrent(){var i;this._jumpBackPosition=(i=this.editor.getSelection())==null?void 0:i.getStartPosition();const e=this._currentEdit.get();if(!e)return;const t=F.lift({lineNumber:e.range.startLineNumber,column:e.range.startColumn});this.editor.setPosition(t),this.editor.revealPositionInCenterIfOutsideViewport(t)}async clear(e=!0){const t=this._currentEdit.get();t&&(t!=null&&t.rejected)&&e&&await this._commandService.executeCommand(t.rejected.id,...t.rejected.arguments||[]).then(void 0,yi),t&&this.freeEdit(t),this._currentEdit.set(void 0,void 0)}freeEdit(e){const t=this.editor.getModel();if(!t)return;const i=this.languageFeaturesService.inlineEditProvider.all(t);i.length!==0&&i[0].freeInlineEdit(e)}},Nb=or,or.ID="editor.contrib.inlineEditController",or.inlineEditVisibleKey="inlineEditVisible",or.inlineEditVisibleContext=new de(or.inlineEditVisibleKey,!1),or.cursorAtInlineEditKey="cursorAtInlineEdit",or.cursorAtInlineEditContext=new de(or.cursorAtInlineEditKey,!1),or);_s=Nb=MSe([Eu(1,Ce),Eu(2,De),Eu(3,ge),Eu(4,At),Eu(5,Ke),Eu(6,q1),Eu(7,Vt)],_s);function ASe(o,e){return new Promise(t=>{let i;const n=setTimeout(()=>{i&&i.dispose(),t()},o);e&&(i=e.onCancellationRequested(()=>{clearTimeout(n),i&&i.dispose(),t()}))})}let PSe=class extends ue{constructor(){super({id:kSe,label:"Accept Inline Edit",alias:"Accept Inline Edit",precondition:G.and(I.writable,_s.inlineEditVisibleContext),kbOpts:[{weight:101,primary:2,kbExpr:G.and(I.writable,_s.inlineEditVisibleContext,_s.cursorAtInlineEditContext)}],menuOpts:[{menuId:me.InlineEditToolbar,title:"Accept",group:"primary",order:1}]})}async run(e,t){const i=_s.get(t);await(i==null?void 0:i.accept())}};class OSe extends ue{constructor(){const e=G.and(I.writable,G.not(_s.inlineEditVisibleKey));super({id:"editor.action.inlineEdit.trigger",label:"Trigger Inline Edit",alias:"Trigger Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e}})}async run(e,t){const i=_s.get(t);i==null||i.trigger()}}class FSe extends ue{constructor(){const e=G.and(I.writable,_s.inlineEditVisibleContext,G.not(_s.cursorAtInlineEditKey));super({id:DSe,label:"Jump to Inline Edit",alias:"Jump to Inline Edit",precondition:e,kbOpts:{weight:101,primary:2646,kbExpr:e},menuOpts:[{menuId:me.InlineEditToolbar,title:"Jump To Edit",group:"primary",order:3,when:e}]})}async run(e,t){const i=_s.get(t);i==null||i.jumpToCurrent()}}class WSe extends ue{constructor(){const e=G.and(I.writable,_s.cursorAtInlineEditContext);super({id:ISe,label:"Jump Back from Inline Edit",alias:"Jump Back from Inline Edit",precondition:e,kbOpts:{weight:110,primary:2646,kbExpr:e},menuOpts:[{menuId:me.InlineEditToolbar,title:"Jump Back",group:"primary",order:3,when:e}]})}async run(e,t){const i=_s.get(t);i==null||i.jumpBack()}}class BSe extends ue{constructor(){const e=G.and(I.writable,_s.inlineEditVisibleContext);super({id:xSe,label:"Reject Inline Edit",alias:"Reject Inline Edit",precondition:e,kbOpts:{weight:100,primary:9,kbExpr:e},menuOpts:[{menuId:me.InlineEditToolbar,title:"Reject",group:"secondary",order:2}]})}async run(e,t){const i=_s.get(t);await(i==null?void 0:i.clear())}}J(PSe);J(BSe);J(FSe);J(WSe);J(OSe);at(_s.ID,_s,3);const HSe="editor.action.inlineEdits.accept",VSe="editor.action.inlineEdits.showPrevious",zSe="editor.action.inlineEdits.showNext",rv=new de("inlineEditsVisible",!1,m("inlineEditsVisible","Whether an inline edit is visible")),USe=new de("inlineEditsIsPinned",!1,m("isPinned","Whether an inline edit is visible")),fW=class fW extends V{constructor(e){super(),this._editor=e,this._editorObs=ao(this._editor),this._placeholderText=this._editorObs.getOption(88),this._state=Ao({owner:this,equalsFn:wL},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:
`))}).recomputeInitiallyAndOnChange(this._store),this._promptTextModel=this._register(this._instantiationService.createInstance(ka,"",bs,ka.DEFAULT_CREATION_OPTIONS,null)),this._promptEditor=this._register(this._instantiationService.createInstance(Qr,this._elements.promptEditor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,placeholder:"Describe the change you want...",fontFamily:V$},{contributions:bg.getSomeEditorContributions([zr.ID,s1.ID,X_.ID]),isSimpleWidget:!0},this._editor)),this._previewEditor=this._register(this._instantiationService.createInstance(Qr,this._elements.editor,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0},{contributions:[]},this._editor)),this._previewEditorObs=ao(this._previewEditor),this._decorations=_e(this,r=>{var d;this._setText.read(r);const a=(d=this._edit.read(r))==null?void 0:d.changes;if(!a)return[];const l=[],c=[];if(a.length===1&&a[0].innerChanges[0].modifiedRange.equalsRange(this._previewTextModel.getFullModelRange()))return[];for(const h of a)if(h.original.isEmpty||l.push({range:h.original.toInclusiveRange(),options:Nw}),h.modified.isEmpty||c.push({range:h.modified.toInclusiveRange(),options:IL}),h.modified.isEmpty||h.original.isEmpty)h.original.isEmpty||l.push({range:h.original.toInclusiveRange(),options:w3}),h.modified.isEmpty||c.push({range:h.modified.toInclusiveRange(),options:b3});else for(const u of h.innerChanges||[])h.original.contains(u.originalRange.startLineNumber)&&l.push({range:u.originalRange,options:u.originalRange.isEmpty()?S3:z_}),h.modified.contains(u.modifiedRange.startLineNumber)&&c.push({range:u.modifiedRange,options:u.modifiedRange.isEmpty()?C3:EL});return c}),this._layout1=_e(this,r=>{const a=this._editor.getModel(),l=this._edit.read(r);if(!l)return null;const c=l.range;let d=0;for(let g=c.startLineNumber;g<c.endLineNumberExclusive;g++){const f=a.getLineMaxColumn(g),p=this._editor.getOffsetForColumn(g,f);d=Math.max(d,p)}return{left:this._editor.getLayoutInfo().contentLeft+d}}),this._layout=_e(this,r=>{const a=this._edit.read(r);if(!a)return null;const l=a.range,c=this._editorObs.scrollLeft.read(r),d=this._layout1.read(r).left+20-c,h=this._editor.getTopForLineNumber(l.startLineNumber)-this._editorObs.scrollTop.read(r),u=this._editor.getTopForLineNumber(l.endLineNumberExclusive)-this._editorObs.scrollTop.read(r),g=new bp(d,h),f=new bp(d,u),p=u-h,_=50,v=this._editor.getOption(67)*a.newLines.length,b=p-v,C=new bp(d+_,h+b/2),w=new bp(d+_,u-b/2);return{topCode:g,bottomCode:f,codeHeight:p,topEdit:C,bottomEdit:w,editHeight:v}});const s=_e(this,r=>this._edit.read(r)!==void 0||this._userPrompt.read(r)!==void 0);this._register(ad(this._elements.root,{display:_e(this,r=>s.read(r)?"block":"none")})),this._register(hp(this._editor.getDomNode(),this._elements.root)),this._register(ao(e).createOverlayWidget({domNode:this._elements.root,position:hr(null),allowEditorOverflow:!1,minContentWidthInPx:_e(r=>{var c;const a=(c=this._layout1.read(r))==null?void 0:c.left;if(a===void 0)return 0;const l=this._previewEditorObs.contentWidth.read(r);return a+l})})),this._previewEditor.setModel(this._previewTextModel),this._register(this._previewEditorObs.setDecorations(this._decorations)),this._register(Ae(r=>{const a=this._layout.read(r);if(!a)return;const{topCode:l,bottomCode:c,topEdit:d,bottomEdit:h,editHeight:u}=a,g=10,f=0,p=40,_=new ZSe().moveTo(l).lineTo(l.deltaX(g)).curveTo(l.deltaX(g+p),d.deltaX(-p-f),d.deltaX(-f)).lineTo(d).lineTo(h).lineTo(h.deltaX(-f)).curveTo(h.deltaX(-p-f),c.deltaX(g+p),c.deltaX(g)).lineTo(c).build();this._elements.path.setAttribute("d
`)),this._modifiedModel.get().setValue(h.join(``));const p=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return YI.fromFn(async()=>{const _=await p.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},Ve.None);if(!_.identical)return new qSe(Re.fromRangeInclusive(d),u(h),_.changes)})}),this._fetchStore=this._register(new K),this._inlineEditsFetchResult=kw(this,void 0),this._inlineEdits=Ao({owner:this,equalsFn:wL},l=>{var c;return((c=this._inlineEditsFetchResult.read(l))==null?void 0:c.completions.map(d=>new QSe(d)))??[]}),this._fetchInlineEditsPromise=Sj({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:Ra.Automatic}),handleChange:(l,c)=>(l.didChange(this._forceUpdateExplicitlySignal)&&(c.inlineCompletionTriggerKind=Ra.Explicit),!0)},async(l,c)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(l),this._textModelVersionId.read(l);function d(p,_){return _(p)}const h=this._pinnedRange.range.read(l)??d(this._selection.read(l),p=>p.isEmpty()?void 0:p);if(!h){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const u={triggerKind:c.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(l)},g=sR(this._fetchStore);await id(200,g);const f=await PG(this.languageFeaturesService.inlineCompletionsProvider,h,this.textModel,u,g);g.isCancellationRequested||this._inlineEditsFetchResult.set(f,void 0)}),this._filteredInlineEditItems=Ao({owner:this,equalsFn:CL()},l=>this._inlineEdits.read(l)),this.selectedInlineCompletionIndex=_e(this,l=>{const c=this._selectedInlineCompletionId.read(l),d=this._filteredInlineEditItems.read(l),h=this._selectedInlineCompletionId===void 0?-1:d.findIndex(u=>u.semanticId===c);return h===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):h}),this.selectedInlineEdit=_e(this,l=>{const c=this._filteredInlineEditItems.read(l),d=this.selectedInlineCompletionIndex.read(l);return c[d]}),this._register(Dv(this._fetchInlineEditsPromise))}async triggerExplicitly(e){Ff(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){Ff(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new ft;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},Tb=gf,gf._modelId=0,gf);CO=Tb=XSe([IT(4,ge),IT(5,q1),IT(6,Vt)],CO);class QSe{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class JSe extends V{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=je(this,[]),this.range=_e(this,i=>{this._versionId.read(i);const n=this._decorations.read(i)[0];return n?this._textModel.getDecorationRange(n)??null:null}),this._register(be(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var eye=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ob=function(o,e){return function(t,i){e(t,i,o)}},w
`):void 0}:{range:k.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(``):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(``)};const r=await s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(m("no result","No result.")),n);return r}}async function vye(o,e,t,i){const n=new W6(e,t,o),s=await n.resolveRenameLocation(Ve.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,Ve.None)}var _f;let ou=(_f=class{static get(e){return e.getContribution(TO.ID)}constructor(e,t,i,n,s,r,a,l,c){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._telemetryService=c,this._disposableStore=new K,this._cts=new oi,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(NO,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var f,p;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new oi,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new W6(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new iu(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const _=i.resolveRenameLocation(n.token);this._progressService.showWhile(_,250),s=await _,e("resolved rename location")}catch(_){_ instanceof jr?e("resolve rename location cancelled",JSON.stringify(_,null," ")):(e("resolve rename location failed",_ instanceof Error?_:JSON.stringify(_,null," ")),(typeof _=="string"||Aa(_))&&((f=go.get(this.editor))==null||f.showMessage(_||m("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),(p=go.get(this.editor))==null||p.showMessage(s.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new iu(this.editor,5,s.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async _=>[_,await _.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(_,v)=>{let b=c.slice();return _===dw.Automatic&&(b=b.filter(([C,w])=>w)),b.map(([C])=>C.provideNewSymbolNames(a,s.range,_,v))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(s.range,s.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),u),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const g=k1(i.provideRenameEdits(u.newName,r.token),r.token).then(async _=>{if(!_){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(_.rejectReason){e(`returning early - rejected with reason: ${_.rejectReason}`),this._notificationService.info(_.rejectReason);return}this.editor.setSelection(k.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(_,{editor:this.editor,showPreview:u.wantsPreview,label:m("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,u.newName),code:"undoredo.rename",quotableLabel:m("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,u.newName),respectAutoSaveConfig:!0}).then(v=>{e("edits applied"),v.ariaSummary&&Ss(m("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,u.newName,v.ariaSummary))}).catch(v=>{e(``||o===" "}var iLe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xH=function(o,e){return function(t,i){e(t,i,o)}};let KO=class extends V{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,s){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=X(e,ne("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Ds("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new Je(this.el,"click")),a=this._register(new Je(this.el,"keypress")),l=re.chain(a.event,h=>h.map(u=>new Tt(u)).filter(u=>u.keyCode===3)),c=this._register(new Je(this.el,Mt.Tap)).event;this._register(zn.addTarget(this.el));const d=re.any(r.event,l,c);this._register(d(h=>{this.enabled&&(et.stop(h,!0),i!=null&&i.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};KO=iLe([xH(3,Ql),xH(4,Zs)],KO);var mZ=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},pZ=function(o,e){return function(t,i){e(t,i,o)}};const nLe=26;let qO=class extends V{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(GO))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,nLe)}};qO=mZ([pZ(1,Ce)],qO);let GO=class extends V{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(cd,{}),this.element=ne("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=ne("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){wn(this.element)}show(e){wn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=X(this.element,ne("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(ne(`div${xe.asCSSSelector(e.icon)}`));const n=X(this.element,ne("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=X(this.element,ne("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(KO,this.messageActionsContainer,{...r,tabIndex:-1},{}));const s=X(this.element,ne("div.action-container"));this.actionBar=this._register(new zo(s)),this.actionBar.push(this._register(new co("banner.close","Close Banner",xe.asClassName(eK),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};GO=mZ([pZ(0,Ce)],GO);const _Z=Qe("workspaceTrustManagementService");var $6=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescripto
`)}const jke={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Gr]:"#FFFFFE",[Xl]:"#000000",[YU]:"#E5EBF1",[F1]:"#D3D3D3",[W1]:"#939393",[v5]:"#ADD6FF4D"}},Kke={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Gr]:"#1E1E1E",[Xl]:"#D4D4D4",
`)}}}class FZ{getIcon(e){const t=Xj();let i=e.defaults;for(;xe.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const Tc="vs",c_="vs-dark",Eg="hc-black",Ng="hc-light",WZ=ri.as($U.ColorContribution),Yke=ri.as(v$.ThemingContribution);class BZ{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Cy(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,Y.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=v2(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,Y.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=WZ.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Tc:return dr.LIGHT;case Eg:return dr.HIGH_CONTRAST_DARK;case Ng:return dr.HIGH_CONTRAST_LIGHT;default:return dr.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=v2(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const s={token:""};i&&(s.foreground=i),n&&(s.background=n),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=OZ.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Fs.getForeground(s),a=Fs.getFontStyle(s);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function Cy(o){return o===Tc||o===c_||o===Eg||o===Ng}function v2(o){switch(o){case Tc:return jke;case c_:return Kke;case Eg:return qke;case Ng:return Gke}}function bS(o){const e=v2(o);return new BZ(o,e)}class Xke extends V{constructor(){super(),this._onColorThemeChange=this._register(new B),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new B),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new FZ,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Tc,bS(Tc)),this._knownThemes.set(c_,bS(c_)),this._knownThemes.set(Eg,bS(Eg)),this._knownThemes.set(Ng,bS(Ng));const e=this._register(Zke(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Tc),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),az(xt,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return Py(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=jo(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),V.None}_registerShadowDomContainer(e){const t=jo(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!Cy(t.base)&&!Cy(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new BZ(e,t)),Cy(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Tc),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=xt.matchMedia("(forced-colors: active)").matches;if(e!==Ta(this._theme.type)){let t;R_(this._theme.type)?t=e?Eg:c_:t=e?Ng:Tc,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};Yke.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of WZ.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${m5(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(`
`)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule($ke(s)),this._themeCSS=e.join(`
`),this._updateCSS(),fi.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}class Qke extends ue{constructor(){super({id:"editor.action.toggleHighContrast",label:o2.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Jo),n=i.getColorTheme();Ta(n.type)?(i.setTheme(this._originalThemeName||(R_(n.type)?c_:Tc)),this._originalThemeName=null):(i.setTheme(R_(n.type)?Eg:Ng),this._originalThemeName=n.themeName)}}J(Qke);var b2;(function(o){o[o.Unknown=0]="Unknown",o[o.Disabled=1]="Disabled",o[o.Enabled=2]="Enabled"})(b2||(b2={}));var C2;(function(o){o[o.Invoke=1]="Invoke",o[o.Auto=2]="Auto"})(C2||(C2={}));var w2;(function(o){o[o.None=0]="None",o[o.KeepWhitespace=1]="KeepWhitespace",o[o.InsertAsSnippet=4]="InsertAsSnippet"})(w2||(w2={}));var S2;(function(o){o[o.Method=0]="Method",o[o.Function=1]="Function",o[o.Constructor=2]="Constructor",o[o.Field=3]="Field",o[o.Variable=4]="Variable",o[o.Class=5]="Class",o[o.Struct=6]="Struct",o[o.Interface=7]="Interface",o[o.Module=8]="Module",o[o.Property=9]="Property",o[o.Event=10]="Event",o[o.Operator=11]="Operator",o[o.Unit=12]="Unit",o[o.Value=13]="Value",o[o.Constant=14]="Constant",o[o.Enum=15]="Enum",o[o.EnumMember=16]="EnumMember",o[o.Keyword=17]="Keyword",o[o.Text=18]="Text",o[o.Color=19]="Color",o[o.File=20]="File",o[o.Reference=21]="Reference",o[o.Customcolor=22]="Customcolor",o[o.Folder=23]="Folder",o[o.TypeParameter=24]="TypeParameter",o[o.User=25]="User",o[o.Issue=26]="Issue",o[o.Snippet=27]="Snippet"})(S2||(S2={}));var y2;(function(o){o[o.Deprecated=1]="Deprecated"})(y2||(y2={}));var L2;(function(o){o[o.Invoke=0]="Invoke",o[o.TriggerCharacter=1]="TriggerCharacter",o[o.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(L2||(L2={}));var k2;(function(o){o[o.EXACT=0]="EXACT",o[o.ABOVE=1]="ABOVE",o[o.BELOW=2]="BELOW"})(k2||(k2={}));var x2;(function(o){o[o.NotSet=0]="NotSet",o[o.ContentFlush=1]="ContentFlush",o[o.RecoverFromMarkers=2]="RecoverFromMarkers",o[o.Explicit=3]="Explicit",o[o.Paste=4]="Paste",o[o.Undo=5]="Undo",o[o.Redo=6]="Redo"})(x2||(x2={}));var D2;(function(o){o[o.LF=1]="LF",o[o.CRLF=2]="CRLF"})(D2||(D2={}));var I2;(function(o){o[o.Text=0]="Text",o[o.Read=1]="Read",o[o.Write=2]="Write"})(I2||(I2={}));var E2;(function(o){o[o.None=0]="None",o[o.Keep=1]="Keep",o[o.Brackets=2]="Brackets",o[o.Advanced=3]="Advanced",o[o.Full=4]="Full"})(E2||(E2={}));var N2;(function(o){o[o.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",o[o.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",o[o.accessibilitySupport=2]="accessibilitySupport",o[o.accessibilityPageSize=3]="accessibilityPageSize",o[o.ariaLabel=4]="ariaLabel",o[o.ariaRequired=5]="ariaRequired",o[o.autoClosingBrackets=6]="autoClosingBrackets",o[o.autoClosingComments=7]="autoClosingComments",o[o.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",o[o.autoClosingDelete=9]="autoClosingDelete",o[o.autoClosingOvertype=10]="autoClosingOvertype",o[o.autoClosingQuotes=11]="autoClosingQuotes",o[o.autoIndent=12]="autoIndent",o[o.automaticLayout=13]="automaticLayout",o[o.autoSurround=14]="autoSurround",o[o.bracketPairColorization=15]="bracketPairColorization",o[o.guides=16]="guides",o[o.codeLens=17]="codeLens",o[o.codeLensFontFamily=18]="codeLensFontFamily",o[o.codeLensFontSize=19]="codeLensFontSize",o[o.colorDecorators=20]="colorDecorators",o[o.colorDecoratorsLimit=21]="colorDecoratorsLimit",o[o.columnSelection=22]="columnSelection",o[o.comments=23]="comments",o[o.contextmenu=24]="contextmenu",o[o.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",o[o.cursorBlinking=26]="cursorBlinking",o[o.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",o[o.cursorStyle=28]="cursorStyle",o[o.cursorSurroundingLines=29]="cursorSurroundingLines",o[o.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",o[o.cursorWidth=31]="cursorWidth",o[o.disa
`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class zxe{constructor(e,t,i,n,s,r,a){this.id=++GZ,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new sV),this.removedResources.has(t)||this.removedResources.set(t,new nV(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new sV),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new nV(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class ZZ{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(``)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new hj(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const c=this._past[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,s=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class BT{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const YZ=new ZZ("","");YZ.locked=!0;let S4=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(``))}pushElement(e,t=CM.None,i=Yu.None){if(e.type===0){const n=CS(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new wS(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,s=[],r=[];for(const a of e.resources){const l=CS(a),c=this.getUriComparisonKey(a);n.has(c)||(n.add(c),s.push(l),r.push(c))}s.length===1?this._pushElement(new wS(e,s[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new zxe(e,s,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const n=e.resourceLabels[t],s=e.strResources[t];let r;this._editStacks.has(s)?r=this._editStacks.get(s):(r=new ZZ(n,s),this._editStacks.set(s,r)),r.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const n=i.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=CS(s.resource),a=this.getUriComparisonKey(s.resource),l=new wS(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=CS(s.resource),a=this.getUriComparisonKey(s.resource),l=new wS(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new hj(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const r=s.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof Yu){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){Pe(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),s()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),s())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return V.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?V.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(V.None);const i=e.actual.prepareUndoRedo();return i?sI(i)?t(i):i.then(n=>t(n)):t(V.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||YZ);return new BT(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new SS(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new SS}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources
:host { all: initial; /* 1st rule so subsequent properties are reset. */ }
.codicon[class*='codicon-'] { font: normal normal normal 16px/1 codicon; display: inline-block; text-decoration: none; text-rendering: auto; text-align: center; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; user-select: none; -webkit-user-select: none; -ms-user-select: none; }
:host { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; }
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } :host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } :host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } :host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } :host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; } :host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } :host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } :host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } :host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } :host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }`;var Zxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Yxe=function(o,e){return function(t,i){e(t,i,o)}};let ax=class extends V{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new k4(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(ke(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};ax=Zxe([Yxe(0,pu)],ax);class Xxe extends ax{getContextViewElement(){return this.contextView.getViewElement()}}class Qxe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(e===void 0||Hs(e)||Ji(e))n=e;else if(!HC(e.markdown))n=e.markdown??e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(m("iconLabel.loading","Loading..."),t,i),this._cancellationTokenSource=new oi;const s=this._cancellationTokenSource.token;if(n=await e.markdown(s),n===void 0&&(n=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){var s;const n=this._hoverWidget;if(this.hasContent(e)){const r={content:e,target:this.target,actions:i==null?void 0:i.actions,linkHandler:i==null?void 0:i.linkHandler,trapFocus:i==null?void 0:i.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n,showHoverHint:(s=i==null?void 0:i.appearance)==null?void 0:s.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(r,t)}n==null||n.dispose()}hasContent(e){return e?Aa(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)==null?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)==null||e.dispose(),(t=this._cancellationTokenSource)==null||t.dispose(!0),this._cancellationTokenSource=void 0}}var Jxe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hb=function(o,e){return function(t,i){e(t,i,o)}};let x4=class extends V{constructor(e,t,i,n,s){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=s,this._managedHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new ax(this._layoutService))}showHover(e,t,i){var l,c,d,h;if(aV(this._currentHoverOptions)===aV(e)||this._currentHover&&((c=(l=this._currentHoverOptions)==null?void 0:l.persistence)!=null&&c.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const n=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),s=Rn();i||(n&&s?s.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=s):this._lastFocusedElementBeforeOpen=void 0);const r=new K,a=this._instantiationService.createInstance(L4,e);if((d=e.persistence)!=null&&d.sticky&&(a.isLocked=!0),a.onDispose(()=>{var g,f;((g=this._currentHover)==null?void 0:g.domNode)&&eU(this._currentHover.domNode)&&((f=this._lastFocusedElementBeforeOpen)==null||f.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),r.dispose()},void 0,r),!e.container){const u=Ji(e.target)?e.target:e.target.targetElement
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=OE.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var a;const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const s=n+i.length;if(s>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(s);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(a=this.previous)==null?void 0:a.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!uo(l,c)}return!0}}const lx={kind:0},sDe={kind:1};function oDe(o,e,t){return{kind:2,commandId:o,commandArgs:e,isBubble:t}}class mC{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const r=s.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=mC.handleRemovals([].concat(e).concat(t));for(let s=0,r=this._keybindings.length;s<r;s++){const a=this._keybindings[s];if(a.chords.length===0)continue;const l=(n=a.when)==null?void 0:n.substituteConstants();l&&l.type===0||this._addKeyPress(a.chords[0],a)}}static _isTargetedForRemoval(e,t,i){if(t){for(let n=0;n<t.length;n++)if(t[n]!==e.chords[n])return!1}return!(i&&i.type!==1&&(!e.when||!iee(i,e.when)))}static handleRemovals(e){const t=new Map;for(let n=0,s=e.length;n<s;n++){const r=e[n];if(r.command&&r.command.charAt(0)==="-"){const a=r.command.substring(1);t.has(a)?t.get(a).push(r):t.set(a,[r])}}if(t.size===0)return e;const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];if(!r.command||r.command.length===0){i.push(r);continue}if(r.command.charAt(0)==="-")continue;const a=t.get(r.command);if(!a||!r.isDefault){i.push(r);continue}let l=!1;for(const c of a){const d=c.when;if(this._isTargetedForRemoval(r,c.chords,d)){l=!0;break}}if(!l){i.push(r);continue}}return i}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const s=i[n];if(s.command===t.command)continue;let r=!0;for(let a=1;a<s.chords.length&&a<t.chords.length;a++)if(s.chords[a]!==t.chords[a]){r=!1;break}r&&mC.whenIsEntirelyIncluded(s.when,t.when)&&this._removeFromLookupMap(s)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i<n;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:yR(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let n=i.length-1;n>=0;n--){const s=i[n];if(t.contextMatchesRules(s.when))return s}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(s===void 0)return this._log("\\ No keybinding entries."),lx;let r=null;if(n.length<2)r=s;else{r=[];for(let l=0,c=s.length;l<c;l++){const d=s[l];if(n.length>d.chords.length)continue;let h=!0;for(let u=1;u<n.length;u++)if(d.chords[u]!==n[u]){h=!1;break}h&&r.push(d)}}const a=this._findCommand(e,r);return a?n.length<a.chords.length?(this._log(`\\ From ${r.length} keybinding entries, awaiting ${a.chords.length-n.length} more chord(s), when: ${cV(a.when)}, source: ${dV(a)}.`),sDe):(this._log(`\\ From ${r.length} keybinding entries, matched ${a.command}.monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px;}
${_V(ee.menuSelection)}${_V(ee.menuSubmenu)}
.monaco-menu .monaco-action-bar { text-align: right; overflow: hidden; white-space: nowrap;}
.monaco-menu .monaco-action-bar .actions-container { display: flex; margin: 0 auto; padding: 0; width: 100%; justify-content: flex-end;}
.monaco-menu .monaco-action-bar.vertical .actions-container { display: inline-block;}
.monaco-menu .monaco-action-bar.reverse .actions-container { flex-direction: row-reverse;}
.monaco-menu .monaco-action-bar .action-item { cursor: pointer; display: inline-block; transition: transform 50ms ease; position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */}
.monaco-menu .monaco-action-bar .action-item.disabled { cursor: default;}
.monaco-menu .monaco-action-bar .action-item .icon,.monaco-menu .monaco-action-bar .action-item .codicon { display: inline-block;}
.monaco-menu .monaco-action-bar .action-item .codicon { display: flex; align-items: center;}
.monaco-menu .monaco-action-bar .action-label { font-size: 11px; margin-right: 4px;}
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover { color: var(--vscode-disabledForeground);}
/* Vertical actions */
.monaco-menu .monaco-action-bar.vertical { text-align: left;}
.monaco-menu .monaco-action-bar.vertical .action-item { display: block;}
.monaco-menu .monaco-action-bar.vertical .action-label.separator { display: block; border-bottom: 1px solid var(--vscode-menu-separatorBackground); padding-top: 1px; padding: 30px;}
.monaco-menu .secondary-actions .monaco-action-bar .action-label { margin-left: 6px;}
/* Action Items */.monaco-menu .monaco-action-bar .action-item.select-container { overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */ flex: 1; max-width: 170px; min-width: 60px; display: flex; align-items: center; justify-content: center; margin-right: 10px;}
.monaco-menu .monaco-action-bar.vertical { margin-left: 0; overflow: visible;}
.monaco-menu .monaco-action-bar.vertical .actions-container { display: block;}
.monaco-menu .monaco-action-bar.vertical .action-item { padding: 0; transform: none; display: flex;}
.monaco-menu .monaco-action-bar.vertical .action-item.active { transform: none;}
.monaco-menu .monaco-action-bar.vertical .action-menu-item { flex: 1 1 auto; display: flex; height: 2em; align-items: center; position: relative; margin: 0 4px; border-radius: 4px;}
.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding { opacity: unset;}
.monaco-menu .monaco-action-bar.vertical .action-label { flex: 1 1 auto; text-decoration: none; padding: 0 1em; background: none; font-size: 12px; line-height: 1;}
.monaco-menu .monaco-action-bar.vertical .keybinding,.monaco-menu .monaco-action-bar.vertical .submenu-indicator { display: inline-block; flex: 2 1 auto; padding: 0 1em; text-align: right; font-size: 12px; line-height: 1;}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%;}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon { font-size: 16px !important; display: flex; align-items: center;}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before { margin-left: auto; margin-right: -20px;}
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator { opacity: 0.4;}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) { display: inline-block; box-sizing: border-box; margin: 0;}
.monaco-menu .monaco-action-bar.vertical .action-item { position: static; overflow: visible;}
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu { position: absolute;}
.monaco-menu .monaco-action-bar.vertical .action-label.separator { width: 100%; height: 0px !important; opacity: 1;}
.monaco-menu .monaco-action-bar.vertical .action-label.separator.text { padding: 0.7em 1em 0.1em 1em; font-weight: bold; opacity: 1;}
.monaco-menu .monaco-action-bar.vertical .action-label:hover { color: inherit;}
.monaco-menu .monaco-action-bar.vertical .menu-item-check { position: absolute; visibility: hidden; width: 1em; height: 100%;}
.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check { visibility: visible; display: flex; align-items: center; justify-content: center;}
/* Context Menu */
.context-view.monaco-menu-container { outline: 0; border: none; animation: fadeIn 0.083s linear; -webkit-app-region: no-drag;}
.context-view.monaco-menu-container :focus,.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,.context-view.monaco-menu-container .monaco-action-bar.vertical :focus { outline: 0;}
.hc-black .context-view.monaco-menu-container,.hc-light .context-view.monaco-menu-container,:host-context(.hc-black) .context-view.monaco-menu-container,:host-context(.hc-light) .context-view.monaco-menu-container { box-shadow: none;}
.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused { background: none;}
/* Vertical Action Bar Styles */
.monaco-menu .monaco-action-bar.vertical { padding: 4px 0;}
.monaco-menu .monaco-action-bar.vertical .action-menu-item { height: 2em;}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),.monaco-menu .monaco-action-bar.vertical .keybinding { font-size: inherit; padding: 0 2em; max-height: 100%;}
.monaco-menu .monaco-action-bar.vertical .menu-item-check { font-size: inherit; width: 2em;}
.monaco-menu .monaco-action-bar.vertical .action-label.separator { font-size: inherit; margin: 5px 0 !important; padding: 0; border-radius: 0;}
.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator { margin-left: 0; margin-right: 0;}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator { font-size: 60%; padding: 0 1.8em;}
.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; mask-size: 10px 10px; -webkit-mask-size: 10px 10px;}
.monaco-menu .action-item { cursor: default;}`;if(e){t+=` /* Arrows */ .monaco-scrollable-element > .scrollbar > .scra { cursor: pointer; font-size: 11px !important; }
.monaco-scrollable-element > .visible { opacity: 1;
/* Background rule added for IE9 - to allow clicks on dom node */ background:rgba(0,0,0,0);
transition: opacity 100ms linear; } .monaco-scrollable-element > .invisible { opacity: 0; pointer-events: none; } .monaco-scrollable-element > .invisible.fade { transition: opacity 800ms linear; }
/* Scrollable Content Inset Shadow */ .monaco-scrollable-element > .shadow { position: absolute; display: none; } .monaco-scrollable-element > .shadow.top { display: block; top: 0; left: 3px; height: 3px; width: 100%; } .monaco-scrollable-element > .shadow.left { display: block; top: 3px; left: 0; height: 100%; width: 3px; } .monaco-scrollable-element > .shadow.top-left-corner { display: block; top: 0; left: 0; height: 3px; width: 3px; } `;const i=o.scrollbarShadow;i&&(t+=` .monaco-scrollable-element > .shadow.top { box-shadow: ${i} 0 6px 6px -6px inset; }
.monaco-scrollable-element > .shadow.left { box-shadow: ${i} 6px 0 6px -6px inset; }
.monaco-scrollable-element > .shadow.top.left { box-shadow: ${i} 6px 6px 6px -6px inset; } `);const n=o.scrollbarSliderBackground;n&&(t+=` .monaco-scrollable-element > .scrollbar > .slider { background: ${n}; } `);const s=o.scrollbarSliderHoverBackground;s&&(t+=` .monaco-scrollable-element > .scrollbar > .slider:hover { background: ${s}; } `);const r=o.scrollbarSliderActiveBackground;r&&(t+=` .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } `)}return t}class vDe{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=Rn();let i;const n=Ji(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{var d;this.lastContainer=s;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(s.className+=" "+r),this.options.blockMouse&&(this.block=s.appendChild(ne(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(d=this.blockDisposable)==null||d.dispose(),this.blockDisposable=$(this.block,ie.MOUSE_DOWN,h=>h.stopPropagation()));const a=new K,l=e.actionRunner||new Mf;l.onWillRun(h=>this.onActionRun(h,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new h_(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:h=>this.keybindingService.lookupKeybinding(h.id)},pfe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=ke(s);return a.add($(c,ie.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add($(c,ie.MOUSE_DOWN,h=>{if(h.defaultPrevented)return;const u=new Hr(c,h);let g=u.target;if(!u.rightButton){for(;g;){if(g===s)return;g=g.parentElement}this.contextViewService.hideContextView(!0)}})),Ur(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:s=>{var r,a,l;(r=e.onHide)==null||r.call(e,!!s),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Rn()===this.lastContainer||Xi(Rn(),this.lastContainer))&&((l=this.focusToReturn)==null||l.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!wr(e.error)&&this.notificationService.error(e.error)}}var bDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Km=function(o,e){return function(t,i){e(t,i,o)}};let R4=class extends V{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new vDe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new B),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new B)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=M4.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}}),Pc.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};R4=bDe([Km(0,$n),Km(1,Ni),Km(2,vd),Km(3,vt),Km(4,Zo),Km(5,De)],R4);var M4;(function(o){function e(i){return i&&i.menuId instanceof me}function t(i,n,s){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;re
`?r=2:a===``&&(r=1);let l=Bn.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=Bn.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Bn.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Bn.bracketPairColorizationOptions;return(u=e.editor)!=null&&u.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:s,detectIndentation:c,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:lo===3||lo===2?``:`\r`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);s=Jm._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;n<s;n++){const r=i[n],a=this._models[r],l=a.model.getLanguageId(),c=a.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:l,resource:c})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:l,resource:c}))continue;const d=t[l+c],h=this.getCreationOptions(l,c,a.model.isForSimpleWidget);Jm._setModelOptionsForModel(a.model,h,d)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&uo(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions))&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(Nu(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(Nu(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(Nu(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),r=this._instantiationService.createInstance(ka,e,t,s,i);if(i&&this._disposedModels.has(Nu(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===c.sha1:!1;if(u||c.sharesUndoRedoStack){for(const g of d.past)kc(g)&&g.matchesResource(i)&&g.setModel(r);for(const g of d.future)kc(g)&&g.matchesResource(i)&&g.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,g=>kc(g)&&g.matchesResource(i)),u&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=Nu(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new yDe(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,n=!1){let s;return t?s=this._createModelData(e,t,i,n):s=this._createModelData(e,bs,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i];e.push(this._models[s].model)}return e}getModel(e){const t=Nu(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Oe.file||e.scheme===Oe.vscodeRemote||e.scheme===Oe.vscodeUserData||e.scheme===Oe.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=Nu(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!=
`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};z4=MDe([CV(0,Ke),CV(1,Ql)],z4);const wV="done",SV="active",UT="infinite",$T="infinite-long-running",yV="discrete",YD=class YD extends V{constructor(e,t){super(),this.progressSignal=this._register(new tn),this.workedVal=0,this.showDelayedScheduler=this._register(new Lt(()=>oo(this.element),0)),this.longRunningScheduler=this._register(new Lt(()=>this.infiniteLongRunning(),YD.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(SV,UT,$T,yV),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(wV),this.element.classList.contains(UT)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(yV,wV,$T),this.element.classList.add(SV,UT),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add($T)}getContainer(){return this.element}};YD.LONG_RUNNING_INFINITE_THRESHOLD=1e4;let U4=YD;const HDe=ne;class VDe extends V{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=s=>ci(this.findInput.inputBox.inputElement,ie.KEY_DOWN,s),this.onDidChange=s=>this.findInput.onDidChange(s),this.container=X(this.parent,HDe(".quick-input-box")),this.findInput=this._register(new Wq(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="combobox",n.ariaHasPopup="menu",n.ariaAutoComplete="list",n.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===Ii.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Ii.Info?1:e===Ii.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Ii.Info?1:e===Ii.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const LV=new Fa(()=>{const o=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:o,collatorIsNumeric:o.resolvedOptions().numeric}});function zDe(o,e,t=!1){const i=o||"",n=e||"",s=LV.value.collator.compare(i,n);return LV.value.collatorIsNumeric&&s===0&&i!==n?i<n?-1:1:s}function UDe(o,e,t){const i=o.toLowerCase(),n=e.toLowerCase(),s=$De(o,e,t);if(s)return s;const r=i.endsWith(t),a=n.endsWith(t);if(r!==a)return r?-1:1;const l=zDe(i,n);return l!==0?l:i.localeCompare(n)}function $De(o,e,t){const i=o.toLowerCase(),n=e.toLowerCase(),s=i.startsWith(t),r=n.startsWith(t);if(s!==r)return s?-1:1;if(s&&r){if(i.length<n.length)return-1;if(i.length>n.length)return 1}return 0}var FE=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===n
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}},K4=xf,xf.MAX_WIDTH=600,xf);q4=K4=YDe([jT(1,pu),jT(2,Ce),jT(3,De)],q4);var XDe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ub=function(o,e){return function(t,i){e(t,i,o)}};let G4=class extends zoe{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(H4))),this._quickAccess}constructor(e,t,i,n,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=s,this._onShow=this._register(new B),this._onHide=this._register(new B),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(r=>{r.get(Zs).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(z4))},n=this._register(this.instantiationService.createInstance(q4,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(s=>{ke(e.activeContainer)===ke(n.container)&&n.layout(s,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new de(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=Ve.None){return this.controller.pick(e,t,i)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:he(T7),quickInputForeground:he(Bse),quickInputTitleBackground:he(Hse),widgetBorder:he(QU),widgetShadow:he(wv)},inputBox:OL,toggle:PL,countBadge:dK,button:ufe,progressBar:gfe,keybindingLabel:hfe,list:hm({listBackground:T7,listFocusBackground:sw,listFocusForeground:nw,listInactiveFocusForeground:nw,listInactiveSelectionIconForeground:L5,listInactiveFocusBackground:sw,listFocusOutline:Kt,listInactiveFocusOutline:Kt}),pickerGroup:{pickerGroupBorder:he(Vse),pickerGroupForeground:he(l$)}}}};G4=XDe([ub(0,Ce),ub(1,De),ub(2,Ki),ub(3,pu),ub(4,Ke)],G4);var aY=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eg=function(o,e){return function(t,i){e(t,i,o)}};let Z4=class extends G4{constructor(e,t,i,n,s,r){super(t,i,n,new w4(e.getContainerDomNode(),s),r),this.host=void 0;const a=_1.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContai
(-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}]`);return e.join(``)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}const dIe=!1;class MV extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: ${e.toString()}`}}class _x{constructor(e=new yv,t=!1,i,n=dIe){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(Ce,this),this._globalGraph=n?(i==null?void 0:i._globalGraph)??new RV(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,Et(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)sI(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends _x{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t==null||t.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=vC.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw TF("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof Cl?(i=vC.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=vC.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=La.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),s.push(l)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Cl)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Cl?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var l;const n=new RV(c=>c.id.toString());let s=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const c=r.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),n.lookupOrInsertNode(c),s++>1e3)throw new MV(n);for(const d of La.getServiceDependencies(c.desc.ctor)){const h=this._getServiceInstanceOrDescriptor(d.id);if(h||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),(l=this._globalGraph)==null||l.insertEdge(String(c.id),String(d.id)),h instanceof Cl){const u={id:d.id,desc:h,_trace:c._trace.branch(d.id,!0)};n.insertEdge(c,u),r.push(u)}}}}for(;;){const c=n.roots();if(c.length===0){if(!n.isEmpty())throw new MV(n);break}for(const{data:d}of c){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Cl){const u=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,u)}n.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithO
`).slice(3,4).join(``)):ko._None}static traceCreation(e,t){return e?new ko(1,t.name):ko._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new ko(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;ko._totals+=e;let t=!1;function i(s,r){const a=[],l=new Array(s+1).join(" ");for(const[c,d,h]of r._dep)if(d&&h){t=!0,a.push(`${l}CREATES -> ${c}`);const u=i(s+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${c}`);return a.join(``)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${ko._totals.toFixed(2)}ms)`];(e>2||t)&&ko.all.add(n.join(``))}};ko.all=new Set,ko._None=new class extends ko{constructor(){super(0,null)}stop(){}branch(){return this}},ko._totals=0;let vC=ko;const hIe=new Set([Oe.inMemory,Oe.vscodeSourceControl,Oe.walkThrough,Oe.walkThroughSnippet,Oe.vscodeChatCodeBlock]);class uIe{constructor(){this._byResource=new cn,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new cn,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i;return typeof e=="string"?((t=this._byOwner.get(e))==null?void 0:t.values())??it.empty():Le.isUri(e)?((i=this._byResource.get(e))==null?void 0:i.values())??it.empty():it.map(it.concat(...this._byOwner.values()),n=>n[1])}}class gIe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new cn,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(hIe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===pi.Error?t.errors+=1:i===pi.Warning?t.warnings+=1:i===pi.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Fd{constructor(){this._onMarkerChanged=new bz({delay:0,merge:Fd._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new uIe,this._stats=new gIe(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(CU(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const r=Fd._toMarker(e,t,s);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:g}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const r=it.first(s);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(os(t)){const s=new cn;for(const{resource:r,marker:a}of t){const l=Fd._toMarker(e,r,a);if(!l)continue;const c=s.get(r);c?c.push(l):(s.set(r,[l]),i.push(r))}for(const[r,a]of s)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Fd._accept(l,n)){const c=a.push(l);if(s>0&&c===s)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Fd._accept(l,n)){const c=r.push(l);if(s>0&&c===s)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Fd._accept(c,n)){const d=a.push(c);if(s>0&&d===s)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new cn;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class fIe extends V{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=bn.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configur
`+t),xt.confirm(i)}async prompt(e){var n;let t;if(this.doConfirm(e.message,e.detail)){const s=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),t=await((n=s[0])==null?void 0:n.run({checkboxChecked:!1}))}return{result:t}}async error(e,t){await this.prompt({type:Ii.Error,message:e,detail:t})}}const OC=class OC{info(e){return this.notify({severity:Ii.Info,message:e})}warn(e){return this.notify({severity:Ii.Warning,message:e})}error(e){return this.notify({severity:Ii.Error,message:e})}notify(e){switch(e.severity){case Ii.Error:console.error(e.message);break;case Ii.Warning:console.warn(e.message);break;default:console.log(e.message);break}return OC.NO_OP}prompt(e,t,i,n){return OC.NO_OP}status(e,t){return V.None}};OC.NO_OP=new Sde;let oF=OC,rF=class{constructor(e){this._onWillExecuteCommand=new B,this._onDidExecuteCommand=new B,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=nt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};rF=tc([Pi(0,Ce)],rF);let dv=class extends aDe{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const f=new K;f.add($(g,ie.KEY_DOWN,p=>{const _=new Tt(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),f.add($(g,ie.KEY_UP,p=>{const _=new Tt(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new wIe(g,f))},l=g=>{for(let f=0;f<this._domNodeListeners.length;f++){const p=this._domNodeListeners[f];p.domNode===g&&(this._domNodeListeners.splice(f,1),p.dispose())}},c=g=>{g.getOption(61)||a(g.getContainerDomNode())},d=g=>{g.getOption(61)||l(g.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const h=g=>{a(g.getContainerDomNode())},u=g=>{l(g.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return Ur(nt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:tR(i.keybinding,lo),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),be(()=>{for(let i=0;i<this._dynamicKeybindings.length;i++)if(this._dynamicKeybindings[i]===t[0]){this._dynamicKeybindings.splice(i,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(Ls.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new mC(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return xt.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const r=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new hV(void 0,s.command,s.commandArgs,r,t,null,!1);else{const l=m1.resolveKeybinding(a,lo);for(const c of l)i[n++]=new hV(c,s.command,s.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new td(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new m1([t],lo)}};dv=tc([Pi(0,De),Pi(1,At),Pi(2,$n),Pi(3,Ni),Pi(4,Pn),Pi(5,ut)],dv);class wIe extends V{constructor(e,t){super(),this.domNode=e,this._register(t)}}function AV(o){return o&&typeof o=="object"&&(!o.overrideIdentifier||typeof o.overrideIdentifier=="string")&&(!o.resource||o.resource instanceof Le)}let vx=class{constructor(e)
`:`\r`}};lF=tc([Pi(0,Ke)],lF);class SIe{publicLog2(){}}const FC=class FC{constructor(){const e=Le.from({scheme:FC.SCHEME,authority:"model",path:"/"});this.workspace={id:xK,folders:[new pme({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===FC.SCHEME?this.workspace.folders[0]:null}};FC.SCHEME="inmemory";let cF=FC;function bx(o,e,t){if(!e||!(o instanceof vx))return;const i=[];Object.keys(e).forEach(n=>{Ome(n)&&i.push([`editor.${n}`,e[n]]),t&&Fme(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&o.updateValues(i)}let dF=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:R3.convert(e),n=new Map;for(const a of i){if(!(a instanceof vh))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=n.get(l);c||(c=[],n.set(l,c)),c.push(ni.replaceMove(k.lift(a.textEdit.range),a.textEdit.text))}let s=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,s+=l.length;return{ariaSummary:Nf(r2.bulkEditServiceSummary,s,r),isApplied:s>0}}};dF=tc([Pi(0,Vt)],dF);class yIe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return br(e)}}let hF=class extends Xxe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};hF=tc([Pi(0,pu),Pi(1,ut)],hF);class LIe{constructor(){this._neverEmitter=new B,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class kIe extends E4{constructor(){super()}}class xIe extends mIe{constructor(){super(new lee)}}let uF=class extends R4{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r),this.configure({blockMouse:!1})}};uF=tc([Pi(0,$n),Pi(1,Ni),Pi(2,vd),Pi(3,vt),Pi(4,Zo),Pi(5,De)],uF);const gF={amdModuleId:"vs/editor/common/services/editorSimpleWorker",esmModuleLocation:void 0,label:"editorWorkerService"};let fF=class extends v4{constructor(e,t,i,n,s){super(gF,e,t,i,n,s)}};fF=tc([Pi(0,Vt),Pi(1,EE),Pi(2,Pn),Pi(3,ai),Pi(4,ge)],fF);class DIe{async playSignal(e,t){}}tt(Pn,xIe,0);tt(Ke,vx,0);tt(EE,aF,0);tt(tZ,lF,0);tt(zf,cF,0);tt(Z_,yIe,0);tt($n,SIe,0);tt(a0,CIe,0);tt(U3,bIe,0);tt(Ni,oF,0);tt(Jl,Fd,0);tt(Jt,kIe,0);tt(Jo,Xke,0);tt(Vt,W4,0);tt(g5,F4,0);tt(De,iF,0);tt(pK,vIe,0);tt(uu,sF,0);tt(ta,cfe,0);tt(Gs,fF,0);tt(Z1,dF,0);tt(_Z,LIe,0);tt(Ks,nF,0);tt(Co,Q4,0);tt(Lr,xve,0);tt(At,rF,0);tt(vt,dv,0);tt(yr,Y4,0);tt(vd,hF,0);tt(Zs,O4,0);tt(_d,eF,0);tt(So,uF,0);tt(Zo,iA,0);tt(hu,DIe,0);tt(dj,pIe,0);var Ne;(function(o){const e=new yv;for(const[l,c]of c7())e.set(l,c);const t=new _x(e,!0);e.set(Ce,t);function i(l){n||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Cl?t.invokeFunction(d=>d.get(l)):c}o.get=i;let n=!1;const s=new B;function r(l){if(n)return t;n=!0;for(const[d,h]of c7())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=Qe(d);e.get(h)instanceof Cl&&e.set(h,l[d])}const c=wpe();for(const d of c)try{t.createInstance(d)}catch(h){Pe(h)}return s.fire(),t}o.initialize=r;function a(l){if(n)return l();const c=new K,d=c.add(s.event(()=>{d.dispose(),c.add(l())}));return c}o.withServices=a})(Ne||(Ne={}));function IIe(o,e){return new EIe(o,e)}class EIe extends sx{constructor(e,t){const i={amdModuleId:gF.amdModuleId,esmModuleLocation:gF.esmModuleLocation,label:t.label};super(i,t.keepIdleModels||!1,e),this._foreignModuleId=t.moduleId,this._foreignModuleCreateData=t.createData||null,this._foreignModuleHost=t.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(
`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,h=0,u=null,g=!0;for(;g||h<l;){const f=h,p=d.depth,_=u?u.groups.length:0,v=d.state;let b=null,C=null,w=null,S=null,L=null;if(u){b=u.matches;const N=u.groups.shift();C=N.matched,w=N.action,S=u.rule,u.groups.length===0&&(u=null)}else{if(!g&&h>=l)break;g=!1;let N=this._lexer.tokenizer[v];if(!N&&(N=DS(this._lexer,v),!N))throw $t(this._lexer,"tokenizer state is not defined: "+v);const z=a.substr(h);for(const P of N)if((h===0||!P.matchOnlyAtLineStart)&&(b=z.match(P.resolveRegex(v)),b)){C=b[0],w=P.action;break}}if(b||(b=[""],C=""),w||(h<l&&(b=[a.charAt(h)],C=b[0]),w=this._lexer.defaultToken),C===null)break;for(h+=C.length;TIe(w)&&PV(w)&&w.test;)w=w.test(C,b,v,h===l);let x=null;if(typeof w=="string"||Array.isArray(w))x=w;else if(w.group)x=w.group;else if(w.token!==null&&w.token!==void 0){if(w.tokenSubst?x=Yd(this._lexer,w.token,C,b,v):x=w.token,w.nextEmbedded)if(w.nextEmbedded==="@pop"){if(!c)throw $t(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw $t(this._lexer,"cannot enter embedded language from within an embedded language");L=Yd(this._lexer,w.nextEmbedded,C,b,v)}if(w.goBack&&(h=Math.max(0,h-w.goBack)),w.switchTo&&typeof w.switchTo=="string"){let N=Yd(this._lexer,w.switchTo,C,b,v);if(N[0]==="@"&&(N=N.substr(1)),DS(this._lexer,N))d=d.switchTo(N);else throw $t(this._lexer,"trying to switch to a state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}else{if(w.transform&&typeof w.transform=="function")throw $t(this._lexer,"action.transform not supported");if(w.next)if(w.next==="@push"){if(d.depth>=this._lexer.maxStack)throw $t(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(w.next==="@pop"){if(d.depth<=1)throw $t(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let N=Yd(this._lexer,w.next,C,b,v);if(N[0]==="@"&&(N=N.substr(1)),DS(this._lexer,N))d=d.push(N);else throw $t(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(S))}}w.log&&typeof w.log=="string"&&RIe(this._lexer,this._lexer.languageId+": "+Yd(this._lexer,w.log,C,b,v))}if(x===null)throw $t(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const D=N=>{const z=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,P=this._getNestedEmbeddedLanguageData(z);if(h<l){const M=e.substr(h);return this._nestedTokenize(M,t,Xd.create(d,P),n+h,s)}else return Xd.create(d,P)};if(Array.isArray(x)){if(u&&u.groups.length>0)throw $t(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==x.length+1)throw $t(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let N=0;for(let z=1;z<b.length;z++)N+=b[z].length;if(N!==C.length)throw $t(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(S));u={rule:S,matches:b,groups:[]};for(let z=0;z<x.length;z++)u.groups[z]={action:x[z],matched:b[z+1]};h-=C.length;continue}else{if(x==="@rematch"&&(h-=C.length,C="",b=null,x="",L!==null))return D(L);if(C.length===0){if(l===0||p!==d.depth||v!==d.state||(u?u.groups.length:0)!==_)continue;throw $t(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(S))}let N=null;if(cY(x)&&x.indexOf("@brackets")===0){const z=x.substr(9),P=WIe(this._lexer,C);if(!P)throw $t(this._lexer,"@brackets token returned but no bracket defined as: "+C);N=OV(P.token+z)}else{const z=x===""?"":x+this._lexer.tokenPostfix;N=OV(z)}f<r&&s.emit(f+n,N)}if(L!==null)return D(L)}return Xd.create(d,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new Lp(e,W_);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),fi.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=fi.get(e);return t?new Lp(e,t.getInitialState()):new Lp(e,W_)}};b1=mF=PIe([OIe(4,Ke)],b1);function WI
`);let r=t;return s!==-1&&(r=t.substring(0,s)),BV(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return BV(o,t,e.createById(i),n)}function BV(o,e,t,i){return o.createModel(e,t,i)}var UIe=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},HV=function(o,e){return function(t,i){e(t,i,o)}};class $Ie{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let Sx=class extends V{constructor(e,t,i,n,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=je(this,void 0),this._collapsed=_e(this,l=>{var c;return(c=this._viewModel.read(l))==null?void 0:c.collapsed.read(l)}),this._editorContentHeight=je(this,500),this.contentHeight=_e(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=je(this,0),this._modifiedWidth=je(this,0),this._originalContentWidth=je(this,0),this._originalWidth=je(this,0),this.maxScroll=_e(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=Ze("div.multiDiffEntry",[Ze("div.header@header",[Ze("div.header-content",[Ze("div.collapse-button@collapseButton"),Ze("div.file-path",[Ze("div.title.modified.show-file-icons@primaryPath",[]),Ze("div.status.deleted@status",["R"]),Ze("div.title.original.show-file-icons@secondaryPath",[])]),Ze("div.actions@actions")])]),Ze("div.editorParent",[Ze("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(ld,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=ao(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=ao(this.editor.getOriginalEditor()).isFocused,this.isFocused=_e(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new K),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new KL(this._elements.collapseButton,{});this._register(Ae(l=>{r.element.className="",r.icon=this._collapsed.read(l)?ee.chevronRight:ee.chevronDown})),this._register(r.onDidClick(()=>{var l;(l=this._viewModel.get())==null||l.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Ae(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{Cb(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(Ae(l=>{var d;const c=(d=this._viewModel.read(l))==null?void 0:d.isActive.read(l);thi
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")s.push({token:a.token+t.tokenPostfix,open:Jc(t,a.open),close:Jc(t,a.close)});else throw $t(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}function PEe(o){I_.registerLanguage(o)}function OEe(){let o=[];return o=o.concat(I_.getLanguages()),o}function FEe(o){return Ne.get(Jt).languageIdCodec.encodeLanguageId(o)}function WEe(o,e){return Ne.withServices(()=>{const i=Ne.get(Jt).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function BEe(o,e){return Ne.withServices(()=>{const i=Ne.get(Jt).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function HEe(o,e){if(!Ne.get(Jt).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Ne.get(ai).register(o,e,100)}class VEe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return C1.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new UI(n.tokens,n.endState)}}class C1{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s<r;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new aw(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),r=C1._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new R5(r,a)}tokenize(e,t,i){return C1.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const h=t[c],u=n.match(i,h.scopes)|1024;if(r>0&&s[r-1]===u)continue;let g=h.startIndex;c===0?g=0:g<a&&(g=a),s[r++]=g,s[r++]=u,a=g}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=s[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new UI(s,r)}}function zEe(o){return typeof o.getInitialState=="function"}function UEe(o){return"tokenizeEncoded"in o}function fY(o){return o&&typeof o.then=="function"}function $Ee(o){const e=Ne.get(Jo);if(o){const t=[null];for(let i=1,n=o.length;i<n;i++)t[i]=Y.fromHex(o[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function mY(o,e){return UEe(e)?new VEe(o,e):new C1(o,e,Ne.get(Jt),Ne.get(Jo))}function oW(o,e){const t=new Tre(async()=>{const i=await Promise.resolve(e.create());return i?zEe(i)?mY(o,i):new b1(Ne.get(Jt),Ne.get(Jo),o,gY(o,i),Ne.get(Ke)):null});return fi.registerFactory(o,t)}function jEe(o,e){if(!Ne.get(Jt).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return fY(e)?oW(o,{create:()=>e}):fi.register(o,mY(o,e))}function KEe(o,e){const t=i=>new b1(Ne.get(Jt),Ne.get(Jo),o,gY(o,i),Ne.get(Ke));return fY(e)?oW(o,{create:()=>e}):fi.register(o,t(e))}function qEe(o,e){return Ne.get(ge).referenceProvider.register(o,e)}function GEe(o,e){return Ne.get(ge).renameProvider.register(o,e)}function ZEe(o,e){return Ne.get(ge).newSymbolNamesProvider.register(o,e)}function YEe(o,e){return Ne.get(ge).signatureHelpProvider.register(o,e)}function XEe(o,e){return Ne.get(ge).hoverProvider.register(o,{provideHover:async(i,n,s,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new k(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new k(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function QEe(o,e){return Ne
${o.value}\`\`\``}}function UNe(o){return typeof o=="string"||"language"in o?[qV(o)]:Array.isArray(o)?o.map(qV):[Wv(o)]}function $Ne(o){const e={contents:UNe(o.contents)};return o.range&&(e.range=Cn(o.range)),e}function jNe(o){const e={label:o.value};return o.command&&(e.command=rW(o.command)),o.location&&(e.location=wY(o.location)),typeof o.tooltip=="string"?e.tooltip=o.tooltip:o.tooltip&&(e.tooltip=Wv(o.tooltip)),e}function Rs(o){return{character:o.column-1,line:o.lineNumber-1}}function KNe(o){return{lineNumber:o.line+1,column:o.character+1}}function GV(o){const e={label:typeof o.label=="string"?o.label:o.label.map(jNe),position:KNe(o.position)};return o.kind!=null&&(e.kind=o.kind),o.paddingLeft!=null&&(e.paddingLeft=o.paddingLeft),o.paddingRight!=null&&(e.paddingRight=o.paddingRight),o.textEdits&&(e.textEdits=o.textEdits.map(wh)),typeof o.tooltip=="string"?e.tooltip=o.tooltip:o.tooltip&&(e.tooltip=Wv(o.tooltip)),e}function ZV(o){const e={range:Cn(o.range)};return o.tooltip!=null&&(e.tooltip=o.tooltip),o.target!=null&&(e.url=Rl.parse(o.target)),e}function qNe(o){const e={ranges:o.ranges.map(Cn)};return o.wordPattern!=null&&(e.wordPattern=new RegExp(o.wordPattern)),e}function NS(o){const e={range:Cn(o.targetRange),targetSelectionRange:Cn(o.targetSelectionRange),uri:Rl.parse(o.targetUri)};return o.originSelectionRange&&(e.originSelectionRange=Cn(o.originSelectionRange)),e}function GNe(o){const e={label:o.label};return typeof o.documentation=="string"?e.documentation=o.documentation:o.documentation&&(e.documentation=bY(o.documentation)),e}function ZNe(o){const e={label:o.label};return typeof o.documentation=="string"?e.documentation=o.documentation:o.documentation&&(e.documentation=Wv(o.documentation)),e}function YNe(o){const e=[];let t=o;for(;t;)e.push({range:Cn(t.range)}),t=t.parent;return e}function YV(o){const e={data:Uint32Array.from(o.data)};return o.resultId!=null&&(e.resultId=o.resultId),e}function XNe(o){const e={label:o.label,parameters:o.parameters.map(GNe)};return typeof o.documentation=="string"?e.documentation=o.documentation:o.documentation&&(e.documentation=bY(o.documentation)),o.activeParameter!=null&&(e.activeParameter=o.activeParameter),e}function QNe(o){var e,t;const i={label:o.label,parameters:(t=(e=o.parameters)===null||e===void 0?void 0:e.map(ZNe))!==null&&t!==void 0?t:[]};return typeof o.documentation=="string"?i.documentation=o.documentation:o.documentation&&(i.documentation=Wv(o.documentation)),o.activeParameter!=null&&(i.activeParameter=o.activeParameter),i}function JNe(o){return{activeParameter:o.activeParameter,activeSignature:o.activeSignature,signatures:o.signatures.map(XNe)}}function eTe(o){var e,t;return{activeParameter:(e=o.activeParameter)!==null&&e!==void 0?e:0,activeSignature:(t=o.activeSignature)!==null&&t!==void 0?t:0,signatures:o.signatures.map(QNe)}}function tTe(o){const e={isRetrigger:o.isRetrigger,triggerKind:o.triggerKind};return o.triggerCharacter!=null&&(e.triggerCharacter=o.triggerCharacter),o.activeSignatureHelp&&(e.activeSignatureHelp=JNe(o.activeSignatureHelp)),e}const yY=new WeakMap,XV=new WeakMap;function ii(o,e){const t=(XV.get(e)??0)+1;return XV.set(e,t),o.onCancellationRequested(()=>e.cancelRequest(t)),t}function iTe(o,e,t,i,n){const s=[],r=new Map;s.push(n.onDidCreateModel(d=>l(d)),n.onWillDisposeModel(a),n.onDidChangeModelLanguage(d=>{a(d.model),l(d.model)}),{dispose:()=>{for(const d of n.getModels())a(d)}});for(const d of n.getModels())l(d);return{dispose:()=>s.forEach(d=>d.dispose())};function a(d){var u;n.setModelMarkers(d,t,[]);const h=d.uri.toString();r.has(h)&&((u=r.get(h))==null||u.dispose(),r.delete(h))}function l(d){var f,p;if(!e.includes(((f=d.getLanguageId)==null?void 0:f.call(d))??((p=d.getModeId)==null?void 0:p.call(d))))return;let h;const u=d.onDidChangeContent(()=>{clearTimeout(h),h=setTimeout(()=>c(d),250)}),g=d.onDidChangeAttached(()=>{d.isAttachedToEditor()?c(d):n.setModelMarkers(d,t,[])});r.set(d.uri.toString(),{dispose:()=>{u.dispose(),g.dispose(),clearTimeout(h)}}),c(d)}async function c(d){if(d.isDisposed()||!d.isAttachedToEditor())return;const h=await o `,surroundingPairs:[{open:"'",close:"'"},{open:'"',close:'"'},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{markers:{start:/^\s*<!--\s*#region\b.*-->/,end:/^\s*<!--\s*#endregion\b.*-->/}},wordPattern:/(-?\d*\.\d\w*)|([^\`\@\~\!\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>/\?\s]+)/,onEnterRules:[{beforeText:/<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style))([_:\w][_:\w-.\d]*)(?:(?:[^'"/>]|"[^"]*"|'[^']*')*?(?!\/)>)[^<]*$/i,afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>/i,action:{indentAction:Fi.IndentAction.IndentOutdent}},{beforeText:/<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style))([_:\w][_:\w-.\d]*)(?:(?:[^'"/>]|"[^"]*"|'[^']*')*?(?!\/)>)[^<]*$/i,action:{indentAction:Fi.IndentAction.Indent}}],indentationRules:{increaseIndentPattern:/<(?!\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style)\b|[^>]*\/>)([-_\.A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!\s*\()(?!.*<\/\1>)|<!--(?!.*-->)|\{[^}"']*$/i,decreaseIndentPattern:/^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|-->|\})/}},dTe={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["${","}"],["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],surroundingPairs:[{open:"'",close:"'"},{open:'"',close:'"'},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"`",close:"`"}],autoCloseBefore:";:.,=}])>` \n ",folding:{markers:{start:/^\s*\/\/\s*#?region\b/,end:/^\s*\/\/\s*#?endregion\b/}},wordPattern:/(-?\d*\.\d\w*)|([^\`\~\@\!\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>/\?\s]+)/,indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]].*$/,increaseIndentPattern:/^((?!\/\/).)*(\{([^}"'`/]*|(\t|[ ])*\/\/.*)|\([^)"'`/]*|\[[^\]"'`/]*)$/,unIndentedLinePattern:/^(\t|[ ])*[ ]\*[^/]*\*\/\s*$|^(\t|[ ])*[ ]\*\/\s*$|^(\t|[ ])*[ ]\*([ ]([^\*]|\*(?!\/))*)?$/},onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:Fi.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:Fi.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|[ ])*[ ]\*([ ]([^\*]|\*(?!\/))*)?$/,previousLineText:/(?=^(\s*(\/\*\*|\*)).*)(?=(?!(\s*\*\/)))/,action:{indentAction:Fi.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|[ ])*[ ]\*\/\s*$/,action:{indentAction:Fi.IndentAction.None,removeText:1}},{beforeText:/^(\t|[ ])*[ ]\*[^/]*\*\/\s*$/,action:{indentAction:Fi.IndentAction.None,removeText:1}},{beforeText:/^\s*(\bcase\s.+:|\bdefault:)$/,afterText:/^(?!\s*(\bcase\b|\bdefault\b))/,action:{indentAction:Fi.IndentAction.Indent}},{previousLineText:/^\s*(((else ?)?if|for|while)\s*\(.*\)\s*|else\s*)$/,beforeText:/^\s+([^{i\s]|i(?!f\b))/,action:{indentAction:Fi.IndentAction.Outdent}}]},hTe={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["${","}"],["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],surroundingPairs:[{open:"'",close:"'"},{open:'"',close:'"'},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"`",close:"`"}],colorizedBracketPairs:[["(",")"],["[","]"],["{","}"],["<",">"]],autoCloseBefore:";:.,=}])>` \n ",folding:{markers:{start:/^\s*\/\/\s*#?region\b/,end:/^\s*\/\/\s*#?endregion\b/}},wordPattern:/(-?\d*\.\d\w*)|([^\`\~\@\!\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>/\?\s]+)/,indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]].*$/,increaseIndentPattern:/^((?!\/<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cui-vue2-ui/dist/cui-vue2-ui.min.css" /><script src="https://cdn.jsdelivr.net/npm/cui-vue2-ui/dist/cui-vue2-ui.min.js"><\/script>`,CTe=S1({__name:"Info",props:{modelValue:{type:Object,default:()=>({name:"",desc:"",thumbnailUrl:"",previewOptions:{headHTML:"",bodyHTML:"",placeholderHTML:"",customCode:{importCode:"",useCode:""}},type:"",groupId:"",isDefault:"0",hash:"",config:""})},options:{type:Object,default:()=>({headHTML:"",bodyHTML:"",placeholderHTML:"",customCode:{importCode:"",useCode:""}})}},emits:["update:modelValue","update:options"],setup(o,{emit:e}){const t=o,i=e,n=Rc([]),s=sz();async function r(){const p=await XT.groups();if(p.code!==0)return s.warning(p.msg);n.value=p.data.map(_=>({label:_.businessName,value:_.id}))}LF(()=>{r()});const a=Rc(null),l=Rc(null),c=BC({get(){return t.modelValue},set(p){i("update:modelValue",p)}}),d=BC({get(){return t.options},set(p){i("update:options",p)}}),h=Rc(null);async function u(p){if(!p){c.value.thumbnailUrl="";return}const _=await KY.uploadDashboardSnapshot(p);if(_.code!==0)return s.warning(_.msg);c.value.thumbnailUrl=_.data}function g(p){c.value.thumbnailUrl=p}function f(){c.value.thumbnailUrl&&(h.value.previewSrc=c.value.thumbnailUrl)}return(p,_)=>{const v=ZY,b=YY,C=XY,w=QY,S=JY,L=qY,x=GY;return uh(),WC(x,{position:"absolute",style:{top:"0px",bottom:"0px"},"has-sider":""},{default:Ui(()=>[Ci(L,{"content-style":"padding: 24px;",width:"600","native-scrollbar":!1,bordered:"",class:"bg-[#e5e6eb] dark:bg-[#232324]"},{default:Ui(()=>[Ci(S,{ref_key:"formRef",ref:a,model:Pt(c),"label-placement":"left","label-width":"100px"},{default:Ui(()=>[Ci(b,{label:"组件名称",path:"name",rule:{required:!0,trigger:"blur",message:"请输入名称"}},{default:Ui(()=>[Ci(v,{value:Pt(c).name,"onUpdate:value":_[0]||(_[0]=D=>Pt(c).name=D),placeholder:"请输入名称"},null,8,["value"])]),_:1}),Ci(b,{label:"所属组",path:"groupId","has-feedback":"",rule:{required:!0,message:"请选择组件类型",trigger:["change","blur"]}},{default:Ui(()=>[Ci(C,{value:Pt(c).groupId,"onUpdate:value":_[1]||(_[1]=D=>Pt(c).groupId=D),options:Pt(n),placeholder:"请选择组件类型"},null,8,["value","options"])]),_:1}),Ci(b,{label:"系统默认",path:"isDefault"},{default:Ui(()=>[Ci(w,{checked:Pt(c).isDefault,"onUpdate:checked":_[2]||(_[2]=D=>Pt(c).isDefault=D),"checked-value":"0","unchecked-value":"1"},null,8,["checked"])]),_:1}),Ci(b,{label:"功能描述"},{default:Ui(()=>[Ci(v,{value:Pt(c).desc,"onUpdate:value":_[3]||(_[3]=D=>Pt(c).desc=D),type:"textarea",placeholder:"请输入描述"},null,8,["value"])]),_:1}),Ci(b,{label:"展示图片"},{default:Ui(()=>[Ci(jY,{ref_key:"uploadRef",ref:h,tip:"组件预览图小于5M,格式为jpg/png/gif 的文件。",onImagedChanged:u,onVnodeMounted:f,onMaterialSelected:g},null,512)]),_:1})]),_:1},8,["model"])]),_:1}),Ci(x,{"content-style":"padding: 24px;","native-scrollbar":!1,class:"bg-[#e5e6eb] dark:bg-[#232324]"},{default:Ui(()=>[Pt(d)?(uh(),WC(S,{key:0,ref_key:"previewOptionsFormRef",ref:l,model:Pt(d),"label-placement":"left","label-width":"100px"},{default:Ui(()=>[Ci(b,{label:"headHTML"},{default:Ui(()=>[Ci(p0,{modelValue:Pt(d).headHTML,"onUpdate:modelValue":_[4]||(_[4]=D=>Pt(d).headHTML=D),mode:"javascript",height:"150px",class:"w-full",placeholder:bTe},null,8,["modelValue"])]),_:1}),Ci(b,{label:"bodyHTML"},{default:Ui(()=>[Ci(p0,{modelValue:Pt(d).bodyHTML,"onUpdate:modelValue":_[5]||(_[5]=D=>Pt(d).bodyHTML=D),mode:"javascript",height:"150px",class:"w-full",placeholder:"<!--在body末尾插入脚本-->"},null,8,["modelValue"])]),_:1}),Ci(b,{label:"import"},{default:Ui(()=>[Ci(p0,{modelValue:Pt(d).customCode.importCode,"onUpdate:modelValue":_[6]||(_[6]=D=>Pt(d).customCode.importCode=D),mode:"javascript",height:"150px",class:"w-full",placeholder:"import CUI from 'cui-vue2-ui // 引入Import Map 的依赖"},null,8,["modelValue"])]),_:1}),Ci(b,{label:"use"},{default:Ui(()=>[Ci(p0,{modelValue:Pt(d).customCode.useCode,"onUpdate:modelValue":_[7]||(_[7]=D=>Pt(d).customCode.useCode=D),mode:"javascript",height:"150px",class:"w-full",placeholder:"app.use(CUI)"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])):YT("",!0)]),_:1})]),_:1})}}}),wTe={basic:`<script setup>import { ref, onMounted } from 'vue'
const text = ref('这是测试文本')
// DOM 挂载后初始化
onMounted(() => { // 触发表示【初始化】的钩子
window.postMessage({ type: 'inited', data: undefined, })})
// 接收数据更新推送消息
window.addEventListener('message', async (event) => { const { type, data } = event.data // 更新数据
if (type === 'update') { text.value = data }}, false);
// 接收配置信息
const config = ref({})window.addEventListener('message', async (event) => { const { type, data } = event.data // 更新数据
if (type === 'config') { config.value = data }}, false);<\/script>
<template> <div style="color: #00c1de">{{ text }}</div></template>
<style>body { margin: 0; overflow: hidden;}</style>`,echarts:`<script setup>import { ref, onMounted } from 'vue'import 'echarts'
// 挂载节点
const dom = ref()// echarts 实例
let echartInstance = null
// 初始化配置
const initOption = (datas) => { const legendConfig = [ { dataField: 'data1', legend: 'legend1' }, { dataField: 'data2', legend: 'legend2' }, ] const legends = [] const xAxisData = [...new Set(datas.map((d) => d.category))] const series = []
for (const item of legendConfig) { const { dataField, legend } = item legends.push(legend) series.push({ name: legend, type: 'bar', stack:'total', data: datas.map((d) => d[dataField]), }) };
const xAxisConfig = { data: xAxisData, }
const legendConf = { data: legends.filter(Boolean), }
// 指定图表的配置项和数据
const option = { backgroundColor: 'transparent', legend: legendConf, xAxis: xAxisConfig, tooltip: { show: true, }, yAxis: {}, series, }
option.color = ['#4992FFFF', '#7CFFB2FF', '#FDDD60FF', '#FF6E76FF', '#58D9F9FF', '#05C091FF']; return option;}
// 初始化图表
const createEcharts = (newData) => { const echarts = window.echarts; if (!echarts) return; if (!echartInstance) { echartInstance = echarts.init(dom.value, 'dark'); } // 清除缓存
echartInstance.clear(); echartInstance.setOption(initOption(newData)); // 图表的宽高自适应
const resizeObserver = new ResizeObserver(() => { echartInstance.resize() }) if (dom.value) resizeObserver.observe(dom.value)}
// DOM 挂载后初始化
onMounted(() => { // 触发表示【初始化】的钩子
window.postMessage({ type: 'inited', data: undefined, })})
// 接收数据更新推送消息
window.addEventListener('message', async (event) => { // 更新数据
if (event.data.type === 'update') { createEcharts(event.data.data); }}, false);
// 接收配置信息
const config = ref({})window.addEventListener('message', async (event) => { const { type, data } = event.data // 更新数据
if (type === 'config') { config.value = data }}, false);<\/script>
<template> <div ref="dom" style="width: 100vw; height:100vh;"></div></template>
<style>body { margin: 0; overflow: hidden;}</style>`,interaction:`<script setup>import { ref, onMounted } from 'vue'
const btnList = ref([{ label: "tab1", value: 1},{ label: "tab2", value: 2},{ label: "tab3", value: 2}])const select = ref(0)
// DOM 挂载后初始化
onMounted(() => { // 触发表示【初始化】的钩子
window.postMessage({ type: 'inited', data: undefined, })})
// 接收数据更新推送消息
window.addEventListener('message', async (event) => { const { type, data } = event.data // 更新数据
if (type === 'update') { btnList.value = data.btnList }}, false);
// 接收配置信息
const config = ref({})window.addEventListener('message', async (event) => { const { type, data } = event.data // 更新数据
if (type === 'config') { config.value = data }}, false);
// 选中内容
const selectHanbdle = (index, item) => { select.value = index // 触发事件
window.postMessage({ type: 'hookEmitEvent', data: { // 动作类型:单击、双击、移入、移出、更新
eventType: 'click', // 需要传递的数据
value: JSON.parse(JSON.stringify(item)) } })}<\/script>
<template> <div class="btn-box"> <div class="item" :class="{ active: index === select }" v-for="(item, index) in btnList" :key="index" @click="selectHanbdle(index, item)"> {{ item.label }} </div> </div></template>
<style>body { margin: 0; overflow: hidden;}
.btn-box { display: flex; column-gap: 4px; overflow: hidden;}
.btn-box .item { height: 24px; font-size: 14px; line-height: 24px; padding: 4px 16px; color: #fff; user-select:none; cursor: pointer; border: 2px solid rgba(160, 169, 184, 0.1); background-color: rgba(15, 22, 34, 0.6);}
.btn-box .item.active { border: 2px solid #08fbf5; background-color: rgba(30, 231, 231, 0.1);}</style>`},STe=["src"],kY=S1({__name:"index",setup(o){const{importMap:e,vueVersion:t,productionMode:i}=NY({runtimeDev:`${window.serverEntry}/visual/cdn/vue.runtime.esm-browser.js`,serverRenderer:`${window.serverEntry}/visual/cdn/vue.server-renderer.esm-browser.js`});Object.assign(e.value.imports,{echarts:`${window.serverEntry}/visual/cdn/echarts.min.js`});const n=TY({builtinImportMap:e,vueVersion:t,typescriptVersion:Rc("5.5.3")});i.value=!1;const s=HY({headHTML:"",bodyHTML:"",placeholderHTML:"",customCode:{importCode:"",useCode:""}}),r=sz(),a=Rc(null),l=Rc({});function c(b){b.type==="echarts"&&setTimeout(()=>{var S;const C=document.querySelector(".es-repl");if(!C)return;const w=(S=C.querySelector(".iframe-container iframe"))==null?void 0:S.contentWindow;w&&w.postMessage({type:"update",data:[{category:"1",data1:185,data2:300},{category:"2",data1:3680,data2:100},{category:"3",data1:2800,data2:800},{category:"4",data1:480,data2:200},{category:"5",data1:700,data2:300},{category:"6",data1:350,data2:100},{category:"7",data1:800,data2:250},{category:"8",data1:500,data2:600},{category:"9",data1:700,data2:800},{category:"10",data1:900,data2:600}]})},500)}async function d(b){const{data:C,code:w}=await XT.info(b);if(w!==0)return r.warning("获取组件信息失败");const S=JSON.parse(C.previewOptions||"{}");Object.keys(S).length>0&&Object.assign(s,S),Object.assign(l.value,{...C,previewOptions:{...s}}),C.hash?n.files=JSON.parse(C.hash):n.activeFile.code=wTe[C.type],c(C)}const h=Rc("code"),u=BC(()=>CW.value),{init:g}=lX(),f=VY();async function p(){if(h.value==="config"&&!l.value.config)return r.warning("请先保存配置");const b={...l.value,hash:JSON.stringify({...n.files}),previewOptions:JSON.stringify({...s})},{code:C}=await XT.edit(b);if(C!==0)return r.warning("保存失败");r.success("保存成功"),f.back()}const _=zY();LF(()=>{d(_.query.id)}),zu(h,b=>{b==="info"?yF(()=>{const C=document.querySelectorAll(".monaco-colors");C[1]&&C[1].remove()}):b==="code"&&d(_.query.id)}),zu(()=>n.activeFile.code,()=>{h.value==="code"&&c(l.value)});const v=BC(()=>{let b="";return b=`${`${window.location.protocol}//${window.location.host}${window.serverEntry}/visual/`}cdn/vueFormCraft/index.html#/design`,b});return(b,C)=>{const w=tX,S=eX,L=iX,x=nX;return uh(),WC(x,{value:Pt(h),"onUpdate:value":C[4]||(C[4]=D=>zE(h)?h.value=D:null),"default-value":"code",class:"component-widget-design-tabs h-full",type:"card"},{prefix:Ui(()=>[Ci(S,{text:"",onClick:C[0]||(C[0]=D=>b.$router.back())},{icon:Ui(()=>[Ci(w,{size:"16"},{default:Ui(()=>[Ci(Pt(aX))]),_:1})]),default:Ui(()=>[C[5]||(C[5]=wW(" 返回 "))]),_:1})]),suffix:Ui(()=>[Ci(S,{type:"primary",class:"mr-2","text-color":"#ffffff",onClick:p},{default:Ui(()=>C[6]||(C[6]=[wW(" 保存 ")])),_:1})]),default:Ui(()=>[Ci(L,{name:"code",tab:"编辑代码"},{default:Ui(()=>[Ci(Pt(RY),{ref_key:"replRef",ref:a,theme:Pt(u)?"dark":"auto",class:UY(["es-repl",{"repl-dark":Pt(CW)}]),store:Pt(n),editor:Pt(vTe),"show-compile-output":!1,"preview-options":Pt(s)},null,8,["theme","class","store","editor","preview-options"])]),_:1}),Ci(L,{name:"info",tab:"组件信息",class:"relative"},{default:Ui(()=>[Pt(h)==="info"?(uh(),WC(CTe,{key:0,modelValue:Pt(l),"onUpdate:modelValue":C[1]||(C[1]=D=>zE(l)?l.value=D:null),options:Pt(s),"onUpdate:options":C[2]||(C[2]=D=>zE(s)?s.value=D:null)},null,8,["modelValue","options"])):YT("",!0)]),_:1}),Ci(L,{name:"config",tab:"配置信息",class:"bg-[#ffffff] dark:bg-dark"},{default:Ui(()=>[Pt(h)==="config"?(uh(),SF("iframe",{key:0,src:Pt(v),class:"config-iframe h-full w-full",onLoad:C[3]||(C[3]=D=>Pt(g)(Pt(l)))},null,40,STe)):YT("",!0)]),_:1})]),_:1},8,["value"])}}});typeof SW=="function"&&SW(kY);const yTe=$Y(kY,[["__scopeId","data-v-235b6b1f"]]),RPe=Object.freeze(Object.defineProperty({__proto__:null,default:yTe},Symbol.toStringTag,{value:"Module"}));export{SPe as C,yPe as E,wNe as K,IPe as M,LPe as P,kPe as R,xPe as S,NPe as T,w1 as U,SNe as a,EPe as b,DPe as c,Fl as e,RPe as i,Fi as l};
|