@opengis/richtext 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/richtext.js +3888 -3855
- package/dist/richtext.umd.cjs +6 -6
- package/package.json +1 -1
package/dist/richtext.umd.cjs
CHANGED
|
@@ -115,14 +115,14 @@ ${m}
|
|
|
115
115
|
`,HJ="️",zJ="",Vk="";let vw=null,yw=null;function $J(s=[]){const e={};js.groups=e;const t=new js;vw==null&&(vw=z3(OJ)),yw==null&&(yw=z3(PJ)),de(t,"'",cw),de(t,"{",mm),de(t,"}",_m),de(t,"[",G0),de(t,"]",Y0),de(t,"(",X0),de(t,")",Z0),de(t,"<",Q0),de(t,">",J0),de(t,"(",ew),de(t,")",tw),de(t,"「",nw),de(t,"」",iw),de(t,"『",sw),de(t,"』",rw),de(t,"<",ow),de(t,">",aw),de(t,"&",lw),de(t,"*",dw),de(t,"@",Ic),de(t,"`",uw),de(t,"^",fw),de(t,":",Mc),de(t,",",Mk),de(t,"$",gw),de(t,".",Jo),de(t,"=",pw),de(t,"!",Rk),de(t,"-",Kr),de(t,"%",bm),de(t,"|",mw),de(t,"+",_w),de(t,"#",bw),de(t,"?",wm),de(t,'"',Ak),de(t,"/",ea),de(t,";",Ok),de(t,"~",Cm),de(t,"_",ww),de(t,"\\",hw),de(t,"・",F3);const n=On(t,al,Dk,{[vk]:!0});On(n,al,n);const i=On(n,ol,O3,{[fm]:!0}),r=On(n,vm,P3,{[gm]:!0}),o=On(t,ol,rl,{[yk]:!0});On(o,al,i),On(o,ol,o),On(i,al,i),On(i,ol,i);const a=On(t,vm,kk,{[Sk]:!0});On(a,ol),On(a,al,r),On(a,vm,a),On(r,al,r),On(r,ol),On(r,vm,r);const l=de(t,Bk,Ik,{[Lk]:!0}),c=de(t,W3,Tk,{[Lk]:!0}),d=On(t,Fk,Tk,{[Lk]:!0});de(t,Vk,d),de(c,Bk,l),de(c,Vk,d),On(c,Fk,d),de(d,W3),de(d,Bk),On(d,Fk,d),de(d,Vk,d);const h=On(t,Pk,B3,{[R3]:!0});de(h,"#"),On(h,Pk,h),de(h,HJ,h);const u=de(h,zJ);de(u,"#"),On(u,Pk,h);const f=[[ol,o],[al,i]],g=[[ol,null],[vm,a],[al,r]];for(let p=0;p<vw.length;p++)Rc(t,vw[p],Ek,rl,f);for(let p=0;p<yw.length;p++)Rc(t,yw[p],Nk,kk,g);Yd(Ek,{tld:!0,ascii:!0},e),Yd(Nk,{utld:!0,alpha:!0},e),Rc(t,"file",q0,rl,f),Rc(t,"mailto",q0,rl,f),Rc(t,"http",Df,rl,f),Rc(t,"https",Df,rl,f),Rc(t,"ftp",Df,rl,f),Rc(t,"ftps",Df,rl,f),Yd(q0,{scheme:!0,ascii:!0},e),Yd(Df,{slashscheme:!0,ascii:!0},e),s=s.sort((p,m)=>p[0]>m[0]?1:-1);for(let p=0;p<s.length;p++){const m=s[p][0],w=s[p][1]?{[FJ]:!0}:{[BJ]:!0};m.indexOf("-")>=0?w[xk]=!0:ol.test(m)?al.test(m)?w[fm]=!0:w[yk]=!0:w[vk]=!0,A3(t,m,m,w)}return A3(t,"localhost",pm,{ascii:!0}),t.jd=new js(Cw),{start:t,tokens:Object.assign({groups:e},V3)}}function H3(s,e){const t=UJ(e.replace(/[A-Z]/g,a=>a.toLowerCase())),n=t.length,i=[];let r=0,o=0;for(;o<n;){let a=s,l=null,c=0,d=null,h=-1,u=-1;for(;o<n&&(l=a.go(t[o]));)a=l,a.accepts()?(h=0,u=0,d=a):h>=0&&(h+=t[o].length,u++),c+=t[o].length,r+=t[o].length,o++;r-=h,o-=u,c-=h,i.push({t:d.t,v:e.slice(r-c,r),s:r-c,e:r})}return i}function UJ(s){const e=[],t=s.length;let n=0;for(;n<t;){let i=s.charCodeAt(n),r,o=i<55296||i>56319||n+1===t||(r=s.charCodeAt(n+1))<56320||r>57343?s[n]:s.slice(n,n+2);e.push(o),n+=o.length}return e}function Rc(s,e,t,n,i){let r;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];s.j[l]?r=s.j[l]:(r=new js(n),r.jr=i.slice(),s.j[l]=r),s=r}return r=new js(t),r.jr=i.slice(),s.j[e[o-1]]=r,r}function z3(s){const e=[],t=[];let n=0,i="0123456789";for(;n<s.length;){let r=0;for(;i.indexOf(s[n+r])>=0;)r++;if(r>0){e.push(t.join(""));for(let o=parseInt(s.substring(n,n+r),10);o>0;o--)t.pop();n+=r}else t.push(s[n]),n++}return e}const ym={defaultProtocol:"http",events:null,format:$3,formatHref:$3,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Wk(s,e=null){let t=Object.assign({},ym);s&&(t=Object.assign(t,s instanceof Wk?s.o:s));const n=t.ignoreTags,i=[];for(let r=0;r<n.length;r++)i.push(n[r].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Wk.prototype={o:ym,ignoreTags:[],defaultRender(s){return s},check(s){return this.get("validate",s.toString(),s)},get(s,e,t){const n=e!=null;let i=this.o[s];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:ym[s],typeof i=="function"&&n&&(i=i(e,t))):typeof i=="function"&&n&&(i=i(e,t.t,t)),i)},getObj(s,e,t){let n=this.o[s];return typeof n=="function"&&e!=null&&(n=n(e,t.t,t)),n},render(s){const e=s.render(this);return(this.get("render",null,s)||this.defaultRender)(e,s.t,s)}};function $3(s){return s}function U3(s,e){this.t="token",this.v=s,this.tk=e}U3.prototype={isLink:!1,toString(){return this.v},toHref(s){return this.toString()},toFormattedString(s){const e=this.toString(),t=s.get("truncate",e,this),n=s.get("format",e,this);return t&&n.length>t?n.substring(0,t)+"…":n},toFormattedHref(s){return s.get("formatHref",this.toHref(s.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(s=ym.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(s),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(s){return{type:this.t,value:this.toFormattedString(s),isLink:this.isLink,href:this.toFormattedHref(s),start:this.startIndex(),end:this.endIndex()}},validate(s){return s.get("validate",this.toString(),this)},render(s){const e=this,t=this.toHref(s.get("defaultProtocol")),n=s.get("formatHref",t,this),i=s.get("tagName",t,e),r=this.toFormattedString(s),o={},a=s.get("className",t,e),l=s.get("target",t,e),c=s.get("rel",t,e),d=s.getObj("attributes",t,e),h=s.getObj("events",t,e);return o.href=n,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),d&&Object.assign(o,d),{tagName:i,attributes:o,content:r,eventListeners:h}}};function Sw(s,e){class t extends U3{constructor(i,r){super(i,r),this.t=s}}for(const n in e)t.prototype[n]=e[n];return t.t=s,t}const j3=Sw("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),K3=Sw("text"),jJ=Sw("nl"),xw=Sw("url",{isLink:!0,toHref(s=ym.defaultProtocol){return this.hasProtocol()?this.v:`${s}://${this.v}`},hasProtocol(){const s=this.tk;return s.length>=2&&s[0].t!==pm&&s[1].t===Mc}}),qr=s=>new js(s);function KJ({groups:s}){const e=s.domain.concat([lw,dw,Ic,hw,uw,fw,gw,pw,Kr,Dk,bm,mw,_w,bw,ea,Cw,Cm,ww]),t=[cw,Mc,Mk,Jo,Rk,bm,wm,Ak,Ok,Q0,J0,mm,_m,Y0,G0,X0,Z0,ew,tw,nw,iw,sw,rw,ow,aw],n=[lw,cw,dw,hw,uw,fw,gw,pw,Kr,mm,_m,bm,mw,_w,bw,wm,ea,Cw,Cm,ww],i=qr(),r=de(i,Cm);ut(r,n,r),ut(r,s.domain,r);const o=qr(),a=qr(),l=qr();ut(i,s.domain,o),ut(i,s.scheme,a),ut(i,s.slashscheme,l),ut(o,n,r),ut(o,s.domain,o);const c=de(o,Ic);de(r,Ic,c),de(a,Ic,c),de(l,Ic,c);const d=de(r,Jo);ut(d,n,r),ut(d,s.domain,r);const h=qr();ut(c,s.domain,h),ut(h,s.domain,h);const u=de(h,Jo);ut(u,s.domain,h);const f=qr(j3);ut(u,s.tld,f),ut(u,s.utld,f),de(c,pm,f);const g=de(h,Kr);de(g,Kr,g),ut(g,s.domain,h),ut(f,s.domain,h),de(f,Jo,u),de(f,Kr,g);const p=de(f,Mc);ut(p,s.numeric,j3);const m=de(o,Kr),b=de(o,Jo);de(m,Kr,m),ut(m,s.domain,o),ut(b,n,r),ut(b,s.domain,o);const w=qr(xw);ut(b,s.tld,w),ut(b,s.utld,w),ut(w,s.domain,o),ut(w,n,r),de(w,Jo,b),de(w,Kr,m),de(w,Ic,c);const C=de(w,Mc),v=qr(xw);ut(C,s.numeric,v);const S=qr(xw),k=qr();ut(S,e,S),ut(S,t,k),ut(k,e,S),ut(k,t,k),de(w,ea,S),de(v,ea,S);const L=de(a,Mc),E=de(l,Mc),N=de(E,ea),M=de(N,ea);ut(a,s.domain,o),de(a,Jo,b),de(a,Kr,m),ut(l,s.domain,o),de(l,Jo,b),de(l,Kr,m),ut(L,s.domain,S),de(L,ea,S),de(L,wm,S),ut(M,s.domain,S),ut(M,e,S),de(M,ea,S);const O=[[mm,_m],[G0,Y0],[X0,Z0],[Q0,J0],[ew,tw],[nw,iw],[sw,rw],[ow,aw]];for(let I=0;I<O.length;I++){const[F,W]=O[I],z=de(S,F);de(k,F,z),de(z,W,S);const G=qr(xw);ut(z,e,G);const Y=qr();ut(z,t),ut(G,e,G),ut(G,t,Y),ut(Y,e,G),ut(Y,t,Y),de(G,W,S),de(Y,W,S)}return de(i,pm,w),de(i,Ik,jJ),{start:i,tokens:V3}}function qJ(s,e,t){let n=t.length,i=0,r=[],o=[];for(;i<n;){let a=s,l=null,c=null,d=0,h=null,u=-1;for(;i<n&&!(l=a.go(t[i].t));)o.push(t[i++]);for(;i<n&&(c=l||a.go(t[i].t));)l=null,a=c,a.accepts()?(u=0,h=a):u>=0&&u++,i++,d++;if(u<0)i-=d,i<n&&(o.push(t[i]),i++);else{o.length>0&&(r.push(Hk(K3,e,o)),o=[]),i-=u,d-=u;const f=h.t,g=t.slice(i-d,i);r.push(Hk(f,e,g))}}return o.length>0&&r.push(Hk(K3,e,o)),r}function Hk(s,e,t){const n=t[0].s,i=t[t.length-1].e,r=e.slice(n,i);return new s(r,t)}const GJ=typeof console<"u"&&console&&console.warn||(()=>{}),YJ="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",bn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function XJ(){return js.groups={},bn.scanner=null,bn.parser=null,bn.tokenQueue=[],bn.pluginQueue=[],bn.customSchemes=[],bn.initialized=!1,bn}function q3(s,e=!1){if(bn.initialized&&GJ(`linkifyjs: already initialized - will not register custom scheme "${s}" ${YJ}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(s))throw new Error(`linkifyjs: incorrect scheme format.
|
|
116
116
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
117
117
|
2. Cannot start or end with "-"
|
|
118
|
-
3. "-" cannot repeat`);bn.customSchemes.push([s,e])}function ZJ(){bn.scanner=$J(bn.customSchemes);for(let s=0;s<bn.tokenQueue.length;s++)bn.tokenQueue[s][1]({scanner:bn.scanner});bn.parser=KJ(bn.scanner.tokens);for(let s=0;s<bn.pluginQueue.length;s++)bn.pluginQueue[s][1]({scanner:bn.scanner,parser:bn.parser});return bn.initialized=!0,bn}function zk(s){return bn.initialized||ZJ(),qJ(bn.parser.start,s,H3(bn.scanner.start,s))}zk.scan=H3;function G3(s,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const n=new Wk(t),i=zk(s),r=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&n.check(a)&&r.push(a.toFormattedObject(n))}return r}var $k="[\0- -\u2029 ]",QJ=new RegExp($k),JJ=new RegExp(`${$k}$`),eee=new RegExp($k,"g");function tee(s){return s.length===1?s[0].isLink:s.length===3&&s[1].isLink?["()","[]"].includes(s[0].value+s[2].value):!1}function nee(s){return new yn({key:new Gn("autolink"),appendTransaction:(e,t,n)=>{const i=e.some(c=>c.docChanged)&&!t.doc.eq(n.doc),r=e.some(c=>c.getMeta("preventAutolink"));if(!i||r)return;const{tr:o}=n,a=O5(t.doc,[...e]);if(j5(a).forEach(({newRange:c})=>{const d=HX(n.doc,c,f=>f.isTextblock);let h,u;if(d.length>1)h=d[0],u=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const f=n.doc.textBetween(c.from,c.to," "," ");if(!JJ.test(f))return;h=d[0],u=n.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&u){const f=u.split(QJ).filter(Boolean);if(f.length<=0)return!1;const g=f[f.length-1],p=h.pos+u.lastIndexOf(g);if(!g)return!1;const m=zk(g).map(b=>b.toObject(s.defaultProtocol));if(!tee(m))return!1;m.filter(b=>b.isLink).map(b=>({...b,from:p+b.start+1,to:p+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>s.validate(b.value)).filter(b=>s.shouldAutoLink(b.value)).forEach(b=>{ik(b.from,b.to,n.doc).some(w=>w.mark.type===s.type)||o.addMark(b.from,b.to,s.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function iee(s){return new yn({key:new Gn("handleClickLink"),props:{handleClick:(e,t,n)=>{var i,r;if(n.button!==0||!e.editable)return!1;let o=null;if(n.target instanceof HTMLAnchorElement)o=n.target;else{let d=n.target;const h=[];for(;d.nodeName!=="DIV";)h.push(d),d=d.parentNode;o=h.find(u=>u.nodeName==="A")}if(!o)return!1;const a=U5(e.state,s.type.name),l=(i=o?.href)!=null?i:a.href,c=(r=o?.target)!=null?r:a.target;return s.enableClickSelection&&s.editor.commands.extendMarkRange(s.type.name),o&&l?(window.open(l,c),!0):!1}}})}function see(s){return new yn({key:new Gn("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:r}=i,{empty:o}=r;if(o)return!1;let a="";n.content.forEach(c=>{a+=c.textContent});const l=G3(a,{defaultProtocol:s.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:s.editor.commands.setMark(s.type,{href:l.href})}}})}function Xd(s,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&t.push(i)}),!s||s.replace(eee,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Y3=_o.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(s=>{if(typeof s=="string"){q3(s);return}q3(s.scheme,s.optionalSlashes)})},onDestroy(){XJ()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(s,e)=>!!Xd(s,e.protocols),validate:s=>!!s,shouldAutoLink:s=>!!s}},addAttributes(){return{href:{default:null,parseHTML(s){return s.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:s=>{const e=s.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Xd(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:s}){return this.options.isAllowedUri(s.href,{defaultValidate:e=>!!Xd(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$t(this.options.HTMLAttributes,s),0]:["a",$t(this.options.HTMLAttributes,{...s,href:""}),0]},addCommands(){return{setLink:s=>({chain:e})=>{const{href:t}=s;return this.options.isAllowedUri(t,{defaultValidate:n=>!!Xd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,s).setMeta("preventAutolink",!0).run():!1},toggleLink:s=>({chain:e})=>{const{href:t}=s||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:n=>!!Xd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,s,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:s})=>s().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Dc({find:s=>{const e=[];if(s){const{protocols:t,defaultProtocol:n}=this.options,i=G3(s).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:o=>!!Xd(o,t),protocols:t,defaultProtocol:n}));i.length&&i.forEach(r=>e.push({text:r.value,data:{href:r.href},index:r.start}))}return e},type:this.type,getAttributes:s=>{var e;return{href:(e=s.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const s=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&s.push(nee({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Xd(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&s.push(iee({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&s.push(see({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),s}}),ree=Object.defineProperty,oee=(s,e)=>{for(var t in e)ree(s,t,{get:e[t],enumerable:!0})},aee="listItem",X3="textStyle",Z3=/^\s*([-+*])\s$/,Q3=Ni.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:s}){return["ul",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{toggleBulletList:()=>({commands:s,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(aee,this.editor.getAttributes(X3)).run():s.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let s=Ef({find:Z3,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(s=Ef({find:Z3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(X3),editor:this.editor})),[s]}}),J3=Ni.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:s}){return["li",$t(this.options.HTMLAttributes,s),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),lee={};oee(lee,{findListItemPos:()=>Sm,getNextListDepth:()=>Uk,handleBackspace:()=>jk,handleDelete:()=>Kk,hasListBefore:()=>e7,hasListItemAfter:()=>cee,hasListItemBefore:()=>t7,listItemHasSubList:()=>n7,nextListIsDeeper:()=>i7,nextListIsHigher:()=>s7});var Sm=(s,e)=>{const{$from:t}=e.selection,n=ii(s,e.schema);let i=null,r=t.depth,o=t.pos,a=null;for(;r>0&&a===null;)i=t.node(r),i.type===n?a=r:(r-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},Uk=(s,e)=>{const t=Sm(s,e);if(!t)return!1;const[,n]=XX(e,s,t.$pos.pos+4);return n},e7=(s,e,t)=>{const{$anchor:n}=s.selection,i=Math.max(0,n.pos-2),r=s.doc.resolve(i).node();return!(!r||!t.includes(r.type.name))},t7=(s,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==s)},n7=(s,e,t)=>{if(!t)return!1;const n=ii(s,e.schema);let i=!1;return t.descendants(r=>{r.type===n&&(i=!0)}),i},jk=(s,e,t)=>{if(s.commands.undoInputRule())return!0;if(s.state.selection.from!==s.state.selection.to)return!1;if(!Nc(s.state,e)&&e7(s.state,e,t)){const{$anchor:a}=s.state.selection,l=s.state.doc.resolve(a.before()-1),c=[];l.node().descendants((u,f)=>{u.type.name===e&&c.push({node:u,pos:f})});const d=c.at(-1);if(!d)return!1;const h=s.state.doc.resolve(l.start()+d.pos+1);return s.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Nc(s.state,e)||!eZ(s.state))return!1;const n=Sm(e,s.state);if(!n)return!1;const r=s.state.doc.resolve(n.$pos.pos-2).node(n.depth),o=n7(e,s.state,r);return t7(e,s.state)&&!o?s.commands.joinItemBackward():s.chain().liftListItem(e).run()},i7=(s,e)=>{const t=Uk(s,e),n=Sm(s,e);return!n||!t?!1:t>n.depth},s7=(s,e)=>{const t=Uk(s,e),n=Sm(s,e);return!n||!t?!1:t<n.depth},Kk=(s,e)=>{if(!Nc(s.state,e)||!JX(s.state,e))return!1;const{selection:t}=s.state,{$from:n,$to:i}=t;return!t.empty&&n.sameParent(i)?!1:i7(e,s.state)?s.chain().focus(s.state.selection.from+4).lift(e).joinBackward().run():s7(e,s.state)?s.chain().joinForward().joinBackward().run():s.commands.joinItemForward()},cee=(s,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-n.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==s)},r7=Gt.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{s.state.schema.nodes[t]!==void 0&&Kk(s,t)&&(e=!0)}),e},"Mod-Delete":({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{s.state.schema.nodes[t]!==void 0&&Kk(s,t)&&(e=!0)}),e},Backspace:({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{s.state.schema.nodes[t]!==void 0&&jk(s,t,n)&&(e=!0)}),e},"Mod-Backspace":({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{s.state.schema.nodes[t]!==void 0&&jk(s,t,n)&&(e=!0)}),e}}}}),dee="listItem",o7="textStyle",a7=/^(\d+)\.\s$/,l7=Ni.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:s=>s.hasAttribute("start")?parseInt(s.getAttribute("start")||"",10):1},type:{default:null,parseHTML:s=>s.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:s}){const{start:e,...t}=s;return e===1?["ol",$t(this.options.HTMLAttributes,t),0]:["ol",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{toggleOrderedList:()=>({commands:s,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dee,this.editor.getAttributes(o7)).run():s.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let s=Ef({find:a7,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(s=Ef({find:a7,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(o7)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[s]}}),hee=/^\s*(\[([( |x])?\])\s$/,uee=Ni.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:s=>{const e=s.getAttribute("data-checked");return e===""||e==="true"},renderHTML:s=>({"data-checked":s.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:s,HTMLAttributes:e}){return["li",$t(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:s.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const s={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...s,Tab:()=>this.editor.commands.sinkListItem(this.name)}:s},addNodeView(){return({node:s,HTMLAttributes:e,getPos:t,editor:n})=>{const i=document.createElement("li"),r=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var h,u;a.ariaLabel=((u=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:u.call(h,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return c(s),r.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=d.target;n.isEditable&&typeof t=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:u})=>{const f=t();if(typeof f!="number")return!1;const g=u.doc.nodeAt(f);return u.setNodeMarkup(f,void 0,{...g?.attrs,checked:h}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(s,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,h])=>{i.setAttribute(d,h)}),i.dataset.checked=s.attrs.checked,a.checked=s.attrs.checked,r.append(a,o),i.append(r,l),Object.entries(e).forEach(([d,h])=>{i.setAttribute(d,h)}),{dom:i,contentDOM:l,update:d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d),!0)}}},addInputRules(){return[Ef({find:hee,type:this.type,getAttributes:s=>({checked:s[s.length-1]==="x"})})]}}),fee=Ni.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:s}){return["ul",$t(this.options.HTMLAttributes,s,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:s})=>s.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Gt.create({name:"listKit",addExtensions(){const s=[];return this.options.bulletList!==!1&&s.push(Q3.configure(this.options.bulletList)),this.options.listItem!==!1&&s.push(J3.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(r7.configure(this.options.listKeymap)),this.options.orderedList!==!1&&s.push(l7.configure(this.options.orderedList)),this.options.taskItem!==!1&&s.push(uee.configure(this.options.taskItem)),this.options.taskList!==!1&&s.push(fee.configure(this.options.taskList)),s}});var c7=Ni.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:s}){return["p",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setParagraph:()=>({commands:s})=>s.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),gee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,pee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,mee=_o.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:s=>s.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:s}){return["s",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setStrike:()=>({commands:s})=>s.setMark(this.name),toggleStrike:()=>({commands:s})=>s.toggleMark(this.name),unsetStrike:()=>({commands:s})=>s.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qd({find:gee,type:this.type})]},addPasteRules(){return[Dc({find:pee,type:this.type})]}}),_ee=Ni.create({name:"text",group:"inline"}),bee=_o.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:s=>s.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:s}){return["u",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setUnderline:()=>({commands:s})=>s.setMark(this.name),toggleUnderline:()=>({commands:s})=>s.toggleMark(this.name),unsetUnderline:()=>({commands:s})=>s.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function wee(s={}){return new yn({view(e){return new Cee(e,s)}})}class Cee{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let r=o=>{this[i](o)};return e.dom.addEventListener(i,r),{name:i,handler:r}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,r=i.getBoundingClientRect(),o=r.width/i.offsetWidth,a=r.height/i.offsetHeight;if(t){let h=e.nodeBefore,u=e.nodeAfter;if(h||u){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let g=f.getBoundingClientRect(),p=h?g.bottom:g.top;h&&u&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*a;n={left:g.left,right:g.right,top:p-m,bottom:p+m}}}}if(!n){let h=this.editorView.coordsAtPos(this.cursorPos),u=this.width/2*o;n={left:h.left-u,right:h.left+u,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),u=h.width/l.offsetWidth,f=h.height/l.offsetHeight;c=h.left-l.scrollLeft*u,d=h.top-l.scrollTop*f}this.element.style.left=(n.left-c)/o+"px",this.element.style.top=(n.top-d)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,r=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!r){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=WP(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Pn extends je{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Pn.valid(n)?new Pn(n):je.near(n)}content(){return _e.empty}eq(e){return e instanceof Pn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Pn(e.resolve(t.pos))}getBookmark(){return new qk(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!vee(e)||!yee(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Pn.valid(e))return e;let i=e.pos,r=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){r=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Pn.valid(l))return l}for(;;){let o=t>0?r.firstChild:r.lastChild;if(!o){if(r.isAtom&&!r.isText&&!Be.isSelectable(r)){e=e.doc.resolve(i+r.nodeSize*t),n=!1;continue e}break}r=o,i+=t;let a=e.doc.resolve(i);if(Pn.valid(a))return a}return null}}}Pn.prototype.visible=!1,Pn.findFrom=Pn.findGapCursorFrom,je.jsonID("gapcursor",Pn);class qk{constructor(e){this.pos=e}map(e){return new qk(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Pn.valid(t)?new Pn(t):je.near(t)}}function vee(s){for(let e=s.depth;e>=0;e--){let t=s.index(e),n=s.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function yee(s){for(let e=s.depth;e>=0;e--){let t=s.indexAfter(e),n=s.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function See(){return new yn({props:{decorations:Eee,createSelectionBetween(s,e,t){return e.pos==t.pos&&Pn.valid(t)?new Pn(t):null},handleClick:Lee,handleKeyDown:xee,handleDOMEvents:{beforeinput:kee}}})}const xee=GL({ArrowLeft:Lw("horiz",-1),ArrowRight:Lw("horiz",1),ArrowUp:Lw("vert",-1),ArrowDown:Lw("vert",1)});function Lw(s,e){const t=s=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,r){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Ve){if(!r.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=Pn.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new Pn(c))),!0):!1}}function Lee(s,e,t){if(!s||!s.editable)return!1;let n=s.state.doc.resolve(e);if(!Pn.valid(n))return!1;let i=s.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&Be.isSelectable(s.state.doc.nodeAt(i.inside))?!1:(s.dispatch(s.state.tr.setSelection(new Pn(n))),!0)}function kee(s,e){if(e.inputType!="insertCompositionText"||!(s.state.selection instanceof Pn))return!1;let{$from:t}=s.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(s.state.schema.nodes.text);if(!n)return!1;let i=te.empty;for(let o=n.length-1;o>=0;o--)i=te.from(n[o].createAndFill(null,i));let r=s.state.tr.replace(t.pos,t.pos,new _e(i,0,0));return r.setSelection(Ve.near(r.doc.resolve(t.pos+1))),s.dispatch(r),!1}function Eee(s){if(!(s.selection instanceof Pn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",hn.create(s.doc,[Ei.widget(s.selection.head,e,{key:"gapcursor"})])}var kw=200,Di=function(){};Di.prototype.append=function(e){return e.length?(e=Di.from(e),!this.length&&e||e.length<kw&&this.leafAppend(e)||this.length<kw&&e.leafPrepend(this)||this.appendInner(e)):this},Di.prototype.prepend=function(e){return e.length?Di.from(e).append(this):this},Di.prototype.appendInner=function(e){return new Nee(this,e)},Di.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Di.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Di.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Di.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Di.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(r,o){return i.push(e(r,o))},t,n),i},Di.from=function(e){return e instanceof Di?e:e&&e.length?new d7(e):Di.empty};var d7=(function(s){function e(n){s.call(this),this.values=n}s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,r){return i==0&&r==this.length?this:new e(this.values.slice(i,r))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,r,o,a){for(var l=r;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,o,a){for(var l=r-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=kw)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=kw)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(Di);Di.empty=new d7([]);var Nee=(function(s){function e(t,n){s.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,r,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(r,a),o)===!1||r>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,r)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,r,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(r,a)-a,o+a)===!1||r<a&&this.left.forEachInvertedInner(n,Math.min(i,a),r,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var r=this.left.length;return i<=r?this.left.slice(n,i):n>=r?this.right.slice(n-r,i-r):this.left.slice(n,r).append(this.right.slice(0,i-r))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(Di);const Dee=500;class wo{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,r;t&&(i=this.remapping(n,this.items.length),r=i.maps.length);let o=e.tr,a,l,c=[],d=[];return this.items.forEach((h,u)=>{if(!h.step){i||(i=this.remapping(n,u+1),r=i.maps.length),r--,d.push(h);return}if(i){d.push(new ta(h.map));let f=h.step.map(i.slice(r)),g;f&&o.maybeStep(f).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],c.push(new ta(g,void 0,void 0,c.length+d.length))),r--,g&&i.appendMap(g,r)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(r)):h.selection,l=new wo(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let r=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),u=new ta(e.mapping.maps[d],h,t),f;(f=l&&l.merge(u))&&(u=f,d?r.pop():a=a.slice(0,a.length-1)),r.push(u),t&&(o++,t=void 0),i||(l=u)}let c=o-n.depth;return c>Iee&&(a=Tee(a,c),o-=c),new wo(a.append(r),o)}remapping(e,t){let n=new Xp;return this.items.forEach((i,r)=>{let o=i.mirrorOffset!=null&&r-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new wo(this.items.append(e.map(t=>new ta(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),r=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(u=>{u.selection&&a--},i);let l=t;this.items.forEach(u=>{let f=r.getMirror(--l);if(f==null)return;o=Math.min(o,f);let g=r.maps[f];if(u.step){let p=e.steps[f].invert(e.docs[f]),m=u.selection&&u.selection.map(r.slice(l+1,f));m&&a++,n.push(new ta(g,p,m))}else n.push(new ta(g))},i);let c=[];for(let u=t;u<o;u++)c.push(new ta(r.maps[u]));let d=this.items.slice(0,i).append(c).append(n),h=new wo(d,a);return h.emptyItemCount()>Dee&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&r++;else if(o.step){let l=o.step.map(t.slice(n)),c=l&&l.getMap();if(n--,c&&t.appendMap(c,n),l){let d=o.selection&&o.selection.map(t.slice(n));d&&r++;let h=new ta(c.invert(),l,d),u,f=i.length-1;(u=i.length&&i[f].merge(h))?i[f]=u:i.push(h)}}else o.map&&n--},this.items.length,0),new wo(Di.from(i.reverse()),r)}}wo.empty=new wo(Di.empty,0);function Tee(s,e){let t;return s.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),s.slice(t)}class ta{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ta(t.getMap().invert(),t,this.selection)}}}class Ac{constructor(e,t,n,i,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=r}}const Iee=20;function Mee(s,e,t,n){let i=t.getMeta(Zd),r;if(i)return i.historyState;t.getMeta(Oee)&&(s=new Ac(s.done,s.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return s;if(o&&o.getMeta(Zd))return o.getMeta(Zd).redo?new Ac(s.done.addTransform(t,void 0,n,Ew(e)),s.undone,h7(t.mapping.maps),s.prevTime,s.prevComposition):new Ac(s.done,s.undone.addTransform(t,void 0,n,Ew(e)),null,s.prevTime,s.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=s.prevTime==0||!o&&s.prevComposition!=a&&(s.prevTime<(t.time||0)-n.newGroupDelay||!Ree(t,s.prevRanges)),c=o?Gk(s.prevRanges,t.mapping):h7(t.mapping.maps);return new Ac(s.done.addTransform(t,l?e.selection.getBookmark():void 0,n,Ew(e)),wo.empty,c,t.time,a??s.prevComposition)}else return(r=t.getMeta("rebased"))?new Ac(s.done.rebased(t,r),s.undone.rebased(t,r),Gk(s.prevRanges,t.mapping),s.prevTime,s.prevComposition):new Ac(s.done.addMaps(t.mapping.maps),s.undone.addMaps(t.mapping.maps),Gk(s.prevRanges,t.mapping),s.prevTime,s.prevComposition)}function Ree(s,e){if(!e)return!1;if(!s.docChanged)return!0;let t=!1;return s.mapping.maps[0].forEach((n,i)=>{for(let r=0;r<e.length;r+=2)n<=e[r+1]&&i>=e[r]&&(t=!0)}),t}function h7(s){let e=[];for(let t=s.length-1;t>=0&&e.length==0;t--)s[t].forEach((n,i,r,o)=>e.push(r,o));return e}function Gk(s,e){if(!s)return null;let t=[];for(let n=0;n<s.length;n+=2){let i=e.map(s[n],1),r=e.map(s[n+1],-1);i<=r&&t.push(i,r)}return t}function Aee(s,e,t){let n=Ew(e),i=Zd.get(e).spec.config,r=(t?s.undone:s.done).popEvent(e,n);if(!r)return null;let o=r.selection.resolve(r.transform.doc),a=(t?s.done:s.undone).addTransform(r.transform,e.selection.getBookmark(),i,n),l=new Ac(t?a:r.remaining,t?r.remaining:a,null,0,-1);return r.transform.setSelection(o).setMeta(Zd,{redo:t,historyState:l})}let Yk=!1,u7=null;function Ew(s){let e=s.plugins;if(u7!=e){Yk=!1,u7=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Yk=!0;break}}return Yk}const Zd=new Gn("history"),Oee=new Gn("closeHistory");function Pee(s={}){return s={depth:s.depth||100,newGroupDelay:s.newGroupDelay||500},new yn({key:Zd,state:{init(){return new Ac(wo.empty,wo.empty,null,0,-1)},apply(e,t,n){return Mee(t,n,e,s)}},config:s,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?g7:n=="historyRedo"?p7:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function f7(s,e){return(t,n)=>{let i=Zd.getState(t);if(!i||(s?i.undone:i.done).eventCount==0)return!1;if(n){let r=Aee(i,t,s);r&&n(e?r.scrollIntoView():r)}return!0}}const g7=f7(!1,!0),p7=f7(!0,!0);Gt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:s=>s.length,wordCounter:s=>s.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=s=>{const e=s?.node||this.editor.state.doc;if((s?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=s=>{const e=s?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let s=!1;return[new yn({key:new Gn("characterCount"),appendTransaction:(e,t,n)=>{if(s)return;const i=this.options.limit;if(i==null||i===0){s=!0;return}const r=this.storage.characters({node:n.doc});if(r>i){const o=r-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=n.tr.deleteRange(a,l);return s=!0,c}s=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=n||i>n&&r>n&&r<=i)return!0;if(i>n&&r>n&&r>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=r-n,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>n)}})]}});var Fee=Gt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[wee(this.options)]}});Gt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new yn({key:new Gn("focus"),props:{decorations:({doc:s,selection:e})=>{const{isEditable:t,isFocused:n}=this.editor,{anchor:i}=e,r=[];if(!t||!n)return hn.create(s,[]);let o=0;this.options.mode==="deepest"&&s.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1});let a=0;return s.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";r.push(Ei.node(c,c+l.nodeSize,{class:this.options.className}))}),hn.create(s,r)}}})]}});var Bee=Gt.create({name:"gapCursor",addProseMirrorPlugins(){return[See()]},extendNodeSchema(s){var e;const t={name:s.name,options:s.options,storage:s.storage};return{allowGapCursor:(e=Wt(Pe(s,"allowGapCursor",t)))!=null?e:null}}});Gt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new yn({key:new Gn("placeholder"),props:{decorations:({doc:s,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const r=this.editor.isEmpty;return s.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,c=!o.isLeaf&&A0(o);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];r&&d.push(this.options.emptyEditorClass);const h=Ei.node(a,a+o.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),hn.create(s,i)}}})]}}),Gt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:s,options:e}=this;return[new yn({key:new Gn("selection"),props:{decorations(t){return t.selection.empty||s.isFocused||!s.isEditable||G5(t.selection)||s.view.dragging?null:hn.create(t.doc,[Ei.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function m7({types:s,node:e}){return e&&Array.isArray(s)&&s.includes(e.type)||e?.type===s}var Vee=Gt.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const s=new Gn(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>(this.options.notAfter||[]).concat(this.options.node).includes(t.name));return[new yn({key:s,appendTransaction:(t,n,i)=>{const{doc:r,tr:o,schema:a}=i,l=s.getState(i),c=r.content.size,d=a.nodes[this.options.node];if(l)return o.insert(c,d.create())},state:{init:(t,n)=>{const i=n.tr.doc.lastChild;return!m7({node:i,types:e})},apply:(t,n)=>{if(!t.docChanged)return n;const i=t.doc.lastChild;return!m7({node:i,types:e})}}})]}}),Wee=Gt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:s,dispatch:e})=>g7(s,e),redo:()=>({state:s,dispatch:e})=>p7(s,e)}},addProseMirrorPlugins(){return[Pee(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Hee=Gt.create({name:"starterKit",addExtensions(){var s,e,t,n;const i=[];return this.options.bold!==!1&&i.push(CJ.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(pJ.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Q3.configure(this.options.bulletList)),this.options.code!==!1&&i.push(SJ.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(kJ.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(EJ.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Fee.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Bee.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(NJ.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(M3.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Wee.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(DJ.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(AJ.configure(this.options.italic)),this.options.listItem!==!1&&i.push(J3.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(r7.configure((s=this.options)==null?void 0:s.listKeymap)),this.options.link!==!1&&i.push(Y3.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(l7.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(c7.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(mee.configure(this.options.strike)),this.options.text!==!1&&i.push(_ee.configure(this.options.text)),this.options.underline!==!1&&i.push(bee.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&i.push(Vee.configure((n=this.options)==null?void 0:n.trailingNode)),i}}),zee=Hee,$ee=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Uee=Ni.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:s}){return["img",$t(this.options.HTMLAttributes,s)]},addCommands(){return{setImage:s=>({commands:e})=>e.insertContent({type:this.name,attrs:s})}},addInputRules(){return[a3({find:$ee,type:this.type,getAttributes:s=>{const[,,e,t,n]=s;return{src:t,alt:e,title:n}}})]}}),jee=Gt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:s=>{const e=s.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:s=>s.textAlign?{style:`text-align: ${s.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:s=>({commands:e})=>this.options.alignments.includes(s)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:s})).every(t=>t):!1,unsetTextAlign:()=>({commands:s})=>this.options.types.map(e=>s.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:s=>({editor:e,commands:t})=>this.options.alignments.includes(s)?e.isActive({textAlign:s})?t.unsetTextAlign():t.setTextAlign(s):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const Kee=async s=>{try{const e=new FormData;return e.append("unique","true"),e.append("file",s),(await(await fetch("/file/upload/uploads?id=&form=&table=",{method:"POST",body:e})).json())?.result}catch(e){console.error(e)}},qee=async(s,e)=>{const t=e.clipboardData?.items;if(t){const n=e.clipboardData?.getData("text/html"),i=e.clipboardData?.getData("text/plain");if(n){const{state:r,dispatch:o}=s,{tr:a}=r,l=gf.fromSchema(s.state.schema),c=new DOMParser().parseFromString(n,"text/html").body,d=l.parse(c),h=a.replaceSelectionWith(d);return o(h),e.preventDefault(),!0}if(i){const{state:r,dispatch:o}=s,{tr:a}=r,l=a.insertText(i,r.selection.from,r.selection.to);return o(l),e.preventDefault(),!0}for(let r=0;r<t.length;r++){const o=t[r];if(o.type.startsWith("image/")){const a=o.getAsFile();if(a){const l=await Kee(a),{schema:c}=s.state,d=c.nodes.image.create({src:l?.file_path}),h=s.state.tr.replaceSelectionWith(d);return s.dispatch(h),e.preventDefault(),!0}}}}return!1},Gee={1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"},Yee=M3.extend({addOptions(){return{...this.parent?.(),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){return{...this.parent?.(),level:{default:1,renderHTML:s=>{const e=s.level||1;return{class:`heading-level-${e}`,style:Gee[e-1]}}}}}}),Xee=c7.configure({HTMLAttributes:{style:"min-height: 1rem;"}}),Zee=uk.extend({addAttributes(){return{...this.parent?.(),fontFamily:{default:null,parseHTML:s=>s.style.fontFamily?.replace(/['"]/g,""),renderHTML:s=>s.fontFamily?{style:`font-family: ${s.fontFamily}`}:{}}}},addCommands(){return{setFontFamily:s=>({chain:e})=>e().setMark("textStyle",{fontFamily:s}).run(),unsetFontFamily:()=>({chain:s})=>s().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),Qee=uk.extend({addAttributes(){return{...this.parent?.(),fontSize:{default:null,parseHTML:s=>s.style.fontSize?.replace(/['"]/g,""),renderHTML:s=>s.fontSize?{style:`font-size: ${s.fontSize}`}:{}}}},addCommands(){return{setFontSize:s=>({chain:e})=>e().setMark("textStyle",{fontSize:s}).run(),unsetFontSize:()=>({chain:s})=>s().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}});function Jee(s){let e=!1;const t=qZ({content:s.modelValue,extensions:[zee.configure({history:{depth:100,newGroupDelay:500},code:{HTMLAttributes:{class:"editor-code"}},codeBlock:{HTMLAttributes:{class:"editor-codeblock"}},paragraph:!1,heading:!1,link:!1}),fJ,uJ,tQ,Zee,Qee,Xee,Yee,hJ,Uee,jee.configure({types:["heading","paragraph"]}),Y3.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0}),lJ.configure({table:{HTMLAttributes:{class:"editor-content"},resizable:!0}})],editorProps:{handlePaste:qee}}),n=y.computed(()=>t.value||null);return y.watch(t,r=>{r&&t.value.on("update",o=>{if(!e){e=!0;const a=o.editor.getHTML();s.modelValue,setTimeout(()=>{e=!1},10)}})}),{editor:t,editorInstance:n,focusEditor:()=>{t.value&&!t.value.isFocused&&t.value.commands.focus()}}}function ete(s,e){const t=y.ref(!1),n=y.ref(""),i=y.ref(null);return{isHtmlMode:t,htmlContent:n,htmlTextarea:i,toggleHtmlMode:a=>{t.value=a,a?(s.value&&(n.value=s.value.getHTML()),y.nextTick(()=>{i.value&&(i.value.focus(),setTimeout(()=>{i.value.formatCode()},100))})):s.value&&n.value&&s.value.commands.setContent(n.value,!0)},onHtmlInput:a=>{n.value=a,e&&e("update:modelValue",a)}}}function tte(){const s=y.ref(!1);return{isFullscreen:s,toggleFullscreen:()=>{s.value=!s.value}}}const wn=(s,e)=>{const t=s.__vccOpts||s;for(const[n,i]of e)t[n]=i;return t},nte={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function ite(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Blockquote",onClick:e[0]||(e[0]=(...o)=>r.toggleBlockquote&&r.toggleBlockquote(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)])])}const ste=wn(nte,[["render",ite]]),rte={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function ote(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Bullet List",onClick:e[0]||(e[0]=(...o)=>r.toggleBulletList&&r.toggleBulletList(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)])])}const ate=wn(rte,[["render",ote]]),lte={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function cte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Ordered List",onClick:e[0]||(e[0]=(...o)=>r.toggleOrderedList&&r.toggleOrderedList(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)])])}const dte=wn(lte,[["render",cte]]),hte={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function ute(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Code Block",onClick:e[0]||(e[0]=(...o)=>r.toggleCodeBlock&&r.toggleCodeBlock(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)])])}const fte=wn(hte,[["render",ute]]),gte={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.commands.toggleBold()}}};function pte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Bold Text",onClick:e[0]||(e[0]=(...o)=>r.toggleBold&&r.toggleBold(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("bold")}])},[...e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),y.createElementVNode("span",{class:"sr-only"},"Bold",-1)])],2)}const mte=wn(gte,[["render",pte]]),_te={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function bte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Italic Text",onClick:e[0]||(e[0]=(...o)=>r.toggleItalic&&r.toggleItalic(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("italic")}])},[...e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),y.createElementVNode("span",{class:"sr-only"},"Italic",-1)])],2)}const wte=wn(_te,[["render",bte]]),Cte={__name:"vs-editor-underline",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Underline",onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),y.createElementVNode("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)])],2))}},vte={__name:"vs-editor-strike",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Strikethrough",onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M5 12l14 0"}),y.createElementVNode("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)])],2))}},yte={props:{visible:{type:Boolean,default:()=>!1},modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","update:modelValue","onClose","confirm","cancel"],inheritAttrs:!1,name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){return!!this.$slots?.footer},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:s}){s==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("update:modelValue",!1),this.$emit("onClose")},handleConfirm(){this.$emit("confirm"),this.handleClose()},handleCancel(){this.$emit("cancel"),this.handleClose()},closeByClickBack(s,e){e&&s.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},Ste={key:0,class:"vsTailwind ui-dialog__wrapper"},xte={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Lte={class:"font-medium text-gray-800 dark:text-[#ffffff]"},kte={class:"ui-dialog__content p-4"},Ete={key:0,class:"flex justify-end gap-x-2"};function Nte(s,e,t,n,i,r){return y.openBlock(),y.createBlock(y.Teleport,{to:"body"},[t.visible||t.modelValue?(y.openBlock(),y.createElementBlock("div",Ste,[y.createElementVNode("div",{onMousedown:e[1]||(e[1]=o=>r.closeByClickBack(o,t.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[100001] bg-black bg-opacity-50"},[y.createVNode(y.Transition,{name:"content",appear:""},{default:y.withCtx(()=>[y.createElementVNode("div",{class:y.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[r.checkSize]])},[y.createElementVNode("div",xte,[y.createElementVNode("h3",Lte,y.toDisplayString(t.title),1),y.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...o)=>r.handleClose&&r.handleClose(...o))},[...e[2]||(e[2]=[y.createElementVNode("span",{class:"sr-only"},"Close",-1),y.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M18 6 6 18"}),y.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),y.createElementVNode("div",kte,[y.renderSlot(s.$slots,"default",{},void 0,!0)]),r.hasSlot?(y.openBlock(),y.createElementBlock("div",Ete,[y.renderSlot(s.$slots,"footer",{handleClose:r.handleClose,handleConfirm:r.handleConfirm,handleCancel:r.handleCancel},void 0,!0)])):y.createCommentVNode("",!0)],2)]),_:3})],32)])):y.createCommentVNode("",!0)])}const _7=wn(yte,[["render",Nte],["__scopeId","data-v-6d0970a6"]]),Dte={},Tte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function Ite(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Tte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),y.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Mte=wn(Dte,[["render",Ite]]),Rte={},Ate={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function Ote(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Ate,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),y.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const Pte=wn(Rte,[["render",Ote]]),Fte={},Bte={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function Vte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Bte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),y.createElementVNode("path",{d:"M3 7l9 6l9 -6"},null,-1)])])}const Wte=wn(Fte,[["render",Vte]]),Hte=y.defineComponent({components:{IconClose:Mte,IconSearch:Pte,IconEmail:Wte},inheritAttrs:!1,props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){if((this.style?.size||this.size)==="xs")return"h-[32px] text-sm";if((this.style?.size||this.size)==="md")return"h-[38px] text-sm";this.style?.size||this.size},value:{get(){return this.modelValue},set(s){this.$emit("update:modelValue",s.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:s}=await this.$refs;await s.focus()}}}),zte={class:"vs-form-text relative bg-white rounded-lg"},$te={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},Ute=["disabled","type","placeholder"];function jte(s,e,t,n,i,r){const o=y.resolveComponent("IconClose"),a=y.resolveComponent("IconSearch"),l=y.resolveComponent("IconEmail");return y.openBlock(),y.createElementBlock("div",zte,[s.clearable&&s.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>s.clearInput&&s.clearInput(...c))},[y.createVNode(o,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),s.icon&&s.icon==="search"?(y.openBlock(),y.createElementBlock("div",{key:1,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",s.iconStylePosition])},[y.createVNode(a,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):s.icon&&s.icon==="email"?(y.openBlock(),y.createElementBlock("div",$te,[y.createVNode(l,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(y.openBlock(),y.createElementBlock("i",{key:3,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+s.icon,s.iconStylePosition]])},null,2)),s.clearable&&s.value?(y.openBlock(),y.createElementBlock("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...c)=>s.clearInput&&s.clearInput(...c))},[y.createVNode(o,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("input",y.mergeProps({ref:"vsText",disabled:s.disabled,type:s.type,onInput:e[2]||(e[2]=(...c)=>s.handleInput&&s.handleInput(...c)),placeholder:s.placeholder,"onUpdate:modelValue":e[3]||(e[3]=c=>s.value=c)},s.style?.attrs||s.attrs||{},{onFocus:e[4]||(e[4]=(...c)=>s.handleFocus&&s.handleFocus(...c)),onBlur:e[5]||(e[5]=(...c)=>s.handleBlur&&s.handleBlur(...c)),class:[[s.inputStyle,s.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,Ute),[[y.vModelDynamic,s.value]])])}const b7=wn(Hte,[["render",jte],["__scopeId","data-v-749b581f"]]);function Xk(){const s=y.ref("en");return{t:t=>({en:{type_tag:"Type Tag",heading_1:"Heading 1",heading_2:"Heading 2",heading_3:"Heading 3",paragraph:"Paragraph",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",mergeCells:"Merge Cells",splitCells:"Split Cells",linkTitle:"Enter Link"},uk:{type_tag:"Тип тегу",heading_1:"Заголовок 1",heading_2:"Заголовок 2",heading_3:"Заголовок 3",paragraph:"Параграф",createTable:"Створити Таблицю",addColumn:"Додати Колону",addRow:"Додати Рядок",deleteColumn:"Вилучити Колону",deleteRow:"Вилучити Рядок",deleteTable:"Вилучити Таблицю",mergeCells:"Об'єднати Клітинки",splitCells:"Розділити Клітинки",linkTitle:"Введіть Посилання"}})[s.value]?.[t]||t,locale:s}}const Kte={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},qte=Object.assign({inheritAttrs:!1},{__name:"vs-editor-link",props:{editor:Object},setup(s){const{t:e}=Xk(),t=s,n=y.ref(!1),i=y.ref(""),r=()=>{t.editor.chain().focus().toggleLink({href:i.value}).run(),n.value=!1,i.value=""};return(o,a)=>(y.openBlock(),y.createElementBlock(y.Fragment,null,[y.createElementVNode("button",{title:"Link",onClick:a[0]||(a[0]=l=>n.value=!0),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...a[4]||(a[4]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])]),y.createVNode(_7,{title:y.unref(e)("linkTitle"),visible:n.value,"onUpdate:visible":a[3]||(a[3]=l=>n.value=l),size:"small"},{footer:y.withCtx(()=>[y.createElementVNode("div",Kte,[y.createElementVNode("button",{style:{border:"1px solid #000"},onClick:a[2]||(a[2]=l=>{n.value=!1,i.value=""}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},y.toDisplayString(y.unref(e)("cancel")),1),y.createElementVNode("button",{onClick:r,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},y.toDisplayString(y.unref(e)("create")),1)])]),default:y.withCtx(()=>[y.createVNode(b7,{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=l=>i.value=l),placeholder:y.unref(e)("linkTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["title","visible"])],64))}}),xm=async(s,e,t,n=10)=>{if(!e||!t)return;await y.nextTick();const i=await t?.getBoundingClientRect(),r=await e?.getBoundingClientRect();if(!r||!i)return;const o=await parseInt(e?.getBoundingClientRect()?.height),a=await parseInt(e?.getBoundingClientRect()?.width),l=await parseInt(t?.getBoundingClientRect()?.height),c=await parseInt(t?.getBoundingClientRect()?.width),d=await window.innerHeight,h=await window.innerWidth;let u=0,f=0;const g=r.bottom+n+l;switch(s){case"top":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,h>c+r.right+30?f=r.left-i.width/2+r.width/2:f=h-30-c;break;case"bottom":d>g?u=r.bottom+n:u=r.bottom-n-l-o,f=r.left-i.width/2+r.width/2;break;case"left":u=r.top-i.height/2+r.height/2,r.left-i.width-n>0?f=r.left-i.width-n:f=10;break;case"right":u=r.top-i.height/2+r.height/2,h-a>c?f=r.right+n:f=h-30-c;break;case"top-right":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,h-a>c?f=r.right+n:f=h-30-c;break;case"top-left":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,r.left-i.width-n>0?f=r.left-i.width-n:f=10;break;case"top-start":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,r.left>0?f=r.left:f=10;break;case"bottom-right":d>g?u=r.bottom+n:u=r.bottom-n-l-o,h-a>c?f=r.left:f=h-30-c;break;case"bottom-left":d>g?u=r.bottom+n:u=r.bottom-n-l-o,r.left>0?f=r.right-c:f=10;break;case"bottom-start":d>g?u=r.bottom+n:u=r.bottom-n-l-o,r.left>0?f=r.left:f=10;break}u+l>d?u=d-l-n:u<0&&(u=n),f+c>h?f=h-c-n:f<0&&(f=n),t instanceof HTMLElement&&(t.style.top=`${u}px`,t.style.left=`${f}px`,t.style.position="fixed")},Gte={class:"text-center"},Yte={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Oc=Object.assign({inheritAttrs:!1},{__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"body"}},emits:["isvisible"],setup(s,{expose:e,emit:t}){const n=s,i=t,r=y.ref(!1),o=y.ref([]),a=y.ref(null),l=y.ref(null),c=y.ref(null);y.watch(r,C=>{C?(d(),window.addEventListener("resize",()=>xm(n.placement,l.value,c.value)),xm(n.placement,l.value,c.value)):window.removeEventListener("resize",()=>xm(n.placement,l.value,c.value)),i("isvisible",C)}),y.onMounted(()=>{window.addEventListener("click",m),window.addEventListener("popstate",b),window.addEventListener("scroll",w,!0),d()}),y.onBeforeUnmount(()=>{window.removeEventListener("click",m),window.removeEventListener("popstate",b),h()});const d=()=>{let C=a.value;for(;C&&C!==document.body;)(C.scrollHeight>C.clientHeight||C.scrollWidth>C.clientWidth)&&(C.addEventListener("scroll",p),o.value.push(C)),C=C.parentElement;document.body&&(document.body.addEventListener("scroll",p),o.value.push(document.body))},h=()=>{o.value.forEach(C=>{C.removeEventListener("scroll",p)}),o.value=[]},u=()=>{r.value=!0,xm(n.placement,l.value,c.value)},f=()=>{r.value=!1},g=async()=>{await xm(n.placement,l.value,c.value),r.value=!r.value},p=()=>{r.value=!1},m=C=>{if(!C){r.value=!1;return}l.value?.contains(C.target)||c.value?.contains(C.target)||(r.value=!1)},b=()=>{r.value&&(r.value=!1)},w=C=>{r.value&&c.value&&!c.value.contains(C.target)&&(r.value=!1)};return e({togglePopover:g}),(C,v)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"popover",ref:a,class:"vs-popover inline-block"},[y.createElementVNode("div",Gte,[s.trigger==="click"?(y.openBlock(),y.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:g,class:y.normalizeClass({"pointer-events-none":s.disabled})},[y.renderSlot(C.$slots,"reference",{},()=>[v[0]||(v[0]=y.createElementVNode("button",null,"Click me!",-1))])],2)):y.createCommentVNode("",!0),s.trigger==="hover"?(y.openBlock(),y.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:u,onMouseleave:f,class:y.normalizeClass({"pointer-events-none":s.disabled})},[y.renderSlot(C.$slots,"reference",{},()=>[v[1]||(v[1]=y.createElementVNode("button",null,"Click me!",-1))])],34)):y.createCommentVNode("",!0),(y.openBlock(),y.createBlock(y.Teleport,{to:s.teleport},[y.createVNode(y.Transition,{name:"fade"},{default:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["vsTailwind vs-popover__content",s.placement]),ref_key:"contentPop",ref:c,style:y.normalizeStyle({width:s.width?s.width+"px":"fit-content",zIndex:100001})},[y.createElementVNode("div",Yte,[y.renderSlot(C.$slots,"default",{},()=>[v[2]||(v[2]=y.createElementVNode("span",null,"Popover content",-1))])])],6),[[y.vShow,r.value]])]),_:3})],8,["to"]))])],512))}}),Xte={class:"flex flex-col gap-[2px] p-[2px]"},Zte=["onClick"],Qte={__name:"vs-editor-table",props:{editor:Object},setup(s){const{t:e}=Xk(),t=s,n=y.ref(!1),i=y.ref("popover"),r=()=>{t.editor&&(t.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),i.value.togglePopover())},o=()=>{t.editor&&(t.editor.chain().focus().addColumnAfter().run(),i.value.togglePopover())},a=()=>{t.editor&&(t.editor.chain().focus().addRowAfter().run(),i.value.togglePopover())},l=()=>{t.editor&&(t.editor.chain().focus().deleteColumn().run(),i.value.togglePopover())},c=()=>{t.editor&&(t.editor.chain().focus().deleteRow().run(),i.value.togglePopover())},d=()=>{t.editor&&(t.editor.chain().focus().deleteTable().run(),i.value.togglePopover())},h=()=>{t.editor&&(t.editor.chain().focus().mergeCells().run(),i.value.togglePopover())},u=()=>{t.editor&&(t.editor.chain().focus().splitCell().run(),i.value.togglePopover())},f=y.computed(()=>[{text:e("createTable"),function:r},{text:e("addColumn"),function:o},{text:e("addRow"),function:a},{text:e("deleteColumn"),function:l},{text:e("deleteRow"),function:c},{text:e("deleteTable"),function:d},{text:e("mergeCells"),function:h},{text:e("splitCells"),function:u}]);return(g,p)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:i,placement:"bottom",onIsvisible:p[0]||(p[0]=m=>n.value=m)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Table",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...p[1]||(p[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),y.createElementVNode("path",{d:"M3 10h18"}),y.createElementVNode("path",{d:"M10 3v18"})],-1)])],2)]),default:y.withCtx(()=>[y.createElementVNode("div",Xte,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(f.value,(m,b)=>(y.openBlock(),y.createElementBlock("button",{key:b,onClick:m?.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},y.toDisplayString(m.text),9,Zte))),128))])]),_:1},512))}},Jte={},ene={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function tne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",ene,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M8 12l8 0"},null,-1),y.createElementVNode("path",{d:"M6 18l12 0"},null,-1)])])}const nne=wn(Jte,[["render",tne]]),ine={},sne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function rne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",sne,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M10 12l10 0"},null,-1),y.createElementVNode("path",{d:"M6 18l14 0"},null,-1)])])}const one=wn(ine,[["render",rne]]),ane={},lne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function cne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",lne,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M4 12l10 0"},null,-1),y.createElementVNode("path",{d:"M4 18l14 0"},null,-1)])])}const dne=wn(ane,[["render",cne]]),hne={},une={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-justify"};function fne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",une,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6h16"},null,-1),y.createElementVNode("path",{d:"M4 12h16"},null,-1),y.createElementVNode("path",{d:"M4 18h16"},null,-1)])])}const w7={left:dne,center:nne,right:one,justify:wn(hne,[["render",fne]])},gne={class:"flex gap-[4px] p-1"},pne=["title","onClick"],mne={__name:"vs-editor-align",props:{editor:Object},setup(s){const e=s,t=y.ref(!1),n=y.ref("popover"),i=y.ref("left"),r=y.computed(()=>e.editor?.isActive("left")),o=y.computed(()=>e.editor?.isActive("right")),a=y.computed(()=>e.editor?.isActive("center")),l=y.computed(()=>e.editor?.isActive("justify")),c=h=>{e.editor&&e.editor.chain().focus().setTextAlign(h).run()},d=y.ref([{id:"left",isActive:r},{id:"center",isActive:a},{id:"right",isActive:o},{id:"justify",isActive:l}]);return(h,u)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:n,placement:"bottom",onIsvisible:u[0]||(u[0]=f=>t.value=f)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Text Align",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[t.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(w7)[i.value]),{height:"16",width:"16"}))],2)]),default:y.withCtx(()=>[y.createElementVNode("div",gne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(d.value,f=>(y.openBlock(),y.createElementBlock("button",{title:"Text align "+f?.id,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":f?.isActive}]),key:f?.id,onClick:g=>c(f?.id)},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(w7)[f?.id]),{height:"16",width:"16"}))],10,pne))),128))])]),_:1},512))}},_ne={class:"flex flex-col gap-[2px] p-[2px]"},bne=["onClick"],wne={__name:"vs-editor-type-tag",props:{editor:Object},setup(s){const{t:e}=Xk(),t=s,n=y.ref(!1),i=y.ref("popover"),r=()=>{t.editor&&(t.editor?.chain().focus().setParagraph().run(),i.value.togglePopover())},o=l=>{t.editor&&(t.editor?.chain().focus().toggleHeading({level:l}).run(),i.value.togglePopover())},a=y.computed(()=>[{text:e("richtext.heading1"),id:1,style:"font-[700] text-[30px]"},{text:e("richtext.heading2"),id:2,style:"font-[700] text-[26px]"},{text:e("richtext.heading3"),id:3,style:"font-[700] text-[22px]"},{text:e("richtext.heading4"),id:4,style:"font-[700] text-[18px]"},{text:e("richtext.heading5"),id:5,style:"font-[500] text-[16px]"},{text:e("richtext.heading6"),id:6,style:"font-[400] text-[14px]"}]);return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:i,placement:"bottom",onIsvisible:c[0]||(c[0]=d=>n.value=d)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Type Tag",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...c[1]||(c[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 7v-2h13v2"}),y.createElementVNode("path",{d:"M10 5v14"}),y.createElementVNode("path",{d:"M12 19h-4"}),y.createElementVNode("path",{d:"M15 13v-1h6v1"}),y.createElementVNode("path",{d:"M18 12v7"}),y.createElementVNode("path",{d:"M17 19h2"})],-1)])],2)]),default:y.withCtx(()=>[y.createElementVNode("div",_ne,[y.createElementVNode("button",{onClick:r,class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[s.editor?.isActive("paragraph")?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)("richtext.paragraph")),3),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(a.value,(d,h)=>(y.openBlock(),y.createElementBlock("button",{key:h,onClick:u=>o(d?.id),class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[d?.style,s.editor?.isActive("heading",{level:d?.id})?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)(`richtext.heading${d?.id}`)),11,bne))),128))])]),_:1},512))}},Cne={},vne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function yne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",vne,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Lm=wn(Cne,[["render",yne]]),Sne={components:{VsText:b7},inheritAttrs:!1,events:["update:modelValue"],props:{modelValue:{type:String},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(s){this.$emit("update:modelValue",s)}}}},xne={class:"flex items-center w-full max-w-[182px]"},Lne=["disabled"];function kne(s,e,t,n,i,r){const o=y.resolveComponent("vs-text");return y.openBlock(),y.createElementBlock("div",xne,[y.withDirectives(y.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"color",class:y.normalizeClass(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",t.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:t.disabled},null,10,Lne),[[y.vModelText,r.value]]),t.isTextInputShown?(y.openBlock(),y.createBlock(o,{key:0,modelValue:r.value,"onUpdate:modelValue":e[1]||(e[1]=a=>r.value=a),class:"ml-2 w-full",disabled:t.disabled,clearable:t.clearable},null,8,["modelValue","disabled","clearable"])):y.createCommentVNode("",!0)])}const C7=wn(Sne,[["render",kne]]),Ene={title:"Text Color",class:"flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},Nne={class:"flex gap-[4px] mb-[8px]"},Dne={class:"grid grid-rows-3 grid-cols-7"},Tne={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},Ine=["onClick","title"],Mne={__name:"vs-editor-color",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("#000000"),i=y.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),r=l=>{e.editor&&(e.editor.chain().focus().setColor(l).run(),n.value=l,t.value&&t.value.togglePopover())},o=()=>{r(n.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple","#FFFFFF":"White","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",Ene,[c[1]||(c[1]=y.createElementVNode("span",{class:"leading-none"},"A",-1)),y.createElementVNode("span",{class:"block h-1 w-5",style:y.normalizeStyle({backgroundColor:n.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("div",Nne,[y.createVNode(C7,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:o,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(Lm,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("div",Dne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,d=>(y.openBlock(),y.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[y.createElementVNode("div",Tne,[y.createElementVNode("button",{class:"flex items-center justify-center w-full h-full",style:y.normalizeStyle({backgroundColor:d}),onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],12,Ine)])]))),128))])])]),_:1},512))}},Rne={title:"Background Color",class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},Ane={class:"flex gap-[4px] mb-[8px]"},One={class:"grid grid-rows-3 grid-cols-7"},Pne={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},Fne=["onClick","title"],Bne=["onClick","title"],Vne={__name:"vs-editor-background-color",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("transparent"),i=y.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),r=l=>{e.editor&&(e.editor.chain().focus().setBackgroundColor(l).run(),n.value=l,t.value&&t.value.togglePopover())},o=()=>{r(n.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple",transparent:"Transparent","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",Rne,[c[2]||(c[2]=y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"}),y.createElementVNode("path",{d:"m5 2 5 5"}),y.createElementVNode("path",{d:"M2 13h15"}),y.createElementVNode("path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"})],-1)),y.createElementVNode("span",{class:"block h-1 w-5",style:y.normalizeStyle({backgroundColor:n.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("div",Ane,[y.createVNode(C7,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:o,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(Lm,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("div",One,[y.createElementVNode("button",{onClick:c[1]||(c[1]=d=>r("transparent")),class:"col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"},[...c[3]||(c[3]=[y.createElementVNode("svg",{fill:"#000000",width:"16",height:"16",viewBox:"0 0 52 52","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg"},[y.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),y.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),y.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[y.createElementVNode("path",{d:"M48.5,5.6,46.4,3.5a1.67,1.67,0,0,0-2.4.3L32.59,15.21c-.77-1.3-1.51-2.61-2.21-4a36.5,36.5,0,0,1-3.15-8.36c-.13-.53-.39-.91-1-.89s-.86.4-1,.93c-.06.26-.11.51-.17.76A48.3,48.3,0,0,1,21,13.7,97.47,97.47,0,0,1,14.13,25a16,16,0,0,0-3,11.12c0,.14,0,.29.06.43L3.8,44a1.87,1.87,0,0,0-.3,2.4l2.1,2.1A1.67,1.67,0,0,0,8,48.2L48.2,8A1.67,1.67,0,0,0,48.5,5.6Z"}),y.createElementVNode("path",{d:"M38.42,23.79l-22,22.31A14.47,14.47,0,0,0,26.22,50a15.48,15.48,0,0,0,7-1.44c4.94-2.51,8.11-6.4,8.94-12A15.22,15.22,0,0,0,39,24.66C38.87,24.44,38.58,24,38.42,23.79Z"})])],-1),y.createElementVNode("p",null,"no color",-1)])]),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,d=>(y.openBlock(),y.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[y.createElementVNode("div",Pne,[d!=="transparent"?(y.openBlock(),y.createElementBlock("button",{key:0,class:"flex items-center justify-center w-full h-full",style:y.normalizeStyle({backgroundColor:d}),onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],12,Fne)):y.createCommentVNode("",!0),d==="transparent"?(y.openBlock(),y.createElementBlock("button",{key:1,class:"flex items-center justify-center w-full h-full",onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],8,Bne)):y.createCommentVNode("",!0)])]))),128))])])]),_:1},512))}},Wne={__name:"vs-editor-highlight",props:{editor:Object},setup(s){const e=s,t=y.computed(()=>e.editor?.isActive("highlight")),n=()=>{e.editor&&e.editor.chain().focus().toggleHighlight().run()};return(i,r)=>(y.openBlock(),y.createElementBlock("button",{title:"Highlight",onClick:n,class:y.normalizeClass(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex",{"bg-gray-200":t.value}])},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"m9 11-6 6v3h9l3-3"}),y.createElementVNode("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})],-1)])],2))}},Hne={class:"truncate"},zne={class:"w-[200px]"},$ne={class:"max-h-[200px] overflow-y-auto"},Une=["onClick"],jne={__name:"vs-editor-font-family",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref(!1),i=y.ref([{label:"Arial",value:"Arial, sans-serif"},{label:"Helvetica",value:"Helvetica, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Comic Sans MS",value:"Comic Sans MS, cursive"},{label:"Impact",value:"Impact, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Palatino",value:"Palatino, serif"}]),r=y.computed(()=>{if(!e.editor)return"Arial, sans-serif";for(const c of i.value)if(e.editor.isActive("textStyle",{fontFamily:c.value}))return c.value;return"Arial, sans-serif"}),o=y.computed(()=>i.value.find(d=>d.value===r.value)?.label||"Arial"),a=c=>e.editor?e.editor.isActive("textStyle",{fontFamily:c}):!1,l=c=>{e.editor&&(e.editor.chain().focus().setFontFamily(c).run(),t.value&&t.value.togglePopover())};return(c,d)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom",onIsvisible:d[0]||(d[0]=h=>n.value=h)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Font Family",class:y.normalizeClass(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm",[n.value?"bg-gray-100 text-gray-900":"text-gray-700"]]),style:y.normalizeStyle({fontFamily:r.value})},[y.createElementVNode("span",Hne,y.toDisplayString(o.value),1),d[1]||(d[1]=y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))],6)]),default:y.withCtx(()=>[y.createElementVNode("div",zne,[y.createElementVNode("ul",$ne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,h=>(y.openBlock(),y.createElementBlock("li",{key:h.value,class:y.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",{"bg-gray-100":a(h.value)}]),style:y.normalizeStyle({fontFamily:h.value}),onClick:u=>l(h.value)},y.toDisplayString(h.label),15,Une))),128))])])]),_:1},512))}},Kne={class:"w-[120px]"},qne={class:"max-h-[200px] overflow-y-auto"},Gne=["onClick"],Yne={__name:"vs-editor-font-size",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("14px"),i=y.ref([{label:"8px",value:"8px"},{label:"9px",value:"9px"},{label:"10px",value:"10px"},{label:"11px",value:"11px"},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"36px",value:"36px"},{label:"48px",value:"48px"},{label:"72px",value:"72px"}]),r=o=>{e.editor&&(e.editor.chain().focus().setFontSize(o).run(),n.value=o,t.value&&t.value.togglePopover())};return(o,a)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[...a[0]||(a[0]=[y.createElementVNode("button",{title:"Font Size",class:"h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1"},[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-alarge-small-icon lucide-a-large-small"},[y.createElementVNode("path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"}),y.createElementVNode("path",{d:"M15.697 14h5.606"}),y.createElementVNode("path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"}),y.createElementVNode("path",{d:"M3.304 13h6.392"})]),y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})])],-1)])]),default:y.withCtx(()=>[y.createElementVNode("div",Kne,[y.createElementVNode("ul",qne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,l=>(y.openBlock(),y.createElementBlock("li",{key:l.value,class:"px-3 py-2 hover:bg-gray-100 cursor-pointer",onClick:c=>r(l.value)},y.toDisplayString(l.label),9,Gne))),128))])])]),_:1},512))}},Xne={props:{editor:Object},methods:{toggleSuperscript(){this.editor&&this.editor.commands.toggleSuperscript()}}};function Zne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Superscript",onClick:e[0]||(e[0]=(...o)=>r.toggleSuperscript&&r.toggleSuperscript(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("superscript")}])},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript-icon lucide-superscript"><path d="m4 19 8-8"></path><path d="m12 19-8-8"></path><path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"></path></svg><span class="sr-only">Superscript</span>',2)])],2)}const Qne=wn(Xne,[["render",Zne]]),Jne={props:{editor:Object},methods:{toggleSubscript(){this.editor&&this.editor.commands.toggleSubscript()}}};function eie(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Subscript",onClick:e[0]||(e[0]=(...o)=>r.toggleSubscript&&r.toggleSubscript(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("subscript")}])},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-subscript-icon lucide-subscript"><path d="m4 5 8 8"></path><path d="m12 5-8 8"></path><path d="M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07"></path></svg><span class="sr-only">Subscript</span>',2)])],2)}const tie=wn(Jne,[["render",eie]]),nie={title:"Heading",class:"h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"},iie={class:"truncate"},sie={class:"max-h-[200px] overflow-y-auto"},rie=["onClick"],oie=wn({__name:"vs-editor-heading",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref([{label:"Heading 1",value:1},{label:"Heading 2",value:2},{label:"Heading 3",value:3},{label:"Heading 4",value:4},{label:"Heading 5",value:5},{label:"Heading 6",value:6}]),i=y.computed(()=>{if(!e.editor)return"Paragraph";for(let l=1;l<=6;l++)if(e.editor.isActive("heading",{level:l}))return`H ${l}`;return"P"}),r=l=>({1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"})[l]||"",o=l=>{e.editor&&(e.editor.chain().focus().setHeading({level:l}).run(),t.value&&t.value.togglePopover())},a=()=>{e.editor&&(e.editor.chain().focus().setParagraph().run(),t.value&&t.value.togglePopover())};return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",nie,[y.createElementVNode("span",iie,y.toDisplayString(i.value),1),c[0]||(c[0]=y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("ul",sie,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(n.value,d=>(y.openBlock(),y.createElementBlock("li",{key:d.value,class:y.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",`heading-level-${d.value}`]),style:y.normalizeStyle(r(d.value)),onClick:h=>o(d.value)},y.toDisplayString(d.label),15,rie))),128)),y.createElementVNode("li",{class:"px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",onClick:a}," Paragraph ")])])]),_:1},512))}},[["__scopeId","data-v-ef7c378e"]]),aie={props:{editor:Object},methods:{clearFormatting(){this.editor&&this.editor.commands.unsetAllMarks()}}};function lie(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Clear Formatting",onClick:e[0]||(e[0]=(...o)=>r.clearFormatting&&r.clearFormatting(...o)),class:"h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-remove-formatting-icon lucide-remove-formatting"><path d="M4 7V4h16v3"></path><path d="M5 20h6"></path><path d="M13 4 8 20"></path><path d="m15 15 5 5"></path><path d="m20 15-5 5"></path></svg><span class="sr-only">Clear Formatting</span>',2)])])}const cie=wn(aie,[["render",lie]]),die={class:"relative"},hie={class:"space-y-4"},uie={key:0,class:"mt-4"},fie=["src","alt","title"],gie={key:0,class:"text-sm text-red-500"},pie=Object.assign({inheritAttrs:!1},{__name:"vs-editor-image",props:{editor:{type:Object,required:!0}},setup(s){const e=s,t=y.ref(!1),n=y.ref(!1),i=y.ref({src:"",alt:"",title:""}),r=()=>{i.value={src:"",alt:"",title:""},n.value=!1,t.value=!0},o=()=>{t.value=!1,n.value=!1},a=()=>{if(!i.value.src){alert("Please enter an image URL");return}e.editor&&e.editor.chain().focus().setImage({src:i.value.src,alt:i.value.alt||"",title:i.value.title||""}).run(),o()},l=()=>{a()},c=()=>{o()};return y.watch(()=>i.value.src,()=>{n.value=!1}),(d,h)=>(y.openBlock(),y.createElementBlock("div",die,[y.createElementVNode("button",{onClick:r,class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",s.editor?.isActive("image")?"bg-gray-200 text-gray-900":""]),title:"Add Image"},[...h[5]||(h[5]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"></rect><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path></svg><span class="sr-only">Add Image</span>',2)])],2),y.createVNode(_7,{modelValue:t.value,"onUpdate:modelValue":h[4]||(h[4]=u=>t.value=u),title:"Add Image"},{footer:y.withCtx(()=>[y.createElementVNode("button",{onClick:c,type:"button",class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Cancel "),y.createElementVNode("button",{onClick:l,type:"button",class:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Add Image ")]),default:y.withCtx(()=>[y.createElementVNode("div",hie,[y.createElementVNode("div",null,[h[6]||(h[6]=y.createElementVNode("label",{for:"imageUrl",class:"block text-sm font-medium text-gray-700 mb-1"}," Image URL ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageUrl","onUpdate:modelValue":h[0]||(h[0]=u=>i.value.src=u),type:"url",placeholder:"https://example.com/image.png",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:""},null,512),[[y.vModelText,i.value.src]])]),y.createElementVNode("div",null,[h[7]||(h[7]=y.createElementVNode("label",{for:"imageAlt",class:"block text-sm font-medium text-gray-700 mb-1"}," Alt Text ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageAlt","onUpdate:modelValue":h[1]||(h[1]=u=>i.value.alt=u),type:"text",placeholder:"Description of the image",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[y.vModelText,i.value.alt]])]),y.createElementVNode("div",null,[h[8]||(h[8]=y.createElementVNode("label",{for:"imageTitle",class:"block text-sm font-medium text-gray-700 mb-1"}," Title (optional) ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageTitle","onUpdate:modelValue":h[2]||(h[2]=u=>i.value.title=u),type:"text",placeholder:"Image title",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[y.vModelText,i.value.title]])]),i.value.src?(y.openBlock(),y.createElementBlock("div",uie,[h[9]||(h[9]=y.createElementVNode("p",{class:"text-sm text-gray-600 mb-2"},"Preview:",-1)),y.withDirectives(y.createElementVNode("img",{src:i.value.src,alt:i.value.alt||"Image preview",title:i.value.title,class:"max-w-full h-auto max-h-32 rounded border",onError:h[3]||(h[3]=u=>n.value=!0)},null,40,fie),[[y.vShow,!n.value]]),n.value?(y.openBlock(),y.createElementBlock("p",gie," Failed to load image preview ")):y.createCommentVNode("",!0)])):y.createCommentVNode("",!0)])]),_:1},8,["modelValue"])]))}}),mie={class:"flex items-center"},_ie=["disabled"],bie=["disabled"],wie=wn(Object.assign({inheritAttrs:!1},{__name:"vs-editor-history",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor?.can().undo()&&e.editor.chain().focus().undo().run()},n=()=>{e.editor?.can().redo()&&e.editor.chain().focus().redo().run()};return(i,r)=>(y.openBlock(),y.createElementBlock("div",mie,[y.createElementVNode("button",{onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200",[s.editor?.can().undo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!s.editor?.can().undo(),title:"Undo (Ctrl+Z)"},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M3 7v6h6"}),y.createElementVNode("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)])],10,_ie),y.createElementVNode("button",{onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.can().redo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!s.editor?.can().redo(),title:"Redo (Ctrl+Y)"},[...r[1]||(r[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M21 7v6h-6"}),y.createElementVNode("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13"})],-1)])],10,bie)]))}}),[["__scopeId","data-v-b5a7cc5a"]]),Cie={class:"relative"},vie=wn(Object.assign({inheritAttrs:!1},{__name:"vs-editor-help",props:{editor:Object},setup(s){const e=y.ref(!1),t=y.ref(null),n=()=>{e.value=!e.value},i=()=>{e.value=!1};return(r,o)=>(y.openBlock(),y.createElementBlock("div",Cie,[y.createElementVNode("button",{ref_key:"helpButton",ref:t,onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500",[e.value?"bg-gray-100 text-gray-900":"text-gray-500"]]),title:"Markdown Shortcuts Help"},[...o[1]||(o[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),y.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),y.createElementVNode("line",{x1:"12",x2:"12.01",y1:"17",y2:"17"})],-1)])],2),e.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100001]",onClick:i},[y.createElementVNode("div",{class:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",onClick:o[0]||(o[0]=y.withModifiers(()=>{},["stop"]))},[y.createElementVNode("div",{class:"p-6"},[y.createElementVNode("div",{class:"flex justify-between items-center mb-4"},[o[3]||(o[3]=y.createElementVNode("h2",{class:"text-xl font-semibold text-gray-900"},"Common Markdown Syntax & Shortcuts",-1)),y.createElementVNode("button",{onClick:i,class:"text-gray-400 hover:text-gray-600 transition-colors"},[...o[2]||(o[2]=[y.createElementVNode("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),o[4]||(o[4]=y.createStaticVNode('<div class="space-y-6" data-v-72ce3024><div data-v-72ce3024><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-72ce3024>Markdown Syntax</h3><div class="overflow-x-auto" data-v-72ce3024><table class="w-full border-collapse" data-v-72ce3024><thead data-v-72ce3024><tr class="bg-gray-50" data-v-72ce3024><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Example</th></tr></thead><tbody class="text-sm" data-v-72ce3024><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>_italic text_</code></td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>###### Heading 6</code></td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>1. First item</code>). </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Start with a greater-than sign (>) followed by a space. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>`</code>). </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Images</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024></code> syntax. </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Links</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-72ce3024><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-72ce3024>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-72ce3024><table class="w-full border-collapse" data-v-72ce3024><thead data-v-72ce3024><tr class="bg-gray-50" data-v-72ce3024><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Action</th></tr></thead><tbody class="text-sm" data-v-72ce3024><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Select all text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Apply bold formatting</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Copy selected text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Apply italic formatting</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Save the current document</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Paste copied text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Cut selected text</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Redo the last action</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Redo the last action</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Undo the last action</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Undo the last action</td></tr></tbody></table></div></div></div>',1))])])])):y.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-72ce3024"]]),yie={__name:"vs-editor-horizontal-rule",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().setHorizontalRule().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Horizontal Rule",onClick:t,class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("line",{x1:"3",x2:"21",y1:"12",y2:"12"})],-1)])]))}},Sie={__name:"vs-editor-fullscreen",props:{editor:Object},emits:["toggle-fullscreen"],setup(s,{emit:e}){const t=e,n=()=>{t("toggle-fullscreen")};return(i,r)=>(y.openBlock(),y.createElementBlock("button",{title:"Fullscreen",onClick:n,class:"w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})],-1)])]))}},xie=["title"],Lie={class:"vs-editor-html-mode__text"},kie={bold:mte,italic:wte,color:Mne,background_color:Vne,highlight:Wne,bullet_list:ate,ordered_list:dte,blockquote:ste,codeblock:fte,underline:Cte,strike:vte,link:qte,table:Qte,text_align:mne,type_tag:wne,font_family:jne,font_size:Yne,superscript:Qne,subscript:tie,heading:oie,clear_formatting:cie,image:pie,history:wie,help:vie,horizontal_rule:yie,fullscreen:Sie,html_mode:wn({__name:"vs-editor-html-mode",props:{editor:{type:Object,required:!0}},emits:["toggle-html-mode"],setup(s,{emit:e}){const t=e,n=y.ref(!1),i=()=>{n.value=!n.value,t("toggle-html-mode",n.value)};return(r,o)=>(y.openBlock(),y.createElementBlock("button",{onClick:i,class:y.normalizeClass([{"is-active":n.value},"vs-editor-html-mode"]),type:"button",title:n.value?"Switch to Rich Text Mode":"Switch to HTML Mode"},[o[0]||(o[0]=y.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"16,18 22,12 16,6"}),y.createElementVNode("polyline",{points:"8,6 2,12 8,18"})],-1)),y.createElementVNode("span",Lie,y.toDisplayString((n.value,"HTML")),1)],10,xie))}},[["__scopeId","data-v-99a48167"]])},v7={basic:["history","font_family","font_size","bold","italic","underline","strike","text_align","bullet_list","ordered_list","link","image","clear_formatting","help"],default:["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","horizontal_rule","clear_formatting","fullscreen","help","html_mode"],full:["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","horizontal_rule","superscript","subscript","clear_formatting","fullscreen","help","html_mode"]};function Eie(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Sn(s,e,t=(n,i)=>n===i){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let n=0,i=s.length;n<i;n++)if(!t(s[n],e[n]))return!1;return!0}function Nie(s,e){const t=s.length-1;e<t&&(s[e]=s[t]),s.pop()}function Die(s,e,t){return y7(s.length,n=>t(s[n],e))}function y7(s,e){let t=0,n=s-1;for(;t<=n;){const i=(t+n)/2|0,r=e(i);if(r<0)t=i+1;else if(r>0)n=i-1;else return i}return-(t+1)}function*Zk(s,e){let t,n;for(const i of s)n!==void 0&&e(n,i)?t.push(i):(t&&(yield t),t=[i]),n=i;t&&(yield t)}function S7(s,e){for(let t=0;t<=s.length;t++)e(t===0?void 0:s[t-1],t===s.length?void 0:s[t])}function Tie(s,e){for(let t=0;t<s.length;t++)e(t===0?void 0:s[t-1],s[t],t+1===s.length?void 0:s[t+1])}function Qk(s){return s.filter(e=>!!e)}function x7(s){let e=0;for(let t=0;t<s.length;t++)s[t]&&(s[e]=s[t],e+=1);s.length=e}function Iie(s){return!Array.isArray(s)||s.length===0}function Nw(s){return Array.isArray(s)&&s.length>0}function Qd(s,e=t=>t){const t=new Set;return s.filter(n=>{const i=e(n);return t.has(i)?!1:(t.add(i),!0)})}function cs(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const n=[];if(t<=e)for(let i=t;i<e;i++)n.push(i);else for(let i=t;i>e;i--)n.push(i);return n}function Dw(s,e,t){const n=s.slice(0,e),i=s.slice(e);return n.concat(t,i)}function Jk(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function Tw(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function eE(s,e){for(const t of e)s.push(t)}function Mie(s,e,t){const n=L7(s,e),i=s.length,r=t.length;s.length=i+r;for(let o=i-1;o>=n;o--)s[o+r]=s[o];for(let o=0;o<r;o++)s[o+n]=t[o]}function Iw(s,e,t,n){const i=L7(s,e);let r=s.splice(i,t);return r===void 0&&(r=[]),Mie(s,i,n),r}function L7(s,e){return e<0?Math.max(e+s.length,0):Math.min(e,s.length)}var km;(function(s){function e(r){return r<0}s.isLessThan=e;function t(r){return r<=0}s.isLessThanOrEqual=t;function n(r){return r>0}s.isGreaterThan=n;function i(r){return r===0}s.isNeitherLessOrGreaterThan=i,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(km||(km={}));function Ks(s,e){return(t,n)=>e(s(t),s(n))}function Rie(...s){return(e,t)=>{for(const n of s){const i=n(e,t);if(!km.isNeitherLessOrGreaterThan(i))return i}return km.neitherLessOrGreaterThan}}const ll=(s,e)=>s-e,Aie=(s,e)=>ll(s?1:0,e?1:0);function Oie(s){return(e,t)=>-s(e,t)}class cl{constructor(e){this.firstIdx=0,this.items=e,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 n=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,n}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}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 Lp=class Lp{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Lp(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new Lp(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(i=>((n||km.isGreaterThan(e(i,t)))&&(n=!1,t=i),!0)),t}};Lp.empty=new Lp(e=>{});let Jd=Lp;class Pie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?If.isErrorNoTelemetry(e)?new If(e.message+`
|
|
118
|
+
3. "-" cannot repeat`);bn.customSchemes.push([s,e])}function ZJ(){bn.scanner=$J(bn.customSchemes);for(let s=0;s<bn.tokenQueue.length;s++)bn.tokenQueue[s][1]({scanner:bn.scanner});bn.parser=KJ(bn.scanner.tokens);for(let s=0;s<bn.pluginQueue.length;s++)bn.pluginQueue[s][1]({scanner:bn.scanner,parser:bn.parser});return bn.initialized=!0,bn}function zk(s){return bn.initialized||ZJ(),qJ(bn.parser.start,s,H3(bn.scanner.start,s))}zk.scan=H3;function G3(s,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const n=new Wk(t),i=zk(s),r=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&n.check(a)&&r.push(a.toFormattedObject(n))}return r}var $k="[\0- -\u2029 ]",QJ=new RegExp($k),JJ=new RegExp(`${$k}$`),eee=new RegExp($k,"g");function tee(s){return s.length===1?s[0].isLink:s.length===3&&s[1].isLink?["()","[]"].includes(s[0].value+s[2].value):!1}function nee(s){return new yn({key:new Gn("autolink"),appendTransaction:(e,t,n)=>{const i=e.some(c=>c.docChanged)&&!t.doc.eq(n.doc),r=e.some(c=>c.getMeta("preventAutolink"));if(!i||r)return;const{tr:o}=n,a=O5(t.doc,[...e]);if(j5(a).forEach(({newRange:c})=>{const d=HX(n.doc,c,f=>f.isTextblock);let h,u;if(d.length>1)h=d[0],u=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const f=n.doc.textBetween(c.from,c.to," "," ");if(!JJ.test(f))return;h=d[0],u=n.doc.textBetween(h.pos,c.to,void 0," ")}if(h&&u){const f=u.split(QJ).filter(Boolean);if(f.length<=0)return!1;const g=f[f.length-1],p=h.pos+u.lastIndexOf(g);if(!g)return!1;const m=zk(g).map(b=>b.toObject(s.defaultProtocol));if(!tee(m))return!1;m.filter(b=>b.isLink).map(b=>({...b,from:p+b.start+1,to:p+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>s.validate(b.value)).filter(b=>s.shouldAutoLink(b.value)).forEach(b=>{ik(b.from,b.to,n.doc).some(w=>w.mark.type===s.type)||o.addMark(b.from,b.to,s.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function iee(s){return new yn({key:new Gn("handleClickLink"),props:{handleClick:(e,t,n)=>{var i,r;if(n.button!==0||!e.editable)return!1;let o=null;if(n.target instanceof HTMLAnchorElement)o=n.target;else{let d=n.target;const h=[];for(;d.nodeName!=="DIV";)h.push(d),d=d.parentNode;o=h.find(u=>u.nodeName==="A")}if(!o)return!1;const a=U5(e.state,s.type.name),l=(i=o?.href)!=null?i:a.href,c=(r=o?.target)!=null?r:a.target;return s.enableClickSelection&&s.editor.commands.extendMarkRange(s.type.name),o&&l?(window.open(l,c),!0):!1}}})}function see(s){return new yn({key:new Gn("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:r}=i,{empty:o}=r;if(o)return!1;let a="";n.content.forEach(c=>{a+=c.textContent});const l=G3(a,{defaultProtocol:s.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:s.editor.commands.setMark(s.type,{href:l.href})}}})}function Xd(s,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&t.push(i)}),!s||s.replace(eee,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Y3=_o.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(s=>{if(typeof s=="string"){q3(s);return}q3(s.scheme,s.optionalSlashes)})},onDestroy(){XJ()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(s,e)=>!!Xd(s,e.protocols),validate:s=>!!s,shouldAutoLink:s=>!!s}},addAttributes(){return{href:{default:null,parseHTML(s){return s.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:s=>{const e=s.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Xd(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:s}){return this.options.isAllowedUri(s.href,{defaultValidate:e=>!!Xd(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",$t(this.options.HTMLAttributes,s),0]:["a",$t(this.options.HTMLAttributes,{...s,href:""}),0]},addCommands(){return{setLink:s=>({chain:e})=>{const{href:t}=s;return this.options.isAllowedUri(t,{defaultValidate:n=>!!Xd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,s).setMeta("preventAutolink",!0).run():!1},toggleLink:s=>({chain:e})=>{const{href:t}=s||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:n=>!!Xd(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,s,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:s})=>s().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Dc({find:s=>{const e=[];if(s){const{protocols:t,defaultProtocol:n}=this.options,i=G3(s).filter(r=>r.isLink&&this.options.isAllowedUri(r.value,{defaultValidate:o=>!!Xd(o,t),protocols:t,defaultProtocol:n}));i.length&&i.forEach(r=>e.push({text:r.value,data:{href:r.href},index:r.start}))}return e},type:this.type,getAttributes:s=>{var e;return{href:(e=s.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const s=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&s.push(nee({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Xd(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&s.push(iee({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&s.push(see({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),s}}),ree=Object.defineProperty,oee=(s,e)=>{for(var t in e)ree(s,t,{get:e[t],enumerable:!0})},aee="listItem",X3="textStyle",Z3=/^\s*([-+*])\s$/,Q3=Ni.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:s}){return["ul",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{toggleBulletList:()=>({commands:s,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(aee,this.editor.getAttributes(X3)).run():s.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let s=Ef({find:Z3,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(s=Ef({find:Z3,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(X3),editor:this.editor})),[s]}}),J3=Ni.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:s}){return["li",$t(this.options.HTMLAttributes,s),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),lee={};oee(lee,{findListItemPos:()=>Sm,getNextListDepth:()=>Uk,handleBackspace:()=>jk,handleDelete:()=>Kk,hasListBefore:()=>e7,hasListItemAfter:()=>cee,hasListItemBefore:()=>t7,listItemHasSubList:()=>n7,nextListIsDeeper:()=>i7,nextListIsHigher:()=>s7});var Sm=(s,e)=>{const{$from:t}=e.selection,n=ii(s,e.schema);let i=null,r=t.depth,o=t.pos,a=null;for(;r>0&&a===null;)i=t.node(r),i.type===n?a=r:(r-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},Uk=(s,e)=>{const t=Sm(s,e);if(!t)return!1;const[,n]=XX(e,s,t.$pos.pos+4);return n},e7=(s,e,t)=>{const{$anchor:n}=s.selection,i=Math.max(0,n.pos-2),r=s.doc.resolve(i).node();return!(!r||!t.includes(r.type.name))},t7=(s,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==s)},n7=(s,e,t)=>{if(!t)return!1;const n=ii(s,e.schema);let i=!1;return t.descendants(r=>{r.type===n&&(i=!0)}),i},jk=(s,e,t)=>{if(s.commands.undoInputRule())return!0;if(s.state.selection.from!==s.state.selection.to)return!1;if(!Nc(s.state,e)&&e7(s.state,e,t)){const{$anchor:a}=s.state.selection,l=s.state.doc.resolve(a.before()-1),c=[];l.node().descendants((u,f)=>{u.type.name===e&&c.push({node:u,pos:f})});const d=c.at(-1);if(!d)return!1;const h=s.state.doc.resolve(l.start()+d.pos+1);return s.chain().cut({from:a.start()-1,to:a.end()+1},h.end()).joinForward().run()}if(!Nc(s.state,e)||!eZ(s.state))return!1;const n=Sm(e,s.state);if(!n)return!1;const r=s.state.doc.resolve(n.$pos.pos-2).node(n.depth),o=n7(e,s.state,r);return t7(e,s.state)&&!o?s.commands.joinItemBackward():s.chain().liftListItem(e).run()},i7=(s,e)=>{const t=Uk(s,e),n=Sm(s,e);return!n||!t?!1:t>n.depth},s7=(s,e)=>{const t=Uk(s,e),n=Sm(s,e);return!n||!t?!1:t<n.depth},Kk=(s,e)=>{if(!Nc(s.state,e)||!JX(s.state,e))return!1;const{selection:t}=s.state,{$from:n,$to:i}=t;return!t.empty&&n.sameParent(i)?!1:i7(e,s.state)?s.chain().focus(s.state.selection.from+4).lift(e).joinBackward().run():s7(e,s.state)?s.chain().joinForward().joinBackward().run():s.commands.joinItemForward()},cee=(s,e)=>{var t;const{$anchor:n}=e.selection,i=e.doc.resolve(n.pos-n.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==s)},r7=Gt.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{s.state.schema.nodes[t]!==void 0&&Kk(s,t)&&(e=!0)}),e},"Mod-Delete":({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{s.state.schema.nodes[t]!==void 0&&Kk(s,t)&&(e=!0)}),e},Backspace:({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{s.state.schema.nodes[t]!==void 0&&jk(s,t,n)&&(e=!0)}),e},"Mod-Backspace":({editor:s})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:n})=>{s.state.schema.nodes[t]!==void 0&&jk(s,t,n)&&(e=!0)}),e}}}}),dee="listItem",o7="textStyle",a7=/^(\d+)\.\s$/,l7=Ni.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:s=>s.hasAttribute("start")?parseInt(s.getAttribute("start")||"",10):1},type:{default:null,parseHTML:s=>s.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:s}){const{start:e,...t}=s;return e===1?["ol",$t(this.options.HTMLAttributes,t),0]:["ol",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{toggleOrderedList:()=>({commands:s,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dee,this.editor.getAttributes(o7)).run():s.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let s=Ef({find:a7,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(s=Ef({find:a7,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(o7)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[s]}}),hee=/^\s*(\[([( |x])?\])\s$/,uee=Ni.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:s=>{const e=s.getAttribute("data-checked");return e===""||e==="true"},renderHTML:s=>({"data-checked":s.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:s,HTMLAttributes:e}){return["li",$t(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:s.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const s={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...s,Tab:()=>this.editor.commands.sinkListItem(this.name)}:s},addNodeView(){return({node:s,HTMLAttributes:e,getPos:t,editor:n})=>{const i=document.createElement("li"),r=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var h,u;a.ariaLabel=((u=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:u.call(h,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return c(s),r.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=d.target;n.isEditable&&typeof t=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:u})=>{const f=t();if(typeof f!="number")return!1;const g=u.doc.nodeAt(f);return u.setNodeMarkup(f,void 0,{...g?.attrs,checked:h}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(s,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,h])=>{i.setAttribute(d,h)}),i.dataset.checked=s.attrs.checked,a.checked=s.attrs.checked,r.append(a,o),i.append(r,l),Object.entries(e).forEach(([d,h])=>{i.setAttribute(d,h)}),{dom:i,contentDOM:l,update:d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d),!0)}}},addInputRules(){return[Ef({find:hee,type:this.type,getAttributes:s=>({checked:s[s.length-1]==="x"})})]}}),fee=Ni.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:s}){return["ul",$t(this.options.HTMLAttributes,s,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:s})=>s.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Gt.create({name:"listKit",addExtensions(){const s=[];return this.options.bulletList!==!1&&s.push(Q3.configure(this.options.bulletList)),this.options.listItem!==!1&&s.push(J3.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(r7.configure(this.options.listKeymap)),this.options.orderedList!==!1&&s.push(l7.configure(this.options.orderedList)),this.options.taskItem!==!1&&s.push(uee.configure(this.options.taskItem)),this.options.taskList!==!1&&s.push(fee.configure(this.options.taskList)),s}});var c7=Ni.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:s}){return["p",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setParagraph:()=>({commands:s})=>s.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),gee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,pee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,mee=_o.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:s=>s.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:s}){return["s",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setStrike:()=>({commands:s})=>s.setMark(this.name),toggleStrike:()=>({commands:s})=>s.toggleMark(this.name),unsetStrike:()=>({commands:s})=>s.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qd({find:gee,type:this.type})]},addPasteRules(){return[Dc({find:pee,type:this.type})]}}),_ee=Ni.create({name:"text",group:"inline"}),bee=_o.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:s=>s.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:s}){return["u",$t(this.options.HTMLAttributes,s),0]},addCommands(){return{setUnderline:()=>({commands:s})=>s.setMark(this.name),toggleUnderline:()=>({commands:s})=>s.toggleMark(this.name),unsetUnderline:()=>({commands:s})=>s.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function wee(s={}){return new yn({view(e){return new Cee(e,s)}})}class Cee{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let r=o=>{this[i](o)};return e.dom.addEventListener(i,r),{name:i,handler:r}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,r=i.getBoundingClientRect(),o=r.width/i.offsetWidth,a=r.height/i.offsetHeight;if(t){let h=e.nodeBefore,u=e.nodeAfter;if(h||u){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let g=f.getBoundingClientRect(),p=h?g.bottom:g.top;h&&u&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*a;n={left:g.left,right:g.right,top:p-m,bottom:p+m}}}}if(!n){let h=this.editorView.coordsAtPos(this.cursorPos),u=this.width/2*o;n={left:h.left-u,right:h.left+u,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),u=h.width/l.offsetWidth,f=h.height/l.offsetHeight;c=h.left-l.scrollLeft*u,d=h.top-l.scrollTop*f}this.element.style.left=(n.left-c)/o+"px",this.element.style.top=(n.top-d)/a+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,r=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!r){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=WP(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Pn extends je{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Pn.valid(n)?new Pn(n):je.near(n)}content(){return _e.empty}eq(e){return e instanceof Pn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Pn(e.resolve(t.pos))}getBookmark(){return new qk(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!vee(e)||!yee(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Pn.valid(e))return e;let i=e.pos,r=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)<a.childCount:e.index(o)>0){r=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Pn.valid(l))return l}for(;;){let o=t>0?r.firstChild:r.lastChild;if(!o){if(r.isAtom&&!r.isText&&!Be.isSelectable(r)){e=e.doc.resolve(i+r.nodeSize*t),n=!1;continue e}break}r=o,i+=t;let a=e.doc.resolve(i);if(Pn.valid(a))return a}return null}}}Pn.prototype.visible=!1,Pn.findFrom=Pn.findGapCursorFrom,je.jsonID("gapcursor",Pn);class qk{constructor(e){this.pos=e}map(e){return new qk(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Pn.valid(t)?new Pn(t):je.near(t)}}function vee(s){for(let e=s.depth;e>=0;e--){let t=s.index(e),n=s.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function yee(s){for(let e=s.depth;e>=0;e--){let t=s.indexAfter(e),n=s.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function See(){return new yn({props:{decorations:Eee,createSelectionBetween(s,e,t){return e.pos==t.pos&&Pn.valid(t)?new Pn(t):null},handleClick:Lee,handleKeyDown:xee,handleDOMEvents:{beforeinput:kee}}})}const xee=GL({ArrowLeft:Lw("horiz",-1),ArrowRight:Lw("horiz",1),ArrowUp:Lw("vert",-1),ArrowDown:Lw("vert",1)});function Lw(s,e){const t=s=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,r){let o=n.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Ve){if(!r.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=n.doc.resolve(e>0?a.after():a.before())}let c=Pn.findGapCursorFrom(a,e,l);return c?(i&&i(n.tr.setSelection(new Pn(c))),!0):!1}}function Lee(s,e,t){if(!s||!s.editable)return!1;let n=s.state.doc.resolve(e);if(!Pn.valid(n))return!1;let i=s.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&Be.isSelectable(s.state.doc.nodeAt(i.inside))?!1:(s.dispatch(s.state.tr.setSelection(new Pn(n))),!0)}function kee(s,e){if(e.inputType!="insertCompositionText"||!(s.state.selection instanceof Pn))return!1;let{$from:t}=s.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(s.state.schema.nodes.text);if(!n)return!1;let i=te.empty;for(let o=n.length-1;o>=0;o--)i=te.from(n[o].createAndFill(null,i));let r=s.state.tr.replace(t.pos,t.pos,new _e(i,0,0));return r.setSelection(Ve.near(r.doc.resolve(t.pos+1))),s.dispatch(r),!1}function Eee(s){if(!(s.selection instanceof Pn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",hn.create(s.doc,[Ei.widget(s.selection.head,e,{key:"gapcursor"})])}var kw=200,Di=function(){};Di.prototype.append=function(e){return e.length?(e=Di.from(e),!this.length&&e||e.length<kw&&this.leafAppend(e)||this.length<kw&&e.leafPrepend(this)||this.appendInner(e)):this},Di.prototype.prepend=function(e){return e.length?Di.from(e).append(this):this},Di.prototype.appendInner=function(e){return new Nee(this,e)},Di.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Di.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Di.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Di.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Di.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(r,o){return i.push(e(r,o))},t,n),i},Di.from=function(e){return e instanceof Di?e:e&&e.length?new d7(e):Di.empty};var d7=(function(s){function e(n){s.call(this),this.values=n}s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,r){return i==0&&r==this.length?this:new e(this.values.slice(i,r))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,r,o,a){for(var l=r;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,o,a){for(var l=r-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=kw)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=kw)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(Di);Di.empty=new d7([]);var Nee=(function(s){function e(t,n){s.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,r,o){var a=this.left.length;if(i<a&&this.left.forEachInner(n,i,Math.min(r,a),o)===!1||r>a&&this.right.forEachInner(n,Math.max(i-a,0),Math.min(this.length,r)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,r,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(n,i-a,Math.max(r,a)-a,o+a)===!1||r<a&&this.left.forEachInvertedInner(n,Math.min(i,a),r,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var r=this.left.length;return i<=r?this.left.slice(n,i):n>=r?this.right.slice(n-r,i-r):this.left.slice(n,r).append(this.right.slice(0,i-r))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(Di);const Dee=500;class wo{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,r;t&&(i=this.remapping(n,this.items.length),r=i.maps.length);let o=e.tr,a,l,c=[],d=[];return this.items.forEach((h,u)=>{if(!h.step){i||(i=this.remapping(n,u+1),r=i.maps.length),r--,d.push(h);return}if(i){d.push(new ta(h.map));let f=h.step.map(i.slice(r)),g;f&&o.maybeStep(f).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],c.push(new ta(g,void 0,void 0,c.length+d.length))),r--,g&&i.appendMap(g,r)}else o.maybeStep(h.step);if(h.selection)return a=i?h.selection.map(i.slice(r)):h.selection,l=new wo(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,n,i){let r=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),u=new ta(e.mapping.maps[d],h,t),f;(f=l&&l.merge(u))&&(u=f,d?r.pop():a=a.slice(0,a.length-1)),r.push(u),t&&(o++,t=void 0),i||(l=u)}let c=o-n.depth;return c>Iee&&(a=Tee(a,c),o-=c),new wo(a.append(r),o)}remapping(e,t){let n=new Xp;return this.items.forEach((i,r)=>{let o=i.mirrorOffset!=null&&r-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new wo(this.items.append(e.map(t=>new ta(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),r=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(u=>{u.selection&&a--},i);let l=t;this.items.forEach(u=>{let f=r.getMirror(--l);if(f==null)return;o=Math.min(o,f);let g=r.maps[f];if(u.step){let p=e.steps[f].invert(e.docs[f]),m=u.selection&&u.selection.map(r.slice(l+1,f));m&&a++,n.push(new ta(g,p,m))}else n.push(new ta(g))},i);let c=[];for(let u=t;u<o;u++)c.push(new ta(r.maps[u]));let d=this.items.slice(0,i).append(c).append(n),h=new wo(d,a);return h.emptyItemCount()>Dee&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],r=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&r++;else if(o.step){let l=o.step.map(t.slice(n)),c=l&&l.getMap();if(n--,c&&t.appendMap(c,n),l){let d=o.selection&&o.selection.map(t.slice(n));d&&r++;let h=new ta(c.invert(),l,d),u,f=i.length-1;(u=i.length&&i[f].merge(h))?i[f]=u:i.push(h)}}else o.map&&n--},this.items.length,0),new wo(Di.from(i.reverse()),r)}}wo.empty=new wo(Di.empty,0);function Tee(s,e){let t;return s.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),s.slice(t)}class ta{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ta(t.getMap().invert(),t,this.selection)}}}class Ac{constructor(e,t,n,i,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=r}}const Iee=20;function Mee(s,e,t,n){let i=t.getMeta(Zd),r;if(i)return i.historyState;t.getMeta(Oee)&&(s=new Ac(s.done,s.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return s;if(o&&o.getMeta(Zd))return o.getMeta(Zd).redo?new Ac(s.done.addTransform(t,void 0,n,Ew(e)),s.undone,h7(t.mapping.maps),s.prevTime,s.prevComposition):new Ac(s.done,s.undone.addTransform(t,void 0,n,Ew(e)),null,s.prevTime,s.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=s.prevTime==0||!o&&s.prevComposition!=a&&(s.prevTime<(t.time||0)-n.newGroupDelay||!Ree(t,s.prevRanges)),c=o?Gk(s.prevRanges,t.mapping):h7(t.mapping.maps);return new Ac(s.done.addTransform(t,l?e.selection.getBookmark():void 0,n,Ew(e)),wo.empty,c,t.time,a??s.prevComposition)}else return(r=t.getMeta("rebased"))?new Ac(s.done.rebased(t,r),s.undone.rebased(t,r),Gk(s.prevRanges,t.mapping),s.prevTime,s.prevComposition):new Ac(s.done.addMaps(t.mapping.maps),s.undone.addMaps(t.mapping.maps),Gk(s.prevRanges,t.mapping),s.prevTime,s.prevComposition)}function Ree(s,e){if(!e)return!1;if(!s.docChanged)return!0;let t=!1;return s.mapping.maps[0].forEach((n,i)=>{for(let r=0;r<e.length;r+=2)n<=e[r+1]&&i>=e[r]&&(t=!0)}),t}function h7(s){let e=[];for(let t=s.length-1;t>=0&&e.length==0;t--)s[t].forEach((n,i,r,o)=>e.push(r,o));return e}function Gk(s,e){if(!s)return null;let t=[];for(let n=0;n<s.length;n+=2){let i=e.map(s[n],1),r=e.map(s[n+1],-1);i<=r&&t.push(i,r)}return t}function Aee(s,e,t){let n=Ew(e),i=Zd.get(e).spec.config,r=(t?s.undone:s.done).popEvent(e,n);if(!r)return null;let o=r.selection.resolve(r.transform.doc),a=(t?s.done:s.undone).addTransform(r.transform,e.selection.getBookmark(),i,n),l=new Ac(t?a:r.remaining,t?r.remaining:a,null,0,-1);return r.transform.setSelection(o).setMeta(Zd,{redo:t,historyState:l})}let Yk=!1,u7=null;function Ew(s){let e=s.plugins;if(u7!=e){Yk=!1,u7=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Yk=!0;break}}return Yk}const Zd=new Gn("history"),Oee=new Gn("closeHistory");function Pee(s={}){return s={depth:s.depth||100,newGroupDelay:s.newGroupDelay||500},new yn({key:Zd,state:{init(){return new Ac(wo.empty,wo.empty,null,0,-1)},apply(e,t,n){return Mee(t,n,e,s)}},config:s,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?g7:n=="historyRedo"?p7:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function f7(s,e){return(t,n)=>{let i=Zd.getState(t);if(!i||(s?i.undone:i.done).eventCount==0)return!1;if(n){let r=Aee(i,t,s);r&&n(e?r.scrollIntoView():r)}return!0}}const g7=f7(!1,!0),p7=f7(!0,!0);Gt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:s=>s.length,wordCounter:s=>s.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=s=>{const e=s?.node||this.editor.state.doc;if((s?.mode||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=s=>{const e=s?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let s=!1;return[new yn({key:new Gn("characterCount"),appendTransaction:(e,t,n)=>{if(s)return;const i=this.options.limit;if(i==null||i===0){s=!0;return}const r=this.storage.characters({node:n.doc});if(r>i){const o=r-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=n.tr.deleteRange(a,l);return s=!0,c}s=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const i=this.storage.characters({node:t.doc}),r=this.storage.characters({node:e.doc});if(r<=n||i>n&&r>n&&r<=i)return!0;if(i>n&&r>n&&r>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=r-n,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>n)}})]}});var Fee=Gt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[wee(this.options)]}});Gt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new yn({key:new Gn("focus"),props:{decorations:({doc:s,selection:e})=>{const{isEditable:t,isFocused:n}=this.editor,{anchor:i}=e,r=[];if(!t||!n)return hn.create(s,[]);let o=0;this.options.mode==="deepest"&&s.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;o+=1});let a=0;return s.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";r.push(Ei.node(c,c+l.nodeSize,{class:this.options.className}))}),hn.create(s,r)}}})]}});var Bee=Gt.create({name:"gapCursor",addProseMirrorPlugins(){return[See()]},extendNodeSchema(s){var e;const t={name:s.name,options:s.options,storage:s.storage};return{allowGapCursor:(e=Wt(Pe(s,"allowGapCursor",t)))!=null?e:null}}});Gt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new yn({key:new Gn("placeholder"),props:{decorations:({doc:s,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const r=this.editor.isEmpty;return s.descendants((o,a)=>{const l=n>=a&&n<=a+o.nodeSize,c=!o.isLeaf&&A0(o);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];r&&d.push(this.options.emptyEditorClass);const h=Ei.node(a,a+o.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:l}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),hn.create(s,i)}}})]}}),Gt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:s,options:e}=this;return[new yn({key:new Gn("selection"),props:{decorations(t){return t.selection.empty||s.isFocused||!s.isEditable||G5(t.selection)||s.view.dragging?null:hn.create(t.doc,[Ei.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function m7({types:s,node:e}){return e&&Array.isArray(s)&&s.includes(e.type)||e?.type===s}var Vee=Gt.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){const s=new Gn(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>(this.options.notAfter||[]).concat(this.options.node).includes(t.name));return[new yn({key:s,appendTransaction:(t,n,i)=>{const{doc:r,tr:o,schema:a}=i,l=s.getState(i),c=r.content.size,d=a.nodes[this.options.node];if(l)return o.insert(c,d.create())},state:{init:(t,n)=>{const i=n.tr.doc.lastChild;return!m7({node:i,types:e})},apply:(t,n)=>{if(!t.docChanged)return n;const i=t.doc.lastChild;return!m7({node:i,types:e})}}})]}}),Wee=Gt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:s,dispatch:e})=>g7(s,e),redo:()=>({state:s,dispatch:e})=>p7(s,e)}},addProseMirrorPlugins(){return[Pee(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Hee=Gt.create({name:"starterKit",addExtensions(){var s,e,t,n;const i=[];return this.options.bold!==!1&&i.push(CJ.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(pJ.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Q3.configure(this.options.bulletList)),this.options.code!==!1&&i.push(SJ.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(kJ.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(EJ.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Fee.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Bee.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(NJ.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(M3.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Wee.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(DJ.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(AJ.configure(this.options.italic)),this.options.listItem!==!1&&i.push(J3.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(r7.configure((s=this.options)==null?void 0:s.listKeymap)),this.options.link!==!1&&i.push(Y3.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(l7.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(c7.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(mee.configure(this.options.strike)),this.options.text!==!1&&i.push(_ee.configure(this.options.text)),this.options.underline!==!1&&i.push(bee.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&i.push(Vee.configure((n=this.options)==null?void 0:n.trailingNode)),i}}),zee=Hee,$ee=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Uee=Ni.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:s}){return["img",$t(this.options.HTMLAttributes,s)]},addCommands(){return{setImage:s=>({commands:e})=>e.insertContent({type:this.name,attrs:s})}},addInputRules(){return[a3({find:$ee,type:this.type,getAttributes:s=>{const[,,e,t,n]=s;return{src:t,alt:e,title:n}}})]}}),jee=Gt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:s=>{const e=s.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:s=>s.textAlign?{style:`text-align: ${s.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:s=>({commands:e})=>this.options.alignments.includes(s)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:s})).every(t=>t):!1,unsetTextAlign:()=>({commands:s})=>this.options.types.map(e=>s.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:s=>({editor:e,commands:t})=>this.options.alignments.includes(s)?e.isActive({textAlign:s})?t.unsetTextAlign():t.setTextAlign(s):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const Kee=async s=>{try{const e=new FormData;return e.append("unique","true"),e.append("file",s),(await(await fetch("/file/upload/uploads?id=&form=&table=",{method:"POST",body:e})).json())?.result}catch(e){console.error(e)}},qee=async(s,e)=>{const t=e.clipboardData?.items;if(t){const n=e.clipboardData?.getData("text/html"),i=e.clipboardData?.getData("text/plain");if(n){const{state:r,dispatch:o}=s,{tr:a}=r,l=gf.fromSchema(s.state.schema),c=new DOMParser().parseFromString(n,"text/html").body,d=l.parse(c),h=a.replaceSelectionWith(d);return o(h),e.preventDefault(),!0}if(i){const{state:r,dispatch:o}=s,{tr:a}=r,l=a.insertText(i,r.selection.from,r.selection.to);return o(l),e.preventDefault(),!0}for(let r=0;r<t.length;r++){const o=t[r];if(o.type.startsWith("image/")){const a=o.getAsFile();if(a){const l=await Kee(a),{schema:c}=s.state,d=c.nodes.image.create({src:l?.file_path}),h=s.state.tr.replaceSelectionWith(d);return s.dispatch(h),e.preventDefault(),!0}}}}return!1},Gee={1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"},Yee=M3.extend({addOptions(){return{...this.parent?.(),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){return{...this.parent?.(),level:{default:1,renderHTML:s=>{const e=s.level||1;return{class:`heading-level-${e}`,style:Gee[e-1]}}}}}}),Xee=c7.configure({HTMLAttributes:{style:"min-height: 1rem;"}}),Zee=uk.extend({addAttributes(){return{...this.parent?.(),fontFamily:{default:null,parseHTML:s=>s.style.fontFamily?.replace(/['"]/g,""),renderHTML:s=>s.fontFamily?{style:`font-family: ${s.fontFamily}`}:{}}}},addCommands(){return{setFontFamily:s=>({chain:e})=>e().setMark("textStyle",{fontFamily:s}).run(),unsetFontFamily:()=>({chain:s})=>s().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),Qee=uk.extend({addAttributes(){return{...this.parent?.(),fontSize:{default:null,parseHTML:s=>s.style.fontSize?.replace(/['"]/g,""),renderHTML:s=>s.fontSize?{style:`font-size: ${s.fontSize}`}:{}}}},addCommands(){return{setFontSize:s=>({chain:e})=>e().setMark("textStyle",{fontSize:s}).run(),unsetFontSize:()=>({chain:s})=>s().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}});function Jee(s){let e=!1;const t=qZ({content:s.modelValue,extensions:[zee.configure({history:{depth:100,newGroupDelay:500},code:{HTMLAttributes:{class:"editor-code"}},codeBlock:{HTMLAttributes:{class:"editor-codeblock"}},paragraph:!1,heading:!1,link:!1}),fJ,uJ,tQ,Zee,Qee,Xee,Yee,hJ,Uee,jee.configure({types:["heading","paragraph"]}),Y3.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0}),lJ.configure({table:{HTMLAttributes:{class:"editor-content"},resizable:!0}})],editorProps:{handlePaste:qee,handleKeyDown:(r,o)=>{if(o.key==="Tab"){o.preventDefault();const{state:a,dispatch:l}=r,{selection:c}=a,d=a.tr.insertText(" ");return l(d),!0}return!1}}}),n=y.computed(()=>t.value||null);return y.watch(t,r=>{r&&t.value.on("update",o=>{if(!e){e=!0;const a=o.editor.getHTML();s.modelValue,setTimeout(()=>{e=!1},10)}})}),{editor:t,editorInstance:n,focusEditor:()=>{t.value&&!t.value.isFocused&&t.value.commands.focus()}}}function ete(s,e){const t=y.ref(!1),n=y.ref(""),i=y.ref(null);return{isHtmlMode:t,htmlContent:n,htmlTextarea:i,toggleHtmlMode:a=>{t.value=a,a?(s.value&&(n.value=s.value.getHTML()),y.nextTick(()=>{i.value&&(i.value.focus(),setTimeout(()=>{i.value.formatCode()},100))})):s.value&&n.value&&s.value.commands.setContent(n.value,!0)},onHtmlInput:a=>{n.value=a,e&&e("update:modelValue",a)}}}function tte(){const s=y.ref(!1);return{isFullscreen:s,toggleFullscreen:()=>{s.value=!s.value}}}const wn=(s,e)=>{const t=s.__vccOpts||s;for(const[n,i]of e)t[n]=i;return t},nte={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function ite(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Blockquote",onClick:e[0]||(e[0]=(...o)=>r.toggleBlockquote&&r.toggleBlockquote(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)])])}const ste=wn(nte,[["render",ite]]),rte={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function ote(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Bullet List",onClick:e[0]||(e[0]=(...o)=>r.toggleBulletList&&r.toggleBulletList(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)])])}const ate=wn(rte,[["render",ote]]),lte={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function cte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Ordered List",onClick:e[0]||(e[0]=(...o)=>r.toggleOrderedList&&r.toggleOrderedList(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)])])}const dte=wn(lte,[["render",cte]]),hte={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function ute(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Code Block",onClick:e[0]||(e[0]=(...o)=>r.toggleCodeBlock&&r.toggleCodeBlock(...o)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)])])}const fte=wn(hte,[["render",ute]]),gte={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.commands.toggleBold()}}};function pte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Bold Text",onClick:e[0]||(e[0]=(...o)=>r.toggleBold&&r.toggleBold(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("bold")}])},[...e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),y.createElementVNode("span",{class:"sr-only"},"Bold",-1)])],2)}const mte=wn(gte,[["render",pte]]),_te={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function bte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Italic Text",onClick:e[0]||(e[0]=(...o)=>r.toggleItalic&&r.toggleItalic(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("italic")}])},[...e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),y.createElementVNode("span",{class:"sr-only"},"Italic",-1)])],2)}const wte=wn(_te,[["render",bte]]),Cte={__name:"vs-editor-underline",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Underline",onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),y.createElementVNode("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)])],2))}},vte={__name:"vs-editor-strike",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Strikethrough",onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M5 12l14 0"}),y.createElementVNode("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)])],2))}},yte={props:{visible:{type:Boolean,default:()=>!1},modelValue:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","update:modelValue","onClose","confirm","cancel"],inheritAttrs:!1,name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){return!!this.$slots?.footer},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:s}){s==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("update:modelValue",!1),this.$emit("onClose")},handleConfirm(){this.$emit("confirm"),this.handleClose()},handleCancel(){this.$emit("cancel"),this.handleClose()},closeByClickBack(s,e){e&&s.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},Ste={key:0,class:"vsTailwind ui-dialog__wrapper"},xte={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Lte={class:"font-medium text-gray-800 dark:text-[#ffffff]"},kte={class:"ui-dialog__content p-4"},Ete={key:0,class:"flex justify-end gap-x-2"};function Nte(s,e,t,n,i,r){return y.openBlock(),y.createBlock(y.Teleport,{to:"body"},[t.visible||t.modelValue?(y.openBlock(),y.createElementBlock("div",Ste,[y.createElementVNode("div",{onMousedown:e[1]||(e[1]=o=>r.closeByClickBack(o,t.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[100001] bg-black bg-opacity-50"},[y.createVNode(y.Transition,{name:"content",appear:""},{default:y.withCtx(()=>[y.createElementVNode("div",{class:y.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[r.checkSize]])},[y.createElementVNode("div",xte,[y.createElementVNode("h3",Lte,y.toDisplayString(t.title),1),y.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...o)=>r.handleClose&&r.handleClose(...o))},[...e[2]||(e[2]=[y.createElementVNode("span",{class:"sr-only"},"Close",-1),y.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M18 6 6 18"}),y.createElementVNode("path",{d:"m6 6 12 12"})],-1)])])]),y.createElementVNode("div",kte,[y.renderSlot(s.$slots,"default",{},void 0,!0)]),r.hasSlot?(y.openBlock(),y.createElementBlock("div",Ete,[y.renderSlot(s.$slots,"footer",{handleClose:r.handleClose,handleConfirm:r.handleConfirm,handleCancel:r.handleCancel},void 0,!0)])):y.createCommentVNode("",!0)],2)]),_:3})],32)])):y.createCommentVNode("",!0)])}const _7=wn(yte,[["render",Nte],["__scopeId","data-v-6d0970a6"]]),Dte={},Tte={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function Ite(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Tte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),y.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])])}const Mte=wn(Dte,[["render",Ite]]),Rte={},Ate={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function Ote(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Ate,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),y.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)])])}const Pte=wn(Rte,[["render",Ote]]),Fte={},Bte={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function Vte(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",Bte,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),y.createElementVNode("path",{d:"M3 7l9 6l9 -6"},null,-1)])])}const Wte=wn(Fte,[["render",Vte]]),Hte=y.defineComponent({components:{IconClose:Mte,IconSearch:Pte,IconEmail:Wte},inheritAttrs:!1,props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){if((this.style?.size||this.size)==="xs")return"h-[32px] text-sm";if((this.style?.size||this.size)==="md")return"h-[38px] text-sm";this.style?.size||this.size},value:{get(){return this.modelValue},set(s){this.$emit("update:modelValue",s.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:s}=await this.$refs;await s.focus()}}}),zte={class:"vs-form-text relative bg-white rounded-lg"},$te={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},Ute=["disabled","type","placeholder"];function jte(s,e,t,n,i,r){const o=y.resolveComponent("IconClose"),a=y.resolveComponent("IconSearch"),l=y.resolveComponent("IconEmail");return y.openBlock(),y.createElementBlock("div",zte,[s.clearable&&s.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>s.clearInput&&s.clearInput(...c))},[y.createVNode(o,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),s.icon&&s.icon==="search"?(y.openBlock(),y.createElementBlock("div",{key:1,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",s.iconStylePosition])},[y.createVNode(a,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):s.icon&&s.icon==="email"?(y.openBlock(),y.createElementBlock("div",$te,[y.createVNode(l,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(y.openBlock(),y.createElementBlock("i",{key:3,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+s.icon,s.iconStylePosition]])},null,2)),s.clearable&&s.value?(y.openBlock(),y.createElementBlock("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...c)=>s.clearInput&&s.clearInput(...c))},[y.createVNode(o,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("input",y.mergeProps({ref:"vsText",disabled:s.disabled,type:s.type,onInput:e[2]||(e[2]=(...c)=>s.handleInput&&s.handleInput(...c)),placeholder:s.placeholder,"onUpdate:modelValue":e[3]||(e[3]=c=>s.value=c)},s.style?.attrs||s.attrs||{},{onFocus:e[4]||(e[4]=(...c)=>s.handleFocus&&s.handleFocus(...c)),onBlur:e[5]||(e[5]=(...c)=>s.handleBlur&&s.handleBlur(...c)),class:[[s.inputStyle,s.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,Ute),[[y.vModelDynamic,s.value]])])}const b7=wn(Hte,[["render",jte],["__scopeId","data-v-749b581f"]]);function Xk(){const s=y.ref("en");return{t:t=>({en:{type_tag:"Type Tag",heading_1:"Heading 1",heading_2:"Heading 2",heading_3:"Heading 3",paragraph:"Paragraph",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",mergeCells:"Merge Cells",splitCells:"Split Cells",linkTitle:"Enter Link"},uk:{type_tag:"Тип тегу",heading_1:"Заголовок 1",heading_2:"Заголовок 2",heading_3:"Заголовок 3",paragraph:"Параграф",createTable:"Створити Таблицю",addColumn:"Додати Колону",addRow:"Додати Рядок",deleteColumn:"Вилучити Колону",deleteRow:"Вилучити Рядок",deleteTable:"Вилучити Таблицю",mergeCells:"Об'єднати Клітинки",splitCells:"Розділити Клітинки",linkTitle:"Введіть Посилання"}})[s.value]?.[t]||t,locale:s}}const Kte={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},qte=Object.assign({inheritAttrs:!1},{__name:"vs-editor-link",props:{editor:Object},setup(s){const{t:e}=Xk(),t=s,n=y.ref(!1),i=y.ref(""),r=()=>{t.editor.chain().focus().toggleLink({href:i.value}).run(),n.value=!1,i.value=""};return(o,a)=>(y.openBlock(),y.createElementBlock(y.Fragment,null,[y.createElementVNode("button",{title:"Link",onClick:a[0]||(a[0]=l=>n.value=!0),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...a[4]||(a[4]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])]),y.createVNode(_7,{title:y.unref(e)("linkTitle"),visible:n.value,"onUpdate:visible":a[3]||(a[3]=l=>n.value=l),size:"small"},{footer:y.withCtx(()=>[y.createElementVNode("div",Kte,[y.createElementVNode("button",{style:{border:"1px solid #000"},onClick:a[2]||(a[2]=l=>{n.value=!1,i.value=""}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},y.toDisplayString(y.unref(e)("cancel")),1),y.createElementVNode("button",{onClick:r,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},y.toDisplayString(y.unref(e)("create")),1)])]),default:y.withCtx(()=>[y.createVNode(b7,{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=l=>i.value=l),placeholder:y.unref(e)("linkTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["title","visible"])],64))}}),xm=async(s,e,t,n=10)=>{if(!e||!t)return;await y.nextTick();const i=await t?.getBoundingClientRect(),r=await e?.getBoundingClientRect();if(!r||!i)return;const o=await parseInt(e?.getBoundingClientRect()?.height),a=await parseInt(e?.getBoundingClientRect()?.width),l=await parseInt(t?.getBoundingClientRect()?.height),c=await parseInt(t?.getBoundingClientRect()?.width),d=await window.innerHeight,h=await window.innerWidth;let u=0,f=0;const g=r.bottom+n+l;switch(s){case"top":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,h>c+r.right+30?f=r.left-i.width/2+r.width/2:f=h-30-c;break;case"bottom":d>g?u=r.bottom+n:u=r.bottom-n-l-o,f=r.left-i.width/2+r.width/2;break;case"left":u=r.top-i.height/2+r.height/2,r.left-i.width-n>0?f=r.left-i.width-n:f=10;break;case"right":u=r.top-i.height/2+r.height/2,h-a>c?f=r.right+n:f=h-30-c;break;case"top-right":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,h-a>c?f=r.right+n:f=h-30-c;break;case"top-left":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,r.left-i.width-n>0?f=r.left-i.width-n:f=10;break;case"top-start":r.top-i.height-n<0?u=r.top-i.height+n+l+o:u=r.top-i.height-n,r.left>0?f=r.left:f=10;break;case"bottom-right":d>g?u=r.bottom+n:u=r.bottom-n-l-o,h-a>c?f=r.left:f=h-30-c;break;case"bottom-left":d>g?u=r.bottom+n:u=r.bottom-n-l-o,r.left>0?f=r.right-c:f=10;break;case"bottom-start":d>g?u=r.bottom+n:u=r.bottom-n-l-o,r.left>0?f=r.left:f=10;break}u+l>d?u=d-l-n:u<0&&(u=n),f+c>h?f=h-c-n:f<0&&(f=n),t instanceof HTMLElement&&(t.style.top=`${u}px`,t.style.left=`${f}px`,t.style.position="fixed")},Gte={class:"text-center"},Yte={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Oc=Object.assign({inheritAttrs:!1},{__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"body"}},emits:["isvisible"],setup(s,{expose:e,emit:t}){const n=s,i=t,r=y.ref(!1),o=y.ref([]),a=y.ref(null),l=y.ref(null),c=y.ref(null);y.watch(r,C=>{C?(d(),window.addEventListener("resize",()=>xm(n.placement,l.value,c.value)),xm(n.placement,l.value,c.value)):window.removeEventListener("resize",()=>xm(n.placement,l.value,c.value)),i("isvisible",C)}),y.onMounted(()=>{window.addEventListener("click",m),window.addEventListener("popstate",b),window.addEventListener("scroll",w,!0),d()}),y.onBeforeUnmount(()=>{window.removeEventListener("click",m),window.removeEventListener("popstate",b),h()});const d=()=>{let C=a.value;for(;C&&C!==document.body;)(C.scrollHeight>C.clientHeight||C.scrollWidth>C.clientWidth)&&(C.addEventListener("scroll",p),o.value.push(C)),C=C.parentElement;document.body&&(document.body.addEventListener("scroll",p),o.value.push(document.body))},h=()=>{o.value.forEach(C=>{C.removeEventListener("scroll",p)}),o.value=[]},u=()=>{r.value=!0,xm(n.placement,l.value,c.value)},f=()=>{r.value=!1},g=async()=>{await xm(n.placement,l.value,c.value),r.value=!r.value},p=()=>{r.value=!1},m=C=>{if(!C){r.value=!1;return}l.value?.contains(C.target)||c.value?.contains(C.target)||(r.value=!1)},b=()=>{r.value&&(r.value=!1)},w=C=>{r.value&&c.value&&!c.value.contains(C.target)&&(r.value=!1)};return e({togglePopover:g}),(C,v)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"popover",ref:a,class:"vs-popover inline-block"},[y.createElementVNode("div",Gte,[s.trigger==="click"?(y.openBlock(),y.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:g,class:y.normalizeClass({"pointer-events-none":s.disabled})},[y.renderSlot(C.$slots,"reference",{},()=>[v[0]||(v[0]=y.createElementVNode("button",null,"Click me!",-1))])],2)):y.createCommentVNode("",!0),s.trigger==="hover"?(y.openBlock(),y.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:u,onMouseleave:f,class:y.normalizeClass({"pointer-events-none":s.disabled})},[y.renderSlot(C.$slots,"reference",{},()=>[v[1]||(v[1]=y.createElementVNode("button",null,"Click me!",-1))])],34)):y.createCommentVNode("",!0),(y.openBlock(),y.createBlock(y.Teleport,{to:s.teleport},[y.createVNode(y.Transition,{name:"fade"},{default:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["vsTailwind vs-popover__content",s.placement]),ref_key:"contentPop",ref:c,style:y.normalizeStyle({width:s.width?s.width+"px":"fit-content",zIndex:100001})},[y.createElementVNode("div",Yte,[y.renderSlot(C.$slots,"default",{},()=>[v[2]||(v[2]=y.createElementVNode("span",null,"Popover content",-1))])])],6),[[y.vShow,r.value]])]),_:3})],8,["to"]))])],512))}}),Xte={class:"flex flex-col gap-[2px] p-[2px]"},Zte=["onClick"],Qte={__name:"vs-editor-table",props:{editor:Object},setup(s){const{t:e}=Xk(),t=s,n=y.ref(!1),i=y.ref("popover"),r=()=>{t.editor&&(t.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),i.value.togglePopover())},o=()=>{t.editor&&(t.editor.chain().focus().addColumnAfter().run(),i.value.togglePopover())},a=()=>{t.editor&&(t.editor.chain().focus().addRowAfter().run(),i.value.togglePopover())},l=()=>{t.editor&&(t.editor.chain().focus().deleteColumn().run(),i.value.togglePopover())},c=()=>{t.editor&&(t.editor.chain().focus().deleteRow().run(),i.value.togglePopover())},d=()=>{t.editor&&(t.editor.chain().focus().deleteTable().run(),i.value.togglePopover())},h=()=>{t.editor&&(t.editor.chain().focus().mergeCells().run(),i.value.togglePopover())},u=()=>{t.editor&&(t.editor.chain().focus().splitCell().run(),i.value.togglePopover())},f=y.computed(()=>[{text:e("createTable"),function:r},{text:e("addColumn"),function:o},{text:e("addRow"),function:a},{text:e("deleteColumn"),function:l},{text:e("deleteRow"),function:c},{text:e("deleteTable"),function:d},{text:e("mergeCells"),function:h},{text:e("splitCells"),function:u}]);return(g,p)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:i,placement:"bottom",onIsvisible:p[0]||(p[0]=m=>n.value=m)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Table",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...p[1]||(p[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),y.createElementVNode("path",{d:"M3 10h18"}),y.createElementVNode("path",{d:"M10 3v18"})],-1)])],2)]),default:y.withCtx(()=>[y.createElementVNode("div",Xte,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(f.value,(m,b)=>(y.openBlock(),y.createElementBlock("button",{key:b,onClick:m?.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},y.toDisplayString(m.text),9,Zte))),128))])]),_:1},512))}},Jte={},ene={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function tne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",ene,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M8 12l8 0"},null,-1),y.createElementVNode("path",{d:"M6 18l12 0"},null,-1)])])}const nne=wn(Jte,[["render",tne]]),ine={},sne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function rne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",sne,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M10 12l10 0"},null,-1),y.createElementVNode("path",{d:"M6 18l14 0"},null,-1)])])}const one=wn(ine,[["render",rne]]),ane={},lne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function cne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",lne,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M4 12l10 0"},null,-1),y.createElementVNode("path",{d:"M4 18l14 0"},null,-1)])])}const dne=wn(ane,[["render",cne]]),hne={},une={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-justify"};function fne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",une,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6h16"},null,-1),y.createElementVNode("path",{d:"M4 12h16"},null,-1),y.createElementVNode("path",{d:"M4 18h16"},null,-1)])])}const w7={left:dne,center:nne,right:one,justify:wn(hne,[["render",fne]])},gne={class:"flex gap-[4px] p-1"},pne=["title","onClick"],mne={__name:"vs-editor-align",props:{editor:Object},setup(s){const e=s,t=y.ref(!1),n=y.ref("popover"),i=y.ref("left"),r=y.computed(()=>e.editor?.isActive("left")),o=y.computed(()=>e.editor?.isActive("right")),a=y.computed(()=>e.editor?.isActive("center")),l=y.computed(()=>e.editor?.isActive("justify")),c=h=>{e.editor&&e.editor.chain().focus().setTextAlign(h).run()},d=y.ref([{id:"left",isActive:r},{id:"center",isActive:a},{id:"right",isActive:o},{id:"justify",isActive:l}]);return(h,u)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:n,placement:"bottom",onIsvisible:u[0]||(u[0]=f=>t.value=f)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Text Align",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[t.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(w7)[i.value]),{height:"16",width:"16"}))],2)]),default:y.withCtx(()=>[y.createElementVNode("div",gne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(d.value,f=>(y.openBlock(),y.createElementBlock("button",{title:"Text align "+f?.id,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":f?.isActive}]),key:f?.id,onClick:g=>c(f?.id)},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(w7)[f?.id]),{height:"16",width:"16"}))],10,pne))),128))])]),_:1},512))}},_ne={class:"flex flex-col gap-[2px] p-[2px]"},bne=["onClick"],wne={__name:"vs-editor-type-tag",props:{editor:Object},setup(s){const{t:e}=Xk(),t=s,n=y.ref(!1),i=y.ref("popover"),r=()=>{t.editor&&(t.editor?.chain().focus().setParagraph().run(),i.value.togglePopover())},o=l=>{t.editor&&(t.editor?.chain().focus().toggleHeading({level:l}).run(),i.value.togglePopover())},a=y.computed(()=>[{text:e("richtext.heading1"),id:1,style:"font-[700] text-[30px]"},{text:e("richtext.heading2"),id:2,style:"font-[700] text-[26px]"},{text:e("richtext.heading3"),id:3,style:"font-[700] text-[22px]"},{text:e("richtext.heading4"),id:4,style:"font-[700] text-[18px]"},{text:e("richtext.heading5"),id:5,style:"font-[500] text-[16px]"},{text:e("richtext.heading6"),id:6,style:"font-[400] text-[14px]"}]);return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:i,placement:"bottom",onIsvisible:c[0]||(c[0]=d=>n.value=d)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Type Tag",class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[...c[1]||(c[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 7v-2h13v2"}),y.createElementVNode("path",{d:"M10 5v14"}),y.createElementVNode("path",{d:"M12 19h-4"}),y.createElementVNode("path",{d:"M15 13v-1h6v1"}),y.createElementVNode("path",{d:"M18 12v7"}),y.createElementVNode("path",{d:"M17 19h2"})],-1)])],2)]),default:y.withCtx(()=>[y.createElementVNode("div",_ne,[y.createElementVNode("button",{onClick:r,class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[s.editor?.isActive("paragraph")?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)("richtext.paragraph")),3),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(a.value,(d,h)=>(y.openBlock(),y.createElementBlock("button",{key:h,onClick:u=>o(d?.id),class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[d?.style,s.editor?.isActive("heading",{level:d?.id})?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)(`richtext.heading${d?.id}`)),11,bne))),128))])]),_:1},512))}},Cne={},vne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function yne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("svg",vne,[...e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)])])}const Lm=wn(Cne,[["render",yne]]),Sne={components:{VsText:b7},inheritAttrs:!1,events:["update:modelValue"],props:{modelValue:{type:String},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(s){this.$emit("update:modelValue",s)}}}},xne={class:"flex items-center w-full max-w-[182px]"},Lne=["disabled"];function kne(s,e,t,n,i,r){const o=y.resolveComponent("vs-text");return y.openBlock(),y.createElementBlock("div",xne,[y.withDirectives(y.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"color",class:y.normalizeClass(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",t.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:t.disabled},null,10,Lne),[[y.vModelText,r.value]]),t.isTextInputShown?(y.openBlock(),y.createBlock(o,{key:0,modelValue:r.value,"onUpdate:modelValue":e[1]||(e[1]=a=>r.value=a),class:"ml-2 w-full",disabled:t.disabled,clearable:t.clearable},null,8,["modelValue","disabled","clearable"])):y.createCommentVNode("",!0)])}const C7=wn(Sne,[["render",kne]]),Ene={title:"Text Color",class:"flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},Nne={class:"flex gap-[4px] mb-[8px]"},Dne={class:"grid grid-rows-3 grid-cols-7"},Tne={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},Ine=["onClick","title"],Mne={__name:"vs-editor-color",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("#000000"),i=y.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),r=l=>{e.editor&&(e.editor.chain().focus().setColor(l).run(),n.value=l,t.value&&t.value.togglePopover())},o=()=>{r(n.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple","#FFFFFF":"White","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",Ene,[c[1]||(c[1]=y.createElementVNode("span",{class:"leading-none"},"A",-1)),y.createElementVNode("span",{class:"block h-1 w-5",style:y.normalizeStyle({backgroundColor:n.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("div",Nne,[y.createVNode(C7,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:o,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(Lm,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("div",Dne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,d=>(y.openBlock(),y.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[y.createElementVNode("div",Tne,[y.createElementVNode("button",{class:"flex items-center justify-center w-full h-full",style:y.normalizeStyle({backgroundColor:d}),onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],12,Ine)])]))),128))])])]),_:1},512))}},Rne={title:"Background Color",class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},Ane={class:"flex gap-[4px] mb-[8px]"},One={class:"grid grid-rows-3 grid-cols-7"},Pne={class:"w-full h-full rounded border border-gray-300 overflow-hidden"},Fne=["onClick","title"],Bne=["onClick","title"],Vne={__name:"vs-editor-background-color",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("transparent"),i=y.ref(["#172B4D","#0747A6","#008DA6","#006644","#FF991F","#BF2600","#403294","#97A0AF","#4C9AFF","#00B8D9","#36B37E","#FFC400","#FF5630","#6554C0","#FFFFFF","#B3D4FF","#B3F5FF","#ABF5D1","#FFF0B3","#FFBDAD","#EAE6FF"]),r=l=>{e.editor&&(e.editor.chain().focus().setBackgroundColor(l).run(),n.value=l,t.value&&t.value.togglePopover())},o=()=>{r(n.value)},a=l=>({"#172B4D":"Default","#0747A6":"Bright blue","#008DA6":"Bright blue-green","#006644":"Bright green","#FF991F":"Bright orange","#BF2600":"Bright red","#403294":"Bright purple","#97A0AF":"Gray","#4C9AFF":"Blue","#00B8D9":"Blue-green","#36B37E":"Green","#FFC400":"Yellow","#FF5630":"Red","#6554C0":"Purple",transparent:"Transparent","#B3D4FF":"Bright blue","#B3F5FF":"Bright blue-green","#ABF5D1":"Bright green","#FFF0B3":"Bright yellow","#FFBDAD":"Bright red","#EAE6FF":"Bright purple"})[l]||l;return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",Rne,[c[2]||(c[2]=y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"}),y.createElementVNode("path",{d:"m5 2 5 5"}),y.createElementVNode("path",{d:"M2 13h15"}),y.createElementVNode("path",{d:"M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"})],-1)),y.createElementVNode("span",{class:"block h-1 w-5",style:y.normalizeStyle({backgroundColor:n.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("div",Ane,[y.createVNode(C7,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:o,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(Lm,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("div",One,[y.createElementVNode("button",{onClick:c[1]||(c[1]=d=>r("transparent")),class:"col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"},[...c[3]||(c[3]=[y.createElementVNode("svg",{fill:"#000000",width:"16",height:"16",viewBox:"0 0 52 52","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg"},[y.createElementVNode("g",{id:"SVGRepo_bgCarrier","stroke-width":"0"}),y.createElementVNode("g",{id:"SVGRepo_tracerCarrier","stroke-linecap":"round","stroke-linejoin":"round"}),y.createElementVNode("g",{id:"SVGRepo_iconCarrier"},[y.createElementVNode("path",{d:"M48.5,5.6,46.4,3.5a1.67,1.67,0,0,0-2.4.3L32.59,15.21c-.77-1.3-1.51-2.61-2.21-4a36.5,36.5,0,0,1-3.15-8.36c-.13-.53-.39-.91-1-.89s-.86.4-1,.93c-.06.26-.11.51-.17.76A48.3,48.3,0,0,1,21,13.7,97.47,97.47,0,0,1,14.13,25a16,16,0,0,0-3,11.12c0,.14,0,.29.06.43L3.8,44a1.87,1.87,0,0,0-.3,2.4l2.1,2.1A1.67,1.67,0,0,0,8,48.2L48.2,8A1.67,1.67,0,0,0,48.5,5.6Z"}),y.createElementVNode("path",{d:"M38.42,23.79l-22,22.31A14.47,14.47,0,0,0,26.22,50a15.48,15.48,0,0,0,7-1.44c4.94-2.51,8.11-6.4,8.94-12A15.22,15.22,0,0,0,39,24.66C38.87,24.44,38.58,24,38.42,23.79Z"})])],-1),y.createElementVNode("p",null,"no color",-1)])]),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,d=>(y.openBlock(),y.createElementBlock("div",{key:d,class:"h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"},[y.createElementVNode("div",Pne,[d!=="transparent"?(y.openBlock(),y.createElementBlock("button",{key:0,class:"flex items-center justify-center w-full h-full",style:y.normalizeStyle({backgroundColor:d}),onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],12,Fne)):y.createCommentVNode("",!0),d==="transparent"?(y.openBlock(),y.createElementBlock("button",{key:1,class:"flex items-center justify-center w-full h-full",onClick:h=>r(d),title:a(d)},[n.value===d?(y.openBlock(),y.createBlock(Lm,{key:0,class:"h-5 w-5 text-gray-500"})):y.createCommentVNode("",!0)],8,Bne)):y.createCommentVNode("",!0)])]))),128))])])]),_:1},512))}},Wne={__name:"vs-editor-highlight",props:{editor:Object},setup(s){const e=s,t=y.computed(()=>e.editor?.isActive("highlight")),n=()=>{e.editor&&e.editor.chain().focus().toggleHighlight().run()};return(i,r)=>(y.openBlock(),y.createElementBlock("button",{title:"Highlight",onClick:n,class:y.normalizeClass(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex",{"bg-gray-200":t.value}])},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"m9 11-6 6v3h9l3-3"}),y.createElementVNode("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})],-1)])],2))}},Hne={class:"truncate"},zne={class:"w-[200px]"},$ne={class:"max-h-[200px] overflow-y-auto"},Une=["onClick"],jne={__name:"vs-editor-font-family",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref(!1),i=y.ref([{label:"Arial",value:"Arial, sans-serif"},{label:"Helvetica",value:"Helvetica, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Comic Sans MS",value:"Comic Sans MS, cursive"},{label:"Impact",value:"Impact, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Palatino",value:"Palatino, serif"}]),r=y.computed(()=>{if(!e.editor)return"Arial, sans-serif";for(const c of i.value)if(e.editor.isActive("textStyle",{fontFamily:c.value}))return c.value;return"Arial, sans-serif"}),o=y.computed(()=>i.value.find(d=>d.value===r.value)?.label||"Arial"),a=c=>e.editor?e.editor.isActive("textStyle",{fontFamily:c}):!1,l=c=>{e.editor&&(e.editor.chain().focus().setFontFamily(c).run(),t.value&&t.value.togglePopover())};return(c,d)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom",onIsvisible:d[0]||(d[0]=h=>n.value=h)},{reference:y.withCtx(()=>[y.createElementVNode("button",{title:"Font Family",class:y.normalizeClass(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm",[n.value?"bg-gray-100 text-gray-900":"text-gray-700"]]),style:y.normalizeStyle({fontFamily:r.value})},[y.createElementVNode("span",Hne,y.toDisplayString(o.value),1),d[1]||(d[1]=y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))],6)]),default:y.withCtx(()=>[y.createElementVNode("div",zne,[y.createElementVNode("ul",$ne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,h=>(y.openBlock(),y.createElementBlock("li",{key:h.value,class:y.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",{"bg-gray-100":a(h.value)}]),style:y.normalizeStyle({fontFamily:h.value}),onClick:u=>l(h.value)},y.toDisplayString(h.label),15,Une))),128))])])]),_:1},512))}},Kne={class:"w-[120px]"},qne={class:"max-h-[200px] overflow-y-auto"},Gne=["onClick"],Yne={__name:"vs-editor-font-size",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref("14px"),i=y.ref([{label:"8px",value:"8px"},{label:"9px",value:"9px"},{label:"10px",value:"10px"},{label:"11px",value:"11px"},{label:"12px",value:"12px"},{label:"14px",value:"14px"},{label:"16px",value:"16px"},{label:"18px",value:"18px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"28px",value:"28px"},{label:"32px",value:"32px"},{label:"36px",value:"36px"},{label:"48px",value:"48px"},{label:"72px",value:"72px"}]),r=o=>{e.editor&&(e.editor.chain().focus().setFontSize(o).run(),n.value=o,t.value&&t.value.togglePopover())};return(o,a)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[...a[0]||(a[0]=[y.createElementVNode("button",{title:"Font Size",class:"h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1"},[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-alarge-small-icon lucide-a-large-small"},[y.createElementVNode("path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"}),y.createElementVNode("path",{d:"M15.697 14h5.606"}),y.createElementVNode("path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"}),y.createElementVNode("path",{d:"M3.304 13h6.392"})]),y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})])],-1)])]),default:y.withCtx(()=>[y.createElementVNode("div",Kne,[y.createElementVNode("ul",qne,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,l=>(y.openBlock(),y.createElementBlock("li",{key:l.value,class:"px-3 py-2 hover:bg-gray-100 cursor-pointer",onClick:c=>r(l.value)},y.toDisplayString(l.label),9,Gne))),128))])])]),_:1},512))}},Xne={props:{editor:Object},methods:{toggleSuperscript(){this.editor&&this.editor.commands.toggleSuperscript()}}};function Zne(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Superscript",onClick:e[0]||(e[0]=(...o)=>r.toggleSuperscript&&r.toggleSuperscript(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("superscript")}])},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript-icon lucide-superscript"><path d="m4 19 8-8"></path><path d="m12 19-8-8"></path><path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"></path></svg><span class="sr-only">Superscript</span>',2)])],2)}const Qne=wn(Xne,[["render",Zne]]),Jne={props:{editor:Object},methods:{toggleSubscript(){this.editor&&this.editor.commands.toggleSubscript()}}};function eie(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Subscript",onClick:e[0]||(e[0]=(...o)=>r.toggleSubscript&&r.toggleSubscript(...o)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":t.editor?.isActive("subscript")}])},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-subscript-icon lucide-subscript"><path d="m4 5 8 8"></path><path d="m12 5-8 8"></path><path d="M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07"></path></svg><span class="sr-only">Subscript</span>',2)])],2)}const tie=wn(Jne,[["render",eie]]),nie={title:"Heading",class:"h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"},iie={class:"truncate"},sie={class:"max-h-[200px] overflow-y-auto"},rie=["onClick"],oie=wn({__name:"vs-editor-heading",props:{editor:Object},setup(s){const e=s,t=y.ref("popover"),n=y.ref([{label:"Heading 1",value:1},{label:"Heading 2",value:2},{label:"Heading 3",value:3},{label:"Heading 4",value:4},{label:"Heading 5",value:5},{label:"Heading 6",value:6}]),i=y.computed(()=>{if(!e.editor)return"Paragraph";for(let l=1;l<=6;l++)if(e.editor.isActive("heading",{level:l}))return`H ${l}`;return"P"}),r=l=>({1:"font-weight:700; font-size:30px;",2:"font-weight:700; font-size:26px;",3:"font-weight:700; font-size:22px;",4:"font-weight:700; font-size:18px;",5:"font-weight:500; font-size:16px;",6:"font-weight:400; font-size:14px;"})[l]||"",o=l=>{e.editor&&(e.editor.chain().focus().setHeading({level:l}).run(),t.value&&t.value.togglePopover())},a=()=>{e.editor&&(e.editor.chain().focus().setParagraph().run(),t.value&&t.value.togglePopover())};return(l,c)=>(y.openBlock(),y.createBlock(Oc,{ref_key:"popover",ref:t,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",nie,[y.createElementVNode("span",iie,y.toDisplayString(i.value),1),c[0]||(c[0]=y.createElementVNode("svg",{class:"ml-1 text-gray-400",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"6,9 12,15 18,9"})],-1))])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("ul",sie,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(n.value,d=>(y.openBlock(),y.createElementBlock("li",{key:d.value,class:y.normalizeClass(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm",`heading-level-${d.value}`]),style:y.normalizeStyle(r(d.value)),onClick:h=>o(d.value)},y.toDisplayString(d.label),15,rie))),128)),y.createElementVNode("li",{class:"px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",onClick:a}," Paragraph ")])])]),_:1},512))}},[["__scopeId","data-v-ef7c378e"]]),aie={props:{editor:Object},methods:{clearFormatting(){this.editor&&this.editor.commands.unsetAllMarks()}}};function lie(s,e,t,n,i,r){return y.openBlock(),y.createElementBlock("button",{title:"Clear Formatting",onClick:e[0]||(e[0]=(...o)=>r.clearFormatting&&r.clearFormatting(...o)),class:"h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"},[...e[1]||(e[1]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-remove-formatting-icon lucide-remove-formatting"><path d="M4 7V4h16v3"></path><path d="M5 20h6"></path><path d="M13 4 8 20"></path><path d="m15 15 5 5"></path><path d="m20 15-5 5"></path></svg><span class="sr-only">Clear Formatting</span>',2)])])}const cie=wn(aie,[["render",lie]]),die={class:"relative"},hie={class:"space-y-4"},uie={key:0,class:"mt-4"},fie=["src","alt","title"],gie={key:0,class:"text-sm text-red-500"},pie=Object.assign({inheritAttrs:!1},{__name:"vs-editor-image",props:{editor:{type:Object,required:!0}},setup(s){const e=s,t=y.ref(!1),n=y.ref(!1),i=y.ref({src:"",alt:"",title:""}),r=()=>{i.value={src:"",alt:"",title:""},n.value=!1,t.value=!0},o=()=>{t.value=!1,n.value=!1},a=()=>{if(!i.value.src){alert("Please enter an image URL");return}e.editor&&e.editor.chain().focus().setImage({src:i.value.src,alt:i.value.alt||"",title:i.value.title||""}).run(),o()},l=()=>{a()},c=()=>{o()};return y.watch(()=>i.value.src,()=>{n.value=!1}),(d,h)=>(y.openBlock(),y.createElementBlock("div",die,[y.createElementVNode("button",{onClick:r,class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",s.editor?.isActive("image")?"bg-gray-200 text-gray-900":""]),title:"Add Image"},[...h[5]||(h[5]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"></rect><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"></path></svg><span class="sr-only">Add Image</span>',2)])],2),y.createVNode(_7,{modelValue:t.value,"onUpdate:modelValue":h[4]||(h[4]=u=>t.value=u),title:"Add Image"},{footer:y.withCtx(()=>[y.createElementVNode("button",{onClick:c,type:"button",class:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Cancel "),y.createElementVNode("button",{onClick:l,type:"button",class:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"}," Add Image ")]),default:y.withCtx(()=>[y.createElementVNode("div",hie,[y.createElementVNode("div",null,[h[6]||(h[6]=y.createElementVNode("label",{for:"imageUrl",class:"block text-sm font-medium text-gray-700 mb-1"}," Image URL ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageUrl","onUpdate:modelValue":h[0]||(h[0]=u=>i.value.src=u),type:"url",placeholder:"https://example.com/image.png",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:""},null,512),[[y.vModelText,i.value.src]])]),y.createElementVNode("div",null,[h[7]||(h[7]=y.createElementVNode("label",{for:"imageAlt",class:"block text-sm font-medium text-gray-700 mb-1"}," Alt Text ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageAlt","onUpdate:modelValue":h[1]||(h[1]=u=>i.value.alt=u),type:"text",placeholder:"Description of the image",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[y.vModelText,i.value.alt]])]),y.createElementVNode("div",null,[h[8]||(h[8]=y.createElementVNode("label",{for:"imageTitle",class:"block text-sm font-medium text-gray-700 mb-1"}," Title (optional) ",-1)),y.withDirectives(y.createElementVNode("input",{id:"imageTitle","onUpdate:modelValue":h[2]||(h[2]=u=>i.value.title=u),type:"text",placeholder:"Image title",class:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"},null,512),[[y.vModelText,i.value.title]])]),i.value.src?(y.openBlock(),y.createElementBlock("div",uie,[h[9]||(h[9]=y.createElementVNode("p",{class:"text-sm text-gray-600 mb-2"},"Preview:",-1)),y.withDirectives(y.createElementVNode("img",{src:i.value.src,alt:i.value.alt||"Image preview",title:i.value.title,class:"max-w-full h-auto max-h-32 rounded border",onError:h[3]||(h[3]=u=>n.value=!0)},null,40,fie),[[y.vShow,!n.value]]),n.value?(y.openBlock(),y.createElementBlock("p",gie," Failed to load image preview ")):y.createCommentVNode("",!0)])):y.createCommentVNode("",!0)])]),_:1},8,["modelValue"])]))}}),mie={class:"flex items-center"},_ie=["disabled"],bie=["disabled"],wie=wn(Object.assign({inheritAttrs:!1},{__name:"vs-editor-history",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor?.can().undo()&&e.editor.chain().focus().undo().run()},n=()=>{e.editor?.can().redo()&&e.editor.chain().focus().redo().run()};return(i,r)=>(y.openBlock(),y.createElementBlock("div",mie,[y.createElementVNode("button",{onClick:t,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200",[s.editor?.can().undo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!s.editor?.can().undo(),title:"Undo (Ctrl+Z)"},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M3 7v6h6"}),y.createElementVNode("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)])],10,_ie),y.createElementVNode("button",{onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100",[s.editor?.can().redo()?"text-gray-500":"text-gray-300 cursor-not-allowed"]]),disabled:!s.editor?.can().redo(),title:"Redo (Ctrl+Y)"},[...r[1]||(r[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M21 7v6h-6"}),y.createElementVNode("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3L21 13"})],-1)])],10,bie)]))}}),[["__scopeId","data-v-b5a7cc5a"]]),Cie={class:"relative"},vie=wn(Object.assign({inheritAttrs:!1},{__name:"vs-editor-help",props:{editor:Object},setup(s){const e=y.ref(!1),t=y.ref(null),n=()=>{e.value=!e.value},i=()=>{e.value=!1};return(r,o)=>(y.openBlock(),y.createElementBlock("div",Cie,[y.createElementVNode("button",{ref_key:"helpButton",ref:t,onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500",[e.value?"bg-gray-100 text-gray-900":"text-gray-500"]]),title:"Markdown Shortcuts Help"},[...o[1]||(o[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),y.createElementVNode("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),y.createElementVNode("line",{x1:"12",x2:"12.01",y1:"17",y2:"17"})],-1)])],2),e.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100001]",onClick:i},[y.createElementVNode("div",{class:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",onClick:o[0]||(o[0]=y.withModifiers(()=>{},["stop"]))},[y.createElementVNode("div",{class:"p-6"},[y.createElementVNode("div",{class:"flex justify-between items-center mb-4"},[o[3]||(o[3]=y.createElementVNode("h2",{class:"text-xl font-semibold text-gray-900"},"Common Markdown Syntax & Shortcuts",-1)),y.createElementVNode("button",{onClick:i,class:"text-gray-400 hover:text-gray-600 transition-colors"},[...o[2]||(o[2]=[y.createElementVNode("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),o[4]||(o[4]=y.createStaticVNode('<div class="space-y-6" data-v-72ce3024><div data-v-72ce3024><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-72ce3024>Markdown Syntax</h3><div class="overflow-x-auto" data-v-72ce3024><table class="w-full border-collapse" data-v-72ce3024><thead data-v-72ce3024><tr class="bg-gray-50" data-v-72ce3024><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Example</th></tr></thead><tbody class="text-sm" data-v-72ce3024><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>_italic text_</code></td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>###### Heading 6</code></td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>1. First item</code>). </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Start with a greater-than sign (>) followed by a space. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>`</code>). </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Images</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024></code> syntax. </td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Links</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-72ce3024><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-72ce3024>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-72ce3024><table class="w-full border-collapse" data-v-72ce3024><thead data-v-72ce3024><tr class="bg-gray-50" data-v-72ce3024><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-72ce3024>Action</th></tr></thead><tbody class="text-sm" data-v-72ce3024><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Select all text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Apply bold formatting</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Copy selected text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Apply italic formatting</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Save the current document</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Paste copied text</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Cut selected text</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Redo the last action</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Redo the last action</td></tr><tr data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Undo the last action</td></tr><tr class="bg-gray-25" data-v-72ce3024><td class="border border-gray-200 px-3 py-2 font-medium" data-v-72ce3024><code class="bg-gray-100 px-2 py-1 rounded" data-v-72ce3024>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-72ce3024>Undo the last action</td></tr></tbody></table></div></div></div>',1))])])])):y.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-72ce3024"]]),yie={__name:"vs-editor-horizontal-rule",props:{editor:Object},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().setHorizontalRule().run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Horizontal Rule",onClick:t,class:"flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"},[...i[0]||(i[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("line",{x1:"3",x2:"21",y1:"12",y2:"12"})],-1)])]))}},Sie={__name:"vs-editor-fullscreen",props:{editor:Object},emits:["toggle-fullscreen"],setup(s,{emit:e}){const t=e,n=()=>{t("toggle-fullscreen")};return(i,r)=>(y.openBlock(),y.createElementBlock("button",{title:"Fullscreen",onClick:n,class:"w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"},[...r[0]||(r[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})],-1)])]))}},xie=["title"],Lie={class:"vs-editor-html-mode__text"},kie={bold:mte,italic:wte,color:Mne,background_color:Vne,highlight:Wne,bullet_list:ate,ordered_list:dte,blockquote:ste,codeblock:fte,underline:Cte,strike:vte,link:qte,table:Qte,text_align:mne,type_tag:wne,font_family:jne,font_size:Yne,superscript:Qne,subscript:tie,heading:oie,clear_formatting:cie,image:pie,history:wie,help:vie,horizontal_rule:yie,fullscreen:Sie,html_mode:wn({__name:"vs-editor-html-mode",props:{editor:{type:Object,required:!0}},emits:["toggle-html-mode"],setup(s,{emit:e}){const t=e,n=y.ref(!1),i=()=>{n.value=!n.value,t("toggle-html-mode",n.value)};return(r,o)=>(y.openBlock(),y.createElementBlock("button",{onClick:i,class:y.normalizeClass([{"is-active":n.value},"vs-editor-html-mode"]),type:"button",title:n.value?"Switch to Rich Text Mode":"Switch to HTML Mode"},[o[0]||(o[0]=y.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("polyline",{points:"16,18 22,12 16,6"}),y.createElementVNode("polyline",{points:"8,6 2,12 8,18"})],-1)),y.createElementVNode("span",Lie,y.toDisplayString((n.value,"HTML")),1)],10,xie))}},[["__scopeId","data-v-99a48167"]]),tab:Object.assign({inheritAttrs:!1},{__name:"vs-editor-tab",props:{editor:{type:Object,required:!0}},setup(s){const e=s,t=()=>{e.editor&&e.editor.chain().focus().insertContent(" ").run()};return(n,i)=>(y.openBlock(),y.createElementBlock("button",{title:"Tab (Indent)",onClick:t,class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},[...i[0]||(i[0]=[y.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-indent-increase"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M20 6l-11 0"></path><path d="M20 12l-7 0"></path><path d="M20 18l-11 0"></path><path d="M4 8l4 4l-4 4"></path></svg>',1)])]))}})},v7={basic:["history","font_family","font_size","bold","italic","underline","strike","text_align","bullet_list","ordered_list","link","image","clear_formatting","help"],default:["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","tab","horizontal_rule","clear_formatting","fullscreen","help","html_mode"],full:["history","heading","font_family","font_size","bold","italic","underline","strike","color","background_color","highlight","text_align","bullet_list","ordered_list","blockquote","codeblock","table","link","image","tab","horizontal_rule","superscript","subscript","clear_formatting","fullscreen","help","html_mode"]};function Eie(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Sn(s,e,t=(n,i)=>n===i){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let n=0,i=s.length;n<i;n++)if(!t(s[n],e[n]))return!1;return!0}function Nie(s,e){const t=s.length-1;e<t&&(s[e]=s[t]),s.pop()}function Die(s,e,t){return y7(s.length,n=>t(s[n],e))}function y7(s,e){let t=0,n=s-1;for(;t<=n;){const i=(t+n)/2|0,r=e(i);if(r<0)t=i+1;else if(r>0)n=i-1;else return i}return-(t+1)}function*Zk(s,e){let t,n;for(const i of s)n!==void 0&&e(n,i)?t.push(i):(t&&(yield t),t=[i]),n=i;t&&(yield t)}function S7(s,e){for(let t=0;t<=s.length;t++)e(t===0?void 0:s[t-1],t===s.length?void 0:s[t])}function Tie(s,e){for(let t=0;t<s.length;t++)e(t===0?void 0:s[t-1],s[t],t+1===s.length?void 0:s[t+1])}function Qk(s){return s.filter(e=>!!e)}function x7(s){let e=0;for(let t=0;t<s.length;t++)s[t]&&(s[e]=s[t],e+=1);s.length=e}function Iie(s){return!Array.isArray(s)||s.length===0}function Nw(s){return Array.isArray(s)&&s.length>0}function Qd(s,e=t=>t){const t=new Set;return s.filter(n=>{const i=e(n);return t.has(i)?!1:(t.add(i),!0)})}function cs(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const n=[];if(t<=e)for(let i=t;i<e;i++)n.push(i);else for(let i=t;i>e;i--)n.push(i);return n}function Dw(s,e,t){const n=s.slice(0,e),i=s.slice(e);return n.concat(t,i)}function Jk(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function Tw(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function eE(s,e){for(const t of e)s.push(t)}function Mie(s,e,t){const n=L7(s,e),i=s.length,r=t.length;s.length=i+r;for(let o=i-1;o>=n;o--)s[o+r]=s[o];for(let o=0;o<r;o++)s[o+n]=t[o]}function Iw(s,e,t,n){const i=L7(s,e);let r=s.splice(i,t);return r===void 0&&(r=[]),Mie(s,i,n),r}function L7(s,e){return e<0?Math.max(e+s.length,0):Math.min(e,s.length)}var km;(function(s){function e(r){return r<0}s.isLessThan=e;function t(r){return r<=0}s.isLessThanOrEqual=t;function n(r){return r>0}s.isGreaterThan=n;function i(r){return r===0}s.isNeitherLessOrGreaterThan=i,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(km||(km={}));function Ks(s,e){return(t,n)=>e(s(t),s(n))}function Rie(...s){return(e,t)=>{for(const n of s){const i=n(e,t);if(!km.isNeitherLessOrGreaterThan(i))return i}return km.neitherLessOrGreaterThan}}const ll=(s,e)=>s-e,Aie=(s,e)=>ll(s?1:0,e?1:0);function Oie(s){return(e,t)=>-s(e,t)}class cl{constructor(e){this.firstIdx=0,this.items=e,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 n=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,n}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const n=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,n}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 Lp=class Lp{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Lp(t=>this.iterate(n=>e(n)?t(n):!0))}map(e){return new Lp(t=>this.iterate(n=>t(e(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(i=>((n||km.isGreaterThan(e(i,t)))&&(n=!1,t=i),!0)),t}};Lp.empty=new Lp(e=>{});let Jd=Lp;class Pie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?If.isErrorNoTelemetry(e)?new If(e.message+`
|
|
119
119
|
|
|
120
120
|
`+e.stack):new Error(e.message+`
|
|
121
121
|
|
|
122
122
|
`+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 tE=new Pie;function Mw(s){tE.onUnexpectedError(s)}function dt(s){Em(s)||tE.onUnexpectedError(s)}function nE(s){Em(s)||tE.onUnexpectedExternalError(s)}function iE(s){if(s instanceof Error){const{name:e,message:t,cause:n}=s,i=s.stacktrace||s.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:If.isErrorNoTelemetry(s),cause:n?iE(n):void 0,code:s.code}}return s}const Rw="Canceled";function Em(s){return s instanceof Tf?!0:s instanceof Error&&s.name===Rw&&s.message===Rw}class Tf extends Error{constructor(){super(Rw),this.name=this.message}}function Fie(){const s=new Error(Rw);return s.name=s.message,s}function Aw(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}function Ow(s){return s?new Error(`Illegal state: ${s}`):new Error("Illegal state")}class Bie extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class If extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof If)return e;const t=new If;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class we extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,we.prototype)}}function sE(s,e){if(!s)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function rE(s,e="Unreachable"){throw new Error(e)}function Pw(s,e="unexpected state"){if(!s)throw typeof e=="string"?new we(`Assertion Failed: ${e}`):e}function k7(s,e="Soft Assertion Failed"){s||dt(new we(e))}function eh(s){if(!s()){debugger;s(),dt(new we("Assertion Failed"))}}function oE(s,e){let t=0;for(;t<s.length-1;){const n=s[t],i=s[t+1];if(!e(n,i))return!1;t++}return!0}function Yn(s){return typeof s=="string"}function ds(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function Vie(s){const e=Object.getPrototypeOf(Uint8Array);return typeof s=="object"&&s instanceof e}function th(s){return typeof s=="number"&&!isNaN(s)}function aE(s){return!!s&&typeof s[Symbol.iterator]=="function"}function E7(s){return s===!0||s===!1}function yr(s){return typeof s>"u"}function Sr(s){return!xr(s)}function xr(s){return yr(s)||s===null}function Pc(s,e){if(!s)throw new Error("Unexpected type")}function N7(s){return Pw(s!=null,"Argument is `undefined` or `null`."),s}function Mf(s){return typeof s=="function"}function Wie(s,e){const t=Math.min(s.length,e.length);for(let n=0;n<t;n++)Hie(s[n],e[n])}function Hie(s,e){if(Yn(e)){if(typeof s!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(Mf(e)){try{if(s instanceof e)return}catch{}if(!xr(s)&&s.constructor===e||e.length===1&&e.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function dl(s){if(!s||typeof s!="object"||s instanceof RegExp)return s;const e=Array.isArray(s)?[]:{};return Object.entries(s).forEach(([t,n])=>{e[t]=n&&typeof n=="object"?dl(n):n}),e}function zie(s){if(!s||typeof s!="object")return s;const e=[s];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const n in t)if(D7.call(t,n)){const i=t[n];typeof i=="object"&&!Object.isFrozen(i)&&!Vie(i)&&e.push(i)}}return s}const D7=Object.prototype.hasOwnProperty;function T7(s,e){return lE(s,e,new Set)}function lE(s,e,t){if(xr(s))return s;const n=e(s);if(typeof n<"u")return n;if(Array.isArray(s)){const i=[];for(const r of s)i.push(lE(r,e,t));return i}if(ds(s)){if(t.has(s))throw new Error("Cannot clone recursive data-structure");t.add(s);const i={};for(const r in s)D7.call(s,r)&&(i[r]=lE(s[r],e,t));return t.delete(s),i}return s}function Ds(s,e){if(s===e)return!0;if(s==null||e===null||e===void 0||typeof s!=typeof e||typeof s!="object"||Array.isArray(s)!==Array.isArray(e))return!1;let t,n;if(Array.isArray(s)){if(s.length!==e.length)return!1;for(t=0;t<s.length;t++)if(!Ds(s[t],e[t]))return!1}else{const i=[];for(n in s)i.push(n);i.sort();const r=[];for(n in e)r.push(n);if(r.sort(),!Ds(i,r))return!1;for(t=0;t<i.length;t++)if(!Ds(s[i[t]],e[i[t]]))return!1}return!0}function I7(){return globalThis._VSCODE_NLS_MESSAGES}function cE(){return globalThis._VSCODE_NLS_LANGUAGE}const $ie=cE()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function M7(s,e){let t;return e.length===0?t=s:t=s.replace(/\{(\d+)\}/g,(n,i)=>{const r=i[0],o=e[r];let a=n;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),$ie&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function _(s,e,...t){return M7(typeof s=="number"?Uie(s,e):e,t)}function Uie(s,e){const t=I7()?.[s];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${s} !!!`)}return t}const nh="en";let Nm=!1,Dm=!1,Tm=!1,R7=!1,dE=!1,hE=!1,A7=!1,Fw,uE=nh,O7=nh,jie,hl;const ul=globalThis;let qs;typeof ul.vscode<"u"&&typeof ul.vscode.process<"u"?qs=ul.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(qs=process);const Kie=typeof qs?.versions?.electron=="string"&&qs?.type==="renderer";if(typeof qs=="object"){Nm=qs.platform==="win32",Dm=qs.platform==="darwin",Tm=qs.platform==="linux",Tm&&qs.env.SNAP&&qs.env.SNAP_REVISION,qs.env.CI||qs.env.BUILD_ARTIFACTSTAGINGDIRECTORY||qs.env.GITHUB_WORKSPACE,Fw=nh,uE=nh;const s=qs.env.VSCODE_NLS_CONFIG;if(s)try{const e=JSON.parse(s);Fw=e.userLocale,O7=e.osLocale,uE=e.resolvedLanguage||nh,jie=e.languagePack?.translationsConfigFile}catch{}R7=!0}else typeof navigator=="object"&&!Kie?(hl=navigator.userAgent,Nm=hl.indexOf("Windows")>=0,Dm=hl.indexOf("Macintosh")>=0,hE=(hl.indexOf("Macintosh")>=0||hl.indexOf("iPad")>=0||hl.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Tm=hl.indexOf("Linux")>=0,A7=hl?.indexOf("Mobi")>=0,dE=!0,uE=cE()||nh,Fw=navigator.language.toLowerCase(),O7=Fw):console.error("Unable to resolve platform.");let Bw=0;Dm?Bw=1:Nm?Bw=3:Tm&&(Bw=2);const hs=Nm,He=Dm,Ts=Tm,Im=R7,fl=dE,qie=dE&&typeof ul.importScripts=="function"?ul.origin:void 0,na=hE,P7=A7,fE=Bw,ia=hl,Gie=typeof ul.postMessage=="function"&&!ul.importScripts,Vw=(()=>{if(Gie){const s=[];ul.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,i=s.length;n<i;n++){const r=s[n];if(r.id===t.data.vscodeScheduleAsyncWork){s.splice(n,1),r.callback();return}}});let e=0;return t=>{const n=++e;s.push({id:n,callback:t}),ul.postMessage({vscodeScheduleAsyncWork:n},"*")}}return s=>setTimeout(s)})(),Gr=Dm||hE?2:Nm?1:3;let F7=!0,B7=!1;function Yie(){if(!B7){B7=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,F7=new Uint16Array(s.buffer)[0]===513}return F7}const gE=!!(ia&&ia.indexOf("Chrome")>=0),Xie=!!(ia&&ia.indexOf("Firefox")>=0),Zie=!!(!gE&&ia&&ia.indexOf("Safari")>=0),V7=!!(ia&&ia.indexOf("Edg/")>=0),Qie=!!(ia&&ia.indexOf("Android")>=0),pi={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var it;(function(s){function e(L){return!!L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}s.is=e;const t=Object.freeze([]);function n(){return t}s.empty=n;function*i(L){yield L}s.single=i;function r(L){return e(L)?L:i(L)}s.wrap=r;function o(L){return L||t}s.from=o;function*a(L){for(let E=L.length-1;E>=0;E--)yield L[E]}s.reverse=a;function l(L){return!L||L[Symbol.iterator]().next().done===!0}s.isEmpty=l;function c(L){return L[Symbol.iterator]().next().value}s.first=c;function d(L,E){let N=0;for(const M of L)if(E(M,N++))return!0;return!1}s.some=d;function h(L,E){let N=0;for(const M of L)if(!E(M,N++))return!1;return!0}s.every=h;function u(L,E){for(const N of L)if(E(N))return N}s.find=u;function*f(L,E){for(const N of L)E(N)&&(yield N)}s.filter=f;function*g(L,E){let N=0;for(const M of L)yield E(M,N++)}s.map=g;function*p(L,E){let N=0;for(const M of L)yield*E(M,N++)}s.flatMap=p;function*m(...L){for(const E of L)aE(E)?yield*E:yield E}s.concat=m;function b(L,E,N){let M=N;for(const O of L)M=E(M,O);return M}s.reduce=b;function w(L){let E=0;for(const N of L)E++;return E}s.length=w;function*C(L,E,N=L.length){for(E<-L.length&&(E=0),E<0&&(E+=L.length),N<0?N+=L.length:N>L.length&&(N=L.length);E<N;E++)yield L[E]}s.slice=C;function v(L,E=Number.POSITIVE_INFINITY){const N=[];if(E===0)return[N,L];const M=L[Symbol.iterator]();for(let O=0;O<E;O++){const I=M.next();if(I.done)return[N,s.empty()];N.push(I.value)}return[N,{[Symbol.iterator](){return M}}]}s.consume=v;async function S(L){const E=[];for await(const N of L)E.push(N);return E}s.asyncToArray=S;async function k(L){let E=[];for await(const N of L)E=E.concat(N);return E}s.asyncToArrayFlat=k})(it||(it={}));let En=(ic=class{constructor(e){this.element=e,this.next=ic.Undefined,this.prev=ic.Undefined}},ic.Undefined=new ic(void 0),ic);class us{constructor(){this._first=En.Undefined,this._last=En.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===En.Undefined}clear(){let e=this._first;for(;e!==En.Undefined;){const t=e.next;e.prev=En.Undefined,e.next=En.Undefined,e=t}this._first=En.Undefined,this._last=En.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new En(e);if(this._first===En.Undefined)this._first=n,this._last=n;else if(t){const r=this._last;this._last=n,n.prev=r,r.next=n}else{const r=this._first;this._first=n,n.next=r,r.prev=n}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==En.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==En.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==En.Undefined&&e.next!==En.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===En.Undefined&&e.next===En.Undefined?(this._first=En.Undefined,this._last=En.Undefined):e.next===En.Undefined?(this._last=this._last.prev,this._last.next=En.Undefined):e.prev===En.Undefined&&(this._first=this._first.next,this._first.prev=En.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==En.Undefined;)yield e.element,e=e.next}}const W7="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Jie(s=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of W7)s.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const pE=Jie();function mE(s){let e=pE;if(s&&s instanceof RegExp)if(s.global)e=s;else{let t="g";s.ignoreCase&&(t+="i"),s.multiline&&(t+="m"),s.unicode&&(t+="u"),e=new RegExp(s.source,t)}return e.lastIndex=0,e}const H7=new us;H7.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Mm(s,e,t,n,i){if(e=mE(e),i||(i=it.first(H7)),t.length>i.maxLen){let c=s-i.maxLen/2;return c<0?c=0:n+=c,t=t.substring(c,s+i.maxLen/2),Mm(s,e,t,n,i)}const r=Date.now(),o=s-1-n;let a=-1,l=null;for(let c=1;!(Date.now()-r>=i.timeBudget);c++){const d=o-i.windowSize*c;e.lastIndex=Math.max(0,d);const h=ese(e,t,o,a);if(!h&&l||(l=h,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function ese(s,e,t,n){let i;for(;i=s.exec(e);){const r=i.index||0;if(r<=t&&s.lastIndex>=t)return i;if(n>0&&r>n)return null}return null}const sa=8;class z7{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class $7{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Mt{constructor(e,t,n,i){this.id=e,this.name=t,this.defaultValue=n,this.schema=i}applyUpdate(e,t){return Ww(e,t)}compute(e,t,n){return n}}class Rm{constructor(e,t){this.newValue=e,this.didChange=t}}function Ww(s,e){if(typeof s!="object"||typeof e!="object"||!s||!e)return new Rm(e,s!==e);if(Array.isArray(s)||Array.isArray(e)){const n=Array.isArray(s)&&Array.isArray(e)&&Sn(s,e);return new Rm(e,!n)}let t=!1;for(const n in e)if(e.hasOwnProperty(n)){const i=Ww(s[n],e[n]);i.didChange&&(s[n]=i.newValue,t=!0)}return new Rm(s,t)}class Fc{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return Ww(e,t)}validate(e){return this.defaultValue}}class Rf{constructor(e,t,n,i){this.id=e,this.name=t,this.defaultValue=n,this.schema=i}applyUpdate(e,t){return Ww(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,n){return n}}function se(s,e){return typeof s>"u"?e:s==="false"?!1:!!s}class De extends Rf{constructor(e,t,n,i=void 0){typeof i<"u"&&(i.type="boolean",i.default=n),super(e,t,n,i)}validate(e){return se(e,this.defaultValue)}}function ih(s,e,t,n){if(typeof s>"u")return e;let i=parseInt(s,10);return isNaN(i)?e:(i=Math.max(t,i),i=Math.min(n,i),i|0)}class at extends Rf{static clampedInt(e,t,n,i){return ih(e,t,n,i)}constructor(e,t,n,i,r,o=void 0){typeof o<"u"&&(o.type="integer",o.default=n,o.minimum=i,o.maximum=r),super(e,t,n,o),this.minimum=i,this.maximum=r}validate(e){return at.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function tse(s,e,t,n){if(typeof s>"u")return e;const i=Gs.float(s,e);return Gs.clamp(i,t,n)}class Gs extends Rf{static clamp(e,t,n){return e<t?t:e>n?n:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const n=parseFloat(e);return isNaN(n)?t:n}constructor(e,t,n,i,r,o,a){typeof r<"u"&&(r.type="number",r.default=n,r.minimum=o,r.maximum=a),super(e,t,n,r),this.validationFn=i,this.minimum=o,this.maximum=a}validate(e){return this.validationFn(Gs.float(e,this.defaultValue))}}class Ti extends Rf{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,n,i=void 0){typeof i<"u"&&(i.type="string",i.default=n),super(e,t,n,i)}validate(e){return Ti.string(e,this.defaultValue)}}function vt(s,e,t,n){return typeof s!="string"?e:n&&s in n?n[s]:t.indexOf(s)===-1?e:s}class Rt extends Rf{constructor(e,t,n,i,r=void 0){typeof r<"u"&&(r.type="string",r.enum=i,r.default=n),super(e,t,n,r),this._allowedValues=i}validate(e){return vt(e,this.defaultValue,this._allowedValues)}}class Am extends Mt{constructor(e,t,n,i,r,o,a=void 0){typeof a<"u"&&(a.type="string",a.enum=r,a.default=i),super(e,t,n,a),this._allowedValues=r,this._convert=o}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function nse(s){switch(s){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class ise extends Mt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[_(198,"Use platform APIs to detect when a Screen Reader is attached."),_(199,"Optimize for usage with a Screen Reader."),_(200,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:_(201,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,n){return n===0?e.accessibilitySupport:n}}class sse extends Mt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:_(202,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:_(203,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:se(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:se(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function rse(s){switch(s){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Fn;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(Fn||(Fn={}));function U7(s){switch(s){case"line":return Fn.Line;case"block":return Fn.Block;case"underline":return Fn.Underline;case"line-thin":return Fn.LineThin;case"block-outline":return Fn.BlockOutline;case"underline-thin":return Fn.UnderlineThin}}class ose extends Fc{constructor(){super(162)}compute(e,t,n){const i=["monaco-editor"];return t.get(48)&&i.push(t.get(48)),e.extraEditorClassName&&i.push(e.extraEditorClassName),t.get(82)==="default"?i.push("mouse-default"):t.get(82)==="copy"&&i.push("mouse-copy"),t.get(127)&&i.push("showUnused"),t.get(157)&&i.push("showDeprecated"),i.join(" ")}}class ase extends De{constructor(){super(45,"emptySelectionClipboard",!0,{description:_(204,"Controls whether copying without a selection copies the current line.")})}compute(e,t,n){return n&&e.emptySelectionClipboard}}class lse extends Mt{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:_(205,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[_(206,"Never seed search string from the editor selection."),_(207,"Always seed search string from the editor selection, including word at cursor position."),_(208,"Only seed search string from the editor selection.")],description:_(209,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[_(210,"Never turn on Find in Selection automatically (default)."),_(211,"Always turn on Find in Selection automatically."),_(212,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:_(213,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:_(214,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:He},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:_(215,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:_(216,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(217,"Do not store search history from the find widget."),_(218,"Store search history across the active workspace")],description:_(219,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(220,"Do not store history from the replace widget."),_(221,"Store replace history across the active workspace")],description:_(222,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:_(223,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:se(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:se(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":vt(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":vt(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:se(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:se(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:se(t.loop,this.defaultValue.loop),history:vt(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:vt(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}}const sc=class sc extends Mt{constructor(){super(60,"fontLigatures",sc.OFF,{anyOf:[{type:"boolean",description:_(224,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:_(225,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:_(226,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?sc.OFF:e==="true"?sc.ON:e:e?sc.ON:sc.OFF}};sc.OFF='"liga" off, "calt" off',sc.ON='"liga" on, "calt" on';let Bc=sc;const rc=class rc extends Mt{constructor(){super(63,"fontVariations",rc.OFF,{anyOf:[{type:"boolean",description:_(227,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:_(228,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:_(229,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?rc.OFF:e==="true"?rc.TRANSLATE:e:e?rc.TRANSLATE:rc.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}};rc.OFF="normal",rc.TRANSLATE="translate";let Om=rc;class cse extends Fc{constructor(){super(59)}compute(e,t,n){return e.fontInfo}}class dse extends Fc{constructor(){super(161)}compute(e,t,n){return e.inputMode==="overtype"?t.get(92):t.get(34)}}class hse extends Fc{constructor(){super(170)}compute(e,t){return e.editContextSupported&&t.get(44)}}class use extends Fc{constructor(){super(172)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}}class fse extends Rf{constructor(){super(61,"fontSize",Ys.fontSize,{type:"number",minimum:6,maximum:100,default:Ys.fontSize,description:_(230,"Controls the font size in pixels.")})}validate(e){const t=Gs.float(e,this.defaultValue);return t===0?Ys.fontSize:Gs.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}}const $a=class $a extends Mt{constructor(){super(62,"fontWeight",Ys.fontWeight,{anyOf:[{type:"number",minimum:$a.MINIMUM_VALUE,maximum:$a.MAXIMUM_VALUE,errorMessage:_(231,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:$a.SUGGESTION_VALUES}],default:Ys.fontWeight,description:_(232,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(at.clampedInt(e,Ys.fontWeight,$a.MINIMUM_VALUE,$a.MAXIMUM_VALUE))}};$a.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],$a.MINIMUM_VALUE=1,$a.MAXIMUM_VALUE=1e3;let _E=$a;class gse extends Mt{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[_(233,"Show Peek view of the results (default)"),_(234,"Go to the primary result and show a Peek view"),_(235,"Go to the primary result and enable Peek-less navigation to others")]},n=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:_(236,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:_(237,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:_(238,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:_(239,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:_(240,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:_(241,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:n,description:_(242,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:n,description:_(243,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:n,description:_(244,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:n,description:_(245,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:n,description:_(246,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:vt(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:t.multipleDefinitions??vt(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:t.multipleTypeDefinitions??vt(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:t.multipleDeclarations??vt(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:t.multipleImplementations??vt(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:t.multipleReferences??vt(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:t.multipleTests??vt(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Ti.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Ti.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Ti.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Ti.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Ti.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Ti.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class pse extends Mt{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:_(247,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:_(248,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:_(249,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:_(250,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:_(251,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),delay:at.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:se(t.sticky,this.defaultValue.sticky),hidingDelay:at.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:se(t.above,this.defaultValue.above)}}}class Af extends Fc{constructor(){super(165)}compute(e,t,n){return Af.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight);let i=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(i=Math.max(i,t-1));const r=(n+e.viewLineCount+i)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:i,desiredRatio:r,minimapLineCount:o}}static _computeMinimapLayout(e,t){const n=e.outerWidth,i=e.outerHeight,r=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(r*i),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:i};const o=t.stableMinimapLayoutInput,a=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,b=e.viewLineCount,w=e.remainingWidth,C=e.isViewportWrapping,v=h?2:3;let S=Math.floor(r*i);const k=S/r;let L=!1,E=!1,N=v*u,M=u/r,O=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:Q,extraLinesBeforeFirstLine:oe,extraLinesBeyondLastLine:me,desiredRatio:Ie,minimapLineCount:qt}=Af.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:i,lineHeight:l,pixelRatio:r});if(b/qt>1)L=!0,E=!0,u=1,N=1,M=u/r;else{let Ot=!1,ot=u+1;if(g==="fit"){const ei=Math.ceil((oe+b+me)*N);C&&a&&w<=t.stableFitRemainingWidth?(Ot=!0,ot=t.stableFitMaxMinimapScale):Ot=ei>S}if(g==="fill"||Ot){L=!0;const ei=u;N=Math.min(l*r,Math.max(1,Math.floor(1/Ie))),C&&a&&w<=t.stableFitRemainingWidth&&(ot=t.stableFitMaxMinimapScale),u=Math.min(ot,Math.max(1,Math.floor(N/v))),u>ei&&(O=Math.min(2,u/ei)),M=u/r/O,S=Math.ceil(Math.max(Q,oe+b+me)*N),C?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=w,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const I=Math.floor(f*M),F=Math.min(I,Math.max(0,Math.floor((w-m-2)*M/(c+M)))+sa);let W=Math.floor(r*F);const z=W/r;W=Math.floor(W*O);const G=h?1:2,Y=p==="left"?0:n-F-m;return{renderMinimap:G,minimapLeft:Y,minimapWidth:F,minimapHeightIsEditorHeight:L,minimapIsSampling:E,minimapScale:u,minimapLineHeight:N,minimapCanvasInnerWidth:W,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:z,minimapCanvasOuterHeight:k}}static computeLayout(e,t){const n=t.outerWidth|0,i=t.outerHeight|0,r=t.lineHeight|0,o=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(154),u=h==="inherit"?e.get(153):h,f=u==="inherit"?e.get(149):u,g=e.get(152),p=t.isDominatedByLongLines,m=e.get(66),b=e.get(76).renderType!==0,w=e.get(77),C=e.get(119),v=e.get(96),S=e.get(81),k=e.get(117),L=k.verticalScrollbarSize,E=k.verticalHasArrows,N=k.arrowSize,M=k.horizontalScrollbarSize,O=e.get(52),I=e.get(126)!=="never";let F=e.get(74);O&&I&&(F+=16);let W=0;if(b){const xs=Math.max(o,w);W=Math.round(xs*l)}let z=0;m&&(z=r*t.glyphMarginDecorationLaneCount);let G=0,Y=G+z,Q=Y+W,oe=Q+F;const me=n-z-W-F;let Ie=!1,qt=!1,Qe=-1;e.get(2)===2&&u==="inherit"&&p?(Ie=!0,qt=!0):f==="on"||f==="bounded"?qt=!0:f==="wordWrapColumn"&&(Qe=g);const Ot=Af._computeMinimapLayout({outerWidth:n,outerHeight:i,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:C,paddingTop:v.top,paddingBottom:v.bottom,minimap:S,verticalScrollbarWidth:L,viewLineCount:d,remainingWidth:me,isViewportWrapping:qt},t.memory||new $7);Ot.renderMinimap!==0&&Ot.minimapLeft===0&&(G+=Ot.minimapWidth,Y+=Ot.minimapWidth,Q+=Ot.minimapWidth,oe+=Ot.minimapWidth);const ot=me-Ot.minimapWidth,ei=Math.max(1,Math.floor((ot-L-2)/a)),Jt=E?N:0;return qt&&(Qe=Math.max(1,ei),f==="bounded"&&(Qe=Math.min(Qe,g))),{width:n,height:i,glyphMarginLeft:G,glyphMarginWidth:z,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:Y,lineNumbersWidth:W,decorationsLeft:Q,decorationsWidth:F,contentLeft:oe,contentWidth:ot,minimap:Ot,viewportColumn:ei,isWordWrapMinified:Ie,isViewportWrapping:qt,wrappingColumn:Qe,verticalScrollbarWidth:L,horizontalScrollbarHeight:M,overviewRuler:{top:Jt,width:L,height:i-2*Jt,right:0}}}}class mse extends Mt{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[_(252,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),_(253,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:_(254,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return vt(e,"simple",["simple","advanced"])}compute(e,t,n){return t.get(2)===2?"advanced":n}}var gl;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(gl||(gl={}));class _se extends Mt{constructor(){const e={enabled:gl.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[gl.Off,gl.OnCode,gl.On],default:e.enabled,enumDescriptions:[_(255,"Disable the code action menu."),_(256,"Show the code action menu when the cursor is on lines with code."),_(257,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:_(258,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:vt(e.enabled,this.defaultValue.enabled,[gl.Off,gl.OnCode,gl.On])}}}class bse extends Mt{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:_(259,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:_(260,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:_(261,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:_(262,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),maxLineCount:at.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:vt(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:se(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class wse extends Mt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:_(263,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[_(264,"Inlay hints are enabled"),_(265,"Inlay hints are showing by default and hide when holding {0}",He?"Ctrl+Option":"Ctrl+Alt"),_(266,"Inlay hints are hidden by default and show when holding {0}",He?"Ctrl+Option":"Ctrl+Alt"),_(267,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:_(268,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:_(269,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:_(270,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:_(271,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:vt(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:at.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Ti.string(t.fontFamily,this.defaultValue.fontFamily),padding:se(t.padding,this.defaultValue.padding),maximumLength:at.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}}class Cse extends Mt{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):at.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?at.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}}class vse extends Gs{constructor(){super(75,"lineHeight",Ys.lineHeight,e=>Gs.clamp(e,0,150),{markdownDescription:_(272,`Controls the line height.
|
|
123
123
|
- Use 0 to automatically compute the line height from the font size.
|
|
124
124
|
- Values between 0 and 8 will be used as a multiplier with the font size.
|
|
125
|
-
- Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,n){return e.fontInfo.lineHeight}}class yse extends Mt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:_(273,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[_(274,"The minimap is always shown."),_(275,"The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),_(276,"The minimap is only shown when the editor is scrolled")],default:e.autohide,description:_(277,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[_(278,"The minimap has the same size as the editor contents (and might scroll)."),_(279,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),_(280,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:_(281,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:_(282,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:_(283,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:_(284,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:_(285,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:_(286,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:_(287,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:_(288,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.markSectionHeaderRegex":{type:"string",default:e.markSectionHeaderRegex,description:_(289,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:_(290,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:_(291,"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;let n=this.defaultValue.markSectionHeaderRegex;const i=e.markSectionHeaderRegex;if(typeof i=="string")try{new RegExp(i,"d"),n=i}catch{}return{enabled:se(t.enabled,this.defaultValue.enabled),autohide:vt(t.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:vt(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:vt(t.side,this.defaultValue.side,["right","left"]),showSlider:vt(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:se(t.renderCharacters,this.defaultValue.renderCharacters),scale:at.clampedInt(t.scale,1,1,3),maxColumn:at.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:se(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:se(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:n,sectionHeaderFontSize:Gs.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:Gs.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function Sse(s){return s==="ctrlCmd"?He?"metaKey":"ctrlKey":"altKey"}class xse extends Mt{constructor(){super(96,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:_(292,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:_(293,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:at.clampedInt(t.top,0,0,1e3),bottom:at.clampedInt(t.bottom,0,0,1e3)}}}class Lse extends Mt{constructor(){const e={enabled:!0,cycle:!0};super(98,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:_(294,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:_(295,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),cycle:se(t.cycle,this.defaultValue.cycle)}}}class kse extends Fc{constructor(){super(163)}compute(e,t,n){return e.pixelRatio}}class Ese extends Mt{constructor(){super(100,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class Nse extends Mt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[_(296,"Quick suggestions show inside the suggest widget"),_(297,"Quick suggestions show as ghost text"),_(298,"Quick suggestions are disabled")]}];super(102,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:_(299,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:_(300,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:_(301,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:_(302,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:n,strings:i}=e,r=["on","inline","off"];let o,a,l;return typeof t=="boolean"?o=t?"on":"off":o=vt(t,this.defaultValue.other,r),typeof n=="boolean"?a=n?"on":"off":a=vt(n,this.defaultValue.comments,r),typeof i=="boolean"?l=i?"on":"off":l=vt(i,this.defaultValue.strings,r),{other:o,comments:a,strings:l}}}class Dse extends Mt{constructor(){super(76,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[_(303,"Line numbers are not rendered."),_(304,"Line numbers are rendered as absolute number."),_(305,"Line numbers are rendered as distance in lines to cursor position."),_(306,"Line numbers are rendered every 10 lines.")],default:"on",description:_(307,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function Hw(s){const e=s.get(112);return e==="editable"?s.get(104):e!=="on"}function zw(s){return!s.get(172)}class Tse extends Mt{constructor(){const e=[],t={type:"number",description:_(308,"Number of monospace characters at which this editor ruler will render.")};super(116,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:_(309,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:_(310,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="number")t.push({column:at.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const i=n;t.push({column:at.clampedInt(i.column,0,0,1e4),color:i.color})}return t.sort((n,i)=>n.column-i.column),t}return this.defaultValue}}class Ise extends Mt{constructor(){super(105,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function j7(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return 2;case"visible":return 3;default:return 1}}let Mse=class extends Mt{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(117,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[_(311,"The vertical scrollbar will be visible only when necessary."),_(312,"The vertical scrollbar will always be visible."),_(313,"The vertical scrollbar will always be hidden.")],default:"auto",description:_(314,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[_(315,"The horizontal scrollbar will be visible only when necessary."),_(316,"The horizontal scrollbar will always be visible."),_(317,"The horizontal scrollbar will always be hidden.")],default:"auto",description:_(318,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:_(319,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:_(320,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:_(321,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:_(322,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,n=at.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),i=at.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:at.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:j7(t.vertical,this.defaultValue.vertical),horizontal:j7(t.horizontal,this.defaultValue.horizontal),useShadows:se(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:se(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:se(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:se(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:se(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:at.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:i,verticalSliderSize:at.clampedInt(t.verticalSliderSize,i,0,1e3),scrollByPage:se(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:se(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Co="inUntrustedWorkspace",sh={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class Rse extends Mt{constructor(){const e={nonBasicASCII:Co,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Co,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(142,"unicodeHighlight",e,{[sh.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Co],default:e.nonBasicASCII,description:_(323,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[sh.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:_(324,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[sh.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:_(325,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[sh.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Co],default:e.includeComments,description:_(326,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[sh.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Co],default:e.includeStrings,description:_(327,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[sh.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:_(328,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[sh.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:_(329,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(Ds(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(Ds(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));const i=super.applyUpdate(e,t);return n?new Rm(i.newValue,!0):i}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Of(t.nonBasicASCII,Co,[!0,!1,Co]),invisibleCharacters:se(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:se(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Of(t.includeComments,Co,[!0,!1,Co]),includeStrings:Of(t.includeStrings,Co,[!0,!1,Co]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const n={};for(const[i,r]of Object.entries(e))r===!0&&(n[i]=!0);return n}}class Ase extends Mt{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default",syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!1,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:"auto",allowCodeShifting:"always"},triggerCommandOnProviderChange:!0,experimental:{suppressInlineSuggestions:"",showOnSuggestConflict:"never",emptyResponseInformation:!0}};super(71,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:_(330,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[_(331,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),_(332,"Show the inline suggestion toolbar when hovering over an inline suggestion."),_(333,"Never show the inline suggestion toolbar.")],description:_(334,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:e.syntaxHighlightingEnabled,description:_(335,"Controls whether to show syntax highlighting for inline suggestions in the editor.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:_(336,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.suppressInSnippetMode":{type:"boolean",default:e.suppressInSnippetMode,description:_(337,"Controls whether inline suggestions are suppressed when in snippet mode.")},"editor.inlineSuggest.minShowDelay":{type:"number",default:0,minimum:0,maximum:1e4,description:_(338,"Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.")},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"string",default:e.experimental.suppressInlineSuggestions,tags:["experimental"],description:_(339,"Suppresses inline completions for specified extension IDs -- comma separated."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:"boolean",default:e.experimental.emptyResponseInformation,tags:["experimental"],description:_(340,"Controls whether to send request information from the inline suggestion provider."),experiment:{mode:"auto"}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:"boolean",default:e.triggerCommandOnProviderChange,tags:["experimental"],description:_(341,"Controls whether to trigger a command when the inline suggestion provider changes."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:"string",default:e.experimental.showOnSuggestConflict,tags:["experimental"],enum:["always","never","whenSuggestListIsIncomplete"],description:_(342,"Controls whether to show inline suggestions when there is a suggest conflict."),experiment:{mode:"auto"}},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:_(343,"Controls the font family of the inline suggestions.")},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:e.edits.allowCodeShifting,description:_(344,"Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:e.edits.renderSideBySide,description:_(345,"Controls whether larger suggestions can be shown side by side."),enum:["auto","never"],enumDescriptions:[_(346,"Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),_(347,"Larger suggestions are never shown side by side and will always be shown below.")],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:e.edits.showCollapsed,description:_(348,"Controls whether the suggestion will show as collapsed until jumping to it."),tags:["nextEditSuggestions"]}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),mode:vt(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:vt(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:se(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:se(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Ti.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:se(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:at.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:se(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:{enabled:se(t.edits?.enabled,this.defaultValue.edits.enabled),showCollapsed:se(t.edits?.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:vt(t.edits?.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),renderSideBySide:vt(t.edits?.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"])},triggerCommandOnProviderChange:se(t.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:{suppressInlineSuggestions:Ti.string(t.experimental?.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:vt(t.experimental?.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,["always","never","whenSuggestListIsIncomplete"]),emptyResponseInformation:se(t.experimental?.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}}}class Ose extends Mt{constructor(){const e={enabled:pi.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:pi.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:_(349,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:_(350,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:se(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class Pse extends Mt{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(22,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[_(351,"Enables bracket pair guides."),_(352,"Enables bracket pair guides only for the active bracket pair."),_(353,"Disables bracket pair guides.")],default:e.bracketPairs,description:_(354,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[_(355,"Enables horizontal guides as addition to vertical bracket pair guides."),_(356,"Enables horizontal guides only for the active bracket pair."),_(357,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:_(358,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:_(359,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:_(360,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[_(361,"Highlights the active indent guide."),_(362,"Highlights the active indent guide even if bracket guides are highlighted."),_(363,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:_(364,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:Of(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Of(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:se(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:se(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Of(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Of(s,e,t){const n=t.indexOf(s);return n===-1?e:t[n]}class Fse extends Mt{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(134,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[_(365,"Insert suggestion without overwriting text right of the cursor."),_(366,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:_(367,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:_(368,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:_(369,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:_(370,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[_(371,"Always select a suggestion when automatically triggering IntelliSense."),_(372,"Never select a suggestion when automatically triggering IntelliSense."),_(373,"Select a suggestion only when triggering IntelliSense from a trigger character."),_(374,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:_(375,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:_(376,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:_(377,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:_(378,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:_(379,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:_(380,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:_(381,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:_(382,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:_(383,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:_(384,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:_(385,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:_(386,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:_(387,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:_(388,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:_(389,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:_(390,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:_(391,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:_(392,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:_(393,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:_(394,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:_(395,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:_(396,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:_(397,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:_(398,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:_(399,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:_(400,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:_(401,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:_(402,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:_(403,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:_(404,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:_(405,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:_(406,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:_(407,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:_(408,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:_(409,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:_(410,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:_(411,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:_(412,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:vt(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:se(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:se(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:se(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:se(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:vt(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:se(t.showIcons,this.defaultValue.showIcons),showStatusBar:se(t.showStatusBar,this.defaultValue.showStatusBar),preview:se(t.preview,this.defaultValue.preview),previewMode:vt(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:se(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:se(t.showMethods,this.defaultValue.showMethods),showFunctions:se(t.showFunctions,this.defaultValue.showFunctions),showConstructors:se(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:se(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:se(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:se(t.showFields,this.defaultValue.showFields),showVariables:se(t.showVariables,this.defaultValue.showVariables),showClasses:se(t.showClasses,this.defaultValue.showClasses),showStructs:se(t.showStructs,this.defaultValue.showStructs),showInterfaces:se(t.showInterfaces,this.defaultValue.showInterfaces),showModules:se(t.showModules,this.defaultValue.showModules),showProperties:se(t.showProperties,this.defaultValue.showProperties),showEvents:se(t.showEvents,this.defaultValue.showEvents),showOperators:se(t.showOperators,this.defaultValue.showOperators),showUnits:se(t.showUnits,this.defaultValue.showUnits),showValues:se(t.showValues,this.defaultValue.showValues),showConstants:se(t.showConstants,this.defaultValue.showConstants),showEnums:se(t.showEnums,this.defaultValue.showEnums),showEnumMembers:se(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:se(t.showKeywords,this.defaultValue.showKeywords),showWords:se(t.showWords,this.defaultValue.showWords),showColors:se(t.showColors,this.defaultValue.showColors),showFiles:se(t.showFiles,this.defaultValue.showFiles),showReferences:se(t.showReferences,this.defaultValue.showReferences),showFolders:se(t.showFolders,this.defaultValue.showFolders),showTypeParameters:se(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:se(t.showSnippets,this.defaultValue.showSnippets),showUsers:se(t.showUsers,this.defaultValue.showUsers),showIssues:se(t.showIssues,this.defaultValue.showIssues)}}}class Bse extends Mt{constructor(){super(129,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:_(413,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:_(414,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:se(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:se(e.selectSubwords,this.defaultValue.selectSubwords)}}}class Vse extends Mt{constructor(){const e=[];super(147,"wordSegmenterLocales",e,{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:_(415,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"},default:e})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")try{Intl.Segmenter.supportedLocalesOf(n).length>0&&t.push(n)}catch{}return t}return this.defaultValue}}class Wse extends Mt{constructor(){super(155,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[_(416,"No indentation. Wrapped lines begin at column 1."),_(417,"Wrapped lines get the same indentation as the parent."),_(418,"Wrapped lines get +1 indentation toward the parent."),_(419,"Wrapped lines get +2 indentation toward the parent.")],description:_(420,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,n){return t.get(2)===2?0:n}}class Hse extends Fc{constructor(){super(166)}compute(e,t,n){const i=t.get(165);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:i.isWordWrapMinified,isViewportWrapping:i.isViewportWrapping,wrappingColumn:i.wrappingColumn}}}class zse extends Mt{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(43,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:_(421,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:_(422,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[_(423,"Show the drop selector widget after a file is dropped into the editor."),_(424,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),showDropSelector:vt(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class $se extends Mt{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(97,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:_(425,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:_(426,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[_(427,"Show the paste selector widget after content is pasted into the editor."),_(428,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),showPasteSelector:vt(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const Ys={fontFamily:He?"Menlo, Monaco, 'Courier New', monospace":hs?"Consolas, 'Courier New', monospace":"'Droid Sans Mono', 'monospace', monospace",fontWeight:"normal",fontSize:He?12:14,lineHeight:0,letterSpacing:0},Pf=[];function K(s){return Pf[s.id]=s,s}const rh={acceptSuggestionOnCommitCharacter:K(new De(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:_(429,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:K(new Rt(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",_(430,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:_(431,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:K(new ise),accessibilityPageSize:K(new at(3,"accessibilityPageSize",500,1,1073741824,{description:_(432,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),allowOverflow:K(new De(4,"allowOverflow",!0)),allowVariableLineHeights:K(new De(5,"allowVariableLineHeights",!0,{description:_(433,"Controls whether to allow using variable line heights in the editor.")})),allowVariableFonts:K(new De(6,"allowVariableFonts",!0,{description:_(434,"Controls whether to allow using variable fonts in the editor.")})),allowVariableFontsInAccessibilityMode:K(new De(7,"allowVariableFontsInAccessibilityMode",!1,{description:_(435,"Controls whether to allow using variable fonts in the editor in the accessibility mode."),tags:["accessibility"]})),ariaLabel:K(new Ti(8,"ariaLabel",_(436,"Editor content"))),ariaRequired:K(new De(9,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:K(new De(12,"screenReaderAnnounceInlineSuggestion",!0,{description:_(437,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:K(new Rt(10,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",_(438,"Use language configurations to determine when to autoclose brackets."),_(439,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:_(440,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:K(new Rt(11,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",_(441,"Use language configurations to determine when to autoclose comments."),_(442,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:_(443,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:K(new Rt(13,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",_(444,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:_(445,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:K(new Rt(14,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",_(446,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:_(447,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:K(new Rt(15,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",_(448,"Use language configurations to determine when to autoclose quotes."),_(449,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:_(450,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:K(new Am(16,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],nse,{enumDescriptions:[_(451,"The editor will not insert indentation automatically."),_(452,"The editor will keep the current line's indentation."),_(453,"The editor will keep the current line's indentation and honor language defined brackets."),_(454,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),_(455,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:_(456,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),autoIndentOnPaste:K(new De(17,"autoIndentOnPaste",!1,{description:_(457,"Controls whether the editor should automatically auto-indent the pasted content.")})),autoIndentOnPasteWithinString:K(new De(18,"autoIndentOnPasteWithinString",!0,{description:_(458,"Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.")})),automaticLayout:K(new De(19,"automaticLayout",!1)),autoSurround:K(new Rt(20,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[_(459,"Use language configurations to determine when to automatically surround selections."),_(460,"Surround with quotes but not brackets."),_(461,"Surround with brackets but not quotes."),""],description:_(462,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:K(new Ose),bracketPairGuides:K(new Pse),stickyTabStops:K(new De(132,"stickyTabStops",!1,{description:_(463,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:K(new De(23,"codeLens",!0,{description:_(464,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:K(new Ti(24,"codeLensFontFamily","",{description:_(465,"Controls the font family for CodeLens.")})),codeLensFontSize:K(new at(25,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:_(466,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:K(new De(26,"colorDecorators",!0,{description:_(467,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:K(new Rt(168,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[_(468,"Make the color picker appear both on click and hover of the color decorator"),_(469,"Make the color picker appear on hover of the color decorator"),_(470,"Make the color picker appear on click of the color decorator")],description:_(471,"Controls the condition to make a color picker appear from a color decorator.")})),colorDecoratorsLimit:K(new at(27,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:_(472,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:K(new De(28,"columnSelection",!1,{description:_(473,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:K(new sse),contextmenu:K(new De(30,"contextmenu",!0)),copyWithSyntaxHighlighting:K(new De(31,"copyWithSyntaxHighlighting",!0,{description:_(474,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:K(new Am(32,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],rse,{description:_(475,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:K(new Rt(33,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[_(476,"Smooth caret animation is disabled."),_(477,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),_(478,"Smooth caret animation is always enabled.")],description:_(479,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:K(new Am(34,"cursorStyle",Fn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],U7,{description:_(480,"Controls the cursor style in insert input mode.")})),overtypeCursorStyle:K(new Am(92,"overtypeCursorStyle",Fn.Block,"block",["line","block","underline","line-thin","block-outline","underline-thin"],U7,{description:_(481,"Controls the cursor style in overtype input mode.")})),cursorSurroundingLines:K(new at(35,"cursorSurroundingLines",0,0,1073741824,{description:_(482,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:K(new Rt(36,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[_(483,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),_(484,"`cursorSurroundingLines` is enforced always.")],markdownDescription:_(485,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:K(new at(37,"cursorWidth",0,0,1073741824,{markdownDescription:_(486,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),cursorHeight:K(new at(38,"cursorHeight",0,0,1073741824,{markdownDescription:_(487,"Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.")})),disableLayerHinting:K(new De(39,"disableLayerHinting",!1)),disableMonospaceOptimizations:K(new De(40,"disableMonospaceOptimizations",!1)),domReadOnly:K(new De(41,"domReadOnly",!1)),dragAndDrop:K(new De(42,"dragAndDrop",!0,{description:_(488,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:K(new ase),dropIntoEditor:K(new zse),editContext:K(new De(44,"editContext",!0,{description:_(489,"Sets whether the EditContext API should be used instead of the text area to power input in the editor."),included:gE||V7||Im})),renderRichScreenReaderContent:K(new De(107,"renderRichScreenReaderContent",!1,{markdownDescription:_(490,"Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")})),stickyScroll:K(new bse),experimentalGpuAcceleration:K(new Rt(46,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[_(491,"Use regular DOM-based rendering."),_(492,"Use GPU acceleration.")],description:_(493,"Controls whether to use the experimental GPU acceleration to render the editor.")})),experimentalWhitespaceRendering:K(new Rt(47,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[_(494,"Use a new rendering method with svgs."),_(495,"Use a new rendering method with font characters."),_(496,"Use the stable rendering method.")],description:_(497,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:K(new Ti(48,"extraEditorClassName","")),fastScrollSensitivity:K(new Gs(49,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:_(498,"Scrolling speed multiplier when pressing `Alt`.")})),find:K(new lse),fixedOverflowWidgets:K(new De(51,"fixedOverflowWidgets",!1)),folding:K(new De(52,"folding",!0,{description:_(499,"Controls whether the editor has code folding enabled.")})),foldingStrategy:K(new Rt(53,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[_(500,"Use a language-specific folding strategy if available, else the indentation-based one."),_(501,"Use the indentation-based folding strategy.")],description:_(502,"Controls the strategy for computing folding ranges.")})),foldingHighlight:K(new De(54,"foldingHighlight",!0,{description:_(503,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:K(new De(55,"foldingImportsByDefault",!1,{description:_(504,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:K(new at(56,"foldingMaximumRegions",5e3,10,65e3,{description:_(505,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:K(new De(57,"unfoldOnClickAfterEndOfLine",!1,{description:_(506,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:K(new Ti(58,"fontFamily",Ys.fontFamily,{description:_(507,"Controls the font family.")})),fontInfo:K(new cse),fontLigatures2:K(new Bc),fontSize:K(new fse),fontWeight:K(new _E),fontVariations:K(new Om),formatOnPaste:K(new De(64,"formatOnPaste",!1,{description:_(508,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:K(new De(65,"formatOnType",!1,{description:_(509,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:K(new De(66,"glyphMargin",!0,{description:_(510,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:K(new gse),hideCursorInOverviewRuler:K(new De(68,"hideCursorInOverviewRuler",!1,{description:_(511,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:K(new pse),inDiffEditor:K(new De(70,"inDiffEditor",!1)),inertialScroll:K(new De(158,"inertialScroll",!1,{description:_(512,"Make scrolling inertial - mostly useful with touchpad on linux.")})),letterSpacing:K(new Gs(72,"letterSpacing",Ys.letterSpacing,s=>Gs.clamp(s,-5,20),{description:_(513,"Controls the letter spacing in pixels.")})),lightbulb:K(new _se),lineDecorationsWidth:K(new Cse),lineHeight:K(new vse),lineNumbers:K(new Dse),lineNumbersMinChars:K(new at(77,"lineNumbersMinChars",5,1,300)),linkedEditing:K(new De(78,"linkedEditing",!1,{description:_(514,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:K(new De(79,"links",!0,{description:_(515,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:K(new Rt(80,"matchBrackets","always",["always","near","never"],{description:_(516,"Highlight matching brackets.")})),minimap:K(new yse),mouseStyle:K(new Rt(82,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:K(new Gs(83,"mouseWheelScrollSensitivity",1,s=>s===0?1:s,{markdownDescription:_(517,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:K(new De(84,"mouseWheelZoom",!1,{markdownDescription:He?_(518,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):_(519,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:K(new De(85,"multiCursorMergeOverlapping",!0,{description:_(520,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:K(new Am(86,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Sse,{markdownEnumDescriptions:[_(521,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),_(522,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:_(523,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),mouseMiddleClickAction:K(new Rt(87,"mouseMiddleClickAction","default",["default","openLink","ctrlLeftClick"],{description:_(524,"Controls what happens when middle mouse button is clicked in the editor.")})),multiCursorPaste:K(new Rt(88,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[_(525,"Each cursor pastes a single line of the text."),_(526,"Each cursor pastes the full text.")],markdownDescription:_(527,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:K(new at(89,"multiCursorLimit",1e4,1,1e5,{markdownDescription:_(528,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:K(new Rt(90,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[_(529,"Does not highlight occurrences."),_(530,"Highlights occurrences only in the current file."),_(531,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:_(532,"Controls whether occurrences should be highlighted across open files.")})),occurrencesHighlightDelay:K(new at(91,"occurrencesHighlightDelay",0,0,2e3,{description:_(533,"Controls the delay in milliseconds after which occurrences are highlighted."),tags:["preview"]})),overtypeOnPaste:K(new De(93,"overtypeOnPaste",!0,{description:_(534,"Controls whether pasting should overtype.")})),overviewRulerBorder:K(new De(94,"overviewRulerBorder",!0,{description:_(535,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:K(new at(95,"overviewRulerLanes",3,0,3)),padding:K(new xse),pasteAs:K(new $se),parameterHints:K(new Lse),peekWidgetDefaultFocus:K(new Rt(99,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[_(536,"Focus the tree when opening peek"),_(537,"Focus the editor when opening peek")],description:_(538,"Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:K(new Ese),definitionLinkOpensInPeek:K(new De(101,"definitionLinkOpensInPeek",!1,{description:_(539,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:K(new Nse),quickSuggestionsDelay:K(new at(103,"quickSuggestionsDelay",10,0,1073741824,{description:_(540,"Controls the delay in milliseconds after which quick suggestions will show up."),experiment:{mode:"auto"}})),readOnly:K(new De(104,"readOnly",!1)),readOnlyMessage:K(new Ise),renameOnType:K(new De(106,"renameOnType",!1,{description:_(541,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:_(542,"Deprecated, use `#editor.linkedEditing#` instead.")})),renderControlCharacters:K(new De(108,"renderControlCharacters",!0,{description:_(543,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:K(new Rt(109,"renderFinalNewline",Ts?"dimmed":"on",["off","on","dimmed"],{description:_(544,"Render last line number when the file ends with a newline.")})),renderLineHighlight:K(new Rt(110,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",_(545,"Highlights both the gutter and the current line.")],description:_(546,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:K(new De(111,"renderLineHighlightOnlyWhenFocus",!1,{description:_(547,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:K(new Rt(112,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:K(new Rt(113,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",_(548,"Render whitespace characters except for single spaces between words."),_(549,"Render whitespace characters only on selected text."),_(550,"Render only trailing whitespace characters."),""],description:_(551,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:K(new at(114,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:K(new De(115,"roundedSelection",!0,{description:_(552,"Controls whether selections should have rounded corners.")})),rulers:K(new Tse),scrollbar:K(new Mse),scrollBeyondLastColumn:K(new at(118,"scrollBeyondLastColumn",4,0,1073741824,{description:_(553,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:K(new De(119,"scrollBeyondLastLine",!0,{description:_(554,"Controls whether the editor will scroll beyond the last line.")})),scrollOnMiddleClick:K(new De(171,"scrollOnMiddleClick",!1,{description:_(555,"Controls whether the editor will scroll when the middle button is pressed.")})),scrollPredominantAxis:K(new De(120,"scrollPredominantAxis",!0,{description:_(556,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:K(new De(121,"selectionClipboard",!0,{description:_(557,"Controls whether the Linux primary clipboard should be supported."),included:Ts})),selectionHighlight:K(new De(122,"selectionHighlight",!0,{description:_(558,"Controls whether the editor should highlight matches similar to the selection.")})),selectionHighlightMaxLength:K(new at(123,"selectionHighlightMaxLength",200,0,1073741824,{description:_(559,"Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.")})),selectionHighlightMultiline:K(new De(124,"selectionHighlightMultiline",!1,{description:_(560,"Controls whether the editor should highlight selection matches that span multiple lines.")})),selectOnLineNumbers:K(new De(125,"selectOnLineNumbers",!0)),showFoldingControls:K(new Rt(126,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[_(561,"Always show the folding controls."),_(562,"Never show the folding controls and reduce the gutter size."),_(563,"Only show the folding controls when the mouse is over the gutter.")],description:_(564,"Controls when the folding controls on the gutter are shown.")})),showUnused:K(new De(127,"showUnused",!0,{description:_(565,"Controls fading out of unused code.")})),showDeprecated:K(new De(157,"showDeprecated",!0,{description:_(566,"Controls strikethrough deprecated variables.")})),inlayHints:K(new wse),snippetSuggestions:K(new Rt(128,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[_(567,"Show snippet suggestions on top of other suggestions."),_(568,"Show snippet suggestions below other suggestions."),_(569,"Show snippets suggestions with other suggestions."),_(570,"Do not show snippet suggestions.")],description:_(571,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:K(new Bse),smoothScrolling:K(new De(130,"smoothScrolling",!1,{description:_(572,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:K(new at(133,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:K(new Fse),inlineSuggest:K(new Ase),inlineCompletionsAccessibilityVerbose:K(new De(169,"inlineCompletionsAccessibilityVerbose",!1,{description:_(573,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:K(new at(135,"suggestFontSize",0,0,1e3,{markdownDescription:_(574,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:K(new at(136,"suggestLineHeight",0,0,1e3,{markdownDescription:_(575,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:K(new De(137,"suggestOnTriggerCharacters",!0,{description:_(576,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:K(new Rt(138,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[_(577,"Always select the first suggestion."),_(578,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),_(579,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:_(580,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:K(new Rt(139,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[_(581,"Tab complete will insert the best matching suggestion when pressing tab."),_(582,"Disable tab completions."),_(583,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:_(584,"Enables tab completions.")})),tabIndex:K(new at(140,"tabIndex",0,-1,1073741824)),trimWhitespaceOnDelete:K(new De(141,"trimWhitespaceOnDelete",!1,{description:_(585,"Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.")})),unicodeHighlight:K(new Rse),unusualLineTerminators:K(new Rt(143,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[_(586,"Unusual line terminators are automatically removed."),_(587,"Unusual line terminators are ignored."),_(588,"Unusual line terminators prompt to be removed.")],description:_(589,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:K(new De(144,"useShadowDOM",!0)),useTabStops:K(new De(145,"useTabStops",!0,{description:_(590,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:K(new Rt(146,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[_(591,"Use the default line break rule."),_(592,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:_(593,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:K(new Vse),wordSeparators:K(new Ti(148,"wordSeparators",W7,{description:_(594,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:K(new Rt(149,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[_(595,"Lines will never wrap."),_(596,"Lines will wrap at the viewport width."),_(597,"Lines will wrap at `#editor.wordWrapColumn#`."),_(598,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:_(599,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:K(new Ti(150,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:K(new Ti(151,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:K(new at(152,"wordWrapColumn",80,1,1073741824,{markdownDescription:_(600,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:K(new Rt(153,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:K(new Rt(154,"wordWrapOverride2","inherit",["off","on","inherit"])),wrapOnEscapedLineFeeds:K(new De(160,"wrapOnEscapedLineFeeds",!1,{markdownDescription:_(601,'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n world"\n```')})),effectiveCursorStyle:K(new dse),editorClassName:K(new ose),defaultColorDecorators:K(new Rt(167,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[_(602,"Show default color decorators only when no extension provides colors decorators."),_(603,"Always show default color decorators."),_(604,"Never show default color decorators.")],description:_(605,"Controls whether inline color decorations should be shown using the default document color provider.")})),pixelRatio:K(new kse),tabFocusMode:K(new De(164,"tabFocusMode",!1,{markdownDescription:_(606,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:K(new Af),wrappingInfo:K(new Hse),wrappingIndent:K(new Wse),wrappingStrategy:K(new mse),effectiveEditContextEnabled:K(new hse),effectiveAllowVariableFonts:K(new use)};function Pm(s,e){const t=this;let n=!1,i;return function(){return n||(n=!0,i=s.apply(t,arguments)),i}}function BTe(s,e){}function VTe(s){return s}function $w(s){return typeof s=="object"&&s!==null&&typeof s.dispose=="function"&&s.dispose.length===0}function xn(s){if(it.is(s)){const e=[];for(const t of s)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function ra(...s){return Ce(()=>xn(s))}class Use{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function Ce(s){return new Use(s)}const ox=class ox{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{xn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===U.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ox.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};ox.DISABLE_DISPOSED_WARNING=!1;let le=ox;const UO=class UO{constructor(){this._store=new le,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};UO.None=Object.freeze({dispose(){}});let U=UO;class Bn{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}class jse{constructor(e){this.object=e}dispose(){}}class bE{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{xn(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const Kse=globalThis.performance.now.bind(globalThis.performance);class pl{static create(e){return new pl(e)}constructor(e){this._now=e===!1?Date.now:Kse,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var X;(function(s){s.None=()=>U.None;function e(I,F){return u(I,()=>{},0,void 0,!0,void 0,F)}s.defer=e;function t(I){return(F,W=null,z)=>{let G=!1,Y;return Y=I(Q=>{if(!G)return Y?Y.dispose():G=!0,F.call(W,Q)},null,z),G&&Y.dispose(),Y}}s.once=t;function n(I,F){return s.once(s.filter(I,F))}s.onceIf=n;function i(I,F,W){return d((z,G=null,Y)=>I(Q=>z.call(G,F(Q)),null,Y),W)}s.map=i;function r(I,F,W){return d((z,G=null,Y)=>I(Q=>{F(Q),z.call(G,Q)},null,Y),W)}s.forEach=r;function o(I,F,W){return d((z,G=null,Y)=>I(Q=>F(Q)&&z.call(G,Q),null,Y),W)}s.filter=o;function a(I){return I}s.signal=a;function l(...I){return(F,W=null,z)=>{const G=ra(...I.map(Y=>Y(Q=>F.call(W,Q))));return h(G,z)}}s.any=l;function c(I,F,W,z){let G=W;return i(I,Y=>(G=F(G,Y),G),z)}s.reduce=c;function d(I,F){let W;const z={onWillAddFirstListener(){W=I(G.fire,G)},onDidRemoveLastListener(){W?.dispose()}},G=new A(z);return F?.add(G),G.event}function h(I,F){return F instanceof Array?F.push(I):F&&F.add(I),I}function u(I,F,W=100,z=!1,G=!1,Y,Q){let oe,me,Ie,qt=0,Qe;const Ot={leakWarningThreshold:Y,onWillAddFirstListener(){oe=I(ei=>{qt++,me=F(me,ei),z&&!Ie&&(ot.fire(me),me=void 0),Qe=()=>{const Jt=me;me=void 0,Ie=void 0,(!z||qt>1)&&ot.fire(Jt),qt=0},typeof W=="number"?(Ie&&clearTimeout(Ie),Ie=setTimeout(Qe,W)):Ie===void 0&&(Ie=null,queueMicrotask(Qe))})},onWillRemoveListener(){G&&qt>0&&Qe?.()},onDidRemoveLastListener(){Qe=void 0,oe.dispose()}},ot=new A(Ot);return Q?.add(ot),ot.event}s.debounce=u;function f(I,F=0,W){return s.debounce(I,(z,G)=>z?(z.push(G),z):[G],F,void 0,!0,void 0,W)}s.accumulate=f;function g(I,F=(z,G)=>z===G,W){let z=!0,G;return o(I,Y=>{const Q=z||!F(Y,G);return z=!1,G=Y,Q},W)}s.latch=g;function p(I,F,W){return[s.filter(I,F,W),s.filter(I,z=>!F(z),W)]}s.split=p;function m(I,F=!1,W=[],z){let G=W.slice(),Y=I(me=>{G?G.push(me):oe.fire(me)});z&&z.add(Y);const Q=()=>{G?.forEach(me=>oe.fire(me)),G=null},oe=new A({onWillAddFirstListener(){Y||(Y=I(me=>oe.fire(me)),z&&z.add(Y))},onDidAddFirstListener(){G&&(F?setTimeout(Q):Q())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return z&&z.add(oe),oe.event}s.buffer=m;function b(I,F){return(z,G,Y)=>{const Q=F(new C);return I(function(oe){const me=Q.evaluate(oe);me!==w&&z.call(G,me)},void 0,Y)}}s.chain=b;const w=Symbol("HaltChainable");class C{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(W=>(F(W),W)),this}filter(F){return this.steps.push(W=>F(W)?W:w),this}reduce(F,W){let z=W;return this.steps.push(G=>(z=F(z,G),z)),this}latch(F=(W,z)=>W===z){let W=!0,z;return this.steps.push(G=>{const Y=W||!F(G,z);return W=!1,z=G,Y?G:w}),this}evaluate(F){for(const W of this.steps)if(F=W(F),F===w)break;return F}}function v(I,F,W=z=>z){const z=(...oe)=>Q.fire(W(...oe)),G=()=>I.on(F,z),Y=()=>I.removeListener(F,z),Q=new A({onWillAddFirstListener:G,onDidRemoveLastListener:Y});return Q.event}s.fromNodeEventEmitter=v;function S(I,F,W=z=>z){const z=(...oe)=>Q.fire(W(...oe)),G=()=>I.addEventListener(F,z),Y=()=>I.removeEventListener(F,z),Q=new A({onWillAddFirstListener:G,onDidRemoveLastListener:Y});return Q.event}s.fromDOMEventEmitter=S;function k(I,F){let W;const z=new Promise((G,Y)=>{const Q=t(I)(G,null,F);W=()=>Q.dispose()});return z.cancel=W,z}s.toPromise=k;function L(I,F){return I(W=>F.fire(W))}s.forward=L;function E(I,F,W){return F(W),I(z=>F(z))}s.runAndSubscribe=E;class N{constructor(F,W){this._observable=F,this._counter=0,this._hasChanged=!1;const z={onWillAddFirstListener:()=>{F.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{F.removeObserver(this)}};this.emitter=new A(z),W&&W.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,W){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function M(I,F){return new N(I,F).emitter.event}s.fromObservable=M;function O(I){return(F,W,z)=>{let G=0,Y=!1;const Q={beginUpdate(){G++},endUpdate(){G--,G===0&&(I.reportChanges(),Y&&(Y=!1,F.call(W)))},handlePossibleChange(){},handleChange(){Y=!0}};I.addObserver(Q),I.reportChanges();const oe={dispose(){I.removeObserver(Q)}};return z instanceof le?z.add(oe):Array.isArray(z)&&z.push(oe),oe}}s.fromObservableLight=O})(X||(X={}));const kp=class kp{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${kp._idPool++}`,kp.all.add(this)}start(e){this._stopWatch=new pl,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};kp.all=new Set,kp._idPool=0;let wE=kp,qse=-1;const ax=class ax{constructor(e,t,n=(ax._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){const n=this.threshold;if(n<=0||t<n)return;this._stacks||(this._stacks=new Map);const i=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;const[r,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(r);const l=new Gse(a,r);this._errorHandler(l)}return()=>{const r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[n,i]of this._stacks)(!e||t<i)&&(e=[n,i],t=i);return e}};ax._idPool=1;let CE=ax;class vE{static create(){const e=new Error;return new vE(e.stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split(`
|
|
125
|
+
- Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,n){return e.fontInfo.lineHeight}}class yse extends Mt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:_(273,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[_(274,"The minimap is always shown."),_(275,"The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),_(276,"The minimap is only shown when the editor is scrolled")],default:e.autohide,description:_(277,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[_(278,"The minimap has the same size as the editor contents (and might scroll)."),_(279,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),_(280,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:_(281,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:_(282,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:_(283,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:_(284,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:_(285,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:_(286,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:_(287,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:_(288,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.markSectionHeaderRegex":{type:"string",default:e.markSectionHeaderRegex,description:_(289,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:_(290,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:_(291,"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;let n=this.defaultValue.markSectionHeaderRegex;const i=e.markSectionHeaderRegex;if(typeof i=="string")try{new RegExp(i,"d"),n=i}catch{}return{enabled:se(t.enabled,this.defaultValue.enabled),autohide:vt(t.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:vt(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:vt(t.side,this.defaultValue.side,["right","left"]),showSlider:vt(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:se(t.renderCharacters,this.defaultValue.renderCharacters),scale:at.clampedInt(t.scale,1,1,3),maxColumn:at.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:se(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:se(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:n,sectionHeaderFontSize:Gs.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:Gs.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function Sse(s){return s==="ctrlCmd"?He?"metaKey":"ctrlKey":"altKey"}class xse extends Mt{constructor(){super(96,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:_(292,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:_(293,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:at.clampedInt(t.top,0,0,1e3),bottom:at.clampedInt(t.bottom,0,0,1e3)}}}class Lse extends Mt{constructor(){const e={enabled:!0,cycle:!0};super(98,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:_(294,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:_(295,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),cycle:se(t.cycle,this.defaultValue.cycle)}}}class kse extends Fc{constructor(){super(163)}compute(e,t,n){return e.pixelRatio}}class Ese extends Mt{constructor(){super(100,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class Nse extends Mt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[_(296,"Quick suggestions show inside the suggest widget"),_(297,"Quick suggestions show as ghost text"),_(298,"Quick suggestions are disabled")]}];super(102,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:_(299,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:_(300,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:_(301,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:_(302,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:n,strings:i}=e,r=["on","inline","off"];let o,a,l;return typeof t=="boolean"?o=t?"on":"off":o=vt(t,this.defaultValue.other,r),typeof n=="boolean"?a=n?"on":"off":a=vt(n,this.defaultValue.comments,r),typeof i=="boolean"?l=i?"on":"off":l=vt(i,this.defaultValue.strings,r),{other:o,comments:a,strings:l}}}class Dse extends Mt{constructor(){super(76,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[_(303,"Line numbers are not rendered."),_(304,"Line numbers are rendered as absolute number."),_(305,"Line numbers are rendered as distance in lines to cursor position."),_(306,"Line numbers are rendered every 10 lines.")],default:"on",description:_(307,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,n=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:n}}}function Hw(s){const e=s.get(112);return e==="editable"?s.get(104):e!=="on"}function zw(s){return!s.get(172)}class Tse extends Mt{constructor(){const e=[],t={type:"number",description:_(308,"Number of monospace characters at which this editor ruler will render.")};super(116,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:_(309,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:_(310,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="number")t.push({column:at.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n=="object"){const i=n;t.push({column:at.clampedInt(i.column,0,0,1e4),color:i.color})}return t.sort((n,i)=>n.column-i.column),t}return this.defaultValue}}class Ise extends Mt{constructor(){super(105,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function j7(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return 2;case"visible":return 3;default:return 1}}let Mse=class extends Mt{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(117,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[_(311,"The vertical scrollbar will be visible only when necessary."),_(312,"The vertical scrollbar will always be visible."),_(313,"The vertical scrollbar will always be hidden.")],default:"auto",description:_(314,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[_(315,"The horizontal scrollbar will be visible only when necessary."),_(316,"The horizontal scrollbar will always be visible."),_(317,"The horizontal scrollbar will always be hidden.")],default:"auto",description:_(318,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:_(319,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:_(320,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:_(321,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:_(322,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,n=at.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),i=at.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:at.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:j7(t.vertical,this.defaultValue.vertical),horizontal:j7(t.horizontal,this.defaultValue.horizontal),useShadows:se(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:se(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:se(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:se(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:se(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:at.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:i,verticalSliderSize:at.clampedInt(t.verticalSliderSize,i,0,1e3),scrollByPage:se(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:se(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Co="inUntrustedWorkspace",sh={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class Rse extends Mt{constructor(){const e={nonBasicASCII:Co,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Co,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(142,"unicodeHighlight",e,{[sh.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Co],default:e.nonBasicASCII,description:_(323,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[sh.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:_(324,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[sh.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:_(325,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[sh.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Co],default:e.includeComments,description:_(326,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[sh.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Co],default:e.includeStrings,description:_(327,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[sh.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:_(328,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[sh.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:_(329,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(Ds(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(Ds(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));const i=super.applyUpdate(e,t);return n?new Rm(i.newValue,!0):i}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:Of(t.nonBasicASCII,Co,[!0,!1,Co]),invisibleCharacters:se(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:se(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Of(t.includeComments,Co,[!0,!1,Co]),includeStrings:Of(t.includeStrings,Co,[!0,!1,Co]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const n={};for(const[i,r]of Object.entries(e))r===!0&&(n[i]=!0);return n}}class Ase extends Mt{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default",syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!1,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:"auto",allowCodeShifting:"always"},triggerCommandOnProviderChange:!0,experimental:{suppressInlineSuggestions:"",showOnSuggestConflict:"never",emptyResponseInformation:!0}};super(71,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:_(330,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[_(331,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),_(332,"Show the inline suggestion toolbar when hovering over an inline suggestion."),_(333,"Never show the inline suggestion toolbar.")],description:_(334,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:e.syntaxHighlightingEnabled,description:_(335,"Controls whether to show syntax highlighting for inline suggestions in the editor.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:_(336,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.suppressInSnippetMode":{type:"boolean",default:e.suppressInSnippetMode,description:_(337,"Controls whether inline suggestions are suppressed when in snippet mode.")},"editor.inlineSuggest.minShowDelay":{type:"number",default:0,minimum:0,maximum:1e4,description:_(338,"Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.")},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"string",default:e.experimental.suppressInlineSuggestions,tags:["experimental"],description:_(339,"Suppresses inline completions for specified extension IDs -- comma separated."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:"boolean",default:e.experimental.emptyResponseInformation,tags:["experimental"],description:_(340,"Controls whether to send request information from the inline suggestion provider."),experiment:{mode:"auto"}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:"boolean",default:e.triggerCommandOnProviderChange,tags:["experimental"],description:_(341,"Controls whether to trigger a command when the inline suggestion provider changes."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:"string",default:e.experimental.showOnSuggestConflict,tags:["experimental"],enum:["always","never","whenSuggestListIsIncomplete"],description:_(342,"Controls whether to show inline suggestions when there is a suggest conflict."),experiment:{mode:"auto"}},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:_(343,"Controls the font family of the inline suggestions.")},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:e.edits.allowCodeShifting,description:_(344,"Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:e.edits.renderSideBySide,description:_(345,"Controls whether larger suggestions can be shown side by side."),enum:["auto","never"],enumDescriptions:[_(346,"Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),_(347,"Larger suggestions are never shown side by side and will always be shown below.")],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:e.edits.showCollapsed,description:_(348,"Controls whether the suggestion will show as collapsed until jumping to it."),tags:["nextEditSuggestions"]}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),mode:vt(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:vt(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:se(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:se(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Ti.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:se(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:at.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:se(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:{enabled:se(t.edits?.enabled,this.defaultValue.edits.enabled),showCollapsed:se(t.edits?.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:vt(t.edits?.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),renderSideBySide:vt(t.edits?.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"])},triggerCommandOnProviderChange:se(t.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:{suppressInlineSuggestions:Ti.string(t.experimental?.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:vt(t.experimental?.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,["always","never","whenSuggestListIsIncomplete"]),emptyResponseInformation:se(t.experimental?.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}}}class Ose extends Mt{constructor(){const e={enabled:pi.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:pi.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:_(349,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:_(350,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:se(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class Pse extends Mt{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(22,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[_(351,"Enables bracket pair guides."),_(352,"Enables bracket pair guides only for the active bracket pair."),_(353,"Disables bracket pair guides.")],default:e.bracketPairs,description:_(354,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[_(355,"Enables horizontal guides as addition to vertical bracket pair guides."),_(356,"Enables horizontal guides only for the active bracket pair."),_(357,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:_(358,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:_(359,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:_(360,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[_(361,"Highlights the active indent guide."),_(362,"Highlights the active indent guide even if bracket guides are highlighted."),_(363,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:_(364,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:Of(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Of(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:se(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:se(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Of(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function Of(s,e,t){const n=t.indexOf(s);return n===-1?e:t[n]}class Fse extends Mt{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(134,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[_(365,"Insert suggestion without overwriting text right of the cursor."),_(366,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:_(367,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:_(368,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:_(369,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:_(370,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[_(371,"Always select a suggestion when automatically triggering IntelliSense."),_(372,"Never select a suggestion when automatically triggering IntelliSense."),_(373,"Select a suggestion only when triggering IntelliSense from a trigger character."),_(374,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:_(375,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:_(376,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:_(377,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:_(378,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:_(379,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:_(380,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:_(381,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:_(382,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:_(383,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:_(384,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:_(385,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:_(386,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:_(387,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:_(388,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:_(389,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:_(390,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:_(391,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:_(392,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:_(393,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:_(394,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:_(395,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:_(396,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:_(397,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:_(398,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:_(399,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:_(400,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:_(401,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:_(402,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:_(403,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:_(404,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:_(405,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:_(406,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:_(407,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:_(408,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:_(409,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:_(410,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:_(411,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:_(412,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:vt(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:se(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:se(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:se(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:se(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:vt(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:se(t.showIcons,this.defaultValue.showIcons),showStatusBar:se(t.showStatusBar,this.defaultValue.showStatusBar),preview:se(t.preview,this.defaultValue.preview),previewMode:vt(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:se(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:se(t.showMethods,this.defaultValue.showMethods),showFunctions:se(t.showFunctions,this.defaultValue.showFunctions),showConstructors:se(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:se(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:se(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:se(t.showFields,this.defaultValue.showFields),showVariables:se(t.showVariables,this.defaultValue.showVariables),showClasses:se(t.showClasses,this.defaultValue.showClasses),showStructs:se(t.showStructs,this.defaultValue.showStructs),showInterfaces:se(t.showInterfaces,this.defaultValue.showInterfaces),showModules:se(t.showModules,this.defaultValue.showModules),showProperties:se(t.showProperties,this.defaultValue.showProperties),showEvents:se(t.showEvents,this.defaultValue.showEvents),showOperators:se(t.showOperators,this.defaultValue.showOperators),showUnits:se(t.showUnits,this.defaultValue.showUnits),showValues:se(t.showValues,this.defaultValue.showValues),showConstants:se(t.showConstants,this.defaultValue.showConstants),showEnums:se(t.showEnums,this.defaultValue.showEnums),showEnumMembers:se(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:se(t.showKeywords,this.defaultValue.showKeywords),showWords:se(t.showWords,this.defaultValue.showWords),showColors:se(t.showColors,this.defaultValue.showColors),showFiles:se(t.showFiles,this.defaultValue.showFiles),showReferences:se(t.showReferences,this.defaultValue.showReferences),showFolders:se(t.showFolders,this.defaultValue.showFolders),showTypeParameters:se(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:se(t.showSnippets,this.defaultValue.showSnippets),showUsers:se(t.showUsers,this.defaultValue.showUsers),showIssues:se(t.showIssues,this.defaultValue.showIssues)}}}class Bse extends Mt{constructor(){super(129,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:_(413,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:_(414,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:se(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:se(e.selectSubwords,this.defaultValue.selectSubwords)}}}class Vse extends Mt{constructor(){const e=[];super(147,"wordSegmenterLocales",e,{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:_(415,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"},default:e})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")try{Intl.Segmenter.supportedLocalesOf(n).length>0&&t.push(n)}catch{}return t}return this.defaultValue}}class Wse extends Mt{constructor(){super(155,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[_(416,"No indentation. Wrapped lines begin at column 1."),_(417,"Wrapped lines get the same indentation as the parent."),_(418,"Wrapped lines get +1 indentation toward the parent."),_(419,"Wrapped lines get +2 indentation toward the parent.")],description:_(420,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,n){return t.get(2)===2?0:n}}class Hse extends Fc{constructor(){super(166)}compute(e,t,n){const i=t.get(165);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:i.isWordWrapMinified,isViewportWrapping:i.isViewportWrapping,wrappingColumn:i.wrappingColumn}}}class zse extends Mt{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(43,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:_(421,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:_(422,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[_(423,"Show the drop selector widget after a file is dropped into the editor."),_(424,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),showDropSelector:vt(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class $se extends Mt{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(97,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:_(425,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:_(426,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[_(427,"Show the paste selector widget after content is pasted into the editor."),_(428,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:se(t.enabled,this.defaultValue.enabled),showPasteSelector:vt(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const Ys={fontFamily:He?"Menlo, Monaco, 'Courier New', monospace":hs?"Consolas, 'Courier New', monospace":"'Droid Sans Mono', 'monospace', monospace",fontWeight:"normal",fontSize:He?12:14,lineHeight:0,letterSpacing:0},Pf=[];function K(s){return Pf[s.id]=s,s}const rh={acceptSuggestionOnCommitCharacter:K(new De(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:_(429,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:K(new Rt(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",_(430,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:_(431,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:K(new ise),accessibilityPageSize:K(new at(3,"accessibilityPageSize",500,1,1073741824,{description:_(432,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),allowOverflow:K(new De(4,"allowOverflow",!0)),allowVariableLineHeights:K(new De(5,"allowVariableLineHeights",!0,{description:_(433,"Controls whether to allow using variable line heights in the editor.")})),allowVariableFonts:K(new De(6,"allowVariableFonts",!0,{description:_(434,"Controls whether to allow using variable fonts in the editor.")})),allowVariableFontsInAccessibilityMode:K(new De(7,"allowVariableFontsInAccessibilityMode",!1,{description:_(435,"Controls whether to allow using variable fonts in the editor in the accessibility mode."),tags:["accessibility"]})),ariaLabel:K(new Ti(8,"ariaLabel",_(436,"Editor content"))),ariaRequired:K(new De(9,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:K(new De(12,"screenReaderAnnounceInlineSuggestion",!0,{description:_(437,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:K(new Rt(10,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",_(438,"Use language configurations to determine when to autoclose brackets."),_(439,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:_(440,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:K(new Rt(11,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",_(441,"Use language configurations to determine when to autoclose comments."),_(442,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:_(443,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:K(new Rt(13,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",_(444,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:_(445,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:K(new Rt(14,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",_(446,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:_(447,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:K(new Rt(15,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",_(448,"Use language configurations to determine when to autoclose quotes."),_(449,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:_(450,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:K(new Am(16,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],nse,{enumDescriptions:[_(451,"The editor will not insert indentation automatically."),_(452,"The editor will keep the current line's indentation."),_(453,"The editor will keep the current line's indentation and honor language defined brackets."),_(454,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),_(455,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:_(456,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),autoIndentOnPaste:K(new De(17,"autoIndentOnPaste",!1,{description:_(457,"Controls whether the editor should automatically auto-indent the pasted content.")})),autoIndentOnPasteWithinString:K(new De(18,"autoIndentOnPasteWithinString",!0,{description:_(458,"Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.")})),automaticLayout:K(new De(19,"automaticLayout",!1)),autoSurround:K(new Rt(20,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[_(459,"Use language configurations to determine when to automatically surround selections."),_(460,"Surround with quotes but not brackets."),_(461,"Surround with brackets but not quotes."),""],description:_(462,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:K(new Ose),bracketPairGuides:K(new Pse),stickyTabStops:K(new De(132,"stickyTabStops",!1,{description:_(463,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:K(new De(23,"codeLens",!0,{description:_(464,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:K(new Ti(24,"codeLensFontFamily","",{description:_(465,"Controls the font family for CodeLens.")})),codeLensFontSize:K(new at(25,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:_(466,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:K(new De(26,"colorDecorators",!0,{description:_(467,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:K(new Rt(168,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[_(468,"Make the color picker appear both on click and hover of the color decorator"),_(469,"Make the color picker appear on hover of the color decorator"),_(470,"Make the color picker appear on click of the color decorator")],description:_(471,"Controls the condition to make a color picker appear from a color decorator.")})),colorDecoratorsLimit:K(new at(27,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:_(472,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:K(new De(28,"columnSelection",!1,{description:_(473,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:K(new sse),contextmenu:K(new De(30,"contextmenu",!0)),copyWithSyntaxHighlighting:K(new De(31,"copyWithSyntaxHighlighting",!0,{description:_(474,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:K(new Am(32,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],rse,{description:_(475,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:K(new Rt(33,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[_(476,"Smooth caret animation is disabled."),_(477,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),_(478,"Smooth caret animation is always enabled.")],description:_(479,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:K(new Am(34,"cursorStyle",Fn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],U7,{description:_(480,"Controls the cursor style in insert input mode.")})),overtypeCursorStyle:K(new Am(92,"overtypeCursorStyle",Fn.Block,"block",["line","block","underline","line-thin","block-outline","underline-thin"],U7,{description:_(481,"Controls the cursor style in overtype input mode.")})),cursorSurroundingLines:K(new at(35,"cursorSurroundingLines",0,0,1073741824,{description:_(482,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:K(new Rt(36,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[_(483,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),_(484,"`cursorSurroundingLines` is enforced always.")],markdownDescription:_(485,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:K(new at(37,"cursorWidth",0,0,1073741824,{markdownDescription:_(486,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),cursorHeight:K(new at(38,"cursorHeight",0,0,1073741824,{markdownDescription:_(487,"Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.")})),disableLayerHinting:K(new De(39,"disableLayerHinting",!1)),disableMonospaceOptimizations:K(new De(40,"disableMonospaceOptimizations",!1)),domReadOnly:K(new De(41,"domReadOnly",!1)),dragAndDrop:K(new De(42,"dragAndDrop",!0,{description:_(488,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:K(new ase),dropIntoEditor:K(new zse),editContext:K(new De(44,"editContext",!0,{description:_(489,"Sets whether the EditContext API should be used instead of the text area to power input in the editor."),included:gE||V7||Im})),renderRichScreenReaderContent:K(new De(107,"renderRichScreenReaderContent",!1,{markdownDescription:_(490,"Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")})),stickyScroll:K(new bse),experimentalGpuAcceleration:K(new Rt(46,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[_(491,"Use regular DOM-based rendering."),_(492,"Use GPU acceleration.")],description:_(493,"Controls whether to use the experimental GPU acceleration to render the editor.")})),experimentalWhitespaceRendering:K(new Rt(47,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[_(494,"Use a new rendering method with svgs."),_(495,"Use a new rendering method with font characters."),_(496,"Use the stable rendering method.")],description:_(497,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:K(new Ti(48,"extraEditorClassName","")),fastScrollSensitivity:K(new Gs(49,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:_(498,"Scrolling speed multiplier when pressing `Alt`.")})),find:K(new lse),fixedOverflowWidgets:K(new De(51,"fixedOverflowWidgets",!1)),folding:K(new De(52,"folding",!0,{description:_(499,"Controls whether the editor has code folding enabled.")})),foldingStrategy:K(new Rt(53,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[_(500,"Use a language-specific folding strategy if available, else the indentation-based one."),_(501,"Use the indentation-based folding strategy.")],description:_(502,"Controls the strategy for computing folding ranges.")})),foldingHighlight:K(new De(54,"foldingHighlight",!0,{description:_(503,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:K(new De(55,"foldingImportsByDefault",!1,{description:_(504,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:K(new at(56,"foldingMaximumRegions",5e3,10,65e3,{description:_(505,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:K(new De(57,"unfoldOnClickAfterEndOfLine",!1,{description:_(506,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:K(new Ti(58,"fontFamily",Ys.fontFamily,{description:_(507,"Controls the font family.")})),fontInfo:K(new cse),fontLigatures2:K(new Bc),fontSize:K(new fse),fontWeight:K(new _E),fontVariations:K(new Om),formatOnPaste:K(new De(64,"formatOnPaste",!1,{description:_(508,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:K(new De(65,"formatOnType",!1,{description:_(509,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:K(new De(66,"glyphMargin",!0,{description:_(510,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:K(new gse),hideCursorInOverviewRuler:K(new De(68,"hideCursorInOverviewRuler",!1,{description:_(511,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:K(new pse),inDiffEditor:K(new De(70,"inDiffEditor",!1)),inertialScroll:K(new De(158,"inertialScroll",!1,{description:_(512,"Make scrolling inertial - mostly useful with touchpad on linux.")})),letterSpacing:K(new Gs(72,"letterSpacing",Ys.letterSpacing,s=>Gs.clamp(s,-5,20),{description:_(513,"Controls the letter spacing in pixels.")})),lightbulb:K(new _se),lineDecorationsWidth:K(new Cse),lineHeight:K(new vse),lineNumbers:K(new Dse),lineNumbersMinChars:K(new at(77,"lineNumbersMinChars",5,1,300)),linkedEditing:K(new De(78,"linkedEditing",!1,{description:_(514,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:K(new De(79,"links",!0,{description:_(515,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:K(new Rt(80,"matchBrackets","always",["always","near","never"],{description:_(516,"Highlight matching brackets.")})),minimap:K(new yse),mouseStyle:K(new Rt(82,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:K(new Gs(83,"mouseWheelScrollSensitivity",1,s=>s===0?1:s,{markdownDescription:_(517,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:K(new De(84,"mouseWheelZoom",!1,{markdownDescription:He?_(518,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):_(519,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:K(new De(85,"multiCursorMergeOverlapping",!0,{description:_(520,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:K(new Am(86,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Sse,{markdownEnumDescriptions:[_(521,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),_(522,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:_(523,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),mouseMiddleClickAction:K(new Rt(87,"mouseMiddleClickAction","default",["default","openLink","ctrlLeftClick"],{description:_(524,"Controls what happens when middle mouse button is clicked in the editor.")})),multiCursorPaste:K(new Rt(88,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[_(525,"Each cursor pastes a single line of the text."),_(526,"Each cursor pastes the full text.")],markdownDescription:_(527,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:K(new at(89,"multiCursorLimit",1e4,1,1e5,{markdownDescription:_(528,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:K(new Rt(90,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[_(529,"Does not highlight occurrences."),_(530,"Highlights occurrences only in the current file."),_(531,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:_(532,"Controls whether occurrences should be highlighted across open files.")})),occurrencesHighlightDelay:K(new at(91,"occurrencesHighlightDelay",0,0,2e3,{description:_(533,"Controls the delay in milliseconds after which occurrences are highlighted."),tags:["preview"]})),overtypeOnPaste:K(new De(93,"overtypeOnPaste",!0,{description:_(534,"Controls whether pasting should overtype.")})),overviewRulerBorder:K(new De(94,"overviewRulerBorder",!0,{description:_(535,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:K(new at(95,"overviewRulerLanes",3,0,3)),padding:K(new xse),pasteAs:K(new $se),parameterHints:K(new Lse),peekWidgetDefaultFocus:K(new Rt(99,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[_(536,"Focus the tree when opening peek"),_(537,"Focus the editor when opening peek")],description:_(538,"Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:K(new Ese),definitionLinkOpensInPeek:K(new De(101,"definitionLinkOpensInPeek",!1,{description:_(539,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:K(new Nse),quickSuggestionsDelay:K(new at(103,"quickSuggestionsDelay",10,0,1073741824,{description:_(540,"Controls the delay in milliseconds after which quick suggestions will show up."),experiment:{mode:"auto"}})),readOnly:K(new De(104,"readOnly",!1)),readOnlyMessage:K(new Ise),renameOnType:K(new De(106,"renameOnType",!1,{description:_(541,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:_(542,"Deprecated, use `#editor.linkedEditing#` instead.")})),renderControlCharacters:K(new De(108,"renderControlCharacters",!0,{description:_(543,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:K(new Rt(109,"renderFinalNewline",Ts?"dimmed":"on",["off","on","dimmed"],{description:_(544,"Render last line number when the file ends with a newline.")})),renderLineHighlight:K(new Rt(110,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",_(545,"Highlights both the gutter and the current line.")],description:_(546,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:K(new De(111,"renderLineHighlightOnlyWhenFocus",!1,{description:_(547,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:K(new Rt(112,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:K(new Rt(113,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",_(548,"Render whitespace characters except for single spaces between words."),_(549,"Render whitespace characters only on selected text."),_(550,"Render only trailing whitespace characters."),""],description:_(551,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:K(new at(114,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:K(new De(115,"roundedSelection",!0,{description:_(552,"Controls whether selections should have rounded corners.")})),rulers:K(new Tse),scrollbar:K(new Mse),scrollBeyondLastColumn:K(new at(118,"scrollBeyondLastColumn",4,0,1073741824,{description:_(553,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:K(new De(119,"scrollBeyondLastLine",!0,{description:_(554,"Controls whether the editor will scroll beyond the last line.")})),scrollOnMiddleClick:K(new De(171,"scrollOnMiddleClick",!1,{description:_(555,"Controls whether the editor will scroll when the middle button is pressed.")})),scrollPredominantAxis:K(new De(120,"scrollPredominantAxis",!0,{description:_(556,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:K(new De(121,"selectionClipboard",!0,{description:_(557,"Controls whether the Linux primary clipboard should be supported."),included:Ts})),selectionHighlight:K(new De(122,"selectionHighlight",!0,{description:_(558,"Controls whether the editor should highlight matches similar to the selection.")})),selectionHighlightMaxLength:K(new at(123,"selectionHighlightMaxLength",200,0,1073741824,{description:_(559,"Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.")})),selectionHighlightMultiline:K(new De(124,"selectionHighlightMultiline",!1,{description:_(560,"Controls whether the editor should highlight selection matches that span multiple lines.")})),selectOnLineNumbers:K(new De(125,"selectOnLineNumbers",!0)),showFoldingControls:K(new Rt(126,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[_(561,"Always show the folding controls."),_(562,"Never show the folding controls and reduce the gutter size."),_(563,"Only show the folding controls when the mouse is over the gutter.")],description:_(564,"Controls when the folding controls on the gutter are shown.")})),showUnused:K(new De(127,"showUnused",!0,{description:_(565,"Controls fading out of unused code.")})),showDeprecated:K(new De(157,"showDeprecated",!0,{description:_(566,"Controls strikethrough deprecated variables.")})),inlayHints:K(new wse),snippetSuggestions:K(new Rt(128,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[_(567,"Show snippet suggestions on top of other suggestions."),_(568,"Show snippet suggestions below other suggestions."),_(569,"Show snippets suggestions with other suggestions."),_(570,"Do not show snippet suggestions.")],description:_(571,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:K(new Bse),smoothScrolling:K(new De(130,"smoothScrolling",!1,{description:_(572,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:K(new at(133,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:K(new Fse),inlineSuggest:K(new Ase),inlineCompletionsAccessibilityVerbose:K(new De(169,"inlineCompletionsAccessibilityVerbose",!1,{description:_(573,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:K(new at(135,"suggestFontSize",0,0,1e3,{markdownDescription:_(574,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:K(new at(136,"suggestLineHeight",0,0,1e3,{markdownDescription:_(575,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:K(new De(137,"suggestOnTriggerCharacters",!0,{description:_(576,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:K(new Rt(138,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[_(577,"Always select the first suggestion."),_(578,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),_(579,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:_(580,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:K(new Rt(139,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[_(581,"Tab complete will insert the best matching suggestion when pressing tab."),_(582,"Disable tab completions."),_(583,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:_(584,"Enables tab completions.")})),tabIndex:K(new at(140,"tabIndex",0,-1,1073741824)),trimWhitespaceOnDelete:K(new De(141,"trimWhitespaceOnDelete",!1,{description:_(585,"Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.")})),unicodeHighlight:K(new Rse),unusualLineTerminators:K(new Rt(143,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[_(586,"Unusual line terminators are automatically removed."),_(587,"Unusual line terminators are ignored."),_(588,"Unusual line terminators prompt to be removed.")],description:_(589,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:K(new De(144,"useShadowDOM",!0)),useTabStops:K(new De(145,"useTabStops",!0,{description:_(590,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:K(new Rt(146,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[_(591,"Use the default line break rule."),_(592,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:_(593,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:K(new Vse),wordSeparators:K(new Ti(148,"wordSeparators",W7,{description:_(594,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:K(new Rt(149,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[_(595,"Lines will never wrap."),_(596,"Lines will wrap at the viewport width."),_(597,"Lines will wrap at `#editor.wordWrapColumn#`."),_(598,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:_(599,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:K(new Ti(150,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:K(new Ti(151,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:K(new at(152,"wordWrapColumn",80,1,1073741824,{markdownDescription:_(600,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:K(new Rt(153,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:K(new Rt(154,"wordWrapOverride2","inherit",["off","on","inherit"])),wrapOnEscapedLineFeeds:K(new De(160,"wrapOnEscapedLineFeeds",!1,{markdownDescription:_(601,'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n world"\n```')})),effectiveCursorStyle:K(new dse),editorClassName:K(new ose),defaultColorDecorators:K(new Rt(167,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[_(602,"Show default color decorators only when no extension provides colors decorators."),_(603,"Always show default color decorators."),_(604,"Never show default color decorators.")],description:_(605,"Controls whether inline color decorations should be shown using the default document color provider.")})),pixelRatio:K(new kse),tabFocusMode:K(new De(164,"tabFocusMode",!1,{markdownDescription:_(606,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:K(new Af),wrappingInfo:K(new Hse),wrappingIndent:K(new Wse),wrappingStrategy:K(new mse),effectiveEditContextEnabled:K(new hse),effectiveAllowVariableFonts:K(new use)};function Pm(s,e){const t=this;let n=!1,i;return function(){return n||(n=!0,i=s.apply(t,arguments)),i}}function VTe(s,e){}function WTe(s){return s}function $w(s){return typeof s=="object"&&s!==null&&typeof s.dispose=="function"&&s.dispose.length===0}function xn(s){if(it.is(s)){const e=[];for(const t of s)if(t)try{t.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function ra(...s){return Ce(()=>xn(s))}class Use{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function Ce(s){return new Use(s)}const ox=class ox{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{xn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===U.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ox.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};ox.DISABLE_DISPOSED_WARNING=!1;let le=ox;const UO=class UO{constructor(){this._store=new le,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};UO.None=Object.freeze({dispose(){}});let U=UO;class Bn{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}class jse{constructor(e){this.object=e}dispose(){}}class bE{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{xn(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const Kse=globalThis.performance.now.bind(globalThis.performance);class pl{static create(e){return new pl(e)}constructor(e){this._now=e===!1?Date.now:Kse,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var X;(function(s){s.None=()=>U.None;function e(I,F){return u(I,()=>{},0,void 0,!0,void 0,F)}s.defer=e;function t(I){return(F,W=null,z)=>{let G=!1,Y;return Y=I(Q=>{if(!G)return Y?Y.dispose():G=!0,F.call(W,Q)},null,z),G&&Y.dispose(),Y}}s.once=t;function n(I,F){return s.once(s.filter(I,F))}s.onceIf=n;function i(I,F,W){return d((z,G=null,Y)=>I(Q=>z.call(G,F(Q)),null,Y),W)}s.map=i;function r(I,F,W){return d((z,G=null,Y)=>I(Q=>{F(Q),z.call(G,Q)},null,Y),W)}s.forEach=r;function o(I,F,W){return d((z,G=null,Y)=>I(Q=>F(Q)&&z.call(G,Q),null,Y),W)}s.filter=o;function a(I){return I}s.signal=a;function l(...I){return(F,W=null,z)=>{const G=ra(...I.map(Y=>Y(Q=>F.call(W,Q))));return h(G,z)}}s.any=l;function c(I,F,W,z){let G=W;return i(I,Y=>(G=F(G,Y),G),z)}s.reduce=c;function d(I,F){let W;const z={onWillAddFirstListener(){W=I(G.fire,G)},onDidRemoveLastListener(){W?.dispose()}},G=new A(z);return F?.add(G),G.event}function h(I,F){return F instanceof Array?F.push(I):F&&F.add(I),I}function u(I,F,W=100,z=!1,G=!1,Y,Q){let oe,me,Ie,qt=0,Qe;const Ot={leakWarningThreshold:Y,onWillAddFirstListener(){oe=I(ei=>{qt++,me=F(me,ei),z&&!Ie&&(ot.fire(me),me=void 0),Qe=()=>{const Jt=me;me=void 0,Ie=void 0,(!z||qt>1)&&ot.fire(Jt),qt=0},typeof W=="number"?(Ie&&clearTimeout(Ie),Ie=setTimeout(Qe,W)):Ie===void 0&&(Ie=null,queueMicrotask(Qe))})},onWillRemoveListener(){G&&qt>0&&Qe?.()},onDidRemoveLastListener(){Qe=void 0,oe.dispose()}},ot=new A(Ot);return Q?.add(ot),ot.event}s.debounce=u;function f(I,F=0,W){return s.debounce(I,(z,G)=>z?(z.push(G),z):[G],F,void 0,!0,void 0,W)}s.accumulate=f;function g(I,F=(z,G)=>z===G,W){let z=!0,G;return o(I,Y=>{const Q=z||!F(Y,G);return z=!1,G=Y,Q},W)}s.latch=g;function p(I,F,W){return[s.filter(I,F,W),s.filter(I,z=>!F(z),W)]}s.split=p;function m(I,F=!1,W=[],z){let G=W.slice(),Y=I(me=>{G?G.push(me):oe.fire(me)});z&&z.add(Y);const Q=()=>{G?.forEach(me=>oe.fire(me)),G=null},oe=new A({onWillAddFirstListener(){Y||(Y=I(me=>oe.fire(me)),z&&z.add(Y))},onDidAddFirstListener(){G&&(F?setTimeout(Q):Q())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return z&&z.add(oe),oe.event}s.buffer=m;function b(I,F){return(z,G,Y)=>{const Q=F(new C);return I(function(oe){const me=Q.evaluate(oe);me!==w&&z.call(G,me)},void 0,Y)}}s.chain=b;const w=Symbol("HaltChainable");class C{constructor(){this.steps=[]}map(F){return this.steps.push(F),this}forEach(F){return this.steps.push(W=>(F(W),W)),this}filter(F){return this.steps.push(W=>F(W)?W:w),this}reduce(F,W){let z=W;return this.steps.push(G=>(z=F(z,G),z)),this}latch(F=(W,z)=>W===z){let W=!0,z;return this.steps.push(G=>{const Y=W||!F(G,z);return W=!1,z=G,Y?G:w}),this}evaluate(F){for(const W of this.steps)if(F=W(F),F===w)break;return F}}function v(I,F,W=z=>z){const z=(...oe)=>Q.fire(W(...oe)),G=()=>I.on(F,z),Y=()=>I.removeListener(F,z),Q=new A({onWillAddFirstListener:G,onDidRemoveLastListener:Y});return Q.event}s.fromNodeEventEmitter=v;function S(I,F,W=z=>z){const z=(...oe)=>Q.fire(W(...oe)),G=()=>I.addEventListener(F,z),Y=()=>I.removeEventListener(F,z),Q=new A({onWillAddFirstListener:G,onDidRemoveLastListener:Y});return Q.event}s.fromDOMEventEmitter=S;function k(I,F){let W;const z=new Promise((G,Y)=>{const Q=t(I)(G,null,F);W=()=>Q.dispose()});return z.cancel=W,z}s.toPromise=k;function L(I,F){return I(W=>F.fire(W))}s.forward=L;function E(I,F,W){return F(W),I(z=>F(z))}s.runAndSubscribe=E;class N{constructor(F,W){this._observable=F,this._counter=0,this._hasChanged=!1;const z={onWillAddFirstListener:()=>{F.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{F.removeObserver(this)}};this.emitter=new A(z),W&&W.add(this.emitter)}beginUpdate(F){this._counter++}handlePossibleChange(F){}handleChange(F,W){this._hasChanged=!0}endUpdate(F){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function M(I,F){return new N(I,F).emitter.event}s.fromObservable=M;function O(I){return(F,W,z)=>{let G=0,Y=!1;const Q={beginUpdate(){G++},endUpdate(){G--,G===0&&(I.reportChanges(),Y&&(Y=!1,F.call(W)))},handlePossibleChange(){},handleChange(){Y=!0}};I.addObserver(Q),I.reportChanges();const oe={dispose(){I.removeObserver(Q)}};return z instanceof le?z.add(oe):Array.isArray(z)&&z.push(oe),oe}}s.fromObservableLight=O})(X||(X={}));const kp=class kp{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${kp._idPool++}`,kp.all.add(this)}start(e){this._stopWatch=new pl,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};kp.all=new Set,kp._idPool=0;let wE=kp,qse=-1;const ax=class ax{constructor(e,t,n=(ax._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){const n=this.threshold;if(n<=0||t<n)return;this._stacks||(this._stacks=new Map);const i=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;const[r,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(r);const l=new Gse(a,r);this._errorHandler(l)}return()=>{const r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[n,i]of this._stacks)(!e||t<i)&&(e=[n,i],t=i);return e}};ax._idPool=1;let CE=ax;class vE{static create(){const e=new Error;return new vE(e.stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split(`
|
|
126
126
|
`).slice(2).join(`
|
|
127
127
|
`))}}class Gse extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class Yse extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class yE{constructor(e){this.value=e}}const Xse=2;class A{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new CE(e?.onListenerError??dt,this._options?.leakWarningThreshold??qse):void 0,this._perfMon=this._options?._profName?new wE(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);const l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new Yse(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||dt)(c),U.None}if(this._disposed)return U.None;t&&(e=e.bind(t));const i=new yE(e);let r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=vE.create(),r=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof yE?(this._deliveryQueue??=new K7,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const o=Ce(()=>{r?.(),this._removeListener(i)});return n instanceof le?n.add(o):Array.isArray(n)&&n.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const t=this._listeners,n=t.indexOf(e);if(n===-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[n]=void 0;const i=this._deliveryQueue.current===this;if(this._size*Xse<=t.length){let r=0;for(let o=0;o<t.length;o++)t[o]?t[r++]=t[o]:i&&r<this._deliveryQueue.end&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;const n=this._options?.onListenerError||dt;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof yE)this._deliver(this._listeners,e);else{const t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}}const Zse=()=>new K7;class K7{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Fm extends A{constructor(e){super(e),this._isPaused=0,this._eventQueue=new us,this._mergeFn=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._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class q7 extends Fm{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class Qse extends A{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class Jse{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new A({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Ce(Pm(()=>{this.hasListeners&&this.unhook(t);const i=this.events.indexOf(t);this.events.splice(i,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(const e of this.events)e.listener?.dispose();this.events=[]}}class Bm{constructor(){this.data=[]}wrapEvent(e,t,n){return(i,r,o)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>i.call(r,a)):i.call(r,a);return}const c=l;if(!c){i.call(r,t(n,a));return}c.items??=[],c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??=n?c.items.reduce(t,n):c.items.reduce(t),i.call(r,c.reducedResult)})},void 0,o)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const n=e();return this.data.pop(),t.buffers.forEach(i=>i()),n}}class Vm{constructor(){this.listening=!1,this.inputEvent=X.None,this.inputEventListener=U.None,this.emitter=new A({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const G7=Object.freeze(function(s,e){const t=setTimeout(s.bind(e),0);return{dispose(){clearTimeout(t)}}});var Xs;(function(s){function e(t){return t===s.None||t===s.Cancelled||t instanceof Uw?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}s.isCancellationToken=e,s.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:X.None}),s.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:G7})})(Xs||(Xs={}));class Uw{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?G7:(this._emitter||(this._emitter=new A),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class Ff{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Uw),this._token}cancel(){this._token?this._token instanceof Uw&&this._token.cancel():this._token=Xs.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Uw&&this._token.dispose():this._token=Xs.None}}class SE{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const jw=new SE,xE=new SE,LE=new SE,Y7=new Array(230),ere=Object.create(null),tre=Object.create(null),kE=[];for(let s=0;s<=193;s++)kE[s]=-1;(function(){const e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Delete",46,"VK_DELETE","",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]],t=[],n=[];for(const i of e){const[r,o,a,l,c,d,h,u,f]=i;if(n[o]||(n[o]=!0,ere[a]=o,tre[a.toLowerCase()]=o,r&&(kE[o]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);jw.define(l,c),xE.define(l,u||c),LE.define(l,f||u||c)}d&&(Y7[d]=l)}})();var ml;(function(s){function e(a){return jw.keyCodeToStr(a)}s.toString=e;function t(a){return jw.strToKeyCode(a)}s.fromString=t;function n(a){return xE.keyCodeToStr(a)}s.toUserSettingsUS=n;function i(a){return LE.keyCodeToStr(a)}s.toUserSettingsGeneral=i;function r(a){return xE.strToKeyCode(a)||LE.strToKeyCode(a)}s.fromUserSettings=r;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return jw.keyCodeToStr(a)}s.toElectronAccelerator=o})(ml||(ml={}));function X7(s,e){const t=(e&65535)<<16>>>0;return(s|t)>>>0}let Bf;const EE=globalThis.vscode;if(typeof EE<"u"&&typeof EE.process<"u"){const s=EE.process;Bf={get platform(){return s.platform},get arch(){return s.arch},get env(){return s.env},cwd(){return s.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Bf={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Bf={get platform(){return hs?"win32":He?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const Kw=Bf.cwd,NE=Bf.env,nre=Bf.platform,ire=65,sre=97,rre=90,ore=122,oh=46,Ii=47,Zs=92,_l=58,are=63;class Z7 extends Error{constructor(e,t,n){let i;typeof t=="string"&&t.indexOf("not ")===0?(i="must not be",t=t.replace(/^not /,"")):i="must be";const r=e.indexOf(".")!==-1?"property":"argument";let o=`The "${e}" ${r} ${i} of type ${t}`;o+=`. Received type ${typeof n}`,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function lre(s,e){if(s===null||typeof s!="object")throw new Z7(e,"Object",s)}function Vn(s,e){if(typeof s!="string")throw new Z7(e,"string",s)}const Vc=nre==="win32";function lt(s){return s===Ii||s===Zs}function DE(s){return s===Ii}function bl(s){return s>=ire&&s<=rre||s>=sre&&s<=ore}function qw(s,e,t,n){let i="",r=0,o=-1,a=0,l=0;for(let c=0;c<=s.length;++c){if(c<s.length)l=s.charCodeAt(c);else{if(n(l))break;l=Ii}if(n(l)){if(!(o===c-1||a===1))if(a===2){if(i.length<2||r!==2||i.charCodeAt(i.length-1)!==oh||i.charCodeAt(i.length-2)!==oh){if(i.length>2){const d=i.lastIndexOf(t);d===-1?(i="",r=0):(i=i.slice(0,d),r=i.length-1-i.lastIndexOf(t)),o=c,a=0;continue}else if(i.length!==0){i="",r=0,o=c,a=0;continue}}e&&(i+=i.length>0?`${t}..`:"..",r=2)}else i.length>0?i+=`${t}${s.slice(o+1,c)}`:i=s.slice(o+1,c),r=c-o-1;o=c,a=0}else l===oh&&a!==-1?++a:a=-1}return i}function cre(s){return s?`${s[0]==="."?"":"."}${s}`:""}function Q7(s,e){lre(e,"pathObject");const t=e.dir||e.root,n=e.base||`${e.name||""}${cre(e.ext)}`;return t?t===e.root?`${t}${n}`:`${t}${s}${n}`:n}const Is={resolve(...s){let e="",t="",n=!1;for(let i=s.length-1;i>=-1;i--){let r;if(i>=0){if(r=s[i],Vn(r,`paths[${i}]`),r.length===0)continue}else e.length===0?r=Kw():(r=NE[`=${e}`]||Kw(),(r===void 0||r.slice(0,2).toLowerCase()!==e.toLowerCase()&&r.charCodeAt(2)===Zs)&&(r=`${e}\\`));const o=r.length;let a=0,l="",c=!1;const d=r.charCodeAt(0);if(o===1)lt(d)&&(a=1,c=!0);else if(lt(d))if(c=!0,lt(r.charCodeAt(1))){let h=2,u=h;for(;h<o&&!lt(r.charCodeAt(h));)h++;if(h<o&&h!==u){const f=r.slice(u,h);for(u=h;h<o&<(r.charCodeAt(h));)h++;if(h<o&&h!==u){for(u=h;h<o&&!lt(r.charCodeAt(h));)h++;(h===o||h!==u)&&(l=`\\\\${f}\\${r.slice(u,h)}`,a=h)}}}else a=1;else bl(d)&&r.charCodeAt(1)===_l&&(l=r.slice(0,2),a=2,o>2&<(r.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(n){if(e.length>0)break}else if(t=`${r.slice(a)}\\${t}`,n=c,c&&e.length>0)break}return t=qw(t,!n,"\\",lt),n?`${e}\\${t}`:`${e}${t}`||"."},normalize(s){Vn(s,"path");const e=s.length;if(e===0)return".";let t=0,n,i=!1;const r=s.charCodeAt(0);if(e===1)return DE(r)?"\\":s;if(lt(r))if(i=!0,lt(s.charCodeAt(1))){let a=2,l=a;for(;a<e&&!lt(s.charCodeAt(a));)a++;if(a<e&&a!==l){const c=s.slice(l,a);for(l=a;a<e&<(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!lt(s.charCodeAt(a));)a++;if(a===e)return`\\\\${c}\\${s.slice(l)}\\`;a!==l&&(n=`\\\\${c}\\${s.slice(l,a)}`,t=a)}}}else t=1;else bl(r)&&s.charCodeAt(1)===_l&&(n=s.slice(0,2),t=2,e>2&<(s.charCodeAt(2))&&(i=!0,t=3));let o=t<e?qw(s.slice(t),!i,"\\",lt):"";if(o.length===0&&!i&&(o="."),o.length>0&<(s.charCodeAt(e-1))&&(o+="\\"),!i&&n===void 0&&s.includes(":")){if(o.length>=2&&bl(o.charCodeAt(0))&&o.charCodeAt(1)===_l)return`.\\${o}`;let a=s.indexOf(":");do if(a===e-1||lt(s.charCodeAt(a+1)))return`.\\${o}`;while((a=s.indexOf(":",a+1))!==-1)}return n===void 0?i?`\\${o}`:o:i?`${n}\\${o}`:`${n}${o}`},isAbsolute(s){Vn(s,"path");const e=s.length;if(e===0)return!1;const t=s.charCodeAt(0);return lt(t)||e>2&&bl(t)&&s.charCodeAt(1)===_l&<(s.charCodeAt(2))},join(...s){if(s.length===0)return".";let e,t;for(let r=0;r<s.length;++r){const o=s[r];Vn(o,"path"),o.length>0&&(e===void 0?e=t=o:e+=`\\${o}`)}if(e===void 0)return".";let n=!0,i=0;if(typeof t=="string"&<(t.charCodeAt(0))){++i;const r=t.length;r>1&<(t.charCodeAt(1))&&(++i,r>2&&(lt(t.charCodeAt(2))?++i:n=!1))}if(n){for(;i<e.length&<(e.charCodeAt(i));)i++;i>=2&&(e=`\\${e.slice(i)}`)}return Is.normalize(e)},relative(s,e){if(Vn(s,"from"),Vn(e,"to"),s===e)return"";const t=Is.resolve(s),n=Is.resolve(e);if(t===n||(s=t.toLowerCase(),e=n.toLowerCase(),s===e))return"";if(t.length!==s.length||n.length!==e.length){const g=t.split("\\"),p=n.split("\\");g[g.length-1]===""&&g.pop(),p[p.length-1]===""&&p.pop();const m=g.length,b=p.length,w=m<b?m:b;let C;for(C=0;C<w&&g[C].toLowerCase()===p[C].toLowerCase();C++);return C===0?n:C===w?b>w?p.slice(C).join("\\"):m>w?"..\\".repeat(m-1-C)+"..":"":"..\\".repeat(m-C)+p.slice(C).join("\\")}let i=0;for(;i<s.length&&s.charCodeAt(i)===Zs;)i++;let r=s.length;for(;r-1>i&&s.charCodeAt(r-1)===Zs;)r--;const o=r-i;let a=0;for(;a<e.length&&e.charCodeAt(a)===Zs;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===Zs;)l--;const c=l-a,d=o<c?o:c;let h=-1,u=0;for(;u<d;u++){const g=s.charCodeAt(i+u);if(g!==e.charCodeAt(a+u))break;g===Zs&&(h=u)}if(u!==d){if(h===-1)return n}else{if(c>d){if(e.charCodeAt(a+u)===Zs)return n.slice(a+u+1);if(u===2)return n.slice(a+u)}o>d&&(s.charCodeAt(i+u)===Zs?h=u:u===2&&(h=3)),h===-1&&(h=0)}let f="";for(u=i+h+1;u<=r;++u)(u===r||s.charCodeAt(u)===Zs)&&(f+=f.length===0?"..":"\\..");return a+=h,f.length>0?`${f}${n.slice(a,l)}`:(n.charCodeAt(a)===Zs&&++a,n.slice(a,l))},toNamespacedPath(s){if(typeof s!="string"||s.length===0)return s;const e=Is.resolve(s);if(e.length<=2)return s;if(e.charCodeAt(0)===Zs){if(e.charCodeAt(1)===Zs){const t=e.charCodeAt(2);if(t!==are&&t!==oh)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(bl(e.charCodeAt(0))&&e.charCodeAt(1)===_l&&e.charCodeAt(2)===Zs)return`\\\\?\\${e}`;return e},dirname(s){Vn(s,"path");const e=s.length;if(e===0)return".";let t=-1,n=0;const i=s.charCodeAt(0);if(e===1)return lt(i)?s:".";if(lt(i)){if(t=n=1,lt(s.charCodeAt(1))){let a=2,l=a;for(;a<e&&!lt(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&<(s.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!lt(s.charCodeAt(a));)a++;if(a===e)return s;a!==l&&(t=n=a+1)}}}}else bl(i)&&s.charCodeAt(1)===_l&&(t=e>2&<(s.charCodeAt(2))?3:2,n=t);let r=-1,o=!0;for(let a=e-1;a>=n;--a)if(lt(s.charCodeAt(a))){if(!o){r=a;break}}else o=!1;if(r===-1){if(t===-1)return".";r=t}return s.slice(0,r)},basename(s,e){e!==void 0&&Vn(e,"suffix"),Vn(s,"path");let t=0,n=-1,i=!0,r;if(s.length>=2&&bl(s.charCodeAt(0))&&s.charCodeAt(1)===_l&&(t=2),e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let o=e.length-1,a=-1;for(r=s.length-1;r>=t;--r){const l=s.charCodeAt(r);if(lt(l)){if(!i){t=r+1;break}}else a===-1&&(i=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(n=r):(o=-1,n=a))}return t===n?n=a:n===-1&&(n=s.length),s.slice(t,n)}for(r=s.length-1;r>=t;--r)if(lt(s.charCodeAt(r))){if(!i){t=r+1;break}}else n===-1&&(i=!1,n=r+1);return n===-1?"":s.slice(t,n)},extname(s){Vn(s,"path");let e=0,t=-1,n=0,i=-1,r=!0,o=0;s.length>=2&&s.charCodeAt(1)===_l&&bl(s.charCodeAt(0))&&(e=n=2);for(let a=s.length-1;a>=e;--a){const l=s.charCodeAt(a);if(lt(l)){if(!r){n=a+1;break}continue}i===-1&&(r=!1,i=a+1),l===oh?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||i===-1||o===0||o===1&&t===i-1&&t===n+1?"":s.slice(t,i)},format:Q7.bind(null,"\\"),parse(s){Vn(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.length;let n=0,i=s.charCodeAt(0);if(t===1)return lt(i)?(e.root=e.dir=s,e):(e.base=e.name=s,e);if(lt(i)){if(n=1,lt(s.charCodeAt(1))){let h=2,u=h;for(;h<t&&!lt(s.charCodeAt(h));)h++;if(h<t&&h!==u){for(u=h;h<t&<(s.charCodeAt(h));)h++;if(h<t&&h!==u){for(u=h;h<t&&!lt(s.charCodeAt(h));)h++;h===t?n=h:h!==u&&(n=h+1)}}}}else if(bl(i)&&s.charCodeAt(1)===_l){if(t<=2)return e.root=e.dir=s,e;if(n=2,lt(s.charCodeAt(2))){if(t===3)return e.root=e.dir=s,e;n=3}}n>0&&(e.root=s.slice(0,n));let r=-1,o=n,a=-1,l=!0,c=s.length-1,d=0;for(;c>=n;--c){if(i=s.charCodeAt(c),lt(i)){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),i===oh?r===-1?r=c:d!==1&&(d=1):r!==-1&&(d=-1)}return a!==-1&&(r===-1||d===0||d===1&&r===a-1&&r===o+1?e.base=e.name=s.slice(o,a):(e.name=s.slice(o,r),e.base=s.slice(o,a),e.ext=s.slice(r,a))),o>0&&o!==n?e.dir=s.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},dre=(()=>{if(Vc){const s=/\\/g;return()=>{const e=Kw().replace(s,"/");return e.slice(e.indexOf("/"))}}return()=>Kw()})(),fn={resolve(...s){let e="",t=!1;for(let n=s.length-1;n>=0&&!t;n--){const i=s[n];Vn(i,`paths[${n}]`),i.length!==0&&(e=`${i}/${e}`,t=i.charCodeAt(0)===Ii)}if(!t){const n=dre();e=`${n}/${e}`,t=n.charCodeAt(0)===Ii}return e=qw(e,!t,"/",DE),t?`/${e}`:e.length>0?e:"."},normalize(s){if(Vn(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===Ii,t=s.charCodeAt(s.length-1)===Ii;return s=qw(s,!e,"/",DE),s.length===0?e?"/":t?"./":".":(t&&(s+="/"),e?`/${s}`:s)},isAbsolute(s){return Vn(s,"path"),s.length>0&&s.charCodeAt(0)===Ii},join(...s){if(s.length===0)return".";const e=[];for(let t=0;t<s.length;++t){const n=s[t];Vn(n,"path"),n.length>0&&e.push(n)}return e.length===0?".":fn.normalize(e.join("/"))},relative(s,e){if(Vn(s,"from"),Vn(e,"to"),s===e||(s=fn.resolve(s),e=fn.resolve(e),s===e))return"";const t=1,n=s.length,i=n-t,r=1,o=e.length-r,a=i<o?i:o;let l=-1,c=0;for(;c<a;c++){const h=s.charCodeAt(t+c);if(h!==e.charCodeAt(r+c))break;h===Ii&&(l=c)}if(c===a)if(o>a){if(e.charCodeAt(r+c)===Ii)return e.slice(r+c+1);if(c===0)return e.slice(r+c)}else i>a&&(s.charCodeAt(t+c)===Ii?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=n;++c)(c===n||s.charCodeAt(c)===Ii)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(r+l)}`},toNamespacedPath(s){return s},dirname(s){if(Vn(s,"path"),s.length===0)return".";const e=s.charCodeAt(0)===Ii;let t=-1,n=!0;for(let i=s.length-1;i>=1;--i)if(s.charCodeAt(i)===Ii){if(!n){t=i;break}}else n=!1;return t===-1?e?"/":".":e&&t===1?"//":s.slice(0,t)},basename(s,e){e!==void 0&&Vn(e,"suffix"),Vn(s,"path");let t=0,n=-1,i=!0,r;if(e!==void 0&&e.length>0&&e.length<=s.length){if(e===s)return"";let o=e.length-1,a=-1;for(r=s.length-1;r>=0;--r){const l=s.charCodeAt(r);if(l===Ii){if(!i){t=r+1;break}}else a===-1&&(i=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(n=r):(o=-1,n=a))}return t===n?n=a:n===-1&&(n=s.length),s.slice(t,n)}for(r=s.length-1;r>=0;--r)if(s.charCodeAt(r)===Ii){if(!i){t=r+1;break}}else n===-1&&(i=!1,n=r+1);return n===-1?"":s.slice(t,n)},extname(s){Vn(s,"path");let e=-1,t=0,n=-1,i=!0,r=0;for(let o=s.length-1;o>=0;--o){const a=s[o];if(a==="/"){if(!i){t=o+1;break}continue}n===-1&&(i=!1,n=o+1),a==="."?e===-1?e=o:r!==1&&(r=1):e!==-1&&(r=-1)}return e===-1||n===-1||r===0||r===1&&e===n-1&&e===t+1?"":s.slice(e,n)},format:Q7.bind(null,"/"),parse(s){Vn(s,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return e;const t=s.charCodeAt(0)===Ii;let n;t?(e.root="/",n=1):n=0;let i=-1,r=0,o=-1,a=!0,l=s.length-1,c=0;for(;l>=n;--l){const d=s.charCodeAt(l);if(d===Ii){if(!a){r=l+1;break}continue}o===-1&&(a=!1,o=l+1),d===oh?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}if(o!==-1){const d=r===0&&t?1:r;i===-1||c===0||c===1&&i===o-1&&i===r+1?e.base=e.name=s.slice(d,o):(e.name=s.slice(d,i),e.base=s.slice(d,o),e.ext=s.slice(i,o))}return r>0?e.dir=s.slice(0,r-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};fn.win32=Is.win32=Is,fn.posix=Is.posix=fn;const J7=Vc?Is.normalize:fn.normalize,hre=Vc?Is.resolve:fn.resolve,ure=Vc?Is.relative:fn.relative,fre=Vc?Is.dirname:fn.dirname,eF=Vc?Is.basename:fn.basename,gre=Vc?Is.extname:fn.extname,Wc=Vc?Is.sep:fn.sep,pre=/^\w[\w\d+.-]*$/,mre=/^\//,_re=/^\/\//;function bre(s,e){if(!s.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${s.authority}", path: "${s.path}", query: "${s.query}", fragment: "${s.fragment}"}`);if(s.scheme&&!pre.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!mre.test(s.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(_re.test(s.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function wre(s,e){return!s&&!e?"file":s}function Cre(s,e){switch(s){case"https":case"http":case"file":e?e[0]!==vo&&(e=vo+e):e=vo;break}return e}const tn="",vo="/",vre=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class ze{static isUri(e){return e instanceof ze?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,t,n,i,r,o=!1){typeof e=="object"?(this.scheme=e.scheme||tn,this.authority=e.authority||tn,this.path=e.path||tn,this.query=e.query||tn,this.fragment=e.fragment||tn):(this.scheme=wre(e,o),this.authority=t||tn,this.path=Cre(this.scheme,n||tn),this.query=i||tn,this.fragment=r||tn,bre(this,o))}get fsPath(){return Gw(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:i,query:r,fragment:o}=e;return t===void 0?t=this.scheme:t===null&&(t=tn),n===void 0?n=this.authority:n===null&&(n=tn),i===void 0?i=this.path:i===null&&(i=tn),r===void 0?r=this.query:r===null&&(r=tn),o===void 0?o=this.fragment:o===null&&(o=tn),t===this.scheme&&n===this.authority&&i===this.path&&r===this.query&&o===this.fragment?this:new Vf(t,n,i,r,o)}static parse(e,t=!1){const n=vre.exec(e);return n?new Vf(n[2]||tn,Yw(n[4]||tn),Yw(n[5]||tn),Yw(n[7]||tn),Yw(n[9]||tn),t):new Vf(tn,tn,tn,tn,tn)}static file(e){let t=tn;if(hs&&(e=e.replace(/\\/g,vo)),e[0]===vo&&e[1]===vo){const n=e.indexOf(vo,2);n===-1?(t=e.substring(2),e=vo):(t=e.substring(2,n),e=e.substring(n)||vo)}return new Vf("file",t,e,tn,tn)}static from(e,t){return new Vf(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return hs&&e.scheme==="file"?n=ze.file(Is.join(Gw(e,!0),...t)).path:n=fn.join(e.path,...t),e.with({path:n})}toString(e=!1){return TE(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof ze)return e;{const t=new Vf(e);return t._formatted=e.external??null,t._fsPath=e._sep===tF?e.fsPath??null:null,t}}else return e}}const tF=hs?1:void 0;class Vf extends ze{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Gw(this,!1)),this._fsPath}toString(e=!1){return e?TE(this,!0):(this._formatted||(this._formatted=TE(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=tF),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const nF={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function iF(s,e,t){let n,i=-1;for(let r=0;r<s.length;r++){const o=s.charCodeAt(r);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47||t&&o===91||t&&o===93||t&&o===58)i!==-1&&(n+=encodeURIComponent(s.substring(i,r)),i=-1),n!==void 0&&(n+=s.charAt(r));else{n===void 0&&(n=s.substr(0,r));const a=nF[o];a!==void 0?(i!==-1&&(n+=encodeURIComponent(s.substring(i,r)),i=-1),n+=a):i===-1&&(i=r)}}return i!==-1&&(n+=encodeURIComponent(s.substring(i))),n!==void 0?n:s}function yre(s){let e;for(let t=0;t<s.length;t++){const n=s.charCodeAt(t);n===35||n===63?(e===void 0&&(e=s.substr(0,t)),e+=nF[n]):e!==void 0&&(e+=s[t])}return e!==void 0?e:s}function Gw(s,e){let t;return s.authority&&s.path.length>1&&s.scheme==="file"?t=`//${s.authority}${s.path}`:s.path.charCodeAt(0)===47&&(s.path.charCodeAt(1)>=65&&s.path.charCodeAt(1)<=90||s.path.charCodeAt(1)>=97&&s.path.charCodeAt(1)<=122)&&s.path.charCodeAt(2)===58?e?t=s.path.substr(1):t=s.path[1].toLowerCase()+s.path.substr(2):t=s.path,hs&&(t=t.replace(/\//g,"\\")),t}function TE(s,e){const t=e?yre:iF;let n="",{scheme:i,authority:r,path:o,query:a,fragment:l}=s;if(i&&(n+=i,n+=":"),(r||i==="file")&&(n+=vo,n+=vo),r){let c=r.indexOf("@");if(c!==-1){const d=r.substr(0,c);r=r.substr(c+1),c=d.lastIndexOf(":"),c===-1?n+=t(d,!1,!1):(n+=t(d.substr(0,c),!1,!1),n+=":",n+=t(d.substr(c+1),!1,!0)),n+="@"}r=r.toLowerCase(),c=r.lastIndexOf(":"),c===-1?n+=t(r,!1,!0):(n+=t(r.substr(0,c),!1,!0),n+=r.substr(c))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){const c=o.charCodeAt(1);c>=65&&c<=90&&(o=`/${String.fromCharCode(c+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){const c=o.charCodeAt(0);c>=65&&c<=90&&(o=`${String.fromCharCode(c+32)}:${o.substr(2)}`)}n+=t(o,!0,!1)}return a&&(n+="?",n+=t(a,!1,!1)),l&&(n+="#",n+=e?l:iF(l,!1,!1)),n}function sF(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+sF(s.substr(3)):s}}const rF=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Yw(s){return s.match(rF)?s.replace(rF,e=>sF(e)):s}class P{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new P(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return P.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return P.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(e){return P.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){const n=e.lineNumber|0,i=t.lineNumber|0;if(n===i){const r=e.column|0,o=t.column|0;return r-o}return n-i}clone(){return new P(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new P(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}}let R=class ti{constructor(e,t,n,i){e>n||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}isEmpty(){return ti.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return ti.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return ti.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return ti.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return ti.plusRange(this,e)}static plusRange(e,t){let n,i,r,o;return t.startLineNumber<e.startLineNumber?(n=t.startLineNumber,i=t.startColumn):t.startLineNumber===e.startLineNumber?(n=t.startLineNumber,i=Math.min(t.startColumn,e.startColumn)):(n=e.startLineNumber,i=e.startColumn),t.endLineNumber>e.endLineNumber?(r=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,o=e.endColumn),new ti(n,i,r,o)}intersectRanges(e){return ti.intersectRanges(this,e)}static intersectRanges(e,t){let n=e.startLineNumber,i=e.startColumn,r=e.endLineNumber,o=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return n<a?(n=a,i=l):n===a&&(i=Math.max(i,l)),r>c?(r=c,o=d):r===c&&(o=Math.min(o,d)),n>r||n===r&&i>o?null:new ti(n,i,r,o)}equalsRange(e){return ti.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return ti.getEndPosition(this)}static getEndPosition(e){return new P(e.endLineNumber,e.endColumn)}getStartPosition(){return ti.getStartPosition(this)}static getStartPosition(e){return new P(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new ti(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new ti(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return ti.collapseToStart(this)}static collapseToStart(e){return new ti(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return ti.collapseToEnd(this)}static collapseToEnd(e){return new ti(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new ti(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new ti(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new ti(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static areOnlyIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber-1||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn-1||t.endLineNumber<e.startLineNumber-1||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn-1)}static compareRangesUsingStarts(e,t){if(e&&t){const r=e.startLineNumber|0,o=t.startLineNumber|0;if(r===o){const a=e.startColumn|0,l=t.startColumn|0;if(a===l){const c=e.endLineNumber|0,d=t.endLineNumber|0;if(c===d){const h=e.endColumn|0,u=t.endColumn|0;return h-u}return c-d}return a-l}return r-o}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}};class Ae extends R{constructor(e,t,n,i){super(e,t,n,i),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=i}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Ae.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new Ae(this.startLineNumber,this.startColumn,e,t):new Ae(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new P(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new P(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new Ae(e,t,this.endLineNumber,this.endColumn):new Ae(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Ae(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new Ae(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Ae(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Ae(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(!this.selectionsEqual(e[n],t[n]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,t,n,i,r){return r===0?new Ae(e,t,n,i):new Ae(n,i,e,t)}}const IE=Object.create(null);function x(s,e){if(Yn(e)){const t=IE[e];if(t===void 0)throw new Error(`${s} references an unknown codicon: ${e}`);e=t}return IE[s]=e,{id:s}}function oF(){return IE}const Sre={add:x("add",6e4),plus:x("plus",6e4),gistNew:x("gist-new",6e4),repoCreate:x("repo-create",6e4),lightbulb:x("lightbulb",60001),lightBulb:x("light-bulb",60001),repo:x("repo",60002),repoDelete:x("repo-delete",60002),gistFork:x("gist-fork",60003),repoForked:x("repo-forked",60003),gitPullRequest:x("git-pull-request",60004),gitPullRequestAbandoned:x("git-pull-request-abandoned",60004),recordKeys:x("record-keys",60005),keyboard:x("keyboard",60005),tag:x("tag",60006),gitPullRequestLabel:x("git-pull-request-label",60006),tagAdd:x("tag-add",60006),tagRemove:x("tag-remove",60006),person:x("person",60007),personFollow:x("person-follow",60007),personOutline:x("person-outline",60007),personFilled:x("person-filled",60007),gitBranch:x("git-branch",60008),gitBranchCreate:x("git-branch-create",60008),gitBranchDelete:x("git-branch-delete",60008),sourceControl:x("source-control",60008),mirror:x("mirror",60009),mirrorPublic:x("mirror-public",60009),star:x("star",60010),starAdd:x("star-add",60010),starDelete:x("star-delete",60010),starEmpty:x("star-empty",60010),comment:x("comment",60011),commentAdd:x("comment-add",60011),alert:x("alert",60012),warning:x("warning",60012),search:x("search",60013),searchSave:x("search-save",60013),logOut:x("log-out",60014),signOut:x("sign-out",60014),logIn:x("log-in",60015),signIn:x("sign-in",60015),eye:x("eye",60016),eyeUnwatch:x("eye-unwatch",60016),eyeWatch:x("eye-watch",60016),circleFilled:x("circle-filled",60017),primitiveDot:x("primitive-dot",60017),closeDirty:x("close-dirty",60017),debugBreakpoint:x("debug-breakpoint",60017),debugBreakpointDisabled:x("debug-breakpoint-disabled",60017),debugHint:x("debug-hint",60017),terminalDecorationSuccess:x("terminal-decoration-success",60017),primitiveSquare:x("primitive-square",60018),edit:x("edit",60019),pencil:x("pencil",60019),info:x("info",60020),issueOpened:x("issue-opened",60020),gistPrivate:x("gist-private",60021),gitForkPrivate:x("git-fork-private",60021),lock:x("lock",60021),mirrorPrivate:x("mirror-private",60021),close:x("close",60022),removeClose:x("remove-close",60022),x:x("x",60022),repoSync:x("repo-sync",60023),sync:x("sync",60023),clone:x("clone",60024),desktopDownload:x("desktop-download",60024),beaker:x("beaker",60025),microscope:x("microscope",60025),vm:x("vm",60026),deviceDesktop:x("device-desktop",60026),file:x("file",60027),fileText:x("file-text",60027),more:x("more",60028),ellipsis:x("ellipsis",60028),kebabHorizontal:x("kebab-horizontal",60028),mailReply:x("mail-reply",60029),reply:x("reply",60029),organization:x("organization",60030),organizationFilled:x("organization-filled",60030),organizationOutline:x("organization-outline",60030),newFile:x("new-file",60031),fileAdd:x("file-add",60031),newFolder:x("new-folder",60032),fileDirectoryCreate:x("file-directory-create",60032),trash:x("trash",60033),trashcan:x("trashcan",60033),history:x("history",60034),clock:x("clock",60034),folder:x("folder",60035),fileDirectory:x("file-directory",60035),symbolFolder:x("symbol-folder",60035),logoGithub:x("logo-github",60036),markGithub:x("mark-github",60036),github:x("github",60036),terminal:x("terminal",60037),console:x("console",60037),repl:x("repl",60037),zap:x("zap",60038),symbolEvent:x("symbol-event",60038),error:x("error",60039),stop:x("stop",60039),variable:x("variable",60040),symbolVariable:x("symbol-variable",60040),array:x("array",60042),symbolArray:x("symbol-array",60042),symbolModule:x("symbol-module",60043),symbolPackage:x("symbol-package",60043),symbolNamespace:x("symbol-namespace",60043),symbolObject:x("symbol-object",60043),symbolMethod:x("symbol-method",60044),symbolFunction:x("symbol-function",60044),symbolConstructor:x("symbol-constructor",60044),symbolBoolean:x("symbol-boolean",60047),symbolNull:x("symbol-null",60047),symbolNumeric:x("symbol-numeric",60048),symbolNumber:x("symbol-number",60048),symbolStructure:x("symbol-structure",60049),symbolStruct:x("symbol-struct",60049),symbolParameter:x("symbol-parameter",60050),symbolTypeParameter:x("symbol-type-parameter",60050),symbolKey:x("symbol-key",60051),symbolText:x("symbol-text",60051),symbolReference:x("symbol-reference",60052),goToFile:x("go-to-file",60052),symbolEnum:x("symbol-enum",60053),symbolValue:x("symbol-value",60053),symbolRuler:x("symbol-ruler",60054),symbolUnit:x("symbol-unit",60054),activateBreakpoints:x("activate-breakpoints",60055),archive:x("archive",60056),arrowBoth:x("arrow-both",60057),arrowDown:x("arrow-down",60058),arrowLeft:x("arrow-left",60059),arrowRight:x("arrow-right",60060),arrowSmallDown:x("arrow-small-down",60061),arrowSmallLeft:x("arrow-small-left",60062),arrowSmallRight:x("arrow-small-right",60063),arrowSmallUp:x("arrow-small-up",60064),arrowUp:x("arrow-up",60065),bell:x("bell",60066),bold:x("bold",60067),book:x("book",60068),bookmark:x("bookmark",60069),debugBreakpointConditionalUnverified:x("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:x("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:x("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:x("debug-breakpoint-data-unverified",60072),debugBreakpointData:x("debug-breakpoint-data",60073),debugBreakpointDataDisabled:x("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:x("debug-breakpoint-log-unverified",60074),debugBreakpointLog:x("debug-breakpoint-log",60075),debugBreakpointLogDisabled:x("debug-breakpoint-log-disabled",60075),briefcase:x("briefcase",60076),broadcast:x("broadcast",60077),browser:x("browser",60078),bug:x("bug",60079),calendar:x("calendar",60080),caseSensitive:x("case-sensitive",60081),check:x("check",60082),checklist:x("checklist",60083),chevronDown:x("chevron-down",60084),chevronLeft:x("chevron-left",60085),chevronRight:x("chevron-right",60086),chevronUp:x("chevron-up",60087),chromeClose:x("chrome-close",60088),chromeMaximize:x("chrome-maximize",60089),chromeMinimize:x("chrome-minimize",60090),chromeRestore:x("chrome-restore",60091),circleOutline:x("circle-outline",60092),circle:x("circle",60092),debugBreakpointUnverified:x("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:x("terminal-decoration-incomplete",60092),circleSlash:x("circle-slash",60093),circuitBoard:x("circuit-board",60094),clearAll:x("clear-all",60095),clippy:x("clippy",60096),closeAll:x("close-all",60097),cloudDownload:x("cloud-download",60098),cloudUpload:x("cloud-upload",60099),code:x("code",60100),collapseAll:x("collapse-all",60101),colorMode:x("color-mode",60102),commentDiscussion:x("comment-discussion",60103),creditCard:x("credit-card",60105),dash:x("dash",60108),dashboard:x("dashboard",60109),database:x("database",60110),debugContinue:x("debug-continue",60111),debugDisconnect:x("debug-disconnect",60112),debugPause:x("debug-pause",60113),debugRestart:x("debug-restart",60114),debugStart:x("debug-start",60115),debugStepInto:x("debug-step-into",60116),debugStepOut:x("debug-step-out",60117),debugStepOver:x("debug-step-over",60118),debugStop:x("debug-stop",60119),debug:x("debug",60120),deviceCameraVideo:x("device-camera-video",60121),deviceCamera:x("device-camera",60122),deviceMobile:x("device-mobile",60123),diffAdded:x("diff-added",60124),diffIgnored:x("diff-ignored",60125),diffModified:x("diff-modified",60126),diffRemoved:x("diff-removed",60127),diffRenamed:x("diff-renamed",60128),diff:x("diff",60129),diffSidebyside:x("diff-sidebyside",60129),discard:x("discard",60130),editorLayout:x("editor-layout",60131),emptyWindow:x("empty-window",60132),exclude:x("exclude",60133),extensions:x("extensions",60134),eyeClosed:x("eye-closed",60135),fileBinary:x("file-binary",60136),fileCode:x("file-code",60137),fileMedia:x("file-media",60138),filePdf:x("file-pdf",60139),fileSubmodule:x("file-submodule",60140),fileSymlinkDirectory:x("file-symlink-directory",60141),fileSymlinkFile:x("file-symlink-file",60142),fileZip:x("file-zip",60143),files:x("files",60144),filter:x("filter",60145),flame:x("flame",60146),foldDown:x("fold-down",60147),foldUp:x("fold-up",60148),fold:x("fold",60149),folderActive:x("folder-active",60150),folderOpened:x("folder-opened",60151),gear:x("gear",60152),gift:x("gift",60153),gistSecret:x("gist-secret",60154),gist:x("gist",60155),gitCommit:x("git-commit",60156),gitCompare:x("git-compare",60157),compareChanges:x("compare-changes",60157),gitMerge:x("git-merge",60158),githubAction:x("github-action",60159),githubAlt:x("github-alt",60160),globe:x("globe",60161),grabber:x("grabber",60162),graph:x("graph",60163),gripper:x("gripper",60164),heart:x("heart",60165),home:x("home",60166),horizontalRule:x("horizontal-rule",60167),hubot:x("hubot",60168),inbox:x("inbox",60169),issueReopened:x("issue-reopened",60171),issues:x("issues",60172),italic:x("italic",60173),jersey:x("jersey",60174),json:x("json",60175),kebabVertical:x("kebab-vertical",60176),key:x("key",60177),law:x("law",60178),lightbulbAutofix:x("lightbulb-autofix",60179),linkExternal:x("link-external",60180),link:x("link",60181),listOrdered:x("list-ordered",60182),listUnordered:x("list-unordered",60183),liveShare:x("live-share",60184),loading:x("loading",60185),location:x("location",60186),mailRead:x("mail-read",60187),mail:x("mail",60188),markdown:x("markdown",60189),megaphone:x("megaphone",60190),mention:x("mention",60191),milestone:x("milestone",60192),gitPullRequestMilestone:x("git-pull-request-milestone",60192),mortarBoard:x("mortar-board",60193),move:x("move",60194),multipleWindows:x("multiple-windows",60195),mute:x("mute",60196),noNewline:x("no-newline",60197),note:x("note",60198),octoface:x("octoface",60199),openPreview:x("open-preview",60200),package:x("package",60201),paintcan:x("paintcan",60202),pin:x("pin",60203),play:x("play",60204),run:x("run",60204),plug:x("plug",60205),preserveCase:x("preserve-case",60206),preview:x("preview",60207),project:x("project",60208),pulse:x("pulse",60209),question:x("question",60210),quote:x("quote",60211),radioTower:x("radio-tower",60212),reactions:x("reactions",60213),references:x("references",60214),refresh:x("refresh",60215),regex:x("regex",60216),remoteExplorer:x("remote-explorer",60217),remote:x("remote",60218),remove:x("remove",60219),replaceAll:x("replace-all",60220),replace:x("replace",60221),repoClone:x("repo-clone",60222),repoForcePush:x("repo-force-push",60223),repoPull:x("repo-pull",60224),repoPush:x("repo-push",60225),report:x("report",60226),requestChanges:x("request-changes",60227),rocket:x("rocket",60228),rootFolderOpened:x("root-folder-opened",60229),rootFolder:x("root-folder",60230),rss:x("rss",60231),ruby:x("ruby",60232),saveAll:x("save-all",60233),saveAs:x("save-as",60234),save:x("save",60235),screenFull:x("screen-full",60236),screenNormal:x("screen-normal",60237),searchStop:x("search-stop",60238),server:x("server",60240),settingsGear:x("settings-gear",60241),settings:x("settings",60242),shield:x("shield",60243),smiley:x("smiley",60244),sortPrecedence:x("sort-precedence",60245),splitHorizontal:x("split-horizontal",60246),splitVertical:x("split-vertical",60247),squirrel:x("squirrel",60248),starFull:x("star-full",60249),starHalf:x("star-half",60250),symbolClass:x("symbol-class",60251),symbolColor:x("symbol-color",60252),symbolConstant:x("symbol-constant",60253),symbolEnumMember:x("symbol-enum-member",60254),symbolField:x("symbol-field",60255),symbolFile:x("symbol-file",60256),symbolInterface:x("symbol-interface",60257),symbolKeyword:x("symbol-keyword",60258),symbolMisc:x("symbol-misc",60259),symbolOperator:x("symbol-operator",60260),symbolProperty:x("symbol-property",60261),wrench:x("wrench",60261),wrenchSubaction:x("wrench-subaction",60261),symbolSnippet:x("symbol-snippet",60262),tasklist:x("tasklist",60263),telescope:x("telescope",60264),textSize:x("text-size",60265),threeBars:x("three-bars",60266),thumbsdown:x("thumbsdown",60267),thumbsup:x("thumbsup",60268),tools:x("tools",60269),triangleDown:x("triangle-down",60270),triangleLeft:x("triangle-left",60271),triangleRight:x("triangle-right",60272),triangleUp:x("triangle-up",60273),twitter:x("twitter",60274),unfold:x("unfold",60275),unlock:x("unlock",60276),unmute:x("unmute",60277),unverified:x("unverified",60278),verified:x("verified",60279),versions:x("versions",60280),vmActive:x("vm-active",60281),vmOutline:x("vm-outline",60282),vmRunning:x("vm-running",60283),watch:x("watch",60284),whitespace:x("whitespace",60285),wholeWord:x("whole-word",60286),window:x("window",60287),wordWrap:x("word-wrap",60288),zoomIn:x("zoom-in",60289),zoomOut:x("zoom-out",60290),listFilter:x("list-filter",60291),listFlat:x("list-flat",60292),listSelection:x("list-selection",60293),selection:x("selection",60293),listTree:x("list-tree",60294),debugBreakpointFunctionUnverified:x("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:x("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:x("debug-breakpoint-function-disabled",60296),debugStackframeActive:x("debug-stackframe-active",60297),circleSmallFilled:x("circle-small-filled",60298),debugStackframeDot:x("debug-stackframe-dot",60298),terminalDecorationMark:x("terminal-decoration-mark",60298),debugStackframe:x("debug-stackframe",60299),debugStackframeFocused:x("debug-stackframe-focused",60299),debugBreakpointUnsupported:x("debug-breakpoint-unsupported",60300),symbolString:x("symbol-string",60301),debugReverseContinue:x("debug-reverse-continue",60302),debugStepBack:x("debug-step-back",60303),debugRestartFrame:x("debug-restart-frame",60304),debugAlt:x("debug-alt",60305),callIncoming:x("call-incoming",60306),callOutgoing:x("call-outgoing",60307),menu:x("menu",60308),expandAll:x("expand-all",60309),feedback:x("feedback",60310),gitPullRequestReviewer:x("git-pull-request-reviewer",60310),groupByRefType:x("group-by-ref-type",60311),ungroupByRefType:x("ungroup-by-ref-type",60312),account:x("account",60313),gitPullRequestAssignee:x("git-pull-request-assignee",60313),bellDot:x("bell-dot",60314),debugConsole:x("debug-console",60315),library:x("library",60316),output:x("output",60317),runAll:x("run-all",60318),syncIgnored:x("sync-ignored",60319),pinned:x("pinned",60320),githubInverted:x("github-inverted",60321),serverProcess:x("server-process",60322),serverEnvironment:x("server-environment",60323),pass:x("pass",60324),issueClosed:x("issue-closed",60324),stopCircle:x("stop-circle",60325),playCircle:x("play-circle",60326),record:x("record",60327),debugAltSmall:x("debug-alt-small",60328),vmConnect:x("vm-connect",60329),cloud:x("cloud",60330),merge:x("merge",60331),export:x("export",60332),graphLeft:x("graph-left",60333),magnet:x("magnet",60334),notebook:x("notebook",60335),redo:x("redo",60336),checkAll:x("check-all",60337),pinnedDirty:x("pinned-dirty",60338),passFilled:x("pass-filled",60339),circleLargeFilled:x("circle-large-filled",60340),circleLarge:x("circle-large",60341),circleLargeOutline:x("circle-large-outline",60341),combine:x("combine",60342),gather:x("gather",60342),table:x("table",60343),variableGroup:x("variable-group",60344),typeHierarchy:x("type-hierarchy",60345),typeHierarchySub:x("type-hierarchy-sub",60346),typeHierarchySuper:x("type-hierarchy-super",60347),gitPullRequestCreate:x("git-pull-request-create",60348),runAbove:x("run-above",60349),runBelow:x("run-below",60350),notebookTemplate:x("notebook-template",60351),debugRerun:x("debug-rerun",60352),workspaceTrusted:x("workspace-trusted",60353),workspaceUntrusted:x("workspace-untrusted",60354),workspaceUnknown:x("workspace-unknown",60355),terminalCmd:x("terminal-cmd",60356),terminalDebian:x("terminal-debian",60357),terminalLinux:x("terminal-linux",60358),terminalPowershell:x("terminal-powershell",60359),terminalTmux:x("terminal-tmux",60360),terminalUbuntu:x("terminal-ubuntu",60361),terminalBash:x("terminal-bash",60362),arrowSwap:x("arrow-swap",60363),copy:x("copy",60364),personAdd:x("person-add",60365),filterFilled:x("filter-filled",60366),wand:x("wand",60367),debugLineByLine:x("debug-line-by-line",60368),inspect:x("inspect",60369),layers:x("layers",60370),layersDot:x("layers-dot",60371),layersActive:x("layers-active",60372),compass:x("compass",60373),compassDot:x("compass-dot",60374),compassActive:x("compass-active",60375),azure:x("azure",60376),issueDraft:x("issue-draft",60377),gitPullRequestClosed:x("git-pull-request-closed",60378),gitPullRequestDraft:x("git-pull-request-draft",60379),debugAll:x("debug-all",60380),debugCoverage:x("debug-coverage",60381),runErrors:x("run-errors",60382),folderLibrary:x("folder-library",60383),debugContinueSmall:x("debug-continue-small",60384),beakerStop:x("beaker-stop",60385),graphLine:x("graph-line",60386),graphScatter:x("graph-scatter",60387),pieChart:x("pie-chart",60388),bracket:x("bracket",60175),bracketDot:x("bracket-dot",60389),bracketError:x("bracket-error",60390),lockSmall:x("lock-small",60391),azureDevops:x("azure-devops",60392),verifiedFilled:x("verified-filled",60393),newline:x("newline",60394),layout:x("layout",60395),layoutActivitybarLeft:x("layout-activitybar-left",60396),layoutActivitybarRight:x("layout-activitybar-right",60397),layoutPanelLeft:x("layout-panel-left",60398),layoutPanelCenter:x("layout-panel-center",60399),layoutPanelJustify:x("layout-panel-justify",60400),layoutPanelRight:x("layout-panel-right",60401),layoutPanel:x("layout-panel",60402),layoutSidebarLeft:x("layout-sidebar-left",60403),layoutSidebarRight:x("layout-sidebar-right",60404),layoutStatusbar:x("layout-statusbar",60405),layoutMenubar:x("layout-menubar",60406),layoutCentered:x("layout-centered",60407),target:x("target",60408),indent:x("indent",60409),recordSmall:x("record-small",60410),errorSmall:x("error-small",60411),terminalDecorationError:x("terminal-decoration-error",60411),arrowCircleDown:x("arrow-circle-down",60412),arrowCircleLeft:x("arrow-circle-left",60413),arrowCircleRight:x("arrow-circle-right",60414),arrowCircleUp:x("arrow-circle-up",60415),layoutSidebarRightOff:x("layout-sidebar-right-off",60416),layoutPanelOff:x("layout-panel-off",60417),layoutSidebarLeftOff:x("layout-sidebar-left-off",60418),blank:x("blank",60419),heartFilled:x("heart-filled",60420),map:x("map",60421),mapHorizontal:x("map-horizontal",60421),foldHorizontal:x("fold-horizontal",60421),mapFilled:x("map-filled",60422),mapHorizontalFilled:x("map-horizontal-filled",60422),foldHorizontalFilled:x("fold-horizontal-filled",60422),circleSmall:x("circle-small",60423),bellSlash:x("bell-slash",60424),bellSlashDot:x("bell-slash-dot",60425),commentUnresolved:x("comment-unresolved",60426),gitPullRequestGoToChanges:x("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:x("git-pull-request-new-changes",60428),searchFuzzy:x("search-fuzzy",60429),commentDraft:x("comment-draft",60430),send:x("send",60431),sparkle:x("sparkle",60432),insert:x("insert",60433),mic:x("mic",60434),thumbsdownFilled:x("thumbsdown-filled",60435),thumbsupFilled:x("thumbsup-filled",60436),coffee:x("coffee",60437),snake:x("snake",60438),game:x("game",60439),vr:x("vr",60440),chip:x("chip",60441),piano:x("piano",60442),music:x("music",60443),micFilled:x("mic-filled",60444),repoFetch:x("repo-fetch",60445),copilot:x("copilot",60446),lightbulbSparkle:x("lightbulb-sparkle",60447),robot:x("robot",60448),sparkleFilled:x("sparkle-filled",60449),diffSingle:x("diff-single",60450),diffMultiple:x("diff-multiple",60451),surroundWith:x("surround-with",60452),share:x("share",60453),gitStash:x("git-stash",60454),gitStashApply:x("git-stash-apply",60455),gitStashPop:x("git-stash-pop",60456),vscode:x("vscode",60457),vscodeInsiders:x("vscode-insiders",60458),codeOss:x("code-oss",60459),runCoverage:x("run-coverage",60460),runAllCoverage:x("run-all-coverage",60461),coverage:x("coverage",60462),githubProject:x("github-project",60463),mapVertical:x("map-vertical",60464),foldVertical:x("fold-vertical",60464),mapVerticalFilled:x("map-vertical-filled",60465),foldVerticalFilled:x("fold-vertical-filled",60465),goToSearch:x("go-to-search",60466),percentage:x("percentage",60467),sortPercentage:x("sort-percentage",60467),attach:x("attach",60468),goToEditingSession:x("go-to-editing-session",60469),editSession:x("edit-session",60470),codeReview:x("code-review",60471),copilotWarning:x("copilot-warning",60472),python:x("python",60473),copilotLarge:x("copilot-large",60474),copilotWarningLarge:x("copilot-warning-large",60475),keyboardTab:x("keyboard-tab",60476),copilotBlocked:x("copilot-blocked",60477),copilotNotConnected:x("copilot-not-connected",60478),flag:x("flag",60479),lightbulbEmpty:x("lightbulb-empty",60480),symbolMethodArrow:x("symbol-method-arrow",60481),copilotUnavailable:x("copilot-unavailable",60482),repoPinned:x("repo-pinned",60483),keyboardTabAbove:x("keyboard-tab-above",60484),keyboardTabBelow:x("keyboard-tab-below",60485),gitPullRequestDone:x("git-pull-request-done",60486),mcp:x("mcp",60487),extensionsLarge:x("extensions-large",60488),layoutPanelDock:x("layout-panel-dock",60489),layoutSidebarLeftDock:x("layout-sidebar-left-dock",60490),layoutSidebarRightDock:x("layout-sidebar-right-dock",60491),copilotInProgress:x("copilot-in-progress",60492),copilotError:x("copilot-error",60493),copilotSuccess:x("copilot-success",60494),chatSparkle:x("chat-sparkle",60495),searchSparkle:x("search-sparkle",60496),editSparkle:x("edit-sparkle",60497),copilotSnooze:x("copilot-snooze",60498),sendToRemoteAgent:x("send-to-remote-agent",60499),commentDiscussionSparkle:x("comment-discussion-sparkle",60500),chatSparkleWarning:x("chat-sparkle-warning",60501),chatSparkleError:x("chat-sparkle-error",60502),collection:x("collection",60503),newCollection:x("new-collection",60504),thinking:x("thinking",60505)},xre={dialogError:x("dialog-error","error"),dialogWarning:x("dialog-warning","warning"),dialogInfo:x("dialog-info","info"),dialogClose:x("dialog-close","close"),treeItemExpanded:x("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:x("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:x("tree-filter-on-type-off","list-selection"),treeFilterClear:x("tree-filter-clear","close"),treeItemLoading:x("tree-item-loading","loading"),menuSelection:x("menu-selection","check"),menuSubmenu:x("menu-submenu","chevron-right"),menuBarMore:x("menubar-more","more"),scrollbarButtonLeft:x("scrollbar-button-left","triangle-left"),scrollbarButtonRight:x("scrollbar-button-right","triangle-right"),scrollbarButtonUp:x("scrollbar-button-up","triangle-up"),scrollbarButtonDown:x("scrollbar-button-down","triangle-down"),toolBarMore:x("toolbar-more","more"),quickInputBack:x("quick-input-back","arrow-left"),dropDownButton:x("drop-down-button",60084),symbolCustomColor:x("symbol-customcolor",60252),exportIcon:x("export",60332),workspaceUnspecified:x("workspace-unspecified",60355),newLine:x("newline",60394),thumbsDownFilled:x("thumbsdown-filled",60435),thumbsUpFilled:x("thumbsup-filled",60436),gitFetch:x("git-fetch",60445),lightbulbSparkleAutofix:x("lightbulb-sparkle-autofix",60447),debugBreakpointPending:x("debug-breakpoint-pending",60377)},ne={...Sre,...xre};let Lre=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),Ce(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();const n=new kre(this,e,t);return this._factories.set(e,n),Ce(()=>{const i=this._factories.get(e);!i||i!==n||(this._factories.delete(e),i.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const n=this._factories.get(e);return!!(!n||n.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class kre extends U{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}let Wm=class{constructor(e,t,n){this.offset=e,this.type=t,this.language=n,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class ME{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class Xw{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var aF;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(aF||(aF={}));var lF;(function(s){const e=new Map;e.set(0,ne.symbolMethod),e.set(1,ne.symbolFunction),e.set(2,ne.symbolConstructor),e.set(3,ne.symbolField),e.set(4,ne.symbolVariable),e.set(5,ne.symbolClass),e.set(6,ne.symbolStruct),e.set(7,ne.symbolInterface),e.set(8,ne.symbolModule),e.set(9,ne.symbolProperty),e.set(10,ne.symbolEvent),e.set(11,ne.symbolOperator),e.set(12,ne.symbolUnit),e.set(13,ne.symbolValue),e.set(15,ne.symbolEnum),e.set(14,ne.symbolConstant),e.set(15,ne.symbolEnum),e.set(16,ne.symbolEnumMember),e.set(17,ne.symbolKeyword),e.set(28,ne.symbolSnippet),e.set(18,ne.symbolText),e.set(19,ne.symbolColor),e.set(20,ne.symbolFile),e.set(21,ne.symbolReference),e.set(22,ne.symbolCustomColor),e.set(23,ne.symbolFolder),e.set(24,ne.symbolTypeParameter),e.set(25,ne.account),e.set(26,ne.issues),e.set(27,ne.tools);function t(o){let a=e.get(o);return a||(console.info("No codicon found for CompletionItemKind "+o),a=ne.symbolProperty),a}s.toIcon=t;function n(o){switch(o){case 0:return _(724,"Method");case 1:return _(725,"Function");case 2:return _(726,"Constructor");case 3:return _(727,"Field");case 4:return _(728,"Variable");case 5:return _(729,"Class");case 6:return _(730,"Struct");case 7:return _(731,"Interface");case 8:return _(732,"Module");case 9:return _(733,"Property");case 10:return _(734,"Event");case 11:return _(735,"Operator");case 12:return _(736,"Unit");case 13:return _(737,"Value");case 14:return _(738,"Constant");case 15:return _(739,"Enum");case 16:return _(740,"Enum Member");case 17:return _(741,"Keyword");case 18:return _(742,"Text");case 19:return _(743,"Color");case 20:return _(744,"File");case 21:return _(745,"Reference");case 22:return _(746,"Custom Color");case 23:return _(747,"Folder");case 24:return _(748,"Type Parameter");case 25:return _(749,"User");case 26:return _(750,"Issue");case 27:return _(751,"Tool");case 28:return _(752,"Snippet");default:return""}}s.toLabel=n;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",28),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),i.set("tool",27);function r(o,a){let l=i.get(o);return typeof l>"u"&&!a&&(l=9),l}s.fromString=r})(lF||(lF={}));var cF;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(cF||(cF={}));class Ere{constructor(e,t,n,i){this.range=e,this.text=t,this.completionKind=n,this.isSnippetText=i}equals(e){return R.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var dF;(function(s){s[s.Code=1]="Code",s[s.Label=2]="Label"})(dF||(dF={}));var hF;(function(s){s[s.Accepted=0]="Accepted",s[s.Rejected=1]="Rejected",s[s.Ignored=2]="Ignored"})(hF||(hF={}));var uF;(function(s){s[s.Automatic=0]="Automatic",s[s.PasteAs=1]="PasteAs"})(uF||(uF={}));var fF;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(fF||(fF={}));var gF;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(gF||(gF={})),_(753,"array"),_(754,"boolean"),_(755,"class"),_(756,"constant"),_(757,"constructor"),_(758,"enumeration"),_(759,"enumeration member"),_(760,"event"),_(761,"field"),_(762,"file"),_(763,"function"),_(764,"interface"),_(765,"key"),_(766,"method"),_(767,"module"),_(768,"namespace"),_(769,"null"),_(770,"number"),_(771,"object"),_(772,"operator"),_(773,"package"),_(774,"property"),_(775,"string"),_(776,"struct"),_(777,"type parameter"),_(778,"variable");var RE;(function(s){const e=new Map;e.set(0,ne.symbolFile),e.set(1,ne.symbolModule),e.set(2,ne.symbolNamespace),e.set(3,ne.symbolPackage),e.set(4,ne.symbolClass),e.set(5,ne.symbolMethod),e.set(6,ne.symbolProperty),e.set(7,ne.symbolField),e.set(8,ne.symbolConstructor),e.set(9,ne.symbolEnum),e.set(10,ne.symbolInterface),e.set(11,ne.symbolFunction),e.set(12,ne.symbolVariable),e.set(13,ne.symbolConstant),e.set(14,ne.symbolString),e.set(15,ne.symbolNumber),e.set(16,ne.symbolBoolean),e.set(17,ne.symbolArray),e.set(18,ne.symbolObject),e.set(19,ne.symbolKey),e.set(20,ne.symbolNull),e.set(21,ne.symbolEnumMember),e.set(22,ne.symbolStruct),e.set(23,ne.symbolEvent),e.set(24,ne.symbolOperator),e.set(25,ne.symbolTypeParameter);function t(r){let o=e.get(r);return o||(console.info("No codicon found for SymbolKind "+r),o=ne.symbolProperty),o}s.toIcon=t;const n=new Map;n.set(0,20),n.set(1,8),n.set(2,8),n.set(3,8),n.set(4,5),n.set(5,0),n.set(6,9),n.set(7,3),n.set(8,2),n.set(9,15),n.set(10,7),n.set(11,1),n.set(12,4),n.set(13,14),n.set(14,18),n.set(15,13),n.set(16,13),n.set(17,13),n.set(18,13),n.set(19,17),n.set(20,13),n.set(21,16),n.set(22,6),n.set(23,10),n.set(24,11),n.set(25,24);function i(r){let o=n.get(r);return o===void 0&&(console.info("No completion kind found for SymbolKind "+r),o=20),o}s.toCompletionKind=i})(RE||(RE={}));const fo=class fo{static fromValue(e){switch(e){case"comment":return fo.Comment;case"imports":return fo.Imports;case"region":return fo.Region}return new fo(e)}constructor(e){this.value=e}};fo.Comment=new fo("comment"),fo.Imports=new fo("imports"),fo.Region=new fo("region");let AE=fo;var pF;(function(s){s[s.AIGenerated=1]="AIGenerated"})(pF||(pF={}));var mF;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(mF||(mF={}));var _F;(function(s){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}s.is=e})(_F||(_F={}));var bF;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(bF||(bF={}));class Nre{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const gn=new Lre;var OE;(function(s){s[s.Unknown=0]="Unknown",s[s.Disabled=1]="Disabled",s[s.Enabled=2]="Enabled"})(OE||(OE={}));var PE;(function(s){s[s.Invoke=1]="Invoke",s[s.Auto=2]="Auto"})(PE||(PE={}));var FE;(function(s){s[s.None=0]="None",s[s.KeepWhitespace=1]="KeepWhitespace",s[s.InsertAsSnippet=4]="InsertAsSnippet"})(FE||(FE={}));var BE;(function(s){s[s.Method=0]="Method",s[s.Function=1]="Function",s[s.Constructor=2]="Constructor",s[s.Field=3]="Field",s[s.Variable=4]="Variable",s[s.Class=5]="Class",s[s.Struct=6]="Struct",s[s.Interface=7]="Interface",s[s.Module=8]="Module",s[s.Property=9]="Property",s[s.Event=10]="Event",s[s.Operator=11]="Operator",s[s.Unit=12]="Unit",s[s.Value=13]="Value",s[s.Constant=14]="Constant",s[s.Enum=15]="Enum",s[s.EnumMember=16]="EnumMember",s[s.Keyword=17]="Keyword",s[s.Text=18]="Text",s[s.Color=19]="Color",s[s.File=20]="File",s[s.Reference=21]="Reference",s[s.Customcolor=22]="Customcolor",s[s.Folder=23]="Folder",s[s.TypeParameter=24]="TypeParameter",s[s.User=25]="User",s[s.Issue=26]="Issue",s[s.Tool=27]="Tool",s[s.Snippet=28]="Snippet"})(BE||(BE={}));var VE;(function(s){s[s.Deprecated=1]="Deprecated"})(VE||(VE={}));var WE;(function(s){s[s.Invoke=0]="Invoke",s[s.TriggerCharacter=1]="TriggerCharacter",s[s.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(WE||(WE={}));var HE;(function(s){s[s.EXACT=0]="EXACT",s[s.ABOVE=1]="ABOVE",s[s.BELOW=2]="BELOW"})(HE||(HE={}));var zE;(function(s){s[s.NotSet=0]="NotSet",s[s.ContentFlush=1]="ContentFlush",s[s.RecoverFromMarkers=2]="RecoverFromMarkers",s[s.Explicit=3]="Explicit",s[s.Paste=4]="Paste",s[s.Undo=5]="Undo",s[s.Redo=6]="Redo"})(zE||(zE={}));var $E;(function(s){s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})($E||($E={}));var UE;(function(s){s[s.Text=0]="Text",s[s.Read=1]="Read",s[s.Write=2]="Write"})(UE||(UE={}));var jE;(function(s){s[s.None=0]="None",s[s.Keep=1]="Keep",s[s.Brackets=2]="Brackets",s[s.Advanced=3]="Advanced",s[s.Full=4]="Full"})(jE||(jE={}));var KE;(function(s){s[s.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",s[s.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",s[s.accessibilitySupport=2]="accessibilitySupport",s[s.accessibilityPageSize=3]="accessibilityPageSize",s[s.allowOverflow=4]="allowOverflow",s[s.allowVariableLineHeights=5]="allowVariableLineHeights",s[s.allowVariableFonts=6]="allowVariableFonts",s[s.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",s[s.ariaLabel=8]="ariaLabel",s[s.ariaRequired=9]="ariaRequired",s[s.autoClosingBrackets=10]="autoClosingBrackets",s[s.autoClosingComments=11]="autoClosingComments",s[s.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",s[s.autoClosingDelete=13]="autoClosingDelete",s[s.autoClosingOvertype=14]="autoClosingOvertype",s[s.autoClosingQuotes=15]="autoClosingQuotes",s[s.autoIndent=16]="autoIndent",s[s.autoIndentOnPaste=17]="autoIndentOnPaste",s[s.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",s[s.automaticLayout=19]="automaticLayout",s[s.autoSurround=20]="autoSurround",s[s.bracketPairColorization=21]="bracketPairColorization",s[s.guides=22]="guides",s[s.codeLens=23]="codeLens",s[s.codeLensFontFamily=24]="codeLensFontFamily",s[s.codeLensFontSize=25]="codeLensFontSize",s[s.colorDecorators=26]="colorDecorators",s[s.colorDecoratorsLimit=27]="colorDecoratorsLimit",s[s.columnSelection=28]="columnSelection",s[s.comments=29]="comments",s[s.contextmenu=30]="contextmenu",s[s.copyWithSyntaxHighlighting=31]="copyWithSyntaxHighlighting",s[s.cursorBlinking=32]="cursorBlinking",s[s.cursorSmoothCaretAnimation=33]="cursorSmoothCaretAnimation",s[s.cursorStyle=34]="cursorStyle",s[s.cursorSurroundingLines=35]="cursorSurroundingLines",s[s.cursorSurroundingLinesStyle=36]="cursorSurroundingLinesStyle",s[s.cursorWidth=37]="cursorWidth",s[s.cursorHeight=38]="cursorHeight",s[s.disableLayerHinting=39]="disableLayerHinting",s[s.disableMonospaceOptimizations=40]="disableMonospaceOptimizations",s[s.domReadOnly=41]="domReadOnly",s[s.dragAndDrop=42]="dragAndDrop",s[s.dropIntoEditor=43]="dropIntoEditor",s[s.editContext=44]="editContext",s[s.emptySelectionClipboard=45]="emptySelectionClipboard",s[s.experimentalGpuAcceleration=46]="experimentalGpuAcceleration",s[s.experimentalWhitespaceRendering=47]="experimentalWhitespaceRendering",s[s.extraEditorClassName=48]="extraEditorClassName",s[s.fastScrollSensitivity=49]="fastScrollSensitivity",s[s.find=50]="find",s[s.fixedOverflowWidgets=51]="fixedOverflowWidgets",s[s.folding=52]="folding",s[s.foldingStrategy=53]="foldingStrategy",s[s.foldingHighlight=54]="foldingHighlight",s[s.foldingImportsByDefault=55]="foldingImportsByDefault",s[s.foldingMaximumRegions=56]="foldingMaximumRegions",s[s.unfoldOnClickAfterEndOfLine=57]="unfoldOnClickAfterEndOfLine",s[s.fontFamily=58]="fontFamily",s[s.fontInfo=59]="fontInfo",s[s.fontLigatures=60]="fontLigatures",s[s.fontSize=61]="fontSize",s[s.fontWeight=62]="fontWeight",s[s.fontVariations=63]="fontVariations",s[s.formatOnPaste=64]="formatOnPaste",s[s.formatOnType=65]="formatOnType",s[s.glyphMargin=66]="glyphMargin",s[s.gotoLocation=67]="gotoLocation",s[s.hideCursorInOverviewRuler=68]="hideCursorInOverviewRuler",s[s.hover=69]="hover",s[s.inDiffEditor=70]="inDiffEditor",s[s.inlineSuggest=71]="inlineSuggest",s[s.letterSpacing=72]="letterSpacing",s[s.lightbulb=73]="lightbulb",s[s.lineDecorationsWidth=74]="lineDecorationsWidth",s[s.lineHeight=75]="lineHeight",s[s.lineNumbers=76]="lineNumbers",s[s.lineNumbersMinChars=77]="lineNumbersMinChars",s[s.linkedEditing=78]="linkedEditing",s[s.links=79]="links",s[s.matchBrackets=80]="matchBrackets",s[s.minimap=81]="minimap",s[s.mouseStyle=82]="mouseStyle",s[s.mouseWheelScrollSensitivity=83]="mouseWheelScrollSensitivity",s[s.mouseWheelZoom=84]="mouseWheelZoom",s[s.multiCursorMergeOverlapping=85]="multiCursorMergeOverlapping",s[s.multiCursorModifier=86]="multiCursorModifier",s[s.mouseMiddleClickAction=87]="mouseMiddleClickAction",s[s.multiCursorPaste=88]="multiCursorPaste",s[s.multiCursorLimit=89]="multiCursorLimit",s[s.occurrencesHighlight=90]="occurrencesHighlight",s[s.occurrencesHighlightDelay=91]="occurrencesHighlightDelay",s[s.overtypeCursorStyle=92]="overtypeCursorStyle",s[s.overtypeOnPaste=93]="overtypeOnPaste",s[s.overviewRulerBorder=94]="overviewRulerBorder",s[s.overviewRulerLanes=95]="overviewRulerLanes",s[s.padding=96]="padding",s[s.pasteAs=97]="pasteAs",s[s.parameterHints=98]="parameterHints",s[s.peekWidgetDefaultFocus=99]="peekWidgetDefaultFocus",s[s.placeholder=100]="placeholder",s[s.definitionLinkOpensInPeek=101]="definitionLinkOpensInPeek",s[s.quickSuggestions=102]="quickSuggestions",s[s.quickSuggestionsDelay=103]="quickSuggestionsDelay",s[s.readOnly=104]="readOnly",s[s.readOnlyMessage=105]="readOnlyMessage",s[s.renameOnType=106]="renameOnType",s[s.renderRichScreenReaderContent=107]="renderRichScreenReaderContent",s[s.renderControlCharacters=108]="renderControlCharacters",s[s.renderFinalNewline=109]="renderFinalNewline",s[s.renderLineHighlight=110]="renderLineHighlight",s[s.renderLineHighlightOnlyWhenFocus=111]="renderLineHighlightOnlyWhenFocus",s[s.renderValidationDecorations=112]="renderValidationDecorations",s[s.renderWhitespace=113]="renderWhitespace",s[s.revealHorizontalRightPadding=114]="revealHorizontalRightPadding",s[s.roundedSelection=115]="roundedSelection",s[s.rulers=116]="rulers",s[s.scrollbar=117]="scrollbar",s[s.scrollBeyondLastColumn=118]="scrollBeyondLastColumn",s[s.scrollBeyondLastLine=119]="scrollBeyondLastLine",s[s.scrollPredominantAxis=120]="scrollPredominantAxis",s[s.selectionClipboard=121]="selectionClipboard",s[s.selectionHighlight=122]="selectionHighlight",s[s.selectionHighlightMaxLength=123]="selectionHighlightMaxLength",s[s.selectionHighlightMultiline=124]="selectionHighlightMultiline",s[s.selectOnLineNumbers=125]="selectOnLineNumbers",s[s.showFoldingControls=126]="showFoldingControls",s[s.showUnused=127]="showUnused",s[s.snippetSuggestions=128]="snippetSuggestions",s[s.smartSelect=129]="smartSelect",s[s.smoothScrolling=130]="smoothScrolling",s[s.stickyScroll=131]="stickyScroll",s[s.stickyTabStops=132]="stickyTabStops",s[s.stopRenderingLineAfter=133]="stopRenderingLineAfter",s[s.suggest=134]="suggest",s[s.suggestFontSize=135]="suggestFontSize",s[s.suggestLineHeight=136]="suggestLineHeight",s[s.suggestOnTriggerCharacters=137]="suggestOnTriggerCharacters",s[s.suggestSelection=138]="suggestSelection",s[s.tabCompletion=139]="tabCompletion",s[s.tabIndex=140]="tabIndex",s[s.trimWhitespaceOnDelete=141]="trimWhitespaceOnDelete",s[s.unicodeHighlighting=142]="unicodeHighlighting",s[s.unusualLineTerminators=143]="unusualLineTerminators",s[s.useShadowDOM=144]="useShadowDOM",s[s.useTabStops=145]="useTabStops",s[s.wordBreak=146]="wordBreak",s[s.wordSegmenterLocales=147]="wordSegmenterLocales",s[s.wordSeparators=148]="wordSeparators",s[s.wordWrap=149]="wordWrap",s[s.wordWrapBreakAfterCharacters=150]="wordWrapBreakAfterCharacters",s[s.wordWrapBreakBeforeCharacters=151]="wordWrapBreakBeforeCharacters",s[s.wordWrapColumn=152]="wordWrapColumn",s[s.wordWrapOverride1=153]="wordWrapOverride1",s[s.wordWrapOverride2=154]="wordWrapOverride2",s[s.wrappingIndent=155]="wrappingIndent",s[s.wrappingStrategy=156]="wrappingStrategy",s[s.showDeprecated=157]="showDeprecated",s[s.inertialScroll=158]="inertialScroll",s[s.inlayHints=159]="inlayHints",s[s.wrapOnEscapedLineFeeds=160]="wrapOnEscapedLineFeeds",s[s.effectiveCursorStyle=161]="effectiveCursorStyle",s[s.editorClassName=162]="editorClassName",s[s.pixelRatio=163]="pixelRatio",s[s.tabFocusMode=164]="tabFocusMode",s[s.layoutInfo=165]="layoutInfo",s[s.wrappingInfo=166]="wrappingInfo",s[s.defaultColorDecorators=167]="defaultColorDecorators",s[s.colorDecoratorsActivatedOn=168]="colorDecoratorsActivatedOn",s[s.inlineCompletionsAccessibilityVerbose=169]="inlineCompletionsAccessibilityVerbose",s[s.effectiveEditContext=170]="effectiveEditContext",s[s.scrollOnMiddleClick=171]="scrollOnMiddleClick",s[s.effectiveAllowVariableFonts=172]="effectiveAllowVariableFonts"})(KE||(KE={}));var qE;(function(s){s[s.TextDefined=0]="TextDefined",s[s.LF=1]="LF",s[s.CRLF=2]="CRLF"})(qE||(qE={}));var GE;(function(s){s[s.LF=0]="LF",s[s.CRLF=1]="CRLF"})(GE||(GE={}));var YE;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=3]="Right"})(YE||(YE={}));var XE;(function(s){s[s.Increase=0]="Increase",s[s.Decrease=1]="Decrease"})(XE||(XE={}));var ZE;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(ZE||(ZE={}));var QE;(function(s){s[s.Both=0]="Both",s[s.Right=1]="Right",s[s.Left=2]="Left",s[s.None=3]="None"})(QE||(QE={}));var JE;(function(s){s[s.Type=1]="Type",s[s.Parameter=2]="Parameter"})(JE||(JE={}));var e2;(function(s){s[s.Code=1]="Code",s[s.Label=2]="Label"})(e2||(e2={}));var t2;(function(s){s[s.Accepted=0]="Accepted",s[s.Rejected=1]="Rejected",s[s.Ignored=2]="Ignored"})(t2||(t2={}));var n2;(function(s){s[s.Automatic=0]="Automatic",s[s.Explicit=1]="Explicit"})(n2||(n2={}));var i2;(function(s){s[s.DependsOnKbLayout=-1]="DependsOnKbLayout",s[s.Unknown=0]="Unknown",s[s.Backspace=1]="Backspace",s[s.Tab=2]="Tab",s[s.Enter=3]="Enter",s[s.Shift=4]="Shift",s[s.Ctrl=5]="Ctrl",s[s.Alt=6]="Alt",s[s.PauseBreak=7]="PauseBreak",s[s.CapsLock=8]="CapsLock",s[s.Escape=9]="Escape",s[s.Space=10]="Space",s[s.PageUp=11]="PageUp",s[s.PageDown=12]="PageDown",s[s.End=13]="End",s[s.Home=14]="Home",s[s.LeftArrow=15]="LeftArrow",s[s.UpArrow=16]="UpArrow",s[s.RightArrow=17]="RightArrow",s[s.DownArrow=18]="DownArrow",s[s.Insert=19]="Insert",s[s.Delete=20]="Delete",s[s.Digit0=21]="Digit0",s[s.Digit1=22]="Digit1",s[s.Digit2=23]="Digit2",s[s.Digit3=24]="Digit3",s[s.Digit4=25]="Digit4",s[s.Digit5=26]="Digit5",s[s.Digit6=27]="Digit6",s[s.Digit7=28]="Digit7",s[s.Digit8=29]="Digit8",s[s.Digit9=30]="Digit9",s[s.KeyA=31]="KeyA",s[s.KeyB=32]="KeyB",s[s.KeyC=33]="KeyC",s[s.KeyD=34]="KeyD",s[s.KeyE=35]="KeyE",s[s.KeyF=36]="KeyF",s[s.KeyG=37]="KeyG",s[s.KeyH=38]="KeyH",s[s.KeyI=39]="KeyI",s[s.KeyJ=40]="KeyJ",s[s.KeyK=41]="KeyK",s[s.KeyL=42]="KeyL",s[s.KeyM=43]="KeyM",s[s.KeyN=44]="KeyN",s[s.KeyO=45]="KeyO",s[s.KeyP=46]="KeyP",s[s.KeyQ=47]="KeyQ",s[s.KeyR=48]="KeyR",s[s.KeyS=49]="KeyS",s[s.KeyT=50]="KeyT",s[s.KeyU=51]="KeyU",s[s.KeyV=52]="KeyV",s[s.KeyW=53]="KeyW",s[s.KeyX=54]="KeyX",s[s.KeyY=55]="KeyY",s[s.KeyZ=56]="KeyZ",s[s.Meta=57]="Meta",s[s.ContextMenu=58]="ContextMenu",s[s.F1=59]="F1",s[s.F2=60]="F2",s[s.F3=61]="F3",s[s.F4=62]="F4",s[s.F5=63]="F5",s[s.F6=64]="F6",s[s.F7=65]="F7",s[s.F8=66]="F8",s[s.F9=67]="F9",s[s.F10=68]="F10",s[s.F11=69]="F11",s[s.F12=70]="F12",s[s.F13=71]="F13",s[s.F14=72]="F14",s[s.F15=73]="F15",s[s.F16=74]="F16",s[s.F17=75]="F17",s[s.F18=76]="F18",s[s.F19=77]="F19",s[s.F20=78]="F20",s[s.F21=79]="F21",s[s.F22=80]="F22",s[s.F23=81]="F23",s[s.F24=82]="F24",s[s.NumLock=83]="NumLock",s[s.ScrollLock=84]="ScrollLock",s[s.Semicolon=85]="Semicolon",s[s.Equal=86]="Equal",s[s.Comma=87]="Comma",s[s.Minus=88]="Minus",s[s.Period=89]="Period",s[s.Slash=90]="Slash",s[s.Backquote=91]="Backquote",s[s.BracketLeft=92]="BracketLeft",s[s.Backslash=93]="Backslash",s[s.BracketRight=94]="BracketRight",s[s.Quote=95]="Quote",s[s.OEM_8=96]="OEM_8",s[s.IntlBackslash=97]="IntlBackslash",s[s.Numpad0=98]="Numpad0",s[s.Numpad1=99]="Numpad1",s[s.Numpad2=100]="Numpad2",s[s.Numpad3=101]="Numpad3",s[s.Numpad4=102]="Numpad4",s[s.Numpad5=103]="Numpad5",s[s.Numpad6=104]="Numpad6",s[s.Numpad7=105]="Numpad7",s[s.Numpad8=106]="Numpad8",s[s.Numpad9=107]="Numpad9",s[s.NumpadMultiply=108]="NumpadMultiply",s[s.NumpadAdd=109]="NumpadAdd",s[s.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",s[s.NumpadSubtract=111]="NumpadSubtract",s[s.NumpadDecimal=112]="NumpadDecimal",s[s.NumpadDivide=113]="NumpadDivide",s[s.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",s[s.ABNT_C1=115]="ABNT_C1",s[s.ABNT_C2=116]="ABNT_C2",s[s.AudioVolumeMute=117]="AudioVolumeMute",s[s.AudioVolumeUp=118]="AudioVolumeUp",s[s.AudioVolumeDown=119]="AudioVolumeDown",s[s.BrowserSearch=120]="BrowserSearch",s[s.BrowserHome=121]="BrowserHome",s[s.BrowserBack=122]="BrowserBack",s[s.BrowserForward=123]="BrowserForward",s[s.MediaTrackNext=124]="MediaTrackNext",s[s.MediaTrackPrevious=125]="MediaTrackPrevious",s[s.MediaStop=126]="MediaStop",s[s.MediaPlayPause=127]="MediaPlayPause",s[s.LaunchMediaPlayer=128]="LaunchMediaPlayer",s[s.LaunchMail=129]="LaunchMail",s[s.LaunchApp2=130]="LaunchApp2",s[s.Clear=131]="Clear",s[s.MAX_VALUE=132]="MAX_VALUE"})(i2||(i2={}));var s2;(function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"})(s2||(s2={}));var r2;(function(s){s[s.Unnecessary=1]="Unnecessary",s[s.Deprecated=2]="Deprecated"})(r2||(r2={}));var o2;(function(s){s[s.Inline=1]="Inline",s[s.Gutter=2]="Gutter"})(o2||(o2={}));var a2;(function(s){s[s.Normal=1]="Normal",s[s.Underlined=2]="Underlined"})(a2||(a2={}));var l2;(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.TEXTAREA=1]="TEXTAREA",s[s.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",s[s.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",s[s.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",s[s.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",s[s.CONTENT_TEXT=6]="CONTENT_TEXT",s[s.CONTENT_EMPTY=7]="CONTENT_EMPTY",s[s.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",s[s.CONTENT_WIDGET=9]="CONTENT_WIDGET",s[s.OVERVIEW_RULER=10]="OVERVIEW_RULER",s[s.SCROLLBAR=11]="SCROLLBAR",s[s.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",s[s.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(l2||(l2={}));var c2;(function(s){s[s.AIGenerated=1]="AIGenerated"})(c2||(c2={}));var d2;(function(s){s[s.Invoke=0]="Invoke",s[s.Automatic=1]="Automatic"})(d2||(d2={}));var h2;(function(s){s[s.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",s[s.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",s[s.TOP_CENTER=2]="TOP_CENTER"})(h2||(h2={}));var u2;(function(s){s[s.Left=1]="Left",s[s.Center=2]="Center",s[s.Right=4]="Right",s[s.Full=7]="Full"})(u2||(u2={}));var f2;(function(s){s[s.Word=0]="Word",s[s.Line=1]="Line",s[s.Suggest=2]="Suggest"})(f2||(f2={}));var g2;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right",s[s.None=2]="None",s[s.LeftOfInjectedText=3]="LeftOfInjectedText",s[s.RightOfInjectedText=4]="RightOfInjectedText"})(g2||(g2={}));var p2;(function(s){s[s.Off=0]="Off",s[s.On=1]="On",s[s.Relative=2]="Relative",s[s.Interval=3]="Interval",s[s.Custom=4]="Custom"})(p2||(p2={}));var m2;(function(s){s[s.None=0]="None",s[s.Text=1]="Text",s[s.Blocks=2]="Blocks"})(m2||(m2={}));var _2;(function(s){s[s.Smooth=0]="Smooth",s[s.Immediate=1]="Immediate"})(_2||(_2={}));var b2;(function(s){s[s.Auto=1]="Auto",s[s.Hidden=2]="Hidden",s[s.Visible=3]="Visible"})(b2||(b2={}));var w2;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(w2||(w2={}));var C2;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(C2||(C2={}));var v2;(function(s){s[s.Invoke=1]="Invoke",s[s.TriggerCharacter=2]="TriggerCharacter",s[s.ContentChange=3]="ContentChange"})(v2||(v2={}));var y2;(function(s){s[s.File=0]="File",s[s.Module=1]="Module",s[s.Namespace=2]="Namespace",s[s.Package=3]="Package",s[s.Class=4]="Class",s[s.Method=5]="Method",s[s.Property=6]="Property",s[s.Field=7]="Field",s[s.Constructor=8]="Constructor",s[s.Enum=9]="Enum",s[s.Interface=10]="Interface",s[s.Function=11]="Function",s[s.Variable=12]="Variable",s[s.Constant=13]="Constant",s[s.String=14]="String",s[s.Number=15]="Number",s[s.Boolean=16]="Boolean",s[s.Array=17]="Array",s[s.Object=18]="Object",s[s.Key=19]="Key",s[s.Null=20]="Null",s[s.EnumMember=21]="EnumMember",s[s.Struct=22]="Struct",s[s.Event=23]="Event",s[s.Operator=24]="Operator",s[s.TypeParameter=25]="TypeParameter"})(y2||(y2={}));var S2;(function(s){s[s.Deprecated=1]="Deprecated"})(S2||(S2={}));var x2;(function(s){s[s.LTR=0]="LTR",s[s.RTL=1]="RTL"})(x2||(x2={}));var L2;(function(s){s[s.Hidden=0]="Hidden",s[s.Blink=1]="Blink",s[s.Smooth=2]="Smooth",s[s.Phase=3]="Phase",s[s.Expand=4]="Expand",s[s.Solid=5]="Solid"})(L2||(L2={}));var k2;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(k2||(k2={}));var E2;(function(s){s[s.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",s[s.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",s[s.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",s[s.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(E2||(E2={}));var N2;(function(s){s[s.None=0]="None",s[s.Same=1]="Same",s[s.Indent=2]="Indent",s[s.DeepIndent=3]="DeepIndent"})(N2||(N2={}));const Ep=class Ep{static chord(e,t){return X7(e,t)}};Ep.CtrlCmd=2048,Ep.Shift=1024,Ep.Alt=512,Ep.WinCtrl=256;let D2=Ep;function wF(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ff,Emitter:A,KeyCode:i2,KeyMod:D2,Position:P,Range:R,Selection:Ae,SelectionDirection:w2,MarkerSeverity:s2,MarkerTag:r2,Uri:ze,Token:Wm}}function Dre(s,e){const t=s;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}const _t=window;function CF(s){return s}class Tre{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=CF):(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 vF{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=CF):(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 n=this._fn(e);return this._map.set(e,n),this._map2.set(t,n),n}}var ah;(function(s){s[s.Uninitialized=0]="Uninitialized",s[s.Running=1]="Running",s[s.Completed=2]="Completed"})(ah||(ah={}));class Wi{constructor(e){this.executor=e,this._state=ah.Uninitialized}get value(){if(this._state===ah.Uninitialized){this._state=ah.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=ah.Completed}}else if(this._state===ah.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function Ire(s){return!s||typeof s!="string"?!0:s.trim().length===0}const Mre=/{(\d+)}/g;function T2(s,...e){return e.length===0?s:s.replace(Mre,function(t,n){const i=parseInt(n,10);return isNaN(i)||i<0||i>=e.length?t:e[i]})}function Rre(s){return s.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}function Yr(s){return s.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function oa(s){return s.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Zw(s,e){if(!s||!e)return s;const t=e.length;if(t===0||s.length===0)return s;let n=0;for(;s.indexOf(e,n)===n;)n=n+t;return s.substring(n)}function Are(s,e){if(!s||!e)return s;const t=e.length,n=s.length;if(t===0||n===0)return s;let i=n,r=-1;for(;r=s.lastIndexOf(e,i-1),!(r===-1||r+t!==i);){if(r===0)return"";i=r}return s.substring(0,i)}function Ore(s){return s.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function yF(s,e,t={}){if(!s)throw new Error("Cannot create regex from empty string");e||(s=oa(s)),t.wholeWord&&(/\B/.test(s.charAt(0))||(s="\\b"+s),/\B/.test(s.charAt(s.length-1))||(s=s+"\\b"));let n="";return t.global&&(n+="g"),t.matchCase||(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),new RegExp(s,n)}function SF(s){return s.source==="^"||s.source==="^$"||s.source==="$"||s.source==="^\\s*$"?!1:!!(s.exec("")&&s.lastIndex===0)}function Wf(s){return s.split(/\r\n|\r|\n/)}function Ms(s){for(let e=0,t=s.length;e<t;e++){const n=s.charCodeAt(e);if(n!==32&&n!==9)return e}return-1}function Hi(s,e=0,t=s.length){for(let n=e;n<t;n++){const i=s.charCodeAt(n);if(i!==32&&i!==9)return s.substring(e,n)}return s.substring(e,t)}function lh(s,e=s.length-1){for(let t=e;t>=0;t--){const n=s.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function I2(s,e){return s<e?-1:s>e?1:0}function M2(s,e,t=0,n=s.length,i=0,r=e.length){for(;t<n&&i<r;t++,i++){const l=s.charCodeAt(t),c=e.charCodeAt(i);if(l<c)return-1;if(l>c)return 1}const o=n-t,a=r-i;return o<a?-1:o>a?1:0}function xF(s,e){return Hm(s,e,0,s.length,0,e.length)}function Hm(s,e,t=0,n=s.length,i=0,r=e.length){for(;t<n&&i<r;t++,i++){let l=s.charCodeAt(t),c=e.charCodeAt(i);if(l===c)continue;if(l>=128||c>=128)return M2(s.toLowerCase(),e.toLowerCase(),t,n,i,r);Hf(l)&&(l-=32),Hf(c)&&(c-=32);const d=l-c;if(d!==0)return d}const o=n-t,a=r-i;return o<a?-1:o>a?1:0}function Qw(s){return s>=48&&s<=57}function Hf(s){return s>=97&&s<=122}function Hc(s){return s>=65&&s<=90}function zf(s,e){return s.length===e.length&&Hm(s,e)===0}function R2(s,e){const t=e.length;return e.length>s.length?!1:Hm(s,e,0,t)===0}function $f(s,e){const t=Math.min(s.length,e.length);let n;for(n=0;n<t;n++)if(s.charCodeAt(n)!==e.charCodeAt(n))return n;return t}function Uf(s,e){const t=Math.min(s.length,e.length);let n;const i=s.length-1,r=e.length-1;for(n=0;n<t;n++)if(s.charCodeAt(i-n)!==e.charCodeAt(r-n))return n;return t}function Nn(s){return 55296<=s&&s<=56319}function ch(s){return 56320<=s&&s<=57343}function A2(s,e){return(s-55296<<10)+(e-56320)+65536}function Jw(s,e,t){const n=s.charCodeAt(t);if(Nn(n)&&t+1<e){const i=s.charCodeAt(t+1);if(ch(i))return A2(n,i)}return n}function Pre(s,e){const t=s.charCodeAt(e-1);if(ch(t)&&e>1){const n=s.charCodeAt(e-2);if(Nn(n))return A2(n,t)}return t}class O2{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=Pre(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=Jw(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class eC{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new O2(e,t)}nextGraphemeLength(){const e=tC.getInstance(),t=this._iterator,n=t.offset;let i=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const r=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(DF(i,o)){t.setOffset(r);break}i=o}return t.offset-n}prevGraphemeLength(){const e=tC.getInstance(),t=this._iterator,n=t.offset;let i=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const r=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(DF(o,i)){t.setOffset(r);break}i=o}return n-t.offset}eol(){return this._iterator.eol()}}function P2(s,e){return new eC(s,e).nextGraphemeLength()}function LF(s,e){return new eC(s,e).prevGraphemeLength()}function Fre(s,e){e>0&&ch(s.charCodeAt(e))&&e--;const t=e+P2(s,e);return[t-LF(s,t),t]}let F2;function Bre(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function zm(s){return F2||(F2=Bre()),F2.test(s)}const Vre=/^[\t\n\r\x20-\x7E]*$/;function B2(s){return Vre.test(s)}const kF=/[\u2028\u2029]/;function EF(s){return kF.test(s)}function zc(s){return s>=11904&&s<=55215||s>=63744&&s<=64255||s>=65281&&s<=65374}function V2(s){return s>=127462&&s<=127487||s===8986||s===8987||s===9200||s===9203||s>=9728&&s<=10175||s===11088||s===11093||s>=127744&&s<=128591||s>=128640&&s<=128764||s>=128992&&s<=129008||s>=129280&&s<=129535||s>=129648&&s<=129782}const Wre="\uFEFF";function W2(s){return!!(s&&s.length>0&&s.charCodeAt(0)===65279)}function NF(s){return s=s%52,s<26?String.fromCharCode(97+s):String.fromCharCode(65+s-26)}function DF(s,e){return s===0?e!==5&&e!==7:s===2&&e===3?!1:s===4||s===2||s===3||e===4||e===2||e===3?!0:!(s===8&&(e===8||e===9||e===11||e===12)||(s===11||s===9)&&(e===9||e===10)||(s===12||s===10)&&e===10||e===5||e===13||e===7||s===1||s===13&&e===14||s===6&&e===6)}const ju=class ju{static getInstance(){return ju._INSTANCE||(ju._INSTANCE=new ju),ju._INSTANCE}constructor(){this._data=Hre()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,n=t.length/3;let i=1;for(;i<=n;)if(e<t[3*i])i=2*i;else if(e>t[3*i+1])i=2*i+1;else return t[3*i+2];return 0}};ju._INSTANCE=null;let tC=ju;function Hre(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function zre(s,e){if(s===0)return 0;const t=$re(s,e);if(t!==void 0)return t;const n=new O2(e,s);return n.prevCodePoint(),n.offset}function $re(s,e){const t=new O2(e,s);let n=t.prevCodePoint();for(;Ure(n)||n===65039||n===8419;){if(t.offset===0)return;n=t.prevCodePoint()}if(!V2(n))return;let i=t.offset;return i>0&&t.prevCodePoint()===8205&&(i=t.offset),i}function Ure(s){return 127995<=s&&s<=127999}const Ua=class Ua{static getInstance(e){return Ua.cache.get(Array.from(e))}static getLocales(){return Ua._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}};Ua.ambiguousCharacterData=new Wi(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}')),Ua.cache=new Tre({getCacheKey:JSON.stringify},e=>{function t(d){const h=new Map;for(let u=0;u<d.length;u+=2)h.set(d[u],d[u+1]);return h}function n(d,h){const u=new Map(d);for(const[f,g]of h)u.set(f,g);return u}function i(d,h){if(!d)return h;const u=new Map;for(const[f,g]of d)h.has(f)&&u.set(f,g);return u}const r=Ua.ambiguousCharacterData.value;let o=e.filter(d=>!d.startsWith("_")&&d in r);o.length===0&&(o=["_default"]);let a;for(const d of o){const h=t(r[d]);a=i(a,h)}const l=t(r._common),c=n(l,a);return new Ua(c)}),Ua._locales=new Wi(()=>Object.keys(Ua.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")));let $m=Ua;const Np=class Np{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static getData(){return this._data||(this._data=new Set([...Object.values(Np.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return Np.getData().has(e)}static get codePoints(){return Np.getData()}};Np._data=void 0;let Um=Np;const lx=class lx{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}};lx.INSTANCE=new lx;let H2=lx;function TF(s,e,t){typeof e=="string"&&(e=s.matchMedia(e)),e.addEventListener("change",t)}function z2(s){return H2.INSTANCE.getZoomFactor(s)}const jf=navigator.userAgent,Rs=jf.indexOf("Firefox")>=0,nC=jf.indexOf("AppleWebKit")>=0,jm=jf.indexOf("Chrome")>=0,dh=!jm&&jf.indexOf("Safari")>=0,IF=!jm&&!dh&&nC;jf.indexOf("Electron/")>=0;const MF=jf.indexOf("Android")>=0;let $2=!1;if(typeof _t.matchMedia=="function"){const s=_t.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=_t.matchMedia("(display-mode: fullscreen)");$2=s.matches,TF(_t,s,({matches:t})=>{$2&&e.matches||($2=t)})}const Km={clipboard:{writeText:Im||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:Im||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:_t.PointerEvent&&("ontouchstart"in _t||navigator.maxTouchPoints>0)};function U2(s,e){if(typeof s=="number"){if(s===0)return null;const t=(s&65535)>>>0,n=(s&4294901760)>>>16;return n!==0?new j2([iC(t,e),iC(n,e)]):new j2([iC(t,e)])}else{const t=[];for(let n=0;n<s.length;n++)t.push(iC(s[n],e));return new j2(t)}}function iC(s,e){const t=!!(s&2048),n=!!(s&256),i=e===2?n:t,r=!!(s&1024),o=!!(s&512),a=e===2?t:n,l=s&255;return new hh(i,r,o,a,l)}class hh{constructor(e,t,n,i,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=i,this.keyCode=r}equals(e){return e instanceof hh&&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 j2{constructor(e){if(e.length===0)throw Aw("chords");this.chords=e}}class jre{constructor(e,t,n,i,r,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=i,this.keyLabel=r,this.keyAriaLabel=o}}class Kre{}function qre(s){if(s.charCode){const t=String.fromCharCode(s.charCode).toUpperCase();return ml.fromString(t)}const e=s.keyCode;if(e===3)return 7;if(Rs)switch(e){case 59:return 85;case 60:if(Ts)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(He)return 57;break}else if(nC){if(He&&e===93)return 57;if(!He&&e===92)return 57}return Y7[e]||0}const Gre=He?256:2048,Yre=512,Xre=1024,Zre=He?2048:256;class bt{constructor(e){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=t.getModifierState?.("AltGraph"),this.keyCode=qre(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|=Gre),this.altKey&&(t|=Yre),this.shiftKey&&(t|=Xre),this.metaKey&&(t|=Zre),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new hh(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}const RF=new WeakMap;function Qre(s){if(!s.parent||s.parent===s)return null;try{const e=s.location,t=s.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return null}catch{return null}return s.parent}class Jre{static getSameOriginWindowChain(e){let t=RF.get(e);if(!t){t=[],RF.set(e,t);let n=e,i;do i=Qre(n),i?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=i;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,i=0;const r=this.getSameOriginWindowChain(e);for(const o of r){const a=o.window.deref();if(n+=a?.scrollY??0,i+=a?.scrollX??0,a===t||!o.iframeElement)break;const l=o.iframeElement.getBoundingClientRect();n+=l.top,i+=l.left}return{top:n,left:i}}}class Qs{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.defaultPrevented=t.defaultPrevented,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const n=Jre.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class uh{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let i=!1;if(jm){const r=navigator.userAgent.match(/Chrome\/(\d+)/);i=(r?parseInt(r[1]):123)<=122}if(e){const r=e,o=e,a=e.view?.devicePixelRatio||1;if(typeof r.wheelDeltaY<"u")i?this.deltaY=r.wheelDeltaY/(120*a):this.deltaY=r.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const l=e;l.deltaMode===l.DOM_DELTA_LINE?Rs&&!He?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")dh&&hs?this.deltaX=-(r.wheelDeltaX/120):i?this.deltaX=r.wheelDeltaX/(120*a):this.deltaX=r.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const l=e;l.deltaMode===l.DOM_DELTA_LINE?Rs&&!He?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(i?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}const AF=Symbol("MicrotaskDelay");function K2(s){return!!s&&typeof s.then=="function"}function q2(s){const e=new Ff,t=s(e.token);let n=!1;const i=new Promise((r,o)=>{const a=e.token.onCancellationRequested(()=>{n=!0,a.dispose(),o(new Tf)});Promise.resolve(t).then(l=>{a.dispose(),e.dispose(),n?$w(l)&&l.dispose():r(l)},l=>{a.dispose(),e.dispose(),o(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(r,o){return i.then(r,o)}catch(r){return this.then(void 0,r)}finally(r){return i.finally(r)}}}let eoe=class{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n};this.queuedPromise=new Promise(n=>{this.activePromise.then(t,t).then(n)})}return new Promise((t,n)=>{this.queuedPromise.then(t,n)})}return this.activePromise=e(),new Promise((t,n)=>{this.activePromise.then(i=>{this.activePromise=null,t(i)},i=>{this.activePromise=null,n(i)})})}dispose(){this.isDisposed=!0}};const toe=(s,e)=>{let t=!0;const n=setTimeout(()=>{t=!1,e()},s);return{isTriggered:()=>t,dispose:()=>{clearTimeout(n),t=!1}}},noe=s=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,s())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class qm{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,r)=>{this.doResolve=i,this.doReject=r}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const i=this.task;return this.task=null,i()}}));const n=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===AF?noe(n):toe(t,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new Tf),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}class OF{constructor(e){this.delayer=new qm(e),this.throttler=new eoe}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function Kf(s,e){return e?new Promise((t,n)=>{const i=setTimeout(()=>{r.dispose(),t()},s),r=e.onCancellationRequested(()=>{clearTimeout(i),r.dispose(),n(new Tf)})}):q2(t=>Kf(s,t))}function G2(s,e=0,t){const n=setTimeout(()=>{s(),t&&i.dispose()},e),i=Ce(()=>{clearTimeout(n),t?.delete(i)});return t?.add(i),i}let ioe=class{constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){const t=new sC;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),t.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;const e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new we;this._runningTask=e.task;try{const t=await e.task();e.deferred.complete(t)}catch(t){e.deferred.error(t)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){const e=this._pendingTasks;this._pendingTasks=[];for(const t of e)t.setUndefinedWhenCleared?t.deferred.complete(void 0):t.deferred.error(new Tf)}};class wl{constructor(e,t){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,t){if(this._isDisposed)throw new we("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new we("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},t))}}class Y2{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new we("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const i=n.setInterval(()=>{e()},t);this.disposable=Ce(()=>{n.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class mi{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}}let X2,Gm;(function(){const s=globalThis;typeof s.requestIdleCallback!="function"||typeof s.cancelIdleCallback!="function"?Gm=(e,t,n)=>{Vw(()=>{if(i)return;const r=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,r-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:Gm=(e,t,n)=>{const i=e.requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0);let r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(i))}}},X2=(e,t)=>Gm(globalThis,e,t)})();class soe{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=Gm(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class roe extends soe{constructor(e){super(globalThis,e)}}class sC{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new Tf)}}var Ym;(function(s){async function e(n){let i;const r=await Promise.all(n.map(o=>o.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return r}s.settled=e;function t(n){return new Promise(async(i,r)=>{try{await n(i,r)}catch(o){r(o)}})}s.withAsyncBody=t})(Ym||(Ym={}));class ooe{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new we("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new sC;return this._unsatisfiedConsumers.push(e),e.p}}}const mr=class mr{constructor(e,t){this._onReturn=t,this._producerConsumer=new ooe,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async n=>(this._finishError(n),{done:!0,value:void 0})},queueMicrotask(async()=>{const n=e({emitOne:i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),emitMany:i=>{for(const r of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:r}})},reject:i=>this._finishError(i)});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(e){return new mr(t=>{t.emitMany(e)})}static fromPromise(e){return new mr(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new mr(async t=>{await Promise.all(e.map(async n=>t.emitOne(await n)))})}static merge(e){return new mr(async t=>{await Promise.all(e.map(async n=>{for await(const i of n)t.emitOne(i)}))})}static map(e,t){return new mr(async n=>{for await(const i of e)n.emitOne(t(i))})}map(e){return mr.map(this,e)}static coalesce(e){return mr.filter(e,t=>!!t)}coalesce(){return mr.coalesce(this)}static filter(e,t){return new mr(async n=>{for await(const i of e)t(i)&&n.emitOne(i)})}filter(e){return mr.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};mr.EMPTY=mr.fromArray([]);let PF=mr;var Le;(function(s){s.inMemory="inmemory",s.vscode="vscode",s.internal="private",s.walkThrough="walkThrough",s.walkThroughSnippet="walkThroughSnippet",s.http="http",s.https="https",s.file="file",s.mailto="mailto",s.untitled="untitled",s.data="data",s.command="command",s.vscodeRemote="vscode-remote",s.vscodeRemoteResource="vscode-remote-resource",s.vscodeManagedRemoteResource="vscode-managed-remote-resource",s.vscodeUserData="vscode-userdata",s.vscodeCustomEditor="vscode-custom-editor",s.vscodeNotebookCell="vscode-notebook-cell",s.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",s.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",s.vscodeNotebookCellOutput="vscode-notebook-cell-output",s.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",s.vscodeNotebookMetadata="vscode-notebook-metadata",s.vscodeInteractiveInput="vscode-interactive-input",s.vscodeSettings="vscode-settings",s.vscodeWorkspaceTrust="vscode-workspace-trust",s.vscodeTerminal="vscode-terminal",s.vscodeChatCodeBlock="vscode-chat-code-block",s.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",s.vscodeChatEditor="vscode-chat-editor",s.vscodeChatInput="chatSessionInput",s.vscodeChatSession="vscode-chat-session",s.webviewPanel="webview-panel",s.vscodeWebview="vscode-webview",s.extension="extension",s.vscodeFileResource="vscode-file",s.tmp="tmp",s.vsls="vsls",s.vscodeSourceControl="vscode-scm",s.commentsInput="comment",s.codeSetting="code-setting",s.outputChannel="output",s.accessibleView="accessible-view",s.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",s.chatEditingModel="chat-editing-text-model"})(Le||(Le={}));function Z2(s,e){return ze.isUri(s)?zf(s.scheme,e):R2(s,e+":")}function FF(s,...e){return e.some(t=>Z2(s,t))}const aoe="tkn";class loe{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return fn.join(this._serverRootPath,Le.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return dt(a),e}const t=e.authority;let n=this._hosts[t];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);const i=this._ports[t],r=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return typeof r=="string"&&(o+=`&${aoe}=${encodeURIComponent(r)}`),ze.from({scheme:fl?this._preferredWebSchema:Le.vscodeRemoteResource,authority:`${n}:${i}`,path:this._remoteResourcesPath,query:o})}}const BF=new loe,coe="vscode-app",Hb=class Hb{uriToBrowserUri(e){return e.scheme===Le.vscodeRemote?BF.rewrite(e):e.scheme===Le.file&&(Im||qie===`${Le.vscodeFileResource}://${Hb.FALLBACK_AUTHORITY}`)?e.with({scheme:Le.vscodeFileResource,authority:e.authority||Hb.FALLBACK_AUTHORITY,query:null,fragment:null}):e}};Hb.FALLBACK_AUTHORITY=coe;let Q2=Hb;const VF=new Q2;var J2;(function(s){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);s.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function n(r){let o;typeof r=="string"?o=new URL(r).searchParams:r instanceof URL?o=r.searchParams:ze.isUri(r)&&(o=new URL(r.toString(!0)).searchParams);const a=o?.get(t);if(a)return e.get(a)}s.getHeadersFromQuery=n;function i(r,o,a){if(!globalThis.crossOriginIsolated)return;const l=o&&a?"3":a?"2":"1";r instanceof URLSearchParams?r.set(t,l):r[t]=l}s.addSearchParam=i})(J2||(J2={}));const WF=typeof Buffer<"u";new Wi(()=>new Uint8Array(256));let eN;class rC{static wrap(e){return WF&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new rC(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return WF?this.buffer.toString():(eN||(eN=new TextDecoder),eN.decode(this.buffer))}}function doe(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0}function hoe(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function yo(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function So(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function HF(s,e){return s[e]}function zF(s,e,t){s[t]=e}const $F="0123456789abcdef";function uoe({buffer:s}){let e="";for(let t=0;t<s.length;t++){const n=s[t];e+=$F[n>>>4],e+=$F[n&15]}return e}function tN(s){return oC(s,0)}function oC(s,e){switch(typeof s){case"object":return s===null?Cl(349,e):Array.isArray(s)?goe(s,e):poe(s,e);case"string":return nN(s,e);case"boolean":return foe(s,e);case"number":return Cl(s,e);case"undefined":return Cl(937,e);default:return Cl(617,e)}}function Cl(s,e){return(e<<5)-e+s|0}function foe(s,e){return Cl(s?433:863,e)}function nN(s,e){e=Cl(149417,e);for(let t=0,n=s.length;t<n;t++)e=Cl(s.charCodeAt(t),e);return e}function goe(s,e){return e=Cl(104579,e),s.reduce((t,n)=>oC(n,t),e)}function poe(s,e){return e=Cl(181387,e),Object.keys(s).sort().reduce((t,n)=>(t=nN(n,t),oC(s[n],t)),e)}function iN(s,e,t=32){const n=t-e,i=~((1<<n)-1);return(s<<e|(i&s)>>>n)>>>0}function Xm(s,e=32){return s instanceof ArrayBuffer?uoe(rC.wrap(new Uint8Array(s))):(s>>>0).toString(16).padStart(e/4,"0")}const cx=class cx{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const n=this._buff;let i=this._buffLen,r=this._leftoverHighSurrogate,o,a;for(r!==0?(o=r,a=-1,r=0):(o=e.charCodeAt(0),a=0);;){let l=o;if(Nn(o))if(a+1<t){const c=e.charCodeAt(a+1);ch(c)?(a++,l=A2(o,c)):l=65533}else{r=o;break}else ch(o)&&(l=65533);if(i=this._push(n,i,l),a++,a<t)o=e.charCodeAt(a);else break}this._buffLen=i,this._leftoverHighSurrogate=r}_push(e,t,n){return n<128?e[t++]=n:n<2048?(e[t++]=192|(n&1984)>>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Xm(this._h0)+Xm(this._h1)+Xm(this._h2)+Xm(this._h3)+Xm(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=cx._bigBlock32,t=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,t.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,iN(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let n=this._h0,i=this._h1,r=this._h2,o=this._h3,a=this._h4,l,c,d;for(let h=0;h<80;h++)h<20?(l=i&r|~i&o,c=1518500249):h<40?(l=i^r^o,c=1859775393):h<60?(l=i&r|i&o|r&o,c=2400959708):(l=i^r^o,c=3395469782),d=iN(n,5)+l+a+c+e.getUint32(h*4,!1)&4294967295,a=o,o=r,r=iN(i,30),i=n,n=d;this._h0=this._h0+n&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};cx._bigBlock32=new DataView(new ArrayBuffer(320));let sN=cx;class zi{constructor(e,t,n){this.owner=e,this.debugNameSource=t,this.referenceFn=n}getDebugName(e){return moe(e,this)}}const UF=new Map,rN=new WeakMap;function moe(s,e){const t=rN.get(s);if(t)return t;const n=_oe(s,e);if(n){let i=UF.get(n)??0;i++,UF.set(n,i);const r=i===1?n:`${n}#${i}`;return rN.set(s,r),r}}function _oe(s,e){const t=rN.get(s);if(t)return t;const n=e.owner?woe(e.owner)+".":"";let i;const r=e.debugNameSource;if(r!==void 0)if(typeof r=="function"){if(i=r(),i!==void 0)return n+i}else return n+r;const o=e.referenceFn;if(o!==void 0&&(i=oN(o),i!==void 0))return n+i;if(e.owner!==void 0){const a=boe(e.owner,s);if(a!==void 0)return n+a}}function boe(s,e){for(const t in s)if(s[t]===e)return t}const jF=new Map,KF=new WeakMap;function woe(s){const e=KF.get(s);if(e)return e;const t=qF(s)??"Object";let n=jF.get(t)??0;n++,jF.set(t,n);const i=n===1?t:`${t}#${n}`;return KF.set(s,i),i}function qF(s){const e=s.constructor;if(e)return e.name==="Object"?void 0:e.name}function oN(s){const e=s.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}const xo=(s,e)=>s===e;function aN(s=xo){return(e,t)=>Sn(e,t,s)}function Coe(){return(s,e)=>s.equals(e)}function Zm(s,e,t){{const n=s;return(i,r)=>i==null||r===void 0||r===null?r===i:n(i,r)}}function GF(s){const e=new Error("BugIndicatingErrorRecovery: "+s);dt(e),console.error("recovered from an error that indicates a bug",e)}let fh;function voe(s){fh?fh instanceof YF?fh.loggers.push(s):fh=new YF([fh,s]):fh=s}function _i(){return fh}class YF{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(const n of this.loggers)n.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(const n of this.loggers)n.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(const n of this.loggers)n.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(const n of this.loggers)n.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(const t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,n){for(const i of this.loggers)i.handleAutorunDependencyChanged(e,t,n)}handleAutorunStarted(e){for(const t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(const t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,n){for(const i of this.loggers)i.handleDerivedDependencyChanged(e,t,n)}handleDerivedCleared(e){for(const t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(const t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(const t of this.loggers)t.handleEndTransaction(e)}}function nn(s,e){const t=new Jm(s,e);try{s(t)}finally{t.finish()}}let aC;function Qm(s){if(aC)s(aC);else{const e=new Jm(s,void 0);aC=e;try{s(e)}finally{e.finish(),aC=void 0}}}function lN(s,e,t){s?e(s):nn(e,t)}class Jm{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],_i()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():oN(this._fn)}updateObserver(e,t){if(!this._updatingObservers){GF("Transaction already finished!"),nn(n=>{n.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this._updatingObservers;if(!e){GF("transaction.finish() has already been called!");return}for(let t=0;t<e.length;t++){const{observer:n,observable:i}=e[t];n.endUpdate(i)}this._updatingObservers=null,_i()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}}var bi;(function(s){let e=!1;function t(){e=!0}s.enable=t;function n(){if(!e)return;const i=Error,r=i.stackTraceLimit;i.stackTraceLimit=3;const o=new Error().stack;return i.stackTraceLimit=r,cN.fromStack(o,2)}s.ofCaller=n})(bi||(bi={}));class cN{static fromStack(e,t){const n=e.split(`
|
|
128
128
|
`),i=yoe(n[t+1]);if(i)return new cN(i.fileName,i.line,i.column,i.id)}constructor(e,t,n,i){this.fileName=e,this.line=t,this.column=n,this.id=i}}function yoe(s){const e=s.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:s};const t=s.match(/at ([^\(\)]*):(\d+):(\d+)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:s}}let dN;function Soe(s){dN=s}let XF;function xoe(s){XF=s}class ZF{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t,n=bi.ofCaller()){const i=t===void 0?void 0:e,r=t===void 0?e:t;return dN({owner:i,debugName:()=>{const o=oN(r);if(o!==void 0)return o;const l=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(l)return`${this.debugName}.${l[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:r},o=>r(this.read(o),o),n)}flatten(){return dN({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(XF(this,t)),this}}class qf extends ZF{constructor(e){super(),this._observers=new Set,_i()?.handleObservableCreated(this,e)}addObserver(e){const t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&_i()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){const t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&_i()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}debugGetObservers(){return this._observers}}function Me(s,e,t=bi.ofCaller()){let n;return typeof s=="string"?n=new zi(void 0,s,void 0):n=new zi(s,void 0,void 0),new e_(n,e,xo,t)}class e_ extends qf{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,n,i){super(i),this._debugNameData=e,this._equalityComparator=n,this._value=t,_i()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let i;t||(t=i=new Jm(()=>{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),_i()?.handleObservableUpdated(this,{oldValue:r,newValue:e,change:n,didChange:!0,hadValue:!0});for(const o of this._observers)t.updateObserver(o,this),o.handleChange(this,n)}finally{i&&i.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function QF(s,e,t=bi.ofCaller()){let n;return typeof s=="string"?n=new zi(void 0,s,void 0):n=new zi(s,void 0,void 0),new Loe(n,e,xo,t)}class Loe extends e_{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}class koe extends qf{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,n,i){super(i),this._debugNameData=e,this._equalityComparator=n,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this._deltas){_i()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const t of this._observers)t.handleChange(this,e)}this._deltas.length=0}else{_i()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(const e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();const e=[...this._observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let i;t||(t=i=new Jm(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),n!==void 0&&this._deltas.push(n),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(r,o)=>{},handlePossibleChange:r=>{}},this),this._updateCounter>1)for(const r of this._observers)r.handlePossibleChange(this)}finally{i&&i.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function t_(s,e,t=bi.ofCaller()){return s.lazy?new koe(new zi(s.owner,s.debugName,void 0),e,s.equalsFn??xo,t):new e_(new zi(s.owner,s.debugName,void 0),e,s.equalsFn??xo,t)}function Eoe(s){switch(s){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}class n_{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,n,i){this._debugNameData=e,this._runFn=t,this._changeTracker=n,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),_i()?.handleAutorunCreated(this,i),this._run()}dispose(){if(!this._disposed){this._disposed=!0;for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),_i()?.handleAutorunDisposed(this)}}_run(){const e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){_i()?.handleAutorunStarted(this);const t=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,t),this._changeSummary=this._changeTracker.createChangeSummary(t)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,t)}catch(i){Mw(i)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||_i()?.handleAutorunFinished(this);for(const t of this._dependenciesToBeRemoved)t.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1)do{if(this._state===1){this._state=3;for(const t of this._dependencies)if(t.reportChanges(),this._state===2)break}this._state!==3&&this._run()}while(this._state!==3)}finally{this._updateCount--}eh(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._state=1)}handleChange(e,t){if(this._isDependency(e)){_i()?.handleAutorunDependencyChanged(this,e,t);try{(this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:i=>i===e},this._changeSummary):!0)&&(this._state=2)}catch(n){Mw(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new we("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new we("Cannot access store after dispose");return this._store===void 0&&(this._store=new le),this._store}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:Eoe(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}}function Ke(s,e=bi.ofCaller()){return new n_(new zi(void 0,void 0,s),s,void 0,e)}function hN(s,e,t=bi.ofCaller()){return new n_(new zi(s.owner,s.debugName,s.debugReferenceFn??e),e,void 0,t)}function Gf(s,e,t=bi.ofCaller()){return new n_(new zi(s.owner,s.debugName,s.debugReferenceFn??e),e,s.changeTracker,t)}function Noe(s,e){const t=new le,n=Gf({owner:s.owner,debugName:s.debugName,debugReferenceFn:s.debugReferenceFn??e,changeTracker:s.changeTracker},(i,r)=>{t.clear(),e(i,r,t)});return Ce(()=>{n.dispose(),t.dispose()})}function Lo(s){const e=new le,t=hN({owner:void 0,debugName:void 0,debugReferenceFn:s},n=>{e.clear(),s(n,e)});return Ce(()=>{t.dispose(),e.dispose()})}function Doe(s){switch(s){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}class Xr extends qf{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,n,i=void 0,r,o){super(o),this._debugNameData=e,this._computeFn=t,this._changeTracker=n,this._handleLastObserverRemoved=i,this._equalityComparator=r,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,_i()?.handleDerivedCleared(this);for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let t;try{this._isReaderValid=!0;let n;this._changeTracker&&(n=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,n)),t=this._computeFn(this,n)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),t}else{do{if(this._state===1){for(const t of this._dependencies)if(t.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;const t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{const n=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,n),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(n));const i=this._state!==0,r=this._value;this._state=3;const o=this._delayedStore;o!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,n)}finally{this._isReaderValid=!1;for(const a of this._dependenciesToBeRemoved)a.removeObserver(this);this._dependenciesToBeRemoved.clear(),o!==void 0&&o.dispose()}e=this._didReportChange||i&&!this._equalityComparator(r,this._value),_i()?.handleObservableUpdated(this,{oldValue:r,newValue:this._value,change:void 0,didChange:e,hadValue:i})}catch(n){Mw(n)}if(this._isComputing=!1,!this._didReportChange&&e)for(const n of this._observers)n.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new we("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{const t=this._updateCount===1;if(this._state===3&&(this._state=1,!t))for(const n of this._observers)n.handlePossibleChange(this);if(t)for(const n of this._observers)n.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){const t=[...this._observers];for(const n of t)n.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){const n=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(const i of n)i.endUpdate(this)}}eh(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(const t of this._observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){_i()?.handleDerivedDependencyChanged(this,e,t);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:r=>r===e},this._changeSummary):!0}catch(r){Mw(r)}const i=this._state===3;if(n&&(this._state===1||i)&&(this._state=2,i))for(const r of this._observers)r.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new we("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new le),this._store}addObserver(e){const t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:Doe(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this._isComputing?this._state=2:this._recompute()}setValue(e,t,n){this._value=e;const i=this._observers;t.updateObserver(this,this);for(const r of i)r.handleChange(this,n)}}class Toe extends Xr{constructor(e,t,n,i=void 0,r,o,a){super(e,t,n,i,r,a),this.set=o}}function he(s,e,t=bi.ofCaller()){return e!==void 0?new Xr(new zi(s,void 0,e),e,void 0,void 0,xo,t):new Xr(new zi(void 0,void 0,s),s,void 0,void 0,xo,t)}function uN(s,e,t,n=bi.ofCaller()){return new Toe(new zi(s,void 0,e),e,void 0,void 0,xo,t,n)}function aa(s,e,t=bi.ofCaller()){return new Xr(new zi(s.owner,s.debugName,s.debugReferenceFn),e,void 0,s.onLastObserverRemoved,s.equalsFn??xo,t)}Soe(aa);function la(s,e,t=bi.ofCaller()){let n,i;e===void 0?(n=s,i=void 0):(i=s,n=e);let r;return new Xr(new zi(i,void 0,n),o=>{r?r.clear():r=new le;const a=n(o);return a&&r.add(a),a},void 0,()=>{r&&(r.dispose(),r=void 0)},xo,t)}class Ioe{constructor(e){this._value=Me(this,void 0),this.promiseResult=this._value,this.promise=e.then(t=>(nn(n=>{this._value.set(new JF(t,void 0),n)}),t),t=>{throw nn(n=>{this._value.set(new JF(void 0,t),n)}),t})}}class JF{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}function Moe(s,e,t,n){return e||(e=i=>i!=null),new Promise((i,r)=>{let o=!0,a=!1;const l=s.map(d=>({isFinished:e(d),error:!1,state:d})),c=Ke(d=>{const{isFinished:h,error:u,state:f}=l.read(d);(h||u)&&(o?a=!0:c.dispose(),u?r(u===!0?f:u):i(f))});o=!1,a&&c.dispose()})}function Bt(...s){let e,t,n,i;return s.length===2?[t,n]=s:[e,t,n,i]=s,new gh(new zi(e,void 0,n),t,n,()=>gh.globalTransaction,xo,i??bi.ofCaller())}class gh extends qf{constructor(e,t,n,i,r,o){super(o),this._debugNameData=e,this.event=t,this._getValue=n,this._getTransaction=i,this._equalityComparator=r,this._hasValue=!1,this.handleEvent=a=>{const l=this._getValue(a),c=this._value,d=!this._hasValue||!this._equalityComparator(c,l);let h=!1;d&&(this._value=l,this._hasValue&&(h=!0,lN(this._getTransaction(),u=>{_i()?.handleObservableUpdated(this,{oldValue:c,newValue:l,change:void 0,didChange:d,hadValue:this._hasValue});for(const f of this._observers)u.updateObserver(f,this),f.handleChange(this,void 0)},()=>{const u=this.getDebugName();return"Event fired"+(u?`: ${u}`:"")})),this._hasValue=!0),h||_i()?.handleObservableUpdated(this,{oldValue:c,newValue:l,change:void 0,didChange:d,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}}(function(s){s.Observer=gh;function e(t,n){let i=!1;gh.globalTransaction===void 0&&(gh.globalTransaction=t,i=!0);try{n()}finally{i&&(gh.globalTransaction=void 0)}}s.batchEventsGlobally=e})(Bt||(Bt={}));function i_(s,e=bi.ofCaller()){return typeof s=="string"?new e9(s,void 0,e):new e9(void 0,s,e)}class e9 extends qf{get debugName(){return new zi(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t,n){super(n),this._debugName=e,this._owner=t}trigger(e,t){if(!e){nn(n=>{this.trigger(n,t)},()=>`Trigger signal ${this.debugName}`);return}for(const n of this._observers)e.updateObserver(n,this),n.handleChange(this,t)}get(){}}function lC(s,e){const t=new Roe(!0,e);s.addObserver(t);try{t.beginUpdate(s)}finally{t.endUpdate(s)}return Ce(()=>{s.removeObserver(t)})}xoe(lC);class Roe{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}}function Aoe(s,e){let t;return aa({owner:s,debugReferenceFn:e},i=>(t=e(i,t),t))}function Ooe(s){return{createChangeSummary:e=>({changes:[]}),handleChange(e,t){for(const n in s)e.didChange(s[n])&&t.changes.push({key:n,change:e.change});return!0},beforeUpdate(e,t){for(const n in s){if(n==="changes")throw new we('property name "changes" is reserved for change tracking');t[n]=s[n].read(e)}}}}function s_(s){return new Poe(s)}class Poe extends ZF{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function Zr(s,e,t=bi.ofCaller()){return new Foe(typeof s=="string"?s:new zi(s,void 0,void 0),e,t)}class Foe extends qf{constructor(e,t,n){super(n),this.event=t,this.handleEvent=()=>{nn(i=>{for(const r of this._observers)i.updateObserver(r,this),r.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function r_(s,e){let t,n=!0;return Noe({changeTracker:{createChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(i,r)=>{if(i.didChange(s)){const o=i.change;o!==void 0&&r.deltas.push(o),r.didChange=!0}return!0}}},(i,r)=>{const o=s.read(i),a=t;r.didChange&&(t=o,e(o,a,r.deltas)),n&&(n=!1,t=o)})}function Boe(s,e){return Aoe(s,(t,n)=>n??e(t))}function Yf(s,e){switch(typeof s){case"number":return""+s;case"string":return s.length+2<=e?`"${s}"`:`"${s.substr(0,e-7)}"+...`;case"boolean":return s?"true":"false";case"undefined":return"undefined";case"object":return s===null?"null":Array.isArray(s)?Voe(s,e):Woe(s,e);case"symbol":return s.toString();case"function":return`[[Function${s.name?" "+s.name:""}]]`;default:return""+s}}function Voe(s,e){let t="[ ",n=!0;for(const i of s){if(n||(t+=", "),t.length-5>e){t+="...";break}n=!1,t+=`${Yf(i,e-t.length)}`}return t+=" ]",t}function Woe(s,e){if(typeof s.toString=="function"&&s.toString!==Object.prototype.toString){const r=s.toString();return r.length<=e?r:r.substring(0,e-3)+"..."}const t=qF(s);let n=t?t+"(":"{ ",i=!0;for(const[r,o]of Object.entries(s)){if(i||(n+=", "),n.length-5>e){n+="...";break}i=!1,n+=`${r}: ${Yf(o,e-n.length)}`}return n+=t?")":" }",n}class fN{static createClient(e,t){return new fN(e,t)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:r=>{const o=r,a=this._getHandler().notifications[o[0]];if(!a)throw new Error(`Unknown notification "${o[0]}"!`);a(...o[1])},handleRequest:r=>{const o=r;try{return{type:"result",value:this._getHandler().requests[o[0]](...o[1])}}catch(a){return{type:"error",value:a}}}});const n=new Proxy({},{get:(r,o)=>async(...a)=>{const l=await this._channel.sendRequest([o,a]);if(l.type==="error")throw l.value;return l.value}}),i=new Proxy({},{get:(r,o)=>(...a)=>{this._channel.sendNotification([o,a])}});this.api={notifications:i,requests:n}}}function Hoe(s,e){const t=globalThis;let n=[],i;const{channel:r,handler:o}=zoe({sendNotification:l=>{i?i.sendNotification(l):n.push(l)}});let a;return(t.$$debugValueEditor_debugChannels??(t.$$debugValueEditor_debugChannels={}))[s]=l=>{a=e(),i=l;for(const c of n)l.sendNotification(c);return n=[],o},fN.createClient(r,()=>{if(!a)throw new Error("Not supported");return a})}function zoe(s){let e;return{channel:n=>(e=n,{sendNotification:i=>{s.sendNotification(i)},sendRequest:i=>{throw new Error("not supported")}}),handler:{handleRequest:n=>n.type==="notification"?e?.handleNotification(n.data):e?.handleRequest(n.data)}}}class $oe{constructor(){this._timeout=void 0}throttle(e,t){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}}function t9(s,e){for(const t in e)s[t]&&typeof s[t]=="object"&&e[t]&&typeof e[t]=="object"?t9(s[t],e[t]):s[t]=e[t]}function n9(s,e){for(const t in e)e[t]===null?delete s[t]:s[t]&&typeof s[t]=="object"&&e[t]&&typeof e[t]=="object"?n9(s[t],e[t]):s[t]=e[t]}const Ku=class Ku{static getInstance(){return Ku._instance===void 0&&(Ku._instance=new Ku),Ku._instance}getTransactionState(){const e=[],t=[...this._activeTransactions];if(t.length===0)return;const n=t.flatMap(r=>r.debugGetUpdatingObservers()??[]).map(r=>r.observer),i=new Set;for(;n.length>0;){const r=n.shift();if(i.has(r))continue;i.add(r);const o=this._getInfo(r,a=>{i.has(a)||n.push(a)});o&&e.push(o)}return{names:t.map(r=>r.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){const t=this._instanceInfos.get(e);if(!t){dt(new we("No info found"));return}return t}_getAutorunInfo(e){const t=this._instanceInfos.get(e);if(!t){dt(new we("No info found"));return}return t}_getInfo(e,t){if(e instanceof Xr){const n=[...e.debugGetObservers()];for(const l of n)t(l);const i=this._getObservableInfo(e);if(!i)return;const r=e.debugGetState(),o={name:e.debugName,instanceId:i.instanceId,updateCount:r.updateCount},a=[...i.changedObservables].map(l=>this._instanceInfos.get(l)?.instanceId).filter(Sr);if(r.isComputing)return{...o,type:"observable/derived",state:"updating",changedDependencies:a,initialComputation:!1};switch(r.state){case 0:return{...o,type:"observable/derived",state:"noValue"};case 3:return{...o,type:"observable/derived",state:"upToDate"};case 2:return{...o,type:"observable/derived",state:"stale",changedDependencies:a};case 1:return{...o,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof n_){const n=this._getAutorunInfo(e);if(!n)return;const i={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},r=[...n.changedObservables].map(o=>this._instanceInfos.get(o).instanceId);if(e.debugGetState().isRunning)return{...i,type:"autorun",state:"updating",changedDependencies:r};switch(e.debugGetState().state){case 3:return{...i,type:"autorun",state:"upToDate"};case 2:return{...i,type:"autorun",state:"stale",changedDependencies:r};case 1:return{...i,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){const t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof Xr)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};const t=this._getAutorunInfo(e);if(t)return{name:e.toString(),instanceId:t.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=Hoe("observableDevTools",()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{const e={};for(const t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(Sr)}),getDerivedInfo:e=>{const t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(Sr),observers:[...t.debugGetObservers()].map(n=>this._formatObserver(n)).filter(Sr)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(Sr)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{const n=this._aliveInstances.get(e);if(n instanceof Xr)n.debugSetValue(t);else if(n instanceof e_)n.debugSetValue(t);else if(n instanceof gh)n.debugSetValue(t);else throw new we("Observable is not supported");const i=[...n.debugGetObservers()];for(const r of i)r.beginUpdate(n);for(const r of i)r.handleChange(n,void 0);for(const r of i)r.endUpdate(n)},getValue:e=>{const t=this._aliveInstances.get(e);if(t instanceof Xr)return Yf(t.debugGetState().value,200);if(t instanceof e_)return Yf(t.debugGetState().value,200)},logValue:e=>{const t=this._aliveInstances.get(e);if(t&&"get"in t)console.log("Logged Value:",t.get());else throw new we("Observable is not supported")},rerun:e=>{const t=this._aliveInstances.get(e);if(t instanceof Xr)t.debugRecompute();else if(t instanceof n_)t.debugRerun();else throw new we("Observable is not supported")}}})),this._pendingChanges=null,this._changeThrottler=new $oe,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},bi.enable()}_handleChange(e){n9(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:t9(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let n=this._declarations.get(t.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,t){const i={declarationId:this._getDeclarationId("observable/value",t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i)}handleOnListenerCountChanged(e,t){const n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&t>0){const i=e instanceof Xr?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:i,name:e.debugName}}})}else n.listenerCount>0&&t===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof Xr){this._handleDerivedRecomputed(e,t);return}const n=this._getObservableInfo(e);n&&t.didChange&&(n.lastValue=Yf(t.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,t){const i={declarationId:this._getDeclarationId("autorun",t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i),this._aliveInstances.set(i.instanceId,e),i&&this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){const t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,n){const i=this._getAutorunInfo(e);i&&i.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){const t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,n){const i=this._getObservableInfo(e);i&&i.changedObservables.add(t)}_handleDerivedRecomputed(e,t){const n=this._getObservableInfo(e);if(!n)return;const i=Yf(t.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=i,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:i,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){const t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};Ku._instance=void 0;let gN=Ku;NE&&NE.VSCODE_DEV_DEBUG_OBSERVABLES&&voe(gN.getInstance());const{getWindow:pe,getDocument:Uoe,getWindows:i9,getWindowsCount:joe,getWindowId:o_,getWindowById:s9,onDidRegisterWindow:a_,onWillUnregisterWindow:Koe,onDidUnregisterWindow:qoe}=(function(){const s=new Map;Dre(_t,1);const e={window:_t,disposables:new le};s.set(_t.vscodeWindowId,e);const t=new A,n=new A,i=new A;function r(o,a){return(typeof o=="number"?s.get(o):void 0)??(a?e:void 0)}return{onDidRegisterWindow:t.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:n.event,registerWindow(o){if(s.has(o.vscodeWindowId))return U.None;const a=new le,l={window:o,disposables:a.add(new le)};return s.set(o.vscodeWindowId,l),a.add(Ce(()=>{s.delete(o.vscodeWindowId),n.fire(o)})),a.add(B(o,Z.BEFORE_UNLOAD,()=>{i.fire(o)})),t.fire(l),a},getWindows(){return s.values()},getWindowsCount(){return s.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return s.has(o)},getWindowById:r,getWindow(o){const a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;const l=o;return l?.view?l.view.window:_t},getDocument(o){return pe(o).document}}})();function ko(s){for(;s.firstChild;)s.firstChild.remove()}class Goe{constructor(e,t,n,i){this._node=e,this._type=t,this._handler=n,this._options=i||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function B(s,e,t,n){return new Goe(s,e,t,n)}function Yoe(s,e){return function(t){return e(new Qs(s,t))}}function Xoe(s){return function(e){return s(new bt(e))}}const si=function(e,t,n,i){let r=n;return t==="click"||t==="mousedown"||t==="contextmenu"?r=Yoe(pe(e),n):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=Xoe(n)),B(e,t,r,i)};function Zoe(s,e,t){return B(s,na&&Km.pointerEvents?Z.POINTER_DOWN:Z.MOUSE_DOWN,e,t)}function Qoe(s,e,t){return B(s,na&&Km.pointerEvents?Z.POINTER_MOVE:Z.MOUSE_MOVE,e,t)}function r9(s,e,t){return B(s,na&&Km.pointerEvents?Z.POINTER_UP:Z.MOUSE_UP,e,t)}function cC(s,e,t){return Gm(s,e,t)}let o9,fs;class dC extends Y2{constructor(e){super(),this.defaultTarget=e&&pe(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}}class pN{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){dt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){const s=new Map,e=new Map,t=new Map,n=new Map,i=r=>{t.set(r,!1);const o=s.get(r)??[];for(e.set(r,o),s.set(r,[]),n.set(r,!0);o.length>0;)o.sort(pN.sort),o.shift().execute();n.set(r,!1)};fs=(r,o,a=0)=>{const l=o_(r),c=new pN(o,a);let d=s.get(l);return d||(d=[],s.set(l,d)),d.push(c),t.get(l)||(t.set(l,!0),r.requestAnimationFrame(()=>i(l))),c},o9=(r,o,a)=>{const l=o_(r);if(n.get(l)){const c=new pN(o,a);let d=e.get(l);return d||(d=[],e.set(l,d)),d.push(c),c}else return fs(r,o,a)}})();function mN(s){return pe(s).getComputedStyle(s,null)}function _N(s,e,t){const n=pe(s),i=n.document;if(s!==i.body)return new vl(s.clientWidth,s.clientHeight);if(na&&n?.visualViewport)return new vl(n.visualViewport.width,n.visualViewport.height);if(n?.innerWidth&&n.innerHeight)return new vl(n.innerWidth,n.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new vl(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new vl(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class Yt{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t){const n=mN(e),i=n?n.getPropertyValue(t):"0";return Yt.convertToPixels(e,i)}static getBorderLeftWidth(e){return Yt.getDimension(e,"border-left-width")}static getBorderRightWidth(e){return Yt.getDimension(e,"border-right-width")}static getBorderTopWidth(e){return Yt.getDimension(e,"border-top-width")}static getBorderBottomWidth(e){return Yt.getDimension(e,"border-bottom-width")}static getPaddingLeft(e){return Yt.getDimension(e,"padding-left")}static getPaddingRight(e){return Yt.getDimension(e,"padding-right")}static getPaddingTop(e){return Yt.getDimension(e,"padding-top")}static getPaddingBottom(e){return Yt.getDimension(e,"padding-bottom")}static getMarginLeft(e){return Yt.getDimension(e,"margin-left")}static getMarginTop(e){return Yt.getDimension(e,"margin-top")}static getMarginRight(e){return Yt.getDimension(e,"margin-right")}static getMarginBottom(e){return Yt.getDimension(e,"margin-bottom")}}const qu=class qu{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new qu(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof qu?e:new qu(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};qu.None=new qu(0,0);let vl=qu;function Joe(s){let e=s.offsetParent,t=s.offsetTop,n=s.offsetLeft;for(;(s=s.parentNode)!==null&&s!==s.ownerDocument.body&&s!==s.ownerDocument.documentElement;){t-=s.scrollTop;const i=l9(s)?null:mN(s);i&&(n-=i.direction!=="rtl"?s.scrollLeft:-s.scrollLeft),s===e&&(n+=Yt.getBorderLeftWidth(s),t+=Yt.getBorderTopWidth(s),t+=s.offsetTop,n+=s.offsetLeft,e=s.offsetParent)}return{left:n,top:t}}function Lr(s){const e=s.getBoundingClientRect(),t=pe(s);return{left:e.left+t.scrollX,top:e.top+t.scrollY,width:e.width,height:e.height}}function a9(s){let e=s,t=1;do{const n=mN(e).zoom;n!=null&&n!=="1"&&(t*=n),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function bN(s){const e=Yt.getMarginLeft(s)+Yt.getMarginRight(s);return s.offsetWidth+e}function wN(s){const e=Yt.getBorderLeftWidth(s)+Yt.getBorderRightWidth(s),t=Yt.getPaddingLeft(s)+Yt.getPaddingRight(s);return s.offsetWidth-e-t}function eae(s){const e=Yt.getBorderTopWidth(s)+Yt.getBorderBottomWidth(s),t=Yt.getPaddingTop(s)+Yt.getPaddingBottom(s);return s.offsetHeight-e-t}function CN(s){const e=Yt.getMarginTop(s)+Yt.getMarginBottom(s);return s.offsetHeight+e}function Wn(s,e){return!!e?.contains(s)}function tae(s,e,t){for(;s&&s.nodeType===s.ELEMENT_NODE;){if(s.classList.contains(e))return s;if(t){if(typeof t=="string"){if(s.classList.contains(t))return null}else if(s===t)return null}s=s.parentNode}return null}function vN(s,e,t){return!!tae(s,e,t)}function l9(s){return s&&!!s.host&&!!s.mode}function yN(s){return!!ph(s)}function ph(s){for(;s.parentNode;){if(s===s.ownerDocument?.body)return null;s=s.parentNode}return l9(s)?s:null}function Hn(){let s=hC().activeElement;for(;s?.shadowRoot;)s=s.shadowRoot.activeElement;return s}function SN(s){return Hn()===s}function c9(s){return Wn(Hn(),s)}function hC(){return joe()<=1?_t.document:Array.from(i9()).map(({window:e})=>e.document).find(e=>e.hasFocus())??_t.document}function ft(){return hC().defaultView?.window??_t}const nae=new class{constructor(){this.mutationObservers=new Map}observe(s,e,t){let n=this.mutationObservers.get(s);n||(n=new Map,this.mutationObservers.set(s,n));const i=tN(t);let r=n.get(i);if(r)r.users+=1;else{const o=new A,a=new MutationObserver(c=>o.fire(c));a.observe(s,t);const l=r={users:1,observer:a,onDidMutate:o.event};e.add(Ce(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),n?.delete(i),n?.size===0&&this.mutationObservers.delete(s))})),n.set(i,r)}return r.onDidMutate}};function sn(s){return s instanceof HTMLElement||s instanceof pe(s).HTMLElement}function d9(s){return s instanceof HTMLAnchorElement||s instanceof pe(s).HTMLAnchorElement}function h9(s){return s instanceof SVGElement||s instanceof pe(s).SVGElement}function xN(s){return s instanceof MouseEvent||s instanceof pe(s).MouseEvent}function yl(s){return s instanceof KeyboardEvent||s instanceof pe(s).KeyboardEvent}const Z={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend"};function iae(s){const e=s;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const st={stop:(s,e)=>(s.preventDefault(),e&&s.stopPropagation(),s)};function sae(s){const e=[];for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)e[t]=s.scrollTop,s=s.parentNode;return e}function rae(s,e){for(let t=0;s&&s.nodeType===s.ELEMENT_NODE;t++)s.scrollTop!==e[t]&&(s.scrollTop=e[t]),s=s.parentNode}let oae=class tP extends U{get onDidFocus(){return this._onDidFocus.event}get onDidBlur(){return this._onDidBlur.event}static hasFocusWithin(e){if(sn(e)){const t=ph(e),n=t?t.activeElement:e.ownerDocument.activeElement;return Wn(n,e)}else{const t=e;return Wn(t.document.activeElement,t.document)}}constructor(e){super(),this._onDidFocus=this._register(new A),this._onDidBlur=this._register(new A);let t=tP.hasFocusWithin(e),n=!1;const i=()=>{n=!1,t||(t=!0,this._onDidFocus.fire())},r=()=>{t&&(n=!0,(sn(e)?pe(e):e).setTimeout(()=>{n&&(n=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{tP.hasFocusWithin(e)!==t&&(t?r():i())},this._register(B(e,Z.FOCUS,i,!0)),this._register(B(e,Z.BLUR,r,!0)),sn(e)&&(this._register(B(e,Z.FOCUS_IN,()=>this._refreshStateHandler())),this._register(B(e,Z.FOCUS_OUT,()=>this._refreshStateHandler())))}};function Xf(s){return new oae(s)}function aae(s,e){return s.after(e),e}function ce(s,...e){if(s.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function uC(s,e){return s.insertBefore(e,s.firstChild),e}function wi(s,...e){s.textContent="",ce(s,...e)}const lae=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var l_;(function(s){s.HTML="http://www.w3.org/1999/xhtml",s.SVG="http://www.w3.org/2000/svg"})(l_||(l_={}));function u9(s,e,t,...n){const i=lae.exec(e);if(!i)throw new Error("Bad use of emmet");const r=i[1]||"div";let o;return s!==l_.HTML?o=document.createElementNS(s,r):o=document.createElement(r),i[3]&&(o.id=i[3]),i[4]&&(o.className=i[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...n),o}function ve(s,e,...t){return u9(l_.HTML,s,e,...t)}ve.SVG=function(s,e,...t){return u9(l_.SVG,s,e,...t)};function f9(...s){for(const e of s)e.style.display="",e.removeAttribute("aria-hidden")}function g9(...s){for(const e of s)e.style.display="none",e.setAttribute("aria-hidden","true")}function p9(s,e){const t=s.devicePixelRatio*e;return Math.max(1,Math.floor(t))/s.devicePixelRatio}function m9(s){_t.open(s,"_blank","noopener")}function cae(s,e){const t=()=>{e(),n=fs(s,t)};let n=fs(s,t);return Ce(()=>n.dispose())}BF.setPreferredWebSchema(/^https:/.test(_t.location.href)?"https":"http");class $c extends A{constructor(){super(),this._subscriptions=new le,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(X.runAndSubscribe(a_,({window:e,disposables:t})=>this.registerListeners(e,t),{window:_t,disposables:this._subscriptions}))}registerListeners(e,t){t.add(B(e,"keydown",n=>{if(n.defaultPrevented)return;const i=new bt(n);if(!(i.keyCode===6&&n.repeat)){if(n.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(n.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(n.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(n.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(i.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=n,this.fire(this._keyStatus))}},!0)),t.add(B(e,"keyup",n=>{n.defaultPrevented||(!n.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!n.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!n.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!n.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=n.altKey,this._keyStatus.ctrlKey=n.ctrlKey,this._keyStatus.metaKey=n.metaKey,this._keyStatus.shiftKey=n.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=n,this.fire(this._keyStatus)))},!0)),t.add(B(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(B(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(B(e.document.body,"mousemove",n=>{n.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(B(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return $c.instance||($c.instance=new $c),$c.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class dae extends U{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(B(this.element,Z.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(B(this.element,Z.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(B(this.element,Z.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(B(this.element,Z.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(B(this.element,Z.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(B(this.element,Z.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(B(this.element,Z.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}const hae=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function Je(s,...e){let t,n;Array.isArray(e[0])?(t={},n=e[0]):(t=e[0]||{},n=e[1]);const i=hae.exec(s);if(!i||!i.groups)throw new Error("Bad use of h");const r=i.groups.tag||"div",o=document.createElement(r);i.groups.id&&(o.id=i.groups.id);const a=[];if(i.groups.class)for(const c of i.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(o.className=a.join(" "));const l={};if(i.groups.name&&(l[i.groups.name]=o),n)for(const c of n)sn(c)?o.appendChild(c):typeof c=="string"?o.append(c):"root"in c&&(Object.assign(l,c),o.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[h,u]of Object.entries(d))o.style.setProperty(c_(h),typeof u=="number"?u+"px":""+u);else c==="tabIndex"?o.tabIndex=d:o.setAttribute(c_(c),d.toString());return l.root=o,l}function c_(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Eo(s){return s.tagName.toLowerCase()==="input"||s.tagName.toLowerCase()==="textarea"||sn(s)&&!!s.editContext}var _9;(function(s){function e(i=void 0){return(r,o,a)=>{const l=o.class;delete o.class;const c=o.ref;delete o.ref;const d=o.obsRef;return delete o.obsRef,new fae(r,c,d,i,l,o,a)}}function t(i,r=void 0){const o=e(r);return(a,l)=>o(i,a,l)}s.div=t("div"),s.elem=e(void 0),s.svg=t("svg","http://www.w3.org/2000/svg"),s.svgElem=e("http://www.w3.org/2000/svg");function n(){let i;const r=function(o){i=o};return Object.defineProperty(r,"element",{get(){if(!i)throw new we("Make sure the ref is set before accessing the element. Maybe wrong initialization order?");return i}}),r}s.ref=n})(_9||(_9={}));class LN{constructor(e,t,n,i,r,o,a){this._deriveds=[],this._element=i?document.createElementNS(i,e):document.createElement(e),t&&t(this._element),n&&this._deriveds.push(he(l=>{n(this),l.store.add({dispose:()=>{n(null)}})})),r&&(v9(r)?this._deriveds.push(he(this,l=>{b9(this._element,C9(r,l))})):b9(this._element,C9(r,void 0)));for(const[l,c]of Object.entries(o))if(l==="style")for(const[d,h]of Object.entries(c)){const u=c_(d);mh(h)?this._deriveds.push(aa({owner:this,debugName:()=>`set.style.${u}`},f=>{this._element.style.setProperty(u,y9(h.read(f)))})):this._element.style.setProperty(u,y9(h))}else l==="tabIndex"?mh(c)?this._deriveds.push(he(this,d=>{this._element.tabIndex=c.read(d)})):this._element.tabIndex=c:l.startsWith("on")?this._element[l]=c:mh(c)?this._deriveds.push(aa({owner:this,debugName:()=>`set.${l}`},d=>{x9(this._element,l,c.read(d))})):x9(this._element,l,c);if(a){let l=function(d,h){return mh(h)?l(d,h.read(d)):Array.isArray(h)?h.flatMap(u=>l(d,u)):h instanceof LN?(d&&h.readEffect(d),[h._element]):h?[h]:[]};const c=he(this,d=>{this._element.replaceChildren(...l(d,a))});this._deriveds.push(c),S9(a)||c.get()}}readEffect(e){for(const t of this._deriveds)t.read(e)}keepUpdated(e){return he(t=>{this.readEffect(t)}).recomputeInitiallyAndOnChange(e),this}toDisposableLiveElement(){const e=new le;return this.keepUpdated(e),new uae(this._element,e)}}function b9(s,e){h9(s)?s.setAttribute("class",e):s.className=e}function w9(s,e,t){if(mh(s)){t(s.read(e));return}if(Array.isArray(s)){for(const n of s)w9(n,e,t);return}t(s)}function C9(s,e){let t="";return w9(s,e,n=>{n&&(t.length===0?t=n:t+=" "+n)}),t}function v9(s){return mh(s)?!0:Array.isArray(s)?s.some(e=>v9(e)):!1}function y9(s){return typeof s=="number"?s+"px":s}function S9(s){return mh(s)?!0:Array.isArray(s)?s.some(e=>S9(e)):!1}class uae{constructor(e,t){this.element=e,this._disposable=t}dispose(){this._disposable.dispose()}}class fae extends LN{constructor(){super(...arguments),this._isHovered=void 0,this._didMouseMoveDuringHover=void 0}get element(){return this._element}get isHovered(){if(!this._isHovered){const e=Me("hovered",!1);this._element.addEventListener("mouseenter",t=>e.set(!0,void 0)),this._element.addEventListener("mouseleave",t=>e.set(!1,void 0)),this._isHovered=e}return this._isHovered}get didMouseMoveDuringHover(){if(!this._didMouseMoveDuringHover){let e=!1;const t=Me("didMouseMoveDuringHover",!1);this._element.addEventListener("mouseenter",n=>{e=!0}),this._element.addEventListener("mousemove",n=>{e&&t.set(!0,void 0)}),this._element.addEventListener("mouseleave",n=>{e=!1,t.set(!1,void 0)}),this._didMouseMoveDuringHover=t}return this._didMouseMoveDuringHover}}function x9(s,e,t){t==null?s.removeAttribute(c_(e)):s.setAttribute(c_(e),String(t))}function mh(s){return!!s&&s.read!==void 0&&s.reportChanges!==void 0}class gae extends U{constructor(e){super(),this._onDidChange=this._register(new A),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class pae extends U{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new A),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new gae(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d"),n=e.devicePixelRatio||1,i=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/i}}class mae{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=o_(e);let n=this.mapWindowIdToPixelRatioMonitor.get(t);return n||(n=new pae(e),this.mapWindowIdToPixelRatioMonitor.set(t,n),X.once(qoe)(({vscodeWindowId:i})=>{i===t&&(n?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),n}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}const fC=new mae;class gC{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}focus(){this.domNode.focus()}setMaxWidth(e){const t=No(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=No(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=No(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=No(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=No(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=No(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=No(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=No(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=No(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=No(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=No(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function No(s){return typeof s=="number"?`${s}px`:s}function et(s){return new gC(s)}function ri(s,e){s instanceof gC?(s.setFontFamily(e.getMassagedFontFamily()),s.setFontWeight(e.fontWeight),s.setFontSize(e.fontSize),s.setFontFeatureSettings(e.fontFeatureSettings),s.setFontVariationSettings(e.fontVariationSettings),s.setLineHeight(e.lineHeight),s.setLetterSpacing(e.letterSpacing)):(s.style.fontFamily=e.getMassagedFontFamily(),s.style.fontWeight=e.fontWeight,s.style.fontSize=e.fontSize+"px",s.style.fontFeatureSettings=e.fontFeatureSettings,s.style.fontVariationSettings=e.fontVariationSettings,s.style.lineHeight=e.lineHeight+"px",s.style.letterSpacing=e.letterSpacing+"px")}class _ae{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class kN{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");ri(t,this._bareFontInfo),e.appendChild(t);const n=document.createElement("div");ri(n,this._bareFontInfo),n.style.fontWeight="bold",e.appendChild(n);const i=document.createElement("div");ri(i,this._bareFontInfo),i.style.fontStyle="italic",e.appendChild(i);const r=[];for(const o of this._requests){let a;o.type===0&&(a=t),o.type===2&&(a=n),o.type===1&&(a=i),a.appendChild(document.createElement("br"));const l=document.createElement("span");kN._render(l,o),a.appendChild(l),r.push(l)}this._container=e,this._testElements=r}static _render(e,t){if(t.chr===" "){let n=" ";for(let i=0;i<8;i++)n+=n;e.innerText=n}else{let n=t.chr;for(let i=0;i<8;i++)n+=n;e.textContent=n}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const n=this._requests[e],i=this._testElements[e];n.fulfill(i.offsetWidth/256)}}}function bae(s,e,t){new kN(e,t).read(s)}const Uc=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new A,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(s){s=Math.min(Math.max(-5,s),20),this._zoomLevel!==s&&(this._zoomLevel=s,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},wae=He?1.5:1.35,EN=8;class _h{static createFromValidatedSettings(e,t,n){const i=e.get(58),r=e.get(62),o=e.get(61),a=e.get(60),l=e.get(63),c=e.get(75),d=e.get(72);return _h._create(i,r,o,a,l,c,d,t,n)}static _create(e,t,n,i,r,o,a,l,c){o===0?o=wae*n:o<EN&&(o=o*n),o=Math.round(o),o<EN&&(o=EN);const d=1+(c?0:Uc.getZoomLevel()*.1);return n*=d,o*=d,r===Om.TRANSLATE&&(t==="normal"||t==="bold"?r=Om.OFF:(r=`'wght' ${parseInt(t,10)}`,t="normal")),new _h({pixelRatio:l,fontFamily:e,fontWeight:t,fontSize:n,fontFeatureSettings:i,fontVariationSettings:r,lineHeight:o,letterSpacing:a})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=Ys.fontFamily,t=_h._wrapInQuotes(this.fontFamily);return this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const Cae=2;class NN extends _h{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=Cae,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}class vae extends U{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new A),this.onDidChange=this._onDidChange.event}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){const t=o_(e);let n=this._cache.get(t);return n||(n=new yae,this._cache.set(t,n)),n}_writeToCache(e,t,n){this._ensureCache(e).put(t,n),!n.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),n=t.getValues();let i=!1;for(const r of n)r.isTrusted||(i=!0,t.remove(r));i&&this._onDidChange.fire()}readFontInfo(e,t){const n=this._ensureCache(e);if(!n.has(t)){let i=this._actualReadFontInfo(e,t);(i.typicalHalfwidthCharacterWidth<=2||i.typicalFullwidthCharacterWidth<=2||i.spaceWidth<=2||i.maxDigitWidth<=2)&&(i=new NN({pixelRatio:fC.getInstance(e).value,fontFamily:i.fontFamily,fontWeight:i.fontWeight,fontSize:i.fontSize,fontFeatureSettings:i.fontFeatureSettings,fontVariationSettings:i.fontVariationSettings,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,isMonospace:i.isMonospace,typicalHalfwidthCharacterWidth:Math.max(i.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(i.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:i.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(i.spaceWidth,5),middotWidth:Math.max(i.middotWidth,5),wsmiddotWidth:Math.max(i.wsmiddotWidth,5),maxDigitWidth:Math.max(i.maxDigitWidth,5)},!1)),this._writeToCache(e,t,i)}return n.get(t)}_createRequest(e,t,n,i){const r=new _ae(e,t);return n.push(r),i?.push(r),r}_actualReadFontInfo(e,t){const n=[],i=[],r=this._createRequest("n",0,n,i),o=this._createRequest("m",0,n,null),a=this._createRequest(" ",0,n,i),l=this._createRequest("0",0,n,i),c=this._createRequest("1",0,n,i),d=this._createRequest("2",0,n,i),h=this._createRequest("3",0,n,i),u=this._createRequest("4",0,n,i),f=this._createRequest("5",0,n,i),g=this._createRequest("6",0,n,i),p=this._createRequest("7",0,n,i),m=this._createRequest("8",0,n,i),b=this._createRequest("9",0,n,i),w=this._createRequest("→",0,n,i),C=this._createRequest("→",0,n,null),v=this._createRequest("·",0,n,i),S=this._createRequest("⸱",0,n,null),k="|/-_ilm%";for(let O=0,I=k.length;O<I;O++)this._createRequest(k.charAt(O),0,n,i),this._createRequest(k.charAt(O),1,n,i),this._createRequest(k.charAt(O),2,n,i);bae(e,t,n);const L=Math.max(l.width,c.width,d.width,h.width,u.width,f.width,g.width,p.width,m.width,b.width);let E=t.fontFeatureSettings===Bc.OFF;const N=i[0].width;for(let O=1,I=i.length;E&&O<I;O++){const F=N-i[O].width;if(F<-.001||F>.001){E=!1;break}}let M=!0;return E&&C.width!==N&&(M=!1),C.width>w.width&&(M=!1),new NN({pixelRatio:fC.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:E,typicalHalfwidthCharacterWidth:r.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:M,spaceWidth:a.width,middotWidth:v.width,wsmiddotWidth:S.width,maxDigitWidth:L},!0)}}class yae{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const n=e.getId();this._keys[n]=e,this._values[n]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const DN=new vae;var Do;(function(s){s.serviceIds=new Map,s.DI_TARGET="$di$target",s.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[s.DI_DEPENDENCIES]||[]}s.getServiceDependencies=e})(Do||(Do={}));const Xe=We("instantiationService");function Sae(s,e,t){e[Do.DI_TARGET]===e?e[Do.DI_DEPENDENCIES].push({id:s,index:t}):(e[Do.DI_DEPENDENCIES]=[{id:s,index:t}],e[Do.DI_TARGET]=e)}function We(s){if(Do.serviceIds.has(s))return Do.serviceIds.get(s);const e=function(t,n,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Sae(e,t,i)};return e.toString=()=>s,Do.serviceIds.set(s,e),e}const Dn=We("codeEditorService"),$i=We("modelService"),pC=We("textModelService");class jc extends U{get onDidChange(){return this._onDidChange.event}constructor(e,t="",n="",i=!0,r){super(),this._onDidChange=this._register(new A),this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=i,this._actionCallback=r}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class bh extends U{constructor(){super(...arguments),this._onWillRun=this._register(new A),this._onDidRun=this._register(new A)}get onWillRun(){return this._onWillRun.event}get onDidRun(){return this._onDidRun.event}async run(e,t){if(!e.enabled)return;this._onWillRun.fire({action:e});let n;try{await this.runAction(e,t)}catch(i){n=i}this._onDidRun.fire({action:e,error:n})}async runAction(e,t){await e.run(t)}}const zb=class zb{constructor(){this.id=zb.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const n of e)n.length&&(t.length?t=[...t,new zb,...n]:t=n);return t}async run(){}};zb.ID="vs.actions.separator";let Ci=zb;class mC{get actions(){return this._actions}constructor(e,t,n,i){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=i,this._actions=n}async run(){}}const dx=class dx extends jc{constructor(){super(dx.ID,_(28,"(empty)"),void 0,!1)}};dx.ID="vs.actions.empty";let TN=dx;function wh(s){return{id:s.id,label:s.label,tooltip:s.tooltip??s.label,class:s.class,enabled:s.enabled??!0,checked:s.checked,run:async(...e)=>s.run(...e)}}var IN;(function(s){function e(t){return!!t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=e})(IN||(IN={}));var Ge;(function(s){s.iconNameSegment="[A-Za-z0-9]+",s.iconNameExpression="[A-Za-z0-9-]+",s.iconModifierExpression="~[A-Za-z]+",s.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${s.iconNameExpression})(${s.iconModifierExpression})?$`);function t(u){const f=e.exec(u.id);if(!f)return t(ne.error);const[,g,p]=f,m=["codicon","codicon-"+g];return p&&m.push("codicon-modifier-"+p.substring(1)),m}s.asClassNameArray=t;function n(u){return t(u).join(" ")}s.asClassName=n;function i(u){return"."+t(u).join(".")}s.asCSSSelector=i;function r(u){return!!u&&typeof u=="object"&&typeof u.id=="string"&&(typeof u.color>"u"||IN.isThemeColor(u.color))}s.isThemeIcon=r;const o=new RegExp(`^\\$\\((${s.iconNameExpression}(?:${s.iconModifierExpression})?)\\)$`);function a(u){const f=o.exec(u);if(!f)return;const[,g]=f;return{id:g}}s.fromString=a;function l(u){return{id:u}}s.fromId=l;function c(u,f){let g=u.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}s.modify=c;function d(u){const f=u.id.lastIndexOf("~");if(f!==-1)return u.id.substring(f+1)}s.getModifier=d;function h(u,f){return u.id===f.id&&u.color?.id===f.color?.id}s.isEqual=h})(Ge||(Ge={}));const Js=We("commandService"),gs=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new A,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(s,e){if(!s)throw new Error("invalid command");if(typeof s=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:s,handler:e})}if(s.metadata&&Array.isArray(s.metadata.args)){const o=[];for(const l of s.metadata.args)o.push(l.constraint);const a=s.handler;s.handler=function(l,...c){return Wie(c,o),a(l,...c)}}const{id:t}=s;let n=this._commands.get(t);n||(n=new us,this._commands.set(t,n));const i=n.unshift(s),r=Ce(()=>{i(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(s,e){return gs.registerCommand(s,(t,...n)=>t.get(Js).executeCommand(e,...n))}getCommand(s){const e=this._commands.get(s);if(!(!e||e.isEmpty()))return it.first(e)}getCommands(){const s=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&s.set(e,t)}return s}};gs.registerCommand("noop",()=>{});function MN(...s){switch(s.length){case 1:return _(1678,"Did you mean {0}?",s[0]);case 2:return _(1679,"Did you mean {0} or {1}?",s[0],s[1]);case 3:return _(1680,"Did you mean {0}, {1} or {2}?",s[0],s[1],s[2]);default:return}}const xae=_(1681,"Did you forget to open or close the quote?"),Lae=_(1682,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'."),Dp=class Dp{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw Ow(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(MN("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(MN("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(MN("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,n=this._input.substring(this._start,this._current),i={type:19,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(i)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),n=Dp._keywords.get(t);n?this._addToken(n):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(xae);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,n=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(Lae);return}const r=this._input.charCodeAt(e);if(t)t=!1;else if(r===47&&!n){e++;break}else r===91?n=!0:r===92?t=!0:r===93&&(n=!1);e++}for(;e<this._input.length&&Dp._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;const i=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:i,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}};Dp._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0))),Dp._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);let Ch=Dp;const vi=new Map;vi.set("false",!1),vi.set("true",!0),vi.set("isMac",He),vi.set("isLinux",Ts),vi.set("isWindows",hs),vi.set("isWeb",fl),vi.set("isMacNative",He&&!fl),vi.set("isEdge",V7),vi.set("isFirefox",Xie),vi.set("isChrome",gE),vi.set("isSafari",Zie);const kae=Object.prototype.hasOwnProperty,Eae={regexParsingWithErrorRecovery:!0},Nae=_(1660,"Empty context key expression"),Dae=_(1661,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Tae=_(1662,"'in' after 'not'."),L9=_(1663,"closing parenthesis ')'"),Iae=_(1664,"Unexpected token"),Mae=_(1665,"Did you forget to put && or || before the token?"),Rae=_(1666,"Unexpected end of expression"),Aae=_(1667,"Did you forget to put a context key?");let Oae=(ja=class{constructor(e=Eae){this._config=e,this._scanner=new Ch,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Nae,offset:0,lexeme:"",additionalInfo:Dae});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const n=this._peek(),i=n.type===17?Mae:void 0;throw this._parsingErrors.push({message:Iae,offset:n.offset,lexeme:Ch.getLexeme(n),additionalInfo:i}),ja._parseError}return t}catch(t){if(t!==ja._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:Ze.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Ze.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Ui.INSTANCE;case 12:return this._advance(),ps.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,L9),t?.negate()}case 17:return this._advance(),yh.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Ze.true();case 12:return this._advance(),Ze.false();case 0:{this._advance();const t=this._expr();return this._consume(1,L9),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const i=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),i.type!==10)throw this._errExpectedButGot("REGEX",i);const r=i.lexeme,o=r.lastIndexOf("/"),a=o===r.length-1?void 0:this._removeFlagsGY(r.substring(o+1));let l;try{l=new RegExp(r.substring(1,o),a)}catch{throw this._errExpectedButGot("REGEX",i)}return u_.create(t,l)}switch(i.type){case 10:case 19:{const r=[i.lexeme];this._advance();let o=this._peek(),a=0;for(let u=0;u<i.lexeme.length;u++)i.lexeme.charCodeAt(u)===40?a++:i.lexeme.charCodeAt(u)===41&&a--;for(;!this._isAtEnd()&&o.type!==15&&o.type!==16;){switch(o.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let u=0;u<o.lexeme.length;u++)o.lexeme.charCodeAt(u)===40?a++:i.lexeme.charCodeAt(u)===41&&a--}if(a<0)break;r.push(Ch.getLexeme(o)),this._advance(),o=this._peek()}const l=r.join(""),c=l.lastIndexOf("/"),d=c===l.length-1?void 0:this._removeFlagsGY(l.substring(c+1));let h;try{h=new RegExp(l.substring(1,c),d)}catch{throw this._errExpectedButGot("REGEX",i)}return Ze.regex(t,h)}case 18:{const r=i.lexeme;this._advance();let o=null;if(!Ire(r)){const a=r.indexOf("/"),l=r.lastIndexOf("/");if(a!==l&&a>=0){const c=r.slice(a+1,l),d=r[l+1]==="i"?"i":"";try{o=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",i)}}}if(o===null)throw this._errExpectedButGot("REGEX",i);return u_.create(t,o)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Tae);const i=this._value();return Ze.notIn(t,i)}switch(this._peek().type){case 3:{this._advance();const i=this._value();if(this._previous().type===18)return Ze.equals(t,i);switch(i){case"true":return Ze.has(t);case"false":return Ze.not(t);default:return Ze.equals(t,i)}}case 4:{this._advance();const i=this._value();if(this._previous().type===18)return Ze.notEquals(t,i);switch(i){case"true":return Ze.not(t);case"false":return Ze.has(t);default:return Ze.notEquals(t,i)}}case 5:return this._advance(),SC.create(t,this._value());case 6:return this._advance(),xC.create(t,this._value());case 7:return this._advance(),vC.create(t,this._value());case 8:return this._advance(),yC.create(t,this._value());case 13:return this._advance(),Ze.in(t,this._value());default:return Ze.has(t)}}case 20:throw this._parsingErrors.push({message:Rae,offset:e.offset,lexeme:"",additionalInfo:Aae}),ja._parseError;default:throw this._errExpectedButGot(`true | false | KEY
|
|
@@ -344,9 +344,9 @@ struct VSOutput {
|
|
|
344
344
|
`;this.value=n}equals(e){return this.value===e.value}static get NULL(){const e={getLineContent:()=>"",getLineCount:()=>1,getLineMaxColumn:()=>1,getValueInRange:()=>"",getValueLengthInRange:()=>0,modifyPosition:(t,n)=>t};return new n1(e,[])}}class Nme{constructor(){}_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t,n){const i=t*n,r=i+1,o=Math.min(i+n,e.getLineCount());return new Eme(r,o)}fromEditorSelection(e,t,n){const i=this._getPageOfLine(t.startLineNumber,n),r=this._getRangeForPage(e,i,n),o=this._getPageOfLine(t.endLineNumber,n),a=this._getRangeForPage(e,o,n),l=[{startLine:r.startLine,endLine:r.endLine}];return i+1<o&&l.push({startLine:a.startLine,endLine:a.endLine}),new n1(e,l)}}class Dme{constructor(e){this.replacements=e;let t=-1;for(const n of e){if(!(n.replaceRange.start>=t))throw new we(`Edits must be disjoint and sorted. Found ${n} after ${t}`);t=n.replaceRange.endExclusive}}toString(){return`[${this.replacements.map(t=>t.toString()).join(", ")}]`}normalize(){const e=[];let t;for(const n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(t&&t.replaceRange.endExclusive===n.replaceRange.start){const i=t.tryJoinTouching(n);if(i){t=i;continue}}t&&e.push(t),t=n}return t&&e.push(t),this._createNew(e)}compose(e){const t=this.normalize(),n=e.normalize();if(t.isEmpty())return n;if(n.isEmpty())return t;const i=[...t.replacements],r=[];let o=0;for(const a of n.replacements){for(;;){const h=i[0];if(!h||h.replaceRange.start+o+h.getNewLength()>=a.replaceRange.start)break;i.shift(),r.push(h),o+=h.getNewLength()-h.replaceRange.length}const l=o;let c,d;for(;;){const h=i[0];if(!h||h.replaceRange.start+o>a.replaceRange.endExclusive)break;c||(c=h),d=h,i.shift(),o+=h.getNewLength()-h.replaceRange.length}if(!c)r.push(a.delta(-o));else{const h=Math.min(c.replaceRange.start,a.replaceRange.start-l),u=a.replaceRange.start-(c.replaceRange.start+l);if(u>0){const m=c.slice(fe.emptyAt(h),new fe(0,u));r.push(m)}if(!d)throw new we("Invariant violation: lastIntersecting is undefined");const f=d.replaceRange.endExclusive+o-a.replaceRange.endExclusive;if(f>0){const m=d.slice(fe.ofStartAndLength(d.replaceRange.endExclusive,0),new fe(d.getNewLength()-f,d.getNewLength()));i.unshift(m),o-=m.getNewLength()-m.replaceRange.length}const g=new fe(h,a.replaceRange.endExclusive-o),p=a.slice(g,new fe(0,a.getNewLength()));r.push(p)}}for(;;){const a=i.shift();if(!a)break;r.push(a)}return this._createNew(r).normalize()}getNewRanges(){const e=[];let t=0;for(const n of this.replacements)e.push(fe.ofStartAndLength(n.replaceRange.start+t,n.getNewLength())),t+=n.getLengthDelta();return e}isEmpty(){return this.replacements.length===0}}class Tme{constructor(e){this.replaceRange=e}delta(e){return this.slice(this.replaceRange.delta(e),new fe(0,this.getNewLength()))}getLengthDelta(){return this.getNewLength()-this.replaceRange.length}toString(){return`{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new fe(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}}class Ime extends Dme{apply(e){const t=[];let n=0;for(const i of this.replacements)t.push(e.substring(n,i.replaceRange.start)),t.push(i.newText),n=i.replaceRange.endExclusive;return t.push(e.substring(n)),t.join("")}}class Mme extends Tme{constructor(e,t){super(e),this.newText=t}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){const t=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),n=$f(t,this.newText),i=Math.min(t.length-n,this.newText.length-n,Uf(t,this.newText)),r=new fe(this.replaceRange.start+n,this.replaceRange.endExclusive-i),o=this.newText.substring(n,this.newText.length-i);return new tu(r,o)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){const t=this.replaceRange.substring(e),n=$f(t,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new fe(n,this.newText.length))}removeCommonSuffix(e){const t=this.replaceRange.substring(e),n=Uf(t,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new fe(0,this.newText.length-n))}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}}const Op=class Op extends Ime{static compose(e){if(e.length===0)return Op.empty;let t=e[0];for(let n=1;n<e.length;n++)t=t.compose(e[n]);return t}constructor(e){super(e)}_createNew(e){return new Op(e)}};Op.empty=new Op([]);let PT=Op;class tu extends Mme{static insert(e,t){return new tu(fe.emptyAt(e),t)}static replace(e,t){return new tu(e,t)}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newText===e.newText}tryJoinTouching(e){return new tu(this.replaceRange.joinRightTouching(e.replaceRange),this.newText+e.newText)}slice(e,t){return new tu(e,t?t.substring(this.newText):this.newText)}}Lce({StringEdit:PT,StringReplacement:tu,TextReplacement:To,TextEdit:y_,TextLength:As});var Rme=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Ame=function(s,e){return function(t,n){e(t,n,s)}};let FT=class extends U{constructor(e,t,n,i){super(),this._domNode=e,this._context=t,this._viewController=n,this._accessibilityService=i,this._selectionChangeListener=this._register(new Bn),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._strategy=new lV,this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=this._domNode.domNode,n=ft().document.activeElement;if(!n||n!==t)return;if(this._accessibilityService.isScreenReaderOptimized()){this._state=this._getScreenReaderContentState(e),t.textContent!==this._state.value&&(this._setIgnoreSelectionChangeTime("setValue"),t.textContent=this._state.value);const r=ft().document.getSelection();if(!r)return;const o=this._getScreenReaderRange(this._state.selectionStart,this._state.selectionEnd);if(!o)return;this._setIgnoreSelectionChangeTime("setRange"),r.setBaseAndExtent(o.anchorNode,o.anchorOffset,o.focusNode,o.focusOffset)}else this._state=void 0,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){if(!this._state)return;const t=this._context.viewModel.viewLayout,n=this._state.startPositionWithinEditor.lineNumber,i=t.getVerticalOffsetForLineNumber(n),r=t.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=r-i}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return B(this._domNode.domNode.ownerDocument,"selectionchange",()=>{const t=this._accessibilityService.isScreenReaderOptimized();if(!this._state||!t||!ma.enabled||!(ft().document.activeElement===this._domNode.domNode))return;const r=ft().document.getSelection();if(!r||r.rangeCount===0)return;const a=r.getRangeAt(0),l=Date.now(),c=l-e;if(e=l,c<5)return;const d=l-this._ignoreSelectionChangeTime;this._ignoreSelectionChangeTime=0,!(d<100)&&this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context,this._state,r.direction,a))})}_getScreenReaderContentState(e){const t=this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize,this._accessibilityService.getAccessibilitySupport()===0),n=this._context.viewModel.model.getPositionAt(1/0);let i=t.value;return n.column===1&&e.getEndPosition().equals(n)&&(i+=`
|
|
345
345
|
`),t.value=i,t}_getScreenReaderRange(e,t){const n=this._domNode.domNode.firstChild;if(!n)return;const i=new globalThis.Range;return i.setStart(n,e),i.setEnd(n,t),{anchorNode:n,anchorOffset:e,focusNode:n,focusOffset:t}}_getEditorSelectionFromDomRange(e,t,n,i){const r=e.viewModel,o=r.model,l=r.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),c=o.getOffsetAt(l);let d=i.startOffset+c,h=i.endOffset+c;if(o.getEndOfLineSequence()===1){const b=t.value,w=new UC(b),C=w.getPosition(i.startOffset),v=w.getPosition(i.endOffset);d+=C.lineNumber-1,h+=v.lineNumber-1}const f=o.getPositionAt(d),g=o.getPositionAt(h),p=n==="forward"?f:g,m=n==="forward"?g:f;return Ae.fromPositions(p,m)}};FT=Rme([Ame(3,sr)],FT);var Ome=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},hV=function(s,e){return function(t,n){e(t,n,s)}};let BT=class extends U{constructor(e,t,n,i,r){super(),this._domNode=e,this._context=t,this._viewController=n,this._keybindingService=i,this._accessibilityService=r,this._contentLeft=1,this._contentWidth=1,this._contentHeight=1,this._divWidth=1,this._primarySelection=new Ae(1,1,1,1),this._primaryCursorVisibleRange=null,this._state=this._register(new Bn),this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes()}onWillPaste(){this._state.value?.onWillPaste()}onWillCut(){this._state.value?.onWillCut()}handleFocusChange(e){this._state.value?.onFocusChange(e),this.writeScreenReaderContent()}onConfigurationChanged(e){this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes(),e.hasChanged(2)&&this.writeScreenReaderContent()}_instantiateScreenReaderContent(){const e=this._context.configuration.options.get(107);this._renderRichContent!==e&&(this._renderRichContent=e,this._state.value=this._createScreenReaderContent(e))}_createScreenReaderContent(e){return e?new OT(this._domNode,this._context,this._viewController,this._accessibilityService):new FT(this._domNode,this._context,this._viewController,this._accessibilityService)}_updateConfigurationSettings(){const e=this._context.configuration.options,t=e.get(165),n=t.wrappingColumn;this._contentLeft=t.contentLeft,this._contentWidth=t.contentWidth,this._contentHeight=t.height,this._fontInfo=e.get(59),this._divWidth=Math.round(n*this._fontInfo.typicalHalfwidthCharacterWidth),this._state.value?.onConfigurationChanged(e)}_updateDomAttributes(){const e=this._context.configuration.options;this._domNode.domNode.setAttribute("role","textbox"),this._domNode.domNode.setAttribute("aria-required",e.get(9)?"true":"false"),this._domNode.domNode.setAttribute("aria-multiline","true"),this._domNode.domNode.setAttribute("aria-autocomplete",e.get(104)?"none":"both"),this._domNode.domNode.setAttribute("aria-roledescription",_(55,"editor")),this._domNode.domNode.setAttribute("aria-label",TT(e,this._keybindingService));const t=this._context.viewModel.model.getOptions().tabSize,n=e.get(59).spaceWidth;this._domNode.domNode.style.tabSize=`${t*n}px`;const i=e.get(154),r=i==="inherit"?e.get(153):i,o=r==="inherit"?e.get(149):r;this._domNode.domNode.style.textWrap=o==="off"?"nowrap":"wrap"}onCursorStateChanged(e){this._primarySelection=e.selections[0]??new Ae(1,1,1,1)}prepareRender(e){this.writeScreenReaderContent(),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primarySelection.getPosition())}render(e){if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._context.viewLayout.getCurrentScrollLeft(),n=this._contentLeft+this._primaryCursorVisibleRange.left-t;if(n<this._contentLeft||n>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getCurrentScrollTop(),r=this._primarySelection.positionLineNumber,o=this._context.viewLayout.getVerticalOffsetForLineNumber(r)-i;if(o<0||o>this._contentHeight){this._renderAtTopLeft();return}const a=this._context.viewLayout.getLineHeightForLineNumber(r);this._doRender(o,this._contentLeft,this._divWidth,a),this._state.value?.updateScrollTop(this._primarySelection)}_renderAtTopLeft(){this._doRender(0,0,this._contentWidth,1)}_doRender(e,t,n,i){ri(this._domNode,this._fontInfo),this._domNode.setTop(e),this._domNode.setLeft(t),this._domNode.setWidth(n),this._domNode.setHeight(i),this._domNode.setLineHeight(i)}setAriaOptions(e){e.activeDescendant?(this._domNode.setAttribute("aria-haspopup","true"),this._domNode.setAttribute("aria-autocomplete","list"),this._domNode.setAttribute("aria-activedescendant",e.activeDescendant)):(this._domNode.setAttribute("aria-haspopup","false"),this._domNode.setAttribute("aria-autocomplete","both"),this._domNode.removeAttribute("aria-activedescendant")),e.role&&this._domNode.setAttribute("role",e.role)}writeScreenReaderContent(){this._state.value?.updateScreenReaderContent(this._primarySelection)}};BT=Ome([hV(3,Qn),hV(4,sr)],BT);var VT;(function(s){function e(t,n){return new t.EditContext(n)}s.create=e})(VT||(VT={}));class Pme{constructor(){this._nativeEditContextMapping=new Map}register(e,t){return this._nativeEditContextMapping.set(e,t),{dispose:()=>{this._nativeEditContextMapping.delete(e)}}}get(e){return this._nativeEditContextMapping.get(e)}}const Fme=new Pme;var Bme=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},uV=function(s,e){return function(t,n){e(t,n,s)}},i1;(function(s){s.NONE="edit-context-composition-none",s.SECONDARY="edit-context-composition-secondary",s.PRIMARY="edit-context-composition-primary"})(i1||(i1={}));let Uv=class extends aV{constructor(e,t,n,i,r,o,a){super(t),this._viewController=i,this._visibleRangeProvider=r,this.logService=a,this._previousEditContextSelection=new fe(0,0),this._editContextPrimarySelection=new Ae(1,1,1,1),this._decorations=[],this._primarySelection=new Ae(1,1,1,1),this._targetWindowId=-1,this._scrollTop=0,this._scrollLeft=0,this.domNode=new gC(document.createElement("div")),this.domNode.setClassName("native-edit-context"),this._imeTextArea=new gC(document.createElement("textarea")),this._imeTextArea.setClassName("ime-text-area"),this._imeTextArea.setAttribute("readonly","true"),this._imeTextArea.setAttribute("tabindex","-1"),this._imeTextArea.setAttribute("aria-hidden","true"),this.domNode.setAttribute("autocorrect","off"),this.domNode.setAttribute("autocapitalize","off"),this.domNode.setAttribute("autocomplete","off"),this.domNode.setAttribute("spellcheck","false"),this._updateDomAttributes(),n.appendChild(this.domNode),n.appendChild(this._imeTextArea),this._parent=n.domNode,this._focusTracker=this._register(new RT(a,this.domNode.domNode,h=>{a.trace("NativeEditContext#handleFocusChange : ",h),this._screenReaderSupport.handleFocusChange(h),this._context.viewModel.setHasFocus(h)}));const l=pe(this.domNode.domNode);this._editContext=VT.create(l),this.setEditContextOnDomNode(),this._screenReaderSupport=this._register(o.createInstance(BT,this.domNode,t,this._viewController)),this._register(B(this.domNode.domNode,"copy",h=>{this.logService.trace("NativeEditContext#copy"),this._ensureClipboardGetsEditorSelection(h)})),this._register(B(this.domNode.domNode,"cut",h=>{this.logService.trace("NativeEditContext#cut"),this._screenReaderSupport.onWillCut(),this._ensureClipboardGetsEditorSelection(h),this.logService.trace("NativeEditContext#cut (before viewController.cut)"),this._viewController.cut()})),this._register(B(this.domNode.domNode,"keyup",h=>this._onKeyUp(h))),this._register(B(this.domNode.domNode,"keydown",async h=>this._onKeyDown(h))),this._register(B(this._imeTextArea.domNode,"keyup",h=>this._onKeyUp(h))),this._register(B(this._imeTextArea.domNode,"keydown",async h=>this._onKeyDown(h))),this._register(B(this.domNode.domNode,"beforeinput",async h=>{(h.inputType==="insertParagraph"||h.inputType==="insertLineBreak")&&this._onType(this._viewController,{text:`
|
|
346
346
|
`,replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0})})),this._register(B(this.domNode.domNode,"paste",h=>{if(this.logService.trace("NativeEditContext#paste"),h.preventDefault(),!h.clipboardData)return;let[u,f]=Sv.getTextData(h.clipboardData);if(this.logService.trace("NativeEditContext#paste with id : ",f?.id," with text.length: ",u.length),!u)return;f=f||$h.INSTANCE.get(u);let g=!1,p=null,m=null;f&&(g=this._context.configuration.options.get(45)&&!!f.isFromEmptySelection,p=typeof f.multicursorText<"u"?f.multicursorText:null,m=f.mode),this.logService.trace("NativeEditContext#paste (before viewController.paste)"),this._viewController.paste(u,g,p,m)})),this._register(t1(this._editContext,"textformatupdate",h=>this._handleTextFormatUpdate(h))),this._register(t1(this._editContext,"characterboundsupdate",h=>this._updateCharacterBounds(h)));let c;this._register(t1(this._editContext,"textupdate",h=>{const u=h.text;if(u.length===1){const f=u.charCodeAt(0);if(Nn(f)){c=u;return}if(ch(f)&&c){const g={text:c+u,selectionEnd:h.selectionEnd,selectionStart:h.selectionStart,updateRangeStart:h.updateRangeStart-1,updateRangeEnd:h.updateRangeEnd-1};c=void 0,this._emitTypeEvent(this._viewController,g);return}}this._emitTypeEvent(this._viewController,h)})),this._register(t1(this._editContext,"compositionstart",h=>{this._updateEditContext(),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(t1(this._editContext,"compositionend",h=>{this._updateEditContext(),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}));let d=!1;this._register(ma.onDidChange(()=>{ma.enabled&&d&&(this._focusTracker.resume(),this.domNode.focus(),d=!1),!ma.enabled&&this.isFocused()&&(this._focusTracker.pause(),this._imeTextArea.focus(),d=!0)})),this._register(Fme.register(e,this))}dispose(){this.domNode.domNode.editContext=void 0,this.domNode.domNode.blur(),this.domNode.domNode.remove(),this._imeTextArea.domNode.remove(),super.dispose()}setAriaOptions(e){this._screenReaderSupport.setAriaOptions(e)}getLastRenderData(){return this._primarySelection.getPosition()}prepareRender(e){this._screenReaderSupport.prepareRender(e),this._updateSelectionAndControlBounds(e)}render(e){this._screenReaderSupport.render(e)}onCursorStateChanged(e){return this._primarySelection=e.modelSelections[0]??new Ae(1,1,1,1),this._screenReaderSupport.onCursorStateChanged(e),this._updateEditContext(),!0}onConfigurationChanged(e){return this._screenReaderSupport.onConfigurationChanged(e),this._updateDomAttributes(),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.fromLineNumber+e.count-1),!0}onLinesDeleted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}onLinesInserted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}_updateEditContextOnLineChange(e,t){this._editContextPrimarySelection.endLineNumber<e||this._editContextPrimarySelection.startLineNumber>t||this._updateEditContext()}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}onWillPaste(){this.logService.trace("NativeEditContext#onWillPaste"),this._onWillPaste()}_onWillPaste(){this._screenReaderSupport.onWillPaste()}onWillCopy(){this.logService.trace("NativeEditContext#onWillCopy"),this.logService.trace("NativeEditContext#isFocused : ",this.domNode.domNode===Hn())}writeScreenReaderContent(){this._screenReaderSupport.writeScreenReaderContent()}isFocused(){return this._focusTracker.isFocused}focus(){this._focusTracker.focus(),this.refreshFocusState()}refreshFocusState(){this._focusTracker.refreshFocusState()}setEditContextOnDomNode(){const e=pe(this.domNode.domNode),t=o_(e);this._targetWindowId!==t&&(this.domNode.domNode.editContext=this._editContext,this._targetWindowId=t)}_onKeyUp(e){this._viewController.emitKeyUp(new bt(e))}_onKeyDown(e){const t=new bt(e);t.keyCode===114&&t.stopPropagation(),this._viewController.emitKeyDown(t)}_updateDomAttributes(){const e=this._context.configuration.options;this.domNode.domNode.setAttribute("tabindex",String(e.get(140)))}_updateEditContext(){const e=this._getNewEditContextState();e&&(this._editContext.updateText(0,Number.MAX_SAFE_INTEGER,e.text??" "),this._editContext.updateSelection(e.selectionStartOffset,e.selectionEndOffset),this._editContextPrimarySelection=e.editContextPrimarySelection,this._previousEditContextSelection=new fe(e.selectionStartOffset,e.selectionEndOffset))}_emitTypeEvent(e,t){if(!this._editContext)return;const n=this._previousEditContextSelection.endExclusive,i=this._previousEditContextSelection.start;this._previousEditContextSelection=new fe(t.selectionStart,t.selectionEnd);let r=0,o=0;t.updateRangeEnd>n&&(r=t.updateRangeEnd-n),t.updateRangeStart<i&&(o=i-t.updateRangeStart);let a="";i<t.updateRangeStart&&(a+=this._editContext.text.substring(i,t.updateRangeStart)),a+=t.text,n>t.updateRangeEnd&&(a+=this._editContext.text.substring(t.updateRangeEnd,n));let l=0;t.selectionStart===t.selectionEnd&&i===n&&(l=t.selectionStart-(t.updateRangeStart+t.text.length));const c={text:a,replacePrevCharCnt:o,replaceNextCharCnt:r,positionDelta:l};this._onType(e,c)}_onType(e,t){t.replacePrevCharCnt||t.replaceNextCharCnt||t.positionDelta?e.compositionType(t.text,t.replacePrevCharCnt,t.replaceNextCharCnt,t.positionDelta):e.type(t.text)}_getNewEditContextState(){const e=this._primarySelection,t=this._context.viewModel.model;if(!t.isValidRange(e))return;const n=e.startLineNumber,i=e.endLineNumber,r=t.getLineMaxColumn(i),o=new R(n,1,i,r),a=t.getValueInRange(o,0),l=e.startColumn-1,c=a.length+e.endColumn-r;return{text:a,selectionStartOffset:l,selectionEndOffset:c,editContextPrimarySelection:e}}_editContextStartPosition(){return new P(this._editContextPrimarySelection.startLineNumber,1)}_handleTextFormatUpdate(e){if(!this._editContext)return;const t=e.getTextFormats(),n=this._editContextStartPosition(),i=[];t.forEach(r=>{const o=this._context.viewModel.model,a=o.getOffsetAt(n),l=o.getPositionAt(a+r.rangeStart),c=o.getPositionAt(a+r.rangeEnd),d=R.fromPositions(l,c),h=r.underlineThickness.toLowerCase();let u=i1.NONE;switch(h){case"thin":u=i1.SECONDARY;break;case"thick":u=i1.PRIMARY;break}i.push({range:d,options:{description:"textFormatDecoration",inlineClassName:u}})}),this._decorations=this._context.viewModel.model.deltaDecorations(this._decorations,i)}_updateSelectionAndControlBounds(e){if(!this._parent)return;const n=this._context.configuration.options.get(165).contentLeft,i=this._parent.getBoundingClientRect(),r=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection),o=this._context.viewLayout.getVerticalOffsetForLineNumber(r.startLineNumber),a=i.top+o-this._scrollTop,c=this._context.viewLayout.getVerticalOffsetAfterLineNumber(r.endLineNumber)-o;let d=i.left+n-this._scrollLeft,h;if(this._primarySelection.isEmpty()){const f=e.visibleRangeForPosition(r.getStartPosition());f&&(d+=f.left),h=0}else h=i.width-n;const u=new DOMRect(d,a,h,c);this._editContext.updateSelectionBounds(u),this._editContext.updateControlBounds(u)}_updateCharacterBounds(e){if(!this._parent)return;const t=this._context.configuration.options,n=t.get(59).typicalHalfwidthCharacterWidth,i=t.get(165).contentLeft,r=this._parent.getBoundingClientRect(),o=[],a=new UC(this._editContext.text);for(let l=e.rangeStart;l<e.rangeEnd;l++){const c=a.getPosition(l),d=this._editContextPrimarySelection.startLineNumber-1,h=new P(d+c.lineNumber,c.column),u=h.delta(0,1),f=R.fromPositions(h,u),g=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(f),p=this._visibleRangeProvider.linesVisibleRangesForRange(g,!0)??[],m=g.startLineNumber,b=this._context.viewLayout.getVerticalOffsetForLineNumber(m),w=r.top+b-this._scrollTop;let C=0,v=n;if(p.length>0)for(const k of p[0].ranges){C=k.left,v=k.width;break}const S=this._context.viewLayout.getLineHeightForLineNumber(m);o.push(new DOMRect(r.left+i+C-this._scrollLeft,w,v,S))}this._editContext.updateCharacterBounds(e.rangeStart,o)}_ensureClipboardGetsEditorSelection(e){const t=this._context.configuration.options,n=t.get(45),i=t.get(31),r=this._context.viewModel.getCursorStates().map(c=>c.modelState.selection),o=oB(this._context.viewModel,r,n,i);let a;this.logService.getLevel()===zn.Trace&&(a=eT());const l={version:1,id:a,isFromEmptySelection:o.isFromEmptySelection,multicursorText:o.multicursorText,mode:o.mode};$h.INSTANCE.set(Rs?o.text.replace(/\r\n/g,`
|
|
347
|
-
`):o.text,l),e.preventDefault(),e.clipboardData&&Sv.setTextData(e.clipboardData,o.text,o.html,l),this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",a," with text.length: ",o.text.length)}};Uv=Bme([uV(5,Xe),uV(6,ji)],Uv);class Vme extends Gi{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register(Ke(n=>this._updateEntries(n)))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){const t=this._context.configuration.options,n=t.get(116),i=t.get(59).typicalHalfwidthCharacterWidth,r=this._viewGpuContext.devicePixelRatio.read(e);for(let o=0,a=n.length;o<a;o++){const l=n[o],c=this._gpuShapes[o],d=l.color?q.fromHex(l.color):this._context.theme.getColor(Ige)??q.white,h=[l.column*i*r,0,Math.max(1,Math.ceil(r)),Number.MAX_SAFE_INTEGER,d.rgba.r/255,d.rgba.g/255,d.rgba.b/255,d.rgba.a];c?c.setRaw(h):this._gpuShapes[o]=this._viewGpuContext.rectangleRenderer.register(...h)}for(;this._gpuShapes.length>n.length;)this._gpuShapes.splice(-1,1)[0].dispose()}}const Nx=class Nx extends cd{constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return!0}prepareRender(e){const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,i=e.viewportData,r=new Ov(this._context.configuration,this._context.theme.type),o=[];for(let a=t;a<=n;a++){const l=a-t,c=this._viewGpuContext.canRenderDetailed(r,i,a);o[l]=c.length?`<div class="${Nx.CLASS_NAME}" title="Cannot render on GPU: ${c.join(", ")}"></div>`:""}this._renderResult=o}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}};Nx.CLASS_NAME="gpu-mark";let WT=Nx;var Wme=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Hme=function(s,e){return function(t,n){e(t,n,s)}};let HT=class extends Wh{constructor(e,t,n,i,r,o,a,l,c){super(),this._instantiationService=c,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new zme(e,l)),this._register(this._widgetFocusTracker.onChange(()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())})),this._selections=[new Ae(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=et(document.createElement("div")),Ro.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new rge(i,o,a,n),this._context=new Hpe(i,r,o),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(170),this._accessibilitySupport=this._context.configuration.options.get(2),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=et(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=et(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._context.configuration.options.get(46)==="on"&&(this._viewGpuContext=this._instantiationService.createInstance(Ir,this._context)),this._scrollbar=new tpe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new CT(this._context,this._viewGpuContext,this._linesContent),this._viewGpuContext&&(this._viewLinesGpu=this._instantiationService.createInstance(DT,this._context,this._viewGpuContext)),this._viewZones=new Ppe(this._context),this._viewParts.push(this._viewZones);const d=new Epe(this._context);this._viewParts.push(d);const h=new Ipe(this._context);this._viewParts.push(h);const u=new age(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Qge(this._context)),u.addDynamicOverlay(new yT(this._context)),u.addDynamicOverlay(new dpe(this._context)),u.addDynamicOverlay(new epe(this._context)),u.addDynamicOverlay(new Bpe(this._context));const f=new lge(this._context);this._viewParts.push(f),f.addDynamicOverlay(new Jge(this._context)),f.addDynamicOverlay(new ppe(this._context)),f.addDynamicOverlay(new gpe(this._context)),f.addDynamicOverlay(new Av(this._context)),this._viewGpuContext&&f.addDynamicOverlay(new WT(this._context,this._viewGpuContext)),this._glyphMarginWidgets=new spe(this._context),this._viewParts.push(this._glyphMarginWidgets);const g=new Pv(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(f.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new dge(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ST(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Lpe(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=this._viewGpuContext?new Vme(this._context,this._viewGpuContext):new Tpe(this._context);this._viewParts.push(p);const m=new cge(this._context);this._viewParts.push(m);const b=new xpe(this._context);if(this._viewParts.push(b),d){const w=this._scrollbar.getOverviewRulerLayoutInfo();w.parent.insertBefore(d.getDomNode(),w.insertBefore)}this._linesContent.appendChild(u.getDomNode()),"domNode"in p&&this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._viewGpuContext&&this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(b.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),l?(l.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),l.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new Efe(this._context,this._viewController,this._createPointerHandlerHelper()))}_instantiateEditContext(){return this._context.configuration.options.get(170)?this._instantiationService.createInstance(Uv,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper()):this._instantiationService.createInstance(MT,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper())}_updateEditContext(){const e=this._context.configuration.options.get(170),t=this._context.configuration.options.get(2);if(this._editContextEnabled===e&&this._accessibilitySupport===t)return;this._editContextEnabled=e,this._accessibilitySupport=t;const n=this._editContext.isFocused(),i=this._viewParts.indexOf(this._editContext);this._editContext.dispose(),this._editContext=this._instantiateEditContext(),n&&this._editContext.focus(),i!==-1&&this._viewParts.splice(i,1,this._editContext)}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let n=[],i=0;n=n.concat(e.getAllMarginDecorations().map(r=>{const o=r.options.glyphMargin?.position??Zc.Center;return i=Math.max(i,r.range.endLineNumber),{range:r.range,lane:o,persist:r.options.glyphMargin?.persistLane}})),n=n.concat(this._glyphMarginWidgets.getWidgets().map(r=>{const o=e.validateRange(r.preference.range);return i=Math.max(i,o.endLineNumber),{range:o,lane:r.preference.lane}})),n.sort((r,o)=>R.compareRangesUsingStarts(r.range,o.range)),t.reset(i);for(const r of n)t.push(r.lane,r.range,r.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,viewLinesGpu:this._viewLinesGpu,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._editContext.domNode.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._editContext.getLastRenderData();return new Que(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>{this._flushAccumulatedAndRenderNow();const n=new P(e,t);return this._viewLines.visibleRangeForPosition(n)??this._viewLinesGpu?.visibleRangeForPosition(n)??null},getLineWidth:e=>{if(this._flushAccumulatedAndRenderNow(),this._viewLinesGpu){const t=this._viewLinesGpu.getLineWidth(e);if(t!==void 0)return t}return this._viewLines.getLineWidth(e)}}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e)),linesVisibleRangesForRange:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.linesVisibleRangesForRange(e,t))}}_applyLayout(){const t=this._context.configuration.options.get(165);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._editContext.isFocused()?" focused":"";return this._context.configuration.options.get(162)+" "+pT(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._updateEditContext(),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewGpuContext?.dispose(),this._viewLines.dispose(),this._viewLinesGpu?.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new we;if(this._renderAnimationFrame===null){this._editContext instanceof Uv&&this._editContext.setEditContextOnDomNode();const e=this._createCoordinatedRendering();this._renderAnimationFrame=zT.INSTANCE.scheduleCoordinatedRendering({window:pe(this.domNode?.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new we;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new we;return e.renderText()},prepareRender:(t,n)=>{if(this._store.isDisposed)throw new we;return e.prepareRender(t,n)},render:(t,n)=>{if(this._store.isDisposed)throw new we;return e.render(t,n)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();hd(()=>e.prepareRenderText());const t=hd(()=>e.renderText());if(t){const[n,i]=t;hd(()=>e.prepareRender(n,i)),hd(()=>e.render(n,i))}}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}nd.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const n=new Vpe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),this._viewLinesGpu?.shouldRender()&&(this._viewLinesGpu.renderText(n),this._viewLinesGpu.onDidRender()),[e,new que(this._context.viewLayout,n,this._viewLines,this._viewLinesGpu)]},prepareRender:(e,t)=>{for(const n of e)n.prepareRender(t)},render:(e,t)=>{for(const n of e)n.render(t),n.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),i=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const r=this._viewLines.visibleRangeForPosition(new P(i.lineNumber,i.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?Mv.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Dpe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._editContext.writeScreenReaderContent(e)}focus(){this._editContext.focus()}isFocused(){return this._editContext.isFocused()}isWidgetFocused(){return this._widgetFocusTracker.hasFocus()}setAriaOptions(e){this._editContext.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};HT=Wme([Hme(8,Xe)],HT);function hd(s){try{return s()}catch(e){return dt(e),null}}const Dx=class Dx{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[n,i]of this._animationFrameRunners)i.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,o9(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const n of e)hd(()=>n.prepareRenderText());const t=[];for(let n=0,i=e.length;n<i;n++){const r=e[n];t[n]=hd(()=>r.renderText())}for(let n=0,i=e.length;n<i;n++){const r=e[n],o=t[n];if(!o)continue;const[a,l]=o;hd(()=>r.prepareRender(a,l))}for(let n=0,i=e.length;n<i;n++){const r=e[n],o=t[n];if(!o)continue;const[a,l]=o;hd(()=>r.render(a,l))}}};Dx.INSTANCE=new Dx;let zT=Dx;class zme extends U{constructor(e,t){super(),this._onChange=this._register(new A),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Xf(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Xf(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}}class s1{constructor(e,t,n,i,r){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=n,this.breakOffsetsVisibleColumn=i,this.wrappedTextIndentLength=r}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let r=0;r<this.injectionOffsets.length&&i>this.injectionOffsets[r];r++)i<this.injectionOffsets[r]+this.injectionOptions[r].content.length?i=this.injectionOffsets[r]:i-=this.injectionOptions[r].content.length;return i}translateToOutputPosition(e,t=2){let n=e;if(this.injectionOffsets!==null)for(let i=0;i<this.injectionOffsets.length&&!(e<this.injectionOffsets[i]||t!==1&&e===this.injectionOffsets[i]);i++)n+=this.injectionOptions[i].content.length;return this.offsetInInputWithInjectionsToOutputPosition(n,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let n=0,i=this.breakOffsets.length-1,r=0,o=0;for(;n<=i;){r=n+(i-n)/2|0;const l=this.breakOffsets[r];if(o=r>0?this.breakOffsets[r-1]:0,t===0)if(e<=o)i=r-1;else if(e>l)n=r+1;else break;else if(e<o)i=r-1;else if(e>=l)n=r+1;else break}let a=e-o;return r>0&&(a+=this.wrappedTextIndentLength),new jv(r,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const i=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(i,n);if(r!==i)return this.offsetInInputWithInjectionsToOutputPosition(r,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new jv(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const i=this.getOutputLineCount()-1;if(e<i&&t===this.getMaxOutputOffset(e))return new jv(e+1,this.getMinOutputOffset(e+1))}return new jv(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&fV(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let i=n.offsetInInputWithInjections;if(gV(this.injectionOptions[n.injectedTextIndex].cursorStops))return i;let r=n.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[n.injectedTextIndex]&&!(fV(this.injectionOptions[r].cursorStops)||(i-=this.injectionOptions[r].content.length,gV(this.injectionOptions[r].cursorStops)));)r--;return i}}else if(t===1||t===4){let i=n.offsetInInputWithInjections+n.length,r=n.injectedTextIndex;for(;r+1<this.injectionOffsets.length&&this.injectionOffsets[r+1]===this.injectionOffsets[r];)i+=this.injectionOptions[r+1].content.length,r++;return i}else if(t===0||t===3){let i=n.offsetInInputWithInjections,r=n.injectedTextIndex;for(;r-1>=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)i-=this.injectionOptions[r-1].content.length,r--;return i}rE()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),i=this.getInjectedTextAtOffset(n);return i?{options:this.injectionOptions[i.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let i=0;for(let r=0;r<t.length;r++){const o=n[r].content.length,a=t[r]+i,l=t[r]+i+o;if(a>e)break;if(e<=l)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:o};i+=o}}}}function fV(s){return s==null?!0:s===cg.Right||s===cg.Both}function gV(s){return s==null?!0:s===cg.Left||s===cg.Both}class jv{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new P(e+this.outputLineIndex,this.outputOffset+1)}}class $me{constructor(){this.changeType=1}}class Oo{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",i=0;for(const r of t)n+=e.substring(i,r.column-1),i=r.column-1,n+=r.options.content;return n+=e.substring(i),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new Oo(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new Oo(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,i)=>n.lineNumber===i.lineNumber?n.column===i.column?n.order-i.order:n.column-i.column:n.lineNumber-i.lineNumber),t}constructor(e,t,n,i,r){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=i,this.order=r}}class pV{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class Ume{constructor(e,t,n,i){this.ownerId=e,this.decorationId=t,this.lineNumber=n,this.lineHeight=i}}class jme{constructor(e,t){this.ownerId=e,this.lineNumber=t}}class Kme{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class qme{constructor(e,t,n,i){this.changeType=4,this.injectedTexts=i,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class Gme{constructor(){this.changeType=5}}class Wg{constructor(e,t,n,i){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=i,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;t<n;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const n=[].concat(e.changes).concat(t.changes),i=t.versionId,r=e.isUndoing||t.isUndoing,o=e.isRedoing||t.isRedoing;return new Wg(n,i,r,o)}}class mV{constructor(e){this.changes=e}}let _V=class{constructor(e){this.changes=e}},bV=class{constructor(e){this.changes=e}};class nu{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=Wg.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),n=nu._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new nu(t,n)}static _mergeChangeEvents(e,t){const n=[].concat(e.changes).concat(t.changes),i=t.eol,r=t.versionId,o=e.isUndoing||t.isUndoing,a=e.isRedoing||t.isRedoing,l=e.isFlush||t.isFlush,c=e.isEolChange&&t.isEolChange;return{changes:n,eol:i,isEolChange:c,versionId:r,isUndoing:o,isRedoing:a,isFlush:l,detailedReasons:e.detailedReasons.concat(t.detailedReasons),detailedReasonsChangeLengths:e.detailedReasonsChangeLengths.concat(t.detailedReasonsChangeLengths)}}}const Yme=Gc("domLineBreaksComputer",{createHTML:s=>s});class $T{static create(e){return new $T(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,n,i,r,o){const a=[],l=[];return{addRequest:(c,d,h)=>{a.push(c),l.push(d)},finalize:()=>Xme(N7(this.targetWindow.deref()),a,e,t,n,i,r,l)}}}function Xme(s,e,t,n,i,r,o,a){function l(N){const M=a[N];if(M){const O=Oo.applyInjectedText(e[N],M),I=M.map(W=>W.options),F=M.map(W=>W.column-1);return new s1(F,I,[O.length],[],0)}else return null}if(i===-1){const N=[];for(let M=0,O=e.length;M<O;M++)N[M]=l(M);return N}const c=Math.round(i*t.typicalHalfwidthCharacterWidth),h=Math.round(n*(r===3?2:r===2?1:0)),u=Math.ceil(t.spaceWidth*h),f=document.createElement("div");ri(f,t);const g=new tg(1e4),p=[],m=[],b=[],w=[],C=[];for(let N=0;N<e.length;N++){const M=Oo.applyInjectedText(e[N],a[N]);let O=0,I=0,F=c;if(r!==0)if(O=Ms(M),O===-1)O=0;else{for(let Y=0;Y<O;Y++){const Q=M.charCodeAt(Y)===9?n-I%n:1;I+=Q}const G=Math.ceil(t.spaceWidth*I);G+t.typicalFullwidthCharacterWidth>c?(O=0,I=0):F=c-G}const W=M.substr(O),z=Zme(W,I,n,F,g,u);p[N]=O,m[N]=I,b[N]=W,w[N]=z[0],C[N]=z[1]}const v=g.build(),S=Yme?.createHTML(v)??v;f.innerHTML=S,f.style.position="absolute",f.style.top="10000",o==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),s.document.body.appendChild(f);const k=document.createRange(),L=Array.prototype.slice.call(f.children,0),E=[];for(let N=0;N<e.length;N++){const M=L[N],O=Qme(k,M,b[N],w[N]);if(O===null){E[N]=l(N);continue}const I=p[N],F=m[N]+h,W=C[N],z=[];for(let oe=0,me=O.length;oe<me;oe++)z[oe]=W[O[oe]];if(I!==0)for(let oe=0,me=O.length;oe<me;oe++)O[oe]+=I;let G,Y;const Q=a[N];Q?(G=Q.map(oe=>oe.options),Y=Q.map(oe=>oe.column-1)):(G=null,Y=null),E[N]=new s1(Y,G,O,z,F)}return f.remove(),E}function Zme(s,e,t,n,i,r){if(r!==0){const u=String(r);i.appendString('<div style="text-indent: -'),i.appendString(u),i.appendString("px; padding-left: "),i.appendString(u),i.appendString("px; box-sizing: border-box; width:")}else i.appendString('<div style="width:');i.appendString(String(n)),i.appendString('px;">');const o=s.length;let a=e,l=0;const c=[],d=[];let h=0<o?s.charCodeAt(0):0;i.appendString("<span>");for(let u=0;u<o;u++){u!==0&&u%16384===0&&i.appendString("</span><span>"),c[u]=l,d[u]=a;const f=h;h=u+1<o?s.charCodeAt(u+1):0;let g=1,p=1;switch(f){case 9:g=t-a%t,p=g;for(let m=1;m<=g;m++)m<g?i.appendCharCode(160):i.appendASCIICharCode(32);break;case 32:h===32?i.appendCharCode(160):i.appendASCIICharCode(32);break;case 60:i.appendString("<");break;case 62:i.appendString(">");break;case 38:i.appendString("&");break;case 0:i.appendString("�");break;case 65279:case 8232:case 8233:case 133:i.appendCharCode(65533);break;default:zc(f)&&p++,f<32?i.appendCharCode(9216+f):i.appendCharCode(f)}l+=g,a+=p}return i.appendString("</span>"),c[s.length]=l,d[s.length]=a,i.appendString("</div>"),[c,d]}function Qme(s,e,t,n){if(t.length<=1)return null;const i=Array.prototype.slice.call(e.children,0),r=[];try{UT(s,i,n,0,null,t.length-1,null,r)}catch(o){return console.log(o),null}return r.length===0?null:(r.push(t.length),r)}function UT(s,e,t,n,i,r,o,a){if(n===r||(i=i||jT(s,e,t[n],t[n+1]),o=o||jT(s,e,t[r],t[r+1]),Math.abs(i[0].top-o[0].top)<=.1))return;if(n+1===r){a.push(r);return}const l=n+(r-n)/2|0,c=jT(s,e,t[l],t[l+1]);UT(s,e,t,n,i,l,c,a),UT(s,e,t,l,c,r,o,a)}function jT(s,e,t,n){return s.setStart(e[t/16384|0].firstChild,t%16384),s.setEnd(e[n/16384|0].firstChild,n%16384),s.getClientRects()}class Jme extends U{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new bE),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,n){this._editor=e,this._instantiationService=n;for(const i of t){if(this._pending.has(i.id)){dt(new Error(`Cannot have two contributions with the same id ${i.id}`));continue}this._pending.set(i.id,i)}this._instantiateSome(0),this._register(cC(pe(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(cC(pe(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(cC(pe(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){return cC(pe(this._editor?.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){dt(n)}}}}class wV{constructor(e,t,n,i,r,o,a){this.id=e,this.label=t,this.alias=n,this.metadata=i,this._precondition=r,this._run=o,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Hg(s){let e=0,t=0,n=0,i=0;for(let r=0,o=s.length;r<o;r++){const a=s.charCodeAt(r);a===13?(e===0&&(t=r),e++,r+1<o&&s.charCodeAt(r+1)===10?(i|=2,r++):i|=3,n=r+1):a===10&&(i|=1,e===0&&(t=r),e++,n=r+1)}return e===0&&(t=s.length),[e,t,s.length-n,i]}class CV{constructor(e,t,n,i){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=n,this.isInvalid=i}}class e_e{constructor(e,t,n,i,r,o){this.range=e,this.openingBracketRange=t,this.closingBracketRange=n,this.nestingLevel=i,this.nestingLevelOfEqualBracketType=r,this.bracketPairNode=o}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class t_e extends e_e{constructor(e,t,n,i,r,o,a){super(e,t,n,i,r,o),this.minVisibleColumnIndentation=a}}function n_e(s,e,t,n){return s!==t?ln(t-s,n):ln(0,n-e)}const _s=0;function Kv(s){return s===0}const rr=2**26;function ln(s,e){return s*rr+e}function Mr(s){const e=s,t=Math.floor(e/rr),n=e-t*rr;return new As(t,n)}function i_e(s){return Math.floor(s/rr)}function HTe(s){return s}function Cn(s,e){let t=s+e;return e>=rr&&(t=t-s%rr),t}function s_e(s,e){return s.reduce((t,n)=>Cn(t,e(n)),_s)}function vV(s,e){return s===e}function r1(s,e){const t=s,n=e;if(n-t<=0)return _s;const r=Math.floor(t/rr),o=Math.floor(n/rr),a=n-o*rr;if(r===o){const l=t-r*rr;return ln(0,a-l)}else return ln(o-r,a)}function zg(s,e){return s<e}function $g(s,e){return s<=e}function o1(s,e){return s>=e}function Ug(s){return ln(s.lineNumber-1,s.column-1)}function iu(s,e){const t=s,n=Math.floor(t/rr),i=t-n*rr,r=e,o=Math.floor(r/rr),a=r-o*rr;return new R(n+1,i+1,o+1,a+1)}function r_e(s){const e=Wf(s);return ln(e.length-1,e[e.length-1].length)}class Pl{static fromModelContentChanges(e){return e.map(n=>{const i=R.lift(n.range);return new Pl(Ug(i.getStartPosition()),Ug(i.getEndPosition()),r_e(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${Mr(this.startOffset)}...${Mr(this.endOffset)}) -> ${Mr(this.newLength)}`}}class o_e{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>KT.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:r1(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ln(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ln(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Mr(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ln(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ln(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],n=this.translateOldToCur(t.endOffsetAfterObj);if($g(n,e)){this.nextEditIdx++;const i=Mr(n),r=Mr(this.translateOldToCur(t.endOffsetBeforeObj)),o=i.lineCount-r.lineCount;this.deltaOldToNewLineCount+=o;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=i.columnCount-r.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class KT{static from(e){return new KT(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,n){this.endOffsetBeforeObj=Mr(t),this.endOffsetAfterObj=Mr(Cn(e,n)),this.offsetObj=Mr(e)}}const qv=[],Wr=class Wr{static create(e,t){if(e<=128&&t.length===0){let n=Wr.cache[e];return n||(n=new Wr(e,t),Wr.cache[e]=n),n}return new Wr(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const n=t.getKey(e);let i=n>>5;if(i===0){const o=1<<n|this.items;return o===this.items?this:Wr.create(o,this.additionalItems)}i--;const r=this.additionalItems.slice(0);for(;r.length<i;)r.push(0);return r[i]|=1<<(n&31),Wr.create(this.items,r)}merge(e){const t=this.items|e.items;if(this.additionalItems===qv&&e.additionalItems===qv)return t===this.items?this:t===e.items?e:Wr.create(t,qv);const n=[];for(let i=0;i<Math.max(this.additionalItems.length,e.additionalItems.length);i++){const r=this.additionalItems[i]||0,o=e.additionalItems[i]||0;n.push(r|o)}return Wr.create(t,n)}intersects(e){if((this.items&e.items)!==0)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if((this.additionalItems[t]&e.additionalItems[t])!==0)return!0;return!1}};Wr.cache=new Array(129),Wr.empty=Wr.create(0,qv);let Bs=Wr;const yV={getKey(s){return s}};class a_e{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}}class qT{get length(){return this._length}constructor(e){this._length=e}}class a1 extends qT{static create(e,t,n){let i=e.length;return t&&(i=Cn(i,t.length)),n&&(i=Cn(i,n.length)),new a1(i,e,t,n,t?t.missingOpeningBracketIds:Bs.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,n,i,r){super(e),this.openingBracket=t,this.child=n,this.closingBracket=i,this.missingOpeningBracketIds=r}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new a1(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Cn(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class _a extends qT{static create23(e,t,n,i=!1){let r=e.length,o=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(r=Cn(r,t.length),o=o.merge(t.missingOpeningBracketIds),n){if(e.listHeight!==n.listHeight)throw new Error("Invalid list heights");r=Cn(r,n.length),o=o.merge(n.missingOpeningBracketIds)}return i?new l_e(r,e.listHeight+1,e,t,n,o):new l1(r,e.listHeight+1,e,t,n,o)}static getEmpty(){return new c_e(_s,0,[],Bs.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,n){super(e),this.listHeight=t,this._missingOpeningBracketIds=n,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const t=this.getChild(e-1),n=t.kind===4?t.toMutable():t;return t!==n&&this.setChild(e-1,n),n}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const t=this.getChild(0),n=t.kind===4?t.toMutable():t;return t!==n&&this.setChild(0,n),n}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let t=this;for(;t.kind===4;){const n=t.childrenLength;if(n===0)throw new we;t=t.getChild(n-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,n=this.getChild(0).missingOpeningBracketIds;for(let i=1;i<e;i++){const r=this.getChild(i);t=Cn(t,r.length),n=n.merge(r.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=n,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let n=Number.MAX_SAFE_INTEGER,i=e;for(let r=0;r<this.childrenLength;r++){const o=this.getChild(r);o&&(n=Math.min(n,o.computeMinIndentation(i,t)),i=Cn(i,o.length))}return this.cachedMinIndentation=n,n}}class l1 extends _a{get childrenLength(){return this._item3!==null?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,n,i,r,o){super(e,t,o),this._item1=n,this._item2=i,this._item3=r}deepClone(){return new l1(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class l_e extends l1{toMutable(){return new l1(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class Gv extends _a{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,n,i){super(e,t,i),this._children=n}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new Gv(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class c_e extends Gv{toMutable(){return new Gv(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const d_e=[];class GT extends qT{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return d_e}deepClone(){return this}}class su extends GT{get kind(){return 0}get missingOpeningBracketIds(){return Bs.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const n=Mr(e),i=(n.columnCount===0?n.lineCount:n.lineCount+1)+1,r=i_e(Cn(e,this.length))+1;let o=Number.MAX_SAFE_INTEGER;for(let a=i;a<=r;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const d=Ht.visibleColumnFromColumn(c,l,t.getOptions().tabSize);o=Math.min(o,d)}return o}}class Yv extends GT{static create(e,t,n){return new Yv(e,t,n)}get kind(){return 1}get missingOpeningBracketIds(){return Bs.getEmpty()}constructor(e,t,n){super(e),this.bracketInfo=t,this.bracketIds=n}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class h_e extends GT{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class ud{constructor(e,t,n,i,r){this.length=e,this.kind=t,this.bracketId=n,this.bracketIds=i,this.astNode=r}}class u_e{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new f_e(this.textModel,this.bracketTokens),this._offset=_s,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return ln(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Cn(this._offset,e);const t=Mr(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Cn(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class f_e{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const r=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=r.length,r}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let n=0;for(;;){const r=this.lineTokens,o=r.getCount();let a=null;if(this.lineTokenOffset<o){const l=r.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&l===r.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=nr.getTokenType(l)===0,d=nr.containsBalancedBrackets(l),h=r.getEndOffset(this.lineTokenOffset);if(d&&c&&this.lineCharOffset<h){const u=r.getLanguageId(this.lineTokenOffset),f=this.line.substring(this.lineCharOffset,h),g=this.bracketTokens.getSingleLanguageBracketTokens(u),p=g.regExpGlobal;if(p){p.lastIndex=0;const m=p.exec(f);m&&(a=g.getToken(m[0]),a&&(this.lineCharOffset+=m.index))}}if(n+=h-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=h}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,n+=33,n>1e3))break;if(n>1500)break}const i=n_e(e,t,this.lineIdx,this.lineCharOffset);return new ud(i,0,-1,Bs.getEmpty(),new su(i))}}class g_e{constructor(e,t){this.text=e,this._offset=_s,this.idx=0;const n=t.getRegExpStr(),i=n?new RegExp(n+`|
|
|
347
|
+
`):o.text,l),e.preventDefault(),e.clipboardData&&Sv.setTextData(e.clipboardData,o.text,o.html,l),this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",a," with text.length: ",o.text.length)}};Uv=Bme([uV(5,Xe),uV(6,ji)],Uv);class Vme extends Gi{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register(Ke(n=>this._updateEntries(n)))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){const t=this._context.configuration.options,n=t.get(116),i=t.get(59).typicalHalfwidthCharacterWidth,r=this._viewGpuContext.devicePixelRatio.read(e);for(let o=0,a=n.length;o<a;o++){const l=n[o],c=this._gpuShapes[o],d=l.color?q.fromHex(l.color):this._context.theme.getColor(Ige)??q.white,h=[l.column*i*r,0,Math.max(1,Math.ceil(r)),Number.MAX_SAFE_INTEGER,d.rgba.r/255,d.rgba.g/255,d.rgba.b/255,d.rgba.a];c?c.setRaw(h):this._gpuShapes[o]=this._viewGpuContext.rectangleRenderer.register(...h)}for(;this._gpuShapes.length>n.length;)this._gpuShapes.splice(-1,1)[0].dispose()}}const Nx=class Nx extends cd{constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return!0}prepareRender(e){const t=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,i=e.viewportData,r=new Ov(this._context.configuration,this._context.theme.type),o=[];for(let a=t;a<=n;a++){const l=a-t,c=this._viewGpuContext.canRenderDetailed(r,i,a);o[l]=c.length?`<div class="${Nx.CLASS_NAME}" title="Cannot render on GPU: ${c.join(", ")}"></div>`:""}this._renderResult=o}render(e,t){if(!this._renderResult)return"";const n=t-e;return n<0||n>=this._renderResult.length?"":this._renderResult[n]}};Nx.CLASS_NAME="gpu-mark";let WT=Nx;var Wme=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Hme=function(s,e){return function(t,n){e(t,n,s)}};let HT=class extends Wh{constructor(e,t,n,i,r,o,a,l,c){super(),this._instantiationService=c,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new zme(e,l)),this._register(this._widgetFocusTracker.onChange(()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())})),this._selections=[new Ae(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=et(document.createElement("div")),Ro.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new rge(i,o,a,n),this._context=new Hpe(i,r,o),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(170),this._accessibilitySupport=this._context.configuration.options.get(2),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=et(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=et(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._context.configuration.options.get(46)==="on"&&(this._viewGpuContext=this._instantiationService.createInstance(Ir,this._context)),this._scrollbar=new tpe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new CT(this._context,this._viewGpuContext,this._linesContent),this._viewGpuContext&&(this._viewLinesGpu=this._instantiationService.createInstance(DT,this._context,this._viewGpuContext)),this._viewZones=new Ppe(this._context),this._viewParts.push(this._viewZones);const d=new Epe(this._context);this._viewParts.push(d);const h=new Ipe(this._context);this._viewParts.push(h);const u=new age(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Qge(this._context)),u.addDynamicOverlay(new yT(this._context)),u.addDynamicOverlay(new dpe(this._context)),u.addDynamicOverlay(new epe(this._context)),u.addDynamicOverlay(new Bpe(this._context));const f=new lge(this._context);this._viewParts.push(f),f.addDynamicOverlay(new Jge(this._context)),f.addDynamicOverlay(new ppe(this._context)),f.addDynamicOverlay(new gpe(this._context)),f.addDynamicOverlay(new Av(this._context)),this._viewGpuContext&&f.addDynamicOverlay(new WT(this._context,this._viewGpuContext)),this._glyphMarginWidgets=new spe(this._context),this._viewParts.push(this._glyphMarginWidgets);const g=new Pv(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(f.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new dge(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new ST(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Lpe(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=this._viewGpuContext?new Vme(this._context,this._viewGpuContext):new Tpe(this._context);this._viewParts.push(p);const m=new cge(this._context);this._viewParts.push(m);const b=new xpe(this._context);if(this._viewParts.push(b),d){const w=this._scrollbar.getOverviewRulerLayoutInfo();w.parent.insertBefore(d.getDomNode(),w.insertBefore)}this._linesContent.appendChild(u.getDomNode()),"domNode"in p&&this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._viewGpuContext&&this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(b.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),l?(l.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),l.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new Efe(this._context,this._viewController,this._createPointerHandlerHelper()))}_instantiateEditContext(){return this._context.configuration.options.get(170)?this._instantiationService.createInstance(Uv,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper()):this._instantiationService.createInstance(MT,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper())}_updateEditContext(){const e=this._context.configuration.options.get(170),t=this._context.configuration.options.get(2);if(this._editContextEnabled===e&&this._accessibilitySupport===t)return;this._editContextEnabled=e,this._accessibilitySupport=t;const n=this._editContext.isFocused(),i=this._viewParts.indexOf(this._editContext);this._editContext.dispose(),this._editContext=this._instantiateEditContext(),n&&this._editContext.focus(),i!==-1&&this._viewParts.splice(i,1,this._editContext)}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let n=[],i=0;n=n.concat(e.getAllMarginDecorations().map(r=>{const o=r.options.glyphMargin?.position??Zc.Center;return i=Math.max(i,r.range.endLineNumber),{range:r.range,lane:o,persist:r.options.glyphMargin?.persistLane}})),n=n.concat(this._glyphMarginWidgets.getWidgets().map(r=>{const o=e.validateRange(r.preference.range);return i=Math.max(i,o.endLineNumber),{range:o,lane:r.preference.lane}})),n.sort((r,o)=>R.compareRangesUsingStarts(r.range,o.range)),t.reset(i);for(const r of n)t.push(r.lane,r.range,r.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,viewLinesGpu:this._viewLinesGpu,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._editContext.domNode.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._editContext.getLastRenderData();return new Que(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>{this._flushAccumulatedAndRenderNow();const n=new P(e,t);return this._viewLines.visibleRangeForPosition(n)??this._viewLinesGpu?.visibleRangeForPosition(n)??null},getLineWidth:e=>{if(this._flushAccumulatedAndRenderNow(),this._viewLinesGpu){const t=this._viewLinesGpu.getLineWidth(e);if(t!==void 0)return t}return this._viewLines.getLineWidth(e)}}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e)),linesVisibleRangesForRange:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.linesVisibleRangesForRange(e,t))}}_applyLayout(){const t=this._context.configuration.options.get(165);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._editContext.isFocused()?" focused":"";return this._context.configuration.options.get(162)+" "+pT(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._updateEditContext(),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewGpuContext?.dispose(),this._viewLines.dispose(),this._viewLinesGpu?.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new we;if(this._renderAnimationFrame===null){this._editContext instanceof Uv&&this._editContext.setEditContextOnDomNode();const e=this._createCoordinatedRendering();this._renderAnimationFrame=zT.INSTANCE.scheduleCoordinatedRendering({window:pe(this.domNode?.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new we;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new we;return e.renderText()},prepareRender:(t,n)=>{if(this._store.isDisposed)throw new we;return e.prepareRender(t,n)},render:(t,n)=>{if(this._store.isDisposed)throw new we;return e.render(t,n)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();hd(()=>e.prepareRenderText());const t=hd(()=>e.renderText());if(t){const[n,i]=t;hd(()=>e.prepareRender(n,i)),hd(()=>e.render(n,i))}}_getViewPartsToRender(){const e=[];let t=0;for(const n of this._viewParts)n.shouldRender()&&(e[t++]=n);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}nd.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const n=new Vpe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(n),this._viewLines.shouldRender()&&(this._viewLines.renderText(n),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),this._viewLinesGpu?.shouldRender()&&(this._viewLinesGpu.renderText(n),this._viewLinesGpu.onDidRender()),[e,new que(this._context.viewLayout,n,this._viewLines,this._viewLinesGpu)]},prepareRender:(e,t)=>{for(const n of e)n.prepareRender(t)},render:(e,t)=>{for(const n of e)n.render(t),n.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const n=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),i=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);this._flushAccumulatedAndRenderNow();const r=this._viewLines.visibleRangeForPosition(new P(i.lineNumber,i.column));return r?r.left:-1}getTargetAtClientPoint(e,t){const n=this._pointerHandler.getTargetAtClientPoint(e,t);return n?Mv.convertViewToModelMouseTarget(n,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new Dpe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const n of this._viewParts)n.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._editContext.writeScreenReaderContent(e)}focus(){this._editContext.focus()}isFocused(){return this._editContext.isFocused()}isWidgetFocused(){return this._widgetFocusTracker.hasFocus()}setAriaOptions(e){this._editContext.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};HT=Wme([Hme(8,Xe)],HT);function hd(s){try{return s()}catch(e){return dt(e),null}}const Dx=class Dx{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(t!==-1&&(this._coordinatedRenderings.splice(t,1),this._coordinatedRenderings.length===0)){for(const[n,i]of this._animationFrameRunners)i.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,o9(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const n of e)hd(()=>n.prepareRenderText());const t=[];for(let n=0,i=e.length;n<i;n++){const r=e[n];t[n]=hd(()=>r.renderText())}for(let n=0,i=e.length;n<i;n++){const r=e[n],o=t[n];if(!o)continue;const[a,l]=o;hd(()=>r.prepareRender(a,l))}for(let n=0,i=e.length;n<i;n++){const r=e[n],o=t[n];if(!o)continue;const[a,l]=o;hd(()=>r.render(a,l))}}};Dx.INSTANCE=new Dx;let zT=Dx;class zme extends U{constructor(e,t){super(),this._onChange=this._register(new A),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Xf(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Xf(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}}class s1{constructor(e,t,n,i,r){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=n,this.breakOffsetsVisibleColumn=i,this.wrappedTextIndentLength=r}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let r=0;r<this.injectionOffsets.length&&i>this.injectionOffsets[r];r++)i<this.injectionOffsets[r]+this.injectionOptions[r].content.length?i=this.injectionOffsets[r]:i-=this.injectionOptions[r].content.length;return i}translateToOutputPosition(e,t=2){let n=e;if(this.injectionOffsets!==null)for(let i=0;i<this.injectionOffsets.length&&!(e<this.injectionOffsets[i]||t!==1&&e===this.injectionOffsets[i]);i++)n+=this.injectionOptions[i].content.length;return this.offsetInInputWithInjectionsToOutputPosition(n,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let n=0,i=this.breakOffsets.length-1,r=0,o=0;for(;n<=i;){r=n+(i-n)/2|0;const l=this.breakOffsets[r];if(o=r>0?this.breakOffsets[r-1]:0,t===0)if(e<=o)i=r-1;else if(e>l)n=r+1;else break;else if(e<o)i=r-1;else if(e>=l)n=r+1;else break}let a=e-o;return r>0&&(a+=this.wrappedTextIndentLength),new jv(r,a)}normalizeOutputPosition(e,t,n){if(this.injectionOffsets!==null){const i=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.normalizeOffsetInInputWithInjectionsAroundInjections(i,n);if(r!==i)return this.offsetInInputWithInjectionsToOutputPosition(r,n)}if(n===0){if(e>0&&t===this.getMinOutputOffset(e))return new jv(e-1,this.getMaxOutputOffset(e-1))}else if(n===1){const i=this.getOutputLineCount()-1;if(e<i&&t===this.getMaxOutputOffset(e))return new jv(e+1,this.getMinOutputOffset(e+1))}return new jv(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const n=this.getInjectedTextAtOffset(e);if(!n)return e;if(t===2){if(e===n.offsetInInputWithInjections+n.length&&fV(this.injectionOptions[n.injectedTextIndex].cursorStops))return n.offsetInInputWithInjections+n.length;{let i=n.offsetInInputWithInjections;if(gV(this.injectionOptions[n.injectedTextIndex].cursorStops))return i;let r=n.injectedTextIndex-1;for(;r>=0&&this.injectionOffsets[r]===this.injectionOffsets[n.injectedTextIndex]&&!(fV(this.injectionOptions[r].cursorStops)||(i-=this.injectionOptions[r].content.length,gV(this.injectionOptions[r].cursorStops)));)r--;return i}}else if(t===1||t===4){let i=n.offsetInInputWithInjections+n.length,r=n.injectedTextIndex;for(;r+1<this.injectionOffsets.length&&this.injectionOffsets[r+1]===this.injectionOffsets[r];)i+=this.injectionOptions[r+1].content.length,r++;return i}else if(t===0||t===3){let i=n.offsetInInputWithInjections,r=n.injectedTextIndex;for(;r-1>=0&&this.injectionOffsets[r-1]===this.injectionOffsets[r];)i-=this.injectionOptions[r-1].content.length,r--;return i}rE()}getInjectedText(e,t){const n=this.outputPositionToOffsetInInputWithInjections(e,t),i=this.getInjectedTextAtOffset(n);return i?{options:this.injectionOptions[i.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,n=this.injectionOptions;if(t!==null){let i=0;for(let r=0;r<t.length;r++){const o=n[r].content.length,a=t[r]+i,l=t[r]+i+o;if(a>e)break;if(e<=l)return{injectedTextIndex:r,offsetInInputWithInjections:a,length:o};i+=o}}}}function fV(s){return s==null?!0:s===cg.Right||s===cg.Both}function gV(s){return s==null?!0:s===cg.Left||s===cg.Both}class jv{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new P(e+this.outputLineIndex,this.outputOffset+1)}}class $me{constructor(){this.changeType=1}}class Oo{static applyInjectedText(e,t){if(!t||t.length===0)return e;let n="",i=0;for(const r of t)n+=e.substring(i,r.column-1),i=r.column-1,n+=r.options.content;return n+=e.substring(i),n}static fromDecorations(e){const t=[];for(const n of e)n.options.before&&n.options.before.content.length>0&&t.push(new Oo(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&t.push(new Oo(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return t.sort((n,i)=>n.lineNumber===i.lineNumber?n.column===i.column?n.order-i.order:n.column-i.column:n.lineNumber-i.lineNumber),t}constructor(e,t,n,i,r){this.ownerId=e,this.lineNumber=t,this.column=n,this.options=i,this.order=r}}class pV{constructor(e,t,n){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=n}}class Ume{constructor(e,t,n,i){this.ownerId=e,this.decorationId=t,this.lineNumber=n,this.lineHeight=i}}class jme{constructor(e,t){this.ownerId=e,this.lineNumber=t}}class Kme{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class qme{constructor(e,t,n,i){this.changeType=4,this.injectedTexts=i,this.fromLineNumber=e,this.toLineNumber=t,this.detail=n}}class Gme{constructor(){this.changeType=5}}class Wg{constructor(e,t,n,i){this.changes=e,this.versionId=t,this.isUndoing=n,this.isRedoing=i,this.resultingSelection=null}containsEvent(e){for(let t=0,n=this.changes.length;t<n;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const n=[].concat(e.changes).concat(t.changes),i=t.versionId,r=e.isUndoing||t.isUndoing,o=e.isRedoing||t.isRedoing;return new Wg(n,i,r,o)}}class mV{constructor(e){this.changes=e}}let _V=class{constructor(e){this.changes=e}},bV=class{constructor(e){this.changes=e}};class nu{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=Wg.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),n=nu._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new nu(t,n)}static _mergeChangeEvents(e,t){const n=[].concat(e.changes).concat(t.changes),i=t.eol,r=t.versionId,o=e.isUndoing||t.isUndoing,a=e.isRedoing||t.isRedoing,l=e.isFlush||t.isFlush,c=e.isEolChange&&t.isEolChange;return{changes:n,eol:i,isEolChange:c,versionId:r,isUndoing:o,isRedoing:a,isFlush:l,detailedReasons:e.detailedReasons.concat(t.detailedReasons),detailedReasonsChangeLengths:e.detailedReasonsChangeLengths.concat(t.detailedReasonsChangeLengths)}}}const Yme=Gc("domLineBreaksComputer",{createHTML:s=>s});class $T{static create(e){return new $T(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,n,i,r,o){const a=[],l=[];return{addRequest:(c,d,h)=>{a.push(c),l.push(d)},finalize:()=>Xme(N7(this.targetWindow.deref()),a,e,t,n,i,r,l)}}}function Xme(s,e,t,n,i,r,o,a){function l(N){const M=a[N];if(M){const O=Oo.applyInjectedText(e[N],M),I=M.map(W=>W.options),F=M.map(W=>W.column-1);return new s1(F,I,[O.length],[],0)}else return null}if(i===-1){const N=[];for(let M=0,O=e.length;M<O;M++)N[M]=l(M);return N}const c=Math.round(i*t.typicalHalfwidthCharacterWidth),h=Math.round(n*(r===3?2:r===2?1:0)),u=Math.ceil(t.spaceWidth*h),f=document.createElement("div");ri(f,t);const g=new tg(1e4),p=[],m=[],b=[],w=[],C=[];for(let N=0;N<e.length;N++){const M=Oo.applyInjectedText(e[N],a[N]);let O=0,I=0,F=c;if(r!==0)if(O=Ms(M),O===-1)O=0;else{for(let Y=0;Y<O;Y++){const Q=M.charCodeAt(Y)===9?n-I%n:1;I+=Q}const G=Math.ceil(t.spaceWidth*I);G+t.typicalFullwidthCharacterWidth>c?(O=0,I=0):F=c-G}const W=M.substr(O),z=Zme(W,I,n,F,g,u);p[N]=O,m[N]=I,b[N]=W,w[N]=z[0],C[N]=z[1]}const v=g.build(),S=Yme?.createHTML(v)??v;f.innerHTML=S,f.style.position="absolute",f.style.top="10000",o==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),s.document.body.appendChild(f);const k=document.createRange(),L=Array.prototype.slice.call(f.children,0),E=[];for(let N=0;N<e.length;N++){const M=L[N],O=Qme(k,M,b[N],w[N]);if(O===null){E[N]=l(N);continue}const I=p[N],F=m[N]+h,W=C[N],z=[];for(let oe=0,me=O.length;oe<me;oe++)z[oe]=W[O[oe]];if(I!==0)for(let oe=0,me=O.length;oe<me;oe++)O[oe]+=I;let G,Y;const Q=a[N];Q?(G=Q.map(oe=>oe.options),Y=Q.map(oe=>oe.column-1)):(G=null,Y=null),E[N]=new s1(Y,G,O,z,F)}return f.remove(),E}function Zme(s,e,t,n,i,r){if(r!==0){const u=String(r);i.appendString('<div style="text-indent: -'),i.appendString(u),i.appendString("px; padding-left: "),i.appendString(u),i.appendString("px; box-sizing: border-box; width:")}else i.appendString('<div style="width:');i.appendString(String(n)),i.appendString('px;">');const o=s.length;let a=e,l=0;const c=[],d=[];let h=0<o?s.charCodeAt(0):0;i.appendString("<span>");for(let u=0;u<o;u++){u!==0&&u%16384===0&&i.appendString("</span><span>"),c[u]=l,d[u]=a;const f=h;h=u+1<o?s.charCodeAt(u+1):0;let g=1,p=1;switch(f){case 9:g=t-a%t,p=g;for(let m=1;m<=g;m++)m<g?i.appendCharCode(160):i.appendASCIICharCode(32);break;case 32:h===32?i.appendCharCode(160):i.appendASCIICharCode(32);break;case 60:i.appendString("<");break;case 62:i.appendString(">");break;case 38:i.appendString("&");break;case 0:i.appendString("�");break;case 65279:case 8232:case 8233:case 133:i.appendCharCode(65533);break;default:zc(f)&&p++,f<32?i.appendCharCode(9216+f):i.appendCharCode(f)}l+=g,a+=p}return i.appendString("</span>"),c[s.length]=l,d[s.length]=a,i.appendString("</div>"),[c,d]}function Qme(s,e,t,n){if(t.length<=1)return null;const i=Array.prototype.slice.call(e.children,0),r=[];try{UT(s,i,n,0,null,t.length-1,null,r)}catch(o){return console.log(o),null}return r.length===0?null:(r.push(t.length),r)}function UT(s,e,t,n,i,r,o,a){if(n===r||(i=i||jT(s,e,t[n],t[n+1]),o=o||jT(s,e,t[r],t[r+1]),Math.abs(i[0].top-o[0].top)<=.1))return;if(n+1===r){a.push(r);return}const l=n+(r-n)/2|0,c=jT(s,e,t[l],t[l+1]);UT(s,e,t,n,i,l,c,a),UT(s,e,t,l,c,r,o,a)}function jT(s,e,t,n){return s.setStart(e[t/16384|0].firstChild,t%16384),s.setEnd(e[n/16384|0].firstChild,n%16384),s.getClientRects()}class Jme extends U{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new bE),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,n){this._editor=e,this._instantiationService=n;for(const i of t){if(this._pending.has(i.id)){dt(new Error(`Cannot have two contributions with the same id ${i.id}`));continue}this._pending.set(i.id,i)}this._instantiateSome(0),this._register(cC(pe(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(cC(pe(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(cC(pe(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,n]of this._instances)typeof n.saveViewState=="function"&&(e[t]=n.saveViewState());return e}restoreViewState(e){for(const[t,n]of this._instances)typeof n.restoreViewState=="function"&&n.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){return cC(pe(this._editor?.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const n of t)this._instantiateById(n.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,n]of this._pending)n.instantiation===e&&t.push(n);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const n=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,n),typeof n.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(n){dt(n)}}}}class wV{constructor(e,t,n,i,r,o,a){this.id=e,this.label=t,this.alias=n,this.metadata=i,this._precondition=r,this._run=o,this._contextKeyService=a}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Hg(s){let e=0,t=0,n=0,i=0;for(let r=0,o=s.length;r<o;r++){const a=s.charCodeAt(r);a===13?(e===0&&(t=r),e++,r+1<o&&s.charCodeAt(r+1)===10?(i|=2,r++):i|=3,n=r+1):a===10&&(i|=1,e===0&&(t=r),e++,n=r+1)}return e===0&&(t=s.length),[e,t,s.length-n,i]}class CV{constructor(e,t,n,i){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=n,this.isInvalid=i}}class e_e{constructor(e,t,n,i,r,o){this.range=e,this.openingBracketRange=t,this.closingBracketRange=n,this.nestingLevel=i,this.nestingLevelOfEqualBracketType=r,this.bracketPairNode=o}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class t_e extends e_e{constructor(e,t,n,i,r,o,a){super(e,t,n,i,r,o),this.minVisibleColumnIndentation=a}}function n_e(s,e,t,n){return s!==t?ln(t-s,n):ln(0,n-e)}const _s=0;function Kv(s){return s===0}const rr=2**26;function ln(s,e){return s*rr+e}function Mr(s){const e=s,t=Math.floor(e/rr),n=e-t*rr;return new As(t,n)}function i_e(s){return Math.floor(s/rr)}function zTe(s){return s}function Cn(s,e){let t=s+e;return e>=rr&&(t=t-s%rr),t}function s_e(s,e){return s.reduce((t,n)=>Cn(t,e(n)),_s)}function vV(s,e){return s===e}function r1(s,e){const t=s,n=e;if(n-t<=0)return _s;const r=Math.floor(t/rr),o=Math.floor(n/rr),a=n-o*rr;if(r===o){const l=t-r*rr;return ln(0,a-l)}else return ln(o-r,a)}function zg(s,e){return s<e}function $g(s,e){return s<=e}function o1(s,e){return s>=e}function Ug(s){return ln(s.lineNumber-1,s.column-1)}function iu(s,e){const t=s,n=Math.floor(t/rr),i=t-n*rr,r=e,o=Math.floor(r/rr),a=r-o*rr;return new R(n+1,i+1,o+1,a+1)}function r_e(s){const e=Wf(s);return ln(e.length-1,e[e.length-1].length)}class Pl{static fromModelContentChanges(e){return e.map(n=>{const i=R.lift(n.range);return new Pl(Ug(i.getStartPosition()),Ug(i.getEndPosition()),r_e(n.text))}).reverse()}constructor(e,t,n){this.startOffset=e,this.endOffset=t,this.newLength=n}toString(){return`[${Mr(this.startOffset)}...${Mr(this.endOffset)}) -> ${Mr(this.newLength)}`}}class o_e{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>KT.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],n=t?this.translateOldToCur(t.offsetObj):null;return n===null?null:r1(e,n)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ln(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ln(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Mr(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ln(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ln(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],n=this.translateOldToCur(t.endOffsetAfterObj);if($g(n,e)){this.nextEditIdx++;const i=Mr(n),r=Mr(this.translateOldToCur(t.endOffsetBeforeObj)),o=i.lineCount-r.lineCount;this.deltaOldToNewLineCount+=o;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=i.columnCount-r.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class KT{static from(e){return new KT(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,n){this.endOffsetBeforeObj=Mr(t),this.endOffsetAfterObj=Mr(Cn(e,n)),this.offsetObj=Mr(e)}}const qv=[],Wr=class Wr{static create(e,t){if(e<=128&&t.length===0){let n=Wr.cache[e];return n||(n=new Wr(e,t),Wr.cache[e]=n),n}return new Wr(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const n=t.getKey(e);let i=n>>5;if(i===0){const o=1<<n|this.items;return o===this.items?this:Wr.create(o,this.additionalItems)}i--;const r=this.additionalItems.slice(0);for(;r.length<i;)r.push(0);return r[i]|=1<<(n&31),Wr.create(this.items,r)}merge(e){const t=this.items|e.items;if(this.additionalItems===qv&&e.additionalItems===qv)return t===this.items?this:t===e.items?e:Wr.create(t,qv);const n=[];for(let i=0;i<Math.max(this.additionalItems.length,e.additionalItems.length);i++){const r=this.additionalItems[i]||0,o=e.additionalItems[i]||0;n.push(r|o)}return Wr.create(t,n)}intersects(e){if((this.items&e.items)!==0)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if((this.additionalItems[t]&e.additionalItems[t])!==0)return!0;return!1}};Wr.cache=new Array(129),Wr.empty=Wr.create(0,qv);let Bs=Wr;const yV={getKey(s){return s}};class a_e{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}}class qT{get length(){return this._length}constructor(e){this._length=e}}class a1 extends qT{static create(e,t,n){let i=e.length;return t&&(i=Cn(i,t.length)),n&&(i=Cn(i,n.length)),new a1(i,e,t,n,t?t.missingOpeningBracketIds:Bs.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,n,i,r){super(e),this.openingBracket=t,this.child=n,this.closingBracket=i,this.missingOpeningBracketIds=r}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new a1(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Cn(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class _a extends qT{static create23(e,t,n,i=!1){let r=e.length,o=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(r=Cn(r,t.length),o=o.merge(t.missingOpeningBracketIds),n){if(e.listHeight!==n.listHeight)throw new Error("Invalid list heights");r=Cn(r,n.length),o=o.merge(n.missingOpeningBracketIds)}return i?new l_e(r,e.listHeight+1,e,t,n,o):new l1(r,e.listHeight+1,e,t,n,o)}static getEmpty(){return new c_e(_s,0,[],Bs.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,n){super(e),this.listHeight=t,this._missingOpeningBracketIds=n,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const t=this.getChild(e-1),n=t.kind===4?t.toMutable():t;return t!==n&&this.setChild(e-1,n),n}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const t=this.getChild(0),n=t.kind===4?t.toMutable():t;return t!==n&&this.setChild(0,n),n}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let t=this;for(;t.kind===4;){const n=t.childrenLength;if(n===0)throw new we;t=t.getChild(n-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,n=this.getChild(0).missingOpeningBracketIds;for(let i=1;i<e;i++){const r=this.getChild(i);t=Cn(t,r.length),n=n.merge(r.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=n,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let n=Number.MAX_SAFE_INTEGER,i=e;for(let r=0;r<this.childrenLength;r++){const o=this.getChild(r);o&&(n=Math.min(n,o.computeMinIndentation(i,t)),i=Cn(i,o.length))}return this.cachedMinIndentation=n,n}}class l1 extends _a{get childrenLength(){return this._item3!==null?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,n,i,r,o){super(e,t,o),this._item1=n,this._item2=i,this._item3=r}deepClone(){return new l1(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class l_e extends l1{toMutable(){return new l1(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class Gv extends _a{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,n,i){super(e,t,i),this._children=n}deepClone(){const e=new Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new Gv(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class c_e extends Gv{toMutable(){return new Gv(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const d_e=[];class GT extends qT{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return d_e}deepClone(){return this}}class su extends GT{get kind(){return 0}get missingOpeningBracketIds(){return Bs.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const n=Mr(e),i=(n.columnCount===0?n.lineCount:n.lineCount+1)+1,r=i_e(Cn(e,this.length))+1;let o=Number.MAX_SAFE_INTEGER;for(let a=i;a<=r;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const d=Ht.visibleColumnFromColumn(c,l,t.getOptions().tabSize);o=Math.min(o,d)}return o}}class Yv extends GT{static create(e,t,n){return new Yv(e,t,n)}get kind(){return 1}get missingOpeningBracketIds(){return Bs.getEmpty()}constructor(e,t,n){super(e),this.bracketInfo=t,this.bracketIds=n}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class h_e extends GT{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class ud{constructor(e,t,n,i,r){this.length=e,this.kind=t,this.bracketId=n,this.bracketIds=i,this.astNode=r}}class u_e{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new f_e(this.textModel,this.bracketTokens),this._offset=_s,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return ln(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Cn(this._offset,e);const t=Mr(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Cn(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class f_e{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,this.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const r=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=r.length,r}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let n=0;for(;;){const r=this.lineTokens,o=r.getCount();let a=null;if(this.lineTokenOffset<o){const l=r.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&l===r.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=nr.getTokenType(l)===0,d=nr.containsBalancedBrackets(l),h=r.getEndOffset(this.lineTokenOffset);if(d&&c&&this.lineCharOffset<h){const u=r.getLanguageId(this.lineTokenOffset),f=this.line.substring(this.lineCharOffset,h),g=this.bracketTokens.getSingleLanguageBracketTokens(u),p=g.regExpGlobal;if(p){p.lastIndex=0;const m=p.exec(f);m&&(a=g.getToken(m[0]),a&&(this.lineCharOffset+=m.index))}}if(n+=h-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=h}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,n+=33,n>1e3))break;if(n>1500)break}const i=n_e(e,t,this.lineIdx,this.lineCharOffset);return new ud(i,0,-1,Bs.getEmpty(),new su(i))}}class g_e{constructor(e,t){this.text=e,this._offset=_s,this.idx=0;const n=t.getRegExpStr(),i=n?new RegExp(n+`|
|
|
348
348
|
`,"gi"):null,r=[];let o,a=0,l=0,c=0,d=0;const h=[];for(let g=0;g<60;g++)h.push(new ud(ln(0,g),0,-1,Bs.getEmpty(),new su(ln(0,g))));const u=[];for(let g=0;g<60;g++)u.push(new ud(ln(1,g),0,-1,Bs.getEmpty(),new su(ln(1,g))));if(i)for(i.lastIndex=0;(o=i.exec(e))!==null;){const g=o.index,p=o[0];if(p===`
|
|
349
|
-
`)a++,l=g+1;else{if(c!==g){let m;if(d===a){const b=g-c;if(b<h.length)m=h[b];else{const w=ln(0,b);m=new ud(w,0,-1,Bs.getEmpty(),new su(w))}}else{const b=a-d,w=g-l;if(b===1&&w<u.length)m=u[w];else{const C=ln(b,w);m=new ud(C,0,-1,Bs.getEmpty(),new su(C))}}r.push(m)}r.push(t.getToken(p)),c=g+p.length,d=a}}const f=e.length;if(c!==f){const g=d===a?ln(0,f-c):ln(a-d,f-l);r.push(new ud(g,0,-1,Bs.getEmpty(),new su(g)))}this.length=ln(a,f-l),this.tokens=r}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Bie}}class YT{static createFromLanguage(e,t){function n(r){return t.getKey(`${r.languageId}:::${r.bracketText}`)}const i=new Map;for(const r of e.bracketsNew.openingBrackets){const o=ln(0,r.bracketText.length),a=n(r),l=Bs.getEmpty().add(a,yV);i.set(r.bracketText,new ud(o,1,a,l,Yv.create(o,r,l)))}for(const r of e.bracketsNew.closingBrackets){const o=ln(0,r.bracketText.length);let a=Bs.getEmpty();const l=r.getOpeningBrackets();for(const c of l)a=a.add(n(c),yV);i.set(r.bracketText,new ud(o,2,n(l[0]),a,Yv.create(o,r,a)))}return new YT(i)}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=>p_e(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,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function p_e(s){let e=oa(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class m_e{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=YT.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function __e(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const o=e,a=s[o].listHeight;for(e++;e<s.length&&s[e].listHeight===a;)e++;return e-o>=2?SV(o===0&&e===s.length?s:s.slice(o,e),!1):s[o]}let n=t(),i=t();if(!i)return n;for(let o=t();o;o=t())xV(n,i)<=xV(i,o)?(n=XT(n,i),i=o):i=XT(i,o);return XT(n,i)}function SV(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const n=t>>1;for(let i=0;i<n;i++){const r=i<<1;s[i]=_a.create23(s[r],s[r+1],r+3===t?s[r+2]:null,e)}t=n}return _a.create23(s[0],s[1],t>=3?s[2]:null,e)}function xV(s,e){return Math.abs(s.listHeight-e.listHeight)}function XT(s,e){return s.listHeight===e.listHeight?_a.create23(s,e,null,!1):s.listHeight>e.listHeight?b_e(s,e):w_e(e,s)}function b_e(s,e){s=s.toMutable();let t=s;const n=[];let i;for(;;){if(e.listHeight===t.listHeight){i=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let r=n.length-1;r>=0;r--){const o=n[r];i?o.childrenLength>=3?i=_a.create23(o.unappendChild(),i,null,!1):(o.appendChildOfSameHeight(i),i=void 0):o.handleChildrenChanged()}return i?_a.create23(s,i,null,!1):s}function w_e(s,e){s=s.toMutable();let t=s;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let i=e;for(let r=n.length-1;r>=0;r--){const o=n[r];i?o.childrenLength>=3?i=_a.create23(i,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(i),i=void 0):o.handleChildrenChanged()}return i?_a.create23(i,s,null,!1):s}class C_e{constructor(e){this.lastOffset=_s,this.nextNodes=[e],this.offsets=[_s],this.idxs=[]}readLongestNodeAt(e,t){if(zg(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=c1(this.nextNodes);if(!n)return;const i=c1(this.offsets);if(zg(e,i))return;if(zg(i,e))if(Cn(i,n.length)<=e)this.nextNodeAfterCurrent();else{const r=ZT(n);r!==-1?(this.nextNodes.push(n.getChild(r)),this.offsets.push(i),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const r=ZT(n);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(r)),this.offsets.push(i),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=c1(this.offsets),t=c1(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=c1(this.nextNodes),i=ZT(n,this.idxs[this.idxs.length-1]);if(i!==-1){this.nextNodes.push(n.getChild(i)),this.offsets.push(Cn(e,t.length)),this.idxs[this.idxs.length-1]=i;break}else this.idxs.pop()}}}function ZT(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function c1(s){return s.length>0?s[s.length-1]:void 0}function LV(s,e,t,n){return new v_e(s,e,t,n).parseDocument()}class v_e{constructor(e,t,n,i){if(this.tokenizer=e,this.createImmutableLists=i,this._itemsConstructed=0,this._itemsFromCache=0,n&&i)throw new Error("Not supported");this.oldNodeReader=n?new C_e(n):void 0,this.positionMapper=new o_e(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Bs.getEmpty(),0);return e||(e=_a.getEmpty()),e}parseList(e,t){const n=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const o=this.tokenizer.peek();if(!o||o.kind===2&&o.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===4&&r.childrenLength===0||n.push(r)}return this.oldNodeReader?__e(n):SV(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!Kv(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),i=>t!==null&&!zg(i.length,t)?!1:i.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new h_e(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new su(n.length);const i=e.merge(n.bracketIds),r=this.parseList(i,t+1),o=this.tokenizer.peek();return o&&o.kind===2&&(o.bracketId===n.bracketId||o.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),a1.create(n.astNode,r,o.astNode)):a1.create(n.astNode,r,null)}default:throw new Error("unexpected")}}}function Xv(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new cl(kV(s)),n=kV(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let i=t.dequeue();function r(c){if(c===void 0){const h=t.takeWhile(u=>!0)||[];return i&&h.unshift(i),h}const d=[];for(;i&&!Kv(c);){const[h,u]=i.splitAt(c);d.push(h),c=r1(h.lengthAfter,c),i=u??t.dequeue()}return Kv(c)||d.push(new fd(!1,c,c)),d}const o=[];function a(c,d,h){if(o.length>0&&vV(o[o.length-1].endOffset,c)){const u=o[o.length-1];o[o.length-1]=new Pl(u.startOffset,d,Cn(u.newLength,h))}else o.push({startOffset:c,endOffset:d,newLength:h})}let l=_s;for(const c of n){const d=r(c.lengthBefore);if(c.modified){const h=s_e(d,f=>f.lengthBefore),u=Cn(l,h);a(l,u,c.lengthAfter),l=u}else for(const h of d){const u=l;l=Cn(l,h.lengthBefore),h.modified&&a(u,l,h.lengthAfter)}}return o}class fd{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=r1(e,this.lengthAfter);return vV(t,_s)?[this,void 0]:this.modified?[new fd(this.modified,this.lengthBefore,e),new fd(this.modified,_s,t)]:[new fd(this.modified,e,e),new fd(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Mr(this.lengthBefore)} -> ${Mr(this.lengthAfter)}`}}function kV(s){const e=[];let t=_s;for(const n of s){const i=r1(t,n.startOffset);Kv(i)||e.push(new fd(!1,i,i));const r=r1(n.startOffset,n.endOffset);e.push(new fd(!0,r,n.newLength)),t=n.endOffset}return e}class y_e extends U{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new A,this.denseKeyProvider=new a_e,this.brackets=new m_e(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),i=new g_e(this.textModel.getValue(),n);this.initialAstWithoutTokens=LV(i,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(n=>new Pl(ln(n.fromLineNumber-1,0),ln(n.toLineNumber,0),ln(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Pl.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=Xv(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=Xv(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,n){const i=t,r=new u_e(this.textModel,this.brackets);return LV(r,e,i,n)}getBracketsInRange(e,t){this.flushQueue();const n=ln(e.startLineNumber-1,e.startColumn-1),i=ln(e.endLineNumber-1,e.endColumn-1);return new Jd(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens;QT(o,_s,o.length,n,i,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=Ug(e.getStartPosition()),i=Ug(e.getEndPosition());return new Jd(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens,a=new S_e(r,t,this.textModel);JT(o,_s,o.length,n,i,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return NV(t,_s,t.length,Ug(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return EV(t,_s,t.length,Ug(e))}}function EV(s,e,t,n){if(s.kind===4||s.kind===2){const i=[];for(const r of s.children)t=Cn(e,r.length),i.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=i.length-1;r>=0;r--){const{nodeOffsetStart:o,nodeOffsetEnd:a}=i[r];if(zg(o,n)){const l=EV(s.children[r],o,a,n);if(l)return l}}return null}else{if(s.kind===3)return null;if(s.kind===1){const i=iu(e,t);return{bracketInfo:s.bracketInfo,range:i}}}return null}function NV(s,e,t,n){if(s.kind===4||s.kind===2){for(const i of s.children){if(t=Cn(e,i.length),zg(n,t)){const r=NV(i,e,t,n);if(r)return r}e=t}return null}else{if(s.kind===3)return null;if(s.kind===1){const i=iu(e,t);return{bracketInfo:s.bracketInfo,range:i}}}return null}function QT(s,e,t,n,i,r,o,a,l,c,d=!1){if(o>200)return!0;e:for(;;)switch(s.kind){case 4:{const h=s.childrenLength;for(let u=0;u<h;u++){const f=s.getChild(u);if(f){if(t=Cn(e,f.length),$g(e,i)&&o1(t,n)){if(o1(t,i)){s=f;continue e}if(!QT(f,e,t,n,i,r,o,0,l,c))return!1}e=t}}return!0}case 2:{const h=!c||!s.closingBracket||s.closingBracket.bracketInfo.closesColorized(s.openingBracket.bracketInfo);let u=0;if(l){let g=l.get(s.openingBracket.text);g===void 0&&(g=0),u=g,h&&(g++,l.set(s.openingBracket.text,g))}const f=s.childrenLength;for(let g=0;g<f;g++){const p=s.getChild(g);if(p){if(t=Cn(e,p.length),$g(e,i)&&o1(t,n)){if(o1(t,i)&&p.kind!==1){s=p,h?(o++,a=u+1):a=u;continue e}if((h||p.kind!==1||!s.closingBracket)&&!QT(p,e,t,n,i,r,h?o+1:o,h?u+1:u,l,c,!s.closingBracket))return!1}e=t}}return l?.set(s.openingBracket.text,u),!0}case 3:{const h=iu(e,t);return r(new CV(h,o-1,0,!0))}case 1:{const h=iu(e,t);return r(new CV(h,o-1,a-1,d))}case 0:return!0}}class S_e{constructor(e,t,n){this.push=e,this.includeMinIndentation=t,this.textModel=n}}function JT(s,e,t,n,i,r,o,a){if(o>200)return!0;let l=!0;if(s.kind===2){let c=0;if(a){let u=a.get(s.openingBracket.text);u===void 0&&(u=0),c=u,u++,a.set(s.openingBracket.text,u)}const d=Cn(e,s.openingBracket.length);let h=-1;if(r.includeMinIndentation&&(h=s.computeMinIndentation(e,r.textModel)),l=r.push(new t_e(iu(e,t),iu(e,d),s.closingBracket?iu(Cn(d,s.child?.length||_s),t):void 0,o,c,s,h)),e=d,l&&s.child){const u=s.child;if(t=Cn(e,u.length),$g(e,i)&&o1(t,n)&&(l=JT(u,e,t,n,i,r,o+1,a),!l))return!1}a?.set(s.openingBracket.text,c)}else{let c=e;for(const d of s.children){const h=c;if(c=Cn(c,d.length),$g(h,i)&&$g(n,c)&&(l=JT(d,h,c,n,i,r,o,a),!l))return!1}}return l}class x_e extends U{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Bn),this.onDidChangeEmitter=new A,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new le;this.bracketPairsTree.value=L_e(e.add(new y_e(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||Jd.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||Jd.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||Jd.empty}findMatchingBracketUp(e,t,n){const i=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(i.lineNumber,i.column);if(this.canBuildAST){const o=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!o)return null;const a=this.getBracketPairsInRange(R.fromPositions(t,t)).findLast(l=>o.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const o=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const l=a.textIsBracket[o];return l?Zv(this._findMatchingBracketUp(l,i,eI(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(R.fromPositions(e,e)).filter(i=>i.closingBracketRange!==void 0&&(i.openingBracketRange.containsPosition(e)||i.closingBracketRange.containsPosition(e))).findLastMaxBy(Ks(i=>i.openingBracketRange.containsPosition(e)?i.openingBracketRange:i.closingBracketRange,R.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=eI(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,i){const r=t.getCount(),o=t.getLanguageId(i);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=i-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(da(t.getStandardTokenType(c))||t.getLanguageId(c)!==o){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=i+1;c<r;c++){const d=t.getStartOffset(c);if(d>=l)break;if(da(t.getStandardTokenType(c))||t.getLanguageId(c)!==o){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,i=this.textModel.tokenization.getLineTokens(n),r=this.textModel.getLineContent(n),o=i.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(i.getLanguageId(o)).brackets;if(a&&!da(i.getStandardTokenType(o))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,i,a,o),d=null;for(;;){const h=Qr.findNextBracketInRange(a.forwardRegex,n,r,l,c);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=r.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof Fl)return null;d=f}}l=h.endColumn-1}if(d)return d}if(o>0&&i.getStartOffset(o)===e.column-1){const l=o-1,c=this.languageConfigurationService.getLanguageConfiguration(i.getLanguageId(l)).brackets;if(c&&!da(i.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,i,c,l),u=Qr.findPrevBracketInRange(c.reversedRegex,n,r,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const f=r.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),g=this._matchFoundBracket(u,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Fl?null:g}}}return null}_matchFoundBracket(e,t,n,i){if(!t)return null;const r=n?this._findMatchingBracketDown(t,e.getEndPosition(),i):this._findMatchingBracketUp(t,e.getStartPosition(),i);return r?r instanceof Fl?r:[e,r]:null}_findMatchingBracketUp(e,t,n){const i=e.languageId,r=e.reversedRegex;let o=-1,a=0;const l=(c,d,h,u)=>{for(;;){if(n&&++a%100===0&&!n())return Fl.INSTANCE;const f=Qr.findPrevBracketInRange(r,c,d,h,u);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?o++:e.isClose(g)&&o--,o===0)return f;u=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),h=d.getCount(),u=this.textModel.getLineContent(c);let f=h-1,g=u.length,p=u.length;c===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let m=!0;for(;f>=0;f--){const b=d.getLanguageId(f)===i&&!da(d.getStandardTokenType(f));if(b)m?g=d.getStartOffset(f):(g=d.getStartOffset(f),p=d.getEndOffset(f));else if(m&&g!==p){const w=l(c,u,g,p);if(w)return w}m=b}if(m&&g!==p){const b=l(c,u,g,p);if(b)return b}}return null}_findMatchingBracketDown(e,t,n){const i=e.languageId,r=e.forwardRegex;let o=1,a=0;const l=(d,h,u,f)=>{for(;;){if(n&&++a%100===0&&!n())return Fl.INSTANCE;const g=Qr.findNextBracketInRange(r,d,h,u,f);if(!g)break;const p=h.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?o++:e.isClose(p)&&o--,o===0)return g;u=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),f=this.textModel.getLineContent(d);let g=0,p=0,m=0;d===t.lineNumber&&(g=h.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let b=!0;for(;g<u;g++){const w=h.getLanguageId(g)===i&&!da(h.getStandardTokenType(g));if(w)b||(p=h.getStartOffset(g)),m=h.getEndOffset(g);else if(b&&p!==m){const C=l(d,f,p,m);if(C)return C}b=w}if(b&&p!==m){const w=l(d,f,p,m);if(w)return w}}return null}findPrevBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketBefore(t)||null;let n=null,i=null,r=null;for(let o=t.lineNumber;o>=1;o--){const a=this.textModel.tokenization.getLineTokens(o),l=a.getCount(),c=this.textModel.getLineContent(o);let d=l-1,h=c.length,u=c.length;if(o===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const g=a.getLanguageId(d);n!==g&&(n=g,i=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let f=!0;for(;d>=0;d--){const g=a.getLanguageId(d);if(n!==g){if(i&&r&&f&&h!==u){const m=Qr.findPrevBracketInRange(i.reversedRegex,o,c,h,u);if(m)return this._toFoundBracket(r,m);f=!1}n=g,i=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const p=!!i&&!da(a.getStandardTokenType(d));if(p)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(r&&i&&f&&h!==u){const m=Qr.findPrevBracketInRange(i.reversedRegex,o,c,h,u);if(m)return this._toFoundBracket(r,m)}f=p}if(r&&i&&f&&h!==u){const g=Qr.findPrevBracketInRange(i.reversedRegex,o,c,h,u);if(g)return this._toFoundBracket(r,g)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const n=this.textModel.getLineCount();let i=null,r=null,o=null;for(let a=t.lineNumber;a<=n;a++){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let h=0,u=0,f=0;if(a===t.lineNumber){h=l.findTokenIndexAtOffset(t.column-1),u=t.column-1,f=t.column-1;const p=l.getLanguageId(h);i!==p&&(i=p,r=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let g=!0;for(;h<c;h++){const p=l.getLanguageId(h);if(i!==p){if(o&&r&&g&&u!==f){const b=Qr.findNextBracketInRange(r.forwardRegex,a,d,u,f);if(b)return this._toFoundBracket(o,b);g=!1}i=p,r=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!r&&!da(l.getStandardTokenType(h));if(m)g||(u=l.getStartOffset(h)),f=l.getEndOffset(h);else if(o&&r&&g&&u!==f){const b=Qr.findNextBracketInRange(r.forwardRegex,a,d,u,f);if(b)return this._toFoundBracket(o,b)}g=m}if(o&&r&&g&&u!==f){const p=Qr.findNextBracketInRange(r.forwardRegex,a,d,u,f);if(p)return this._toFoundBracket(o,p)}}return null}findEnclosingBrackets(e,t){const n=this.textModel.validatePosition(e);if(this.canBuildAST){const f=R.fromPositions(n),g=this.getBracketPairsInRange(R.fromPositions(n,n)).findLast(p=>p.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const i=eI(t),r=this.textModel.getLineCount(),o=new Map;let a=[];const l=(f,g)=>{if(!o.has(f)){const p=[];for(let m=0,b=g?g.brackets.length:0;m<b;m++)p[m]=0;o.set(f,p)}a=o.get(f)};let c=0;const d=(f,g,p,m,b)=>{for(;;){if(i&&++c%100===0&&!i())return Fl.INSTANCE;const w=Qr.findNextBracketInRange(f.forwardRegex,g,p,m,b);if(!w)break;const C=p.substring(w.startColumn-1,w.endColumn-1).toLowerCase(),v=f.textIsBracket[C];if(v&&(v.isOpen(C)?a[v.index]++:v.isClose(C)&&a[v.index]--,a[v.index]===-1))return this._matchFoundBracket(w,v,!1,i);m=w.endColumn-1}return null};let h=null,u=null;for(let f=n.lineNumber;f<=r;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),m=this.textModel.getLineContent(f);let b=0,w=0,C=0;if(f===n.lineNumber){b=g.findTokenIndexAtOffset(n.column-1),w=n.column-1,C=n.column-1;const S=g.getLanguageId(b);h!==S&&(h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u))}let v=!0;for(;b<p;b++){const S=g.getLanguageId(b);if(h!==S){if(u&&v&&w!==C){const L=d(u,f,m,w,C);if(L)return Zv(L);v=!1}h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u)}const k=!!u&&!da(g.getStandardTokenType(b));if(k)v||(w=g.getStartOffset(b)),C=g.getEndOffset(b);else if(u&&v&&w!==C){const L=d(u,f,m,w,C);if(L)return Zv(L)}v=k}if(u&&v&&w!==C){const S=d(u,f,m,w,C);if(S)return Zv(S)}}return null}_toFoundBracket(e,t){if(!t)return null;let n=this.textModel.getValueInRange(t);n=n.toLowerCase();const i=e.getBracketInfo(n);return i?{range:t,bracketInfo:i}:null}}function L_e(s,e){return{object:s,dispose:()=>e?.dispose()}}function eI(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}const Tx=class Tx{constructor(){this._searchCanceledBrand=void 0}};Tx.INSTANCE=new Tx;let Fl=Tx;function Zv(s){return s instanceof Fl?null:s}class k_e extends U{constructor(e){super(),this.textModel=e,this.colorProvider=new DV,this.onDidChangeEmitter=new A,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,n,i){return i?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(o=>({id:`bracket${o.range.toString()}-${o.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(o,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:o.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new R(1,1,this.textModel.getLineCount(),1),e,t):[]}}class DV{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Rl((s,e)=>{const t=[TB,IB,MB,RB,AB,OB],n=new DV;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${s.getColor(Vge)}; }`);const i=t.map(r=>s.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const o=i[r%i.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(r)} { color: ${o}; }`)}});function Qv(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class li{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,i){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=i}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Qv(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Qv(this.oldText)}")`:`(replace@${this.oldPosition} "${Qv(this.oldText)}" with "${Qv(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const i=t.length;So(e,i,n),n+=4;for(let r=0;r<i;r++)hoe(e,t.charCodeAt(r),n),n+=2;return n}static _readString(e,t){const n=yo(e,t);return t+=4,Ele(e,t,n)}writeSize(){return 8+li._writeStringSize(this.oldText)+li._writeStringSize(this.newText)}write(e,t){return So(e,this.oldPosition,t),t+=4,So(e,this.newPosition,t),t+=4,t=li._writeString(e,this.oldText,t),t=li._writeString(e,this.newText,t),t}static read(e,t,n){const i=yo(e,t);t+=4;const r=yo(e,t);t+=4;const o=li._readString(e,t);t+=li._writeStringSize(o);const a=li._readString(e,t);return t+=li._writeStringSize(a),n.push(new li(i,o,r,a)),t}}function E_e(s,e){return s===null||s.length===0?e:new ba(s,e).compress()}class ba{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,n=this._getPrev(e),i=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(n===null){this._acceptCurr(i),i=this._getCurr(++t);continue}if(i===null){this._acceptPrev(n),n=this._getPrev(++e);continue}if(i.oldEnd<=n.newPosition){this._acceptCurr(i),i=this._getCurr(++t);continue}if(n.newEnd<=i.oldPosition){this._acceptPrev(n),n=this._getPrev(++e);continue}if(i.oldPosition<n.newPosition){const[c,d]=ba._splitCurr(i,n.newPosition-i.oldPosition);this._acceptCurr(c),i=d;continue}if(n.newPosition<i.oldPosition){const[c,d]=ba._splitPrev(n,i.oldPosition-n.newPosition);this._acceptPrev(c),n=d;continue}let a,l;if(i.oldEnd===n.newEnd)a=n,l=i,n=this._getPrev(++e),i=this._getCurr(++t);else if(i.oldEnd<n.newEnd){const[c,d]=ba._splitPrev(n,i.oldLength);a=c,l=i,n=d,i=this._getCurr(++t)}else{const[c,d]=ba._splitCurr(i,n.newLength);a=n,l=c,n=this._getPrev(++e),i=d}this._result[this._resultLen++]=new li(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const r=ba._merge(this._result);return ba._removeNoOps(r)}_acceptCurr(e){this._result[this._resultLen++]=ba._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=ba._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new li(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new li(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const n=e.newText.substr(0,t),i=e.newText.substr(t);return[new li(e.oldPosition,e.oldText,e.newPosition,n),new li(e.oldEnd,"",e.newPosition+t,i)]}static _splitCurr(e,t){const n=e.oldText.substr(0,t),i=e.oldText.substr(t);return[new li(e.oldPosition,n,e.newPosition,e.newText),new li(e.oldPosition+t,i,e.newEnd,"")]}static _merge(e){if(e.length===0)return e;const t=[];let n=0,i=e[0];for(let r=1;r<e.length;r++){const o=e[r];i.oldEnd===o.oldPosition?i=new li(i.oldPosition,i.oldText+o.oldText,i.newPosition,i.newText+o.newText):(t[n++]=i,i=o)}return t[n++]=i,t}static _removeNoOps(e){if(e.length===0)return e;const t=[];let n=0;for(let i=0;i<e.length;i++){const r=e[i];r.oldText!==r.newText&&(t[n++]=r)}return t}}const N_e=Symbol("TextModelEditSource");class TV{constructor(e,t){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){const e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e,t={}){const n=this.metadata;return Object.entries(n).filter(([r,o])=>{const a=t[r];return a!==void 0?a:(r.match(/\$/g)||[]).length<=e&&o!==void 0&&o!==null&&o!==""}).map(([r,o])=>`${r}:${o}`).join("-")}}function bs(s){return new TV(s,N_e)}const Rr={unknown(s){return bs({source:"unknown",name:s.name})},rename:()=>bs({source:"rename"}),chatApplyEdits(s){return bs({source:"Chat.applyEdits",$modelId:IV(s.modelId),$extensionId:s.extensionId?.extensionId,$extensionVersion:s.extensionId?.version,$$languageId:s.languageId,$$sessionId:s.sessionId,$$requestId:s.requestId,$$mode:s.mode,$$codeBlockSuggestionId:s.codeBlockSuggestionId})},chatUndoEdits:()=>bs({source:"Chat.undoEdits"}),chatReset:()=>bs({source:"Chat.reset"}),inlineCompletionAccept(s){return bs({source:"inlineCompletionAccept",$nes:s.nes,...Jv(s.providerId),$$requestUuid:s.requestUuid,$$languageId:s.languageId})},inlineCompletionPartialAccept(s){return bs({source:"inlineCompletionPartialAccept",type:s.type,$nes:s.nes,...Jv(s.providerId),$$requestUuid:s.requestUuid,$$languageId:s.languageId})},inlineChatApplyEdit(s){return bs({source:"inlineChat.applyEdits",$modelId:IV(s.modelId),$extensionId:s.extensionId?.extensionId,$extensionVersion:s.extensionId?.version,$$requestId:s.requestId,$$languageId:s.languageId})},reloadFromDisk:()=>bs({source:"reloadFromDisk"}),cursor(s){return bs({source:"cursor",kind:s.kind,detailedSource:s.detailedSource})},setValue:()=>bs({source:"setValue"}),eolChange:()=>bs({source:"eolChange"}),applyEdits:()=>bs({source:"applyEdits"}),snippet:()=>bs({source:"snippet"}),suggest:s=>bs({source:"suggest",...Jv(s.providerId)}),codeAction:s=>bs({source:"codeAction",$kind:s.kind,...Jv(s.providerId)})};function Jv(s){return s?{$extensionId:s.extensionId,$extensionVersion:s.extensionVersion,$providerId:s.providerId}:{}}function IV(s){if(s!==void 0)return s.replaceAll("/","|")}class ey{static fromText(e){const t=As.ofText(e).lineCount,n=e.length;return new ey(t,0,n,0)}static tryCreate(e,t,n,i){if(!(e===void 0||t===void 0||n===void 0||i===void 0))return new ey(e,t,n,i)}constructor(e,t,n,i){this.linesAdded=e,this.linesRemoved=t,this.charsAdded=n,this.charsRemoved=i}}var MV;(function(s){function e(){const t=vfe("sgt");return t}s.newId=e})(MV||(MV={}));function zTe(s){return s}function jg(s){return s.toString()}class Kn{static create(e,t){const n=e.getAlternativeVersionId(),i=tI(e);return new Kn(n,n,i,i,t,t,[])}constructor(e,t,n,i,r,o,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=i,this.beforeCursorState=r,this.afterCursorState=o,this.changes=a}append(e,t,n,i,r){t.length>0&&(this.changes=E_e(this.changes,t)),this.afterEOL=n,this.afterVersionId=i,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,n){if(So(e,t?t.length:0,n),n+=4,t)for(const i of t)So(e,i.selectionStartLineNumber,n),n+=4,So(e,i.selectionStartColumn,n),n+=4,So(e,i.positionLineNumber,n),n+=4,So(e,i.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const i=yo(e,t);t+=4;for(let r=0;r<i;r++){const o=yo(e,t);t+=4;const a=yo(e,t);t+=4;const l=yo(e,t);t+=4;const c=yo(e,t);t+=4,n.push(new Ae(o,a,l,c))}return t}serialize(){let e=10+Kn._writeSelectionsSize(this.beforeCursorState)+Kn._writeSelectionsSize(this.afterCursorState)+4;for(const i of this.changes)e+=i.writeSize();const t=new Uint8Array(e);let n=0;So(t,this.beforeVersionId,n),n+=4,So(t,this.afterVersionId,n),n+=4,zF(t,this.beforeEOL,n),n+=1,zF(t,this.afterEOL,n),n+=1,n=Kn._writeSelections(t,this.beforeCursorState,n),n=Kn._writeSelections(t,this.afterCursorState,n),So(t,this.changes.length,n),n+=4;for(const i of this.changes)n=i.write(t,n);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let n=0;const i=yo(t,n);n+=4;const r=yo(t,n);n+=4;const o=HF(t,n);n+=1;const a=HF(t,n);n+=1;const l=[];n=Kn._readSelections(t,n,l);const c=[];n=Kn._readSelections(t,n,c);const d=yo(t,n);n+=4;const h=[];for(let u=0;u<d;u++)n=li.read(t,n,h);return new Kn(i,r,o,a,l,c,h)}}class RV{get type(){return 0}get resource(){return ze.isUri(this.model)?this.model:this.model.uri}constructor(e,t,n,i){this.label=e,this.code=t,this.model=n,this._data=Kn.create(n,i)}toString(){return(this._data instanceof Kn?this._data:Kn.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(ze.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Kn}append(e,t,n,i,r){this._data instanceof Kn&&this._data.append(e,t,n,i,r)}close(){this._data instanceof Kn&&(this._data=this._data.serialize())}open(){this._data instanceof Kn||(this._data=Kn.deserialize(this._data))}undo(){if(ze.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Kn&&(this._data=this._data.serialize());const e=Kn.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(ze.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Kn&&(this._data=this._data.serialize());const e=Kn.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Kn&&(this._data=this._data.serialize()),this._data.byteLength+168}}class D_e{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const r=jg(i.resource);this._editStackElementsMap.set(r,i)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=jg(e);return this._editStackElementsMap.has(t)}setModel(e){const t=jg(ze.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=jg(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,i,r){const o=jg(e.uri);this._editStackElementsMap.get(o).append(e,t,n,i,r)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=jg(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${FN(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function tI(s){return s.getEOL()===`
|
|
349
|
+
`)a++,l=g+1;else{if(c!==g){let m;if(d===a){const b=g-c;if(b<h.length)m=h[b];else{const w=ln(0,b);m=new ud(w,0,-1,Bs.getEmpty(),new su(w))}}else{const b=a-d,w=g-l;if(b===1&&w<u.length)m=u[w];else{const C=ln(b,w);m=new ud(C,0,-1,Bs.getEmpty(),new su(C))}}r.push(m)}r.push(t.getToken(p)),c=g+p.length,d=a}}const f=e.length;if(c!==f){const g=d===a?ln(0,f-c):ln(a-d,f-l);r.push(new ud(g,0,-1,Bs.getEmpty(),new su(g)))}this.length=ln(a,f-l),this.tokens=r}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new Bie}}class YT{static createFromLanguage(e,t){function n(r){return t.getKey(`${r.languageId}:::${r.bracketText}`)}const i=new Map;for(const r of e.bracketsNew.openingBrackets){const o=ln(0,r.bracketText.length),a=n(r),l=Bs.getEmpty().add(a,yV);i.set(r.bracketText,new ud(o,1,a,l,Yv.create(o,r,l)))}for(const r of e.bracketsNew.closingBrackets){const o=ln(0,r.bracketText.length);let a=Bs.getEmpty();const l=r.getOpeningBrackets();for(const c of l)a=a.add(n(c),yV);i.set(r.bracketText,new ud(o,2,n(l[0]),a,Yv.create(o,r,a)))}return new YT(i)}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=>p_e(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,n]of this.map)if(n.kind===2&&n.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function p_e(s){let e=oa(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class m_e{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=YT.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function __e(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const o=e,a=s[o].listHeight;for(e++;e<s.length&&s[e].listHeight===a;)e++;return e-o>=2?SV(o===0&&e===s.length?s:s.slice(o,e),!1):s[o]}let n=t(),i=t();if(!i)return n;for(let o=t();o;o=t())xV(n,i)<=xV(i,o)?(n=XT(n,i),i=o):i=XT(i,o);return XT(n,i)}function SV(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const n=t>>1;for(let i=0;i<n;i++){const r=i<<1;s[i]=_a.create23(s[r],s[r+1],r+3===t?s[r+2]:null,e)}t=n}return _a.create23(s[0],s[1],t>=3?s[2]:null,e)}function xV(s,e){return Math.abs(s.listHeight-e.listHeight)}function XT(s,e){return s.listHeight===e.listHeight?_a.create23(s,e,null,!1):s.listHeight>e.listHeight?b_e(s,e):w_e(e,s)}function b_e(s,e){s=s.toMutable();let t=s;const n=[];let i;for(;;){if(e.listHeight===t.listHeight){i=e;break}if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeLastElementMutable()}for(let r=n.length-1;r>=0;r--){const o=n[r];i?o.childrenLength>=3?i=_a.create23(o.unappendChild(),i,null,!1):(o.appendChildOfSameHeight(i),i=void 0):o.handleChildrenChanged()}return i?_a.create23(s,i,null,!1):s}function w_e(s,e){s=s.toMutable();let t=s;const n=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");n.push(t),t=t.makeFirstElementMutable()}let i=e;for(let r=n.length-1;r>=0;r--){const o=n[r];i?o.childrenLength>=3?i=_a.create23(i,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(i),i=void 0):o.handleChildrenChanged()}return i?_a.create23(i,s,null,!1):s}class C_e{constructor(e){this.lastOffset=_s,this.nextNodes=[e],this.offsets=[_s],this.idxs=[]}readLongestNodeAt(e,t){if(zg(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const n=c1(this.nextNodes);if(!n)return;const i=c1(this.offsets);if(zg(e,i))return;if(zg(i,e))if(Cn(i,n.length)<=e)this.nextNodeAfterCurrent();else{const r=ZT(n);r!==-1?(this.nextNodes.push(n.getChild(r)),this.offsets.push(i),this.idxs.push(r)):this.nextNodeAfterCurrent()}else{if(t(n))return this.nextNodeAfterCurrent(),n;{const r=ZT(n);if(r===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(n.getChild(r)),this.offsets.push(i),this.idxs.push(r)}}}}nextNodeAfterCurrent(){for(;;){const e=c1(this.offsets),t=c1(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const n=c1(this.nextNodes),i=ZT(n,this.idxs[this.idxs.length-1]);if(i!==-1){this.nextNodes.push(n.getChild(i)),this.offsets.push(Cn(e,t.length)),this.idxs[this.idxs.length-1]=i;break}else this.idxs.pop()}}}function ZT(s,e=-1){for(;;){if(e++,e>=s.childrenLength)return-1;if(s.getChild(e))return e}}function c1(s){return s.length>0?s[s.length-1]:void 0}function LV(s,e,t,n){return new v_e(s,e,t,n).parseDocument()}class v_e{constructor(e,t,n,i){if(this.tokenizer=e,this.createImmutableLists=i,this._itemsConstructed=0,this._itemsFromCache=0,n&&i)throw new Error("Not supported");this.oldNodeReader=n?new C_e(n):void 0,this.positionMapper=new o_e(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Bs.getEmpty(),0);return e||(e=_a.getEmpty()),e}parseList(e,t){const n=[];for(;;){let r=this.tryReadChildFromCache(e);if(!r){const o=this.tokenizer.peek();if(!o||o.kind===2&&o.bracketIds.intersects(e))break;r=this.parseChild(e,t+1)}r.kind===4&&r.childrenLength===0||n.push(r)}return this.oldNodeReader?__e(n):SV(n,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!Kv(t)){const n=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),i=>t!==null&&!zg(i.length,t)?!1:i.canBeReused(e));if(n)return this._itemsFromCache++,this.tokenizer.skip(n.length),n}}}parseChild(e,t){this._itemsConstructed++;const n=this.tokenizer.read();switch(n.kind){case 2:return new h_e(n.bracketIds,n.length);case 0:return n.astNode;case 1:{if(t>300)return new su(n.length);const i=e.merge(n.bracketIds),r=this.parseList(i,t+1),o=this.tokenizer.peek();return o&&o.kind===2&&(o.bracketId===n.bracketId||o.bracketIds.intersects(n.bracketIds))?(this.tokenizer.read(),a1.create(n.astNode,r,o.astNode)):a1.create(n.astNode,r,null)}default:throw new Error("unexpected")}}}function Xv(s,e){if(s.length===0)return e;if(e.length===0)return s;const t=new cl(kV(s)),n=kV(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let i=t.dequeue();function r(c){if(c===void 0){const h=t.takeWhile(u=>!0)||[];return i&&h.unshift(i),h}const d=[];for(;i&&!Kv(c);){const[h,u]=i.splitAt(c);d.push(h),c=r1(h.lengthAfter,c),i=u??t.dequeue()}return Kv(c)||d.push(new fd(!1,c,c)),d}const o=[];function a(c,d,h){if(o.length>0&&vV(o[o.length-1].endOffset,c)){const u=o[o.length-1];o[o.length-1]=new Pl(u.startOffset,d,Cn(u.newLength,h))}else o.push({startOffset:c,endOffset:d,newLength:h})}let l=_s;for(const c of n){const d=r(c.lengthBefore);if(c.modified){const h=s_e(d,f=>f.lengthBefore),u=Cn(l,h);a(l,u,c.lengthAfter),l=u}else for(const h of d){const u=l;l=Cn(l,h.lengthBefore),h.modified&&a(u,l,h.lengthAfter)}}return o}class fd{constructor(e,t,n){this.modified=e,this.lengthBefore=t,this.lengthAfter=n}splitAt(e){const t=r1(e,this.lengthAfter);return vV(t,_s)?[this,void 0]:this.modified?[new fd(this.modified,this.lengthBefore,e),new fd(this.modified,_s,t)]:[new fd(this.modified,e,e),new fd(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Mr(this.lengthBefore)} -> ${Mr(this.lengthAfter)}`}}function kV(s){const e=[];let t=_s;for(const n of s){const i=r1(t,n.startOffset);Kv(i)||e.push(new fd(!1,i,i));const r=r1(n.startOffset,n.endOffset);e.push(new fd(!0,r,n.newLength)),t=n.endOffset}return e}class y_e extends U{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new A,this.denseKeyProvider=new a_e,this.brackets=new m_e(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const n=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),i=new g_e(this.textModel.getValue(),n);this.initialAstWithoutTokens=LV(i,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(n=>new Pl(ln(n.fromLineNumber-1,0),ln(n.toLineNumber,0),ln(n.toLineNumber-n.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Pl.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const n=Xv(this.queuedTextEdits,e);this.queuedTextEdits=n,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=Xv(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,n){const i=t,r=new u_e(this.textModel,this.brackets);return LV(r,e,i,n)}getBracketsInRange(e,t){this.flushQueue();const n=ln(e.startLineNumber-1,e.startColumn-1),i=ln(e.endLineNumber-1,e.endColumn-1);return new Jd(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens;QT(o,_s,o.length,n,i,r,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const n=Ug(e.getStartPosition()),i=Ug(e.getEndPosition());return new Jd(r=>{const o=this.initialAstWithoutTokens||this.astWithTokens,a=new S_e(r,t,this.textModel);JT(o,_s,o.length,n,i,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return NV(t,_s,t.length,Ug(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return EV(t,_s,t.length,Ug(e))}}function EV(s,e,t,n){if(s.kind===4||s.kind===2){const i=[];for(const r of s.children)t=Cn(e,r.length),i.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let r=i.length-1;r>=0;r--){const{nodeOffsetStart:o,nodeOffsetEnd:a}=i[r];if(zg(o,n)){const l=EV(s.children[r],o,a,n);if(l)return l}}return null}else{if(s.kind===3)return null;if(s.kind===1){const i=iu(e,t);return{bracketInfo:s.bracketInfo,range:i}}}return null}function NV(s,e,t,n){if(s.kind===4||s.kind===2){for(const i of s.children){if(t=Cn(e,i.length),zg(n,t)){const r=NV(i,e,t,n);if(r)return r}e=t}return null}else{if(s.kind===3)return null;if(s.kind===1){const i=iu(e,t);return{bracketInfo:s.bracketInfo,range:i}}}return null}function QT(s,e,t,n,i,r,o,a,l,c,d=!1){if(o>200)return!0;e:for(;;)switch(s.kind){case 4:{const h=s.childrenLength;for(let u=0;u<h;u++){const f=s.getChild(u);if(f){if(t=Cn(e,f.length),$g(e,i)&&o1(t,n)){if(o1(t,i)){s=f;continue e}if(!QT(f,e,t,n,i,r,o,0,l,c))return!1}e=t}}return!0}case 2:{const h=!c||!s.closingBracket||s.closingBracket.bracketInfo.closesColorized(s.openingBracket.bracketInfo);let u=0;if(l){let g=l.get(s.openingBracket.text);g===void 0&&(g=0),u=g,h&&(g++,l.set(s.openingBracket.text,g))}const f=s.childrenLength;for(let g=0;g<f;g++){const p=s.getChild(g);if(p){if(t=Cn(e,p.length),$g(e,i)&&o1(t,n)){if(o1(t,i)&&p.kind!==1){s=p,h?(o++,a=u+1):a=u;continue e}if((h||p.kind!==1||!s.closingBracket)&&!QT(p,e,t,n,i,r,h?o+1:o,h?u+1:u,l,c,!s.closingBracket))return!1}e=t}}return l?.set(s.openingBracket.text,u),!0}case 3:{const h=iu(e,t);return r(new CV(h,o-1,0,!0))}case 1:{const h=iu(e,t);return r(new CV(h,o-1,a-1,d))}case 0:return!0}}class S_e{constructor(e,t,n){this.push=e,this.includeMinIndentation=t,this.textModel=n}}function JT(s,e,t,n,i,r,o,a){if(o>200)return!0;let l=!0;if(s.kind===2){let c=0;if(a){let u=a.get(s.openingBracket.text);u===void 0&&(u=0),c=u,u++,a.set(s.openingBracket.text,u)}const d=Cn(e,s.openingBracket.length);let h=-1;if(r.includeMinIndentation&&(h=s.computeMinIndentation(e,r.textModel)),l=r.push(new t_e(iu(e,t),iu(e,d),s.closingBracket?iu(Cn(d,s.child?.length||_s),t):void 0,o,c,s,h)),e=d,l&&s.child){const u=s.child;if(t=Cn(e,u.length),$g(e,i)&&o1(t,n)&&(l=JT(u,e,t,n,i,r,o+1,a),!l))return!1}a?.set(s.openingBracket.text,c)}else{let c=e;for(const d of s.children){const h=c;if(c=Cn(c,d.length),$g(h,i)&&$g(n,c)&&(l=JT(d,h,c,n,i,r,o,a),!l))return!1}}return l}class x_e extends U{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Bn),this.onDidChangeEmitter=new A,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new le;this.bracketPairsTree.value=L_e(e.add(new y_e(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||Jd.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||Jd.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||Jd.empty}findMatchingBracketUp(e,t,n){const i=this.textModel.validatePosition(t),r=this.textModel.getLanguageIdAtPosition(i.lineNumber,i.column);if(this.canBuildAST){const o=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew.getClosingBracketInfo(e);if(!o)return null;const a=this.getBracketPairsInRange(R.fromPositions(t,t)).findLast(l=>o.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const o=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(r).brackets;if(!a)return null;const l=a.textIsBracket[o];return l?Zv(this._findMatchingBracketUp(l,i,eI(n))):null}}matchBracket(e,t){if(this.canBuildAST){const n=this.getBracketPairsInRange(R.fromPositions(e,e)).filter(i=>i.closingBracketRange!==void 0&&(i.openingBracketRange.containsPosition(e)||i.closingBracketRange.containsPosition(e))).findLastMaxBy(Ks(i=>i.openingBracketRange.containsPosition(e)?i.openingBracketRange:i.closingBracketRange,R.compareRangesUsingStarts));return n?[n.openingBracketRange,n.closingBracketRange]:null}else{const n=eI(t);return this._matchBracket(this.textModel.validatePosition(e),n)}}_establishBracketSearchOffsets(e,t,n,i){const r=t.getCount(),o=t.getLanguageId(i);let a=Math.max(0,e.column-1-n.maxBracketLength);for(let c=i-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(da(t.getStandardTokenType(c))||t.getLanguageId(c)!==o){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+n.maxBracketLength);for(let c=i+1;c<r;c++){const d=t.getStartOffset(c);if(d>=l)break;if(da(t.getStandardTokenType(c))||t.getLanguageId(c)!==o){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const n=e.lineNumber,i=this.textModel.tokenization.getLineTokens(n),r=this.textModel.getLineContent(n),o=i.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(i.getLanguageId(o)).brackets;if(a&&!da(i.getStandardTokenType(o))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,i,a,o),d=null;for(;;){const h=Qr.findNextBracketInRange(a.forwardRegex,n,r,l,c);if(!h)break;if(h.startColumn<=e.column&&e.column<=h.endColumn){const u=r.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),f=this._matchFoundBracket(h,a.textIsBracket[u],a.textIsOpenBracket[u],t);if(f){if(f instanceof Fl)return null;d=f}}l=h.endColumn-1}if(d)return d}if(o>0&&i.getStartOffset(o)===e.column-1){const l=o-1,c=this.languageConfigurationService.getLanguageConfiguration(i.getLanguageId(l)).brackets;if(c&&!da(i.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:h}=this._establishBracketSearchOffsets(e,i,c,l),u=Qr.findPrevBracketInRange(c.reversedRegex,n,r,d,h);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn){const f=r.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),g=this._matchFoundBracket(u,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Fl?null:g}}}return null}_matchFoundBracket(e,t,n,i){if(!t)return null;const r=n?this._findMatchingBracketDown(t,e.getEndPosition(),i):this._findMatchingBracketUp(t,e.getStartPosition(),i);return r?r instanceof Fl?r:[e,r]:null}_findMatchingBracketUp(e,t,n){const i=e.languageId,r=e.reversedRegex;let o=-1,a=0;const l=(c,d,h,u)=>{for(;;){if(n&&++a%100===0&&!n())return Fl.INSTANCE;const f=Qr.findPrevBracketInRange(r,c,d,h,u);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?o++:e.isClose(g)&&o--,o===0)return f;u=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),h=d.getCount(),u=this.textModel.getLineContent(c);let f=h-1,g=u.length,p=u.length;c===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let m=!0;for(;f>=0;f--){const b=d.getLanguageId(f)===i&&!da(d.getStandardTokenType(f));if(b)m?g=d.getStartOffset(f):(g=d.getStartOffset(f),p=d.getEndOffset(f));else if(m&&g!==p){const w=l(c,u,g,p);if(w)return w}m=b}if(m&&g!==p){const b=l(c,u,g,p);if(b)return b}}return null}_findMatchingBracketDown(e,t,n){const i=e.languageId,r=e.forwardRegex;let o=1,a=0;const l=(d,h,u,f)=>{for(;;){if(n&&++a%100===0&&!n())return Fl.INSTANCE;const g=Qr.findNextBracketInRange(r,d,h,u,f);if(!g)break;const p=h.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?o++:e.isClose(p)&&o--,o===0)return g;u=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const h=this.textModel.tokenization.getLineTokens(d),u=h.getCount(),f=this.textModel.getLineContent(d);let g=0,p=0,m=0;d===t.lineNumber&&(g=h.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let b=!0;for(;g<u;g++){const w=h.getLanguageId(g)===i&&!da(h.getStandardTokenType(g));if(w)b||(p=h.getStartOffset(g)),m=h.getEndOffset(g);else if(b&&p!==m){const C=l(d,f,p,m);if(C)return C}b=w}if(b&&p!==m){const w=l(d,f,p,m);if(w)return w}}return null}findPrevBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketBefore(t)||null;let n=null,i=null,r=null;for(let o=t.lineNumber;o>=1;o--){const a=this.textModel.tokenization.getLineTokens(o),l=a.getCount(),c=this.textModel.getLineContent(o);let d=l-1,h=c.length,u=c.length;if(o===t.lineNumber){d=a.findTokenIndexAtOffset(t.column-1),h=t.column-1,u=t.column-1;const g=a.getLanguageId(d);n!==g&&(n=g,i=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let f=!0;for(;d>=0;d--){const g=a.getLanguageId(d);if(n!==g){if(i&&r&&f&&h!==u){const m=Qr.findPrevBracketInRange(i.reversedRegex,o,c,h,u);if(m)return this._toFoundBracket(r,m);f=!1}n=g,i=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const p=!!i&&!da(a.getStandardTokenType(d));if(p)f?h=a.getStartOffset(d):(h=a.getStartOffset(d),u=a.getEndOffset(d));else if(r&&i&&f&&h!==u){const m=Qr.findPrevBracketInRange(i.reversedRegex,o,c,h,u);if(m)return this._toFoundBracket(r,m)}f=p}if(r&&i&&f&&h!==u){const g=Qr.findPrevBracketInRange(i.reversedRegex,o,c,h,u);if(g)return this._toFoundBracket(r,g)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const n=this.textModel.getLineCount();let i=null,r=null,o=null;for(let a=t.lineNumber;a<=n;a++){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let h=0,u=0,f=0;if(a===t.lineNumber){h=l.findTokenIndexAtOffset(t.column-1),u=t.column-1,f=t.column-1;const p=l.getLanguageId(h);i!==p&&(i=p,r=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let g=!0;for(;h<c;h++){const p=l.getLanguageId(h);if(i!==p){if(o&&r&&g&&u!==f){const b=Qr.findNextBracketInRange(r.forwardRegex,a,d,u,f);if(b)return this._toFoundBracket(o,b);g=!1}i=p,r=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const m=!!r&&!da(l.getStandardTokenType(h));if(m)g||(u=l.getStartOffset(h)),f=l.getEndOffset(h);else if(o&&r&&g&&u!==f){const b=Qr.findNextBracketInRange(r.forwardRegex,a,d,u,f);if(b)return this._toFoundBracket(o,b)}g=m}if(o&&r&&g&&u!==f){const p=Qr.findNextBracketInRange(r.forwardRegex,a,d,u,f);if(p)return this._toFoundBracket(o,p)}}return null}findEnclosingBrackets(e,t){const n=this.textModel.validatePosition(e);if(this.canBuildAST){const f=R.fromPositions(n),g=this.getBracketPairsInRange(R.fromPositions(n,n)).findLast(p=>p.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const i=eI(t),r=this.textModel.getLineCount(),o=new Map;let a=[];const l=(f,g)=>{if(!o.has(f)){const p=[];for(let m=0,b=g?g.brackets.length:0;m<b;m++)p[m]=0;o.set(f,p)}a=o.get(f)};let c=0;const d=(f,g,p,m,b)=>{for(;;){if(i&&++c%100===0&&!i())return Fl.INSTANCE;const w=Qr.findNextBracketInRange(f.forwardRegex,g,p,m,b);if(!w)break;const C=p.substring(w.startColumn-1,w.endColumn-1).toLowerCase(),v=f.textIsBracket[C];if(v&&(v.isOpen(C)?a[v.index]++:v.isClose(C)&&a[v.index]--,a[v.index]===-1))return this._matchFoundBracket(w,v,!1,i);m=w.endColumn-1}return null};let h=null,u=null;for(let f=n.lineNumber;f<=r;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),m=this.textModel.getLineContent(f);let b=0,w=0,C=0;if(f===n.lineNumber){b=g.findTokenIndexAtOffset(n.column-1),w=n.column-1,C=n.column-1;const S=g.getLanguageId(b);h!==S&&(h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u))}let v=!0;for(;b<p;b++){const S=g.getLanguageId(b);if(h!==S){if(u&&v&&w!==C){const L=d(u,f,m,w,C);if(L)return Zv(L);v=!1}h=S,u=this.languageConfigurationService.getLanguageConfiguration(h).brackets,l(h,u)}const k=!!u&&!da(g.getStandardTokenType(b));if(k)v||(w=g.getStartOffset(b)),C=g.getEndOffset(b);else if(u&&v&&w!==C){const L=d(u,f,m,w,C);if(L)return Zv(L)}v=k}if(u&&v&&w!==C){const S=d(u,f,m,w,C);if(S)return Zv(S)}}return null}_toFoundBracket(e,t){if(!t)return null;let n=this.textModel.getValueInRange(t);n=n.toLowerCase();const i=e.getBracketInfo(n);return i?{range:t,bracketInfo:i}:null}}function L_e(s,e){return{object:s,dispose:()=>e?.dispose()}}function eI(s){if(typeof s>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=s}}const Tx=class Tx{constructor(){this._searchCanceledBrand=void 0}};Tx.INSTANCE=new Tx;let Fl=Tx;function Zv(s){return s instanceof Fl?null:s}class k_e extends U{constructor(e){super(),this.textModel=e,this.colorProvider=new DV,this.onDidChangeEmitter=new A,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,n,i){return i?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(o=>({id:`bracket${o.range.toString()}-${o.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(o,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:o.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new R(1,1,this.textModel.getLineCount(),1),e,t):[]}}class DV{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Rl((s,e)=>{const t=[TB,IB,MB,RB,AB,OB],n=new DV;e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${s.getColor(Vge)}; }`);const i=t.map(r=>s.getColor(r)).filter(r=>!!r).filter(r=>!r.isTransparent());for(let r=0;r<30;r++){const o=i[r%i.length];e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(r)} { color: ${o}; }`)}});function Qv(s){return s.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class li{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,i){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=i}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${Qv(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${Qv(this.oldText)}")`:`(replace@${this.oldPosition} "${Qv(this.oldText)}" with "${Qv(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){const i=t.length;So(e,i,n),n+=4;for(let r=0;r<i;r++)hoe(e,t.charCodeAt(r),n),n+=2;return n}static _readString(e,t){const n=yo(e,t);return t+=4,Ele(e,t,n)}writeSize(){return 8+li._writeStringSize(this.oldText)+li._writeStringSize(this.newText)}write(e,t){return So(e,this.oldPosition,t),t+=4,So(e,this.newPosition,t),t+=4,t=li._writeString(e,this.oldText,t),t=li._writeString(e,this.newText,t),t}static read(e,t,n){const i=yo(e,t);t+=4;const r=yo(e,t);t+=4;const o=li._readString(e,t);t+=li._writeStringSize(o);const a=li._readString(e,t);return t+=li._writeStringSize(a),n.push(new li(i,o,r,a)),t}}function E_e(s,e){return s===null||s.length===0?e:new ba(s,e).compress()}class ba{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,n=this._getPrev(e),i=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(n===null){this._acceptCurr(i),i=this._getCurr(++t);continue}if(i===null){this._acceptPrev(n),n=this._getPrev(++e);continue}if(i.oldEnd<=n.newPosition){this._acceptCurr(i),i=this._getCurr(++t);continue}if(n.newEnd<=i.oldPosition){this._acceptPrev(n),n=this._getPrev(++e);continue}if(i.oldPosition<n.newPosition){const[c,d]=ba._splitCurr(i,n.newPosition-i.oldPosition);this._acceptCurr(c),i=d;continue}if(n.newPosition<i.oldPosition){const[c,d]=ba._splitPrev(n,i.oldPosition-n.newPosition);this._acceptPrev(c),n=d;continue}let a,l;if(i.oldEnd===n.newEnd)a=n,l=i,n=this._getPrev(++e),i=this._getCurr(++t);else if(i.oldEnd<n.newEnd){const[c,d]=ba._splitPrev(n,i.oldLength);a=c,l=i,n=d,i=this._getCurr(++t)}else{const[c,d]=ba._splitCurr(i,n.newLength);a=n,l=c,n=this._getPrev(++e),i=d}this._result[this._resultLen++]=new li(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const r=ba._merge(this._result);return ba._removeNoOps(r)}_acceptCurr(e){this._result[this._resultLen++]=ba._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=ba._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new li(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new li(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const n=e.newText.substr(0,t),i=e.newText.substr(t);return[new li(e.oldPosition,e.oldText,e.newPosition,n),new li(e.oldEnd,"",e.newPosition+t,i)]}static _splitCurr(e,t){const n=e.oldText.substr(0,t),i=e.oldText.substr(t);return[new li(e.oldPosition,n,e.newPosition,e.newText),new li(e.oldPosition+t,i,e.newEnd,"")]}static _merge(e){if(e.length===0)return e;const t=[];let n=0,i=e[0];for(let r=1;r<e.length;r++){const o=e[r];i.oldEnd===o.oldPosition?i=new li(i.oldPosition,i.oldText+o.oldText,i.newPosition,i.newText+o.newText):(t[n++]=i,i=o)}return t[n++]=i,t}static _removeNoOps(e){if(e.length===0)return e;const t=[];let n=0;for(let i=0;i<e.length;i++){const r=e[i];r.oldText!==r.newText&&(t[n++]=r)}return t}}const N_e=Symbol("TextModelEditSource");class TV{constructor(e,t){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){const e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e,t={}){const n=this.metadata;return Object.entries(n).filter(([r,o])=>{const a=t[r];return a!==void 0?a:(r.match(/\$/g)||[]).length<=e&&o!==void 0&&o!==null&&o!==""}).map(([r,o])=>`${r}:${o}`).join("-")}}function bs(s){return new TV(s,N_e)}const Rr={unknown(s){return bs({source:"unknown",name:s.name})},rename:()=>bs({source:"rename"}),chatApplyEdits(s){return bs({source:"Chat.applyEdits",$modelId:IV(s.modelId),$extensionId:s.extensionId?.extensionId,$extensionVersion:s.extensionId?.version,$$languageId:s.languageId,$$sessionId:s.sessionId,$$requestId:s.requestId,$$mode:s.mode,$$codeBlockSuggestionId:s.codeBlockSuggestionId})},chatUndoEdits:()=>bs({source:"Chat.undoEdits"}),chatReset:()=>bs({source:"Chat.reset"}),inlineCompletionAccept(s){return bs({source:"inlineCompletionAccept",$nes:s.nes,...Jv(s.providerId),$$requestUuid:s.requestUuid,$$languageId:s.languageId})},inlineCompletionPartialAccept(s){return bs({source:"inlineCompletionPartialAccept",type:s.type,$nes:s.nes,...Jv(s.providerId),$$requestUuid:s.requestUuid,$$languageId:s.languageId})},inlineChatApplyEdit(s){return bs({source:"inlineChat.applyEdits",$modelId:IV(s.modelId),$extensionId:s.extensionId?.extensionId,$extensionVersion:s.extensionId?.version,$$requestId:s.requestId,$$languageId:s.languageId})},reloadFromDisk:()=>bs({source:"reloadFromDisk"}),cursor(s){return bs({source:"cursor",kind:s.kind,detailedSource:s.detailedSource})},setValue:()=>bs({source:"setValue"}),eolChange:()=>bs({source:"eolChange"}),applyEdits:()=>bs({source:"applyEdits"}),snippet:()=>bs({source:"snippet"}),suggest:s=>bs({source:"suggest",...Jv(s.providerId)}),codeAction:s=>bs({source:"codeAction",$kind:s.kind,...Jv(s.providerId)})};function Jv(s){return s?{$extensionId:s.extensionId,$extensionVersion:s.extensionVersion,$providerId:s.providerId}:{}}function IV(s){if(s!==void 0)return s.replaceAll("/","|")}class ey{static fromText(e){const t=As.ofText(e).lineCount,n=e.length;return new ey(t,0,n,0)}static tryCreate(e,t,n,i){if(!(e===void 0||t===void 0||n===void 0||i===void 0))return new ey(e,t,n,i)}constructor(e,t,n,i){this.linesAdded=e,this.linesRemoved=t,this.charsAdded=n,this.charsRemoved=i}}var MV;(function(s){function e(){const t=vfe("sgt");return t}s.newId=e})(MV||(MV={}));function $Te(s){return s}function jg(s){return s.toString()}class Kn{static create(e,t){const n=e.getAlternativeVersionId(),i=tI(e);return new Kn(n,n,i,i,t,t,[])}constructor(e,t,n,i,r,o,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=n,this.afterEOL=i,this.beforeCursorState=r,this.afterCursorState=o,this.changes=a}append(e,t,n,i,r){t.length>0&&(this.changes=E_e(this.changes,t)),this.afterEOL=n,this.afterVersionId=i,this.afterCursorState=r}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,n){if(So(e,t?t.length:0,n),n+=4,t)for(const i of t)So(e,i.selectionStartLineNumber,n),n+=4,So(e,i.selectionStartColumn,n),n+=4,So(e,i.positionLineNumber,n),n+=4,So(e,i.positionColumn,n),n+=4;return n}static _readSelections(e,t,n){const i=yo(e,t);t+=4;for(let r=0;r<i;r++){const o=yo(e,t);t+=4;const a=yo(e,t);t+=4;const l=yo(e,t);t+=4;const c=yo(e,t);t+=4,n.push(new Ae(o,a,l,c))}return t}serialize(){let e=10+Kn._writeSelectionsSize(this.beforeCursorState)+Kn._writeSelectionsSize(this.afterCursorState)+4;for(const i of this.changes)e+=i.writeSize();const t=new Uint8Array(e);let n=0;So(t,this.beforeVersionId,n),n+=4,So(t,this.afterVersionId,n),n+=4,zF(t,this.beforeEOL,n),n+=1,zF(t,this.afterEOL,n),n+=1,n=Kn._writeSelections(t,this.beforeCursorState,n),n=Kn._writeSelections(t,this.afterCursorState,n),So(t,this.changes.length,n),n+=4;for(const i of this.changes)n=i.write(t,n);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let n=0;const i=yo(t,n);n+=4;const r=yo(t,n);n+=4;const o=HF(t,n);n+=1;const a=HF(t,n);n+=1;const l=[];n=Kn._readSelections(t,n,l);const c=[];n=Kn._readSelections(t,n,c);const d=yo(t,n);n+=4;const h=[];for(let u=0;u<d;u++)n=li.read(t,n,h);return new Kn(i,r,o,a,l,c,h)}}class RV{get type(){return 0}get resource(){return ze.isUri(this.model)?this.model:this.model.uri}constructor(e,t,n,i){this.label=e,this.code=t,this.model=n,this._data=Kn.create(n,i)}toString(){return(this._data instanceof Kn?this._data:Kn.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(ze.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Kn}append(e,t,n,i,r){this._data instanceof Kn&&this._data.append(e,t,n,i,r)}close(){this._data instanceof Kn&&(this._data=this._data.serialize())}open(){this._data instanceof Kn||(this._data=Kn.deserialize(this._data))}undo(){if(ze.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Kn&&(this._data=this._data.serialize());const e=Kn.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(ze.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Kn&&(this._data=this._data.serialize());const e=Kn.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Kn&&(this._data=this._data.serialize()),this._data.byteLength+168}}class D_e{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,n){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=n.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const r=jg(i.resource);this._editStackElementsMap.set(r,i)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=jg(e);return this._editStackElementsMap.has(t)}setModel(e){const t=jg(ze.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=jg(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,n,i,r){const o=jg(e.uri);this._editStackElementsMap.get(o).append(e,t,n,i,r)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=jg(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${FN(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function tI(s){return s.getEOL()===`
|
|
350
350
|
`?0:1}function Bl(s){return s?s instanceof RV||s instanceof D_e:!1}class nI{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Bl(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Bl(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const n=this._undoRedoService.getLastElement(this._model.uri);if(Bl(n)&&n.canAppend(this._model))return n;const i=new RV(_(781,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(i,t),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],tI(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,n,i,r=Rr.unknown({name:"pushEditOperation"})){const o=this._getOrCreateEditStackElement(e,i),a=this._model.applyEdits(t,!0,r),l=nI._computeCursorState(n,a),c=a.map((d,h)=>({index:h,textChange:d.textChange}));return c.sort((d,h)=>d.textChange.oldPosition===h.textChange.oldPosition?d.index-h.index:d.textChange.oldPosition-h.textChange.oldPosition),o.append(this._model,c.map(d=>d.textChange),tI(this._model),this._model.getAlternativeVersionId(),l),l}static _computeCursorState(e,t){try{return e?e(t):null}catch(n){return dt(n),null}}}class T_e{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function I_e(s,e,t,n,i){i.spacesDiff=0,i.looksLikeAlignment=!1;let r;for(r=0;r<e&&r<n;r++){const u=s.charCodeAt(r),f=t.charCodeAt(r);if(u!==f)break}let o=0,a=0;for(let u=r;u<e;u++)s.charCodeAt(u)===32?o++:a++;let l=0,c=0;for(let u=r;u<n;u++)t.charCodeAt(u)===32?l++:c++;if(o>0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),h=Math.abs(o-l);if(d===0){i.spacesDiff=h,h>0&&0<=l-1&&l-1<s.length&&l<t.length&&t.charCodeAt(l)!==32&&s.charCodeAt(l-1)===32&&s.charCodeAt(s.length-1)===44&&(i.looksLikeAlignment=!0);return}if(h%d===0){i.spacesDiff=h/d;return}}function AV(s,e,t){const n=Math.min(s.getLineCount(),1e4);let i=0,r=0,o="",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 T_e;for(let g=1;g<=n;g++){const p=s.getLineLength(g),m=s.getLineContent(g),b=p<=65536;let w=!1,C=0,v=0,S=0;for(let L=0,E=p;L<E;L++){const N=b?m.charCodeAt(L):s.getLineCharCode(g,L);if(N===9)S++;else if(N===32)v++;else{w=!0,C=L;break}}if(!w||(S>0?i++:v>1&&r++,I_e(o,a,m,C,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const k=h.spacesDiff;k<=c&&d[k]++,o=m,a=C}let u=t;i!==r&&(u=i<r);let f=e;if(u){let g=u?0:.1*n;l.forEach(p=>{const m=d[p];m>g&&(g=m,f=p)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}function ws(s){return(s.metadata&1)>>>0}function Dt(s,e){s.metadata=s.metadata&254|e<<0}function ci(s){return(s.metadata&2)>>>1===1}function xt(s,e){s.metadata=s.metadata&253|(e?1:0)<<1}function OV(s){return(s.metadata&4)>>>2===1}function PV(s,e){s.metadata=s.metadata&251|(e?1:0)<<2}function FV(s){return(s.metadata&64)>>>6===1}function BV(s,e){s.metadata=s.metadata&191|(e?1:0)<<6}function VV(s){return(s.metadata&128)>>>7===1}function WV(s,e){s.metadata=s.metadata&127|(e?1:0)<<7}function M_e(s){return(s.metadata&24)>>>3}function HV(s,e){s.metadata=s.metadata&231|e<<3}function R_e(s){return(s.metadata&32)>>>5===1}function zV(s,e){s.metadata=s.metadata&223|(e?1:0)<<5}class $V{constructor(e,t,n){this.metadata=0,this.parent=this,this.left=this,this.right=this,Dt(this,1),this.start=t,this.end=n,this.delta=0,this.maxEnd=n,this.id=e,this.ownerId=0,this.options=null,PV(this,!1),BV(this,!1),HV(this,1),zV(this,!1),WV(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=null,xt(this,!1)}reset(e,t,n,i){this.start=t,this.end=n,this.maxEnd=n,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=n,this.range=i}setOptions(e){this.options=e;const t=this.options.className;PV(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),BV(this,this.options.glyphMarginClassName!==null),HV(this,this.options.stickiness),zV(this,this.options.collapseOnReplaceEdit),WV(this,this.options.affectsFont??!1)}setCachedOffsets(e,t,n){this.cachedVersionId!==n&&(this.range=null),this.cachedVersionId=n,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Oe=new $V(null,0,0);Oe.parent=Oe,Oe.left=Oe,Oe.right=Oe,Dt(Oe,0);class iI{constructor(){this.root=Oe,this.requestNormalizeDelta=!1}intervalSearch(e,t,n,i,r,o,a){return this.root===Oe?[]:H_e(this,e,t,n,i,r,o,a)}search(e,t,n,i,r){return this.root===Oe?[]:W_e(this,e,t,n,i,r)}collectNodesFromOwner(e){return B_e(this,e)}collectNodesPostOrder(){return V_e(this)}insert(e){UV(this,e),this._normalizeDeltaIfNecessary()}delete(e){jV(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const n=e;let i=0;for(;e!==this.root;)e===e.parent.right&&(i+=e.parent.delta),e=e.parent;const r=n.start+i,o=n.end+i;n.setCachedOffsets(r,o,t)}acceptReplace(e,t,n,i){const r=P_e(this,e,e+t);for(let o=0,a=r.length;o<a;o++){const l=r[o];jV(this,l)}this._normalizeDeltaIfNecessary(),F_e(this,e,e+t,n),this._normalizeDeltaIfNecessary();for(let o=0,a=r.length;o<a;o++){const l=r[o];l.start=l.cachedAbsoluteStart,l.end=l.cachedAbsoluteEnd,O_e(l,e,e+t,n,i),l.maxEnd=l.end,UV(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,A_e(this))}}function A_e(s){let e=s.root,t=0;for(;e!==Oe;){if(e.left!==Oe&&!ci(e.left)){e=e.left;continue}if(e.right!==Oe&&!ci(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,gd(e),xt(e,!0),xt(e.left,!1),xt(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}xt(s.root,!1)}function Kg(s,e,t,n){return s<t?!0:s>t||n===1?!1:n===2?!0:e}function O_e(s,e,t,n,i){const r=M_e(s),o=r===0||r===2,a=r===1||r===2,l=t-e,c=n,d=Math.min(l,c),h=s.start;let u=!1;const f=s.end;let g=!1;e<=h&&f<=t&&R_e(s)&&(s.start=e,u=!0,s.end=e,g=!0);{const m=i?1:l>0?2:0;!u&&Kg(h,o,e,m)&&(u=!0),!g&&Kg(f,a,e,m)&&(g=!0)}if(d>0&&!i){const m=l>c?2:0;!u&&Kg(h,o,e+d,m)&&(u=!0),!g&&Kg(f,a,e+d,m)&&(g=!0)}{const m=i?1:0;!u&&Kg(h,o,t,m)&&(s.start=e+c,u=!0),!g&&Kg(f,a,t,m)&&(s.end=e+c,g=!0)}const p=c-l;u||(s.start=Math.max(0,h+p)),g||(s.end=Math.max(0,f+p)),s.start>s.end&&(s.end=s.start)}function P_e(s,e,t){let n=s.root,i=0,r=0,o=0,a=0;const l=[];let c=0;for(;n!==Oe;){if(ci(n)){xt(n.left,!1),xt(n.right,!1),n===n.parent.right&&(i-=n.parent.delta),n=n.parent;continue}if(!ci(n.left)){if(r=i+n.maxEnd,r<e){xt(n,!0);continue}if(n.left!==Oe){n=n.left;continue}}if(o=i+n.start,o>t){xt(n,!0);continue}if(a=i+n.end,a>=e&&(n.setCachedOffsets(o,a,0),l[c++]=n),xt(n,!0),n.right!==Oe&&!ci(n.right)){i+=n.delta,n=n.right;continue}}return xt(s.root,!1),l}function F_e(s,e,t,n){let i=s.root,r=0,o=0,a=0;const l=n-(t-e);for(;i!==Oe;){if(ci(i)){xt(i.left,!1),xt(i.right,!1),i===i.parent.right&&(r-=i.parent.delta),gd(i),i=i.parent;continue}if(!ci(i.left)){if(o=r+i.maxEnd,o<e){xt(i,!0);continue}if(i.left!==Oe){i=i.left;continue}}if(a=r+i.start,a>t){i.start+=l,i.end+=l,i.delta+=l,(i.delta<-1073741824||i.delta>1073741824)&&(s.requestNormalizeDelta=!0),xt(i,!0);continue}if(xt(i,!0),i.right!==Oe&&!ci(i.right)){r+=i.delta,i=i.right;continue}}xt(s.root,!1)}function B_e(s,e){let t=s.root;const n=[];let i=0;for(;t!==Oe;){if(ci(t)){xt(t.left,!1),xt(t.right,!1),t=t.parent;continue}if(t.left!==Oe&&!ci(t.left)){t=t.left;continue}if(t.ownerId===e&&(n[i++]=t),xt(t,!0),t.right!==Oe&&!ci(t.right)){t=t.right;continue}}return xt(s.root,!1),n}function V_e(s){let e=s.root;const t=[];let n=0;for(;e!==Oe;){if(ci(e)){xt(e.left,!1),xt(e.right,!1),e=e.parent;continue}if(e.left!==Oe&&!ci(e.left)){e=e.left;continue}if(e.right!==Oe&&!ci(e.right)){e=e.right;continue}t[n++]=e,xt(e,!0)}return xt(s.root,!1),t}function W_e(s,e,t,n,i,r){let o=s.root,a=0,l=0,c=0;const d=[];let h=0;for(;o!==Oe;){if(ci(o)){xt(o.left,!1),xt(o.right,!1),o===o.parent.right&&(a-=o.parent.delta),o=o.parent;continue}if(o.left!==Oe&&!ci(o.left)){o=o.left;continue}l=a+o.start,c=a+o.end,o.setCachedOffsets(l,c,i);let u=!0;if(e&&o.ownerId&&o.ownerId!==e&&(u=!1),t&&OV(o)&&(u=!1),n&&VV(o)&&(u=!1),r&&!FV(o)&&(u=!1),u&&(d[h++]=o),xt(o,!0),o.right!==Oe&&!ci(o.right)){a+=o.delta,o=o.right;continue}}return xt(s.root,!1),d}function H_e(s,e,t,n,i,r,o,a){let l=s.root,c=0,d=0,h=0,u=0;const f=[];let g=0;for(;l!==Oe;){if(ci(l)){xt(l.left,!1),xt(l.right,!1),l===l.parent.right&&(c-=l.parent.delta),l=l.parent;continue}if(!ci(l.left)){if(d=c+l.maxEnd,d<e){xt(l,!0);continue}if(l.left!==Oe){l=l.left;continue}}if(h=c+l.start,h>t){xt(l,!0);continue}if(u=c+l.end,u>=e){l.setCachedOffsets(h,u,o);let p=!0;n&&l.ownerId&&l.ownerId!==n&&(p=!1),i&&OV(l)&&(p=!1),r&&VV(l)&&(p=!1),a&&!FV(l)&&(p=!1),p&&(f[g++]=l)}if(xt(l,!0),l.right!==Oe&&!ci(l.right)){c+=l.delta,l=l.right;continue}}return xt(s.root,!1),f}function UV(s,e){if(s.root===Oe)return e.parent=Oe,e.left=Oe,e.right=Oe,Dt(e,0),s.root=e,s.root;z_e(s,e),pd(e.parent);let t=e;for(;t!==s.root&&ws(t.parent)===1;)if(t.parent===t.parent.parent.left){const n=t.parent.parent.right;ws(n)===1?(Dt(t.parent,0),Dt(n,0),Dt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,d1(s,t)),Dt(t.parent,0),Dt(t.parent.parent,1),h1(s,t.parent.parent))}else{const n=t.parent.parent.left;ws(n)===1?(Dt(t.parent,0),Dt(n,0),Dt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,h1(s,t)),Dt(t.parent,0),Dt(t.parent.parent,1),d1(s,t.parent.parent))}return Dt(s.root,0),e}function z_e(s,e){let t=0,n=s.root;const i=e.start,r=e.end;for(;;)if(U_e(i,r,n.start+t,n.end+t)<0)if(n.left===Oe){e.start-=t,e.end-=t,e.maxEnd-=t,n.left=e;break}else n=n.left;else if(n.right===Oe){e.start-=t+n.delta,e.end-=t+n.delta,e.maxEnd-=t+n.delta,n.right=e;break}else t+=n.delta,n=n.right;e.parent=n,e.left=Oe,e.right=Oe,Dt(e,1)}function jV(s,e){let t,n;if(e.left===Oe?(t=e.right,n=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===Oe?(t=e.left,n=e):(n=$_e(e.right),t=n.right,t.start+=n.delta,t.end+=n.delta,t.delta+=n.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),n.start+=e.delta,n.end+=e.delta,n.delta=e.delta,(n.delta<-1073741824||n.delta>1073741824)&&(s.requestNormalizeDelta=!0)),n===s.root){s.root=t,Dt(t,0),e.detach(),sI(),gd(t),s.root.parent=Oe;return}const i=ws(n)===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?t.parent=n.parent:(n.parent===e?t.parent=n:t.parent=n.parent,n.left=e.left,n.right=e.right,n.parent=e.parent,Dt(n,ws(e)),e===s.root?s.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==Oe&&(n.left.parent=n),n.right!==Oe&&(n.right.parent=n)),e.detach(),i){pd(t.parent),n!==e&&(pd(n),pd(n.parent)),sI();return}pd(t),pd(t.parent),n!==e&&(pd(n),pd(n.parent));let r;for(;t!==s.root&&ws(t)===0;)t===t.parent.left?(r=t.parent.right,ws(r)===1&&(Dt(r,0),Dt(t.parent,1),d1(s,t.parent),r=t.parent.right),ws(r.left)===0&&ws(r.right)===0?(Dt(r,1),t=t.parent):(ws(r.right)===0&&(Dt(r.left,0),Dt(r,1),h1(s,r),r=t.parent.right),Dt(r,ws(t.parent)),Dt(t.parent,0),Dt(r.right,0),d1(s,t.parent),t=s.root)):(r=t.parent.left,ws(r)===1&&(Dt(r,0),Dt(t.parent,1),h1(s,t.parent),r=t.parent.left),ws(r.left)===0&&ws(r.right)===0?(Dt(r,1),t=t.parent):(ws(r.left)===0&&(Dt(r.right,0),Dt(r,1),d1(s,r),r=t.parent.left),Dt(r,ws(t.parent)),Dt(t.parent,0),Dt(r.left,0),h1(s,t.parent),t=s.root));Dt(t,0),sI()}function $_e(s){for(;s.left!==Oe;)s=s.left;return s}function sI(){Oe.parent=Oe,Oe.delta=0,Oe.start=0,Oe.end=0}function d1(s,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(s.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==Oe&&(t.left.parent=e),t.parent=e.parent,e.parent===Oe?s.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,gd(e),gd(t)}function h1(s,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(s.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==Oe&&(t.right.parent=e),t.parent=e.parent,e.parent===Oe?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,gd(e),gd(t)}function KV(s){let e=s.end;if(s.left!==Oe){const t=s.left.maxEnd;t>e&&(e=t)}if(s.right!==Oe){const t=s.right.maxEnd+s.delta;t>e&&(e=t)}return e}function gd(s){s.maxEnd=KV(s)}function pd(s){for(;s!==Oe;){const e=KV(s);if(s.maxEnd===e)return;s.maxEnd=e,s=s.parent}}function U_e(s,e,t,n){return s===t?e-n:s-t}class rI{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==ke)return oI(this.right);let e=this;for(;e.parent!==ke&&e.parent.left!==e;)e=e.parent;return e.parent===ke?ke:e.parent}prev(){if(this.left!==ke)return qV(this.left);let e=this;for(;e.parent!==ke&&e.parent.right!==e;)e=e.parent;return e.parent===ke?ke:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const ke=new rI(null,0);ke.parent=ke,ke.left=ke,ke.right=ke,ke.color=0;function oI(s){for(;s.left!==ke;)s=s.left;return s}function qV(s){for(;s.right!==ke;)s=s.right;return s}function aI(s){return s===ke?0:s.size_left+s.piece.length+aI(s.right)}function lI(s){return s===ke?0:s.lf_left+s.piece.lineFeedCnt+lI(s.right)}function cI(){ke.parent=ke}function u1(s,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==ke&&(t.left.parent=e),t.parent=e.parent,e.parent===ke?s.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function f1(s,e){const t=e.left;e.left=t.right,t.right!==ke&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===ke?s.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function ty(s,e){let t,n;if(e.left===ke?(n=e,t=n.right):e.right===ke?(n=e,t=n.left):(n=oI(e.right),t=n.right),n===s.root){s.root=t,t.color=0,e.detach(),cI(),s.root.parent=ke;return}const i=n.color===1;if(n===n.parent.left?n.parent.left=t:n.parent.right=t,n===e?(t.parent=n.parent,g1(s,t)):(n.parent===e?t.parent=n:t.parent=n.parent,g1(s,t),n.left=e.left,n.right=e.right,n.parent=e.parent,n.color=e.color,e===s.root?s.root=n:e===e.parent.left?e.parent.left=n:e.parent.right=n,n.left!==ke&&(n.left.parent=n),n.right!==ke&&(n.right.parent=n),n.size_left=e.size_left,n.lf_left=e.lf_left,g1(s,n)),e.detach(),t.parent.left===t){const o=aI(t),a=lI(t);if(o!==t.parent.size_left||a!==t.parent.lf_left){const l=o-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=o,t.parent.lf_left=a,Vl(s,t.parent,l,c)}}if(g1(s,t.parent),i){cI();return}let r;for(;t!==s.root&&t.color===0;)t===t.parent.left?(r=t.parent.right,r.color===1&&(r.color=0,t.parent.color=1,u1(s,t.parent),r=t.parent.right),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.right.color===0&&(r.left.color=0,r.color=1,f1(s,r),r=t.parent.right),r.color=t.parent.color,t.parent.color=0,r.right.color=0,u1(s,t.parent),t=s.root)):(r=t.parent.left,r.color===1&&(r.color=0,t.parent.color=1,f1(s,t.parent),r=t.parent.left),r.left.color===0&&r.right.color===0?(r.color=1,t=t.parent):(r.left.color===0&&(r.right.color=0,r.color=1,u1(s,r),r=t.parent.left),r.color=t.parent.color,t.parent.color=0,r.left.color=0,f1(s,t.parent),t=s.root));t.color=0,cI()}function GV(s,e){for(g1(s,e);e!==s.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,u1(s,e)),e.parent.color=0,e.parent.parent.color=1,f1(s,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,f1(s,e)),e.parent.color=0,e.parent.parent.color=1,u1(s,e.parent.parent))}s.root.color=0}function Vl(s,e,t,n){for(;e!==s.root&&e!==ke;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}function g1(s,e){let t=0,n=0;if(e!==s.root){for(;e!==s.root&&e===e.parent.right;)e=e.parent;if(e!==s.root)for(e=e.parent,t=aI(e.left)-e.size_left,n=lI(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=n;e!==s.root&&(t!==0||n!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=n),e=e.parent}}const Wl=65535;function YV(s){let e;return s[s.length-1]<65536?e=new Uint16Array(s.length):e=new Uint32Array(s.length),e.set(s,0),e}class j_e{constructor(e,t,n,i,r){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=i,this.isBasicASCII=r}}function Hl(s,e=!0){const t=[0];let n=1;for(let i=0,r=s.length;i<r;i++){const o=s.charCodeAt(i);o===13?i+1<r&&s.charCodeAt(i+1)===10?(t[n++]=i+2,i++):t[n++]=i+1:o===10&&(t[n++]=i+1)}return e?YV(t):t}function K_e(s,e){s.length=0,s[0]=0;let t=1,n=0,i=0,r=0,o=!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?(r++,s[t++]=l+2,l++):(n++,s[t++]=l+1):d===10?(i++,s[t++]=l+1):o&&d!==9&&(d<32||d>126)&&(o=!1)}const a=new j_e(YV(s),n,i,r,o);return s.length=0,a}class Vs{constructor(e,t,n,i,r){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=i,this.length=r}}class ru{constructor(e,t){this.buffer=e,this.lineStarts=t}}class q_e{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==ke&&e.iterate(e.root,n=>(n!==ke&&this._pieces.push(n.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._pieces[this._index++])}}class G_e{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber<e&&n.nodeStartLineNumber+n.node.piece.lineFeedCnt>=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const n=this._cache;for(let i=0;i<n.length;i++){const r=n[i];if(r.node.parent===null||r.nodeStartOffset>=e){n[i]=null,t=!0;continue}}if(t){const i=[];for(const r of n)r!==null&&i.push(r);this._cache=i}}}class Y_e{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new ru("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=ke,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let i=null;for(let r=0,o=e.length;r<o;r++)if(e[r].buffer.length>0){e[r].lineStarts||(e[r].lineStarts=Hl(e[r].buffer));const a=new Vs(r+1,{line:0,column:0},{line:e[r].lineStarts.length-1,column:e[r].buffer.length-e[r].lineStarts[e[r].lineStarts.length-1]},e[r].lineStarts.length-1,e[r].buffer.length);this._buffers.push(e[r]),i=this.rbInsertRight(i,a)}this._searchCache=new G_e(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Wl,n=t-Math.floor(t/3),i=n*2;let r="",o=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(o<=n||o+d<i)return r+=c,o+=d,!0;const h=r.replace(/\r\n|\r|\n/g,e);return a.push(new ru(h,Hl(h))),r=c,o=d,!0}),o>0){const l=r.replace(/\r\n|\r|\n/g,e);a.push(new ru(l,Hl(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new q_e(this,e)}getOffsetAt(e,t){let n=0,i=this.root;for(;i!==ke;)if(i.left!==ke&&i.lf_left+1>=e)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt+1>=e){n+=i.size_left;const r=this.getAccumulatedValue(i,e-i.lf_left-2);return n+=r+t-1}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0;const i=e;for(;t!==ke;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const r=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+r.index,r.index===0){const o=this.getOffsetAt(n+1,1),a=i-o;return new P(n+1,a+1)}return new P(n+1,r.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===ke){const r=this.getOffsetAt(n+1,1),o=i-e-r;return new P(n+1,o+1)}else t=t.right;return new P(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const n=this.nodeAt2(e.startLineNumber,e.startColumn),i=this.nodeAt2(e.endLineNumber,e.endColumn),r=this.getValueInRange2(n,i);return t?t!==this._EOL||!this._EOLNormalized?r.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?r:r.replace(/\r\n|\r|\n/g,t):r}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let n=e.node;const i=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);let o=i.substring(r+e.remainder,r+n.piece.length);for(n=n.next();n!==ke;){const a=this._buffers[n.piece.bufferIndex].buffer,l=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){o+=a.substring(l,l+t.remainder);break}else o+=a.substr(l,n.piece.length);n=n.next()}return o}getLinesContent(){const e=[];let t=0,n="",i=!1;return this.iterate(this.root,r=>{if(r===ke)return!0;const o=r.piece;let a=o.length;if(a===0)return!0;const l=this._buffers[o.bufferIndex].buffer,c=this._buffers[o.bufferIndex].lineStarts,d=o.start.line,h=o.end.line;let u=c[d]+o.start.column;if(i&&(l.charCodeAt(u)===10&&(u++,a--),e[t++]=n,n="",i=!1,a===0))return!0;if(d===h)return!this._EOLNormalized&&l.charCodeAt(u+a-1)===13?(i=!0,n+=l.substr(u,a-1)):n+=l.substr(u,a),!0;n+=this._EOLNormalized?l.substring(u,Math.max(u,c[d+1]-this._EOLLength)):l.substring(u,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;for(let f=d+1;f<h;f++)n=this._EOLNormalized?l.substring(c[f],c[f+1]-this._EOLLength):l.substring(c[f],c[f+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=n;return!this._EOLNormalized&&l.charCodeAt(c[h]+o.end.column-1)===13?(i=!0,o.end.column===0?t--:n=l.substr(c[h],o.end.column-1)):n=l.substr(c[h],o.end.column),!0}),i&&(e[t++]=n,n=""),e[t++]=n,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,""),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const n=this._buffers[t.piece.bufferIndex],i=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return n.buffer.charCodeAt(i)}else{const t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(i)}}getLineCharCode(e,t){const n=this.nodeAt2(e,t+1);return this._getCharCode(n)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}getNearestChunk(e){const t=this.nodeAt(e);if(t.remainder===t.node.piece.length){const n=t.node.next();if(!n||n===ke)return"";const i=this._buffers[n.piece.bufferIndex],r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i.buffer.substring(r,r+n.piece.length)}else{const n=this._buffers[t.node.piece.bufferIndex],i=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start),r=i+t.remainder,o=i+t.node.piece.length;return n.buffer.substring(r,o)}}findMatchesInNode(e,t,n,i,r,o,a,l,c,d,h){const u=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,r),p=this.offsetInBuffer(e.piece.bufferIndex,o);let m;const b={line:0,column:0};let w,C;t._wordSeparators?(w=u.buffer.substring(g,p),C=v=>v+g,t.reset(0)):(w=u.buffer,C=v=>v,t.reset(g));do if(m=t.next(w),m){if(C(m.index)>=p)return d;this.positionInBuffer(e,C(m.index)-f,b);const v=this.getLineFeedCnt(e.piece.bufferIndex,r,b),S=b.line===r.line?b.column-r.column+i:b.column+1,k=S+m[0].length;if(h[d++]=Th(new R(n+v,S,n+v,k),m,l),C(m.index)+m[0].length>=p||d>=c)return d}while(m);return d}findMatchesLineByLine(e,t,n,i){const r=[];let o=0;const a=new hg(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const h=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,h,t,n,i,o,r),r;let u=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(p>=1){const b=this._buffers[f.piece.bufferIndex].lineStarts,w=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),C=b[d.line+p],v=u===e.startLineNumber?e.startColumn:1;if(o=this.findMatchesInNode(f,a,u,v,d,this.positionInBuffer(f,C-w),t,n,i,o,r),o>=i)return r;u+=p}const m=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){const b=this.getLineContent(u).substring(m,e.endColumn-1);return o=this._findMatchesInLine(t,a,b,e.endLineNumber,m,o,r,n,i),r}if(o=this._findMatchesInLine(t,a,this.getLineContent(u).substr(m),u,m,o,r,n,i),o>=i)return r;u++,l=this.nodeAt2(u,1),f=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(u===e.endLineNumber){const p=u===e.startLineNumber?e.startColumn-1:0,m=this.getLineContent(u).substring(p,e.endColumn-1);return o=this._findMatchesInLine(t,a,m,e.endLineNumber,p,o,r,n,i),r}const g=u===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(c.node,a,u,g,d,h,t,n,i,o,r),r}_findMatchesInLine(e,t,n,i,r,o,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const u=e.simpleSearch,f=u.length,g=n.length;let p=-f;for(;(p=n.indexOf(u,p+f))!==-1;)if((!d||eD(d,n,g,p,f))&&(a[o++]=new v_(new R(i,p+1+r,i,p+1+f+r),null),o>=c))return o;return o}let h;t.reset(0);do if(h=t.next(n),h&&(a[o++]=Th(new R(i,h.index+1+r,i,h.index+1+h[0].length+r),h,l),o>=c))return o;while(h);return o}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==ke){const{node:i,remainder:r,nodeStartOffset:o}=this.nodeAt(e),a=i.piece,l=a.bufferIndex,c=this.positionInBuffer(i,r);if(i.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&o+a.length===e&&t.length<Wl){this.appendToNode(i,t),this.computeBufferMetadata();return}if(o===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(o+i.piece.length>e){const d=[];let h=new Vs(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(i,r)===10){const p={line:h.start.line+1,column:0};h=new Vs(h.bufferIndex,p,h.end,this.getLineFeedCnt(h.bufferIndex,p,h.end),h.length-1),t+=`
|
|
351
351
|
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(i,r-1)===13){const p=this.positionInBuffer(i,r-1);this.deleteNodeTail(i,p),t="\r"+t,i.piece.length===0&&d.push(i)}else this.deleteNodeTail(i,c);else this.deleteNodeTail(i,c);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(i,h);let f=i;for(let g=0;g<u.length;g++)f=this.rbInsertRight(f,u[g]);this.deleteNodes(d)}else this.insertContentToNodeRight(t,i)}else{const i=this.createNewPieces(t);let r=this.rbInsertLeft(null,i[0]);for(let o=1;o<i.length;o++)r=this.rbInsertRight(r,i[o])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===ke)return;const n=this.nodeAt(e),i=this.nodeAt(e+t),r=n.node,o=i.node;if(r===o){const u=this.positionInBuffer(r,n.remainder),f=this.positionInBuffer(r,i.remainder);if(n.nodeStartOffset===e){if(t===r.piece.length){const g=r.next();ty(this,r),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(r,f),this._searchCache.validate(e),this.validateCRLFWithPrevNode(r),this.computeBufferMetadata();return}if(n.nodeStartOffset+r.piece.length===e+t){this.deleteNodeTail(r,u),this.validateCRLFWithNextNode(r),this.computeBufferMetadata();return}this.shrinkNode(r,u,f),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(r,n.remainder);this.deleteNodeTail(r,l),this._searchCache.validate(e),r.piece.length===0&&a.push(r);const c=this.positionInBuffer(o,i.remainder);this.deleteNodeHead(o,c),o.piece.length===0&&a.push(o);const d=r.next();for(let u=d;u!==ke&&u!==o;u=u.next())a.push(u);const h=r.piece.length===0?r.prev():r;this.deleteNodes(a),this.validateCRLFWithNextNode(h),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const n=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const o=t.piece,a={line:o.start.line+1,column:0},l=new Vs(o.bufferIndex,a,o.end,this.getLineFeedCnt(o.bufferIndex,a,o.end),o.length-1);t.piece=l,e+=`
|
|
352
352
|
`,Vl(this,t,-1,-1),t.piece.length===0&&n.push(t)}const i=this.createNewPieces(e);let r=this.rbInsertLeft(t,i[i.length-1]);for(let o=i.length-2;o>=0;o--)r=this.rbInsertLeft(r,i[o]);this.validateCRLFWithPrevNode(r),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
|
|
@@ -499,7 +499,7 @@ ${Yr(e)}
|
|
|
499
499
|
: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; }
|
|
500
500
|
: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; }
|
|
501
501
|
`;var zCe=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},$Ce=function(s,e){return function(t,n){e(t,n,s)}};let Wy=class extends U{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new EM(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,n){let i;t?t===this.layoutService.getContainer(pe(t))?i=1:n?i=3:i=2:i=1,this.contextView.setContainer(t??this.layoutService.activeContainer,i),this.contextView.show(e);const r={close:()=>{this.openContextView===r&&this.hideContextView()}};return this.openContextView=r,r}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};Wy=zCe([$Ce(0,jl)],Wy);class UCe extends Wy{getContextViewElement(){return this.contextView.getViewElement()}}function fz(s){const e=s;return typeof e=="object"&&"markdown"in e&&"markdownNotSupportedFallback"in e}class jCe{constructor(e,t,n){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=n}async update(e,t,n){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let i;if(Yn(e)||sn(e)||e===void 0)i=e;else{this._cancellationTokenSource=new Ff;const r=this._cancellationTokenSource.token;let o;if(fz(e)?Mf(e.markdown)?o=e.markdown(r).then(a=>a??e.markdownNotSupportedFallback):o=e.markdown??e.markdownNotSupportedFallback:o=e.element(r),o instanceof Promise?(this._hoverWidget||this.show(_(75,"Loading..."),t,n),i=await o):i=o,this.isDisposed||r.isCancellationRequested)return}this.show(i,t,n)}show(e,t,n){const i=this._hoverWidget;if(this.hasContent(e)){const r={content:e,target:this.target,actions:n?.actions,linkHandler:n?.linkHandler,trapFocus:n?.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!i,showHoverHint:n?.appearance?.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(r,t)}i?.dispose()}hasContent(e){return e?Xg(e)?!!e.value:!0:!1}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}var KCe=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Jg=function(s,e){return function(t,n){e(t,n,s)}};let NM=class extends U{constructor(e,t,n,i,r,o){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=i,this._layoutService=r,this._accessibilityService=o,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(n.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new Wy(this._layoutService)),this._register(Kc.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:199,when:re.editorTextFocus.negate(),primary:X7(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,n,i){const r=this._createHover(e,n);if(r)return this._showHover(r,e,t),r}showDelayedHover(e,t){if(e.id===void 0&&(e.id=gz(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if(this._currentHover?.isLocked)return;if(wd(this._currentHoverOptions)===wd(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&this._currentDelayedHoverGroupId!==void 0&&this._currentDelayedHoverGroupId===t?.groupId)return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&wd(this._currentHoverOptions)===wd(e))return this._currentDelayedHover;const n=this._createHover(e,void 0);if(!n){this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=void 0;return}return this._currentDelayedHover=n,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=t?.groupId,Kf(this._configurationService.getValue("workbench.hover.delay")).then(()=>{n&&!n.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(n,e))}),n}setupDelayedHover(e,t,n){const i=()=>({...typeof t=="function"?t():t,target:e});return this._setupDelayedHover(e,i,n)}setupDelayedHoverAtMouse(e,t,n){const i=r=>({...typeof t=="function"?t():t,target:{targetElements:[e],x:r!==void 0?r.x+10:void 0}});return this._setupDelayedHover(e,i,n)}_setupDelayedHover(e,t,n){const i=new le;return i.add(B(e,Z.MOUSE_OVER,r=>{this.showDelayedHover(t(r),{groupId:n?.groupId})})),n?.setupKeyboardEvents&&i.add(B(e,Z.KEY_DOWN,r=>{const o=new bt(r);(o.equals(10)||o.equals(3))&&this.showInstantHover(t(),!0)})),this._delayedHovers.set(e,{show:r=>{this.showInstantHover(t(),r)}}),i.add(Ce(()=>this._delayedHovers.delete(e))),i}_createHover(e,t){if(this._currentDelayedHover=void 0,this._currentHover?.isLocked||(e.id===void 0&&(e.id=gz(e.content)),wd(this._currentHoverOptions)===wd(e)))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const n=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),i=Hn();t||(n&&i?i.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=i):this._lastFocusedElementBeforeOpen=void 0);const r=new le,o=this._instantiationService.createInstance(kM,e);if(e.persistence?.sticky&&(o.isLocked=!0),e.position?.hoverPosition&&!th(e.position.hoverPosition)&&(e.target={targetElements:sn(e.target)?[e.target]:e.target.targetElements,x:e.position.hoverPosition.x+10}),o.onDispose(()=>{this._currentHover?.domNode&&c9(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),wd(this._currentHoverOptions)===wd(e)&&this.doHideHover(),r.dispose()},void 0,r),!e.container){const a=sn(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(pe(a))}if(o.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,r),e.persistence?.sticky)r.add(B(pe(e.container).document,Z.MOUSE_DOWN,a=>{Wn(a.target,o.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const l of e.target.targetElements)r.add(B(l,Z.CLICK,()=>this.hideHover()));else r.add(B(e.target,Z.CLICK,()=>this.hideHover()));const a=Hn();if(a){const l=pe(a).document;r.add(B(a,Z.KEY_DOWN,c=>this._keyDown(c,o,!!e.persistence?.hideOnKeyDown))),r.add(B(l,Z.KEY_DOWN,c=>this._keyDown(c,o,!!e.persistence?.hideOnKeyDown))),r.add(B(a,Z.KEY_UP,c=>this._keyUp(c,o))),r.add(B(l,Z.KEY_UP,c=>this._keyUp(c,o)))}}if("IntersectionObserver"in _t){const a=new IntersectionObserver(c=>this._intersectionChange(c,o),{threshold:0}),l="targetElements"in e.target?e.target.targetElements[0]:e.target;a.observe(l),r.add(Ce(()=>a.disconnect()))}return this._currentHover=o,o}_showHover(e,t,n){this._contextViewHandler.showContextView(new GCe(e,n),t.container)}hideHover(e){!e&&this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let e=Hn();for(;e;){const t=this._delayedHovers.get(e)??this._managedHovers.get(e);if(t){t.show(!0);return}e=e.parentElement}}_keyDown(e,t,n){if(e.key==="Alt"){t.isLocked=!0;return}const i=new bt(e);this._keybindingService.resolveKeyboardEvent(i).getSingleModifierDispatchChords().some(o=>!!o)||this._keybindingService.softDispatch(i,i.target).kind!==0||n&&(!this._currentHoverOptions?.trapFocus||e.key!=="Tab")&&(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupManagedHover(e,t,n,i){if(e.showNativeHover)return qCe(t,n);t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let r,o;const a=(f,g)=>{const p=o!==void 0;f&&(o?.dispose(),o=void 0),g&&(r?.dispose(),r=void 0),p&&(e.onDidHideHover?.(),o=void 0)},l=(f,g,p,m)=>new wl(async()=>{(!o||o.isDisposed)&&(o=new jCe(e,p||t,f>0),await o.update(typeof n=="function"?n():n,g,{...i,trapFocus:m}))},f),c=new le;let d=!1;c.add(B(t,Z.MOUSE_DOWN,()=>{d=!0,a(!0,!0)},!0)),c.add(B(t,Z.MOUSE_UP,()=>{d=!1},!0)),c.add(B(t,Z.MOUSE_LEAVE,f=>{d=!1,a(!1,f.fromElement===t)},!0)),c.add(B(t,Z.MOUSE_OVER,f=>{if(r)return;const g=new le,p={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const m=b=>{p.x=b.x+10,sn(b.target)&&mz(b.target,t)!==t&&a(!0,!0)};g.add(B(t,Z.MOUSE_MOVE,m,!0))}r=g,!(sn(f.target)&&mz(f.target,t)!==t)&&g.add(l(typeof e.delay=="function"?e.delay(n):e.delay,!1,p))},!0));const h=()=>{if(d||r)return;const f={targetElements:[t],dispose:()=>{}},g=new le,p=()=>a(!0,!0);g.add(B(t,Z.BLUR,p,!0)),g.add(l(typeof e.delay=="function"?e.delay(n):e.delay,!1,f)),r=g};Eo(t)||c.add(B(t,Z.FOCUS,h,!0));const u={show:f=>{a(!1,!0),l(0,f,void 0,f)},hide:()=>{a(!0,!0)},update:async(f,g)=>{n=f,await o?.update(n,void 0,g)},dispose:()=>{this._managedHovers.delete(t),c.dispose(),a(!0,!0)}};return this._managedHovers.set(t,u),u}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};NM=KCe([Jg(0,Xe),Jg(1,Ft),Jg(2,Kl),Jg(3,Qn),Jg(4,jl),Jg(5,sr)],NM);function wd(s){if(s!==void 0)return s?.id??s}function gz(s){if(!sn(s))return typeof s=="string"?s.toString():s.value}function pz(s){const e=typeof s=="function"?s():s;if(Yn(e))return bH(e);if(fz(e))return e.markdownNotSupportedFallback}function qCe(s,e){function t(n){n?s.setAttribute("title",n):s.removeAttribute("title")}return t(pz(e)),{update:n=>t(pz(n)),show:()=>{},hide:()=>{},dispose:()=>t(void 0)}}class GCe{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function mz(s,e){for(e=e??pe(s).document.body;!s.hasAttribute("custom-hover")&&s!==e;)s=s.parentElement;return s}qe(k1,NM,1),Rl((s,e)=>{const t=s.getColor(_he);t&&(e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const YCe={ctrlCmd:!1,alt:!1};var j1;(function(s){s[s.Blur=1]="Blur",s[s.Gesture=2]="Gesture",s[s.Other=3]="Other"})(j1||(j1={}));var La;(function(s){s[s.NONE=0]="NONE",s[s.FIRST=1]="FIRST",s[s.SECOND=2]="SECOND",s[s.LAST=3]="LAST"})(La||(La={}));var Lt;(function(s){s[s.First=1]="First",s[s.Second=2]="Second",s[s.Last=3]="Last",s[s.Next=4]="Next",s[s.Previous=5]="Previous",s[s.NextPage=6]="NextPage",s[s.PreviousPage=7]="PreviousPage",s[s.NextSeparator=8]="NextSeparator",s[s.PreviousSeparator=9]="PreviousSeparator"})(Lt||(Lt={}));var Hy;(function(s){s[s.Title=1]="Title",s[s.Inline=2]="Inline"})(Hy||(Hy={}));const wu=We("quickInputService");var ep;(function(s){s[s.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",s[s.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(ep||(ep={}));var Cu;(function(s){s[s.None=0]="None",s[s.Initialized=1]="Initialized",s[s.Closed=2]="Closed"})(Cu||(Cu={}));const Rx=class Rx extends U{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Fm),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Cu.None,this.cache=new Map,this.flushDelayer=this._register(new OF(Rx.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,n)=>this.acceptExternal(n,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Cu.Closed)return;let n=!1;xr(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const n=this.cache.get(e);return xr(n)?t:n}getBoolean(e,t){const n=this.get(e);return xr(n)?t:n==="true"}getNumber(e,t){const n=this.get(e);return xr(n)?t:parseInt(n,10)}async set(e,t,n=!1){if(this.state===Cu.Closed)return;if(xr(t))return this.delete(e,n);const i=ds(t)||Array.isArray(t)?Fwe(t):String(t);if(this.cache.get(e)!==i)return this.cache.set(e,i),this.pendingInserts.set(e,i),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Cu.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===Cu.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===ep.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}};Rx.DEFAULT_FLUSH_DELAY=100;let K1=Rx;class DM{constructor(){this.onDidChangeItemsExternal=X.None,this.items=new Map}async updateItems(e){e.insert?.forEach((t,n)=>this.items.set(n,t)),e.delete?.forEach(t=>this.items.delete(t))}}const zy="__$__targetStorageMarker",q1=We("storageService");var G1;(function(s){s[s.NONE=0]="NONE",s[s.SHUTDOWN=1]="SHUTDOWN"})(G1||(G1={}));function XCe(s){const e=s.get(zy);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const Ax=class Ax extends U{constructor(e={flushInterval:Ax.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new Fm),this._onDidChangeTarget=this._register(new Fm),this._onWillSaveState=this._register(new A),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new Bn),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new mi(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,t,n){return X.filter(this._onDidChangeValue.event,i=>i.scope===e&&(t===void 0||i.key===t),n)}doFlushWhenIdle(){this.runFlushWhenIdle.value=X2(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}emitDidChangeValue(e,t){const{key:n,external:i}=t;if(n===zy){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:n,target:this.getKeyTargets(e)[n],external:i})}get(e,t,n){return this.getStorage(t)?.get(e,n)}getBoolean(e,t,n){return this.getStorage(t)?.getBoolean(e,n)}getNumber(e,t,n){return this.getStorage(t)?.getNumber(e,n)}store(e,t,n,i,r=!1){if(xr(t)){this.remove(e,n,r);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,n,i),this.getStorage(n)?.set(e,t,r)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,n,i=!1){const r=this.getKeyTargets(t);typeof n=="number"?r[e]!==n&&(r[e]=n,this.getStorage(t)?.set(zy,JSON.stringify(r),i)):typeof r[e]=="number"&&(delete r[e],this.getStorage(t)?.set(zy,JSON.stringify(r),i))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?XCe(t):Object.create(null)}async flush(e=G1.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(-1),n=this.getStorage(0),i=this.getStorage(1);switch(e){case G1.NONE:await Ym.settled([t?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve()]);break;case G1.SHUTDOWN:await Ym.settled([t?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve()]);break}}};Ax.DEFAULT_FLUSH_INTERVAL=60*1e3;let TM=Ax;class ZCe extends TM{constructor(){super(),this.applicationStorage=this._register(new K1(new DM,{hint:ep.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new K1(new DM,{hint:ep.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new K1(new DM,{hint:ep.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}}var QCe=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},_z=function(s,e){return function(t,n){e(t,n,s)}};const JCe=We("IInlineCompletionsService"),eve=new ue("inlineCompletions.snoozed",!1,_(76,"Whether inline completions are currently snoozed"));let IM=class extends U{get snoozeTimeLeft(){return this._snoozeTimeEnd===void 0?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(e,t){super(),this._contextKeyService=e,this._telemetryService=t,this._onDidChangeIsSnoozing=this._register(new A),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new dC);const n=eve.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing(()=>n.set(this.isSnoozing())))}setSnoozeDuration(e){if(e<0)throw new we(`Invalid snooze duration: ${e}. Duration must be non-negative.`);if(e===0){this.cancelSnooze();return}const t=this.isSnoozing(),n=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+e,t||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet(()=>{if(!this.isSnoozing())this._onDidChangeIsSnoozing.fire(!1);else throw new we("Snooze timer did not fire as expected")},this.snoozeTimeLeft+1),this._reportSnooze(e-n,e)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(e){this._lastCompletionId=e,this._recentCompletionIds.unshift(e),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(e,t){const n=Math.round(e/1e3),i=Math.round(t/1e3);this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:n,totalSeconds:i,lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}};IM=QCe([_z(0,rt),_z(1,Ll)],IM),qe(JCe,IM,1);const tve=We("IWorkspaceEditService");class MM{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(vu.is(t))return vu.lift(t);if(tp.is(t))return tp.lift(t);throw new Error("Unsupported edit")})}}class vu extends MM{static is(e){return e instanceof vu?!0:ds(e)&&ze.isUri(e.resource)&&ds(e.textEdit)}static lift(e){return e instanceof vu?e:new vu(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,n=void 0,i){super(i),this.resource=e,this.textEdit=t,this.versionId=n}}class tp extends MM{static is(e){return e instanceof tp?!0:ds(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof tp?e:new tp(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,n={},i){super(i),this.oldResource=e,this.newResource=t,this.options=n}}const di={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},$y={...Object.freeze({id:"editor",order:5,type:"object",title:_(144,"Editor"),scope:6}),properties:{"editor.tabSize":{type:"number",default:pi.tabSize,minimum:1,maximum:100,markdownDescription:_(145,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:_(146,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:pi.insertSpaces,markdownDescription:_(147,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:pi.detectIndentation,markdownDescription:_(148,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:pi.trimAutoWhitespace,description:_(149,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:pi.largeFileOptimizations,description:_(150,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[_(151,"Turn off Word Based Suggestions."),_(152,"Only suggest words from the active document."),_(153,"Suggest words from all open documents of the same language."),_(154,"Suggest words from all open documents.")],description:_(155,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[_(156,"Semantic highlighting enabled for all color themes."),_(157,"Semantic highlighting disabled for all color themes."),_(158,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:_(159,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:_(160,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:_(161,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:_(162,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:_(163,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:_(164,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:_(165,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:_(166,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:_(167,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:_(168,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:_(169,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:_(170,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:_(171,"The opening bracket character or string sequence.")},{type:"string",description:_(172,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:_(173,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:_(174,"The opening bracket character or string sequence.")},{type:"string",description:_(175,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:di.maxComputationTime,description:_(176,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:di.maxFileSize,description:_(177,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:di.renderSideBySide,description:_(178,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:di.renderSideBySideInlineBreakpoint,description:_(179,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:di.useInlineViewWhenSpaceIsLimited,description:_(180,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:di.renderMarginRevertIcon,description:_(181,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:di.renderGutterMenu,description:_(182,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:di.ignoreTrimWhitespace,description:_(183,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:di.renderIndicators,description:_(184,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:di.diffCodeLens,description:_(185,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:di.diffWordWrap,markdownEnumDescriptions:[_(186,"Lines will never wrap."),_(187,"Lines will wrap at the viewport width."),_(188,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:di.diffAlgorithm,markdownEnumDescriptions:[_(189,"Uses the legacy diffing algorithm."),_(190,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:di.hideUnchangedRegions.enabled,markdownDescription:_(191,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:di.hideUnchangedRegions.revealLineCount,markdownDescription:_(192,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:di.hideUnchangedRegions.minimumLineCount,markdownDescription:_(193,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:di.hideUnchangedRegions.contextLineCount,markdownDescription:_(194,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:di.experimental.showMoves,markdownDescription:_(195,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:di.experimental.showEmptyDecorations,description:_(196,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:di.experimental.useTrueInlineView,description:_(197,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function nve(s){return typeof s.type<"u"||typeof s.anyOf<"u"}for(const s of Pf){const e=s.schema;if(typeof e<"u")if(nve(e))$y.properties[`editor.${s.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&($y.properties[t]=e[t])}let Uy=null;function bz(){return Uy===null&&(Uy=Object.create(null),Object.keys($y.properties).forEach(s=>{Uy[s]=!0})),Uy}function ive(s){return bz()[`editor.${s}`]||!1}function sve(s){return bz()[`diffEditor.${s}`]||!1}Xn.as(Dh.Configuration).registerConfiguration($y);class rve{static insert(e,t){return{range:new R(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function jy(s){return Object.isFrozen(s)?s:zie(s)}class Jn{static createEmptyModel(e){return new Jn({},[],[],void 0,e)}constructor(e,t,n,i,r){this._contents=e,this._keys=t,this._overrides=n,this.raw=i,this.logService=r,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(t=>{if(t instanceof Jn)return t;const n=new ove("",this.logService);return n.parseRaw(t),n.configurationModel});this._rawConfiguration=e.reduce((t,n)=>n===t?n:t.merge(n),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?i8(this.contents,e):this.contents}inspect(e,t){const n=this;return{get value(){return jy(n.rawConfiguration.getValue(e))},get override(){return t?jy(n.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return jy(t?n.rawConfiguration.override(t).getValue(e):n.rawConfiguration.getValue(e))},get overrides(){const i=[];for(const{contents:r,identifiers:o,keys:a}of n.rawConfiguration.overrides){const l=new Jn(r,a,[],void 0,n.logService).getValue(e);l!==void 0&&i.push({identifiers:o,value:l})}return i.length?jy(i):void 0}}}getOverrideValue(e,t){const n=this.getContentsForOverrideIdentifer(t);return n?e?i8(n,e):n:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=dl(this.contents),n=dl(this.overrides),i=[...this.keys],r=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const o of e)if(r.push(...o.raw?Array.isArray(o.raw)?o.raw:[o.raw]:[o]),!o.isEmpty()){this.mergeContents(t,o.contents);for(const a of o.overrides){const[l]=n.filter(c=>Sn(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=Qd(l.keys)):n.push(dl(a))}for(const a of o.keys)i.indexOf(a)===-1&&i.push(a)}return new Jn(t,i,n,!r.length||r.every(o=>o instanceof Jn)?void 0:r,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const n={};for(const i of Qd([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[i];const o=t[i];o&&(typeof r=="object"&&typeof o=="object"?(r=dl(r),this.mergeContents(r,o)):r=o),n[i]=r}return new Jn(n,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const n of Object.keys(t)){if(n in e&&ds(e[n])&&ds(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=dl(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null;const i=r=>{r&&(n?this.mergeContents(n,r):n=dl(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&i(r.contents);return i(t),n}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Ble(this.contents,e),Yc.test(e)&&this.overrides.splice(this.overrides.findIndex(n=>Sn(n.identifiers,AC(e))),1))}updateValue(e,t,n){if(t8(this.contents,e,t,i=>this.logService.error(i)),n=n||this.keys.indexOf(e)===-1,n&&this.keys.push(e),Yc.test(e)){const i=AC(e),r={identifiers:i,keys:Object.keys(this.contents[e]),contents:qN(this.contents[e],a=>this.logService.error(a))},o=this.overrides.findIndex(a=>Sn(a.identifiers,i));o!==-1?this.overrides[o]=r:this.overrides.push(r)}}}class ove{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||Jn.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:n,keys:i,overrides:r,restricted:o,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Jn(n,i,r,a?[e]:void 0,this.logService),this._restrictedConfigurations=o||[]}doParseRaw(e,t){const n=Xn.as(Dh.Configuration),i=n.getConfigurationProperties(),r=n.getExcludedConfigurationProperties(),o=this.filter(e,i,r,!0,t);e=o.raw;const a=qN(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`)),l=Object.keys(e),c=this.toOverrides(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`));return{contents:a,keys:l,overrides:c,restricted:o.restricted,hasExcludedProperties:o.hasExcludedProperties}}filter(e,t,n,i,r){let o=!1;if(!r?.scopes&&!r?.skipRestricted&&!r?.skipUnregistered&&!r?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:o};const a={},l=[];for(const c in e)if(Yc.test(c)&&i){const d=this.filter(e[c],t,n,!1,r);a[c]=d.raw,o=o||d.hasExcludedProperties,l.push(...d.restricted)}else{const d=t[c];d?.restricted&&l.push(c),this.shouldInclude(c,d,n,r)?a[c]=e[c]:o=!0}return{raw:a,restricted:l,hasExcludedProperties:o}}shouldInclude(e,t,n,i){if(i.exclude?.includes(e))return!1;if(i.include?.includes(e))return!0;if(i.skipRestricted&&t?.restricted||i.skipUnregistered&&!t)return!1;const r=t??n[e],o=r?typeof r.scope<"u"?r.scope:4:void 0;return o===void 0||i.scopes===void 0?!0:i.scopes.includes(o)}toOverrides(e,t){const n=[];for(const i of Object.keys(e))if(Yc.test(i)){const r={};for(const o in e[i])r[o]=e[i][o];n.push({identifiers:AC(i),keys:Object.keys(r),contents:qN(r,t)})}return n}}class ave{constructor(e,t,n,i,r,o,a,l,c,d,h,u,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=i,this.defaultConfiguration=r,this.policyConfiguration=o,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class Ky{constructor(e,t,n,i,r,o,a,l,c,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=i,this._remoteUserConfiguration=r,this._workspaceConfiguration=o,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new yi,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let i;n.resource?(i=this._memoryConfigurationByResource.get(n.resource),i||(i=Jn.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(n.resource,i))):i=this._memoryConfiguration,t===void 0?i.removeValue(e):i.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){const i=this.getConsolidatedConfigurationModel(e,t,n),r=this.getFolderConfigurationModelForResource(t.resource,n),o=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of i.overrides)for(const c of l.identifiers)i.getOverrideValue(e,c)!==void 0&&a.add(c);return new ave(e,t,i.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,r||void 0,o)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new Jn(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,n){let i=this.getConsolidatedConfigurationModelForResource(t,n);if(t.overrideIdentifier&&(i=i.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){i=i.merge();for(const r of this._policyConfiguration.keys)i.setValue(r,this._policyConfiguration.getValue(r))}return i}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const i=t.getFolder(e);i&&(n=this.getFolderConsolidatedConfiguration(i.uri)||n);const r=this._memoryConfigurationByResource.get(e);r&&(n=n.merge(r))}return n}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const n=this.getWorkspaceConsolidatedConfiguration(),i=this._folderConfigurations.get(e);i?(t=n.merge(i),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:n,overrides:i,keys:r}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:i,keys:r}]),e},[])}}static parse(e,t){const n=this.parseConfigurationModel(e.defaults,t),i=this.parseConfigurationModel(e.policy,t),r=this.parseConfigurationModel(e.application,t),o=this.parseConfigurationModel(e.userLocal,t),a=this.parseConfigurationModel(e.userRemote,t),l=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((d,h)=>(d.set(ze.revive(h[0]),this.parseConfigurationModel(h[1],t)),d),new yi);return new Ky(n,i,r,o,a,l,c,Jn.createEmptyModel(t),new yi,t)}static parseConfigurationModel(e,t){return new Jn(e.contents,e.keys,e.overrides,e.raw,t)}}class lve{constructor(e,t,n,i,r){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=i,this.logService=r,this._marker=`
|
|
502
|
-
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Ky.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const n=this._marker+e,i=this._affectsConfigStr.indexOf(n);if(i<0)return!1;const r=i+n.length;if(r>=this._affectsConfigStr.length)return!1;const o=this._affectsConfigStr.charCodeAt(r);if(o!==this._markerCode1&&o!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Ds(a,l)}return!0}}const qy={kind:0},cve={kind:1};function dve(s,e,t){return{kind:2,commandId:s,commandArgs:e,isBubble:t}}class Y1{constructor(e,t,n){this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const i of e){const r=i.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Y1.handleRemovals([].concat(e).concat(t));for(let i=0,r=this._keybindings.length;i<r;i++){const o=this._keybindings[i];if(o.chords.length===0)continue;const a=o.when?.substituteConstants();a&&a.type===0||this._addKeyPress(o.chords[0],o)}}static _isTargetedForRemoval(e,t,n){if(t){for(let i=0;i<t.length;i++)if(t[i]!==e.chords[i])return!1}return!(n&&n.type!==1&&(!e.when||!Pae(n,e.when)))}static handleRemovals(e){const t=new Map;for(let i=0,r=e.length;i<r;i++){const o=e[i];if(o.command&&o.command.charAt(0)==="-"){const a=o.command.substring(1);t.has(a)?t.get(a).push(o):t.set(a,[o])}}if(t.size===0)return e;const n=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.command||o.command.length===0){n.push(o);continue}if(o.command.charAt(0)==="-")continue;const a=t.get(o.command);if(!a||!o.isDefault){n.push(o);continue}let l=!1;for(const c of a){const d=c.when;if(this._isTargetedForRemoval(o,c.chords,d)){l=!0;break}}if(!l){n.push(o);continue}}return n}_addKeyPress(e,t){const n=this._map.get(e);if(typeof n>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.command===t.command)continue;let o=!0;for(let a=1;a<r.chords.length&&a<t.chords.length;a++)if(r.chords[a]!==t.chords[a]){o=!1;break}o&&Y1.whenIsEntirelyIncluded(r.when,t.when)&&this._removeFromLookupMap(r)}n.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 n=0,i=t.length;n<i;n++)if(t[n]===e){t.splice(n,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:AN(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t,n=!1){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1&&!n)return i[0];for(let r=i.length-1;r>=0;r--){const o=i[r];if(t.contextMatchesRules(o.when))return o}return n?null:i[i.length-1]}resolve(e,t,n){const i=[...t,n];this._log(`| Resolving ${i}`);const r=this._map.get(i[0]);if(r===void 0)return this._log("\\ No keybinding entries."),qy;let o=null;if(i.length<2)o=r;else{o=[];for(let l=0,c=r.length;l<c;l++){const d=r[l];if(i.length>d.chords.length)continue;let h=!0;for(let u=1;u<i.length;u++)if(d.chords[u]!==i[u]){h=!1;break}h&&o.push(d)}}const a=this._findCommand(e,o);return a?i.length<a.chords.length?(this._log(`\\ From ${o.length} keybinding entries, awaiting ${a.chords.length-i.length} more chord(s), when: ${wz(a.when)}, source: ${Cz(a)}.`),cve):(this._log(`\\ From ${o.length} keybinding entries, matched ${a.command}, when: ${wz(a.when)}, source: ${Cz(a)}.`),dve(a.command,a.commandArgs,a.bubble)):(this._log(`\\ From ${o.length} keybinding entries, no when clauses matched the context.`),qy)}_findCommand(e,t){for(let n=t.length-1;n>=0;n--){const i=t[n];if(Y1._contextMatchesRules(e,i.when))return i}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function wz(s){return s?`${s.serialize()}`:"no when condition"}function Cz(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}const hve=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class uve extends U{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:X.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,i,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=i,this._logService=r,this._onDidUpdateKeybindings=this._register(new A),this._currentChords=[],this._currentChordChecker=new Y2,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=np.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new wl,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,n=!1){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,n);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),qy;const[i]=n.getDispatchChords();if(i===null)return this._log("\\ Keyboard event cannot be dispatched"),qy;const r=this._contextKeyService.getContext(t),o=this._currentChords.map((({keypress:a})=>a));return this._getResolver().resolve(r,o,i)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Ow("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(_(1684,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:i})=>i).join(", ");this._currentChordStatusMessage=this._notificationService.status(_(1685,"({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),ma.enabled&&ma.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],ma.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[i]=n.getSingleModifierDispatchChords();if(i)return this._ignoreSingleModifiers.has(i)?(this._log(`+ Ignoring single modifier ${i} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=np.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=np.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${i}.`),this._currentSingleModifier=i,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):i===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${i} ${i}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${i}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[r]=n.getChords();return this._ignoreSingleModifiers=new np(r),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){let i=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,o=null;if(n){const[d]=e.getSingleModifierDispatchChords();r=d,o=d?[d]:[]}else[r]=e.getDispatchChords(),o=this._currentChords.map(({keypress:d})=>d);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),i;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,o,r);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(_(1686,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),i=!0}return i}case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),i=!0,this._expectAnotherChord(r,l),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),i;case 2:{if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(_(1687,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),i=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(i=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}hve.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return i}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}const Ox=class Ox{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};Ox.EMPTY=new Ox(null);let np=Ox;class vz{constructor(e,t,n,i,r,o,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?RM(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=RM(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=i,this.isDefault=r,this.extensionId=o,this.isBuiltinExtension=a}}function RM(s){const e=[];for(let t=0,n=s.length;t<n;t++){const i=s[t];if(!i)return[];e.push(i)}return e}class Gy{constructor(e,t,n=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=n}toLabel(e,t,n){if(t.length===0)return null;const i=[];for(let r=0,o=t.length;r<o;r++){const a=t[r],l=n(a);if(l===null)return null;i[r]=mve(a,l,this.modifierLabels[e])}return i.join(" ")}}const AM=new Gy({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:_(35,"Ctrl"),shiftKey:_(36,"Shift"),altKey:_(37,"Alt"),metaKey:_(38,"Windows"),separator:"+"},{ctrlKey:_(39,"Ctrl"),shiftKey:_(40,"Shift"),altKey:_(41,"Alt"),metaKey:_(42,"Super"),separator:"+"}),fve=new Gy({ctrlKey:_(43,"Control"),shiftKey:_(44,"Shift"),altKey:_(45,"Option"),metaKey:_(46,"Command"),separator:"+"},{ctrlKey:_(47,"Control"),shiftKey:_(48,"Shift"),altKey:_(49,"Alt"),metaKey:_(50,"Windows"),separator:"+"},{ctrlKey:_(51,"Control"),shiftKey:_(52,"Shift"),altKey:_(53,"Alt"),metaKey:_(54,"Super"),separator:"+"}),gve=new Gy({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),pve=new Gy({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});function mve(s,e,t){if(e===null)return"";const n=[];return s.ctrlKey&&n.push(t.ctrlKey),s.shiftKey&&n.push(t.shiftKey),s.altKey&&n.push(t.altKey),s.metaKey&&n.push(t.metaKey),e!==""&&n.push(e),n.join(t.separator)}class _ve extends Kre{constructor(e,t){if(super(),t.length===0)throw Aw("chords");this._os=e,this._chords=t}getLabel(){return AM.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return fve.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:gve.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return pve.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new jre(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class X1 extends _ve{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return ml.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":ml.toString(e.keyCode)}_getElectronAccelerator(e){return ml.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=ml.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return X1.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=ml.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=kE[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof hh)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new hh(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=RM(e.chords.map(i=>this._toKeyCodeChord(i)));return n.length>0?[new X1(n,t)]:[]}}const bve=We("labelService"),wve=We("progressService"),OM=We("editorProgressService");class Cve{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),n=this._value.charCodeAt(this._pos);return t-n}value(){return this._value[this._pos]}}class vve{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?M2(e,this._value,0,e.length,this._from,this._to):Hm(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class yve{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 n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===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?M2(e,this._value,0,e.length,this._from,this._to):Hm(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Sve{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new yve(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===1)return xF(e,this._value.scheme);if(this._states[this._stateIdx]===2)return xF(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return I2(e,this._value.query);if(this._states[this._stateIdx]===5)return I2(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}const qb=class qb{static wrap(e){return e===void 0?qb.Val:e}static unwrap(e){return e===qb.Val?void 0:e}};qb.Val=Symbol("undefined_placeholder");let Gl=qb;class Yy{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}}class Z1{static forUris(e=()=>!1,t=()=>!1){return new Z1(new Sve(e,t))}static forStrings(){return new Z1(new Cve)}static forConfigKeys(){return new Z1(new vve)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let i;this._root||(this._root=new Yy,this._root.segment=n.value());const r=[];for(i=this._root;;){const a=n.cmp(i.segment);if(a>0)i.left||(i.left=new Yy,i.left.segment=n.value()),r.push([-1,i]),i=i.left;else if(a<0)i.right||(i.right=new Yy,i.right.segment=n.value()),r.push([1,i]),i=i.right;else if(n.hasNext())n.next(),i.mid||(i.mid=new Yy,i.mid.segment=n.value()),r.push([0,i]),i=i.mid;else break}const o=Gl.unwrap(i.value);i.value=Gl.wrap(t),i.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=r[a][0],h=r[a+1][0];if(d===1&&h===1)r[a][1]=l.rotateLeft();else if(d===-1&&h===-1)r[a][1]=l.rotateRight();else if(d===1&&h===-1)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(d===-1&&h===1)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return o}get(e){return Gl.unwrap(this._getNode(e)?.value)}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const i=t.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const n=this._iter.reset(e),i=[];let r=this._root;for(;r;){const o=n.cmp(r.segment);if(o>0)i.push([-1,r]),r=r.left;else if(o<0)i.push([1,r]),r=r.right;else if(n.hasNext())n.next(),i.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const o=[[1,r]],a=this._min(r.right,o);if(a.key){r.key=a.key,r.value=a.value,r.segment=a.segment;const l=a.right;if(o.length>1){const[d,h]=o[o.length-1];switch(d){case-1:h.left=l;break;case 0:Pw(!1);case 1:Pw(!1)}}else r.right=l;const c=this._balanceByStack(o);if(i.length>0){const[d,h]=i[i.length-1];switch(d){case-1:h.left=c;break;case 0:h.mid=c;break;case 1:h.right=c;break}}else this._root=c}}else{const o=r.left??r.right;if(i.length>0){const[a,l]=i[i.length-1];switch(a){case-1:l.left=o;break;case 0:l.mid=o;break;case 1:l.right=o;break}}else this._root=o}this._root=this._balanceByStack(i)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const n=e[t][1];n.updateHeight();const i=n.balanceFactor();if(i>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[t][1]=n.rotateLeft()):i<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[t][1]=n.rotateRight()),t>0)switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){const t=this._iter.reset(e);let n=this._root,i;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),i=Gl.unwrap(n.value)||i,n=n.mid;else break}return n&&Gl.unwrap(n.value)||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let i=this._root;for(;i;){const r=n.cmp(i.segment);if(r>0)i=i.left;else if(r<0)i=i.right;else if(n.hasNext())n.next(),i=i.mid;else return i.mid?this._entries(i.mid):t?Gl.unwrap(i.value):void 0}}forEach(e){for(const[t,n]of this)e(n,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,Gl.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const xve=We("contextService");class Lve{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const kve="code-workspace";_(2032,"Code Workspace");const Eve="4064f6ec-cb38-4ad0-af64-ee6467e63c82";var yz;(function(s){s.inspectTokensAction=_(782,"Developer: Inspect Tokens")})(yz||(yz={}));var Sz;(function(s){s.gotoLineActionLabel=_(783,"Go to Line/Column...")})(Sz||(Sz={}));var xz;(function(s){s.helpQuickAccessActionLabel=_(784,"Show all Quick Access Providers")})(xz||(xz={}));var Lz;(function(s){s.quickCommandActionLabel=_(785,"Command Palette"),s.quickCommandHelp=_(786,"Show And Run Commands")})(Lz||(Lz={}));var kz;(function(s){s.quickOutlineActionLabel=_(787,"Go to Symbol..."),s.quickOutlineByCategoryActionLabel=_(788,"Go to Symbol by Category...")})(kz||(kz={}));var PM;(function(s){s.editorViewAccessibleLabel=_(789,"Editor content")})(PM||(PM={}));var Ez;(function(s){s.toggleHighContrast=_(790,"Toggle High Contrast Theme")})(Ez||(Ez={}));var FM;(function(s){s.bulkEditServiceSummary=_(791,"Made {0} edits in {1} files")})(FM||(FM={}));const Nve=We("workspaceTrustManagementService");let ip=[],BM=[],Nz=[];function Xy(s,e=!1){Dve(s,!1,e)}function Dve(s,e,t){const n=Tve(s,e);ip.push(n),n.userConfigured?Nz.push(n):BM.push(n),t&&!n.userConfigured&&ip.forEach(i=>{i.mime===n.mime||i.userConfigured||(n.extension&&i.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&i.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&i.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&i.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function Tve(s,e){return{id:s.id,mime:s.mime,filename:s.filename,extension:s.extension,filepattern:s.filepattern,firstline:s.firstline,userConfigured:e,filenameLowercase:s.filename?s.filename.toLowerCase():void 0,extensionLowercase:s.extension?s.extension.toLowerCase():void 0,filepatternLowercase:s.filepattern?eH(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(fn.sep)>=0:!1}}function Ive(){ip=ip.filter(s=>s.userConfigured),BM=[]}function Mve(s,e){return Rve(s,e).map(t=>t.id)}function Rve(s,e){let t;if(s)switch(s.scheme){case Le.file:t=s.fsPath;break;case Le.data:{t=EC.parseMetaData(s).get(EC.META_DATA_LABEL);break}case Le.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:El.unknown}];t=t.toLowerCase();const n=eF(t),i=Dz(t,n,Nz);if(i)return[i,{id:Jr,mime:El.text}];const r=Dz(t,n,BM);if(r)return[r,{id:Jr,mime:El.text}];if(e){const o=Ave(e);if(o)return[o,{id:Jr,mime:El.text}]}return[{id:"unknown",mime:El.unknown}]}function Dz(s,e,t){let n,i,r;for(let o=t.length-1;o>=0;o--){const a=t[o];if(e===a.filenameLowercase){n=a;break}if(a.filepattern&&(!i||a.filepattern.length>i.filepattern.length)){const l=a.filepatternOnPath?s:e;a.filepatternLowercase?.(l)&&(i=a)}a.extension&&(!r||a.extension.length>r.extension.length)&&e.endsWith(a.extensionLowercase)&&(r=a)}if(n)return n;if(i)return i;if(r)return r}function Ave(s){if(W2(s)&&(s=s.substr(1)),s.length>0)for(let e=ip.length-1;e>=0;e--){const t=ip[e];if(!t.firstline)continue;const n=s.match(t.firstline);if(n&&n.length>0)return t}}const Zy=Object.prototype.hasOwnProperty,Tz="vs.editor.nullLanguage";class Ove{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Tz,0),this._register(Jr,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Tz}}const Gb=class Gb extends U{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new A),this.onDidChange=this._onDidChange.event,Gb.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new Ove,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(ig.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){Gb.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Ive();const e=[].concat(ig.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(i=>{this._lowercaseNameMap[i.toLowerCase()]=n.identifier}),n.mimetypes.forEach(i=>{this._mimeTypesMap[i]=n.identifier})}),Xn.as(Dh.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;Zy.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let i=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),i=t.mimetypes[0]),i||(i=`text/x-${n}`,e.mimetypes.push(i)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)Xy({id:n,mime:i,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)Xy({id:n,mime:i,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)Xy({id:n,mime:i,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);SF(l)||Xy({id:n,mime:i,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let r=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?r=[null]:r=t.aliases),r!==null)for(const a of r)!a||a.length===0||e.aliases.push(a);const o=r!==null&&r.length>0;if(!(o&&r[0]===null)){const a=(o?r[0]:null)||n;(o||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Zy.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Zy.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Zy.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:Mve(e,t)}};Gb.instanceCount=0;let VM=Gb;const Yb=class Yb extends U{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new A),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new A),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new A({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Yb.instanceCount++,this._registry=this._register(new VM(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Yb.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new Iz(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Iz(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Jr),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),gn.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Yb.instanceCount=0;let WM=Yb;class Iz{constructor(e,t){this._value=Bt(this,e,()=>t()),this.onDidChange=X.fromObservable(this._value)}get languageId(){return this._value.get()}}function KTe(s){return s}function Yl(s,e){if(s!==void 0){const t=s.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=Yl(n[1].trim(),e)),`var(${n[0]}, ${e})`}return s}return e}function Mz(s){const e=s.replaceAll(/[^_\-a-z0-9]/gi,"");return e!==s&&console.warn(`CSS ident value ${s} modified to ${e} to be safe for CSS`),e}function Cd(s){return`'${s.replaceAll(/'/g,"\\000027")}'`}function ka(s){return s?zs`url('${CSS.escape(VF.uriToBrowserUri(s).toString(!0))}')`:"url('')"}function Qy(s,e=!1){const t=CSS.escape(s);return!e&&t!==s&&console.warn(`CSS class name ${s} modified to ${t} to be safe for CSS`),t}function zs(s,...e){return s.reduce((t,n,i)=>{const r=e[i]||"";return t+n+r},"")}class HM{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e=`
|
|
502
|
+
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Ky.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const n=this._marker+e,i=this._affectsConfigStr.indexOf(n);if(i<0)return!1;const r=i+n.length;if(r>=this._affectsConfigStr.length)return!1;const o=this._affectsConfigStr.charCodeAt(r);if(o!==this._markerCode1&&o!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Ds(a,l)}return!0}}const qy={kind:0},cve={kind:1};function dve(s,e,t){return{kind:2,commandId:s,commandArgs:e,isBubble:t}}class Y1{constructor(e,t,n){this._log=n,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const i of e){const r=i.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Y1.handleRemovals([].concat(e).concat(t));for(let i=0,r=this._keybindings.length;i<r;i++){const o=this._keybindings[i];if(o.chords.length===0)continue;const a=o.when?.substituteConstants();a&&a.type===0||this._addKeyPress(o.chords[0],o)}}static _isTargetedForRemoval(e,t,n){if(t){for(let i=0;i<t.length;i++)if(t[i]!==e.chords[i])return!1}return!(n&&n.type!==1&&(!e.when||!Pae(n,e.when)))}static handleRemovals(e){const t=new Map;for(let i=0,r=e.length;i<r;i++){const o=e[i];if(o.command&&o.command.charAt(0)==="-"){const a=o.command.substring(1);t.has(a)?t.get(a).push(o):t.set(a,[o])}}if(t.size===0)return e;const n=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.command||o.command.length===0){n.push(o);continue}if(o.command.charAt(0)==="-")continue;const a=t.get(o.command);if(!a||!o.isDefault){n.push(o);continue}let l=!1;for(const c of a){const d=c.when;if(this._isTargetedForRemoval(o,c.chords,d)){l=!0;break}}if(!l){n.push(o);continue}}return n}_addKeyPress(e,t){const n=this._map.get(e);if(typeof n>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let i=n.length-1;i>=0;i--){const r=n[i];if(r.command===t.command)continue;let o=!0;for(let a=1;a<r.chords.length&&a<t.chords.length;a++)if(r.chords[a]!==t.chords[a]){o=!1;break}o&&Y1.whenIsEntirelyIncluded(r.when,t.when)&&this._removeFromLookupMap(r)}n.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 n=0,i=t.length;n<i;n++)if(t[n]===e){t.splice(n,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:AN(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t,n=!1){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1&&!n)return i[0];for(let r=i.length-1;r>=0;r--){const o=i[r];if(t.contextMatchesRules(o.when))return o}return n?null:i[i.length-1]}resolve(e,t,n){const i=[...t,n];this._log(`| Resolving ${i}`);const r=this._map.get(i[0]);if(r===void 0)return this._log("\\ No keybinding entries."),qy;let o=null;if(i.length<2)o=r;else{o=[];for(let l=0,c=r.length;l<c;l++){const d=r[l];if(i.length>d.chords.length)continue;let h=!0;for(let u=1;u<i.length;u++)if(d.chords[u]!==i[u]){h=!1;break}h&&o.push(d)}}const a=this._findCommand(e,o);return a?i.length<a.chords.length?(this._log(`\\ From ${o.length} keybinding entries, awaiting ${a.chords.length-i.length} more chord(s), when: ${wz(a.when)}, source: ${Cz(a)}.`),cve):(this._log(`\\ From ${o.length} keybinding entries, matched ${a.command}, when: ${wz(a.when)}, source: ${Cz(a)}.`),dve(a.command,a.commandArgs,a.bubble)):(this._log(`\\ From ${o.length} keybinding entries, no when clauses matched the context.`),qy)}_findCommand(e,t){for(let n=t.length-1;n>=0;n--){const i=t[n];if(Y1._contextMatchesRules(e,i.when))return i}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function wz(s){return s?`${s.serialize()}`:"no when condition"}function Cz(s){return s.extensionId?s.isBuiltinExtension?`built-in extension ${s.extensionId}`:`user extension ${s.extensionId}`:s.isDefault?"built-in":"user"}const hve=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class uve extends U{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:X.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,n,i,r){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=n,this._notificationService=i,this._logService=r,this._onDidUpdateKeybindings=this._register(new A),this._currentChords=[],this._currentChordChecker=new Y2,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=np.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new wl,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,n=!1){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,n);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const n=this.resolveKeyboardEvent(e);if(n.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),qy;const[i]=n.getDispatchChords();if(i===null)return this._log("\\ Keyboard event cannot be dispatched"),qy;const r=this._contextKeyService.getContext(t),o=this._currentChords.map((({keypress:a})=>a));return this._getResolver().resolve(r,o,i)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Ow("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(_(1684,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const n=this._currentChords.map(({label:i})=>i).join(", ");this._currentChordStatusMessage=this._notificationService.status(_(1685,"({0}) was pressed. Waiting for next key of chord...",n))}}this._scheduleLeaveChordMode(),ma.enabled&&ma.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],ma.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const n=this.resolveKeyboardEvent(e),[i]=n.getSingleModifierDispatchChords();if(i)return this._ignoreSingleModifiers.has(i)?(this._log(`+ Ignoring single modifier ${i} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=np.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=np.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${i}.`),this._currentSingleModifier=i,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):i===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${i} ${i}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(n,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${i}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[r]=n.getChords();return this._ignoreSingleModifiers=new np(r),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,n=!1){let i=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,o=null;if(n){const[d]=e.getSingleModifierDispatchChords();r=d,o=d?[d]:[]}else[r]=e.getDispatchChords(),o=this._currentChords.map(({keypress:d})=>d);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),i;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,o,r);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(_(1686,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),i=!0}return i}case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),i=!0,this._expectAnotherChord(r,l),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),i;case 2:{if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(_(1687,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),i=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(i=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}hve.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return i}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}const Ox=class Ox{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};Ox.EMPTY=new Ox(null);let np=Ox;class vz{constructor(e,t,n,i,r,o,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?RM(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=RM(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=n,this.when=i,this.isDefault=r,this.extensionId=o,this.isBuiltinExtension=a}}function RM(s){const e=[];for(let t=0,n=s.length;t<n;t++){const i=s[t];if(!i)return[];e.push(i)}return e}class Gy{constructor(e,t,n=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=n}toLabel(e,t,n){if(t.length===0)return null;const i=[];for(let r=0,o=t.length;r<o;r++){const a=t[r],l=n(a);if(l===null)return null;i[r]=mve(a,l,this.modifierLabels[e])}return i.join(" ")}}const AM=new Gy({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:_(35,"Ctrl"),shiftKey:_(36,"Shift"),altKey:_(37,"Alt"),metaKey:_(38,"Windows"),separator:"+"},{ctrlKey:_(39,"Ctrl"),shiftKey:_(40,"Shift"),altKey:_(41,"Alt"),metaKey:_(42,"Super"),separator:"+"}),fve=new Gy({ctrlKey:_(43,"Control"),shiftKey:_(44,"Shift"),altKey:_(45,"Option"),metaKey:_(46,"Command"),separator:"+"},{ctrlKey:_(47,"Control"),shiftKey:_(48,"Shift"),altKey:_(49,"Alt"),metaKey:_(50,"Windows"),separator:"+"},{ctrlKey:_(51,"Control"),shiftKey:_(52,"Shift"),altKey:_(53,"Alt"),metaKey:_(54,"Super"),separator:"+"}),gve=new Gy({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),pve=new Gy({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});function mve(s,e,t){if(e===null)return"";const n=[];return s.ctrlKey&&n.push(t.ctrlKey),s.shiftKey&&n.push(t.shiftKey),s.altKey&&n.push(t.altKey),s.metaKey&&n.push(t.metaKey),e!==""&&n.push(e),n.join(t.separator)}class _ve extends Kre{constructor(e,t){if(super(),t.length===0)throw Aw("chords");this._os=e,this._chords=t}getLabel(){return AM.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return fve.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:gve.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return pve.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new jre(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class X1 extends _ve{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return ml.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":ml.toString(e.keyCode)}_getElectronAccelerator(e){return ml.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=ml.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return X1.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=ml.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=kE[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof hh)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new hh(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const n=RM(e.chords.map(i=>this._toKeyCodeChord(i)));return n.length>0?[new X1(n,t)]:[]}}const bve=We("labelService"),wve=We("progressService"),OM=We("editorProgressService");class Cve{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),n=this._value.charCodeAt(this._pos);return t-n}value(){return this._value[this._pos]}}class vve{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?M2(e,this._value,0,e.length,this._from,this._to):Hm(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class yve{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 n=this._value.charCodeAt(t);if(!(n===47||this._splitOnBackslash&&n===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?M2(e,this._value,0,e.length,this._from,this._to):Hm(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Sve{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new yve(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===1)return xF(e,this._value.scheme);if(this._states[this._stateIdx]===2)return xF(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return I2(e,this._value.query);if(this._states[this._stateIdx]===5)return I2(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}const qb=class qb{static wrap(e){return e===void 0?qb.Val:e}static unwrap(e){return e===qb.Val?void 0:e}};qb.Val=Symbol("undefined_placeholder");let Gl=qb;class Yy{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}}class Z1{static forUris(e=()=>!1,t=()=>!1){return new Z1(new Sve(e,t))}static forStrings(){return new Z1(new Cve)}static forConfigKeys(){return new Z1(new vve)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const n=this._iter.reset(e);let i;this._root||(this._root=new Yy,this._root.segment=n.value());const r=[];for(i=this._root;;){const a=n.cmp(i.segment);if(a>0)i.left||(i.left=new Yy,i.left.segment=n.value()),r.push([-1,i]),i=i.left;else if(a<0)i.right||(i.right=new Yy,i.right.segment=n.value()),r.push([1,i]),i=i.right;else if(n.hasNext())n.next(),i.mid||(i.mid=new Yy,i.mid.segment=n.value()),r.push([0,i]),i=i.mid;else break}const o=Gl.unwrap(i.value);i.value=Gl.wrap(t),i.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=r[a][0],h=r[a+1][0];if(d===1&&h===1)r[a][1]=l.rotateLeft();else if(d===-1&&h===-1)r[a][1]=l.rotateRight();else if(d===1&&h===-1)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(d===-1&&h===1)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case-1:r[a-1][1].left=r[a][1];break;case 1:r[a-1][1].right=r[a][1];break;case 0:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return o}get(e){return Gl.unwrap(this._getNode(e)?.value)}_getNode(e){const t=this._iter.reset(e);let n=this._root;for(;n;){const i=t.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const n=this._iter.reset(e),i=[];let r=this._root;for(;r;){const o=n.cmp(r.segment);if(o>0)i.push([-1,r]),r=r.left;else if(o<0)i.push([1,r]),r=r.right;else if(n.hasNext())n.next(),i.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const o=[[1,r]],a=this._min(r.right,o);if(a.key){r.key=a.key,r.value=a.value,r.segment=a.segment;const l=a.right;if(o.length>1){const[d,h]=o[o.length-1];switch(d){case-1:h.left=l;break;case 0:Pw(!1);case 1:Pw(!1)}}else r.right=l;const c=this._balanceByStack(o);if(i.length>0){const[d,h]=i[i.length-1];switch(d){case-1:h.left=c;break;case 0:h.mid=c;break;case 1:h.right=c;break}}else this._root=c}}else{const o=r.left??r.right;if(i.length>0){const[a,l]=i[i.length-1];switch(a){case-1:l.left=o;break;case 0:l.mid=o;break;case 1:l.right=o;break}}else this._root=o}this._root=this._balanceByStack(i)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const n=e[t][1];n.updateHeight();const i=n.balanceFactor();if(i>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[t][1]=n.rotateLeft()):i<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[t][1]=n.rotateRight()),t>0)switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){const t=this._iter.reset(e);let n=this._root,i;for(;n;){const r=t.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else if(t.hasNext())t.next(),i=Gl.unwrap(n.value)||i,n=n.mid;else break}return n&&Gl.unwrap(n.value)||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const n=this._iter.reset(e);let i=this._root;for(;i;){const r=n.cmp(i.segment);if(r>0)i=i.left;else if(r<0)i=i.right;else if(n.hasNext())n.next(),i=i.mid;else return i.mid?this._entries(i.mid):t?Gl.unwrap(i.value):void 0}}forEach(e){for(const[t,n]of this)e(n,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,Gl.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const xve=We("contextService");class Lve{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const kve="code-workspace";_(2032,"Code Workspace");const Eve="4064f6ec-cb38-4ad0-af64-ee6467e63c82";var yz;(function(s){s.inspectTokensAction=_(782,"Developer: Inspect Tokens")})(yz||(yz={}));var Sz;(function(s){s.gotoLineActionLabel=_(783,"Go to Line/Column...")})(Sz||(Sz={}));var xz;(function(s){s.helpQuickAccessActionLabel=_(784,"Show all Quick Access Providers")})(xz||(xz={}));var Lz;(function(s){s.quickCommandActionLabel=_(785,"Command Palette"),s.quickCommandHelp=_(786,"Show And Run Commands")})(Lz||(Lz={}));var kz;(function(s){s.quickOutlineActionLabel=_(787,"Go to Symbol..."),s.quickOutlineByCategoryActionLabel=_(788,"Go to Symbol by Category...")})(kz||(kz={}));var PM;(function(s){s.editorViewAccessibleLabel=_(789,"Editor content")})(PM||(PM={}));var Ez;(function(s){s.toggleHighContrast=_(790,"Toggle High Contrast Theme")})(Ez||(Ez={}));var FM;(function(s){s.bulkEditServiceSummary=_(791,"Made {0} edits in {1} files")})(FM||(FM={}));const Nve=We("workspaceTrustManagementService");let ip=[],BM=[],Nz=[];function Xy(s,e=!1){Dve(s,!1,e)}function Dve(s,e,t){const n=Tve(s,e);ip.push(n),n.userConfigured?Nz.push(n):BM.push(n),t&&!n.userConfigured&&ip.forEach(i=>{i.mime===n.mime||i.userConfigured||(n.extension&&i.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&i.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&i.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&i.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}function Tve(s,e){return{id:s.id,mime:s.mime,filename:s.filename,extension:s.extension,filepattern:s.filepattern,firstline:s.firstline,userConfigured:e,filenameLowercase:s.filename?s.filename.toLowerCase():void 0,extensionLowercase:s.extension?s.extension.toLowerCase():void 0,filepatternLowercase:s.filepattern?eH(s.filepattern.toLowerCase()):void 0,filepatternOnPath:s.filepattern?s.filepattern.indexOf(fn.sep)>=0:!1}}function Ive(){ip=ip.filter(s=>s.userConfigured),BM=[]}function Mve(s,e){return Rve(s,e).map(t=>t.id)}function Rve(s,e){let t;if(s)switch(s.scheme){case Le.file:t=s.fsPath;break;case Le.data:{t=EC.parseMetaData(s).get(EC.META_DATA_LABEL);break}case Le.vscodeNotebookCell:t=void 0;break;default:t=s.path}if(!t)return[{id:"unknown",mime:El.unknown}];t=t.toLowerCase();const n=eF(t),i=Dz(t,n,Nz);if(i)return[i,{id:Jr,mime:El.text}];const r=Dz(t,n,BM);if(r)return[r,{id:Jr,mime:El.text}];if(e){const o=Ave(e);if(o)return[o,{id:Jr,mime:El.text}]}return[{id:"unknown",mime:El.unknown}]}function Dz(s,e,t){let n,i,r;for(let o=t.length-1;o>=0;o--){const a=t[o];if(e===a.filenameLowercase){n=a;break}if(a.filepattern&&(!i||a.filepattern.length>i.filepattern.length)){const l=a.filepatternOnPath?s:e;a.filepatternLowercase?.(l)&&(i=a)}a.extension&&(!r||a.extension.length>r.extension.length)&&e.endsWith(a.extensionLowercase)&&(r=a)}if(n)return n;if(i)return i;if(r)return r}function Ave(s){if(W2(s)&&(s=s.substr(1)),s.length>0)for(let e=ip.length-1;e>=0;e--){const t=ip[e];if(!t.firstline)continue;const n=s.match(t.firstline);if(n&&n.length>0)return t}}const Zy=Object.prototype.hasOwnProperty,Tz="vs.editor.nullLanguage";class Ove{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Tz,0),this._register(Jr,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Tz}}const Gb=class Gb extends U{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new A),this.onDidChange=this._onDidChange.event,Gb.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new Ove,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(ig.onDidChangeLanguages(n=>{this._initializeFromRegistry()})))}dispose(){Gb.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Ive();const e=[].concat(ig.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const n=this._languages[t];n.name&&(this._nameMap[n.name]=n.identifier),n.aliases.forEach(i=>{this._lowercaseNameMap[i.toLowerCase()]=n.identifier}),n.mimetypes.forEach(i=>{this._mimeTypesMap[i]=n.identifier})}),Xn.as(Dh.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let n;Zy.call(this._languages,t)?n=this._languages[t]:(this.languageIdCodec.register(t),n={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=n),this._mergeLanguage(n,e)}_mergeLanguage(e,t){const n=t.id;let i=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),i=t.mimetypes[0]),i||(i=`text/x-${n}`,e.mimetypes.push(i)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)Xy({id:n,mime:i,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)Xy({id:n,mime:i,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)Xy({id:n,mime:i,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);SF(l)||Xy({id:n,mime:i,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(n);let r=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?r=[null]:r=t.aliases),r!==null)for(const a of r)!a||a.length===0||e.aliases.push(a);const o=r!==null&&r.length>0;if(!(o&&r[0]===null)){const a=(o?r[0]:null)||n;(o||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Zy.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Zy.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Zy.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:Mve(e,t)}};Gb.instanceCount=0;let VM=Gb;const Yb=class Yb extends U{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new A),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new A),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new A({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Yb.instanceCount++,this._registry=this._register(new VM(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Yb.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new Iz(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Iz(this.onDidChange,()=>{const n=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(n)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Jr),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),gn.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};Yb.instanceCount=0;let WM=Yb;class Iz{constructor(e,t){this._value=Bt(this,e,()=>t()),this.onDidChange=X.fromObservable(this._value)}get languageId(){return this._value.get()}}function qTe(s){return s}function Yl(s,e){if(s!==void 0){const t=s.match(/^\s*var\((.+)\)$/);if(t){const n=t[1].split(",",2);return n.length===2&&(e=Yl(n[1].trim(),e)),`var(${n[0]}, ${e})`}return s}return e}function Mz(s){const e=s.replaceAll(/[^_\-a-z0-9]/gi,"");return e!==s&&console.warn(`CSS ident value ${s} modified to ${e} to be safe for CSS`),e}function Cd(s){return`'${s.replaceAll(/'/g,"\\000027")}'`}function ka(s){return s?zs`url('${CSS.escape(VF.uriToBrowserUri(s).toString(!0))}')`:"url('')"}function Qy(s,e=!1){const t=CSS.escape(s);return!e&&t!==s&&console.warn(`CSS class name ${s} modified to ${t} to be safe for CSS`),t}function zs(s,...e){return s.reduce((t,n,i)=>{const r=e[i]||"";return t+n+r},"")}class HM{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e=`
|
|
503
503
|
`){return this._parts.join(e)}}const Rz={TEXT:El.text};let Jy=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});const Pve=new Wi(()=>Jy("mouse",!1)),Fve=new Wi(()=>Jy("element",!1));function Bve(s){Jy=s}function ro(s){return s==="element"?Fve.value:Pve.value}function zM(){return Jy("element",!0)}let Az={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>U.None,setupDelayedHoverAtMouse:()=>U.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}};function Vve(s){Az=s}function Fo(){return Az}class Wve{constructor(e){this.spliceables=e}splice(e,t,n){this.spliceables.forEach(i=>i.splice(e,t,n))}}class yu extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function Oz(s,e){const t=[];for(const n of e){if(s.start>=n.range.end)continue;if(s.end<n.range.start)break;const i=Si.intersect(s,n.range);Si.isEmpty(i)||t.push({range:i,size:n.size})}return t}function $M({start:s,end:e},t){return{start:s+t,end:e+t}}function Hve(s){const e=[];let t=null;for(const n of s){const i=n.range.start,r=n.range.end,o=n.size;if(t&&o===t.size){t.range.end=r;continue}t={range:{start:i,end:r},size:o},e.push(t)}return e}function zve(...s){return Hve(s.reduce((e,t)=>e.concat(t),[]))}class $ve{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,n=[]){const i=n.length-t,r=Oz({start:0,end:e},this.groups),o=Oz({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:$M(l.range,i),size:l.size})),a=n.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=zve(r,a,o),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,n=this._paddingTop;for(const i of this.groups){const r=i.range.end-i.range.start,o=n+r*i.size;if(e<o)return t+Math.floor((e-n)/i.size);t+=r,n=o}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,n=0;for(const i of this.groups){const r=i.range.end-i.range.start,o=n+r;if(e<o)return this._paddingTop+t+(e-n)*i.size;t+=r*i.size,n=o}return-1}}class Uve{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),n=!1;if(t)n=this.transactionNodesPendingRemoval.has(t.domNode),n&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const i=ve(".monaco-list-row"),o=this.getRenderer(e).renderTemplate(i);t={domNode:i,templateId:e,templateData:o}}return{row:t,isReusingConnectedDomNode:n}}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:n}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(n).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),e.remove()}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const n of e)this.getRenderer(t).disposeTemplate(n.templateData),n.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}function jve(s,e,t,n=[]){if(!s.dataTransfer)return;const i=ve(".monaco-drag-image");i.textContent=t,i.classList.add(...n),(a=>{for(;a&&!a.classList.contains("monaco-workbench");)a=a.parentElement;return a||e.ownerDocument.body})(e).appendChild(i),s.dataTransfer.setDragImage(i,-10,-10),setTimeout(()=>i.remove(),0)}var Xl=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r};const Su={CurrentDragAndDropData:void 0},Ea={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(s){return[s]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class Q1{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Kve{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class qve{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const n=e.files.item(t);n&&(n.size||n.type)&&this.files.push(n)}}}getData(){return{types:this.types,files:this.files}}}function Gve(s,e){return Array.isArray(s)&&Array.isArray(e)?Sn(s,e):s===e}class Yve{constructor(e){e?.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(t,n,i)=>i,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,n)=>n+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}const Px=class Px{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:wN(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,n,i=Ea){if(this.virtualDelegate=t,this.domId=`list_id_${++Px.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new qm(50),this.splicing=!1,this.dragOverAnimationStopDisposable=U.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=U.None,this.onDragLeaveTimeout=U.None,this.currentSelectionDisposable=U.None,this.disposables=new le,this._onDidChangeContentHeight=new A,this._onDidChangeContentWidth=new A,this.onDidChangeContentHeight=X.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,i.horizontalScrolling&&i.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(i.paddingTop??0);for(const o of n)this.renderers.set(o.templateId,o);if(this.cache=this.disposables.add(new Uve(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof i.mouseSupport=="boolean"?i.mouseSupport:!0),this._horizontalScrolling=i.horizontalScrolling??Ea.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof i.paddingBottom>"u"?0:i.paddingBottom,this.accessibilityProvider=new Yve(i.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(i.transformOptimization??Ea.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Xi.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new Tg({forceIntegerValues:!0,smoothScrollDuration:i.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:o=>fs(pe(this.domNode),o)})),this.scrollableElement=this.disposables.add(new yv(this.rowsContainer,{alwaysConsumeMouseWheel:i.alwaysConsumeMouseWheel??Ea.alwaysConsumeMouseWheel,horizontal:1,vertical:i.verticalScrollMode??Ea.verticalScrollMode,useShadows:i.useShadows??Ea.useShadows,mouseWheelScrollSensitivity:i.mouseWheelScrollSensitivity,fastScrollSensitivity:i.fastScrollSensitivity,scrollByPage:i.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(B(this.rowsContainer,St.Change,o=>this.onTouchChange(o))),this.disposables.add(B(this.scrollableElement.getDomNode(),"scroll",o=>{const a=o.target,l=a.scrollTop;a.scrollTop=0,i.scrollToActiveElement&&this.setScrollTop(this.scrollTop+l)})),this.disposables.add(B(this.domNode,"dragover",o=>this.onDragOver(this.toDragEvent(o)))),this.disposables.add(B(this.domNode,"drop",o=>this.onDrop(this.toDragEvent(o)))),this.disposables.add(B(this.domNode,"dragleave",o=>this.onDragLeave(this.toDragEvent(o)))),this.disposables.add(B(this.domNode,"dragend",o=>this.onDragEnd(o))),i.userSelection){if(i.dnd)throw new Error("DND and user selection cannot be used simultaneously");this.disposables.add(B(this.domNode,"mousedown",o=>this.onPotentialSelectionStart(o)))}this.setRowLineHeight=i.setRowLineHeight??Ea.setRowLineHeight,this.setRowHeight=i.setRowHeight??Ea.setRowHeight,this.supportDynamicHeights=i.supportDynamicHeights??Ea.supportDynamicHeights,this.dnd=i.dnd??this.disposables.add(Ea.dnd),this.layout(i.initialSize?.height,i.initialSize?.width),i.scrollToActiveElement&&this._setupFocusObserver(e)}_setupFocusObserver(e){this.disposables.add(B(e,"focus",()=>{const t=Hn();this.activeElement!==t&&t!==null&&(this.activeElement=t,this._scrollToActiveElement(this.activeElement,e))},!0))}_scrollToActiveElement(e,t){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect().top-n.top;r<0&&this.setScrollTop(this.scrollTop+r)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(n,Math.max(0,this.lastRenderTop+i),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new $ve(e)}splice(e,t,n=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,n)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,n=[]){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r={start:e,end:e+t},o=Si.intersect(i,r),a=new Map;for(let S=o.end-1;S>=o.start;S--){const k=this.items[S];if(k.dragStartDisposable.dispose(),k.checkedDisposable.dispose(),k.row){let L=a.get(k.templateId);L||(L=[],a.set(k.templateId,L));const E=this.renderers.get(k.templateId);E&&E.disposeElement&&E.disposeElement(k.element,S,k.row.templateData,{height:k.size}),L.unshift(k.row)}k.row=null,k.stale=!0}const l={start:e+t,end:this.items.length},c=Si.intersect(l,i),d=Si.relativeComplement(l,i),h=n.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:U.None,checkedDisposable:U.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=Iw(this.items,e,t,h));const f=n.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=$M(c,f),m=Si.intersect(g,p);for(let S=m.start;S<m.end;S++)this.updateItemInDOM(this.items[S],S);const b=Si.relativeComplement(p,g);for(const S of b)for(let k=S.start;k<S.end;k++)this.removeItemFromDOM(k);const w=d.map(S=>$M(S,f)),v=[{start:e,end:e+n.length},...w].map(S=>Si.intersect(g,S)).reverse();for(const S of v)for(let k=S.end-1;k>=S.start;k--){const L=this.items[k],N=a.get(L.templateId)?.pop();this.insertItemInDOM(k,N)}for(const S of a.values())for(const k of S)this.cache.release(k);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=fs(pe(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const n={height:typeof e=="number"?e:eae(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,n.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(n),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:wN(this.domNode)})}render(e,t,n,i,r,o=!1,a=!1){const l=this.getRenderRange(t,n),c=Si.relativeComplement(l,e).reverse(),d=Si.relativeComplement(e,l);if(o){const h=Si.intersect(e,l);for(let u=h.start;u<h.end;u++)this.updateItemInDOM(this.items[u],u)}this.cache.transact(()=>{for(const h of d)for(let u=h.start;u<h.end;u++)this.removeItemFromDOM(u,a);for(const h of c)for(let u=h.end-1;u>=h.start;u--)this.insertItemInDOM(u)}),i!==void 0&&(this.rowsContainer.style.left=`-${i}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&r!==void 0&&(this.rowsContainer.style.width=`${Math.max(r,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=n}insertItemInDOM(e,t){const n=this.items[e];if(!n.row)if(t)n.row=t,n.stale=!0;else{const l=this.cache.alloc(n.templateId);n.row=l.row,n.stale||=l.isReusingConnectedDomNode}const i=this.accessibilityProvider.getRole(n.element)||"listitem";n.row.domNode.setAttribute("role",i);const r=this.accessibilityProvider.isChecked(n.element);if(typeof r=="boolean")n.row.domNode.setAttribute("aria-checked",String(!!r));else if(r){const l=c=>n.row.domNode.setAttribute("aria-checked",String(!!c));l(r.value),n.checkedDisposable=r.onDidChange(()=>l(r.value))}if(n.stale||!n.row.domNode.parentElement){const l=this.items.at(e+1)?.row?.domNode??null;(n.row.domNode.parentElement!==this.rowsContainer||n.row.domNode.nextElementSibling!==l)&&this.rowsContainer.insertBefore(n.row.domNode,l),n.stale=!1}this.updateItemInDOM(n,e);const o=this.renderers.get(n.templateId);if(!o)throw new Error(`No renderer found for template id ${n.templateId}`);o?.renderElement(n.element,e,n.row.templateData,{height:n.size});const a=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!a,a&&(n.dragStartDisposable=B(n.row.domNode,"dragstart",l=>this.onDragStart(n.element,a,l))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=wN(e.row.domNode);const t=pe(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e,t){const n=this.items[e];if(n.dragStartDisposable.dispose(),n.checkedDisposable.dispose(),n.row){const i=this.renderers.get(n.templateId);i&&i.disposeElement&&i.disposeElement(n.element,e,n.row.templateData,{height:n.size,onScroll:t}),this.cache.release(n.row),n.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return X.map(this.disposables.add(new ht(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return X.map(this.disposables.add(new ht(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return X.filter(X.map(this.disposables.add(new ht(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return X.map(this.disposables.add(new ht(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return X.map(this.disposables.add(new ht(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return X.map(this.disposables.add(new ht(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return X.any(X.map(this.disposables.add(new ht(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),X.map(this.disposables.add(new ht(this.domNode,St.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return X.map(this.disposables.add(new ht(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return X.map(this.disposables.add(new ht(this.rowsContainer,St.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],i=n&&n.element;return{browserEvent:e,index:t,element:i}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],i=n&&n.element;return{browserEvent:e,index:t,element:i}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),n=typeof t>"u"?void 0:this.items[t],i=n&&n.element;return{browserEvent:e,index:t,element:i}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),n=typeof t>"u"?void 0:this.items[t],i=n&&n.element,r=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:i,sector:r}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,n){if(!n.dataTransfer)return;const i=this.dnd.getDragElements(e);n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setData(Rz.TEXT,t);let r;this.dnd.getDragLabel&&(r=this.dnd.getDragLabel(i,n)),typeof r>"u"&&(r=String(i.length)),jve(n,this.domNode,r,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new Q1(i),Su.CurrentDragAndDropData=new Kve(i),this.dnd.onDragStart?.(this.currentDragData,n)}onPotentialSelectionStart(e){this.currentSelectionDisposable.dispose();const t=Uoe(this.domNode),n=this.currentSelectionDisposable=new le,i=n.add(new le);i.add(B(this.domNode,"selectstart",()=>{i.add(B(t,"mousemove",r=>{t.getSelection()?.isCollapsed===!1&&this.setupDragAndDropScrollTopAnimation(r)})),n.add(Ce(()=>{const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(r,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)})),n.add(B(t,"selectionchange",()=>{const r=t.getSelection();if(!r||r.isCollapsed){i.isDisposed&&n.dispose();return}let o=this.getIndexOfListElement(r.anchorNode),a=this.getIndexOfListElement(r.focusNode);o!==void 0&&a!==void 0&&(a<o&&([o,a]=[a,o]),this.currentSelectionBounds={start:o,end:a})}))})),i.add(B(t,"mouseup",()=>{i.dispose(),this.teardownDragAndDropScrollTopAnimation(),t.getSelection()?.isCollapsed!==!1&&n.dispose()}))}getIndexOfListElement(e){if(!(!e||!this.domNode.contains(e)))for(;e&&e!==this.domNode;){if(e.dataset?.index)return Number(e.dataset.index);e=e.parentElement}}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Su.CurrentDragAndDropData&&Su.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Su.CurrentDragAndDropData)this.currentDragData=Su.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new qve}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&t.effect?.type===0?"copy":"move";let n;typeof t!="boolean"&&t.feedback?n=t.feedback:typeof e.index>"u"?n=[-1]:n=[e.index],n=Qd(n).filter(r=>r>=-1&&r<this.length).sort((r,o)=>r-o),n=n[0]===-1?[-1]:n;let i=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(Gve(this.currentDragFeedback,n)&&this.currentDragFeedbackPosition===i)return!0;if(this.currentDragFeedback=n,this.currentDragFeedbackPosition=i,this.currentDragFeedbackDisposable.dispose(),n[0]===-1)this.domNode.classList.add(i),this.rowsContainer.classList.add(i),this.currentDragFeedbackDisposable=Ce(()=>{this.domNode.classList.remove(i),this.rowsContainer.classList.remove(i)});else{if(n.length>1&&i!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");i==="drop-target-after"&&n[0]<this.length-1&&(n[0]+=1,i="drop-target-before");for(const r of n){const o=this.items[r];o.dropTarget=!0,o.row?.domNode.classList.add(i)}this.currentDragFeedbackDisposable=Ce(()=>{for(const r of n){const o=this.items[r];o.dropTarget=!1,o.row?.domNode.classList.remove(i)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=G2(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Su.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Su.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=U.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=Joe(this.domNode).top;this.dragOverAnimationDisposable=cae(pe(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=G2(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,n=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>n&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-n))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const n=e.offsetY/this.items[t].size,i=Math.floor(n/.25);return Cs(i,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let n=e;for(;(sn(n)||h9(n))&&n!==this.rowsContainer&&t.contains(n);){const i=n.getAttribute("data-index");if(i){const r=Number(i);if(!isNaN(r))return r}n=n.parentElement}}getVisibleRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}getRenderRange(e,t){const n=this.getVisibleRange(e,t);if(this.currentSelectionBounds){const i=this.rangeMap.count;n.start=Math.min(n.start,this.currentSelectionBounds.start,i),n.end=Math.min(Math.max(n.end,this.currentSelectionBounds.end+1),i)}return n}_rerender(e,t,n){const i=this.getRenderRange(e,t);let r,o;e===this.elementTop(i.start)?(r=i.start,o=0):i.end-i.start>1&&(r=i.start+1,o=this.elementTop(r)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d<l.end;d++){const h=this.probeDynamicHeight(d);h!==0&&this.rangeMap.splice(d,1,[this.items[d]]),a+=h,c=c||h!==0}if(!c){a!==0&&this.eventuallyUpdateScrollDimensions();const d=Si.relativeComplement(i,l);for(const u of d)for(let f=u.start;f<u.end;f++)this.items[f].row&&this.removeItemFromDOM(f);const h=Si.relativeComplement(l,i).reverse();for(const u of h)for(let f=u.end-1;f>=u.start;f--)this.insertItemInDOM(f);for(let u=l.start;u<l.end;u++)this.items[u].row&&this.updateItemInDOM(this.items[u],u);if(typeof r=="number"){const u=this.scrollable.getFutureScrollPosition().scrollTop-e,f=this.elementTop(r)-o+u;this.setScrollTop(f,n)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){const t=this.items[e];if(this.virtualDelegate.getDynamicHeight){const o=this.virtualDelegate.getDynamicHeight(t.element);if(o!==null){const a=t.size;return t.size=o,t.lastDynamicHeightWidth=this.renderWidth,o-a}}if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;const n=t.size;if(t.row)return t.row.domNode.style.height="",t.size=t.row.domNode.offsetHeight,t.size===0&&!Wn(t.row.domNode,pe(t.row.domNode).document.body)&&console.warn("Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!",new Error().stack),t.lastDynamicHeightWidth=this.renderWidth,t.size-n;const{row:i}=this.cache.alloc(t.templateId);i.domNode.style.height="",this.rowsContainer.appendChild(i.domNode);const r=this.renderers.get(t.templateId);if(!r)throw new we("Missing renderer for templateId: "+t.templateId);return r.renderElement(t.element,e,i.templateData),t.size=i.domNode.offsetHeight,r.disposeElement?.(t.element,e,i.templateData),this.virtualDelegate.setDynamicHeight?.(t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,i.domNode.remove(),this.cache.release(i),t.size-n}getElementDomId(e){return`${this.domId}_${e}`}dispose(){for(const e of this.items)if(e.dragStartDisposable.dispose(),e.checkedDisposable.dispose(),e.row){const t=this.renderers.get(e.row.templateId);t&&(t.disposeElement?.(e.element,-1,e.row.templateData,void 0),t.disposeTemplate(e.row.templateData))}this.items=[],this.domNode?.remove(),this.dragOverAnimationDisposable?.dispose(),this.disposables.dispose()}};Px.InstanceCount=0;let oo=Px;Xl([Ut],oo.prototype,"onMouseClick",null),Xl([Ut],oo.prototype,"onMouseDblClick",null),Xl([Ut],oo.prototype,"onMouseMiddleClick",null),Xl([Ut],oo.prototype,"onMouseDown",null),Xl([Ut],oo.prototype,"onMouseOver",null),Xl([Ut],oo.prototype,"onMouseOut",null),Xl([Ut],oo.prototype,"onContextMenu",null),Xl([Ut],oo.prototype,"onTouchStart",null),Xl([Ut],oo.prototype,"onTap",null);var vd=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r};class Xve{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,n){const i=this.renderedElements.findIndex(r=>r.templateData===n);if(i>=0){const r=this.renderedElements[i];this.trait.unrender(n),r.index=t}else{const r={index:t,templateData:n};this.renderedElements.push(r)}this.trait.renderIndex(t,n)}splice(e,t,n){const i=[];for(const r of this.renderedElements)r.index<e?i.push(r):r.index>=e+t&&i.push({index:r.index+n-t,templateData:r.templateData});this.renderedElements=i}renderIndexes(e){for(const{index:t,templateData:n}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,n)}disposeTemplate(e){const t=this.renderedElements.findIndex(n=>n.templateData===e);t<0||this.renderedElements.splice(t,1)}}let eS=class{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new Xve(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new A}splice(e,t,n){const i=n.length-t,r=e+t,o=[];let a=0;for(;a<this.sortedIndexes.length&&this.sortedIndexes[a]<e;)o.push(this.sortedIndexes[a++]);for(let l=0;l<n.length;l++)n[l]&&o.push(l+e);for(;a<this.sortedIndexes.length&&this.sortedIndexes[a]>=r;)o.push(this.sortedIndexes[a++]+i);this.renderer.splice(e,t,n.length),this._set(o,o)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(zz),t)}_set(e,t,n){const i=this.indexes,r=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=jM(r,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:n}),i}get(){return this.indexes}contains(e){return Die(this.sortedIndexes,e,zz)>=0}dispose(){xn(this._onChange)}};vd([Ut],eS.prototype,"renderer",null);class Zve extends eS{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class UM{constructor(e,t,n){this.trait=e,this.view=t,this.identityProvider=n}splice(e,t,n){if(!this.identityProvider)return this.trait.splice(e,t,new Array(n.length).fill(!1));const i=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(i.length===0)return this.trait.splice(e,t,new Array(n.length).fill(!1));const r=new Set(i),o=n.map(a=>r.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,o)}}function J1(s,e){return s.classList.contains(e)?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:J1(s.parentElement,e)}function eb(s){return J1(s,"monaco-editor")}function Qve(s){return J1(s,"monaco-custom-toggle")}function Jve(s){return J1(s,"action-item")}function tb(s){return J1(s,"monaco-tree-sticky-row")}function nb(s){return s.classList.contains("monaco-tree-sticky-container")}function Pz(s){return s.tagName==="A"&&s.classList.contains("monaco-button")||s.tagName==="DIV"&&s.classList.contains("monaco-button-dropdown")?!0:s.classList.contains("monaco-list")||!s.parentElement?!1:Pz(s.parentElement)}class Fz{get onKeyDown(){return X.chain(this.disposables.add(new ht(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Eo(t.target)).map(t=>new bt(t)))}constructor(e,t,n){this.list=e,this.view=t,this.disposables=new le,this.multipleSelectionDisposables=new le,this.multipleSelectionSupport=n.multipleSelectionSupport,this.disposables.add(this.onKeyDown(i=>{switch(i.keyCode){case 3:return this.onEnter(i);case 16:return this.onUpArrow(i);case 18:return this.onDownArrow(i);case 11:return this.onPageUpArrow(i);case 12:return this.onPageDownArrow(i);case 9:return this.onEscape(i);case 31:this.multipleSelectionSupport&&(He?i.metaKey:i.ctrlKey)&&this.onCtrlA(i)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(cs(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}vd([Ut],Fz.prototype,"onKeyDown",null);var Na;(function(s){s[s.Automatic=0]="Automatic",s[s.Trigger=1]="Trigger"})(Na||(Na={}));var sp;(function(s){s[s.Idle=0]="Idle",s[s.Typing=1]="Typing"})(sp||(sp={}));const eye=new class{mightProducePrintableCharacter(s){return s.ctrlKey||s.metaKey||s.altKey?!1:s.keyCode>=31&&s.keyCode<=56||s.keyCode>=21&&s.keyCode<=30||s.keyCode>=98&&s.keyCode<=107||s.keyCode>=85&&s.keyCode<=95}};class tye{constructor(e,t,n,i,r){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=n,this.keyboardNavigationEventFilter=i,this.delegate=r,this.enabled=!1,this.state=sp.Idle,this.mode=Na.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new le,this.disposables=new le,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??Na.Automatic}enable(){if(this.enabled)return;let e=!1;const t=X.chain(this.enabledDisposables.add(new ht(this.view.domNode,"keydown")).event,r=>r.filter(o=>!Eo(o.target)).filter(()=>this.mode===Na.Automatic||this.triggered).map(o=>new bt(o)).filter(o=>e||this.keyboardNavigationEventFilter(o)).filter(o=>this.delegate.mightProducePrintableCharacter(o)).forEach(o=>st.stop(o,!0)).map(o=>o.browserEvent.key)),n=X.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);X.reduce(X.any(t,n),(r,o)=>o===null?null:(r||"")+o,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),n(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),n(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));typeof t=="string"?R_(t):t&&R_(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=sp.Idle,this.triggered=!1;return}const t=this.list.getFocus(),n=t.length>0?t[0]:0,i=this.state===sp.Idle?1:0;this.state=sp.Typing;for(let r=0;r<this.list.length;r++){const o=(n+r+i)%this.list.length,a=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(o)),l=a&&a.toString();if(this.list.options.typeNavigationEnabled){if(typeof l<"u"){if(Ly(e,l)){this.previouslyFocused=n,this.list.setFocus([o]),this.list.reveal(o);return}const c=U0e(e,l);if(c&&c[0].end-c[0].start>1&&c.length===1){this.previouslyFocused=n,this.list.setFocus([o]),this.list.reveal(o);return}}}else if(typeof l>"u"||Ly(e,l)){this.previouslyFocused=n,this.list.setFocus([o]),this.list.reveal(o);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class nye{constructor(e,t){this.list=e,this.view=t,this.disposables=new le;const n=X.chain(this.disposables.add(new ht(t.domNode,"keydown")).event,r=>r.filter(o=>!Eo(o.target)).map(o=>new bt(o)));X.chain(n,r=>r.filter(o=>o.keyCode===2&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey&&!o.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const n=this.view.domElement(t[0]);if(!n)return;const i=n.querySelector("[tabIndex]");if(!i||!sn(i)||i.tabIndex===-1)return;const r=pe(i).getComputedStyle(i);r.visibility==="hidden"||r.display==="none"||(e.preventDefault(),e.stopPropagation(),i.focus())}dispose(){this.disposables.dispose()}}function Bz(s){return He?s.browserEvent.metaKey:s.browserEvent.ctrlKey}function Vz(s){return s.browserEvent.shiftKey}function iye(s){return xN(s)&&s.button===2}const Wz={isSelectionSingleChangeEvent:Bz,isSelectionRangeChangeEvent:Vz};class Hz{get onPointer(){return this._onPointer.event}constructor(e){this.list=e,this.disposables=new le,this._onPointer=this.disposables.add(new A),e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Wz),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Xi.addTarget(e.getHTMLElement()))),X.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Wz))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){eb(e.browserEvent.target)||Hn()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Eo(e.browserEvent.target)||eb(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Eo(e.browserEvent.target)||eb(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),iye(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Eo(e.browserEvent.target)||eb(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let n=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof n>"u"&&(n=this.list.getFocus()[0]??t,this.list.setAnchor(n));const i=Math.min(n,t),r=Math.max(n,t),o=cs(i,r+1),a=this.list.getSelection(),l=aye(jM(a,[n]),n);if(l.length===0)return;const c=jM(o,lye(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const i=this.list.getSelection(),r=i.filter(o=>o!==t);this.list.setFocus([t]),this.list.setAnchor(t),i.length===r.length?this.list.setSelection([...r,t],e.browserEvent):this.list.setSelection(r,e.browserEvent)}}dispose(){this.disposables.dispose()}}class sye{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,n=[];e.listBackground&&n.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(n.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),n.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(n.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),n.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&n.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&n.push(`
|
|
504
504
|
.monaco-drag-image${t},
|
|
505
505
|
.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
|
|
@@ -948,7 +948,7 @@ ${e.toString()}`}}class OS{constructor(e=new Gg,t=!1,n,i=ALe){this._services=e,t
|
|
|
948
948
|
|
|
949
949
|
`+t),_t.confirm(n)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const i=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&i.push(e.cancelButton),t=await i[0]?.run({checkboxChecked:!1})}return{result:t}}async error(e,t){await this.prompt({type:an.Error,message:e,detail:t})}}const Zb=class Zb{info(e){return this.notify({severity:an.Info,message:e})}warn(e){return this.notify({severity:an.Warning,message:e})}error(e){return this.notify({severity:an.Error,message:e})}notify(e){switch(e.severity){case an.Error:console.error(e.message);break;case an.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Zb.NO_OP}prompt(e,t,n,i){return Zb.NO_OP}status(e,t){return{close:()=>{}}}};Zb.NO_OP=new Jpe;let SA=Zb,xA=class{constructor(e){this._onWillExecuteCommand=new A,this._onDidExecuteCommand=new A,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const n=gs.getCommand(e);if(!n)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const i=this._instantiationService.invokeFunction.apply(this._instantiationService,[n.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(i)}catch(i){return Promise.reject(i)}}};xA=Ba([cn(0,Xe)],xA);let mp=class extends uve{constructor(e,t,n,i,r,o){super(e,t,n,i,r),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new le;g.add(B(f,Z.KEY_DOWN,p=>{const m=new bt(p);this._dispatch(m,m.target)&&(m.preventDefault(),m.stopPropagation())})),g.add(B(f,Z.KEY_UP,p=>{const m=new bt(p);this._singleModifierDispatch(m,m.target)&&m.preventDefault()})),this._domNodeListeners.push(new XLe(f,g))},l=f=>{for(let g=0;g<this._domNodeListeners.length;g++){const p=this._domNodeListeners[g];p.domNode===f&&(this._domNodeListeners.splice(g,1),p.dispose())}},c=f=>{f.getOption(70)||a(f.getContainerDomNode())},d=f=>{f.getOption(70)||l(f.getContainerDomNode())};this._register(o.onCodeEditorAdd(c)),this._register(o.onCodeEditorRemove(d)),o.listCodeEditors().forEach(c);const h=f=>{a(f.getContainerDomNode())},u=f=>{l(f.getContainerDomNode())};this._register(o.onDiffEditorAdd(h)),this._register(o.onDiffEditorRemove(u)),o.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,n,i){return ra(gs.registerCommand(e,n),this.addDynamicKeybindings([{keybinding:t,command:e,when:i}]))}addDynamicKeybindings(e){const t=e.map(n=>({keybinding:U2(n.keybinding,Gr),command:n.command??null,commandArgs:n.commandArgs,when:n.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ce(()=>{for(let n=0;n<this._dynamicKeybindings.length;n++)if(this._dynamicKeybindings[n]===t[0]){this._dynamicKeybindings.splice(n,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(Kc.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new Y1(e,t,n=>this._log(n))}return this._cachedResolver}_documentHasFocus(){return _t.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const n=[];let i=0;for(const r of e){const o=r.when||void 0,a=r.keybinding;if(!a)n[i++]=new vz(void 0,r.command,r.commandArgs,o,t,null,!1);else{const l=X1.resolveKeybinding(a,Gr);for(const c of l)n[i++]=new vz(c,r.command,r.commandArgs,o,t,null,!1)}}return n}resolveKeyboardEvent(e){const t=new hh(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new X1([t],Gr)}};mp=Ba([cn(0,rt),cn(1,Js),cn(2,Ll),cn(3,io),cn(4,ji),cn(5,Dn)],mp);class XLe extends U{constructor(e,t){super(),this.domNode=e,this._register(t)}}function CU(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof ze)}let FS=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new A,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new BLe(e);this._configuration=new Ky(t.reload(),Jn.createEmptyModel(e),Jn.createEmptyModel(e),Jn.createEmptyModel(e),Jn.createEmptyModel(e),Jn.createEmptyModel(e),new yi,Jn.createEmptyModel(e),new yi,e),t.dispose()}getValue(e,t){const n=typeof e=="string"?e:void 0,i=CU(e)?e:CU(t)?t:{};return this._configuration.getValue(n,i,void 0)}updateValues(e){const t={data:this._configuration.toData()},n=[];for(const i of e){const[r,o]=i;this.getValue(r)!==o&&(this._configuration.updateValue(r,o),n.push(r))}if(n.length>0){const i=new lve({keys:n,overrides:[]},t,this._configuration,void 0,this.logService);i.source=8,this._onDidChangeConfiguration.fire(i)}return Promise.resolve()}updateValue(e,t,n,i){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};FS=Ba([cn(0,ji)],FS);let LA=class{constructor(e,t,n){this.configurationService=e,this.modelService=t,this.languageService=n,this._onDidChangeConfiguration=new A,this.configurationService.onDidChangeConfiguration(i=>{this._onDidChangeConfiguration.fire({affectedKeys:i.affectedKeys,affectsConfiguration:(r,o)=>i.affectsConfiguration(o)})})}getValue(e,t,n){const i=P.isIPosition(t)?t:null,r=i?typeof n=="string"?n:void 0:typeof t=="string"?t:void 0,o=e?this.getLanguage(e,i):void 0;return typeof r>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:o}):this.configurationService.getValue(r,{resource:e,overrideIdentifier:o})}getLanguage(e,t){const n=this.modelService.getModel(e);return n?t?n.getLanguageIdAtPosition(t.lineNumber,t.column):n.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};LA=Ba([cn(0,Ft),cn(1,$i),cn(2,$n)],LA);let kA=class{constructor(e){this.configurationService=e}getEOL(e,t){const n=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return n&&typeof n=="string"&&n!=="auto"?n:Ts||He?`
|
|
950
950
|
`:`\r
|
|
951
|
-
`}};kA=Ba([cn(0,Ft)],kA);class ZLe{publicLog2(){}}const Qb=class Qb{constructor(){const e=ze.from({scheme:Qb.SCHEME,authority:"model",path:"/"});this.workspace={id:Eve,folders:[new Lve({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===Qb.SCHEME?this.workspace.folders[0]:null}};Qb.SCHEME="inmemory";let EA=Qb;function BS(s,e,t){if(!e||!(s instanceof FS))return;const n=[];Object.keys(e).forEach(i=>{ive(i)&&n.push([`editor.${i}`,e[i]]),t&&sve(i)&&n.push([`diffEditor.${i}`,e[i]])}),n.length>0&&s.updateValues(n)}let NA=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const n=Array.isArray(e)?e:MM.convert(e),i=new Map;for(const a of n){if(!(a instanceof vu))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=i.get(l);c||(c=[],i.set(l,c)),c.push(rve.replaceMove(R.lift(a.textEdit.range),a.textEdit.text))}let r=0,o=0;for(const[a,l]of i)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),o+=1,r+=l.length;return{ariaSummary:T2(FM.bulkEditServiceSummary,r,o),isApplied:r>0}}};NA=Ba([cn(0,$i)],NA);class QLe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return FN(e)}}let DA=class extends UCe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const i=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();i&&(t=i.getContainerDomNode())}return super.showContextView(e,t,n)}};DA=Ba([cn(0,jl),cn(1,Dn)],DA);class JLe{constructor(){this._neverEmitter=new A,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class eke extends WM{constructor(){super()}}class tke extends WLe{constructor(){super(new ile)}}let TA=class extends tR{constructor(e,t,n,i,r,o){super(e,t,n,i,r,o),this.configure({blockMouse:!1})}};TA=Ba([cn(0,Ll),cn(1,io),cn(2,N1),cn(3,Qn),cn(4,Lh),cn(5,rt)],TA);const nke={esmModuleLocation:void 0,label:"editorWorkerService"};let IA=class extends fD{constructor(e,t,n,i,r){super(nke,e,t,n,i,r)}};IA=Ba([cn(0,$i),cn(1,dD),cn(2,ji),cn(3,ua),cn(4,yt)],IA);class ike{async playSignal(e,t){}}qe(ji,tke,0),qe(Ft,FS,0),qe(dD,LA,0),qe(Z8,kA,0),qe(xve,EA,0),qe(bve,QLe,0),qe(Ll,ZLe,0),qe(PW,YLe,0),qe(UW,GLe,0),qe(io,SA,0),qe(Lu,Fu,0),qe($n,eke,0),qe(ao,CLe,0),qe($i,lR,0),qe(d6,aR,0),qe(rt,CA,0),qe(wve,qLe,0),qe(OM,yA,0),qe(q1,ZCe,0),qe(ob,IA,0),qe(tve,NA,0),qe(Nve,JLe,0),qe(pC,vA,0),qe(sr,hA,0),qe(Ta,Nxe,0),qe(Js,xA,0),qe(Qn,mp,0),qe(wu,rA,0),qe(N1,DA,0),qe(D1,oR,0),qe(_A,mA,0),qe(Kl,TA,0),qe(Lh,uA,0),qe(PS,ike,0),qe(gI,$Le,0),qe(tle,ale,0),qe(ULe,jLe,0);var be;(function(s){const e=new Gg;for(const[l,c]of r8())e.set(l,c);const t=new OS(e,!0);e.set(Xe,t);function n(l){i||o({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof ha?t.invokeFunction(d=>d.get(l)):c}s.get=n;let i=!1;const r=new A;function o(l){if(i)return t;i=!0;for(const[d,h]of r8())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=We(d);e.get(h)instanceof ha&&e.set(h,l[d])}const c=zLe();for(const d of c)try{t.createInstance(d)}catch(h){dt(h)}return r.fire(),t}s.initialize=o;function a(l){if(i)return l();const c=new le,d=c.add(r.event(()=>{d.dispose(),c.add(l())}));return c}s.withServices=a})(be||(be={}));function Jl(s,e){return s}function ec(s,e,t,n=bi.ofCaller()){const i=s.bindTo(e),r=new le;return aa({debugName:()=>`Set Context Key "${s.key}"`},o=>{const a=t(o);return i.set(a),a},n).recomputeInitiallyAndOnChange(r),r}class VS{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new VS(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const i=e.getVisibleRanges();if(i.length>0){t=i[0].getStartPosition();const r=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-r}return new VS(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,i,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=i,this._cursorPosition=r}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n,1)}}function ske(s,e,t,n){if(s.length===0)return e;if(e.length===0)return s;const i=[];let r=0,o=0;for(;r<s.length&&o<e.length;){const a=s[r],l=e[o],c=t(a),d=t(l);c<d?(i.push(a),r++):c>d?(i.push(l),o++):(i.push(n(a,l)),r++,o++)}for(;r<s.length;)i.push(s[r]),r++;for(;o<e.length;)i.push(e[o]),o++;return i}function WS(s,e){const t=new le,n=s.createDecorationsCollection();return t.add(hN({debugName:()=>`Apply decorations from ${e.debugName}`},i=>{const r=e.read(i);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function kb(s,e){return s.appendChild(e),Ce(()=>{e.remove()})}function rke(s,e){return s.prepend(e),Ce(()=>{e.remove()})}class vU extends U{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new h6(e,t)),this._width=Me(this,this.elementSizeObserver.getWidth()),this._height=Me(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>nn(i=>{this._width.set(this.elementSizeObserver.getWidth(),i),this._height.set(this.elementSizeObserver.getHeight(),i)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function yU(s,e,t){let n=e.get(),i=n,r=n;const o=Me("animatedValue",n);let a=-1;const l=300;let c;t.add(Gf({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)}},(h,u)=>{c!==void 0&&(s.cancelAnimationFrame(c),c=void 0),i=r,n=e.read(h),a=Date.now()-(u.animate?0:l),d()}));function d(){const h=Date.now()-a;r=Math.floor(oke(h,i,n-i,l)),h<l?c=s.requestAnimationFrame(d):r=n,o.set(r,void 0)}return o}function oke(s,e,t,n){return s===n?e+t:t*(-Math.pow(2,-10*s/n)+1)+e}class MA extends U{constructor(e,t,n){super(),this._register(new RA(e,n)),this._register(Ld(n,{height:t.actualHeight,top:t.actualTop}))}}class _p{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=Me(this,void 0),this._actualHeight=Me(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=n=>{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}const Gx=class Gx{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Gx._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};Gx._counter=0;let RA=Gx;function Ld(s,e){return Ke(t=>{for(let[n,i]of Object.entries(e))i&&typeof i=="object"&&"read"in i&&(i=i.read(t)),typeof i=="number"&&(i=`${i}px`),n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),s.style[n]=i})}function HS(s,e,t,n){const i=new le,r=[];return i.add(Lo((o,a)=>{const l=e.read(o),c=new Map,d=new Map;t&&t(!0),s.changeViewZones(h=>{for(const u of r)h.removeZone(u),n?.delete(u);r.length=0;for(const u of l){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),r.push(f),n?.add(f),c.set(u,f)}}),t&&t(!1),a.add(Gf({changeTracker:{createChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}}},(h,u)=>{for(const f of l)f.onChange&&(d.set(f.onChange,c.get(f)),f.onChange.read(h));t&&t(!0),s.changeViewZones(f=>{for(const g of u.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),i.add({dispose(){t&&t(!0),s.changeViewZones(o=>{for(const a of r)o.removeZone(a)}),n?.clear(),t&&t(!1)}}),i}function SU(s,e){const t=zC(e,i=>i.original.startLineNumber<=s.lineNumber);if(!t)return R.fromPositions(s);if(t.original.endLineNumberExclusive<=s.lineNumber){const i=s.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return R.fromPositions(new P(i,s.column))}if(!t.innerChanges)return R.fromPositions(new P(t.modified.startLineNumber,1));const n=zC(t.innerChanges,i=>i.originalRange.getStartPosition().isBeforeOrEqual(s));if(!n){const i=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return R.fromPositions(new P(i,s.column))}if(n.originalRange.containsPosition(s))return n.modifiedRange;{const i=ake(n.originalRange.getEndPosition(),s);return R.fromPositions(i.addToPosition(n.modifiedRange.getEndPosition()))}}function ake(s,e){return s.lineNumber===e.lineNumber?new As(0,e.column-s.column):new As(e.lineNumber-s.lineNumber,e.column-1)}function lke(s,e){let t;return s.filter(n=>{const i=e(n,t);return t=n,i})}class zS{static create(e,t=void 0){return new xU(e,e,t)}static createWithDisposable(e,t,n=void 0){const i=new le;return i.add(t),i.add(e),new xU(e,i,n)}}class xU extends zS{constructor(e,t,n){super(),this.object=e,this._disposable=t,this._debugOwner=n,this._refCount=1,this._isDisposed=!1,this._owners=[],n&&this._addOwner(n)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new cke(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class cke extends zS{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}var AA=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},OA=function(s,e){return function(t,n){e(t,n,s)}};const dke=Sd("diff-review-insert",ne.add,_(94,"Icon for 'Insert' in accessible diff viewer.")),hke=Sd("diff-review-remove",ne.remove,_(95,"Icon for 'Remove' in accessible diff viewer.")),uke=Sd("diff-review-close",ne.close,_(96,"Icon for 'Close' in accessible diff viewer."));let Bu=(Wp=class extends U{constructor(e,t,n,i,r,o,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=i,this._width=r,this._height=o,this._diffs=a,this._models=l,this._instantiationService=c,this._state=he(this,d=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const u=d.store.add(this._instantiationService.createInstance(PA,this._diffs,this._models,this._setVisible,this._canClose)),f=d.store.add(this._instantiationService.createInstance(FA,this._parentNode,u,this._width,this._height,this._models));return{model:u,view:f}}).recomputeInitiallyAndOnChange(this._store)}next(){nn(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){nn(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){nn(e=>{this._setVisible(!1,e)})}},Wp._ttPolicy=Gc("diffReview",{createHTML:e=>e}),Wp);Bu=AA([OA(8,Xe)],Bu);let PA=class extends U{constructor(e,t,n,i,r){super(),this._diffs=e,this._models=t,this._setVisible=n,this.canClose=i,this._accessibilitySignalService=r,this._groups=Me(this,[]),this._currentGroupIdx=Me(this,0),this._currentElementIdx=Me(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((o,a)=>this._groups.read(a)[o]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((o,a)=>this.currentGroup.read(a)?.lines[o]),this._register(Ke(o=>{const a=this._diffs.read(o);if(!a){this._groups.set([],void 0);return}const l=fke(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());nn(c=>{const d=this._models.getModifiedPosition();if(d){const h=l.findIndex(u=>d?.lineNumber<u.range.modified.endLineNumberExclusive);h!==-1&&this._currentGroupIdx.set(h,c)}this._groups.set(l,c)})})),this._register(Ke(o=>{const a=this.currentElement.read(o);a?.type===ts.Deleted?this._accessibilitySignalService.playSignal(Fa.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===ts.Added&&this._accessibilitySignalService.playSignal(Fa.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ke(o=>{const a=this.currentElement.read(o);if(a&&a.type!==ts.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(R.fromPositions(new P(l,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||lN(t,i=>{this._currentGroupIdx.set(fe.ofLength(n.length).clipCyclic(this._currentGroupIdx.get()+e),i),this._currentElementIdx.set(0,i)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||nn(n=>{this._currentElementIdx.set(fe.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&nn(i=>{this._currentElementIdx.set(n,i)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ts.Deleted?this._models.originalReveal(R.fromPositions(new P(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ts.Header?R.fromPositions(new P(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};PA=AA([OA(4,PS)],PA);const Eb=3;function fke(s,e,t){const n=[];for(const i of Zk(s,(r,o)=>o.modified.startLineNumber-r.modified.endLineNumberExclusive<2*Eb)){const r=[];r.push(new pke);const o=new xe(Math.max(1,i[0].original.startLineNumber-Eb),Math.min(i[i.length-1].original.endLineNumberExclusive+Eb,e+1)),a=new xe(Math.max(1,i[0].modified.startLineNumber-Eb),Math.min(i[i.length-1].modified.endLineNumberExclusive+Eb,t+1));S7(i,(d,h)=>{const u=new xe(d?d.original.endLineNumberExclusive:o.startLineNumber,h?h.original.startLineNumber:o.endLineNumberExclusive),f=new xe(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(g=>{r.push(new bke(g,f.startLineNumber+(g-u.startLineNumber)))}),h&&(h.original.forEach(g=>{r.push(new mke(h,g))}),h.modified.forEach(g=>{r.push(new _ke(h,g))}))});const l=i[0].modified.join(i[i.length-1].modified),c=i[0].original.join(i[i.length-1].original);n.push(new gke(new Mi(l,c),r))}return n}var ts;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(ts||(ts={}));class gke{constructor(e,t){this.range=e,this.lines=t}}class pke{constructor(){this.type=ts.Header}}class mke{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ts.Deleted,this.modifiedLineNumber=void 0}}class _ke{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ts.Added,this.originalLineNumber=void 0}}class bke{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ts.Unchanged}}let FA=class extends U{constructor(e,t,n,i,r,o){super(),this._element=e,this._model=t,this._width=n,this._height=i,this._models=r,this._languageService=o,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Da(a)),this._register(Ke(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(wh({id:"diffreview.close",label:_(97,"Close"),class:"close-diff-review "+Ge.asClassName(uke),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new ZD(this._content,{})),wi(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ke(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Ce(()=>{wi(this.domNode)})),this._register(Ld(this.domNode,{width:this._width,height:this._height})),this._register(Ld(this._content,{width:this._width,height:this._height})),this._register(Lo((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(si(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),n=this._models.getModifiedOptions(),i=document.createElement("div");i.className="diff-review-table",i.setAttribute("role","list"),i.setAttribute("aria-label",_(98,"Accessible Diff Viewer. Use arrow up and down to navigate.")),ri(i,n.get(59)),wi(this._content,i);const r=this._models.getOriginalModel(),o=this._models.getModifiedModel();if(!r||!o)return;const a=r.getOptions(),l=o.getOptions(),c=n.get(75),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let u;if(h.type===ts.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,m=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,w=k=>k===0?_(99,"no lines changed"):k===1?_(100,"1 line changed"):_(101,"{0} lines changed",k),C=w(p.original.length),v=w(p.modified.length);g.setAttribute("aria-label",_(102,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",m+1,b,p.original.startLineNumber,C,p.modified.startLineNumber,v));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${m+1}/${b}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(S),u=g}else u=this._createRow(h,c,this._width.get(),t,r,a,n,o,l);i.appendChild(u);const f=he(g=>this._model.currentElement.read(g)===h);e.add(Ke(g=>{const p=f.read(g);u.tabIndex=p?0:-1,p&&u.focus()})),e.add(B(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,i,r,o,a,l,c){const d=i.get(165),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(165),f=10+u.glyphMarginWidth+u.lineNumbersWidth;let g="diff-review-row",p="";const m="diff-review-spacer";let b=null;switch(e.type){case ts.Added:g="diff-review-row line-insert",p=" char-insert",b=dke;break;case ts.Deleted:g="diff-review-row line-delete",p=" char-delete",b=hke;break}const w=document.createElement("div");w.style.minWidth=n+"px",w.className=g,w.setAttribute("role","listitem"),w.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height=`${t}px`,w.appendChild(C);const v=document.createElement("span");v.style.width=h+"px",v.style.minWidth=h+"px",v.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText=" ",C.appendChild(v);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",C.appendChild(S);const k=document.createElement("span");if(k.className=m,b){const N=document.createElement("span");N.className=Ge.asClassName(b),N.innerText=" ",k.appendChild(N)}else k.innerText=" ";C.appendChild(k);let L;if(e.modifiedLineNumber!==void 0){let N=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Bu._ttPolicy&&(N=Bu._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),L=l.getLineContent(e.modifiedLineNumber)}else{let N=this._getLineHtml(r,i,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Bu._ttPolicy&&(N=Bu._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),L=r.getLineContent(e.originalLineNumber)}L.length===0&&(L=_(103,"blank"));let E="";switch(e.type){case ts.Unchanged:e.originalLineNumber===e.modifiedLineNumber?E=_(104,"{0} unchanged line {1}",L,e.originalLineNumber):E=_(105,"{0} original line {1} modified line {2}",L,e.originalLineNumber,e.modifiedLineNumber);break;case ts.Added:E=_(106,"+ {0} modified line {1}",L,e.modifiedLineNumber);break;case ts.Deleted:E=_(107,"- {0} original line {1}",L,e.originalLineNumber);break}return w.setAttribute("aria-label",E),w}_getLineHtml(e,t,n,i,r){const o=e.getLineContent(i),a=t.get(59),l=t.get(117).verticalScrollbarSize,c=In.createEmpty(o,r),d=ir.isBasicASCII(o,e.mightContainNonBasicASCII()),h=ir.containsRTL(o,d,e.mightContainRTL());return QC(new Ah(a.isMonospace&&!t.get(40),a.canUseHalfwidthRightwardsArrow,o,!1,d,h,0,c,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==Bc.OFF,null,null,l)).html}};FA=AA([OA(5,$n)],FA);class wke{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}T("diffEditor.move.border","#8b8b8b9c",_(134,"The border color for text that got moved in the diff editor.")),T("diffEditor.moveActive.border","#FFA500",_(135,"The active border color for text that got moved in the diff editor.")),T("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},_(136,"The color of the shadow around unchanged region widgets."));const Cke=Sd("diff-insert",ne.add,_(137,"Line decoration for inserts in the diff editor.")),LU=Sd("diff-remove",ne.remove,_(138,"Line decoration for removals in the diff editor.")),kU=Mn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Ge.asClassName(Cke),marginClassName:"gutter-insert"}),EU=Mn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Ge.asClassName(LU),marginClassName:"gutter-delete"}),NU=Mn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),DU=Mn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),TU=Mn.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),vke=Mn.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),yke=Mn.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),BA=Mn.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),Ske=Mn.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),xke=Mn.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});var IU=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},VA=function(s,e){return function(t,n){e(t,n,s)}},Vu;const MU=We("diffProviderFactoryService");let WA=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(HA,e)}};WA=IU([VA(0,Xe)],WA),qe(MU,WA,1);let HA=(df=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new A,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,n,i){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,i);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new tr(new xe(1,2),new xe(1,t.getLineCount()+1),[new Os(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),o=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(n)]),a=Vu.diffCache.get(r);if(a&&a.context===o)return a.result;const l=pl.create(),c=await this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),d=l.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:c?.quitEarly??!0,detectedMoves:n.computeMoves?c?.moves.length??0:-1}),i.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!c)throw new Error("no diff result available");return Vu.diffCache.size>10&&Vu.diffCache.delete(Vu.diffCache.keys().next().value),Vu.diffCache.set(r,{result:c,context:o}),c}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},Vu=df,df.diffCache=new Map,df);HA=Vu=IU([VA(1,ob),VA(2,Ll)],HA);var Lke=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},kke=function(s,e){return function(t,n){e(t,n,s)}};let zA=class extends U{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n){super(),this.model=e,this._options=t,this._diffProviderFactoryService=n,this._isDiffUpToDate=Me(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Me(this,void 0),this.diff=this._diff,this._unchangedRegions=Me(this,void 0),this.unchangedRegions=he(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(nn(l=>{for(const c of this._unchangedRegions.read(void 0)?.regions||[])c.collapseAll(l)}),[])),this.movedTextToCompare=Me(this,void 0),this._activeMovedText=Me(this,void 0),this._hoveredMovedText=Me(this,void 0),this.activeMovedText=he(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new Ff,this._diffProvider=he(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=Zr("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Ce(()=>this._cancellationTokenSource.cancel()));const i=i_("contentChangedSignal"),r=this._register(new mi(()=>i.trigger(void 0),200));this._register(Ke(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;const c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?xe.fromRangeInclusive(g):void 0),d=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?xe.fromRangeInclusive(g):void 0),h=l.regions.map((g,p)=>!c[p]||!d[p]?void 0:new kd(c[p].startLineNumber,d[p].startLineNumber,c[p].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(Sr),u=[];let f=!1;for(const g of Zk(h,(p,m)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===m.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const p=g.reduce((b,w)=>b+w.lineCount,0),m=new kd(g[0].originalLineNumber,g[0].modifiedLineNumber,p,g[0].visibleLineCountTop.read(void 0),g[g.length-1].visibleLineCountBottom.read(void 0));u.push(m)}else u.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,u.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,u.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));nn(m=>{this._unchangedRegions.set({regions:u,originalDecorationIds:g,modifiedDecorationIds:p},m)})}}));const o=(a,l,c)=>{const d=kd.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let h;const u=this._unchangedRegions.get();if(u){const m=u.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).map(v=>v?xe.fromRangeInclusive(v):void 0),b=u.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).map(v=>v?xe.fromRangeInclusive(v):void 0);let C=lke(u.regions.map((v,S)=>{if(!m[S]||!b[S])return;const k=m[S].length;return new kd(m[S].startLineNumber,b[S].startLineNumber,k,Math.min(v.visibleLineCountTop.get(),k),Math.min(v.visibleLineCountBottom.get(),k-v.visibleLineCountTop.get()))}).filter(Sr),(v,S)=>!S||v.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&v.originalLineNumber>=S.originalLineNumber+S.lineCount).map(v=>new Mi(v.getHiddenOriginalRange(c),v.getHiddenModifiedRange(c)));C=Mi.clip(C,xe.ofLength(1,e.original.getLineCount()),xe.ofLength(1,e.modified.getLineCount())),h=Mi.inverse(C,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const m of d){const b=h.filter(w=>w.original.intersectsStrict(m.originalUnchangedRange)&&w.modified.intersectsStrict(m.modifiedUnchangedRange));f.push(...m.setVisibleRanges(b,l))}else f.push(...d);const g=e.original.deltaDecorations(u?.originalDecorationIds||[],f.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],f.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=Pl.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=Pl.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(Lo(async(a,l)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),r.cancel(),i.read(a);const c=this._diffProvider.read(a);c.onChangeSignal.read(a),this._isDiffUpToDate.set(!1,void 0);let d=[];l.add(e.original.onDidChangeContent(f=>{const g=Pl.fromModelContentChanges(f.changes);d=Xv(d,g)}));let h=[];l.add(e.modified.onDidChangeContent(f=>{const g=Pl.fromModelContentChanges(f.changes);h=Xv(h,g)}));let u=await c.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=Eke(u,e.original,e.modified),u=(e.original,e.modified,void 0)??u,u=(e.original,e.modified,void 0)??u,nn(f=>{o(u,f),this._lastDiff=u;const g=$A.fromDiffResult(u);this._diff.set(g,f),this._isDiffUpToDate.set(!0,f);const p=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(p?this._lastDiff.moves.find(m=>m.lineRangeMapping.modified.intersect(p.lineRangeMapping.modified)):void 0,f)}))}))}ensureModifiedLineIsVisible(e,t,n){if(this.diff.get()?.mappings.length===0)return;const i=this._unchangedRegions.get()?.regions||[];for(const r of i)if(r.getHiddenModifiedRange(void 0).contains(e)){r.showModifiedLine(e,t,n);return}}ensureOriginalLineIsVisible(e,t,n){if(this.diff.get()?.mappings.length===0)return;const i=this._unchangedRegions.get()?.regions||[];for(const r of i)if(r.getHiddenOriginalRange(void 0).contains(e)){r.showOriginalLine(e,t,n);return}}async waitForDiff(){await Moe(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(i=>xe.deserialize(i.range)),n=this._unchangedRegions.get();!n||!t||nn(i=>{for(const r of n.regions)for(const o of t)if(r.modifiedUnchangedRange.intersect(o)){r.setHiddenModifiedRange(o,i);break}})}};zA=Lke([kke(2,MU)],zA);function Eke(s,e,t){return{changes:s.changes.map(n=>new tr(n.original,n.modified,n.innerChanges?n.innerChanges.map(i=>Nke(i,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function Nke(s,e,t){let n=s.originalRange,i=s.modifiedRange;return n.startColumn===1&&i.startColumn===1&&(n.endColumn!==1||i.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&i.endColumn===t.getLineMaxColumn(i.endLineNumber)&&n.endLineNumber<e.getLineCount()&&i.endLineNumber<t.getLineCount()&&(n=n.setEndPosition(n.endLineNumber+1,1),i=i.setEndPosition(i.endLineNumber+1,1)),new Os(n,i)}class $A{static fromDiffResult(e){return new $A(e.changes.map(t=>new RU(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,i){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=i}}class RU{constructor(e){this.lineRangeMapping=e}}class kd{static fromDiffs(e,t,n,i,r){const o=tr.inverse(e,t,n),a=[];for(const l of o){let c=l.original.startLineNumber,d=l.modified.startLineNumber,h=l.original.length;const u=c===1&&d===1,f=c+h===t+1&&d+h===n+1;(u||f)&&h>=r+i?(u&&!f&&(h-=r),f&&!u&&(c+=r,d+=r,h-=r),a.push(new kd(c,d,h,0,0))):h>=r*2+i&&(c+=r,d+=r,h-=r*2,a.push(new kd(c,d,h,0,0)))}return a}get originalUnchangedRange(){return xe.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return xe.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,i,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Me(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Me(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=he(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Me(this,void 0);const o=Math.max(Math.min(i,this.lineCount),0),a=Math.max(Math.min(r,this.lineCount-i),0);k7(i===o),k7(r===a),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const n=[],i=new kr(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let r=this.originalLineNumber,o=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(i.ranges.length===0)this.showAll(t),n.push(this);else{let l=0;for(const c of i.ranges){const d=l===i.ranges.length-1;l++;const h=(d?a:c.endLineNumberExclusive)-o,u=new kd(r,o,h,0,0);u.setHiddenModifiedRange(c,t),n.push(u),r=u.originalUnchangedRange.endLineNumberExclusive,o=u.modifiedUnchangedRange.endLineNumberExclusive}}return n}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return xe.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return xe.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,i=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,i,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,n){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),r=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&i<r||t===1?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+i,n):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+r,n)}showOriginalLine(e,t,n){const i=e-this.originalLineNumber,r=this.originalLineNumber+this.lineCount-e;t===0&&i<r||t===1?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+r-i,this.getMaxVisibleLineCountTop()),n):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+i-r,this.getMaxVisibleLineCountBottom()),n)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,n){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,n),this._visibleLineCountBottom.set(t,n)}}function YTe(s,e,t,n){}function XTe(s,e,t,n){}class Dke extends U{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,n,i,r,o,a,l,c){super(),this._getViewZoneId=e,this._marginDomNode=t,this._modifiedEditor=n,this._diff=i,this._editor=r,this._viewLineCounts=o,this._originalTextModel=a,this._contextMenuService=l,this._clipboardService=c,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Ge.asClassName(ne.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const d=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${d}px`,this._diffActions.style.lineHeight=`${d}px`,this._marginDomNode.appendChild(this._diffActions);let h=0;const u=n.getOption(144)&&!na,f=(g,p)=>{this._contextMenuService.showContextMenu({domForShadowRoot:u?n.getDomNode()??void 0:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const m=[],b=i.modified.isEmpty;return m.push(new jc("diff.clipboard.copyDeletedContent",b?i.original.length>1?_(109,"Copy deleted lines"):_(110,"Copy deleted line"):i.original.length>1?_(111,"Copy changed lines"):_(112,"Copy changed line"),void 0,!0,async()=>{const C=this._originalTextModel.getValueInRange(i.original.toExclusiveRange());await this._clipboardService.writeText(C)})),i.original.length>1&&m.push(new jc("diff.clipboard.copyDeletedLineContent",b?_(113,"Copy deleted line ({0})",i.original.startLineNumber+h):_(114,"Copy changed line ({0})",i.original.startLineNumber+h),void 0,!0,async()=>{let C=this._originalTextModel.getLineContent(i.original.startLineNumber+h);C===""&&(C=this._originalTextModel.getEndOfLineSequence()===0?`
|
|
951
|
+
`}};kA=Ba([cn(0,Ft)],kA);class ZLe{publicLog2(){}}const Qb=class Qb{constructor(){const e=ze.from({scheme:Qb.SCHEME,authority:"model",path:"/"});this.workspace={id:Eve,folders:[new Lve({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===Qb.SCHEME?this.workspace.folders[0]:null}};Qb.SCHEME="inmemory";let EA=Qb;function BS(s,e,t){if(!e||!(s instanceof FS))return;const n=[];Object.keys(e).forEach(i=>{ive(i)&&n.push([`editor.${i}`,e[i]]),t&&sve(i)&&n.push([`diffEditor.${i}`,e[i]])}),n.length>0&&s.updateValues(n)}let NA=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const n=Array.isArray(e)?e:MM.convert(e),i=new Map;for(const a of n){if(!(a instanceof vu))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=i.get(l);c||(c=[],i.set(l,c)),c.push(rve.replaceMove(R.lift(a.textEdit.range),a.textEdit.text))}let r=0,o=0;for(const[a,l]of i)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),o+=1,r+=l.length;return{ariaSummary:T2(FM.bulkEditServiceSummary,r,o),isApplied:r>0}}};NA=Ba([cn(0,$i)],NA);class QLe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return FN(e)}}let DA=class extends UCe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,n){if(!t){const i=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();i&&(t=i.getContainerDomNode())}return super.showContextView(e,t,n)}};DA=Ba([cn(0,jl),cn(1,Dn)],DA);class JLe{constructor(){this._neverEmitter=new A,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class eke extends WM{constructor(){super()}}class tke extends WLe{constructor(){super(new ile)}}let TA=class extends tR{constructor(e,t,n,i,r,o){super(e,t,n,i,r,o),this.configure({blockMouse:!1})}};TA=Ba([cn(0,Ll),cn(1,io),cn(2,N1),cn(3,Qn),cn(4,Lh),cn(5,rt)],TA);const nke={esmModuleLocation:void 0,label:"editorWorkerService"};let IA=class extends fD{constructor(e,t,n,i,r){super(nke,e,t,n,i,r)}};IA=Ba([cn(0,$i),cn(1,dD),cn(2,ji),cn(3,ua),cn(4,yt)],IA);class ike{async playSignal(e,t){}}qe(ji,tke,0),qe(Ft,FS,0),qe(dD,LA,0),qe(Z8,kA,0),qe(xve,EA,0),qe(bve,QLe,0),qe(Ll,ZLe,0),qe(PW,YLe,0),qe(UW,GLe,0),qe(io,SA,0),qe(Lu,Fu,0),qe($n,eke,0),qe(ao,CLe,0),qe($i,lR,0),qe(d6,aR,0),qe(rt,CA,0),qe(wve,qLe,0),qe(OM,yA,0),qe(q1,ZCe,0),qe(ob,IA,0),qe(tve,NA,0),qe(Nve,JLe,0),qe(pC,vA,0),qe(sr,hA,0),qe(Ta,Nxe,0),qe(Js,xA,0),qe(Qn,mp,0),qe(wu,rA,0),qe(N1,DA,0),qe(D1,oR,0),qe(_A,mA,0),qe(Kl,TA,0),qe(Lh,uA,0),qe(PS,ike,0),qe(gI,$Le,0),qe(tle,ale,0),qe(ULe,jLe,0);var be;(function(s){const e=new Gg;for(const[l,c]of r8())e.set(l,c);const t=new OS(e,!0);e.set(Xe,t);function n(l){i||o({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof ha?t.invokeFunction(d=>d.get(l)):c}s.get=n;let i=!1;const r=new A;function o(l){if(i)return t;i=!0;for(const[d,h]of r8())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=We(d);e.get(h)instanceof ha&&e.set(h,l[d])}const c=zLe();for(const d of c)try{t.createInstance(d)}catch(h){dt(h)}return r.fire(),t}s.initialize=o;function a(l){if(i)return l();const c=new le,d=c.add(r.event(()=>{d.dispose(),c.add(l())}));return c}s.withServices=a})(be||(be={}));function Jl(s,e){return s}function ec(s,e,t,n=bi.ofCaller()){const i=s.bindTo(e),r=new le;return aa({debugName:()=>`Set Context Key "${s.key}"`},o=>{const a=t(o);return i.set(a),a},n).recomputeInitiallyAndOnChange(r),r}class VS{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new VS(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,n=0;const i=e.getVisibleRanges();if(i.length>0){t=i[0].getStartPosition();const r=e.getTopForPosition(t.lineNumber,t.column);n=e.getScrollTop()-r}return new VS(e.getScrollTop(),e.getContentHeight(),t,n,e.getPosition())}constructor(e,t,n,i,r){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=n,this._visiblePositionScrollDelta=i,this._cursorPosition=r}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const n=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+n,1)}}function ske(s,e,t,n){if(s.length===0)return e;if(e.length===0)return s;const i=[];let r=0,o=0;for(;r<s.length&&o<e.length;){const a=s[r],l=e[o],c=t(a),d=t(l);c<d?(i.push(a),r++):c>d?(i.push(l),o++):(i.push(n(a,l)),r++,o++)}for(;r<s.length;)i.push(s[r]),r++;for(;o<e.length;)i.push(e[o]),o++;return i}function WS(s,e){const t=new le,n=s.createDecorationsCollection();return t.add(hN({debugName:()=>`Apply decorations from ${e.debugName}`},i=>{const r=e.read(i);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}function kb(s,e){return s.appendChild(e),Ce(()=>{e.remove()})}function rke(s,e){return s.prepend(e),Ce(()=>{e.remove()})}class vU extends U{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new h6(e,t)),this._width=Me(this,this.elementSizeObserver.getWidth()),this._height=Me(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(n=>nn(i=>{this._width.set(this.elementSizeObserver.getWidth(),i),this._height.set(this.elementSizeObserver.getHeight(),i)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function yU(s,e,t){let n=e.get(),i=n,r=n;const o=Me("animatedValue",n);let a=-1;const l=300;let c;t.add(Gf({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)}},(h,u)=>{c!==void 0&&(s.cancelAnimationFrame(c),c=void 0),i=r,n=e.read(h),a=Date.now()-(u.animate?0:l),d()}));function d(){const h=Date.now()-a;r=Math.floor(oke(h,i,n-i,l)),h<l?c=s.requestAnimationFrame(d):r=n,o.set(r,void 0)}return o}function oke(s,e,t,n){return s===n?e+t:t*(-Math.pow(2,-10*s/n)+1)+e}class MA extends U{constructor(e,t,n){super(),this._register(new RA(e,n)),this._register(Ld(n,{height:t.actualHeight,top:t.actualTop}))}}class _p{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=Me(this,void 0),this._actualHeight=Me(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=n=>{this._actualTop.set(n,void 0)},this.onComputedHeight=n=>{this._actualHeight.set(n,void 0)}}}const Gx=class Gx{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Gx._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};Gx._counter=0;let RA=Gx;function Ld(s,e){return Ke(t=>{for(let[n,i]of Object.entries(e))i&&typeof i=="object"&&"read"in i&&(i=i.read(t)),typeof i=="number"&&(i=`${i}px`),n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),s.style[n]=i})}function HS(s,e,t,n){const i=new le,r=[];return i.add(Lo((o,a)=>{const l=e.read(o),c=new Map,d=new Map;t&&t(!0),s.changeViewZones(h=>{for(const u of r)h.removeZone(u),n?.delete(u);r.length=0;for(const u of l){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),r.push(f),n?.add(f),c.set(u,f)}}),t&&t(!1),a.add(Gf({changeTracker:{createChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}}},(h,u)=>{for(const f of l)f.onChange&&(d.set(f.onChange,c.get(f)),f.onChange.read(h));t&&t(!0),s.changeViewZones(f=>{for(const g of u.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),i.add({dispose(){t&&t(!0),s.changeViewZones(o=>{for(const a of r)o.removeZone(a)}),n?.clear(),t&&t(!1)}}),i}function SU(s,e){const t=zC(e,i=>i.original.startLineNumber<=s.lineNumber);if(!t)return R.fromPositions(s);if(t.original.endLineNumberExclusive<=s.lineNumber){const i=s.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return R.fromPositions(new P(i,s.column))}if(!t.innerChanges)return R.fromPositions(new P(t.modified.startLineNumber,1));const n=zC(t.innerChanges,i=>i.originalRange.getStartPosition().isBeforeOrEqual(s));if(!n){const i=s.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return R.fromPositions(new P(i,s.column))}if(n.originalRange.containsPosition(s))return n.modifiedRange;{const i=ake(n.originalRange.getEndPosition(),s);return R.fromPositions(i.addToPosition(n.modifiedRange.getEndPosition()))}}function ake(s,e){return s.lineNumber===e.lineNumber?new As(0,e.column-s.column):new As(e.lineNumber-s.lineNumber,e.column-1)}function lke(s,e){let t;return s.filter(n=>{const i=e(n,t);return t=n,i})}class zS{static create(e,t=void 0){return new xU(e,e,t)}static createWithDisposable(e,t,n=void 0){const i=new le;return i.add(t),i.add(e),new xU(e,i,n)}}class xU extends zS{constructor(e,t,n){super(),this.object=e,this._disposable=t,this._debugOwner=n,this._refCount=1,this._isDisposed=!1,this._owners=[],n&&this._addOwner(n)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new cke(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class cke extends zS{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}var AA=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},OA=function(s,e){return function(t,n){e(t,n,s)}};const dke=Sd("diff-review-insert",ne.add,_(94,"Icon for 'Insert' in accessible diff viewer.")),hke=Sd("diff-review-remove",ne.remove,_(95,"Icon for 'Remove' in accessible diff viewer.")),uke=Sd("diff-review-close",ne.close,_(96,"Icon for 'Close' in accessible diff viewer."));let Bu=(Wp=class extends U{constructor(e,t,n,i,r,o,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=n,this._canClose=i,this._width=r,this._height=o,this._diffs=a,this._models=l,this._instantiationService=c,this._state=he(this,d=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const u=d.store.add(this._instantiationService.createInstance(PA,this._diffs,this._models,this._setVisible,this._canClose)),f=d.store.add(this._instantiationService.createInstance(FA,this._parentNode,u,this._width,this._height,this._models));return{model:u,view:f}}).recomputeInitiallyAndOnChange(this._store)}next(){nn(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){nn(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){nn(e=>{this._setVisible(!1,e)})}},Wp._ttPolicy=Gc("diffReview",{createHTML:e=>e}),Wp);Bu=AA([OA(8,Xe)],Bu);let PA=class extends U{constructor(e,t,n,i,r){super(),this._diffs=e,this._models=t,this._setVisible=n,this.canClose=i,this._accessibilitySignalService=r,this._groups=Me(this,[]),this._currentGroupIdx=Me(this,0),this._currentElementIdx=Me(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((o,a)=>this._groups.read(a)[o]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((o,a)=>this.currentGroup.read(a)?.lines[o]),this._register(Ke(o=>{const a=this._diffs.read(o);if(!a){this._groups.set([],void 0);return}const l=fke(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());nn(c=>{const d=this._models.getModifiedPosition();if(d){const h=l.findIndex(u=>d?.lineNumber<u.range.modified.endLineNumberExclusive);h!==-1&&this._currentGroupIdx.set(h,c)}this._groups.set(l,c)})})),this._register(Ke(o=>{const a=this.currentElement.read(o);a?.type===ts.Deleted?this._accessibilitySignalService.playSignal(Fa.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):a?.type===ts.Added&&this._accessibilitySignalService.playSignal(Fa.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Ke(o=>{const a=this.currentElement.read(o);if(a&&a.type!==ts.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(R.fromPositions(new P(l,1)))}}))}_goToGroupDelta(e,t){const n=this.groups.get();!n||n.length<=1||lN(t,i=>{this._currentGroupIdx.set(fe.ofLength(n.length).clipCyclic(this._currentGroupIdx.get()+e),i),this._currentElementIdx.set(0,i)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||nn(n=>{this._currentElementIdx.set(fe.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),n)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const n=t.lines.indexOf(e);n!==-1&&nn(i=>{this._currentElementIdx.set(n,i)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ts.Deleted?this._models.originalReveal(R.fromPositions(new P(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==ts.Header?R.fromPositions(new P(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};PA=AA([OA(4,PS)],PA);const Eb=3;function fke(s,e,t){const n=[];for(const i of Zk(s,(r,o)=>o.modified.startLineNumber-r.modified.endLineNumberExclusive<2*Eb)){const r=[];r.push(new pke);const o=new xe(Math.max(1,i[0].original.startLineNumber-Eb),Math.min(i[i.length-1].original.endLineNumberExclusive+Eb,e+1)),a=new xe(Math.max(1,i[0].modified.startLineNumber-Eb),Math.min(i[i.length-1].modified.endLineNumberExclusive+Eb,t+1));S7(i,(d,h)=>{const u=new xe(d?d.original.endLineNumberExclusive:o.startLineNumber,h?h.original.startLineNumber:o.endLineNumberExclusive),f=new xe(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(g=>{r.push(new bke(g,f.startLineNumber+(g-u.startLineNumber)))}),h&&(h.original.forEach(g=>{r.push(new mke(h,g))}),h.modified.forEach(g=>{r.push(new _ke(h,g))}))});const l=i[0].modified.join(i[i.length-1].modified),c=i[0].original.join(i[i.length-1].original);n.push(new gke(new Mi(l,c),r))}return n}var ts;(function(s){s[s.Header=0]="Header",s[s.Unchanged=1]="Unchanged",s[s.Deleted=2]="Deleted",s[s.Added=3]="Added"})(ts||(ts={}));class gke{constructor(e,t){this.range=e,this.lines=t}}class pke{constructor(){this.type=ts.Header}}class mke{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ts.Deleted,this.modifiedLineNumber=void 0}}class _ke{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ts.Added,this.originalLineNumber=void 0}}class bke{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ts.Unchanged}}let FA=class extends U{constructor(e,t,n,i,r,o){super(),this._element=e,this._model=t,this._width=n,this._height=i,this._models=r,this._languageService=o,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Da(a)),this._register(Ke(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(wh({id:"diffreview.close",label:_(97,"Close"),class:"close-diff-review "+Ge.asClassName(uke),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new ZD(this._content,{})),wi(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ke(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Ce(()=>{wi(this.domNode)})),this._register(Ld(this.domNode,{width:this._width,height:this._height})),this._register(Ld(this._content,{width:this._width,height:this._height})),this._register(Lo((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(si(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),n=this._models.getModifiedOptions(),i=document.createElement("div");i.className="diff-review-table",i.setAttribute("role","list"),i.setAttribute("aria-label",_(98,"Accessible Diff Viewer. Use arrow up and down to navigate.")),ri(i,n.get(59)),wi(this._content,i);const r=this._models.getOriginalModel(),o=this._models.getModifiedModel();if(!r||!o)return;const a=r.getOptions(),l=o.getOptions(),c=n.get(75),d=this._model.currentGroup.get();for(const h of d?.lines||[]){if(!d)break;let u;if(h.type===ts.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,m=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,w=k=>k===0?_(99,"no lines changed"):k===1?_(100,"1 line changed"):_(101,"{0} lines changed",k),C=w(p.original.length),v=w(p.modified.length);g.setAttribute("aria-label",_(102,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",m+1,b,p.original.startLineNumber,C,p.modified.startLineNumber,v));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${m+1}/${b}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(S),u=g}else u=this._createRow(h,c,this._width.get(),t,r,a,n,o,l);i.appendChild(u);const f=he(g=>this._model.currentElement.read(g)===h);e.add(Ke(g=>{const p=f.read(g);u.tabIndex=p?0:-1,p&&u.focus()})),e.add(B(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,n,i,r,o,a,l,c){const d=i.get(165),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(165),f=10+u.glyphMarginWidth+u.lineNumbersWidth;let g="diff-review-row",p="";const m="diff-review-spacer";let b=null;switch(e.type){case ts.Added:g="diff-review-row line-insert",p=" char-insert",b=dke;break;case ts.Deleted:g="diff-review-row line-delete",p=" char-delete",b=hke;break}const w=document.createElement("div");w.style.minWidth=n+"px",w.className=g,w.setAttribute("role","listitem"),w.ariaLevel="";const C=document.createElement("div");C.className="diff-review-cell",C.style.height=`${t}px`,w.appendChild(C);const v=document.createElement("span");v.style.width=h+"px",v.style.minWidth=h+"px",v.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText=" ",C.appendChild(v);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",C.appendChild(S);const k=document.createElement("span");if(k.className=m,b){const N=document.createElement("span");N.className=Ge.asClassName(b),N.innerText=" ",k.appendChild(N)}else k.innerText=" ";C.appendChild(k);let L;if(e.modifiedLineNumber!==void 0){let N=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);Bu._ttPolicy&&(N=Bu._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),L=l.getLineContent(e.modifiedLineNumber)}else{let N=this._getLineHtml(r,i,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);Bu._ttPolicy&&(N=Bu._ttPolicy.createHTML(N)),C.insertAdjacentHTML("beforeend",N),L=r.getLineContent(e.originalLineNumber)}L.length===0&&(L=_(103,"blank"));let E="";switch(e.type){case ts.Unchanged:e.originalLineNumber===e.modifiedLineNumber?E=_(104,"{0} unchanged line {1}",L,e.originalLineNumber):E=_(105,"{0} original line {1} modified line {2}",L,e.originalLineNumber,e.modifiedLineNumber);break;case ts.Added:E=_(106,"+ {0} modified line {1}",L,e.modifiedLineNumber);break;case ts.Deleted:E=_(107,"- {0} original line {1}",L,e.originalLineNumber);break}return w.setAttribute("aria-label",E),w}_getLineHtml(e,t,n,i,r){const o=e.getLineContent(i),a=t.get(59),l=t.get(117).verticalScrollbarSize,c=In.createEmpty(o,r),d=ir.isBasicASCII(o,e.mightContainNonBasicASCII()),h=ir.containsRTL(o,d,e.mightContainRTL());return QC(new Ah(a.isMonospace&&!t.get(40),a.canUseHalfwidthRightwardsArrow,o,!1,d,h,0,c,[],n,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==Bc.OFF,null,null,l)).html}};FA=AA([OA(5,$n)],FA);class wke{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}T("diffEditor.move.border","#8b8b8b9c",_(134,"The border color for text that got moved in the diff editor.")),T("diffEditor.moveActive.border","#FFA500",_(135,"The active border color for text that got moved in the diff editor.")),T("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},_(136,"The color of the shadow around unchanged region widgets."));const Cke=Sd("diff-insert",ne.add,_(137,"Line decoration for inserts in the diff editor.")),LU=Sd("diff-remove",ne.remove,_(138,"Line decoration for removals in the diff editor.")),kU=Mn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Ge.asClassName(Cke),marginClassName:"gutter-insert"}),EU=Mn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Ge.asClassName(LU),marginClassName:"gutter-delete"}),NU=Mn.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),DU=Mn.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),TU=Mn.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),vke=Mn.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),yke=Mn.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),BA=Mn.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),Ske=Mn.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),xke=Mn.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});var IU=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},VA=function(s,e){return function(t,n){e(t,n,s)}},Vu;const MU=We("diffProviderFactoryService");let WA=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(HA,e)}};WA=IU([VA(0,Xe)],WA),qe(MU,WA,1);let HA=(df=class{constructor(e,t,n){this.editorWorkerService=t,this.telemetryService=n,this.onDidChangeEventEmitter=new A,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,n,i){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,n,i);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new tr(new xe(1,2),new xe(1,t.getLineCount()+1),[new Os(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),o=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(n)]),a=Vu.diffCache.get(r);if(a&&a.context===o)return a.result;const l=pl.create(),c=await this.editorWorkerService.computeDiff(e.uri,t.uri,n,this.diffAlgorithm),d=l.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:c?.quitEarly??!0,detectedMoves:n.computeMoves?c?.moves.length??0:-1}),i.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!c)throw new Error("no diff result available");return Vu.diffCache.size>10&&Vu.diffCache.delete(Vu.diffCache.keys().next().value),Vu.diffCache.set(r,{result:c,context:o}),c}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},Vu=df,df.diffCache=new Map,df);HA=Vu=IU([VA(1,ob),VA(2,Ll)],HA);var Lke=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},kke=function(s,e){return function(t,n){e(t,n,s)}};let zA=class extends U{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,n){super(),this.model=e,this._options=t,this._diffProviderFactoryService=n,this._isDiffUpToDate=Me(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Me(this,void 0),this.diff=this._diff,this._unchangedRegions=Me(this,void 0),this.unchangedRegions=he(this,a=>this._options.hideUnchangedRegions.read(a)?this._unchangedRegions.read(a)?.regions??[]:(nn(l=>{for(const c of this._unchangedRegions.read(void 0)?.regions||[])c.collapseAll(l)}),[])),this.movedTextToCompare=Me(this,void 0),this._activeMovedText=Me(this,void 0),this._hoveredMovedText=Me(this,void 0),this.activeMovedText=he(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new Ff,this._diffProvider=he(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=Zr("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Ce(()=>this._cancellationTokenSource.cancel()));const i=i_("contentChangedSignal"),r=this._register(new mi(()=>i.trigger(void 0),200));this._register(Ke(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;const c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?xe.fromRangeInclusive(g):void 0),d=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?xe.fromRangeInclusive(g):void 0),h=l.regions.map((g,p)=>!c[p]||!d[p]?void 0:new kd(c[p].startLineNumber,d[p].startLineNumber,c[p].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(Sr),u=[];let f=!1;for(const g of Zk(h,(p,m)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===m.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const p=g.reduce((b,w)=>b+w.lineCount,0),m=new kd(g[0].originalLineNumber,g[0].modifiedLineNumber,p,g[0].visibleLineCountTop.read(void 0),g[g.length-1].visibleLineCountBottom.read(void 0));u.push(m)}else u.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,u.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,u.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));nn(m=>{this._unchangedRegions.set({regions:u,originalDecorationIds:g,modifiedDecorationIds:p},m)})}}));const o=(a,l,c)=>{const d=kd.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let h;const u=this._unchangedRegions.get();if(u){const m=u.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).map(v=>v?xe.fromRangeInclusive(v):void 0),b=u.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).map(v=>v?xe.fromRangeInclusive(v):void 0);let C=lke(u.regions.map((v,S)=>{if(!m[S]||!b[S])return;const k=m[S].length;return new kd(m[S].startLineNumber,b[S].startLineNumber,k,Math.min(v.visibleLineCountTop.get(),k),Math.min(v.visibleLineCountBottom.get(),k-v.visibleLineCountTop.get()))}).filter(Sr),(v,S)=>!S||v.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&v.originalLineNumber>=S.originalLineNumber+S.lineCount).map(v=>new Mi(v.getHiddenOriginalRange(c),v.getHiddenModifiedRange(c)));C=Mi.clip(C,xe.ofLength(1,e.original.getLineCount()),xe.ofLength(1,e.modified.getLineCount())),h=Mi.inverse(C,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const m of d){const b=h.filter(w=>w.original.intersectsStrict(m.originalUnchangedRange)&&w.modified.intersectsStrict(m.modifiedUnchangedRange));f.push(...m.setVisibleRanges(b,l))}else f.push(...d);const g=e.original.deltaDecorations(u?.originalDecorationIds||[],f.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(u?.modifiedDecorationIds||[],f.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=Pl.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=Pl.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),r.schedule()})),this._register(Lo(async(a,l)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),r.cancel(),i.read(a);const c=this._diffProvider.read(a);c.onChangeSignal.read(a),this._isDiffUpToDate.set(!1,void 0);let d=[];l.add(e.original.onDidChangeContent(f=>{const g=Pl.fromModelContentChanges(f.changes);d=Xv(d,g)}));let h=[];l.add(e.modified.onDidChangeContent(f=>{const g=Pl.fromModelContentChanges(f.changes);h=Xv(h,g)}));let u=await c.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=Eke(u,e.original,e.modified),u=(e.original,e.modified,void 0)??u,u=(e.original,e.modified,void 0)??u,nn(f=>{o(u,f),this._lastDiff=u;const g=$A.fromDiffResult(u);this._diff.set(g,f),this._isDiffUpToDate.set(!0,f);const p=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(p?this._lastDiff.moves.find(m=>m.lineRangeMapping.modified.intersect(p.lineRangeMapping.modified)):void 0,f)}))}))}ensureModifiedLineIsVisible(e,t,n){if(this.diff.get()?.mappings.length===0)return;const i=this._unchangedRegions.get()?.regions||[];for(const r of i)if(r.getHiddenModifiedRange(void 0).contains(e)){r.showModifiedLine(e,t,n);return}}ensureOriginalLineIsVisible(e,t,n){if(this.diff.get()?.mappings.length===0)return;const i=this._unchangedRegions.get()?.regions||[];for(const r of i)if(r.getHiddenOriginalRange(void 0).contains(e)){r.showOriginalLine(e,t,n);return}}async waitForDiff(){await Moe(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(i=>xe.deserialize(i.range)),n=this._unchangedRegions.get();!n||!t||nn(i=>{for(const r of n.regions)for(const o of t)if(r.modifiedUnchangedRange.intersect(o)){r.setHiddenModifiedRange(o,i);break}})}};zA=Lke([kke(2,MU)],zA);function Eke(s,e,t){return{changes:s.changes.map(n=>new tr(n.original,n.modified,n.innerChanges?n.innerChanges.map(i=>Nke(i,e,t)):void 0)),moves:s.moves,identical:s.identical,quitEarly:s.quitEarly}}function Nke(s,e,t){let n=s.originalRange,i=s.modifiedRange;return n.startColumn===1&&i.startColumn===1&&(n.endColumn!==1||i.endColumn!==1)&&n.endColumn===e.getLineMaxColumn(n.endLineNumber)&&i.endColumn===t.getLineMaxColumn(i.endLineNumber)&&n.endLineNumber<e.getLineCount()&&i.endLineNumber<t.getLineCount()&&(n=n.setEndPosition(n.endLineNumber+1,1),i=i.setEndPosition(i.endLineNumber+1,1)),new Os(n,i)}class $A{static fromDiffResult(e){return new $A(e.changes.map(t=>new RU(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,n,i){this.mappings=e,this.movedTexts=t,this.identical=n,this.quitEarly=i}}class RU{constructor(e){this.lineRangeMapping=e}}class kd{static fromDiffs(e,t,n,i,r){const o=tr.inverse(e,t,n),a=[];for(const l of o){let c=l.original.startLineNumber,d=l.modified.startLineNumber,h=l.original.length;const u=c===1&&d===1,f=c+h===t+1&&d+h===n+1;(u||f)&&h>=r+i?(u&&!f&&(h-=r),f&&!u&&(c+=r,d+=r,h-=r),a.push(new kd(c,d,h,0,0))):h>=r*2+i&&(c+=r,d+=r,h-=r*2,a.push(new kd(c,d,h,0,0)))}return a}get originalUnchangedRange(){return xe.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return xe.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,n,i,r){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=n,this._visibleLineCountTop=Me(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Me(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=he(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Me(this,void 0);const o=Math.max(Math.min(i,this.lineCount),0),a=Math.max(Math.min(r,this.lineCount-i),0);k7(i===o),k7(r===a),this._visibleLineCountTop.set(o,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const n=[],i=new kr(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let r=this.originalLineNumber,o=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(i.ranges.length===0)this.showAll(t),n.push(this);else{let l=0;for(const c of i.ranges){const d=l===i.ranges.length-1;l++;const h=(d?a:c.endLineNumberExclusive)-o,u=new kd(r,o,h,0,0);u.setHiddenModifiedRange(c,t),n.push(u),r=u.originalUnchangedRange.endLineNumberExclusive,o=u.modifiedUnchangedRange.endLineNumberExclusive}}return n}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return xe.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return xe.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const n=e.startLineNumber-this.modifiedLineNumber,i=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(n,i,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const n=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,n),t)}showMoreBelow(e=10,t){const n=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,n),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,n){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),r=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&i<r||t===1?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+i,n):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+r,n)}showOriginalLine(e,t,n){const i=e-this.originalLineNumber,r=this.originalLineNumber+this.lineCount-e;t===0&&i<r||t===1?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+r-i,this.getMaxVisibleLineCountTop()),n):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+i-r,this.getMaxVisibleLineCountBottom()),n)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,n){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,n),this._visibleLineCountBottom.set(t,n)}}function XTe(s,e,t,n){}function ZTe(s,e,t,n){}class Dke extends U{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,n,i,r,o,a,l,c){super(),this._getViewZoneId=e,this._marginDomNode=t,this._modifiedEditor=n,this._diff=i,this._editor=r,this._viewLineCounts=o,this._originalTextModel=a,this._contextMenuService=l,this._clipboardService=c,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Ge.asClassName(ne.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const d=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${d}px`,this._diffActions.style.lineHeight=`${d}px`,this._marginDomNode.appendChild(this._diffActions);let h=0;const u=n.getOption(144)&&!na,f=(g,p)=>{this._contextMenuService.showContextMenu({domForShadowRoot:u?n.getDomNode()??void 0:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const m=[],b=i.modified.isEmpty;return m.push(new jc("diff.clipboard.copyDeletedContent",b?i.original.length>1?_(109,"Copy deleted lines"):_(110,"Copy deleted line"):i.original.length>1?_(111,"Copy changed lines"):_(112,"Copy changed line"),void 0,!0,async()=>{const C=this._originalTextModel.getValueInRange(i.original.toExclusiveRange());await this._clipboardService.writeText(C)})),i.original.length>1&&m.push(new jc("diff.clipboard.copyDeletedLineContent",b?_(113,"Copy deleted line ({0})",i.original.startLineNumber+h):_(114,"Copy changed line ({0})",i.original.startLineNumber+h),void 0,!0,async()=>{let C=this._originalTextModel.getLineContent(i.original.startLineNumber+h);C===""&&(C=this._originalTextModel.getEndOfLineSequence()===0?`
|
|
952
952
|
`:`\r
|
|
953
953
|
`),await this._clipboardService.writeText(C)})),n.getOption(104)||m.push(new jc("diff.inline.revertChange",_(115,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),m},autoSelectFirstItem:!0})};this._register(si(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:p,height:m}=Lr(this._diffActions),b=Math.floor(d/3);g.preventDefault(),f(g.posx,p+m+b)})),this._register(n.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(n.onMouseDown(g=>{g.event.leftButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,n){const{top:i}=Lr(e),r=t-i,o=Math.floor(r/n),a=o*n;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],o<l)return c}return o}}const AU=Gc("diffEditorWidget",{createHTML:s=>s});function Tke(s,e,t,n,i=!1){ri(n,e.fontInfo);const r=t.length>0,o=new tg(1e4);let a=0,l=0;const c=[];for(let f=0;f<s.lineTokens.length;f++){const g=f+1,p=s.lineTokens[f],m=s.lineBreakData[f],b=Er.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(m){let w=0;for(const C of m.breakOffsets){const v=p.sliceAndInflate(w,C,0);a=Math.max(a,OU(l,v,Er.extractWrapped(b,w,C),r,s.mightContainNonBasicASCII,s.mightContainRTL,e,o,i)),l++,w=C}c.push(m.breakOffsets.length)}else c.push(1),a=Math.max(a,OU(l,p,b,r,s.mightContainNonBasicASCII,s.mightContainRTL,e,o,i)),l++}a+=e.scrollBeyondLastColumn;const d=o.build(),h=AU?AU.createHTML(d):d;n.innerHTML=h;const u=a*e.typicalHalfwidthCharacterWidth;return{heightInLines:l,minWidthInPx:u,viewLineCounts:c}}class Ike{constructor(e,t=e.map(r=>null),n=!0,i=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=n,this.mightContainRTL=i}}class Nb{static fromEditor(e){const t=e.getOptions(),n=t.get(59),i=t.get(165);return new Nb(e.getModel()?.getOptions().tabSize||0,n,t.get(40),n.typicalHalfwidthCharacterWidth,t.get(118),t.get(75),i.decorationsWidth,t.get(133),t.get(113),t.get(108),t.get(60),t.get(117).verticalScrollbarSize)}constructor(e,t,n,i,r,o,a,l,c,d,h,u,f=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=n,this.typicalHalfwidthCharacterWidth=i,this.scrollBeyondLastColumn=r,this.lineHeight=o,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h,this.verticalScrollbarSize=u,this.setWidth=f}withSetWidth(e){return new Nb(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new Nb(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}function OU(s,e,t,n,i,r,o,a,l){a.appendString('<div class="view-line'),!l&&!n&&a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(s*o.lineHeight)),o.setWidth?a.appendString('px;width:1000000px;">'):a.appendString('px;">');const c=e.getLineContent(),d=ir.isBasicASCII(c,i),h=ir.containsRTL(c,d,r),u=ZC(new Ah(o.fontInfo.isMonospace&&!o.disableMonospaceOptimizations,o.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,d,h,0,e,t,o.tabSize,0,o.fontInfo.spaceWidth,o.fontInfo.middotWidth,o.fontInfo.wsmiddotWidth,o.stopRenderingLineAfter,o.renderWhitespace,o.renderControlCharacters,o.fontLigatures!==Bc.OFF,null,null,o.verticalScrollbarSize),a);return a.appendString("</div>"),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var Mke=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},PU=function(s,e){return function(t,n){e(t,n,s)}};let UA=class extends U{constructor(e,t,n,i,r,o,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=n,this._options=i,this._diffEditorWidget=r,this._canIgnoreViewZoneUpdateEvent=o,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=Me(this,0),this._originalScrollOffset=Me(this,0),this._originalScrollOffsetAnimated=yU(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Me(this,0),this._modifiedScrollOffset=Me(this,0),this._modifiedScrollOffsetAnimated=yU(this._targetWindow,this._modifiedScrollOffset,this._store);const h=Me("invalidateAlignmentsState",0),u=this._register(new mi(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(C=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(C=>{(C.hasChanged(166)||C.hasChanged(75))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(C=>{(C.hasChanged(166)||C.hasChanged(75))&&u.schedule()}));const f=this._diffModel.map(C=>C?Bt(this,C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===2):void 0).map((C,v)=>C?.read(v)),g=he(C=>{const v=this._diffModel.read(C),S=v?.diff.read(C);if(!v||!S)return null;h.read(C);const L=this._options.renderSideBySide.read(C);return FU(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,L)}),p=he(C=>{const v=this._diffModel.read(C)?.movedTextToCompare.read(C);if(!v)return null;h.read(C);const S=v.changes.map(k=>new RU(k));return FU(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function m(){const C=document.createElement("div");return C.className="diagonal-fill",C}const b=this._register(new le);this.viewZones=he(this,C=>{b.clear();const v=g.read(C)||[],S=[],k=[],L=this._modifiedTopPadding.read(C);L>0&&k.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:L,showInHiddenAreas:!0,suppressMouseDown:!0});const E=this._originalTopPadding.read(C);E>0&&S.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:E,showInHiddenAreas:!0,suppressMouseDown:!0});const N=this._options.renderSideBySide.read(C),M=N?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(M){const Q=this._editors.original.getModel();for(const oe of v)if(oe.diff)for(let me=oe.originalRange.startLineNumber;me<oe.originalRange.endLineNumberExclusive;me++){if(me>Q.getLineCount())return{orig:S,mod:k};M?.addRequest(Q.getLineContent(me),null,null)}}const O=M?.finalize()??[];let I=0;const F=this._editors.modified.getOption(75),W=this._diffModel.read(C)?.movedTextToCompare.read(C),z=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,G=this._editors.original.getModel()?.mightContainRTL()??!1,Y=Nb.fromEditor(this._editors.modified);for(const Q of v)if(Q.diff&&!N&&(!this._options.useTrueInlineDiffRendering.read(C)||!jA(Q.diff))){if(!Q.originalRange.isEmpty){f.read(C);const me=document.createElement("div");me.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const Ie=this._editors.original.getModel();if(Q.originalRange.endLineNumberExclusive-1>Ie.getLineCount())return{orig:S,mod:k};const qt=new Ike(Q.originalRange.mapToLineArray(Jt=>Ie.tokenization.getLineTokens(Jt)),Q.originalRange.mapToLineArray(Jt=>O[I++]),z,G),Qe=[];for(const Jt of Q.diff.innerChanges||[])Qe.push(new x1(Jt.originalRange.delta(-(Q.diff.original.startLineNumber-1)),BA.className,0));const Ot=Tke(qt,Y,Qe,me),ot=document.createElement("div");if(ot.className="inline-deleted-margin-view-zone",ri(ot,Y.fontInfo),this._options.renderIndicators.read(C))for(let Jt=0;Jt<Ot.heightInLines;Jt++){const xs=document.createElement("div");xs.className=`delete-sign ${Ge.asClassName(LU)}`,xs.setAttribute("style",`position:absolute;top:${Jt*F}px;width:${Y.lineDecorationsWidth}px;height:${F}px;right:0;`),ot.appendChild(xs)}let ei;b.add(new Dke(()=>N7(ei),ot,this._editors.modified,Q.diff,this._diffEditorWidget,Ot.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Jt=0;Jt<Ot.viewLineCounts.length;Jt++){const xs=Ot.viewLineCounts[Jt];xs>1&&S.push({afterLineNumber:Q.originalRange.startLineNumber+Jt,domNode:m(),heightInPx:(xs-1)*F,showInHiddenAreas:!0,suppressMouseDown:!0})}k.push({afterLineNumber:Q.modifiedRange.startLineNumber-1,domNode:me,heightInPx:Ot.heightInLines*F,minWidthInPx:Ot.minWidthInPx,marginDomNode:ot,setZoneId(Jt){ei=Jt},showInHiddenAreas:!0,suppressMouseDown:!0})}const oe=document.createElement("div");oe.className="gutter-delete",S.push({afterLineNumber:Q.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Q.modifiedHeightInPx,marginDomNode:oe,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const oe=Q.modifiedHeightInPx-Q.originalHeightInPx;if(oe>0){if(W?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Q.originalRange.endLineNumberExclusive-1))continue;S.push({afterLineNumber:Q.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:oe,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let me=function(){const qt=document.createElement("div");return qt.className="arrow-revert-change "+Ge.asClassName(ne.arrowRight),C.store.add(B(qt,"mousedown",Qe=>Qe.stopPropagation())),C.store.add(B(qt,"click",Qe=>{Qe.stopPropagation(),r.revert(Q.diff)})),ve("div",{},qt)};if(W?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Q.modifiedRange.endLineNumberExclusive-1))continue;let Ie;Q.diff&&Q.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(C)&&(Ie=me()),k.push({afterLineNumber:Q.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-oe,marginDomNode:Ie,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Q of p.read(C)??[]){if(!W?.lineRangeMapping.original.intersect(Q.originalRange)||!W?.lineRangeMapping.modified.intersect(Q.modifiedRange))continue;const oe=Q.modifiedHeightInPx-Q.originalHeightInPx;oe>0?S.push({afterLineNumber:Q.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:oe,showInHiddenAreas:!0,suppressMouseDown:!0}):k.push({afterLineNumber:Q.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-oe,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:S,mod:k}});let w=!1;this._register(this._editors.original.onDidScrollChange(C=>{C.scrollLeftChanged&&!w&&(w=!0,this._editors.modified.setScrollLeft(C.scrollLeft),w=!1)})),this._register(this._editors.modified.onDidScrollChange(C=>{C.scrollLeftChanged&&!w&&(w=!0,this._editors.original.setScrollLeft(C.scrollLeft),w=!1)})),this._originalScrollTop=Bt(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Bt(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Ke(C=>{const v=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(C));v!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(v,1)})),this._register(Ke(C=>{const v=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(C));v!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(v,1)})),this._register(Ke(C=>{const v=this._diffModel.read(C)?.movedTextToCompare.read(C);let S=0;if(v){const k=this._editors.original.getTopForLineNumber(v.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);S=this._editors.modified.getTopForLineNumber(v.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-k}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+S,void 0,!0)}))}};UA=Mke([PU(8,_A),PU(9,Kl)],UA);function FU(s,e,t,n,i,r){const o=new cl(BU(s,n)),a=new cl(BU(e,i)),l=s.getOption(75),c=e.getOption(75),d=[];let h=0,u=0;function f(g,p){for(;;){let m=o.peek(),b=a.peek();if(m&&m.lineNumber>=g&&(m=void 0),b&&b.lineNumber>=p&&(b=void 0),!m&&!b)break;const w=m?m.lineNumber-h:Number.MAX_VALUE,C=b?b.lineNumber-u:Number.MAX_VALUE;w<C?(o.dequeue(),b={lineNumber:m.lineNumber-h+u,heightInPx:0}):w>C?(a.dequeue(),m={lineNumber:b.lineNumber-u+h,heightInPx:0}):(o.dequeue(),a.dequeue()),d.push({originalRange:xe.ofLength(m.lineNumber,1),modifiedRange:xe.ofLength(b.lineNumber,1),originalHeightInPx:l+m.heightInPx,modifiedHeightInPx:c+b.heightInPx,diff:void 0})}}for(const g of t){let C=function(v,S,k=!1){if(v<w||S<b)return;if(m)m=!1;else if(!k&&(v===w||S===b))return;const L=new xe(w,v),E=new xe(b,S);if(L.isEmpty&&E.isEmpty)return;const N=o.takeWhile(O=>O.lineNumber<v)?.reduce((O,I)=>O+I.heightInPx,0)??0,M=a.takeWhile(O=>O.lineNumber<S)?.reduce((O,I)=>O+I.heightInPx,0)??0;d.push({originalRange:L,modifiedRange:E,originalHeightInPx:L.length*l+N,modifiedHeightInPx:E.length*c+M,diff:g.lineRangeMapping}),w=v,b=S};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let m=!0,b=p.modified.startLineNumber,w=p.original.startLineNumber;if(r)for(const v of p.innerChanges||[]){v.originalRange.startColumn>1&&v.modifiedRange.startColumn>1&&C(v.originalRange.startLineNumber,v.modifiedRange.startLineNumber);const S=s.getModel(),k=v.originalRange.endLineNumber<=S.getLineCount()?S.getLineMaxColumn(v.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;v.originalRange.endColumn<k&&C(v.originalRange.endLineNumber,v.modifiedRange.endLineNumber)}C(p.original.endLineNumberExclusive,p.modified.endLineNumberExclusive,!0),h=p.original.endLineNumberExclusive,u=p.modified.endLineNumberExclusive}return f(Number.MAX_VALUE,Number.MAX_VALUE),d}function BU(s,e){const t=[],n=[],i=s.getOption(166).wrappingColumn!==-1,r=s._getViewModel().coordinatesConverter,o=s.getOption(75);if(i)for(let l=1;l<=s.getModel().getLineCount();l++){const c=r.getModelLineViewLineCount(l);c>1&&n.push({lineNumber:l,heightInPx:o*(c-1)})}for(const l of s.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:r.convertViewPositionToModelPosition(new P(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return ske(t,n,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function jA(s){return s.innerChanges?s.innerChanges.every(e=>VU(e.modifiedRange)&&VU(e.originalRange)||e.originalRange.equalsRange(new R(1,1,1,1))):!1}function VU(s){return s.startLineNumber===s.endLineNumber}const Jb=class Jb extends U{constructor(e,t,n,i,r){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=i,this._editors=r,this._originalScrollTop=Bt(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Bt(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Zr("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Me(this,0),this._modifiedViewZonesChangedSignal=Zr("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Zr("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=he(this,d=>{this._element.replaceChildren();const h=this._diffModel.read(d),u=h?.diff.read(d)?.movedTexts;if(!u||u.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const f=this._originalEditorLayoutInfo.read(d),g=this._modifiedEditorLayoutInfo.read(d);if(!f||!g){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const p=u.map(k=>{function L(G,Y){const Q=Y.getTopForLineNumber(G.startLineNumber,!0),oe=Y.getTopForLineNumber(G.endLineNumberExclusive,!0);return(Q+oe)/2}const E=L(k.lineRangeMapping.original,this._editors.original),N=this._originalScrollTop.read(d),M=L(k.lineRangeMapping.modified,this._editors.modified),O=this._modifiedScrollTop.read(d),I=E-N,F=M-O,W=Math.min(E,M),z=Math.max(E,M);return{range:new fe(W,z),from:I,to:F,fromWithoutScroll:E,toWithoutScroll:M,move:k}});p.sort(Rie(Ks(k=>k.fromWithoutScroll>k.toWithoutScroll,Aie),Ks(k=>k.fromWithoutScroll>k.toWithoutScroll?k.fromWithoutScroll:-k.toWithoutScroll,ll)));const m=KA.compute(p.map(k=>k.range)),b=10,w=f.verticalScrollbarWidth,C=(m.getTrackCount()-1)*10+b*2,v=w+C+(g.contentLeft-Jb.movedCodeBlockPadding);let S=0;for(const k of p){const L=m.getTrack(S),E=w+b+L*10,N=15,M=15,O=v,I=g.glyphMarginWidth+g.lineNumbersWidth,F=18,W=document.createElementNS("http://www.w3.org/2000/svg","rect");W.classList.add("arrow-rectangle"),W.setAttribute("x",`${O-I}`),W.setAttribute("y",`${k.to-F/2}`),W.setAttribute("width",`${I}`),W.setAttribute("height",`${F}`),this._element.appendChild(W);const z=document.createElementNS("http://www.w3.org/2000/svg","g"),G=document.createElementNS("http://www.w3.org/2000/svg","path");G.setAttribute("d",`M 0 ${k.from} L ${E} ${k.from} L ${E} ${k.to} L ${O-M} ${k.to}`),G.setAttribute("fill","none"),z.appendChild(G);const Y=document.createElementNS("http://www.w3.org/2000/svg","polygon");Y.classList.add("arrow"),d.store.add(Ke(Q=>{G.classList.toggle("currentMove",k.move===h.activeMovedText.read(Q)),Y.classList.toggle("currentMove",k.move===h.activeMovedText.read(Q))})),Y.setAttribute("points",`${O-M},${k.to-N/2} ${O},${k.to} ${O-M},${k.to+N/2}`),z.appendChild(Y),this._element.appendChild(z),S++}this.width.set(C,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ce(()=>this._element.remove())),this._register(Ke(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-Jb.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(lC(this._state));const o=he(d=>{const u=this._diffModel.read(d)?.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new _p(s_(f.lineRangeMapping.original.startLineNumber-1),18),modified:new _p(s_(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(HS(this._editors.original,o.map(d=>d.map(h=>h.original)))),this._register(HS(this._editors.modified,o.map(d=>d.map(h=>h.modified)))),this._register(Lo((d,h)=>{const u=o.read(d);for(const f of u)h.add(new WU(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new WU(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=Zr("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=Zr("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(Gf({changeTracker:{createChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)}},d=>{a.read(d),l.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let f;if(u&&c==="original"){const g=this._editors.originalCursor.read(d);g&&(f=u.movedTexts.find(p=>p.lineRangeMapping.original.contains(g.lineNumber)))}if(u&&c==="modified"){const g=this._editors.modifiedCursor.read(d);g&&(f=u.movedTexts.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber)))}f!==h.movedTextToCompare.read(void 0)&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(f)}))}};Jb.movedCodeBlockPadding=4;let bp=Jb;class KA{static compute(e){const t=[],n=[];for(const i of e){let r=t.findIndex(o=>!o.intersectsStrict(i));r===-1&&(t.length>=6?r=Sce(t,Ks(a=>a.intersectWithRangeLength(i),ll)):(r=t.length,t.push(new tD))),t[r].addRange(i),n.push(r)}return new KA(t.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class WU extends MA{constructor(e,t,n,i,r){const o=Je("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=n,this._kind=i,this._diffModel=r,this._nodes=Je("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Je("div.text-content@textContent"),Je("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);const a=Bt(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Ld(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let l;n.changes.length>0?l=this._kind==="original"?_(128,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):_(129,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?_(130,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):_(131,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new Da(this._nodes.actionBar,{highlightToggledItems:!0})),d=new jc("",l,"",!1);c.push(d,{icon:!1,label:!0});const h=new jc("","Compare",Ge.asClassName(ne.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===n?void 0:this._move,void 0)});this._register(Ke(u=>{const f=this._diffModel.movedTextToCompare.read(u)===n;h.checked=f})),c.push(h,{icon:!1,label:!0})}}class Rke extends U{constructor(e,t,n,i){super(),this._editors=e,this._diffModel=t,this._options=n,this._decorations=he(this,r=>{const o=this._diffModel.read(r),a=o?.diff.read(r);if(!a)return null;const l=this._diffModel.read(r).movedTextToCompare.read(r),c=this._options.renderIndicators.read(r),d=this._options.showEmptyDecorations.read(r),h=[],u=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?EU:DU}),g.lineRangeMapping.modified.isEmpty||u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?kU:NU}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:Ske}),g.lineRangeMapping.modified.isEmpty||u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:vke});else{const p=this._options.useTrueInlineDiffRendering.read(r)&&jA(g.lineRangeMapping);for(const m of g.lineRangeMapping.innerChanges||[])if(g.lineRangeMapping.original.contains(m.originalRange.startLineNumber)&&h.push({range:m.originalRange,options:m.originalRange.isEmpty()&&d?xke:BA}),g.lineRangeMapping.modified.contains(m.modifiedRange.startLineNumber)&&u.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()&&d&&!p?yke:TU}),p){const b=o.model.original.getValueInRange(m.originalRange);u.push({range:m.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const g of l.changes){const p=g.original.toInclusiveRange();p&&h.push({range:p,options:c?EU:DU});const m=g.modified.toInclusiveRange();m&&u.push({range:m,options:c?kU:NU});for(const b of g.innerChanges||[])h.push({range:b.originalRange,options:BA}),u.push({range:b.modifiedRange,options:TU})}const f=this._diffModel.read(r).activeMovedText.read(r);for(const g of a.movedTexts)h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[bp.movedCodeBlockPadding,0,bp.movedCodeBlockPadding,bp.movedCodeBlockPadding]}}),u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(WS(this._editors.original,this._decorations.map(r=>r?.originalDecorations||[]))),this._register(WS(this._editors.modified,this._decorations.map(r=>r?.modifiedDecorations||[])))}}class $o{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(e){return new $o(this.x+e.x,this.y+e.y)}deltaX(e){return new $o(this.x+e,this.y)}deltaY(e){return new $o(this.x,this.y+e)}toString(){return`(${this.x},${this.y})`}subtract(e){return new $o(this.x-e.x,this.y-e.y)}scale(e){return new $o(this.x*e,this.y*e)}mapComponents(e){return new $o(e(this.x),e(this.y))}isZero(){return this.x===0&&this.y===0}withThreshold(e){return this.mapComponents(t=>t>e?t-e:t<-e?t+e:0)}}function Wu(s){return qA.get(s)}const Md=class Md extends U{static get(e){let t=Md._map.get(e);if(!t){t=new Md(e),Md._map.set(e,t);const n=e.onDidDispose(()=>{const i=Md._map.get(e);i&&(Md._map.delete(e),i.dispose(),n.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new Jm(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Me(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Bt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(104)),this._versionId=t_({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=t_({owner:this,equalsFn:Zm(aN(Ae.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=aa({owner:this,equalsFn:Zm(aN(P.equals))},t=>this.selections.read(t)?.map(n=>n.getStartPosition())??null),this.isFocused=Bt(this,t=>{const n=this.editor.onDidFocusEditorWidget(t),i=this.editor.onDidBlurEditorWidget(t);return{dispose(){n.dispose(),i.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=Bt(this,t=>{const n=this.editor.onDidFocusEditorText(t),i=this.editor.onDidBlurEditorText(t);return{dispose(){n.dispose(),i.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=Bt(this,t=>{const n=this.editor.onDidCompositionStart(()=>{t(void 0)}),i=this.editor.onDidCompositionEnd(()=>{t(void 0)});return{dispose(){n.dispose(),i.dispose()}}},()=>this.editor.inComposition),this.value=uN(this,t=>(this.versionId.read(t),this.model.read(t)?.getValue()??""),(t,n)=>{const i=this.model.get();i!==null&&t!==i.getValue()&&i.setValue(t)}),this.valueIsEmpty=he(this,t=>(this.versionId.read(t),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=aa({owner:this,equalsFn:Zm(Ae.selectionsEqual)},t=>this.selections.read(t)?.[0]??null),this.cursorPosition=aa({owner:this,equalsFn:P.equals},t=>this.selections.read(t)?.[0]?.getPosition()??null),this.cursorLineNumber=he(this,t=>this.cursorPosition.read(t)?.lineNumber??null),this.onDidType=i_(this),this.onDidPaste=i_(this),this.scrollTop=Bt(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Bt(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Bt(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(t=>t.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(t=>t.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(t=>t.width),this.layoutInfoHeight=this.layoutInfo.map(t=>t.height),this.layoutInfoMinimap=this.layoutInfo.map(t=>t.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(t=>t.verticalScrollbarWidth),this.contentWidth=Bt(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=Bt(this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._widgetCounter=0,this.openedPeekWidgets=Me(this,0),this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(t=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,t)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(t=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(t=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,t),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=he(t=>(this.model.read(t),this.editor.getDomNode()))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=bi.ofCaller()){return Bt(this,n=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&n(void 0)}),()=>this.editor.getOption(e),t)}setDecorations(e){const t=new le,n=this.editor.createDecorationsCollection();return t.add(hN({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},i=>{const r=e.read(i);n.set(r)})),t.add({dispose:()=>{n.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._widgetCounter++,n={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(n);const i=Ke(r=>{e.position.read(r),e.minContentWidthInPx.read(r),this.editor.layoutOverlayWidget(n)});return Ce(()=>{i.dispose(),this.editor.removeOverlayWidget(n)})}createContentWidget(e){const t="observableContentWidget"+this._widgetCounter++,n={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(n);const i=Ke(r=>{e.position.read(r),this.editor.layoutContentWidget(n)});return Ce(()=>{i.dispose(),this.editor.removeContentWidget(n)})}observeLineOffsetRange(e,t){const n=this.observePosition(e.map(r=>new P(r.startLineNumber,1)),t),i=this.observePosition(e.map(r=>new P(r.endLineNumberExclusive+1,1)),t);return he(r=>{n.read(r),i.read(r);const o=e.read(r),a=this.model.read(r)?.getLineCount(),l=(typeof a<"u"&&o.startLineNumber>a?this.editor.getBottomForLineNumber(a):this.editor.getTopForLineNumber(o.startLineNumber))-this.scrollTop.read(r),c=o.isEmpty?l:this.editor.getBottomForLineNumber(o.endLineNumberExclusive-1)-this.scrollTop.read(r);return new fe(l,c)})}observePosition(e,t){let n=e.get();const i=t_({owner:this,debugName:()=>`topLeftOfPosition${n?.toString()}`,equalsFn:Zm($o.equals)},new $o(0,0)),r="observablePositionWidget"+this._widgetCounter++,o=document.createElement("div"),a={getDomNode:()=>o,getPosition:()=>n?{preference:[0],position:e.get()}:null,getId:()=>r,allowEditorOverflow:!1,afterRender:(l,c)=>{const d=this._model.get();d&&n&&n.lineNumber>d.getLineCount()?i.set(new $o(0,this.editor.getBottomForLineNumber(d.getLineCount())-this.scrollTop.get()),void 0):i.set(c?new $o(c.left,c.top):null,void 0)}};return this.editor.addContentWidget(a),t.add(Ke(l=>{n=e.read(l),this.editor.layoutContentWidget(a)})),t.add(Ce(()=>{this.editor.removeContentWidget(a)})),i}isTargetHovered(e,t){const n=Me("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove(i=>{const r=e(i);n.set(r,void 0)})),t.add(this.editor.onMouseLeave(i=>{n.set(!1,void 0)})),n}observeLineHeightForPosition(e){return he(t=>{const n=e instanceof P?e:e.read(t);return n===null?null:(this.getOption(75).read(t),this.editor.getLineHeightForPosition(n))})}observeLineHeightForLine(e){return typeof e=="number"?this.observeLineHeightForPosition(new P(e,1)):he(t=>{const n=e.read(t);return n===null?null:this.observeLineHeightForPosition(new P(n,1)).read(t)})}observeLineHeightsForLineRange(e){return he(t=>{const n=e instanceof xe?e:e.read(t),i=[];for(let r=n.startLineNumber;r<n.endLineNumberExclusive;r++)i.push(this.observeLineHeightForLine(r).read(t));return i})}};Md._map=new Map;let qA=Md;var Ake=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Oke=function(s,e){return function(t,n){e(t,n,s)}},Uo;let Db=(cc=class extends U{constructor(e,t,n,i,r,o,a){super(),this._editors=e,this._rootElement=t,this._diffModel=n,this._rootWidth=i,this._rootHeight=r,this._modifiedEditorLayoutInfo=o,this._themeService=a,this.width=Uo.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Bt(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=he(u=>{const f=l.read(u),g=f.getColor(vhe)||(f.getColor(whe)||RD).transparent(2),p=f.getColor(yhe)||(f.getColor(Che)||AD).transparent(2);return{insertColor:g,removeColor:p}}),d=et(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Je("div.diffOverview",{style:{position:"absolute",top:"0px",width:Uo.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(kb(h,d.domNode)),this._register(si(h,Z.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(B(h,Z.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(kb(this._rootElement,h)),this._register(Lo((u,f)=>{const g=this._diffModel.read(u),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(f.add(p),f.add(kb(h,p.getDomNode())));const m=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(m&&(f.add(m),f.add(kb(h,m.getDomNode()))),!p||!m)return;const b=Zr("viewZoneChanged",this._editors.original.onDidChangeViewZones),w=Zr("viewZoneChanged",this._editors.modified.onDidChangeViewZones),C=Zr("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),v=Zr("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(Ke(S=>{b.read(S),w.read(S),C.read(S),v.read(S);const k=c.read(S),L=g?.diff.read(S)?.mappings;function E(O,I,F){const W=F._getViewModel();return W?O.filter(z=>z.length>0).map(z=>{const G=W.coordinatesConverter.convertModelPositionToViewPosition(new P(z.startLineNumber,1)),Y=W.coordinatesConverter.convertModelPositionToViewPosition(new P(z.endLineNumberExclusive,1)),Q=Y.lineNumber-G.lineNumber;return new GB(G.lineNumber,Y.lineNumber,Q,I.toString())}):[]}const N=E((L||[]).map(O=>O.lineRangeMapping.original),k.removeColor,this._editors.original),M=E((L||[]).map(O=>O.lineRangeMapping.modified),k.insertColor,this._editors.modified);p?.setZones(N),m?.setZones(M)})),f.add(Ke(S=>{const k=this._rootHeight.read(S),L=this._rootWidth.read(S),E=this._modifiedEditorLayoutInfo.read(S);if(E){const N=Uo.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Uo.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:k,right:N+Uo.ONE_OVERVIEW_WIDTH,width:Uo.ONE_OVERVIEW_WIDTH}),m.setLayout({top:0,height:k,right:0,width:Uo.ONE_OVERVIEW_WIDTH});const M=this._editors.modifiedScrollTop.read(S),O=this._editors.modifiedScrollHeight.read(S),I=this._editors.modified.getOption(117),F=new Dg(I.verticalHasArrows?I.arrowSize:0,I.verticalScrollbarSize,0,E.height,O,M);d.setTop(F.getSliderPosition()),d.setHeight(F.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=k+"px",h.style.left=L-Uo.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(Uo.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},Uo=cc,cc.ONE_OVERVIEW_WIDTH=15,cc.ENTIRE_DIFF_OVERVIEW_WIDTH=cc.ONE_OVERVIEW_WIDTH*2,cc);Db=Uo=Ake([Oke(6,Fs)],Db);var Pke=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},GA=function(s,e){return function(t,n){e(t,n,s)}};let YA=class extends U{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,n,i,r,o,a,l){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=n,this._argCodeEditorWidgetOptions=i,this._createInnerEditor=r,this._contextKeyService=o,this._instantiationService=a,this._keybindingService=l,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new A),this.modifiedScrollTop=Bt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Bt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=Wu(this.modified),this.originalObs=Wu(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Bt(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=aa({owner:this,equalsFn:P.equals},c=>this.modifiedSelections.read(c)[0]?.getPosition()??new P(1,1)),this.originalCursor=Bt(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new P(1,1)),this.isOriginalFocused=Wu(this.original).isFocused,this.isModifiedFocused=Wu(this.modified).isFocused,this.isFocused=he(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(Gf({changeTracker:{createChangeSummary:()=>({}),handleChange:(c,d)=>(c.didChange(n.editorOptions)&&Object.assign(d,c.change.changedOptions),!0)}},(c,d)=>{n.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,d)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,d))}))}_createLeftHandSideEditor(e,t){const n=this._adjustOptionsForLeftHandSide(void 0,e),i=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,n,t),r=this._contextKeyService.createKey("isInDiffLeftEditor",i.hasWidgetFocus());return this._register(i.onDidFocusEditorWidget(()=>r.set(!0))),this._register(i.onDidBlurEditorWidget(()=>r.set(!1))),i}_createRightHandSideEditor(e,t){const n=this._adjustOptionsForRightHandSide(void 0,e),i=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,n,t),r=this._contextKeyService.createKey("isInDiffRightEditor",i.hasWidgetFocus());return this._register(i.onDidFocusEditorWidget(()=>r.set(!0))),this._register(i.onDidBlurEditorWidget(()=>r.set(!1))),i}_constructInnerEditor(e,t,n,i){const r=this._createInnerEditor(e,t,n,i);return this._register(r.onDidContentSizeChange(o=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+Db.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:o.contentHeightChanged,contentWidthChanged:o.contentWidthChanged})})),r}_adjustOptionsForLeftHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(n.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},n.wordWrapOverride1=this._options.diffWordWrap.get()):(n.wordWrapOverride1="off",n.wordWrapOverride2="off",n.stickyScroll={enabled:!1},n.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),n.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(n.ariaLabel=t.originalAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.readOnly=!this._options.originalEditable.get(),n.dropIntoEditor={enabled:!n.readOnly},n.extraEditorClassName="original-in-monaco-diff-editor",n}_adjustOptionsForRightHandSide(e,t){const n=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(n.ariaLabel=t.modifiedAriaLabel),n.ariaLabel=this._updateAriaLabel(n.ariaLabel),n.wordWrapOverride1=this._options.diffWordWrap.get(),n.revealHorizontalRightPadding=rh.revealHorizontalRightPadding.defaultValue+Db.ENTIRE_DIFF_OVERVIEW_WIDTH,n.scrollbar.verticalHasArrows=!1,n.extraEditorClassName="modified-in-monaco-diff-editor",n}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.allowVariableLineHeights=!1,t.allowVariableFonts=!1,t.allowVariableFontsInAccessibilityMode=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=_(108," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};YA=Pke([GA(5,rt),GA(6,Xe),GA(7,Qn)],YA);class Fke{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=uN(this,n=>{const i=this._sashRatio.read(n)??this._options.splitViewDefaultRatio.read(n);return this._computeSashLeft(i,n)},(n,i)=>{const r=this.dimensions.width.get();this._sashRatio.set(n/r,i)}),this._sashRatio=Me(this,void 0)}_computeSashLeft(e,t){const n=this.dimensions.width.read(t),i=Math.floor(this._options.splitViewDefaultRatio.read(t)*n),r=this._options.enableSplitViewResizing.read(t)?Math.floor(e*n):i,o=100;return n<=o*2?i:r<o?o:r>n-o?n-o:r}}class HU extends U{constructor(e,t,n,i,r,o){super(),this._domNode=e,this._dimensions=t,this._enabled=n,this._boundarySashes=i,this.sashLeft=r,this._resetSash=o,this._sash=this._register(new Pr(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(Ke(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(Ke(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}const Yx=class Yx extends U{constructor(){super(...arguments),this._id=++Yx.idCounter,this._onDidDispose=this._register(new A),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,n=0){this._targetEditor.revealLines(e,t,n)}revealLinesInCenter(e,t,n=0){this._targetEditor.revealLinesInCenter(e,t,n)}revealLinesInCenterIfOutsideViewport(e,t,n=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,n)}revealLinesNearTop(e,t,n=0){this._targetEditor.revealLinesNearTop(e,t,n)}revealRange(e,t=0,n=!1,i=!0){this._targetEditor.revealRange(e,t,n,i)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,n){this._targetEditor.trigger(e,t,n)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};Yx.idCounter=0;let XA=Yx;var Bke=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Vke=function(s,e){return function(t,n){e(t,n,s)}};let ZA=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Me(this,0),this._screenReaderMode=Bt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=he(this,i=>this._options.read(i).renderSideBySide&&this._diffEditorWidth.read(i)<=this._options.read(i).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=he(this,i=>this._options.read(i).renderOverviewRuler),this.renderSideBySide=he(this,i=>this.compactMode.read(i)&&this.shouldRenderInlineViewInSmartMode.read(i)?!1:this._options.read(i).renderSideBySide&&!(this._options.read(i).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(i)&&!this._screenReaderMode.read(i))),this.readOnly=he(this,i=>this._options.read(i).readOnly),this.shouldRenderOldRevertArrows=he(this,i=>!(!this._options.read(i).renderMarginRevertIcon||!this.renderSideBySide.read(i)||this.readOnly.read(i)||this.shouldRenderGutterMenu.read(i))),this.shouldRenderGutterMenu=he(this,i=>this._options.read(i).renderGutterMenu),this.renderIndicators=he(this,i=>this._options.read(i).renderIndicators),this.enableSplitViewResizing=he(this,i=>this._options.read(i).enableSplitViewResizing),this.splitViewDefaultRatio=he(this,i=>this._options.read(i).splitViewDefaultRatio),this.ignoreTrimWhitespace=he(this,i=>this._options.read(i).ignoreTrimWhitespace),this.maxComputationTimeMs=he(this,i=>this._options.read(i).maxComputationTime),this.showMoves=he(this,i=>this._options.read(i).experimental.showMoves&&this.renderSideBySide.read(i)),this.isInEmbeddedEditor=he(this,i=>this._options.read(i).isInEmbeddedEditor),this.diffWordWrap=he(this,i=>this._options.read(i).diffWordWrap),this.originalEditable=he(this,i=>this._options.read(i).originalEditable),this.diffCodeLens=he(this,i=>this._options.read(i).diffCodeLens),this.accessibilityVerbose=he(this,i=>this._options.read(i).accessibilityVerbose),this.diffAlgorithm=he(this,i=>this._options.read(i).diffAlgorithm),this.showEmptyDecorations=he(this,i=>this._options.read(i).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=he(this,i=>this._options.read(i).onlyShowAccessibleDiffViewer),this.compactMode=he(this,i=>this._options.read(i).compactMode),this.trueInlineDiffRenderingEnabled=he(this,i=>this._options.read(i).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=he(this,i=>!this.renderSideBySide.read(i)&&this.trueInlineDiffRenderingEnabled.read(i)),this.hideUnchangedRegions=he(this,i=>this._options.read(i).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=he(this,i=>this._options.read(i).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=he(this,i=>this._options.read(i).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=he(this,i=>this._options.read(i).hideUnchangedRegions.minimumLineCount),this._model=Me(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,i=>Boe(this,r=>{const o=i?.diff.read(r);return o?Wke(o,this.trueInlineDiffRenderingEnabled.read(r)):void 0})).flatten().map(this,i=>!!i),this.inlineViewHideOriginalLineNumbers=this.compactMode;const n={...e,...zU(e,di)};this._options=Me(this,n)}updateOptions(e){const t=zU(e,this._options.get()),n={...this._options.get(),...e,...t};this._options.set(n,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};ZA=Bke([Vke(1,sr)],ZA);function Wke(s,e){return s.mappings.every(t=>Hke(t.lineRangeMapping)||zke(t.lineRangeMapping)||e&&jA(t.lineRangeMapping))}function Hke(s){return s.original.length===0}function zke(s){return s.modified.length===0}function zU(s,e){return{enableSplitViewResizing:se(s.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:tse(s.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:se(s.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:se(s.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:ih(s.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:ih(s.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:se(s.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:se(s.renderIndicators,e.renderIndicators),originalEditable:se(s.originalEditable,e.originalEditable),diffCodeLens:se(s.diffCodeLens,e.diffCodeLens),renderOverviewRuler:se(s.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:vt(s.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:vt(s.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:se(s.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:se(s.experimental?.showMoves,e.experimental.showMoves),showEmptyDecorations:se(s.experimental?.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:se(s.experimental?.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:se(s.hideUnchangedRegions?.enabled??s.experimental?.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:ih(s.hideUnchangedRegions?.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:ih(s.hideUnchangedRegions?.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:ih(s.hideUnchangedRegions?.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:se(s.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:se(s.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:ih(s.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:se(s.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:se(s.renderGutterMenu,e.renderGutterMenu),compactMode:se(s.compactMode,e.compactMode)}}class $ke extends U{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(e,t,n={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Jse),this.disposables=this._register(new le),n.hoverDelegate=n.hoverDelegate??this._register(zM()),this.options=n,this.toggleMenuAction=this._register(new Tb(()=>this.toggleMenuActionViewItem?.show(),n.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Da(this.element,{orientation:n.orientation,ariaLabel:n.ariaLabel,actionRunner:n.actionRunner,allowContextMenu:n.allowContextMenu,highlightToggledItems:n.highlightToggledItems,hoverDelegate:n.hoverDelegate,actionViewItemProvider:(i,r)=>{if(i.id===Tb.ID)return this.toggleMenuActionViewItem=new tS(i,i.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ge.asClassNameArray(n.moreIcon??ne.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(n.actionViewItemProvider){const o=n.actionViewItemProvider(i,r);if(o)return o}if(i instanceof mC){const o=new tS(i,i.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:i.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return o.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(o),this.disposables.add(this._onDidChangeDropdownVisibility.add(o.onDidChangeVisibility)),o}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const n=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),n.push(this.toggleMenuAction)),n.forEach(i=>{this.actionBar.push(i,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(i)})})}getKeybindingLabel(e){return this.options.getKeyBinding?.(e)?.getLabel()??void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const Xx=class Xx extends jc{constructor(e,t){t=t||_(17,"More Actions..."),super(Xx.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};Xx.ID="toolbar.toggle.more";let Tb=Xx;const $U=We("IActionViewItemService");class Uke{constructor(){this._providers=new Map,this._onDidChange=new A,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(e,t){return this._providers.get(this._makeKey(e,t))}_makeKey(e,t){return`${e.id}/${t instanceof Ln?t.id:t}`}}qe($U,Uke,1);var UU=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},fr=function(s,e){return function(t,n){e(t,n,s)}};let QA=class extends $ke{constructor(e,t,n,i,r,o,a,l){super(e,r,{getKeyBinding:d=>o.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof t?.telemetrySource=="string"}),this._options=t,this._menuService=n,this._contextKeyService=i,this._contextMenuService=r,this._keybindingService=o,this._commandService=a,this._sessionDisposables=this._store.add(new le);const c=t?.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],n){this._sessionDisposables.clear();const i=e.slice(),r=t.slice(),o=[];let a=0;const l=[];let c=!1;if(this._options?.hiddenItemStrategy!==-1)for(let d=0;d<i.length;d++){const h=i[d];!(h instanceof xl)&&!(h instanceof Qf)||h.hideActions&&(o.push(h.hideActions.toggle),h.hideActions.toggle.checked&&a++,h.hideActions.isHidden&&(c=!0,i[d]=void 0,this._options?.hiddenItemStrategy!==0&&(l[d]=h)))}if(this._options?.overflowBehavior!==void 0){const d=lW(new Set(this._options.overflowBehavior.exempted),it.map(i,f=>f?.id)),h=this._options.overflowBehavior.maxItems-d.size;let u=0;for(let f=0;f<i.length;f++){const g=i[f];g&&(u++,!d.has(g.id)&&u>=h&&(i[f]=void 0,l[f]=g))}}x7(i),x7(l),super.setActions(i,Ci.join(l,r)),(o.length>0||i.length>0)&&this._sessionDisposables.add(B(this.getElement(),"contextmenu",d=>{const h=new Qs(pe(this.getElement()),d),u=this.getItemAction(h.target);if(!u)return;h.preventDefault(),h.stopPropagation();const f=[];if(u instanceof xl&&u.menuKeybinding)f.push(u.menuKeybinding);else if(!(u instanceof Qf||u instanceof Tb)){const p=!!this._keybindingService.lookupKeybinding(u.id);f.push(uU(this._commandService,this._keybindingService,u.id,void 0,p))}if(o.length>0){let p=!1;if(a===1&&this._options?.hiddenItemStrategy===0){p=!0;for(let m=0;m<o.length;m++)if(o[m].checked){o[m]=wh({id:u.id,label:u.label,checked:!0,enabled:!1,run(){}});break}}if(!p&&(u instanceof xl||u instanceof Qf)){if(!u.hideActions)return;f.push(u.hideActions.hide)}else f.push(wh({id:"label",label:_(1634,"Hide"),enabled:!1,run(){}}))}const g=Ci.join(f,o);this._options?.resetMenu&&!n&&(n=[this._options.resetMenu]),c&&n&&(g.push(new Ci),g.push(wh({id:"resetThisMenu",label:_(1635,"Reset Menu"),run:()=>this._menuService.resetHiddenStates(n)}))),g.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>h,getActions:()=>g,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:typeof this._options?.telemetrySource=="string",contextKeyService:this._contextKeyService})}))}};QA=UU([fr(2,Lh),fr(3,rt),fr(4,Kl),fr(5,Qn),fr(6,Js),fr(7,Ll)],QA);let $S=class extends QA{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,n,i,r,o,a,l,c,d,h){super(e,{resetMenu:t,...n,actionViewItemProvider:(g,p)=>{let m=d.lookUp(t,g instanceof Qf?g.item.submenu.id:g.id);m||(m=n?.actionViewItemProvider);const b=m?.(g,p,h,pe(e).vscodeWindowId);return b||Gz(h,g,p)}},i,r,o,a,l,c),this._onDidChangeMenuItems=this._store.add(new A);const u=this._store.add(i.createMenu(t,r,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:n?.eventDebounceDelay})),f=()=>{const{primary:g,secondary:p}=Mye(u.getActions(n?.menuOptions),n?.toolbarOptions?.primaryGroup,n?.toolbarOptions?.shouldInlineSubmenu,n?.toolbarOptions?.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",g.length===0&&p.length===0),super.setActions(g,p)};this._store.add(u.onDidChange(()=>{f(),this._onDidChangeMenuItems.fire(this)})),this._store.add(d.onDidChange(g=>{g===t&&f()})),f()}setActions(){throw new we("This toolbar is populated from a menu.")}};$S=UU([fr(3,Lh),fr(4,rt),fr(5,Kl),fr(6,Qn),fr(7,Js),fr(8,Ll),fr(9,$U),fr(10,Xe)],$S);class jU extends iD{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}getLineLength(e){return this._textModel.getLineLength(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new As(e-1,t)}}class KU extends bh{constructor(e){super(),this._getContext=e}runAction(e,t){const n=this._getContext();return super.runAction(e,n)}}class jke extends U{constructor(e,t,n){super(),this._editor=e,this._domNode=t,this.itemProvider=n,this.scrollTop=Bt(this,this._editor.onDidScrollChange,o=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(o=>o===0),this.modelAttached=Bt(this,this._editor.onDidChangeModel,o=>this._editor.hasModel()),this.editorOnDidChangeViewZones=Zr("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=Zr("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=i_("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const i=this._domNode.appendChild(Je("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),r=new ResizeObserver(()=>{nn(o=>{this.domNodeSizeChanged.trigger(o)})});r.observe(this._domNode),this._register(Ce(()=>r.disconnect())),this._register(Ke(o=>{i.className=this.isScrollTopZero.read(o)?"":"scroll-decoration"})),this._register(Ke(o=>this.render(o)))}dispose(){super.dispose(),wi(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),n=this._editor.getVisibleRanges(),i=new Set(this.views.keys()),r=fe.ofStartAndLength(0,this._domNode.clientHeight);if(!r.isEmpty)for(const o of n){const a=new xe(o.startLineNumber,o.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);nn(c=>{for(const d of l){if(!d.range.intersect(a))continue;i.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,c);else{const p=document.createElement("div");this._domNode.appendChild(p);const m=Me("item",d),b=this.itemProvider.createView(m,p);h=new Kke(m,b,p),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:d.range.startLineNumber>1?this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t:0,g=(d.range.endLineNumberExclusive===1?Math.max(u,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(u,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${g}px`,h.gutterItemView.layout(fe.ofStartAndLength(u,g),r)}})}for(const o of i){const a=this.views.get(o);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(o)}}}class Kke{constructor(e,t,n){this.item=e,this.gutterItemView=t,this.domNode=n}}var qU=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},US=function(s,e){return function(t,n){e(t,n,s)}};const JA=[],jS=35;let eO=class extends U{constructor(e,t,n,i,r,o,a,l,c){super(),this._diffModel=t,this._editors=n,this._options=i,this._sashLayout=r,this._boundarySashes=o,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(Ln.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Bt(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(h=>h.length>0),this._showSash=he(this,h=>this._options.renderSideBySide.read(h)&&this._hasActions.read(h)),this.width=he(this,h=>this._hasActions.read(h)?jS:0),this.elements=Je("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:jS+"px"}},[]),this._currentDiff=he(this,h=>{const u=this._diffModel.read(h);if(!u)return;const f=u.diff.read(h)?.mappings,g=this._editors.modifiedCursor.read(h);if(g)return f?.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber))}),this._selectedDiffs=he(this,h=>{const f=this._diffModel.read(h)?.diff.read(h);if(!f)return JA;const g=this._editors.modifiedSelections.read(h);if(g.every(w=>w.isEmpty()))return JA;const p=new kr(g.map(w=>xe.fromRangeInclusive(w))),b=f.mappings.filter(w=>w.lineRangeMapping.innerChanges&&p.intersects(w.lineRangeMapping.modified)).map(w=>({mapping:w,rangeMappings:w.lineRangeMapping.innerChanges.filter(C=>g.some(v=>R.areIntersecting(C.modifiedRange,v)))}));return b.length===0||b.every(w=>w.rangeMappings.length===0)?JA:b}),this._register(rke(e,this.elements.root)),this._register(B(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(Ld(this.elements.root,{display:this._hasActions.map(h=>h?"block":"none")})),la(this,h=>this._showSash.read(h)?new HU(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,uN(this,f=>this._sashLayout.sashLeft.read(f)-jS,(f,g)=>this._sashLayout.sashLeft.set(f+jS,g)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store);const d=he(this,h=>{const u=this._diffModel.read(h);if(!u)return[];const f=u.diff.read(h);if(!f)return[];const g=this._selectedDiffs.read(h);if(g.length>0){const m=tr.fromRangeMappings(g.flatMap(b=>b.rangeMappings));return[new GU(m,!0,Ln.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const p=this._currentDiff.read(h);return f.mappings.map(m=>new GU(m.lineRangeMapping.withInnerChangesFromLineRanges(),m.lineRangeMapping===p?.lineRangeMapping,Ln.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))});this._register(new jke(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(h,u)=>d.read(u),createView:(h,u)=>this._instantiationService.createInstance(tO,h,u,this)})),this._register(B(this.elements.gutter,Z.MOUSE_WHEEL,h=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],n=new jU(this._editors.modifiedModel.get()),i=new jU(this._editors.original.getModel());return new y_(t.map(a=>a.toTextEdit(n))).apply(i)}layout(e){this.elements.gutter.style.left=e+"px"}};eO=qU([US(6,Xe),US(7,rt),US(8,Lh)],eO);class GU{constructor(e,t,n,i,r,o){this.mapping=e,this.showAlways=t,this.menuId=n,this.rangeOverride=i,this.originalUri=r,this.modifiedUri=o}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let tO=class extends U{constructor(e,t,n,i){super(),this._item=e,this._elements=Je("div.gutterItem",{style:{height:"20px",width:"34px"}},[Je("div.background@background",{},[]),Je("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,o=>o.showAlways),this._menuId=this._item.map(this,o=>o.menuId),this._isSmall=Me(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const r=this._register(i.createInstance(E1,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(kb(t,this._elements.root)),this._register(Ke(o=>{const a=this._showAlways.read(o);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(Lo((o,a)=>{this._elements.buttons.replaceChildren();const l=a.add(i.createInstance($S,this._elements.buttons,this._menuId.read(o),{orientation:1,hoverDelegate:r,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(o)?1:3},hiddenItemStrategy:0,actionRunner:a.add(new KU(()=>{const c=this._item.read(void 0),d=c.mapping;return{mapping:d,originalWithModifiedChanges:n.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}})),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let n=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),n=this._elements.buttons.clientHeight;const i=e.length/2-n/2,r=n;let o=e.start+i;const a=fe.tryCreate(r,t.endExclusive-r-n),l=fe.tryCreate(e.start+r,e.endExclusive-n-r);l&&a&&l.start<l.endExclusive&&(o=a.clip(o),o=l.clip(o)),this._elements.buttons.style.top=`${o-e.start}px`}};tO=qU([US(3,Xe)],tO);var qke=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Gke=function(s,e){return function(t,n){e(t,n,s)}},KS;let nO=(hf=class extends U{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,n,i){super(),this._editors=e,this._diffModel=t,this._options=n,this._instantiationService=i,this._modifiedOutlineSource=la(this,l=>{const c=this._editors.modifiedModel.read(l),d=KS._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();nn(d=>{for(const h of this._editors.original.getSelections()||[])c?.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,0,d),c?.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();nn(d=>{for(const h of this._editors.modified.getSelections()||[])c?.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,0,d),c?.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,0,d)})}));const r=this._diffModel.map((l,c)=>{const d=l?.unchangedRegions.read(c)??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===this._editors.modifiedModel.read(c)?.getLineCount()?[]:d});this.viewZones=he(this,l=>{const c=this._modifiedOutlineSource.read(l);if(!c)return{origViewZones:[],modViewZones:[]};const d=[],h=[],u=this._options.renderSideBySide.read(l),f=this._options.compactMode.read(l),g=r.read(l);for(let p=0;p<g.length;p++){const m=g[p];if(!m.shouldHideControls(l)&&!(f&&(p===0||p===g.length-1)))if(f){{const b=he(this,C=>m.getHiddenOriginalRange(C).startLineNumber-1),w=new _p(b,12);d.push(w),l.store.add(new YU(this._editors.original,w,m,!u))}{const b=he(this,C=>m.getHiddenModifiedRange(C).startLineNumber-1),w=new _p(b,12);h.push(w),l.store.add(new YU(this._editors.modified,w,m))}}else{{const b=he(this,C=>m.getHiddenOriginalRange(C).startLineNumber-1),w=new _p(b,24);d.push(w),l.store.add(new XU(this._editors.original,w,m,m.originalUnchangedRange,!u,c,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,2,void 0),this._options))}{const b=he(this,C=>m.getHiddenModifiedRange(C).startLineNumber-1),w=new _p(b,24);h.push(w),l.store.add(new XU(this._editors.modified,w,m,m.modifiedUnchangedRange,!1,c,C=>this._diffModel.get().ensureModifiedLineIsVisible(C,2,void 0),this._options))}}}return{origViewZones:d,modViewZones:h}});const o={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new CH(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(_(121,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Ge.asClassName(ne.fold),zIndex:10001};this._register(WS(this._editors.original,he(this,l=>{const c=r.read(l),d=c.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:o}));for(const h of c)h.shouldHideControls(l)&&d.push({range:R.fromPositions(new P(h.originalLineNumber,1)),options:a});return d}))),this._register(WS(this._editors.modified,he(this,l=>{const c=r.read(l),d=c.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:o}));for(const h of c)h.shouldHideControls(l)&&d.push({range:xe.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(Ke(l=>{const c=r.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(Sr)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(Sr))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{if(!l.event.rightButton&&l.target.position&&l.target.element?.className.includes("fold-unchanged")){const c=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.modifiedUnchangedRange.contains(c));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{if(!l.event.rightButton&&l.target.position&&l.target.element?.className.includes("fold-unchanged")){const c=l.target.position.lineNumber,d=this._diffModel.get();if(!d)return;const h=d.unchangedRegions.get().find(u=>u.originalUnchangedRange.contains(c));if(!h)return;h.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}},KS=hf,hf._breadcrumbsSourceFactory=Me(KS,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),hf);nO=KS=qke([Gke(3,Xe)],nO);class YU extends MA{constructor(e,t,n,i=!1){const r=Je("div.diff-hidden-lines-widget");super(e,t,r.root),this._unchangedRegion=n,this._hide=i,this._nodes=Je("div.diff-hidden-lines-compact",[Je("div.line-left",[]),Je("div.text@text",[]),Je("div.line-right",[])]),r.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(Ke(o=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(o).length,l=_(122,"{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class XU extends MA{constructor(e,t,n,i,r,o,a,l){const c=Je("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=n,this._unchangedRegionRange=i,this._hide=r,this._modifiedOutlineSource=o,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Je("div.diff-hidden-lines",[Je("div.top@top",{title:_(123,"Click or drag to show more above")}),Je("div.center@content",{style:{display:"flex"}},[Je("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ve("a",{title:_(124,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...bu("$(unfold)"))]),Je("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Je("div.bottom@bottom",{title:_(125,"Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?wi(this._nodes.first):this._register(Ld(this._nodes.first,{width:Wu(this._editor).layoutInfoContentLeft})),this._register(Ke(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const f=this._unchangedRegion.isDragged.read(h),g=this._editor.getDomNode();g&&(g.classList.toggle("draggingUnchangedRegion",!!f),f==="top"?(g.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),g.classList.toggle("canMoveBottom",!u)):f==="bottom"?(g.classList.toggle("canMoveTop",!u),g.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(g.classList.toggle("canMoveTop",!1),g.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(B(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const g=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const p=pe(this._nodes.top),m=B(p,"mousemove",w=>{const v=w.clientY-u;f=f||Math.abs(v)>2;const S=Math.round(v/d.getOption(75)),k=Math.max(0,Math.min(g+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(k,void 0)}),b=B(p,"mouseup",w=>{f||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),m.dispose(),b.dispose()})})),this._register(B(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const g=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const p=pe(this._nodes.bottom),m=B(p,"mousemove",w=>{const v=w.clientY-u;f=f||Math.abs(v)>2;const S=Math.round(v/d.getOption(75)),k=Math.max(0,Math.min(g-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),L=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(k,void 0);const E=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(E-L))}),b=B(p,"mouseup",w=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!f){const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const v=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(v-C))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),m.dispose(),b.dispose()})})),this._register(Ke(h=>{const u=[];if(!this._hide){const f=n.getHiddenModifiedRange(h).length,g=_(126,"{0} hidden lines",f),p=ve("span",{title:_(127,"Double click to unfold")},g);p.addEventListener("dblclick",w=>{w.button===0&&(w.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(p);const m=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(b.length>0){u.push(ve("span",void 0," | "));for(let w=0;w<b.length;w++){const C=b[w],v=RE.toIcon(C.kind),S=Je("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[Vy(v)," ",C.name,...w===b.length-1?[]:[Vy(ne.chevronRight)]]).root;u.push(S),S.onclick=()=>{this._revealModifiedHiddenLine(C.startLineNumber)}}}}wi(this._nodes.others,...u)}))}}const iO=[];class Yke extends U{constructor(e,t,n,i){super(),this._editors=e,this._diffModel=t,this._options=n,this._widget=i,this._selectedDiffs=he(this,r=>{const a=this._diffModel.read(r)?.diff.read(r);if(!a)return iO;const l=this._editors.modifiedSelections.read(r);if(l.every(u=>u.isEmpty()))return iO;const c=new kr(l.map(u=>xe.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&c.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(f=>l.some(g=>R.areIntersecting(f.modifiedRange,g)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?iO:h}),this._register(Lo((r,o)=>{if(!this._options.shouldRenderOldRevertArrows.read(r))return;const a=this._diffModel.read(r),l=a?.diff.read(r);if(!a||!l||a.movedTextToCompare.read(r))return;const c=[],d=this._selectedDiffs.read(r),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(r),f=o.add(new qS(u[u.length-1].positionLineNumber,this._widget,d.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(const u of l.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const f=o.add(new qS(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}o.add(Ce(()=>{for(const u of c)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const Zx=class Zx extends U{getId(){return this._id}constructor(e,t,n,i){super(),this._lineNumber=e,this._widget=t,this._diffs=n,this._revertSelection=i,this._id=`revertButton${Zx.counter++}`,this._domNode=Je("div.revertButton",{title:this._revertSelection?_(132,"Revert Selected Changes"):_(133,"Revert Change")},[Vy(ne.arrowRight)]).root,this._register(B(this._domNode,Z.MOUSE_DOWN,r=>{r.button!==2&&(r.stopPropagation(),r.preventDefault())})),this._register(B(this._domNode,Z.MOUSE_UP,r=>{r.stopPropagation(),r.preventDefault()})),this._register(B(this._domNode,Z.CLICK,r=>{this._diffs instanceof Mi?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),r.stopPropagation(),r.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Zc.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};Zx.counter=0;let qS=Zx;var Xke=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Ib=function(s,e){return function(t,n){e(t,n,s)}};let GS=class extends XA{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,n,i,r,o,a,l){super(),this._domElement=e,this._parentContextKeyService=i,this._parentInstantiationService=r,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=Je("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Je("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Je("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Je("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(QF(this,void 0)),this._diffModel=he(this,v=>this._diffModelSrc.read(v)?.object),this.onDidChangeModel=X.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Gg([rt,this._contextKeyService]))),this._boundarySashes=Me(this,void 0),this._accessibleDiffViewerShouldBeVisible=Me(this,!1),this._accessibleDiffViewerVisible=he(this,v=>this._options.onlyShowAccessibleDiffViewer.read(v)?!0:this._accessibleDiffViewerShouldBeVisible.read(v)),this._movedBlocksLinesPart=Me(this,void 0),this._layoutInfo=he(this,v=>{const S=this._rootSizeObserver.width.read(v),k=this._rootSizeObserver.height.read(v);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=k+"px";const L=this._sash.read(v),E=this._gutter.read(v),N=E?.width.read(v)??0,M=this._overviewRulerPart.read(v)?.width??0;let O,I,F,W,z;if(!!L){const Y=L.sashLeft.read(v),Q=this._movedBlocksLinesPart.read(v)?.width.read(v)??0;O=0,I=Y-N-Q,z=Y-N,F=Y,W=S-F-M}else{z=0;const Y=this._options.inlineViewHideOriginalLineNumbers.read(v);O=N,Y?I=0:I=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(v)),F=N+I,W=S-F-M}return this.elements.original.style.left=O+"px",this.elements.original.style.width=I+"px",this._editors.original.layout({width:I,height:k},!0),E?.layout(z),this.elements.modified.style.left=F+"px",this.elements.modified.style.width=W+"px",this._editors.modified.layout({width:W,height:k},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((v,S)=>v?.diff.read(S)),this.onDidUpdateDiff=X.fromObservableLight(this._diffValue),o.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ce(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new vU(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(ZA,t),this._register(Ke(v=>{this._options.setWidth(this._rootSizeObserver.width.read(v))})),this._contextKeyService.createKey(re.isEmbeddedDiffEditor.key,!1),this._register(ec(re.isEmbeddedDiffEditor,this._contextKeyService,v=>this._options.isInEmbeddedEditor.read(v))),this._register(ec(re.comparingMovedCode,this._contextKeyService,v=>!!this._diffModel.read(v)?.movedTextToCompare.read(v))),this._register(ec(re.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,v=>this._options.couldShowInlineViewBecauseOfSize.read(v))),this._register(ec(re.diffEditorInlineMode,this._contextKeyService,v=>!this._options.renderSideBySide.read(v))),this._register(ec(re.hasChanges,this._contextKeyService,v=>(this._diffModel.read(v)?.diff.read(v)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(YA,this.elements.original,this.elements.modified,this._options,n,(v,S,k,L)=>this._createInnerEditor(v,S,k,L))),this._register(ec(re.diffEditorOriginalWritable,this._contextKeyService,v=>this._options.originalEditable.read(v))),this._register(ec(re.diffEditorModifiedWritable,this._contextKeyService,v=>!this._options.readOnly.read(v))),this._register(ec(re.diffEditorOriginalUri,this._contextKeyService,v=>this._diffModel.read(v)?.model.original.uri.toString()??"")),this._register(ec(re.diffEditorModifiedUri,this._contextKeyService,v=>this._diffModel.read(v)?.model.modified.uri.toString()??"")),this._overviewRulerPart=la(this,v=>this._options.renderOverviewRuler.read(v)?this._instantiationService.createInstance(Jl(Db),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((v,S)=>v-(this._overviewRulerPart.read(S)?.width??0))};this._sashLayout=new Fke(this._options,c),this._sash=la(this,v=>{const S=this._options.renderSideBySide.read(v);return this.elements.root.classList.toggle("side-by-side",S),S?new HU(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=la(this,v=>this._instantiationService.createInstance(Jl(nO),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);la(this,v=>this._instantiationService.createInstance(Jl(Rke),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const g=la(this,v=>this._instantiationService.createInstance(Jl(UA),pe(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.read(void 0).isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),p=he(this,v=>{const S=g.read(v).viewZones.read(v).orig,k=d.read(v).viewZones.read(v).origViewZones;return S.concat(k)}),m=he(this,v=>{const S=g.read(v).viewZones.read(v).mod,k=d.read(v).viewZones.read(v).modViewZones;return S.concat(k)});this._register(HS(this._editors.original,p,v=>{f=v},h));let b;this._register(HS(this._editors.modified,m,v=>{f=v,f?b=VS.capture(this._editors.modified):(b?.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=la(this,v=>this._instantiationService.createInstance(Jl(Bu),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,k)=>this._accessibleDiffViewerShouldBeVisible.set(S,k),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,k)=>S?.diff.read(k)?.mappings.map(L=>L.lineRangeMapping)),new wke(this._editors))).recomputeInitiallyAndOnChange(this._store);const w=this._accessibleDiffViewerVisible.map(v=>v?"hidden":"visible");this._register(Ld(this.elements.modified,{visibility:w})),this._register(Ld(this.elements.original,{visibility:w})),this._createDiffEditorContributions(),o.addDiffEditor(this),this._gutter=la(this,v=>this._options.shouldRenderGutterMenu.read(v)?this._instantiationService.createInstance(Jl(eO),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(lC(this._layoutInfo)),la(this,v=>new(Jl(bp))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,v=>{this._movedBlocksLinesPart.set(v,void 0)}),this._register(X.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,v=>this._handleCursorPositionChange(v,!0))),this._register(X.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,v=>this._handleCursorPositionChange(v,!1)));const C=this._diffModel.map(this,(v,S)=>{if(v)return v.diff.read(S)===void 0&&!v.isDiffUpToDate.read(S)});this._register(Lo((v,S)=>{if(C.read(v)===!0){const k=this._editorProgressService.show(!0,1e3);S.add(Ce(()=>k.done()))}})),this._register(Lo((v,S)=>{S.add(new(Jl(Yke))(this._editors,this._diffModel,this._options,this))})),this._register(Lo((v,S)=>{const k=this._diffModel.read(v);if(k)for(const L of[k.model.original,k.model.modified])S.add(L.onWillDispose(E=>{dt(new we("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(Ke(v=>{this._options.setModel(this._diffModel.read(v))}))}_createInnerEditor(e,t,n,i){return e.createInstance(gy,t,n,i)}_createDiffEditorContributions(){const e=Jf.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(n){dt(n)}}get _targetEditor(){return this._editors.modified}getEditorType(){return pD.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(zA,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?zS.create(e).createNewRef(this):zS.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const n=this._diffModel.get();!e&&n&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&lN(t,i=>{const r=e?.object;Bt.batchEventsGlobally(i,()=>{this._editors.original.setModel(r?r.model.original:null),this._editors.modified.setModel(r?r.model.modified:null)});const o=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),i),setTimeout(()=>{o?.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?Zke(e):null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}])}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const n=e.map(i=>({range:i.modifiedRange,text:t.model.original.getValueInRange(i.originalRange)}));this._editors.modified.executeEdits("diffEditor",n)}revertFocusedRangeMappings(){const e=this._diffModel.get();if(!e||!e.isDiffUpToDate.get())return;const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const n=this._editors.modified;if(!n.hasTextFocus())return;const i=n.getPosition().lineNumber,r=n.getSelection(),o=xe.fromRange(r||new R(i,0,i,0)),a=t.filter(l=>l.lineRangeMapping.modified.intersect(o));n.executeEdits("diffEditor",a.map(l=>({range:l.lineRangeMapping.modified.toExclusiveRange(),text:e.model.original.getValueInRange(l.lineRangeMapping.original.toExclusiveRange())})))}_goTo(e){this._editors.modified.setPosition(new P(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||t.length===0)return;const n=this._editors.modified.getPosition().lineNumber;let i;e==="next"?this._editors.modified.getModel().getLineCount()===n?i=t[0]:i=t.find(o=>o.lineRangeMapping.modified.startLineNumber>n)??t[0]:i=zC(t,r=>r.lineRangeMapping.modified.startLineNumber<n)??t[t.length-1],this._goTo(i),i.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Fa.diffLineDeleted,{source:"diffEditor.goToDiff"}):i.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Fa.diffLineInserted,{source:"diffEditor.goToDiff"}):i&&this._accessibilitySignalService.playSignal(Fa.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){const e=this._diffModel.get();e&&this.waitForDiff().then(()=>{const t=e.diff.get()?.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,n=e?this._editors.original:this._editors.modified;let i;const r=t.getSelection();if(r){const o=this._diffModel.get()?.diff.get()?.mappings.map(a=>e?a.lineRangeMapping.flip():a.lineRangeMapping);if(o){const a=SU(r.getStartPosition(),o),l=SU(r.getEndPosition(),o);i=R.plusRange(a,l)}}return{destination:n,destinationSelection:i}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&nn(t=>{for(const n of e)n.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&nn(t=>{for(const n of e)n.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===3){const n=this._diffModel.get()?.diff.get()?.mappings.find(i=>t?i.lineRangeMapping.modified.contains(e.position.lineNumber):i.lineRangeMapping.original.contains(e.position.lineNumber));n?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Fa.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):n?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Fa.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):n&&this._accessibilitySignalService.playSignal(Fa.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};GS=Xke([Ib(3,rt),Ib(4,Xe),Ib(5,Dn),Ib(6,PS),Ib(7,OM)],GS);function Zke(s){return s.mappings.map(e=>{const t=e.lineRangeMapping;let n,i,r,o,a=t.innerChanges;return t.original.isEmpty?(n=t.original.startLineNumber-1,i=0,a=void 0):(n=t.original.startLineNumber,i=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(r=t.modified.startLineNumber-1,o=0,a=void 0):(r=t.modified.startLineNumber,o=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:n,originalEndLineNumber:i,modifiedStartLineNumber:r,modifiedEndLineNumber:o,charChanges:a?.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var sO=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},Et=function(s,e){return function(t,n){e(t,n,s)}};let Qke=0,ZU=!1;function Jke(s){if(!s){if(ZU)return;ZU=!0}zde(s||_t.document.body)}let YS=class extends gy{constructor(e,t,n,i,r,o,a,l,c,d,h,u,f){const g={...t};g.ariaLabel=g.ariaLabel||PM.editorViewAccessibleLabel,super(e,g,{},n,i,r,o,c,d,h,u,f),l instanceof mp?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,Jke(g.ariaContainerElement),Bve((p,m)=>n.createInstance(E1,p,{instantHover:m},{})),Vve(a)}addCommand(e,t,n){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const i="DYNAMIC_"+ ++Qke,r=Ze.deserialize(n);return this._standaloneKeybindingService.addDynamicKeybinding(i,e,t,r),i}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),U.None;const t=e.id,n=e.label,i=Ze.and(Ze.equals("editorId",this.getId()),Ze.deserialize(e.precondition)),r=e.keybindings,o=Ze.and(i,Ze.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new le,h=this.getId()+":"+t;if(d.add(gs.registerCommand(h,c)),a){const f={command:{id:h,title:n},when:i,group:a,order:l};d.add(Zf.appendMenuItem(Ln.EditorContext,f))}if(Array.isArray(r))for(const f of r)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,c,o));const u=new wV(h,n,n,void 0,i,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,u),d.add(Ce(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof py)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};YS=sO([Et(2,Xe),Et(3,Dn),Et(4,Js),Et(5,rt),Et(6,k1),Et(7,Qn),Et(8,Fs),Et(9,io),Et(10,sr),Et(11,ua),Et(12,yt)],YS);let rO=class extends YS{constructor(e,t,n,i,r,o,a,l,c,d,h,u,f,g,p,m){const b={...t};BS(h,b,!1);const w=c.registerEditorContainer(e);typeof b.theme=="string"&&c.setTheme(b.theme),typeof b.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!b.autoDetectHighContrast);const C=b.model;delete b.model,super(e,b,n,i,r,o,a,l,c,d,u,p,m),this._configurationService=h,this._standaloneThemeService=c,this._register(w);let v;if(typeof C>"u"){const S=g.getLanguageIdByMimeType(b.language)||b.language||Jr;v=QU(f,g,b.value||"",S,void 0),this._ownsModel=!0}else v=C,this._ownsModel=!1;if(this._attachModel(v),v){const S={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(S)}}dispose(){super.dispose()}updateOptions(e){BS(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};rO=sO([Et(2,Xe),Et(3,Dn),Et(4,Js),Et(5,rt),Et(6,k1),Et(7,Qn),Et(8,ao),Et(9,io),Et(10,Ft),Et(11,sr),Et(12,$i),Et(13,$n),Et(14,ua),Et(15,yt)],rO);let oO=class extends GS{constructor(e,t,n,i,r,o,a,l,c,d,h,u){const f={...t};BS(l,f,!0);const g=o.registerEditorContainer(e);typeof f.theme=="string"&&o.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&o.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},i,n,r,u,d),this._configurationService=l,this._standaloneThemeService=o,this._register(g)}dispose(){super.dispose()}updateOptions(e){BS(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,n){return e.createInstance(YS,t,n)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,n){return this.getModifiedEditor().addCommand(e,t,n)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};oO=sO([Et(2,Xe),Et(3,rt),Et(4,Dn),Et(5,ao),Et(6,io),Et(7,Ft),Et(8,Kl),Et(9,OM),Et(10,_A),Et(11,PS)],oO);function QU(s,e,t,n,i){if(t=t||"",!n){const r=t.indexOf(`
|
|
954
954
|
`);let o=t;return r!==-1&&(o=t.substring(0,r)),JU(s,t,e.createByFilepathOrFirstLine(i||null,o),i)}return JU(s,t,e.createById(n),i)}function JU(s,e,t,n){return s.createModel(e,t,n)}T("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},_(139,"The background color of the diff editor's header")),T("multiDiffEditor.background",to,_(140,"The background color of the multi file diff editor")),T("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},_(141,"The border color of the multi file diff editor"));var eEe=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},ej=function(s,e){return function(t,n){e(t,n,s)}};class tEe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let aO=class extends U{constructor(e,t,n,i,r){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=n,this._instantiationService=i,this._viewModel=Me(this,void 0),this._collapsed=he(this,l=>this._viewModel.read(l)?.collapsed.read(l)),this._editorContentHeight=Me(this,500),this.contentHeight=he(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Me(this,0),this._modifiedWidth=Me(this,0),this._originalContentWidth=Me(this,0),this._originalWidth=Me(this,0),this.maxScroll=he(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=Je("div.multiDiffEntry",[Je("div.header@header",[Je("div.header-content",[Je("div.collapse-button@collapseButton"),Je("div.file-path",[Je("div.title.modified.show-file-icons@primaryPath",[]),Je("div.status.deleted@status",["R"]),Je("div.title.original.show-file-icons@secondaryPath",[])]),Je("div.actions@actions")])]),Je("div.editorParent",[Je("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(GS,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=Wu(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Wu(this.editor.getOriginalEditor()).isFocused,this.isFocused=he(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 le),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new pR(this._elements.collapseButton,{});this._register(Ke(l=>{o.element.className="",o.icon=this._collapsed.read(l)?ne.chevronRight:ne.chevronDown})),this._register(o.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Ke(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=>{Qm(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(Ke(l=>{const c=this._viewModel.read(l)?.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(r.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new Gg([rt,this._contextKeyService])));this._register(a.createInstance($S,this._elements.actions,Ln.MultiDiffEditorFileToolbar,{actionRunner:this._register(new KU(()=>this._viewModel.get()?.modifiedUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>Gz(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(i){return{...i,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){Qm(i=>{this._viewModel.set(void 0,i),this.editor.setDiffModel(null,i),this._dataStore.clear()});return}const n=e.viewModel.documentDiffItem;if(Qm(i=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let r=!1,o=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",r=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",o=!0),this._elements.status.classList.toggle("renamed",r),this._elements.status.classList.toggle("deleted",o),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,this._resourceLabel2?.setUri(r?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,i),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,i),this.editor.updateOptions(t(n.options??{}))}),n.onOptionsDidChange&&this._dataStore.add(n.onOptionsDidChange(()=>{this.editor.updateOptions(t(n.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,i=>{i||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[i,r]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(i,r)}render(e,t,n,i){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const r=e.length-this._headerHeight,o=Math.max(0,Math.min(i.start-e.start,r));this._elements.header.style.transform=`translateY(${o}px)`,Qm(a=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=n,this.editor.getOriginalEditor().setScrollTop(n)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",o>0||n>0),this._elements.header.classList.toggle("collapsed",o===r)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};aO=eEe([ej(3,Xe),ej(4,rt)],aO);class nEe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const n=[...this._unused.values()];t=n.find(i=>this._itemData.get(i).getId()===e.getId())??n[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var iEe=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},tj=function(s,e){return function(t,n){e(t,n,s)}};let lO=class extends U{constructor(e,t,n,i,r,o){super(),this._element=e,this._dimension=t,this._viewModel=n,this._workbenchUIElementFactory=i,this._parentContextKeyService=r,this._parentInstantiationService=o,this._scrollableElements=Je("div.scrollContent",[Je("div@content",{style:{overflow:"hidden"}}),Je("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new Tg({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>fs(pe(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new yv(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Je("div.monaco-component.multiDiffEditor",{},[Je("div",{},[this._scrollableElement.getDomNode()]),Je("div.placeholder@placeholder",{},[Je("div")])]),this._sizeObserver=this._register(new vU(this._element,void 0)),this._objectPool=this._register(new nEe(c=>{const d=this._instantiationService.createInstance(aO,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return d.setData(c),d})),this.scrollTop=Bt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Bt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=he(this,c=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:g=>{throw new we}};const h=d.items.read(c),u=new Map;return{items:h.map(g=>{const p=c.store.add(new sEe(g,this._objectPool,this.scrollLeft,b=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+b})})),m=this._lastDocStates?.[p.getKey()];return m&&nn(b=>{p.setViewState(m,b)}),u.set(g,p),p}),getItem:g=>u.get(g)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,d)=>c.reduce((h,u)=>h+u.contentHeight.read(d)+this._spaceBetweenPx,0)),this.activeControl=he(this,c=>{const d=this._viewModel.read(c)?.activeDiffItem.read(c);return d?this._viewItemsInfo.read(c).getItem(d).template.read(c)?.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new Gg([rt,this._contextKeyService]))),this._lastDocStates={},this._register(Lo((c,d)=>{const h=this._viewModel.read(c);if(h&&h.contextKeys)for(const[u,f]of Object.entries(h.contextKeys)){const g=this._contextKeyService.createKey(u,void 0);g.set(f),d.add(Ce(()=>g.reset()))}}));const a=this._parentContextKeyService.createKey(re.multiDiffEditorAllCollapsed.key,!1);this._register(Ke(c=>{const d=this._viewModel.read(c);if(d){const h=d.items.read(c).every(u=>u.collapsed.read(c));a.set(h)}})),this._register(Ke(c=>{const d=this._dimension.read(c);this._sizeObserver.observe(d)}));const l=he(c=>{if(this._viewItems.read(c).length>0)return;const h=this._viewModel.read(c);return!h||h.isLoading.read(c)?_(142,"Loading..."):_(143,"No Changed Files")});this._register(Ke(c=>{const d=l.read(c);this._elements.placeholder.innerText=d??"",this._elements.placeholder.classList.toggle("visible",!!d)})),this._scrollableElements.content.style.position="relative",this._register(Ke(c=>{const d=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${d}px`;const h=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${h}px`;const u=this._sizeObserver.width.read(c);let f=u;const g=this._viewItems.read(c),p=L8(g,Ks(m=>m.maxScroll.read(c).maxScroll,ll));if(p){const m=p.maxScroll.read(c);f=u+m.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:d,scrollHeight:h,scrollWidth:f})})),e.replaceChildren(this._elements.root),this._register(Ce(()=>{e.replaceChildren()})),this._register(this._register(Ke(c=>{Qm(d=>{this.render(c)})})))}render(e){const t=this.scrollTop.read(e);let n=0,i=0,r=0;const o=this._sizeObserver.height.read(e),a=fe.ofStartAndLength(t,o),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),h=Math.min(d,o),u=fe.ofStartAndLength(i,h),f=fe.ofStartAndLength(r,d);if(f.isBefore(a))n-=d-h,c.hide();else if(f.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-f.start,d-h));n-=g;const p=fe.ofStartAndLength(t+n,o);c.render(u,g,l,p)}i+=h+this._spaceBetweenPx,r+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+n)}px)`}};lO=iEe([tj(4,rt),tj(5,Xe)],lO);class sEe extends U{constructor(e,t,n,i){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=n,this._deltaScrollVertical=i,this._templateRef=this._register(QF(this,void 0)),this.contentHeight=he(this,r=>this._templateRef.read(r)?.object.contentHeight?.read(r)??this.viewModel.lastTemplateData.read(r).contentHeight),this.maxScroll=he(this,r=>this._templateRef.read(r)?.object.maxScroll.read(r)??{maxScroll:0,scrollWidth:0}),this.template=he(this,r=>this._templateRef.read(r)?.object),this._isHidden=Me(this,!1),this._isFocused=he(this,r=>this.template.read(r)?.isFocused.read(r)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(Ke(r=>{const o=this._scrollLeft.read(r);this._templateRef.read(r)?.object.setScrollLeft(o)})),this._register(Ke(r=>{const o=this._templateRef.read(r);!o||!this._isHidden.read(r)||o.object.isFocused.read(r)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const n=this.viewModel.lastTemplateData.get(),i=e.selections?.map(Ae.liftSelection);this.viewModel.lastTemplateData.set({...n,selections:i},t);const r=this._templateRef.get();r&&i&&r.object.editor.setSelections(i)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&nn(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,n,i){this._isHidden.set(!1,void 0);let r=this._templateRef.get();if(!r){r=this._objectPool.getUnusedObj(new tEe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(r,void 0);const o=this.viewModel.lastTemplateData.get().selections;o&&r.object.editor.setSelections(o)}r.object.render(e,n,t,i)}}var rEe=function(s,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(i<3?o(r):i>3?o(e,t,r):o(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r},oEe=function(s,e){return function(t,n){e(t,n,s)}};let cO=class extends U{constructor(e,t,n){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=n,this._dimension=Me(this,void 0),this._viewModel=Me(this,void 0),this._widgetImpl=he(this,i=>i.store.add(this._instantiationService.createInstance(Jl(lO),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register(lC(this._widgetImpl))}};cO=rEe([oEe(2,Xe)],cO);function aEe(s,e,t){return be.initialize(t||{}).createInstance(rO,s,e)}function lEe(s){return be.get(Dn).onCodeEditorAdd(t=>{s(t)})}function cEe(s){return be.get(Dn).onDiffEditorAdd(t=>{s(t)})}function dEe(){return be.get(Dn).listCodeEditors()}function hEe(){return be.get(Dn).listDiffEditors()}function uEe(s,e,t){return be.initialize(t||{}).createInstance(oO,s,e)}function fEe(s,e){const t=be.initialize(e||{});return new cO(s,{},t)}function gEe(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return gs.registerCommand(s.id,s.run)}function pEe(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Ze.deserialize(s.precondition),t=(i,...r)=>Eh.runEditorCommand(i,r,e,(o,a,l)=>Promise.resolve(s.run(a,...l))),n=new le;if(n.add(gs.registerCommand(s.id,t)),s.contextMenuGroupId){const i={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};n.add(Zf.appendMenuItem(Ln.EditorContext,i))}if(Array.isArray(s.keybindings)){const i=be.get(Qn);if(!(i instanceof mp))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const r=Ze.and(e,Ze.deserialize(s.keybindingContext));n.add(i.addDynamicKeybindings(s.keybindings.map(o=>({keybinding:o,command:s.id,when:r}))))}}return n}function mEe(s){return nj([s])}function nj(s){const e=be.get(Qn);return e instanceof mp?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Ze.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),U.None)}function _Ee(s,e,t){const n=be.get($n),i=n.getLanguageIdByMimeType(e)||e;return QU(be.get($i),n,s,i,t)}function bEe(s,e){const t=be.get($n),n=t.getLanguageIdByMimeType(e)||e||Jr;s.setLanguage(t.createById(n))}function wEe(s,e,t){s&&be.get(Lu).changeOne(e,s.uri,t)}function CEe(s){be.get(Lu).changeAll(s,[])}function vEe(s){return be.get(Lu).read(s)}function yEe(s){return be.get(Lu).onMarkerChanged(s)}function SEe(s){return be.get($i).getModel(s)}function xEe(){return be.get($i).getModels()}function LEe(s){return be.get($i).onModelAdded(s)}function kEe(s){return be.get($i).onModelRemoved(s)}function EEe(s){return be.get($i).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function NEe(s){return gde(be.get($i),s)}function DEe(s,e){const t=be.get($n),n=be.get(ao);return yD.colorizeElement(n,t,s,e).then(()=>{n.registerEditorContainer(s)})}function TEe(s,e,t){const n=be.get($n);return be.get(ao).registerEditorContainer(_t.document.body),yD.colorize(n,s,e,t)}function IEe(s,e,t=4){return be.get(ao).registerEditorContainer(_t.document.body),yD.colorizeModelLine(s,e,t)}function MEe(s){const e=gn.get(s);return e||{getInitialState:()=>E_,tokenize:(t,n,i)=>J8(s,i)}}function REe(s,e){gn.getOrCreate(e);const t=MEe(e),n=Wf(s),i=[];let r=t.getInitialState();for(let o=0,a=n.length;o<a;o++){const l=n[o],c=t.tokenize(l,!0,r);i[o]=c.tokens,r=c.endState}return i}function AEe(s,e){be.get(ao).defineTheme(s,e)}function OEe(s){be.get(ao).setTheme(s)}function PEe(){DN.clearAllFontInfos()}function FEe(s,e){return gs.registerCommand({id:s,handler:e})}function BEe(s){return be.get(D1).registerOpener({async open(t){return typeof t=="string"&&(t=ze.parse(t)),s.open(t)}})}function VEe(s){return be.get(Dn).registerCodeEditorOpenHandler(async(t,n,i)=>{if(!n)return null;const r=t.options?.selection;let o;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?o=r:r&&(o={lineNumber:r.startLineNumber,column:r.startColumn}),await s.openCodeEditor(n,t.resource,o)?n:null})}function WEe(){return{create:aEe,getEditors:dEe,getDiffEditors:hEe,onDidCreateEditor:lEe,onDidCreateDiffEditor:cEe,createDiffEditor:uEe,addCommand:gEe,addEditorAction:pEe,addKeybindingRule:mEe,addKeybindingRules:nj,createModel:_Ee,setModelLanguage:bEe,setModelMarkers:wEe,getModelMarkers:vEe,removeAllMarkers:CEe,onDidChangeMarkers:yEe,getModels:xEe,getModel:SEe,onDidCreateModel:LEe,onWillDisposeModel:kEe,onDidChangeModelLanguage:EEe,createWebWorker:NEe,colorizeElement:DEe,colorize:TEe,colorizeModelLine:IEe,tokenize:REe,defineTheme:AEe,setTheme:OEe,remeasureFonts:PEe,registerCommand:FEe,registerLinkOpener:BEe,registerEditorOpener:VEe,AccessibilitySupport:OE,ContentWidgetPositionPreference:HE,CursorChangeReason:zE,DefaultEndOfLine:$E,EditorAutoIndentStrategy:jE,EditorOption:KE,EndOfLinePreference:qE,EndOfLineSequence:GE,MinimapPosition:o2,MinimapSectionHeaderStyle:a2,MouseTargetType:l2,OverlayWidgetPositionPreference:h2,OverviewRulerLane:u2,GlyphMarginLane:YE,RenderLineNumbersType:p2,RenderMinimap:m2,ScrollbarVisibility:b2,ScrollType:_2,TextEditorCursorBlinkingStyle:L2,TextEditorCursorStyle:k2,TrackedRangeStickiness:E2,WrappingIndent:N2,InjectedTextCursorStops:QE,PositionAffinity:g2,ShowLightbulbIconMode:C2,TextDirection:x2,ConfigurationChangedEvent:z7,BareFontInfo:_h,FontInfo:NN,TextModelResolvedOptions:VC,FindMatch:v_,ApplyUpdateResult:Rm,EditorZoom:Uc,createMultiFileDiffEditor:fEe,EditorType:pD,EditorOptions:rh}}function HEe(s,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!s(t))return!1;return!0}function XS(s,e){return typeof s=="boolean"?s:e}function ij(s,e){return typeof s=="string"?s:e}function zEe(s){const e={};for(const t of s)e[t]=!0;return e}function sj(s,e=!1){e&&(s=s.map(function(n){return n.toLowerCase()}));const t=zEe(s);return e?function(n){return t[n.toLowerCase()]!==void 0&&t.hasOwnProperty(n.toLowerCase())}:function(n){return t[n]!==void 0&&t.hasOwnProperty(n)}}function dO(s,e,t){e=e.replace(/@@/g,"");let n=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,a){i=!0;let l="";if(typeof s[a]=="string")l=s[a];else if(s[a]&&s[a]instanceof RegExp)l=s[a].source;else throw s[a]===void 0?Nt(s,"language definition does not contain attribute '"+a+"', used at: "+e):Nt(s,"attribute reference '"+a+"' must be a string, used at: "+e);return Oh(l)?"":"(?:"+l+")"}),n++;while(i&&n<5);e=e.replace(/\x01/g,"@");const r=(s.ignoreCase?"i":"")+(s.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(Rde(s,e,c),r)),l)}return new RegExp(e,r)}function $Ee(s,e,t,n){if(n<0)return s;if(n<e.length)return e[n];if(n>=100){n=n-100;const i=t.split(".");if(i.unshift(t),n<i.length)return i[n]}return null}function UEe(s,e,t,n){let i=-1,r=t,o=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);o&&(o[3]&&(i=parseInt(o[3]),o[2]&&(i=i+100)),r=o[4]);let a="~",l=r;!r||r.length===0?(a="!=",l=""):/^\w*$/.test(l)?a="==":(o=r.match(/^(@|!@|~|!~|==|!=)(.*)$/),o&&(a=o[1],l=o[2]));let c;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(l)){const d=sj(l.split("|"),s.ignoreCase);c=function(h){return a==="~"?d(h):!d(h)}}else if(a==="@"||a==="!@"){const d=s[l];if(!d)throw Nt(s,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!HEe(function(u){return typeof u=="string"},d))throw Nt(s,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const h=sj(d,s.ignoreCase);c=function(u){return a==="@"?h(u):!h(u)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const d=dO(s,"^"+l+"$",!1);c=function(h){return a==="~"?d.test(h):!d.test(h)}}else c=function(d,h,u,f){return dO(s,"^"+Jc(s,l,h,u,f)+"$",!1).test(d)};else if(l.indexOf("$")<0){const d=Il(s,l);c=function(h){return a==="=="?h===d:h!==d}}else{const d=Il(s,l);c=function(h,u,f,g,p){const m=Jc(s,d,u,f,g);return a==="=="?h===m:h!==m}}return i===-1?{name:t,value:n,test:function(d,h,u,f){return c(d,d,h,u,f)}}:{name:t,value:n,test:function(d,h,u,f){const g=$Ee(d,h,u,i);return c(g||"",d,h,u,f)}}}function hO(s,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw Nt(s,"a 'token' attribute must be of type string, in rule: "+e);{const n={token:t.token};if(t.token.indexOf("$")>=0&&(n.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")n.bracket=1;else if(t.bracket==="@close")n.bracket=-1;else throw Nt(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Nt(s,"the next state must be a string value in rule: "+e);{let i=t.next;if(!/^(@pop|@push|@popall)$/.test(i)&&(i[0]==="@"&&(i=i.substr(1)),i.indexOf("$")<0&&!Ade(s,Jc(s,i,"",[],""))))throw Nt(s,"the next state '"+t.next+"' is not defined in rule: "+e);n.next=i}}return typeof t.goBack=="number"&&(n.goBack=t.goBack),typeof t.switchTo=="string"&&(n.switchTo=t.switchTo),typeof t.log=="string"&&(n.log=t.log),typeof t.nextEmbedded=="string"&&(n.nextEmbedded=t.nextEmbedded,s.usesEmbedded=!0),n}}else if(Array.isArray(t)){const n=[];for(let i=0,r=t.length;i<r;i++)n[i]=hO(s,e,t[i]);return{group:n}}else if(t.cases){const n=[];let i=!1;for(const o in t.cases)if(t.cases.hasOwnProperty(o)){const a=hO(s,e,t.cases[o]);o==="@default"||o==="@"||o===""?n.push({test:void 0,value:a,name:o}):o==="@eos"?n.push({test:function(l,c,d,h){return h},value:a,name:o}):n.push(UEe(s,e,o,a)),i||(i=!Yn(a)&&(a.hasEmbeddedEndInCases||["@pop","@popall"].includes(a.nextEmbedded||"")))}const r=s.defaultToken;return{hasEmbeddedEndInCases:i,test:function(o,a,l,c){for(const d of n)if(!d.test||d.test(o,a,l,c))return d.value;return r}}}else throw Nt(s,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}class jEe{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let n;if(typeof t=="string")n=t;else if(t instanceof RegExp)n=t.source;else throw Nt(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=n.length>0&&n[0]==="^",this.name=this.name+": "+n,this.regex=dO(e,"^(?:"+(this.matchOnlyAtLineStart?n.substr(1):n)+")",!0)}setAction(e,t){this.action=hO(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function rj(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:s,includeLF:XS(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:XS(e.ignoreCase,!1),unicode:XS(e.unicode,!1),tokenPostfix:ij(e.tokenPostfix,"."+s),defaultToken:ij(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},n=e;n.languageId=s,n.includeLF=t.includeLF,n.ignoreCase=t.ignoreCase,n.unicode=t.unicode,n.noThrow=t.noThrow,n.usesEmbedded=t.usesEmbedded,n.stateNames=e.tokenizer,n.defaultToken=t.defaultToken;function i(o,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Nt(t,"an 'include' attribute must be a string at: "+o);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Nt(t,"include target '"+d+"' is not defined at: "+o);i(o+"."+d,a,e.tokenizer[d])}else{const h=new jEe(o);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(n,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(n,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const u=c[1];u.next=c[2],h.setAction(n,u)}else throw Nt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+o);else h.setAction(n,c[1]);else{if(!c.regex)throw Nt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+o);c.name&&typeof c.name=="string"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=XS(c.matchOnlyAtLineStart,!1)),h.setRegex(n,c.regex),h.setAction(n,c.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Nt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const o in e.tokenizer)if(e.tokenizer.hasOwnProperty(o)){t.start||(t.start=o);const a=e.tokenizer[o];t.tokenizer[o]=new Array,i("tokenizer."+o,t.tokenizer[o],a)}if(t.usesEmbedded=n.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Nt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const r=[];for(const o of e.brackets){let a=o;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Nt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+`
|