diff --git a/TODO b/TODO index 62096e1..3c081be 100644 --- a/TODO +++ b/TODO @@ -9,13 +9,13 @@ - [X] Add `Code` renderer to syntax highlight quines or other code output. - [X] Responsive view - [X] Fix the mime selector as that has some undesirable behaviour when editing at the moment. +- [X] Add Ruby (https://runrb.io/) - [ ] Check a bunch of existing answers and fix what's broken - [ ] Verify `LICENSE`s before adding one here - [ ] Clean up the used `webperl` implementation (to make updating easier) - [ ] Add different versions of Perl (older versions supporting `?..?` in `s///`, literal `$^V`, etc) - [ ] Add PHP (https://github.com/oraoto/pib) -- [ ] Add Ruby (https://runrb.io/) -- [ ] Add Python (https://pyodide.org/) +- [-] Add Python (https://pyodide.org/) - [ ] Add C#? (https://blazor.net/) - [ ] Maybe add bash via jslinux somehow? (https://bellard.org/jslinux/) - [ ] Accessibility (aria-label of all fields etc) diff --git a/coi-serviceworker.js b/coi-serviceworker.js new file mode 100644 index 0000000..96ff44a --- /dev/null +++ b/coi-serviceworker.js @@ -0,0 +1,7 @@ +var i=!1;typeof window>"u"?(self.addEventListener("install",()=>self.skipWaiting()),self.addEventListener("activate",e=>e.waitUntil(self.clients.claim())),self.addEventListener("message",e=>{if(e.data)e.data.type==="deregister"?self.registration.unregister().then(()=>self.clients.matchAll()).then(r=>{r.forEach(t=>t.navigate(t.url))}):e.data.type==="coepCredentialless"&&(i=e.data.value);else return}),self.addEventListener("fetch",function(e){let r=e.request;if(r.cache==="only-if-cached"&&r.mode!=="same-origin")return;let t=i&&r.mode==="no-cors"?new Request(r,{credentials:"omit"}):r;e.respondWith(fetch(t).then(s=>{if(s.status===0)return s;let o=new Headers(s.headers);return o.set("Cross-Origin-Embedder-Policy",i?"credentialless":"require-corp"),i||o.set("Cross-Origin-Resource-Policy","cross-origin"),o.set("Cross-Origin-Opener-Policy","same-origin"),new Response(s.body,{status:s.status,statusText:s.statusText,headers:o})}).catch(s=>console.error(s)))})):(()=>{let e={shouldRegister:()=>!0,shouldDeregister:()=>!1,coepCredentialless:()=>!(window.chrome||window.netscape),doReload:()=>window.location.reload(),quiet:!1,...window.coi},r=navigator;if(r.serviceWorker&&r.serviceWorker.controller&&(r.serviceWorker.controller.postMessage({type:"coepCredentialless",value:e.coepCredentialless()}),e.shouldDeregister()&&r.serviceWorker.controller.postMessage({type:"deregister"})),!(window.crossOriginIsolated!==!1||!e.shouldRegister())){if(!window.isSecureContext){!e.quiet&&console.log("COOP/COEP Service Worker not registered, a secure context is required.");return}r.serviceWorker&&r.serviceWorker.register(window.document.currentScript.src).then(t=>{!e.quiet&&console.log("COOP/COEP Service Worker registered",t.scope),t.addEventListener("updatefound",()=>{!e.quiet&&console.log("Reloading page to make use of updated COOP/COEP Service Worker."),e.doReload()}),t.active&&!r.serviceWorker.controller&&(!e.quiet&&console.log("Reloading page to make use of COOP/COEP Service Worker."),e.doReload())},t=>{!e.quiet&&console.error("COOP/COEP Service Worker failed to register:",t)})}})(); +/*! Bundled license information: + +coi-serviceworker/coi-serviceworker.js: + (*! coi-serviceworker v0.1.7 - Guido Zuidhof and contributors, licensed under MIT *) +*/ +//# sourceMappingURL=coi-serviceworker.js.map diff --git a/coi-serviceworker.js.map b/coi-serviceworker.js.map new file mode 100644 index 0000000..7b901e1 --- /dev/null +++ b/coi-serviceworker.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["node_modules/coi-serviceworker/coi-serviceworker.js"], + "sourcesContent": ["/*! coi-serviceworker v0.1.7 - Guido Zuidhof and contributors, licensed under MIT */\nlet coepCredentialless = false;\nif (typeof window === 'undefined') {\n self.addEventListener(\"install\", () => self.skipWaiting());\n self.addEventListener(\"activate\", (event) => event.waitUntil(self.clients.claim()));\n\n self.addEventListener(\"message\", (ev) => {\n if (!ev.data) {\n return;\n } else if (ev.data.type === \"deregister\") {\n self.registration\n .unregister()\n .then(() => {\n return self.clients.matchAll();\n })\n .then(clients => {\n clients.forEach((client) => client.navigate(client.url));\n });\n } else if (ev.data.type === \"coepCredentialless\") {\n coepCredentialless = ev.data.value;\n }\n });\n\n self.addEventListener(\"fetch\", function (event) {\n const r = event.request;\n if (r.cache === \"only-if-cached\" && r.mode !== \"same-origin\") {\n return;\n }\n\n const request = (coepCredentialless && r.mode === \"no-cors\")\n ? new Request(r, {\n credentials: \"omit\",\n })\n : r;\n event.respondWith(\n fetch(request)\n .then((response) => {\n if (response.status === 0) {\n return response;\n }\n\n const newHeaders = new Headers(response.headers);\n newHeaders.set(\"Cross-Origin-Embedder-Policy\",\n coepCredentialless ? \"credentialless\" : \"require-corp\"\n );\n if (!coepCredentialless) {\n newHeaders.set(\"Cross-Origin-Resource-Policy\", \"cross-origin\");\n }\n newHeaders.set(\"Cross-Origin-Opener-Policy\", \"same-origin\");\n\n return new Response(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers: newHeaders,\n });\n })\n .catch((e) => console.error(e))\n );\n });\n\n} else {\n (() => {\n // You can customize the behavior of this script through a global `coi` variable.\n const coi = {\n shouldRegister: () => true,\n shouldDeregister: () => false,\n coepCredentialless: () => !(window.chrome || window.netscape),\n doReload: () => window.location.reload(),\n quiet: false,\n ...window.coi\n };\n\n const n = navigator;\n\n if (n.serviceWorker && n.serviceWorker.controller) {\n n.serviceWorker.controller.postMessage({\n type: \"coepCredentialless\",\n value: coi.coepCredentialless(),\n });\n\n if (coi.shouldDeregister()) {\n n.serviceWorker.controller.postMessage({ type: \"deregister\" });\n }\n }\n\n // If we're already coi: do nothing. Perhaps it's due to this script doing its job, or COOP/COEP are\n // already set from the origin server. Also if the browser has no notion of crossOriginIsolated, just give up here.\n if (window.crossOriginIsolated !== false || !coi.shouldRegister()) return;\n\n if (!window.isSecureContext) {\n !coi.quiet && console.log(\"COOP/COEP Service Worker not registered, a secure context is required.\");\n return;\n }\n\n // In some environments (e.g. Chrome incognito mode) this won't be available\n if (n.serviceWorker) {\n n.serviceWorker.register(window.document.currentScript.src).then(\n (registration) => {\n !coi.quiet && console.log(\"COOP/COEP Service Worker registered\", registration.scope);\n\n registration.addEventListener(\"updatefound\", () => {\n !coi.quiet && console.log(\"Reloading page to make use of updated COOP/COEP Service Worker.\");\n coi.doReload();\n });\n\n // If the registration is active, but it's not controlling the page\n if (registration.active && !n.serviceWorker.controller) {\n !coi.quiet && console.log(\"Reloading page to make use of COOP/COEP Service Worker.\");\n coi.doReload();\n }\n },\n (err) => {\n !coi.quiet && console.error(\"COOP/COEP Service Worker failed to register:\", err);\n }\n );\n }\n })();\n}\n"], + "mappings": "AACA,IAAIA,EAAqB,GACrB,OAAO,OAAW,KAClB,KAAK,iBAAiB,UAAW,IAAM,KAAK,YAAY,CAAC,EACzD,KAAK,iBAAiB,WAAaC,GAAUA,EAAM,UAAU,KAAK,QAAQ,MAAM,CAAC,CAAC,EAElF,KAAK,iBAAiB,UAAYC,GAAO,CACrC,GAAKA,EAAG,KAEGA,EAAG,KAAK,OAAS,aACxB,KAAK,aACA,WAAW,EACX,KAAK,IACK,KAAK,QAAQ,SAAS,CAChC,EACA,KAAKC,GAAW,CACbA,EAAQ,QAASC,GAAWA,EAAO,SAASA,EAAO,GAAG,CAAC,CAC3D,CAAC,EACEF,EAAG,KAAK,OAAS,uBACxBF,EAAqBE,EAAG,KAAK,WAX7B,OAaR,CAAC,EAED,KAAK,iBAAiB,QAAS,SAAUD,EAAO,CAC5C,IAAM,EAAIA,EAAM,QAChB,GAAI,EAAE,QAAU,kBAAoB,EAAE,OAAS,cAC3C,OAGJ,IAAMI,EAAWL,GAAsB,EAAE,OAAS,UAC5C,IAAI,QAAQ,EAAG,CACb,YAAa,MACjB,CAAC,EACC,EACNC,EAAM,YACF,MAAMI,CAAO,EACR,KAAMC,GAAa,CAChB,GAAIA,EAAS,SAAW,EACpB,OAAOA,EAGX,IAAMC,EAAa,IAAI,QAAQD,EAAS,OAAO,EAC/C,OAAAC,EAAW,IAAI,+BACXP,EAAqB,iBAAmB,cAC5C,EACKA,GACDO,EAAW,IAAI,+BAAgC,cAAc,EAEjEA,EAAW,IAAI,6BAA8B,aAAa,EAEnD,IAAI,SAASD,EAAS,KAAM,CAC/B,OAAQA,EAAS,OACjB,WAAYA,EAAS,WACrB,QAASC,CACb,CAAC,CACL,CAAC,EACA,MAAOC,GAAM,QAAQ,MAAMA,CAAC,CAAC,CACtC,CACJ,CAAC,IAGA,IAAM,CAEH,IAAMC,EAAM,CACR,eAAgB,IAAM,GACtB,iBAAkB,IAAM,GACxB,mBAAoB,IAAM,EAAE,OAAO,QAAU,OAAO,UACpD,SAAU,IAAM,OAAO,SAAS,OAAO,EACvC,MAAO,GACP,GAAG,OAAO,GACd,EAEMC,EAAI,UAeV,GAbIA,EAAE,eAAiBA,EAAE,cAAc,aACnCA,EAAE,cAAc,WAAW,YAAY,CACnC,KAAM,qBACN,MAAOD,EAAI,mBAAmB,CAClC,CAAC,EAEGA,EAAI,iBAAiB,GACrBC,EAAE,cAAc,WAAW,YAAY,CAAE,KAAM,YAAa,CAAC,GAMjE,SAAO,sBAAwB,IAAS,CAACD,EAAI,eAAe,GAEhE,IAAI,CAAC,OAAO,gBAAiB,CACzB,CAACA,EAAI,OAAS,QAAQ,IAAI,wEAAwE,EAClG,MACJ,CAGIC,EAAE,eACFA,EAAE,cAAc,SAAS,OAAO,SAAS,cAAc,GAAG,EAAE,KACvDC,GAAiB,CACd,CAACF,EAAI,OAAS,QAAQ,IAAI,sCAAuCE,EAAa,KAAK,EAEnFA,EAAa,iBAAiB,cAAe,IAAM,CAC/C,CAACF,EAAI,OAAS,QAAQ,IAAI,iEAAiE,EAC3FA,EAAI,SAAS,CACjB,CAAC,EAGGE,EAAa,QAAU,CAACD,EAAE,cAAc,aACxC,CAACD,EAAI,OAAS,QAAQ,IAAI,yDAAyD,EACnFA,EAAI,SAAS,EAErB,EACCG,GAAQ,CACL,CAACH,EAAI,OAAS,QAAQ,MAAM,+CAAgDG,CAAG,CACnF,CACJ,EAER,GAAG", + "names": ["coepCredentialless", "event", "ev", "clients", "client", "request", "response", "newHeaders", "e", "coi", "n", "registration", "err"] +} diff --git a/dist/js/app.js b/dist/js/app.js index 23cb059..690be35 100644 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -1,47 +1,49 @@ -(()=>{var Vu=Object.create;var bl=Object.defineProperty;var $u=Object.getOwnPropertyDescriptor;var Ju=Object.getOwnPropertyNames;var Qu=Object.getPrototypeOf,ef=Object.prototype.hasOwnProperty;var wr=(G,H)=>()=>(H||G((H={exports:{}}).exports,H),H.exports);var tf=(G,H,D,f)=>{if(H&&typeof H=="object"||typeof H=="function")for(let E of Ju(H))!ef.call(G,E)&&E!==D&&bl(G,E,{get:()=>H[E],enumerable:!(f=$u(H,E))||f.enumerable});return G};var ir=(G,H,D)=>(D=G!=null?Vu(Qu(G)):{},tf(H||!G||!G.__esModule?bl(D,"default",{value:G,enumerable:!0}):D,G));var Lr=wr((hs,ds)=>{(function(G,H){typeof hs=="object"&&typeof ds<"u"?ds.exports=H():typeof define=="function"&&define.amd?define(H):(G=G||self,G.CodeMirror=H())})(hs,function(){"use strict";var G=navigator.userAgent,H=navigator.platform,D=/gecko\/\d/i.test(G),f=/MSIE \d/.test(G),E=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(G),m=/Edge\/(\d+)/.exec(G),y=f||E||m,_=y&&(f?document.documentMode||6:+(m||E)[1]),g=!m&&/WebKit\//.test(G),k=g&&/Qt\/\d+\.\d+/.test(G),C=!m&&/Chrome\/(\d+)/.exec(G),u=C&&+C[1],v=/Opera\//.test(G),L=/Apple Computer/.test(navigator.vendor),b=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(G),c=/PhantomJS/.test(G),n=L&&(/Mobile\/\w+/.test(G)||navigator.maxTouchPoints>2),l=/Android/.test(G),o=n||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(G),a=n||/Mac/.test(H),d=/\bCrOS\b/.test(G),h=/win/i.test(H),S=v&&G.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(v=!1,g=!0);var A=a&&(k||v&&(S==null||S<12.11)),x=D||y&&_>=9;function M(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var O=function(e,t){var i=e.className,r=M(t).exec(i);if(r){var s=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(s?r[1]+s:"")}};function I(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function P(e,t){return I(e).appendChild(t)}function T(e,t,i,r){var s=document.createElement(e);if(i&&(s.className=i),r&&(s.style.cssText=r),typeof t=="string")s.appendChild(document.createTextNode(t));else if(t)for(var p=0;p=t)return w+(t-p);w+=R-p,w+=i-w%i,p=R+1}}var Ie=function(){this.id=null,this.f=null,this.time=0,this.handler=he(this.onTimeout,this)};Ie.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ie.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(w,t-s);if(s+=p-r,s+=i-s%i,r=p+1,s>=t)return r}}var De=[""];function je(e){for(;De.length<=e;)De.push(Re(De)+" ");return De[e]}function Re(e){return e[e.length-1]}function Xe(e,t){for(var i=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Xt.test(e))}function nr(e,t){return t?t.source.indexOf("\\w")>-1&&gr(e)?!0:t.test(e):gr(e)}function ni(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var or=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ze(e){return e.charCodeAt(0)>=768&&or.test(e)}function _r(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var s=(t+i)/2,p=r<0?Math.ceil(s):Math.floor(s);if(p==t)return e(p)?t:i;e(p)?i=p:t=p+r}}function sr(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var s=!1,p=0;pt||t==i&&w.to==t)&&(r(Math.max(w.from,t),Math.min(w.to,i),w.level==1?"rtl":"ltr",p),s=!0)}s||r(t,i,"ltr")}var yr=null;function ar(e,t,i){var r;yr=null;for(var s=0;st)return s;p.to==t&&(p.from!=p.to&&i=="before"?r=s:yr=s),p.from==t&&(p.from!=p.to&&i!="before"?r=s:yr=s)}return r??yr}var oi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(F){return F<=247?e.charAt(F):1424<=F&&F<=1524?"R":1536<=F&&F<=1785?t.charAt(F-1536):1774<=F&&F<=2220?"r":8192<=F&&F<=8203?"w":F==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,s=/[stwN]/,p=/[LRr]/,w=/[Lb1n]/,R=/[1n]/;function B(F,q,X){this.level=F,this.from=q,this.to=X}return function(F,q){var X=q=="ltr"?"L":"R";if(F.length==0||q=="ltr"&&!r.test(F))return!1;for(var Q=F.length,J=[],ie=0;ie-1&&(r[t]=s.slice(0,p).concat(s.slice(p+1)))}}}function Ue(e,t){var i=Yt(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),s=0;s0}function Rt(e){e.prototype.on=function(t,i){Te(this,t,i)},e.prototype.off=function(t,i){et(this,t,i)}}function tt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function lt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function lr(e){tt(e),xr(e)}function Ir(e){return e.target||e.srcElement}function Ot(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var si=function(){if(y&&_<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}(),kr;function Zr(e){if(kr==null){var t=T("span","\u200B");P(e,T("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(kr=t.offsetWidth<=1&&t.offsetHeight>2&&!(y&&_<8))}var i=kr?T("span","\u200B"):T("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Hr;function cr(e){if(Hr!=null)return Hr;var t=P(e,document.createTextNode("A\u062EA")),i=N(t,0,1).getBoundingClientRect(),r=N(t,1,2).getBoundingClientRect();return I(e),!i||i.left==i.right?!1:Hr=r.right-i.right<3}var Et=` +var Ef=Object.create;var Pl=Object.defineProperty;var Tf=Object.getOwnPropertyDescriptor;var Af=Object.getOwnPropertyNames;var Mf=Object.getPrototypeOf,Rf=Object.prototype.hasOwnProperty;var Nt=(U,B)=>()=>(B||U((B={exports:{}}).exports,B),B.exports);var Of=(U,B,R,f)=>{if(B&&typeof B=="object"||typeof B=="function")for(let k of Af(B))!Rf.call(U,k)&&k!==R&&Pl(U,k,{get:()=>B[k],enumerable:!(f=Tf(B,k))||f.enumerable});return U};var kt=(U,B,R)=>(R=U!=null?Ef(Mf(U)):{},Of(B||!U||!U.__esModule?Pl(R,"default",{value:U,enumerable:!0}):R,U));var Wl=Nt((Jf,_s)=>{"use strict";var Pf=Object.prototype.hasOwnProperty,Vt="~";function jn(){}Object.create&&(jn.prototype=Object.create(null),new jn().__proto__||(Vt=!1));function If(U,B,R){this.fn=U,this.context=B,this.once=R||!1}function Fl(U,B,R,f,k){if(typeof R!="function")throw new TypeError("The listener must be a function");var m=new If(R,f||U,k),y=Vt?Vt+B:B;return U._events[y]?U._events[y].fn?U._events[y]=[U._events[y],m]:U._events[y].push(m):(U._events[y]=m,U._eventsCount++),U}function go(U,B){--U._eventsCount===0?U._events=new jn:delete U._events[B]}function jt(){this._events=new jn,this._eventsCount=0}jt.prototype.eventNames=function(){var B=[],R,f;if(this._eventsCount===0)return B;for(f in R=this._events)Pf.call(R,f)&&B.push(Vt?f.slice(1):f);return Object.getOwnPropertySymbols?B.concat(Object.getOwnPropertySymbols(R)):B};jt.prototype.listeners=function(B){var R=Vt?Vt+B:B,f=this._events[R];if(!f)return[];if(f.fn)return[f.fn];for(var k=0,m=f.length,y=new Array(m);k{(function(U,B){typeof ws=="object"&&typeof Ls<"u"?Ls.exports=B():typeof define=="function"&&define.amd?define(B):(U=U||self,U.CodeMirror=B())})(ws,function(){"use strict";var U=navigator.userAgent,B=navigator.platform,R=/gecko\/\d/i.test(U),f=/MSIE \d/.test(U),k=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(U),m=/Edge\/(\d+)/.exec(U),y=f||k||m,_=y&&(f?document.documentMode||6:+(m||k)[1]),g=!m&&/WebKit\//.test(U),x=g&&/Qt\/\d+\.\d+/.test(U),C=!m&&/Chrome\/(\d+)/.exec(U),u=C&&+C[1],p=/Opera\//.test(U),w=/Apple Computer/.test(navigator.vendor),b=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(U),c=/PhantomJS/.test(U),o=w&&(/Mobile\/\w+/.test(U)||navigator.maxTouchPoints>2),l=/Android/.test(U),n=o||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(U),a=o||/Mac/.test(B),h=/\bCrOS\b/.test(U),d=/win/i.test(B),S=p&&U.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(p=!1,g=!0);var T=a&&(x||p&&(S==null||S<12.11)),E=R||y&&_>=9;function M(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var D=function(e,t){var i=e.className,r=M(t).exec(i);if(r){var s=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(s?r[1]+s:"")}};function W(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function I(e,t){return W(e).appendChild(t)}function A(e,t,i,r){var s=document.createElement(e);if(i&&(s.className=i),r&&(s.style.cssText=r),typeof t=="string")s.appendChild(document.createTextNode(t));else if(t)for(var v=0;v=t)return L+(t-v);L+=O-v,L+=i-L%i,v=O+1}}var Ie=function(){this.id=null,this.f=null,this.time=0,this.handler=de(this.onTimeout,this)};Ie.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ie.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(L,t-s);if(s+=v-r,s+=i-s%i,r=v+1,s>=t)return r}}var De=[""];function je(e){for(;De.length<=e;)De.push(Re(De)+" ");return De[e]}function Re(e){return e[e.length-1]}function Ze(e,t){for(var i=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Jt.test(e))}function lr(e,t){return t?t.source.indexOf("\\w")>-1&&br(e)?!0:t.test(e):br(e)}function ai(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var cr=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Xe(e){return e.charCodeAt(0)>=768&&cr.test(e)}function Sr(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var s=(t+i)/2,v=r<0?Math.ceil(s):Math.floor(s);if(v==t)return e(v)?t:i;e(v)?i=v:t=v+r}}function ur(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var s=!1,v=0;vt||t==i&&L.to==t)&&(r(Math.max(L.from,t),Math.min(L.to,i),L.level==1?"rtl":"ltr",v),s=!0)}s||r(t,i,"ltr")}var Cr=null;function fr(e,t,i){var r;Cr=null;for(var s=0;st)return s;v.to==t&&(v.from!=v.to&&i=="before"?r=s:Cr=s),v.from==t&&(v.from!=v.to&&i!="before"?r=s:Cr=s)}return r??Cr}var li=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(N){return N<=247?e.charAt(N):1424<=N&&N<=1524?"R":1536<=N&&N<=1785?t.charAt(N-1536):1774<=N&&N<=2220?"r":8192<=N&&N<=8203?"w":N==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,s=/[stwN]/,v=/[LRr]/,L=/[Lb1n]/,O=/[1n]/;function P(N,K,X){this.level=N,this.from=K,this.to=X}return function(N,K){var X=K=="ltr"?"L":"R";if(N.length==0||K=="ltr"&&!r.test(N))return!1;for(var Q=N.length,J=[],oe=0;oe-1&&(r[t]=s.slice(0,v).concat(s.slice(v+1)))}}}function ze(e,t){var i=er(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),s=0;s0}function Ot(e){e.prototype.on=function(t,i){Te(this,t,i)},e.prototype.off=function(t,i){et(this,t,i)}}function tt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Tr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function lt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function hr(e){tt(e),Tr(e)}function Wr(e){return e.target||e.srcElement}function Dt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var ci=function(){if(y&&_<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}(),Ar;function $r(e){if(Ar==null){var t=A("span","\u200B");I(e,A("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ar=t.offsetWidth<=1&&t.offsetHeight>2&&!(y&&_<8))}var i=Ar?A("span","\u200B"):A("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Nr;function dr(e){if(Nr!=null)return Nr;var t=I(e,document.createTextNode("A\u062EA")),i=F(t,0,1).getBoundingClientRect(),r=F(t,1,2).getBoundingClientRect();return W(e),!i||i.left==i.right?!1:Nr=r.right-i.right<3}var Tt=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var s=e.indexOf(` -`,t);s==-1&&(s=e.length);var p=e.slice(t,e.charAt(s-1)=="\r"?s-1:s),w=p.indexOf("\r");w!=-1?(i.push(p.slice(0,w)),t+=w+1):(i.push(p),t=s+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ur=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Yr=function(){var e=T("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Dt=null;function ai(e){if(Dt!=null)return Dt;var t=P(e,T("span","x")),i=t.getBoundingClientRect(),r=N(t,0,1).getBoundingClientRect();return Dt=Math.abs(i.left-r.left)>1}var Er={},Bt={};function Pt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Er[e]=t}function mr(e,t){Bt[e]=t}function Tr(e){if(typeof e=="string"&&Bt.hasOwnProperty(e))e=Bt[e];else if(e&&typeof e.name=="string"&&Bt.hasOwnProperty(e.name)){var t=Bt[e.name];typeof t=="string"&&(t={name:t}),e=dt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ar(e,t){t=Tr(t);var i=Er[t.name];if(!i)return Ar(e,"text/plain");var r=i(e,t);if(fr.hasOwnProperty(t.name)){var s=fr[t.name];for(var p in s)s.hasOwnProperty(p)&&(r.hasOwnProperty(p)&&(r["_"+p]=r[p]),r[p]=s[p])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var w in t.modeProps)r[w]=t.modeProps[w];return r}var fr={};function Mr(e,t){var i=fr.hasOwnProperty(e)?fr[e]:fr[e]={};ke(t,i)}function Wt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var s=t[r];s instanceof Array&&(s=s.concat([])),i[r]=s}return i}function Fr(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Rr(e,t,i){return e.startState?e.startState(t,i):!0}var qe=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.post},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos0?null:(p&&t!==!1&&(this.pos+=p[0].length),p)}},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Le(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var s=i.children[r],p=s.chunkSize();if(t=e.first&&ti?te(i,Le(e,i).text.length):ln(t,Le(e,t.line).text.length)}function ln(e,t){var i=e.ch;return i==null||i>t?te(e.line,t):i<0?te(e.line,0):e}function Hi(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},$t.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},$t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$t.fromSaved=function(e,t,i){return t instanceof li?new $t(e,Wt(e.mode,t.state),i,t.lookAhead):new $t(e,Wt(e.mode,t),i)},$t.prototype.save=function(e){var t=e!==!1?Wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new li(t,this.maxLookAhead):t};function Fi(e,t,i,r){var s=[e.state.modeGen],p={};hn(e,t.text,e.doc.mode,i,function(F,q){return s.push(F,q)},p,r);for(var w=i.state,R=function(F){i.baseTokens=s;var q=e.state.overlays[F],X=1,Q=0;i.state=!0,hn(e,t.text,q.mode,i,function(J,ie){for(var ce=X;QJ&&s.splice(X,1,J,s[X+1],de),X+=2,Q=Math.min(J,de)}if(ie)if(q.opaque)s.splice(ce,X-ce,J,"overlay "+ie),X=ce+2;else for(;cee.options.maxHighlightLength&&Wt(e.doc.mode,r.state),p=Fi(e,t,r);s&&(r.state=s),t.stateAfter=r.save(!s),t.styles=p.styles,p.classes?t.styleClasses=p.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Vr(e,t,i){var r=e.doc,s=e.display;if(!r.mode.startState)return new $t(r,!0,t);var p=Wn(e,t,i),w=p>r.first&&Le(r,p-1).stateAfter,R=w?$t.fromSaved(r,w,p):new $t(r,Rr(r.mode),p);return r.iter(p,t,function(B){mi(e,B.text,R);var F=R.line;B.stateAfter=F==t-1||F%5==0||F>=s.viewFrom&&Ft.start)return p}throw new Error("Mode "+e.name+" failed to advance stream.")}var un=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Fn(e,t,i,r){var s=e.doc,p=s.mode,w;t=Oe(s,t);var R=Le(s,t.line),B=Vr(e,t.line,i),F=new qe(R.text,e.options.tabSize,B),q;for(r&&(q=[]);(r||F.pose.options.maxHighlightLength?(R=!1,w&&mi(e,t,r,q.pos),q.pos=t.length,X=null):X=fn(bi(i,q,r.state,Q),p),Q){var J=Q[0].name;J&&(X="m-"+(X?J+" "+X:J))}if(!R||F!=X){for(;Bw;--R){if(R<=p.first)return p.first;var B=Le(p,R-1),F=B.stateAfter;if(F&&(!i||R+(F instanceof li?F.lookAhead:0)<=p.modeFrontier))return R;var q=$(B.text,null,e.options.tabSize);(s==null||r>q)&&(s=R-1,r=q)}return s}function Nn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var s=Le(e,r).stateAfter;if(s&&(!(s instanceof li)||r+s.lookAhead=t:p.to>t);(r||(r=[])).push(new Nt(w,p.from,B?null:p.to))}}return r}function Si(e,t,i){var r;if(e)for(var s=0;s=t:p.to>t);if(R||p.from==t&&w.type=="bookmark"&&(!i||p.marker.insertLeft)){var B=p.from==null||(w.inclusiveLeft?p.from<=t:p.from0&&R)for(var Ce=0;Ce0)){var q=[B,1],X=be(F.from,R.from),Q=be(F.to,R.to);(X<0||!w.inclusiveLeft&&!X)&&q.push({from:F.from,to:R.from}),(Q>0||!w.inclusiveRight&&!Q)&&q.push({from:R.to,to:F.to}),s.splice.apply(s,q),B+=q.length-3}}return s}function jr(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||ct(r,p.marker)<0)&&(r=p.marker)}return r}function dr(e,t,i,r,s){var p=Le(e,t),w=ee&&p.markedSpans;if(w)for(var R=0;R=0&&X<=0||q<=0&&X>=0)&&(q<=0&&(B.marker.inclusiveRight&&s.inclusiveLeft?be(F.to,i)>=0:be(F.to,i)>0)||q>=0&&(B.marker.inclusiveRight&&s.inclusiveLeft?be(F.from,r)<=0:be(F.from,r)<0)))return!0}}}function yt(e){for(var t;t=_t(e);)e=t.find(-1,!0).line;return e}function pr(e){for(var t;t=ut(e);)e=t.find(1,!0).line;return e}function ci(e){for(var t,i;t=ut(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Sr(e,t){var i=Le(e,t),r=yt(i);return i==r?t:W(r)}function Cr(e,t){if(t>e.lastLine())return t;var i=Le(e,t),r;if(!jt(e,i))return t;for(;r=ut(i);)i=r.find(1,!0).line;return W(i)+1}function jt(e,t){var i=ee&&t.markedSpans;if(i){for(var r=void 0,s=0;st.maxLineLength&&(t.maxLineLength=s,t.maxLine=r)})}var Ni=function(e,t,i){this.text=e,Or(this,t),this.height=i?i(this):1};Ni.prototype.lineNo=function(){return W(this)},Rt(Ni);function uc(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),jr(e),Or(e,i);var s=r?r(e):1;s!=e.height&&Lt(e,s)}function fc(e){e.parent=null,jr(e)}var hc={},dc={};function Fs(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?dc:hc;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ws(e,t){var i=j("span",null,null,g?"padding-right: .1px":null),r={pre:j("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var s=0;s<=(t.rest?t.rest.length:0);s++){var p=s?t.rest[s-1]:t.line,w=void 0;r.pos=0,r.addToken=vc,cr(e.display.measure)&&(w=Be(p,e.doc.direction))&&(r.addToken=_c(r.addToken,w)),r.map=[];var R=t!=e.display.externalMeasured&&W(p);yc(p,r,Wi(e,p,R)),p.styleClasses&&(p.styleClasses.bgClass&&(r.bgClass=ue(p.styleClasses.bgClass,r.bgClass||"")),p.styleClasses.textClass&&(r.textClass=ue(p.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Zr(e.display.measure))),s==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(g){var B=r.content.lastChild;(/\bcm-tab\b/.test(B.className)||B.querySelector&&B.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ue(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=ue(r.pre.className,r.textClass||"")),r}function pc(e){var t=T("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vc(e,t,i,r,s,p,w){if(t){var R=e.splitSpaces?gc(t,e.trailingSpace):t,B=e.cm.state.specialChars,F=!1,q;if(!B.test(t))e.col+=t.length,q=document.createTextNode(R),e.map.push(e.pos,e.pos+t.length,q),y&&_<9&&(F=!0),e.pos+=t.length;else{q=document.createDocumentFragment();for(var X=0;;){B.lastIndex=X;var Q=B.exec(t),J=Q?Q.index-X:t.length-X;if(J){var ie=document.createTextNode(R.slice(X,X+J));y&&_<9?q.appendChild(T("span",[ie])):q.appendChild(ie),e.map.push(e.pos,e.pos+J,ie),e.col+=J,e.pos+=J}if(!Q)break;X+=J+1;var ce=void 0;if(Q[0]==" "){var de=e.cm.options.tabSize,ye=de-e.col%de;ce=q.appendChild(T("span",je(ye),"cm-tab")),ce.setAttribute("role","presentation"),ce.setAttribute("cm-text"," "),e.col+=ye}else Q[0]=="\r"||Q[0]==` -`?(ce=q.appendChild(T("span",Q[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ce.setAttribute("cm-text",Q[0]),e.col+=1):(ce=e.cm.options.specialCharPlaceholder(Q[0]),ce.setAttribute("cm-text",Q[0]),y&&_<9?q.appendChild(T("span",[ce])):q.appendChild(ce),e.col+=1);e.map.push(e.pos,e.pos+1,ce),e.pos++}}if(e.trailingSpace=R.charCodeAt(t.length-1)==32,i||r||s||F||p||w){var Se=i||"";r&&(Se+=r),s&&(Se+=s);var me=T("span",[q],Se,p);if(w)for(var Ce in w)w.hasOwnProperty(Ce)&&Ce!="style"&&Ce!="class"&&me.setAttribute(Ce,w[Ce]);return e.content.appendChild(me)}e.content.appendChild(q)}}function gc(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",s=0;sF&&X.from<=F));Q++);if(X.to>=q)return e(i,r,s,p,w,R,B);e(i,r.slice(0,X.to-F),s,p,null,R,B),p=null,r=r.slice(X.to-F),F=X.to}}}function Ns(e,t,i,r){var s=!r&&i.widgetNode;s&&e.map.push(e.pos,e.pos+t,s),!r&&e.cm.display.input.needsContentAttribute&&(s||(s=e.content.appendChild(document.createElement("span"))),s.setAttribute("cm-marker",i.id)),s&&(e.cm.display.input.setUneditable(s),e.content.appendChild(s)),e.pos+=t,e.trailingSpace=!1}function yc(e,t,i){var r=e.markedSpans,s=e.text,p=0;if(!r){for(var w=1;wB||Pe.collapsed&&Ae.to==B&&Ae.from==B)){if(Ae.to!=null&&Ae.to!=B&&J>Ae.to&&(J=Ae.to,ce=""),Pe.className&&(ie+=" "+Pe.className),Pe.css&&(Q=(Q?Q+";":"")+Pe.css),Pe.startStyle&&Ae.from==B&&(de+=" "+Pe.startStyle),Pe.endStyle&&Ae.to==J&&(Ce||(Ce=[])).push(Pe.endStyle,Ae.to),Pe.title&&((Se||(Se={})).title=Pe.title),Pe.attributes)for(var Ke in Pe.attributes)(Se||(Se={}))[Ke]=Pe.attributes[Ke];Pe.collapsed&&(!ye||ct(ye.marker,Pe)<0)&&(ye=Ae)}else Ae.from>B&&J>Ae.from&&(J=Ae.from)}if(Ce)for(var Ct=0;Ct=R)break;for(var rr=Math.min(R,J);;){if(q){var qt=B+q.length;if(!ye){var st=qt>rr?q.slice(0,rr-B):q;t.addToken(t,st,X?X+ie:ie,de,B+st.length==J?ce:"",Q,Se)}if(qt>=rr){q=q.slice(rr-B),B=rr;break}B=qt,de=""}q=s.slice(p,p=i[F++]),X=Fs(i[F++],t.cm.options)}}}function js(e,t,i){this.line=t,this.rest=ci(t),this.size=this.rest?W(Re(this.rest))-i+1:1,this.node=this.text=null,this.hidden=jt(e,t)}function jn(e,t,i){for(var r=[],s,p=t;p2&&p.push((B.bottom+F.top)/2-i.top)}}p.push(i.bottom-i.top)}}function Zs(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[s],cache:e.measure.caches[s],before:!0}}}function Ac(e,t){t=yt(t);var i=W(t),r=e.display.externalMeasured=new js(e.doc,t,i);r.lineN=i;var s=r.built=Ws(e,r);return r.text=s.pre,P(e.display.lineMeasure,s.pre),r}function Ys(e,t,i,r){return qr(e,Ui(e,t),i,r)}function xo(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(p=B-R,s=p-1,t>=B&&(w="right")),s!=null){if(r=e[F+2],R==B&&i==(r.insertLeft?"left":"right")&&(w=i),i=="left"&&s==0)for(;F&&e[F-2]==e[F-3]&&e[F-1].insertLeft;)r=e[(F-=3)+2],w="left";if(i=="right"&&s==B-R)for(;F=0&&(i=e[s]).left==i.right;s--);return i}function Rc(e,t,i,r){var s=$s(t.map,i,r),p=s.node,w=s.start,R=s.end,B=s.collapse,F;if(p.nodeType==3){for(var q=0;q<4;q++){for(;w&&Ze(t.line.text.charAt(s.coverStart+w));)--w;for(;s.coverStart+R0&&(B=r="right");var X;e.options.lineWrapping&&(X=p.getClientRects()).length>1?F=X[r=="right"?X.length-1:0]:F=p.getBoundingClientRect()}if(y&&_<9&&!w&&(!F||!F.left&&!F.right)){var Q=p.parentNode.getClientRects()[0];Q?F={left:Q.left,right:Q.left+qi(e.display),top:Q.top,bottom:Q.bottom}:F=Vs}for(var J=F.top-t.rect.top,ie=F.bottom-t.rect.top,ce=(J+ie)/2,de=t.view.measure.heights,ye=0;ye=r.text.length?(B=r.text.length,F="before"):B<=0&&(B=0,F="after"),!R)return w(F=="before"?B-1:B,F=="before");function q(ie,ce,de){var ye=R[ce],Se=ye.level==1;return w(de?ie-1:ie,Se!=de)}var X=ar(R,B,F),Q=yr,J=q(B,X,F=="before");return Q!=null&&(J.other=q(B,Q,F!="before")),J}function ia(e,t){var i=0;t=Oe(e.doc,t),e.options.lineWrapping||(i=qi(e.display)*t.ch);var r=Le(e.doc,t.line),s=ft(r)+Un(e.display);return{left:i,right:i,top:s,bottom:s+r.height}}function Eo(e,t,i,r,s){var p=te(e,t,i);return p.xRel=s,r&&(p.outside=r),p}function To(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return Eo(r.first,0,null,-1,-1);var s=K(r,i),p=r.first+r.size-1;if(s>p)return Eo(r.first+r.size-1,Le(r,p).text.length,null,1,1);t<0&&(t=0);for(var w=Le(r,s);;){var R=Dc(e,w,s,t,i),B=Qt(w,R.ch+(R.xRel>0||R.outside>0?1:0));if(!B)return R;var F=B.find(1);if(F.line==s)return F;w=Le(r,s=F.line)}}function na(e,t,i,r){r-=ko(t);var s=t.text.length,p=Zt(function(w){return qr(e,i,w-1).bottom<=r},s,0);return s=Zt(function(w){return qr(e,i,w).top>r},p,s),{begin:p,end:s}}function oa(e,t,i,r){i||(i=Ui(e,t));var s=zn(e,t,qr(e,i,r),"line").top;return na(e,t,i,s)}function Ao(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Dc(e,t,i,r,s){s-=ft(t);var p=Ui(e,t),w=ko(t),R=0,B=t.text.length,F=!0,q=Be(t,e.doc.direction);if(q){var X=(e.options.lineWrapping?Pc:Bc)(e,t,i,p,q,r,s);F=X.level!=1,R=F?X.from:X.to-1,B=F?X.to:X.from-1}var Q=null,J=null,ie=Zt(function(Me){var Ae=qr(e,p,Me);return Ae.top+=w,Ae.bottom+=w,Ao(Ae,r,s,!1)?(Ae.top<=s&&Ae.left<=r&&(Q=Me,J=Ae),!0):!1},R,B),ce,de,ye=!1;if(J){var Se=r-J.left=Ce.bottom?1:0}return ie=_r(t.text,ie,1),Eo(i,ie,de,ye,r-ce)}function Bc(e,t,i,r,s,p,w){var R=Zt(function(X){var Q=s[X],J=Q.level!=1;return Ao(Dr(e,te(i,J?Q.to:Q.from,J?"before":"after"),"line",t,r),p,w,!0)},0,s.length-1),B=s[R];if(R>0){var F=B.level!=1,q=Dr(e,te(i,F?B.from:B.to,F?"after":"before"),"line",t,r);Ao(q,p,w,!0)&&q.top>w&&(B=s[R-1])}return B}function Pc(e,t,i,r,s,p,w){var R=na(e,t,r,w),B=R.begin,F=R.end;/\s/.test(t.text.charAt(F-1))&&F--;for(var q=null,X=null,Q=0;Q=F||J.to<=B)){var ie=J.level!=1,ce=qr(e,r,ie?Math.min(F,J.to)-1:Math.max(B,J.from)).right,de=cede)&&(q=J,X=de)}}return q||(q=s[s.length-1]),q.fromF&&(q={from:q.from,to:F,level:q.level}),q}var Li;function zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Li==null){Li=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Li.appendChild(document.createTextNode("x")),Li.appendChild(T("br"));Li.appendChild(document.createTextNode("x"))}P(e.measure,Li);var i=Li.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),I(e.measure),i||1}function qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),i=T("pre",[t],"CodeMirror-line-like");P(e.measure,i);var r=t.getBoundingClientRect(),s=(r.right-r.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function Mo(e){for(var t=e.display,i={},r={},s=t.gutters.clientLeft,p=t.gutters.firstChild,w=0;p;p=p.nextSibling,++w){var R=e.display.gutterSpecs[w].className;i[R]=p.offsetLeft+p.clientLeft+s,r[R]=p.clientWidth}return{fixedPos:Ro(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ro(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sa(e){var t=zi(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/qi(e.display)-3);return function(s){if(jt(e.doc,s))return 0;var p=0;if(s.widgets)for(var w=0;w0&&(F=Le(e.doc,B.line).text).length==B.ch){var q=$(F,F.length,e.options.tabSize)-F.length;B=te(B.line,Math.max(0,Math.round((p-Xs(e.display).left)/qi(e.display))-q))}return B}function ki(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(s.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=s.viewTo)ee&&Sr(e.doc,t)s.viewFrom?fi(e):(s.viewFrom+=r,s.viewTo+=r);else if(t<=s.viewFrom&&i>=s.viewTo)fi(e);else if(t<=s.viewFrom){var p=Kn(e,i,i+r,1);p?(s.view=s.view.slice(p.index),s.viewFrom=p.lineN,s.viewTo+=r):fi(e)}else if(i>=s.viewTo){var w=Kn(e,t,t,-1);w?(s.view=s.view.slice(0,w.index),s.viewTo=w.lineN):fi(e)}else{var R=Kn(e,t,t,-1),B=Kn(e,i,i+r,1);R&&B?(s.view=s.view.slice(0,R.index).concat(jn(e,R.lineN,B.lineN)).concat(s.view.slice(B.index)),s.viewTo+=r):fi(e)}var F=s.externalMeasured;F&&(i=s.lineN&&t=r.viewTo)){var p=r.view[ki(e,t)];if(p.node!=null){var w=p.changes||(p.changes=[]);ge(w,i)==-1&&w.push(i)}}}function fi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Kn(e,t,i,r){var s=ki(e,t),p,w=e.display.view;if(!ee||i==e.doc.first+e.doc.size)return{index:s,lineN:i};for(var R=e.display.viewFrom,B=0;B0){if(s==w.length-1)return null;p=R+w[s].size-t,s++}else p=R-t;t+=p,i+=p}for(;Sr(e.doc,i)!=i;){if(s==(r<0?0:w.length-1))return null;i+=r*w[s-(r<0?1:0)].size,s+=r}return{index:s,lineN:i}}function Ic(e,t,i){var r=e.display,s=r.view;s.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=jn(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=jn(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,ki(e,i)))),r.viewTo=i}function aa(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||B.to().line0?w:e.defaultCharWidth())+"px"}if(r.other){var R=i.appendChild(T("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));R.style.display="",R.style.left=r.other.left+"px",R.style.top=r.other.top+"px",R.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Gn(e,t){return e.top-t.top||e.left-t.left}function Hc(e,t,i){var r=e.display,s=e.doc,p=document.createDocumentFragment(),w=Xs(e.display),R=w.left,B=Math.max(r.sizerWidth,wi(e)-r.sizer.offsetLeft)-w.right,F=s.direction=="ltr";function q(me,Ce,Me,Ae){Ce<0&&(Ce=0),Ce=Math.round(Ce),Ae=Math.round(Ae),p.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+me+`px; - top: `+Ce+"px; width: "+(Me??B-me)+`px; - height: `+(Ae-Ce)+"px"))}function X(me,Ce,Me){var Ae=Le(s,me),Pe=Ae.text.length,Ke,Ct;function Ve(st,Kt){return qn(e,te(me,st),"div",Ae,Kt)}function rr(st,Kt,xt){var ht=oa(e,Ae,null,st),at=Kt=="ltr"==(xt=="after")?"left":"right",Qe=xt=="after"?ht.begin:ht.end-(/\s/.test(Ae.text.charAt(ht.end-1))?2:1);return Ve(Qe,at)[at]}var qt=Be(Ae,s.direction);return sr(qt,Ce||0,Me??Pe,function(st,Kt,xt,ht){var at=xt=="ltr",Qe=Ve(st,at?"left":"right"),Gt=Ve(Kt-1,at?"right":"left"),nn=Ce==null&&st==0,_i=Me==null&&Kt==Pe,Mt=ht==0,Kr=!qt||ht==qt.length-1;if(Gt.top-Qe.top<=3){var wt=(F?nn:_i)&&Mt,ss=(F?_i:nn)&&Kr,ti=wt?R:(at?Qe:Gt).left,Ri=ss?B:(at?Gt:Qe).right;q(ti,Qe.top,Ri-ti,Qe.bottom)}else{var Oi,Ft,on,as;at?(Oi=F&&nn&&Mt?R:Qe.left,Ft=F?B:rr(st,xt,"before"),on=F?R:rr(Kt,xt,"after"),as=F&&_i&&Kr?B:Gt.right):(Oi=F?rr(st,xt,"before"):R,Ft=!F&&nn&&Mt?B:Qe.right,on=!F&&_i&&Kr?R:Gt.left,as=F?rr(Kt,xt,"after"):B),q(Oi,Qe.top,Ft-Oi,Qe.bottom),Qe.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Ki(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ca(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Io(e))}function Po(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ki(e))},100)}function Io(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ue(e,"focus",e,t),e.state.focused=!0,ne(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Bo(e))}function Ki(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ue(e,"blur",e,t),e.state.focused=!1,O(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Xn(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),s=t.lineDiv.getBoundingClientRect().top,p=0,w=0;w.005||J<-.005)&&(se.display.sizerWidth){var ce=Math.ceil(q/qi(e.display));ce>e.display.maxLineLength&&(e.display.maxLineLength=ce,e.display.maxLine=R.line,e.display.maxLineChanged=!0)}}}Math.abs(p)>2&&(t.scroller.scrollTop+=p)}function ua(e){if(e.widgets)for(var t=0;t=w&&(p=K(t,ft(Le(t,B))-e.wrapper.clientHeight),w=B)}return{from:p,to:Math.max(w,p+1)}}function Fc(e,t){if(!ze(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),s=null,p=i.wrapper.ownerDocument;if(t.top+r.top<0?s=!0:t.bottom+r.top>(p.defaultView.innerHeight||p.documentElement.clientHeight)&&(s=!1),s!=null&&!c){var w=T("div","\u200B",null,`position: absolute; - top: `+(t.top-i.viewOffset-Un(e.display))+`px; - height: `+(t.bottom-t.top+zr(e)+i.barHeight)+`px; - left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(w),w.scrollIntoView(s),e.display.lineSpace.removeChild(w)}}}function Wc(e,t,i,r){r==null&&(r=0);var s;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?te(t.line,t.ch+1,"before"):t,t=t.ch?te(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var p=0;p<5;p++){var w=!1,R=Dr(e,t),B=!i||i==t?R:Dr(e,i);s={left:Math.min(R.left,B.left),top:Math.min(R.top,B.top)-r,right:Math.max(R.left,B.left),bottom:Math.max(R.bottom,B.bottom)+r};var F=Ho(e,s),q=e.doc.scrollTop,X=e.doc.scrollLeft;if(F.scrollTop!=null&&(mn(e,F.scrollTop),Math.abs(e.doc.scrollTop-q)>1&&(w=!0)),F.scrollLeft!=null&&(Ei(e,F.scrollLeft),Math.abs(e.doc.scrollLeft-X)>1&&(w=!0)),!w)break}return s}function Nc(e,t){var i=Ho(e,t);i.scrollTop!=null&&mn(e,i.scrollTop),i.scrollLeft!=null&&Ei(e,i.scrollLeft)}function Ho(e,t){var i=e.display,r=zi(e.display);t.top<0&&(t.top=0);var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,p=Lo(e),w={};t.bottom-t.top>p&&(t.bottom=t.top+p);var R=e.doc.height+wo(i),B=t.topR-r;if(t.tops+p){var q=Math.min(t.top,(F?R:t.bottom)-p);q!=s&&(w.scrollTop=q)}var X=e.options.fixedGutter?0:i.gutters.offsetWidth,Q=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-X,J=wi(e)-i.gutters.offsetWidth,ie=t.right-t.left>J;return ie&&(t.right=t.left+J),t.left<10?w.scrollLeft=0:t.leftJ+Q-3&&(w.scrollLeft=t.right+(ie?0:10)-J),w}function Fo(e,t){t!=null&&(Yn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Gi(e){Yn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function yn(e,t,i){(t!=null||i!=null)&&Yn(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function jc(e,t){Yn(e),e.curOp.scrollToPos=t}function Yn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=ia(e,t.from),r=ia(e,t.to);fa(e,i,r,t.margin)}}function fa(e,t,i,r){var s=Ho(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});yn(e,s.scrollLeft,s.scrollTop)}function mn(e,t){Math.abs(e.doc.scrollTop-t)<2||(D||No(e,{top:t}),ha(e,t,!0),D&&No(e),Cn(e,100))}function ha(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ei(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,_a(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bn(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+wo(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+zr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Ti=function(e,t,i){this.cm=i;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=s.tabIndex=-1,e(r),e(s),Te(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Te(s,"scroll",function(){s.clientWidth&&t(s.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,y&&_<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ti.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var s=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+s)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var p=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+p)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},Ti.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ti.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ti.prototype.zeroWidthHack=function(){var e=a&&!b?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ie,this.disableVert=new Ie},Ti.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var s=e.getBoundingClientRect(),p=i=="vert"?document.elementFromPoint(s.right-1,(s.top+s.bottom)/2):document.elementFromPoint((s.right+s.left)/2,s.bottom-1);p!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Ti.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sn=function(){};Sn.prototype.update=function(){return{bottom:0,right:0}},Sn.prototype.setScrollLeft=function(){},Sn.prototype.setScrollTop=function(){},Sn.prototype.clear=function(){};function Xi(e,t){t||(t=bn(e));var i=e.display.barWidth,r=e.display.barHeight;da(e,t);for(var s=0;s<4&&i!=e.display.barWidth||r!=e.display.barHeight;s++)i!=e.display.barWidth&&e.options.lineWrapping&&Xn(e),da(e,bn(e)),i=e.display.barWidth,r=e.display.barHeight}function da(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var pa={native:Ti,null:Sn};function va(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new pa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Te(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Ei(e,t):mn(e,t)},e),e.display.scrollbars.addClass&&ne(e.display.wrapper,e.display.scrollbars.addClass)}var Uc=0;function Ai(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Uc,markArrays:null},mc(e.curOp)}function Mi(e){var t=e.curOp;t&&Sc(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Vn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Kc(e){e.updatedDisplay=e.mustUpdate&&Wo(e.cm,e.update)}function Gc(e){var t=e.cm,i=t.display;e.updatedDisplay&&Xn(t),e.barMeasure=bn(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ys(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+zr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-wi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Xc(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Vr(e,t.highlightFrontier),s=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(p){if(r.line>=e.display.viewFrom){var w=p.styles,R=p.text.length>e.options.maxHighlightLength?Wt(t.mode,r.state):null,B=Fi(e,p,r,!0);R&&(r.state=R),p.styles=B.styles;var F=p.styleClasses,q=B.classes;q?p.styleClasses=q:F&&(p.styleClasses=null);for(var X=!w||w.length!=p.styles.length||F!=q&&(!F||!q||F.bgClass!=q.bgClass||F.textClass!=q.textClass),Q=0;!X&&Qi)return Cn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),s.length&&tr(e,function(){for(var p=0;p=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&aa(e)==0)return!1;ya(e)&&(fi(e),t.dims=Mo(e));var s=r.first+r.size,p=Math.max(t.visible.from-e.options.viewportMargin,r.first),w=Math.min(s,t.visible.to+e.options.viewportMargin);i.viewFromw&&i.viewTo-w<20&&(w=Math.min(s,i.viewTo)),ee&&(p=Sr(e.doc,p),w=Cr(e.doc,w));var R=p!=i.viewFrom||w!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Ic(e,p,w),i.viewOffset=ft(Le(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var B=aa(e);if(!R&&B==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var F=$c(e);return B>4&&(i.lineDiv.style.display="none"),Qc(e,i.updateLineNumbers,t.dims),B>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Jc(F),I(i.cursorDiv),I(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,R&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Cn(e,400)),i.updateLineNumbers=null,!0}function ga(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==wi(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+wo(e.display)-Lo(e),i.top)}),t.visible=Zn(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Zn(e.display,e.doc,i));if(!Wo(e,t))break;Xn(e);var s=bn(e);_n(e),Xi(e,s),Uo(e,s),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function No(e,t){var i=new Vn(e,t);if(Wo(e,i)){Xn(e),ga(e,i);var r=bn(e);_n(e),Xi(e,r),Uo(e,r),i.finish()}}function Qc(e,t,i){var r=e.display,s=e.options.lineNumbers,p=r.lineDiv,w=p.firstChild;function R(ie){var ce=ie.nextSibling;return g&&a&&e.display.currentWheelTarget==ie?ie.style.display="none":ie.parentNode.removeChild(ie),ce}for(var B=r.view,F=r.viewFrom,q=0;q-1&&(J=!1),Us(e,X,F,i)),J&&(I(X.lineNumber),X.lineNumber.appendChild(document.createTextNode(fe(e.options,F)))),w=X.node.nextSibling}F+=X.size}for(;w;)w=R(w)}function jo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",mt(e,"gutterChanged",e)}function Uo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+zr(e)+"px"}function _a(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ro(t)-t.scroller.scrollLeft+e.doc.scrollLeft,s=t.gutters.offsetWidth,p=r+"px",w=0;w=105&&(s.wrapper.style.clipPath="inset(0px)"),s.wrapper.setAttribute("translate","no"),y&&_<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),!g&&!(D&&o)&&(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=zo(r.gutters,r.lineNumbers),ma(s),i.init(s)}var $n=0,Qr=null;y?Qr=-.53:D?Qr=15:C?Qr=-.7:L&&(Qr=-1/3);function ba(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function tu(e){var t=ba(e);return t.x*=Qr,t.y*=Qr,t}function Sa(e,t){C&&u==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=ba(t),r=i.x,s=i.y,p=Qr;t.deltaMode===0&&(r=t.deltaX,s=t.deltaY,p=1);var w=e.display,R=w.scroller,B=R.scrollWidth>R.clientWidth,F=R.scrollHeight>R.clientHeight;if(r&&B||s&&F){if(s&&a&&g){e:for(var q=t.target,X=w.view;q!=R;q=q.parentNode)for(var Q=0;Q=0&&be(e,r.to())<=0)return i}return-1};var Fe=function(e,t){this.anchor=e,this.head=t};Fe.prototype.from=function(){return Nr(this.anchor,this.head)},Fe.prototype.to=function(){return vt(this.anchor,this.head)},Fe.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Br(e,t,i){var r=e&&e.options.selectionsMayTouch,s=t[i];t.sort(function(Q,J){return be(Q.from(),J.from())}),i=ge(t,s);for(var p=1;p0:B>=0){var F=Nr(R.from(),w.from()),q=vt(R.to(),w.to()),X=R.empty()?w.from()==w.head:R.from()==R.head;p<=i&&--i,t.splice(--p,2,new Fe(X?q:F,X?F:q))}}return new vr(t,i)}function hi(e,t){return new vr([new Fe(e,t||e)],0)}function di(e){return e.text?te(e.from.line+e.text.length-1,Re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ca(e,t){if(be(e,t.from)<0)return e;if(be(e,t.to)<=0)return di(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=di(t).ch-t.to.ch),te(i,r)}function qo(e,t){for(var i=[],r=0;r1&&e.remove(R.line+1,ie-1),e.insert(R.line+1,ye)}mt(e,"change",e,t)}function pi(e,t,i){function r(s,p,w){if(s.linked)for(var R=0;R1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Re(e.done)}function Ta(e,t,i,r){var s=e.history;s.undone.length=0;var p=+new Date,w,R;if((s.lastOp==r||s.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&s.lastModTime>p-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(w=nu(s,s.lastOp==r)))R=Re(w.changes),be(t.from,t.to)==0&&be(t.from,R.to)==0?R.to=di(t):w.changes.push(Xo(e,t));else{var B=Re(s.done);for((!B||!B.ranges)&&Qn(e.sel,s.done),w={changes:[Xo(e,t)],generation:s.generation},s.done.push(w);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift()}s.done.push(i),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=p,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,R||Ue(e,"historyAdded")}function ou(e,t,i,r){var s=t.charAt(0);return s=="*"||s=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function su(e,t,i,r){var s=e.history,p=r&&r.origin;i==s.lastSelOp||p&&s.lastSelOrigin==p&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==p||ou(e,p,Re(s.done),t))?s.done[s.done.length-1]=t:Qn(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=p,s.lastSelOp=i,r&&r.clearRedo!==!1&&Ea(s.undone)}function Qn(e,t){var i=Re(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Aa(e,t,i,r){var s=t["spans_"+e.id],p=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(w){w.markedSpans&&((s||(s=t["spans_"+e.id]={}))[p]=w.markedSpans),++p})}function au(e){if(!e)return null;for(var t,i=0;i-1&&(Re(R)[X]=F[X],delete F[X])}}return r}function Zo(e,t,i,r){if(r){var s=e.anchor;if(i){var p=be(t,s)<0;p!=be(i,s)<0?(s=t,t=i):p!=be(t,i)<0&&(t=i)}return new Fe(s,t)}else return new Fe(i||t,t)}function eo(e,t,i,r,s){s==null&&(s=e.cm&&(e.cm.display.shift||e.extend)),At(e,new vr([Zo(e.sel.primary(),t,i,s)],0),r)}function Ra(e,t,i){for(var r=[],s=e.cm&&(e.cm.display.shift||e.extend),p=0;p=t.ch:R.to>t.ch))){if(s&&(Ue(B,"beforeCursorEnter"),B.explicitlyCleared))if(p.markedSpans){--w;continue}else break;if(!B.atomic)continue;if(i){var X=B.find(r<0?1:-1),Q=void 0;if((r<0?q:F)&&(X=Ha(e,X,-r,X&&X.line==t.line?p:null)),X&&X.line==t.line&&(Q=be(X,i))&&(r<0?Q<0:Q>0))return Yi(e,X,t,r,s)}var J=B.find(r<0?-1:1);return(r<0?F:q)&&(J=Ha(e,J,r,J.line==t.line?p:null)),J?Yi(e,J,t,r,s):null}}return t}function ro(e,t,i,r,s){var p=r||1,w=Yi(e,t,i,p,s)||!s&&Yi(e,t,i,p,!0)||Yi(e,t,i,-p,s)||!s&&Yi(e,t,i,-p,!0);return w||(e.cantEdit=!0,te(e.first,0))}function Ha(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?Oe(e,te(t.line-1)):null:i>0&&t.ch==(r||Le(e,t.line)).text.length?t.line=0;--s)Na(e,{from:r[s].from,to:r[s].to,text:s?[""]:t.text,origin:t.origin});else Na(e,t)}}function Na(e,t){if(!(t.text.length==1&&t.text[0]==""&&be(t.from,t.to)==0)){var i=qo(e,t);Ta(e,t,i,e.cm?e.cm.curOp.id:NaN),xn(e,t,i,Ge(e,t));var r=[];pi(e,function(s,p){!p&&ge(r,s.history)==-1&&(qa(s.history,t),r.push(s.history)),xn(s,t,null,Ge(s,t))})}}function io(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var s=e.history,p,w=e.sel,R=t=="undo"?s.done:s.undone,B=t=="undo"?s.undone:s.done,F=0;F=0;--J){var ie=Q(J);if(ie)return ie.v}}}}function ja(e,t){if(t!=0&&(e.first+=t,e.sel=new vr(Xe(e.sel.ranges,function(s){return new Fe(te(s.anchor.line+t,s.anchor.ch),te(s.head.line+t,s.head.ch))}),e.sel.primIndex),e.cm)){Ut(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.linep&&(t={from:t.from,to:te(p,Le(e,p).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Vt(e,t.from,t.to),i||(i=qo(e,t)),e.cm?uu(e.cm,t,r):Go(e,t,r),to(e,i,Z),e.cantEdit&&ro(e,te(e.firstLine(),0))&&(e.cantEdit=!1)}}function uu(e,t,i){var r=e.doc,s=e.display,p=t.from,w=t.to,R=!1,B=p.line;e.options.lineWrapping||(B=W(yt(Le(r,p.line))),r.iter(B,w.line+1,function(J){if(J==s.maxLine)return R=!0,!0})),r.sel.contains(t.from,t.to)>-1&&kt(e),Go(r,t,i,sa(e)),e.options.lineWrapping||(r.iter(B,p.line+t.text.length,function(J){var ie=Ur(J);ie>s.maxLineLength&&(s.maxLine=J,s.maxLineLength=ie,s.maxLineChanged=!0,R=!1)}),R&&(e.curOp.updateMaxLine=!0)),Nn(r,p.line),Cn(e,400);var F=t.text.length-(w.line-p.line)-1;t.full?Ut(e):p.line==w.line&&t.text.length==1&&!La(e.doc,t)?ui(e,p.line,"text"):Ut(e,p.line,w.line+1,F);var q=pt(e,"changes"),X=pt(e,"change");if(X||q){var Q={from:p,to:w,text:t.text,removed:t.removed,origin:t.origin};X&&mt(e,"change",e,Q),q&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Q)}e.display.selForContextMenu=null}function $i(e,t,i,r,s){var p;r||(r=i),be(r,i)<0&&(p=[r,i],i=p[0],r=p[1]),typeof t=="string"&&(t=e.splitLines(t)),Vi(e,{from:i,to:r,text:t,origin:s})}function Ua(e,t,i,r){i1||!(this.children[0]instanceof En))){var R=[];this.collapse(R),this.children=[new En(R)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var w=s.lines.length%25+25,R=w;R10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=F,e.display.maxLineLength=q,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Ut(e,r,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Pa(e.doc)),e&&mt(e,"markerCleared",e,this,r,s),t&&Mi(e),this.parent&&this.parent.clear()}},vi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,s=0;s0||w==0&&p.clearWhenEmpty!==!1)return p;if(p.replacedWith&&(p.collapsed=!0,p.widgetNode=j("span",[p.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||p.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(p.widgetNode.insertLeft=!0)),p.collapsed){if(dr(e,t.line,t,i,p)||t.line!=i.line&&dr(e,i.line,t,i,p))throw new Error("Inserting collapsed marker partially overlapping an existing one");It()}p.addToHistory&&Ta(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var R=t.line,B=e.cm,F;if(e.iter(R,i.line+1,function(X){B&&p.collapsed&&!B.options.lineWrapping&&yt(X)==B.display.maxLine&&(F=!0),p.collapsed&&R!=t.line&&Lt(X,0),Jt(X,new Nt(p,R==t.line?t.ch:null,R==i.line?i.ch:null),e.cm&&e.cm.curOp),++R}),p.collapsed&&e.iter(t.line,i.line+1,function(X){jt(e,X)&&Lt(X,0)}),p.clearOnEnter&&Te(p,"beforeCursorEnter",function(){return p.clear()}),p.readOnly&&(nt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),p.collapsed&&(p.id=++Ga,p.atomic=!0),B){if(F&&(B.curOp.updateMaxLine=!0),p.collapsed)Ut(B,t.line,i.line+1);else if(p.className||p.startStyle||p.endStyle||p.css||p.attributes||p.title)for(var q=t.line;q<=i.line;q++)ui(B,q,"text");p.atomic&&Pa(B.doc),mt(B,"markerAdded",B,p)}return p}var Mn=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;B--)Vi(this,r[B]);R?Da(this,R):this.cm&&Gi(this.cm)}),undo:St(function(){io(this,"undo")}),redo:St(function(){io(this,"redo")}),undoSelection:St(function(){io(this,"undo",!0)}),redoSelection:St(function(){io(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(s.marker.parent||s.marker)}return t},findMarks:function(e,t,i){e=Oe(this,e),t=Oe(this,t);var r=[],s=e.line;return this.iter(e.line,t.line+1,function(p){var w=p.markedSpans;if(w)for(var R=0;R=B.to||B.from==null&&s!=e.line||B.from!=null&&s==t.line&&B.from>=t.ch)&&(!i||i(B.marker))&&r.push(B.marker.parent||B.marker)}++s}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=p,++i}),Oe(this,te(i,t))},indexFromPos:function(e){e=Oe(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var q=e.dataTransfer.getData("Text");if(q){var X;if(t.state.draggingText&&!t.state.draggingText.copy&&(X=t.listSelections()),to(t.doc,hi(i,i)),X)for(var Q=0;Q=0;R--)$i(e.doc,"",r[R].from,r[R].to,"+delete");Gi(e)})}function Vo(e,t,i){var r=_r(e.text,t+i,i);return r<0||r>e.text.length?null:r}function $o(e,t,i){var r=Vo(e,t.ch,i);return r==null?null:new te(t.line,r,i<0?"after":"before")}function Jo(e,t,i,r,s){if(e){t.doc.direction=="rtl"&&(s=-s);var p=Be(i,t.doc.direction);if(p){var w=s<0?Re(p):p[0],R=s<0==(w.level==1),B=R?"after":"before",F;if(w.level>0||t.doc.direction=="rtl"){var q=Ui(t,i);F=s<0?i.text.length-1:0;var X=qr(t,q,F).top;F=Zt(function(Q){return qr(t,q,Q).top==X},s<0==(w.level==1)?w.from:w.to-1,F),B=="before"&&(F=Vo(i,F,1))}else F=s<0?w.to:w.from;return new te(r,F,B)}}return new te(r,s<0?i.text.length:0,s<0?"before":"after")}function Lu(e,t,i,r){var s=Be(t,e.doc.direction);if(!s)return $o(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var p=ar(s,i.ch,i.sticky),w=s[p];if(e.doc.direction=="ltr"&&w.level%2==0&&(r>0?w.to>i.ch:w.from=w.from&&Q>=q.begin)){var J=X?"before":"after";return new te(i.line,Q,J)}}var ie=function(ye,Se,me){for(var Ce=function(Ke,Ct){return Ct?new te(i.line,R(Ke,1),"before"):new te(i.line,Ke,"after")};ye>=0&&ye0==(Me.level!=1),Pe=Ae?me.begin:R(me.end,-1);if(Me.from<=Pe&&Pe0?q.end:R(q.begin,-1);return de!=null&&!(r>0&&de==t.text.length)&&(ce=ie(r>0?0:s.length-1,r,F(de)),ce)?ce:null}var Dn={selectAll:Fa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Z)},killLine:function(e){return en(e,function(t){if(t.empty()){var i=Le(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)s=new te(s.line,s.ch+1),e.replaceRange(p.charAt(s.ch-1)+p.charAt(s.ch-2),te(s.line,s.ch-2),s,"+transpose");else if(s.line>e.doc.first){var w=Le(e.doc,s.line-1).text;w&&(s=new te(s.line,1),e.replaceRange(p.charAt(0)+e.doc.lineSeparator()+w.charAt(w.length-1),te(s.line-1,w.length-1),s,"+transpose"))}}i.push(new Fe(s,s))}e.setSelections(i)})},newlineAndIndent:function(e){return tr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&be(t,this.pos)==0&&i==this.button};var Pn,In;function Ru(e,t){var i=+new Date;return In&&In.compare(i,e,t)?(Pn=In=null,"triple"):Pn&&Pn.compare(i,e,t)?(In=new es(i,e,t),Pn=null,"double"):(Pn=new es(i,e,t),In=null,"single")}function ll(e){var t=this,i=t.display;if(!(ze(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,Jr(i,e)){g||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!ts(t,e)){var r=xi(t,e),s=Ot(e),p=r?Ru(r,s):"single";ve(t).focus(),s==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ou(t,s,r,p,e))&&(s==1?r?Bu(t,r,p,e):Ir(e)==i.scroller&&tt(e):s==2?(r&&eo(t.doc,r),setTimeout(function(){return i.input.focus()},20)):s==3&&(x?t.display.input.onContextMenu(e):Po(t)))}}}function Ou(e,t,i,r,s){var p="Click";return r=="double"?p="Double"+p:r=="triple"&&(p="Triple"+p),p=(t==1?"Left":t==2?"Middle":"Right")+p,Bn(e,Qa(p,s),s,function(w){if(typeof w=="string"&&(w=Dn[w]),!w)return!1;var R=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),R=w(e,i)!=Y}finally{e.state.suppressEdits=!1}return R})}function Du(e,t,i){var r=e.getOption("configureMouse"),s=r?r(e,t,i):{};if(s.unit==null){var p=d?i.shiftKey&&i.metaKey:i.altKey;s.unit=p?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(s.extend==null||e.doc.extend)&&(s.extend=e.doc.extend||i.shiftKey),s.addNew==null&&(s.addNew=a?i.metaKey:i.ctrlKey),s.moveOnDrag==null&&(s.moveOnDrag=!(a?i.altKey:i.ctrlKey)),s}function Bu(e,t,i,r){y?setTimeout(he(ca,e),0):e.curOp.focus=V(_e(e));var s=Du(e,i,r),p=e.doc.sel,w;e.options.dragDrop&&si&&!e.isReadOnly()&&i=="single"&&(w=p.contains(t))>-1&&(be((w=p.ranges[w]).from(),t)<0||t.xRel>0)&&(be(w.to(),t)>0||t.xRel<0)?Pu(e,r,t,s):Iu(e,r,t,s)}function Pu(e,t,i,r){var s=e.display,p=!1,w=bt(e,function(F){g&&(s.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Po(e)),et(s.wrapper.ownerDocument,"mouseup",w),et(s.wrapper.ownerDocument,"mousemove",R),et(s.scroller,"dragstart",B),et(s.scroller,"drop",w),p||(tt(F),r.addNew||eo(e.doc,i,null,null,r.extend),g&&!L||y&&_==9?setTimeout(function(){s.wrapper.ownerDocument.body.focus({preventScroll:!0}),s.input.focus()},20):s.input.focus())}),R=function(F){p=p||Math.abs(t.clientX-F.clientX)+Math.abs(t.clientY-F.clientY)>=10},B=function(){return p=!0};g&&(s.scroller.draggable=!0),e.state.draggingText=w,w.copy=!r.moveOnDrag,Te(s.wrapper.ownerDocument,"mouseup",w),Te(s.wrapper.ownerDocument,"mousemove",R),Te(s.scroller,"dragstart",B),Te(s.scroller,"drop",w),e.state.delayingBlurEvent=!0,setTimeout(function(){return s.input.focus()},20),s.scroller.dragDrop&&s.scroller.dragDrop()}function cl(e,t,i){if(i=="char")return new Fe(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Fe(te(t.line,0),Oe(e.doc,te(t.line+1,0)));var r=i(e,t);return new Fe(r.from,r.to)}function Iu(e,t,i,r){y&&Po(e);var s=e.display,p=e.doc;tt(t);var w,R,B=p.sel,F=B.ranges;if(r.addNew&&!r.extend?(R=p.sel.contains(i),R>-1?w=F[R]:w=new Fe(i,i)):(w=p.sel.primary(),R=p.sel.primIndex),r.unit=="rectangle")r.addNew||(w=new Fe(i,i)),i=xi(e,t,!0,!0),R=-1;else{var q=cl(e,i,r.unit);r.extend?w=Zo(w,q.anchor,q.head,r.extend):w=q}r.addNew?R==-1?(R=F.length,At(p,Br(e,F.concat([w]),R),{scroll:!1,origin:"*mouse"})):F.length>1&&F[R].empty()&&r.unit=="char"&&!r.extend?(At(p,Br(e,F.slice(0,R).concat(F.slice(R+1)),0),{scroll:!1,origin:"*mouse"}),B=p.sel):Yo(p,R,w,se):(R=0,At(p,new vr([w],0),se),B=p.sel);var X=i;function Q(me){if(be(X,me)!=0)if(X=me,r.unit=="rectangle"){for(var Ce=[],Me=e.options.tabSize,Ae=$(Le(p,i.line).text,i.ch,Me),Pe=$(Le(p,me.line).text,me.ch,Me),Ke=Math.min(Ae,Pe),Ct=Math.max(Ae,Pe),Ve=Math.min(i.line,me.line),rr=Math.min(e.lastLine(),Math.max(i.line,me.line));Ve<=rr;Ve++){var qt=Le(p,Ve).text,st=Ee(qt,Ke,Me);Ke==Ct?Ce.push(new Fe(te(Ve,st),te(Ve,st))):qt.length>st&&Ce.push(new Fe(te(Ve,st),te(Ve,Ee(qt,Ct,Me))))}Ce.length||Ce.push(new Fe(i,i)),At(p,Br(e,B.ranges.slice(0,R).concat(Ce),R),{origin:"*mouse",scroll:!1}),e.scrollIntoView(me)}else{var Kt=w,xt=cl(e,me,r.unit),ht=Kt.anchor,at;be(xt.anchor,ht)>0?(at=xt.head,ht=Nr(Kt.from(),xt.anchor)):(at=xt.anchor,ht=vt(Kt.to(),xt.head));var Qe=B.ranges.slice(0);Qe[R]=Hu(e,new Fe(Oe(p,ht),at)),At(p,Br(e,Qe,R),se)}}var J=s.wrapper.getBoundingClientRect(),ie=0;function ce(me){var Ce=++ie,Me=xi(e,me,!0,r.unit=="rectangle");if(Me)if(be(Me,X)!=0){e.curOp.focus=V(_e(e)),Q(Me);var Ae=Zn(s,p);(Me.line>=Ae.to||Me.lineJ.bottom?20:0;Pe&&setTimeout(bt(e,function(){ie==Ce&&(s.scroller.scrollTop+=Pe,ce(me))}),50)}}function de(me){e.state.selectingText=!1,ie=1/0,me&&(tt(me),s.input.focus()),et(s.wrapper.ownerDocument,"mousemove",ye),et(s.wrapper.ownerDocument,"mouseup",Se),p.history.lastSelOrigin=null}var ye=bt(e,function(me){me.buttons===0||!Ot(me)?de(me):ce(me)}),Se=bt(e,de);e.state.selectingText=Se,Te(s.wrapper.ownerDocument,"mousemove",ye),Te(s.wrapper.ownerDocument,"mouseup",Se)}function Hu(e,t){var i=t.anchor,r=t.head,s=Le(e.doc,i.line);if(be(i,r)==0&&i.sticky==r.sticky)return t;var p=Be(s);if(!p)return t;var w=ar(p,i.ch,i.sticky),R=p[w];if(R.from!=i.ch&&R.to!=i.ch)return t;var B=w+(R.from==i.ch==(R.level!=1)?0:1);if(B==0||B==p.length)return t;var F;if(r.line!=i.line)F=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var q=ar(p,r.ch,r.sticky),X=q-w||(r.ch-i.ch)*(R.level==1?-1:1);q==B-1||q==B?F=X<0:F=X>0}var Q=p[B+(F?-1:0)],J=F==(Q.level==1),ie=J?Q.from:Q.to,ce=J?"after":"before";return i.ch==ie&&i.sticky==ce?t:new Fe(new te(i.line,ie,ce),r)}function ul(e,t,i,r){var s,p;if(t.touches)s=t.touches[0].clientX,p=t.touches[0].clientY;else try{s=t.clientX,p=t.clientY}catch{return!1}if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&tt(t);var w=e.display,R=w.lineDiv.getBoundingClientRect();if(p>R.bottom||!pt(e,i))return lt(t);p-=R.top-w.viewOffset;for(var B=0;B=s){var q=K(e.doc,p),X=e.display.gutterSpecs[B];return Ue(e,i,e,q,X.className,t),lt(t)}}}function ts(e,t){return ul(e,t,"gutterClick",!0)}function fl(e,t){Jr(e.display,t)||Fu(e,t)||ze(e,t,"contextmenu")||x||e.display.input.onContextMenu(t)}function Fu(e,t){return pt(e,"gutterContextMenu")?ul(e,t,"gutterContextMenu",!1):!1}function hl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gn(e)}var tn={toString:function(){return"CodeMirror.Init"}},dl={},ao={};function Wu(e){var t=e.optionHandlers;function i(r,s,p,w){e.defaults[r]=s,p&&(t[r]=w?function(R,B,F){F!=tn&&p(R,B,F)}:p)}e.defineOption=i,e.Init=tn,i("value","",function(r,s){return r.setValue(s)},!0),i("mode",null,function(r,s){r.doc.modeOption=s,Ko(r)},!0),i("indentUnit",2,Ko,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){Ln(r),gn(r),Ut(r)},!0),i("lineSeparator",null,function(r,s){if(r.doc.lineSep=s,!!s){var p=[],w=r.doc.first;r.doc.iter(function(B){for(var F=0;;){var q=B.text.indexOf(s,F);if(q==-1)break;F=q+s.length,p.push(te(w,q))}w++});for(var R=p.length-1;R>=0;R--)$i(r.doc,s,p[R],te(p[R].line,p[R].ch+s.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,s,p){r.state.specialChars=new RegExp(s.source+(s.test(" ")?"":"| "),"g"),p!=tn&&r.refresh()}),i("specialCharPlaceholder",pc,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,s){return r.getInputField().spellcheck=s},!0),i("autocorrect",!1,function(r,s){return r.getInputField().autocorrect=s},!0),i("autocapitalize",!1,function(r,s){return r.getInputField().autocapitalize=s},!0),i("rtlMoveVisually",!h),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){hl(r),wn(r)},!0),i("keyMap","default",function(r,s,p){var w=oo(s),R=p!=tn&&oo(p);R&&R.detach&&R.detach(r,w),w.attach&&w.attach(r,R||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,ju,!0),i("gutters",[],function(r,s){r.display.gutterSpecs=zo(s,r.options.lineNumbers),wn(r)},!0),i("fixedGutter",!0,function(r,s){r.display.gutters.style.left=s?Ro(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Xi(r)},!0),i("scrollbarStyle","native",function(r){va(r),Xi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,s){r.display.gutterSpecs=zo(r.options.gutters,s),wn(r)},!0),i("firstLineNumber",1,wn,!0),i("lineNumberFormatter",function(r){return r},wn,!0),i("showCursorWhenSelecting",!1,_n,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,s){s=="nocursor"&&(Ki(r),r.display.input.blur()),r.display.input.readOnlyChanged(s)}),i("screenReaderLabel",null,function(r,s){s=s===""?null:s,r.display.input.screenReaderLabelChanged(s)}),i("disableInput",!1,function(r,s){s||r.display.input.reset()},!0),i("dragDrop",!0,Nu),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,_n,!0),i("singleCursorHeightPerLine",!0,_n,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Ln,!0),i("addModeClass",!1,Ln,!0),i("pollInterval",100),i("undoDepth",200,function(r,s){return r.doc.history.undoDepth=s}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,Ln,!0),i("moveInputWithCursor",!0,function(r,s){s||r.display.input.resetPosition()}),i("tabindex",null,function(r,s){return r.display.input.getField().tabIndex=s||""}),i("autofocus",null),i("direction","ltr",function(r,s){return r.doc.setDirection(s)},!0),i("phrases",null)}function Nu(e,t,i){var r=i&&i!=tn;if(!t!=!r){var s=e.display.dragFunctions,p=t?Te:et;p(e.display.scroller,"dragstart",s.start),p(e.display.scroller,"dragenter",s.enter),p(e.display.scroller,"dragover",s.over),p(e.display.scroller,"dragleave",s.leave),p(e.display.scroller,"drop",s.drop)}}function ju(e){e.options.lineWrapping?(ne(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(O(e.display.wrapper,"CodeMirror-wrap"),Ci(e)),Oo(e),Ut(e),gn(e),setTimeout(function(){return Xi(e)},100)}function Ye(e,t){var i=this;if(!(this instanceof Ye))return new Ye(e,t);this.options=t=t?ke(t):{},ke(dl,t,!1);var r=t.value;typeof r=="string"?r=new zt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var s=new Ye.inputStyles[t.inputStyle](this),p=this.display=new eu(e,r,s,t);p.wrapper.CodeMirror=this,hl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),va(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ie,keySeq:null,specialChars:null},t.autofocus&&!o&&p.input.focus(),y&&_<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Uu(this),mu(),Ai(this),this.curOp.forceUpdate=!0,xa(this,r),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Io(i)},20):Ki(this);for(var w in ao)ao.hasOwnProperty(w)&&ao[w](this,t[w],tn);ya(this),t.finishInit&&t.finishInit(this);for(var R=0;R20*20}Te(t.scroller,"touchstart",function(B){if(!ze(e,B)&&!p(B)&&!ts(e,B)){t.input.ensurePolled(),clearTimeout(i);var F=+new Date;t.activeTouch={start:F,moved:!1,prev:F-r.end<=300?r:null},B.touches.length==1&&(t.activeTouch.left=B.touches[0].pageX,t.activeTouch.top=B.touches[0].pageY)}}),Te(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Te(t.scroller,"touchend",function(B){var F=t.activeTouch;if(F&&!Jr(t,B)&&F.left!=null&&!F.moved&&new Date-F.start<300){var q=e.coordsChar(t.activeTouch,"page"),X;!F.prev||w(F,F.prev)?X=new Fe(q,q):!F.prev.prev||w(F,F.prev.prev)?X=e.findWordAt(q):X=new Fe(te(q.line,0),Oe(e.doc,te(q.line+1,0))),e.setSelection(X.anchor,X.head),e.focus(),tt(B)}s()}),Te(t.scroller,"touchcancel",s),Te(t.scroller,"scroll",function(){t.scroller.clientHeight&&(mn(e,t.scroller.scrollTop),Ei(e,t.scroller.scrollLeft,!0),Ue(e,"scroll",e))}),Te(t.scroller,"mousewheel",function(B){return Sa(e,B)}),Te(t.scroller,"DOMMouseScroll",function(B){return Sa(e,B)}),Te(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(B){ze(e,B)||lr(B)},over:function(B){ze(e,B)||(yu(e,B),lr(B))},start:function(B){return _u(e,B)},drop:bt(e,gu),leave:function(B){ze(e,B)||Ya(e)}};var R=t.input.getField();Te(R,"keyup",function(B){return sl.call(e,B)}),Te(R,"keydown",bt(e,ol)),Te(R,"keypress",bt(e,al)),Te(R,"focus",function(B){return Io(e,B)}),Te(R,"blur",function(B){return Ki(e,B)})}var rs=[];Ye.defineInitHook=function(e){return rs.push(e)};function Hn(e,t,i,r){var s=e.doc,p;i==null&&(i="add"),i=="smart"&&(s.mode.indent?p=Vr(e,t).state:i="prev");var w=e.options.tabSize,R=Le(s,t),B=$(R.text,null,w);R.stateAfter&&(R.stateAfter=null);var F=R.text.match(/^\s*/)[0],q;if(!r&&!/\S/.test(R.text))q=0,i="not";else if(i=="smart"&&(q=s.mode.indent(p,R.text.slice(F.length),R.text),q==Y||q>150)){if(!r)return;i="prev"}i=="prev"?t>s.first?q=$(Le(s,t-1).text,null,w):q=0:i=="add"?q=B+e.options.indentUnit:i=="subtract"?q=B-e.options.indentUnit:typeof i=="number"&&(q=B+i),q=Math.max(0,q);var X="",Q=0;if(e.options.indentWithTabs)for(var J=Math.floor(q/w);J;--J)Q+=w,X+=" ";if(Qw,B=Et(t),F=null;if(R&&r.ranges.length>1)if(Pr&&Pr.text.join(` -`)==t){if(r.ranges.length%Pr.text.length==0){F=[];for(var q=0;q=0;Q--){var J=r.ranges[Q],ie=J.from(),ce=J.to();J.empty()&&(i&&i>0?ie=te(ie.line,ie.ch-i):e.state.overwrite&&!R?ce=te(ce.line,Math.min(Le(p,ce.line).text.length,ce.ch+Re(B).length)):R&&Pr&&Pr.lineWise&&Pr.text.join(` -`)==B.join(` -`)&&(ie=ce=te(ie.line,0)));var de={from:ie,to:ce,text:F?F[Q%F.length]:B,origin:s||(R?"paste":e.state.cutIncoming>w?"cut":"+input")};Vi(e.doc,de),mt(e,"inputRead",e,de)}t&&!R&&vl(e,t),Gi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=X),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function pl(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&tr(t,function(){return is(t,i,0,null,"paste")}),!0}function vl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var s=i.ranges[r];if(!(s.head.ch>100||r&&i.ranges[r-1].head.line==s.head.line)){var p=e.getModeAt(s.head),w=!1;if(p.electricChars){for(var R=0;R-1){w=Hn(e,s.head.line,"smart");break}}else p.electricInput&&p.electricInput.test(Le(e.doc,s.head.line).text.slice(0,s.head.ch))&&(w=Hn(e,s.head.line,"smart"));w&&mt(e,"electricInput",e,s.head.line)}}}function gl(e){for(var t=[],i=[],r=0;rp&&(Hn(this,R.head.line,r,!0),p=R.head.line,w==this.doc.sel.primIndex&&Gi(this));else{var B=R.from(),F=R.to(),q=Math.max(p,B.line);p=Math.min(this.lastLine(),F.line-(F.ch?0:1))+1;for(var X=q;X0&&Yo(this.doc,w,new Fe(B,Q[w].to()),Z)}}}),getTokenAt:function(r,s){return Fn(this,r,s)},getLineTokens:function(r,s){return Fn(this,te(r),s,!0)},getTokenTypeAt:function(r){r=Oe(this.doc,r);var s=Wi(this,Le(this.doc,r.line)),p=0,w=(s.length-1)/2,R=r.ch,B;if(R==0)B=s[2];else for(;;){var F=p+w>>1;if((F?s[F*2-1]:0)>=R)w=F;else if(s[F*2+1]B&&(r=B,w=!0),R=Le(this.doc,r)}else R=r;return zn(this,R,{top:0,left:0},s||"page",p||w).top+(w?this.doc.height-ft(R):0)},defaultTextHeight:function(){return zi(this.display)},defaultCharWidth:function(){return qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,s,p,w,R){var B=this.display;r=Dr(this,Oe(this.doc,r));var F=r.bottom,q=r.left;if(s.style.position="absolute",s.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(s),B.sizer.appendChild(s),w=="over")F=r.top;else if(w=="above"||w=="near"){var X=Math.max(B.wrapper.clientHeight,this.doc.height),Q=Math.max(B.sizer.clientWidth,B.lineSpace.clientWidth);(w=="above"||r.bottom+s.offsetHeight>X)&&r.top>s.offsetHeight?F=r.top-s.offsetHeight:r.bottom+s.offsetHeight<=X&&(F=r.bottom),q+s.offsetWidth>Q&&(q=Q-s.offsetWidth)}s.style.top=F+"px",s.style.left=s.style.right="",R=="right"?(q=B.sizer.clientWidth-s.offsetWidth,s.style.right="0px"):(R=="left"?q=0:R=="middle"&&(q=(B.sizer.clientWidth-s.offsetWidth)/2),s.style.left=q+"px"),p&&Nc(this,{left:q,top:F,right:q+s.offsetWidth,bottom:F+s.offsetHeight})},triggerOnKeyDown:Ht(ol),triggerOnKeyPress:Ht(al),triggerOnKeyUp:sl,triggerOnMouseDown:Ht(ll),execCommand:function(r){if(Dn.hasOwnProperty(r))return Dn[r].call(null,this)},triggerElectric:Ht(function(r){vl(this,r)}),findPosH:function(r,s,p,w){var R=1;s<0&&(R=-1,s=-s);for(var B=Oe(this.doc,r),F=0;F0&&q(p.charAt(w-1));)--w;for(;R.5||this.options.lineWrapping)&&Oo(this),Ue(this,"refresh",this)}),swapDoc:Ht(function(r){var s=this.doc;return s.cm=null,this.state.selectingText&&this.state.selectingText(),xa(this,r),gn(this),this.display.input.reset(),yn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,mt(this,"swapDoc",this,s),s}),phrase:function(r){var s=this.options.phrases;return s&&Object.prototype.hasOwnProperty.call(s,r)?s[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Rt(e),e.registerHelper=function(r,s,p){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][s]=p},e.registerGlobalHelper=function(r,s,p,w){e.registerHelper(r,s,w),i[r]._global.push({pred:p,val:w})}}function os(e,t,i,r,s){var p=t,w=i,R=Le(e,t.line),B=s&&e.direction=="rtl"?-i:i;function F(){var Se=t.line+B;return Se=e.first+e.size?!1:(t=new te(Se,t.ch,t.sticky),R=Le(e,Se))}function q(Se){var me;if(r=="codepoint"){var Ce=R.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(Ce))me=null;else{var Me=i>0?Ce>=55296&&Ce<56320:Ce>=56320&&Ce<57343;me=new te(t.line,Math.max(0,Math.min(R.text.length,t.ch+i*(Me?2:1))),-i)}}else s?me=Lu(e.cm,R,t,i):me=$o(R,t,i);if(me==null)if(!Se&&F())t=Jo(s,e.cm,R,t.line,B);else return!1;else t=me;return!0}if(r=="char"||r=="codepoint")q();else if(r=="column")q(!0);else if(r=="word"||r=="group")for(var X=null,Q=r=="group",J=e.cm&&e.cm.getHelper(t,"wordChars"),ie=!0;!(i<0&&!q(!ie));ie=!1){var ce=R.text.charAt(t.ch)||` -`,de=nr(ce,J)?"w":Q&&ce==` -`?"n":!Q||/\s/.test(ce)?null:"p";if(Q&&!ie&&!de&&(de="s"),X&&X!=de){i<0&&(i=1,q(),t.sticky="after");break}if(de&&(X=de),i>0&&!q(!ie))break}var ye=ro(e,t,p,w,!0);return He(p,ye)&&(ye.hitSide=!0),ye}function yl(e,t,i,r){var s=e.doc,p=t.left,w;if(r=="page"){var R=Math.min(e.display.wrapper.clientHeight,ve(e).innerHeight||s(e).documentElement.clientHeight),B=Math.max(R-.5*zi(e.display),3);w=(i>0?t.bottom:t.top)+i*B}else r=="line"&&(w=i>0?t.bottom+3:t.top-3);for(var F;F=To(e,p,w),!!F.outside;){if(i<0?w<=0:w>=s.height){F.hitSide=!0;break}w+=i*5}return F}var Ne=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ie,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ne.prototype.init=function(e){var t=this,i=this,r=i.cm,s=i.div=e.lineDiv;s.contentEditable=!0,ns(s,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function p(R){for(var B=R.target;B;B=B.parentNode){if(B==s)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(B.className))break}return!1}Te(s,"paste",function(R){!p(R)||ze(r,R)||pl(R,r)||_<=11&&setTimeout(bt(r,function(){return t.updateFromDOM()}),20)}),Te(s,"compositionstart",function(R){t.composing={data:R.data,done:!1}}),Te(s,"compositionupdate",function(R){t.composing||(t.composing={data:R.data,done:!1})}),Te(s,"compositionend",function(R){t.composing&&(R.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Te(s,"touchstart",function(){return i.forceCompositionEnd()}),Te(s,"input",function(){t.composing||t.readFromDOMSoon()});function w(R){if(!(!p(R)||ze(r,R))){if(r.somethingSelected())lo({lineWise:!1,text:r.getSelections()}),R.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var B=gl(r);lo({lineWise:!0,text:B.text}),R.type=="cut"&&r.operation(function(){r.setSelections(B.ranges,0,Z),r.replaceSelection("",null,"cut")})}else return;if(R.clipboardData){R.clipboardData.clearData();var F=Pr.text.join(` -`);if(R.clipboardData.setData("Text",F),R.clipboardData.getData("Text")==F){R.preventDefault();return}}var q=_l(),X=q.firstChild;ns(X),r.display.lineSpace.insertBefore(q,r.display.lineSpace.firstChild),X.value=Pr.text.join(` -`);var Q=V(z(s));oe(X),setTimeout(function(){r.display.lineSpace.removeChild(q),Q.focus(),Q==s&&i.showPrimarySelection()},50)}}Te(s,"copy",w),Te(s,"cut",w)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=la(this.cm,!1);return e.focus=V(z(this.div))==this.div,e},Ne.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ne.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ne.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),s=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||s.line=t.display.viewFrom&&ml(t,r)||{node:R[0].measure.map[2],offset:0},F=s.linee.firstLine()&&(r=te(r.line-1,Le(e.doc,r.line-1).length)),s.ch==Le(e.doc,s.line).text.length&&s.linet.viewTo-1)return!1;var p,w,R;r.line==t.viewFrom||(p=ki(e,r.line))==0?(w=W(t.view[0].line),R=t.view[0].node):(w=W(t.view[p].line),R=t.view[p-1].node.nextSibling);var B=ki(e,s.line),F,q;if(B==t.view.length-1?(F=t.viewTo-1,q=t.lineDiv.lastChild):(F=W(t.view[B+1].line)-1,q=t.view[B+1].node.previousSibling),!R)return!1;for(var X=e.doc.splitLines(Ku(e,R,q,w,F)),Q=Vt(e.doc,te(w,0),te(F,Le(e.doc,F).text.length));X.length>1&&Q.length>1;)if(Re(X)==Re(Q))X.pop(),Q.pop(),F--;else if(X[0]==Q[0])X.shift(),Q.shift(),w++;else break;for(var J=0,ie=0,ce=X[0],de=Q[0],ye=Math.min(ce.length,de.length);Jr.ch&&Se.charCodeAt(Se.length-ie-1)==me.charCodeAt(me.length-ie-1);)J--,ie++;X[X.length-1]=Se.slice(0,Se.length-ie).replace(/^\u200b+/,""),X[0]=X[0].slice(J).replace(/\u200b+$/,"");var Me=te(w,J),Ae=te(F,Q.length?Re(Q).length-ie:0);if(X.length>1||X[0]||be(Me,Ae))return $i(e.doc,X,Me,Ae,"+input"),!0},Ne.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ne.prototype.reset=function(){this.forceCompositionEnd()},Ne.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ne.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Ne.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&tr(this.cm,function(){return Ut(e.cm)})},Ne.prototype.setUneditable=function(e){e.contentEditable="false"},Ne.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||bt(this.cm,is)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Ne.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ne.prototype.onContextMenu=function(){},Ne.prototype.resetPosition=function(){},Ne.prototype.needsContentAttribute=!0;function ml(e,t){var i=xo(e,t.line);if(!i||i.hidden)return null;var r=Le(e.doc,t.line),s=Zs(i,r,t.line),p=Be(r,e.doc.direction),w="left";if(p){var R=ar(p,t.ch);w=R%2?"right":"left"}var B=$s(s.map,t.ch,w);return B.offset=B.collapse=="right"?B.end:B.start,B}function qu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function rn(e,t){return t&&(e.bad=!0),e}function Ku(e,t,i,r,s){var p="",w=!1,R=e.doc.lineSeparator(),B=!1;function F(J){return function(ie){return ie.id==J}}function q(){w&&(p+=R,B&&(p+=R),w=B=!1)}function X(J){J&&(q(),p+=J)}function Q(J){if(J.nodeType==1){var ie=J.getAttribute("cm-text");if(ie){X(ie);return}var ce=J.getAttribute("cm-marker"),de;if(ce){var ye=e.findMarks(te(r,0),te(s+1,0),F(+ce));ye.length&&(de=ye[0].find(0))&&X(Vt(e.doc,de.from,de.to).join(R));return}if(J.getAttribute("contenteditable")=="false")return;var Se=/^(pre|div|p|li|table|br)$/i.test(J.nodeName);if(!/^br$/i.test(J.nodeName)&&J.textContent.length==0)return;Se&&q();for(var me=0;me=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Te(s,"paste",function(w){ze(r,w)||pl(w,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function p(w){if(!ze(r,w)){if(r.somethingSelected())lo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var R=gl(r);lo({lineWise:!0,text:R.text}),w.type=="cut"?r.setSelections(R.ranges,null,Z):(i.prevInput="",s.value=R.text.join(` -`),oe(s))}else return;w.type=="cut"&&(r.state.cutIncoming=+new Date)}}Te(s,"cut",p),Te(s,"copy",p),Te(e.scroller,"paste",function(w){if(!(Jr(e,w)||ze(r,w))){if(!s.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var R=new Event("paste");R.clipboardData=w.clipboardData,s.dispatchEvent(R)}}),Te(e.lineSpace,"selectstart",function(w){Jr(e,w)||tt(w)}),Te(s,"compositionstart",function(){var w=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:w,range:r.markText(w,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Te(s,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},it.prototype.createField=function(e){this.wrapper=_l(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;ns(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},it.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},it.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=la(e);if(e.options.moveInputWithCursor){var s=Dr(e,i.sel.primary().head,"div"),p=t.wrapper.getBoundingClientRect(),w=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,s.top+w.top-p.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,s.left+w.left-p.left))}return r},it.prototype.showSelection=function(e){var t=this.cm,i=t.display;P(i.cursorDiv,e.cursors),P(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},it.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&oe(this.textarea),y&&_>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",y&&_>=9&&(this.hasSelection=null));this.resetting=!1}},it.prototype.getField=function(){return this.textarea},it.prototype.supportsTouch=function(){return!1},it.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||V(z(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},it.prototype.blur=function(){this.textarea.blur()},it.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},it.prototype.receivedFocus=function(){this.slowPoll()},it.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},it.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},it.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||ur(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var s=i.value;if(s==r&&!t.somethingSelected())return!1;if(y&&_>=9&&this.hasSelection===s||a&&/[\uf700-\uf7ff]/.test(s))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var p=s.charCodeAt(0);if(p==8203&&!r&&(r="\u200B"),p==8666)return this.reset(),this.cm.execCommand("undo")}for(var w=0,R=Math.min(r.length,s.length);w1e3||s.indexOf(` -`)>-1?i.value=e.prevInput="":e.prevInput=s,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},it.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},it.prototype.onKeyPress=function(){y&&_>=9&&(this.hasSelection=null),this.fastPoll()},it.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,s=t.textarea;t.contextMenuPending&&t.contextMenuPending();var p=xi(i,e),w=r.scroller.scrollTop;if(!p||v)return;var R=i.options.resetSelectionOnContextMenu;R&&i.doc.sel.contains(p)==-1&&bt(i,At)(i.doc,hi(p),Z);var B=s.style.cssText,F=t.wrapper.style.cssText,q=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",s.style.cssText=`position: absolute; width: 30px; height: 30px; - top: `+(e.clientY-q.top-5)+"px; left: "+(e.clientX-q.left-5)+`px; +`,t);s==-1&&(s=e.length);var v=e.slice(t,e.charAt(s-1)=="\r"?s-1:s),L=v.indexOf("\r");L!=-1?(i.push(v.slice(0,L)),t+=L+1):(i.push(v),t=s+1)}return i}:function(e){return e.split(/\r\n?|\n/)},pr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Jr=function(){var e=A("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Bt=null;function ui(e){if(Bt!=null)return Bt;var t=I(e,A("span","x")),i=t.getBoundingClientRect(),r=F(t,0,1).getBoundingClientRect();return Bt=Math.abs(i.left-r.left)>1}var Mr={},Pt={};function It(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Mr[e]=t}function wr(e,t){Pt[e]=t}function Rr(e){if(typeof e=="string"&&Pt.hasOwnProperty(e))e=Pt[e];else if(e&&typeof e.name=="string"&&Pt.hasOwnProperty(e.name)){var t=Pt[e.name];typeof t=="string"&&(t={name:t}),e=dt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Rr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Rr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Or(e,t){t=Rr(t);var i=Mr[t.name];if(!i)return Or(e,"text/plain");var r=i(e,t);if(vr.hasOwnProperty(t.name)){var s=vr[t.name];for(var v in s)s.hasOwnProperty(v)&&(r.hasOwnProperty(v)&&(r["_"+v]=r[v]),r[v]=s[v])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var L in t.modeProps)r[L]=t.modeProps[L];return r}var vr={};function Dr(e,t){var i=vr.hasOwnProperty(e)?vr[e]:vr[e]={};ke(t,i)}function zt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var s=t[r];s instanceof Array&&(s=s.concat([])),i[r]=s}return i}function jr(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Br(e,t,i){return e.startState?e.startState(t,i):!0}var qe=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};qe.prototype.eol=function(){return this.pos>=this.string.length},qe.prototype.sol=function(){return this.pos==this.lineStart},qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},qe.prototype.next=function(){if(this.post},qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},qe.prototype.skipToEnd=function(){this.pos=this.string.length},qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},qe.prototype.backUp=function(e){this.pos-=e},qe.prototype.column=function(){return this.lastColumnPos0?null:(v&&t!==!1&&(this.pos+=v[0].length),v)}},qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Le(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var s=i.children[r],v=s.chunkSize();if(t=e.first&&ti?ie(i,Le(e,i).text.length):fn(t,Le(e,t.line).text.length)}function fn(e,t){var i=e.ch;return i==null||i>t?ie(e.line,t):i<0?ie(e.line,0):e}function Ni(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},rr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},rr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},rr.fromSaved=function(e,t,i){return t instanceof fi?new rr(e,zt(e.mode,t.state),i,t.lookAhead):new rr(e,zt(e.mode,t),i)},rr.prototype.save=function(e){var t=e!==!1?zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fi(t,this.maxLookAhead):t};function ji(e,t,i,r){var s=[e.state.modeGen],v={};vn(e,t.text,e.doc.mode,i,function(N,K){return s.push(N,K)},v,r);for(var L=i.state,O=function(N){i.baseTokens=s;var K=e.state.overlays[N],X=1,Q=0;i.state=!0,vn(e,t.text,K.mode,i,function(J,oe){for(var ue=X;QJ&&s.splice(X,1,J,s[X+1],pe),X+=2,Q=Math.min(J,pe)}if(oe)if(K.opaque)s.splice(ue,X-ue,J,"overlay "+oe),X=ue+2;else for(;uee.options.maxHighlightLength&&zt(e.doc.mode,r.state),v=ji(e,t,r);s&&(r.state=s),t.stateAfter=r.save(!s),t.styles=v.styles,v.classes?t.styleClasses=v.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Qr(e,t,i){var r=e.doc,s=e.display;if(!r.mode.startState)return new rr(r,!0,t);var v=Un(e,t,i),L=v>r.first&&Le(r,v-1).stateAfter,O=L?rr.fromSaved(r,L,v):new rr(r,Br(r.mode),v);return r.iter(v,t,function(P){Ci(e,P.text,O);var N=O.line;P.stateAfter=N==t-1||N%5==0||N>=s.viewFrom&&Nt.start)return v}throw new Error("Mode "+e.name+" failed to advance stream.")}var dn=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function zn(e,t,i,r){var s=e.doc,v=s.mode,L;t=Oe(s,t);var O=Le(s,t.line),P=Qr(e,t.line,i),N=new qe(O.text,e.options.tabSize,P),K;for(r&&(K=[]);(r||N.pose.options.maxHighlightLength?(O=!1,L&&Ci(e,t,r,K.pos),K.pos=t.length,X=null):X=pn(wi(i,K,r.state,Q),v),Q){var J=Q[0].name;J&&(X="m-"+(X?J+" "+X:J))}if(!O||N!=X){for(;PL;--O){if(O<=v.first)return v.first;var P=Le(v,O-1),N=P.stateAfter;if(N&&(!i||O+(N instanceof fi?N.lookAhead:0)<=v.modeFrontier))return O;var K=$(P.text,null,e.options.tabSize);(s==null||r>K)&&(s=O-1,r=K)}return s}function qn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var s=Le(e,r).stateAfter;if(s&&(!(s instanceof fi)||r+s.lookAhead=t:v.to>t);(r||(r=[])).push(new Ut(L,v.from,P?null:v.to))}}return r}function Li(e,t,i){var r;if(e)for(var s=0;s=t:v.to>t);if(O||v.from==t&&L.type=="bookmark"&&(!i||v.marker.insertLeft)){var P=v.from==null||(L.inclusiveLeft?v.from<=t:v.from0&&O)for(var Ce=0;Ce0)){var K=[P,1],X=be(N.from,O.from),Q=be(N.to,O.to);(X<0||!L.inclusiveLeft&&!X)&&K.push({from:N.from,to:O.from}),(Q>0||!L.inclusiveRight&&!Q)&&K.push({from:O.to,to:N.to}),s.splice.apply(s,K),P+=K.length-3}}return s}function qr(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||ct(r,v.marker)<0)&&(r=v.marker)}return r}function _r(e,t,i,r,s){var v=Le(e,t),L=re&&v.markedSpans;if(L)for(var O=0;O=0&&X<=0||K<=0&&X>=0)&&(K<=0&&(P.marker.inclusiveRight&&s.inclusiveLeft?be(N.to,i)>=0:be(N.to,i)>0)||K>=0&&(P.marker.inclusiveRight&&s.inclusiveLeft?be(N.from,r)<=0:be(N.from,r)<0)))return!0}}}function yt(e){for(var t;t=_t(e);)e=t.find(-1,!0).line;return e}function yr(e){for(var t;t=ut(e);)e=t.find(1,!0).line;return e}function hi(e){for(var t,i;t=ut(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function xr(e,t){var i=Le(e,t),r=yt(i);return i==r?t:j(r)}function kr(e,t){if(t>e.lastLine())return t;var i=Le(e,t),r;if(!qt(e,i))return t;for(;r=ut(i);)i=r.find(1,!0).line;return j(i)+1}function qt(e,t){var i=re&&t.markedSpans;if(i){for(var r=void 0,s=0;st.maxLineLength&&(t.maxLineLength=s,t.maxLine=r)})}var Ui=function(e,t,i){this.text=e,Pr(this,t),this.height=i?i(this):1};Ui.prototype.lineNo=function(){return j(this)},Ot(Ui);function Nc(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),qr(e),Pr(e,i);var s=r?r(e):1;s!=e.height&&Lt(e,s)}function jc(e){e.parent=null,qr(e)}var zc={},Uc={};function Qs(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Uc:zc;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function ea(e,t){var i=H("span",null,null,g?"padding-right: .1px":null),r={pre:H("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var s=0;s<=(t.rest?t.rest.length:0);s++){var v=s?t.rest[s-1]:t.line,L=void 0;r.pos=0,r.addToken=Kc,dr(e.display.measure)&&(L=Be(v,e.doc.direction))&&(r.addToken=Zc(r.addToken,L)),r.map=[];var O=t!=e.display.externalMeasured&&j(v);Xc(v,r,zi(e,v,O)),v.styleClasses&&(v.styleClasses.bgClass&&(r.bgClass=ce(v.styleClasses.bgClass,r.bgClass||"")),v.styleClasses.textClass&&(r.textClass=ce(v.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild($r(e.display.measure))),s==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(g){var P=r.content.lastChild;(/\bcm-tab\b/.test(P.className)||P.querySelector&&P.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ze(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=ce(r.pre.className,r.textClass||"")),r}function qc(e){var t=A("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Kc(e,t,i,r,s,v,L){if(t){var O=e.splitSpaces?Gc(t,e.trailingSpace):t,P=e.cm.state.specialChars,N=!1,K;if(!P.test(t))e.col+=t.length,K=document.createTextNode(O),e.map.push(e.pos,e.pos+t.length,K),y&&_<9&&(N=!0),e.pos+=t.length;else{K=document.createDocumentFragment();for(var X=0;;){P.lastIndex=X;var Q=P.exec(t),J=Q?Q.index-X:t.length-X;if(J){var oe=document.createTextNode(O.slice(X,X+J));y&&_<9?K.appendChild(A("span",[oe])):K.appendChild(oe),e.map.push(e.pos,e.pos+J,oe),e.col+=J,e.pos+=J}if(!Q)break;X+=J+1;var ue=void 0;if(Q[0]==" "){var pe=e.cm.options.tabSize,ye=pe-e.col%pe;ue=K.appendChild(A("span",je(ye),"cm-tab")),ue.setAttribute("role","presentation"),ue.setAttribute("cm-text"," "),e.col+=ye}else Q[0]=="\r"||Q[0]==` +`?(ue=K.appendChild(A("span",Q[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ue.setAttribute("cm-text",Q[0]),e.col+=1):(ue=e.cm.options.specialCharPlaceholder(Q[0]),ue.setAttribute("cm-text",Q[0]),y&&_<9?K.appendChild(A("span",[ue])):K.appendChild(ue),e.col+=1);e.map.push(e.pos,e.pos+1,ue),e.pos++}}if(e.trailingSpace=O.charCodeAt(t.length-1)==32,i||r||s||N||v||L){var Se=i||"";r&&(Se+=r),s&&(Se+=s);var me=A("span",[K],Se,v);if(L)for(var Ce in L)L.hasOwnProperty(Ce)&&Ce!="style"&&Ce!="class"&&me.setAttribute(Ce,L[Ce]);return e.content.appendChild(me)}e.content.appendChild(K)}}function Gc(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",s=0;sN&&X.from<=N));Q++);if(X.to>=K)return e(i,r,s,v,L,O,P);e(i,r.slice(0,X.to-N),s,v,null,O,P),v=null,r=r.slice(X.to-N),N=X.to}}}function ta(e,t,i,r){var s=!r&&i.widgetNode;s&&e.map.push(e.pos,e.pos+t,s),!r&&e.cm.display.input.needsContentAttribute&&(s||(s=e.content.appendChild(document.createElement("span"))),s.setAttribute("cm-marker",i.id)),s&&(e.cm.display.input.setUneditable(s),e.content.appendChild(s)),e.pos+=t,e.trailingSpace=!1}function Xc(e,t,i){var r=e.markedSpans,s=e.text,v=0;if(!r){for(var L=1;LP||Pe.collapsed&&Ae.to==P&&Ae.from==P)){if(Ae.to!=null&&Ae.to!=P&&J>Ae.to&&(J=Ae.to,ue=""),Pe.className&&(oe+=" "+Pe.className),Pe.css&&(Q=(Q?Q+";":"")+Pe.css),Pe.startStyle&&Ae.from==P&&(pe+=" "+Pe.startStyle),Pe.endStyle&&Ae.to==J&&(Ce||(Ce=[])).push(Pe.endStyle,Ae.to),Pe.title&&((Se||(Se={})).title=Pe.title),Pe.attributes)for(var Ke in Pe.attributes)(Se||(Se={}))[Ke]=Pe.attributes[Ke];Pe.collapsed&&(!ye||ct(ye.marker,Pe)<0)&&(ye=Ae)}else Ae.from>P&&J>Ae.from&&(J=Ae.from)}if(Ce)for(var Ct=0;Ct=O)break;for(var ar=Math.min(O,J);;){if(K){var Zt=P+K.length;if(!ye){var st=Zt>ar?K.slice(0,ar-P):K;t.addToken(t,st,X?X+oe:oe,pe,P+st.length==J?ue:"",Q,Se)}if(Zt>=ar){K=K.slice(ar-P),P=ar;break}P=Zt,pe=""}K=s.slice(v,v=i[N++]),X=Qs(i[N++],t.cm.options)}}}function ra(e,t,i){this.line=t,this.rest=hi(t),this.size=this.rest?j(Re(this.rest))-i+1:1,this.node=this.text=null,this.hidden=qt(e,t)}function Kn(e,t,i){for(var r=[],s,v=t;v2&&v.push((P.bottom+N.top)/2-i.top)}}v.push(i.bottom-i.top)}}function ca(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[s],cache:e.measure.caches[s],before:!0}}}function ou(e,t){t=yt(t);var i=j(t),r=e.display.externalMeasured=new ra(e.doc,t,i);r.lineN=i;var s=r.built=ea(e,r);return r.text=s.pre,I(e.display.lineMeasure,s.pre),r}function ua(e,t,i,r){return Zr(e,Ki(e,t),i,r)}function Oo(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(v=P-O,s=v-1,t>=P&&(L="right")),s!=null){if(r=e[N+2],O==P&&i==(r.insertLeft?"left":"right")&&(L=i),i=="left"&&s==0)for(;N&&e[N-2]==e[N-3]&&e[N-1].insertLeft;)r=e[(N-=3)+2],L="left";if(i=="right"&&s==P-O)for(;N=0&&(i=e[s]).left==i.right;s--);return i}function au(e,t,i,r){var s=ha(t.map,i,r),v=s.node,L=s.start,O=s.end,P=s.collapse,N;if(v.nodeType==3){for(var K=0;K<4;K++){for(;L&&Xe(t.line.text.charAt(s.coverStart+L));)--L;for(;s.coverStart+O0&&(P=r="right");var X;e.options.lineWrapping&&(X=v.getClientRects()).length>1?N=X[r=="right"?X.length-1:0]:N=v.getBoundingClientRect()}if(y&&_<9&&!L&&(!N||!N.left&&!N.right)){var Q=v.parentNode.getClientRects()[0];Q?N={left:Q.left,right:Q.left+Zi(e.display),top:Q.top,bottom:Q.bottom}:N=fa}for(var J=N.top-t.rect.top,oe=N.bottom-t.rect.top,ue=(J+oe)/2,pe=t.view.measure.heights,ye=0;ye=r.text.length?(P=r.text.length,N="before"):P<=0&&(P=0,N="after"),!O)return L(N=="before"?P-1:P,N=="before");function K(oe,ue,pe){var ye=O[ue],Se=ye.level==1;return L(pe?oe-1:oe,Se!=pe)}var X=fr(O,P,N),Q=Cr,J=K(P,X,N=="before");return Q!=null&&(J.other=K(P,Q,N!="before")),J}function ya(e,t){var i=0;t=Oe(e.doc,t),e.options.lineWrapping||(i=Zi(e.display)*t.ch);var r=Le(e.doc,t.line),s=ft(r)+Gn(e.display);return{left:i,right:i,top:s,bottom:s+r.height}}function Bo(e,t,i,r,s){var v=ie(e,t,i);return v.xRel=s,r&&(v.outside=r),v}function Po(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return Bo(r.first,0,null,-1,-1);var s=Z(r,i),v=r.first+r.size-1;if(s>v)return Bo(r.first+r.size-1,Le(r,v).text.length,null,1,1);t<0&&(t=0);for(var L=Le(r,s);;){var O=cu(e,L,s,t,i),P=nr(L,O.ch+(O.xRel>0||O.outside>0?1:0));if(!P)return O;var N=P.find(1);if(N.line==s)return N;L=Le(r,s=N.line)}}function ma(e,t,i,r){r-=Do(t);var s=t.text.length,v=Qt(function(L){return Zr(e,i,L-1).bottom<=r},s,0);return s=Qt(function(L){return Zr(e,i,L).top>r},v,s),{begin:v,end:s}}function ba(e,t,i,r){i||(i=Ki(e,t));var s=Zn(e,t,Zr(e,i,r),"line").top;return ma(e,t,i,s)}function Io(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function cu(e,t,i,r,s){s-=ft(t);var v=Ki(e,t),L=Do(t),O=0,P=t.text.length,N=!0,K=Be(t,e.doc.direction);if(K){var X=(e.options.lineWrapping?fu:uu)(e,t,i,v,K,r,s);N=X.level!=1,O=N?X.from:X.to-1,P=N?X.to:X.from-1}var Q=null,J=null,oe=Qt(function(Me){var Ae=Zr(e,v,Me);return Ae.top+=L,Ae.bottom+=L,Io(Ae,r,s,!1)?(Ae.top<=s&&Ae.left<=r&&(Q=Me,J=Ae),!0):!1},O,P),ue,pe,ye=!1;if(J){var Se=r-J.left=Ce.bottom?1:0}return oe=Sr(t.text,oe,1),Bo(i,oe,pe,ye,r-ue)}function uu(e,t,i,r,s,v,L){var O=Qt(function(X){var Q=s[X],J=Q.level!=1;return Io(Ir(e,ie(i,J?Q.to:Q.from,J?"before":"after"),"line",t,r),v,L,!0)},0,s.length-1),P=s[O];if(O>0){var N=P.level!=1,K=Ir(e,ie(i,N?P.from:P.to,N?"after":"before"),"line",t,r);Io(K,v,L,!0)&&K.top>L&&(P=s[O-1])}return P}function fu(e,t,i,r,s,v,L){var O=ma(e,t,r,L),P=O.begin,N=O.end;/\s/.test(t.text.charAt(N-1))&&N--;for(var K=null,X=null,Q=0;Q=N||J.to<=P)){var oe=J.level!=1,ue=Zr(e,r,oe?Math.min(N,J.to)-1:Math.max(P,J.from)).right,pe=uepe)&&(K=J,X=pe)}}return K||(K=s[s.length-1]),K.fromN&&(K={from:K.from,to:N,level:K.level}),K}var Ei;function Gi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ei==null){Ei=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ei.appendChild(document.createTextNode("x")),Ei.appendChild(A("br"));Ei.appendChild(document.createTextNode("x"))}I(e.measure,Ei);var i=Ei.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),W(e.measure),i||1}function Zi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),i=A("pre",[t],"CodeMirror-line-like");I(e.measure,i);var r=t.getBoundingClientRect(),s=(r.right-r.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function Ho(e){for(var t=e.display,i={},r={},s=t.gutters.clientLeft,v=t.gutters.firstChild,L=0;v;v=v.nextSibling,++L){var O=e.display.gutterSpecs[L].className;i[O]=v.offsetLeft+v.clientLeft+s,r[O]=v.clientWidth}return{fixedPos:Fo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Sa(e){var t=Gi(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Zi(e.display)-3);return function(s){if(qt(e.doc,s))return 0;var v=0;if(s.widgets)for(var L=0;L0&&(N=Le(e.doc,P.line).text).length==P.ch){var K=$(N,N.length,e.options.tabSize)-N.length;P=ie(P.line,Math.max(0,Math.round((v-la(e.display).left)/Zi(e.display))-K))}return P}function Ai(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(s.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=s.viewTo)re&&xr(e.doc,t)s.viewFrom?pi(e):(s.viewFrom+=r,s.viewTo+=r);else if(t<=s.viewFrom&&i>=s.viewTo)pi(e);else if(t<=s.viewFrom){var v=Yn(e,i,i+r,1);v?(s.view=s.view.slice(v.index),s.viewFrom=v.lineN,s.viewTo+=r):pi(e)}else if(i>=s.viewTo){var L=Yn(e,t,t,-1);L?(s.view=s.view.slice(0,L.index),s.viewTo=L.lineN):pi(e)}else{var O=Yn(e,t,t,-1),P=Yn(e,i,i+r,1);O&&P?(s.view=s.view.slice(0,O.index).concat(Kn(e,O.lineN,P.lineN)).concat(s.view.slice(P.index)),s.viewTo+=r):pi(e)}var N=s.externalMeasured;N&&(i=s.lineN&&t=r.viewTo)){var v=r.view[Ai(e,t)];if(v.node!=null){var L=v.changes||(v.changes=[]);ge(L,i)==-1&&L.push(i)}}}function pi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Yn(e,t,i,r){var s=Ai(e,t),v,L=e.display.view;if(!re||i==e.doc.first+e.doc.size)return{index:s,lineN:i};for(var O=e.display.viewFrom,P=0;P0){if(s==L.length-1)return null;v=O+L[s].size-t,s++}else v=O-t;t+=v,i+=v}for(;xr(e.doc,i)!=i;){if(s==(r<0?0:L.length-1))return null;i+=r*L[s-(r<0?1:0)].size,s+=r}return{index:s,lineN:i}}function hu(e,t,i){var r=e.display,s=r.view;s.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Kn(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Kn(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,Ai(e,i)))),r.viewTo=i}function Ca(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||P.to().line0?L:e.defaultCharWidth())+"px"}if(r.other){var O=i.appendChild(A("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));O.style.display="",O.style.left=r.other.left+"px",O.style.top=r.other.top+"px",O.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Vn(e,t){return e.top-t.top||e.left-t.left}function du(e,t,i){var r=e.display,s=e.doc,v=document.createDocumentFragment(),L=la(e.display),O=L.left,P=Math.max(r.sizerWidth,ki(e)-r.sizer.offsetLeft)-L.right,N=s.direction=="ltr";function K(me,Ce,Me,Ae){Ce<0&&(Ce=0),Ce=Math.round(Ce),Ae=Math.round(Ae),v.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+me+`px; + top: `+Ce+"px; width: "+(Me??P-me)+`px; + height: `+(Ae-Ce)+"px"))}function X(me,Ce,Me){var Ae=Le(s,me),Pe=Ae.text.length,Ke,Ct;function Ve(st,Xt){return Xn(e,ie(me,st),"div",Ae,Xt)}function ar(st,Xt,xt){var ht=ba(e,Ae,null,st),at=Xt=="ltr"==(xt=="after")?"left":"right",Qe=xt=="after"?ht.begin:ht.end-(/\s/.test(Ae.text.charAt(ht.end-1))?2:1);return Ve(Qe,at)[at]}var Zt=Be(Ae,s.direction);return ur(Zt,Ce||0,Me??Pe,function(st,Xt,xt,ht){var at=xt=="ltr",Qe=Ve(st,at?"left":"right"),Yt=Ve(Xt-1,at?"right":"left"),an=Ce==null&&st==0,bi=Me==null&&Xt==Pe,Rt=ht==0,Xr=!Zt||ht==Zt.length-1;if(Yt.top-Qe.top<=3){var wt=(N?an:bi)&&Rt,ds=(N?bi:an)&&Xr,ni=wt?O:(at?Qe:Yt).left,Bi=ds?P:(at?Yt:Qe).right;K(ni,Qe.top,Bi-ni,Qe.bottom)}else{var Pi,Wt,ln,ps;at?(Pi=N&&an&&Rt?O:Qe.left,Wt=N?P:ar(st,xt,"before"),ln=N?O:ar(Xt,xt,"after"),ps=N&&bi&&Xr?P:Yt.right):(Pi=N?ar(st,xt,"before"):O,Wt=!N&&an&&Rt?P:Qe.right,ln=!N&&bi&&Xr?O:Yt.left,ps=N?ar(Xt,xt,"after"):P),K(Pi,Qe.top,Wt-Pi,Qe.bottom),Qe.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Xi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function La(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Uo(e))}function zo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Xi(e))},100)}function Uo(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(ze(e,"focus",e,t),e.state.focused=!0,te(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),jo(e))}function Xi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ze(e,"blur",e,t),e.state.focused=!1,D(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function $n(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),s=t.lineDiv.getBoundingClientRect().top,v=0,L=0;L.005||J<-.005)&&(se.display.sizerWidth){var ue=Math.ceil(K/Zi(e.display));ue>e.display.maxLineLength&&(e.display.maxLineLength=ue,e.display.maxLine=O.line,e.display.maxLineChanged=!0)}}}Math.abs(v)>2&&(t.scroller.scrollTop+=v)}function xa(e){if(e.widgets)for(var t=0;t=L&&(v=Z(t,ft(Le(t,P))-e.wrapper.clientHeight),L=P)}return{from:v,to:Math.max(L,v+1)}}function pu(e,t){if(!Ue(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),s=null,v=i.wrapper.ownerDocument;if(t.top+r.top<0?s=!0:t.bottom+r.top>(v.defaultView.innerHeight||v.documentElement.clientHeight)&&(s=!1),s!=null&&!c){var L=A("div","\u200B",null,`position: absolute; + top: `+(t.top-i.viewOffset-Gn(e.display))+`px; + height: `+(t.bottom-t.top+Gr(e)+i.barHeight)+`px; + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(L),L.scrollIntoView(s),e.display.lineSpace.removeChild(L)}}}function vu(e,t,i,r){r==null&&(r=0);var s;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?ie(t.line,t.ch+1,"before"):t,t=t.ch?ie(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var v=0;v<5;v++){var L=!1,O=Ir(e,t),P=!i||i==t?O:Ir(e,i);s={left:Math.min(O.left,P.left),top:Math.min(O.top,P.top)-r,right:Math.max(O.left,P.left),bottom:Math.max(O.bottom,P.bottom)+r};var N=qo(e,s),K=e.doc.scrollTop,X=e.doc.scrollLeft;if(N.scrollTop!=null&&(Cn(e,N.scrollTop),Math.abs(e.doc.scrollTop-K)>1&&(L=!0)),N.scrollLeft!=null&&(Mi(e,N.scrollLeft),Math.abs(e.doc.scrollLeft-X)>1&&(L=!0)),!L)break}return s}function gu(e,t){var i=qo(e,t);i.scrollTop!=null&&Cn(e,i.scrollTop),i.scrollLeft!=null&&Mi(e,i.scrollLeft)}function qo(e,t){var i=e.display,r=Gi(e.display);t.top<0&&(t.top=0);var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,v=Ro(e),L={};t.bottom-t.top>v&&(t.bottom=t.top+v);var O=e.doc.height+Mo(i),P=t.topO-r;if(t.tops+v){var K=Math.min(t.top,(N?O:t.bottom)-v);K!=s&&(L.scrollTop=K)}var X=e.options.fixedGutter?0:i.gutters.offsetWidth,Q=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-X,J=ki(e)-i.gutters.offsetWidth,oe=t.right-t.left>J;return oe&&(t.right=t.left+J),t.left<10?L.scrollLeft=0:t.leftJ+Q-3&&(L.scrollLeft=t.right+(oe?0:10)-J),L}function Ko(e,t){t!=null&&(Qn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Yi(e){Qn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Sn(e,t,i){(t!=null||i!=null)&&Qn(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function _u(e,t){Qn(e),e.curOp.scrollToPos=t}function Qn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=ya(e,t.from),r=ya(e,t.to);ka(e,i,r,t.margin)}}function ka(e,t,i,r){var s=qo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});Sn(e,s.scrollLeft,s.scrollTop)}function Cn(e,t){Math.abs(e.doc.scrollTop-t)<2||(R||Zo(e,{top:t}),Ea(e,t,!0),R&&Zo(e),xn(e,100))}function Ea(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Mi(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Oa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function wn(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+Mo(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Gr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Ri=function(e,t,i){this.cm=i;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=s.tabIndex=-1,e(r),e(s),Te(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Te(s,"scroll",function(){s.clientWidth&&t(s.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,y&&_<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ri.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var s=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+s)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var v=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+v)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},Ri.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ri.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ri.prototype.zeroWidthHack=function(){var e=a&&!b?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ie,this.disableVert=new Ie},Ri.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var s=e.getBoundingClientRect(),v=i=="vert"?document.elementFromPoint(s.right-1,(s.top+s.bottom)/2):document.elementFromPoint((s.right+s.left)/2,s.bottom-1);v!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Ri.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ln=function(){};Ln.prototype.update=function(){return{bottom:0,right:0}},Ln.prototype.setScrollLeft=function(){},Ln.prototype.setScrollTop=function(){},Ln.prototype.clear=function(){};function Vi(e,t){t||(t=wn(e));var i=e.display.barWidth,r=e.display.barHeight;Ta(e,t);for(var s=0;s<4&&i!=e.display.barWidth||r!=e.display.barHeight;s++)i!=e.display.barWidth&&e.options.lineWrapping&&$n(e),Ta(e,wn(e)),i=e.display.barWidth,r=e.display.barHeight}function Ta(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Aa={native:Ri,null:Ln};function Ma(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Aa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Te(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Mi(e,t):Cn(e,t)},e),e.display.scrollbars.addClass&&te(e.display.wrapper,e.display.scrollbars.addClass)}var yu=0;function Oi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++yu,markArrays:null},Yc(e.curOp)}function Di(e){var t=e.curOp;t&&$c(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new eo(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Su(e){e.updatedDisplay=e.mustUpdate&&Go(e.cm,e.update)}function Cu(e){var t=e.cm,i=t.display;e.updatedDisplay&&$n(t),e.barMeasure=wn(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ua(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Gr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-ki(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function wu(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Qr(e,t.highlightFrontier),s=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(v){if(r.line>=e.display.viewFrom){var L=v.styles,O=v.text.length>e.options.maxHighlightLength?zt(t.mode,r.state):null,P=ji(e,v,r,!0);O&&(r.state=O),v.styles=P.styles;var N=v.styleClasses,K=P.classes;K?v.styleClasses=K:N&&(v.styleClasses=null);for(var X=!L||L.length!=v.styles.length||N!=K&&(!N||!K||N.bgClass!=K.bgClass||N.textClass!=K.textClass),Q=0;!X&&Qi)return xn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),s.length&&sr(e,function(){for(var v=0;v=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Ca(e)==0)return!1;Da(e)&&(pi(e),t.dims=Ho(e));var s=r.first+r.size,v=Math.max(t.visible.from-e.options.viewportMargin,r.first),L=Math.min(s,t.visible.to+e.options.viewportMargin);i.viewFromL&&i.viewTo-L<20&&(L=Math.min(s,i.viewTo)),re&&(v=xr(e.doc,v),L=kr(e.doc,L));var O=v!=i.viewFrom||L!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;hu(e,v,L),i.viewOffset=ft(Le(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var P=Ca(e);if(!O&&P==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var N=Eu(e);return P>4&&(i.lineDiv.style.display="none"),Au(e,i.updateLineNumbers,t.dims),P>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Tu(N),W(i.cursorDiv),W(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,O&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,xn(e,400)),i.updateLineNumbers=null,!0}function Ra(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ki(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Mo(e.display)-Ro(e),i.top)}),t.visible=Jn(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Jn(e.display,e.doc,i));if(!Go(e,t))break;$n(e);var s=wn(e);bn(e),Vi(e,s),Yo(e,s),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Zo(e,t){var i=new eo(e,t);if(Go(e,i)){$n(e),Ra(e,i);var r=wn(e);bn(e),Vi(e,r),Yo(e,r),i.finish()}}function Au(e,t,i){var r=e.display,s=e.options.lineNumbers,v=r.lineDiv,L=v.firstChild;function O(oe){var ue=oe.nextSibling;return g&&a&&e.display.currentWheelTarget==oe?oe.style.display="none":oe.parentNode.removeChild(oe),ue}for(var P=r.view,N=r.viewFrom,K=0;K-1&&(J=!1),ia(e,X,N,i)),J&&(W(X.lineNumber),X.lineNumber.appendChild(document.createTextNode(he(e.options,N)))),L=X.node.nextSibling}N+=X.size}for(;L;)L=O(L)}function Xo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",mt(e,"gutterChanged",e)}function Yo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Gr(e)+"px"}function Oa(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Fo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,s=t.gutters.offsetWidth,v=r+"px",L=0;L=105&&(s.wrapper.style.clipPath="inset(0px)"),s.wrapper.setAttribute("translate","no"),y&&_<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),!g&&!(R&&n)&&(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=Vo(r.gutters,r.lineNumbers),Ba(s),i.init(s)}var to=0,ri=null;y?ri=-.53:R?ri=15:C?ri=-.7:w&&(ri=-1/3);function Pa(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function Ru(e){var t=Pa(e);return t.x*=ri,t.y*=ri,t}function Ia(e,t){C&&u==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=Pa(t),r=i.x,s=i.y,v=ri;t.deltaMode===0&&(r=t.deltaX,s=t.deltaY,v=1);var L=e.display,O=L.scroller,P=O.scrollWidth>O.clientWidth,N=O.scrollHeight>O.clientHeight;if(r&&P||s&&N){if(s&&a&&g){e:for(var K=t.target,X=L.view;K!=O;K=K.parentNode)for(var Q=0;Q=0&&be(e,r.to())<=0)return i}return-1};var Fe=function(e,t){this.anchor=e,this.head=t};Fe.prototype.from=function(){return Ur(this.anchor,this.head)},Fe.prototype.to=function(){return vt(this.anchor,this.head)},Fe.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Hr(e,t,i){var r=e&&e.options.selectionsMayTouch,s=t[i];t.sort(function(Q,J){return be(Q.from(),J.from())}),i=ge(t,s);for(var v=1;v0:P>=0){var N=Ur(O.from(),L.from()),K=vt(O.to(),L.to()),X=O.empty()?L.from()==L.head:O.from()==O.head;v<=i&&--i,t.splice(--v,2,new Fe(X?K:N,X?N:K))}}return new mr(t,i)}function vi(e,t){return new mr([new Fe(e,t||e)],0)}function gi(e){return e.text?ie(e.from.line+e.text.length-1,Re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ha(e,t){if(be(e,t.from)<0)return e;if(be(e,t.to)<=0)return gi(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=gi(t).ch-t.to.ch),ie(i,r)}function $o(e,t){for(var i=[],r=0;r1&&e.remove(O.line+1,oe-1),e.insert(O.line+1,ye)}mt(e,"change",e,t)}function _i(e,t,i){function r(s,v,L){if(s.linked)for(var O=0;O1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Re(e.done)}function Ua(e,t,i,r){var s=e.history;s.undone.length=0;var v=+new Date,L,O;if((s.lastOp==r||s.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&s.lastModTime>v-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(L=Bu(s,s.lastOp==r)))O=Re(L.changes),be(t.from,t.to)==0&&be(t.from,O.to)==0?O.to=gi(t):L.changes.push(es(e,t));else{var P=Re(s.done);for((!P||!P.ranges)&&io(e.sel,s.done),L={changes:[es(e,t)],generation:s.generation},s.done.push(L);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift()}s.done.push(i),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=v,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,O||ze(e,"historyAdded")}function Pu(e,t,i,r){var s=t.charAt(0);return s=="*"||s=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Iu(e,t,i,r){var s=e.history,v=r&&r.origin;i==s.lastSelOp||v&&s.lastSelOrigin==v&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==v||Pu(e,v,Re(s.done),t))?s.done[s.done.length-1]=t:io(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=v,s.lastSelOp=i,r&&r.clearRedo!==!1&&za(s.undone)}function io(e,t){var i=Re(t);i&&i.ranges&&i.equals(e)||t.push(e)}function qa(e,t,i,r){var s=t["spans_"+e.id],v=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(L){L.markedSpans&&((s||(s=t["spans_"+e.id]={}))[v]=L.markedSpans),++v})}function Hu(e){if(!e)return null;for(var t,i=0;i-1&&(Re(O)[X]=N[X],delete N[X])}}return r}function ts(e,t,i,r){if(r){var s=e.anchor;if(i){var v=be(t,s)<0;v!=be(i,s)<0?(s=t,t=i):v!=be(t,i)<0&&(t=i)}return new Fe(s,t)}else return new Fe(i||t,t)}function no(e,t,i,r,s){s==null&&(s=e.cm&&(e.cm.display.shift||e.extend)),Mt(e,new mr([ts(e.sel.primary(),t,i,s)],0),r)}function Ga(e,t,i){for(var r=[],s=e.cm&&(e.cm.display.shift||e.extend),v=0;v=t.ch:O.to>t.ch))){if(s&&(ze(P,"beforeCursorEnter"),P.explicitlyCleared))if(v.markedSpans){--L;continue}else break;if(!P.atomic)continue;if(i){var X=P.find(r<0?1:-1),Q=void 0;if((r<0?K:N)&&(X=Ja(e,X,-r,X&&X.line==t.line?v:null)),X&&X.line==t.line&&(Q=be(X,i))&&(r<0?Q<0:Q>0))return Ji(e,X,t,r,s)}var J=P.find(r<0?-1:1);return(r<0?N:K)&&(J=Ja(e,J,r,J.line==t.line?v:null)),J?Ji(e,J,t,r,s):null}}return t}function so(e,t,i,r,s){var v=r||1,L=Ji(e,t,i,v,s)||!s&&Ji(e,t,i,v,!0)||Ji(e,t,i,-v,s)||!s&&Ji(e,t,i,-v,!0);return L||(e.cantEdit=!0,ie(e.first,0))}function Ja(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?Oe(e,ie(t.line-1)):null:i>0&&t.ch==(r||Le(e,t.line)).text.length?t.line=0;--s)tl(e,{from:r[s].from,to:r[s].to,text:s?[""]:t.text,origin:t.origin});else tl(e,t)}}function tl(e,t){if(!(t.text.length==1&&t.text[0]==""&&be(t.from,t.to)==0)){var i=$o(e,t);Ua(e,t,i,e.cm?e.cm.curOp.id:NaN),Tn(e,t,i,Ge(e,t));var r=[];_i(e,function(s,v){!v&&ge(r,s.history)==-1&&(ol(s.history,t),r.push(s.history)),Tn(s,t,null,Ge(s,t))})}}function ao(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var s=e.history,v,L=e.sel,O=t=="undo"?s.done:s.undone,P=t=="undo"?s.undone:s.done,N=0;N=0;--J){var oe=Q(J);if(oe)return oe.v}}}}function rl(e,t){if(t!=0&&(e.first+=t,e.sel=new mr(Ze(e.sel.ranges,function(s){return new Fe(ie(s.anchor.line+t,s.anchor.ch),ie(s.head.line+t,s.head.ch))}),e.sel.primIndex),e.cm)){Kt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.linev&&(t={from:t.from,to:ie(v,Le(e,v).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tr(e,t.from,t.to),i||(i=$o(e,t)),e.cm?Nu(e.cm,t,r):Qo(e,t,r),oo(e,i,Y),e.cantEdit&&so(e,ie(e.firstLine(),0))&&(e.cantEdit=!1)}}function Nu(e,t,i){var r=e.doc,s=e.display,v=t.from,L=t.to,O=!1,P=v.line;e.options.lineWrapping||(P=j(yt(Le(r,v.line))),r.iter(P,L.line+1,function(J){if(J==s.maxLine)return O=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Et(e),Qo(r,t,i,Sa(e)),e.options.lineWrapping||(r.iter(P,v.line+t.text.length,function(J){var oe=Kr(J);oe>s.maxLineLength&&(s.maxLine=J,s.maxLineLength=oe,s.maxLineChanged=!0,O=!1)}),O&&(e.curOp.updateMaxLine=!0)),qn(r,v.line),xn(e,400);var N=t.text.length-(L.line-v.line)-1;t.full?Kt(e):v.line==L.line&&t.text.length==1&&!Wa(e.doc,t)?di(e,v.line,"text"):Kt(e,v.line,L.line+1,N);var K=pt(e,"changes"),X=pt(e,"change");if(X||K){var Q={from:v,to:L,text:t.text,removed:t.removed,origin:t.origin};X&&mt(e,"change",e,Q),K&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Q)}e.display.selForContextMenu=null}function en(e,t,i,r,s){var v;r||(r=i),be(r,i)<0&&(v=[r,i],i=v[0],r=v[1]),typeof t=="string"&&(t=e.splitLines(t)),Qi(e,{from:i,to:r,text:t,origin:s})}function il(e,t,i,r){i1||!(this.children[0]instanceof Mn))){var O=[];this.collapse(O),this.children=[new Mn(O)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var L=s.lines.length%25+25,O=L;O10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=N,e.display.maxLineLength=K,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Kt(e,r,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Va(e.doc)),e&&mt(e,"markerCleared",e,this,r,s),t&&Di(e),this.parent&&this.parent.clear()}},yi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,s=0;s0||L==0&&v.clearWhenEmpty!==!1)return v;if(v.replacedWith&&(v.collapsed=!0,v.widgetNode=H("span",[v.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||v.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(v.widgetNode.insertLeft=!0)),v.collapsed){if(_r(e,t.line,t,i,v)||t.line!=i.line&&_r(e,i.line,t,i,v))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ht()}v.addToHistory&&Ua(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var O=t.line,P=e.cm,N;if(e.iter(O,i.line+1,function(X){P&&v.collapsed&&!P.options.lineWrapping&&yt(X)==P.display.maxLine&&(N=!0),v.collapsed&&O!=t.line&&Lt(X,0),ir(X,new Ut(v,O==t.line?t.ch:null,O==i.line?i.ch:null),e.cm&&e.cm.curOp),++O}),v.collapsed&&e.iter(t.line,i.line+1,function(X){qt(e,X)&&Lt(X,0)}),v.clearOnEnter&&Te(v,"beforeCursorEnter",function(){return v.clear()}),v.readOnly&&(nt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),v.collapsed&&(v.id=++al,v.atomic=!0),P){if(N&&(P.curOp.updateMaxLine=!0),v.collapsed)Kt(P,t.line,i.line+1);else if(v.className||v.startStyle||v.endStyle||v.css||v.attributes||v.title)for(var K=t.line;K<=i.line;K++)di(P,K,"text");v.atomic&&Va(P.doc),mt(P,"markerAdded",P,v)}return v}var Dn=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;P--)Qi(this,r[P]);O?Xa(this,O):this.cm&&Yi(this.cm)}),undo:St(function(){ao(this,"undo")}),redo:St(function(){ao(this,"redo")}),undoSelection:St(function(){ao(this,"undo",!0)}),redoSelection:St(function(){ao(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(s.marker.parent||s.marker)}return t},findMarks:function(e,t,i){e=Oe(this,e),t=Oe(this,t);var r=[],s=e.line;return this.iter(e.line,t.line+1,function(v){var L=v.markedSpans;if(L)for(var O=0;O=P.to||P.from==null&&s!=e.line||P.from!=null&&s==t.line&&P.from>=t.ch)&&(!i||i(P.marker))&&r.push(P.marker.parent||P.marker)}++s}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=v,++i}),Oe(this,ie(i,t))},indexFromPos:function(e){e=Oe(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var K=e.dataTransfer.getData("Text");if(K){var X;if(t.state.draggingText&&!t.state.draggingText.copy&&(X=t.listSelections()),oo(t.doc,vi(i,i)),X)for(var Q=0;Q=0;O--)en(e.doc,"",r[O].from,r[O].to,"+delete");Yi(e)})}function is(e,t,i){var r=Sr(e.text,t+i,i);return r<0||r>e.text.length?null:r}function ns(e,t,i){var r=is(e,t.ch,i);return r==null?null:new ie(t.line,r,i<0?"after":"before")}function os(e,t,i,r,s){if(e){t.doc.direction=="rtl"&&(s=-s);var v=Be(i,t.doc.direction);if(v){var L=s<0?Re(v):v[0],O=s<0==(L.level==1),P=O?"after":"before",N;if(L.level>0||t.doc.direction=="rtl"){var K=Ki(t,i);N=s<0?i.text.length-1:0;var X=Zr(t,K,N).top;N=Qt(function(Q){return Zr(t,K,Q).top==X},s<0==(L.level==1)?L.from:L.to-1,N),P=="before"&&(N=is(i,N,1))}else N=s<0?L.to:L.from;return new ie(r,N,P)}}return new ie(r,s<0?i.text.length:0,s<0?"before":"after")}function ef(e,t,i,r){var s=Be(t,e.doc.direction);if(!s)return ns(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var v=fr(s,i.ch,i.sticky),L=s[v];if(e.doc.direction=="ltr"&&L.level%2==0&&(r>0?L.to>i.ch:L.from=L.from&&Q>=K.begin)){var J=X?"before":"after";return new ie(i.line,Q,J)}}var oe=function(ye,Se,me){for(var Ce=function(Ke,Ct){return Ct?new ie(i.line,O(Ke,1),"before"):new ie(i.line,Ke,"after")};ye>=0&&ye0==(Me.level!=1),Pe=Ae?me.begin:O(me.end,-1);if(Me.from<=Pe&&Pe0?K.end:O(K.begin,-1);return pe!=null&&!(r>0&&pe==t.text.length)&&(ue=oe(r>0?0:s.length-1,r,N(pe)),ue)?ue:null}var In={selectAll:Qa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Y)},killLine:function(e){return nn(e,function(t){if(t.empty()){var i=Le(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)s=new ie(s.line,s.ch+1),e.replaceRange(v.charAt(s.ch-1)+v.charAt(s.ch-2),ie(s.line,s.ch-2),s,"+transpose");else if(s.line>e.doc.first){var L=Le(e.doc,s.line-1).text;L&&(s=new ie(s.line,1),e.replaceRange(v.charAt(0)+e.doc.lineSeparator()+L.charAt(L.length-1),ie(s.line-1,L.length-1),s,"+transpose"))}}i.push(new Fe(s,s))}e.setSelections(i)})},newlineAndIndent:function(e){return sr(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&be(t,this.pos)==0&&i==this.button};var Fn,Wn;function lf(e,t){var i=+new Date;return Wn&&Wn.compare(i,e,t)?(Fn=Wn=null,"triple"):Fn&&Fn.compare(i,e,t)?(Wn=new as(i,e,t),Fn=null,"double"):(Fn=new as(i,e,t),Wn=null,"single")}function wl(e){var t=this,i=t.display;if(!(Ue(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,ti(i,e)){g||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!ls(t,e)){var r=Ti(t,e),s=Dt(e),v=r?lf(r,s):"single";ve(t).focus(),s==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&cf(t,s,r,v,e))&&(s==1?r?ff(t,r,v,e):Wr(e)==i.scroller&&tt(e):s==2?(r&&no(t.doc,r),setTimeout(function(){return i.input.focus()},20)):s==3&&(E?t.display.input.onContextMenu(e):zo(t)))}}}function cf(e,t,i,r,s){var v="Click";return r=="double"?v="Double"+v:r=="triple"&&(v="Triple"+v),v=(t==1?"Left":t==2?"Middle":"Right")+v,Hn(e,pl(v,s),s,function(L){if(typeof L=="string"&&(L=In[L]),!L)return!1;var O=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),O=L(e,i)!=V}finally{e.state.suppressEdits=!1}return O})}function uf(e,t,i){var r=e.getOption("configureMouse"),s=r?r(e,t,i):{};if(s.unit==null){var v=h?i.shiftKey&&i.metaKey:i.altKey;s.unit=v?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(s.extend==null||e.doc.extend)&&(s.extend=e.doc.extend||i.shiftKey),s.addNew==null&&(s.addNew=a?i.metaKey:i.ctrlKey),s.moveOnDrag==null&&(s.moveOnDrag=!(a?i.altKey:i.ctrlKey)),s}function ff(e,t,i,r){y?setTimeout(de(La,e),0):e.curOp.focus=G(_e(e));var s=uf(e,i,r),v=e.doc.sel,L;e.options.dragDrop&&ci&&!e.isReadOnly()&&i=="single"&&(L=v.contains(t))>-1&&(be((L=v.ranges[L]).from(),t)<0||t.xRel>0)&&(be(L.to(),t)>0||t.xRel<0)?hf(e,r,t,s):df(e,r,t,s)}function hf(e,t,i,r){var s=e.display,v=!1,L=bt(e,function(N){g&&(s.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:zo(e)),et(s.wrapper.ownerDocument,"mouseup",L),et(s.wrapper.ownerDocument,"mousemove",O),et(s.scroller,"dragstart",P),et(s.scroller,"drop",L),v||(tt(N),r.addNew||no(e.doc,i,null,null,r.extend),g&&!w||y&&_==9?setTimeout(function(){s.wrapper.ownerDocument.body.focus({preventScroll:!0}),s.input.focus()},20):s.input.focus())}),O=function(N){v=v||Math.abs(t.clientX-N.clientX)+Math.abs(t.clientY-N.clientY)>=10},P=function(){return v=!0};g&&(s.scroller.draggable=!0),e.state.draggingText=L,L.copy=!r.moveOnDrag,Te(s.wrapper.ownerDocument,"mouseup",L),Te(s.wrapper.ownerDocument,"mousemove",O),Te(s.scroller,"dragstart",P),Te(s.scroller,"drop",L),e.state.delayingBlurEvent=!0,setTimeout(function(){return s.input.focus()},20),s.scroller.dragDrop&&s.scroller.dragDrop()}function Ll(e,t,i){if(i=="char")return new Fe(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Fe(ie(t.line,0),Oe(e.doc,ie(t.line+1,0)));var r=i(e,t);return new Fe(r.from,r.to)}function df(e,t,i,r){y&&zo(e);var s=e.display,v=e.doc;tt(t);var L,O,P=v.sel,N=P.ranges;if(r.addNew&&!r.extend?(O=v.sel.contains(i),O>-1?L=N[O]:L=new Fe(i,i)):(L=v.sel.primary(),O=v.sel.primIndex),r.unit=="rectangle")r.addNew||(L=new Fe(i,i)),i=Ti(e,t,!0,!0),O=-1;else{var K=Ll(e,i,r.unit);r.extend?L=ts(L,K.anchor,K.head,r.extend):L=K}r.addNew?O==-1?(O=N.length,Mt(v,Hr(e,N.concat([L]),O),{scroll:!1,origin:"*mouse"})):N.length>1&&N[O].empty()&&r.unit=="char"&&!r.extend?(Mt(v,Hr(e,N.slice(0,O).concat(N.slice(O+1)),0),{scroll:!1,origin:"*mouse"}),P=v.sel):rs(v,O,L,se):(O=0,Mt(v,new mr([L],0),se),P=v.sel);var X=i;function Q(me){if(be(X,me)!=0)if(X=me,r.unit=="rectangle"){for(var Ce=[],Me=e.options.tabSize,Ae=$(Le(v,i.line).text,i.ch,Me),Pe=$(Le(v,me.line).text,me.ch,Me),Ke=Math.min(Ae,Pe),Ct=Math.max(Ae,Pe),Ve=Math.min(i.line,me.line),ar=Math.min(e.lastLine(),Math.max(i.line,me.line));Ve<=ar;Ve++){var Zt=Le(v,Ve).text,st=Ee(Zt,Ke,Me);Ke==Ct?Ce.push(new Fe(ie(Ve,st),ie(Ve,st))):Zt.length>st&&Ce.push(new Fe(ie(Ve,st),ie(Ve,Ee(Zt,Ct,Me))))}Ce.length||Ce.push(new Fe(i,i)),Mt(v,Hr(e,P.ranges.slice(0,O).concat(Ce),O),{origin:"*mouse",scroll:!1}),e.scrollIntoView(me)}else{var Xt=L,xt=Ll(e,me,r.unit),ht=Xt.anchor,at;be(xt.anchor,ht)>0?(at=xt.head,ht=Ur(Xt.from(),xt.anchor)):(at=xt.anchor,ht=vt(Xt.to(),xt.head));var Qe=P.ranges.slice(0);Qe[O]=pf(e,new Fe(Oe(v,ht),at)),Mt(v,Hr(e,Qe,O),se)}}var J=s.wrapper.getBoundingClientRect(),oe=0;function ue(me){var Ce=++oe,Me=Ti(e,me,!0,r.unit=="rectangle");if(Me)if(be(Me,X)!=0){e.curOp.focus=G(_e(e)),Q(Me);var Ae=Jn(s,v);(Me.line>=Ae.to||Me.lineJ.bottom?20:0;Pe&&setTimeout(bt(e,function(){oe==Ce&&(s.scroller.scrollTop+=Pe,ue(me))}),50)}}function pe(me){e.state.selectingText=!1,oe=1/0,me&&(tt(me),s.input.focus()),et(s.wrapper.ownerDocument,"mousemove",ye),et(s.wrapper.ownerDocument,"mouseup",Se),v.history.lastSelOrigin=null}var ye=bt(e,function(me){me.buttons===0||!Dt(me)?pe(me):ue(me)}),Se=bt(e,pe);e.state.selectingText=Se,Te(s.wrapper.ownerDocument,"mousemove",ye),Te(s.wrapper.ownerDocument,"mouseup",Se)}function pf(e,t){var i=t.anchor,r=t.head,s=Le(e.doc,i.line);if(be(i,r)==0&&i.sticky==r.sticky)return t;var v=Be(s);if(!v)return t;var L=fr(v,i.ch,i.sticky),O=v[L];if(O.from!=i.ch&&O.to!=i.ch)return t;var P=L+(O.from==i.ch==(O.level!=1)?0:1);if(P==0||P==v.length)return t;var N;if(r.line!=i.line)N=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var K=fr(v,r.ch,r.sticky),X=K-L||(r.ch-i.ch)*(O.level==1?-1:1);K==P-1||K==P?N=X<0:N=X>0}var Q=v[P+(N?-1:0)],J=N==(Q.level==1),oe=J?Q.from:Q.to,ue=J?"after":"before";return i.ch==oe&&i.sticky==ue?t:new Fe(new ie(i.line,oe,ue),r)}function xl(e,t,i,r){var s,v;if(t.touches)s=t.touches[0].clientX,v=t.touches[0].clientY;else try{s=t.clientX,v=t.clientY}catch{return!1}if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&tt(t);var L=e.display,O=L.lineDiv.getBoundingClientRect();if(v>O.bottom||!pt(e,i))return lt(t);v-=O.top-L.viewOffset;for(var P=0;P=s){var K=Z(e.doc,v),X=e.display.gutterSpecs[P];return ze(e,i,e,K,X.className,t),lt(t)}}}function ls(e,t){return xl(e,t,"gutterClick",!0)}function kl(e,t){ti(e.display,t)||vf(e,t)||Ue(e,t,"contextmenu")||E||e.display.input.onContextMenu(t)}function vf(e,t){return pt(e,"gutterContextMenu")?xl(e,t,"gutterContextMenu",!1):!1}function El(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),mn(e)}var on={toString:function(){return"CodeMirror.Init"}},Tl={},fo={};function gf(e){var t=e.optionHandlers;function i(r,s,v,L){e.defaults[r]=s,v&&(t[r]=L?function(O,P,N){N!=on&&v(O,P,N)}:v)}e.defineOption=i,e.Init=on,i("value","",function(r,s){return r.setValue(s)},!0),i("mode",null,function(r,s){r.doc.modeOption=s,Jo(r)},!0),i("indentUnit",2,Jo,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){En(r),mn(r),Kt(r)},!0),i("lineSeparator",null,function(r,s){if(r.doc.lineSep=s,!!s){var v=[],L=r.doc.first;r.doc.iter(function(P){for(var N=0;;){var K=P.text.indexOf(s,N);if(K==-1)break;N=K+s.length,v.push(ie(L,K))}L++});for(var O=v.length-1;O>=0;O--)en(r.doc,s,v[O],ie(v[O].line,v[O].ch+s.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,s,v){r.state.specialChars=new RegExp(s.source+(s.test(" ")?"":"| "),"g"),v!=on&&r.refresh()}),i("specialCharPlaceholder",qc,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",n?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,s){return r.getInputField().spellcheck=s},!0),i("autocorrect",!1,function(r,s){return r.getInputField().autocorrect=s},!0),i("autocapitalize",!1,function(r,s){return r.getInputField().autocapitalize=s},!0),i("rtlMoveVisually",!d),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){El(r),kn(r)},!0),i("keyMap","default",function(r,s,v){var L=co(s),O=v!=on&&co(v);O&&O.detach&&O.detach(r,L),L.attach&&L.attach(r,O||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,yf,!0),i("gutters",[],function(r,s){r.display.gutterSpecs=Vo(s,r.options.lineNumbers),kn(r)},!0),i("fixedGutter",!0,function(r,s){r.display.gutters.style.left=s?Fo(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Vi(r)},!0),i("scrollbarStyle","native",function(r){Ma(r),Vi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,s){r.display.gutterSpecs=Vo(r.options.gutters,s),kn(r)},!0),i("firstLineNumber",1,kn,!0),i("lineNumberFormatter",function(r){return r},kn,!0),i("showCursorWhenSelecting",!1,bn,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,s){s=="nocursor"&&(Xi(r),r.display.input.blur()),r.display.input.readOnlyChanged(s)}),i("screenReaderLabel",null,function(r,s){s=s===""?null:s,r.display.input.screenReaderLabelChanged(s)}),i("disableInput",!1,function(r,s){s||r.display.input.reset()},!0),i("dragDrop",!0,_f),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,bn,!0),i("singleCursorHeightPerLine",!0,bn,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,En,!0),i("addModeClass",!1,En,!0),i("pollInterval",100),i("undoDepth",200,function(r,s){return r.doc.history.undoDepth=s}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,En,!0),i("moveInputWithCursor",!0,function(r,s){s||r.display.input.resetPosition()}),i("tabindex",null,function(r,s){return r.display.input.getField().tabIndex=s||""}),i("autofocus",null),i("direction","ltr",function(r,s){return r.doc.setDirection(s)},!0),i("phrases",null)}function _f(e,t,i){var r=i&&i!=on;if(!t!=!r){var s=e.display.dragFunctions,v=t?Te:et;v(e.display.scroller,"dragstart",s.start),v(e.display.scroller,"dragenter",s.enter),v(e.display.scroller,"dragover",s.over),v(e.display.scroller,"dragleave",s.leave),v(e.display.scroller,"drop",s.drop)}}function yf(e){e.options.lineWrapping?(te(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(D(e.display.wrapper,"CodeMirror-wrap"),xi(e)),Wo(e),Kt(e),mn(e),setTimeout(function(){return Vi(e)},100)}function Ye(e,t){var i=this;if(!(this instanceof Ye))return new Ye(e,t);this.options=t=t?ke(t):{},ke(Tl,t,!1);var r=t.value;typeof r=="string"?r=new Gt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var s=new Ye.inputStyles[t.inputStyle](this),v=this.display=new Mu(e,r,s,t);v.wrapper.CodeMirror=this,El(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ma(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ie,keySeq:null,specialChars:null},t.autofocus&&!n&&v.input.focus(),y&&_<11&&setTimeout(function(){return i.display.input.reset(!0)},20),mf(this),Yu(),Oi(this),this.curOp.forceUpdate=!0,Na(this,r),t.autofocus&&!n||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Uo(i)},20):Xi(this);for(var L in fo)fo.hasOwnProperty(L)&&fo[L](this,t[L],on);Da(this),t.finishInit&&t.finishInit(this);for(var O=0;O20*20}Te(t.scroller,"touchstart",function(P){if(!Ue(e,P)&&!v(P)&&!ls(e,P)){t.input.ensurePolled(),clearTimeout(i);var N=+new Date;t.activeTouch={start:N,moved:!1,prev:N-r.end<=300?r:null},P.touches.length==1&&(t.activeTouch.left=P.touches[0].pageX,t.activeTouch.top=P.touches[0].pageY)}}),Te(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Te(t.scroller,"touchend",function(P){var N=t.activeTouch;if(N&&!ti(t,P)&&N.left!=null&&!N.moved&&new Date-N.start<300){var K=e.coordsChar(t.activeTouch,"page"),X;!N.prev||L(N,N.prev)?X=new Fe(K,K):!N.prev.prev||L(N,N.prev.prev)?X=e.findWordAt(K):X=new Fe(ie(K.line,0),Oe(e.doc,ie(K.line+1,0))),e.setSelection(X.anchor,X.head),e.focus(),tt(P)}s()}),Te(t.scroller,"touchcancel",s),Te(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Cn(e,t.scroller.scrollTop),Mi(e,t.scroller.scrollLeft,!0),ze(e,"scroll",e))}),Te(t.scroller,"mousewheel",function(P){return Ia(e,P)}),Te(t.scroller,"DOMMouseScroll",function(P){return Ia(e,P)}),Te(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(P){Ue(e,P)||hr(P)},over:function(P){Ue(e,P)||(Xu(e,P),hr(P))},start:function(P){return Zu(e,P)},drop:bt(e,Gu),leave:function(P){Ue(e,P)||ul(e)}};var O=t.input.getField();Te(O,"keyup",function(P){return Sl.call(e,P)}),Te(O,"keydown",bt(e,bl)),Te(O,"keypress",bt(e,Cl)),Te(O,"focus",function(P){return Uo(e,P)}),Te(O,"blur",function(P){return Xi(e,P)})}var cs=[];Ye.defineInitHook=function(e){return cs.push(e)};function Nn(e,t,i,r){var s=e.doc,v;i==null&&(i="add"),i=="smart"&&(s.mode.indent?v=Qr(e,t).state:i="prev");var L=e.options.tabSize,O=Le(s,t),P=$(O.text,null,L);O.stateAfter&&(O.stateAfter=null);var N=O.text.match(/^\s*/)[0],K;if(!r&&!/\S/.test(O.text))K=0,i="not";else if(i=="smart"&&(K=s.mode.indent(v,O.text.slice(N.length),O.text),K==V||K>150)){if(!r)return;i="prev"}i=="prev"?t>s.first?K=$(Le(s,t-1).text,null,L):K=0:i=="add"?K=P+e.options.indentUnit:i=="subtract"?K=P-e.options.indentUnit:typeof i=="number"&&(K=P+i),K=Math.max(0,K);var X="",Q=0;if(e.options.indentWithTabs)for(var J=Math.floor(K/L);J;--J)Q+=L,X+=" ";if(QL,P=Tt(t),N=null;if(O&&r.ranges.length>1)if(Fr&&Fr.text.join(` +`)==t){if(r.ranges.length%Fr.text.length==0){N=[];for(var K=0;K=0;Q--){var J=r.ranges[Q],oe=J.from(),ue=J.to();J.empty()&&(i&&i>0?oe=ie(oe.line,oe.ch-i):e.state.overwrite&&!O?ue=ie(ue.line,Math.min(Le(v,ue.line).text.length,ue.ch+Re(P).length)):O&&Fr&&Fr.lineWise&&Fr.text.join(` +`)==P.join(` +`)&&(oe=ue=ie(oe.line,0)));var pe={from:oe,to:ue,text:N?N[Q%N.length]:P,origin:s||(O?"paste":e.state.cutIncoming>L?"cut":"+input")};Qi(e.doc,pe),mt(e,"inputRead",e,pe)}t&&!O&&Ml(e,t),Yi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=X),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Al(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&sr(t,function(){return us(t,i,0,null,"paste")}),!0}function Ml(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var s=i.ranges[r];if(!(s.head.ch>100||r&&i.ranges[r-1].head.line==s.head.line)){var v=e.getModeAt(s.head),L=!1;if(v.electricChars){for(var O=0;O-1){L=Nn(e,s.head.line,"smart");break}}else v.electricInput&&v.electricInput.test(Le(e.doc,s.head.line).text.slice(0,s.head.ch))&&(L=Nn(e,s.head.line,"smart"));L&&mt(e,"electricInput",e,s.head.line)}}}function Rl(e){for(var t=[],i=[],r=0;rv&&(Nn(this,O.head.line,r,!0),v=O.head.line,L==this.doc.sel.primIndex&&Yi(this));else{var P=O.from(),N=O.to(),K=Math.max(v,P.line);v=Math.min(this.lastLine(),N.line-(N.ch?0:1))+1;for(var X=K;X0&&rs(this.doc,L,new Fe(P,Q[L].to()),Y)}}}),getTokenAt:function(r,s){return zn(this,r,s)},getLineTokens:function(r,s){return zn(this,ie(r),s,!0)},getTokenTypeAt:function(r){r=Oe(this.doc,r);var s=zi(this,Le(this.doc,r.line)),v=0,L=(s.length-1)/2,O=r.ch,P;if(O==0)P=s[2];else for(;;){var N=v+L>>1;if((N?s[N*2-1]:0)>=O)L=N;else if(s[N*2+1]P&&(r=P,L=!0),O=Le(this.doc,r)}else O=r;return Zn(this,O,{top:0,left:0},s||"page",v||L).top+(L?this.doc.height-ft(O):0)},defaultTextHeight:function(){return Gi(this.display)},defaultCharWidth:function(){return Zi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,s,v,L,O){var P=this.display;r=Ir(this,Oe(this.doc,r));var N=r.bottom,K=r.left;if(s.style.position="absolute",s.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(s),P.sizer.appendChild(s),L=="over")N=r.top;else if(L=="above"||L=="near"){var X=Math.max(P.wrapper.clientHeight,this.doc.height),Q=Math.max(P.sizer.clientWidth,P.lineSpace.clientWidth);(L=="above"||r.bottom+s.offsetHeight>X)&&r.top>s.offsetHeight?N=r.top-s.offsetHeight:r.bottom+s.offsetHeight<=X&&(N=r.bottom),K+s.offsetWidth>Q&&(K=Q-s.offsetWidth)}s.style.top=N+"px",s.style.left=s.style.right="",O=="right"?(K=P.sizer.clientWidth-s.offsetWidth,s.style.right="0px"):(O=="left"?K=0:O=="middle"&&(K=(P.sizer.clientWidth-s.offsetWidth)/2),s.style.left=K+"px"),v&&gu(this,{left:K,top:N,right:K+s.offsetWidth,bottom:N+s.offsetHeight})},triggerOnKeyDown:Ft(bl),triggerOnKeyPress:Ft(Cl),triggerOnKeyUp:Sl,triggerOnMouseDown:Ft(wl),execCommand:function(r){if(In.hasOwnProperty(r))return In[r].call(null,this)},triggerElectric:Ft(function(r){Ml(this,r)}),findPosH:function(r,s,v,L){var O=1;s<0&&(O=-1,s=-s);for(var P=Oe(this.doc,r),N=0;N0&&K(v.charAt(L-1));)--L;for(;O.5||this.options.lineWrapping)&&Wo(this),ze(this,"refresh",this)}),swapDoc:Ft(function(r){var s=this.doc;return s.cm=null,this.state.selectingText&&this.state.selectingText(),Na(this,r),mn(this),this.display.input.reset(),Sn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,mt(this,"swapDoc",this,s),s}),phrase:function(r){var s=this.options.phrases;return s&&Object.prototype.hasOwnProperty.call(s,r)?s[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ot(e),e.registerHelper=function(r,s,v){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][s]=v},e.registerGlobalHelper=function(r,s,v,L){e.registerHelper(r,s,L),i[r]._global.push({pred:v,val:L})}}function hs(e,t,i,r,s){var v=t,L=i,O=Le(e,t.line),P=s&&e.direction=="rtl"?-i:i;function N(){var Se=t.line+P;return Se=e.first+e.size?!1:(t=new ie(Se,t.ch,t.sticky),O=Le(e,Se))}function K(Se){var me;if(r=="codepoint"){var Ce=O.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(Ce))me=null;else{var Me=i>0?Ce>=55296&&Ce<56320:Ce>=56320&&Ce<57343;me=new ie(t.line,Math.max(0,Math.min(O.text.length,t.ch+i*(Me?2:1))),-i)}}else s?me=ef(e.cm,O,t,i):me=ns(O,t,i);if(me==null)if(!Se&&N())t=os(s,e.cm,O,t.line,P);else return!1;else t=me;return!0}if(r=="char"||r=="codepoint")K();else if(r=="column")K(!0);else if(r=="word"||r=="group")for(var X=null,Q=r=="group",J=e.cm&&e.cm.getHelper(t,"wordChars"),oe=!0;!(i<0&&!K(!oe));oe=!1){var ue=O.text.charAt(t.ch)||` +`,pe=lr(ue,J)?"w":Q&&ue==` +`?"n":!Q||/\s/.test(ue)?null:"p";if(Q&&!oe&&!pe&&(pe="s"),X&&X!=pe){i<0&&(i=1,K(),t.sticky="after");break}if(pe&&(X=pe),i>0&&!K(!oe))break}var ye=so(e,t,v,L,!0);return He(v,ye)&&(ye.hitSide=!0),ye}function Dl(e,t,i,r){var s=e.doc,v=t.left,L;if(r=="page"){var O=Math.min(e.display.wrapper.clientHeight,ve(e).innerHeight||s(e).documentElement.clientHeight),P=Math.max(O-.5*Gi(e.display),3);L=(i>0?t.bottom:t.top)+i*P}else r=="line"&&(L=i>0?t.bottom+3:t.top-3);for(var N;N=Po(e,v,L),!!N.outside;){if(i<0?L<=0:L>=s.height){N.hitSide=!0;break}L+=i*5}return N}var Ne=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ie,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ne.prototype.init=function(e){var t=this,i=this,r=i.cm,s=i.div=e.lineDiv;s.contentEditable=!0,fs(s,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function v(O){for(var P=O.target;P;P=P.parentNode){if(P==s)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(P.className))break}return!1}Te(s,"paste",function(O){!v(O)||Ue(r,O)||Al(O,r)||_<=11&&setTimeout(bt(r,function(){return t.updateFromDOM()}),20)}),Te(s,"compositionstart",function(O){t.composing={data:O.data,done:!1}}),Te(s,"compositionupdate",function(O){t.composing||(t.composing={data:O.data,done:!1})}),Te(s,"compositionend",function(O){t.composing&&(O.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Te(s,"touchstart",function(){return i.forceCompositionEnd()}),Te(s,"input",function(){t.composing||t.readFromDOMSoon()});function L(O){if(!(!v(O)||Ue(r,O))){if(r.somethingSelected())ho({lineWise:!1,text:r.getSelections()}),O.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var P=Rl(r);ho({lineWise:!0,text:P.text}),O.type=="cut"&&r.operation(function(){r.setSelections(P.ranges,0,Y),r.replaceSelection("",null,"cut")})}else return;if(O.clipboardData){O.clipboardData.clearData();var N=Fr.text.join(` +`);if(O.clipboardData.setData("Text",N),O.clipboardData.getData("Text")==N){O.preventDefault();return}}var K=Ol(),X=K.firstChild;fs(X),r.display.lineSpace.insertBefore(K,r.display.lineSpace.firstChild),X.value=Fr.text.join(` +`);var Q=G(q(s));ee(X),setTimeout(function(){r.display.lineSpace.removeChild(K),Q.focus(),Q==s&&i.showPrimarySelection()},50)}}Te(s,"copy",L),Te(s,"cut",L)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=wa(this.cm,!1);return e.focus=G(q(this.div))==this.div,e},Ne.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ne.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ne.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),s=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||s.line=t.display.viewFrom&&Bl(t,r)||{node:O[0].measure.map[2],offset:0},N=s.linee.firstLine()&&(r=ie(r.line-1,Le(e.doc,r.line-1).length)),s.ch==Le(e.doc,s.line).text.length&&s.linet.viewTo-1)return!1;var v,L,O;r.line==t.viewFrom||(v=Ai(e,r.line))==0?(L=j(t.view[0].line),O=t.view[0].node):(L=j(t.view[v].line),O=t.view[v-1].node.nextSibling);var P=Ai(e,s.line),N,K;if(P==t.view.length-1?(N=t.viewTo-1,K=t.lineDiv.lastChild):(N=j(t.view[P+1].line)-1,K=t.view[P+1].node.previousSibling),!O)return!1;for(var X=e.doc.splitLines(Cf(e,O,K,L,N)),Q=tr(e.doc,ie(L,0),ie(N,Le(e.doc,N).text.length));X.length>1&&Q.length>1;)if(Re(X)==Re(Q))X.pop(),Q.pop(),N--;else if(X[0]==Q[0])X.shift(),Q.shift(),L++;else break;for(var J=0,oe=0,ue=X[0],pe=Q[0],ye=Math.min(ue.length,pe.length);Jr.ch&&Se.charCodeAt(Se.length-oe-1)==me.charCodeAt(me.length-oe-1);)J--,oe++;X[X.length-1]=Se.slice(0,Se.length-oe).replace(/^\u200b+/,""),X[0]=X[0].slice(J).replace(/\u200b+$/,"");var Me=ie(L,J),Ae=ie(N,Q.length?Re(Q).length-oe:0);if(X.length>1||X[0]||be(Me,Ae))return en(e.doc,X,Me,Ae,"+input"),!0},Ne.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ne.prototype.reset=function(){this.forceCompositionEnd()},Ne.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ne.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Ne.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&sr(this.cm,function(){return Kt(e.cm)})},Ne.prototype.setUneditable=function(e){e.contentEditable="false"},Ne.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||bt(this.cm,us)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Ne.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ne.prototype.onContextMenu=function(){},Ne.prototype.resetPosition=function(){},Ne.prototype.needsContentAttribute=!0;function Bl(e,t){var i=Oo(e,t.line);if(!i||i.hidden)return null;var r=Le(e.doc,t.line),s=ca(i,r,t.line),v=Be(r,e.doc.direction),L="left";if(v){var O=fr(v,t.ch);L=O%2?"right":"left"}var P=ha(s.map,t.ch,L);return P.offset=P.collapse=="right"?P.end:P.start,P}function Sf(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function sn(e,t){return t&&(e.bad=!0),e}function Cf(e,t,i,r,s){var v="",L=!1,O=e.doc.lineSeparator(),P=!1;function N(J){return function(oe){return oe.id==J}}function K(){L&&(v+=O,P&&(v+=O),L=P=!1)}function X(J){J&&(K(),v+=J)}function Q(J){if(J.nodeType==1){var oe=J.getAttribute("cm-text");if(oe){X(oe);return}var ue=J.getAttribute("cm-marker"),pe;if(ue){var ye=e.findMarks(ie(r,0),ie(s+1,0),N(+ue));ye.length&&(pe=ye[0].find(0))&&X(tr(e.doc,pe.from,pe.to).join(O));return}if(J.getAttribute("contenteditable")=="false")return;var Se=/^(pre|div|p|li|table|br)$/i.test(J.nodeName);if(!/^br$/i.test(J.nodeName)&&J.textContent.length==0)return;Se&&K();for(var me=0;me=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Te(s,"paste",function(L){Ue(r,L)||Al(L,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function v(L){if(!Ue(r,L)){if(r.somethingSelected())ho({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var O=Rl(r);ho({lineWise:!0,text:O.text}),L.type=="cut"?r.setSelections(O.ranges,null,Y):(i.prevInput="",s.value=O.text.join(` +`),ee(s))}else return;L.type=="cut"&&(r.state.cutIncoming=+new Date)}}Te(s,"cut",v),Te(s,"copy",v),Te(e.scroller,"paste",function(L){if(!(ti(e,L)||Ue(r,L))){if(!s.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var O=new Event("paste");O.clipboardData=L.clipboardData,s.dispatchEvent(O)}}),Te(e.lineSpace,"selectstart",function(L){ti(e,L)||tt(L)}),Te(s,"compositionstart",function(){var L=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:L,range:r.markText(L,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Te(s,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},it.prototype.createField=function(e){this.wrapper=Ol(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;fs(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},it.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},it.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=wa(e);if(e.options.moveInputWithCursor){var s=Ir(e,i.sel.primary().head,"div"),v=t.wrapper.getBoundingClientRect(),L=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,s.top+L.top-v.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,s.left+L.left-v.left))}return r},it.prototype.showSelection=function(e){var t=this.cm,i=t.display;I(i.cursorDiv,e.cursors),I(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},it.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&ee(this.textarea),y&&_>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",y&&_>=9&&(this.hasSelection=null));this.resetting=!1}},it.prototype.getField=function(){return this.textarea},it.prototype.supportsTouch=function(){return!1},it.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!n||G(q(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},it.prototype.blur=function(){this.textarea.blur()},it.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},it.prototype.receivedFocus=function(){this.slowPoll()},it.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},it.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},it.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||pr(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var s=i.value;if(s==r&&!t.somethingSelected())return!1;if(y&&_>=9&&this.hasSelection===s||a&&/[\uf700-\uf7ff]/.test(s))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var v=s.charCodeAt(0);if(v==8203&&!r&&(r="\u200B"),v==8666)return this.reset(),this.cm.execCommand("undo")}for(var L=0,O=Math.min(r.length,s.length);L1e3||s.indexOf(` +`)>-1?i.value=e.prevInput="":e.prevInput=s,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},it.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},it.prototype.onKeyPress=function(){y&&_>=9&&(this.hasSelection=null),this.fastPoll()},it.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,s=t.textarea;t.contextMenuPending&&t.contextMenuPending();var v=Ti(i,e),L=r.scroller.scrollTop;if(!v||p)return;var O=i.options.resetSelectionOnContextMenu;O&&i.doc.sel.contains(v)==-1&&bt(i,Mt)(i.doc,vi(v),Y);var P=s.style.cssText,N=t.wrapper.style.cssText,K=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",s.style.cssText=`position: absolute; width: 30px; height: 30px; + top: `+(e.clientY-K.top-5)+"px; left: "+(e.clientX-K.left-5)+`px; z-index: 1000; background: `+(y?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var X;g&&(X=s.ownerDocument.defaultView.scrollY),r.input.focus(),g&&s.ownerDocument.defaultView.scrollTo(null,X),r.input.reset(),i.somethingSelected()||(s.value=t.prevInput=" "),t.contextMenuPending=J,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function Q(){if(s.selectionStart!=null){var ce=i.somethingSelected(),de="\u200B"+(ce?s.value:"");s.value="\u21DA",s.value=de,t.prevInput=ce?"":"\u200B",s.selectionStart=1,s.selectionEnd=de.length,r.selForContextMenu=i.doc.sel}}function J(){if(t.contextMenuPending==J&&(t.contextMenuPending=!1,t.wrapper.style.cssText=F,s.style.cssText=B,y&&_<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=w),s.selectionStart!=null)){(!y||y&&_<9)&&Q();var ce=0,de=function(){r.selForContextMenu==i.doc.sel&&s.selectionStart==0&&s.selectionEnd>0&&t.prevInput=="\u200B"?bt(i,Fa)(i):ce++<10?r.detectingSelectAll=setTimeout(de,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(de,200)}}if(y&&_>=9&&Q(),x){lr(e);var ie=function(){et(window,"mouseup",ie),setTimeout(J,20)};Te(window,"mouseup",ie)}else setTimeout(J,50)},it.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},it.prototype.setUneditable=function(){},it.prototype.needsContentAttribute=!1;function Xu(e,t){if(t=t?ke(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=V(z(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=R.getValue()}var s;if(e.form&&(Te(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var p=e.form;s=p.submit;try{var w=p.submit=function(){r(),p.submit=s,p.submit(),p.submit=w}}catch{}}t.finishInit=function(B){B.save=r,B.getTextArea=function(){return e},B.toTextArea=function(){B.toTextArea=isNaN,r(),e.parentNode.removeChild(B.getWrapperElement()),e.style.display="",e.form&&(et(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var R=Ye(function(B){return e.parentNode.insertBefore(B,e.nextSibling)},t);return R}function Zu(e){e.off=et,e.on=Te,e.wheelEventPixels=tu,e.Doc=zt,e.splitLines=Et,e.countColumn=$,e.findColumn=Ee,e.isWordChar=gr,e.Pass=Y,e.signal=Ue,e.Line=Ni,e.changeEnd=di,e.scrollbarModel=pa,e.Pos=te,e.cmpPos=be,e.modes=Er,e.mimeModes=Bt,e.resolveMode=Tr,e.getMode=Ar,e.modeExtensions=fr,e.extendMode=Mr,e.copyState=Wt,e.startState=Rr,e.innerMode=Fr,e.commands=Dn,e.keyMap=ei,e.keyName=el,e.isModifierKey=Ja,e.lookupKey=Qi,e.normalizeKeyMap=wu,e.StringStream=qe,e.SharedTextMarker=Mn,e.TextMarker=vi,e.LineWidget=An,e.e_preventDefault=tt,e.e_stopPropagation=xr,e.e_stop=lr,e.addClass=ne,e.contains=U,e.rmClass=O,e.keyNames=gi}Wu(Ye),zu(Ye);var Yu="iter insert remove copy getEditor constructor".split(" ");for(var uo in zt.prototype)zt.prototype.hasOwnProperty(uo)&&ge(Yu,uo)<0&&(Ye.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(zt.prototype[uo]));return Rt(zt),Ye.inputStyles={textarea:it,contenteditable:Ne},Ye.defineMode=function(e){!Ye.defaults.mode&&e!="null"&&(Ye.defaults.mode=e),Pt.apply(this,arguments)},Ye.defineMIME=mr,Ye.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ye.defineMIME("text/plain","null"),Ye.defineExtension=function(e,t){Ye.prototype[e]=t},Ye.defineDocExtension=function(e,t){zt.prototype[e]=t},Ye.fromTextArea=Xu,Zu(Ye),Ye.version="5.65.16",Ye})});var ps=wr((Ll,xl)=>{(function(G){typeof Ll=="object"&&typeof xl=="object"?G(Lr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],G):G(CodeMirror)})(function(G){"use strict";G.defineMode("javascript",function(H,D){var f=H.indentUnit,E=D.statementIndent,m=D.jsonld,y=D.json||m,_=D.trackScope!==!1,g=D.typescript,k=D.wordCharacters||/[\w$\xa1-\uffff]/,C=function(){function W(Je){return{type:Je,style:"keyword"}}var K=W("keyword a"),ae=W("keyword b"),fe=W("keyword c"),te=W("keyword d"),be=W("operator"),He={type:"atom",style:"atom"};return{if:W("if"),while:K,with:K,else:ae,do:ae,try:ae,finally:ae,return:te,break:te,continue:te,new:W("new"),delete:fe,void:fe,throw:fe,debugger:W("debugger"),var:W("var"),const:W("var"),let:W("var"),function:W("function"),catch:W("catch"),for:W("for"),switch:W("switch"),case:W("case"),default:W("default"),in:be,typeof:be,instanceof:be,true:He,false:He,null:He,undefined:He,NaN:He,Infinity:He,this:W("this"),class:W("class"),super:W("atom"),yield:fe,export:W("export"),import:W("import"),extends:fe,await:fe}}(),u=/[+\-*&%=<>!?|~^@]/,v=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function L(W){for(var K=!1,ae,fe=!1;(ae=W.next())!=null;){if(!K){if(ae=="/"&&!fe)return;ae=="["?fe=!0:fe&&ae=="]"&&(fe=!1)}K=!K&&ae=="\\"}}var b,c;function n(W,K,ae){return b=W,c=ae,K}function l(W,K){var ae=W.next();if(ae=='"'||ae=="'")return K.tokenize=o(ae),K.tokenize(W,K);if(ae=="."&&W.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return n("number","number");if(ae=="."&&W.match(".."))return n("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(ae))return n(ae);if(ae=="="&&W.eat(">"))return n("=>","operator");if(ae=="0"&&W.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return n("number","number");if(/\d/.test(ae))return W.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),n("number","number");if(ae=="/")return W.eat("*")?(K.tokenize=a,a(W,K)):W.eat("/")?(W.skipToEnd(),n("comment","comment")):Lt(W,K,1)?(L(W),W.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),n("regexp","string-2")):(W.eat("="),n("operator","operator",W.current()));if(ae=="`")return K.tokenize=d,d(W,K);if(ae=="#"&&W.peek()=="!")return W.skipToEnd(),n("meta","meta");if(ae=="#"&&W.eatWhile(k))return n("variable","property");if(ae=="<"&&W.match("!--")||ae=="-"&&W.match("->")&&!/\S/.test(W.string.slice(0,W.start)))return W.skipToEnd(),n("comment","comment");if(u.test(ae))return(ae!=">"||!K.lexical||K.lexical.type!=">")&&(W.eat("=")?(ae=="!"||ae=="=")&&W.eat("="):/[<>*+\-|&?]/.test(ae)&&(W.eat(ae),ae==">"&&W.eat(ae))),ae=="?"&&W.eat(".")?n("."):n("operator","operator",W.current());if(k.test(ae)){W.eatWhile(k);var fe=W.current();if(K.lastType!="."){if(C.propertyIsEnumerable(fe)){var te=C[fe];return n(te.type,te.style,fe)}if(fe=="async"&&W.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return n("async","keyword",fe)}return n("variable","variable",fe)}}function o(W){return function(K,ae){var fe=!1,te;if(m&&K.peek()=="@"&&K.match(v))return ae.tokenize=l,n("jsonld-keyword","meta");for(;(te=K.next())!=null&&!(te==W&&!fe);)fe=!fe&&te=="\\";return fe||(ae.tokenize=l),n("string","string")}}function a(W,K){for(var ae=!1,fe;fe=W.next();){if(fe=="/"&&ae){K.tokenize=l;break}ae=fe=="*"}return n("comment","comment")}function d(W,K){for(var ae=!1,fe;(fe=W.next())!=null;){if(!ae&&(fe=="`"||fe=="$"&&W.eat("{"))){K.tokenize=l;break}ae=!ae&&fe=="\\"}return n("quasi","string-2",W.current())}var h="([{}])";function S(W,K){K.fatArrowAt&&(K.fatArrowAt=null);var ae=W.string.indexOf("=>",W.start);if(!(ae<0)){if(g){var fe=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(W.string.slice(W.start,ae));fe&&(ae=fe.index)}for(var te=0,be=!1,He=ae-1;He>=0;--He){var Je=W.string.charAt(He),vt=h.indexOf(Je);if(vt>=0&&vt<3){if(!te){++He;break}if(--te==0){Je=="("&&(be=!0);break}}else if(vt>=3&&vt<6)++te;else if(k.test(Je))be=!0;else if(/["'\/`]/.test(Je))for(;;--He){if(He==0)return;var Nr=W.string.charAt(He-1);if(Nr==Je&&W.string.charAt(He-2)!="\\"){He--;break}}else if(be&&!te){++He;break}}be&&!te&&(K.fatArrowAt=He)}}var A={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(W,K,ae,fe,te,be){this.indented=W,this.column=K,this.type=ae,this.prev=te,this.info=be,fe!=null&&(this.align=fe)}function M(W,K){if(!_)return!1;for(var ae=W.localVars;ae;ae=ae.next)if(ae.name==K)return!0;for(var fe=W.context;fe;fe=fe.prev)for(var ae=fe.vars;ae;ae=ae.next)if(ae.name==K)return!0}function O(W,K,ae,fe,te){var be=W.cc;for(I.state=W,I.stream=te,I.marked=null,I.cc=be,I.style=K,W.lexical.hasOwnProperty("align")||(W.lexical.align=!0);;){var He=be.length?be.pop():y?ge:$;if(He(ae,fe)){for(;be.length&&be[be.length-1].lex;)be.pop()();return I.marked?I.marked:ae=="variable"&&M(W,fe)?"variable-2":K}}}var I={state:null,column:null,marked:null,cc:null};function P(){for(var W=arguments.length-1;W>=0;W--)I.cc.push(arguments[W])}function T(){return P.apply(null,arguments),!0}function j(W,K){for(var ae=K;ae;ae=ae.next)if(ae.name==W)return!0;return!1}function N(W){var K=I.state;if(I.marked="def",!!_){if(K.context){if(K.lexical.info=="var"&&K.context&&K.context.block){var ae=U(W,K.context);if(ae!=null){K.context=ae;return}}else if(!j(W,K.localVars)){K.localVars=new ue(W,K.localVars);return}}D.globalVars&&!j(W,K.globalVars)&&(K.globalVars=new ue(W,K.globalVars))}}function U(W,K){if(K)if(K.block){var ae=U(W,K.prev);return ae?ae==K.prev?K:new ne(ae,K.vars,!0):null}else return j(W,K.vars)?K:new ne(K.prev,new ue(W,K.vars),!1);else return null}function V(W){return W=="public"||W=="private"||W=="protected"||W=="abstract"||W=="readonly"}function ne(W,K,ae){this.prev=W,this.vars=K,this.block=ae}function ue(W,K){this.name=W,this.next=K}var oe=new ue("this",new ue("arguments",null));function pe(){I.state.context=new ne(I.state.context,I.state.localVars,!1),I.state.localVars=oe}function _e(){I.state.context=new ne(I.state.context,I.state.localVars,!0),I.state.localVars=null}pe.lex=_e.lex=!0;function z(){I.state.localVars=I.state.context.vars,I.state.context=I.state.context.prev}z.lex=!0;function ve(W,K){var ae=function(){var fe=I.state,te=fe.indented;if(fe.lexical.type=="stat")te=fe.lexical.indented;else for(var be=fe.lexical;be&&be.type==")"&&be.align;be=be.prev)te=be.indented;fe.lexical=new x(te,I.stream.column(),W,null,fe.lexical,K)};return ae.lex=!0,ae}function he(){var W=I.state;W.lexical.prev&&(W.lexical.type==")"&&(W.indented=W.lexical.indented),W.lexical=W.lexical.prev)}he.lex=!0;function ke(W){function K(ae){return ae==W?T():W==";"||ae=="}"||ae==")"||ae=="]"?P():T(K)}return K}function $(W,K){return W=="var"?T(ve("vardef",K),xr,ke(";"),he):W=="keyword a"?T(ve("form"),Y,$,he):W=="keyword b"?T(ve("form"),$,he):W=="keyword d"?I.stream.match(/^\s*$/,!1)?T():T(ve("stat"),se,ke(";"),he):W=="debugger"?T(ke(";")):W=="{"?T(ve("}"),_e,Zt,he,z):W==";"?T():W=="if"?(I.state.lexical.info=="else"&&I.state.cc[I.state.cc.length-1]==he&&I.state.cc.pop()(),T(ve("form"),Y,$,he,kr)):W=="function"?T(Et):W=="for"?T(ve("form"),_e,Zr,$,z,he):W=="class"||g&&K=="interface"?(I.marked="keyword",T(ve("form",W=="class"?W:K),Er,he)):W=="variable"?g&&K=="declare"?(I.marked="keyword",T($)):g&&(K=="module"||K=="enum"||K=="type")&&I.stream.match(/^\s*\w/,!1)?(I.marked="keyword",K=="enum"?T(Le):K=="type"?T(Yr,ke("operator"),Be,ke(";")):T(ve("form"),lt,ke("{"),ve("}"),Zt,he,he)):g&&K=="namespace"?(I.marked="keyword",T(ve("form"),ge,$,he)):g&&K=="abstract"?(I.marked="keyword",T($)):T(ve("stat"),Xt):W=="switch"?T(ve("form"),Y,ke("{"),ve("}","switch"),_e,Zt,he,he,z):W=="case"?T(ge,ke(":")):W=="default"?T(ke(":")):W=="catch"?T(ve("form"),pe,Ie,$,he,z):W=="export"?T(ve("stat"),Tr,he):W=="import"?T(ve("stat"),fr,he):W=="async"?T($):K=="@"?T(ge,$):P(ve("stat"),ge,ke(";"),he)}function Ie(W){if(W=="(")return T(Dt,ke(")"))}function ge(W,K){return Z(W,K,!1)}function le(W,K){return Z(W,K,!0)}function Y(W){return W!="("?P():T(ve(")"),se,ke(")"),he)}function Z(W,K,ae){if(I.state.fatArrowAt==I.stream.start){var fe=ae?Xe:Re;if(W=="(")return T(pe,ve(")"),Ze(Dt,")"),he,ke("=>"),fe,z);if(W=="variable")return P(pe,lt,ke("=>"),fe,z)}var te=ae?Ee:xe;return A.hasOwnProperty(W)?T(te):W=="function"?T(Et,te):W=="class"||g&&K=="interface"?(I.marked="keyword",T(ve("form"),ai,he)):W=="keyword c"||W=="async"?T(ae?le:ge):W=="("?T(ve(")"),se,ke(")"),he,te):W=="operator"||W=="spread"?T(ae?le:ge):W=="["?T(ve("]"),qe,he,te):W=="{"?_r(nr,"}",null,te):W=="quasi"?P(De,te):W=="new"?T(we(ae)):T()}function se(W){return W.match(/[;\}\)\],]/)?P():P(ge)}function xe(W,K){return W==","?T(se):Ee(W,K,!1)}function Ee(W,K,ae){var fe=ae==!1?xe:Ee,te=ae==!1?ge:le;if(W=="=>")return T(pe,ae?Xe:Re,z);if(W=="operator")return/\+\+|--/.test(K)||g&&K=="!"?T(fe):g&&K=="<"&&I.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?T(ve(">"),Ze(Be,">"),he,fe):K=="?"?T(ge,ke(":"),te):T(te);if(W=="quasi")return P(De,fe);if(W!=";"){if(W=="(")return _r(le,")","call",fe);if(W==".")return T(gr,fe);if(W=="[")return T(ve("]"),se,ke("]"),he,fe);if(g&&K=="as")return I.marked="keyword",T(Be,fe);if(W=="regexp")return I.state.lastType=I.marked="operator",I.stream.backUp(I.stream.pos-I.stream.start-1),T(te)}}function De(W,K){return W!="quasi"?P():K.slice(K.length-2)!="${"?T(De):T(se,je)}function je(W){if(W=="}")return I.marked="string-2",I.state.tokenize=d,T(De)}function Re(W){return S(I.stream,I.state),P(W=="{"?$:ge)}function Xe(W){return S(I.stream,I.state),P(W=="{"?$:le)}function we(W){return function(K){return K=="."?T(W?dt:$e):K=="variable"&&g?T(pt,W?Ee:xe):P(W?le:ge)}}function $e(W,K){if(K=="target")return I.marked="keyword",T(xe)}function dt(W,K){if(K=="target")return I.marked="keyword",T(Ee)}function Xt(W){return W==":"?T(he,$):P(xe,ke(";"),he)}function gr(W){if(W=="variable")return I.marked="property",T()}function nr(W,K){if(W=="async")return I.marked="property",T(nr);if(W=="variable"||I.style=="keyword"){if(I.marked="property",K=="get"||K=="set")return T(ni);var ae;return g&&I.state.fatArrowAt==I.stream.start&&(ae=I.stream.match(/^\s*:\s*/,!1))&&(I.state.fatArrowAt=I.stream.pos+ae[0].length),T(or)}else{if(W=="number"||W=="string")return I.marked=m?"property":I.style+" property",T(or);if(W=="jsonld-keyword")return T(or);if(g&&V(K))return I.marked="keyword",T(nr);if(W=="[")return T(ge,sr,ke("]"),or);if(W=="spread")return T(le,or);if(K=="*")return I.marked="keyword",T(nr);if(W==":")return P(or)}}function ni(W){return W!="variable"?P(or):(I.marked="property",T(Et))}function or(W){if(W==":")return T(le);if(W=="(")return P(Et)}function Ze(W,K,ae){function fe(te,be){if(ae?ae.indexOf(te)>-1:te==","){var He=I.state.lexical;return He.info=="call"&&(He.pos=(He.pos||0)+1),T(function(Je,vt){return Je==K||vt==K?P():P(W)},fe)}return te==K||be==K?T():ae&&ae.indexOf(";")>-1?P(W):T(ke(K))}return function(te,be){return te==K||be==K?T():P(W,fe)}}function _r(W,K,ae){for(var fe=3;fe"),Be);if(W=="quasi")return P(et,kt)}function Xr(W){if(W=="=>")return T(Be)}function Te(W){return W.match(/[\}\)\]]/)?T():W==","||W==";"?T(Te):P(Yt,Te)}function Yt(W,K){if(W=="variable"||I.style=="keyword")return I.marked="property",T(Yt);if(K=="?"||W=="number"||W=="string")return T(Yt);if(W==":")return T(Be);if(W=="[")return T(ke("variable"),yr,ke("]"),Yt);if(W=="(")return P(ur,Yt);if(!W.match(/[;\}\)\],]/))return T()}function et(W,K){return W!="quasi"?P():K.slice(K.length-2)!="${"?T(et):T(Be,Ue)}function Ue(W){if(W=="}")return I.marked="string-2",I.state.tokenize=d,T(et)}function ze(W,K){return W=="variable"&&I.stream.match(/^\s*[?:]/,!1)||K=="?"?T(ze):W==":"?T(Be):W=="spread"?T(ze):P(Be)}function kt(W,K){if(K=="<")return T(ve(">"),Ze(Be,">"),he,kt);if(K=="|"||W=="."||K=="&")return T(Be);if(W=="[")return T(Be,ke("]"),kt);if(K=="extends"||K=="implements")return I.marked="keyword",T(Be);if(K=="?")return T(Be,ke(":"),Be)}function pt(W,K){if(K=="<")return T(ve(">"),Ze(Be,">"),he,kt)}function Rt(){return P(Be,tt)}function tt(W,K){if(K=="=")return T(Be)}function xr(W,K){return K=="enum"?(I.marked="keyword",T(Le)):P(lt,sr,Ot,si)}function lt(W,K){if(g&&V(K))return I.marked="keyword",T(lt);if(W=="variable")return N(K),T();if(W=="spread")return T(lt);if(W=="[")return _r(Ir,"]");if(W=="{")return _r(lr,"}")}function lr(W,K){return W=="variable"&&!I.stream.match(/^\s*:/,!1)?(N(K),T(Ot)):(W=="variable"&&(I.marked="property"),W=="spread"?T(lt):W=="}"?P():W=="["?T(ge,ke("]"),ke(":"),lr):T(ke(":"),lt,Ot))}function Ir(){return P(lt,Ot)}function Ot(W,K){if(K=="=")return T(le)}function si(W){if(W==",")return T(xr)}function kr(W,K){if(W=="keyword b"&&K=="else")return T(ve("form","else"),$,he)}function Zr(W,K){if(K=="await")return T(Zr);if(W=="(")return T(ve(")"),Hr,he)}function Hr(W){return W=="var"?T(xr,cr):W=="variable"?T(cr):P(cr)}function cr(W,K){return W==")"?T():W==";"?T(cr):K=="in"||K=="of"?(I.marked="keyword",T(ge,cr)):P(ge,cr)}function Et(W,K){if(K=="*")return I.marked="keyword",T(Et);if(W=="variable")return N(K),T(Et);if(W=="(")return T(pe,ve(")"),Ze(Dt,")"),he,ar,$,z);if(g&&K=="<")return T(ve(">"),Ze(Rt,">"),he,Et)}function ur(W,K){if(K=="*")return I.marked="keyword",T(ur);if(W=="variable")return N(K),T(ur);if(W=="(")return T(pe,ve(")"),Ze(Dt,")"),he,ar,z);if(g&&K=="<")return T(ve(">"),Ze(Rt,">"),he,ur)}function Yr(W,K){if(W=="keyword"||W=="variable")return I.marked="type",T(Yr);if(K=="<")return T(ve(">"),Ze(Rt,">"),he)}function Dt(W,K){return K=="@"&&T(ge,Dt),W=="spread"?T(Dt):g&&V(K)?(I.marked="keyword",T(Dt)):g&&W=="this"?T(sr,Ot):P(lt,sr,Ot)}function ai(W,K){return W=="variable"?Er(W,K):Bt(W,K)}function Er(W,K){if(W=="variable")return N(K),T(Bt)}function Bt(W,K){if(K=="<")return T(ve(">"),Ze(Rt,">"),he,Bt);if(K=="extends"||K=="implements"||g&&W==",")return K=="implements"&&(I.marked="keyword"),T(g?Be:ge,Bt);if(W=="{")return T(ve("}"),Pt,he)}function Pt(W,K){if(W=="async"||W=="variable"&&(K=="static"||K=="get"||K=="set"||g&&V(K))&&I.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return I.marked="keyword",T(Pt);if(W=="variable"||I.style=="keyword")return I.marked="property",T(mr,Pt);if(W=="number"||W=="string")return T(mr,Pt);if(W=="[")return T(ge,sr,ke("]"),mr,Pt);if(K=="*")return I.marked="keyword",T(Pt);if(g&&W=="(")return P(ur,Pt);if(W==";"||W==",")return T(Pt);if(W=="}")return T();if(K=="@")return T(ge,Pt)}function mr(W,K){if(K=="!"||K=="?")return T(mr);if(W==":")return T(Be,Ot);if(K=="=")return T(le);var ae=I.state.lexical.prev,fe=ae&&ae.info=="interface";return P(fe?ur:Et)}function Tr(W,K){return K=="*"?(I.marked="keyword",T(Rr,ke(";"))):K=="default"?(I.marked="keyword",T(ge,ke(";"))):W=="{"?T(Ze(Ar,"}"),Rr,ke(";")):P($)}function Ar(W,K){if(K=="as")return I.marked="keyword",T(ke("variable"));if(W=="variable")return P(le,Ar)}function fr(W){return W=="string"?T():W=="("?P(ge):W=="."?P(xe):P(Mr,Wt,Rr)}function Mr(W,K){return W=="{"?_r(Mr,"}"):(W=="variable"&&N(K),K=="*"&&(I.marked="keyword"),T(Fr))}function Wt(W){if(W==",")return T(Mr,Wt)}function Fr(W,K){if(K=="as")return I.marked="keyword",T(Mr)}function Rr(W,K){if(K=="from")return I.marked="keyword",T(ge)}function qe(W){return W=="]"?T():P(Ze(le,"]"))}function Le(){return P(ve("form"),lt,ke("{"),ve("}"),Ze(Vt,"}"),he,he)}function Vt(){return P(lt,Ot)}function Wr(W,K){return W.lastType=="operator"||W.lastType==","||u.test(K.charAt(0))||/[,.]/.test(K.charAt(0))}function Lt(W,K,ae){return K.tokenize==l&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(K.lastType)||K.lastType=="quasi"&&/\{\s*$/.test(W.string.slice(0,W.pos-(ae||0)))}return{startState:function(W){var K={tokenize:l,lastType:"sof",cc:[],lexical:new x((W||0)-f,0,"block",!1),localVars:D.localVars,context:D.localVars&&new ne(null,null,!1),indented:W||0};return D.globalVars&&typeof D.globalVars=="object"&&(K.globalVars=D.globalVars),K},token:function(W,K){if(W.sol()&&(K.lexical.hasOwnProperty("align")||(K.lexical.align=!1),K.indented=W.indentation(),S(W,K)),K.tokenize!=a&&W.eatSpace())return null;var ae=K.tokenize(W,K);return b=="comment"?ae:(K.lastType=b=="operator"&&(c=="++"||c=="--")?"incdec":b,O(K,ae,b,c,W))},indent:function(W,K){if(W.tokenize==a||W.tokenize==d)return G.Pass;if(W.tokenize!=l)return 0;var ae=K&&K.charAt(0),fe=W.lexical,te;if(!/^\s*else\b/.test(K))for(var be=W.cc.length-1;be>=0;--be){var He=W.cc[be];if(He==he)fe=fe.prev;else if(He!=kr&&He!=z)break}for(;(fe.type=="stat"||fe.type=="form")&&(ae=="}"||(te=W.cc[W.cc.length-1])&&(te==xe||te==Ee)&&!/^[,\.=+\-*:?[\(]/.test(K));)fe=fe.prev;E&&fe.type==")"&&fe.prev.type=="stat"&&(fe=fe.prev);var Je=fe.type,vt=ae==Je;return Je=="vardef"?fe.indented+(W.lastType=="operator"||W.lastType==","?fe.info.length+1:0):Je=="form"&&ae=="{"?fe.indented:Je=="form"?fe.indented+f:Je=="stat"?fe.indented+(Wr(W,K)?E||f:0):fe.info=="switch"&&!vt&&D.doubleIndentSwitch!=!1?fe.indented+(/^(?:case|default)\b/.test(K)?f:2*f):fe.align?fe.column+(vt?0:1):fe.indented+(vt?0:f)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:y?null:"/*",blockCommentEnd:y?null:"*/",blockCommentContinue:y?null:" * ",lineComment:y?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:y?"json":"javascript",jsonldMode:m,jsonMode:y,expressionAllowed:Lt,skipExpression:function(W){O(W,"atom","atom","true",new G.StringStream("",2,null))}}}),G.registerHelper("wordChars","javascript",/[\w$]/),G.defineMIME("text/javascript","javascript"),G.defineMIME("text/ecmascript","javascript"),G.defineMIME("application/javascript","javascript"),G.defineMIME("application/x-javascript","javascript"),G.defineMIME("application/ecmascript","javascript"),G.defineMIME("application/json",{name:"javascript",json:!0}),G.defineMIME("application/x-json",{name:"javascript",json:!0}),G.defineMIME("application/manifest+json",{name:"javascript",json:!0}),G.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),G.defineMIME("text/typescript",{name:"javascript",typescript:!0}),G.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var gs=wr((El,Tl)=>{(function(G){typeof El=="object"&&typeof Tl=="object"?G(Lr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],G):G(CodeMirror)})(function(G){"use strict";G.defineMode("perl",function(){var m={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,if:[1,1],elsif:[1,1],else:[1,1],while:[1,1],unless:[1,1],for:[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,break:1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,continue:[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,default:1,defined:1,delete:1,die:1,do:1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,goto:1,grep:1,hex:1,import:1,index:1,int:1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,new:1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,package:1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,return:1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},y="string-2",_=/[goseximacplud]/;function g(u,v,L,b,c){return v.chain=null,v.style=null,v.tail=null,v.tokenize=function(n,l){for(var o=!1,a,d=0;a=n.next();){if(a===L[d]&&!o)return L[++d]!==void 0?(l.chain=L[d],l.style=b,l.tail=c):c&&n.eatWhile(c),l.tokenize=C,b;o=!o&&a=="\\"}return b},v.tokenize(u,v)}function k(u,v,L){return v.tokenize=function(b,c){return b.string==L&&(c.tokenize=C),b.skipToEnd(),"string"},v.tokenize(u,v)}function C(u,v){if(u.eatSpace())return null;if(v.chain)return g(u,v,v.chain,v.style,v.tail);if(u.match(/^(\-?((\d[\d_]*)?\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F_]+|0b[01_]+|\d[\d_]*(e[+-]?\d+)?)/))return"number";if(u.match(/^<<(?=[_a-zA-Z])/))return u.eatWhile(/\w/),k(u,v,u.current().substr(2));if(u.sol()&&u.match(/^\=item(?!\w)/))return k(u,v,"=cut");var L=u.next();if(L=='"'||L=="'"){if(D(u,3)=="<<"+L){var b=u.pos;u.eatWhile(/\w/);var c=u.current().substr(1);if(c&&u.eat(L))return k(u,v,c);u.pos=b}return g(u,v,[L],"string")}if(L=="q"){var n=H(u,-2);if(!(n&&/\w/.test(n))){if(n=H(u,0),n=="x"){if(n=H(u,1),n=="(")return E(u,2),g(u,v,[")"],y,_);if(n=="[")return E(u,2),g(u,v,["]"],y,_);if(n=="{")return E(u,2),g(u,v,["}"],y,_);if(n=="<")return E(u,2),g(u,v,[">"],y,_);if(/[\^'"!~\/]/.test(n))return E(u,1),g(u,v,[u.eat(n)],y,_)}else if(n=="q"){if(n=H(u,1),n=="(")return E(u,2),g(u,v,[")"],"string");if(n=="[")return E(u,2),g(u,v,["]"],"string");if(n=="{")return E(u,2),g(u,v,["}"],"string");if(n=="<")return E(u,2),g(u,v,[">"],"string");if(/[\^'"!~\/]/.test(n))return E(u,1),g(u,v,[u.eat(n)],"string")}else if(n=="w"){if(n=H(u,1),n=="(")return E(u,2),g(u,v,[")"],"bracket");if(n=="[")return E(u,2),g(u,v,["]"],"bracket");if(n=="{")return E(u,2),g(u,v,["}"],"bracket");if(n=="<")return E(u,2),g(u,v,[">"],"bracket");if(/[\^'"!~\/]/.test(n))return E(u,1),g(u,v,[u.eat(n)],"bracket")}else if(n=="r"){if(n=H(u,1),n=="(")return E(u,2),g(u,v,[")"],y,_);if(n=="[")return E(u,2),g(u,v,["]"],y,_);if(n=="{")return E(u,2),g(u,v,["}"],y,_);if(n=="<")return E(u,2),g(u,v,[">"],y,_);if(/[\^'"!~\/]/.test(n))return E(u,1),g(u,v,[u.eat(n)],y,_)}else if(/[\^'"!~\/(\[{<]/.test(n)){if(n=="(")return E(u,1),g(u,v,[")"],"string");if(n=="[")return E(u,1),g(u,v,["]"],"string");if(n=="{")return E(u,1),g(u,v,["}"],"string");if(n=="<")return E(u,1),g(u,v,[">"],"string");if(/[\^'"!~\/]/.test(n))return g(u,v,[u.eat(n)],"string")}}}if(L=="m"){var n=H(u,-2);if(!(n&&/\w/.test(n))&&(n=u.eat(/[(\[{<\^'"!~\/]/),n)){if(/[\^'"!~\/]/.test(n))return g(u,v,[n],y,_);if(n=="(")return g(u,v,[")"],y,_);if(n=="[")return g(u,v,["]"],y,_);if(n=="{")return g(u,v,["}"],y,_);if(n=="<")return g(u,v,[">"],y,_)}}if(L=="s"){var n=/[\/>\]})\w]/.test(H(u,-2));if(!n&&(n=u.eat(/[(\[{<\^'"!~\/]/),n))return n=="["?g(u,v,["]","]"],y,_):n=="{"?g(u,v,["}","}"],y,_):n=="<"?g(u,v,[">",">"],y,_):n=="("?g(u,v,[")",")"],y,_):g(u,v,[n,n],y,_)}if(L=="y"){var n=/[\/>\]})\w]/.test(H(u,-2));if(!n&&(n=u.eat(/[(\[{<\^'"!~\/]/),n))return n=="["?g(u,v,["]","]"],y,_):n=="{"?g(u,v,["}","}"],y,_):n=="<"?g(u,v,[">",">"],y,_):n=="("?g(u,v,[")",")"],y,_):g(u,v,[n,n],y,_)}if(L=="t"){var n=/[\/>\]})\w]/.test(H(u,-2));if(!n&&(n=u.eat("r"),n&&(n=u.eat(/[(\[{<\^'"!~\/]/),n)))return n=="["?g(u,v,["]","]"],y,_):n=="{"?g(u,v,["}","}"],y,_):n=="<"?g(u,v,[">",">"],y,_):n=="("?g(u,v,[")",")"],y,_):g(u,v,[n,n],y,_)}if(L=="`")return g(u,v,[L],"variable-2");if(L=="/")return/~\s*$/.test(D(u))?g(u,v,[L],y,_):"operator";if(L=="$"){var b=u.pos;if(u.eatWhile(/\d/)||u.eat("{")&&u.eatWhile(/\d/)&&u.eat("}"))return"variable-2";u.pos=b}if(/[$@%]/.test(L)){var b=u.pos;if(u.eat("^")&&u.eat(/[A-Z]/)||!/[@$%&]/.test(H(u,-2))&&u.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var n=u.current();if(m[n])return"variable-2"}u.pos=b}if(/[$@%&]/.test(L)&&(u.eatWhile(/[\w$]/)||u.eat("{")&&u.eatWhile(/[\w$]/)&&u.eat("}"))){var n=u.current();return m[n]?"variable-2":"variable"}if(L=="#"&&H(u,-2)!="$")return u.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(L)){var b=u.pos;if(u.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),m[u.current()])return"operator";u.pos=b}if(L=="_"&&u.pos==1){if(f(u,6)=="_END__")return g(u,v,["\0"],"comment");if(f(u,7)=="_DATA__")return g(u,v,["\0"],"variable-2");if(f(u,7)=="_C__")return g(u,v,["\0"],"string")}if(/\w/.test(L)){var b=u.pos;if(H(u,-2)=="{"&&(H(u,0)=="}"||u.eatWhile(/\w/)&&H(u,0)=="}"))return"string";u.pos=b}if(/[A-Z]/.test(L)){var l=H(u,-2),b=u.pos;if(u.eatWhile(/[A-Z_]/),/[\da-z]/.test(H(u,0)))u.pos=b;else{var n=m[u.current()];return n?(n[1]&&(n=n[0]),l!=":"?n==1?"keyword":n==2?"def":n==3?"atom":n==4?"operator":n==5?"variable-2":"meta":"meta"):"meta"}}if(/[a-zA-Z_]/.test(L)){var l=H(u,-2);u.eatWhile(/\w/);var n=m[u.current()];return n?(n[1]&&(n=n[0]),l!=":"?n==1?"keyword":n==2?"def":n==3?"atom":n==4?"operator":n==5?"variable-2":"meta":"meta"):"meta"}return null}return{startState:function(){return{tokenize:C,chain:null,style:null,tail:null}},token:function(u,v){return(v.tokenize||C)(u,v)},lineComment:"#"}}),G.registerHelper("wordChars","perl",/[\w$]/),G.defineMIME("text/x-perl","perl");function H(m,y){return m.string.charAt(m.pos+(y||0))}function D(m,y){if(y){var _=m.pos-y;return m.string.substr(_>=0?_:0,y)}else return m.string.substr(0,m.pos-1)}function f(m,y){var _=m.string.length,g=_-m.pos+1;return m.string.substr(m.pos,y&&y<_?y:g)}function E(m,y){var _=m.pos+y,g;_<=0?m.pos=0:_>=(g=m.string.length-1)?m.pos=g:m.pos=_}})});var Dl=wr(ri=>{"use strict";var po=ri&&ri.__assign||function(){return po=Object.assign||function(G){for(var H,D=1,f=arguments.length;D0&&D.hide()}),this.element.classList.remove(this.toastShowClass),this.element.classList.add(this.toastHideClass),this.trigger("hide"),this.animation){var f=function(){return D.remove()},E=function(){y||(D.element.addEventListener("transitionend",function(){return f()}),y=!0)},m=function(){D.show(),D.element.removeEventListener("transitionstart",function(){return E()}),D.element.removeEventListener("transitionend",function(){return f()}),D.element.removeEventListener("mouseover",function(){return m()}),D.element.addEventListener("mouseout",function(){return D.hide()})},y=!1;this.element.addEventListener("mouseover",function(){return m()}),this.element.addEventListener("transitionstart",function(){return E()});return}this.remove()}},G.prototype.remove=function(){this.element.parentNode===this.container&&(this.container.removeChild(this.element),this.trigger("remove"))},G.prototype.buildClose=function(H){var D=this,f=document.createElement("button");return f.setAttribute("title",H),f.appendChild(document.createTextNode(H)),f.addEventListener("click",function(){return D.hide()}),f},G.prototype.getContainer=function(H){var D=H.containerClass,f=H.containerElement,E=H.root,m=E.querySelector("".concat(f,".").concat(D));if(m)return m;var y=document.createElement(f);return y.classList.add(D),E.appendChild(y),y},G.prototype.on=function(H,D){this.events[H]||(this.events[H]=[]),this.events[H].push(D)},G.prototype.off=function(H,D){if(D===void 0&&(D=null),!D){this.events[H]=[];return}var f=this.events[H].indexOf(D);f===-1&&this.events[H].splice(f,1)},G.prototype.trigger=function(H){for(var D=this,f=[],E=1;E{(function(G,H){if(typeof bo=="object"&&typeof Os=="object")Os.exports=H();else if(typeof define=="function"&&define.amd)define([],H);else{var D=H();for(var f in D)(typeof bo=="object"?bo:G)[f]=D[f]}})(self,function(){return(()=>{"use strict";var G={4567:function(D,f,E){var m,y=this&&this.__extends||(m=function(c,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,o){l.__proto__=o}||function(l,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(l[a]=o[a])},m(c,n)},function(c,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function l(){this.constructor=c}m(c,n),c.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)});Object.defineProperty(f,"__esModule",{value:!0}),f.AccessibilityManager=void 0;var _=E(9042),g=E(6114),k=E(9924),C=E(3656),u=E(844),v=E(5596),L=E(9631),b=function(c){function n(l,o){var a=c.call(this)||this;a._terminal=l,a._renderService=o,a._liveRegionLineCount=0,a._charsToConsume=[],a._charsToAnnounce="",a._accessibilityTreeRoot=document.createElement("div"),a._accessibilityTreeRoot.classList.add("xterm-accessibility"),a._accessibilityTreeRoot.tabIndex=0,a._rowContainer=document.createElement("div"),a._rowContainer.setAttribute("role","list"),a._rowContainer.classList.add("xterm-accessibility-tree"),a._rowElements=[];for(var d=0;dl;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},n.prototype._createAccessibilityTreeNode=function(){var l=document.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l},n.prototype._onTab=function(l){for(var o=0;o0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=_.tooMuchOutput)),g.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){o._accessibilityTreeRoot.appendChild(o._liveRegion)},0))},n.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,g.isMac&&(0,L.removeElementFromParent)(this._liveRegion)},n.prototype._onKey=function(l){this._clearLiveRegion(),this._charsToConsume.push(l)},n.prototype._refreshRows=function(l,o){this._renderRowsDebouncer.refresh(l,o,this._terminal.rows)},n.prototype._renderRows=function(l,o){for(var a=this._terminal.buffer,d=a.lines.length.toString(),h=l;h<=o;h++){var S=a.translateBufferLineToString(a.ydisp+h,!0),A=(a.ydisp+h+1).toString(),x=this._rowElements[h];x&&(S.length===0?x.innerText="\xA0":x.textContent=S,x.setAttribute("aria-posinset",A),x.setAttribute("aria-setsize",d))}this._announceCharacters()},n.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var l=0;l{function E(g){return g.replace(/\r?\n/g,"\r")}function m(g,k){return k?"\x1B[200~"+g+"\x1B[201~":g}function y(g,k,C){g=m(g=E(g),C.decPrivateModes.bracketedPasteMode),C.triggerDataEvent(g,!0),k.value=""}function _(g,k,C){var u=C.getBoundingClientRect(),v=g.clientX-u.left-10,L=g.clientY-u.top-10;k.style.width="20px",k.style.height="20px",k.style.left=v+"px",k.style.top=L+"px",k.style.zIndex="1000",k.focus()}Object.defineProperty(f,"__esModule",{value:!0}),f.rightClickHandler=f.moveTextAreaUnderMouseCursor=f.paste=f.handlePasteEvent=f.copyHandler=f.bracketTextForPaste=f.prepareTextForTerminal=void 0,f.prepareTextForTerminal=E,f.bracketTextForPaste=m,f.copyHandler=function(g,k){g.clipboardData&&g.clipboardData.setData("text/plain",k.selectionText),g.preventDefault()},f.handlePasteEvent=function(g,k,C){g.stopPropagation(),g.clipboardData&&y(g.clipboardData.getData("text/plain"),k,C)},f.paste=y,f.moveTextAreaUnderMouseCursor=_,f.rightClickHandler=function(g,k,C,u,v){_(g,k,C),v&&u.rightClickSelect(g),k.value=u.selectionText,k.select()}},7239:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ColorContrastCache=void 0;var E=function(){function m(){this._color={},this._rgba={}}return m.prototype.clear=function(){this._color={},this._rgba={}},m.prototype.setCss=function(y,_,g){this._rgba[y]||(this._rgba[y]={}),this._rgba[y][_]=g},m.prototype.getCss=function(y,_){return this._rgba[y]?this._rgba[y][_]:void 0},m.prototype.setColor=function(y,_,g){this._color[y]||(this._color[y]={}),this._color[y][_]=g},m.prototype.getColor=function(y,_){return this._color[y]?this._color[y][_]:void 0},m}();f.ColorContrastCache=E},5680:function(D,f,E){var m=this&&this.__read||function(b,c){var n=typeof Symbol=="function"&&b[Symbol.iterator];if(!n)return b;var l,o,a=n.call(b),d=[];try{for(;(c===void 0||c-- >0)&&!(l=a.next()).done;)d.push(l.value)}catch(h){o={error:h}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return d};Object.defineProperty(f,"__esModule",{value:!0}),f.ColorManager=f.DEFAULT_ANSI_COLORS=void 0;var y=E(8055),_=E(7239),g=y.css.toColor("#ffffff"),k=y.css.toColor("#000000"),C=y.css.toColor("#ffffff"),u=y.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};f.DEFAULT_ANSI_COLORS=Object.freeze(function(){for(var b=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],c=[0,95,135,175,215,255],n=0;n<216;n++){var l=c[n/36%6|0],o=c[n/6%6|0],a=c[n%6];b.push({css:y.channels.toCss(l,o,a),rgba:y.channels.toRgba(l,o,a)})}for(n=0;n<24;n++){var d=8+10*n;b.push({css:y.channels.toCss(d,d,d),rgba:y.channels.toRgba(d,d,d)})}return b}());var L=function(){function b(c,n){this.allowTransparency=n;var l=c.createElement("canvas");l.width=1,l.height=1;var o=l.getContext("2d");if(!o)throw new Error("Could not get rendering context");this._ctx=o,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new _.ColorContrastCache,this.colors={foreground:g,background:k,cursor:C,cursorAccent:u,selectionTransparent:v,selectionOpaque:y.color.blend(k,v),selectionForeground:void 0,ansi:f.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}return b.prototype.onOptionsChange=function(c){c==="minimumContrastRatio"&&this._contrastCache.clear()},b.prototype.setTheme=function(c){c===void 0&&(c={}),this.colors.foreground=this._parseColor(c.foreground,g),this.colors.background=this._parseColor(c.background,k),this.colors.cursor=this._parseColor(c.cursor,C,!0),this.colors.cursorAccent=this._parseColor(c.cursorAccent,u,!0),this.colors.selectionTransparent=this._parseColor(c.selection,v,!0),this.colors.selectionOpaque=y.color.blend(this.colors.background,this.colors.selectionTransparent);var n={css:"",rgba:0};this.colors.selectionForeground=c.selectionForeground?this._parseColor(c.selectionForeground,n):void 0,this.colors.selectionForeground===n&&(this.colors.selectionForeground=void 0),y.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=y.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(c.black,f.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(c.red,f.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(c.green,f.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(c.yellow,f.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(c.blue,f.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(c.magenta,f.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(c.cyan,f.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(c.white,f.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(c.brightBlack,f.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(c.brightRed,f.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(c.brightGreen,f.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(c.brightYellow,f.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(c.brightBlue,f.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(c.brightMagenta,f.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(c.brightCyan,f.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(c.brightWhite,f.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear(),this._updateRestoreColors()},b.prototype.restoreColor=function(c){if(c!==void 0)switch(c){case 256:this.colors.foreground=this._restoreColors.foreground;break;case 257:this.colors.background=this._restoreColors.background;break;case 258:this.colors.cursor=this._restoreColors.cursor;break;default:this.colors.ansi[c]=this._restoreColors.ansi[c]}else for(var n=0;n=m.length&&(m=void 0),{value:m&&m[g++],done:!m}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.removeElementFromParent=void 0,f.removeElementFromParent=function(){for(var m,y,_,g=[],k=0;k{Object.defineProperty(f,"__esModule",{value:!0}),f.addDisposableDomListener=void 0,f.addDisposableDomListener=function(E,m,y,_){E.addEventListener(m,y,_);var g=!1;return{dispose:function(){g||(g=!0,E.removeEventListener(m,y,_))}}}},3551:function(D,f,E){var m=this&&this.__decorate||function(u,v,L,b){var c,n=arguments.length,l=n<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,L):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(u,v,L,b);else for(var o=u.length-1;o>=0;o--)(c=u[o])&&(l=(n<3?c(l):n>3?c(v,L,l):c(v,L))||l);return n>3&&l&&Object.defineProperty(v,L,l),l},y=this&&this.__param||function(u,v){return function(L,b){v(L,b,u)}};Object.defineProperty(f,"__esModule",{value:!0}),f.MouseZone=f.Linkifier=void 0;var _=E(8460),g=E(2585),k=function(){function u(v,L,b){this._bufferService=v,this._logService=L,this._unicodeService=b,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new _.EventEmitter,this._onHideLinkUnderline=new _.EventEmitter,this._onLinkTooltip=new _.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(u.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),u.prototype.attachToDom=function(v,L){this._element=v,this._mouseZoneManager=L},u.prototype.linkifyRows=function(v,L){var b=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=v,this._rowsToLinkify.end=L):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,v),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,L)),this._mouseZoneManager.clearAll(v,L),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return b._linkifyRows()},u._timeBeforeLatency))},u.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var v=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var L=v.ydisp+this._rowsToLinkify.start;if(!(L>=v.lines.length)){for(var b=v.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,c=Math.ceil(2e3/this._bufferService.cols),n=this._bufferService.buffer.iterator(!1,L,b,c,c);n.hasNext();)for(var l=n.next(),o=0;o=0;L--)if(v.priority<=this._linkMatchers[L].priority)return void this._linkMatchers.splice(L+1,0,v);this._linkMatchers.splice(0,0,v)}else this._linkMatchers.push(v)},u.prototype.deregisterLinkMatcher=function(v){for(var L=0;L>9&511:void 0;b.validationCallback?b.validationCallback(h,function(O){n._rowsTimeoutId||O&&n._addLink(S[1],S[0]-n._bufferService.buffer.ydisp,h,b,M)}):d._addLink(S[1],S[0]-d._bufferService.buffer.ydisp,h,b,M)},d=this;(c=l.exec(L))!==null&&a()!=="break";);},u.prototype._addLink=function(v,L,b,c,n){var l=this;if(this._mouseZoneManager&&this._element){var o=this._unicodeService.getStringCellWidth(b),a=v%this._bufferService.cols,d=L+Math.floor(v/this._bufferService.cols),h=(a+o)%this._bufferService.cols,S=d+Math.floor((a+o)/this._bufferService.cols);h===0&&(h=this._bufferService.cols,S--),this._mouseZoneManager.add(new C(a+1,d+1,h+1,S+1,function(A){if(c.handler)return c.handler(A,b);var x=window.open();x?(x.opener=null,x.location.href=b):console.warn("Opening link blocked as opener could not be cleared")},function(){l._onShowLinkUnderline.fire(l._createLinkHoverEvent(a,d,h,S,n)),l._element.classList.add("xterm-cursor-pointer")},function(A){l._onLinkTooltip.fire(l._createLinkHoverEvent(a,d,h,S,n)),c.hoverTooltipCallback&&c.hoverTooltipCallback(A,b,{start:{x:a,y:d},end:{x:h,y:S}})},function(){l._onHideLinkUnderline.fire(l._createLinkHoverEvent(a,d,h,S,n)),l._element.classList.remove("xterm-cursor-pointer"),c.hoverLeaveCallback&&c.hoverLeaveCallback()},function(A){return!c.willLinkActivate||c.willLinkActivate(A,b)}))}},u.prototype._createLinkHoverEvent=function(v,L,b,c,n){return{x1:v,y1:L,x2:b,y2:c,cols:this._bufferService.cols,fg:n}},u._timeBeforeLatency=200,u=m([y(0,g.IBufferService),y(1,g.ILogService),y(2,g.IUnicodeService)],u)}();f.Linkifier=k;var C=function(u,v,L,b,c,n,l,o,a){this.x1=u,this.y1=v,this.x2=L,this.y2=b,this.clickCallback=c,this.hoverCallback=n,this.tooltipCallback=l,this.leaveCallback=o,this.willLinkActivate=a};f.MouseZone=C},6465:function(D,f,E){var m,y=this&&this.__extends||(m=function(n,l){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(o[d]=a[d])},m(n,l)},function(n,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function o(){this.constructor=n}m(n,l),n.prototype=l===null?Object.create(l):(o.prototype=l.prototype,new o)}),_=this&&this.__decorate||function(n,l,o,a){var d,h=arguments.length,S=h<3?l:a===null?a=Object.getOwnPropertyDescriptor(l,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(n,l,o,a);else for(var A=n.length-1;A>=0;A--)(d=n[A])&&(S=(h<3?d(S):h>3?d(l,o,S):d(l,o))||S);return h>3&&S&&Object.defineProperty(l,o,S),S},g=this&&this.__param||function(n,l){return function(o,a){l(o,a,n)}},k=this&&this.__values||function(n){var l=typeof Symbol=="function"&&Symbol.iterator,o=l&&n[l],a=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")},C=this&&this.__read||function(n,l){var o=typeof Symbol=="function"&&n[Symbol.iterator];if(!o)return n;var a,d,h=o.call(n),S=[];try{for(;(l===void 0||l-- >0)&&!(a=h.next()).done;)S.push(a.value)}catch(A){d={error:A}}finally{try{a&&!a.done&&(o=h.return)&&o.call(h)}finally{if(d)throw d.error}}return S};Object.defineProperty(f,"__esModule",{value:!0}),f.Linkifier2=void 0;var u=E(2585),v=E(8460),L=E(844),b=E(3656),c=function(n){function l(o){var a=n.call(this)||this;return a._bufferService=o,a._linkProviders=[],a._linkCacheDisposables=[],a._isMouseOut=!0,a._activeLine=-1,a._onShowLinkUnderline=a.register(new v.EventEmitter),a._onHideLinkUnderline=a.register(new v.EventEmitter),a.register((0,L.getDisposeArrayDisposable)(a._linkCacheDisposables)),a}return y(l,n),Object.defineProperty(l.prototype,"currentLink",{get:function(){return this._currentLink},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),l.prototype.registerLinkProvider=function(o){var a=this;return this._linkProviders.push(o),{dispose:function(){var d=a._linkProviders.indexOf(o);d!==-1&&a._linkProviders.splice(d,1)}}},l.prototype.attachToDom=function(o,a,d){var h=this;this._element=o,this._mouseService=a,this._renderService=d,this.register((0,b.addDisposableDomListener)(this._element,"mouseleave",function(){h._isMouseOut=!0,h._clearCurrentLink()})),this.register((0,b.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,b.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,b.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))},l.prototype._onMouseMove=function(o){if(this._lastMouseEvent=o,this._element&&this._mouseService){var a=this._positionFromMouseEvent(o,this._element,this._mouseService);if(a){this._isMouseOut=!1;for(var d=o.composedPath(),h=0;ho?this._bufferService.cols:x.link.range.end.x,I=M;I<=O;I++){if(d.has(I)){S.splice(A--,1);break}d.add(I)}}},l.prototype._checkLinkProviderResult=function(o,a,d){var h,S=this;if(!this._activeProviderReplies)return d;for(var A=this._activeProviderReplies.get(o),x=!1,M=0;M=o&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,L.disposeArray)(this._linkCacheDisposables))},l.prototype._handleNewLink=function(o){var a=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(o.link,d)&&(this._currentLink=o,this._currentLink.state={decorations:{underline:o.link.decorations===void 0||o.link.decorations.underline,pointerCursor:o.link.decorations===void 0||o.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,o.link,this._lastMouseEvent),o.link.decorations={},Object.defineProperties(o.link.decorations,{pointerCursor:{get:function(){var h,S;return(S=(h=a._currentLink)===null||h===void 0?void 0:h.state)===null||S===void 0?void 0:S.decorations.pointerCursor},set:function(h){var S,A;!((S=a._currentLink)===null||S===void 0)&&S.state&&a._currentLink.state.decorations.pointerCursor!==h&&(a._currentLink.state.decorations.pointerCursor=h,a._currentLink.state.isHovered&&((A=a._element)===null||A===void 0||A.classList.toggle("xterm-cursor-pointer",h)))}},underline:{get:function(){var h,S;return(S=(h=a._currentLink)===null||h===void 0?void 0:h.state)===null||S===void 0?void 0:S.decorations.underline},set:function(h){var S,A,x;!((S=a._currentLink)===null||S===void 0)&&S.state&&((x=(A=a._currentLink)===null||A===void 0?void 0:A.state)===null||x===void 0?void 0:x.decorations.underline)!==h&&(a._currentLink.state.decorations.underline=h,a._currentLink.state.isHovered&&a._fireUnderlineEvent(o.link,h))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(function(h){var S=h.start===0?0:h.start+1+a._bufferService.buffer.ydisp;a._clearCurrentLink(S,h.end+1+a._bufferService.buffer.ydisp)})))}},l.prototype._linkHover=function(o,a,d){var h;!((h=this._currentLink)===null||h===void 0)&&h.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&o.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(d,a.text)},l.prototype._fireUnderlineEvent=function(o,a){var d=o.range,h=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-h-1,d.end.x,d.end.y-h-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)},l.prototype._linkLeave=function(o,a,d){var h;!((h=this._currentLink)===null||h===void 0)&&h.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&o.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(d,a.text)},l.prototype._linkAtPosition=function(o,a){var d=o.range.start.y===o.range.end.y,h=o.range.start.ya.y;return(d&&o.range.start.x<=a.x&&o.range.end.x>=a.x||h&&o.range.end.x>=a.x||S&&o.range.start.x<=a.x||h&&S)&&o.range.start.y<=a.y&&o.range.end.y>=a.y},l.prototype._positionFromMouseEvent=function(o,a,d){var h=d.getCoords(o,a,this._bufferService.cols,this._bufferService.rows);if(h)return{x:h[0],y:h[1]+this._bufferService.buffer.ydisp}},l.prototype._createLinkUnderlineEvent=function(o,a,d,h,S){return{x1:o,y1:a,x2:d,y2:h,cols:this._bufferService.cols,fg:S}},_([g(0,u.IBufferService)],l)}(L.Disposable);f.Linkifier2=c},9042:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.tooMuchOutput=f.promptLabel=void 0,f.promptLabel="Terminal input",f.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},6954:function(D,f,E){var m,y=this&&this.__extends||(m=function(b,c){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(n[o]=l[o])},m(b,c)},function(b,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function n(){this.constructor=b}m(b,c),b.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)}),_=this&&this.__decorate||function(b,c,n,l){var o,a=arguments.length,d=a<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(b,c,n,l);else for(var h=b.length-1;h>=0;h--)(o=b[h])&&(d=(a<3?o(d):a>3?o(c,n,d):o(c,n))||d);return a>3&&d&&Object.defineProperty(c,n,d),d},g=this&&this.__param||function(b,c){return function(n,l){c(n,l,b)}};Object.defineProperty(f,"__esModule",{value:!0}),f.MouseZoneManager=void 0;var k=E(844),C=E(3656),u=E(4725),v=E(2585),L=function(b){function c(n,l,o,a,d,h){var S=b.call(this)||this;return S._element=n,S._screenElement=l,S._bufferService=o,S._mouseService=a,S._selectionService=d,S._optionsService=h,S._zones=[],S._areZonesActive=!1,S._lastHoverCoords=[void 0,void 0],S._initialSelectionLength=0,S.register((0,C.addDisposableDomListener)(S._element,"mousedown",function(A){return S._onMouseDown(A)})),S._mouseMoveListener=function(A){return S._onMouseMove(A)},S._mouseLeaveListener=function(A){return S._onMouseLeave(A)},S._clickListener=function(A){return S._onClick(A)},S}return y(c,b),c.prototype.dispose=function(){b.prototype.dispose.call(this),this._deactivate()},c.prototype.add=function(n){this._zones.push(n),this._zones.length===1&&this._activate()},c.prototype.clearAll=function(n,l){if(this._zones.length!==0){n&&l||(n=0,l=this._bufferService.rows-1);for(var o=0;on&&a.y1<=l+1||a.y2>n&&a.y2<=l+1||a.y1l+1)&&(this._currentZone&&this._currentZone===a&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(o--,1))}this._zones.length===0&&this._deactivate()}},c.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},c.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},c.prototype._onMouseMove=function(n){this._lastHoverCoords[0]===n.pageX&&this._lastHoverCoords[1]===n.pageY||(this._onHover(n),this._lastHoverCoords=[n.pageX,n.pageY])},c.prototype._onHover=function(n){var l=this,o=this._findZoneEventAt(n);o!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),o&&(this._currentZone=o,o.hoverCallback&&o.hoverCallback(n),this._tooltipTimeout=window.setTimeout(function(){return l._onTooltip(n)},this._optionsService.rawOptions.linkTooltipHoverDuration)))},c.prototype._onTooltip=function(n){this._tooltipTimeout=void 0;var l=this._findZoneEventAt(n);l?.tooltipCallback(n)},c.prototype._onMouseDown=function(n){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var l=this._findZoneEventAt(n);l?.willLinkActivate(n)&&(n.preventDefault(),n.stopImmediatePropagation())}},c.prototype._onMouseLeave=function(n){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},c.prototype._onClick=function(n){var l=this._findZoneEventAt(n),o=this._getSelectionLength();l&&o===this._initialSelectionLength&&(l.clickCallback(n),n.preventDefault(),n.stopImmediatePropagation())},c.prototype._getSelectionLength=function(){var n=this._selectionService.selectionText;return n?n.length:0},c.prototype._findZoneEventAt=function(n){var l=this._mouseService.getCoords(n,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(l)for(var o=l[0],a=l[1],d=0;d=h.x1&&o=h.x1||a===h.y2&&oh.y1&&a=y.length&&(y=void 0),{value:y&&y[k++],done:!y}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.RenderDebouncer=void 0;var m=function(){function y(_){this._renderCallback=_,this._refreshCallbacks=[]}return y.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},y.prototype.addRefreshCallback=function(_){var g=this;return this._refreshCallbacks.push(_),this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return g._innerRefresh()})),this._animationFrame},y.prototype.refresh=function(_,g,k){var C=this;this._rowCount=k,_=_!==void 0?_:0,g=g!==void 0?g:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,_):_,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,g):g,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return C._innerRefresh()}))},y.prototype._innerRefresh=function(){if(this._animationFrame=void 0,this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var _=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(_,g),this._runRefreshCallbacks()}else this._runRefreshCallbacks()},y.prototype._runRefreshCallbacks=function(){var _,g;try{for(var k=E(this._refreshCallbacks),C=k.next();!C.done;C=k.next())(0,C.value)(0)}catch(u){_={error:u}}finally{try{C&&!C.done&&(g=k.return)&&g.call(k)}finally{if(_)throw _.error}}this._refreshCallbacks=[]},y}();f.RenderDebouncer=m},5596:function(D,f,E){var m,y=this&&this.__extends||(m=function(g,k){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,u){C.__proto__=u}||function(C,u){for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(C[v]=u[v])},m(g,k)},function(g,k){if(typeof k!="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");function C(){this.constructor=g}m(g,k),g.prototype=k===null?Object.create(k):(C.prototype=k.prototype,new C)});Object.defineProperty(f,"__esModule",{value:!0}),f.ScreenDprMonitor=void 0;var _=function(g){function k(){var C=g!==null&&g.apply(this,arguments)||this;return C._currentDevicePixelRatio=window.devicePixelRatio,C}return y(k,g),k.prototype.setListener=function(C){var u=this;this._listener&&this.clearListener(),this._listener=C,this._outerListener=function(){u._listener&&(u._listener(window.devicePixelRatio,u._currentDevicePixelRatio),u._updateDpr())},this._updateDpr()},k.prototype.dispose=function(){g.prototype.dispose.call(this),this.clearListener()},k.prototype._updateDpr=function(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)===null||C===void 0||C.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},k.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},k}(E(844).Disposable);f.ScreenDprMonitor=_},3236:function(D,f,E){var m,y=this&&this.__extends||(m=function(ge,le){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Y,Z){Y.__proto__=Z}||function(Y,Z){for(var se in Z)Object.prototype.hasOwnProperty.call(Z,se)&&(Y[se]=Z[se])},m(ge,le)},function(ge,le){if(typeof le!="function"&&le!==null)throw new TypeError("Class extends value "+String(le)+" is not a constructor or null");function Y(){this.constructor=ge}m(ge,le),ge.prototype=le===null?Object.create(le):(Y.prototype=le.prototype,new Y)}),_=this&&this.__values||function(ge){var le=typeof Symbol=="function"&&Symbol.iterator,Y=le&&ge[le],Z=0;if(Y)return Y.call(ge);if(ge&&typeof ge.length=="number")return{next:function(){return ge&&Z>=ge.length&&(ge=void 0),{value:ge&&ge[Z++],done:!ge}}};throw new TypeError(le?"Object is not iterable.":"Symbol.iterator is not defined.")},g=this&&this.__read||function(ge,le){var Y=typeof Symbol=="function"&&ge[Symbol.iterator];if(!Y)return ge;var Z,se,xe=Y.call(ge),Ee=[];try{for(;(le===void 0||le-- >0)&&!(Z=xe.next()).done;)Ee.push(Z.value)}catch(De){se={error:De}}finally{try{Z&&!Z.done&&(Y=xe.return)&&Y.call(xe)}finally{if(se)throw se.error}}return Ee},k=this&&this.__spreadArray||function(ge,le,Y){if(Y||arguments.length===2)for(var Z,se=0,xe=le.length;se4)&&Z.coreMouseService.triggerMouseEvent({col:Xt.x-33,row:Xt.y-33,button:$e,action:dt,ctrl:we.ctrlKey,alt:we.altKey,shift:we.shiftKey})}var Ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},De=function(we){return xe(we),we.buttons||(Y._document.removeEventListener("mouseup",Ee.mouseup),Ee.mousedrag&&Y._document.removeEventListener("mousemove",Ee.mousedrag)),Y.cancel(we)},je=function(we){return xe(we),Y.cancel(we,!0)},Re=function(we){we.buttons&&xe(we)},Xe=function(we){we.buttons||xe(we)};this.register(this.coreMouseService.onProtocolChange(function(we){we?(Y.optionsService.rawOptions.logLevel==="debug"&&Y._logService.debug("Binding to mouse events:",Y.coreMouseService.explainEvents(we)),Y.element.classList.add("enable-mouse-events"),Y._selectionService.disable()):(Y._logService.debug("Unbinding from mouse events."),Y.element.classList.remove("enable-mouse-events"),Y._selectionService.enable()),8&we?Ee.mousemove||(se.addEventListener("mousemove",Xe),Ee.mousemove=Xe):(se.removeEventListener("mousemove",Ee.mousemove),Ee.mousemove=null),16&we?Ee.wheel||(se.addEventListener("wheel",je,{passive:!1}),Ee.wheel=je):(se.removeEventListener("wheel",Ee.wheel),Ee.wheel=null),2&we?Ee.mouseup||(Ee.mouseup=De):(Y._document.removeEventListener("mouseup",Ee.mouseup),Ee.mouseup=null),4&we?Ee.mousedrag||(Ee.mousedrag=Re):(Y._document.removeEventListener("mousemove",Ee.mousedrag),Ee.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,a.addDisposableDomListener)(se,"mousedown",function(we){if(we.preventDefault(),Y.focus(),Y.coreMouseService.areMouseEventsActive&&!Y._selectionService.shouldForceSelection(we))return xe(we),Ee.mouseup&&Y._document.addEventListener("mouseup",Ee.mouseup),Ee.mousedrag&&Y._document.addEventListener("mousemove",Ee.mousedrag),Y.cancel(we)})),this.register((0,a.addDisposableDomListener)(se,"wheel",function(we){if(!Ee.wheel){if(!Y.buffer.hasScrollback){var $e=Y.viewport.getLinesScrolled(we);if($e===0)return;for(var dt=L.C0.ESC+(Y.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(we.deltaY<0?"A":"B"),Xt="",gr=0;gr=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==L.C0.ETX&&se.key!==L.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(Y,!0))))},le.prototype._isThirdLevelShift=function(Y,Z){var se=Y.isMac&&!this.options.macOptionIsMeta&&Z.altKey&&!Z.ctrlKey&&!Z.metaKey||Y.isWindows&&Z.altKey&&Z.ctrlKey&&!Z.metaKey||Y.isWindows&&Z.getModifierState("AltGraph");return Z.type==="keypress"?se:se&&(!Z.keyCode||Z.keyCode>47)},le.prototype._keyUp=function(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||(function(Z){return Z.keyCode===16||Z.keyCode===17||Z.keyCode===18}(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)},le.prototype._keyPress=function(Y){var Z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)Z=Y.charCode;else if(Y.which===null||Y.which===void 0)Z=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;Z=Y.which}return!(!Z||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(Z=String.fromCharCode(Z),this._onKey.fire({key:Z,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(Z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))},le.prototype._inputEvent=function(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;var Z=Y.data;return this.coreService.triggerDataEvent(Z,!0),this.cancel(Y),!0}return!1},le.prototype.bell=function(){var Y;this._soundBell()&&((Y=this._soundService)===null||Y===void 0||Y.playBellSound()),this._onBell.fire()},le.prototype.resize=function(Y,Z){Y!==this.cols||Z!==this.rows?ge.prototype.resize.call(this,Y,Z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},le.prototype._afterResize=function(Y,Z){var se,xe;(se=this._charSizeService)===null||se===void 0||se.measure(),(xe=this.viewport)===null||xe===void 0||xe.syncScrollArea(!0)},le.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var Y=1;Y{Object.defineProperty(f,"__esModule",{value:!0}),f.TimeBasedDebouncer=void 0;var E=function(){function m(y,_){_===void 0&&(_=1e3),this._renderCallback=y,this._debounceThresholdMS=_,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}return m.prototype.dispose=function(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)},m.prototype.refresh=function(y,_,g){var k=this;this._rowCount=g,y=y!==void 0?y:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,y):y,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_;var C=Date.now();if(C-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=C,this._innerRefresh();else if(!this._additionalRefreshRequested){var u=C-this._lastRefreshMs,v=this._debounceThresholdMS-u;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(function(){k._lastRefreshMs=Date.now(),k._innerRefresh(),k._additionalRefreshRequested=!1,k._refreshTimeoutID=void 0},v)}},m.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var y=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(y,_)}},m}();f.TimeBasedDebouncer=E},1680:function(D,f,E){var m,y=this&&this.__extends||(m=function(b,c){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(n[o]=l[o])},m(b,c)},function(b,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function n(){this.constructor=b}m(b,c),b.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)}),_=this&&this.__decorate||function(b,c,n,l){var o,a=arguments.length,d=a<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(b,c,n,l);else for(var h=b.length-1;h>=0;h--)(o=b[h])&&(d=(a<3?o(d):a>3?o(c,n,d):o(c,n))||d);return a>3&&d&&Object.defineProperty(c,n,d),d},g=this&&this.__param||function(b,c){return function(n,l){c(n,l,b)}};Object.defineProperty(f,"__esModule",{value:!0}),f.Viewport=void 0;var k=E(844),C=E(3656),u=E(4725),v=E(2585),L=function(b){function c(n,l,o,a,d,h,S,A){var x=b.call(this)||this;return x._scrollLines=n,x._viewportElement=l,x._scrollArea=o,x._element=a,x._bufferService=d,x._optionsService=h,x._charSizeService=S,x._renderService=A,x.scrollBarWidth=0,x._currentRowHeight=0,x._currentScaledCellHeight=0,x._lastRecordedBufferLength=0,x._lastRecordedViewportHeight=0,x._lastRecordedBufferHeight=0,x._lastTouchY=0,x._lastScrollTop=0,x._wheelPartialScroll=0,x._refreshAnimationFrame=null,x._ignoreNextScrollEvent=!1,x.scrollBarWidth=x._viewportElement.offsetWidth-x._scrollArea.offsetWidth||15,x.register((0,C.addDisposableDomListener)(x._viewportElement,"scroll",x._onScroll.bind(x))),x._activeBuffer=x._bufferService.buffer,x.register(x._bufferService.buffers.onBufferActivate(function(M){return x._activeBuffer=M.activeBuffer})),x._renderDimensions=x._renderService.dimensions,x.register(x._renderService.onDimensionsChange(function(M){return x._renderDimensions=M})),setTimeout(function(){return x.syncScrollArea()},0),x}return y(c,b),c.prototype.onThemeChange=function(n){this._viewportElement.style.backgroundColor=n.background.css},c.prototype._refresh=function(n){var l=this;if(n)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return l._innerRefresh()}))},c.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var n=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==n&&(this._lastRecordedBufferHeight=n,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null},c.prototype.syncScrollArea=function(n){if(n===void 0&&(n=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(n);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(n)},c.prototype._onScroll=function(n){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent){if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);var l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(l)}},c.prototype._bubbleScroll=function(n,l){var o=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&o0?1:-1),this._wheelPartialScroll%=1):n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l},c.prototype._applyScrollModifier=function(n,l){var o=this._optionsService.rawOptions.fastScrollModifier;return o==="alt"&&l.altKey||o==="ctrl"&&l.ctrlKey||o==="shift"&&l.shiftKey?n*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:n*this._optionsService.rawOptions.scrollSensitivity},c.prototype.onTouchStart=function(n){this._lastTouchY=n.touches[0].pageY},c.prototype.onTouchMove=function(n){var l=this._lastTouchY-n.touches[0].pageY;return this._lastTouchY=n.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(n,l))},_([g(4,v.IBufferService),g(5,v.IOptionsService),g(6,u.ICharSizeService),g(7,u.IRenderService)],c)}(k.Disposable);f.Viewport=L},3107:function(D,f,E){var m,y=this&&this.__extends||(m=function(c,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,o){l.__proto__=o}||function(l,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(l[a]=o[a])},m(c,n)},function(c,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function l(){this.constructor=c}m(c,n),c.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}),_=this&&this.__decorate||function(c,n,l,o){var a,d=arguments.length,h=d<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(c,n,l,o);else for(var S=c.length-1;S>=0;S--)(a=c[S])&&(h=(d<3?a(h):d>3?a(n,l,h):a(n,l))||h);return d>3&&h&&Object.defineProperty(n,l,h),h},g=this&&this.__param||function(c,n){return function(l,o){n(l,o,c)}},k=this&&this.__values||function(c){var n=typeof Symbol=="function"&&Symbol.iterator,l=n&&c[n],o=0;if(l)return l.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&o>=c.length&&(c=void 0),{value:c&&c[o++],done:!c}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.BufferDecorationRenderer=void 0;var C=E(3656),u=E(4725),v=E(844),L=E(2585),b=function(c){function n(l,o,a,d){var h=c.call(this)||this;return h._screenElement=l,h._bufferService=o,h._decorationService=a,h._renderService=d,h._decorationElements=new Map,h._altBufferIsActive=!1,h._dimensionsChanged=!1,h._container=document.createElement("div"),h._container.classList.add("xterm-decoration-container"),h._screenElement.appendChild(h._container),h.register(h._renderService.onRenderedViewportChange(function(){return h._queueRefresh()})),h.register(h._renderService.onDimensionsChange(function(){h._dimensionsChanged=!0,h._queueRefresh()})),h.register((0,C.addDisposableDomListener)(window,"resize",function(){return h._queueRefresh()})),h.register(h._bufferService.buffers.onBufferActivate(function(){h._altBufferIsActive=h._bufferService.buffer===h._bufferService.buffers.alt})),h.register(h._decorationService.onDecorationRegistered(function(){return h._queueRefresh()})),h.register(h._decorationService.onDecorationRemoved(function(S){return h._removeDecoration(S)})),h}return y(n,c),n.prototype.dispose=function(){this._container.remove(),this._decorationElements.clear(),c.prototype.dispose.call(this)},n.prototype._queueRefresh=function(){var l=this;this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(function(){l.refreshDecorations(),l._animationFrame=void 0}))},n.prototype.refreshDecorations=function(){var l,o;try{for(var a=k(this._decorationService.decorations),d=a.next();!d.done;d=a.next()){var h=d.value;this._renderDecoration(h)}}catch(S){l={error:S}}finally{try{d&&!d.done&&(o=a.return)&&o.call(a)}finally{if(l)throw l.error}}this._dimensionsChanged=!1},n.prototype._renderDecoration=function(l){this._refreshStyle(l),this._dimensionsChanged&&this._refreshXPosition(l)},n.prototype._createElement=function(l){var o,a=document.createElement("div");a.classList.add("xterm-decoration"),a.style.width=Math.round((l.options.width||1)*this._renderService.dimensions.actualCellWidth)+"px",a.style.height=(l.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",a.style.top=(l.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",a.style.lineHeight=this._renderService.dimensions.actualCellHeight+"px";var d=(o=l.options.x)!==null&&o!==void 0?o:0;return d&&d>this._bufferService.cols&&(a.style.display="none"),this._refreshXPosition(l,a),a},n.prototype._refreshStyle=function(l){var o=this,a=l.marker.line-this._bufferService.buffers.active.ydisp;if(a<0||a>=this._bufferService.rows)l.element&&(l.element.style.display="none",l.onRenderEmitter.fire(l.element));else{var d=this._decorationElements.get(l);d||(l.onDispose(function(){return o._removeDecoration(l)}),d=this._createElement(l),l.element=d,this._decorationElements.set(l,d),this._container.appendChild(d)),d.style.top=a*this._renderService.dimensions.actualCellHeight+"px",d.style.display=this._altBufferIsActive?"none":"block",l.onRenderEmitter.fire(d)}},n.prototype._refreshXPosition=function(l,o){var a;if(o===void 0&&(o=l.element),o){var d=(a=l.options.x)!==null&&a!==void 0?a:0;(l.options.anchor||"left")==="right"?o.style.right=d?d*this._renderService.dimensions.actualCellWidth+"px":"":o.style.left=d?d*this._renderService.dimensions.actualCellWidth+"px":""}},n.prototype._removeDecoration=function(l){var o;(o=this._decorationElements.get(l))===null||o===void 0||o.remove(),this._decorationElements.delete(l)},_([g(1,L.IBufferService),g(2,L.IDecorationService),g(3,u.IRenderService)],n)}(v.Disposable);f.BufferDecorationRenderer=b},5871:function(D,f){var E=this&&this.__values||function(y){var _=typeof Symbol=="function"&&Symbol.iterator,g=_&&y[_],k=0;if(g)return g.call(y);if(y&&typeof y.length=="number")return{next:function(){return y&&k>=y.length&&(y=void 0),{value:y&&y[k++],done:!y}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.ColorZoneStore=void 0;var m=function(){function y(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}return Object.defineProperty(y.prototype,"zones",{get:function(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones},enumerable:!1,configurable:!0}),y.prototype.clear=function(){this._zones.length=0,this._zonePoolIndex=0},y.prototype.addDecoration=function(_){var g,k;if(_.options.overviewRulerOptions){try{for(var C=E(this._zones),u=C.next();!u.done;u=C.next()){var v=u.value;if(v.color===_.options.overviewRulerOptions.color&&v.position===_.options.overviewRulerOptions.position){if(this._lineIntersectsZone(v,_.marker.line))return;if(this._lineAdjacentToZone(v,_.marker.line,_.options.overviewRulerOptions.position))return void this._addLineToZone(v,_.marker.line)}}}catch(L){g={error:L}}finally{try{u&&!u.done&&(k=C.return)&&k.call(C)}finally{if(g)throw g.error}}if(this._zonePoolIndex=_.startBufferLine&&g<=_.endBufferLine},y.prototype._lineAdjacentToZone=function(_,g,k){return g>=_.startBufferLine-this._linePadding[k||"full"]&&g<=_.endBufferLine+this._linePadding[k||"full"]},y.prototype._addLineToZone=function(_,g){_.startBufferLine=Math.min(_.startBufferLine,g),_.endBufferLine=Math.max(_.endBufferLine,g)},y}();f.ColorZoneStore=m},5744:function(D,f,E){var m,y=this&&this.__extends||(m=function(a,d){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,S){h.__proto__=S}||function(h,S){for(var A in S)Object.prototype.hasOwnProperty.call(S,A)&&(h[A]=S[A])},m(a,d)},function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");function h(){this.constructor=a}m(a,d),a.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}),_=this&&this.__decorate||function(a,d,h,S){var A,x=arguments.length,M=x<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,h):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(a,d,h,S);else for(var O=a.length-1;O>=0;O--)(A=a[O])&&(M=(x<3?A(M):x>3?A(d,h,M):A(d,h))||M);return x>3&&M&&Object.defineProperty(d,h,M),M},g=this&&this.__param||function(a,d){return function(h,S){d(h,S,a)}},k=this&&this.__values||function(a){var d=typeof Symbol=="function"&&Symbol.iterator,h=d&&a[d],S=0;if(h)return h.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&S>=a.length&&(a=void 0),{value:a&&a[S++],done:!a}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.OverviewRulerRenderer=void 0;var C=E(5871),u=E(3656),v=E(4725),L=E(844),b=E(2585),c={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},o=function(a){function d(h,S,A,x,M,O){var I,P=a.call(this)||this;P._viewportElement=h,P._screenElement=S,P._bufferService=A,P._decorationService=x,P._renderService=M,P._optionsService=O,P._colorZoneStore=new C.ColorZoneStore,P._shouldUpdateDimensions=!0,P._shouldUpdateAnchor=!0,P._lastKnownBufferLength=0,P._canvas=document.createElement("canvas"),P._canvas.classList.add("xterm-decoration-overview-ruler"),P._refreshCanvasDimensions(),(I=P._viewportElement.parentElement)===null||I===void 0||I.insertBefore(P._canvas,P._viewportElement);var T=P._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");return P._ctx=T,P._registerDecorationListeners(),P._registerBufferChangeListeners(),P._registerDimensionChangeListeners(),P}return y(d,a),Object.defineProperty(d.prototype,"_width",{get:function(){return this._optionsService.options.overviewRulerWidth||0},enumerable:!1,configurable:!0}),d.prototype._registerDecorationListeners=function(){var h=this;this.register(this._decorationService.onDecorationRegistered(function(){return h._queueRefresh(void 0,!0)})),this.register(this._decorationService.onDecorationRemoved(function(){return h._queueRefresh(void 0,!0)}))},d.prototype._registerBufferChangeListeners=function(){var h=this;this.register(this._renderService.onRenderedViewportChange(function(){return h._queueRefresh()})),this.register(this._bufferService.buffers.onBufferActivate(function(){h._canvas.style.display=h._bufferService.buffer===h._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(function(){h._lastKnownBufferLength!==h._bufferService.buffers.normal.lines.length&&(h._refreshDrawHeightConstants(),h._refreshColorZonePadding())}))},d.prototype._registerDimensionChangeListeners=function(){var h=this;this.register(this._renderService.onRender(function(){h._containerHeight&&h._containerHeight===h._screenElement.clientHeight||(h._queueRefresh(!0),h._containerHeight=h._screenElement.clientHeight)})),this.register(this._optionsService.onOptionChange(function(S){S==="overviewRulerWidth"&&h._queueRefresh(!0)})),this.register((0,u.addDisposableDomListener)(window,"resize",function(){h._queueRefresh(!0)})),this._queueRefresh(!0)},d.prototype.dispose=function(){var h;(h=this._canvas)===null||h===void 0||h.remove(),a.prototype.dispose.call(this)},d.prototype._refreshDrawConstants=function(){var h=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=h,n.center=S,n.right=h,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=n.left,l.right=n.left+n.center},d.prototype._refreshDrawHeightConstants=function(){c.full=Math.round(2*window.devicePixelRatio);var h=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(h,12),6)*window.devicePixelRatio);c.left=S,c.center=S,c.right=S},d.prototype._refreshColorZonePadding=function(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length},d.prototype._refreshCanvasDimensions=function(){this._canvas.style.width=this._width+"px",this._canvas.width=Math.round(this._width*window.devicePixelRatio),this._canvas.style.height=this._screenElement.clientHeight+"px",this._canvas.height=Math.round(this._screenElement.clientHeight*window.devicePixelRatio),this._refreshDrawConstants(),this._refreshColorZonePadding()},d.prototype._refreshDecorations=function(){var h,S,A,x,M,O;this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();try{for(var I=k(this._decorationService.decorations),P=I.next();!P.done;P=I.next()){var T=P.value;this._colorZoneStore.addDecoration(T)}}catch(oe){h={error:oe}}finally{try{P&&!P.done&&(S=I.return)&&S.call(I)}finally{if(h)throw h.error}}this._ctx.lineWidth=1;var j=this._colorZoneStore.zones;try{for(var N=k(j),U=N.next();!U.done;U=N.next())(ue=U.value).position!=="full"&&this._renderColorZone(ue)}catch(oe){A={error:oe}}finally{try{U&&!U.done&&(x=N.return)&&x.call(N)}finally{if(A)throw A.error}}try{for(var V=k(j),ne=V.next();!ne.done;ne=V.next()){var ue;(ue=ne.value).position==="full"&&this._renderColorZone(ue)}}catch(oe){M={error:oe}}finally{try{ne&&!ne.done&&(O=V.return)&&O.call(V)}finally{if(M)throw M.error}}this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1},d.prototype._renderColorZone=function(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(l[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-c[h.position||"full"]/2),n[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[h.position||"full"]))},d.prototype._queueRefresh=function(h,S){var A=this;this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=window.requestAnimationFrame(function(){A._refreshDecorations(),A._animationFrame=void 0}))},_([g(2,b.IBufferService),g(3,b.IDecorationService),g(4,v.IRenderService),g(5,b.IOptionsService)],d)}(L.Disposable);f.OverviewRulerRenderer=o},2950:function(D,f,E){var m=this&&this.__decorate||function(C,u,v,L){var b,c=arguments.length,n=c<3?u:L===null?L=Object.getOwnPropertyDescriptor(u,v):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(C,u,v,L);else for(var l=C.length-1;l>=0;l--)(b=C[l])&&(n=(c<3?b(n):c>3?b(u,v,n):b(u,v))||n);return c>3&&n&&Object.defineProperty(u,v,n),n},y=this&&this.__param||function(C,u){return function(v,L){u(v,L,C)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CompositionHelper=void 0;var _=E(4725),g=E(2585),k=function(){function C(u,v,L,b,c,n){this._textarea=u,this._compositionView=v,this._bufferService=L,this._optionsService=b,this._coreService=c,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}return Object.defineProperty(C.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),C.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")},C.prototype.compositionupdate=function(u){var v=this;this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout(function(){v._compositionPosition.end=v._textarea.value.length},0)},C.prototype.compositionend=function(){this._finalizeComposition(!0)},C.prototype.keydown=function(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},C.prototype._finalizeComposition=function(u){var v=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){var L={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(v._isSendingComposition){v._isSendingComposition=!1;var c;L.start+=v._dataAlreadySent.length,(c=v._isComposing?v._textarea.value.substring(L.start,L.end):v._textarea.value.substring(L.start)).length>0&&v._coreService.triggerDataEvent(c,!0)}},0)}else{this._isSendingComposition=!1;var b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}},C.prototype._handleAnyTextareaChanges=function(){var u=this,v=this._textarea.value;setTimeout(function(){if(!u._isComposing){var L=u._textarea.value.replace(v,"");L.length>0&&(u._dataAlreadySent=L,u._coreService.triggerDataEvent(L,!0))}},0)},C.prototype.updateCompositionElements=function(u){var v=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var L=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.actualCellHeight,c=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,n=L*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=n+"px",this._compositionView.style.top=c+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var l=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=c+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}u||setTimeout(function(){return v.updateCompositionElements(!0)},0)}},m([y(2,g.IBufferService),y(3,g.IOptionsService),y(4,g.ICoreService),y(5,_.IRenderService)],C)}();f.CompositionHelper=k},9806:(D,f)=>{function E(m,y,_){var g=_.getBoundingClientRect(),k=m.getComputedStyle(_),C=parseInt(k.getPropertyValue("padding-left")),u=parseInt(k.getPropertyValue("padding-top"));return[y.clientX-g.left-C,y.clientY-g.top-u]}Object.defineProperty(f,"__esModule",{value:!0}),f.getRawByteCoords=f.getCoords=f.getCoordsRelativeToElement=void 0,f.getCoordsRelativeToElement=E,f.getCoords=function(m,y,_,g,k,C,u,v,L){if(C){var b=E(m,y,_);if(b)return b[0]=Math.ceil((b[0]+(L?u/2:0))/u),b[1]=Math.ceil(b[1]/v),b[0]=Math.min(Math.max(b[0],1),g+(L?1:0)),b[1]=Math.min(Math.max(b[1],1),k),b}},f.getRawByteCoords=function(m){if(m)return{x:m[0]+32,y:m[1]+32}}},9504:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.moveToCellSequence=void 0;var m=E(2584);function y(v,L,b,c){var n=v-_(b,v),l=L-_(b,L),o=Math.abs(n-l)-function(a,d,h){for(var S=0,A=a-_(h,a),x=d-_(h,d),M=0;M=0&&LL?"A":"B"}function k(v,L,b,c,n,l){for(var o=v,a=L,d="";o!==b||a!==c;)o+=n?1:-1,n&&o>l.cols-1?(d+=l.buffer.translateBufferLineToString(a,!1,v,o),o=0,v=0,a++):!n&&o<0&&(d+=l.buffer.translateBufferLineToString(a,!1,0,v+1),v=o=l.cols-1,a--);return d+l.buffer.translateBufferLineToString(a,!1,v,o)}function C(v,L){var b=L?"O":"[";return m.C0.ESC+b+v}function u(v,L){v=Math.floor(v);for(var b="",c=0;c0?A-_(x,A):h;var I=A,P=function(T,j,N,U,V,ne){var ue;return ue=y(N,U,V,ne).length>0?U-_(V,U):j,T=N&&uev?"D":"C",u(Math.abs(l-v),C(n,c));n=o>L?"D":"C";var a=Math.abs(o-L);return u(function(d,h){return h.cols-d}(o>L?v:l,b)+(a-1)*b.cols+1+((o>L?l:v)-1),C(n,c))}},4389:function(D,f,E){var m=this&&this.__assign||function(){return m=Object.assign||function(c){for(var n,l=1,o=arguments.length;l=c.length&&(c=void 0),{value:c&&c[o++],done:!c}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;var _=E(3236),g=E(9042),k=E(7975),C=E(7090),u=E(5741),v=E(8285),L=["cols","rows"],b=function(){function c(n){var l=this;this._core=new _.Terminal(n),this._addonManager=new u.AddonManager,this._publicOptions=m({},this._core.options);var o=function(S){return l._core.options[S]},a=function(S,A){l._checkReadonlyOptions(S),l._core.options[S]=A};for(var d in this._core.options){var h={get:o.bind(this,d),set:a.bind(this,d)};Object.defineProperty(this._publicOptions,d,h)}}return c.prototype._checkReadonlyOptions=function(n){if(L.includes(n))throw new Error('Option "'+n+'" can only be set in the constructor')},c.prototype._checkProposedApi=function(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(c.prototype,"onBell",{get:function(){return this._core.onBell},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onWriteParsed",{get:function(){return this._core.onWriteParsed},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new k.ParserApi(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"unicode",{get:function(){return this._checkProposedApi(),new C.UnicodeApi(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"buffer",{get:function(){return this._checkProposedApi(),this._buffer||(this._buffer=new v.BufferNamespaceApi(this._core)),this._buffer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"modes",{get:function(){var n=this._core.coreService.decPrivateModes,l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:n.applicationCursorKeys,applicationKeypadMode:n.applicationKeypad,bracketedPasteMode:n.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:n.origin,reverseWraparoundMode:n.reverseWraparound,sendFocusMode:n.sendFocus,wraparoundMode:n.wraparound}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"options",{get:function(){return this._publicOptions},set:function(n){for(var l in n)this._publicOptions[l]=n[l]},enumerable:!1,configurable:!0}),c.prototype.blur=function(){this._core.blur()},c.prototype.focus=function(){this._core.focus()},c.prototype.resize=function(n,l){this._verifyIntegers(n,l),this._core.resize(n,l)},c.prototype.open=function(n){this._core.open(n)},c.prototype.attachCustomKeyEventHandler=function(n){this._core.attachCustomKeyEventHandler(n)},c.prototype.registerLinkMatcher=function(n,l,o){return this._checkProposedApi(),this._core.registerLinkMatcher(n,l,o)},c.prototype.deregisterLinkMatcher=function(n){this._checkProposedApi(),this._core.deregisterLinkMatcher(n)},c.prototype.registerLinkProvider=function(n){return this._checkProposedApi(),this._core.registerLinkProvider(n)},c.prototype.registerCharacterJoiner=function(n){return this._checkProposedApi(),this._core.registerCharacterJoiner(n)},c.prototype.deregisterCharacterJoiner=function(n){this._checkProposedApi(),this._core.deregisterCharacterJoiner(n)},c.prototype.registerMarker=function(n){return n===void 0&&(n=0),this._checkProposedApi(),this._verifyIntegers(n),this._core.addMarker(n)},c.prototype.registerDecoration=function(n){var l,o,a;return this._checkProposedApi(),this._verifyPositiveIntegers((l=n.x)!==null&&l!==void 0?l:0,(o=n.width)!==null&&o!==void 0?o:0,(a=n.height)!==null&&a!==void 0?a:0),this._core.registerDecoration(n)},c.prototype.addMarker=function(n){return this.registerMarker(n)},c.prototype.hasSelection=function(){return this._core.hasSelection()},c.prototype.select=function(n,l,o){this._verifyIntegers(n,l,o),this._core.select(n,l,o)},c.prototype.getSelection=function(){return this._core.getSelection()},c.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},c.prototype.clearSelection=function(){this._core.clearSelection()},c.prototype.selectAll=function(){this._core.selectAll()},c.prototype.selectLines=function(n,l){this._verifyIntegers(n,l),this._core.selectLines(n,l)},c.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},c.prototype.scrollLines=function(n){this._verifyIntegers(n),this._core.scrollLines(n)},c.prototype.scrollPages=function(n){this._verifyIntegers(n),this._core.scrollPages(n)},c.prototype.scrollToTop=function(){this._core.scrollToTop()},c.prototype.scrollToBottom=function(){this._core.scrollToBottom()},c.prototype.scrollToLine=function(n){this._verifyIntegers(n),this._core.scrollToLine(n)},c.prototype.clear=function(){this._core.clear()},c.prototype.write=function(n,l){this._core.write(n,l)},c.prototype.writeUtf8=function(n,l){this._core.write(n,l)},c.prototype.writeln=function(n,l){this._core.write(n),this._core.write(`\r -`,l)},c.prototype.paste=function(n){this._core.paste(n)},c.prototype.getOption=function(n){return this._core.optionsService.getOption(n)},c.prototype.setOption=function(n,l){this._checkReadonlyOptions(n),this._core.optionsService.setOption(n,l)},c.prototype.refresh=function(n,l){this._verifyIntegers(n,l),this._core.refresh(n,l)},c.prototype.reset=function(){this._core.reset()},c.prototype.clearTextureAtlas=function(){this._core.clearTextureAtlas()},c.prototype.loadAddon=function(n){return this._addonManager.loadAddon(this,n)},Object.defineProperty(c,"strings",{get:function(){return g},enumerable:!1,configurable:!0}),c.prototype._verifyIntegers=function(){for(var n,l,o=[],a=0;a=c.length&&(c=void 0),{value:c&&c[o++],done:!c}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.BaseRenderLayer=void 0;var y=E(643),_=E(8803),g=E(1420),k=E(3734),C=E(1752),u=E(8055),v=E(9631),L=E(8978),b=function(){function c(n,l,o,a,d,h,S,A,x){this._container=n,this._alpha=a,this._colors=d,this._rendererId=h,this._bufferService=S,this._optionsService=A,this._decorationService=x,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._columnSelectMode=!1,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+l+"-layer"),this._canvas.style.zIndex=o.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return c.prototype.dispose=function(){var n;(0,v.removeElementFromParent)(this._canvas),(n=this._charAtlas)===null||n===void 0||n.dispose()},c.prototype._initCanvas=function(){this._ctx=(0,C.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},c.prototype.onOptionsChanged=function(){},c.prototype.onBlur=function(){},c.prototype.onFocus=function(){},c.prototype.onCursorMove=function(){},c.prototype.onGridChanged=function(n,l){},c.prototype.onSelectionChanged=function(n,l,o){o===void 0&&(o=!1),this._selectionStart=n,this._selectionEnd=l,this._columnSelectMode=o},c.prototype.setColors=function(n){this._refreshCharAtlas(n)},c.prototype._setTransparency=function(n){if(n!==this._alpha){var l=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,l),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},c.prototype._refreshCharAtlas=function(n){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=(0,g.acquireCharAtlas)(this._optionsService.rawOptions,this._rendererId,n,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},c.prototype.resize=function(n){this._scaledCellWidth=n.scaledCellWidth,this._scaledCellHeight=n.scaledCellHeight,this._scaledCharWidth=n.scaledCharWidth,this._scaledCharHeight=n.scaledCharHeight,this._scaledCharLeft=n.scaledCharLeft,this._scaledCharTop=n.scaledCharTop,this._canvas.width=n.scaledCanvasWidth,this._canvas.height=n.scaledCanvasHeight,this._canvas.style.width=n.canvasWidth+"px",this._canvas.style.height=n.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},c.prototype.clearTextureAtlas=function(){var n;(n=this._charAtlas)===null||n===void 0||n.clear()},c.prototype._fillCells=function(n,l,o,a){this._ctx.fillRect(n*this._scaledCellWidth,l*this._scaledCellHeight,o*this._scaledCellWidth,a*this._scaledCellHeight)},c.prototype._fillMiddleLineAtCells=function(n,l,o){o===void 0&&(o=1);var a=Math.ceil(.5*this._scaledCellHeight);this._ctx.fillRect(n*this._scaledCellWidth,(l+1)*this._scaledCellHeight-a-window.devicePixelRatio,o*this._scaledCellWidth,window.devicePixelRatio)},c.prototype._fillBottomLineAtCells=function(n,l,o){o===void 0&&(o=1),this._ctx.fillRect(n*this._scaledCellWidth,(l+1)*this._scaledCellHeight-window.devicePixelRatio-1,o*this._scaledCellWidth,window.devicePixelRatio)},c.prototype._fillLeftLineAtCell=function(n,l,o){this._ctx.fillRect(n*this._scaledCellWidth,l*this._scaledCellHeight,window.devicePixelRatio*o,this._scaledCellHeight)},c.prototype._strokeRectAtCell=function(n,l,o,a){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(n*this._scaledCellWidth+window.devicePixelRatio/2,l*this._scaledCellHeight+window.devicePixelRatio/2,o*this._scaledCellWidth-window.devicePixelRatio,a*this._scaledCellHeight-window.devicePixelRatio)},c.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},c.prototype._clearCells=function(n,l,o,a){this._alpha?this._ctx.clearRect(n*this._scaledCellWidth,l*this._scaledCellHeight,o*this._scaledCellWidth,a*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(n*this._scaledCellWidth,l*this._scaledCellHeight,o*this._scaledCellWidth,a*this._scaledCellHeight))},c.prototype._fillCharTrueColor=function(n,l,o){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipRow(o);var a=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(a=(0,L.tryDrawCustomChar)(this._ctx,n.getChars(),l*this._scaledCellWidth,o*this._scaledCellHeight,this._scaledCellWidth,this._scaledCellHeight)),a||this._ctx.fillText(n.getChars(),l*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight)},c.prototype._drawChars=function(n,l,o){var a,d,h,S=this._getContrastColor(n,l,o);if(S||n.isFgRGB()||n.isBgRGB())this._drawUncachedChars(n,l,o,S);else{var A,x;n.isInverse()?(A=n.isBgDefault()?_.INVERTED_DEFAULT_COLOR:n.getBgColor(),x=n.isFgDefault()?_.INVERTED_DEFAULT_COLOR:n.getFgColor()):(x=n.isBgDefault()?y.DEFAULT_COLOR:n.getBgColor(),A=n.isFgDefault()?y.DEFAULT_COLOR:n.getFgColor()),A+=this._optionsService.rawOptions.drawBoldTextInBrightColors&&n.isBold()&&A<8?8:0,this._currentGlyphIdentifier.chars=n.getChars()||y.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=n.getCode()||y.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=x,this._currentGlyphIdentifier.fg=A,this._currentGlyphIdentifier.bold=!!n.isBold(),this._currentGlyphIdentifier.dim=!!n.isDim(),this._currentGlyphIdentifier.italic=!!n.isItalic();var M=!1;try{for(var O=m(this._decorationService.getDecorationsAtCell(l,o)),I=O.next();!I.done;I=O.next()){var P=I.value;if(P.backgroundColorRGB||P.foregroundColorRGB){M=!0;break}}}catch(T){a={error:T}}finally{try{I&&!I.done&&(d=O.return)&&d.call(O)}finally{if(a)throw a.error}}!M&&(!((h=this._charAtlas)===null||h===void 0)&&h.draw(this._ctx,this._currentGlyphIdentifier,l*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop))||this._drawUncachedChars(n,l,o)}},c.prototype._drawUncachedChars=function(n,l,o,a){if(this._ctx.save(),this._ctx.font=this._getFont(!!n.isBold(),!!n.isItalic()),this._ctx.textBaseline=_.TEXT_BASELINE,n.isInverse())if(a)this._ctx.fillStyle=a.css;else if(n.isBgDefault())this._ctx.fillStyle=u.color.opaque(this._colors.background).css;else if(n.isBgRGB())this._ctx.fillStyle="rgb("+k.AttributeData.toColorRGB(n.getBgColor()).join(",")+")";else{var d=n.getBgColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&n.isBold()&&d<8&&(d+=8),this._ctx.fillStyle=this._colors.ansi[d].css}else if(a)this._ctx.fillStyle=a.css;else if(n.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(n.isFgRGB())this._ctx.fillStyle="rgb("+k.AttributeData.toColorRGB(n.getFgColor()).join(",")+")";else{var h=n.getFgColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&n.isBold()&&h<8&&(h+=8),this._ctx.fillStyle=this._colors.ansi[h].css}this._clipRow(o),n.isDim()&&(this._ctx.globalAlpha=_.DIM_OPACITY);var S=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(S=(0,L.tryDrawCustomChar)(this._ctx,n.getChars(),l*this._scaledCellWidth,o*this._scaledCellHeight,this._scaledCellWidth,this._scaledCellHeight)),S||this._ctx.fillText(n.getChars(),l*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight),this._ctx.restore()},c.prototype._clipRow=function(n){this._ctx.beginPath(),this._ctx.rect(0,n*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},c.prototype._getFont=function(n,l){return(l?"italic":"")+" "+(n?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight)+" "+this._optionsService.rawOptions.fontSize*window.devicePixelRatio+"px "+this._optionsService.rawOptions.fontFamily},c.prototype._getContrastColor=function(n,l,o){var a,d,h,S,A=!1;try{for(var x=m(this._decorationService.getDecorationsAtCell(l,o)),M=x.next();!M.done;M=x.next()){var O=M.value;O.options.layer!=="top"&&A||(O.backgroundColorRGB&&(h=O.backgroundColorRGB.rgba),O.foregroundColorRGB&&(S=O.foregroundColorRGB.rgba),A=O.options.layer==="top")}}catch(ve){a={error:ve}}finally{try{M&&!M.done&&(d=x.return)&&d.call(x)}finally{if(a)throw a.error}}if(A||this._colors.selectionForeground&&this._isCellInSelection(l,o)&&(S=this._colors.selectionForeground.rgba),h||S||this._optionsService.rawOptions.minimumContrastRatio!==1&&!(0,C.excludeFromContrastRatioDemands)(n.getCode())){if(!h&&!S){var I=this._colors.contrastCache.getColor(n.bg,n.fg);if(I!==void 0)return I||void 0}var P=n.getFgColor(),T=n.getFgColorMode(),j=n.getBgColor(),N=n.getBgColorMode(),U=!!n.isInverse(),V=!!n.isInverse();if(U){var ne=P;P=j,j=ne;var ue=T;T=N,N=ue}var oe=this._resolveBackgroundRgba(h!==void 0?50331648:N,h??j,U),pe=this._resolveForegroundRgba(T,P,U,V),_e=u.rgba.ensureContrastRatio(h??oe,S??pe,this._optionsService.rawOptions.minimumContrastRatio);if(!_e){if(!S)return void this._colors.contrastCache.setColor(n.bg,n.fg,null);_e=S}var z={css:u.channels.toCss(_e>>24&255,_e>>16&255,_e>>8&255),rgba:_e};return h||S||this._colors.contrastCache.setColor(n.bg,n.fg,z),z}},c.prototype._resolveBackgroundRgba=function(n,l,o){switch(n){case 16777216:case 33554432:return this._colors.ansi[l].rgba;case 50331648:return l<<8;default:return o?this._colors.foreground.rgba:this._colors.background.rgba}},c.prototype._resolveForegroundRgba=function(n,l,o,a){switch(n){case 16777216:case 33554432:return this._optionsService.rawOptions.drawBoldTextInBrightColors&&a&&l<8&&(l+=8),this._colors.ansi[l].rgba;case 50331648:return l<<8;default:return o?this._colors.background.rgba:this._colors.foreground.rgba}},c.prototype._isCellInSelection=function(n,l){var o=this._selectionStart,a=this._selectionEnd;return!(!o||!a)&&(this._columnSelectMode?n>=o[0]&&l>=o[1]&&no[1]&&l=o[0]&&n=o[0])},c}();f.BaseRenderLayer=b},2512:function(D,f,E){var m,y=this&&this.__extends||(m=function(n,l){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(o[d]=a[d])},m(n,l)},function(n,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function o(){this.constructor=n}m(n,l),n.prototype=l===null?Object.create(l):(o.prototype=l.prototype,new o)}),_=this&&this.__decorate||function(n,l,o,a){var d,h=arguments.length,S=h<3?l:a===null?a=Object.getOwnPropertyDescriptor(l,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(n,l,o,a);else for(var A=n.length-1;A>=0;A--)(d=n[A])&&(S=(h<3?d(S):h>3?d(l,o,S):d(l,o))||S);return h>3&&S&&Object.defineProperty(l,o,S),S},g=this&&this.__param||function(n,l){return function(o,a){l(o,a,n)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CursorRenderLayer=void 0;var k=E(1546),C=E(511),u=E(2585),v=E(4725),L=600,b=function(n){function l(o,a,d,h,S,A,x,M,O,I){var P=n.call(this,o,"cursor",a,!0,d,h,A,x,I)||this;return P._onRequestRedraw=S,P._coreService=M,P._coreBrowserService=O,P._cell=new C.CellData,P._state={x:0,y:0,isFocused:!1,style:"",width:0},P._cursorRenderers={bar:P._renderBarCursor.bind(P),block:P._renderBlockCursor.bind(P),underline:P._renderUnderlineCursor.bind(P)},P}return y(l,n),l.prototype.dispose=function(){this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0),n.prototype.dispose.call(this)},l.prototype.resize=function(o){n.prototype.resize.call(this,o),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},l.prototype.reset=function(){var o;this._clearCursor(),(o=this._cursorBlinkStateManager)===null||o===void 0||o.restartBlinkAnimation(),this.onOptionsChanged()},l.prototype.onBlur=function(){var o;(o=this._cursorBlinkStateManager)===null||o===void 0||o.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},l.prototype.onFocus=function(){var o;(o=this._cursorBlinkStateManager)===null||o===void 0||o.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},l.prototype.onOptionsChanged=function(){var o,a=this;this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new c(this._coreBrowserService.isFocused,function(){a._render(!0)})):((o=this._cursorBlinkStateManager)===null||o===void 0||o.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},l.prototype.onCursorMove=function(){var o;(o=this._cursorBlinkStateManager)===null||o===void 0||o.restartBlinkAnimation()},l.prototype.onGridChanged=function(o,a){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},l.prototype._render=function(o){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var a=this._bufferService.buffer.ybase+this._bufferService.buffer.y,d=a-this._bufferService.buffer.ydisp;if(d<0||d>=this._bufferService.rows)this._clearCursor();else{var h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(a).loadCell(h,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var S=this._optionsService.rawOptions.cursorStyle;return S&&S!=="block"?this._cursorRenderers[S](h,d,this._cell):this._renderBlurCursor(h,d,this._cell),this._ctx.restore(),this._state.x=h,this._state.y=d,this._state.isFocused=!1,this._state.style=S,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===h&&this._state.y===d&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](h,d,this._cell),this._ctx.restore(),this._state.x=h,this._state.y=d,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},l.prototype._clearCursor=function(){this._state&&(window.devicePixelRatio<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},l.prototype._renderBarCursor=function(o,a,d){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(o,a,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()},l.prototype._renderBlockCursor=function(o,a,d){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(o,a,d.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(d,o,a),this._ctx.restore()},l.prototype._renderUnderlineCursor=function(o,a,d){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(o,a),this._ctx.restore()},l.prototype._renderBlurCursor=function(o,a,d){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(o,a,d.getWidth(),1),this._ctx.restore()},_([g(5,u.IBufferService),g(6,u.IOptionsService),g(7,u.ICoreService),g(8,v.ICoreBrowserService),g(9,u.IDecorationService)],l)}(k.BaseRenderLayer);f.CursorRenderLayer=b;var c=function(){function n(l,o){this._renderCallback=o,this.isCursorVisible=!0,l&&this._restartInterval()}return Object.defineProperty(n.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},n.prototype.restartBlinkAnimation=function(){var l=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){l._renderCallback(),l._animationFrame=void 0})))},n.prototype._restartInterval=function(l){var o=this;l===void 0&&(l=L),this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=window.setTimeout(function(){if(o._animationTimeRestarted){var a=L-(Date.now()-o._animationTimeRestarted);if(o._animationTimeRestarted=void 0,a>0)return void o._restartInterval(a)}o.isCursorVisible=!1,o._animationFrame=window.requestAnimationFrame(function(){o._renderCallback(),o._animationFrame=void 0}),o._blinkInterval=window.setInterval(function(){if(o._animationTimeRestarted){var d=L-(Date.now()-o._animationTimeRestarted);return o._animationTimeRestarted=void 0,void o._restartInterval(d)}o.isCursorVisible=!o.isCursorVisible,o._animationFrame=window.requestAnimationFrame(function(){o._renderCallback(),o._animationFrame=void 0})},L)},l)},n.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},n.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},n}()},8978:function(D,f,E){var m,y,_,g,k,C,u,v,L,b,c,n,l,o,a,d,h,S,A,x,M,O,I,P,T,j,N,U,V,ne,ue,oe,pe,_e,z,ve,he,ke,$,Ie,ge,le,Y,Z,se,xe,Ee,De,je,Re,Xe,we,$e,dt,Xt,gr,nr,ni,or,Ze,_r,Zt,sr,yr,ar,oi,Be,Xr,Te,Yt,et,Ue,ze,kt,pt,Rt,tt,xr,lt,lr,Ir,Ot,si,kr,Zr,Hr,cr,Et,ur,Yr,Dt,ai,Er,Bt,Pt,mr,Tr,Ar,fr,Mr,Wt,Fr,Rr,qe,Le,Vt,Wr,Lt,W,K,ae,fe,te,be,He,Je,vt,Nr,Ii,Oe,ln,Hi,li,$t,Fi,Wi,Vr,mi,cn=this&&this.__read||function(re,ee){var nt=typeof Symbol=="function"&&re[Symbol.iterator];if(!nt)return re;var It,Nt,gt=nt.call(re),rt=[];try{for(;(ee===void 0||ee-- >0)&&!(It=gt.next()).done;)rt.push(It.value)}catch(Jt){Nt={error:Jt}}finally{try{It&&!It.done&&(nt=gt.return)&&nt.call(gt)}finally{if(Nt)throw Nt.error}}return rt},bi=this&&this.__values||function(re){var ee=typeof Symbol=="function"&&Symbol.iterator,nt=ee&&re[ee],It=0;if(nt)return nt.call(re);if(re&&typeof re.length=="number")return{next:function(){return re&&It>=re.length&&(re=void 0),{value:re&&re[It++],done:!re}}};throw new TypeError(ee?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.tryDrawCustomChar=f.powerlineDefinitions=f.boxDrawingDefinitions=f.blockElementDefinitions=void 0;var un=E(1752);f.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258A":[{x:0,y:0,w:6,h:8}],"\u258B":[{x:0,y:0,w:5,h:8}],"\u258C":[{x:0,y:0,w:4,h:8}],"\u258D":[{x:0,y:0,w:3,h:8}],"\u258E":[{x:0,y:0,w:2,h:8}],"\u258F":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:9,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259A":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259B":[{x:0,y:0,w:4,h:8},{x:0,y:0,w:4,h:8}],"\u259C":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259D":[{x:4,y:0,w:4,h:4}],"\u259E":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259F":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u{1FB70}":[{x:1,y:0,w:1,h:8}],"\u{1FB71}":[{x:2,y:0,w:1,h:8}],"\u{1FB72}":[{x:3,y:0,w:1,h:8}],"\u{1FB73}":[{x:4,y:0,w:1,h:8}],"\u{1FB74}":[{x:5,y:0,w:1,h:8}],"\u{1FB75}":[{x:6,y:0,w:1,h:8}],"\u{1FB76}":[{x:0,y:1,w:8,h:1}],"\u{1FB77}":[{x:0,y:2,w:8,h:1}],"\u{1FB78}":[{x:0,y:3,w:8,h:1}],"\u{1FB79}":[{x:0,y:4,w:8,h:1}],"\u{1FB7A}":[{x:0,y:5,w:8,h:1}],"\u{1FB7B}":[{x:0,y:6,w:8,h:1}],"\u{1FB7C}":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB7D}":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7E}":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7F}":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB80}":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB81}":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB82}":[{x:0,y:0,w:8,h:2}],"\u{1FB83}":[{x:0,y:0,w:8,h:3}],"\u{1FB84}":[{x:0,y:0,w:8,h:5}],"\u{1FB85}":[{x:0,y:0,w:8,h:6}],"\u{1FB86}":[{x:0,y:0,w:8,h:7}],"\u{1FB87}":[{x:6,y:0,w:2,h:8}],"\u{1FB88}":[{x:5,y:0,w:3,h:8}],"\u{1FB89}":[{x:3,y:0,w:5,h:8}],"\u{1FB8A}":[{x:2,y:0,w:6,h:8}],"\u{1FB8B}":[{x:1,y:0,w:7,h:8}],"\u{1FB95}":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"\u{1FB96}":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"\u{1FB97}":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};var Fn={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};f.boxDrawingDefinitions={"\u2500":(m={},m[1]="M0,.5 L1,.5",m),"\u2501":(y={},y[3]="M0,.5 L1,.5",y),"\u2502":(_={},_[1]="M.5,0 L.5,1",_),"\u2503":(g={},g[3]="M.5,0 L.5,1",g),"\u250C":(k={},k[1]="M0.5,1 L.5,.5 L1,.5",k),"\u250F":(C={},C[3]="M0.5,1 L.5,.5 L1,.5",C),"\u2510":(u={},u[1]="M0,.5 L.5,.5 L.5,1",u),"\u2513":(v={},v[3]="M0,.5 L.5,.5 L.5,1",v),"\u2514":(L={},L[1]="M.5,0 L.5,.5 L1,.5",L),"\u2517":(b={},b[3]="M.5,0 L.5,.5 L1,.5",b),"\u2518":(c={},c[1]="M.5,0 L.5,.5 L0,.5",c),"\u251B":(n={},n[3]="M.5,0 L.5,.5 L0,.5",n),"\u251C":(l={},l[1]="M.5,0 L.5,1 M.5,.5 L1,.5",l),"\u2523":(o={},o[3]="M.5,0 L.5,1 M.5,.5 L1,.5",o),"\u2524":(a={},a[1]="M.5,0 L.5,1 M.5,.5 L0,.5",a),"\u252B":(d={},d[3]="M.5,0 L.5,1 M.5,.5 L0,.5",d),"\u252C":(h={},h[1]="M0,.5 L1,.5 M.5,.5 L.5,1",h),"\u2533":(S={},S[3]="M0,.5 L1,.5 M.5,.5 L.5,1",S),"\u2534":(A={},A[1]="M0,.5 L1,.5 M.5,.5 L.5,0",A),"\u253B":(x={},x[3]="M0,.5 L1,.5 M.5,.5 L.5,0",x),"\u253C":(M={},M[1]="M0,.5 L1,.5 M.5,0 L.5,1",M),"\u254B":(O={},O[3]="M0,.5 L1,.5 M.5,0 L.5,1",O),"\u2574":(I={},I[1]="M.5,.5 L0,.5",I),"\u2578":(P={},P[3]="M.5,.5 L0,.5",P),"\u2575":(T={},T[1]="M.5,.5 L.5,0",T),"\u2579":(j={},j[3]="M.5,.5 L.5,0",j),"\u2576":(N={},N[1]="M.5,.5 L1,.5",N),"\u257A":(U={},U[3]="M.5,.5 L1,.5",U),"\u2577":(V={},V[1]="M.5,.5 L.5,1",V),"\u257B":(ne={},ne[3]="M.5,.5 L.5,1",ne),"\u2550":(ue={},ue[1]=function(re,ee){return"M0,"+(.5-ee)+" L1,"+(.5-ee)+" M0,"+(.5+ee)+" L1,"+(.5+ee)},ue),"\u2551":(oe={},oe[1]=function(re,ee){return"M"+(.5-re)+",0 L"+(.5-re)+",1 M"+(.5+re)+",0 L"+(.5+re)+",1"},oe),"\u2552":(pe={},pe[1]=function(re,ee){return"M.5,1 L.5,"+(.5-ee)+" L1,"+(.5-ee)+" M.5,"+(.5+ee)+" L1,"+(.5+ee)},pe),"\u2553":(_e={},_e[1]=function(re,ee){return"M"+(.5-re)+",1 L"+(.5-re)+",.5 L1,.5 M"+(.5+re)+",.5 L"+(.5+re)+",1"},_e),"\u2554":(z={},z[1]=function(re,ee){return"M1,"+(.5-ee)+" L"+(.5-re)+","+(.5-ee)+" L"+(.5-re)+",1 M1,"+(.5+ee)+" L"+(.5+re)+","+(.5+ee)+" L"+(.5+re)+",1"},z),"\u2555":(ve={},ve[1]=function(re,ee){return"M0,"+(.5-ee)+" L.5,"+(.5-ee)+" L.5,1 M0,"+(.5+ee)+" L.5,"+(.5+ee)},ve),"\u2556":(he={},he[1]=function(re,ee){return"M"+(.5+re)+",1 L"+(.5+re)+",.5 L0,.5 M"+(.5-re)+",.5 L"+(.5-re)+",1"},he),"\u2557":(ke={},ke[1]=function(re,ee){return"M0,"+(.5+ee)+" L"+(.5-re)+","+(.5+ee)+" L"+(.5-re)+",1 M0,"+(.5-ee)+" L"+(.5+re)+","+(.5-ee)+" L"+(.5+re)+",1"},ke),"\u2558":($={},$[1]=function(re,ee){return"M.5,0 L.5,"+(.5+ee)+" L1,"+(.5+ee)+" M.5,"+(.5-ee)+" L1,"+(.5-ee)},$),"\u2559":(Ie={},Ie[1]=function(re,ee){return"M1,.5 L"+(.5-re)+",.5 L"+(.5-re)+",0 M"+(.5+re)+",.5 L"+(.5+re)+",0"},Ie),"\u255A":(ge={},ge[1]=function(re,ee){return"M1,"+(.5-ee)+" L"+(.5+re)+","+(.5-ee)+" L"+(.5+re)+",0 M1,"+(.5+ee)+" L"+(.5-re)+","+(.5+ee)+" L"+(.5-re)+",0"},ge),"\u255B":(le={},le[1]=function(re,ee){return"M0,"+(.5+ee)+" L.5,"+(.5+ee)+" L.5,0 M0,"+(.5-ee)+" L.5,"+(.5-ee)},le),"\u255C":(Y={},Y[1]=function(re,ee){return"M0,.5 L"+(.5+re)+",.5 L"+(.5+re)+",0 M"+(.5-re)+",.5 L"+(.5-re)+",0"},Y),"\u255D":(Z={},Z[1]=function(re,ee){return"M0,"+(.5-ee)+" L"+(.5-re)+","+(.5-ee)+" L"+(.5-re)+",0 M0,"+(.5+ee)+" L"+(.5+re)+","+(.5+ee)+" L"+(.5+re)+",0"},Z),"\u255E":(se={},se[1]=function(re,ee){return"M.5,0 L.5,1 M.5,"+(.5-ee)+" L1,"+(.5-ee)+" M.5,"+(.5+ee)+" L1,"+(.5+ee)},se),"\u255F":(xe={},xe[1]=function(re,ee){return"M"+(.5-re)+",0 L"+(.5-re)+",1 M"+(.5+re)+",0 L"+(.5+re)+",1 M"+(.5+re)+",.5 L1,.5"},xe),"\u2560":(Ee={},Ee[1]=function(re,ee){return"M"+(.5-re)+",0 L"+(.5-re)+",1 M1,"+(.5+ee)+" L"+(.5+re)+","+(.5+ee)+" L"+(.5+re)+",1 M1,"+(.5-ee)+" L"+(.5+re)+","+(.5-ee)+" L"+(.5+re)+",0"},Ee),"\u2561":(De={},De[1]=function(re,ee){return"M.5,0 L.5,1 M0,"+(.5-ee)+" L.5,"+(.5-ee)+" M0,"+(.5+ee)+" L.5,"+(.5+ee)},De),"\u2562":(je={},je[1]=function(re,ee){return"M0,.5 L"+(.5-re)+",.5 M"+(.5-re)+",0 L"+(.5-re)+",1 M"+(.5+re)+",0 L"+(.5+re)+",1"},je),"\u2563":(Re={},Re[1]=function(re,ee){return"M"+(.5+re)+",0 L"+(.5+re)+",1 M0,"+(.5+ee)+" L"+(.5-re)+","+(.5+ee)+" L"+(.5-re)+",1 M0,"+(.5-ee)+" L"+(.5-re)+","+(.5-ee)+" L"+(.5-re)+",0"},Re),"\u2564":(Xe={},Xe[1]=function(re,ee){return"M0,"+(.5-ee)+" L1,"+(.5-ee)+" M0,"+(.5+ee)+" L1,"+(.5+ee)+" M.5,"+(.5+ee)+" L.5,1"},Xe),"\u2565":(we={},we[1]=function(re,ee){return"M0,.5 L1,.5 M"+(.5-re)+",.5 L"+(.5-re)+",1 M"+(.5+re)+",.5 L"+(.5+re)+",1"},we),"\u2566":($e={},$e[1]=function(re,ee){return"M0,"+(.5-ee)+" L1,"+(.5-ee)+" M0,"+(.5+ee)+" L"+(.5-re)+","+(.5+ee)+" L"+(.5-re)+",1 M1,"+(.5+ee)+" L"+(.5+re)+","+(.5+ee)+" L"+(.5+re)+",1"},$e),"\u2567":(dt={},dt[1]=function(re,ee){return"M.5,0 L.5,"+(.5-ee)+" M0,"+(.5-ee)+" L1,"+(.5-ee)+" M0,"+(.5+ee)+" L1,"+(.5+ee)},dt),"\u2568":(Xt={},Xt[1]=function(re,ee){return"M0,.5 L1,.5 M"+(.5-re)+",.5 L"+(.5-re)+",0 M"+(.5+re)+",.5 L"+(.5+re)+",0"},Xt),"\u2569":(gr={},gr[1]=function(re,ee){return"M0,"+(.5+ee)+" L1,"+(.5+ee)+" M0,"+(.5-ee)+" L"+(.5-re)+","+(.5-ee)+" L"+(.5-re)+",0 M1,"+(.5-ee)+" L"+(.5+re)+","+(.5-ee)+" L"+(.5+re)+",0"},gr),"\u256A":(nr={},nr[1]=function(re,ee){return"M.5,0 L.5,1 M0,"+(.5-ee)+" L1,"+(.5-ee)+" M0,"+(.5+ee)+" L1,"+(.5+ee)},nr),"\u256B":(ni={},ni[1]=function(re,ee){return"M0,.5 L1,.5 M"+(.5-re)+",0 L"+(.5-re)+",1 M"+(.5+re)+",0 L"+(.5+re)+",1"},ni),"\u256C":(or={},or[1]=function(re,ee){return"M0,"+(.5+ee)+" L"+(.5-re)+","+(.5+ee)+" L"+(.5-re)+",1 M1,"+(.5+ee)+" L"+(.5+re)+","+(.5+ee)+" L"+(.5+re)+",1 M0,"+(.5-ee)+" L"+(.5-re)+","+(.5-ee)+" L"+(.5-re)+",0 M1,"+(.5-ee)+" L"+(.5+re)+","+(.5-ee)+" L"+(.5+re)+",0"},or),"\u2571":(Ze={},Ze[1]="M1,0 L0,1",Ze),"\u2572":(_r={},_r[1]="M0,0 L1,1",_r),"\u2573":(Zt={},Zt[1]="M1,0 L0,1 M0,0 L1,1",Zt),"\u257C":(sr={},sr[1]="M.5,.5 L0,.5",sr[3]="M.5,.5 L1,.5",sr),"\u257D":(yr={},yr[1]="M.5,.5 L.5,0",yr[3]="M.5,.5 L.5,1",yr),"\u257E":(ar={},ar[1]="M.5,.5 L1,.5",ar[3]="M.5,.5 L0,.5",ar),"\u257F":(oi={},oi[1]="M.5,.5 L.5,1",oi[3]="M.5,.5 L.5,0",oi),"\u250D":(Be={},Be[1]="M.5,.5 L.5,1",Be[3]="M.5,.5 L1,.5",Be),"\u250E":(Xr={},Xr[1]="M.5,.5 L1,.5",Xr[3]="M.5,.5 L.5,1",Xr),"\u2511":(Te={},Te[1]="M.5,.5 L.5,1",Te[3]="M.5,.5 L0,.5",Te),"\u2512":(Yt={},Yt[1]="M.5,.5 L0,.5",Yt[3]="M.5,.5 L.5,1",Yt),"\u2515":(et={},et[1]="M.5,.5 L.5,0",et[3]="M.5,.5 L1,.5",et),"\u2516":(Ue={},Ue[1]="M.5,.5 L1,.5",Ue[3]="M.5,.5 L.5,0",Ue),"\u2519":(ze={},ze[1]="M.5,.5 L.5,0",ze[3]="M.5,.5 L0,.5",ze),"\u251A":(kt={},kt[1]="M.5,.5 L0,.5",kt[3]="M.5,.5 L.5,0",kt),"\u251D":(pt={},pt[1]="M.5,0 L.5,1",pt[3]="M.5,.5 L1,.5",pt),"\u251E":(Rt={},Rt[1]="M0.5,1 L.5,.5 L1,.5",Rt[3]="M.5,.5 L.5,0",Rt),"\u251F":(tt={},tt[1]="M.5,0 L.5,.5 L1,.5",tt[3]="M.5,.5 L.5,1",tt),"\u2520":(xr={},xr[1]="M.5,.5 L1,.5",xr[3]="M.5,0 L.5,1",xr),"\u2521":(lt={},lt[1]="M.5,.5 L.5,1",lt[3]="M.5,0 L.5,.5 L1,.5",lt),"\u2522":(lr={},lr[1]="M.5,.5 L.5,0",lr[3]="M0.5,1 L.5,.5 L1,.5",lr),"\u2525":(Ir={},Ir[1]="M.5,0 L.5,1",Ir[3]="M.5,.5 L0,.5",Ir),"\u2526":(Ot={},Ot[1]="M0,.5 L.5,.5 L.5,1",Ot[3]="M.5,.5 L.5,0",Ot),"\u2527":(si={},si[1]="M.5,0 L.5,.5 L0,.5",si[3]="M.5,.5 L.5,1",si),"\u2528":(kr={},kr[1]="M.5,.5 L0,.5",kr[3]="M.5,0 L.5,1",kr),"\u2529":(Zr={},Zr[1]="M.5,.5 L.5,1",Zr[3]="M.5,0 L.5,.5 L0,.5",Zr),"\u252A":(Hr={},Hr[1]="M.5,.5 L.5,0",Hr[3]="M0,.5 L.5,.5 L.5,1",Hr),"\u252D":(cr={},cr[1]="M0.5,1 L.5,.5 L1,.5",cr[3]="M.5,.5 L0,.5",cr),"\u252E":(Et={},Et[1]="M0,.5 L.5,.5 L.5,1",Et[3]="M.5,.5 L1,.5",Et),"\u252F":(ur={},ur[1]="M.5,.5 L.5,1",ur[3]="M0,.5 L1,.5",ur),"\u2530":(Yr={},Yr[1]="M0,.5 L1,.5",Yr[3]="M.5,.5 L.5,1",Yr),"\u2531":(Dt={},Dt[1]="M.5,.5 L1,.5",Dt[3]="M0,.5 L.5,.5 L.5,1",Dt),"\u2532":(ai={},ai[1]="M.5,.5 L0,.5",ai[3]="M0.5,1 L.5,.5 L1,.5",ai),"\u2535":(Er={},Er[1]="M.5,0 L.5,.5 L1,.5",Er[3]="M.5,.5 L0,.5",Er),"\u2536":(Bt={},Bt[1]="M.5,0 L.5,.5 L0,.5",Bt[3]="M.5,.5 L1,.5",Bt),"\u2537":(Pt={},Pt[1]="M.5,.5 L.5,0",Pt[3]="M0,.5 L1,.5",Pt),"\u2538":(mr={},mr[1]="M0,.5 L1,.5",mr[3]="M.5,.5 L.5,0",mr),"\u2539":(Tr={},Tr[1]="M.5,.5 L1,.5",Tr[3]="M.5,0 L.5,.5 L0,.5",Tr),"\u253A":(Ar={},Ar[1]="M.5,.5 L0,.5",Ar[3]="M.5,0 L.5,.5 L1,.5",Ar),"\u253D":(fr={},fr[1]="M.5,0 L.5,1 M.5,.5 L1,.5",fr[3]="M.5,.5 L0,.5",fr),"\u253E":(Mr={},Mr[1]="M.5,0 L.5,1 M.5,.5 L0,.5",Mr[3]="M.5,.5 L1,.5",Mr),"\u253F":(Wt={},Wt[1]="M.5,0 L.5,1",Wt[3]="M0,.5 L1,.5",Wt),"\u2540":(Fr={},Fr[1]="M0,.5 L1,.5 M.5,.5 L.5,1",Fr[3]="M.5,.5 L.5,0",Fr),"\u2541":(Rr={},Rr[1]="M.5,.5 L.5,0 M0,.5 L1,.5",Rr[3]="M.5,.5 L.5,1",Rr),"\u2542":(qe={},qe[1]="M0,.5 L1,.5",qe[3]="M.5,0 L.5,1",qe),"\u2543":(Le={},Le[1]="M0.5,1 L.5,.5 L1,.5",Le[3]="M.5,0 L.5,.5 L0,.5",Le),"\u2544":(Vt={},Vt[1]="M0,.5 L.5,.5 L.5,1",Vt[3]="M.5,0 L.5,.5 L1,.5",Vt),"\u2545":(Wr={},Wr[1]="M.5,0 L.5,.5 L1,.5",Wr[3]="M0,.5 L.5,.5 L.5,1",Wr),"\u2546":(Lt={},Lt[1]="M.5,0 L.5,.5 L0,.5",Lt[3]="M0.5,1 L.5,.5 L1,.5",Lt),"\u2547":(W={},W[1]="M.5,.5 L.5,1",W[3]="M.5,.5 L.5,0 M0,.5 L1,.5",W),"\u2548":(K={},K[1]="M.5,.5 L.5,0",K[3]="M0,.5 L1,.5 M.5,.5 L.5,1",K),"\u2549":(ae={},ae[1]="M.5,.5 L1,.5",ae[3]="M.5,0 L.5,1 M.5,.5 L0,.5",ae),"\u254A":(fe={},fe[1]="M.5,.5 L0,.5",fe[3]="M.5,0 L.5,1 M.5,.5 L1,.5",fe),"\u254C":(te={},te[1]="M.1,.5 L.4,.5 M.6,.5 L.9,.5",te),"\u254D":(be={},be[3]="M.1,.5 L.4,.5 M.6,.5 L.9,.5",be),"\u2504":(He={},He[1]="M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5",He),"\u2505":(Je={},Je[3]="M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5",Je),"\u2508":(vt={},vt[1]="M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5",vt),"\u2509":(Nr={},Nr[3]="M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5",Nr),"\u254E":(Ii={},Ii[1]="M.5,.1 L.5,.4 M.5,.6 L.5,.9",Ii),"\u254F":(Oe={},Oe[3]="M.5,.1 L.5,.4 M.5,.6 L.5,.9",Oe),"\u2506":(ln={},ln[1]="M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333",ln),"\u2507":(Hi={},Hi[3]="M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333",Hi),"\u250A":(li={},li[1]="M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95",li),"\u250B":($t={},$t[3]="M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95",$t),"\u256D":(Fi={},Fi[1]="C.5,1,.5,.5,1,.5",Fi),"\u256E":(Wi={},Wi[1]="C.5,1,.5,.5,0,.5",Wi),"\u256F":(Vr={},Vr[1]="C.5,0,.5,.5,0,.5",Vr),"\u2570":(mi={},mi[1]="C.5,0,.5,.5,1,.5",mi)},f.powerlineDefinitions={"\uE0B0":{d:"M0,0 L1,.5 L0,1",type:0},"\uE0B1":{d:"M0,0 L1,.5 L0,1",type:1,horizontalPadding:.5},"\uE0B2":{d:"M1,0 L0,.5 L1,1",type:0},"\uE0B3":{d:"M1,0 L0,.5 L1,1",type:1,horizontalPadding:.5}},f.tryDrawCustomChar=function(re,ee,nt,It,Nt,gt){var rt=f.blockElementDefinitions[ee];if(rt)return function(Ge,Tt,$r,jr,Or,hr){for(var ot=0;ot7&&parseInt(We.slice(7,9),16)||1;else{if(!We.startsWith("rgba"))throw new Error('Unexpected fillStyle color format "'+We+'" when drawing pattern glyph');ci=(ot=cn(We.substring(5,We.length-1).split(",").map(function(Ur){return parseFloat(Ur)}),4))[0],Sr=ot[1],Cr=ot[2],jt=ot[3]}for(var er=0;er{Object.defineProperty(f,"__esModule",{value:!0}),f.GridCache=void 0;var E=function(){function m(){this.cache=[]}return m.prototype.resize=function(y,_){for(var g=0;g=0;h--)(o=b[h])&&(d=(a<3?o(d):a>3?o(c,n,d):o(c,n))||d);return a>3&&d&&Object.defineProperty(c,n,d),d},g=this&&this.__param||function(b,c){return function(n,l){c(n,l,b)}};Object.defineProperty(f,"__esModule",{value:!0}),f.LinkRenderLayer=void 0;var k=E(1546),C=E(8803),u=E(2040),v=E(2585),L=function(b){function c(n,l,o,a,d,h,S,A,x){var M=b.call(this,n,"link",l,!0,o,a,S,A,x)||this;return d.onShowLinkUnderline(function(O){return M._onShowLinkUnderline(O)}),d.onHideLinkUnderline(function(O){return M._onHideLinkUnderline(O)}),h.onShowLinkUnderline(function(O){return M._onShowLinkUnderline(O)}),h.onHideLinkUnderline(function(O){return M._onHideLinkUnderline(O)}),M}return y(c,b),c.prototype.resize=function(n){b.prototype.resize.call(this,n),this._state=void 0},c.prototype.reset=function(){this._clearCurrentLink()},c.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var n=this._state.y2-this._state.y1-1;n>0&&this._clearCells(0,this._state.y1+1,this._state.cols,n),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},c.prototype._onShowLinkUnderline=function(n){if(n.fg===C.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:n.fg&&(0,u.is256Color)(n.fg)?this._ctx.fillStyle=this._colors.ansi[n.fg].css:this._ctx.fillStyle=this._colors.foreground.css,n.y1===n.y2)this._fillBottomLineAtCells(n.x1,n.y1,n.x2-n.x1);else{this._fillBottomLineAtCells(n.x1,n.y1,n.cols-n.x1);for(var l=n.y1+1;l=0;P--)(M=h[P])&&(I=(O<3?M(I):O>3?M(S,A,I):M(S,A))||I);return O>3&&I&&Object.defineProperty(S,A,I),I},g=this&&this.__param||function(h,S){return function(A,x){S(A,x,h)}},k=this&&this.__values||function(h){var S=typeof Symbol=="function"&&Symbol.iterator,A=S&&h[S],x=0;if(A)return A.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&x>=h.length&&(h=void 0),{value:h&&h[x++],done:!h}}};throw new TypeError(S?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.Renderer=void 0;var C=E(9596),u=E(4149),v=E(2512),L=E(5098),b=E(844),c=E(4725),n=E(2585),l=E(1420),o=E(8460),a=1,d=function(h){function S(A,x,M,O,I,P,T,j){var N=h.call(this)||this;N._colors=A,N._screenElement=x,N._bufferService=P,N._charSizeService=T,N._optionsService=j,N._id=a++,N._onRequestRedraw=new o.EventEmitter;var U=N._optionsService.rawOptions.allowTransparency;return N._renderLayers=[I.createInstance(C.TextRenderLayer,N._screenElement,0,N._colors,U,N._id),I.createInstance(u.SelectionRenderLayer,N._screenElement,1,N._colors,N._id),I.createInstance(L.LinkRenderLayer,N._screenElement,2,N._colors,N._id,M,O),I.createInstance(v.CursorRenderLayer,N._screenElement,3,N._colors,N._id,N._onRequestRedraw)],N.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},N._devicePixelRatio=window.devicePixelRatio,N._updateDimensions(),N.onOptionsChanged(),N}return y(S,h),Object.defineProperty(S.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){var A,x;try{for(var M=k(this._renderLayers),O=M.next();!O.done;O=M.next())O.value.dispose()}catch(I){A={error:I}}finally{try{O&&!O.done&&(x=M.return)&&x.call(M)}finally{if(A)throw A.error}}h.prototype.dispose.call(this),(0,l.removeTerminalFromCache)(this._id)},S.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},S.prototype.setColors=function(A){var x,M;this._colors=A;try{for(var O=k(this._renderLayers),I=O.next();!I.done;I=O.next()){var P=I.value;P.setColors(this._colors),P.reset()}}catch(T){x={error:T}}finally{try{I&&!I.done&&(M=O.return)&&M.call(O)}finally{if(x)throw x.error}}},S.prototype.onResize=function(A,x){var M,O;this._updateDimensions();try{for(var I=k(this._renderLayers),P=I.next();!P.done;P=I.next())P.value.resize(this.dimensions)}catch(T){M={error:T}}finally{try{P&&!P.done&&(O=I.return)&&O.call(I)}finally{if(M)throw M.error}}this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},S.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},S.prototype.onBlur=function(){this._runOperation(function(A){return A.onBlur()})},S.prototype.onFocus=function(){this._runOperation(function(A){return A.onFocus()})},S.prototype.onSelectionChanged=function(A,x,M){M===void 0&&(M=!1),this._runOperation(function(O){return O.onSelectionChanged(A,x,M)}),this._colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})},S.prototype.onCursorMove=function(){this._runOperation(function(A){return A.onCursorMove()})},S.prototype.onOptionsChanged=function(){this._runOperation(function(A){return A.onOptionsChanged()})},S.prototype.clear=function(){this._runOperation(function(A){return A.reset()})},S.prototype._runOperation=function(A){var x,M;try{for(var O=k(this._renderLayers),I=O.next();!I.done;I=O.next())A(I.value)}catch(P){x={error:P}}finally{try{I&&!I.done&&(M=O.return)&&M.call(O)}finally{if(x)throw x.error}}},S.prototype.renderRows=function(A,x){var M,O;try{for(var I=k(this._renderLayers),P=I.next();!P.done;P=I.next())P.value.onGridChanged(A,x)}catch(T){M={error:T}}finally{try{P&&!P.done&&(O=I.return)&&O.call(I)}finally{if(M)throw M.error}}},S.prototype.clearTextureAtlas=function(){var A,x;try{for(var M=k(this._renderLayers),O=M.next();!O.done;O=M.next())O.value.clearTextureAtlas()}catch(I){A={error:I}}finally{try{O&&!O.done&&(x=M.return)&&x.call(M)}finally{if(A)throw A.error}}},S.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharTop=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},_([g(4,n.IInstantiationService),g(5,n.IBufferService),g(6,c.ICharSizeService),g(7,n.IOptionsService)],S)}(b.Disposable);f.Renderer=d},1752:(D,f)=>{function E(m){return 57508<=m&&m<=57558}Object.defineProperty(f,"__esModule",{value:!0}),f.excludeFromContrastRatioDemands=f.isPowerlineGlyph=f.throwIfFalsy=void 0,f.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},f.isPowerlineGlyph=E,f.excludeFromContrastRatioDemands=function(m){return E(m)||function(y){return 9472<=y&&y<=9631}(m)}},4149:function(D,f,E){var m,y=this&&this.__extends||(m=function(v,L){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,c){b.__proto__=c}||function(b,c){for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&(b[n]=c[n])},m(v,L)},function(v,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");function b(){this.constructor=v}m(v,L),v.prototype=L===null?Object.create(L):(b.prototype=L.prototype,new b)}),_=this&&this.__decorate||function(v,L,b,c){var n,l=arguments.length,o=l<3?L:c===null?c=Object.getOwnPropertyDescriptor(L,b):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(v,L,b,c);else for(var a=v.length-1;a>=0;a--)(n=v[a])&&(o=(l<3?n(o):l>3?n(L,b,o):n(L,b))||o);return l>3&&o&&Object.defineProperty(L,b,o),o},g=this&&this.__param||function(v,L){return function(b,c){L(b,c,v)}};Object.defineProperty(f,"__esModule",{value:!0}),f.SelectionRenderLayer=void 0;var k=E(1546),C=E(2585),u=function(v){function L(b,c,n,l,o,a,d){var h=v.call(this,b,"selection",c,!0,n,l,o,a,d)||this;return h._clearState(),h}return y(L,v),L.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},L.prototype.resize=function(b){v.prototype.resize.call(this,b),this._clearState()},L.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},L.prototype.onSelectionChanged=function(b,c,n){if(v.prototype.onSelectionChanged.call(this,b,c,n),this._didStateChange(b,c,n,this._bufferService.buffer.ydisp))if(this._clearAll(),b&&c){var l=b[1]-this._bufferService.buffer.ydisp,o=c[1]-this._bufferService.buffer.ydisp,a=Math.max(l,0),d=Math.min(o,this._bufferService.rows-1);if(a>=this._bufferService.rows||d<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=this._colors.selectionTransparent.css,n){var h=b[0],S=c[0]-h,A=d-a+1;this._fillCells(h,a,S,A)}else{h=l===a?b[0]:0;var x=a===o?c[0]:this._bufferService.cols;this._fillCells(h,a,x-h,1);var M=Math.max(d-a-1,0);if(this._fillCells(0,a+1,this._bufferService.cols,M),a!==d){var O=o===d?c[0]:this._bufferService.cols;this._fillCells(0,d,O,1)}}this._state.start=[b[0],b[1]],this._state.end=[c[0],c[1]],this._state.columnSelectMode=n,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},L.prototype._didStateChange=function(b,c,n,l){return!this._areCoordinatesEqual(b,this._state.start)||!this._areCoordinatesEqual(c,this._state.end)||n!==this._state.columnSelectMode||l!==this._state.ydisp},L.prototype._areCoordinatesEqual=function(b,c){return!(!b||!c)&&b[0]===c[0]&&b[1]===c[1]},_([g(4,C.IBufferService),g(5,C.IOptionsService),g(6,C.IDecorationService)],L)}(k.BaseRenderLayer);f.SelectionRenderLayer=u},9596:function(D,f,E){var m,y=this&&this.__extends||(m=function(a,d){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,S){h.__proto__=S}||function(h,S){for(var A in S)Object.prototype.hasOwnProperty.call(S,A)&&(h[A]=S[A])},m(a,d)},function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");function h(){this.constructor=a}m(a,d),a.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}),_=this&&this.__decorate||function(a,d,h,S){var A,x=arguments.length,M=x<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,h):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(a,d,h,S);else for(var O=a.length-1;O>=0;O--)(A=a[O])&&(M=(x<3?A(M):x>3?A(d,h,M):A(d,h))||M);return x>3&&M&&Object.defineProperty(d,h,M),M},g=this&&this.__param||function(a,d){return function(h,S){d(h,S,a)}},k=this&&this.__values||function(a){var d=typeof Symbol=="function"&&Symbol.iterator,h=d&&a[d],S=0;if(h)return h.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&S>=a.length&&(a=void 0),{value:a&&a[S++],done:!a}}};throw new TypeError(d?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.TextRenderLayer=void 0;var C=E(3700),u=E(1546),v=E(3734),L=E(643),b=E(511),c=E(2585),n=E(4725),l=E(4269),o=function(a){function d(h,S,A,x,M,O,I,P,T){var j=a.call(this,h,"text",S,x,A,M,O,I,T)||this;return j._characterJoinerService=P,j._characterWidth=0,j._characterFont="",j._characterOverlapCache={},j._workCell=new b.CellData,j._state=new C.GridCache,j}return y(d,a),d.prototype.resize=function(h){a.prototype.resize.call(this,h);var S=this._getFont(!1,!1);this._characterWidth===h.scaledCharWidth&&this._characterFont===S||(this._characterWidth=h.scaledCharWidth,this._characterFont=S,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},d.prototype.reset=function(){this._state.clear(),this._clearAll()},d.prototype._forEachCell=function(h,S,A){for(var x=h;x<=S;x++)for(var M=x+this._bufferService.buffer.ydisp,O=this._bufferService.buffer.lines.get(M),I=this._characterJoinerService.getJoinedCharacters(M),P=0;P0&&P===I[0][0]){j=!0;var U=I.shift();T=new l.JoinedCellData(this._workCell,O.translateToString(!0,U[0],U[1]),U[1]-U[0]),N=U[1]-1}!j&&this._isOverlapping(T)&&Nthis._characterWidth;return this._ctx.restore(),this._characterOverlapCache[S]=A,A},_([g(5,c.IBufferService),g(6,c.IOptionsService),g(7,n.ICharacterJoinerService),g(8,c.IDecorationService)],d)}(u.BaseRenderLayer);f.TextRenderLayer=o},9616:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BaseCharAtlas=void 0;var E=function(){function m(){this._didWarmUp=!1}return m.prototype.dispose=function(){},m.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},m.prototype._doWarmUp=function(){},m.prototype.clear=function(){},m.prototype.beginFrame=function(){},m}();f.BaseCharAtlas=E},1420:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.removeTerminalFromCache=f.acquireCharAtlas=void 0;var m=E(2040),y=E(1906),_=[];f.acquireCharAtlas=function(g,k,C,u,v){for(var L=(0,m.generateConfig)(u,v,g,C),b=0;b<_.length;b++){var c=(n=_[b]).ownedBy.indexOf(k);if(c>=0){if((0,m.configEquals)(n.config,L))return n.atlas;n.ownedBy.length===1?(n.atlas.dispose(),_.splice(b,1)):n.ownedBy.splice(c,1);break}}for(b=0;b<_.length;b++){var n=_[b];if((0,m.configEquals)(n.config,L))return n.ownedBy.push(k),n.atlas}var l={atlas:new y.DynamicCharAtlas(document,L),config:L,ownedBy:[k]};return _.push(l),l.atlas},f.removeTerminalFromCache=function(g){for(var k=0;k<_.length;k++){var C=_[k].ownedBy.indexOf(g);if(C!==-1){_[k].ownedBy.length===1?(_[k].atlas.dispose(),_.splice(k,1)):_[k].ownedBy.splice(C,1);break}}}},2040:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.is256Color=f.configEquals=f.generateConfig=void 0;var m=E(643);f.generateConfig=function(y,_,g,k){var C={foreground:k.foreground,background:k.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:k.ansi.slice()};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:y,scaledCharHeight:_,fontFamily:g.fontFamily,fontSize:g.fontSize,fontWeight:g.fontWeight,fontWeightBold:g.fontWeightBold,allowTransparency:g.allowTransparency,colors:C}},f.configEquals=function(y,_){for(var g=0;g{Object.defineProperty(f,"__esModule",{value:!0}),f.CHAR_ATLAS_CELL_SPACING=f.TEXT_BASELINE=f.DIM_OPACITY=f.INVERTED_DEFAULT_COLOR=void 0;var m=E(6114);f.INVERTED_DEFAULT_COLOR=257,f.DIM_OPACITY=.5,f.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic",f.CHAR_ATLAS_CELL_SPACING=1},1906:function(D,f,E){var m,y=this&&this.__extends||(m=function(h,S){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,x){A.__proto__=x}||function(A,x){for(var M in x)Object.prototype.hasOwnProperty.call(x,M)&&(A[M]=x[M])},m(h,S)},function(h,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function A(){this.constructor=h}m(h,S),h.prototype=S===null?Object.create(S):(A.prototype=S.prototype,new A)});Object.defineProperty(f,"__esModule",{value:!0}),f.NoneCharAtlas=f.DynamicCharAtlas=f.getGlyphCacheKey=void 0;var _=E(8803),g=E(9616),k=E(5680),C=E(7001),u=E(6114),v=E(1752),L=E(8055),b=1024,c=1024,n={css:"rgba(0, 0, 0, 0)",rgba:0};function l(h){return h.code<<21|h.bg<<12|h.fg<<3|(h.bold?0:4)+(h.dim?0:2)+(h.italic?0:1)}f.getGlyphCacheKey=l;var o=function(h){function S(A,x){var M=h.call(this)||this;M._config=x,M._drawToCacheCount=0,M._glyphsWaitingOnBitmap=[],M._bitmapCommitTimeout=null,M._bitmap=null,M._cacheCanvas=A.createElement("canvas"),M._cacheCanvas.width=b,M._cacheCanvas.height=c,M._cacheCtx=(0,v.throwIfFalsy)(M._cacheCanvas.getContext("2d",{alpha:!0}));var O=A.createElement("canvas");O.width=M._config.scaledCharWidth,O.height=M._config.scaledCharHeight,M._tmpCtx=(0,v.throwIfFalsy)(O.getContext("2d",{alpha:M._config.allowTransparency})),M._width=Math.floor(b/M._config.scaledCharWidth),M._height=Math.floor(c/M._config.scaledCharHeight);var I=M._width*M._height;return M._cacheMap=new C.LRUMap(I),M._cacheMap.prealloc(I),M}return y(S,h),S.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},S.prototype.beginFrame=function(){this._drawToCacheCount=0},S.prototype.clear=function(){if(this._cacheMap.size>0){var A=this._width*this._height;this._cacheMap=new C.LRUMap(A),this._cacheMap.prealloc(A)}this._cacheCtx.clearRect(0,0,b,c),this._tmpCtx.clearRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight)},S.prototype.draw=function(A,x,M,O){if(x.code===32)return!0;if(!this._canCache(x))return!1;var I=l(x),P=this._cacheMap.get(I);if(P!=null)return this._drawFromCache(A,P,M,O),!0;if(this._drawToCacheCount<100){var T;T=this._cacheMap.size>>24,M=S.rgba>>>16&255,O=S.rgba>>>8&255,I=0;I{Object.defineProperty(f,"__esModule",{value:!0}),f.LRUMap=void 0;var E=function(){function m(y){this.capacity=y,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return m.prototype._unlinkNode=function(y){var _=y.prev,g=y.next;y===this._head&&(this._head=g),y===this._tail&&(this._tail=_),_!==null&&(_.next=g),g!==null&&(g.prev=_)},m.prototype._appendNode=function(y){var _=this._tail;_!==null&&(_.next=y),y.prev=_,y.next=null,this._tail=y,this._head===null&&(this._head=y)},m.prototype.prealloc=function(y){for(var _=this._nodePool,g=0;g=this.capacity)g=this._head,this._unlinkNode(g),delete this._map[g.key],g.key=y,g.value=_,this._map[y]=g;else{var k=this._nodePool;k.length>0?((g=k.pop()).key=y,g.value=_):g={prev:null,next:null,key:y,value:_},this._map[y]=g,this.size++}this._appendNode(g)},m}();f.LRUMap=E},1296:function(D,f,E){var m,y=this&&this.__extends||(m=function(x,M){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,I){O.__proto__=I}||function(O,I){for(var P in I)Object.prototype.hasOwnProperty.call(I,P)&&(O[P]=I[P])},m(x,M)},function(x,M){if(typeof M!="function"&&M!==null)throw new TypeError("Class extends value "+String(M)+" is not a constructor or null");function O(){this.constructor=x}m(x,M),x.prototype=M===null?Object.create(M):(O.prototype=M.prototype,new O)}),_=this&&this.__decorate||function(x,M,O,I){var P,T=arguments.length,j=T<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,O):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(x,M,O,I);else for(var N=x.length-1;N>=0;N--)(P=x[N])&&(j=(T<3?P(j):T>3?P(M,O,j):P(M,O))||j);return T>3&&j&&Object.defineProperty(M,O,j),j},g=this&&this.__param||function(x,M){return function(O,I){M(O,I,x)}},k=this&&this.__values||function(x){var M=typeof Symbol=="function"&&Symbol.iterator,O=M&&x[M],I=0;if(O)return O.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&I>=x.length&&(x=void 0),{value:x&&x[I++],done:!x}}};throw new TypeError(M?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.DomRenderer=void 0;var C=E(3787),u=E(8803),v=E(844),L=E(4725),b=E(2585),c=E(8460),n=E(8055),l=E(9631),o="xterm-dom-renderer-owner-",a="xterm-fg-",d="xterm-bg-",h="xterm-focus",S=1,A=function(x){function M(O,I,P,T,j,N,U,V,ne,ue){var oe=x.call(this)||this;return oe._colors=O,oe._element=I,oe._screenElement=P,oe._viewportElement=T,oe._linkifier=j,oe._linkifier2=N,oe._charSizeService=V,oe._optionsService=ne,oe._bufferService=ue,oe._terminalClass=S++,oe._rowElements=[],oe._rowContainer=document.createElement("div"),oe._rowContainer.classList.add("xterm-rows"),oe._rowContainer.style.lineHeight="normal",oe._rowContainer.setAttribute("aria-hidden","true"),oe._refreshRowElements(oe._bufferService.cols,oe._bufferService.rows),oe._selectionContainer=document.createElement("div"),oe._selectionContainer.classList.add("xterm-selection"),oe._selectionContainer.setAttribute("aria-hidden","true"),oe.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},oe._updateDimensions(),oe._injectCss(),oe._rowFactory=U.createInstance(C.DomRendererRowFactory,document,oe._colors),oe._element.classList.add(o+oe._terminalClass),oe._screenElement.appendChild(oe._rowContainer),oe._screenElement.appendChild(oe._selectionContainer),oe.register(oe._linkifier.onShowLinkUnderline(function(pe){return oe._onLinkHover(pe)})),oe.register(oe._linkifier.onHideLinkUnderline(function(pe){return oe._onLinkLeave(pe)})),oe.register(oe._linkifier2.onShowLinkUnderline(function(pe){return oe._onLinkHover(pe)})),oe.register(oe._linkifier2.onHideLinkUnderline(function(pe){return oe._onLinkLeave(pe)})),oe}return y(M,x),Object.defineProperty(M.prototype,"onRequestRedraw",{get:function(){return new c.EventEmitter().event},enumerable:!1,configurable:!0}),M.prototype.dispose=function(){this._element.classList.remove(o+this._terminalClass),(0,l.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),x.prototype.dispose.call(this)},M.prototype._updateDimensions=function(){var O,I;this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;try{for(var P=k(this._rowElements),T=P.next();!T.done;T=P.next()){var j=T.value;j.style.width=this.dimensions.canvasWidth+"px",j.style.height=this.dimensions.actualCellHeight+"px",j.style.lineHeight=this.dimensions.actualCellHeight+"px",j.style.overflow="hidden"}}catch(U){O={error:U}}finally{try{T&&!T.done&&(I=P.return)&&I.call(P)}finally{if(O)throw O.error}}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var N=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.textContent=N,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},M.prototype.setColors=function(O){this._colors=O,this._injectCss()},M.prototype._injectCss=function(){var O=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var I=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.rawOptions.fontFamily+"; font-size: "+this._optionsService.rawOptions.fontSize+"px;}";I+=this._terminalSelector+" span:not(."+C.BOLD_CLASS+") { font-weight: "+this._optionsService.rawOptions.fontWeight+";}"+this._terminalSelector+" span."+C.BOLD_CLASS+" { font-weight: "+this._optionsService.rawOptions.fontWeightBold+";}"+this._terminalSelector+" span."+C.ITALIC_CLASS+" { font-style: italic;}",I+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",I+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",I+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+C.CURSOR_CLASS+"."+C.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+C.CURSOR_CLASS+"."+C.CURSOR_BLINK_CLASS+":not(."+C.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+C.CURSOR_CLASS+"."+C.CURSOR_BLINK_CLASS+"."+C.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+C.CURSOR_CLASS+"."+C.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+C.CURSOR_CLASS+"."+C.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.rawOptions.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+C.CURSOR_CLASS+"."+C.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",I+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionOpaque.css+";}",this._colors.ansi.forEach(function(P,T){I+=O._terminalSelector+" ."+a+T+" { color: "+P.css+"; }"+O._terminalSelector+" ."+d+T+" { background-color: "+P.css+"; }"}),I+=this._terminalSelector+" ."+a+u.INVERTED_DEFAULT_COLOR+" { color: "+n.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" ."+d+u.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.textContent=I},M.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},M.prototype._refreshRowElements=function(O,I){for(var P=this._rowElements.length;P<=I;P++){var T=document.createElement("div");this._rowContainer.appendChild(T),this._rowElements.push(T)}for(;this._rowElements.length>I;)this._rowContainer.removeChild(this._rowElements.pop())},M.prototype.onResize=function(O,I){this._refreshRowElements(O,I),this._updateDimensions()},M.prototype.onCharSizeChanged=function(){this._updateDimensions()},M.prototype.onBlur=function(){this._rowContainer.classList.remove(h)},M.prototype.onFocus=function(){this._rowContainer.classList.add(h)},M.prototype.onSelectionChanged=function(O,I,P){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(O,I,P),this.renderRows(0,this._bufferService.rows-1),O&&I){var T=O[1]-this._bufferService.buffer.ydisp,j=I[1]-this._bufferService.buffer.ydisp,N=Math.max(T,0),U=Math.min(j,this._bufferService.rows-1);if(!(N>=this._bufferService.rows||U<0)){var V=document.createDocumentFragment();if(P){var ne=O[0]>I[0];V.appendChild(this._createSelectionElement(N,ne?I[0]:O[0],ne?O[0]:I[0],U-N+1))}else{var ue=T===N?O[0]:0,oe=N===j?I[0]:this._bufferService.cols;V.appendChild(this._createSelectionElement(N,ue,oe));var pe=U-N-1;if(V.appendChild(this._createSelectionElement(N+1,0,this._bufferService.cols,pe)),N!==U){var _e=j===U?I[0]:this._bufferService.cols;V.appendChild(this._createSelectionElement(U,0,_e))}}this._selectionContainer.appendChild(V)}}},M.prototype._createSelectionElement=function(O,I,P,T){T===void 0&&(T=1);var j=document.createElement("div");return j.style.height=T*this.dimensions.actualCellHeight+"px",j.style.top=O*this.dimensions.actualCellHeight+"px",j.style.left=I*this.dimensions.actualCellWidth+"px",j.style.width=this.dimensions.actualCellWidth*(P-I)+"px",j},M.prototype.onCursorMove=function(){},M.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},M.prototype.clear=function(){var O,I;try{for(var P=k(this._rowElements),T=P.next();!T.done;T=P.next())T.value.innerText=""}catch(j){O={error:j}}finally{try{T&&!T.done&&(I=P.return)&&I.call(P)}finally{if(O)throw O.error}}},M.prototype.renderRows=function(O,I){for(var P=this._bufferService.buffer.ybase+this._bufferService.buffer.y,T=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,N=O;N<=I;N++){var U=this._rowElements[N];U.innerText="";var V=N+this._bufferService.buffer.ydisp,ne=this._bufferService.buffer.lines.get(V),ue=this._optionsService.rawOptions.cursorStyle;U.appendChild(this._rowFactory.createRow(ne,V,V===P,ue,T,j,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(M.prototype,"_terminalSelector",{get:function(){return"."+o+this._terminalClass},enumerable:!1,configurable:!0}),M.prototype._onLinkHover=function(O){this._setCellUnderline(O.x1,O.x2,O.y1,O.y2,O.cols,!0)},M.prototype._onLinkLeave=function(O){this._setCellUnderline(O.x1,O.x2,O.y1,O.y2,O.cols,!1)},M.prototype._setCellUnderline=function(O,I,P,T,j,N){for(;O!==I||P!==T;){var U=this._rowElements[P];if(!U)return;var V=U.children[O];V&&(V.style.textDecoration=N?"underline":"none"),++O>=j&&(O=0,P++)}},_([g(6,b.IInstantiationService),g(7,L.ICharSizeService),g(8,b.IOptionsService),g(9,b.IBufferService)],M)}(v.Disposable);f.DomRenderer=A},3787:function(D,f,E){var m=this&&this.__decorate||function(o,a,d,h){var S,A=arguments.length,x=A<3?a:h===null?h=Object.getOwnPropertyDescriptor(a,d):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,a,d,h);else for(var M=o.length-1;M>=0;M--)(S=o[M])&&(x=(A<3?S(x):A>3?S(a,d,x):S(a,d))||x);return A>3&&x&&Object.defineProperty(a,d,x),x},y=this&&this.__param||function(o,a){return function(d,h){a(d,h,o)}},_=this&&this.__values||function(o){var a=typeof Symbol=="function"&&Symbol.iterator,d=a&&o[a],h=0;if(d)return d.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&h>=o.length&&(o=void 0),{value:o&&o[h++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.DomRendererRowFactory=f.CURSOR_STYLE_UNDERLINE_CLASS=f.CURSOR_STYLE_BAR_CLASS=f.CURSOR_STYLE_BLOCK_CLASS=f.CURSOR_BLINK_CLASS=f.CURSOR_CLASS=f.STRIKETHROUGH_CLASS=f.UNDERLINE_CLASS=f.ITALIC_CLASS=f.DIM_CLASS=f.BOLD_CLASS=void 0;var g=E(8803),k=E(643),C=E(511),u=E(2585),v=E(8055),L=E(4725),b=E(4269),c=E(1752);f.BOLD_CLASS="xterm-bold",f.DIM_CLASS="xterm-dim",f.ITALIC_CLASS="xterm-italic",f.UNDERLINE_CLASS="xterm-underline",f.STRIKETHROUGH_CLASS="xterm-strikethrough",f.CURSOR_CLASS="xterm-cursor",f.CURSOR_BLINK_CLASS="xterm-cursor-blink",f.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",f.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",f.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var n=function(){function o(a,d,h,S,A,x){this._document=a,this._colors=d,this._characterJoinerService=h,this._optionsService=S,this._coreService=A,this._decorationService=x,this._workCell=new C.CellData,this._columnSelectMode=!1}return o.prototype.setColors=function(a){this._colors=a},o.prototype.onSelectionChanged=function(a,d,h){this._selectionStart=a,this._selectionEnd=d,this._columnSelectMode=h},o.prototype.createRow=function(a,d,h,S,A,x,M,O){for(var I,P,T=this._document.createDocumentFragment(),j=this._characterJoinerService.getJoinedCharacters(d),N=0,U=Math.min(a.length,O)-1;U>=0;U--)if(a.loadCell(U,this._workCell).getCode()!==k.NULL_CELL_CODE||h&&U===A){N=U+1;break}for(U=0;U0&&U===j[0][0]){ne=!0;var pe=j.shift();oe=new b.JoinedCellData(this._workCell,a.translateToString(!0,pe[0],pe[1]),pe[1]-pe[0]),ue=pe[1]-1,V=oe.getWidth()}var _e=this._document.createElement("span");if(V>1&&(_e.style.width=M*V+"px"),ne&&(_e.style.display="inline",A>=U&&A<=ue&&(A=U)),!this._coreService.isCursorHidden&&h&&U===A)switch(_e.classList.add(f.CURSOR_CLASS),x&&_e.classList.add(f.CURSOR_BLINK_CLASS),S){case"bar":_e.classList.add(f.CURSOR_STYLE_BAR_CLASS);break;case"underline":_e.classList.add(f.CURSOR_STYLE_UNDERLINE_CLASS);break;default:_e.classList.add(f.CURSOR_STYLE_BLOCK_CLASS)}oe.isBold()&&_e.classList.add(f.BOLD_CLASS),oe.isItalic()&&_e.classList.add(f.ITALIC_CLASS),oe.isDim()&&_e.classList.add(f.DIM_CLASS),oe.isUnderline()&&_e.classList.add(f.UNDERLINE_CLASS),oe.isInvisible()?_e.textContent=k.WHITESPACE_CELL_CHAR:_e.textContent=oe.getChars()||k.WHITESPACE_CELL_CHAR,oe.isStrikethrough()&&_e.classList.add(f.STRIKETHROUGH_CLASS);var z=oe.getFgColor(),ve=oe.getFgColorMode(),he=oe.getBgColor(),ke=oe.getBgColorMode(),$=!!oe.isInverse();if($){var Ie=z;z=he,he=Ie;var ge=ve;ve=ke,ke=ge}var le=void 0,Y=void 0,Z=!1;try{for(var se=(I=void 0,_(this._decorationService.getDecorationsAtCell(U,d))),xe=se.next();!xe.done;xe=se.next()){var Ee=xe.value;Ee.options.layer!=="top"&&Z||(Ee.backgroundColorRGB&&(ke=50331648,he=Ee.backgroundColorRGB.rgba>>8&16777215,le=Ee.backgroundColorRGB),Ee.foregroundColorRGB&&(ve=50331648,z=Ee.foregroundColorRGB.rgba>>8&16777215,Y=Ee.foregroundColorRGB),Z=Ee.options.layer==="top")}}catch(Xe){I={error:Xe}}finally{try{xe&&!xe.done&&(P=se.return)&&P.call(se)}finally{if(I)throw I.error}}var De=this._isCellInSelection(U,d);Z||this._colors.selectionForeground&&De&&(ve=50331648,z=this._colors.selectionForeground.rgba>>8&16777215,Y=this._colors.selectionForeground),De&&(le=this._colors.selectionOpaque,Z=!0),Z&&_e.classList.add("xterm-decoration-top");var je=void 0;switch(ke){case 16777216:case 33554432:je=this._colors.ansi[he],_e.classList.add("xterm-bg-"+he);break;case 50331648:je=v.rgba.toColor(he>>16,he>>8&255,255&he),this._addStyle(_e,"background-color:#"+l((he>>>0).toString(16),"0",6));break;default:$?(je=this._colors.foreground,_e.classList.add("xterm-bg-"+g.INVERTED_DEFAULT_COLOR)):je=this._colors.background}switch(ve){case 16777216:case 33554432:oe.isBold()&&z<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(z+=8),this._applyMinimumContrast(_e,je,this._colors.ansi[z],oe,le,void 0)||_e.classList.add("xterm-fg-"+z);break;case 50331648:var Re=v.rgba.toColor(z>>16&255,z>>8&255,255&z);this._applyMinimumContrast(_e,je,Re,oe,le,Y)||this._addStyle(_e,"color:#"+l(z.toString(16),"0",6));break;default:this._applyMinimumContrast(_e,je,this._colors.foreground,oe,le,void 0)||$&&_e.classList.add("xterm-fg-"+g.INVERTED_DEFAULT_COLOR)}T.appendChild(_e),U=ue}}return T},o.prototype._applyMinimumContrast=function(a,d,h,S,A,x){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,c.excludeFromContrastRatioDemands)(S.getCode()))return!1;var M=void 0;return A||x||(M=this._colors.contrastCache.getColor(d.rgba,h.rgba)),M===void 0&&(M=v.color.ensureContrastRatio(A||d,x||h,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((A||d).rgba,(x||h).rgba,M??null)),!!M&&(this._addStyle(a,"color:"+M.css),!0)},o.prototype._addStyle=function(a,d){a.setAttribute("style",""+(a.getAttribute("style")||"")+d+";")},o.prototype._isCellInSelection=function(a,d){var h=this._selectionStart,S=this._selectionEnd;return!(!h||!S)&&(this._columnSelectMode?h[0]<=S[0]?a>=h[0]&&d>=h[1]&&a=h[1]&&a>=S[0]&&d<=S[1]:d>h[1]&&d=h[0]&&a=h[0])},m([y(2,L.ICharacterJoinerService),y(3,u.IOptionsService),y(4,u.ICoreService),y(5,u.IDecorationService)],o)}();function l(o,a,d){for(;o.length{Object.defineProperty(f,"__esModule",{value:!0}),f.SelectionModel=void 0;var E=function(){function m(y){this._bufferService=y,this.isSelectAllActive=!1,this.selectionStartLength=0}return m.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(m.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"finalSelectionEnd",{get:function(){return this.isSelectAllActive?[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1]:this.selectionStart?!this.selectionEnd||this.areSelectionValuesReversed()?(y=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?y%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(y/this._bufferService.cols)-1]:[y%this._bufferService.cols,this.selectionStart[1]+Math.floor(y/this._bufferService.cols)]:[y,this.selectionStart[1]]:this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?(y=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?[y%this._bufferService.cols,this.selectionStart[1]+Math.floor(y/this._bufferService.cols)]:[Math.max(y,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd:void 0;var y},enumerable:!1,configurable:!0}),m.prototype.areSelectionValuesReversed=function(){var y=this.selectionStart,_=this.selectionEnd;return!(!y||!_)&&(y[1]>_[1]||y[1]===_[1]&&y[0]>_[0])},m.prototype.onTrim=function(y){return this.selectionStart&&(this.selectionStart[1]-=y),this.selectionEnd&&(this.selectionEnd[1]-=y),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},m}();f.SelectionModel=E},428:function(D,f,E){var m=this&&this.__decorate||function(u,v,L,b){var c,n=arguments.length,l=n<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,L):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(u,v,L,b);else for(var o=u.length-1;o>=0;o--)(c=u[o])&&(l=(n<3?c(l):n>3?c(v,L,l):c(v,L))||l);return n>3&&l&&Object.defineProperty(v,L,l),l},y=this&&this.__param||function(u,v){return function(L,b){v(L,b,u)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CharSizeService=void 0;var _=E(2585),g=E(8460),k=function(){function u(v,L,b){this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=new g.EventEmitter,this._measureStrategy=new C(v,L,this._optionsService)}return Object.defineProperty(u.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),u.prototype.measure=function(){var v=this._measureStrategy.measure();v.width===this.width&&v.height===this.height||(this.width=v.width,this.height=v.height,this._onCharSizeChange.fire())},m([y(2,_.IOptionsService)],u)}();f.CharSizeService=k;var C=function(){function u(v,L,b){this._document=v,this._parentElement=L,this._optionsService=b,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return u.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var v=this._measureElement.getBoundingClientRect();return v.width!==0&&v.height!==0&&(this._result.width=v.width,this._result.height=Math.ceil(v.height)),this._result},u}()},4269:function(D,f,E){var m,y=this&&this.__extends||(m=function(c,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,o){l.__proto__=o}||function(l,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(l[a]=o[a])},m(c,n)},function(c,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function l(){this.constructor=c}m(c,n),c.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}),_=this&&this.__decorate||function(c,n,l,o){var a,d=arguments.length,h=d<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(c,n,l,o);else for(var S=c.length-1;S>=0;S--)(a=c[S])&&(h=(d<3?a(h):d>3?a(n,l,h):a(n,l))||h);return d>3&&h&&Object.defineProperty(n,l,h),h},g=this&&this.__param||function(c,n){return function(l,o){n(l,o,c)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CharacterJoinerService=f.JoinedCellData=void 0;var k=E(3734),C=E(643),u=E(511),v=E(2585),L=function(c){function n(l,o,a){var d=c.call(this)||this;return d.content=0,d.combinedData="",d.fg=l.fg,d.bg=l.bg,d.combinedData=o,d._width=a,d}return y(n,c),n.prototype.isCombined=function(){return 2097152},n.prototype.getWidth=function(){return this._width},n.prototype.getChars=function(){return this.combinedData},n.prototype.getCode=function(){return 2097151},n.prototype.setFromCharData=function(l){throw new Error("not implemented")},n.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},n}(k.AttributeData);f.JoinedCellData=L;var b=function(){function c(n){this._bufferService=n,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new u.CellData}return c.prototype.register=function(n){var l={id:this._nextCharacterJoinerId++,handler:n};return this._characterJoiners.push(l),l.id},c.prototype.deregister=function(n){for(var l=0;l1)for(var O=this._getJoinedRanges(a,S,h,l,d),I=0;I1)for(O=this._getJoinedRanges(a,S,h,l,d),I=0;I{Object.defineProperty(f,"__esModule",{value:!0}),f.CoreBrowserService=void 0;var E=function(){function m(y){this._textarea=y}return Object.defineProperty(m.prototype,"isFocused",{get:function(){return(this._textarea.getRootNode?this._textarea.getRootNode():document).activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),m}();f.CoreBrowserService=E},8934:function(D,f,E){var m=this&&this.__decorate||function(C,u,v,L){var b,c=arguments.length,n=c<3?u:L===null?L=Object.getOwnPropertyDescriptor(u,v):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(C,u,v,L);else for(var l=C.length-1;l>=0;l--)(b=C[l])&&(n=(c<3?b(n):c>3?b(u,v,n):b(u,v))||n);return c>3&&n&&Object.defineProperty(u,v,n),n},y=this&&this.__param||function(C,u){return function(v,L){u(v,L,C)}};Object.defineProperty(f,"__esModule",{value:!0}),f.MouseService=void 0;var _=E(4725),g=E(9806),k=function(){function C(u,v){this._renderService=u,this._charSizeService=v}return C.prototype.getCoords=function(u,v,L,b,c){return(0,g.getCoords)(window,u,v,L,b,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,c)},C.prototype.getRawByteCoords=function(u,v,L,b){var c=this.getCoords(u,v,L,b);return(0,g.getRawByteCoords)(c)},m([y(0,_.IRenderService),y(1,_.ICharSizeService)],C)}();f.MouseService=k},3230:function(D,f,E){var m,y=this&&this.__extends||(m=function(l,o){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,d){a.__proto__=d}||function(a,d){for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&(a[h]=d[h])},m(l,o)},function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=l}m(l,o),l.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}),_=this&&this.__decorate||function(l,o,a,d){var h,S=arguments.length,A=S<3?o:d===null?d=Object.getOwnPropertyDescriptor(o,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(l,o,a,d);else for(var x=l.length-1;x>=0;x--)(h=l[x])&&(A=(S<3?h(A):S>3?h(o,a,A):h(o,a))||A);return S>3&&A&&Object.defineProperty(o,a,A),A},g=this&&this.__param||function(l,o){return function(a,d){o(a,d,l)}};Object.defineProperty(f,"__esModule",{value:!0}),f.RenderService=void 0;var k=E(6193),C=E(8460),u=E(844),v=E(5596),L=E(3656),b=E(2585),c=E(4725),n=function(l){function o(a,d,h,S,A,x,M){var O=l.call(this)||this;if(O._renderer=a,O._rowCount=d,O._charSizeService=A,O._isPaused=!1,O._needsFullRefresh=!1,O._isNextRenderRedrawOnly=!0,O._needsSelectionRefresh=!1,O._canvasWidth=0,O._canvasHeight=0,O._selectionState={start:void 0,end:void 0,columnSelectMode:!1},O._onDimensionsChange=new C.EventEmitter,O._onRenderedViewportChange=new C.EventEmitter,O._onRender=new C.EventEmitter,O._onRefreshRequest=new C.EventEmitter,O.register({dispose:function(){return O._renderer.dispose()}}),O._renderDebouncer=new k.RenderDebouncer(function(P,T){return O._renderRows(P,T)}),O.register(O._renderDebouncer),O._screenDprMonitor=new v.ScreenDprMonitor,O._screenDprMonitor.setListener(function(){return O.onDevicePixelRatioChange()}),O.register(O._screenDprMonitor),O.register(M.onResize(function(){return O._fullRefresh()})),O.register(M.buffers.onBufferActivate(function(){var P;return(P=O._renderer)===null||P===void 0?void 0:P.clear()})),O.register(S.onOptionChange(function(){return O._handleOptionsChanged()})),O.register(O._charSizeService.onCharSizeChange(function(){return O.onCharSizeChanged()})),O.register(x.onDecorationRegistered(function(){return O._fullRefresh()})),O.register(x.onDecorationRemoved(function(){return O._fullRefresh()})),O._renderer.onRequestRedraw(function(P){return O.refreshRows(P.start,P.end,!0)}),O.register((0,L.addDisposableDomListener)(window,"resize",function(){return O.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var I=new IntersectionObserver(function(P){return O._onIntersectionChange(P[P.length-1])},{threshold:0});I.observe(h),O.register({dispose:function(){return I.disconnect()}})}return O}return y(o,l),Object.defineProperty(o.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onRenderedViewportChange",{get:function(){return this._onRenderedViewportChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),o.prototype._onIntersectionChange=function(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},o.prototype.refreshRows=function(a,d,h){h===void 0&&(h=!1),this._isPaused?this._needsFullRefresh=!0:(h||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,d,this._rowCount))},o.prototype._renderRows=function(a,d){this._renderer.renderRows(a,d),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:d}),this._onRender.fire({start:a,end:d}),this._isNextRenderRedrawOnly=!0},o.prototype.resize=function(a,d){this._rowCount=d,this._fireOnCanvasResize()},o.prototype._handleOptionsChanged=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},o.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},o.prototype.dispose=function(){l.prototype.dispose.call(this)},o.prototype.setRenderer=function(a){var d=this;this._renderer.dispose(),this._renderer=a,this._renderer.onRequestRedraw(function(h){return d.refreshRows(h.start,h.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},o.prototype.addRefreshCallback=function(a){return this._renderDebouncer.addRefreshCallback(a)},o.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},o.prototype.clearTextureAtlas=function(){var a,d;(d=(a=this._renderer)===null||a===void 0?void 0:a.clearTextureAtlas)===null||d===void 0||d.call(a),this._fullRefresh()},o.prototype.setColors=function(a){this._renderer.setColors(a),this._fullRefresh()},o.prototype.onDevicePixelRatioChange=function(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},o.prototype.onResize=function(a,d){this._renderer.onResize(a,d),this._fullRefresh()},o.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},o.prototype.onBlur=function(){this._renderer.onBlur()},o.prototype.onFocus=function(){this._renderer.onFocus()},o.prototype.onSelectionChanged=function(a,d,h){this._selectionState.start=a,this._selectionState.end=d,this._selectionState.columnSelectMode=h,this._renderer.onSelectionChanged(a,d,h)},o.prototype.onCursorMove=function(){this._renderer.onCursorMove()},o.prototype.clear=function(){this._renderer.clear()},_([g(3,b.IOptionsService),g(4,c.ICharSizeService),g(5,b.IDecorationService),g(6,b.IBufferService)],o)}(u.Disposable);f.RenderService=n},9312:function(D,f,E){var m,y=this&&this.__extends||(m=function(S,A){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,M){x.__proto__=M}||function(x,M){for(var O in M)Object.prototype.hasOwnProperty.call(M,O)&&(x[O]=M[O])},m(S,A)},function(S,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function x(){this.constructor=S}m(S,A),S.prototype=A===null?Object.create(A):(x.prototype=A.prototype,new x)}),_=this&&this.__decorate||function(S,A,x,M){var O,I=arguments.length,P=I<3?A:M===null?M=Object.getOwnPropertyDescriptor(A,x):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(S,A,x,M);else for(var T=S.length-1;T>=0;T--)(O=S[T])&&(P=(I<3?O(P):I>3?O(A,x,P):O(A,x))||P);return I>3&&P&&Object.defineProperty(A,x,P),P},g=this&&this.__param||function(S,A){return function(x,M){A(x,M,S)}};Object.defineProperty(f,"__esModule",{value:!0}),f.SelectionService=void 0;var k=E(6114),C=E(456),u=E(511),v=E(8460),L=E(4725),b=E(2585),c=E(9806),n=E(9504),l=E(844),o=E(4841),a="\xA0",d=new RegExp(a,"g"),h=function(S){function A(x,M,O,I,P,T,j,N){var U=S.call(this)||this;return U._element=x,U._screenElement=M,U._linkifier=O,U._bufferService=I,U._coreService=P,U._mouseService=T,U._optionsService=j,U._renderService=N,U._dragScrollAmount=0,U._enabled=!0,U._workCell=new u.CellData,U._mouseDownTimeStamp=0,U._oldHasSelection=!1,U._oldSelectionStart=void 0,U._oldSelectionEnd=void 0,U._onLinuxMouseSelection=U.register(new v.EventEmitter),U._onRedrawRequest=U.register(new v.EventEmitter),U._onSelectionChange=U.register(new v.EventEmitter),U._onRequestScrollLines=U.register(new v.EventEmitter),U._mouseMoveListener=function(V){return U._onMouseMove(V)},U._mouseUpListener=function(V){return U._onMouseUp(V)},U._coreService.onUserInput(function(){U.hasSelection&&U.clearSelection()}),U._trimListener=U._bufferService.buffer.lines.onTrim(function(V){return U._onTrim(V)}),U.register(U._bufferService.buffers.onBufferActivate(function(V){return U._onBufferActivate(V)})),U.enable(),U._model=new C.SelectionModel(U._bufferService),U._activeSelectionMode=0,U}return y(A,S),Object.defineProperty(A.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),A.prototype.dispose=function(){this._removeMouseDownListeners()},A.prototype.reset=function(){this.clearSelection()},A.prototype.disable=function(){this.clearSelection(),this._enabled=!1},A.prototype.enable=function(){this._enabled=!0},Object.defineProperty(A.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"hasSelection",{get:function(){var x=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!x||!M||x[0]===M[0]&&x[1]===M[1])},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"selectionText",{get:function(){var x=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!x||!M)return"";var O=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(x[0]===M[0])return"";for(var P=x[0]0&&t.prevInput=="\u200B"?bt(i,Qa)(i):ue++<10?r.detectingSelectAll=setTimeout(pe,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(pe,200)}}if(y&&_>=9&&Q(),E){hr(e);var oe=function(){et(window,"mouseup",oe),setTimeout(J,20)};Te(window,"mouseup",oe)}else setTimeout(J,50)},it.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},it.prototype.setUneditable=function(){},it.prototype.needsContentAttribute=!1;function Lf(e,t){if(t=t?ke(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=G(q(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=O.getValue()}var s;if(e.form&&(Te(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var v=e.form;s=v.submit;try{var L=v.submit=function(){r(),v.submit=s,v.submit(),v.submit=L}}catch{}}t.finishInit=function(P){P.save=r,P.getTextArea=function(){return e},P.toTextArea=function(){P.toTextArea=isNaN,r(),e.parentNode.removeChild(P.getWrapperElement()),e.style.display="",e.form&&(et(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var O=Ye(function(P){return e.parentNode.insertBefore(P,e.nextSibling)},t);return O}function xf(e){e.off=et,e.on=Te,e.wheelEventPixels=Ru,e.Doc=Gt,e.splitLines=Tt,e.countColumn=$,e.findColumn=Ee,e.isWordChar=br,e.Pass=V,e.signal=ze,e.Line=Ui,e.changeEnd=gi,e.scrollbarModel=Aa,e.Pos=ie,e.cmpPos=be,e.modes=Mr,e.mimeModes=Pt,e.resolveMode=Rr,e.getMode=Or,e.modeExtensions=vr,e.extendMode=Dr,e.copyState=zt,e.startState=Br,e.innerMode=jr,e.commands=In,e.keyMap=ii,e.keyName=vl,e.isModifierKey=dl,e.lookupKey=rn,e.normalizeKeyMap=Qu,e.StringStream=qe,e.SharedTextMarker=Dn,e.TextMarker=yi,e.LineWidget=On,e.e_preventDefault=tt,e.e_stopPropagation=Tr,e.e_stop=hr,e.addClass=te,e.contains=z,e.rmClass=D,e.keyNames=mi}gf(Ye),bf(Ye);var kf="iter insert remove copy getEditor constructor".split(" ");for(var vo in Gt.prototype)Gt.prototype.hasOwnProperty(vo)&&ge(kf,vo)<0&&(Ye.prototype[vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Gt.prototype[vo]));return Ot(Gt),Ye.inputStyles={textarea:it,contenteditable:Ne},Ye.defineMode=function(e){!Ye.defaults.mode&&e!="null"&&(Ye.defaults.mode=e),It.apply(this,arguments)},Ye.defineMIME=wr,Ye.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ye.defineMIME("text/plain","null"),Ye.defineExtension=function(e,t){Ye.prototype[e]=t},Ye.defineDocExtension=function(e,t){Gt.prototype[e]=t},Ye.fromTextArea=Lf,xf(Ye),Ye.version="5.65.16",Ye})});var Ul=Nt((jl,zl)=>{(function(U){typeof jl=="object"&&typeof zl=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){"use strict";U.defineMode("shell",function(){var B={};function R(p,w){for(var b=0;b1&&p.eat("$");var b=p.next();return/['"({]/.test(b)?(w.tokens[0]=_(b,b=="("?"quote":b=="{"?"def":"string"),u(p,w)):(/\d/.test(b)||p.eatWhile(/\w/),w.tokens.shift(),"def")};function C(p){return function(w,b){return w.sol()&&w.string==p&&b.tokens.shift(),w.skipToEnd(),"string-2"}}function u(p,w){return(w.tokens[0]||y)(p,w)}return{startState:function(){return{tokens:[]}},token:function(p,w){return u(p,w)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}}),U.defineMIME("text/x-sh","shell"),U.defineMIME("application/x-sh","shell")})});var Es=Nt((Gl,Zl)=>{(function(U){typeof Gl=="object"&&typeof Zl=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){"use strict";U.defineMode("javascript",function(B,R){var f=B.indentUnit,k=R.statementIndent,m=R.jsonld,y=R.json||m,_=R.trackScope!==!1,g=R.typescript,x=R.wordCharacters||/[\w$\xa1-\uffff]/,C=function(){function j(Je){return{type:Je,style:"keyword"}}var Z=j("keyword a"),ae=j("keyword b"),he=j("keyword c"),ie=j("keyword d"),be=j("operator"),He={type:"atom",style:"atom"};return{if:j("if"),while:Z,with:Z,else:ae,do:ae,try:ae,finally:ae,return:ie,break:ie,continue:ie,new:j("new"),delete:he,void:he,throw:he,debugger:j("debugger"),var:j("var"),const:j("var"),let:j("var"),function:j("function"),catch:j("catch"),for:j("for"),switch:j("switch"),case:j("case"),default:j("default"),in:be,typeof:be,instanceof:be,true:He,false:He,null:He,undefined:He,NaN:He,Infinity:He,this:j("this"),class:j("class"),super:j("atom"),yield:he,export:j("export"),import:j("import"),extends:he,await:he}}(),u=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function w(j){for(var Z=!1,ae,he=!1;(ae=j.next())!=null;){if(!Z){if(ae=="/"&&!he)return;ae=="["?he=!0:he&&ae=="]"&&(he=!1)}Z=!Z&&ae=="\\"}}var b,c;function o(j,Z,ae){return b=j,c=ae,Z}function l(j,Z){var ae=j.next();if(ae=='"'||ae=="'")return Z.tokenize=n(ae),Z.tokenize(j,Z);if(ae=="."&&j.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return o("number","number");if(ae=="."&&j.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(ae))return o(ae);if(ae=="="&&j.eat(">"))return o("=>","operator");if(ae=="0"&&j.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return o("number","number");if(/\d/.test(ae))return j.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),o("number","number");if(ae=="/")return j.eat("*")?(Z.tokenize=a,a(j,Z)):j.eat("/")?(j.skipToEnd(),o("comment","comment")):Lt(j,Z,1)?(w(j),j.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),o("regexp","string-2")):(j.eat("="),o("operator","operator",j.current()));if(ae=="`")return Z.tokenize=h,h(j,Z);if(ae=="#"&&j.peek()=="!")return j.skipToEnd(),o("meta","meta");if(ae=="#"&&j.eatWhile(x))return o("variable","property");if(ae=="<"&&j.match("!--")||ae=="-"&&j.match("->")&&!/\S/.test(j.string.slice(0,j.start)))return j.skipToEnd(),o("comment","comment");if(u.test(ae))return(ae!=">"||!Z.lexical||Z.lexical.type!=">")&&(j.eat("=")?(ae=="!"||ae=="=")&&j.eat("="):/[<>*+\-|&?]/.test(ae)&&(j.eat(ae),ae==">"&&j.eat(ae))),ae=="?"&&j.eat(".")?o("."):o("operator","operator",j.current());if(x.test(ae)){j.eatWhile(x);var he=j.current();if(Z.lastType!="."){if(C.propertyIsEnumerable(he)){var ie=C[he];return o(ie.type,ie.style,he)}if(he=="async"&&j.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return o("async","keyword",he)}return o("variable","variable",he)}}function n(j){return function(Z,ae){var he=!1,ie;if(m&&Z.peek()=="@"&&Z.match(p))return ae.tokenize=l,o("jsonld-keyword","meta");for(;(ie=Z.next())!=null&&!(ie==j&&!he);)he=!he&&ie=="\\";return he||(ae.tokenize=l),o("string","string")}}function a(j,Z){for(var ae=!1,he;he=j.next();){if(he=="/"&&ae){Z.tokenize=l;break}ae=he=="*"}return o("comment","comment")}function h(j,Z){for(var ae=!1,he;(he=j.next())!=null;){if(!ae&&(he=="`"||he=="$"&&j.eat("{"))){Z.tokenize=l;break}ae=!ae&&he=="\\"}return o("quasi","string-2",j.current())}var d="([{}])";function S(j,Z){Z.fatArrowAt&&(Z.fatArrowAt=null);var ae=j.string.indexOf("=>",j.start);if(!(ae<0)){if(g){var he=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(j.string.slice(j.start,ae));he&&(ae=he.index)}for(var ie=0,be=!1,He=ae-1;He>=0;--He){var Je=j.string.charAt(He),vt=d.indexOf(Je);if(vt>=0&&vt<3){if(!ie){++He;break}if(--ie==0){Je=="("&&(be=!0);break}}else if(vt>=3&&vt<6)++ie;else if(x.test(Je))be=!0;else if(/["'\/`]/.test(Je))for(;;--He){if(He==0)return;var Ur=j.string.charAt(He-1);if(Ur==Je&&j.string.charAt(He-2)!="\\"){He--;break}}else if(be&&!ie){++He;break}}be&&!ie&&(Z.fatArrowAt=He)}}var T={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function E(j,Z,ae,he,ie,be){this.indented=j,this.column=Z,this.type=ae,this.prev=ie,this.info=be,he!=null&&(this.align=he)}function M(j,Z){if(!_)return!1;for(var ae=j.localVars;ae;ae=ae.next)if(ae.name==Z)return!0;for(var he=j.context;he;he=he.prev)for(var ae=he.vars;ae;ae=ae.next)if(ae.name==Z)return!0}function D(j,Z,ae,he,ie){var be=j.cc;for(W.state=j,W.stream=ie,W.marked=null,W.cc=be,W.style=Z,j.lexical.hasOwnProperty("align")||(j.lexical.align=!0);;){var He=be.length?be.pop():y?ge:$;if(He(ae,he)){for(;be.length&&be[be.length-1].lex;)be.pop()();return W.marked?W.marked:ae=="variable"&&M(j,he)?"variable-2":Z}}}var W={state:null,column:null,marked:null,cc:null};function I(){for(var j=arguments.length-1;j>=0;j--)W.cc.push(arguments[j])}function A(){return I.apply(null,arguments),!0}function H(j,Z){for(var ae=Z;ae;ae=ae.next)if(ae.name==j)return!0;return!1}function F(j){var Z=W.state;if(W.marked="def",!!_){if(Z.context){if(Z.lexical.info=="var"&&Z.context&&Z.context.block){var ae=z(j,Z.context);if(ae!=null){Z.context=ae;return}}else if(!H(j,Z.localVars)){Z.localVars=new ce(j,Z.localVars);return}}R.globalVars&&!H(j,Z.globalVars)&&(Z.globalVars=new ce(j,Z.globalVars))}}function z(j,Z){if(Z)if(Z.block){var ae=z(j,Z.prev);return ae?ae==Z.prev?Z:new te(ae,Z.vars,!0):null}else return H(j,Z.vars)?Z:new te(Z.prev,new ce(j,Z.vars),!1);else return null}function G(j){return j=="public"||j=="private"||j=="protected"||j=="abstract"||j=="readonly"}function te(j,Z,ae){this.prev=j,this.vars=Z,this.block=ae}function ce(j,Z){this.name=j,this.next=Z}var ee=new ce("this",new ce("arguments",null));function fe(){W.state.context=new te(W.state.context,W.state.localVars,!1),W.state.localVars=ee}function _e(){W.state.context=new te(W.state.context,W.state.localVars,!0),W.state.localVars=null}fe.lex=_e.lex=!0;function q(){W.state.localVars=W.state.context.vars,W.state.context=W.state.context.prev}q.lex=!0;function ve(j,Z){var ae=function(){var he=W.state,ie=he.indented;if(he.lexical.type=="stat")ie=he.lexical.indented;else for(var be=he.lexical;be&&be.type==")"&&be.align;be=be.prev)ie=be.indented;he.lexical=new E(ie,W.stream.column(),j,null,he.lexical,Z)};return ae.lex=!0,ae}function de(){var j=W.state;j.lexical.prev&&(j.lexical.type==")"&&(j.indented=j.lexical.indented),j.lexical=j.lexical.prev)}de.lex=!0;function ke(j){function Z(ae){return ae==j?A():j==";"||ae=="}"||ae==")"||ae=="]"?I():A(Z)}return Z}function $(j,Z){return j=="var"?A(ve("vardef",Z),Tr,ke(";"),de):j=="keyword a"?A(ve("form"),V,$,de):j=="keyword b"?A(ve("form"),$,de):j=="keyword d"?W.stream.match(/^\s*$/,!1)?A():A(ve("stat"),se,ke(";"),de):j=="debugger"?A(ke(";")):j=="{"?A(ve("}"),_e,Qt,de,q):j==";"?A():j=="if"?(W.state.lexical.info=="else"&&W.state.cc[W.state.cc.length-1]==de&&W.state.cc.pop()(),A(ve("form"),V,$,de,Ar)):j=="function"?A(Tt):j=="for"?A(ve("form"),_e,$r,$,q,de):j=="class"||g&&Z=="interface"?(W.marked="keyword",A(ve("form",j=="class"?j:Z),Mr,de)):j=="variable"?g&&Z=="declare"?(W.marked="keyword",A($)):g&&(Z=="module"||Z=="enum"||Z=="type")&&W.stream.match(/^\s*\w/,!1)?(W.marked="keyword",Z=="enum"?A(Le):Z=="type"?A(Jr,ke("operator"),Be,ke(";")):A(ve("form"),lt,ke("{"),ve("}"),Qt,de,de)):g&&Z=="namespace"?(W.marked="keyword",A(ve("form"),ge,$,de)):g&&Z=="abstract"?(W.marked="keyword",A($)):A(ve("stat"),Jt):j=="switch"?A(ve("form"),V,ke("{"),ve("}","switch"),_e,Qt,de,de,q):j=="case"?A(ge,ke(":")):j=="default"?A(ke(":")):j=="catch"?A(ve("form"),fe,Ie,$,de,q):j=="export"?A(ve("stat"),Rr,de):j=="import"?A(ve("stat"),vr,de):j=="async"?A($):Z=="@"?A(ge,$):I(ve("stat"),ge,ke(";"),de)}function Ie(j){if(j=="(")return A(Bt,ke(")"))}function ge(j,Z){return Y(j,Z,!1)}function le(j,Z){return Y(j,Z,!0)}function V(j){return j!="("?I():A(ve(")"),se,ke(")"),de)}function Y(j,Z,ae){if(W.state.fatArrowAt==W.stream.start){var he=ae?Ze:Re;if(j=="(")return A(fe,ve(")"),Xe(Bt,")"),de,ke("=>"),he,q);if(j=="variable")return I(fe,lt,ke("=>"),he,q)}var ie=ae?Ee:xe;return T.hasOwnProperty(j)?A(ie):j=="function"?A(Tt,ie):j=="class"||g&&Z=="interface"?(W.marked="keyword",A(ve("form"),ui,de)):j=="keyword c"||j=="async"?A(ae?le:ge):j=="("?A(ve(")"),se,ke(")"),de,ie):j=="operator"||j=="spread"?A(ae?le:ge):j=="["?A(ve("]"),qe,de,ie):j=="{"?Sr(lr,"}",null,ie):j=="quasi"?I(De,ie):j=="new"?A(we(ae)):A()}function se(j){return j.match(/[;\}\)\],]/)?I():I(ge)}function xe(j,Z){return j==","?A(se):Ee(j,Z,!1)}function Ee(j,Z,ae){var he=ae==!1?xe:Ee,ie=ae==!1?ge:le;if(j=="=>")return A(fe,ae?Ze:Re,q);if(j=="operator")return/\+\+|--/.test(Z)||g&&Z=="!"?A(he):g&&Z=="<"&&W.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?A(ve(">"),Xe(Be,">"),de,he):Z=="?"?A(ge,ke(":"),ie):A(ie);if(j=="quasi")return I(De,he);if(j!=";"){if(j=="(")return Sr(le,")","call",he);if(j==".")return A(br,he);if(j=="[")return A(ve("]"),se,ke("]"),de,he);if(g&&Z=="as")return W.marked="keyword",A(Be,he);if(j=="regexp")return W.state.lastType=W.marked="operator",W.stream.backUp(W.stream.pos-W.stream.start-1),A(ie)}}function De(j,Z){return j!="quasi"?I():Z.slice(Z.length-2)!="${"?A(De):A(se,je)}function je(j){if(j=="}")return W.marked="string-2",W.state.tokenize=h,A(De)}function Re(j){return S(W.stream,W.state),I(j=="{"?$:ge)}function Ze(j){return S(W.stream,W.state),I(j=="{"?$:le)}function we(j){return function(Z){return Z=="."?A(j?dt:$e):Z=="variable"&&g?A(pt,j?Ee:xe):I(j?le:ge)}}function $e(j,Z){if(Z=="target")return W.marked="keyword",A(xe)}function dt(j,Z){if(Z=="target")return W.marked="keyword",A(Ee)}function Jt(j){return j==":"?A(de,$):I(xe,ke(";"),de)}function br(j){if(j=="variable")return W.marked="property",A()}function lr(j,Z){if(j=="async")return W.marked="property",A(lr);if(j=="variable"||W.style=="keyword"){if(W.marked="property",Z=="get"||Z=="set")return A(ai);var ae;return g&&W.state.fatArrowAt==W.stream.start&&(ae=W.stream.match(/^\s*:\s*/,!1))&&(W.state.fatArrowAt=W.stream.pos+ae[0].length),A(cr)}else{if(j=="number"||j=="string")return W.marked=m?"property":W.style+" property",A(cr);if(j=="jsonld-keyword")return A(cr);if(g&&G(Z))return W.marked="keyword",A(lr);if(j=="[")return A(ge,ur,ke("]"),cr);if(j=="spread")return A(le,cr);if(Z=="*")return W.marked="keyword",A(lr);if(j==":")return I(cr)}}function ai(j){return j!="variable"?I(cr):(W.marked="property",A(Tt))}function cr(j){if(j==":")return A(le);if(j=="(")return I(Tt)}function Xe(j,Z,ae){function he(ie,be){if(ae?ae.indexOf(ie)>-1:ie==","){var He=W.state.lexical;return He.info=="call"&&(He.pos=(He.pos||0)+1),A(function(Je,vt){return Je==Z||vt==Z?I():I(j)},he)}return ie==Z||be==Z?A():ae&&ae.indexOf(";")>-1?I(j):A(ke(Z))}return function(ie,be){return ie==Z||be==Z?A():I(j,he)}}function Sr(j,Z,ae){for(var he=3;he"),Be);if(j=="quasi")return I(et,Et)}function Vr(j){if(j=="=>")return A(Be)}function Te(j){return j.match(/[\}\)\]]/)?A():j==","||j==";"?A(Te):I(er,Te)}function er(j,Z){if(j=="variable"||W.style=="keyword")return W.marked="property",A(er);if(Z=="?"||j=="number"||j=="string")return A(er);if(j==":")return A(Be);if(j=="[")return A(ke("variable"),Cr,ke("]"),er);if(j=="(")return I(pr,er);if(!j.match(/[;\}\)\],]/))return A()}function et(j,Z){return j!="quasi"?I():Z.slice(Z.length-2)!="${"?A(et):A(Be,ze)}function ze(j){if(j=="}")return W.marked="string-2",W.state.tokenize=h,A(et)}function Ue(j,Z){return j=="variable"&&W.stream.match(/^\s*[?:]/,!1)||Z=="?"?A(Ue):j==":"?A(Be):j=="spread"?A(Ue):I(Be)}function Et(j,Z){if(Z=="<")return A(ve(">"),Xe(Be,">"),de,Et);if(Z=="|"||j=="."||Z=="&")return A(Be);if(j=="[")return A(Be,ke("]"),Et);if(Z=="extends"||Z=="implements")return W.marked="keyword",A(Be);if(Z=="?")return A(Be,ke(":"),Be)}function pt(j,Z){if(Z=="<")return A(ve(">"),Xe(Be,">"),de,Et)}function Ot(){return I(Be,tt)}function tt(j,Z){if(Z=="=")return A(Be)}function Tr(j,Z){return Z=="enum"?(W.marked="keyword",A(Le)):I(lt,ur,Dt,ci)}function lt(j,Z){if(g&&G(Z))return W.marked="keyword",A(lt);if(j=="variable")return F(Z),A();if(j=="spread")return A(lt);if(j=="[")return Sr(Wr,"]");if(j=="{")return Sr(hr,"}")}function hr(j,Z){return j=="variable"&&!W.stream.match(/^\s*:/,!1)?(F(Z),A(Dt)):(j=="variable"&&(W.marked="property"),j=="spread"?A(lt):j=="}"?I():j=="["?A(ge,ke("]"),ke(":"),hr):A(ke(":"),lt,Dt))}function Wr(){return I(lt,Dt)}function Dt(j,Z){if(Z=="=")return A(le)}function ci(j){if(j==",")return A(Tr)}function Ar(j,Z){if(j=="keyword b"&&Z=="else")return A(ve("form","else"),$,de)}function $r(j,Z){if(Z=="await")return A($r);if(j=="(")return A(ve(")"),Nr,de)}function Nr(j){return j=="var"?A(Tr,dr):j=="variable"?A(dr):I(dr)}function dr(j,Z){return j==")"?A():j==";"?A(dr):Z=="in"||Z=="of"?(W.marked="keyword",A(ge,dr)):I(ge,dr)}function Tt(j,Z){if(Z=="*")return W.marked="keyword",A(Tt);if(j=="variable")return F(Z),A(Tt);if(j=="(")return A(fe,ve(")"),Xe(Bt,")"),de,fr,$,q);if(g&&Z=="<")return A(ve(">"),Xe(Ot,">"),de,Tt)}function pr(j,Z){if(Z=="*")return W.marked="keyword",A(pr);if(j=="variable")return F(Z),A(pr);if(j=="(")return A(fe,ve(")"),Xe(Bt,")"),de,fr,q);if(g&&Z=="<")return A(ve(">"),Xe(Ot,">"),de,pr)}function Jr(j,Z){if(j=="keyword"||j=="variable")return W.marked="type",A(Jr);if(Z=="<")return A(ve(">"),Xe(Ot,">"),de)}function Bt(j,Z){return Z=="@"&&A(ge,Bt),j=="spread"?A(Bt):g&&G(Z)?(W.marked="keyword",A(Bt)):g&&j=="this"?A(ur,Dt):I(lt,ur,Dt)}function ui(j,Z){return j=="variable"?Mr(j,Z):Pt(j,Z)}function Mr(j,Z){if(j=="variable")return F(Z),A(Pt)}function Pt(j,Z){if(Z=="<")return A(ve(">"),Xe(Ot,">"),de,Pt);if(Z=="extends"||Z=="implements"||g&&j==",")return Z=="implements"&&(W.marked="keyword"),A(g?Be:ge,Pt);if(j=="{")return A(ve("}"),It,de)}function It(j,Z){if(j=="async"||j=="variable"&&(Z=="static"||Z=="get"||Z=="set"||g&&G(Z))&&W.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return W.marked="keyword",A(It);if(j=="variable"||W.style=="keyword")return W.marked="property",A(wr,It);if(j=="number"||j=="string")return A(wr,It);if(j=="[")return A(ge,ur,ke("]"),wr,It);if(Z=="*")return W.marked="keyword",A(It);if(g&&j=="(")return I(pr,It);if(j==";"||j==",")return A(It);if(j=="}")return A();if(Z=="@")return A(ge,It)}function wr(j,Z){if(Z=="!"||Z=="?")return A(wr);if(j==":")return A(Be,Dt);if(Z=="=")return A(le);var ae=W.state.lexical.prev,he=ae&&ae.info=="interface";return I(he?pr:Tt)}function Rr(j,Z){return Z=="*"?(W.marked="keyword",A(Br,ke(";"))):Z=="default"?(W.marked="keyword",A(ge,ke(";"))):j=="{"?A(Xe(Or,"}"),Br,ke(";")):I($)}function Or(j,Z){if(Z=="as")return W.marked="keyword",A(ke("variable"));if(j=="variable")return I(le,Or)}function vr(j){return j=="string"?A():j=="("?I(ge):j=="."?I(xe):I(Dr,zt,Br)}function Dr(j,Z){return j=="{"?Sr(Dr,"}"):(j=="variable"&&F(Z),Z=="*"&&(W.marked="keyword"),A(jr))}function zt(j){if(j==",")return A(Dr,zt)}function jr(j,Z){if(Z=="as")return W.marked="keyword",A(Dr)}function Br(j,Z){if(Z=="from")return W.marked="keyword",A(ge)}function qe(j){return j=="]"?A():I(Xe(le,"]"))}function Le(){return I(ve("form"),lt,ke("{"),ve("}"),Xe(tr,"}"),de,de)}function tr(){return I(lt,Dt)}function zr(j,Z){return j.lastType=="operator"||j.lastType==","||u.test(Z.charAt(0))||/[,.]/.test(Z.charAt(0))}function Lt(j,Z,ae){return Z.tokenize==l&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(Z.lastType)||Z.lastType=="quasi"&&/\{\s*$/.test(j.string.slice(0,j.pos-(ae||0)))}return{startState:function(j){var Z={tokenize:l,lastType:"sof",cc:[],lexical:new E((j||0)-f,0,"block",!1),localVars:R.localVars,context:R.localVars&&new te(null,null,!1),indented:j||0};return R.globalVars&&typeof R.globalVars=="object"&&(Z.globalVars=R.globalVars),Z},token:function(j,Z){if(j.sol()&&(Z.lexical.hasOwnProperty("align")||(Z.lexical.align=!1),Z.indented=j.indentation(),S(j,Z)),Z.tokenize!=a&&j.eatSpace())return null;var ae=Z.tokenize(j,Z);return b=="comment"?ae:(Z.lastType=b=="operator"&&(c=="++"||c=="--")?"incdec":b,D(Z,ae,b,c,j))},indent:function(j,Z){if(j.tokenize==a||j.tokenize==h)return U.Pass;if(j.tokenize!=l)return 0;var ae=Z&&Z.charAt(0),he=j.lexical,ie;if(!/^\s*else\b/.test(Z))for(var be=j.cc.length-1;be>=0;--be){var He=j.cc[be];if(He==de)he=he.prev;else if(He!=Ar&&He!=q)break}for(;(he.type=="stat"||he.type=="form")&&(ae=="}"||(ie=j.cc[j.cc.length-1])&&(ie==xe||ie==Ee)&&!/^[,\.=+\-*:?[\(]/.test(Z));)he=he.prev;k&&he.type==")"&&he.prev.type=="stat"&&(he=he.prev);var Je=he.type,vt=ae==Je;return Je=="vardef"?he.indented+(j.lastType=="operator"||j.lastType==","?he.info.length+1:0):Je=="form"&&ae=="{"?he.indented:Je=="form"?he.indented+f:Je=="stat"?he.indented+(zr(j,Z)?k||f:0):he.info=="switch"&&!vt&&R.doubleIndentSwitch!=!1?he.indented+(/^(?:case|default)\b/.test(Z)?f:2*f):he.align?he.column+(vt?0:1):he.indented+(vt?0:f)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:y?null:"/*",blockCommentEnd:y?null:"*/",blockCommentContinue:y?null:" * ",lineComment:y?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:y?"json":"javascript",jsonldMode:m,jsonMode:y,expressionAllowed:Lt,skipExpression:function(j){D(j,"atom","atom","true",new U.StringStream("",2,null))}}}),U.registerHelper("wordChars","javascript",/[\w$]/),U.defineMIME("text/javascript","javascript"),U.defineMIME("text/ecmascript","javascript"),U.defineMIME("application/javascript","javascript"),U.defineMIME("application/x-javascript","javascript"),U.defineMIME("application/ecmascript","javascript"),U.defineMIME("application/json",{name:"javascript",json:!0}),U.defineMIME("application/x-json",{name:"javascript",json:!0}),U.defineMIME("application/manifest+json",{name:"javascript",json:!0}),U.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),U.defineMIME("text/typescript",{name:"javascript",typescript:!0}),U.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var $l=Nt((Yl,Vl)=>{(function(U){typeof Yl=="object"&&typeof Vl=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){"use strict";function B(g){for(var x={},C=0,u=g.length;C]/)?(n.eat(/[\<\>]/),"atom"):n.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":n.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(n.eatWhile(/[\w$\xa1-\uffff]/),n.eat(/[\?\!\=]/),"atom"):"operator";if(h=="@"&&n.match(/^@?[a-zA-Z_\xa1-\uffff]/))return n.eat("@"),n.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if(h=="$")return n.eat(/[a-zA-Z_]/)?n.eatWhile(/[\w]/):n.eat(/\d/)?n.eat(/\d/):n.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(h))return n.eatWhile(/[\w\xa1-\uffff]/),n.eat(/[\?\!]/),n.eat(":")?"atom":"ident";if(h=="|"&&(a.varList||a.lastTok=="{"||a.lastTok=="do"))return x="|",null;if(/[\(\)\[\]{}\\;]/.test(h))return x=h,null;if(h=="-"&&n.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(h)){var M=n.eatWhile(/[=+\-\/*:\.^%<>~|]/);return h=="."&&!M&&(x="."),"operator"}else return null}}}function p(n){for(var a=n.pos,h=0,d,S=!1,T=!1;(d=n.next())!=null;)if(T)T=!1;else{if("[{(".indexOf(d)>-1)h++;else if("]})".indexOf(d)>-1){if(h--,h<0)break}else if(d=="/"&&h==0){S=!0;break}T=d=="\\"}return n.backUp(n.pos-a),S}function w(n){return n||(n=1),function(a,h){if(a.peek()=="}"){if(n==1)return h.tokenize.pop(),h.tokenize[h.tokenize.length-1](a,h);h.tokenize[h.tokenize.length-1]=w(n-1)}else a.peek()=="{"&&(h.tokenize[h.tokenize.length-1]=w(n+1));return u(a,h)}}function b(){var n=!1;return function(a,h){return n?(h.tokenize.pop(),h.tokenize[h.tokenize.length-1](a,h)):(n=!0,u(a,h))}}function c(n,a,h,d){return function(S,T){var E=!1,M;for(T.context.type==="read-quoted-paused"&&(T.context=T.context.prev,S.eat("}"));(M=S.next())!=null;){if(M==n&&(d||!E)){T.tokenize.pop();break}if(h&&M=="#"&&!E){if(S.eat("{")){n=="}"&&(T.context={prev:T.context,type:"read-quoted-paused"}),T.tokenize.push(w());break}else if(/[@\$]/.test(S.peek())){T.tokenize.push(b());break}}E=!E&&M=="\\"}return a}}function o(n,a){return function(h,d){return a&&h.eatSpace(),h.match(n)?d.tokenize.pop():h.skipToEnd(),"string"}}function l(n,a){return n.sol()&&n.match("=end")&&n.eol()&&a.tokenize.pop(),n.skipToEnd(),"comment"}return{startState:function(){return{tokenize:[u],indented:0,context:{type:"top",indented:-g.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(n,a){x=null,n.sol()&&(a.indented=n.indentation());var h=a.tokenize[a.tokenize.length-1](n,a),d,S=x;if(h=="ident"){var T=n.current();h=a.lastTok=="."?"property":f.propertyIsEnumerable(n.current())?"keyword":/^[A-Z]/.test(T)?"tag":a.lastTok=="def"||a.lastTok=="class"||a.varList?"def":"variable",h=="keyword"&&(S=T,k.propertyIsEnumerable(T)?d="indent":m.propertyIsEnumerable(T)?d="dedent":((T=="if"||T=="unless")&&n.column()==n.indentation()||T=="do"&&a.context.indented{(function(U){typeof Ql=="object"&&typeof ec=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){"use strict";U.defineMode("perl",function(){var m={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,if:[1,1],elsif:[1,1],else:[1,1],while:[1,1],unless:[1,1],for:[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,break:1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,continue:[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,default:1,defined:1,delete:1,die:1,do:1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,goto:1,grep:1,hex:1,import:1,index:1,int:1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,new:1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,package:1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,return:1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},y="string-2",_=/[goseximacplud]/;function g(u,p,w,b,c){return p.chain=null,p.style=null,p.tail=null,p.tokenize=function(o,l){for(var n=!1,a,h=0;a=o.next();){if(a===w[h]&&!n)return w[++h]!==void 0?(l.chain=w[h],l.style=b,l.tail=c):c&&o.eatWhile(c),l.tokenize=C,b;n=!n&&a=="\\"}return b},p.tokenize(u,p)}function x(u,p,w){return p.tokenize=function(b,c){return b.string==w&&(c.tokenize=C),b.skipToEnd(),"string"},p.tokenize(u,p)}function C(u,p){if(u.eatSpace())return null;if(p.chain)return g(u,p,p.chain,p.style,p.tail);if(u.match(/^(\-?((\d[\d_]*)?\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F_]+|0b[01_]+|\d[\d_]*(e[+-]?\d+)?)/))return"number";if(u.match(/^<<(?=[_a-zA-Z])/))return u.eatWhile(/\w/),x(u,p,u.current().substr(2));if(u.sol()&&u.match(/^\=item(?!\w)/))return x(u,p,"=cut");var w=u.next();if(w=='"'||w=="'"){if(R(u,3)=="<<"+w){var b=u.pos;u.eatWhile(/\w/);var c=u.current().substr(1);if(c&&u.eat(w))return x(u,p,c);u.pos=b}return g(u,p,[w],"string")}if(w=="q"){var o=B(u,-2);if(!(o&&/\w/.test(o))){if(o=B(u,0),o=="x"){if(o=B(u,1),o=="(")return k(u,2),g(u,p,[")"],y,_);if(o=="[")return k(u,2),g(u,p,["]"],y,_);if(o=="{")return k(u,2),g(u,p,["}"],y,_);if(o=="<")return k(u,2),g(u,p,[">"],y,_);if(/[\^'"!~\/]/.test(o))return k(u,1),g(u,p,[u.eat(o)],y,_)}else if(o=="q"){if(o=B(u,1),o=="(")return k(u,2),g(u,p,[")"],"string");if(o=="[")return k(u,2),g(u,p,["]"],"string");if(o=="{")return k(u,2),g(u,p,["}"],"string");if(o=="<")return k(u,2),g(u,p,[">"],"string");if(/[\^'"!~\/]/.test(o))return k(u,1),g(u,p,[u.eat(o)],"string")}else if(o=="w"){if(o=B(u,1),o=="(")return k(u,2),g(u,p,[")"],"bracket");if(o=="[")return k(u,2),g(u,p,["]"],"bracket");if(o=="{")return k(u,2),g(u,p,["}"],"bracket");if(o=="<")return k(u,2),g(u,p,[">"],"bracket");if(/[\^'"!~\/]/.test(o))return k(u,1),g(u,p,[u.eat(o)],"bracket")}else if(o=="r"){if(o=B(u,1),o=="(")return k(u,2),g(u,p,[")"],y,_);if(o=="[")return k(u,2),g(u,p,["]"],y,_);if(o=="{")return k(u,2),g(u,p,["}"],y,_);if(o=="<")return k(u,2),g(u,p,[">"],y,_);if(/[\^'"!~\/]/.test(o))return k(u,1),g(u,p,[u.eat(o)],y,_)}else if(/[\^'"!~\/(\[{<]/.test(o)){if(o=="(")return k(u,1),g(u,p,[")"],"string");if(o=="[")return k(u,1),g(u,p,["]"],"string");if(o=="{")return k(u,1),g(u,p,["}"],"string");if(o=="<")return k(u,1),g(u,p,[">"],"string");if(/[\^'"!~\/]/.test(o))return g(u,p,[u.eat(o)],"string")}}}if(w=="m"){var o=B(u,-2);if(!(o&&/\w/.test(o))&&(o=u.eat(/[(\[{<\^'"!~\/]/),o)){if(/[\^'"!~\/]/.test(o))return g(u,p,[o],y,_);if(o=="(")return g(u,p,[")"],y,_);if(o=="[")return g(u,p,["]"],y,_);if(o=="{")return g(u,p,["}"],y,_);if(o=="<")return g(u,p,[">"],y,_)}}if(w=="s"){var o=/[\/>\]})\w]/.test(B(u,-2));if(!o&&(o=u.eat(/[(\[{<\^'"!~\/]/),o))return o=="["?g(u,p,["]","]"],y,_):o=="{"?g(u,p,["}","}"],y,_):o=="<"?g(u,p,[">",">"],y,_):o=="("?g(u,p,[")",")"],y,_):g(u,p,[o,o],y,_)}if(w=="y"){var o=/[\/>\]})\w]/.test(B(u,-2));if(!o&&(o=u.eat(/[(\[{<\^'"!~\/]/),o))return o=="["?g(u,p,["]","]"],y,_):o=="{"?g(u,p,["}","}"],y,_):o=="<"?g(u,p,[">",">"],y,_):o=="("?g(u,p,[")",")"],y,_):g(u,p,[o,o],y,_)}if(w=="t"){var o=/[\/>\]})\w]/.test(B(u,-2));if(!o&&(o=u.eat("r"),o&&(o=u.eat(/[(\[{<\^'"!~\/]/),o)))return o=="["?g(u,p,["]","]"],y,_):o=="{"?g(u,p,["}","}"],y,_):o=="<"?g(u,p,[">",">"],y,_):o=="("?g(u,p,[")",")"],y,_):g(u,p,[o,o],y,_)}if(w=="`")return g(u,p,[w],"variable-2");if(w=="/")return/~\s*$/.test(R(u))?g(u,p,[w],y,_):"operator";if(w=="$"){var b=u.pos;if(u.eatWhile(/\d/)||u.eat("{")&&u.eatWhile(/\d/)&&u.eat("}"))return"variable-2";u.pos=b}if(/[$@%]/.test(w)){var b=u.pos;if(u.eat("^")&&u.eat(/[A-Z]/)||!/[@$%&]/.test(B(u,-2))&&u.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var o=u.current();if(m[o])return"variable-2"}u.pos=b}if(/[$@%&]/.test(w)&&(u.eatWhile(/[\w$]/)||u.eat("{")&&u.eatWhile(/[\w$]/)&&u.eat("}"))){var o=u.current();return m[o]?"variable-2":"variable"}if(w=="#"&&B(u,-2)!="$")return u.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(w)){var b=u.pos;if(u.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),m[u.current()])return"operator";u.pos=b}if(w=="_"&&u.pos==1){if(f(u,6)=="_END__")return g(u,p,["\0"],"comment");if(f(u,7)=="_DATA__")return g(u,p,["\0"],"variable-2");if(f(u,7)=="_C__")return g(u,p,["\0"],"string")}if(/\w/.test(w)){var b=u.pos;if(B(u,-2)=="{"&&(B(u,0)=="}"||u.eatWhile(/\w/)&&B(u,0)=="}"))return"string";u.pos=b}if(/[A-Z]/.test(w)){var l=B(u,-2),b=u.pos;if(u.eatWhile(/[A-Z_]/),/[\da-z]/.test(B(u,0)))u.pos=b;else{var o=m[u.current()];return o?(o[1]&&(o=o[0]),l!=":"?o==1?"keyword":o==2?"def":o==3?"atom":o==4?"operator":o==5?"variable-2":"meta":"meta"):"meta"}}if(/[a-zA-Z_]/.test(w)){var l=B(u,-2);u.eatWhile(/\w/);var o=m[u.current()];return o?(o[1]&&(o=o[0]),l!=":"?o==1?"keyword":o==2?"def":o==3?"atom":o==4?"operator":o==5?"variable-2":"meta":"meta"):"meta"}return null}return{startState:function(){return{tokenize:C,chain:null,style:null,tail:null}},token:function(u,p){return(p.tokenize||C)(u,p)},lineComment:"#"}}),U.registerHelper("wordChars","perl",/[\w$]/),U.defineMIME("text/x-perl","perl");function B(m,y){return m.string.charAt(m.pos+(y||0))}function R(m,y){if(y){var _=m.pos-y;return m.string.substr(_>=0?_:0,y)}else return m.string.substr(0,m.pos-1)}function f(m,y){var _=m.string.length,g=_-m.pos+1;return m.string.substr(m.pos,y&&y<_?y:g)}function k(m,y){var _=m.pos+y,g;_<=0?m.pos=0:_>=(g=m.string.length-1)?m.pos=g:m.pos=_}})});var oc=Nt(oi=>{"use strict";var So=oi&&oi.__assign||function(){return So=Object.assign||function(U){for(var B,R=1,f=arguments.length;R0&&R.hide()}),this.element.classList.remove(this.toastShowClass),this.element.classList.add(this.toastHideClass),this.trigger("hide"),this.animation){var f=function(){return R.remove()},k=function(){y||(R.element.addEventListener("transitionend",function(){return f()}),y=!0)},m=function(){R.show(),R.element.removeEventListener("transitionstart",function(){return k()}),R.element.removeEventListener("transitionend",function(){return f()}),R.element.removeEventListener("mouseover",function(){return m()}),R.element.addEventListener("mouseout",function(){return R.hide()})},y=!1;this.element.addEventListener("mouseover",function(){return m()}),this.element.addEventListener("transitionstart",function(){return k()});return}this.remove()}},U.prototype.remove=function(){this.element.parentNode===this.container&&(this.container.removeChild(this.element),this.trigger("remove"))},U.prototype.buildClose=function(B){var R=this,f=document.createElement("button");return f.setAttribute("title",B),f.appendChild(document.createTextNode(B)),f.addEventListener("click",function(){return R.hide()}),f},U.prototype.getContainer=function(B){var R=B.containerClass,f=B.containerElement,k=B.root,m=k.querySelector("".concat(f,".").concat(R));if(m)return m;var y=document.createElement(f);return y.classList.add(R),k.appendChild(y),y},U.prototype.on=function(B,R){this.events[B]||(this.events[B]=[]),this.events[B].push(R)},U.prototype.off=function(B,R){if(R===void 0&&(R=null),!R){this.events[B]=[];return}var f=this.events[B].indexOf(R);f===-1&&this.events[B].splice(f,1)},U.prototype.trigger=function(B){for(var R=this,f=[],k=1;k{(function(U,B){if(typeof Eo=="object"&&typeof Gs=="object")Gs.exports=B();else if(typeof define=="function"&&define.amd)define([],B);else{var R=B();for(var f in R)(typeof Eo=="object"?Eo:U)[f]=R[f]}})(self,function(){return(()=>{"use strict";var U={4567:function(R,f,k){var m,y=this&&this.__extends||(m=function(c,o){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,n){l.__proto__=n}||function(l,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(l[a]=n[a])},m(c,o)},function(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function l(){this.constructor=c}m(c,o),c.prototype=o===null?Object.create(o):(l.prototype=o.prototype,new l)});Object.defineProperty(f,"__esModule",{value:!0}),f.AccessibilityManager=void 0;var _=k(9042),g=k(6114),x=k(9924),C=k(3656),u=k(844),p=k(5596),w=k(9631),b=function(c){function o(l,n){var a=c.call(this)||this;a._terminal=l,a._renderService=n,a._liveRegionLineCount=0,a._charsToConsume=[],a._charsToAnnounce="",a._accessibilityTreeRoot=document.createElement("div"),a._accessibilityTreeRoot.classList.add("xterm-accessibility"),a._accessibilityTreeRoot.tabIndex=0,a._rowContainer=document.createElement("div"),a._rowContainer.setAttribute("role","list"),a._rowContainer.classList.add("xterm-accessibility-tree"),a._rowElements=[];for(var h=0;hl;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},o.prototype._createAccessibilityTreeNode=function(){var l=document.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l},o.prototype._onTab=function(l){for(var n=0;n0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=_.tooMuchOutput)),g.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){n._accessibilityTreeRoot.appendChild(n._liveRegion)},0))},o.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,g.isMac&&(0,w.removeElementFromParent)(this._liveRegion)},o.prototype._onKey=function(l){this._clearLiveRegion(),this._charsToConsume.push(l)},o.prototype._refreshRows=function(l,n){this._renderRowsDebouncer.refresh(l,n,this._terminal.rows)},o.prototype._renderRows=function(l,n){for(var a=this._terminal.buffer,h=a.lines.length.toString(),d=l;d<=n;d++){var S=a.translateBufferLineToString(a.ydisp+d,!0),T=(a.ydisp+d+1).toString(),E=this._rowElements[d];E&&(S.length===0?E.innerText="\xA0":E.textContent=S,E.setAttribute("aria-posinset",T),E.setAttribute("aria-setsize",h))}this._announceCharacters()},o.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var l=0;l{function k(g){return g.replace(/\r?\n/g,"\r")}function m(g,x){return x?"\x1B[200~"+g+"\x1B[201~":g}function y(g,x,C){g=m(g=k(g),C.decPrivateModes.bracketedPasteMode),C.triggerDataEvent(g,!0),x.value=""}function _(g,x,C){var u=C.getBoundingClientRect(),p=g.clientX-u.left-10,w=g.clientY-u.top-10;x.style.width="20px",x.style.height="20px",x.style.left=p+"px",x.style.top=w+"px",x.style.zIndex="1000",x.focus()}Object.defineProperty(f,"__esModule",{value:!0}),f.rightClickHandler=f.moveTextAreaUnderMouseCursor=f.paste=f.handlePasteEvent=f.copyHandler=f.bracketTextForPaste=f.prepareTextForTerminal=void 0,f.prepareTextForTerminal=k,f.bracketTextForPaste=m,f.copyHandler=function(g,x){g.clipboardData&&g.clipboardData.setData("text/plain",x.selectionText),g.preventDefault()},f.handlePasteEvent=function(g,x,C){g.stopPropagation(),g.clipboardData&&y(g.clipboardData.getData("text/plain"),x,C)},f.paste=y,f.moveTextAreaUnderMouseCursor=_,f.rightClickHandler=function(g,x,C,u,p){_(g,x,C),p&&u.rightClickSelect(g),x.value=u.selectionText,x.select()}},7239:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ColorContrastCache=void 0;var k=function(){function m(){this._color={},this._rgba={}}return m.prototype.clear=function(){this._color={},this._rgba={}},m.prototype.setCss=function(y,_,g){this._rgba[y]||(this._rgba[y]={}),this._rgba[y][_]=g},m.prototype.getCss=function(y,_){return this._rgba[y]?this._rgba[y][_]:void 0},m.prototype.setColor=function(y,_,g){this._color[y]||(this._color[y]={}),this._color[y][_]=g},m.prototype.getColor=function(y,_){return this._color[y]?this._color[y][_]:void 0},m}();f.ColorContrastCache=k},5680:function(R,f,k){var m=this&&this.__read||function(b,c){var o=typeof Symbol=="function"&&b[Symbol.iterator];if(!o)return b;var l,n,a=o.call(b),h=[];try{for(;(c===void 0||c-- >0)&&!(l=a.next()).done;)h.push(l.value)}catch(d){n={error:d}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return h};Object.defineProperty(f,"__esModule",{value:!0}),f.ColorManager=f.DEFAULT_ANSI_COLORS=void 0;var y=k(8055),_=k(7239),g=y.css.toColor("#ffffff"),x=y.css.toColor("#000000"),C=y.css.toColor("#ffffff"),u=y.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};f.DEFAULT_ANSI_COLORS=Object.freeze(function(){for(var b=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],c=[0,95,135,175,215,255],o=0;o<216;o++){var l=c[o/36%6|0],n=c[o/6%6|0],a=c[o%6];b.push({css:y.channels.toCss(l,n,a),rgba:y.channels.toRgba(l,n,a)})}for(o=0;o<24;o++){var h=8+10*o;b.push({css:y.channels.toCss(h,h,h),rgba:y.channels.toRgba(h,h,h)})}return b}());var w=function(){function b(c,o){this.allowTransparency=o;var l=c.createElement("canvas");l.width=1,l.height=1;var n=l.getContext("2d");if(!n)throw new Error("Could not get rendering context");this._ctx=n,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new _.ColorContrastCache,this.colors={foreground:g,background:x,cursor:C,cursorAccent:u,selectionTransparent:p,selectionOpaque:y.color.blend(x,p),selectionForeground:void 0,ansi:f.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}return b.prototype.onOptionsChange=function(c){c==="minimumContrastRatio"&&this._contrastCache.clear()},b.prototype.setTheme=function(c){c===void 0&&(c={}),this.colors.foreground=this._parseColor(c.foreground,g),this.colors.background=this._parseColor(c.background,x),this.colors.cursor=this._parseColor(c.cursor,C,!0),this.colors.cursorAccent=this._parseColor(c.cursorAccent,u,!0),this.colors.selectionTransparent=this._parseColor(c.selection,p,!0),this.colors.selectionOpaque=y.color.blend(this.colors.background,this.colors.selectionTransparent);var o={css:"",rgba:0};this.colors.selectionForeground=c.selectionForeground?this._parseColor(c.selectionForeground,o):void 0,this.colors.selectionForeground===o&&(this.colors.selectionForeground=void 0),y.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=y.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(c.black,f.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(c.red,f.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(c.green,f.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(c.yellow,f.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(c.blue,f.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(c.magenta,f.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(c.cyan,f.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(c.white,f.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(c.brightBlack,f.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(c.brightRed,f.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(c.brightGreen,f.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(c.brightYellow,f.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(c.brightBlue,f.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(c.brightMagenta,f.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(c.brightCyan,f.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(c.brightWhite,f.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear(),this._updateRestoreColors()},b.prototype.restoreColor=function(c){if(c!==void 0)switch(c){case 256:this.colors.foreground=this._restoreColors.foreground;break;case 257:this.colors.background=this._restoreColors.background;break;case 258:this.colors.cursor=this._restoreColors.cursor;break;default:this.colors.ansi[c]=this._restoreColors.ansi[c]}else for(var o=0;o=m.length&&(m=void 0),{value:m&&m[g++],done:!m}}};throw new TypeError(y?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.removeElementFromParent=void 0,f.removeElementFromParent=function(){for(var m,y,_,g=[],x=0;x{Object.defineProperty(f,"__esModule",{value:!0}),f.addDisposableDomListener=void 0,f.addDisposableDomListener=function(k,m,y,_){k.addEventListener(m,y,_);var g=!1;return{dispose:function(){g||(g=!0,k.removeEventListener(m,y,_))}}}},3551:function(R,f,k){var m=this&&this.__decorate||function(u,p,w,b){var c,o=arguments.length,l=o<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(u,p,w,b);else for(var n=u.length-1;n>=0;n--)(c=u[n])&&(l=(o<3?c(l):o>3?c(p,w,l):c(p,w))||l);return o>3&&l&&Object.defineProperty(p,w,l),l},y=this&&this.__param||function(u,p){return function(w,b){p(w,b,u)}};Object.defineProperty(f,"__esModule",{value:!0}),f.MouseZone=f.Linkifier=void 0;var _=k(8460),g=k(2585),x=function(){function u(p,w,b){this._bufferService=p,this._logService=w,this._unicodeService=b,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new _.EventEmitter,this._onHideLinkUnderline=new _.EventEmitter,this._onLinkTooltip=new _.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(u.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),u.prototype.attachToDom=function(p,w){this._element=p,this._mouseZoneManager=w},u.prototype.linkifyRows=function(p,w){var b=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=p,this._rowsToLinkify.end=w):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,p),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,w)),this._mouseZoneManager.clearAll(p,w),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return b._linkifyRows()},u._timeBeforeLatency))},u.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var p=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var w=p.ydisp+this._rowsToLinkify.start;if(!(w>=p.lines.length)){for(var b=p.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,c=Math.ceil(2e3/this._bufferService.cols),o=this._bufferService.buffer.iterator(!1,w,b,c,c);o.hasNext();)for(var l=o.next(),n=0;n=0;w--)if(p.priority<=this._linkMatchers[w].priority)return void this._linkMatchers.splice(w+1,0,p);this._linkMatchers.splice(0,0,p)}else this._linkMatchers.push(p)},u.prototype.deregisterLinkMatcher=function(p){for(var w=0;w>9&511:void 0;b.validationCallback?b.validationCallback(d,function(D){o._rowsTimeoutId||D&&o._addLink(S[1],S[0]-o._bufferService.buffer.ydisp,d,b,M)}):h._addLink(S[1],S[0]-h._bufferService.buffer.ydisp,d,b,M)},h=this;(c=l.exec(w))!==null&&a()!=="break";);},u.prototype._addLink=function(p,w,b,c,o){var l=this;if(this._mouseZoneManager&&this._element){var n=this._unicodeService.getStringCellWidth(b),a=p%this._bufferService.cols,h=w+Math.floor(p/this._bufferService.cols),d=(a+n)%this._bufferService.cols,S=h+Math.floor((a+n)/this._bufferService.cols);d===0&&(d=this._bufferService.cols,S--),this._mouseZoneManager.add(new C(a+1,h+1,d+1,S+1,function(T){if(c.handler)return c.handler(T,b);var E=window.open();E?(E.opener=null,E.location.href=b):console.warn("Opening link blocked as opener could not be cleared")},function(){l._onShowLinkUnderline.fire(l._createLinkHoverEvent(a,h,d,S,o)),l._element.classList.add("xterm-cursor-pointer")},function(T){l._onLinkTooltip.fire(l._createLinkHoverEvent(a,h,d,S,o)),c.hoverTooltipCallback&&c.hoverTooltipCallback(T,b,{start:{x:a,y:h},end:{x:d,y:S}})},function(){l._onHideLinkUnderline.fire(l._createLinkHoverEvent(a,h,d,S,o)),l._element.classList.remove("xterm-cursor-pointer"),c.hoverLeaveCallback&&c.hoverLeaveCallback()},function(T){return!c.willLinkActivate||c.willLinkActivate(T,b)}))}},u.prototype._createLinkHoverEvent=function(p,w,b,c,o){return{x1:p,y1:w,x2:b,y2:c,cols:this._bufferService.cols,fg:o}},u._timeBeforeLatency=200,u=m([y(0,g.IBufferService),y(1,g.ILogService),y(2,g.IUnicodeService)],u)}();f.Linkifier=x;var C=function(u,p,w,b,c,o,l,n,a){this.x1=u,this.y1=p,this.x2=w,this.y2=b,this.clickCallback=c,this.hoverCallback=o,this.tooltipCallback=l,this.leaveCallback=n,this.willLinkActivate=a};f.MouseZone=C},6465:function(R,f,k){var m,y=this&&this.__extends||(m=function(o,l){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var h in a)Object.prototype.hasOwnProperty.call(a,h)&&(n[h]=a[h])},m(o,l)},function(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function n(){this.constructor=o}m(o,l),o.prototype=l===null?Object.create(l):(n.prototype=l.prototype,new n)}),_=this&&this.__decorate||function(o,l,n,a){var h,d=arguments.length,S=d<3?l:a===null?a=Object.getOwnPropertyDescriptor(l,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,l,n,a);else for(var T=o.length-1;T>=0;T--)(h=o[T])&&(S=(d<3?h(S):d>3?h(l,n,S):h(l,n))||S);return d>3&&S&&Object.defineProperty(l,n,S),S},g=this&&this.__param||function(o,l){return function(n,a){l(n,a,o)}},x=this&&this.__values||function(o){var l=typeof Symbol=="function"&&Symbol.iterator,n=l&&o[l],a=0;if(n)return n.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&a>=o.length&&(o=void 0),{value:o&&o[a++],done:!o}}};throw new TypeError(l?"Object is not iterable.":"Symbol.iterator is not defined.")},C=this&&this.__read||function(o,l){var n=typeof Symbol=="function"&&o[Symbol.iterator];if(!n)return o;var a,h,d=n.call(o),S=[];try{for(;(l===void 0||l-- >0)&&!(a=d.next()).done;)S.push(a.value)}catch(T){h={error:T}}finally{try{a&&!a.done&&(n=d.return)&&n.call(d)}finally{if(h)throw h.error}}return S};Object.defineProperty(f,"__esModule",{value:!0}),f.Linkifier2=void 0;var u=k(2585),p=k(8460),w=k(844),b=k(3656),c=function(o){function l(n){var a=o.call(this)||this;return a._bufferService=n,a._linkProviders=[],a._linkCacheDisposables=[],a._isMouseOut=!0,a._activeLine=-1,a._onShowLinkUnderline=a.register(new p.EventEmitter),a._onHideLinkUnderline=a.register(new p.EventEmitter),a.register((0,w.getDisposeArrayDisposable)(a._linkCacheDisposables)),a}return y(l,o),Object.defineProperty(l.prototype,"currentLink",{get:function(){return this._currentLink},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),l.prototype.registerLinkProvider=function(n){var a=this;return this._linkProviders.push(n),{dispose:function(){var h=a._linkProviders.indexOf(n);h!==-1&&a._linkProviders.splice(h,1)}}},l.prototype.attachToDom=function(n,a,h){var d=this;this._element=n,this._mouseService=a,this._renderService=h,this.register((0,b.addDisposableDomListener)(this._element,"mouseleave",function(){d._isMouseOut=!0,d._clearCurrentLink()})),this.register((0,b.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,b.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,b.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))},l.prototype._onMouseMove=function(n){if(this._lastMouseEvent=n,this._element&&this._mouseService){var a=this._positionFromMouseEvent(n,this._element,this._mouseService);if(a){this._isMouseOut=!1;for(var h=n.composedPath(),d=0;dn?this._bufferService.cols:E.link.range.end.x,W=M;W<=D;W++){if(h.has(W)){S.splice(T--,1);break}h.add(W)}}},l.prototype._checkLinkProviderResult=function(n,a,h){var d,S=this;if(!this._activeProviderReplies)return h;for(var T=this._activeProviderReplies.get(n),E=!1,M=0;M=n&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))},l.prototype._handleNewLink=function(n){var a=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(n.link,h)&&(this._currentLink=n,this._currentLink.state={decorations:{underline:n.link.decorations===void 0||n.link.decorations.underline,pointerCursor:n.link.decorations===void 0||n.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,n.link,this._lastMouseEvent),n.link.decorations={},Object.defineProperties(n.link.decorations,{pointerCursor:{get:function(){var d,S;return(S=(d=a._currentLink)===null||d===void 0?void 0:d.state)===null||S===void 0?void 0:S.decorations.pointerCursor},set:function(d){var S,T;!((S=a._currentLink)===null||S===void 0)&&S.state&&a._currentLink.state.decorations.pointerCursor!==d&&(a._currentLink.state.decorations.pointerCursor=d,a._currentLink.state.isHovered&&((T=a._element)===null||T===void 0||T.classList.toggle("xterm-cursor-pointer",d)))}},underline:{get:function(){var d,S;return(S=(d=a._currentLink)===null||d===void 0?void 0:d.state)===null||S===void 0?void 0:S.decorations.underline},set:function(d){var S,T,E;!((S=a._currentLink)===null||S===void 0)&&S.state&&((E=(T=a._currentLink)===null||T===void 0?void 0:T.state)===null||E===void 0?void 0:E.decorations.underline)!==d&&(a._currentLink.state.decorations.underline=d,a._currentLink.state.isHovered&&a._fireUnderlineEvent(n.link,d))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(function(d){var S=d.start===0?0:d.start+1+a._bufferService.buffer.ydisp;a._clearCurrentLink(S,d.end+1+a._bufferService.buffer.ydisp)})))}},l.prototype._linkHover=function(n,a,h){var d;!((d=this._currentLink)===null||d===void 0)&&d.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&n.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(h,a.text)},l.prototype._fireUnderlineEvent=function(n,a){var h=n.range,d=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-d-1,h.end.x,h.end.y-d-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)},l.prototype._linkLeave=function(n,a,h){var d;!((d=this._currentLink)===null||d===void 0)&&d.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&n.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(h,a.text)},l.prototype._linkAtPosition=function(n,a){var h=n.range.start.y===n.range.end.y,d=n.range.start.ya.y;return(h&&n.range.start.x<=a.x&&n.range.end.x>=a.x||d&&n.range.end.x>=a.x||S&&n.range.start.x<=a.x||d&&S)&&n.range.start.y<=a.y&&n.range.end.y>=a.y},l.prototype._positionFromMouseEvent=function(n,a,h){var d=h.getCoords(n,a,this._bufferService.cols,this._bufferService.rows);if(d)return{x:d[0],y:d[1]+this._bufferService.buffer.ydisp}},l.prototype._createLinkUnderlineEvent=function(n,a,h,d,S){return{x1:n,y1:a,x2:h,y2:d,cols:this._bufferService.cols,fg:S}},_([g(0,u.IBufferService)],l)}(w.Disposable);f.Linkifier2=c},9042:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.tooMuchOutput=f.promptLabel=void 0,f.promptLabel="Terminal input",f.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},6954:function(R,f,k){var m,y=this&&this.__extends||(m=function(b,c){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(o[n]=l[n])},m(b,c)},function(b,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function o(){this.constructor=b}m(b,c),b.prototype=c===null?Object.create(c):(o.prototype=c.prototype,new o)}),_=this&&this.__decorate||function(b,c,o,l){var n,a=arguments.length,h=a<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(b,c,o,l);else for(var d=b.length-1;d>=0;d--)(n=b[d])&&(h=(a<3?n(h):a>3?n(c,o,h):n(c,o))||h);return a>3&&h&&Object.defineProperty(c,o,h),h},g=this&&this.__param||function(b,c){return function(o,l){c(o,l,b)}};Object.defineProperty(f,"__esModule",{value:!0}),f.MouseZoneManager=void 0;var x=k(844),C=k(3656),u=k(4725),p=k(2585),w=function(b){function c(o,l,n,a,h,d){var S=b.call(this)||this;return S._element=o,S._screenElement=l,S._bufferService=n,S._mouseService=a,S._selectionService=h,S._optionsService=d,S._zones=[],S._areZonesActive=!1,S._lastHoverCoords=[void 0,void 0],S._initialSelectionLength=0,S.register((0,C.addDisposableDomListener)(S._element,"mousedown",function(T){return S._onMouseDown(T)})),S._mouseMoveListener=function(T){return S._onMouseMove(T)},S._mouseLeaveListener=function(T){return S._onMouseLeave(T)},S._clickListener=function(T){return S._onClick(T)},S}return y(c,b),c.prototype.dispose=function(){b.prototype.dispose.call(this),this._deactivate()},c.prototype.add=function(o){this._zones.push(o),this._zones.length===1&&this._activate()},c.prototype.clearAll=function(o,l){if(this._zones.length!==0){o&&l||(o=0,l=this._bufferService.rows-1);for(var n=0;no&&a.y1<=l+1||a.y2>o&&a.y2<=l+1||a.y1l+1)&&(this._currentZone&&this._currentZone===a&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(n--,1))}this._zones.length===0&&this._deactivate()}},c.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},c.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},c.prototype._onMouseMove=function(o){this._lastHoverCoords[0]===o.pageX&&this._lastHoverCoords[1]===o.pageY||(this._onHover(o),this._lastHoverCoords=[o.pageX,o.pageY])},c.prototype._onHover=function(o){var l=this,n=this._findZoneEventAt(o);n!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),n&&(this._currentZone=n,n.hoverCallback&&n.hoverCallback(o),this._tooltipTimeout=window.setTimeout(function(){return l._onTooltip(o)},this._optionsService.rawOptions.linkTooltipHoverDuration)))},c.prototype._onTooltip=function(o){this._tooltipTimeout=void 0;var l=this._findZoneEventAt(o);l?.tooltipCallback(o)},c.prototype._onMouseDown=function(o){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var l=this._findZoneEventAt(o);l?.willLinkActivate(o)&&(o.preventDefault(),o.stopImmediatePropagation())}},c.prototype._onMouseLeave=function(o){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},c.prototype._onClick=function(o){var l=this._findZoneEventAt(o),n=this._getSelectionLength();l&&n===this._initialSelectionLength&&(l.clickCallback(o),o.preventDefault(),o.stopImmediatePropagation())},c.prototype._getSelectionLength=function(){var o=this._selectionService.selectionText;return o?o.length:0},c.prototype._findZoneEventAt=function(o){var l=this._mouseService.getCoords(o,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(l)for(var n=l[0],a=l[1],h=0;h=d.x1&&n=d.x1||a===d.y2&&nd.y1&&a=y.length&&(y=void 0),{value:y&&y[x++],done:!y}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.RenderDebouncer=void 0;var m=function(){function y(_){this._renderCallback=_,this._refreshCallbacks=[]}return y.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},y.prototype.addRefreshCallback=function(_){var g=this;return this._refreshCallbacks.push(_),this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return g._innerRefresh()})),this._animationFrame},y.prototype.refresh=function(_,g,x){var C=this;this._rowCount=x,_=_!==void 0?_:0,g=g!==void 0?g:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,_):_,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,g):g,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return C._innerRefresh()}))},y.prototype._innerRefresh=function(){if(this._animationFrame=void 0,this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var _=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(_,g),this._runRefreshCallbacks()}else this._runRefreshCallbacks()},y.prototype._runRefreshCallbacks=function(){var _,g;try{for(var x=k(this._refreshCallbacks),C=x.next();!C.done;C=x.next())(0,C.value)(0)}catch(u){_={error:u}}finally{try{C&&!C.done&&(g=x.return)&&g.call(x)}finally{if(_)throw _.error}}this._refreshCallbacks=[]},y}();f.RenderDebouncer=m},5596:function(R,f,k){var m,y=this&&this.__extends||(m=function(g,x){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,u){C.__proto__=u}||function(C,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(C[p]=u[p])},m(g,x)},function(g,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function C(){this.constructor=g}m(g,x),g.prototype=x===null?Object.create(x):(C.prototype=x.prototype,new C)});Object.defineProperty(f,"__esModule",{value:!0}),f.ScreenDprMonitor=void 0;var _=function(g){function x(){var C=g!==null&&g.apply(this,arguments)||this;return C._currentDevicePixelRatio=window.devicePixelRatio,C}return y(x,g),x.prototype.setListener=function(C){var u=this;this._listener&&this.clearListener(),this._listener=C,this._outerListener=function(){u._listener&&(u._listener(window.devicePixelRatio,u._currentDevicePixelRatio),u._updateDpr())},this._updateDpr()},x.prototype.dispose=function(){g.prototype.dispose.call(this),this.clearListener()},x.prototype._updateDpr=function(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)===null||C===void 0||C.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},x.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},x}(k(844).Disposable);f.ScreenDprMonitor=_},3236:function(R,f,k){var m,y=this&&this.__extends||(m=function(ge,le){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,Y){V.__proto__=Y}||function(V,Y){for(var se in Y)Object.prototype.hasOwnProperty.call(Y,se)&&(V[se]=Y[se])},m(ge,le)},function(ge,le){if(typeof le!="function"&&le!==null)throw new TypeError("Class extends value "+String(le)+" is not a constructor or null");function V(){this.constructor=ge}m(ge,le),ge.prototype=le===null?Object.create(le):(V.prototype=le.prototype,new V)}),_=this&&this.__values||function(ge){var le=typeof Symbol=="function"&&Symbol.iterator,V=le&&ge[le],Y=0;if(V)return V.call(ge);if(ge&&typeof ge.length=="number")return{next:function(){return ge&&Y>=ge.length&&(ge=void 0),{value:ge&&ge[Y++],done:!ge}}};throw new TypeError(le?"Object is not iterable.":"Symbol.iterator is not defined.")},g=this&&this.__read||function(ge,le){var V=typeof Symbol=="function"&&ge[Symbol.iterator];if(!V)return ge;var Y,se,xe=V.call(ge),Ee=[];try{for(;(le===void 0||le-- >0)&&!(Y=xe.next()).done;)Ee.push(Y.value)}catch(De){se={error:De}}finally{try{Y&&!Y.done&&(V=xe.return)&&V.call(xe)}finally{if(se)throw se.error}}return Ee},x=this&&this.__spreadArray||function(ge,le,V){if(V||arguments.length===2)for(var Y,se=0,xe=le.length;se4)&&Y.coreMouseService.triggerMouseEvent({col:Jt.x-33,row:Jt.y-33,button:$e,action:dt,ctrl:we.ctrlKey,alt:we.altKey,shift:we.shiftKey})}var Ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},De=function(we){return xe(we),we.buttons||(V._document.removeEventListener("mouseup",Ee.mouseup),Ee.mousedrag&&V._document.removeEventListener("mousemove",Ee.mousedrag)),V.cancel(we)},je=function(we){return xe(we),V.cancel(we,!0)},Re=function(we){we.buttons&&xe(we)},Ze=function(we){we.buttons||xe(we)};this.register(this.coreMouseService.onProtocolChange(function(we){we?(V.optionsService.rawOptions.logLevel==="debug"&&V._logService.debug("Binding to mouse events:",V.coreMouseService.explainEvents(we)),V.element.classList.add("enable-mouse-events"),V._selectionService.disable()):(V._logService.debug("Unbinding from mouse events."),V.element.classList.remove("enable-mouse-events"),V._selectionService.enable()),8&we?Ee.mousemove||(se.addEventListener("mousemove",Ze),Ee.mousemove=Ze):(se.removeEventListener("mousemove",Ee.mousemove),Ee.mousemove=null),16&we?Ee.wheel||(se.addEventListener("wheel",je,{passive:!1}),Ee.wheel=je):(se.removeEventListener("wheel",Ee.wheel),Ee.wheel=null),2&we?Ee.mouseup||(Ee.mouseup=De):(V._document.removeEventListener("mouseup",Ee.mouseup),Ee.mouseup=null),4&we?Ee.mousedrag||(Ee.mousedrag=Re):(V._document.removeEventListener("mousemove",Ee.mousedrag),Ee.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,a.addDisposableDomListener)(se,"mousedown",function(we){if(we.preventDefault(),V.focus(),V.coreMouseService.areMouseEventsActive&&!V._selectionService.shouldForceSelection(we))return xe(we),Ee.mouseup&&V._document.addEventListener("mouseup",Ee.mouseup),Ee.mousedrag&&V._document.addEventListener("mousemove",Ee.mousedrag),V.cancel(we)})),this.register((0,a.addDisposableDomListener)(se,"wheel",function(we){if(!Ee.wheel){if(!V.buffer.hasScrollback){var $e=V.viewport.getLinesScrolled(we);if($e===0)return;for(var dt=w.C0.ESC+(V.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(we.deltaY<0?"A":"B"),Jt="",br=0;br=65&&V.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==w.C0.ETX&&se.key!==w.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(V,!0))))},le.prototype._isThirdLevelShift=function(V,Y){var se=V.isMac&&!this.options.macOptionIsMeta&&Y.altKey&&!Y.ctrlKey&&!Y.metaKey||V.isWindows&&Y.altKey&&Y.ctrlKey&&!Y.metaKey||V.isWindows&&Y.getModifierState("AltGraph");return Y.type==="keypress"?se:se&&(!Y.keyCode||Y.keyCode>47)},le.prototype._keyUp=function(V){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1||(function(Y){return Y.keyCode===16||Y.keyCode===17||Y.keyCode===18}(V)||this.focus(),this.updateCursorStyle(V),this._keyPressHandled=!1)},le.prototype._keyPress=function(V){var Y;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;if(this.cancel(V),V.charCode)Y=V.charCode;else if(V.which===null||V.which===void 0)Y=V.keyCode;else{if(V.which===0||V.charCode===0)return!1;Y=V.which}return!(!Y||(V.altKey||V.ctrlKey||V.metaKey)&&!this._isThirdLevelShift(this.browser,V)||(Y=String.fromCharCode(Y),this._onKey.fire({key:Y,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(Y,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))},le.prototype._inputEvent=function(V){if(V.data&&V.inputType==="insertText"&&(!V.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;var Y=V.data;return this.coreService.triggerDataEvent(Y,!0),this.cancel(V),!0}return!1},le.prototype.bell=function(){var V;this._soundBell()&&((V=this._soundService)===null||V===void 0||V.playBellSound()),this._onBell.fire()},le.prototype.resize=function(V,Y){V!==this.cols||Y!==this.rows?ge.prototype.resize.call(this,V,Y):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},le.prototype._afterResize=function(V,Y){var se,xe;(se=this._charSizeService)===null||se===void 0||se.measure(),(xe=this.viewport)===null||xe===void 0||xe.syncScrollArea(!0)},le.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var V=1;V{Object.defineProperty(f,"__esModule",{value:!0}),f.TimeBasedDebouncer=void 0;var k=function(){function m(y,_){_===void 0&&(_=1e3),this._renderCallback=y,this._debounceThresholdMS=_,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}return m.prototype.dispose=function(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)},m.prototype.refresh=function(y,_,g){var x=this;this._rowCount=g,y=y!==void 0?y:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,y):y,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_;var C=Date.now();if(C-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=C,this._innerRefresh();else if(!this._additionalRefreshRequested){var u=C-this._lastRefreshMs,p=this._debounceThresholdMS-u;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(function(){x._lastRefreshMs=Date.now(),x._innerRefresh(),x._additionalRefreshRequested=!1,x._refreshTimeoutID=void 0},p)}},m.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var y=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(y,_)}},m}();f.TimeBasedDebouncer=k},1680:function(R,f,k){var m,y=this&&this.__extends||(m=function(b,c){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(o[n]=l[n])},m(b,c)},function(b,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function o(){this.constructor=b}m(b,c),b.prototype=c===null?Object.create(c):(o.prototype=c.prototype,new o)}),_=this&&this.__decorate||function(b,c,o,l){var n,a=arguments.length,h=a<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(b,c,o,l);else for(var d=b.length-1;d>=0;d--)(n=b[d])&&(h=(a<3?n(h):a>3?n(c,o,h):n(c,o))||h);return a>3&&h&&Object.defineProperty(c,o,h),h},g=this&&this.__param||function(b,c){return function(o,l){c(o,l,b)}};Object.defineProperty(f,"__esModule",{value:!0}),f.Viewport=void 0;var x=k(844),C=k(3656),u=k(4725),p=k(2585),w=function(b){function c(o,l,n,a,h,d,S,T){var E=b.call(this)||this;return E._scrollLines=o,E._viewportElement=l,E._scrollArea=n,E._element=a,E._bufferService=h,E._optionsService=d,E._charSizeService=S,E._renderService=T,E.scrollBarWidth=0,E._currentRowHeight=0,E._currentScaledCellHeight=0,E._lastRecordedBufferLength=0,E._lastRecordedViewportHeight=0,E._lastRecordedBufferHeight=0,E._lastTouchY=0,E._lastScrollTop=0,E._wheelPartialScroll=0,E._refreshAnimationFrame=null,E._ignoreNextScrollEvent=!1,E.scrollBarWidth=E._viewportElement.offsetWidth-E._scrollArea.offsetWidth||15,E.register((0,C.addDisposableDomListener)(E._viewportElement,"scroll",E._onScroll.bind(E))),E._activeBuffer=E._bufferService.buffer,E.register(E._bufferService.buffers.onBufferActivate(function(M){return E._activeBuffer=M.activeBuffer})),E._renderDimensions=E._renderService.dimensions,E.register(E._renderService.onDimensionsChange(function(M){return E._renderDimensions=M})),setTimeout(function(){return E.syncScrollArea()},0),E}return y(c,b),c.prototype.onThemeChange=function(o){this._viewportElement.style.backgroundColor=o.background.css},c.prototype._refresh=function(o){var l=this;if(o)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return l._innerRefresh()}))},c.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null},c.prototype.syncScrollArea=function(o){if(o===void 0&&(o=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(o)},c.prototype._onScroll=function(o){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent){if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);var l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(l)}},c.prototype._bubbleScroll=function(o,l){var n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&n0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l},c.prototype._applyScrollModifier=function(o,l){var n=this._optionsService.rawOptions.fastScrollModifier;return n==="alt"&&l.altKey||n==="ctrl"&&l.ctrlKey||n==="shift"&&l.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity},c.prototype.onTouchStart=function(o){this._lastTouchY=o.touches[0].pageY},c.prototype.onTouchMove=function(o){var l=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(o,l))},_([g(4,p.IBufferService),g(5,p.IOptionsService),g(6,u.ICharSizeService),g(7,u.IRenderService)],c)}(x.Disposable);f.Viewport=w},3107:function(R,f,k){var m,y=this&&this.__extends||(m=function(c,o){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,n){l.__proto__=n}||function(l,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(l[a]=n[a])},m(c,o)},function(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function l(){this.constructor=c}m(c,o),c.prototype=o===null?Object.create(o):(l.prototype=o.prototype,new l)}),_=this&&this.__decorate||function(c,o,l,n){var a,h=arguments.length,d=h<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,l):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(c,o,l,n);else for(var S=c.length-1;S>=0;S--)(a=c[S])&&(d=(h<3?a(d):h>3?a(o,l,d):a(o,l))||d);return h>3&&d&&Object.defineProperty(o,l,d),d},g=this&&this.__param||function(c,o){return function(l,n){o(l,n,c)}},x=this&&this.__values||function(c){var o=typeof Symbol=="function"&&Symbol.iterator,l=o&&c[o],n=0;if(l)return l.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&n>=c.length&&(c=void 0),{value:c&&c[n++],done:!c}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.BufferDecorationRenderer=void 0;var C=k(3656),u=k(4725),p=k(844),w=k(2585),b=function(c){function o(l,n,a,h){var d=c.call(this)||this;return d._screenElement=l,d._bufferService=n,d._decorationService=a,d._renderService=h,d._decorationElements=new Map,d._altBufferIsActive=!1,d._dimensionsChanged=!1,d._container=document.createElement("div"),d._container.classList.add("xterm-decoration-container"),d._screenElement.appendChild(d._container),d.register(d._renderService.onRenderedViewportChange(function(){return d._queueRefresh()})),d.register(d._renderService.onDimensionsChange(function(){d._dimensionsChanged=!0,d._queueRefresh()})),d.register((0,C.addDisposableDomListener)(window,"resize",function(){return d._queueRefresh()})),d.register(d._bufferService.buffers.onBufferActivate(function(){d._altBufferIsActive=d._bufferService.buffer===d._bufferService.buffers.alt})),d.register(d._decorationService.onDecorationRegistered(function(){return d._queueRefresh()})),d.register(d._decorationService.onDecorationRemoved(function(S){return d._removeDecoration(S)})),d}return y(o,c),o.prototype.dispose=function(){this._container.remove(),this._decorationElements.clear(),c.prototype.dispose.call(this)},o.prototype._queueRefresh=function(){var l=this;this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(function(){l.refreshDecorations(),l._animationFrame=void 0}))},o.prototype.refreshDecorations=function(){var l,n;try{for(var a=x(this._decorationService.decorations),h=a.next();!h.done;h=a.next()){var d=h.value;this._renderDecoration(d)}}catch(S){l={error:S}}finally{try{h&&!h.done&&(n=a.return)&&n.call(a)}finally{if(l)throw l.error}}this._dimensionsChanged=!1},o.prototype._renderDecoration=function(l){this._refreshStyle(l),this._dimensionsChanged&&this._refreshXPosition(l)},o.prototype._createElement=function(l){var n,a=document.createElement("div");a.classList.add("xterm-decoration"),a.style.width=Math.round((l.options.width||1)*this._renderService.dimensions.actualCellWidth)+"px",a.style.height=(l.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",a.style.top=(l.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",a.style.lineHeight=this._renderService.dimensions.actualCellHeight+"px";var h=(n=l.options.x)!==null&&n!==void 0?n:0;return h&&h>this._bufferService.cols&&(a.style.display="none"),this._refreshXPosition(l,a),a},o.prototype._refreshStyle=function(l){var n=this,a=l.marker.line-this._bufferService.buffers.active.ydisp;if(a<0||a>=this._bufferService.rows)l.element&&(l.element.style.display="none",l.onRenderEmitter.fire(l.element));else{var h=this._decorationElements.get(l);h||(l.onDispose(function(){return n._removeDecoration(l)}),h=this._createElement(l),l.element=h,this._decorationElements.set(l,h),this._container.appendChild(h)),h.style.top=a*this._renderService.dimensions.actualCellHeight+"px",h.style.display=this._altBufferIsActive?"none":"block",l.onRenderEmitter.fire(h)}},o.prototype._refreshXPosition=function(l,n){var a;if(n===void 0&&(n=l.element),n){var h=(a=l.options.x)!==null&&a!==void 0?a:0;(l.options.anchor||"left")==="right"?n.style.right=h?h*this._renderService.dimensions.actualCellWidth+"px":"":n.style.left=h?h*this._renderService.dimensions.actualCellWidth+"px":""}},o.prototype._removeDecoration=function(l){var n;(n=this._decorationElements.get(l))===null||n===void 0||n.remove(),this._decorationElements.delete(l)},_([g(1,w.IBufferService),g(2,w.IDecorationService),g(3,u.IRenderService)],o)}(p.Disposable);f.BufferDecorationRenderer=b},5871:function(R,f){var k=this&&this.__values||function(y){var _=typeof Symbol=="function"&&Symbol.iterator,g=_&&y[_],x=0;if(g)return g.call(y);if(y&&typeof y.length=="number")return{next:function(){return y&&x>=y.length&&(y=void 0),{value:y&&y[x++],done:!y}}};throw new TypeError(_?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.ColorZoneStore=void 0;var m=function(){function y(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}return Object.defineProperty(y.prototype,"zones",{get:function(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones},enumerable:!1,configurable:!0}),y.prototype.clear=function(){this._zones.length=0,this._zonePoolIndex=0},y.prototype.addDecoration=function(_){var g,x;if(_.options.overviewRulerOptions){try{for(var C=k(this._zones),u=C.next();!u.done;u=C.next()){var p=u.value;if(p.color===_.options.overviewRulerOptions.color&&p.position===_.options.overviewRulerOptions.position){if(this._lineIntersectsZone(p,_.marker.line))return;if(this._lineAdjacentToZone(p,_.marker.line,_.options.overviewRulerOptions.position))return void this._addLineToZone(p,_.marker.line)}}}catch(w){g={error:w}}finally{try{u&&!u.done&&(x=C.return)&&x.call(C)}finally{if(g)throw g.error}}if(this._zonePoolIndex=_.startBufferLine&&g<=_.endBufferLine},y.prototype._lineAdjacentToZone=function(_,g,x){return g>=_.startBufferLine-this._linePadding[x||"full"]&&g<=_.endBufferLine+this._linePadding[x||"full"]},y.prototype._addLineToZone=function(_,g){_.startBufferLine=Math.min(_.startBufferLine,g),_.endBufferLine=Math.max(_.endBufferLine,g)},y}();f.ColorZoneStore=m},5744:function(R,f,k){var m,y=this&&this.__extends||(m=function(a,h){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,S){d.__proto__=S}||function(d,S){for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(d[T]=S[T])},m(a,h)},function(a,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");function d(){this.constructor=a}m(a,h),a.prototype=h===null?Object.create(h):(d.prototype=h.prototype,new d)}),_=this&&this.__decorate||function(a,h,d,S){var T,E=arguments.length,M=E<3?h:S===null?S=Object.getOwnPropertyDescriptor(h,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(a,h,d,S);else for(var D=a.length-1;D>=0;D--)(T=a[D])&&(M=(E<3?T(M):E>3?T(h,d,M):T(h,d))||M);return E>3&&M&&Object.defineProperty(h,d,M),M},g=this&&this.__param||function(a,h){return function(d,S){h(d,S,a)}},x=this&&this.__values||function(a){var h=typeof Symbol=="function"&&Symbol.iterator,d=h&&a[h],S=0;if(d)return d.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&S>=a.length&&(a=void 0),{value:a&&a[S++],done:!a}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.OverviewRulerRenderer=void 0;var C=k(5871),u=k(3656),p=k(4725),w=k(844),b=k(2585),c={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},n=function(a){function h(d,S,T,E,M,D){var W,I=a.call(this)||this;I._viewportElement=d,I._screenElement=S,I._bufferService=T,I._decorationService=E,I._renderService=M,I._optionsService=D,I._colorZoneStore=new C.ColorZoneStore,I._shouldUpdateDimensions=!0,I._shouldUpdateAnchor=!0,I._lastKnownBufferLength=0,I._canvas=document.createElement("canvas"),I._canvas.classList.add("xterm-decoration-overview-ruler"),I._refreshCanvasDimensions(),(W=I._viewportElement.parentElement)===null||W===void 0||W.insertBefore(I._canvas,I._viewportElement);var A=I._canvas.getContext("2d");if(!A)throw new Error("Ctx cannot be null");return I._ctx=A,I._registerDecorationListeners(),I._registerBufferChangeListeners(),I._registerDimensionChangeListeners(),I}return y(h,a),Object.defineProperty(h.prototype,"_width",{get:function(){return this._optionsService.options.overviewRulerWidth||0},enumerable:!1,configurable:!0}),h.prototype._registerDecorationListeners=function(){var d=this;this.register(this._decorationService.onDecorationRegistered(function(){return d._queueRefresh(void 0,!0)})),this.register(this._decorationService.onDecorationRemoved(function(){return d._queueRefresh(void 0,!0)}))},h.prototype._registerBufferChangeListeners=function(){var d=this;this.register(this._renderService.onRenderedViewportChange(function(){return d._queueRefresh()})),this.register(this._bufferService.buffers.onBufferActivate(function(){d._canvas.style.display=d._bufferService.buffer===d._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(function(){d._lastKnownBufferLength!==d._bufferService.buffers.normal.lines.length&&(d._refreshDrawHeightConstants(),d._refreshColorZonePadding())}))},h.prototype._registerDimensionChangeListeners=function(){var d=this;this.register(this._renderService.onRender(function(){d._containerHeight&&d._containerHeight===d._screenElement.clientHeight||(d._queueRefresh(!0),d._containerHeight=d._screenElement.clientHeight)})),this.register(this._optionsService.onOptionChange(function(S){S==="overviewRulerWidth"&&d._queueRefresh(!0)})),this.register((0,u.addDisposableDomListener)(window,"resize",function(){d._queueRefresh(!0)})),this._queueRefresh(!0)},h.prototype.dispose=function(){var d;(d=this._canvas)===null||d===void 0||d.remove(),a.prototype.dispose.call(this)},h.prototype._refreshDrawConstants=function(){var d=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=d,o.center=S,o.right=d,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=o.left,l.right=o.left+o.center},h.prototype._refreshDrawHeightConstants=function(){c.full=Math.round(2*window.devicePixelRatio);var d=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(d,12),6)*window.devicePixelRatio);c.left=S,c.center=S,c.right=S},h.prototype._refreshColorZonePadding=function(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length},h.prototype._refreshCanvasDimensions=function(){this._canvas.style.width=this._width+"px",this._canvas.width=Math.round(this._width*window.devicePixelRatio),this._canvas.style.height=this._screenElement.clientHeight+"px",this._canvas.height=Math.round(this._screenElement.clientHeight*window.devicePixelRatio),this._refreshDrawConstants(),this._refreshColorZonePadding()},h.prototype._refreshDecorations=function(){var d,S,T,E,M,D;this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();try{for(var W=x(this._decorationService.decorations),I=W.next();!I.done;I=W.next()){var A=I.value;this._colorZoneStore.addDecoration(A)}}catch(ee){d={error:ee}}finally{try{I&&!I.done&&(S=W.return)&&S.call(W)}finally{if(d)throw d.error}}this._ctx.lineWidth=1;var H=this._colorZoneStore.zones;try{for(var F=x(H),z=F.next();!z.done;z=F.next())(ce=z.value).position!=="full"&&this._renderColorZone(ce)}catch(ee){T={error:ee}}finally{try{z&&!z.done&&(E=F.return)&&E.call(F)}finally{if(T)throw T.error}}try{for(var G=x(H),te=G.next();!te.done;te=G.next()){var ce;(ce=te.value).position==="full"&&this._renderColorZone(ce)}}catch(ee){M={error:ee}}finally{try{te&&!te.done&&(D=G.return)&&D.call(G)}finally{if(M)throw M.error}}this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1},h.prototype._renderColorZone=function(d){this._ctx.fillStyle=d.color,this._ctx.fillRect(l[d.position||"full"],Math.round((this._canvas.height-1)*(d.startBufferLine/this._bufferService.buffers.active.lines.length)-c[d.position||"full"]/2),o[d.position||"full"],Math.round((this._canvas.height-1)*((d.endBufferLine-d.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[d.position||"full"]))},h.prototype._queueRefresh=function(d,S){var T=this;this._shouldUpdateDimensions=d||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=window.requestAnimationFrame(function(){T._refreshDecorations(),T._animationFrame=void 0}))},_([g(2,b.IBufferService),g(3,b.IDecorationService),g(4,p.IRenderService),g(5,b.IOptionsService)],h)}(w.Disposable);f.OverviewRulerRenderer=n},2950:function(R,f,k){var m=this&&this.__decorate||function(C,u,p,w){var b,c=arguments.length,o=c<3?u:w===null?w=Object.getOwnPropertyDescriptor(u,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(C,u,p,w);else for(var l=C.length-1;l>=0;l--)(b=C[l])&&(o=(c<3?b(o):c>3?b(u,p,o):b(u,p))||o);return c>3&&o&&Object.defineProperty(u,p,o),o},y=this&&this.__param||function(C,u){return function(p,w){u(p,w,C)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CompositionHelper=void 0;var _=k(4725),g=k(2585),x=function(){function C(u,p,w,b,c,o){this._textarea=u,this._compositionView=p,this._bufferService=w,this._optionsService=b,this._coreService=c,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}return Object.defineProperty(C.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),C.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")},C.prototype.compositionupdate=function(u){var p=this;this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout(function(){p._compositionPosition.end=p._textarea.value.length},0)},C.prototype.compositionend=function(){this._finalizeComposition(!0)},C.prototype.keydown=function(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},C.prototype._finalizeComposition=function(u){var p=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){var w={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(p._isSendingComposition){p._isSendingComposition=!1;var c;w.start+=p._dataAlreadySent.length,(c=p._isComposing?p._textarea.value.substring(w.start,w.end):p._textarea.value.substring(w.start)).length>0&&p._coreService.triggerDataEvent(c,!0)}},0)}else{this._isSendingComposition=!1;var b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}},C.prototype._handleAnyTextareaChanges=function(){var u=this,p=this._textarea.value;setTimeout(function(){if(!u._isComposing){var w=u._textarea.value.replace(p,"");w.length>0&&(u._dataAlreadySent=w,u._coreService.triggerDataEvent(w,!0))}},0)},C.prototype.updateCompositionElements=function(u){var p=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var w=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.actualCellHeight,c=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,o=w*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=o+"px",this._compositionView.style.top=c+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var l=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=c+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}u||setTimeout(function(){return p.updateCompositionElements(!0)},0)}},m([y(2,g.IBufferService),y(3,g.IOptionsService),y(4,g.ICoreService),y(5,_.IRenderService)],C)}();f.CompositionHelper=x},9806:(R,f)=>{function k(m,y,_){var g=_.getBoundingClientRect(),x=m.getComputedStyle(_),C=parseInt(x.getPropertyValue("padding-left")),u=parseInt(x.getPropertyValue("padding-top"));return[y.clientX-g.left-C,y.clientY-g.top-u]}Object.defineProperty(f,"__esModule",{value:!0}),f.getRawByteCoords=f.getCoords=f.getCoordsRelativeToElement=void 0,f.getCoordsRelativeToElement=k,f.getCoords=function(m,y,_,g,x,C,u,p,w){if(C){var b=k(m,y,_);if(b)return b[0]=Math.ceil((b[0]+(w?u/2:0))/u),b[1]=Math.ceil(b[1]/p),b[0]=Math.min(Math.max(b[0],1),g+(w?1:0)),b[1]=Math.min(Math.max(b[1],1),x),b}},f.getRawByteCoords=function(m){if(m)return{x:m[0]+32,y:m[1]+32}}},9504:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.moveToCellSequence=void 0;var m=k(2584);function y(p,w,b,c){var o=p-_(b,p),l=w-_(b,w),n=Math.abs(o-l)-function(a,h,d){for(var S=0,T=a-_(d,a),E=h-_(d,h),M=0;M=0&&ww?"A":"B"}function x(p,w,b,c,o,l){for(var n=p,a=w,h="";n!==b||a!==c;)n+=o?1:-1,o&&n>l.cols-1?(h+=l.buffer.translateBufferLineToString(a,!1,p,n),n=0,p=0,a++):!o&&n<0&&(h+=l.buffer.translateBufferLineToString(a,!1,0,p+1),p=n=l.cols-1,a--);return h+l.buffer.translateBufferLineToString(a,!1,p,n)}function C(p,w){var b=w?"O":"[";return m.C0.ESC+b+p}function u(p,w){p=Math.floor(p);for(var b="",c=0;c0?T-_(E,T):d;var W=T,I=function(A,H,F,z,G,te){var ce;return ce=y(F,z,G,te).length>0?z-_(G,z):H,A=F&&cep?"D":"C",u(Math.abs(l-p),C(o,c));o=n>w?"D":"C";var a=Math.abs(n-w);return u(function(h,d){return d.cols-h}(n>w?p:l,b)+(a-1)*b.cols+1+((n>w?l:p)-1),C(o,c))}},4389:function(R,f,k){var m=this&&this.__assign||function(){return m=Object.assign||function(c){for(var o,l=1,n=arguments.length;l=c.length&&(c=void 0),{value:c&&c[n++],done:!c}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;var _=k(3236),g=k(9042),x=k(7975),C=k(7090),u=k(5741),p=k(8285),w=["cols","rows"],b=function(){function c(o){var l=this;this._core=new _.Terminal(o),this._addonManager=new u.AddonManager,this._publicOptions=m({},this._core.options);var n=function(S){return l._core.options[S]},a=function(S,T){l._checkReadonlyOptions(S),l._core.options[S]=T};for(var h in this._core.options){var d={get:n.bind(this,h),set:a.bind(this,h)};Object.defineProperty(this._publicOptions,h,d)}}return c.prototype._checkReadonlyOptions=function(o){if(w.includes(o))throw new Error('Option "'+o+'" can only be set in the constructor')},c.prototype._checkProposedApi=function(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(c.prototype,"onBell",{get:function(){return this._core.onBell},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onWriteParsed",{get:function(){return this._core.onWriteParsed},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new x.ParserApi(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"unicode",{get:function(){return this._checkProposedApi(),new C.UnicodeApi(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"buffer",{get:function(){return this._checkProposedApi(),this._buffer||(this._buffer=new p.BufferNamespaceApi(this._core)),this._buffer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"modes",{get:function(){var o=this._core.coreService.decPrivateModes,l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"options",{get:function(){return this._publicOptions},set:function(o){for(var l in o)this._publicOptions[l]=o[l]},enumerable:!1,configurable:!0}),c.prototype.blur=function(){this._core.blur()},c.prototype.focus=function(){this._core.focus()},c.prototype.resize=function(o,l){this._verifyIntegers(o,l),this._core.resize(o,l)},c.prototype.open=function(o){this._core.open(o)},c.prototype.attachCustomKeyEventHandler=function(o){this._core.attachCustomKeyEventHandler(o)},c.prototype.registerLinkMatcher=function(o,l,n){return this._checkProposedApi(),this._core.registerLinkMatcher(o,l,n)},c.prototype.deregisterLinkMatcher=function(o){this._checkProposedApi(),this._core.deregisterLinkMatcher(o)},c.prototype.registerLinkProvider=function(o){return this._checkProposedApi(),this._core.registerLinkProvider(o)},c.prototype.registerCharacterJoiner=function(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)},c.prototype.deregisterCharacterJoiner=function(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)},c.prototype.registerMarker=function(o){return o===void 0&&(o=0),this._checkProposedApi(),this._verifyIntegers(o),this._core.addMarker(o)},c.prototype.registerDecoration=function(o){var l,n,a;return this._checkProposedApi(),this._verifyPositiveIntegers((l=o.x)!==null&&l!==void 0?l:0,(n=o.width)!==null&&n!==void 0?n:0,(a=o.height)!==null&&a!==void 0?a:0),this._core.registerDecoration(o)},c.prototype.addMarker=function(o){return this.registerMarker(o)},c.prototype.hasSelection=function(){return this._core.hasSelection()},c.prototype.select=function(o,l,n){this._verifyIntegers(o,l,n),this._core.select(o,l,n)},c.prototype.getSelection=function(){return this._core.getSelection()},c.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},c.prototype.clearSelection=function(){this._core.clearSelection()},c.prototype.selectAll=function(){this._core.selectAll()},c.prototype.selectLines=function(o,l){this._verifyIntegers(o,l),this._core.selectLines(o,l)},c.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},c.prototype.scrollLines=function(o){this._verifyIntegers(o),this._core.scrollLines(o)},c.prototype.scrollPages=function(o){this._verifyIntegers(o),this._core.scrollPages(o)},c.prototype.scrollToTop=function(){this._core.scrollToTop()},c.prototype.scrollToBottom=function(){this._core.scrollToBottom()},c.prototype.scrollToLine=function(o){this._verifyIntegers(o),this._core.scrollToLine(o)},c.prototype.clear=function(){this._core.clear()},c.prototype.write=function(o,l){this._core.write(o,l)},c.prototype.writeUtf8=function(o,l){this._core.write(o,l)},c.prototype.writeln=function(o,l){this._core.write(o),this._core.write(`\r +`,l)},c.prototype.paste=function(o){this._core.paste(o)},c.prototype.getOption=function(o){return this._core.optionsService.getOption(o)},c.prototype.setOption=function(o,l){this._checkReadonlyOptions(o),this._core.optionsService.setOption(o,l)},c.prototype.refresh=function(o,l){this._verifyIntegers(o,l),this._core.refresh(o,l)},c.prototype.reset=function(){this._core.reset()},c.prototype.clearTextureAtlas=function(){this._core.clearTextureAtlas()},c.prototype.loadAddon=function(o){return this._addonManager.loadAddon(this,o)},Object.defineProperty(c,"strings",{get:function(){return g},enumerable:!1,configurable:!0}),c.prototype._verifyIntegers=function(){for(var o,l,n=[],a=0;a=c.length&&(c=void 0),{value:c&&c[n++],done:!c}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.BaseRenderLayer=void 0;var y=k(643),_=k(8803),g=k(1420),x=k(3734),C=k(1752),u=k(8055),p=k(9631),w=k(8978),b=function(){function c(o,l,n,a,h,d,S,T,E){this._container=o,this._alpha=a,this._colors=h,this._rendererId=d,this._bufferService=S,this._optionsService=T,this._decorationService=E,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._columnSelectMode=!1,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+l+"-layer"),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return c.prototype.dispose=function(){var o;(0,p.removeElementFromParent)(this._canvas),(o=this._charAtlas)===null||o===void 0||o.dispose()},c.prototype._initCanvas=function(){this._ctx=(0,C.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},c.prototype.onOptionsChanged=function(){},c.prototype.onBlur=function(){},c.prototype.onFocus=function(){},c.prototype.onCursorMove=function(){},c.prototype.onGridChanged=function(o,l){},c.prototype.onSelectionChanged=function(o,l,n){n===void 0&&(n=!1),this._selectionStart=o,this._selectionEnd=l,this._columnSelectMode=n},c.prototype.setColors=function(o){this._refreshCharAtlas(o)},c.prototype._setTransparency=function(o){if(o!==this._alpha){var l=this._canvas;this._alpha=o,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,l),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},c.prototype._refreshCharAtlas=function(o){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=(0,g.acquireCharAtlas)(this._optionsService.rawOptions,this._rendererId,o,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},c.prototype.resize=function(o){this._scaledCellWidth=o.scaledCellWidth,this._scaledCellHeight=o.scaledCellHeight,this._scaledCharWidth=o.scaledCharWidth,this._scaledCharHeight=o.scaledCharHeight,this._scaledCharLeft=o.scaledCharLeft,this._scaledCharTop=o.scaledCharTop,this._canvas.width=o.scaledCanvasWidth,this._canvas.height=o.scaledCanvasHeight,this._canvas.style.width=o.canvasWidth+"px",this._canvas.style.height=o.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},c.prototype.clearTextureAtlas=function(){var o;(o=this._charAtlas)===null||o===void 0||o.clear()},c.prototype._fillCells=function(o,l,n,a){this._ctx.fillRect(o*this._scaledCellWidth,l*this._scaledCellHeight,n*this._scaledCellWidth,a*this._scaledCellHeight)},c.prototype._fillMiddleLineAtCells=function(o,l,n){n===void 0&&(n=1);var a=Math.ceil(.5*this._scaledCellHeight);this._ctx.fillRect(o*this._scaledCellWidth,(l+1)*this._scaledCellHeight-a-window.devicePixelRatio,n*this._scaledCellWidth,window.devicePixelRatio)},c.prototype._fillBottomLineAtCells=function(o,l,n){n===void 0&&(n=1),this._ctx.fillRect(o*this._scaledCellWidth,(l+1)*this._scaledCellHeight-window.devicePixelRatio-1,n*this._scaledCellWidth,window.devicePixelRatio)},c.prototype._fillLeftLineAtCell=function(o,l,n){this._ctx.fillRect(o*this._scaledCellWidth,l*this._scaledCellHeight,window.devicePixelRatio*n,this._scaledCellHeight)},c.prototype._strokeRectAtCell=function(o,l,n,a){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(o*this._scaledCellWidth+window.devicePixelRatio/2,l*this._scaledCellHeight+window.devicePixelRatio/2,n*this._scaledCellWidth-window.devicePixelRatio,a*this._scaledCellHeight-window.devicePixelRatio)},c.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},c.prototype._clearCells=function(o,l,n,a){this._alpha?this._ctx.clearRect(o*this._scaledCellWidth,l*this._scaledCellHeight,n*this._scaledCellWidth,a*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(o*this._scaledCellWidth,l*this._scaledCellHeight,n*this._scaledCellWidth,a*this._scaledCellHeight))},c.prototype._fillCharTrueColor=function(o,l,n){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipRow(n);var a=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(a=(0,w.tryDrawCustomChar)(this._ctx,o.getChars(),l*this._scaledCellWidth,n*this._scaledCellHeight,this._scaledCellWidth,this._scaledCellHeight)),a||this._ctx.fillText(o.getChars(),l*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight)},c.prototype._drawChars=function(o,l,n){var a,h,d,S=this._getContrastColor(o,l,n);if(S||o.isFgRGB()||o.isBgRGB())this._drawUncachedChars(o,l,n,S);else{var T,E;o.isInverse()?(T=o.isBgDefault()?_.INVERTED_DEFAULT_COLOR:o.getBgColor(),E=o.isFgDefault()?_.INVERTED_DEFAULT_COLOR:o.getFgColor()):(E=o.isBgDefault()?y.DEFAULT_COLOR:o.getBgColor(),T=o.isFgDefault()?y.DEFAULT_COLOR:o.getFgColor()),T+=this._optionsService.rawOptions.drawBoldTextInBrightColors&&o.isBold()&&T<8?8:0,this._currentGlyphIdentifier.chars=o.getChars()||y.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=o.getCode()||y.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=E,this._currentGlyphIdentifier.fg=T,this._currentGlyphIdentifier.bold=!!o.isBold(),this._currentGlyphIdentifier.dim=!!o.isDim(),this._currentGlyphIdentifier.italic=!!o.isItalic();var M=!1;try{for(var D=m(this._decorationService.getDecorationsAtCell(l,n)),W=D.next();!W.done;W=D.next()){var I=W.value;if(I.backgroundColorRGB||I.foregroundColorRGB){M=!0;break}}}catch(A){a={error:A}}finally{try{W&&!W.done&&(h=D.return)&&h.call(D)}finally{if(a)throw a.error}}!M&&(!((d=this._charAtlas)===null||d===void 0)&&d.draw(this._ctx,this._currentGlyphIdentifier,l*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop))||this._drawUncachedChars(o,l,n)}},c.prototype._drawUncachedChars=function(o,l,n,a){if(this._ctx.save(),this._ctx.font=this._getFont(!!o.isBold(),!!o.isItalic()),this._ctx.textBaseline=_.TEXT_BASELINE,o.isInverse())if(a)this._ctx.fillStyle=a.css;else if(o.isBgDefault())this._ctx.fillStyle=u.color.opaque(this._colors.background).css;else if(o.isBgRGB())this._ctx.fillStyle="rgb("+x.AttributeData.toColorRGB(o.getBgColor()).join(",")+")";else{var h=o.getBgColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&o.isBold()&&h<8&&(h+=8),this._ctx.fillStyle=this._colors.ansi[h].css}else if(a)this._ctx.fillStyle=a.css;else if(o.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(o.isFgRGB())this._ctx.fillStyle="rgb("+x.AttributeData.toColorRGB(o.getFgColor()).join(",")+")";else{var d=o.getFgColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&o.isBold()&&d<8&&(d+=8),this._ctx.fillStyle=this._colors.ansi[d].css}this._clipRow(n),o.isDim()&&(this._ctx.globalAlpha=_.DIM_OPACITY);var S=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(S=(0,w.tryDrawCustomChar)(this._ctx,o.getChars(),l*this._scaledCellWidth,n*this._scaledCellHeight,this._scaledCellWidth,this._scaledCellHeight)),S||this._ctx.fillText(o.getChars(),l*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight),this._ctx.restore()},c.prototype._clipRow=function(o){this._ctx.beginPath(),this._ctx.rect(0,o*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},c.prototype._getFont=function(o,l){return(l?"italic":"")+" "+(o?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight)+" "+this._optionsService.rawOptions.fontSize*window.devicePixelRatio+"px "+this._optionsService.rawOptions.fontFamily},c.prototype._getContrastColor=function(o,l,n){var a,h,d,S,T=!1;try{for(var E=m(this._decorationService.getDecorationsAtCell(l,n)),M=E.next();!M.done;M=E.next()){var D=M.value;D.options.layer!=="top"&&T||(D.backgroundColorRGB&&(d=D.backgroundColorRGB.rgba),D.foregroundColorRGB&&(S=D.foregroundColorRGB.rgba),T=D.options.layer==="top")}}catch(ve){a={error:ve}}finally{try{M&&!M.done&&(h=E.return)&&h.call(E)}finally{if(a)throw a.error}}if(T||this._colors.selectionForeground&&this._isCellInSelection(l,n)&&(S=this._colors.selectionForeground.rgba),d||S||this._optionsService.rawOptions.minimumContrastRatio!==1&&!(0,C.excludeFromContrastRatioDemands)(o.getCode())){if(!d&&!S){var W=this._colors.contrastCache.getColor(o.bg,o.fg);if(W!==void 0)return W||void 0}var I=o.getFgColor(),A=o.getFgColorMode(),H=o.getBgColor(),F=o.getBgColorMode(),z=!!o.isInverse(),G=!!o.isInverse();if(z){var te=I;I=H,H=te;var ce=A;A=F,F=ce}var ee=this._resolveBackgroundRgba(d!==void 0?50331648:F,d??H,z),fe=this._resolveForegroundRgba(A,I,z,G),_e=u.rgba.ensureContrastRatio(d??ee,S??fe,this._optionsService.rawOptions.minimumContrastRatio);if(!_e){if(!S)return void this._colors.contrastCache.setColor(o.bg,o.fg,null);_e=S}var q={css:u.channels.toCss(_e>>24&255,_e>>16&255,_e>>8&255),rgba:_e};return d||S||this._colors.contrastCache.setColor(o.bg,o.fg,q),q}},c.prototype._resolveBackgroundRgba=function(o,l,n){switch(o){case 16777216:case 33554432:return this._colors.ansi[l].rgba;case 50331648:return l<<8;default:return n?this._colors.foreground.rgba:this._colors.background.rgba}},c.prototype._resolveForegroundRgba=function(o,l,n,a){switch(o){case 16777216:case 33554432:return this._optionsService.rawOptions.drawBoldTextInBrightColors&&a&&l<8&&(l+=8),this._colors.ansi[l].rgba;case 50331648:return l<<8;default:return n?this._colors.background.rgba:this._colors.foreground.rgba}},c.prototype._isCellInSelection=function(o,l){var n=this._selectionStart,a=this._selectionEnd;return!(!n||!a)&&(this._columnSelectMode?o>=n[0]&&l>=n[1]&&on[1]&&l=n[0]&&o=n[0])},c}();f.BaseRenderLayer=b},2512:function(R,f,k){var m,y=this&&this.__extends||(m=function(o,l){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var h in a)Object.prototype.hasOwnProperty.call(a,h)&&(n[h]=a[h])},m(o,l)},function(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function n(){this.constructor=o}m(o,l),o.prototype=l===null?Object.create(l):(n.prototype=l.prototype,new n)}),_=this&&this.__decorate||function(o,l,n,a){var h,d=arguments.length,S=d<3?l:a===null?a=Object.getOwnPropertyDescriptor(l,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,l,n,a);else for(var T=o.length-1;T>=0;T--)(h=o[T])&&(S=(d<3?h(S):d>3?h(l,n,S):h(l,n))||S);return d>3&&S&&Object.defineProperty(l,n,S),S},g=this&&this.__param||function(o,l){return function(n,a){l(n,a,o)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CursorRenderLayer=void 0;var x=k(1546),C=k(511),u=k(2585),p=k(4725),w=600,b=function(o){function l(n,a,h,d,S,T,E,M,D,W){var I=o.call(this,n,"cursor",a,!0,h,d,T,E,W)||this;return I._onRequestRedraw=S,I._coreService=M,I._coreBrowserService=D,I._cell=new C.CellData,I._state={x:0,y:0,isFocused:!1,style:"",width:0},I._cursorRenderers={bar:I._renderBarCursor.bind(I),block:I._renderBlockCursor.bind(I),underline:I._renderUnderlineCursor.bind(I)},I}return y(l,o),l.prototype.dispose=function(){this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0),o.prototype.dispose.call(this)},l.prototype.resize=function(n){o.prototype.resize.call(this,n),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},l.prototype.reset=function(){var n;this._clearCursor(),(n=this._cursorBlinkStateManager)===null||n===void 0||n.restartBlinkAnimation(),this.onOptionsChanged()},l.prototype.onBlur=function(){var n;(n=this._cursorBlinkStateManager)===null||n===void 0||n.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},l.prototype.onFocus=function(){var n;(n=this._cursorBlinkStateManager)===null||n===void 0||n.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},l.prototype.onOptionsChanged=function(){var n,a=this;this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new c(this._coreBrowserService.isFocused,function(){a._render(!0)})):((n=this._cursorBlinkStateManager)===null||n===void 0||n.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},l.prototype.onCursorMove=function(){var n;(n=this._cursorBlinkStateManager)===null||n===void 0||n.restartBlinkAnimation()},l.prototype.onGridChanged=function(n,a){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},l.prototype._render=function(n){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var a=this._bufferService.buffer.ybase+this._bufferService.buffer.y,h=a-this._bufferService.buffer.ydisp;if(h<0||h>=this._bufferService.rows)this._clearCursor();else{var d=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(a).loadCell(d,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var S=this._optionsService.rawOptions.cursorStyle;return S&&S!=="block"?this._cursorRenderers[S](d,h,this._cell):this._renderBlurCursor(d,h,this._cell),this._ctx.restore(),this._state.x=d,this._state.y=h,this._state.isFocused=!1,this._state.style=S,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===d&&this._state.y===h&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](d,h,this._cell),this._ctx.restore(),this._state.x=d,this._state.y=h,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},l.prototype._clearCursor=function(){this._state&&(window.devicePixelRatio<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},l.prototype._renderBarCursor=function(n,a,h){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(n,a,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()},l.prototype._renderBlockCursor=function(n,a,h){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(n,a,h.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(h,n,a),this._ctx.restore()},l.prototype._renderUnderlineCursor=function(n,a,h){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(n,a),this._ctx.restore()},l.prototype._renderBlurCursor=function(n,a,h){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(n,a,h.getWidth(),1),this._ctx.restore()},_([g(5,u.IBufferService),g(6,u.IOptionsService),g(7,u.ICoreService),g(8,p.ICoreBrowserService),g(9,u.IDecorationService)],l)}(x.BaseRenderLayer);f.CursorRenderLayer=b;var c=function(){function o(l,n){this._renderCallback=n,this.isCursorVisible=!0,l&&this._restartInterval()}return Object.defineProperty(o.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),o.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},o.prototype.restartBlinkAnimation=function(){var l=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){l._renderCallback(),l._animationFrame=void 0})))},o.prototype._restartInterval=function(l){var n=this;l===void 0&&(l=w),this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=window.setTimeout(function(){if(n._animationTimeRestarted){var a=w-(Date.now()-n._animationTimeRestarted);if(n._animationTimeRestarted=void 0,a>0)return void n._restartInterval(a)}n.isCursorVisible=!1,n._animationFrame=window.requestAnimationFrame(function(){n._renderCallback(),n._animationFrame=void 0}),n._blinkInterval=window.setInterval(function(){if(n._animationTimeRestarted){var h=w-(Date.now()-n._animationTimeRestarted);return n._animationTimeRestarted=void 0,void n._restartInterval(h)}n.isCursorVisible=!n.isCursorVisible,n._animationFrame=window.requestAnimationFrame(function(){n._renderCallback(),n._animationFrame=void 0})},w)},l)},o.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},o.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},o}()},8978:function(R,f,k){var m,y,_,g,x,C,u,p,w,b,c,o,l,n,a,h,d,S,T,E,M,D,W,I,A,H,F,z,G,te,ce,ee,fe,_e,q,ve,de,ke,$,Ie,ge,le,V,Y,se,xe,Ee,De,je,Re,Ze,we,$e,dt,Jt,br,lr,ai,cr,Xe,Sr,Qt,ur,Cr,fr,li,Be,Vr,Te,er,et,ze,Ue,Et,pt,Ot,tt,Tr,lt,hr,Wr,Dt,ci,Ar,$r,Nr,dr,Tt,pr,Jr,Bt,ui,Mr,Pt,It,wr,Rr,Or,vr,Dr,zt,jr,Br,qe,Le,tr,zr,Lt,j,Z,ae,he,ie,be,He,Je,vt,Ur,Wi,Oe,fn,Ni,fi,rr,ji,zi,Qr,Ci,hn=this&&this.__read||function(ne,re){var nt=typeof Symbol=="function"&&ne[Symbol.iterator];if(!nt)return ne;var Ht,Ut,gt=nt.call(ne),rt=[];try{for(;(re===void 0||re-- >0)&&!(Ht=gt.next()).done;)rt.push(Ht.value)}catch(ir){Ut={error:ir}}finally{try{Ht&&!Ht.done&&(nt=gt.return)&&nt.call(gt)}finally{if(Ut)throw Ut.error}}return rt},wi=this&&this.__values||function(ne){var re=typeof Symbol=="function"&&Symbol.iterator,nt=re&&ne[re],Ht=0;if(nt)return nt.call(ne);if(ne&&typeof ne.length=="number")return{next:function(){return ne&&Ht>=ne.length&&(ne=void 0),{value:ne&&ne[Ht++],done:!ne}}};throw new TypeError(re?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.tryDrawCustomChar=f.powerlineDefinitions=f.boxDrawingDefinitions=f.blockElementDefinitions=void 0;var dn=k(1752);f.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258A":[{x:0,y:0,w:6,h:8}],"\u258B":[{x:0,y:0,w:5,h:8}],"\u258C":[{x:0,y:0,w:4,h:8}],"\u258D":[{x:0,y:0,w:3,h:8}],"\u258E":[{x:0,y:0,w:2,h:8}],"\u258F":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:9,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259A":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259B":[{x:0,y:0,w:4,h:8},{x:0,y:0,w:4,h:8}],"\u259C":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259D":[{x:4,y:0,w:4,h:4}],"\u259E":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259F":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u{1FB70}":[{x:1,y:0,w:1,h:8}],"\u{1FB71}":[{x:2,y:0,w:1,h:8}],"\u{1FB72}":[{x:3,y:0,w:1,h:8}],"\u{1FB73}":[{x:4,y:0,w:1,h:8}],"\u{1FB74}":[{x:5,y:0,w:1,h:8}],"\u{1FB75}":[{x:6,y:0,w:1,h:8}],"\u{1FB76}":[{x:0,y:1,w:8,h:1}],"\u{1FB77}":[{x:0,y:2,w:8,h:1}],"\u{1FB78}":[{x:0,y:3,w:8,h:1}],"\u{1FB79}":[{x:0,y:4,w:8,h:1}],"\u{1FB7A}":[{x:0,y:5,w:8,h:1}],"\u{1FB7B}":[{x:0,y:6,w:8,h:1}],"\u{1FB7C}":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB7D}":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7E}":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7F}":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB80}":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB81}":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB82}":[{x:0,y:0,w:8,h:2}],"\u{1FB83}":[{x:0,y:0,w:8,h:3}],"\u{1FB84}":[{x:0,y:0,w:8,h:5}],"\u{1FB85}":[{x:0,y:0,w:8,h:6}],"\u{1FB86}":[{x:0,y:0,w:8,h:7}],"\u{1FB87}":[{x:6,y:0,w:2,h:8}],"\u{1FB88}":[{x:5,y:0,w:3,h:8}],"\u{1FB89}":[{x:3,y:0,w:5,h:8}],"\u{1FB8A}":[{x:2,y:0,w:6,h:8}],"\u{1FB8B}":[{x:1,y:0,w:7,h:8}],"\u{1FB95}":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"\u{1FB96}":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"\u{1FB97}":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};var zn={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};f.boxDrawingDefinitions={"\u2500":(m={},m[1]="M0,.5 L1,.5",m),"\u2501":(y={},y[3]="M0,.5 L1,.5",y),"\u2502":(_={},_[1]="M.5,0 L.5,1",_),"\u2503":(g={},g[3]="M.5,0 L.5,1",g),"\u250C":(x={},x[1]="M0.5,1 L.5,.5 L1,.5",x),"\u250F":(C={},C[3]="M0.5,1 L.5,.5 L1,.5",C),"\u2510":(u={},u[1]="M0,.5 L.5,.5 L.5,1",u),"\u2513":(p={},p[3]="M0,.5 L.5,.5 L.5,1",p),"\u2514":(w={},w[1]="M.5,0 L.5,.5 L1,.5",w),"\u2517":(b={},b[3]="M.5,0 L.5,.5 L1,.5",b),"\u2518":(c={},c[1]="M.5,0 L.5,.5 L0,.5",c),"\u251B":(o={},o[3]="M.5,0 L.5,.5 L0,.5",o),"\u251C":(l={},l[1]="M.5,0 L.5,1 M.5,.5 L1,.5",l),"\u2523":(n={},n[3]="M.5,0 L.5,1 M.5,.5 L1,.5",n),"\u2524":(a={},a[1]="M.5,0 L.5,1 M.5,.5 L0,.5",a),"\u252B":(h={},h[3]="M.5,0 L.5,1 M.5,.5 L0,.5",h),"\u252C":(d={},d[1]="M0,.5 L1,.5 M.5,.5 L.5,1",d),"\u2533":(S={},S[3]="M0,.5 L1,.5 M.5,.5 L.5,1",S),"\u2534":(T={},T[1]="M0,.5 L1,.5 M.5,.5 L.5,0",T),"\u253B":(E={},E[3]="M0,.5 L1,.5 M.5,.5 L.5,0",E),"\u253C":(M={},M[1]="M0,.5 L1,.5 M.5,0 L.5,1",M),"\u254B":(D={},D[3]="M0,.5 L1,.5 M.5,0 L.5,1",D),"\u2574":(W={},W[1]="M.5,.5 L0,.5",W),"\u2578":(I={},I[3]="M.5,.5 L0,.5",I),"\u2575":(A={},A[1]="M.5,.5 L.5,0",A),"\u2579":(H={},H[3]="M.5,.5 L.5,0",H),"\u2576":(F={},F[1]="M.5,.5 L1,.5",F),"\u257A":(z={},z[3]="M.5,.5 L1,.5",z),"\u2577":(G={},G[1]="M.5,.5 L.5,1",G),"\u257B":(te={},te[3]="M.5,.5 L.5,1",te),"\u2550":(ce={},ce[1]=function(ne,re){return"M0,"+(.5-re)+" L1,"+(.5-re)+" M0,"+(.5+re)+" L1,"+(.5+re)},ce),"\u2551":(ee={},ee[1]=function(ne,re){return"M"+(.5-ne)+",0 L"+(.5-ne)+",1 M"+(.5+ne)+",0 L"+(.5+ne)+",1"},ee),"\u2552":(fe={},fe[1]=function(ne,re){return"M.5,1 L.5,"+(.5-re)+" L1,"+(.5-re)+" M.5,"+(.5+re)+" L1,"+(.5+re)},fe),"\u2553":(_e={},_e[1]=function(ne,re){return"M"+(.5-ne)+",1 L"+(.5-ne)+",.5 L1,.5 M"+(.5+ne)+",.5 L"+(.5+ne)+",1"},_e),"\u2554":(q={},q[1]=function(ne,re){return"M1,"+(.5-re)+" L"+(.5-ne)+","+(.5-re)+" L"+(.5-ne)+",1 M1,"+(.5+re)+" L"+(.5+ne)+","+(.5+re)+" L"+(.5+ne)+",1"},q),"\u2555":(ve={},ve[1]=function(ne,re){return"M0,"+(.5-re)+" L.5,"+(.5-re)+" L.5,1 M0,"+(.5+re)+" L.5,"+(.5+re)},ve),"\u2556":(de={},de[1]=function(ne,re){return"M"+(.5+ne)+",1 L"+(.5+ne)+",.5 L0,.5 M"+(.5-ne)+",.5 L"+(.5-ne)+",1"},de),"\u2557":(ke={},ke[1]=function(ne,re){return"M0,"+(.5+re)+" L"+(.5-ne)+","+(.5+re)+" L"+(.5-ne)+",1 M0,"+(.5-re)+" L"+(.5+ne)+","+(.5-re)+" L"+(.5+ne)+",1"},ke),"\u2558":($={},$[1]=function(ne,re){return"M.5,0 L.5,"+(.5+re)+" L1,"+(.5+re)+" M.5,"+(.5-re)+" L1,"+(.5-re)},$),"\u2559":(Ie={},Ie[1]=function(ne,re){return"M1,.5 L"+(.5-ne)+",.5 L"+(.5-ne)+",0 M"+(.5+ne)+",.5 L"+(.5+ne)+",0"},Ie),"\u255A":(ge={},ge[1]=function(ne,re){return"M1,"+(.5-re)+" L"+(.5+ne)+","+(.5-re)+" L"+(.5+ne)+",0 M1,"+(.5+re)+" L"+(.5-ne)+","+(.5+re)+" L"+(.5-ne)+",0"},ge),"\u255B":(le={},le[1]=function(ne,re){return"M0,"+(.5+re)+" L.5,"+(.5+re)+" L.5,0 M0,"+(.5-re)+" L.5,"+(.5-re)},le),"\u255C":(V={},V[1]=function(ne,re){return"M0,.5 L"+(.5+ne)+",.5 L"+(.5+ne)+",0 M"+(.5-ne)+",.5 L"+(.5-ne)+",0"},V),"\u255D":(Y={},Y[1]=function(ne,re){return"M0,"+(.5-re)+" L"+(.5-ne)+","+(.5-re)+" L"+(.5-ne)+",0 M0,"+(.5+re)+" L"+(.5+ne)+","+(.5+re)+" L"+(.5+ne)+",0"},Y),"\u255E":(se={},se[1]=function(ne,re){return"M.5,0 L.5,1 M.5,"+(.5-re)+" L1,"+(.5-re)+" M.5,"+(.5+re)+" L1,"+(.5+re)},se),"\u255F":(xe={},xe[1]=function(ne,re){return"M"+(.5-ne)+",0 L"+(.5-ne)+",1 M"+(.5+ne)+",0 L"+(.5+ne)+",1 M"+(.5+ne)+",.5 L1,.5"},xe),"\u2560":(Ee={},Ee[1]=function(ne,re){return"M"+(.5-ne)+",0 L"+(.5-ne)+",1 M1,"+(.5+re)+" L"+(.5+ne)+","+(.5+re)+" L"+(.5+ne)+",1 M1,"+(.5-re)+" L"+(.5+ne)+","+(.5-re)+" L"+(.5+ne)+",0"},Ee),"\u2561":(De={},De[1]=function(ne,re){return"M.5,0 L.5,1 M0,"+(.5-re)+" L.5,"+(.5-re)+" M0,"+(.5+re)+" L.5,"+(.5+re)},De),"\u2562":(je={},je[1]=function(ne,re){return"M0,.5 L"+(.5-ne)+",.5 M"+(.5-ne)+",0 L"+(.5-ne)+",1 M"+(.5+ne)+",0 L"+(.5+ne)+",1"},je),"\u2563":(Re={},Re[1]=function(ne,re){return"M"+(.5+ne)+",0 L"+(.5+ne)+",1 M0,"+(.5+re)+" L"+(.5-ne)+","+(.5+re)+" L"+(.5-ne)+",1 M0,"+(.5-re)+" L"+(.5-ne)+","+(.5-re)+" L"+(.5-ne)+",0"},Re),"\u2564":(Ze={},Ze[1]=function(ne,re){return"M0,"+(.5-re)+" L1,"+(.5-re)+" M0,"+(.5+re)+" L1,"+(.5+re)+" M.5,"+(.5+re)+" L.5,1"},Ze),"\u2565":(we={},we[1]=function(ne,re){return"M0,.5 L1,.5 M"+(.5-ne)+",.5 L"+(.5-ne)+",1 M"+(.5+ne)+",.5 L"+(.5+ne)+",1"},we),"\u2566":($e={},$e[1]=function(ne,re){return"M0,"+(.5-re)+" L1,"+(.5-re)+" M0,"+(.5+re)+" L"+(.5-ne)+","+(.5+re)+" L"+(.5-ne)+",1 M1,"+(.5+re)+" L"+(.5+ne)+","+(.5+re)+" L"+(.5+ne)+",1"},$e),"\u2567":(dt={},dt[1]=function(ne,re){return"M.5,0 L.5,"+(.5-re)+" M0,"+(.5-re)+" L1,"+(.5-re)+" M0,"+(.5+re)+" L1,"+(.5+re)},dt),"\u2568":(Jt={},Jt[1]=function(ne,re){return"M0,.5 L1,.5 M"+(.5-ne)+",.5 L"+(.5-ne)+",0 M"+(.5+ne)+",.5 L"+(.5+ne)+",0"},Jt),"\u2569":(br={},br[1]=function(ne,re){return"M0,"+(.5+re)+" L1,"+(.5+re)+" M0,"+(.5-re)+" L"+(.5-ne)+","+(.5-re)+" L"+(.5-ne)+",0 M1,"+(.5-re)+" L"+(.5+ne)+","+(.5-re)+" L"+(.5+ne)+",0"},br),"\u256A":(lr={},lr[1]=function(ne,re){return"M.5,0 L.5,1 M0,"+(.5-re)+" L1,"+(.5-re)+" M0,"+(.5+re)+" L1,"+(.5+re)},lr),"\u256B":(ai={},ai[1]=function(ne,re){return"M0,.5 L1,.5 M"+(.5-ne)+",0 L"+(.5-ne)+",1 M"+(.5+ne)+",0 L"+(.5+ne)+",1"},ai),"\u256C":(cr={},cr[1]=function(ne,re){return"M0,"+(.5+re)+" L"+(.5-ne)+","+(.5+re)+" L"+(.5-ne)+",1 M1,"+(.5+re)+" L"+(.5+ne)+","+(.5+re)+" L"+(.5+ne)+",1 M0,"+(.5-re)+" L"+(.5-ne)+","+(.5-re)+" L"+(.5-ne)+",0 M1,"+(.5-re)+" L"+(.5+ne)+","+(.5-re)+" L"+(.5+ne)+",0"},cr),"\u2571":(Xe={},Xe[1]="M1,0 L0,1",Xe),"\u2572":(Sr={},Sr[1]="M0,0 L1,1",Sr),"\u2573":(Qt={},Qt[1]="M1,0 L0,1 M0,0 L1,1",Qt),"\u257C":(ur={},ur[1]="M.5,.5 L0,.5",ur[3]="M.5,.5 L1,.5",ur),"\u257D":(Cr={},Cr[1]="M.5,.5 L.5,0",Cr[3]="M.5,.5 L.5,1",Cr),"\u257E":(fr={},fr[1]="M.5,.5 L1,.5",fr[3]="M.5,.5 L0,.5",fr),"\u257F":(li={},li[1]="M.5,.5 L.5,1",li[3]="M.5,.5 L.5,0",li),"\u250D":(Be={},Be[1]="M.5,.5 L.5,1",Be[3]="M.5,.5 L1,.5",Be),"\u250E":(Vr={},Vr[1]="M.5,.5 L1,.5",Vr[3]="M.5,.5 L.5,1",Vr),"\u2511":(Te={},Te[1]="M.5,.5 L.5,1",Te[3]="M.5,.5 L0,.5",Te),"\u2512":(er={},er[1]="M.5,.5 L0,.5",er[3]="M.5,.5 L.5,1",er),"\u2515":(et={},et[1]="M.5,.5 L.5,0",et[3]="M.5,.5 L1,.5",et),"\u2516":(ze={},ze[1]="M.5,.5 L1,.5",ze[3]="M.5,.5 L.5,0",ze),"\u2519":(Ue={},Ue[1]="M.5,.5 L.5,0",Ue[3]="M.5,.5 L0,.5",Ue),"\u251A":(Et={},Et[1]="M.5,.5 L0,.5",Et[3]="M.5,.5 L.5,0",Et),"\u251D":(pt={},pt[1]="M.5,0 L.5,1",pt[3]="M.5,.5 L1,.5",pt),"\u251E":(Ot={},Ot[1]="M0.5,1 L.5,.5 L1,.5",Ot[3]="M.5,.5 L.5,0",Ot),"\u251F":(tt={},tt[1]="M.5,0 L.5,.5 L1,.5",tt[3]="M.5,.5 L.5,1",tt),"\u2520":(Tr={},Tr[1]="M.5,.5 L1,.5",Tr[3]="M.5,0 L.5,1",Tr),"\u2521":(lt={},lt[1]="M.5,.5 L.5,1",lt[3]="M.5,0 L.5,.5 L1,.5",lt),"\u2522":(hr={},hr[1]="M.5,.5 L.5,0",hr[3]="M0.5,1 L.5,.5 L1,.5",hr),"\u2525":(Wr={},Wr[1]="M.5,0 L.5,1",Wr[3]="M.5,.5 L0,.5",Wr),"\u2526":(Dt={},Dt[1]="M0,.5 L.5,.5 L.5,1",Dt[3]="M.5,.5 L.5,0",Dt),"\u2527":(ci={},ci[1]="M.5,0 L.5,.5 L0,.5",ci[3]="M.5,.5 L.5,1",ci),"\u2528":(Ar={},Ar[1]="M.5,.5 L0,.5",Ar[3]="M.5,0 L.5,1",Ar),"\u2529":($r={},$r[1]="M.5,.5 L.5,1",$r[3]="M.5,0 L.5,.5 L0,.5",$r),"\u252A":(Nr={},Nr[1]="M.5,.5 L.5,0",Nr[3]="M0,.5 L.5,.5 L.5,1",Nr),"\u252D":(dr={},dr[1]="M0.5,1 L.5,.5 L1,.5",dr[3]="M.5,.5 L0,.5",dr),"\u252E":(Tt={},Tt[1]="M0,.5 L.5,.5 L.5,1",Tt[3]="M.5,.5 L1,.5",Tt),"\u252F":(pr={},pr[1]="M.5,.5 L.5,1",pr[3]="M0,.5 L1,.5",pr),"\u2530":(Jr={},Jr[1]="M0,.5 L1,.5",Jr[3]="M.5,.5 L.5,1",Jr),"\u2531":(Bt={},Bt[1]="M.5,.5 L1,.5",Bt[3]="M0,.5 L.5,.5 L.5,1",Bt),"\u2532":(ui={},ui[1]="M.5,.5 L0,.5",ui[3]="M0.5,1 L.5,.5 L1,.5",ui),"\u2535":(Mr={},Mr[1]="M.5,0 L.5,.5 L1,.5",Mr[3]="M.5,.5 L0,.5",Mr),"\u2536":(Pt={},Pt[1]="M.5,0 L.5,.5 L0,.5",Pt[3]="M.5,.5 L1,.5",Pt),"\u2537":(It={},It[1]="M.5,.5 L.5,0",It[3]="M0,.5 L1,.5",It),"\u2538":(wr={},wr[1]="M0,.5 L1,.5",wr[3]="M.5,.5 L.5,0",wr),"\u2539":(Rr={},Rr[1]="M.5,.5 L1,.5",Rr[3]="M.5,0 L.5,.5 L0,.5",Rr),"\u253A":(Or={},Or[1]="M.5,.5 L0,.5",Or[3]="M.5,0 L.5,.5 L1,.5",Or),"\u253D":(vr={},vr[1]="M.5,0 L.5,1 M.5,.5 L1,.5",vr[3]="M.5,.5 L0,.5",vr),"\u253E":(Dr={},Dr[1]="M.5,0 L.5,1 M.5,.5 L0,.5",Dr[3]="M.5,.5 L1,.5",Dr),"\u253F":(zt={},zt[1]="M.5,0 L.5,1",zt[3]="M0,.5 L1,.5",zt),"\u2540":(jr={},jr[1]="M0,.5 L1,.5 M.5,.5 L.5,1",jr[3]="M.5,.5 L.5,0",jr),"\u2541":(Br={},Br[1]="M.5,.5 L.5,0 M0,.5 L1,.5",Br[3]="M.5,.5 L.5,1",Br),"\u2542":(qe={},qe[1]="M0,.5 L1,.5",qe[3]="M.5,0 L.5,1",qe),"\u2543":(Le={},Le[1]="M0.5,1 L.5,.5 L1,.5",Le[3]="M.5,0 L.5,.5 L0,.5",Le),"\u2544":(tr={},tr[1]="M0,.5 L.5,.5 L.5,1",tr[3]="M.5,0 L.5,.5 L1,.5",tr),"\u2545":(zr={},zr[1]="M.5,0 L.5,.5 L1,.5",zr[3]="M0,.5 L.5,.5 L.5,1",zr),"\u2546":(Lt={},Lt[1]="M.5,0 L.5,.5 L0,.5",Lt[3]="M0.5,1 L.5,.5 L1,.5",Lt),"\u2547":(j={},j[1]="M.5,.5 L.5,1",j[3]="M.5,.5 L.5,0 M0,.5 L1,.5",j),"\u2548":(Z={},Z[1]="M.5,.5 L.5,0",Z[3]="M0,.5 L1,.5 M.5,.5 L.5,1",Z),"\u2549":(ae={},ae[1]="M.5,.5 L1,.5",ae[3]="M.5,0 L.5,1 M.5,.5 L0,.5",ae),"\u254A":(he={},he[1]="M.5,.5 L0,.5",he[3]="M.5,0 L.5,1 M.5,.5 L1,.5",he),"\u254C":(ie={},ie[1]="M.1,.5 L.4,.5 M.6,.5 L.9,.5",ie),"\u254D":(be={},be[3]="M.1,.5 L.4,.5 M.6,.5 L.9,.5",be),"\u2504":(He={},He[1]="M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5",He),"\u2505":(Je={},Je[3]="M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5",Je),"\u2508":(vt={},vt[1]="M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5",vt),"\u2509":(Ur={},Ur[3]="M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5",Ur),"\u254E":(Wi={},Wi[1]="M.5,.1 L.5,.4 M.5,.6 L.5,.9",Wi),"\u254F":(Oe={},Oe[3]="M.5,.1 L.5,.4 M.5,.6 L.5,.9",Oe),"\u2506":(fn={},fn[1]="M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333",fn),"\u2507":(Ni={},Ni[3]="M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333",Ni),"\u250A":(fi={},fi[1]="M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95",fi),"\u250B":(rr={},rr[3]="M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95",rr),"\u256D":(ji={},ji[1]="C.5,1,.5,.5,1,.5",ji),"\u256E":(zi={},zi[1]="C.5,1,.5,.5,0,.5",zi),"\u256F":(Qr={},Qr[1]="C.5,0,.5,.5,0,.5",Qr),"\u2570":(Ci={},Ci[1]="C.5,0,.5,.5,1,.5",Ci)},f.powerlineDefinitions={"\uE0B0":{d:"M0,0 L1,.5 L0,1",type:0},"\uE0B1":{d:"M0,0 L1,.5 L0,1",type:1,horizontalPadding:.5},"\uE0B2":{d:"M1,0 L0,.5 L1,1",type:0},"\uE0B3":{d:"M1,0 L0,.5 L1,1",type:1,horizontalPadding:.5}},f.tryDrawCustomChar=function(ne,re,nt,Ht,Ut,gt){var rt=f.blockElementDefinitions[re];if(rt)return function(Ge,At,ei,qr,Pr,gr){for(var ot=0;ot7&&parseInt(We.slice(7,9),16)||1;else{if(!We.startsWith("rgba"))throw new Error('Unexpected fillStyle color format "'+We+'" when drawing pattern glyph');hi=(ot=hn(We.substring(5,We.length-1).split(",").map(function(Kr){return parseFloat(Kr)}),4))[0],xr=ot[1],kr=ot[2],qt=ot[3]}for(var or=0;or{Object.defineProperty(f,"__esModule",{value:!0}),f.GridCache=void 0;var k=function(){function m(){this.cache=[]}return m.prototype.resize=function(y,_){for(var g=0;g=0;d--)(n=b[d])&&(h=(a<3?n(h):a>3?n(c,o,h):n(c,o))||h);return a>3&&h&&Object.defineProperty(c,o,h),h},g=this&&this.__param||function(b,c){return function(o,l){c(o,l,b)}};Object.defineProperty(f,"__esModule",{value:!0}),f.LinkRenderLayer=void 0;var x=k(1546),C=k(8803),u=k(2040),p=k(2585),w=function(b){function c(o,l,n,a,h,d,S,T,E){var M=b.call(this,o,"link",l,!0,n,a,S,T,E)||this;return h.onShowLinkUnderline(function(D){return M._onShowLinkUnderline(D)}),h.onHideLinkUnderline(function(D){return M._onHideLinkUnderline(D)}),d.onShowLinkUnderline(function(D){return M._onShowLinkUnderline(D)}),d.onHideLinkUnderline(function(D){return M._onHideLinkUnderline(D)}),M}return y(c,b),c.prototype.resize=function(o){b.prototype.resize.call(this,o),this._state=void 0},c.prototype.reset=function(){this._clearCurrentLink()},c.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var o=this._state.y2-this._state.y1-1;o>0&&this._clearCells(0,this._state.y1+1,this._state.cols,o),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},c.prototype._onShowLinkUnderline=function(o){if(o.fg===C.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:o.fg&&(0,u.is256Color)(o.fg)?this._ctx.fillStyle=this._colors.ansi[o.fg].css:this._ctx.fillStyle=this._colors.foreground.css,o.y1===o.y2)this._fillBottomLineAtCells(o.x1,o.y1,o.x2-o.x1);else{this._fillBottomLineAtCells(o.x1,o.y1,o.cols-o.x1);for(var l=o.y1+1;l=0;I--)(M=d[I])&&(W=(D<3?M(W):D>3?M(S,T,W):M(S,T))||W);return D>3&&W&&Object.defineProperty(S,T,W),W},g=this&&this.__param||function(d,S){return function(T,E){S(T,E,d)}},x=this&&this.__values||function(d){var S=typeof Symbol=="function"&&Symbol.iterator,T=S&&d[S],E=0;if(T)return T.call(d);if(d&&typeof d.length=="number")return{next:function(){return d&&E>=d.length&&(d=void 0),{value:d&&d[E++],done:!d}}};throw new TypeError(S?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.Renderer=void 0;var C=k(9596),u=k(4149),p=k(2512),w=k(5098),b=k(844),c=k(4725),o=k(2585),l=k(1420),n=k(8460),a=1,h=function(d){function S(T,E,M,D,W,I,A,H){var F=d.call(this)||this;F._colors=T,F._screenElement=E,F._bufferService=I,F._charSizeService=A,F._optionsService=H,F._id=a++,F._onRequestRedraw=new n.EventEmitter;var z=F._optionsService.rawOptions.allowTransparency;return F._renderLayers=[W.createInstance(C.TextRenderLayer,F._screenElement,0,F._colors,z,F._id),W.createInstance(u.SelectionRenderLayer,F._screenElement,1,F._colors,F._id),W.createInstance(w.LinkRenderLayer,F._screenElement,2,F._colors,F._id,M,D),W.createInstance(p.CursorRenderLayer,F._screenElement,3,F._colors,F._id,F._onRequestRedraw)],F.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},F._devicePixelRatio=window.devicePixelRatio,F._updateDimensions(),F.onOptionsChanged(),F}return y(S,d),Object.defineProperty(S.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),S.prototype.dispose=function(){var T,E;try{for(var M=x(this._renderLayers),D=M.next();!D.done;D=M.next())D.value.dispose()}catch(W){T={error:W}}finally{try{D&&!D.done&&(E=M.return)&&E.call(M)}finally{if(T)throw T.error}}d.prototype.dispose.call(this),(0,l.removeTerminalFromCache)(this._id)},S.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},S.prototype.setColors=function(T){var E,M;this._colors=T;try{for(var D=x(this._renderLayers),W=D.next();!W.done;W=D.next()){var I=W.value;I.setColors(this._colors),I.reset()}}catch(A){E={error:A}}finally{try{W&&!W.done&&(M=D.return)&&M.call(D)}finally{if(E)throw E.error}}},S.prototype.onResize=function(T,E){var M,D;this._updateDimensions();try{for(var W=x(this._renderLayers),I=W.next();!I.done;I=W.next())I.value.resize(this.dimensions)}catch(A){M={error:A}}finally{try{I&&!I.done&&(D=W.return)&&D.call(W)}finally{if(M)throw M.error}}this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},S.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},S.prototype.onBlur=function(){this._runOperation(function(T){return T.onBlur()})},S.prototype.onFocus=function(){this._runOperation(function(T){return T.onFocus()})},S.prototype.onSelectionChanged=function(T,E,M){M===void 0&&(M=!1),this._runOperation(function(D){return D.onSelectionChanged(T,E,M)}),this._colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})},S.prototype.onCursorMove=function(){this._runOperation(function(T){return T.onCursorMove()})},S.prototype.onOptionsChanged=function(){this._runOperation(function(T){return T.onOptionsChanged()})},S.prototype.clear=function(){this._runOperation(function(T){return T.reset()})},S.prototype._runOperation=function(T){var E,M;try{for(var D=x(this._renderLayers),W=D.next();!W.done;W=D.next())T(W.value)}catch(I){E={error:I}}finally{try{W&&!W.done&&(M=D.return)&&M.call(D)}finally{if(E)throw E.error}}},S.prototype.renderRows=function(T,E){var M,D;try{for(var W=x(this._renderLayers),I=W.next();!I.done;I=W.next())I.value.onGridChanged(T,E)}catch(A){M={error:A}}finally{try{I&&!I.done&&(D=W.return)&&D.call(W)}finally{if(M)throw M.error}}},S.prototype.clearTextureAtlas=function(){var T,E;try{for(var M=x(this._renderLayers),D=M.next();!D.done;D=M.next())D.value.clearTextureAtlas()}catch(W){T={error:W}}finally{try{D&&!D.done&&(E=M.return)&&E.call(M)}finally{if(T)throw T.error}}},S.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharTop=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},_([g(4,o.IInstantiationService),g(5,o.IBufferService),g(6,c.ICharSizeService),g(7,o.IOptionsService)],S)}(b.Disposable);f.Renderer=h},1752:(R,f)=>{function k(m){return 57508<=m&&m<=57558}Object.defineProperty(f,"__esModule",{value:!0}),f.excludeFromContrastRatioDemands=f.isPowerlineGlyph=f.throwIfFalsy=void 0,f.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},f.isPowerlineGlyph=k,f.excludeFromContrastRatioDemands=function(m){return k(m)||function(y){return 9472<=y&&y<=9631}(m)}},4149:function(R,f,k){var m,y=this&&this.__extends||(m=function(p,w){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,c){b.__proto__=c}||function(b,c){for(var o in c)Object.prototype.hasOwnProperty.call(c,o)&&(b[o]=c[o])},m(p,w)},function(p,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");function b(){this.constructor=p}m(p,w),p.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}),_=this&&this.__decorate||function(p,w,b,c){var o,l=arguments.length,n=l<3?w:c===null?c=Object.getOwnPropertyDescriptor(w,b):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(p,w,b,c);else for(var a=p.length-1;a>=0;a--)(o=p[a])&&(n=(l<3?o(n):l>3?o(w,b,n):o(w,b))||n);return l>3&&n&&Object.defineProperty(w,b,n),n},g=this&&this.__param||function(p,w){return function(b,c){w(b,c,p)}};Object.defineProperty(f,"__esModule",{value:!0}),f.SelectionRenderLayer=void 0;var x=k(1546),C=k(2585),u=function(p){function w(b,c,o,l,n,a,h){var d=p.call(this,b,"selection",c,!0,o,l,n,a,h)||this;return d._clearState(),d}return y(w,p),w.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},w.prototype.resize=function(b){p.prototype.resize.call(this,b),this._clearState()},w.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},w.prototype.onSelectionChanged=function(b,c,o){if(p.prototype.onSelectionChanged.call(this,b,c,o),this._didStateChange(b,c,o,this._bufferService.buffer.ydisp))if(this._clearAll(),b&&c){var l=b[1]-this._bufferService.buffer.ydisp,n=c[1]-this._bufferService.buffer.ydisp,a=Math.max(l,0),h=Math.min(n,this._bufferService.rows-1);if(a>=this._bufferService.rows||h<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=this._colors.selectionTransparent.css,o){var d=b[0],S=c[0]-d,T=h-a+1;this._fillCells(d,a,S,T)}else{d=l===a?b[0]:0;var E=a===n?c[0]:this._bufferService.cols;this._fillCells(d,a,E-d,1);var M=Math.max(h-a-1,0);if(this._fillCells(0,a+1,this._bufferService.cols,M),a!==h){var D=n===h?c[0]:this._bufferService.cols;this._fillCells(0,h,D,1)}}this._state.start=[b[0],b[1]],this._state.end=[c[0],c[1]],this._state.columnSelectMode=o,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},w.prototype._didStateChange=function(b,c,o,l){return!this._areCoordinatesEqual(b,this._state.start)||!this._areCoordinatesEqual(c,this._state.end)||o!==this._state.columnSelectMode||l!==this._state.ydisp},w.prototype._areCoordinatesEqual=function(b,c){return!(!b||!c)&&b[0]===c[0]&&b[1]===c[1]},_([g(4,C.IBufferService),g(5,C.IOptionsService),g(6,C.IDecorationService)],w)}(x.BaseRenderLayer);f.SelectionRenderLayer=u},9596:function(R,f,k){var m,y=this&&this.__extends||(m=function(a,h){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,S){d.__proto__=S}||function(d,S){for(var T in S)Object.prototype.hasOwnProperty.call(S,T)&&(d[T]=S[T])},m(a,h)},function(a,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");function d(){this.constructor=a}m(a,h),a.prototype=h===null?Object.create(h):(d.prototype=h.prototype,new d)}),_=this&&this.__decorate||function(a,h,d,S){var T,E=arguments.length,M=E<3?h:S===null?S=Object.getOwnPropertyDescriptor(h,d):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(a,h,d,S);else for(var D=a.length-1;D>=0;D--)(T=a[D])&&(M=(E<3?T(M):E>3?T(h,d,M):T(h,d))||M);return E>3&&M&&Object.defineProperty(h,d,M),M},g=this&&this.__param||function(a,h){return function(d,S){h(d,S,a)}},x=this&&this.__values||function(a){var h=typeof Symbol=="function"&&Symbol.iterator,d=h&&a[h],S=0;if(d)return d.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&S>=a.length&&(a=void 0),{value:a&&a[S++],done:!a}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.TextRenderLayer=void 0;var C=k(3700),u=k(1546),p=k(3734),w=k(643),b=k(511),c=k(2585),o=k(4725),l=k(4269),n=function(a){function h(d,S,T,E,M,D,W,I,A){var H=a.call(this,d,"text",S,E,T,M,D,W,A)||this;return H._characterJoinerService=I,H._characterWidth=0,H._characterFont="",H._characterOverlapCache={},H._workCell=new b.CellData,H._state=new C.GridCache,H}return y(h,a),h.prototype.resize=function(d){a.prototype.resize.call(this,d);var S=this._getFont(!1,!1);this._characterWidth===d.scaledCharWidth&&this._characterFont===S||(this._characterWidth=d.scaledCharWidth,this._characterFont=S,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},h.prototype.reset=function(){this._state.clear(),this._clearAll()},h.prototype._forEachCell=function(d,S,T){for(var E=d;E<=S;E++)for(var M=E+this._bufferService.buffer.ydisp,D=this._bufferService.buffer.lines.get(M),W=this._characterJoinerService.getJoinedCharacters(M),I=0;I0&&I===W[0][0]){H=!0;var z=W.shift();A=new l.JoinedCellData(this._workCell,D.translateToString(!0,z[0],z[1]),z[1]-z[0]),F=z[1]-1}!H&&this._isOverlapping(A)&&Fthis._characterWidth;return this._ctx.restore(),this._characterOverlapCache[S]=T,T},_([g(5,c.IBufferService),g(6,c.IOptionsService),g(7,o.ICharacterJoinerService),g(8,c.IDecorationService)],h)}(u.BaseRenderLayer);f.TextRenderLayer=n},9616:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BaseCharAtlas=void 0;var k=function(){function m(){this._didWarmUp=!1}return m.prototype.dispose=function(){},m.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},m.prototype._doWarmUp=function(){},m.prototype.clear=function(){},m.prototype.beginFrame=function(){},m}();f.BaseCharAtlas=k},1420:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.removeTerminalFromCache=f.acquireCharAtlas=void 0;var m=k(2040),y=k(1906),_=[];f.acquireCharAtlas=function(g,x,C,u,p){for(var w=(0,m.generateConfig)(u,p,g,C),b=0;b<_.length;b++){var c=(o=_[b]).ownedBy.indexOf(x);if(c>=0){if((0,m.configEquals)(o.config,w))return o.atlas;o.ownedBy.length===1?(o.atlas.dispose(),_.splice(b,1)):o.ownedBy.splice(c,1);break}}for(b=0;b<_.length;b++){var o=_[b];if((0,m.configEquals)(o.config,w))return o.ownedBy.push(x),o.atlas}var l={atlas:new y.DynamicCharAtlas(document,w),config:w,ownedBy:[x]};return _.push(l),l.atlas},f.removeTerminalFromCache=function(g){for(var x=0;x<_.length;x++){var C=_[x].ownedBy.indexOf(g);if(C!==-1){_[x].ownedBy.length===1?(_[x].atlas.dispose(),_.splice(x,1)):_[x].ownedBy.splice(C,1);break}}}},2040:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.is256Color=f.configEquals=f.generateConfig=void 0;var m=k(643);f.generateConfig=function(y,_,g,x){var C={foreground:x.foreground,background:x.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:x.ansi.slice()};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:y,scaledCharHeight:_,fontFamily:g.fontFamily,fontSize:g.fontSize,fontWeight:g.fontWeight,fontWeightBold:g.fontWeightBold,allowTransparency:g.allowTransparency,colors:C}},f.configEquals=function(y,_){for(var g=0;g{Object.defineProperty(f,"__esModule",{value:!0}),f.CHAR_ATLAS_CELL_SPACING=f.TEXT_BASELINE=f.DIM_OPACITY=f.INVERTED_DEFAULT_COLOR=void 0;var m=k(6114);f.INVERTED_DEFAULT_COLOR=257,f.DIM_OPACITY=.5,f.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic",f.CHAR_ATLAS_CELL_SPACING=1},1906:function(R,f,k){var m,y=this&&this.__extends||(m=function(d,S){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,E){T.__proto__=E}||function(T,E){for(var M in E)Object.prototype.hasOwnProperty.call(E,M)&&(T[M]=E[M])},m(d,S)},function(d,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function T(){this.constructor=d}m(d,S),d.prototype=S===null?Object.create(S):(T.prototype=S.prototype,new T)});Object.defineProperty(f,"__esModule",{value:!0}),f.NoneCharAtlas=f.DynamicCharAtlas=f.getGlyphCacheKey=void 0;var _=k(8803),g=k(9616),x=k(5680),C=k(7001),u=k(6114),p=k(1752),w=k(8055),b=1024,c=1024,o={css:"rgba(0, 0, 0, 0)",rgba:0};function l(d){return d.code<<21|d.bg<<12|d.fg<<3|(d.bold?0:4)+(d.dim?0:2)+(d.italic?0:1)}f.getGlyphCacheKey=l;var n=function(d){function S(T,E){var M=d.call(this)||this;M._config=E,M._drawToCacheCount=0,M._glyphsWaitingOnBitmap=[],M._bitmapCommitTimeout=null,M._bitmap=null,M._cacheCanvas=T.createElement("canvas"),M._cacheCanvas.width=b,M._cacheCanvas.height=c,M._cacheCtx=(0,p.throwIfFalsy)(M._cacheCanvas.getContext("2d",{alpha:!0}));var D=T.createElement("canvas");D.width=M._config.scaledCharWidth,D.height=M._config.scaledCharHeight,M._tmpCtx=(0,p.throwIfFalsy)(D.getContext("2d",{alpha:M._config.allowTransparency})),M._width=Math.floor(b/M._config.scaledCharWidth),M._height=Math.floor(c/M._config.scaledCharHeight);var W=M._width*M._height;return M._cacheMap=new C.LRUMap(W),M._cacheMap.prealloc(W),M}return y(S,d),S.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},S.prototype.beginFrame=function(){this._drawToCacheCount=0},S.prototype.clear=function(){if(this._cacheMap.size>0){var T=this._width*this._height;this._cacheMap=new C.LRUMap(T),this._cacheMap.prealloc(T)}this._cacheCtx.clearRect(0,0,b,c),this._tmpCtx.clearRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight)},S.prototype.draw=function(T,E,M,D){if(E.code===32)return!0;if(!this._canCache(E))return!1;var W=l(E),I=this._cacheMap.get(W);if(I!=null)return this._drawFromCache(T,I,M,D),!0;if(this._drawToCacheCount<100){var A;A=this._cacheMap.size>>24,M=S.rgba>>>16&255,D=S.rgba>>>8&255,W=0;W{Object.defineProperty(f,"__esModule",{value:!0}),f.LRUMap=void 0;var k=function(){function m(y){this.capacity=y,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return m.prototype._unlinkNode=function(y){var _=y.prev,g=y.next;y===this._head&&(this._head=g),y===this._tail&&(this._tail=_),_!==null&&(_.next=g),g!==null&&(g.prev=_)},m.prototype._appendNode=function(y){var _=this._tail;_!==null&&(_.next=y),y.prev=_,y.next=null,this._tail=y,this._head===null&&(this._head=y)},m.prototype.prealloc=function(y){for(var _=this._nodePool,g=0;g=this.capacity)g=this._head,this._unlinkNode(g),delete this._map[g.key],g.key=y,g.value=_,this._map[y]=g;else{var x=this._nodePool;x.length>0?((g=x.pop()).key=y,g.value=_):g={prev:null,next:null,key:y,value:_},this._map[y]=g,this.size++}this._appendNode(g)},m}();f.LRUMap=k},1296:function(R,f,k){var m,y=this&&this.__extends||(m=function(E,M){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,W){D.__proto__=W}||function(D,W){for(var I in W)Object.prototype.hasOwnProperty.call(W,I)&&(D[I]=W[I])},m(E,M)},function(E,M){if(typeof M!="function"&&M!==null)throw new TypeError("Class extends value "+String(M)+" is not a constructor or null");function D(){this.constructor=E}m(E,M),E.prototype=M===null?Object.create(M):(D.prototype=M.prototype,new D)}),_=this&&this.__decorate||function(E,M,D,W){var I,A=arguments.length,H=A<3?M:W===null?W=Object.getOwnPropertyDescriptor(M,D):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(E,M,D,W);else for(var F=E.length-1;F>=0;F--)(I=E[F])&&(H=(A<3?I(H):A>3?I(M,D,H):I(M,D))||H);return A>3&&H&&Object.defineProperty(M,D,H),H},g=this&&this.__param||function(E,M){return function(D,W){M(D,W,E)}},x=this&&this.__values||function(E){var M=typeof Symbol=="function"&&Symbol.iterator,D=M&&E[M],W=0;if(D)return D.call(E);if(E&&typeof E.length=="number")return{next:function(){return E&&W>=E.length&&(E=void 0),{value:E&&E[W++],done:!E}}};throw new TypeError(M?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.DomRenderer=void 0;var C=k(3787),u=k(8803),p=k(844),w=k(4725),b=k(2585),c=k(8460),o=k(8055),l=k(9631),n="xterm-dom-renderer-owner-",a="xterm-fg-",h="xterm-bg-",d="xterm-focus",S=1,T=function(E){function M(D,W,I,A,H,F,z,G,te,ce){var ee=E.call(this)||this;return ee._colors=D,ee._element=W,ee._screenElement=I,ee._viewportElement=A,ee._linkifier=H,ee._linkifier2=F,ee._charSizeService=G,ee._optionsService=te,ee._bufferService=ce,ee._terminalClass=S++,ee._rowElements=[],ee._rowContainer=document.createElement("div"),ee._rowContainer.classList.add("xterm-rows"),ee._rowContainer.style.lineHeight="normal",ee._rowContainer.setAttribute("aria-hidden","true"),ee._refreshRowElements(ee._bufferService.cols,ee._bufferService.rows),ee._selectionContainer=document.createElement("div"),ee._selectionContainer.classList.add("xterm-selection"),ee._selectionContainer.setAttribute("aria-hidden","true"),ee.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},ee._updateDimensions(),ee._injectCss(),ee._rowFactory=z.createInstance(C.DomRendererRowFactory,document,ee._colors),ee._element.classList.add(n+ee._terminalClass),ee._screenElement.appendChild(ee._rowContainer),ee._screenElement.appendChild(ee._selectionContainer),ee.register(ee._linkifier.onShowLinkUnderline(function(fe){return ee._onLinkHover(fe)})),ee.register(ee._linkifier.onHideLinkUnderline(function(fe){return ee._onLinkLeave(fe)})),ee.register(ee._linkifier2.onShowLinkUnderline(function(fe){return ee._onLinkHover(fe)})),ee.register(ee._linkifier2.onHideLinkUnderline(function(fe){return ee._onLinkLeave(fe)})),ee}return y(M,E),Object.defineProperty(M.prototype,"onRequestRedraw",{get:function(){return new c.EventEmitter().event},enumerable:!1,configurable:!0}),M.prototype.dispose=function(){this._element.classList.remove(n+this._terminalClass),(0,l.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),E.prototype.dispose.call(this)},M.prototype._updateDimensions=function(){var D,W;this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;try{for(var I=x(this._rowElements),A=I.next();!A.done;A=I.next()){var H=A.value;H.style.width=this.dimensions.canvasWidth+"px",H.style.height=this.dimensions.actualCellHeight+"px",H.style.lineHeight=this.dimensions.actualCellHeight+"px",H.style.overflow="hidden"}}catch(z){D={error:z}}finally{try{A&&!A.done&&(W=I.return)&&W.call(I)}finally{if(D)throw D.error}}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var F=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.textContent=F,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},M.prototype.setColors=function(D){this._colors=D,this._injectCss()},M.prototype._injectCss=function(){var D=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var W=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.rawOptions.fontFamily+"; font-size: "+this._optionsService.rawOptions.fontSize+"px;}";W+=this._terminalSelector+" span:not(."+C.BOLD_CLASS+") { font-weight: "+this._optionsService.rawOptions.fontWeight+";}"+this._terminalSelector+" span."+C.BOLD_CLASS+" { font-weight: "+this._optionsService.rawOptions.fontWeightBold+";}"+this._terminalSelector+" span."+C.ITALIC_CLASS+" { font-style: italic;}",W+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",W+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",W+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+C.CURSOR_CLASS+"."+C.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+C.CURSOR_CLASS+"."+C.CURSOR_BLINK_CLASS+":not(."+C.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+C.CURSOR_CLASS+"."+C.CURSOR_BLINK_CLASS+"."+C.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+C.CURSOR_CLASS+"."+C.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+C.CURSOR_CLASS+"."+C.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.rawOptions.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+C.CURSOR_CLASS+"."+C.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",W+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionOpaque.css+";}",this._colors.ansi.forEach(function(I,A){W+=D._terminalSelector+" ."+a+A+" { color: "+I.css+"; }"+D._terminalSelector+" ."+h+A+" { background-color: "+I.css+"; }"}),W+=this._terminalSelector+" ."+a+u.INVERTED_DEFAULT_COLOR+" { color: "+o.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" ."+h+u.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.textContent=W},M.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},M.prototype._refreshRowElements=function(D,W){for(var I=this._rowElements.length;I<=W;I++){var A=document.createElement("div");this._rowContainer.appendChild(A),this._rowElements.push(A)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())},M.prototype.onResize=function(D,W){this._refreshRowElements(D,W),this._updateDimensions()},M.prototype.onCharSizeChanged=function(){this._updateDimensions()},M.prototype.onBlur=function(){this._rowContainer.classList.remove(d)},M.prototype.onFocus=function(){this._rowContainer.classList.add(d)},M.prototype.onSelectionChanged=function(D,W,I){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(D,W,I),this.renderRows(0,this._bufferService.rows-1),D&&W){var A=D[1]-this._bufferService.buffer.ydisp,H=W[1]-this._bufferService.buffer.ydisp,F=Math.max(A,0),z=Math.min(H,this._bufferService.rows-1);if(!(F>=this._bufferService.rows||z<0)){var G=document.createDocumentFragment();if(I){var te=D[0]>W[0];G.appendChild(this._createSelectionElement(F,te?W[0]:D[0],te?D[0]:W[0],z-F+1))}else{var ce=A===F?D[0]:0,ee=F===H?W[0]:this._bufferService.cols;G.appendChild(this._createSelectionElement(F,ce,ee));var fe=z-F-1;if(G.appendChild(this._createSelectionElement(F+1,0,this._bufferService.cols,fe)),F!==z){var _e=H===z?W[0]:this._bufferService.cols;G.appendChild(this._createSelectionElement(z,0,_e))}}this._selectionContainer.appendChild(G)}}},M.prototype._createSelectionElement=function(D,W,I,A){A===void 0&&(A=1);var H=document.createElement("div");return H.style.height=A*this.dimensions.actualCellHeight+"px",H.style.top=D*this.dimensions.actualCellHeight+"px",H.style.left=W*this.dimensions.actualCellWidth+"px",H.style.width=this.dimensions.actualCellWidth*(I-W)+"px",H},M.prototype.onCursorMove=function(){},M.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},M.prototype.clear=function(){var D,W;try{for(var I=x(this._rowElements),A=I.next();!A.done;A=I.next())A.value.innerText=""}catch(H){D={error:H}}finally{try{A&&!A.done&&(W=I.return)&&W.call(I)}finally{if(D)throw D.error}}},M.prototype.renderRows=function(D,W){for(var I=this._bufferService.buffer.ybase+this._bufferService.buffer.y,A=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,F=D;F<=W;F++){var z=this._rowElements[F];z.innerText="";var G=F+this._bufferService.buffer.ydisp,te=this._bufferService.buffer.lines.get(G),ce=this._optionsService.rawOptions.cursorStyle;z.appendChild(this._rowFactory.createRow(te,G,G===I,ce,A,H,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(M.prototype,"_terminalSelector",{get:function(){return"."+n+this._terminalClass},enumerable:!1,configurable:!0}),M.prototype._onLinkHover=function(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)},M.prototype._onLinkLeave=function(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)},M.prototype._setCellUnderline=function(D,W,I,A,H,F){for(;D!==W||I!==A;){var z=this._rowElements[I];if(!z)return;var G=z.children[D];G&&(G.style.textDecoration=F?"underline":"none"),++D>=H&&(D=0,I++)}},_([g(6,b.IInstantiationService),g(7,w.ICharSizeService),g(8,b.IOptionsService),g(9,b.IBufferService)],M)}(p.Disposable);f.DomRenderer=T},3787:function(R,f,k){var m=this&&this.__decorate||function(n,a,h,d){var S,T=arguments.length,E=T<3?a:d===null?d=Object.getOwnPropertyDescriptor(a,h):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(n,a,h,d);else for(var M=n.length-1;M>=0;M--)(S=n[M])&&(E=(T<3?S(E):T>3?S(a,h,E):S(a,h))||E);return T>3&&E&&Object.defineProperty(a,h,E),E},y=this&&this.__param||function(n,a){return function(h,d){a(h,d,n)}},_=this&&this.__values||function(n){var a=typeof Symbol=="function"&&Symbol.iterator,h=a&&n[a],d=0;if(h)return h.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&d>=n.length&&(n=void 0),{value:n&&n[d++],done:!n}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.DomRendererRowFactory=f.CURSOR_STYLE_UNDERLINE_CLASS=f.CURSOR_STYLE_BAR_CLASS=f.CURSOR_STYLE_BLOCK_CLASS=f.CURSOR_BLINK_CLASS=f.CURSOR_CLASS=f.STRIKETHROUGH_CLASS=f.UNDERLINE_CLASS=f.ITALIC_CLASS=f.DIM_CLASS=f.BOLD_CLASS=void 0;var g=k(8803),x=k(643),C=k(511),u=k(2585),p=k(8055),w=k(4725),b=k(4269),c=k(1752);f.BOLD_CLASS="xterm-bold",f.DIM_CLASS="xterm-dim",f.ITALIC_CLASS="xterm-italic",f.UNDERLINE_CLASS="xterm-underline",f.STRIKETHROUGH_CLASS="xterm-strikethrough",f.CURSOR_CLASS="xterm-cursor",f.CURSOR_BLINK_CLASS="xterm-cursor-blink",f.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",f.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",f.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var o=function(){function n(a,h,d,S,T,E){this._document=a,this._colors=h,this._characterJoinerService=d,this._optionsService=S,this._coreService=T,this._decorationService=E,this._workCell=new C.CellData,this._columnSelectMode=!1}return n.prototype.setColors=function(a){this._colors=a},n.prototype.onSelectionChanged=function(a,h,d){this._selectionStart=a,this._selectionEnd=h,this._columnSelectMode=d},n.prototype.createRow=function(a,h,d,S,T,E,M,D){for(var W,I,A=this._document.createDocumentFragment(),H=this._characterJoinerService.getJoinedCharacters(h),F=0,z=Math.min(a.length,D)-1;z>=0;z--)if(a.loadCell(z,this._workCell).getCode()!==x.NULL_CELL_CODE||d&&z===T){F=z+1;break}for(z=0;z0&&z===H[0][0]){te=!0;var fe=H.shift();ee=new b.JoinedCellData(this._workCell,a.translateToString(!0,fe[0],fe[1]),fe[1]-fe[0]),ce=fe[1]-1,G=ee.getWidth()}var _e=this._document.createElement("span");if(G>1&&(_e.style.width=M*G+"px"),te&&(_e.style.display="inline",T>=z&&T<=ce&&(T=z)),!this._coreService.isCursorHidden&&d&&z===T)switch(_e.classList.add(f.CURSOR_CLASS),E&&_e.classList.add(f.CURSOR_BLINK_CLASS),S){case"bar":_e.classList.add(f.CURSOR_STYLE_BAR_CLASS);break;case"underline":_e.classList.add(f.CURSOR_STYLE_UNDERLINE_CLASS);break;default:_e.classList.add(f.CURSOR_STYLE_BLOCK_CLASS)}ee.isBold()&&_e.classList.add(f.BOLD_CLASS),ee.isItalic()&&_e.classList.add(f.ITALIC_CLASS),ee.isDim()&&_e.classList.add(f.DIM_CLASS),ee.isUnderline()&&_e.classList.add(f.UNDERLINE_CLASS),ee.isInvisible()?_e.textContent=x.WHITESPACE_CELL_CHAR:_e.textContent=ee.getChars()||x.WHITESPACE_CELL_CHAR,ee.isStrikethrough()&&_e.classList.add(f.STRIKETHROUGH_CLASS);var q=ee.getFgColor(),ve=ee.getFgColorMode(),de=ee.getBgColor(),ke=ee.getBgColorMode(),$=!!ee.isInverse();if($){var Ie=q;q=de,de=Ie;var ge=ve;ve=ke,ke=ge}var le=void 0,V=void 0,Y=!1;try{for(var se=(W=void 0,_(this._decorationService.getDecorationsAtCell(z,h))),xe=se.next();!xe.done;xe=se.next()){var Ee=xe.value;Ee.options.layer!=="top"&&Y||(Ee.backgroundColorRGB&&(ke=50331648,de=Ee.backgroundColorRGB.rgba>>8&16777215,le=Ee.backgroundColorRGB),Ee.foregroundColorRGB&&(ve=50331648,q=Ee.foregroundColorRGB.rgba>>8&16777215,V=Ee.foregroundColorRGB),Y=Ee.options.layer==="top")}}catch(Ze){W={error:Ze}}finally{try{xe&&!xe.done&&(I=se.return)&&I.call(se)}finally{if(W)throw W.error}}var De=this._isCellInSelection(z,h);Y||this._colors.selectionForeground&&De&&(ve=50331648,q=this._colors.selectionForeground.rgba>>8&16777215,V=this._colors.selectionForeground),De&&(le=this._colors.selectionOpaque,Y=!0),Y&&_e.classList.add("xterm-decoration-top");var je=void 0;switch(ke){case 16777216:case 33554432:je=this._colors.ansi[de],_e.classList.add("xterm-bg-"+de);break;case 50331648:je=p.rgba.toColor(de>>16,de>>8&255,255&de),this._addStyle(_e,"background-color:#"+l((de>>>0).toString(16),"0",6));break;default:$?(je=this._colors.foreground,_e.classList.add("xterm-bg-"+g.INVERTED_DEFAULT_COLOR)):je=this._colors.background}switch(ve){case 16777216:case 33554432:ee.isBold()&&q<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(q+=8),this._applyMinimumContrast(_e,je,this._colors.ansi[q],ee,le,void 0)||_e.classList.add("xterm-fg-"+q);break;case 50331648:var Re=p.rgba.toColor(q>>16&255,q>>8&255,255&q);this._applyMinimumContrast(_e,je,Re,ee,le,V)||this._addStyle(_e,"color:#"+l(q.toString(16),"0",6));break;default:this._applyMinimumContrast(_e,je,this._colors.foreground,ee,le,void 0)||$&&_e.classList.add("xterm-fg-"+g.INVERTED_DEFAULT_COLOR)}A.appendChild(_e),z=ce}}return A},n.prototype._applyMinimumContrast=function(a,h,d,S,T,E){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,c.excludeFromContrastRatioDemands)(S.getCode()))return!1;var M=void 0;return T||E||(M=this._colors.contrastCache.getColor(h.rgba,d.rgba)),M===void 0&&(M=p.color.ensureContrastRatio(T||h,E||d,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((T||h).rgba,(E||d).rgba,M??null)),!!M&&(this._addStyle(a,"color:"+M.css),!0)},n.prototype._addStyle=function(a,h){a.setAttribute("style",""+(a.getAttribute("style")||"")+h+";")},n.prototype._isCellInSelection=function(a,h){var d=this._selectionStart,S=this._selectionEnd;return!(!d||!S)&&(this._columnSelectMode?d[0]<=S[0]?a>=d[0]&&h>=d[1]&&a=d[1]&&a>=S[0]&&h<=S[1]:h>d[1]&&h=d[0]&&a=d[0])},m([y(2,w.ICharacterJoinerService),y(3,u.IOptionsService),y(4,u.ICoreService),y(5,u.IDecorationService)],n)}();function l(n,a,h){for(;n.length{Object.defineProperty(f,"__esModule",{value:!0}),f.SelectionModel=void 0;var k=function(){function m(y){this._bufferService=y,this.isSelectAllActive=!1,this.selectionStartLength=0}return m.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(m.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"finalSelectionEnd",{get:function(){return this.isSelectAllActive?[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1]:this.selectionStart?!this.selectionEnd||this.areSelectionValuesReversed()?(y=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?y%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(y/this._bufferService.cols)-1]:[y%this._bufferService.cols,this.selectionStart[1]+Math.floor(y/this._bufferService.cols)]:[y,this.selectionStart[1]]:this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?(y=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?[y%this._bufferService.cols,this.selectionStart[1]+Math.floor(y/this._bufferService.cols)]:[Math.max(y,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd:void 0;var y},enumerable:!1,configurable:!0}),m.prototype.areSelectionValuesReversed=function(){var y=this.selectionStart,_=this.selectionEnd;return!(!y||!_)&&(y[1]>_[1]||y[1]===_[1]&&y[0]>_[0])},m.prototype.onTrim=function(y){return this.selectionStart&&(this.selectionStart[1]-=y),this.selectionEnd&&(this.selectionEnd[1]-=y),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},m}();f.SelectionModel=k},428:function(R,f,k){var m=this&&this.__decorate||function(u,p,w,b){var c,o=arguments.length,l=o<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(u,p,w,b);else for(var n=u.length-1;n>=0;n--)(c=u[n])&&(l=(o<3?c(l):o>3?c(p,w,l):c(p,w))||l);return o>3&&l&&Object.defineProperty(p,w,l),l},y=this&&this.__param||function(u,p){return function(w,b){p(w,b,u)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CharSizeService=void 0;var _=k(2585),g=k(8460),x=function(){function u(p,w,b){this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=new g.EventEmitter,this._measureStrategy=new C(p,w,this._optionsService)}return Object.defineProperty(u.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),u.prototype.measure=function(){var p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())},m([y(2,_.IOptionsService)],u)}();f.CharSizeService=x;var C=function(){function u(p,w,b){this._document=p,this._parentElement=w,this._optionsService=b,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return u.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var p=this._measureElement.getBoundingClientRect();return p.width!==0&&p.height!==0&&(this._result.width=p.width,this._result.height=Math.ceil(p.height)),this._result},u}()},4269:function(R,f,k){var m,y=this&&this.__extends||(m=function(c,o){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,n){l.__proto__=n}||function(l,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(l[a]=n[a])},m(c,o)},function(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function l(){this.constructor=c}m(c,o),c.prototype=o===null?Object.create(o):(l.prototype=o.prototype,new l)}),_=this&&this.__decorate||function(c,o,l,n){var a,h=arguments.length,d=h<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,l):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(c,o,l,n);else for(var S=c.length-1;S>=0;S--)(a=c[S])&&(d=(h<3?a(d):h>3?a(o,l,d):a(o,l))||d);return h>3&&d&&Object.defineProperty(o,l,d),d},g=this&&this.__param||function(c,o){return function(l,n){o(l,n,c)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CharacterJoinerService=f.JoinedCellData=void 0;var x=k(3734),C=k(643),u=k(511),p=k(2585),w=function(c){function o(l,n,a){var h=c.call(this)||this;return h.content=0,h.combinedData="",h.fg=l.fg,h.bg=l.bg,h.combinedData=n,h._width=a,h}return y(o,c),o.prototype.isCombined=function(){return 2097152},o.prototype.getWidth=function(){return this._width},o.prototype.getChars=function(){return this.combinedData},o.prototype.getCode=function(){return 2097151},o.prototype.setFromCharData=function(l){throw new Error("not implemented")},o.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},o}(x.AttributeData);f.JoinedCellData=w;var b=function(){function c(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new u.CellData}return c.prototype.register=function(o){var l={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(l),l.id},c.prototype.deregister=function(o){for(var l=0;l1)for(var D=this._getJoinedRanges(a,S,d,l,h),W=0;W1)for(D=this._getJoinedRanges(a,S,d,l,h),W=0;W{Object.defineProperty(f,"__esModule",{value:!0}),f.CoreBrowserService=void 0;var k=function(){function m(y){this._textarea=y}return Object.defineProperty(m.prototype,"isFocused",{get:function(){return(this._textarea.getRootNode?this._textarea.getRootNode():document).activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),m}();f.CoreBrowserService=k},8934:function(R,f,k){var m=this&&this.__decorate||function(C,u,p,w){var b,c=arguments.length,o=c<3?u:w===null?w=Object.getOwnPropertyDescriptor(u,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(C,u,p,w);else for(var l=C.length-1;l>=0;l--)(b=C[l])&&(o=(c<3?b(o):c>3?b(u,p,o):b(u,p))||o);return c>3&&o&&Object.defineProperty(u,p,o),o},y=this&&this.__param||function(C,u){return function(p,w){u(p,w,C)}};Object.defineProperty(f,"__esModule",{value:!0}),f.MouseService=void 0;var _=k(4725),g=k(9806),x=function(){function C(u,p){this._renderService=u,this._charSizeService=p}return C.prototype.getCoords=function(u,p,w,b,c){return(0,g.getCoords)(window,u,p,w,b,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,c)},C.prototype.getRawByteCoords=function(u,p,w,b){var c=this.getCoords(u,p,w,b);return(0,g.getRawByteCoords)(c)},m([y(0,_.IRenderService),y(1,_.ICharSizeService)],C)}();f.MouseService=x},3230:function(R,f,k){var m,y=this&&this.__extends||(m=function(l,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,h){a.__proto__=h}||function(a,h){for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(a[d]=h[d])},m(l,n)},function(l,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function a(){this.constructor=l}m(l,n),l.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}),_=this&&this.__decorate||function(l,n,a,h){var d,S=arguments.length,T=S<3?n:h===null?h=Object.getOwnPropertyDescriptor(n,a):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(l,n,a,h);else for(var E=l.length-1;E>=0;E--)(d=l[E])&&(T=(S<3?d(T):S>3?d(n,a,T):d(n,a))||T);return S>3&&T&&Object.defineProperty(n,a,T),T},g=this&&this.__param||function(l,n){return function(a,h){n(a,h,l)}};Object.defineProperty(f,"__esModule",{value:!0}),f.RenderService=void 0;var x=k(6193),C=k(8460),u=k(844),p=k(5596),w=k(3656),b=k(2585),c=k(4725),o=function(l){function n(a,h,d,S,T,E,M){var D=l.call(this)||this;if(D._renderer=a,D._rowCount=h,D._charSizeService=T,D._isPaused=!1,D._needsFullRefresh=!1,D._isNextRenderRedrawOnly=!0,D._needsSelectionRefresh=!1,D._canvasWidth=0,D._canvasHeight=0,D._selectionState={start:void 0,end:void 0,columnSelectMode:!1},D._onDimensionsChange=new C.EventEmitter,D._onRenderedViewportChange=new C.EventEmitter,D._onRender=new C.EventEmitter,D._onRefreshRequest=new C.EventEmitter,D.register({dispose:function(){return D._renderer.dispose()}}),D._renderDebouncer=new x.RenderDebouncer(function(I,A){return D._renderRows(I,A)}),D.register(D._renderDebouncer),D._screenDprMonitor=new p.ScreenDprMonitor,D._screenDprMonitor.setListener(function(){return D.onDevicePixelRatioChange()}),D.register(D._screenDprMonitor),D.register(M.onResize(function(){return D._fullRefresh()})),D.register(M.buffers.onBufferActivate(function(){var I;return(I=D._renderer)===null||I===void 0?void 0:I.clear()})),D.register(S.onOptionChange(function(){return D._handleOptionsChanged()})),D.register(D._charSizeService.onCharSizeChange(function(){return D.onCharSizeChanged()})),D.register(E.onDecorationRegistered(function(){return D._fullRefresh()})),D.register(E.onDecorationRemoved(function(){return D._fullRefresh()})),D._renderer.onRequestRedraw(function(I){return D.refreshRows(I.start,I.end,!0)}),D.register((0,w.addDisposableDomListener)(window,"resize",function(){return D.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var W=new IntersectionObserver(function(I){return D._onIntersectionChange(I[I.length-1])},{threshold:0});W.observe(d),D.register({dispose:function(){return W.disconnect()}})}return D}return y(n,l),Object.defineProperty(n.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRenderedViewportChange",{get:function(){return this._onRenderedViewportChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),n.prototype._onIntersectionChange=function(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},n.prototype.refreshRows=function(a,h,d){d===void 0&&(d=!1),this._isPaused?this._needsFullRefresh=!0:(d||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,h,this._rowCount))},n.prototype._renderRows=function(a,h){this._renderer.renderRows(a,h),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:h}),this._onRender.fire({start:a,end:h}),this._isNextRenderRedrawOnly=!0},n.prototype.resize=function(a,h){this._rowCount=h,this._fireOnCanvasResize()},n.prototype._handleOptionsChanged=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},n.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},n.prototype.dispose=function(){l.prototype.dispose.call(this)},n.prototype.setRenderer=function(a){var h=this;this._renderer.dispose(),this._renderer=a,this._renderer.onRequestRedraw(function(d){return h.refreshRows(d.start,d.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},n.prototype.addRefreshCallback=function(a){return this._renderDebouncer.addRefreshCallback(a)},n.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},n.prototype.clearTextureAtlas=function(){var a,h;(h=(a=this._renderer)===null||a===void 0?void 0:a.clearTextureAtlas)===null||h===void 0||h.call(a),this._fullRefresh()},n.prototype.setColors=function(a){this._renderer.setColors(a),this._fullRefresh()},n.prototype.onDevicePixelRatioChange=function(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},n.prototype.onResize=function(a,h){this._renderer.onResize(a,h),this._fullRefresh()},n.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},n.prototype.onBlur=function(){this._renderer.onBlur()},n.prototype.onFocus=function(){this._renderer.onFocus()},n.prototype.onSelectionChanged=function(a,h,d){this._selectionState.start=a,this._selectionState.end=h,this._selectionState.columnSelectMode=d,this._renderer.onSelectionChanged(a,h,d)},n.prototype.onCursorMove=function(){this._renderer.onCursorMove()},n.prototype.clear=function(){this._renderer.clear()},_([g(3,b.IOptionsService),g(4,c.ICharSizeService),g(5,b.IDecorationService),g(6,b.IBufferService)],n)}(u.Disposable);f.RenderService=o},9312:function(R,f,k){var m,y=this&&this.__extends||(m=function(S,T){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,M){E.__proto__=M}||function(E,M){for(var D in M)Object.prototype.hasOwnProperty.call(M,D)&&(E[D]=M[D])},m(S,T)},function(S,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function E(){this.constructor=S}m(S,T),S.prototype=T===null?Object.create(T):(E.prototype=T.prototype,new E)}),_=this&&this.__decorate||function(S,T,E,M){var D,W=arguments.length,I=W<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(S,T,E,M);else for(var A=S.length-1;A>=0;A--)(D=S[A])&&(I=(W<3?D(I):W>3?D(T,E,I):D(T,E))||I);return W>3&&I&&Object.defineProperty(T,E,I),I},g=this&&this.__param||function(S,T){return function(E,M){T(E,M,S)}};Object.defineProperty(f,"__esModule",{value:!0}),f.SelectionService=void 0;var x=k(6114),C=k(456),u=k(511),p=k(8460),w=k(4725),b=k(2585),c=k(9806),o=k(9504),l=k(844),n=k(4841),a="\xA0",h=new RegExp(a,"g"),d=function(S){function T(E,M,D,W,I,A,H,F){var z=S.call(this)||this;return z._element=E,z._screenElement=M,z._linkifier=D,z._bufferService=W,z._coreService=I,z._mouseService=A,z._optionsService=H,z._renderService=F,z._dragScrollAmount=0,z._enabled=!0,z._workCell=new u.CellData,z._mouseDownTimeStamp=0,z._oldHasSelection=!1,z._oldSelectionStart=void 0,z._oldSelectionEnd=void 0,z._onLinuxMouseSelection=z.register(new p.EventEmitter),z._onRedrawRequest=z.register(new p.EventEmitter),z._onSelectionChange=z.register(new p.EventEmitter),z._onRequestScrollLines=z.register(new p.EventEmitter),z._mouseMoveListener=function(G){return z._onMouseMove(G)},z._mouseUpListener=function(G){return z._onMouseUp(G)},z._coreService.onUserInput(function(){z.hasSelection&&z.clearSelection()}),z._trimListener=z._bufferService.buffer.lines.onTrim(function(G){return z._onTrim(G)}),z.register(z._bufferService.buffers.onBufferActivate(function(G){return z._onBufferActivate(G)})),z.enable(),z._model=new C.SelectionModel(z._bufferService),z._activeSelectionMode=0,z}return y(T,S),Object.defineProperty(T.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),T.prototype.dispose=function(){this._removeMouseDownListeners()},T.prototype.reset=function(){this.clearSelection()},T.prototype.disable=function(){this.clearSelection(),this._enabled=!1},T.prototype.enable=function(){this._enabled=!0},Object.defineProperty(T.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"hasSelection",{get:function(){var E=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!E||!M||E[0]===M[0]&&E[1]===M[1])},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"selectionText",{get:function(){var E=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!E||!M)return"";var D=this._bufferService.buffer,W=[];if(this._activeSelectionMode===3){if(E[0]===M[0])return"";for(var I=E[0]M[1]&&x[1]=M[0]&&x[0]=M[0]},A.prototype._selectWordAtCursor=function(x,M){var O,I,P=(I=(O=this._linkifier.currentLink)===null||O===void 0?void 0:O.link)===null||I===void 0?void 0:I.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;var T=this._getMouseBufferCoords(x);return!!T&&(this._selectWordAt(T,M),this._model.selectionEnd=void 0,!0)},A.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},A.prototype.selectLines=function(x,M){this._model.clearSelection(),x=Math.max(x,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()},A.prototype._onTrim=function(x){this._model.onTrim(x)&&this.refresh()},A.prototype._getMouseBufferCoords=function(x){var M=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M},A.prototype._getMouseEventScrollAmount=function(x){var M=(0,c.getCoordsRelativeToElement)(window,x,this._screenElement)[1],O=this._renderService.dimensions.canvasHeight;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),(M/=50)/Math.abs(M)+Math.round(14*M))},A.prototype.shouldForceSelection=function(x){return k.isMac?x.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:x.shiftKey},A.prototype.onMouseDown=function(x){if(this._mouseDownTimeStamp=x.timeStamp,(x.button!==2||!this.hasSelection)&&x.button===0){if(!this._enabled){if(!this.shouldForceSelection(x))return;x.stopPropagation()}x.preventDefault(),this._dragScrollAmount=0,this._enabled&&x.shiftKey?this._onIncrementalClick(x):x.detail===1?this._onSingleClick(x):x.detail===2?this._onDoubleClick(x):x.detail===3&&this._onTripleClick(x),this._addMouseDownListeners(),this.refresh(!0)}},A.prototype._addMouseDownListeners=function(){var x=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return x._dragScroll()},50)},A.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},A.prototype._onIncrementalClick=function(x){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(x))},A.prototype._onSingleClick=function(x){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(x)?3:0,this._model.selectionStart=this._getMouseBufferCoords(x),this._model.selectionStart){this._model.selectionEnd=void 0;var M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},A.prototype._onDoubleClick=function(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)},A.prototype._onTripleClick=function(x){var M=this._getMouseBufferCoords(x);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))},A.prototype.shouldColumnSelect=function(x){return x.altKey&&!(k.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)},A.prototype._onMouseMove=function(x){if(x.stopImmediatePropagation(),this._model.selectionStart){var M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(x),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(x.ydisp+this._bufferService.rows,x.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=x.ydisp),this.refresh()}},A.prototype._onMouseUp=function(x){var M=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&x.altKey&&this._optionsService.getOption("altClickMovesCursor")){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var O=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){var I=(0,n.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()},A.prototype._fireEventIfSelectionChanged=function(){var x=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!x||!M||x[0]===M[0]&&x[1]===M[1]);O?x&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(x,M,O)},A.prototype._fireOnSelectionChange=function(x,M,O){this._oldSelectionStart=x,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()},A.prototype._onBufferActivate=function(x){var M=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim(function(O){return M._onTrim(O)})},A.prototype._convertViewportColToCharacterIndex=function(x,M){for(var O=M[0],I=0;M[0]>=I;I++){var P=x.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:P>1&&M[0]!==I&&(O+=P-1)}return O},A.prototype.setSelection=function(x,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()},A.prototype.rightClickSelect=function(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())},A.prototype._getWordAt=function(x,M,O,I){if(O===void 0&&(O=!0),I===void 0&&(I=!0),!(x[0]>=this._bufferService.cols)){var P=this._bufferService.buffer,T=P.lines.get(x[1]);if(T){var j=P.translateBufferLineToString(x[1],!1),N=this._convertViewportColToCharacterIndex(T,x),U=N,V=x[0]-N,ne=0,ue=0,oe=0,pe=0;if(j.charAt(N)===" "){for(;N>0&&j.charAt(N-1)===" ";)N--;for(;U1&&(pe+=ve-1,U+=ve-1);_e>0&&N>0&&!this._isCharWordSeparator(T.loadCell(_e-1,this._workCell));){T.loadCell(_e-1,this._workCell);var he=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,_e--):he>1&&(oe+=he-1,N-=he-1),N--,_e--}for(;z1&&(pe+=ke-1,U+=ke-1),U++,z++}}U++;var $=N+V-ne+oe,Ie=Math.min(this._bufferService.cols,U-N+ne+ue-oe-pe);if(M||j.slice(N,U).trim()!==""){if(O&&$===0&&T.getCodePoint(0)!==32){var ge=P.lines.get(x[1]-1);if(ge&&T.isWrapped&&ge.getCodePoint(this._bufferService.cols-1)!==32){var le=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(le){var Y=this._bufferService.cols-le.start;$-=Y,Ie+=Y}}}if(I&&$+Ie===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){var Z=P.lines.get(x[1]+1);if(Z?.isWrapped&&Z.getCodePoint(0)!==32){var se=this._getWordAt([0,x[1]+1],!1,!1,!0);se&&(Ie+=se.length)}}return{start:$,length:Ie}}}}},A.prototype._selectWordAt=function(x,M){var O=this._getWordAt(x,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[O.start,x[1]],this._model.selectionStartLength=O.length}},A.prototype._selectToWordAt=function(x){var M=this._getWordAt(x,!0);if(M){for(var O=x[1];M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}},A.prototype._isCharWordSeparator=function(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0},A.prototype._selectLineAt=function(x){var M=this._bufferService.buffer.getWrappedRangeForLine(x),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(O,this._bufferService.cols)},_([g(3,b.IBufferService),g(4,b.ICoreService),g(5,L.IMouseService),g(6,b.IOptionsService),g(7,L.IRenderService)],A)}(l.Disposable);f.SelectionService=h},4725:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ICharacterJoinerService=f.ISoundService=f.ISelectionService=f.IRenderService=f.IMouseService=f.ICoreBrowserService=f.ICharSizeService=void 0;var m=E(8343);f.ICharSizeService=(0,m.createDecorator)("CharSizeService"),f.ICoreBrowserService=(0,m.createDecorator)("CoreBrowserService"),f.IMouseService=(0,m.createDecorator)("MouseService"),f.IRenderService=(0,m.createDecorator)("RenderService"),f.ISelectionService=(0,m.createDecorator)("SelectionService"),f.ISoundService=(0,m.createDecorator)("SoundService"),f.ICharacterJoinerService=(0,m.createDecorator)("CharacterJoinerService")},357:function(D,f,E){var m=this&&this.__decorate||function(k,C,u,v){var L,b=arguments.length,c=b<3?C:v===null?v=Object.getOwnPropertyDescriptor(C,u):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(k,C,u,v);else for(var n=k.length-1;n>=0;n--)(L=k[n])&&(c=(b<3?L(c):b>3?L(C,u,c):L(C,u))||c);return b>3&&c&&Object.defineProperty(C,u,c),c},y=this&&this.__param||function(k,C){return function(u,v){C(u,v,k)}};Object.defineProperty(f,"__esModule",{value:!0}),f.SoundService=void 0;var _=E(2585),g=function(){function k(C){this._optionsService=C}return Object.defineProperty(k,"audioContext",{get:function(){if(!k._audioContext){var C=window.AudioContext||window.webkitAudioContext;if(!C)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;k._audioContext=new C}return k._audioContext},enumerable:!1,configurable:!0}),k.prototype.playBellSound=function(){var C=k.audioContext;if(C){var u=C.createBufferSource();C.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.rawOptions.bellSound)),function(v){u.buffer=v,u.connect(C.destination),u.start(0)})}},k.prototype._base64ToArrayBuffer=function(C){for(var u=window.atob(C),v=u.length,L=new Uint8Array(v),b=0;b{Object.defineProperty(f,"__esModule",{value:!0}),f.CircularList=void 0;var m=E(8460),y=function(){function _(g){this._maxLength=g,this.onDeleteEmitter=new m.EventEmitter,this.onInsertEmitter=new m.EventEmitter,this.onTrimEmitter=new m.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(_.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"maxLength",{get:function(){return this._maxLength},set:function(g){if(this._maxLength!==g){for(var k=new Array(g),C=0;Cthis._length)for(var k=this._length;k=g;v--)this._array[this._getCyclicIndex(v+C.length)]=this._array[this._getCyclicIndex(v)];for(v=0;vthis._maxLength){var L=this._length+C.length-this._maxLength;this._startIndex+=L,this._length=this._maxLength,this.onTrimEmitter.fire(L)}else this._length+=C.length},_.prototype.trimStart=function(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)},_.prototype.shiftElements=function(g,k,C){if(!(k<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(var u=k-1;u>=0;u--)this.set(g+u+C,this.get(g+u));var v=g+k+C-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(u=0;u{Object.defineProperty(f,"__esModule",{value:!0}),f.clone=void 0,f.clone=function E(m,y){if(y===void 0&&(y=5),typeof m!="object")return m;var _=Array.isArray(m)?[]:{};for(var g in m)_[g]=y<=1?m[g]:m[g]&&E(m[g],y-1);return _}},8055:function(D,f){var E,m,y,_,g=this&&this.__read||function(u,v){var L=typeof Symbol=="function"&&u[Symbol.iterator];if(!L)return u;var b,c,n=L.call(u),l=[];try{for(;(v===void 0||v-- >0)&&!(b=n.next()).done;)l.push(b.value)}catch(o){c={error:o}}finally{try{b&&!b.done&&(L=n.return)&&L.call(n)}finally{if(c)throw c.error}}return l};function k(u){var v=u.toString(16);return v.length<2?"0"+v:v}function C(u,v){return u>>0}}(E=f.channels||(f.channels={})),(m=f.color||(f.color={})).blend=function(u,v){var L=(255&v.rgba)/255;if(L===1)return{css:v.css,rgba:v.rgba};var b=v.rgba>>24&255,c=v.rgba>>16&255,n=v.rgba>>8&255,l=u.rgba>>24&255,o=u.rgba>>16&255,a=u.rgba>>8&255,d=l+Math.round((b-l)*L),h=o+Math.round((c-o)*L),S=a+Math.round((n-a)*L);return{css:E.toCss(d,h,S),rgba:E.toRgba(d,h,S)}},m.isOpaque=function(u){return(255&u.rgba)==255},m.ensureContrastRatio=function(u,v,L){var b=_.ensureContrastRatio(u.rgba,v.rgba,L);if(b)return _.toColor(b>>24&255,b>>16&255,b>>8&255)},m.opaque=function(u){var v=(255|u.rgba)>>>0,L=g(_.toChannels(v),3),b=L[0],c=L[1],n=L[2];return{css:E.toCss(b,c,n),rgba:v}},m.opacity=function(u,v){var L=Math.round(255*v),b=g(_.toChannels(u.rgba),3),c=b[0],n=b[1],l=b[2];return{css:E.toCss(c,n,l,L),rgba:E.toRgba(c,n,l,L)}},m.toColorRGB=function(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]},(f.css||(f.css={})).toColor=function(u){if(u.match(/#[0-9a-f]{3,8}/i))switch(u.length){case 4:var v=parseInt(u.slice(1,2).repeat(2),16),L=parseInt(u.slice(2,3).repeat(2),16),b=parseInt(u.slice(3,4).repeat(2),16);return _.toColor(v,L,b);case 5:v=parseInt(u.slice(1,2).repeat(2),16),L=parseInt(u.slice(2,3).repeat(2),16),b=parseInt(u.slice(3,4).repeat(2),16);var c=parseInt(u.slice(4,5).repeat(2),16);return _.toColor(v,L,b,c);case 7:return{css:u,rgba:(parseInt(u.slice(1),16)<<8|255)>>>0};case 9:return{css:u,rgba:parseInt(u.slice(1),16)>>>0}}var n=u.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return v=parseInt(n[1]),L=parseInt(n[2]),b=parseInt(n[3]),c=Math.round(255*(n[5]===void 0?1:parseFloat(n[5]))),_.toColor(v,L,b,c);throw new Error("css.toColor: Unsupported css format")},function(u){function v(L,b,c){var n=L/255,l=b/255,o=c/255;return .2126*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.7152*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}u.relativeLuminance=function(L){return v(L>>16&255,L>>8&255,255&L)},u.relativeLuminance2=v}(y=f.rgb||(f.rgb={})),function(u){function v(b,c,n){for(var l=b>>24&255,o=b>>16&255,a=b>>8&255,d=c>>24&255,h=c>>16&255,S=c>>8&255,A=C(y.relativeLuminance2(d,h,S),y.relativeLuminance2(l,o,a));A0||h>0||S>0);)d-=Math.max(0,Math.ceil(.1*d)),h-=Math.max(0,Math.ceil(.1*h)),S-=Math.max(0,Math.ceil(.1*S)),A=C(y.relativeLuminance2(d,h,S),y.relativeLuminance2(l,o,a));return(d<<24|h<<16|S<<8|255)>>>0}function L(b,c,n){for(var l=b>>24&255,o=b>>16&255,a=b>>8&255,d=c>>24&255,h=c>>16&255,S=c>>8&255,A=C(y.relativeLuminance2(d,h,S),y.relativeLuminance2(l,o,a));A>>0}u.ensureContrastRatio=function(b,c,n){var l=y.relativeLuminance(b>>8),o=y.relativeLuminance(c>>8);if(C(l,o)>8));if(dC(l,y.relativeLuminance(h>>8))?a:h}return a}var S=L(b,c,n),A=C(l,y.relativeLuminance(S>>8));return AC(l,y.relativeLuminance(h>>8))?S:h):S}},u.reduceLuminance=v,u.increaseLuminance=L,u.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]},u.toColor=function(b,c,n,l){return{css:E.toCss(b,c,n,l),rgba:E.toRgba(b,c,n,l)}}}(_=f.rgba||(f.rgba={})),f.toPaddedHex=k,f.contrastRatio=C},8969:function(D,f,E){var m,y=this&&this.__extends||(m=function(M,O){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,P){I.__proto__=P}||function(I,P){for(var T in P)Object.prototype.hasOwnProperty.call(P,T)&&(I[T]=P[T])},m(M,O)},function(M,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");function I(){this.constructor=M}m(M,O),M.prototype=O===null?Object.create(O):(I.prototype=O.prototype,new I)}),_=this&&this.__values||function(M){var O=typeof Symbol=="function"&&Symbol.iterator,I=O&&M[O],P=0;if(I)return I.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&P>=M.length&&(M=void 0),{value:M&&M[P++],done:!M}}};throw new TypeError(O?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.CoreTerminal=void 0;var g=E(844),k=E(2585),C=E(4348),u=E(7866),v=E(744),L=E(7302),b=E(6975),c=E(8460),n=E(1753),l=E(3730),o=E(1480),a=E(7994),d=E(9282),h=E(5435),S=E(5981),A=!1,x=function(M){function O(I){var P=M.call(this)||this;return P._onBinary=new c.EventEmitter,P._onData=new c.EventEmitter,P._onLineFeed=new c.EventEmitter,P._onResize=new c.EventEmitter,P._onScroll=new c.EventEmitter,P._onWriteParsed=new c.EventEmitter,P._instantiationService=new C.InstantiationService,P.optionsService=new L.OptionsService(I),P._instantiationService.setService(k.IOptionsService,P.optionsService),P._bufferService=P.register(P._instantiationService.createInstance(v.BufferService)),P._instantiationService.setService(k.IBufferService,P._bufferService),P._logService=P._instantiationService.createInstance(u.LogService),P._instantiationService.setService(k.ILogService,P._logService),P.coreService=P.register(P._instantiationService.createInstance(b.CoreService,function(){return P.scrollToBottom()})),P._instantiationService.setService(k.ICoreService,P.coreService),P.coreMouseService=P._instantiationService.createInstance(n.CoreMouseService),P._instantiationService.setService(k.ICoreMouseService,P.coreMouseService),P._dirtyRowService=P._instantiationService.createInstance(l.DirtyRowService),P._instantiationService.setService(k.IDirtyRowService,P._dirtyRowService),P.unicodeService=P._instantiationService.createInstance(o.UnicodeService),P._instantiationService.setService(k.IUnicodeService,P.unicodeService),P._charsetService=P._instantiationService.createInstance(a.CharsetService),P._instantiationService.setService(k.ICharsetService,P._charsetService),P._inputHandler=new h.InputHandler(P._bufferService,P._charsetService,P.coreService,P._dirtyRowService,P._logService,P.optionsService,P.coreMouseService,P.unicodeService),P.register((0,c.forwardEvent)(P._inputHandler.onLineFeed,P._onLineFeed)),P.register(P._inputHandler),P.register((0,c.forwardEvent)(P._bufferService.onResize,P._onResize)),P.register((0,c.forwardEvent)(P.coreService.onData,P._onData)),P.register((0,c.forwardEvent)(P.coreService.onBinary,P._onBinary)),P.register(P.optionsService.onOptionChange(function(T){return P._updateOptions(T)})),P.register(P._bufferService.onScroll(function(T){P._onScroll.fire({position:P._bufferService.buffer.ydisp,source:0}),P._dirtyRowService.markRangeDirty(P._bufferService.buffer.scrollTop,P._bufferService.buffer.scrollBottom)})),P.register(P._inputHandler.onScroll(function(T){P._onScroll.fire({position:P._bufferService.buffer.ydisp,source:0}),P._dirtyRowService.markRangeDirty(P._bufferService.buffer.scrollTop,P._bufferService.buffer.scrollBottom)})),P._writeBuffer=new S.WriteBuffer(function(T,j){return P._inputHandler.parse(T,j)}),P.register((0,c.forwardEvent)(P._writeBuffer.onWriteParsed,P._onWriteParsed)),P}return y(O,M),Object.defineProperty(O.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onWriteParsed",{get:function(){return this._onWriteParsed.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"onScroll",{get:function(){var I=this;return this._onScrollApi||(this._onScrollApi=new c.EventEmitter,this.register(this._onScroll.event(function(P){var T;(T=I._onScrollApi)===null||T===void 0||T.fire(P.position)}))),this._onScrollApi.event},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"options",{get:function(){return this.optionsService.options},set:function(I){for(var P in I)this.optionsService.options[P]=I[P]},enumerable:!1,configurable:!0}),O.prototype.dispose=function(){var I;this._isDisposed||(M.prototype.dispose.call(this),(I=this._windowsMode)===null||I===void 0||I.dispose(),this._windowsMode=void 0)},O.prototype.write=function(I,P){this._writeBuffer.write(I,P)},O.prototype.writeSync=function(I,P){this._logService.logLevel<=k.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(I,P)},O.prototype.resize=function(I,P){isNaN(I)||isNaN(P)||(I=Math.max(I,v.MINIMUM_COLS),P=Math.max(P,v.MINIMUM_ROWS),this._bufferService.resize(I,P))},O.prototype.scroll=function(I,P){P===void 0&&(P=!1),this._bufferService.scroll(I,P)},O.prototype.scrollLines=function(I,P,T){this._bufferService.scrollLines(I,P,T)},O.prototype.scrollPages=function(I){this._bufferService.scrollPages(I)},O.prototype.scrollToTop=function(){this._bufferService.scrollToTop()},O.prototype.scrollToBottom=function(){this._bufferService.scrollToBottom()},O.prototype.scrollToLine=function(I){this._bufferService.scrollToLine(I)},O.prototype.registerEscHandler=function(I,P){return this._inputHandler.registerEscHandler(I,P)},O.prototype.registerDcsHandler=function(I,P){return this._inputHandler.registerDcsHandler(I,P)},O.prototype.registerCsiHandler=function(I,P){return this._inputHandler.registerCsiHandler(I,P)},O.prototype.registerOscHandler=function(I,P){return this._inputHandler.registerOscHandler(I,P)},O.prototype._setup=function(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()},O.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()},O.prototype._updateOptions=function(I){var P;switch(I){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():((P=this._windowsMode)===null||P===void 0||P.dispose(),this._windowsMode=void 0)}},O.prototype._enableWindowsMode=function(){var I=this;if(!this._windowsMode){var P=[];P.push(this.onLineFeed(d.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},function(){return(0,d.updateWindowsModeWrappedState)(I._bufferService),!1})),this._windowsMode={dispose:function(){var T,j;try{for(var N=_(P),U=N.next();!U.done;U=N.next())U.value.dispose()}catch(V){T={error:V}}finally{try{U&&!U.done&&(j=N.return)&&j.call(N)}finally{if(T)throw T.error}}}}}},O}(g.Disposable);f.CoreTerminal=x},8460:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.forwardEvent=f.EventEmitter=void 0;var E=function(){function m(){this._listeners=[],this._disposed=!1}return Object.defineProperty(m.prototype,"event",{get:function(){var y=this;return this._event||(this._event=function(_){return y._listeners.push(_),{dispose:function(){if(!y._disposed){for(var g=0;g24)return T.setWinLines||!1;switch(P){case 1:return!!T.restoreWin;case 2:return!!T.minimizeWin;case 3:return!!T.setWinPosition;case 4:return!!T.setWinSizePixels;case 5:return!!T.raiseWin;case 6:return!!T.lowerWin;case 7:return!!T.refreshWin;case 8:return!!T.setWinSizeChars;case 9:return!!T.maximizeWin;case 10:return!!T.fullscreenWin;case 11:return!!T.getWinState;case 13:return!!T.getWinPosition;case 14:return!!T.getWinSizePixels;case 15:return!!T.getScreenSizePixels;case 16:return!!T.getCellSizePixels;case 18:return!!T.getWinSizeChars;case 19:return!!T.getScreenSizeChars;case 20:return!!T.getIconTitle;case 21:return!!T.getWinTitle;case 22:return!!T.pushTitle;case 23:return!!T.popTitle;case 24:return!!T.setWinLines}return!1}(function(P){P[P.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",P[P.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(_=f.WindowsOptionsReportType||(f.WindowsOptionsReportType={}));var O=function(){function P(T,j,N,U){this._bufferService=T,this._coreService=j,this._logService=N,this._optionsService=U,this._data=new Uint32Array(0)}return P.prototype.hook=function(T){this._data=new Uint32Array(0)},P.prototype.put=function(T,j,N){this._data=(0,v.concat)(this._data,T.subarray(j,N))},P.prototype.unhook=function(T){if(!T)return this._data=new Uint32Array(0),!0;var j=(0,L.utf32ToString)(this._data);switch(this._data=new Uint32Array(0),j){case'"q':this._coreService.triggerDataEvent(g.C0.ESC+'P1$r0"q'+g.C0.ESC+"\\");break;case'"p':this._coreService.triggerDataEvent(g.C0.ESC+'P1$r61;1"p'+g.C0.ESC+"\\");break;case"r":var N=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";this._coreService.triggerDataEvent(g.C0.ESC+"P1$r"+N+g.C0.ESC+"\\");break;case"m":this._coreService.triggerDataEvent(g.C0.ESC+"P1$r0m"+g.C0.ESC+"\\");break;case" q":var U={block:2,underline:4,bar:6}[this._optionsService.rawOptions.cursorStyle];U-=this._optionsService.rawOptions.cursorBlink?1:0,this._coreService.triggerDataEvent(g.C0.ESC+"P1$r"+U+" q"+g.C0.ESC+"\\");break;default:this._logService.debug("Unknown DCS $q %s",j),this._coreService.triggerDataEvent(g.C0.ESC+"P0$r"+g.C0.ESC+"\\")}return!0},P}(),I=function(P){function T(j,N,U,V,ne,ue,oe,pe,_e){_e===void 0&&(_e=new C.EscapeSequenceParser);var z=P.call(this)||this;z._bufferService=j,z._charsetService=N,z._coreService=U,z._dirtyRowService=V,z._logService=ne,z._optionsService=ue,z._coreMouseService=oe,z._unicodeService=pe,z._parser=_e,z._parseBuffer=new Uint32Array(4096),z._stringDecoder=new L.StringToUtf32,z._utf8Decoder=new L.Utf8ToUtf32,z._workCell=new l.CellData,z._windowTitle="",z._iconName="",z._windowTitleStack=[],z._iconNameStack=[],z._curAttrData=b.DEFAULT_ATTR_DATA.clone(),z._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),z._onRequestBell=new c.EventEmitter,z._onRequestRefreshRows=new c.EventEmitter,z._onRequestReset=new c.EventEmitter,z._onRequestSendFocus=new c.EventEmitter,z._onRequestSyncScrollBar=new c.EventEmitter,z._onRequestWindowsOptionsReport=new c.EventEmitter,z._onA11yChar=new c.EventEmitter,z._onA11yTab=new c.EventEmitter,z._onCursorMove=new c.EventEmitter,z._onLineFeed=new c.EventEmitter,z._onScroll=new c.EventEmitter,z._onTitleChange=new c.EventEmitter,z._onColor=new c.EventEmitter,z._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},z._specialColors=[256,257,258],z.register(z._parser),z._activeBuffer=z._bufferService.buffer,z.register(z._bufferService.buffers.onBufferActivate(function($){return z._activeBuffer=$.activeBuffer})),z._parser.setCsiHandlerFallback(function($,Ie){z._logService.debug("Unknown CSI code: ",{identifier:z._parser.identToString($),params:Ie.toArray()})}),z._parser.setEscHandlerFallback(function($){z._logService.debug("Unknown ESC code: ",{identifier:z._parser.identToString($)})}),z._parser.setExecuteHandlerFallback(function($){z._logService.debug("Unknown EXECUTE code: ",{code:$})}),z._parser.setOscHandlerFallback(function($,Ie,ge){z._logService.debug("Unknown OSC code: ",{identifier:$,action:Ie,data:ge})}),z._parser.setDcsHandlerFallback(function($,Ie,ge){Ie==="HOOK"&&(ge=ge.toArray()),z._logService.debug("Unknown DCS code: ",{identifier:z._parser.identToString($),action:Ie,payload:ge})}),z._parser.setPrintHandler(function($,Ie,ge){return z.print($,Ie,ge)}),z._parser.registerCsiHandler({final:"@"},function($){return z.insertChars($)}),z._parser.registerCsiHandler({intermediates:" ",final:"@"},function($){return z.scrollLeft($)}),z._parser.registerCsiHandler({final:"A"},function($){return z.cursorUp($)}),z._parser.registerCsiHandler({intermediates:" ",final:"A"},function($){return z.scrollRight($)}),z._parser.registerCsiHandler({final:"B"},function($){return z.cursorDown($)}),z._parser.registerCsiHandler({final:"C"},function($){return z.cursorForward($)}),z._parser.registerCsiHandler({final:"D"},function($){return z.cursorBackward($)}),z._parser.registerCsiHandler({final:"E"},function($){return z.cursorNextLine($)}),z._parser.registerCsiHandler({final:"F"},function($){return z.cursorPrecedingLine($)}),z._parser.registerCsiHandler({final:"G"},function($){return z.cursorCharAbsolute($)}),z._parser.registerCsiHandler({final:"H"},function($){return z.cursorPosition($)}),z._parser.registerCsiHandler({final:"I"},function($){return z.cursorForwardTab($)}),z._parser.registerCsiHandler({final:"J"},function($){return z.eraseInDisplay($)}),z._parser.registerCsiHandler({prefix:"?",final:"J"},function($){return z.eraseInDisplay($)}),z._parser.registerCsiHandler({final:"K"},function($){return z.eraseInLine($)}),z._parser.registerCsiHandler({prefix:"?",final:"K"},function($){return z.eraseInLine($)}),z._parser.registerCsiHandler({final:"L"},function($){return z.insertLines($)}),z._parser.registerCsiHandler({final:"M"},function($){return z.deleteLines($)}),z._parser.registerCsiHandler({final:"P"},function($){return z.deleteChars($)}),z._parser.registerCsiHandler({final:"S"},function($){return z.scrollUp($)}),z._parser.registerCsiHandler({final:"T"},function($){return z.scrollDown($)}),z._parser.registerCsiHandler({final:"X"},function($){return z.eraseChars($)}),z._parser.registerCsiHandler({final:"Z"},function($){return z.cursorBackwardTab($)}),z._parser.registerCsiHandler({final:"`"},function($){return z.charPosAbsolute($)}),z._parser.registerCsiHandler({final:"a"},function($){return z.hPositionRelative($)}),z._parser.registerCsiHandler({final:"b"},function($){return z.repeatPrecedingCharacter($)}),z._parser.registerCsiHandler({final:"c"},function($){return z.sendDeviceAttributesPrimary($)}),z._parser.registerCsiHandler({prefix:">",final:"c"},function($){return z.sendDeviceAttributesSecondary($)}),z._parser.registerCsiHandler({final:"d"},function($){return z.linePosAbsolute($)}),z._parser.registerCsiHandler({final:"e"},function($){return z.vPositionRelative($)}),z._parser.registerCsiHandler({final:"f"},function($){return z.hVPosition($)}),z._parser.registerCsiHandler({final:"g"},function($){return z.tabClear($)}),z._parser.registerCsiHandler({final:"h"},function($){return z.setMode($)}),z._parser.registerCsiHandler({prefix:"?",final:"h"},function($){return z.setModePrivate($)}),z._parser.registerCsiHandler({final:"l"},function($){return z.resetMode($)}),z._parser.registerCsiHandler({prefix:"?",final:"l"},function($){return z.resetModePrivate($)}),z._parser.registerCsiHandler({final:"m"},function($){return z.charAttributes($)}),z._parser.registerCsiHandler({final:"n"},function($){return z.deviceStatus($)}),z._parser.registerCsiHandler({prefix:"?",final:"n"},function($){return z.deviceStatusPrivate($)}),z._parser.registerCsiHandler({intermediates:"!",final:"p"},function($){return z.softReset($)}),z._parser.registerCsiHandler({intermediates:" ",final:"q"},function($){return z.setCursorStyle($)}),z._parser.registerCsiHandler({final:"r"},function($){return z.setScrollRegion($)}),z._parser.registerCsiHandler({final:"s"},function($){return z.saveCursor($)}),z._parser.registerCsiHandler({final:"t"},function($){return z.windowOptions($)}),z._parser.registerCsiHandler({final:"u"},function($){return z.restoreCursor($)}),z._parser.registerCsiHandler({intermediates:"'",final:"}"},function($){return z.insertColumns($)}),z._parser.registerCsiHandler({intermediates:"'",final:"~"},function($){return z.deleteColumns($)}),z._parser.setExecuteHandler(g.C0.BEL,function(){return z.bell()}),z._parser.setExecuteHandler(g.C0.LF,function(){return z.lineFeed()}),z._parser.setExecuteHandler(g.C0.VT,function(){return z.lineFeed()}),z._parser.setExecuteHandler(g.C0.FF,function(){return z.lineFeed()}),z._parser.setExecuteHandler(g.C0.CR,function(){return z.carriageReturn()}),z._parser.setExecuteHandler(g.C0.BS,function(){return z.backspace()}),z._parser.setExecuteHandler(g.C0.HT,function(){return z.tab()}),z._parser.setExecuteHandler(g.C0.SO,function(){return z.shiftOut()}),z._parser.setExecuteHandler(g.C0.SI,function(){return z.shiftIn()}),z._parser.setExecuteHandler(g.C1.IND,function(){return z.index()}),z._parser.setExecuteHandler(g.C1.NEL,function(){return z.nextLine()}),z._parser.setExecuteHandler(g.C1.HTS,function(){return z.tabSet()}),z._parser.registerOscHandler(0,new d.OscHandler(function($){return z.setTitle($),z.setIconName($),!0})),z._parser.registerOscHandler(1,new d.OscHandler(function($){return z.setIconName($)})),z._parser.registerOscHandler(2,new d.OscHandler(function($){return z.setTitle($)})),z._parser.registerOscHandler(4,new d.OscHandler(function($){return z.setOrReportIndexedColor($)})),z._parser.registerOscHandler(10,new d.OscHandler(function($){return z.setOrReportFgColor($)})),z._parser.registerOscHandler(11,new d.OscHandler(function($){return z.setOrReportBgColor($)})),z._parser.registerOscHandler(12,new d.OscHandler(function($){return z.setOrReportCursorColor($)})),z._parser.registerOscHandler(104,new d.OscHandler(function($){return z.restoreIndexedColor($)})),z._parser.registerOscHandler(110,new d.OscHandler(function($){return z.restoreFgColor($)})),z._parser.registerOscHandler(111,new d.OscHandler(function($){return z.restoreBgColor($)})),z._parser.registerOscHandler(112,new d.OscHandler(function($){return z.restoreCursorColor($)})),z._parser.registerEscHandler({final:"7"},function(){return z.saveCursor()}),z._parser.registerEscHandler({final:"8"},function(){return z.restoreCursor()}),z._parser.registerEscHandler({final:"D"},function(){return z.index()}),z._parser.registerEscHandler({final:"E"},function(){return z.nextLine()}),z._parser.registerEscHandler({final:"H"},function(){return z.tabSet()}),z._parser.registerEscHandler({final:"M"},function(){return z.reverseIndex()}),z._parser.registerEscHandler({final:"="},function(){return z.keypadApplicationMode()}),z._parser.registerEscHandler({final:">"},function(){return z.keypadNumericMode()}),z._parser.registerEscHandler({final:"c"},function(){return z.fullReset()}),z._parser.registerEscHandler({final:"n"},function(){return z.setgLevel(2)}),z._parser.registerEscHandler({final:"o"},function(){return z.setgLevel(3)}),z._parser.registerEscHandler({final:"|"},function(){return z.setgLevel(3)}),z._parser.registerEscHandler({final:"}"},function(){return z.setgLevel(2)}),z._parser.registerEscHandler({final:"~"},function(){return z.setgLevel(1)}),z._parser.registerEscHandler({intermediates:"%",final:"@"},function(){return z.selectDefaultCharset()}),z._parser.registerEscHandler({intermediates:"%",final:"G"},function(){return z.selectDefaultCharset()});var ve=function($){he._parser.registerEscHandler({intermediates:"(",final:$},function(){return z.selectCharset("("+$)}),he._parser.registerEscHandler({intermediates:")",final:$},function(){return z.selectCharset(")"+$)}),he._parser.registerEscHandler({intermediates:"*",final:$},function(){return z.selectCharset("*"+$)}),he._parser.registerEscHandler({intermediates:"+",final:$},function(){return z.selectCharset("+"+$)}),he._parser.registerEscHandler({intermediates:"-",final:$},function(){return z.selectCharset("-"+$)}),he._parser.registerEscHandler({intermediates:".",final:$},function(){return z.selectCharset("."+$)}),he._parser.registerEscHandler({intermediates:"/",final:$},function(){return z.selectCharset("/"+$)})},he=this;for(var ke in k.CHARSETS)ve(ke);return z._parser.registerEscHandler({intermediates:"#",final:"8"},function(){return z.screenAlignmentPattern()}),z._parser.setErrorHandler(function($){return z._logService.error("Parsing error: ",$),$}),z._parser.registerDcsHandler({intermediates:"$",final:"q"},new O(z._bufferService,z._coreService,z._logService,z._optionsService)),z}return y(T,P),Object.defineProperty(T.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestSendFocus",{get:function(){return this._onRequestSendFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onColor",{get:function(){return this._onColor.event},enumerable:!1,configurable:!0}),T.prototype.dispose=function(){P.prototype.dispose.call(this)},T.prototype._preserveStack=function(j,N,U,V){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=N,this._parseStack.decodedLength=U,this._parseStack.position=V},T.prototype._logSlowResolvingAsync=function(j){this._logService.logLevel<=a.LogLevelEnum.WARN&&Promise.race([j,new Promise(function(N,U){return setTimeout(function(){return U("#SLOW_TIMEOUT")},5e3)})]).catch(function(N){if(N!=="#SLOW_TIMEOUT")throw N;console.warn("async parser handler taking longer than 5000 ms")})},T.prototype.parse=function(j,N){var U,V=this._activeBuffer.x,ne=this._activeBuffer.y,ue=0,oe=this._parseStack.paused;if(oe){if(U=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,N))return this._logSlowResolvingAsync(U),U;V=this._parseStack.cursorStartX,ne=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>x&&(ue=this._parseStack.position+x)}if(this._logService.logLevel<=a.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?' "'+j+'"':' "'+Array.prototype.map.call(j,function(ve){return String.fromCharCode(ve)}).join("")+'"'),typeof j=="string"?j.split("").map(function(ve){return ve.charCodeAt(0)}):j),this._parseBuffer.lengthx)for(var pe=ue;pe0&&he.getWidth(this._activeBuffer.x-1)===2&&he.setCellFromCodePoint(this._activeBuffer.x-1,0,1,ve.fg,ve.bg,ve.extended);for(var ke=N;ke=pe){if(_e){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),he=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=pe-1,ne===2)continue}if(z&&(he.insertCells(this._activeBuffer.x,ne,this._activeBuffer.getNullCell(ve),ve),he.getWidth(pe-1)===2&&he.setCellFromCodePoint(pe-1,n.NULL_CELL_CODE,n.NULL_CELL_WIDTH,ve.fg,ve.bg,ve.extended)),he.setCellFromCodePoint(this._activeBuffer.x++,V,ne,ve.fg,ve.bg,ve.extended),ne>0)for(;--ne;)he.setCellFromCodePoint(this._activeBuffer.x++,0,0,ve.fg,ve.bg,ve.extended)}else he.getWidth(this._activeBuffer.x-1)?he.addCodepointToCell(this._activeBuffer.x-1,V):he.addCodepointToCell(this._activeBuffer.x-2,V)}U-N>0&&(he.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x0&&he.getWidth(this._activeBuffer.x)===0&&!he.hasContent(this._activeBuffer.x)&&he.setCellFromCodePoint(this._activeBuffer.x,0,1,ve.fg,ve.bg,ve.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)},T.prototype.registerCsiHandler=function(j,N){var U=this;return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,N):this._parser.registerCsiHandler(j,function(V){return!M(V.params[0],U._optionsService.rawOptions.windowOptions)||N(V)})},T.prototype.registerDcsHandler=function(j,N){return this._parser.registerDcsHandler(j,new h.DcsHandler(N))},T.prototype.registerEscHandler=function(j,N){return this._parser.registerEscHandler(j,N)},T.prototype.registerOscHandler=function(j,N){return this._parser.registerOscHandler(j,new d.OscHandler(N))},T.prototype.bell=function(){return this._onRequestBell.fire(),!0},T.prototype.lineFeed=function(){return this._dirtyRowService.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0},T.prototype.carriageReturn=function(){return this._activeBuffer.x=0,!0},T.prototype.backspace=function(){var j;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||j===void 0)&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;var N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0},T.prototype.tab=function(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;var j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0},T.prototype.shiftOut=function(){return this._charsetService.setgLevel(1),!0},T.prototype.shiftIn=function(){return this._charsetService.setgLevel(0),!0},T.prototype._restrictCursor=function(j){j===void 0&&(j=this._bufferService.cols-1),this._activeBuffer.x=Math.min(j,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowService.markDirty(this._activeBuffer.y)},T.prototype._setCursor=function(j,N){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+N):(this._activeBuffer.x=j,this._activeBuffer.y=N),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)},T.prototype._moveCursor=function(j,N){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+N)},T.prototype.cursorUp=function(j){var N=this._activeBuffer.y-this._activeBuffer.scrollTop;return N>=0?this._moveCursor(0,-Math.min(N,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0},T.prototype.cursorDown=function(j){var N=this._activeBuffer.scrollBottom-this._activeBuffer.y;return N>=0?this._moveCursor(0,Math.min(N,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0},T.prototype.cursorForward=function(j){return this._moveCursor(j.params[0]||1,0),!0},T.prototype.cursorBackward=function(j){return this._moveCursor(-(j.params[0]||1),0),!0},T.prototype.cursorNextLine=function(j){return this.cursorDown(j),this._activeBuffer.x=0,!0},T.prototype.cursorPrecedingLine=function(j){return this.cursorUp(j),this._activeBuffer.x=0,!0},T.prototype.cursorCharAbsolute=function(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0},T.prototype.cursorPosition=function(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0},T.prototype.charPosAbsolute=function(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0},T.prototype.hPositionRelative=function(j){return this._moveCursor(j.params[0]||1,0),!0},T.prototype.linePosAbsolute=function(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0},T.prototype.vPositionRelative=function(j){return this._moveCursor(0,j.params[0]||1),!0},T.prototype.hVPosition=function(j){return this.cursorPosition(j),!0},T.prototype.tabClear=function(j){var N=j.params[0];return N===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:N===3&&(this._activeBuffer.tabs={}),!0},T.prototype.cursorForwardTab=function(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;for(var N=j.params[0]||1;N--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0},T.prototype.cursorBackwardTab=function(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;for(var N=j.params[0]||1;N--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0},T.prototype._eraseInBufferLine=function(j,N,U,V){V===void 0&&(V=!1);var ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);ne.replaceCells(N,U,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),V&&(ne.isWrapped=!1)},T.prototype._resetBufferLine=function(j){var N=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);N.fill(this._activeBuffer.getNullCell(this._eraseAttrData())),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),N.isWrapped=!1},T.prototype.eraseInDisplay=function(j){var N;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowService.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0);N=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N);this._dirtyRowService.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowService.markDirty(N-1);N--;)this._resetBufferLine(N);this._dirtyRowService.markDirty(0);break;case 3:var U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0},T.prototype.eraseInLine=function(j){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0},T.prototype.insertLines=function(j){this._restrictCursor();var N=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(g.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(g.C0.ESC+"[?6c")),!0},T.prototype.sendDeviceAttributesSecondary=function(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(g.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(g.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(g.C0.ESC+"[>83;40003;0c")),!0},T.prototype._is=function(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0},T.prototype.setMode=function(j){for(var N=0;N=2||V[1]===2&&ue+ne>=5)break;V[1]&&(ne=1)}while(++ue+N5)&&(j=1),N.extended.underlineStyle=j,N.fg|=268435456,j===0&&(N.fg&=-268435457),N.updateExtended()},T.prototype.charAttributes=function(j){if(j.length===1&&j.params[0]===0)return this._curAttrData.fg=b.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=b.DEFAULT_ATTR_DATA.bg,!0;for(var N,U=j.length,V=this._curAttrData,ne=0;ne=30&&N<=37?(V.fg&=-50331904,V.fg|=16777216|N-30):N>=40&&N<=47?(V.bg&=-50331904,V.bg|=16777216|N-40):N>=90&&N<=97?(V.fg&=-50331904,V.fg|=16777224|N-90):N>=100&&N<=107?(V.bg&=-50331904,V.bg|=16777224|N-100):N===0?(V.fg=b.DEFAULT_ATTR_DATA.fg,V.bg=b.DEFAULT_ATTR_DATA.bg):N===1?V.fg|=134217728:N===3?V.bg|=67108864:N===4?(V.fg|=268435456,this._processUnderline(j.hasSubParams(ne)?j.getSubParams(ne)[0]:1,V)):N===5?V.fg|=536870912:N===7?V.fg|=67108864:N===8?V.fg|=1073741824:N===9?V.fg|=2147483648:N===2?V.bg|=134217728:N===21?this._processUnderline(2,V):N===22?(V.fg&=-134217729,V.bg&=-134217729):N===23?V.bg&=-67108865:N===24?V.fg&=-268435457:N===25?V.fg&=-536870913:N===27?V.fg&=-67108865:N===28?V.fg&=-1073741825:N===29?V.fg&=2147483647:N===39?(V.fg&=-67108864,V.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):N===49?(V.bg&=-67108864,V.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?ne+=this._extractColor(j,ne,V):N===59?(V.extended=V.extended.clone(),V.extended.underlineColor=-1,V.updateExtended()):N===100?(V.fg&=-67108864,V.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,V.bg&=-67108864,V.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0},T.prototype.deviceStatus=function(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(g.C0.ESC+"[0n");break;case 6:var N=this._activeBuffer.y+1,U=this._activeBuffer.x+1;this._coreService.triggerDataEvent(g.C0.ESC+"["+N+";"+U+"R")}return!0},T.prototype.deviceStatusPrivate=function(j){if(j.params[0]===6){var N=this._activeBuffer.y+1,U=this._activeBuffer.x+1;this._coreService.triggerDataEvent(g.C0.ESC+"[?"+N+";"+U+"R")}return!0},T.prototype.softReset=function(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0},T.prototype.setCursorStyle=function(j){var N=j.params[0]||1;switch(N){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var U=N%2==1;return this._optionsService.options.cursorBlink=U,!0},T.prototype.setScrollRegion=function(j){var N,U=j.params[0]||1;return(j.length<2||(N=j.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0},T.prototype.windowOptions=function(j){if(!M(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;var N=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:N!==2&&this._onRequestWindowsOptionsReport.fire(_.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(_.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(g.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:N!==0&&N!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),N!==0&&N!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:N!==0&&N!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),N!==0&&N!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0},T.prototype.saveCursor=function(j){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0},T.prototype.restoreCursor=function(j){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0},T.prototype.setTitle=function(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0},T.prototype.setIconName=function(j){return this._iconName=j,!0},T.prototype.setOrReportIndexedColor=function(j){for(var N=[],U=j.split(";");U.length>1;){var V=U.shift(),ne=U.shift();if(/^\d+$/.exec(V)){var ue=parseInt(V);if(0<=ue&&ue<256)if(ne==="?")N.push({type:0,index:ue});else{var oe=(0,S.parseColor)(ne);oe&&N.push({type:1,index:ue,color:oe})}}}return N.length&&this._onColor.fire(N),!0},T.prototype._setOrReportSpecialColor=function(j,N){for(var U=j.split(";"),V=0;V=this._specialColors.length);++V,++N)if(U[V]==="?")this._onColor.fire([{type:0,index:this._specialColors[N]}]);else{var ne=(0,S.parseColor)(U[V]);ne&&this._onColor.fire([{type:1,index:this._specialColors[N],color:ne}])}return!0},T.prototype.setOrReportFgColor=function(j){return this._setOrReportSpecialColor(j,0)},T.prototype.setOrReportBgColor=function(j){return this._setOrReportSpecialColor(j,1)},T.prototype.setOrReportCursorColor=function(j){return this._setOrReportSpecialColor(j,2)},T.prototype.restoreIndexedColor=function(j){if(!j)return this._onColor.fire([{type:2}]),!0;for(var N=[],U=j.split(";"),V=0;V=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0},T.prototype.tabSet=function(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0},T.prototype.reverseIndex=function(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){var j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0},T.prototype.fullReset=function(){return this._parser.reset(),this._onRequestReset.fire(),!0},T.prototype.reset=function(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()},T.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},T.prototype.setgLevel=function(j){return this._charsetService.setgLevel(j),!0},T.prototype.screenAlignmentPattern=function(){var j=new l.CellData;j.content=1<<22|69,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(var N=0;N=_.length&&(_=void 0),{value:_&&_[C++],done:!_}}};throw new TypeError(g?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.getDisposeArrayDisposable=f.disposeArray=f.Disposable=void 0;var m=function(){function _(){this._disposables=[],this._isDisposed=!1}return _.prototype.dispose=function(){var g,k;this._isDisposed=!0;try{for(var C=E(this._disposables),u=C.next();!u.done;u=C.next())u.value.dispose()}catch(v){g={error:v}}finally{try{u&&!u.done&&(k=C.return)&&k.call(C)}finally{if(g)throw g.error}}this._disposables.length=0},_.prototype.register=function(g){return this._disposables.push(g),g},_.prototype.unregister=function(g){var k=this._disposables.indexOf(g);k!==-1&&this._disposables.splice(k,1)},_}();function y(_){var g,k;try{for(var C=E(_),u=C.next();!u.done;u=C.next())u.value.dispose()}catch(v){g={error:v}}finally{try{u&&!u.done&&(k=C.return)&&k.call(C)}finally{if(g)throw g.error}}_.length=0}f.Disposable=m,f.disposeArray=y,f.getDisposeArrayDisposable=function(_){return{dispose:function(){return y(_)}}}},6114:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.isLinux=f.isWindows=f.isIphone=f.isIpad=f.isMac=f.isSafari=f.isLegacyEdge=f.isFirefox=void 0;var E=typeof navigator>"u",m=E?"node":navigator.userAgent,y=E?"node":navigator.platform;f.isFirefox=m.includes("Firefox"),f.isLegacyEdge=m.includes("Edge"),f.isSafari=/^((?!chrome|android).)*safari/i.test(m),f.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(y),f.isIpad=y==="iPad",f.isIphone=y==="iPhone",f.isWindows=["Windows","Win16","Win32","WinCE"].includes(y),f.isLinux=y.indexOf("Linux")>=0},6106:function(D,f){var E=this&&this.__generator||function(y,_){var g,k,C,u,v={label:0,sent:function(){if(1&C[0])throw C[1];return C[1]},trys:[],ops:[]};return u={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function L(b){return function(c){return function(n){if(g)throw new TypeError("Generator is already executing.");for(;v;)try{if(g=1,k&&(C=2&n[0]?k.return:n[0]?k.throw||((C=k.return)&&C.call(k),0):k.next)&&!(C=C.call(k,n[1])).done)return C;switch(k=0,C&&(n=[2&n[0],C.value]),n[0]){case 0:case 1:C=n;break;case 4:return v.label++,{value:n[1],done:!1};case 5:v.label++,k=n[1],n=[0];continue;case 7:n=v.ops.pop(),v.trys.pop();continue;default:if(!((C=(C=v.trys).length>0&&C[C.length-1])||n[0]!==6&&n[0]!==2)){v=0;continue}if(n[0]===3&&(!C||n[1]>C[0]&&n[1]=this._array.length)return[2];if(this._getKey(this._array[g])!==_)return[2];k.label=1;case 1:return[4,this._array[g]];case 2:k.sent(),k.label=3;case 3:if(++g_)return this._search(_,g,C-1);if(this._getKey(this._array[C])<_)return this._search(_,C+1,k);for(;C>0&&this._getKey(this._array[C-1])===_;)C--;return C},y}();f.SortedList=m},8273:(D,f)=>{function E(m,y,_,g){if(_===void 0&&(_=0),g===void 0&&(g=m.length),_>=m.length)return m;_=(m.length+_)%m.length,g=g>=m.length?m.length:(m.length+g)%m.length;for(var k=_;k{Object.defineProperty(f,"__esModule",{value:!0}),f.updateWindowsModeWrappedState=void 0;var m=E(643);f.updateWindowsModeWrappedState=function(y){var _=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),g=_?.get(y.cols-1),k=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);k&&g&&(k.isWrapped=g[m.CHAR_DATA_CODE_INDEX]!==m.NULL_CELL_CODE&&g[m.CHAR_DATA_CODE_INDEX]!==m.WHITESPACE_CELL_CODE)}},3734:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ExtendedAttrs=f.AttributeData=void 0;var E=function(){function y(){this.fg=0,this.bg=0,this.extended=new m}return y.toColorRGB=function(_){return[_>>>16&255,_>>>8&255,255&_]},y.fromColorRGB=function(_){return(255&_[0])<<16|(255&_[1])<<8|255&_[2]},y.prototype.clone=function(){var _=new y;return _.fg=this.fg,_.bg=this.bg,_.extended=this.extended.clone(),_},y.prototype.isInverse=function(){return 67108864&this.fg},y.prototype.isBold=function(){return 134217728&this.fg},y.prototype.isUnderline=function(){return 268435456&this.fg},y.prototype.isBlink=function(){return 536870912&this.fg},y.prototype.isInvisible=function(){return 1073741824&this.fg},y.prototype.isItalic=function(){return 67108864&this.bg},y.prototype.isDim=function(){return 134217728&this.bg},y.prototype.isStrikethrough=function(){return 2147483648&this.fg},y.prototype.getFgColorMode=function(){return 50331648&this.fg},y.prototype.getBgColorMode=function(){return 50331648&this.bg},y.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},y.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},y.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},y.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},y.prototype.isFgDefault=function(){return(50331648&this.fg)==0},y.prototype.isBgDefault=function(){return(50331648&this.bg)==0},y.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},y.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},y.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},y.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},y.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},y.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},y.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},y.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},y.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},y.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},y.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},y}();f.AttributeData=E;var m=function(){function y(_,g){_===void 0&&(_=0),g===void 0&&(g=-1),this.underlineStyle=_,this.underlineColor=g}return y.prototype.clone=function(){return new y(this.underlineStyle,this.underlineColor)},y.prototype.isEmpty=function(){return this.underlineStyle===0},y}();f.ExtendedAttrs=m},9092:function(D,f,E){var m=this&&this.__read||function(l,o){var a=typeof Symbol=="function"&&l[Symbol.iterator];if(!a)return l;var d,h,S=a.call(l),A=[];try{for(;(o===void 0||o-- >0)&&!(d=S.next()).done;)A.push(d.value)}catch(x){h={error:x}}finally{try{d&&!d.done&&(a=S.return)&&a.call(S)}finally{if(h)throw h.error}}return A},y=this&&this.__spreadArray||function(l,o,a){if(a||arguments.length===2)for(var d,h=0,S=o.length;hthis._rows},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isCursorInViewport",{get:function(){var o=this.ybase+this.y-this.ydisp;return o>=0&&of.MAX_BUFFER_SIZE?f.MAX_BUFFER_SIZE:a},l.prototype.fillViewportRows=function(o){if(this.lines.length===0){o===void 0&&(o=g.DEFAULT_ATTR_DATA);for(var a=this._rows;a--;)this.lines.push(this.getBlankLine(o))}},l.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new _.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},l.prototype.resize=function(o,a){var d=this.getNullCell(g.DEFAULT_ATTR_DATA),h=this._getCorrectBufferLength(a);if(h>this.lines.maxLength&&(this.lines.maxLength=h),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+A+1?(this.ybase--,A++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(o,d)));else for(x=this._rows;x>a;x--)this.lines.length>a+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(h0&&(this.lines.trimStart(M),this.ybase=Math.max(this.ybase-M,0),this.ydisp=Math.max(this.ydisp-M,0),this.savedY=Math.max(this.savedY-M,0)),this.lines.maxLength=h}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,a-1),A&&(this.y+=A),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=a-1,this._isReflowEnabled&&(this._reflow(o,a),this._cols>o))for(S=0;Sthis._cols?this._reflowLarger(o,a):this._reflowSmaller(o,a))},l.prototype._reflowLarger=function(o,a){var d=(0,u.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(d.length>0){var h=(0,u.reflowLargerCreateNewLayout)(this.lines,d);(0,u.reflowLargerApplyNewLayout)(this.lines,h.layout),this._reflowLargerAdjustViewport(o,a,h.countRemoved)}},l.prototype._reflowLargerAdjustViewport=function(o,a,d){for(var h=this.getNullCell(g.DEFAULT_ATTR_DATA),S=d;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;A--){var x=this.lines.get(A);if(!(!x||!x.isWrapped&&x.getTrimmedLength()<=o)){for(var M=[x];x.isWrapped&&A>0;)x=this.lines.get(--A),M.unshift(x);var O=this.ybase+this.y;if(!(O>=A&&O0&&(h.push({start:A+M.length+S,newLines:N}),S+=N.length),M.push.apply(M,y([],m(N),!1));var ne=T.length-1,ue=T[ne];ue===0&&(ue=T[--ne]);for(var oe=M.length-j-1,pe=P;oe>=0;){var _e=Math.min(pe,ue);if(M[ne]===void 0)break;if(M[ne].copyCellsFrom(M[oe],pe-_e,ue-_e,_e,!0),(ue-=_e)==0&&(ue=T[--ne]),(pe-=_e)==0){oe--;var z=Math.max(oe,0);pe=(0,u.getWrappedLineTrimmedLength)(M,z,this._cols)}}for(U=0;U0;)this.ybase===0?this.y0){var he=[],ke=[];for(U=0;U=0;U--)if(le&&le.start>Ie+Y){for(var Z=le.newLines.length-1;Z>=0;Z--)this.lines.set(U--,le.newLines[Z]);U++,he.push({index:Ie+1,amount:le.newLines.length}),Y+=le.newLines.length,le=h[++ge]}else this.lines.set(U,ke[Ie--]);var se=0;for(U=he.length-1;U>=0;U--)he[U].index+=se,this.lines.onInsertEmitter.fire(he[U]),se+=he[U].amount;var xe=Math.max(0,$+S-this.lines.maxLength);xe>0&&this.lines.onTrimEmitter.fire(xe)}},l.prototype.stringIndexToBufferIndex=function(o,a,d){for(d===void 0&&(d=!1);a;){var h=this.lines.get(o);if(!h)return[-1,-1];for(var S=d?h.getTrimmedLength():h.length,A=0;A0&&this.lines.get(a).isWrapped;)a--;for(;d+10;);return o>=this._cols?this._cols-1:o<0?0:o},l.prototype.nextStop=function(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o=this._cols?this._cols-1:o<0?0:o},l.prototype.clearMarkers=function(o){this._isClearing=!0;for(var a=0;a=h.index&&(d.line+=h.amount)})),d.register(this.lines.onDelete(function(h){d.line>=h.index&&d.lineh.index&&(d.line-=h.amount)})),d.register(d.onDispose(function(){return a._removeMarker(d)})),d},l.prototype._removeMarker=function(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)},l.prototype.iterator=function(o,a,d,h,S){return new n(this,o,a,d,h,S)},l}();f.Buffer=c;var n=function(){function l(o,a,d,h,S,A){d===void 0&&(d=0),h===void 0&&(h=o.lines.length),S===void 0&&(S=0),A===void 0&&(A=0),this._buffer=o,this._trimRight=a,this._startIndex=d,this._endIndex=h,this._startOverscan=S,this._endOverscan=A,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return l.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(o.last=this._endIndex+this._endOverscan),o.first=Math.max(o.first,0),o.last=Math.min(o.last,this._buffer.lines.length);for(var a="",d=o.first;d<=o.last;++d)a+=this._buffer.translateBufferLineToString(d,this._trimRight);return this._current=o.last+1,{range:o,content:a}},l}();f.BufferStringIterator=n},8437:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BufferLine=f.DEFAULT_ATTR_DATA=void 0;var m=E(482),y=E(643),_=E(511),g=E(3734);f.DEFAULT_ATTR_DATA=Object.freeze(new g.AttributeData);var k=function(){function C(u,v,L){L===void 0&&(L=!1),this.isWrapped=L,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);for(var b=v||_.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),c=0;c>22,2097152&v?this._combined[u].charCodeAt(this._combined[u].length-1):L]},C.prototype.set=function(u,v){this._data[3*u+1]=v[y.CHAR_DATA_ATTR_INDEX],v[y.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=v[1],this._data[3*u+0]=2097152|u|v[y.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=v[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[y.CHAR_DATA_WIDTH_INDEX]<<22},C.prototype.getWidth=function(u){return this._data[3*u+0]>>22},C.prototype.hasWidth=function(u){return 12582912&this._data[3*u+0]},C.prototype.getFg=function(u){return this._data[3*u+1]},C.prototype.getBg=function(u){return this._data[3*u+2]},C.prototype.hasContent=function(u){return 4194303&this._data[3*u+0]},C.prototype.getCodePoint=function(u){var v=this._data[3*u+0];return 2097152&v?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&v},C.prototype.isCombined=function(u){return 2097152&this._data[3*u+0]},C.prototype.getString=function(u){var v=this._data[3*u+0];return 2097152&v?this._combined[u]:2097151&v?(0,m.stringFromCodePoint)(2097151&v):""},C.prototype.loadCell=function(u,v){var L=3*u;return v.content=this._data[L+0],v.fg=this._data[L+1],v.bg=this._data[L+2],2097152&v.content&&(v.combinedData=this._combined[u]),268435456&v.bg&&(v.extended=this._extendedAttrs[u]),v},C.prototype.setCell=function(u,v){2097152&v.content&&(this._combined[u]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[u]=v.extended),this._data[3*u+0]=v.content,this._data[3*u+1]=v.fg,this._data[3*u+2]=v.bg},C.prototype.setCellFromCodePoint=function(u,v,L,b,c,n){268435456&c&&(this._extendedAttrs[u]=n),this._data[3*u+0]=v|L<<22,this._data[3*u+1]=b,this._data[3*u+2]=c},C.prototype.addCodepointToCell=function(u,v){var L=this._data[3*u+0];2097152&L?this._combined[u]+=(0,m.stringFromCodePoint)(v):(2097151&L?(this._combined[u]=(0,m.stringFromCodePoint)(2097151&L)+(0,m.stringFromCodePoint)(v),L&=-2097152,L|=2097152):L=v|1<<22,this._data[3*u+0]=L)},C.prototype.insertCells=function(u,v,L,b){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,b?.fg||0,b?.bg||0,b?.extended||new g.ExtendedAttrs),v=0;--n)this.setCell(u+v+n,this.loadCell(u+n,c));for(n=0;nthis.length){var L=new Uint32Array(3*u);this.length&&(3*u=u&&delete this._combined[n]}}else this._data=new Uint32Array(0),this._combined={};this.length=u}},C.prototype.fill=function(u){this._combined={},this._extendedAttrs={};for(var v=0;v=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0},C.prototype.copyCellsFrom=function(u,v,L,b,c){var n=u._data;if(c)for(var l=b-1;l>=0;l--)for(var o=0;o<3;o++)this._data[3*(L+l)+o]=n[3*(v+l)+o];else for(l=0;l=v&&(this._combined[d-v+L]=u._combined[d])}},C.prototype.translateToString=function(u,v,L){u===void 0&&(u=!1),v===void 0&&(v=0),L===void 0&&(L=this.length),u&&(L=Math.min(L,this.getTrimmedLength()));for(var b="";v>22||1}return b},C}();f.BufferLine=k},4841:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.getRangeLength=void 0,f.getRangeLength=function(E,m){if(E.start.y>E.end.y)throw new Error("Buffer range end ("+E.end.x+", "+E.end.y+") cannot be before start ("+E.start.x+", "+E.start.y+")");return m*(E.end.y-E.start.y)+(E.end.x-E.start.x+1)}},4634:(D,f)=>{function E(m,y,_){if(y===m.length-1)return m[y].getTrimmedLength();var g=!m[y].hasContent(_-1)&&m[y].getWidth(_-1)===1,k=m[y+1].getWidth(0)===2;return g&&k?_-1:_}Object.defineProperty(f,"__esModule",{value:!0}),f.getWrappedLineTrimmedLength=f.reflowSmallerGetNewLineLengths=f.reflowLargerApplyNewLayout=f.reflowLargerCreateNewLayout=f.reflowLargerGetLinesToRemove=void 0,f.reflowLargerGetLinesToRemove=function(m,y,_,g,k){for(var C=[],u=0;u=u&&g0&&(x>c||b[x].getTrimmedLength()===0);x--)A++;A>0&&(C.push(u+b.length-A),C.push(A)),u+=b.length-1}}}return C},f.reflowLargerCreateNewLayout=function(m,y){for(var _=[],g=0,k=y[g],C=0,u=0;uL&&(C-=L,u++);var b=m[u].getWidth(C-1)===2;b&&C--;var c=b?_-1:_;g.push(c),v+=c}return g},f.getWrappedLineTrimmedLength=E},5295:function(D,f,E){var m,y=this&&this.__extends||(m=function(C,u){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,L){v.__proto__=L}||function(v,L){for(var b in L)Object.prototype.hasOwnProperty.call(L,b)&&(v[b]=L[b])},m(C,u)},function(C,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function v(){this.constructor=C}m(C,u),C.prototype=u===null?Object.create(u):(v.prototype=u.prototype,new v)});Object.defineProperty(f,"__esModule",{value:!0}),f.BufferSet=void 0;var _=E(9092),g=E(8460),k=function(C){function u(v,L){var b=C.call(this)||this;return b._optionsService=v,b._bufferService=L,b._onBufferActivate=b.register(new g.EventEmitter),b.reset(),b}return y(u,C),Object.defineProperty(u.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),u.prototype.reset=function(){this._normal=new _.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new _.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()},Object.defineProperty(u.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),u.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},u.prototype.activateAltBuffer=function(v){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(v),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},u.prototype.resize=function(v,L){this._normal.resize(v,L),this._alt.resize(v,L)},u.prototype.setupTabStops=function(v){this._normal.setupTabStops(v),this._alt.setupTabStops(v)},u}(E(844).Disposable);f.BufferSet=k},511:function(D,f,E){var m,y=this&&this.__extends||(m=function(u,v){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,b){L.__proto__=b}||function(L,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(L[c]=b[c])},m(u,v)},function(u,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function L(){this.constructor=u}m(u,v),u.prototype=v===null?Object.create(v):(L.prototype=v.prototype,new L)});Object.defineProperty(f,"__esModule",{value:!0}),f.CellData=void 0;var _=E(482),g=E(643),k=E(3734),C=function(u){function v(){var L=u!==null&&u.apply(this,arguments)||this;return L.content=0,L.fg=0,L.bg=0,L.extended=new k.ExtendedAttrs,L.combinedData="",L}return y(v,u),v.fromCharData=function(L){var b=new v;return b.setFromCharData(L),b},v.prototype.isCombined=function(){return 2097152&this.content},v.prototype.getWidth=function(){return this.content>>22},v.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,_.stringFromCodePoint)(2097151&this.content):""},v.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},v.prototype.setFromCharData=function(L){this.fg=L[g.CHAR_DATA_ATTR_INDEX],this.bg=0;var b=!1;if(L[g.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(L[g.CHAR_DATA_CHAR_INDEX].length===2){var c=L[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){var n=L[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(c-55296)+n-56320+65536|L[g.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=L[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|L[g.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=L[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|L[g.CHAR_DATA_WIDTH_INDEX]<<22)},v.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},v}(k.AttributeData);f.CellData=C},643:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.WHITESPACE_CELL_CODE=f.WHITESPACE_CELL_WIDTH=f.WHITESPACE_CELL_CHAR=f.NULL_CELL_CODE=f.NULL_CELL_WIDTH=f.NULL_CELL_CHAR=f.CHAR_DATA_CODE_INDEX=f.CHAR_DATA_WIDTH_INDEX=f.CHAR_DATA_CHAR_INDEX=f.CHAR_DATA_ATTR_INDEX=f.DEFAULT_ATTR=f.DEFAULT_COLOR=void 0,f.DEFAULT_COLOR=256,f.DEFAULT_ATTR=256|f.DEFAULT_COLOR<<9,f.CHAR_DATA_ATTR_INDEX=0,f.CHAR_DATA_CHAR_INDEX=1,f.CHAR_DATA_WIDTH_INDEX=2,f.CHAR_DATA_CODE_INDEX=3,f.NULL_CELL_CHAR="",f.NULL_CELL_WIDTH=1,f.NULL_CELL_CODE=0,f.WHITESPACE_CELL_CHAR=" ",f.WHITESPACE_CELL_WIDTH=1,f.WHITESPACE_CELL_CODE=32},4863:function(D,f,E){var m,y=this&&this.__extends||(m=function(k,C){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,v){u.__proto__=v}||function(u,v){for(var L in v)Object.prototype.hasOwnProperty.call(v,L)&&(u[L]=v[L])},m(k,C)},function(k,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");function u(){this.constructor=k}m(k,C),k.prototype=C===null?Object.create(C):(u.prototype=C.prototype,new u)});Object.defineProperty(f,"__esModule",{value:!0}),f.Marker=void 0;var _=E(8460),g=function(k){function C(u){var v=k.call(this)||this;return v.line=u,v._id=C._nextId++,v.isDisposed=!1,v._onDispose=new _.EventEmitter,v}return y(C,k),Object.defineProperty(C.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),C.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),k.prototype.dispose.call(this))},C._nextId=1,C}(E(844).Disposable);f.Marker=g},7116:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.DEFAULT_CHARSET=f.CHARSETS=void 0,f.CHARSETS={},f.DEFAULT_CHARSET=f.CHARSETS.B,f.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},f.CHARSETS.A={"#":"\xA3"},f.CHARSETS.B=void 0,f.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},f.CHARSETS.C=f.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},f.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},f.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},f.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},f.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},f.CHARSETS.E=f.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},f.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},f.CHARSETS.H=f.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},f.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(D,f)=>{var E,m;Object.defineProperty(f,"__esModule",{value:!0}),f.C1_ESCAPED=f.C1=f.C0=void 0,function(y){y.NUL="\0",y.SOH="",y.STX="",y.ETX="",y.EOT="",y.ENQ="",y.ACK="",y.BEL="\x07",y.BS="\b",y.HT=" ",y.LF=` -`,y.VT="\v",y.FF="\f",y.CR="\r",y.SO="",y.SI="",y.DLE="",y.DC1="",y.DC2="",y.DC3="",y.DC4="",y.NAK="",y.SYN="",y.ETB="",y.CAN="",y.EM="",y.SUB="",y.ESC="\x1B",y.FS="",y.GS="",y.RS="",y.US="",y.SP=" ",y.DEL="\x7F"}(E=f.C0||(f.C0={})),(m=f.C1||(f.C1={})).PAD="\x80",m.HOP="\x81",m.BPH="\x82",m.NBH="\x83",m.IND="\x84",m.NEL="\x85",m.SSA="\x86",m.ESA="\x87",m.HTS="\x88",m.HTJ="\x89",m.VTS="\x8A",m.PLD="\x8B",m.PLU="\x8C",m.RI="\x8D",m.SS2="\x8E",m.SS3="\x8F",m.DCS="\x90",m.PU1="\x91",m.PU2="\x92",m.STS="\x93",m.CCH="\x94",m.MW="\x95",m.SPA="\x96",m.EPA="\x97",m.SOS="\x98",m.SGCI="\x99",m.SCI="\x9A",m.CSI="\x9B",m.ST="\x9C",m.OSC="\x9D",m.PM="\x9E",m.APC="\x9F",(f.C1_ESCAPED||(f.C1_ESCAPED={})).ST=E.ESC+"\\"},7399:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.evaluateKeyboardEvent=void 0;var m=E(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};f.evaluateKeyboardEvent=function(_,g,k,C){var u={type:0,cancel:!1,key:void 0},v=(_.shiftKey?1:0)|(_.altKey?2:0)|(_.ctrlKey?4:0)|(_.metaKey?8:0);switch(_.keyCode){case 0:_.key==="UIKeyInputUpArrow"?u.key=g?m.C0.ESC+"OA":m.C0.ESC+"[A":_.key==="UIKeyInputLeftArrow"?u.key=g?m.C0.ESC+"OD":m.C0.ESC+"[D":_.key==="UIKeyInputRightArrow"?u.key=g?m.C0.ESC+"OC":m.C0.ESC+"[C":_.key==="UIKeyInputDownArrow"&&(u.key=g?m.C0.ESC+"OB":m.C0.ESC+"[B");break;case 8:if(_.shiftKey){u.key=m.C0.BS;break}if(_.altKey){u.key=m.C0.ESC+m.C0.DEL;break}u.key=m.C0.DEL;break;case 9:if(_.shiftKey){u.key=m.C0.ESC+"[Z";break}u.key=m.C0.HT,u.cancel=!0;break;case 13:u.key=_.altKey?m.C0.ESC+m.C0.CR:m.C0.CR,u.cancel=!0;break;case 27:u.key=m.C0.ESC,_.altKey&&(u.key=m.C0.ESC+m.C0.ESC),u.cancel=!0;break;case 37:if(_.metaKey)break;v?(u.key=m.C0.ESC+"[1;"+(v+1)+"D",u.key===m.C0.ESC+"[1;3D"&&(u.key=m.C0.ESC+(k?"b":"[1;5D"))):u.key=g?m.C0.ESC+"OD":m.C0.ESC+"[D";break;case 39:if(_.metaKey)break;v?(u.key=m.C0.ESC+"[1;"+(v+1)+"C",u.key===m.C0.ESC+"[1;3C"&&(u.key=m.C0.ESC+(k?"f":"[1;5C"))):u.key=g?m.C0.ESC+"OC":m.C0.ESC+"[C";break;case 38:if(_.metaKey)break;v?(u.key=m.C0.ESC+"[1;"+(v+1)+"A",k||u.key!==m.C0.ESC+"[1;3A"||(u.key=m.C0.ESC+"[1;5A")):u.key=g?m.C0.ESC+"OA":m.C0.ESC+"[A";break;case 40:if(_.metaKey)break;v?(u.key=m.C0.ESC+"[1;"+(v+1)+"B",k||u.key!==m.C0.ESC+"[1;3B"||(u.key=m.C0.ESC+"[1;5B")):u.key=g?m.C0.ESC+"OB":m.C0.ESC+"[B";break;case 45:_.shiftKey||_.ctrlKey||(u.key=m.C0.ESC+"[2~");break;case 46:u.key=v?m.C0.ESC+"[3;"+(v+1)+"~":m.C0.ESC+"[3~";break;case 36:u.key=v?m.C0.ESC+"[1;"+(v+1)+"H":g?m.C0.ESC+"OH":m.C0.ESC+"[H";break;case 35:u.key=v?m.C0.ESC+"[1;"+(v+1)+"F":g?m.C0.ESC+"OF":m.C0.ESC+"[F";break;case 33:_.shiftKey?u.type=2:_.ctrlKey?u.key=m.C0.ESC+"[5;"+(v+1)+"~":u.key=m.C0.ESC+"[5~";break;case 34:_.shiftKey?u.type=3:_.ctrlKey?u.key=m.C0.ESC+"[6;"+(v+1)+"~":u.key=m.C0.ESC+"[6~";break;case 112:u.key=v?m.C0.ESC+"[1;"+(v+1)+"P":m.C0.ESC+"OP";break;case 113:u.key=v?m.C0.ESC+"[1;"+(v+1)+"Q":m.C0.ESC+"OQ";break;case 114:u.key=v?m.C0.ESC+"[1;"+(v+1)+"R":m.C0.ESC+"OR";break;case 115:u.key=v?m.C0.ESC+"[1;"+(v+1)+"S":m.C0.ESC+"OS";break;case 116:u.key=v?m.C0.ESC+"[15;"+(v+1)+"~":m.C0.ESC+"[15~";break;case 117:u.key=v?m.C0.ESC+"[17;"+(v+1)+"~":m.C0.ESC+"[17~";break;case 118:u.key=v?m.C0.ESC+"[18;"+(v+1)+"~":m.C0.ESC+"[18~";break;case 119:u.key=v?m.C0.ESC+"[19;"+(v+1)+"~":m.C0.ESC+"[19~";break;case 120:u.key=v?m.C0.ESC+"[20;"+(v+1)+"~":m.C0.ESC+"[20~";break;case 121:u.key=v?m.C0.ESC+"[21;"+(v+1)+"~":m.C0.ESC+"[21~";break;case 122:u.key=v?m.C0.ESC+"[23;"+(v+1)+"~":m.C0.ESC+"[23~";break;case 123:u.key=v?m.C0.ESC+"[24;"+(v+1)+"~":m.C0.ESC+"[24~";break;default:if(!_.ctrlKey||_.shiftKey||_.altKey||_.metaKey)if(k&&!C||!_.altKey||_.metaKey)!k||_.altKey||_.ctrlKey||_.shiftKey||!_.metaKey?_.key&&!_.ctrlKey&&!_.altKey&&!_.metaKey&&_.keyCode>=48&&_.key.length===1?u.key=_.key:_.key&&_.ctrlKey&&(_.key==="_"&&(u.key=m.C0.US),_.key==="@"&&(u.key=m.C0.NUL)):_.keyCode===65&&(u.type=1);else{var L=y[_.keyCode],b=L?.[_.shiftKey?1:0];if(b)u.key=m.C0.ESC+b;else if(_.keyCode>=65&&_.keyCode<=90){var c=_.ctrlKey?_.keyCode-64:_.keyCode+32,n=String.fromCharCode(c);_.shiftKey&&(n=n.toUpperCase()),u.key=m.C0.ESC+n}else _.key==="Dead"&&_.code.startsWith("Key")&&(n=_.code.slice(3,4),_.shiftKey||(n=n.toLowerCase()),u.key=m.C0.ESC+n,u.cancel=!0)}else _.keyCode>=65&&_.keyCode<=90?u.key=String.fromCharCode(_.keyCode-64):_.keyCode===32?u.key=m.C0.NUL:_.keyCode>=51&&_.keyCode<=55?u.key=String.fromCharCode(_.keyCode-51+27):_.keyCode===56?u.key=m.C0.DEL:_.keyCode===219?u.key=m.C0.ESC:_.keyCode===220?u.key=m.C0.FS:_.keyCode===221&&(u.key=m.C0.GS)}return u}},482:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.Utf8ToUtf32=f.StringToUtf32=f.utf32ToString=f.stringFromCodePoint=void 0,f.stringFromCodePoint=function(y){return y>65535?(y-=65536,String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):String.fromCharCode(y)},f.utf32ToString=function(y,_,g){_===void 0&&(_=0),g===void 0&&(g=y.length);for(var k="",C=_;C65535?(u-=65536,k+=String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):k+=String.fromCharCode(u)}return k};var E=function(){function y(){this._interim=0}return y.prototype.clear=function(){this._interim=0},y.prototype.decode=function(_,g){var k=_.length;if(!k)return 0;var C=0,u=0;this._interim&&(56320<=(b=_.charCodeAt(u++))&&b<=57343?g[C++]=1024*(this._interim-55296)+b-56320+65536:(g[C++]=this._interim,g[C++]=b),this._interim=0);for(var v=u;v=k)return this._interim=L,C;var b;56320<=(b=_.charCodeAt(v))&&b<=57343?g[C++]=1024*(L-55296)+b-56320+65536:(g[C++]=L,g[C++]=b)}else L!==65279&&(g[C++]=L)}return C},y}();f.StringToUtf32=E;var m=function(){function y(){this.interim=new Uint8Array(3)}return y.prototype.clear=function(){this.interim.fill(0)},y.prototype.decode=function(_,g){var k=_.length;if(!k)return 0;var C,u,v,L,b=0,c=0,n=0;if(this.interim[0]){var l=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;for(var a=0,d=void 0;(d=63&this.interim[++a])&&a<4;)o<<=6,o|=d;for(var h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=h-a;n=k)return 0;if((192&(d=_[n++]))!=128){n--,l=!0;break}this.interim[a++]=d,o<<=6,o|=63&d}l||(h===2?o<128?n--:g[b++]=o:h===3?o<2048||o>=55296&&o<=57343||o===65279||(g[b++]=o):o<65536||o>1114111||(g[b++]=o)),this.interim.fill(0)}for(var A=k-4,x=n;x=k)return this.interim[0]=C,b;if((192&(u=_[x++]))!=128){x--;continue}if((c=(31&C)<<6|63&u)<128){x--;continue}g[b++]=c}else if((240&C)==224){if(x>=k)return this.interim[0]=C,b;if((192&(u=_[x++]))!=128){x--;continue}if(x>=k)return this.interim[0]=C,this.interim[1]=u,b;if((192&(v=_[x++]))!=128){x--;continue}if((c=(15&C)<<12|(63&u)<<6|63&v)<2048||c>=55296&&c<=57343||c===65279)continue;g[b++]=c}else if((248&C)==240){if(x>=k)return this.interim[0]=C,b;if((192&(u=_[x++]))!=128){x--;continue}if(x>=k)return this.interim[0]=C,this.interim[1]=u,b;if((192&(v=_[x++]))!=128){x--;continue}if(x>=k)return this.interim[0]=C,this.interim[1]=u,this.interim[2]=v,b;if((192&(L=_[x++]))!=128){x--;continue}if((c=(7&C)<<18|(63&u)<<12|(63&v)<<6|63&L)<65536||c>1114111)continue;g[b++]=c}}return b},y}();f.Utf8ToUtf32=m},225:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.UnicodeV6=void 0;var m,y=E(8273),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],g=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],k=function(){function C(){if(this.version="6",!m){m=new Uint8Array(65536),(0,y.fill)(m,1),m[0]=0,(0,y.fill)(m,0,1,32),(0,y.fill)(m,0,127,160),(0,y.fill)(m,2,4352,4448),m[9001]=2,m[9002]=2,(0,y.fill)(m,2,11904,42192),m[12351]=1,(0,y.fill)(m,2,44032,55204),(0,y.fill)(m,2,63744,64256),(0,y.fill)(m,2,65040,65050),(0,y.fill)(m,2,65072,65136),(0,y.fill)(m,2,65280,65377),(0,y.fill)(m,2,65504,65511);for(var u=0;u<_.length;++u)(0,y.fill)(m,0,_[u][0],_[u][1]+1)}}return C.prototype.wcwidth=function(u){return u<32?0:u<127?1:u<65536?m[u]:function(v,L){var b,c=0,n=L.length-1;if(vL[n][1])return!1;for(;n>=c;)if(v>L[b=c+n>>1][1])c=b+1;else{if(!(v=131072&&u<=196605||u>=196608&&u<=262141?2:1},C}();f.UnicodeV6=k},5981:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.WriteBuffer=void 0;var m=E(8460),y=typeof queueMicrotask>"u"?function(g){Promise.resolve().then(g)}:queueMicrotask,_=function(){function g(k){this._action=k,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new m.EventEmitter}return Object.defineProperty(g.prototype,"onWriteParsed",{get:function(){return this._onWriteParsed.event},enumerable:!1,configurable:!0}),g.prototype.writeSync=function(k,C){if(C!==void 0&&this._syncCalls>C)this._syncCalls=0;else if(this._pendingData+=k.length,this._writeBuffer.push(k),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){var u;for(this._isSyncWriting=!0;u=this._writeBuffer.shift();){this._action(u);var v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}},g.prototype.write=function(k,C){var u=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return u._innerWrite()})),this._pendingData+=k.length,this._writeBuffer.push(k),this._callbacks.push(C)},g.prototype._innerWrite=function(k,C){var u=this;k===void 0&&(k=0),C===void 0&&(C=!0);for(var v=k||Date.now();this._writeBuffer.length>this._bufferOffset;){var L=this._writeBuffer[this._bufferOffset],b=this._action(L,C);if(b)return void b.catch(function(n){return y(function(){throw n}),Promise.resolve(!1)}).then(function(n){return Date.now()-v>=12?setTimeout(function(){return u._innerWrite(0,n)}):u._innerWrite(v,n)});var c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=L.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return u._innerWrite()})):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()},g}();f.WriteBuffer=_},5941:function(D,f){var E=this&&this.__read||function(g,k){var C=typeof Symbol=="function"&&g[Symbol.iterator];if(!C)return g;var u,v,L=C.call(g),b=[];try{for(;(k===void 0||k-- >0)&&!(u=L.next()).done;)b.push(u.value)}catch(c){v={error:c}}finally{try{u&&!u.done&&(C=L.return)&&C.call(L)}finally{if(v)throw v.error}}return b};Object.defineProperty(f,"__esModule",{value:!0}),f.toRgbString=f.parseColor=void 0;var m=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,y=/^[\da-f]+$/;function _(g,k){var C=g.toString(16),u=C.length<2?"0"+C:C;switch(k){case 4:return C[0];case 8:return u;case 12:return(u+u).slice(0,3);default:return u+u}}f.parseColor=function(g){if(g){var k=g.toLowerCase();if(k.indexOf("rgb:")===0){k=k.slice(4);var C=m.exec(k);if(C){var u=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/u*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/u*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/u*255)]}}else if(k.indexOf("#")===0&&(k=k.slice(1),y.exec(k)&&[3,6,9,12].includes(k.length))){for(var v=k.length/3,L=[0,0,0],b=0;b<3;++b){var c=parseInt(k.slice(v*b,v*b+v),16);L[b]=v===1?c<<4:v===2?c:v===3?c>>4:c>>8}return L}}},f.toRgbString=function(g,k){k===void 0&&(k=16);var C=E(g,3),u=C[0],v=C[1],L=C[2];return"rgb:"+_(u,k)+"/"+_(v,k)+"/"+_(L,k)}},5770:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.PAYLOAD_LIMIT=void 0,f.PAYLOAD_LIMIT=1e7},6351:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.DcsHandler=f.DcsParser=void 0;var m=E(482),y=E(8742),_=E(5770),g=[],k=function(){function v(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return v.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=g},v.prototype.registerHandler=function(L,b){this._handlers[L]===void 0&&(this._handlers[L]=[]);var c=this._handlers[L];return c.push(b),{dispose:function(){var n=c.indexOf(b);n!==-1&&c.splice(n,1)}}},v.prototype.clearHandler=function(L){this._handlers[L]&&delete this._handlers[L]},v.prototype.setHandlerFallback=function(L){this._handlerFb=L},v.prototype.reset=function(){if(this._active.length)for(var L=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;L>=0;--L)this._active[L].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0},v.prototype.hook=function(L,b){if(this.reset(),this._ident=L,this._active=this._handlers[L]||g,this._active.length)for(var c=this._active.length-1;c>=0;c--)this._active[c].hook(b);else this._handlerFb(this._ident,"HOOK",b)},v.prototype.put=function(L,b,c){if(this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].put(L,b,c);else this._handlerFb(this._ident,"PUT",(0,m.utf32ToString)(L,b,c))},v.prototype.unhook=function(L,b){if(b===void 0&&(b=!0),this._active.length){var c=!1,n=this._active.length-1,l=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,c=b,l=this._stack.fallThrough,this._stack.paused=!1),!l&&c===!1){for(;n>=0&&(c=this._active[n].unhook(L))!==!0;n--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,c;n--}for(;n>=0;n--)if((c=this._active[n].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",L);this._active=g,this._ident=0},v}();f.DcsParser=k;var C=new y.Params;C.addParam(0);var u=function(){function v(L){this._handler=L,this._data="",this._params=C,this._hitLimit=!1}return v.prototype.hook=function(L){this._params=L.length>1||L.params[0]?L.clone():C,this._data="",this._hitLimit=!1},v.prototype.put=function(L,b,c){this._hitLimit||(this._data+=(0,m.utf32ToString)(L,b,c),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},v.prototype.unhook=function(L){var b=this,c=!1;if(this._hitLimit)c=!1;else if(L&&(c=this._handler(this._data,this._params))instanceof Promise)return c.then(function(n){return b._params=C,b._data="",b._hitLimit=!1,n});return this._params=C,this._data="",this._hitLimit=!1,c},v}();f.DcsHandler=u},2015:function(D,f,E){var m,y=this&&this.__extends||(m=function(c,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,o){l.__proto__=o}||function(l,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(l[a]=o[a])},m(c,n)},function(c,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function l(){this.constructor=c}m(c,n),c.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)});Object.defineProperty(f,"__esModule",{value:!0}),f.EscapeSequenceParser=f.VT500_TRANSITION_TABLE=f.TransitionTable=void 0;var _=E(844),g=E(8273),k=E(8742),C=E(6242),u=E(6351),v=function(){function c(n){this.table=new Uint8Array(n)}return c.prototype.setDefault=function(n,l){(0,g.fill)(this.table,n<<4|l)},c.prototype.add=function(n,l,o,a){this.table[l<<8|n]=o<<4|a},c.prototype.addMany=function(n,l,o,a){for(var d=0;d1)throw new Error("only one byte as prefix supported");if((a=l.prefix.charCodeAt(0))&&60>a||a>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var d=0;dh||h>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=h}}if(l.final.length!==1)throw new Error("final must be a single byte");var S=l.final.charCodeAt(0);if(o[0]>S||S>o[1])throw new Error("final must be in range "+o[0]+" .. "+o[1]);return(a<<=8)|S},n.prototype.identToString=function(l){for(var o=[];l;)o.push(String.fromCharCode(255&l)),l>>=8;return o.reverse().join("")},n.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},n.prototype.setPrintHandler=function(l){this._printHandler=l},n.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},n.prototype.registerEscHandler=function(l,o){var a=this._identifier(l,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);var d=this._escHandlers[a];return d.push(o),{dispose:function(){var h=d.indexOf(o);h!==-1&&d.splice(h,1)}}},n.prototype.clearEscHandler=function(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]},n.prototype.setEscHandlerFallback=function(l){this._escHandlerFb=l},n.prototype.setExecuteHandler=function(l,o){this._executeHandlers[l.charCodeAt(0)]=o},n.prototype.clearExecuteHandler=function(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]},n.prototype.setExecuteHandlerFallback=function(l){this._executeHandlerFb=l},n.prototype.registerCsiHandler=function(l,o){var a=this._identifier(l);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);var d=this._csiHandlers[a];return d.push(o),{dispose:function(){var h=d.indexOf(o);h!==-1&&d.splice(h,1)}}},n.prototype.clearCsiHandler=function(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]},n.prototype.setCsiHandlerFallback=function(l){this._csiHandlerFb=l},n.prototype.registerDcsHandler=function(l,o){return this._dcsParser.registerHandler(this._identifier(l),o)},n.prototype.clearDcsHandler=function(l){this._dcsParser.clearHandler(this._identifier(l))},n.prototype.setDcsHandlerFallback=function(l){this._dcsParser.setHandlerFallback(l)},n.prototype.registerOscHandler=function(l,o){return this._oscParser.registerHandler(l,o)},n.prototype.clearOscHandler=function(l){this._oscParser.clearHandler(l)},n.prototype.setOscHandlerFallback=function(l){this._oscParser.setHandlerFallback(l)},n.prototype.setErrorHandler=function(l){this._errorHandler=l},n.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},n.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])},n.prototype._preserveStack=function(l,o,a,d,h){this._parseStack.state=l,this._parseStack.handlers=o,this._parseStack.handlerPos=a,this._parseStack.transition=d,this._parseStack.chunkPos=h},n.prototype.parse=function(l,o,a){var d,h=0,S=0,A=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,A=this._parseStack.chunkPos+1;else{if(a===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");var x=this._parseStack.handlers,M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(a===!1&&M>-1){for(;M>=0&&(d=x[M](this._params))!==!0;M--)if(d instanceof Promise)return this._parseStack.handlerPos=M,d}this._parseStack.handlers=[];break;case 4:if(a===!1&&M>-1){for(;M>=0&&(d=x[M]())!==!0;M--)if(d instanceof Promise)return this._parseStack.handlerPos=M,d}this._parseStack.handlers=[];break;case 6:if(h=l[this._parseStack.chunkPos],d=this._dcsParser.unhook(h!==24&&h!==26,a))return d;h===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(h=l[this._parseStack.chunkPos],d=this._oscParser.end(h!==24&&h!==26,a))return d;h===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,A=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(var O=A;O>4){case 2:for(var I=O+1;;++I){if(I>=o||(h=l[I])<32||h>126&&h=o||(h=l[I])<32||h>126&&h=o||(h=l[I])<32||h>126&&h=o||(h=l[I])<32||h>126&&h=0&&(d=x[P](this._params))!==!0;P--)if(d instanceof Promise)return this._preserveStack(3,x,P,S,O),d;P<0&&this._csiHandlerFb(this._collect<<8|h,this._params),this.precedingCodepoint=0;break;case 8:do switch(h){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(h-48)}while(++O47&&h<60);O--;break;case 9:this._collect<<=8,this._collect|=h;break;case 10:for(var T=this._escHandlers[this._collect<<8|h],j=T?T.length-1:-1;j>=0&&(d=T[j]())!==!0;j--)if(d instanceof Promise)return this._preserveStack(4,T,j,S,O),d;j<0&&this._escHandlerFb(this._collect<<8|h),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|h,this._params);break;case 13:for(var N=O+1;;++N)if(N>=o||(h=l[N])===24||h===26||h===27||h>127&&h=o||(h=l[U])<32||h>127&&h{Object.defineProperty(f,"__esModule",{value:!0}),f.OscHandler=f.OscParser=void 0;var m=E(5770),y=E(482),_=[],g=function(){function C(){this._state=0,this._active=_,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return C.prototype.registerHandler=function(u,v){this._handlers[u]===void 0&&(this._handlers[u]=[]);var L=this._handlers[u];return L.push(v),{dispose:function(){var b=L.indexOf(v);b!==-1&&L.splice(b,1)}}},C.prototype.clearHandler=function(u){this._handlers[u]&&delete this._handlers[u]},C.prototype.setHandlerFallback=function(u){this._handlerFb=u},C.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=_},C.prototype.reset=function(){if(this._state===2)for(var u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].end(!1);this._stack.paused=!1,this._active=_,this._id=-1,this._state=0},C.prototype._start=function(){if(this._active=this._handlers[this._id]||_,this._active.length)for(var u=this._active.length-1;u>=0;u--)this._active[u].start();else this._handlerFb(this._id,"START")},C.prototype._put=function(u,v,L){if(this._active.length)for(var b=this._active.length-1;b>=0;b--)this._active[b].put(u,v,L);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(u,v,L))},C.prototype.start=function(){this.reset(),this._state=1},C.prototype.put=function(u,v,L){if(this._state!==3){if(this._state===1)for(;v0&&this._put(u,v,L)}},C.prototype.end=function(u,v){if(v===void 0&&(v=!0),this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){var L=!1,b=this._active.length-1,c=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,L=v,c=this._stack.fallThrough,this._stack.paused=!1),!c&&L===!1){for(;b>=0&&(L=this._active[b].end(u))!==!0;b--)if(L instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,L;b--}for(;b>=0;b--)if((L=this._active[b].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,L}else this._handlerFb(this._id,"END",u);this._active=_,this._id=-1,this._state=0}},C}();f.OscParser=g;var k=function(){function C(u){this._handler=u,this._data="",this._hitLimit=!1}return C.prototype.start=function(){this._data="",this._hitLimit=!1},C.prototype.put=function(u,v,L){this._hitLimit||(this._data+=(0,y.utf32ToString)(u,v,L),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},C.prototype.end=function(u){var v=this,L=!1;if(this._hitLimit)L=!1;else if(u&&(L=this._handler(this._data))instanceof Promise)return L.then(function(b){return v._data="",v._hitLimit=!1,b});return this._data="",this._hitLimit=!1,L},C}();f.OscHandler=k},8742:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.Params=void 0;var E=2147483647,m=function(){function y(_,g){if(_===void 0&&(_=32),g===void 0&&(g=32),this.maxLength=_,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(_),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(_),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return y.fromArray=function(_){var g=new y;if(!_.length)return g;for(var k=Array.isArray(_[0])?1:0;k<_.length;++k){var C=_[k];if(Array.isArray(C))for(var u=0;u>8,C=255&this._subParamsIdx[g];C-k>0&&_.push(Array.prototype.slice.call(this._subParams,k,C))}return _},y.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},y.prototype.addParam=function(_){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=_>E?E:_}},y.prototype.addSubParam=function(_){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=_>E?E:_,this._subParamsIdx[this.length-1]++}},y.prototype.hasSubParams=function(_){return(255&this._subParamsIdx[_])-(this._subParamsIdx[_]>>8)>0},y.prototype.getSubParams=function(_){var g=this._subParamsIdx[_]>>8,k=255&this._subParamsIdx[_];return k-g>0?this._subParams.subarray(g,k):null},y.prototype.getSubParamsAll=function(){for(var _={},g=0;g>8,C=255&this._subParamsIdx[g];C-k>0&&(_[g]=this._subParams.slice(k,C))}return _},y.prototype.addDigit=function(_){var g;if(!(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var k=this._digitIsSub?this._subParams:this.params,C=k[g-1];k[g-1]=~C?Math.min(10*C+_,E):_}},y}();f.Params=m},5741:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.AddonManager=void 0;var E=function(){function m(){this._addons=[]}return m.prototype.dispose=function(){for(var y=this._addons.length-1;y>=0;y--)this._addons[y].instance.dispose()},m.prototype.loadAddon=function(y,_){var g=this,k={instance:_,dispose:_.dispose,isDisposed:!1};this._addons.push(k),_.dispose=function(){return g._wrappedAddonDispose(k)},_.activate(y)},m.prototype._wrappedAddonDispose=function(y){if(!y.isDisposed){for(var _=-1,g=0;g{Object.defineProperty(f,"__esModule",{value:!0}),f.BufferApiView=void 0;var m=E(3785),y=E(511),_=function(){function g(k,C){this._buffer=k,this.type=C}return g.prototype.init=function(k){return this._buffer=k,this},Object.defineProperty(g.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),g.prototype.getLine=function(k){var C=this._buffer.lines.get(k);if(C)return new m.BufferLineApiView(C)},g.prototype.getNullCell=function(){return new y.CellData},g}();f.BufferApiView=_},3785:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BufferLineApiView=void 0;var m=E(511),y=function(){function _(g){this._line=g}return Object.defineProperty(_.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),_.prototype.getCell=function(g,k){if(!(g<0||g>=this._line.length))return k?(this._line.loadCell(g,k),k):this._line.loadCell(g,new m.CellData)},_.prototype.translateToString=function(g,k,C){return this._line.translateToString(g,k,C)},_}();f.BufferLineApiView=y},8285:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BufferNamespaceApi=void 0;var m=E(8771),y=E(8460),_=function(){function g(k){var C=this;this._core=k,this._onBufferChange=new y.EventEmitter,this._normal=new m.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new m.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(function(){return C._onBufferChange.fire(C.active)})}return Object.defineProperty(g.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"active",{get:function(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"normal",{get:function(){return this._normal.init(this._core.buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"alternate",{get:function(){return this._alternate.init(this._core.buffers.alt)},enumerable:!1,configurable:!0}),g}();f.BufferNamespaceApi=_},7975:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ParserApi=void 0;var E=function(){function m(y){this._core=y}return m.prototype.registerCsiHandler=function(y,_){return this._core.registerCsiHandler(y,function(g){return _(g.toArray())})},m.prototype.addCsiHandler=function(y,_){return this.registerCsiHandler(y,_)},m.prototype.registerDcsHandler=function(y,_){return this._core.registerDcsHandler(y,function(g,k){return _(g,k.toArray())})},m.prototype.addDcsHandler=function(y,_){return this.registerDcsHandler(y,_)},m.prototype.registerEscHandler=function(y,_){return this._core.registerEscHandler(y,_)},m.prototype.addEscHandler=function(y,_){return this.registerEscHandler(y,_)},m.prototype.registerOscHandler=function(y,_){return this._core.registerOscHandler(y,_)},m.prototype.addOscHandler=function(y,_){return this.registerOscHandler(y,_)},m}();f.ParserApi=E},7090:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.UnicodeApi=void 0;var E=function(){function m(y){this._core=y}return m.prototype.register=function(y){this._core.unicodeService.register(y)},Object.defineProperty(m.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(y){this._core.unicodeService.activeVersion=y},enumerable:!1,configurable:!0}),m}();f.UnicodeApi=E},744:function(D,f,E){var m,y=this&&this.__extends||(m=function(b,c){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,l){n.__proto__=l}||function(n,l){for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(n[o]=l[o])},m(b,c)},function(b,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function n(){this.constructor=b}m(b,c),b.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)}),_=this&&this.__decorate||function(b,c,n,l){var o,a=arguments.length,d=a<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(b,c,n,l);else for(var h=b.length-1;h>=0;h--)(o=b[h])&&(d=(a<3?o(d):a>3?o(c,n,d):o(c,n))||d);return a>3&&d&&Object.defineProperty(c,n,d),d},g=this&&this.__param||function(b,c){return function(n,l){c(n,l,b)}};Object.defineProperty(f,"__esModule",{value:!0}),f.BufferService=f.MINIMUM_ROWS=f.MINIMUM_COLS=void 0;var k=E(2585),C=E(5295),u=E(8460),v=E(844);f.MINIMUM_COLS=2,f.MINIMUM_ROWS=1;var L=function(b){function c(n){var l=b.call(this)||this;return l._optionsService=n,l.isUserScrolling=!1,l._onResize=new u.EventEmitter,l._onScroll=new u.EventEmitter,l.cols=Math.max(n.rawOptions.cols||0,f.MINIMUM_COLS),l.rows=Math.max(n.rawOptions.rows||0,f.MINIMUM_ROWS),l.buffers=new C.BufferSet(n,l),l}return y(c,b),Object.defineProperty(c.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),c.prototype.dispose=function(){b.prototype.dispose.call(this),this.buffers.dispose()},c.prototype.resize=function(n,l){this.cols=n,this.rows=l,this.buffers.resize(n,l),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:n,rows:l})},c.prototype.reset=function(){this.buffers.reset(),this.isUserScrolling=!1},c.prototype.scroll=function(n,l){l===void 0&&(l=!1);var o,a=this.buffer;(o=this._cachedBlankLine)&&o.length===this.cols&&o.getFg(0)===n.fg&&o.getBg(0)===n.bg||(o=a.getBlankLine(n,l),this._cachedBlankLine=o),o.isWrapped=l;var d=a.ybase+a.scrollTop,h=a.ybase+a.scrollBottom;if(a.scrollTop===0){var S=a.lines.isFull;h===a.lines.length-1?S?a.lines.recycle().copyFrom(o):a.lines.push(o.clone()):a.lines.splice(h+1,0,o.clone()),S?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{var A=h-d+1;a.lines.shiftElements(d+1,A-1,-1),a.lines.set(h,o.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)},c.prototype.scrollLines=function(n,l,o){var a=this.buffer;if(n<0){if(a.ydisp===0)return;this.isUserScrolling=!0}else n+a.ydisp>=a.ybase&&(this.isUserScrolling=!1);var d=a.ydisp;a.ydisp=Math.max(Math.min(a.ydisp+n,a.ybase),0),d!==a.ydisp&&(l||this._onScroll.fire(a.ydisp))},c.prototype.scrollPages=function(n){this.scrollLines(n*(this.rows-1))},c.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},c.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},c.prototype.scrollToLine=function(n){var l=n-this.buffer.ydisp;l!==0&&this.scrollLines(l)},_([g(0,k.IOptionsService)],c)}(v.Disposable);f.BufferService=L},7994:(D,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.CharsetService=void 0;var E=function(){function m(){this.glevel=0,this._charsets=[]}return m.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},m.prototype.setgLevel=function(y){this.glevel=y,this.charset=this._charsets[y]},m.prototype.setgCharset=function(y,_){this._charsets[y]=_,this.glevel===y&&(this.charset=_)},m}();f.CharsetService=E},1753:function(D,f,E){var m=this&&this.__decorate||function(c,n,l,o){var a,d=arguments.length,h=d<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(c,n,l,o);else for(var S=c.length-1;S>=0;S--)(a=c[S])&&(h=(d<3?a(h):d>3?a(n,l,h):a(n,l))||h);return d>3&&h&&Object.defineProperty(n,l,h),h},y=this&&this.__param||function(c,n){return function(l,o){n(l,o,c)}},_=this&&this.__values||function(c){var n=typeof Symbol=="function"&&Symbol.iterator,l=n&&c[n],o=0;if(l)return l.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&o>=c.length&&(c=void 0),{value:c&&c[o++],done:!c}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.CoreMouseService=void 0;var g=E(2585),k=E(8460),C={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(c){return c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)}},VT200:{events:19,restrict:function(c){return c.action!==32}},DRAG:{events:23,restrict:function(c){return c.action!==32||c.button!==3}},ANY:{events:31,restrict:function(c){return!0}}};function u(c,n){var l=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(l|=64,l|=c.action):(l|=3&c.button,4&c.button&&(l|=64),8&c.button&&(l|=128),c.action===32?l|=32:c.action!==0||n||(l|=3)),l}var v=String.fromCharCode,L={DEFAULT:function(c){var n=[u(c,!1)+32,c.col+32,c.row+32];return n[0]>255||n[1]>255||n[2]>255?"":"\x1B[M"+v(n[0])+v(n[1])+v(n[2])},SGR:function(c){var n=c.action===0&&c.button!==4?"m":"M";return"\x1B[<"+u(c,!0)+";"+c.col+";"+c.row+n}},b=function(){function c(n,l){var o,a,d,h;this._bufferService=n,this._coreService=l,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new k.EventEmitter,this._lastEvent=null;try{for(var S=_(Object.keys(C)),A=S.next();!A.done;A=S.next()){var x=A.value;this.addProtocol(x,C[x])}}catch(P){o={error:P}}finally{try{A&&!A.done&&(a=S.return)&&a.call(S)}finally{if(o)throw o.error}}try{for(var M=_(Object.keys(L)),O=M.next();!O.done;O=M.next()){var I=O.value;this.addEncoding(I,L[I])}}catch(P){d={error:P}}finally{try{O&&!O.done&&(h=M.return)&&h.call(M)}finally{if(d)throw d.error}}this.reset()}return c.prototype.addProtocol=function(n,l){this._protocols[n]=l},c.prototype.addEncoding=function(n,l){this._encodings[n]=l},Object.defineProperty(c.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(n){if(!this._protocols[n])throw new Error('unknown protocol "'+n+'"');this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(n){if(!this._encodings[n])throw new Error('unknown encoding "'+n+'"');this._activeEncoding=n},enumerable:!1,configurable:!0}),c.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(c.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),c.prototype.triggerMouseEvent=function(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows||n.button===4&&n.action===32||n.button===3&&n.action!==32||n.button!==4&&(n.action===2||n.action===3)||(n.col++,n.row++,n.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,n))||!this._protocols[this._activeProtocol].restrict(n))return!1;var l=this._encodings[this._activeEncoding](n);return l&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(l):this._coreService.triggerDataEvent(l,!0)),this._lastEvent=n,!0},c.prototype.explainEvents=function(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}},c.prototype._compareEvents=function(n,l){return n.col===l.col&&n.row===l.row&&n.button===l.button&&n.action===l.action&&n.ctrl===l.ctrl&&n.alt===l.alt&&n.shift===l.shift},m([y(0,g.IBufferService),y(1,g.ICoreService)],c)}();f.CoreMouseService=b},6975:function(D,f,E){var m,y=this&&this.__extends||(m=function(n,l){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(o[d]=a[d])},m(n,l)},function(n,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function o(){this.constructor=n}m(n,l),n.prototype=l===null?Object.create(l):(o.prototype=l.prototype,new o)}),_=this&&this.__decorate||function(n,l,o,a){var d,h=arguments.length,S=h<3?l:a===null?a=Object.getOwnPropertyDescriptor(l,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(n,l,o,a);else for(var A=n.length-1;A>=0;A--)(d=n[A])&&(S=(h<3?d(S):h>3?d(l,o,S):d(l,o))||S);return h>3&&S&&Object.defineProperty(l,o,S),S},g=this&&this.__param||function(n,l){return function(o,a){l(o,a,n)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CoreService=void 0;var k=E(2585),C=E(8460),u=E(1439),v=E(844),L=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),c=function(n){function l(o,a,d,h){var S=n.call(this)||this;return S._bufferService=a,S._logService=d,S._optionsService=h,S.isCursorInitialized=!1,S.isCursorHidden=!1,S._onData=S.register(new C.EventEmitter),S._onUserInput=S.register(new C.EventEmitter),S._onBinary=S.register(new C.EventEmitter),S._scrollToBottom=o,S.register({dispose:function(){return S._scrollToBottom=void 0}}),S.modes=(0,u.clone)(L),S.decPrivateModes=(0,u.clone)(b),S}return y(l,n),Object.defineProperty(l.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),l.prototype.reset=function(){this.modes=(0,u.clone)(L),this.decPrivateModes=(0,u.clone)(b)},l.prototype.triggerDataEvent=function(o,a){if(a===void 0&&(a=!1),!this._optionsService.rawOptions.disableStdin){var d=this._bufferService.buffer;d.ybase!==d.ydisp&&this._scrollToBottom(),a&&this._onUserInput.fire(),this._logService.debug('sending data "'+o+'"',function(){return o.split("").map(function(h){return h.charCodeAt(0)})}),this._onData.fire(o)}},l.prototype.triggerBinaryEvent=function(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug('sending binary "'+o+'"',function(){return o.split("").map(function(a){return a.charCodeAt(0)})}),this._onBinary.fire(o))},_([g(1,k.IBufferService),g(2,k.ILogService),g(3,k.IOptionsService)],l)}(v.Disposable);f.CoreService=c},9074:function(D,f,E){var m,y=this&&this.__extends||(m=function(c,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,o){l.__proto__=o}||function(l,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(l[a]=o[a])},m(c,n)},function(c,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function l(){this.constructor=c}m(c,n),c.prototype=n===null?Object.create(n):(l.prototype=n.prototype,new l)}),_=this&&this.__generator||function(c,n){var l,o,a,d,h={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return d={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function S(A){return function(x){return function(M){if(l)throw new TypeError("Generator is already executing.");for(;h;)try{if(l=1,o&&(a=2&M[0]?o.return:M[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,M[1])).done)return a;switch(o=0,a&&(M=[2&M[0],a.value]),M[0]){case 0:case 1:a=M;break;case 4:return h.label++,{value:M[1],done:!1};case 5:h.label++,o=M[1],M=[0];continue;case 7:M=h.ops.pop(),h.trys.pop();continue;default:if(!((a=(a=h.trys).length>0&&a[a.length-1])||M[0]!==6&&M[0]!==2)){h=0;continue}if(M[0]===3&&(!a||M[1]>a[0]&&M[1]=c.length&&(c=void 0),{value:c&&c[o++],done:!c}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.DecorationService=void 0;var k=E(8055),C=E(8460),u=E(844),v=E(6106),L=function(c){function n(){var l=c.call(this)||this;return l._decorations=new v.SortedList(function(o){return o.marker.line}),l._onDecorationRegistered=l.register(new C.EventEmitter),l._onDecorationRemoved=l.register(new C.EventEmitter),l}return y(n,c),Object.defineProperty(n.prototype,"onDecorationRegistered",{get:function(){return this._onDecorationRegistered.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDecorationRemoved",{get:function(){return this._onDecorationRemoved.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"decorations",{get:function(){return this._decorations.values()},enumerable:!1,configurable:!0}),n.prototype.registerDecoration=function(l){var o=this;if(!l.marker.isDisposed){var a=new b(l);if(a){var d=a.marker.onDispose(function(){return a.dispose()});a.onDispose(function(){a&&(o._decorations.delete(a)&&o._onDecorationRemoved.fire(a),d.dispose())}),this._decorations.insert(a),this._onDecorationRegistered.fire(a)}return a}},n.prototype.reset=function(){var l,o;try{for(var a=g(this._decorations.values()),d=a.next();!d.done;d=a.next())d.value.dispose()}catch(h){l={error:h}}finally{try{d&&!d.done&&(o=a.return)&&o.call(a)}finally{if(l)throw l.error}}this._decorations.clear()},n.prototype.getDecorationsAtLine=function(l){return _(this,function(o){return[2,this._decorations.getKeyIterator(l)]})},n.prototype.getDecorationsAtCell=function(l,o,a){var d,h,S,A,x,M,O,I,P,T,j;return _(this,function(N){switch(N.label){case 0:d=0,h=0,N.label=1;case 1:N.trys.push([1,6,7,8]),S=g(this._decorations.getKeyIterator(o)),A=S.next(),N.label=2;case 2:return A.done?[3,5]:(x=A.value,d=(P=x.options.x)!==null&&P!==void 0?P:0,h=d+((T=x.options.width)!==null&&T!==void 0?T:1),!(l>=d&&l=0;n--)(L=k[n])&&(c=(b<3?L(c):b>3?L(C,u,c):L(C,u))||c);return b>3&&c&&Object.defineProperty(C,u,c),c},y=this&&this.__param||function(k,C){return function(u,v){C(u,v,k)}};Object.defineProperty(f,"__esModule",{value:!0}),f.DirtyRowService=void 0;var _=E(2585),g=function(){function k(C){this._bufferService=C,this.clearRange()}return Object.defineProperty(k.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),k.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},k.prototype.markDirty=function(C){Cthis._end&&(this._end=C)},k.prototype.markRangeDirty=function(C,u){if(C>u){var v=C;C=u,u=v}Cthis._end&&(this._end=u)},k.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},m([y(0,_.IBufferService)],k)}();f.DirtyRowService=g},4348:function(D,f,E){var m=this&&this.__values||function(v){var L=typeof Symbol=="function"&&Symbol.iterator,b=L&&v[L],c=0;if(b)return b.call(v);if(v&&typeof v.length=="number")return{next:function(){return v&&c>=v.length&&(v=void 0),{value:v&&v[c++],done:!v}}};throw new TypeError(L?"Object is not iterable.":"Symbol.iterator is not defined.")},y=this&&this.__read||function(v,L){var b=typeof Symbol=="function"&&v[Symbol.iterator];if(!b)return v;var c,n,l=b.call(v),o=[];try{for(;(L===void 0||L-- >0)&&!(c=l.next()).done;)o.push(c.value)}catch(a){n={error:a}}finally{try{c&&!c.done&&(b=l.return)&&b.call(l)}finally{if(n)throw n.error}}return o},_=this&&this.__spreadArray||function(v,L,b){if(b||arguments.length===2)for(var c,n=0,l=L.length;n0?o[0].index:n.length;if(n.length!==x)throw new Error("[createInstance] First service dependency of "+L.name+" at position "+(x+1)+" conflicts with "+n.length+" static arguments");return new(L.bind.apply(L,_([void 0],y(_(_([],y(n),!1),y(a),!1)),!1)))},v}();f.InstantiationService=u},7866:function(D,f,E){var m=this&&this.__decorate||function(v,L,b,c){var n,l=arguments.length,o=l<3?L:c===null?c=Object.getOwnPropertyDescriptor(L,b):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(v,L,b,c);else for(var a=v.length-1;a>=0;a--)(n=v[a])&&(o=(l<3?n(o):l>3?n(L,b,o):n(L,b))||o);return l>3&&o&&Object.defineProperty(L,b,o),o},y=this&&this.__param||function(v,L){return function(b,c){L(b,c,v)}},_=this&&this.__read||function(v,L){var b=typeof Symbol=="function"&&v[Symbol.iterator];if(!b)return v;var c,n,l=b.call(v),o=[];try{for(;(L===void 0||L-- >0)&&!(c=l.next()).done;)o.push(c.value)}catch(a){n={error:a}}finally{try{c&&!c.done&&(b=l.return)&&b.call(l)}finally{if(n)throw n.error}}return o},g=this&&this.__spreadArray||function(v,L,b){if(b||arguments.length===2)for(var c,n=0,l=L.length;n{function E(m,y,_){y.di$target===y?y.di$dependencies.push({id:m,index:_}):(y.di$dependencies=[{id:m,index:_}],y.di$target=y)}Object.defineProperty(f,"__esModule",{value:!0}),f.createDecorator=f.getServiceDependencies=f.serviceRegistry=void 0,f.serviceRegistry=new Map,f.getServiceDependencies=function(m){return m.di$dependencies||[]},f.createDecorator=function(m){if(f.serviceRegistry.has(m))return f.serviceRegistry.get(m);var y=function(_,g,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");E(y,_,k)};return y.toString=function(){return m},f.serviceRegistry.set(m,y),y}},2585:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.IDecorationService=f.IUnicodeService=f.IOptionsService=f.ILogService=f.LogLevelEnum=f.IInstantiationService=f.IDirtyRowService=f.ICharsetService=f.ICoreService=f.ICoreMouseService=f.IBufferService=void 0;var m,y=E(8343);f.IBufferService=(0,y.createDecorator)("BufferService"),f.ICoreMouseService=(0,y.createDecorator)("CoreMouseService"),f.ICoreService=(0,y.createDecorator)("CoreService"),f.ICharsetService=(0,y.createDecorator)("CharsetService"),f.IDirtyRowService=(0,y.createDecorator)("DirtyRowService"),f.IInstantiationService=(0,y.createDecorator)("InstantiationService"),(m=f.LogLevelEnum||(f.LogLevelEnum={}))[m.DEBUG=0]="DEBUG",m[m.INFO=1]="INFO",m[m.WARN=2]="WARN",m[m.ERROR=3]="ERROR",m[m.OFF=4]="OFF",f.ILogService=(0,y.createDecorator)("LogService"),f.IOptionsService=(0,y.createDecorator)("OptionsService"),f.IUnicodeService=(0,y.createDecorator)("UnicodeService"),f.IDecorationService=(0,y.createDecorator)("DecorationService")},1480:(D,f,E)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.UnicodeService=void 0;var m=E(8460),y=E(225),_=function(){function g(){this._providers=Object.create(null),this._active="",this._onChange=new m.EventEmitter;var k=new y.UnicodeV6;this.register(k),this._active=k.version,this._activeProvider=k}return Object.defineProperty(g.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"activeVersion",{get:function(){return this._active},set:function(k){if(!this._providers[k])throw new Error('unknown Unicode version "'+k+'"');this._active=k,this._activeProvider=this._providers[k],this._onChange.fire(k)},enumerable:!1,configurable:!0}),g.prototype.register=function(k){this._providers[k.version]=k},g.prototype.wcwidth=function(k){return this._activeProvider.wcwidth(k)},g.prototype.getStringCellWidth=function(k){for(var C=0,u=k.length,v=0;v=u)return C+this.wcwidth(L);var b=k.charCodeAt(v);56320<=b&&b<=57343?L=1024*(L-55296)+b-56320+65536:C+=this.wcwidth(b)}C+=this.wcwidth(L)}return C},g}();f.UnicodeService=_}},H={};return function D(f){var E=H[f];if(E!==void 0)return E.exports;var m=H[f]={exports:{}};return G[f].call(m.exports,m,m.exports,D),m.exports}(4389)})()})});var zl=wr((jl,Ul)=>{(function(G){typeof jl=="object"&&typeof Ul=="object"?G(Lr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],G):G(CodeMirror)})(function(G){"use strict";var H={},D=/[^\s\u00a0]/,f=G.Pos,E=G.cmpPos;function m(g){var k=g.search(D);return k==-1?0:k}G.commands.toggleComment=function(g){g.toggleComment()},G.defineExtension("toggleComment",function(g){g||(g=H);for(var k=this,C=1/0,u=this.listSelections(),v=null,L=u.length-1;L>=0;L--){var b=u[L].from(),c=u[L].to();b.line>=C||(c.line>=C&&(c=f(C,0)),C=b.line,v==null?k.uncomment(b,c,g)?v="un":(k.lineComment(b,c,g),v="line"):v=="un"?k.uncomment(b,c,g):k.lineComment(b,c,g))}});function y(g,k,C){return/\bstring\b/.test(g.getTokenTypeAt(f(k.line,0)))&&!/^[\'\"\`]/.test(C)}function _(g,k){var C=g.getMode();return C.useInnerComments===!1||!C.innerMode?C:g.getModeAt(k)}G.defineExtension("lineComment",function(g,k,C){C||(C=H);var u=this,v=_(u,g),L=u.getLine(g.line);if(!(L==null||y(u,g,L))){var b=C.lineComment||v.lineComment;if(!b){(C.blockCommentStart||v.blockCommentStart)&&(C.fullLines=!0,u.blockComment(g,k,C));return}var c=Math.min(k.ch!=0||k.line==g.line?k.line+1:k.line,u.lastLine()+1),n=C.padding==null?" ":C.padding,l=C.commentBlankLines||g.line==k.line;u.operation(function(){if(C.indent){for(var o=null,a=g.line;ah.length)&&(o=h)}for(var a=g.line;ac||u.operation(function(){if(C.fullLines!=!1){var l=D.test(u.getLine(c));u.replaceRange(n+b,f(c)),u.replaceRange(L+n,f(g.line,0));var o=C.blockCommentLead||v.blockCommentLead;if(o!=null)for(var a=g.line+1;a<=c;++a)(a!=c||l)&&u.replaceRange(o+n,f(a,0))}else{var d=E(u.getCursor("to"),k)==0,h=!u.somethingSelected();u.replaceRange(b,k),d&&u.setSelection(h?k:u.getCursor("from"),k),u.replaceRange(L,g)}})}}),G.defineExtension("uncomment",function(g,k,C){C||(C=H);var u=this,v=_(u,g),L=Math.min(k.ch!=0||k.line==g.line?k.line:k.line-1,u.lastLine()),b=Math.min(g.line,L),c=C.lineComment||v.lineComment,n=[],l=C.padding==null?" ":C.padding,o;e:{if(!c)break e;for(var a=b;a<=L;++a){var d=u.getLine(a),h=d.indexOf(c);if(h>-1&&!/comment/.test(u.getTokenTypeAt(f(a,h+1)))&&(h=-1),h==-1&&D.test(d)||h>-1&&D.test(d.slice(0,h)))break e;n.push(d)}if(u.operation(function(){for(var ne=b;ne<=L;++ne){var ue=n[ne-b],oe=ue.indexOf(c),pe=oe+c.length;oe<0||(ue.slice(pe,pe+l.length)==l&&(pe+=l.length),o=!0,u.replaceRange("",f(ne,oe),f(ne,pe)))}}),o)return!0}var S=C.blockCommentStart||v.blockCommentStart,A=C.blockCommentEnd||v.blockCommentEnd;if(!S||!A)return!1;var x=C.blockCommentLead||v.blockCommentLead,M=u.getLine(b),O=M.indexOf(S);if(O==-1)return!1;var I=L==b?M:u.getLine(L),P=I.indexOf(A,L==b?O+S.length:0),T=f(b,O+1),j=f(L,P+1);if(P==-1||!/comment/.test(u.getTokenTypeAt(T))||!/comment/.test(u.getTokenTypeAt(j))||u.getRange(T,j,` -`).indexOf(A)>-1)return!1;var N=M.lastIndexOf(S,g.ch),U=N==-1?-1:M.slice(0,g.ch).indexOf(A,N+S.length);if(N!=-1&&U!=-1&&U+A.length!=g.ch)return!1;U=I.indexOf(A,k.ch);var V=I.slice(k.ch).lastIndexOf(S,U-k.ch);return N=U==-1||V==-1?-1:k.ch+V,U!=-1&&N!=-1&&N!=k.ch?!1:(u.operation(function(){u.replaceRange("",f(L,P-(l&&I.slice(P-l.length,P)==l?l.length:0)),f(L,P+A.length));var ne=O+S.length;if(l&&M.slice(ne,ne+l.length)==l&&(ne+=l.length),u.replaceRange("",f(b,O),f(b,ne)),x)for(var ue=b+1;ue<=L;++ue){var oe=u.getLine(ue),pe=oe.indexOf(x);if(!(pe==-1||D.test(oe.slice(0,pe)))){var _e=pe+x.length;l&&oe.slice(_e,_e+l.length)==l&&(_e+=l.length),u.replaceRange("",f(ue,pe),f(ue,_e))}}}),!0)})})});var Gl=wr((ql,Kl)=>{(function(G){typeof ql=="object"&&typeof Kl=="object"?G(Lr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],G):G(CodeMirror)})(function(G){var H=/\S/g,D=String.prototype.repeat||function(y){return Array(y+1).join(this)};function f(y){if(y.getOption("disableInput"))return G.Pass;for(var _=y.listSelections(),g,k=[],C=0;C<_.length;C++){var u=_[C].head;if(!/\bcomment\b/.test(y.getTokenTypeAt(u)))return G.Pass;var v=y.getModeAt(u);if(!g)g=v;else if(g!=v)return G.Pass;var L=null,b,c,n=g.blockCommentStart,l=g.lineComment;if(n&&g.blockCommentContinue){b=y.getLine(u.line);var o=b.lastIndexOf(g.blockCommentEnd,u.ch-g.blockCommentEnd.length);if(!(o!=-1&&o==u.ch-g.blockCommentEnd.length||l&&(c=b.lastIndexOf(l,u.ch-1))>-1&&/\bcomment\b/.test(y.getTokenTypeAt({line:u.line,ch:c+1}))))if(u.ch>=n.length&&(c=b.lastIndexOf(n,u.ch-n.length))>-1&&c>o)if(E(0,b)>=c)L=b.slice(0,c);else{var a=y.options.tabSize,d;c=G.countColumn(b,c,a),L=y.options.indentWithTabs?D.call(" ",d=Math.floor(c/a))+D.call(" ",c-a*d):D.call(" ",c)}else(c=b.indexOf(g.blockCommentContinue))>-1&&c<=u.ch&&c<=E(0,b)&&(L=b.slice(0,c));L!=null&&(L+=g.blockCommentContinue)}if(L==null&&l&&m(y)){if(b==null&&(b=y.getLine(u.line)),c=b.indexOf(l),!u.ch&&!c)L="";else if(c>-1&&E(0,b)>=c){if(L=E(u.ch,b)>-1,!L){var h=y.getLine(u.line+1)||"",S=h.indexOf(l);L=S>-1&&E(0,h)>=S||null}L&&(L=b.slice(0,c)+l+b.slice(c+l.length).match(/^\s*/)[0])}}if(L==null)return G.Pass;k[C]=` -`+L}y.operation(function(){for(var A=_.length-1;A>=0;A--)y.replaceRange(k[A],_[A].from(),_[A].to(),"+insert")})}function E(y,_){H.lastIndex=y;var g=H.exec(_);return g?g.index:-1}function m(y){var _=y.getOption("continueComments");return _&&typeof _=="object"?_.continueLineComment!==!1:!0}G.defineOption("continueComments",null,function(y,_,g){if(g&&g!=G.Init&&y.removeKeyMap("continueComment"),_){var k="Enter";typeof _=="string"?k=_:typeof _=="object"&&_.key&&(k=_.key);var C={name:"continueComment"};C[k]=f,y.addKeyMap(C)}})})});var Yl=wr((Xl,Zl)=>{(function(G){typeof Xl=="object"&&typeof Zl=="object"?G(Lr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],G):G(CodeMirror)})(function(G){G.defineOption("placeholder","",function(_,g,k){var C=k&&k!=G.Init;if(g&&!C)_.on("blur",E),_.on("change",m),_.on("swapDoc",m),G.on(_.getInputField(),"compositionupdate",_.state.placeholderCompose=function(){f(_)}),m(_);else if(!g&&C){_.off("blur",E),_.off("change",m),_.off("swapDoc",m),G.off(_.getInputField(),"compositionupdate",_.state.placeholderCompose),H(_);var u=_.getWrapperElement();u.className=u.className.replace(" CodeMirror-empty","")}g&&!_.hasFocus()&&E(_)});function H(_){_.state.placeholder&&(_.state.placeholder.parentNode.removeChild(_.state.placeholder),_.state.placeholder=null)}function D(_){H(_);var g=_.state.placeholder=document.createElement("pre");g.style.cssText="height: 0; overflow: visible",g.style.direction=_.getOption("direction"),g.className="CodeMirror-placeholder CodeMirror-line-like";var k=_.getOption("placeholder");typeof k=="string"&&(k=document.createTextNode(k)),g.appendChild(k),_.display.lineSpace.insertBefore(g,_.display.lineSpace.firstChild)}function f(_){setTimeout(function(){var g=!1;if(_.lineCount()==1){var k=_.getInputField();g=k.nodeName=="TEXTAREA"?!_.getLine(0).length:!/[^\u200b]/.test(k.querySelector(".CodeMirror-line").textContent)}g?D(_):H(_)},20)}function E(_){y(_)&&D(_)}function m(_){var g=_.getWrapperElement(),k=y(_);g.className=g.className.replace(" CodeMirror-empty","")+(k?" CodeMirror-empty":""),k?D(_):H(_)}function y(_){return _.lineCount()===1&&_.getLine(0)===""}})});var Jl=wr((Vl,$l)=>{(function(G){typeof Vl=="object"&&typeof $l=="object"?G(Lr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],G):G(CodeMirror)})(function(G){var H={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=G.Pos;G.defineOption("autoCloseBrackets",!1,function(c,n,l){l&&l!=G.Init&&(c.removeKeyMap(E),c.state.closeBrackets=null),n&&(m(f(n,"pairs")),c.state.closeBrackets=n,c.addKeyMap(E))});function f(c,n){return n=="pairs"&&typeof c=="string"?c:typeof c=="object"&&c[n]!=null?c[n]:H[n]}var E={Backspace:g,Enter:k};function m(c){for(var n=0;n=0;a--){var h=o[a].head;c.replaceRange("",D(h.line,h.ch-1),D(h.line,h.ch+1),"+delete")}}function k(c){var n=_(c),l=n&&f(n,"explode");if(!l||c.getOption("disableInput"))return G.Pass;for(var o=c.listSelections(),a=0;a0?{line:h.head.line,ch:h.head.ch+n}:{line:h.head.line-1};l.push({anchor:S,head:S})}c.setSelections(l,a)}function u(c){var n=G.cmpPos(c.anchor,c.head)>0;return{anchor:new D(c.anchor.line,c.anchor.ch+(n?-1:1)),head:new D(c.head.line,c.head.ch+(n?1:-1))}}function v(c,n){var l=_(c);if(!l||c.getOption("disableInput"))return G.Pass;var o=f(l,"pairs"),a=o.indexOf(n);if(a==-1)return G.Pass;for(var d=f(l,"closeBefore"),h=f(l,"triples"),S=o.charAt(a+1)==n,A=c.listSelections(),x=a%2==0,M,O=0;O=0&&c.getRange(P,D(P.line,P.ch+3))==n+n+n?T="skipThree":T="skip";else if(S&&P.ch>1&&h.indexOf(n)>=0&&c.getRange(D(P.line,P.ch-2),P)==n+n){if(P.ch>2&&/\bstring/.test(c.getTokenTypeAt(D(P.line,P.ch-2))))return G.Pass;T="addFour"}else if(S){var N=P.ch==0?" ":c.getRange(D(P.line,P.ch-1),P);if(!G.isWordChar(j)&&N!=n&&!G.isWordChar(N))T="both";else return G.Pass}else if(x&&(j.length===0||/\s/.test(j)||d.indexOf(j)>-1))T="both";else return G.Pass;if(!M)M=T;else if(M!=T)return G.Pass}var U=a%2?o.charAt(a-1):n,V=a%2?n:o.charAt(a+1);c.operation(function(){if(M=="skip")C(c,1);else if(M=="skipThree")C(c,3);else if(M=="surround"){for(var ne=c.getSelections(),ue=0;ue{(function(G){typeof Ql=="object"&&typeof ec=="object"?G(Lr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],G):G(CodeMirror)})(function(G){var H=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),D=G.Pos,f={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function E(C){return C&&C.bracketRegex||/[(){}[\]]/}function m(C,u,v){var L=C.getLineHandle(u.line),b=u.ch-1,c=v&&v.afterCursor;c==null&&(c=/(^| )cm-fat-cursor($| )/.test(C.getWrapperElement().className));var n=E(v),l=!c&&b>=0&&n.test(L.text.charAt(b))&&f[L.text.charAt(b)]||n.test(L.text.charAt(b+1))&&f[L.text.charAt(++b)];if(!l)return null;var o=l.charAt(1)==">"?1:-1;if(v&&v.strict&&o>0!=(b==u.ch))return null;var a=C.getTokenTypeAt(D(u.line,b+1)),d=y(C,D(u.line,b+(o>0?1:0)),o,a,v);return d==null?null:{from:D(u.line,b),to:d&&d.pos,match:d&&d.ch==l.charAt(0),forward:o>0}}function y(C,u,v,L,b){for(var c=b&&b.maxScanLineLength||1e4,n=b&&b.maxScanLines||1e3,l=[],o=E(b),a=v>0?Math.min(u.line+n,C.lastLine()+1):Math.max(C.firstLine()-1,u.line-n),d=u.line;d!=a;d+=v){var h=C.getLine(d);if(h){var S=v>0?0:h.length-1,A=v>0?h.length:-1;if(!(h.length>c))for(d==u.line&&(S=u.ch-(v<0?1:0));S!=A;S+=v){var x=h.charAt(S);if(o.test(x)&&(L===void 0||(C.getTokenTypeAt(D(d,S+1))||"")==(L||""))){var M=f[x];if(M&&M.charAt(1)==">"==v>0)l.push(x);else if(l.length)l.pop();else return{pos:D(d,S),ch:x}}}}}return d-v==(v>0?C.lastLine():C.firstLine())?!1:null}function _(C,u,v){for(var L=C.state.matchBrackets.maxHighlightLineLength||1e3,b=v&&v.highlightNonMatching,c=[],n=C.listSelections(),l=0;l{(function(G){typeof tc=="object"&&typeof rc=="object"?G(Lr()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],G):G(CodeMirror)})(function(G){"use strict";var H=G.Pos;function D(n){var l=n.flags;return l??(n.ignoreCase?"i":"")+(n.global?"g":"")+(n.multiline?"m":"")}function f(n,l){for(var o=D(n),a=o,d=0;dS);A++){var x=n.getLine(h++);a=a==null?x:a+` -`+x}d=d*2,l.lastIndex=o.ch;var M=l.exec(a);if(M){var O=a.slice(0,M.index).split(` -`),I=M[0].split(` -`),P=o.line+O.length-1,T=O[O.length-1].length;return{from:H(P,T),to:H(P+I.length-1,I.length==1?T+I[0].length:I[I.length-1].length),match:M}}}}function _(n,l,o){for(var a,d=0;d<=n.length;){l.lastIndex=d;var h=l.exec(n);if(!h)break;var S=h.index+h[0].length;if(S>n.length-o)break;(!a||S>a.index+a[0].length)&&(a=h),d=h.index+1}return a}function g(n,l,o){l=f(l,"g");for(var a=o.line,d=o.ch,h=n.firstLine();a>=h;a--,d=-1){var S=n.getLine(a),A=_(S,l,d<0?0:S.length-d);if(A)return{from:H(a,A.index),to:H(a,A.index+A[0].length),match:A}}}function k(n,l,o){if(!E(l))return g(n,l,o);l=f(l,"gm");for(var a,d=1,h=n.getLine(o.line).length-o.ch,S=o.line,A=n.firstLine();S>=A;){for(var x=0;x=A;x++){var M=n.getLine(S--);a=a==null?M:M+` -`+a}d*=2;var O=_(a,l,h);if(O){var I=a.slice(0,O.index).split(` -`),P=O[0].split(` -`),T=S+I.length,j=I[I.length-1].length;return{from:H(T,j),to:H(T+P.length-1,P.length==1?j+P[0].length:P[P.length-1].length),match:O}}}}var C,u;String.prototype.normalize?(C=function(n){return n.normalize("NFD").toLowerCase()},u=function(n){return n.normalize("NFD")}):(C=function(n){return n.toLowerCase()},u=function(n){return n});function v(n,l,o,a){if(n.length==l.length)return o;for(var d=0,h=o+Math.max(0,n.length-l.length);;){if(d==h)return d;var S=d+h>>1,A=a(n.slice(0,S)).length;if(A==o)return S;A>o?h=S:d=S+1}}function L(n,l,o,a){if(!l.length)return null;var d=a?C:u,h=d(l).split(/\r|\n\r?/);e:for(var S=o.line,A=o.ch,x=n.lastLine()+1-h.length;S<=x;S++,A=0){var M=n.getLine(S).slice(A),O=d(M);if(h.length==1){var I=O.indexOf(h[0]);if(I==-1)continue e;var o=v(M,O,I,d)+A;return{from:H(S,v(M,O,I,d)+A),to:H(S,v(M,O,I+h[0].length,d)+A)}}else{var P=O.length-h[0].length;if(O.slice(P)!=h[0])continue e;for(var T=1;T=x;S--,A=-1){var M=n.getLine(S);A>-1&&(M=M.slice(0,A));var O=d(M);if(h.length==1){var I=O.lastIndexOf(h[0]);if(I==-1)continue e;return{from:H(S,v(M,O,I,d)),to:H(S,v(M,O,I+h[0].length,d))}}else{var P=h[h.length-1];if(O.slice(0,P.length)!=P)continue e;for(var T=1,o=S-h.length+1;T(this.doc.getLine(l.line)||"").length&&(l.ch=0,l.line++)),G.cmpPos(l,this.doc.clipPos(l))!=0))return this.atOccurrence=!1;var o=this.matches(n,l);if(this.afterEmptyMatch=o&&G.cmpPos(o.from,o.to)==0,o)return this.pos=o,this.atOccurrence=!0,this.pos.match||!0;var a=H(n?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:a,to:a},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,l){if(this.atOccurrence){var o=G.splitLines(n);this.doc.replaceRange(o,this.pos.from,this.pos.to,l),this.pos.to=H(this.pos.from.line+o.length-1,o[o.length-1].length+(o.length==1?this.pos.from.ch:0))}}},G.defineExtension("getSearchCursor",function(n,l,o){return new c(this.doc,n,l,o)}),G.defineDocExtension("getSearchCursor",function(n,l,o){return new c(this,n,l,o)}),G.defineExtension("selectMatches",function(n,l){for(var o=[],a=this.getSearchCursor(n,this.getCursor("from"),l);a.findNext()&&!(G.cmpPos(a.to(),this.getCursor("to"))>0);)o.push({anchor:a.from(),head:a.to()});o.length&&this.setSelections(o,0)})})});var sc=wr((nc,oc)=>{(function(G){typeof nc=="object"&&typeof oc=="object"?G(Lr(),ic(),Ps()):typeof define=="function"&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],G):G(CodeMirror)})(function(G){"use strict";var H=G.commands,D=G.Pos;function f(o,a,d){if(d<0&&a.ch==0)return o.clipPos(D(a.line-1));var h=o.getLine(a.line);if(d>0&&a.ch>=h.length)return o.clipPos(D(a.line+1,0));for(var S="start",A,x=a.ch,M=x,O=d<0?0:h.length,I=0;M!=O;M+=d,I++){var P=h.charAt(d<0?M-1:M),T=P!="_"&&G.isWordChar(P)?"w":"o";if(T=="w"&&P.toUpperCase()==P&&(T="W"),S=="start")T!="o"?(S="in",A=T):x=M+d;else if(S=="in"&&A!=T){if(A=="w"&&T=="W"&&d<0&&M--,A=="W"&&T=="w"&&d>0)if(M==x+1){A="w";continue}else M--;break}}return D(a.line,M)}function E(o,a){o.extendSelectionsBy(function(d){return o.display.shift||o.doc.extend||d.empty()?f(o.doc,d.head,a):a<0?d.from():d.to()})}H.goSubwordLeft=function(o){E(o,-1)},H.goSubwordRight=function(o){E(o,1)},H.scrollLineUp=function(o){var a=o.getScrollInfo();if(!o.somethingSelected()){var d=o.lineAtHeight(a.top+a.clientHeight,"local");o.getCursor().line>=d&&o.execCommand("goLineUp")}o.scrollTo(null,a.top-o.defaultTextHeight())},H.scrollLineDown=function(o){var a=o.getScrollInfo();if(!o.somethingSelected()){var d=o.lineAtHeight(a.top,"local")+1;o.getCursor().line<=d&&o.execCommand("goLineDown")}o.scrollTo(null,a.top+o.defaultTextHeight())},H.splitSelectionByLine=function(o){for(var a=o.listSelections(),d=[],h=0;hS.line&&x==A.line&&A.ch==0||d.push({anchor:x==S.line?S:D(x,0),head:x==A.line?A:D(x)});o.setSelections(d,0)},H.singleSelectionTop=function(o){var a=o.listSelections()[0];o.setSelection(a.anchor,a.head,{scroll:!1})},H.selectLine=function(o){for(var a=o.listSelections(),d=[],h=0;hh?d.push(M,O):d.length&&(d[d.length-1]=O),h=O}o.operation(function(){for(var I=0;Io.lastLine()?o.replaceRange(` -`+j,D(o.lastLine()),null,"+swapLine"):o.replaceRange(j+` -`,D(T,0),null,"+swapLine")}o.setSelections(S),o.scrollIntoView()})},H.swapLineDown=function(o){if(o.isReadOnly())return G.Pass;for(var a=o.listSelections(),d=[],h=o.lastLine()+1,S=a.length-1;S>=0;S--){var A=a[S],x=A.to().line+1,M=A.from().line;A.to().ch==0&&!A.empty()&&x--,x=0;O-=2){var I=d[O],P=d[O+1],T=o.getLine(I);I==o.lastLine()?o.replaceRange("",D(I-1),D(I),"+swapLine"):o.replaceRange("",D(I,0),D(I+1,0),"+swapLine"),o.replaceRange(T+` -`,D(P,0),null,"+swapLine")}o.scrollIntoView()})},H.toggleCommentIndented=function(o){o.toggleComment({indent:!0})},H.joinLines=function(o){for(var a=o.listSelections(),d=[],h=0;h=0;A--){var x=d[h[A]];if(!(M&&G.cmpPos(x.head,M)>0)){var O=y(o,x.head);M=O.from,o.replaceRange(a(O.word),O.from,O.to)}}})}H.smartBackspace=function(o){if(o.somethingSelected())return G.Pass;o.operation(function(){for(var a=o.listSelections(),d=o.getOption("indentUnit"),h=a.length-1;h>=0;h--){var S=a[h].head,A=o.getRange({line:S.line,ch:0},S),x=G.countColumn(A,null,o.getOption("tabSize")),M=o.findPosH(S,-1,"char",!1);if(A&&!/\S/.test(A)&&x%d==0){var O=new D(S.line,G.findColumn(A,x-d,d));O.ch!=S.ch&&(M=O)}o.replaceRange("",M,S,"+delete")}})},H.delLineRight=function(o){o.operation(function(){for(var a=o.listSelections(),d=a.length-1;d>=0;d--)o.replaceRange("",a[d].anchor,D(a[d].to().line),"+delete");o.scrollIntoView()})},H.upcaseAtCursor=function(o){L(o,function(a){return a.toUpperCase()})},H.downcaseAtCursor=function(o){L(o,function(a){return a.toLowerCase()})},H.setSublimeMark=function(o){o.state.sublimeMark&&o.state.sublimeMark.clear(),o.state.sublimeMark=o.setBookmark(o.getCursor())},H.selectToSublimeMark=function(o){var a=o.state.sublimeMark&&o.state.sublimeMark.find();a&&o.setSelection(o.getCursor(),a)},H.deleteToSublimeMark=function(o){var a=o.state.sublimeMark&&o.state.sublimeMark.find();if(a){var d=o.getCursor(),h=a;if(G.cmpPos(d,h)>0){var S=h;h=d,d=S}o.state.sublimeKilled=o.getRange(d,h),o.replaceRange("",d,h)}},H.swapWithSublimeMark=function(o){var a=o.state.sublimeMark&&o.state.sublimeMark.find();a&&(o.state.sublimeMark.clear(),o.state.sublimeMark=o.setBookmark(o.getCursor()),o.setCursor(a))},H.sublimeYank=function(o){o.state.sublimeKilled!=null&&o.replaceSelection(o.state.sublimeKilled,null,"paste")},H.showInCenter=function(o){var a=o.cursorCoords(null,"local");o.scrollTo(null,(a.top+a.bottom)/2-o.getScrollInfo().clientHeight/2)};function b(o){var a=o.getCursor("from"),d=o.getCursor("to");if(G.cmpPos(a,d)==0){var h=y(o,a);if(!h.word)return;a=h.from,d=h.to}return{from:a,to:d,query:o.getRange(a,d),word:h}}function c(o,a){var d=b(o);if(d){var h=d.query,S=o.getSearchCursor(h,a?d.to:d.from);(a?S.findNext():S.findPrevious())?o.setSelection(S.from(),S.to()):(S=o.getSearchCursor(h,a?D(o.firstLine(),0):o.clipPos(D(o.lastLine()))),(a?S.findNext():S.findPrevious())?o.setSelection(S.from(),S.to()):d.word&&o.setSelection(d.from,d.to))}}H.findUnder=function(o){c(o,!0)},H.findUnderPrevious=function(o){c(o,!1)},H.findAllUnder=function(o){var a=b(o);if(a){for(var d=o.getSearchCursor(a.query),h=[],S=-1;d.findNext();)h.push({anchor:d.from(),head:d.to()}),d.from().line<=a.from.line&&d.from().ch<=a.from.ch&&S++;o.setSelections(h,S)}};var n=G.keyMap;n.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},G.normalizeKeyMap(n.macSublime),n.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},G.normalizeKeyMap(n.pcSublime);var l=n.default==n.macDefault;n.sublime=l?n.macSublime:n.pcSublime})});var rf=G=>G.reduce((H,D)=>H+String.fromCharCode(D),""),fo=rf;var nf=G=>G.split("").map(H=>H.charCodeAt(0)),Sl=nf;var ls=class{name(){return"default"}codePointsToString(H){return fo(H)}stringToCodePoints(H){return Sl(H)}matches(H){return this.matchesAsString(this.codePointsToString(H))}matchesAsString(H){return!0}decode(H){return this.decodeAsString(this.codePointsToString(H))}decodeAsString(H){return this.stringToCodePoints(H)}},yi=ls;var cs=class extends yi{name(){return"base64"}matchesAsString(H){if(H.length<4)return!1;try{return atob(H),!0}catch{return!1}}decodeAsString(H){return Array.from(atob(H)).map(D=>D.charCodeAt(0))}},Cl=cs;var us=class extends yi{name(){return"hexdump"}matchesAsString(H){return/^([0-9a-f]{7}(( ([0-9a-f]{4})){1,8}) *\n)+[0-9a-f]{7}\n?$/.test(H)}decodeAsString(H){return H.trim().replace(/\n[0-9a-f]{7}\n?$/,"").replace(/(?<=^|\n)[0-9a-f]{7}(( ([0-9a-f]{4})){1,8}) */g,"$1").replace(/\s+/g,"").replace(/(..)(..)/g,"$2$1").replace(/00$/,"").match(/../g).map(D=>parseInt(D,16))}},wl=us;var sn=class{constructor(H,D,f,E=null,m=null,y=H){this.id=H;this.name=D;this.runner=f;this.url=E;this.args=m;this.highlighterRef=y}getId(){return this.id}getName(){return this.name}getURL(){return this.url}getArgs(){return this.args}getHighlighterRef(){return this.highlighterRef}run(H,D,f){return this.runner(H,f,D)}};var fs=class{constructor(){this.data={}}register(...H){H.forEach(D=>{this.data[D.getId()]=D})}get(H){return this.data[H]}all(){return Object.keys(this.data)}run(H,D,f,E){return this.data[H].run(D,f,E)}},ho=G=>(H,D,f)=>{let E=new Worker(G);return E.postMessage({type:"run",code:H,args:f,input:D}),E},Gr=new fs;var wf=ir(ps()),vs=class extends sn{constructor(){super("javascript-browser","JavaScript (Browser)",ho("dist/js/langs/javascript-browser/worker.js"),"https://www.ecma-international.org/publications-and-standards/standards/ecma-262/",null,"javascript")}},kl=vs;var Ef=ir(gs()),_s=class extends sn{constructor(){super("webperl-5.28.1","Perl 5.28.1 (webperl)",ho("dist/js/langs/webperl-5.28.1/worker.js"),"https://www.perl.org/",["-M5.10.0","-F","-l","-p"],"perl")}},Al=_s;var ac=ir(Lr()),lc=ir(Dl());var ys=class{constructor(...H){this.buffer="";this.prepend="";this.registered=[];this.register(...H)}activate(H){this.registered.reduce((D,f)=>f.matches(H)&&!D?(f.isActive()||(f.activate(H),f.reset(),f.write(this.prepend+this.buffer)),!0):(f.deactivate(),f.reset(),D),!1),this.resize()}refresh(){this.registered.forEach(H=>{this.registered.filter(D=>D.isActive()).forEach(D=>{D.reset(),D.write(this.prepend+this.buffer)})})}register(...H){this.registered.push(...H)}reset(){this.buffer="",this.registered.forEach(H=>{H.reset(),this.prepend&&H.write(this.prepend)})}resize(){this.registered.forEach(H=>{H.isActive()&&H.resize()})}setPrepend(H){this.prepend=H,this.refresh()}write(H){typeof H=="number"&&(H=String.fromCharCode(H)),this.buffer+=H,this.registered.filter(D=>D.isActive()).forEach(D=>D.write(H))}};var ms=(...G)=>new ys(...G);var Pl=ir(Lr());var bs=class{constructor(){this.active=!1;this.inputs=null}activate(H){this.container.removeAttribute("hidden"),this.active=!0,this.inputs=H,this.resize()}createElement(H="div"){return this.container=document.createElement(H),this.container.setAttribute("hidden",""),this.container}deactivate(){this.container.setAttribute("hidden",""),this.active=!1}isActive(){return this.active}read(){return this.readAsString(null).split("").map(H=>H.charCodeAt(0))}resize(){}},Bl=bs;var sf=(G,H=".")=>G.replace(/[^\x09\x0a\x20-\x7e]/g,H),vo=sf;var Ss=class extends Bl{constructor(H,D={}){super();let f=this.createElement("div"),E=document.createElement("textarea");H.append(f),f.append(E),this.editor=(0,Pl.fromTextArea)(E,{mode:null,theme:"monokai",viewportMargin:1/0,...D,extraKeys:{"Ctrl-D":"duplicateLine","Ctrl-/":"toggleComment","Shift-Tab":!1,Tab:!1,...Object.keys(D.extraKeys||{}).length?D.extraKeys:{}}}),this.editor.on("change",()=>{this.inputs!==null&&this.inputs.setBuffer(this.editor.getValue().split("").map(m=>m.charCodeAt(0)))})}matches(H){return/^[\t\n -~]*$/.test(H)}on(H,D){this.editor.on(H,(...f)=>D(...f))}readAsString(H="."){let D=unescape(encodeURIComponent(this.editor.getValue()));return H===null?D:vo(D,H)}reset(){this.editor.setValue("")}setOption(H,D){this.editor.setOption(H,D)}setType(H){this.editor.getOption("mode")!==H&&this.editor.setOption("mode",H)}write(H){Array.isArray(H)&&(H=H.map(D=>String.fromCharCode(D)).join("")),this.editor.setValue(H)}},Di=Ss;var Cs=class{constructor(){this.active=!1;this.mimeType="text/plain"}activate(H){this.container.removeAttribute("hidden"),this.active=!0,this.mimeType=H,this.resize()}createElement(H="div",D=!0){let f=document.createElement(H);return D&&f.setAttribute("hidden",""),f}deactivate(){this.container.setAttribute("hidden",""),this.active=!1}isActive(){return this.active}matches(H){return!0}resize(){}},an=Cs;var zf=ir(ps()),qf=ir(gs()),ws=class extends an{constructor(H,D={}){super();let f=document.createElement("textarea");this.container=this.createElement("div"),this.container.append(f),H.append(this.container),this.editor=go.createEditor(f,{...D,readOnly:!0}),H.append(this.container)}activate(H){super.activate(H),this.editor.setOption("mode",H)}deactivate(){super.deactivate()}matches(H){return["application/ecmascript","application/javascript","application/json","application/x-perl","text/ecmascript","text/javascript","text/json","text/x-perl"].includes(H)}reset(){this.editor.setValue("")}write(H){typeof H=="number"&&(H=String.fromCharCode(H)),this.editor.setValue(this.editor.getValue()+H)}},Il=ws;var Ls=class extends an{constructor(D){super();this.buffer="";this.mimeType="text/html";this.container=this.createElement("iframe"),D.append(this.container),this.update()}activate(D){super.activate(D),this.update()}matches(D){return["text/html"].includes(D)}reset(){this.buffer="",this.update()}write(D){typeof D=="number"&&(D=String.fromCharCode(D)),this.buffer+=D,this.update()}update(){let D=this.createElement("iframe",this.container.hasAttribute("hidden"));D.src=`data:${this.mimeType};base64,${btoa(this.buffer)}`,this.container.replaceWith(D),this.container=D}},_o=Ls;var xs=class{constructor(){this.registered=[]}register(...H){this.registered.push(...H)}decode(H){return this.decoder(H).decode(H)}decodeAsString(H){return this.decoderAsString(H).decodeAsString(H)}decoder(H){let[D]=this.registered.filter(f=>f.matches(H));return D}decoderAsString(H){let[D]=this.registered.filter(f=>f.matchesAsString(H));return D}};var ii=new xs;var ks=class{constructor(H,D){this.stdin=H;this.args=D}getArgs(){return this.args.getValue()}setArgs(H){this.args.setValue(H)}argsRefresh(){this.args.refresh()}getStdin(){return ii.decodeAsString(this.stdin.getValue()).reduce((H,D)=>H+String.fromCharCode(D),"")}setStdin(H){this.stdin.setValue(H)}},Hl=ks;var Es=class{constructor(){this.options={}}get(H,D=null){return this.options[H]??D}set(H,D){this.options[H]=D}},Bi=new Es;var Ts=class extends _o{constructor(){super(...arguments);this.imageBuffer="";this.imageMimeType="image/png";this.zoomLevel=1}activate(D){this.zoomLevel=Bi.get("zoomLevel",1),super.activate("text/html"),this.imageMimeType=D}css(){return` +`)},enumerable:!1,configurable:!0}),T.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},T.prototype.refresh=function(E){var M=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return M._refresh()})),x.isLinux&&E&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},T.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},T.prototype._isClickInSelection=function(E){var M=this._getMouseBufferCoords(E),D=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!!(D&&W&&M)&&this._areCoordsInSelection(M,D,W)},T.prototype.isCellInSelection=function(E,M){var D=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!(!D||!W)&&this._areCoordsInSelection([E,M],D,W)},T.prototype._areCoordsInSelection=function(E,M,D){return E[1]>M[1]&&E[1]=M[0]&&E[0]=M[0]},T.prototype._selectWordAtCursor=function(E,M){var D,W,I=(W=(D=this._linkifier.currentLink)===null||D===void 0?void 0:D.link)===null||W===void 0?void 0:W.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;var A=this._getMouseBufferCoords(E);return!!A&&(this._selectWordAt(A,M),this._model.selectionEnd=void 0,!0)},T.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},T.prototype.selectLines=function(E,M){this._model.clearSelection(),E=Math.max(E,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()},T.prototype._onTrim=function(E){this._model.onTrim(E)&&this.refresh()},T.prototype._getMouseBufferCoords=function(E){var M=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M},T.prototype._getMouseEventScrollAmount=function(E){var M=(0,c.getCoordsRelativeToElement)(window,E,this._screenElement)[1],D=this._renderService.dimensions.canvasHeight;return M>=0&&M<=D?0:(M>D&&(M-=D),M=Math.min(Math.max(M,-50),50),(M/=50)/Math.abs(M)+Math.round(14*M))},T.prototype.shouldForceSelection=function(E){return x.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey},T.prototype.onMouseDown=function(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._onIncrementalClick(E):E.detail===1?this._onSingleClick(E):E.detail===2?this._onDoubleClick(E):E.detail===3&&this._onTripleClick(E),this._addMouseDownListeners(),this.refresh(!0)}},T.prototype._addMouseDownListeners=function(){var E=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return E._dragScroll()},50)},T.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},T.prototype._onIncrementalClick=function(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))},T.prototype._onSingleClick=function(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),this._model.selectionStart){this._model.selectionEnd=void 0;var M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},T.prototype._onDoubleClick=function(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)},T.prototype._onTripleClick=function(E){var M=this._getMouseBufferCoords(E);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))},T.prototype.shouldColumnSelect=function(E){return E.altKey&&!(x.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)},T.prototype._onMouseMove=function(E){if(E.stopImmediatePropagation(),this._model.selectionStart){var M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var D=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}},T.prototype._onMouseUp=function(E){var M=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&E.altKey&&this._optionsService.getOption("altClickMovesCursor")){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var D=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(D&&D[0]!==void 0&&D[1]!==void 0){var W=(0,o.moveToCellSequence)(D[0]-1,D[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(W,!0)}}}else this._fireEventIfSelectionChanged()},T.prototype._fireEventIfSelectionChanged=function(){var E=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,D=!(!E||!M||E[0]===M[0]&&E[1]===M[1]);D?E&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,M,D)):this._oldHasSelection&&this._fireOnSelectionChange(E,M,D)},T.prototype._fireOnSelectionChange=function(E,M,D){this._oldSelectionStart=E,this._oldSelectionEnd=M,this._oldHasSelection=D,this._onSelectionChange.fire()},T.prototype._onBufferActivate=function(E){var M=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim(function(D){return M._onTrim(D)})},T.prototype._convertViewportColToCharacterIndex=function(E,M){for(var D=M[0],W=0;M[0]>=W;W++){var I=E.loadCell(W,this._workCell).getChars().length;this._workCell.getWidth()===0?D--:I>1&&M[0]!==W&&(D+=I-1)}return D},T.prototype.setSelection=function(E,M,D){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,M],this._model.selectionStartLength=D,this.refresh(),this._fireEventIfSelectionChanged()},T.prototype.rightClickSelect=function(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())},T.prototype._getWordAt=function(E,M,D,W){if(D===void 0&&(D=!0),W===void 0&&(W=!0),!(E[0]>=this._bufferService.cols)){var I=this._bufferService.buffer,A=I.lines.get(E[1]);if(A){var H=I.translateBufferLineToString(E[1],!1),F=this._convertViewportColToCharacterIndex(A,E),z=F,G=E[0]-F,te=0,ce=0,ee=0,fe=0;if(H.charAt(F)===" "){for(;F>0&&H.charAt(F-1)===" ";)F--;for(;z1&&(fe+=ve-1,z+=ve-1);_e>0&&F>0&&!this._isCharWordSeparator(A.loadCell(_e-1,this._workCell));){A.loadCell(_e-1,this._workCell);var de=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,_e--):de>1&&(ee+=de-1,F-=de-1),F--,_e--}for(;q1&&(fe+=ke-1,z+=ke-1),z++,q++}}z++;var $=F+G-te+ee,Ie=Math.min(this._bufferService.cols,z-F+te+ce-ee-fe);if(M||H.slice(F,z).trim()!==""){if(D&&$===0&&A.getCodePoint(0)!==32){var ge=I.lines.get(E[1]-1);if(ge&&A.isWrapped&&ge.getCodePoint(this._bufferService.cols-1)!==32){var le=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(le){var V=this._bufferService.cols-le.start;$-=V,Ie+=V}}}if(W&&$+Ie===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){var Y=I.lines.get(E[1]+1);if(Y?.isWrapped&&Y.getCodePoint(0)!==32){var se=this._getWordAt([0,E[1]+1],!1,!1,!0);se&&(Ie+=se.length)}}return{start:$,length:Ie}}}}},T.prototype._selectWordAt=function(E,M){var D=this._getWordAt(E,M);if(D){for(;D.start<0;)D.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[D.start,E[1]],this._model.selectionStartLength=D.length}},T.prototype._selectToWordAt=function(E){var M=this._getWordAt(E,!0);if(M){for(var D=E[1];M.start<0;)M.start+=this._bufferService.cols,D--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,D++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,D]}},T.prototype._isCharWordSeparator=function(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0},T.prototype._selectLineAt=function(E){var M=this._bufferService.buffer.getWrappedRangeForLine(E),D={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(D,this._bufferService.cols)},_([g(3,b.IBufferService),g(4,b.ICoreService),g(5,w.IMouseService),g(6,b.IOptionsService),g(7,w.IRenderService)],T)}(l.Disposable);f.SelectionService=d},4725:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ICharacterJoinerService=f.ISoundService=f.ISelectionService=f.IRenderService=f.IMouseService=f.ICoreBrowserService=f.ICharSizeService=void 0;var m=k(8343);f.ICharSizeService=(0,m.createDecorator)("CharSizeService"),f.ICoreBrowserService=(0,m.createDecorator)("CoreBrowserService"),f.IMouseService=(0,m.createDecorator)("MouseService"),f.IRenderService=(0,m.createDecorator)("RenderService"),f.ISelectionService=(0,m.createDecorator)("SelectionService"),f.ISoundService=(0,m.createDecorator)("SoundService"),f.ICharacterJoinerService=(0,m.createDecorator)("CharacterJoinerService")},357:function(R,f,k){var m=this&&this.__decorate||function(x,C,u,p){var w,b=arguments.length,c=b<3?C:p===null?p=Object.getOwnPropertyDescriptor(C,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(x,C,u,p);else for(var o=x.length-1;o>=0;o--)(w=x[o])&&(c=(b<3?w(c):b>3?w(C,u,c):w(C,u))||c);return b>3&&c&&Object.defineProperty(C,u,c),c},y=this&&this.__param||function(x,C){return function(u,p){C(u,p,x)}};Object.defineProperty(f,"__esModule",{value:!0}),f.SoundService=void 0;var _=k(2585),g=function(){function x(C){this._optionsService=C}return Object.defineProperty(x,"audioContext",{get:function(){if(!x._audioContext){var C=window.AudioContext||window.webkitAudioContext;if(!C)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;x._audioContext=new C}return x._audioContext},enumerable:!1,configurable:!0}),x.prototype.playBellSound=function(){var C=x.audioContext;if(C){var u=C.createBufferSource();C.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.rawOptions.bellSound)),function(p){u.buffer=p,u.connect(C.destination),u.start(0)})}},x.prototype._base64ToArrayBuffer=function(C){for(var u=window.atob(C),p=u.length,w=new Uint8Array(p),b=0;b{Object.defineProperty(f,"__esModule",{value:!0}),f.CircularList=void 0;var m=k(8460),y=function(){function _(g){this._maxLength=g,this.onDeleteEmitter=new m.EventEmitter,this.onInsertEmitter=new m.EventEmitter,this.onTrimEmitter=new m.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(_.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"maxLength",{get:function(){return this._maxLength},set:function(g){if(this._maxLength!==g){for(var x=new Array(g),C=0;Cthis._length)for(var x=this._length;x=g;p--)this._array[this._getCyclicIndex(p+C.length)]=this._array[this._getCyclicIndex(p)];for(p=0;pthis._maxLength){var w=this._length+C.length-this._maxLength;this._startIndex+=w,this._length=this._maxLength,this.onTrimEmitter.fire(w)}else this._length+=C.length},_.prototype.trimStart=function(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)},_.prototype.shiftElements=function(g,x,C){if(!(x<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(var u=x-1;u>=0;u--)this.set(g+u+C,this.get(g+u));var p=g+x+C-this._length;if(p>0)for(this._length+=p;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(u=0;u{Object.defineProperty(f,"__esModule",{value:!0}),f.clone=void 0,f.clone=function k(m,y){if(y===void 0&&(y=5),typeof m!="object")return m;var _=Array.isArray(m)?[]:{};for(var g in m)_[g]=y<=1?m[g]:m[g]&&k(m[g],y-1);return _}},8055:function(R,f){var k,m,y,_,g=this&&this.__read||function(u,p){var w=typeof Symbol=="function"&&u[Symbol.iterator];if(!w)return u;var b,c,o=w.call(u),l=[];try{for(;(p===void 0||p-- >0)&&!(b=o.next()).done;)l.push(b.value)}catch(n){c={error:n}}finally{try{b&&!b.done&&(w=o.return)&&w.call(o)}finally{if(c)throw c.error}}return l};function x(u){var p=u.toString(16);return p.length<2?"0"+p:p}function C(u,p){return u>>0}}(k=f.channels||(f.channels={})),(m=f.color||(f.color={})).blend=function(u,p){var w=(255&p.rgba)/255;if(w===1)return{css:p.css,rgba:p.rgba};var b=p.rgba>>24&255,c=p.rgba>>16&255,o=p.rgba>>8&255,l=u.rgba>>24&255,n=u.rgba>>16&255,a=u.rgba>>8&255,h=l+Math.round((b-l)*w),d=n+Math.round((c-n)*w),S=a+Math.round((o-a)*w);return{css:k.toCss(h,d,S),rgba:k.toRgba(h,d,S)}},m.isOpaque=function(u){return(255&u.rgba)==255},m.ensureContrastRatio=function(u,p,w){var b=_.ensureContrastRatio(u.rgba,p.rgba,w);if(b)return _.toColor(b>>24&255,b>>16&255,b>>8&255)},m.opaque=function(u){var p=(255|u.rgba)>>>0,w=g(_.toChannels(p),3),b=w[0],c=w[1],o=w[2];return{css:k.toCss(b,c,o),rgba:p}},m.opacity=function(u,p){var w=Math.round(255*p),b=g(_.toChannels(u.rgba),3),c=b[0],o=b[1],l=b[2];return{css:k.toCss(c,o,l,w),rgba:k.toRgba(c,o,l,w)}},m.toColorRGB=function(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]},(f.css||(f.css={})).toColor=function(u){if(u.match(/#[0-9a-f]{3,8}/i))switch(u.length){case 4:var p=parseInt(u.slice(1,2).repeat(2),16),w=parseInt(u.slice(2,3).repeat(2),16),b=parseInt(u.slice(3,4).repeat(2),16);return _.toColor(p,w,b);case 5:p=parseInt(u.slice(1,2).repeat(2),16),w=parseInt(u.slice(2,3).repeat(2),16),b=parseInt(u.slice(3,4).repeat(2),16);var c=parseInt(u.slice(4,5).repeat(2),16);return _.toColor(p,w,b,c);case 7:return{css:u,rgba:(parseInt(u.slice(1),16)<<8|255)>>>0};case 9:return{css:u,rgba:parseInt(u.slice(1),16)>>>0}}var o=u.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o)return p=parseInt(o[1]),w=parseInt(o[2]),b=parseInt(o[3]),c=Math.round(255*(o[5]===void 0?1:parseFloat(o[5]))),_.toColor(p,w,b,c);throw new Error("css.toColor: Unsupported css format")},function(u){function p(w,b,c){var o=w/255,l=b/255,n=c/255;return .2126*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.7152*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))}u.relativeLuminance=function(w){return p(w>>16&255,w>>8&255,255&w)},u.relativeLuminance2=p}(y=f.rgb||(f.rgb={})),function(u){function p(b,c,o){for(var l=b>>24&255,n=b>>16&255,a=b>>8&255,h=c>>24&255,d=c>>16&255,S=c>>8&255,T=C(y.relativeLuminance2(h,d,S),y.relativeLuminance2(l,n,a));T0||d>0||S>0);)h-=Math.max(0,Math.ceil(.1*h)),d-=Math.max(0,Math.ceil(.1*d)),S-=Math.max(0,Math.ceil(.1*S)),T=C(y.relativeLuminance2(h,d,S),y.relativeLuminance2(l,n,a));return(h<<24|d<<16|S<<8|255)>>>0}function w(b,c,o){for(var l=b>>24&255,n=b>>16&255,a=b>>8&255,h=c>>24&255,d=c>>16&255,S=c>>8&255,T=C(y.relativeLuminance2(h,d,S),y.relativeLuminance2(l,n,a));T>>0}u.ensureContrastRatio=function(b,c,o){var l=y.relativeLuminance(b>>8),n=y.relativeLuminance(c>>8);if(C(l,n)>8));if(hC(l,y.relativeLuminance(d>>8))?a:d}return a}var S=w(b,c,o),T=C(l,y.relativeLuminance(S>>8));return TC(l,y.relativeLuminance(d>>8))?S:d):S}},u.reduceLuminance=p,u.increaseLuminance=w,u.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]},u.toColor=function(b,c,o,l){return{css:k.toCss(b,c,o,l),rgba:k.toRgba(b,c,o,l)}}}(_=f.rgba||(f.rgba={})),f.toPaddedHex=x,f.contrastRatio=C},8969:function(R,f,k){var m,y=this&&this.__extends||(m=function(M,D){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,I){W.__proto__=I}||function(W,I){for(var A in I)Object.prototype.hasOwnProperty.call(I,A)&&(W[A]=I[A])},m(M,D)},function(M,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");function W(){this.constructor=M}m(M,D),M.prototype=D===null?Object.create(D):(W.prototype=D.prototype,new W)}),_=this&&this.__values||function(M){var D=typeof Symbol=="function"&&Symbol.iterator,W=D&&M[D],I=0;if(W)return W.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&I>=M.length&&(M=void 0),{value:M&&M[I++],done:!M}}};throw new TypeError(D?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.CoreTerminal=void 0;var g=k(844),x=k(2585),C=k(4348),u=k(7866),p=k(744),w=k(7302),b=k(6975),c=k(8460),o=k(1753),l=k(3730),n=k(1480),a=k(7994),h=k(9282),d=k(5435),S=k(5981),T=!1,E=function(M){function D(W){var I=M.call(this)||this;return I._onBinary=new c.EventEmitter,I._onData=new c.EventEmitter,I._onLineFeed=new c.EventEmitter,I._onResize=new c.EventEmitter,I._onScroll=new c.EventEmitter,I._onWriteParsed=new c.EventEmitter,I._instantiationService=new C.InstantiationService,I.optionsService=new w.OptionsService(W),I._instantiationService.setService(x.IOptionsService,I.optionsService),I._bufferService=I.register(I._instantiationService.createInstance(p.BufferService)),I._instantiationService.setService(x.IBufferService,I._bufferService),I._logService=I._instantiationService.createInstance(u.LogService),I._instantiationService.setService(x.ILogService,I._logService),I.coreService=I.register(I._instantiationService.createInstance(b.CoreService,function(){return I.scrollToBottom()})),I._instantiationService.setService(x.ICoreService,I.coreService),I.coreMouseService=I._instantiationService.createInstance(o.CoreMouseService),I._instantiationService.setService(x.ICoreMouseService,I.coreMouseService),I._dirtyRowService=I._instantiationService.createInstance(l.DirtyRowService),I._instantiationService.setService(x.IDirtyRowService,I._dirtyRowService),I.unicodeService=I._instantiationService.createInstance(n.UnicodeService),I._instantiationService.setService(x.IUnicodeService,I.unicodeService),I._charsetService=I._instantiationService.createInstance(a.CharsetService),I._instantiationService.setService(x.ICharsetService,I._charsetService),I._inputHandler=new d.InputHandler(I._bufferService,I._charsetService,I.coreService,I._dirtyRowService,I._logService,I.optionsService,I.coreMouseService,I.unicodeService),I.register((0,c.forwardEvent)(I._inputHandler.onLineFeed,I._onLineFeed)),I.register(I._inputHandler),I.register((0,c.forwardEvent)(I._bufferService.onResize,I._onResize)),I.register((0,c.forwardEvent)(I.coreService.onData,I._onData)),I.register((0,c.forwardEvent)(I.coreService.onBinary,I._onBinary)),I.register(I.optionsService.onOptionChange(function(A){return I._updateOptions(A)})),I.register(I._bufferService.onScroll(function(A){I._onScroll.fire({position:I._bufferService.buffer.ydisp,source:0}),I._dirtyRowService.markRangeDirty(I._bufferService.buffer.scrollTop,I._bufferService.buffer.scrollBottom)})),I.register(I._inputHandler.onScroll(function(A){I._onScroll.fire({position:I._bufferService.buffer.ydisp,source:0}),I._dirtyRowService.markRangeDirty(I._bufferService.buffer.scrollTop,I._bufferService.buffer.scrollBottom)})),I._writeBuffer=new S.WriteBuffer(function(A,H){return I._inputHandler.parse(A,H)}),I.register((0,c.forwardEvent)(I._writeBuffer.onWriteParsed,I._onWriteParsed)),I}return y(D,M),Object.defineProperty(D.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onWriteParsed",{get:function(){return this._onWriteParsed.event},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"onScroll",{get:function(){var W=this;return this._onScrollApi||(this._onScrollApi=new c.EventEmitter,this.register(this._onScroll.event(function(I){var A;(A=W._onScrollApi)===null||A===void 0||A.fire(I.position)}))),this._onScrollApi.event},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"options",{get:function(){return this.optionsService.options},set:function(W){for(var I in W)this.optionsService.options[I]=W[I]},enumerable:!1,configurable:!0}),D.prototype.dispose=function(){var W;this._isDisposed||(M.prototype.dispose.call(this),(W=this._windowsMode)===null||W===void 0||W.dispose(),this._windowsMode=void 0)},D.prototype.write=function(W,I){this._writeBuffer.write(W,I)},D.prototype.writeSync=function(W,I){this._logService.logLevel<=x.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(W,I)},D.prototype.resize=function(W,I){isNaN(W)||isNaN(I)||(W=Math.max(W,p.MINIMUM_COLS),I=Math.max(I,p.MINIMUM_ROWS),this._bufferService.resize(W,I))},D.prototype.scroll=function(W,I){I===void 0&&(I=!1),this._bufferService.scroll(W,I)},D.prototype.scrollLines=function(W,I,A){this._bufferService.scrollLines(W,I,A)},D.prototype.scrollPages=function(W){this._bufferService.scrollPages(W)},D.prototype.scrollToTop=function(){this._bufferService.scrollToTop()},D.prototype.scrollToBottom=function(){this._bufferService.scrollToBottom()},D.prototype.scrollToLine=function(W){this._bufferService.scrollToLine(W)},D.prototype.registerEscHandler=function(W,I){return this._inputHandler.registerEscHandler(W,I)},D.prototype.registerDcsHandler=function(W,I){return this._inputHandler.registerDcsHandler(W,I)},D.prototype.registerCsiHandler=function(W,I){return this._inputHandler.registerCsiHandler(W,I)},D.prototype.registerOscHandler=function(W,I){return this._inputHandler.registerOscHandler(W,I)},D.prototype._setup=function(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()},D.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()},D.prototype._updateOptions=function(W){var I;switch(W){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():((I=this._windowsMode)===null||I===void 0||I.dispose(),this._windowsMode=void 0)}},D.prototype._enableWindowsMode=function(){var W=this;if(!this._windowsMode){var I=[];I.push(this.onLineFeed(h.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},function(){return(0,h.updateWindowsModeWrappedState)(W._bufferService),!1})),this._windowsMode={dispose:function(){var A,H;try{for(var F=_(I),z=F.next();!z.done;z=F.next())z.value.dispose()}catch(G){A={error:G}}finally{try{z&&!z.done&&(H=F.return)&&H.call(F)}finally{if(A)throw A.error}}}}}},D}(g.Disposable);f.CoreTerminal=E},8460:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.forwardEvent=f.EventEmitter=void 0;var k=function(){function m(){this._listeners=[],this._disposed=!1}return Object.defineProperty(m.prototype,"event",{get:function(){var y=this;return this._event||(this._event=function(_){return y._listeners.push(_),{dispose:function(){if(!y._disposed){for(var g=0;g24)return A.setWinLines||!1;switch(I){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(_=f.WindowsOptionsReportType||(f.WindowsOptionsReportType={}));var D=function(){function I(A,H,F,z){this._bufferService=A,this._coreService=H,this._logService=F,this._optionsService=z,this._data=new Uint32Array(0)}return I.prototype.hook=function(A){this._data=new Uint32Array(0)},I.prototype.put=function(A,H,F){this._data=(0,p.concat)(this._data,A.subarray(H,F))},I.prototype.unhook=function(A){if(!A)return this._data=new Uint32Array(0),!0;var H=(0,w.utf32ToString)(this._data);switch(this._data=new Uint32Array(0),H){case'"q':this._coreService.triggerDataEvent(g.C0.ESC+'P1$r0"q'+g.C0.ESC+"\\");break;case'"p':this._coreService.triggerDataEvent(g.C0.ESC+'P1$r61;1"p'+g.C0.ESC+"\\");break;case"r":var F=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";this._coreService.triggerDataEvent(g.C0.ESC+"P1$r"+F+g.C0.ESC+"\\");break;case"m":this._coreService.triggerDataEvent(g.C0.ESC+"P1$r0m"+g.C0.ESC+"\\");break;case" q":var z={block:2,underline:4,bar:6}[this._optionsService.rawOptions.cursorStyle];z-=this._optionsService.rawOptions.cursorBlink?1:0,this._coreService.triggerDataEvent(g.C0.ESC+"P1$r"+z+" q"+g.C0.ESC+"\\");break;default:this._logService.debug("Unknown DCS $q %s",H),this._coreService.triggerDataEvent(g.C0.ESC+"P0$r"+g.C0.ESC+"\\")}return!0},I}(),W=function(I){function A(H,F,z,G,te,ce,ee,fe,_e){_e===void 0&&(_e=new C.EscapeSequenceParser);var q=I.call(this)||this;q._bufferService=H,q._charsetService=F,q._coreService=z,q._dirtyRowService=G,q._logService=te,q._optionsService=ce,q._coreMouseService=ee,q._unicodeService=fe,q._parser=_e,q._parseBuffer=new Uint32Array(4096),q._stringDecoder=new w.StringToUtf32,q._utf8Decoder=new w.Utf8ToUtf32,q._workCell=new l.CellData,q._windowTitle="",q._iconName="",q._windowTitleStack=[],q._iconNameStack=[],q._curAttrData=b.DEFAULT_ATTR_DATA.clone(),q._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),q._onRequestBell=new c.EventEmitter,q._onRequestRefreshRows=new c.EventEmitter,q._onRequestReset=new c.EventEmitter,q._onRequestSendFocus=new c.EventEmitter,q._onRequestSyncScrollBar=new c.EventEmitter,q._onRequestWindowsOptionsReport=new c.EventEmitter,q._onA11yChar=new c.EventEmitter,q._onA11yTab=new c.EventEmitter,q._onCursorMove=new c.EventEmitter,q._onLineFeed=new c.EventEmitter,q._onScroll=new c.EventEmitter,q._onTitleChange=new c.EventEmitter,q._onColor=new c.EventEmitter,q._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},q._specialColors=[256,257,258],q.register(q._parser),q._activeBuffer=q._bufferService.buffer,q.register(q._bufferService.buffers.onBufferActivate(function($){return q._activeBuffer=$.activeBuffer})),q._parser.setCsiHandlerFallback(function($,Ie){q._logService.debug("Unknown CSI code: ",{identifier:q._parser.identToString($),params:Ie.toArray()})}),q._parser.setEscHandlerFallback(function($){q._logService.debug("Unknown ESC code: ",{identifier:q._parser.identToString($)})}),q._parser.setExecuteHandlerFallback(function($){q._logService.debug("Unknown EXECUTE code: ",{code:$})}),q._parser.setOscHandlerFallback(function($,Ie,ge){q._logService.debug("Unknown OSC code: ",{identifier:$,action:Ie,data:ge})}),q._parser.setDcsHandlerFallback(function($,Ie,ge){Ie==="HOOK"&&(ge=ge.toArray()),q._logService.debug("Unknown DCS code: ",{identifier:q._parser.identToString($),action:Ie,payload:ge})}),q._parser.setPrintHandler(function($,Ie,ge){return q.print($,Ie,ge)}),q._parser.registerCsiHandler({final:"@"},function($){return q.insertChars($)}),q._parser.registerCsiHandler({intermediates:" ",final:"@"},function($){return q.scrollLeft($)}),q._parser.registerCsiHandler({final:"A"},function($){return q.cursorUp($)}),q._parser.registerCsiHandler({intermediates:" ",final:"A"},function($){return q.scrollRight($)}),q._parser.registerCsiHandler({final:"B"},function($){return q.cursorDown($)}),q._parser.registerCsiHandler({final:"C"},function($){return q.cursorForward($)}),q._parser.registerCsiHandler({final:"D"},function($){return q.cursorBackward($)}),q._parser.registerCsiHandler({final:"E"},function($){return q.cursorNextLine($)}),q._parser.registerCsiHandler({final:"F"},function($){return q.cursorPrecedingLine($)}),q._parser.registerCsiHandler({final:"G"},function($){return q.cursorCharAbsolute($)}),q._parser.registerCsiHandler({final:"H"},function($){return q.cursorPosition($)}),q._parser.registerCsiHandler({final:"I"},function($){return q.cursorForwardTab($)}),q._parser.registerCsiHandler({final:"J"},function($){return q.eraseInDisplay($)}),q._parser.registerCsiHandler({prefix:"?",final:"J"},function($){return q.eraseInDisplay($)}),q._parser.registerCsiHandler({final:"K"},function($){return q.eraseInLine($)}),q._parser.registerCsiHandler({prefix:"?",final:"K"},function($){return q.eraseInLine($)}),q._parser.registerCsiHandler({final:"L"},function($){return q.insertLines($)}),q._parser.registerCsiHandler({final:"M"},function($){return q.deleteLines($)}),q._parser.registerCsiHandler({final:"P"},function($){return q.deleteChars($)}),q._parser.registerCsiHandler({final:"S"},function($){return q.scrollUp($)}),q._parser.registerCsiHandler({final:"T"},function($){return q.scrollDown($)}),q._parser.registerCsiHandler({final:"X"},function($){return q.eraseChars($)}),q._parser.registerCsiHandler({final:"Z"},function($){return q.cursorBackwardTab($)}),q._parser.registerCsiHandler({final:"`"},function($){return q.charPosAbsolute($)}),q._parser.registerCsiHandler({final:"a"},function($){return q.hPositionRelative($)}),q._parser.registerCsiHandler({final:"b"},function($){return q.repeatPrecedingCharacter($)}),q._parser.registerCsiHandler({final:"c"},function($){return q.sendDeviceAttributesPrimary($)}),q._parser.registerCsiHandler({prefix:">",final:"c"},function($){return q.sendDeviceAttributesSecondary($)}),q._parser.registerCsiHandler({final:"d"},function($){return q.linePosAbsolute($)}),q._parser.registerCsiHandler({final:"e"},function($){return q.vPositionRelative($)}),q._parser.registerCsiHandler({final:"f"},function($){return q.hVPosition($)}),q._parser.registerCsiHandler({final:"g"},function($){return q.tabClear($)}),q._parser.registerCsiHandler({final:"h"},function($){return q.setMode($)}),q._parser.registerCsiHandler({prefix:"?",final:"h"},function($){return q.setModePrivate($)}),q._parser.registerCsiHandler({final:"l"},function($){return q.resetMode($)}),q._parser.registerCsiHandler({prefix:"?",final:"l"},function($){return q.resetModePrivate($)}),q._parser.registerCsiHandler({final:"m"},function($){return q.charAttributes($)}),q._parser.registerCsiHandler({final:"n"},function($){return q.deviceStatus($)}),q._parser.registerCsiHandler({prefix:"?",final:"n"},function($){return q.deviceStatusPrivate($)}),q._parser.registerCsiHandler({intermediates:"!",final:"p"},function($){return q.softReset($)}),q._parser.registerCsiHandler({intermediates:" ",final:"q"},function($){return q.setCursorStyle($)}),q._parser.registerCsiHandler({final:"r"},function($){return q.setScrollRegion($)}),q._parser.registerCsiHandler({final:"s"},function($){return q.saveCursor($)}),q._parser.registerCsiHandler({final:"t"},function($){return q.windowOptions($)}),q._parser.registerCsiHandler({final:"u"},function($){return q.restoreCursor($)}),q._parser.registerCsiHandler({intermediates:"'",final:"}"},function($){return q.insertColumns($)}),q._parser.registerCsiHandler({intermediates:"'",final:"~"},function($){return q.deleteColumns($)}),q._parser.setExecuteHandler(g.C0.BEL,function(){return q.bell()}),q._parser.setExecuteHandler(g.C0.LF,function(){return q.lineFeed()}),q._parser.setExecuteHandler(g.C0.VT,function(){return q.lineFeed()}),q._parser.setExecuteHandler(g.C0.FF,function(){return q.lineFeed()}),q._parser.setExecuteHandler(g.C0.CR,function(){return q.carriageReturn()}),q._parser.setExecuteHandler(g.C0.BS,function(){return q.backspace()}),q._parser.setExecuteHandler(g.C0.HT,function(){return q.tab()}),q._parser.setExecuteHandler(g.C0.SO,function(){return q.shiftOut()}),q._parser.setExecuteHandler(g.C0.SI,function(){return q.shiftIn()}),q._parser.setExecuteHandler(g.C1.IND,function(){return q.index()}),q._parser.setExecuteHandler(g.C1.NEL,function(){return q.nextLine()}),q._parser.setExecuteHandler(g.C1.HTS,function(){return q.tabSet()}),q._parser.registerOscHandler(0,new h.OscHandler(function($){return q.setTitle($),q.setIconName($),!0})),q._parser.registerOscHandler(1,new h.OscHandler(function($){return q.setIconName($)})),q._parser.registerOscHandler(2,new h.OscHandler(function($){return q.setTitle($)})),q._parser.registerOscHandler(4,new h.OscHandler(function($){return q.setOrReportIndexedColor($)})),q._parser.registerOscHandler(10,new h.OscHandler(function($){return q.setOrReportFgColor($)})),q._parser.registerOscHandler(11,new h.OscHandler(function($){return q.setOrReportBgColor($)})),q._parser.registerOscHandler(12,new h.OscHandler(function($){return q.setOrReportCursorColor($)})),q._parser.registerOscHandler(104,new h.OscHandler(function($){return q.restoreIndexedColor($)})),q._parser.registerOscHandler(110,new h.OscHandler(function($){return q.restoreFgColor($)})),q._parser.registerOscHandler(111,new h.OscHandler(function($){return q.restoreBgColor($)})),q._parser.registerOscHandler(112,new h.OscHandler(function($){return q.restoreCursorColor($)})),q._parser.registerEscHandler({final:"7"},function(){return q.saveCursor()}),q._parser.registerEscHandler({final:"8"},function(){return q.restoreCursor()}),q._parser.registerEscHandler({final:"D"},function(){return q.index()}),q._parser.registerEscHandler({final:"E"},function(){return q.nextLine()}),q._parser.registerEscHandler({final:"H"},function(){return q.tabSet()}),q._parser.registerEscHandler({final:"M"},function(){return q.reverseIndex()}),q._parser.registerEscHandler({final:"="},function(){return q.keypadApplicationMode()}),q._parser.registerEscHandler({final:">"},function(){return q.keypadNumericMode()}),q._parser.registerEscHandler({final:"c"},function(){return q.fullReset()}),q._parser.registerEscHandler({final:"n"},function(){return q.setgLevel(2)}),q._parser.registerEscHandler({final:"o"},function(){return q.setgLevel(3)}),q._parser.registerEscHandler({final:"|"},function(){return q.setgLevel(3)}),q._parser.registerEscHandler({final:"}"},function(){return q.setgLevel(2)}),q._parser.registerEscHandler({final:"~"},function(){return q.setgLevel(1)}),q._parser.registerEscHandler({intermediates:"%",final:"@"},function(){return q.selectDefaultCharset()}),q._parser.registerEscHandler({intermediates:"%",final:"G"},function(){return q.selectDefaultCharset()});var ve=function($){de._parser.registerEscHandler({intermediates:"(",final:$},function(){return q.selectCharset("("+$)}),de._parser.registerEscHandler({intermediates:")",final:$},function(){return q.selectCharset(")"+$)}),de._parser.registerEscHandler({intermediates:"*",final:$},function(){return q.selectCharset("*"+$)}),de._parser.registerEscHandler({intermediates:"+",final:$},function(){return q.selectCharset("+"+$)}),de._parser.registerEscHandler({intermediates:"-",final:$},function(){return q.selectCharset("-"+$)}),de._parser.registerEscHandler({intermediates:".",final:$},function(){return q.selectCharset("."+$)}),de._parser.registerEscHandler({intermediates:"/",final:$},function(){return q.selectCharset("/"+$)})},de=this;for(var ke in x.CHARSETS)ve(ke);return q._parser.registerEscHandler({intermediates:"#",final:"8"},function(){return q.screenAlignmentPattern()}),q._parser.setErrorHandler(function($){return q._logService.error("Parsing error: ",$),$}),q._parser.registerDcsHandler({intermediates:"$",final:"q"},new D(q._bufferService,q._coreService,q._logService,q._optionsService)),q}return y(A,I),Object.defineProperty(A.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRequestSendFocus",{get:function(){return this._onRequestSendFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onColor",{get:function(){return this._onColor.event},enumerable:!1,configurable:!0}),A.prototype.dispose=function(){I.prototype.dispose.call(this)},A.prototype._preserveStack=function(H,F,z,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=H,this._parseStack.cursorStartY=F,this._parseStack.decodedLength=z,this._parseStack.position=G},A.prototype._logSlowResolvingAsync=function(H){this._logService.logLevel<=a.LogLevelEnum.WARN&&Promise.race([H,new Promise(function(F,z){return setTimeout(function(){return z("#SLOW_TIMEOUT")},5e3)})]).catch(function(F){if(F!=="#SLOW_TIMEOUT")throw F;console.warn("async parser handler taking longer than 5000 ms")})},A.prototype.parse=function(H,F){var z,G=this._activeBuffer.x,te=this._activeBuffer.y,ce=0,ee=this._parseStack.paused;if(ee){if(z=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,F))return this._logSlowResolvingAsync(z),z;G=this._parseStack.cursorStartX,te=this._parseStack.cursorStartY,this._parseStack.paused=!1,H.length>E&&(ce=this._parseStack.position+E)}if(this._logService.logLevel<=a.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof H=="string"?' "'+H+'"':' "'+Array.prototype.map.call(H,function(ve){return String.fromCharCode(ve)}).join("")+'"'),typeof H=="string"?H.split("").map(function(ve){return ve.charCodeAt(0)}):H),this._parseBuffer.lengthE)for(var fe=ce;fe0&&de.getWidth(this._activeBuffer.x-1)===2&&de.setCellFromCodePoint(this._activeBuffer.x-1,0,1,ve.fg,ve.bg,ve.extended);for(var ke=F;ke=fe){if(_e){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=fe-1,te===2)continue}if(q&&(de.insertCells(this._activeBuffer.x,te,this._activeBuffer.getNullCell(ve),ve),de.getWidth(fe-1)===2&&de.setCellFromCodePoint(fe-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,ve.fg,ve.bg,ve.extended)),de.setCellFromCodePoint(this._activeBuffer.x++,G,te,ve.fg,ve.bg,ve.extended),te>0)for(;--te;)de.setCellFromCodePoint(this._activeBuffer.x++,0,0,ve.fg,ve.bg,ve.extended)}else de.getWidth(this._activeBuffer.x-1)?de.addCodepointToCell(this._activeBuffer.x-1,G):de.addCodepointToCell(this._activeBuffer.x-2,G)}z-F>0&&(de.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x0&&de.getWidth(this._activeBuffer.x)===0&&!de.hasContent(this._activeBuffer.x)&&de.setCellFromCodePoint(this._activeBuffer.x,0,1,ve.fg,ve.bg,ve.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)},A.prototype.registerCsiHandler=function(H,F){var z=this;return H.final!=="t"||H.prefix||H.intermediates?this._parser.registerCsiHandler(H,F):this._parser.registerCsiHandler(H,function(G){return!M(G.params[0],z._optionsService.rawOptions.windowOptions)||F(G)})},A.prototype.registerDcsHandler=function(H,F){return this._parser.registerDcsHandler(H,new d.DcsHandler(F))},A.prototype.registerEscHandler=function(H,F){return this._parser.registerEscHandler(H,F)},A.prototype.registerOscHandler=function(H,F){return this._parser.registerOscHandler(H,new h.OscHandler(F))},A.prototype.bell=function(){return this._onRequestBell.fire(),!0},A.prototype.lineFeed=function(){return this._dirtyRowService.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0},A.prototype.carriageReturn=function(){return this._activeBuffer.x=0,!0},A.prototype.backspace=function(){var H;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||H===void 0)&&H.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;var F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);F.hasWidth(this._activeBuffer.x)&&!F.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0},A.prototype.tab=function(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;var H=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-H),!0},A.prototype.shiftOut=function(){return this._charsetService.setgLevel(1),!0},A.prototype.shiftIn=function(){return this._charsetService.setgLevel(0),!0},A.prototype._restrictCursor=function(H){H===void 0&&(H=this._bufferService.cols-1),this._activeBuffer.x=Math.min(H,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowService.markDirty(this._activeBuffer.y)},A.prototype._setCursor=function(H,F){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=H,this._activeBuffer.y=this._activeBuffer.scrollTop+F):(this._activeBuffer.x=H,this._activeBuffer.y=F),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)},A.prototype._moveCursor=function(H,F){this._restrictCursor(),this._setCursor(this._activeBuffer.x+H,this._activeBuffer.y+F)},A.prototype.cursorUp=function(H){var F=this._activeBuffer.y-this._activeBuffer.scrollTop;return F>=0?this._moveCursor(0,-Math.min(F,H.params[0]||1)):this._moveCursor(0,-(H.params[0]||1)),!0},A.prototype.cursorDown=function(H){var F=this._activeBuffer.scrollBottom-this._activeBuffer.y;return F>=0?this._moveCursor(0,Math.min(F,H.params[0]||1)):this._moveCursor(0,H.params[0]||1),!0},A.prototype.cursorForward=function(H){return this._moveCursor(H.params[0]||1,0),!0},A.prototype.cursorBackward=function(H){return this._moveCursor(-(H.params[0]||1),0),!0},A.prototype.cursorNextLine=function(H){return this.cursorDown(H),this._activeBuffer.x=0,!0},A.prototype.cursorPrecedingLine=function(H){return this.cursorUp(H),this._activeBuffer.x=0,!0},A.prototype.cursorCharAbsolute=function(H){return this._setCursor((H.params[0]||1)-1,this._activeBuffer.y),!0},A.prototype.cursorPosition=function(H){return this._setCursor(H.length>=2?(H.params[1]||1)-1:0,(H.params[0]||1)-1),!0},A.prototype.charPosAbsolute=function(H){return this._setCursor((H.params[0]||1)-1,this._activeBuffer.y),!0},A.prototype.hPositionRelative=function(H){return this._moveCursor(H.params[0]||1,0),!0},A.prototype.linePosAbsolute=function(H){return this._setCursor(this._activeBuffer.x,(H.params[0]||1)-1),!0},A.prototype.vPositionRelative=function(H){return this._moveCursor(0,H.params[0]||1),!0},A.prototype.hVPosition=function(H){return this.cursorPosition(H),!0},A.prototype.tabClear=function(H){var F=H.params[0];return F===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:F===3&&(this._activeBuffer.tabs={}),!0},A.prototype.cursorForwardTab=function(H){if(this._activeBuffer.x>=this._bufferService.cols)return!0;for(var F=H.params[0]||1;F--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0},A.prototype.cursorBackwardTab=function(H){if(this._activeBuffer.x>=this._bufferService.cols)return!0;for(var F=H.params[0]||1;F--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0},A.prototype._eraseInBufferLine=function(H,F,z,G){G===void 0&&(G=!1);var te=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);te.replaceCells(F,z,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),G&&(te.isWrapped=!1)},A.prototype._resetBufferLine=function(H){var F=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);F.fill(this._activeBuffer.getNullCell(this._eraseAttrData())),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+H),F.isWrapped=!1},A.prototype.eraseInDisplay=function(H){var F;switch(this._restrictCursor(this._bufferService.cols),H.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowService.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F);this._dirtyRowService.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowService.markDirty(F-1);F--;)this._resetBufferLine(F);this._dirtyRowService.markDirty(0);break;case 3:var z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0},A.prototype.eraseInLine=function(H){switch(this._restrictCursor(this._bufferService.cols),H.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0},A.prototype.insertLines=function(H){this._restrictCursor();var F=H.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(g.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(g.C0.ESC+"[?6c")),!0},A.prototype.sendDeviceAttributesSecondary=function(H){return H.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(g.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(g.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(H.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(g.C0.ESC+"[>83;40003;0c")),!0},A.prototype._is=function(H){return(this._optionsService.rawOptions.termName+"").indexOf(H)===0},A.prototype.setMode=function(H){for(var F=0;F=2||G[1]===2&&ce+te>=5)break;G[1]&&(te=1)}while(++ce+F5)&&(H=1),F.extended.underlineStyle=H,F.fg|=268435456,H===0&&(F.fg&=-268435457),F.updateExtended()},A.prototype.charAttributes=function(H){if(H.length===1&&H.params[0]===0)return this._curAttrData.fg=b.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=b.DEFAULT_ATTR_DATA.bg,!0;for(var F,z=H.length,G=this._curAttrData,te=0;te=30&&F<=37?(G.fg&=-50331904,G.fg|=16777216|F-30):F>=40&&F<=47?(G.bg&=-50331904,G.bg|=16777216|F-40):F>=90&&F<=97?(G.fg&=-50331904,G.fg|=16777224|F-90):F>=100&&F<=107?(G.bg&=-50331904,G.bg|=16777224|F-100):F===0?(G.fg=b.DEFAULT_ATTR_DATA.fg,G.bg=b.DEFAULT_ATTR_DATA.bg):F===1?G.fg|=134217728:F===3?G.bg|=67108864:F===4?(G.fg|=268435456,this._processUnderline(H.hasSubParams(te)?H.getSubParams(te)[0]:1,G)):F===5?G.fg|=536870912:F===7?G.fg|=67108864:F===8?G.fg|=1073741824:F===9?G.fg|=2147483648:F===2?G.bg|=134217728:F===21?this._processUnderline(2,G):F===22?(G.fg&=-134217729,G.bg&=-134217729):F===23?G.bg&=-67108865:F===24?G.fg&=-268435457:F===25?G.fg&=-536870913:F===27?G.fg&=-67108865:F===28?G.fg&=-1073741825:F===29?G.fg&=2147483647:F===39?(G.fg&=-67108864,G.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):F===49?(G.bg&=-67108864,G.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?te+=this._extractColor(H,te,G):F===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):F===100?(G.fg&=-67108864,G.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0},A.prototype.deviceStatus=function(H){switch(H.params[0]){case 5:this._coreService.triggerDataEvent(g.C0.ESC+"[0n");break;case 6:var F=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(g.C0.ESC+"["+F+";"+z+"R")}return!0},A.prototype.deviceStatusPrivate=function(H){if(H.params[0]===6){var F=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(g.C0.ESC+"[?"+F+";"+z+"R")}return!0},A.prototype.softReset=function(H){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0},A.prototype.setCursorStyle=function(H){var F=H.params[0]||1;switch(F){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var z=F%2==1;return this._optionsService.options.cursorBlink=z,!0},A.prototype.setScrollRegion=function(H){var F,z=H.params[0]||1;return(H.length<2||(F=H.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>z&&(this._activeBuffer.scrollTop=z-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0},A.prototype.windowOptions=function(H){if(!M(H.params[0],this._optionsService.rawOptions.windowOptions))return!0;var F=H.length>1?H.params[1]:0;switch(H.params[0]){case 14:F!==2&&this._onRequestWindowsOptionsReport.fire(_.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(_.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(g.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:F!==0&&F!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),F!==0&&F!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:F!==0&&F!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),F!==0&&F!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0},A.prototype.saveCursor=function(H){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0},A.prototype.restoreCursor=function(H){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0},A.prototype.setTitle=function(H){return this._windowTitle=H,this._onTitleChange.fire(H),!0},A.prototype.setIconName=function(H){return this._iconName=H,!0},A.prototype.setOrReportIndexedColor=function(H){for(var F=[],z=H.split(";");z.length>1;){var G=z.shift(),te=z.shift();if(/^\d+$/.exec(G)){var ce=parseInt(G);if(0<=ce&&ce<256)if(te==="?")F.push({type:0,index:ce});else{var ee=(0,S.parseColor)(te);ee&&F.push({type:1,index:ce,color:ee})}}}return F.length&&this._onColor.fire(F),!0},A.prototype._setOrReportSpecialColor=function(H,F){for(var z=H.split(";"),G=0;G=this._specialColors.length);++G,++F)if(z[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[F]}]);else{var te=(0,S.parseColor)(z[G]);te&&this._onColor.fire([{type:1,index:this._specialColors[F],color:te}])}return!0},A.prototype.setOrReportFgColor=function(H){return this._setOrReportSpecialColor(H,0)},A.prototype.setOrReportBgColor=function(H){return this._setOrReportSpecialColor(H,1)},A.prototype.setOrReportCursorColor=function(H){return this._setOrReportSpecialColor(H,2)},A.prototype.restoreIndexedColor=function(H){if(!H)return this._onColor.fire([{type:2}]),!0;for(var F=[],z=H.split(";"),G=0;G=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0},A.prototype.tabSet=function(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0},A.prototype.reverseIndex=function(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){var H=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,H,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0},A.prototype.fullReset=function(){return this._parser.reset(),this._onRequestReset.fire(),!0},A.prototype.reset=function(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()},A.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},A.prototype.setgLevel=function(H){return this._charsetService.setgLevel(H),!0},A.prototype.screenAlignmentPattern=function(){var H=new l.CellData;H.content=1<<22|69,H.fg=this._curAttrData.fg,H.bg=this._curAttrData.bg,this._setCursor(0,0);for(var F=0;F=_.length&&(_=void 0),{value:_&&_[C++],done:!_}}};throw new TypeError(g?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.getDisposeArrayDisposable=f.disposeArray=f.Disposable=void 0;var m=function(){function _(){this._disposables=[],this._isDisposed=!1}return _.prototype.dispose=function(){var g,x;this._isDisposed=!0;try{for(var C=k(this._disposables),u=C.next();!u.done;u=C.next())u.value.dispose()}catch(p){g={error:p}}finally{try{u&&!u.done&&(x=C.return)&&x.call(C)}finally{if(g)throw g.error}}this._disposables.length=0},_.prototype.register=function(g){return this._disposables.push(g),g},_.prototype.unregister=function(g){var x=this._disposables.indexOf(g);x!==-1&&this._disposables.splice(x,1)},_}();function y(_){var g,x;try{for(var C=k(_),u=C.next();!u.done;u=C.next())u.value.dispose()}catch(p){g={error:p}}finally{try{u&&!u.done&&(x=C.return)&&x.call(C)}finally{if(g)throw g.error}}_.length=0}f.Disposable=m,f.disposeArray=y,f.getDisposeArrayDisposable=function(_){return{dispose:function(){return y(_)}}}},6114:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.isLinux=f.isWindows=f.isIphone=f.isIpad=f.isMac=f.isSafari=f.isLegacyEdge=f.isFirefox=void 0;var k=typeof navigator>"u",m=k?"node":navigator.userAgent,y=k?"node":navigator.platform;f.isFirefox=m.includes("Firefox"),f.isLegacyEdge=m.includes("Edge"),f.isSafari=/^((?!chrome|android).)*safari/i.test(m),f.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(y),f.isIpad=y==="iPad",f.isIphone=y==="iPhone",f.isWindows=["Windows","Win16","Win32","WinCE"].includes(y),f.isLinux=y.indexOf("Linux")>=0},6106:function(R,f){var k=this&&this.__generator||function(y,_){var g,x,C,u,p={label:0,sent:function(){if(1&C[0])throw C[1];return C[1]},trys:[],ops:[]};return u={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function w(b){return function(c){return function(o){if(g)throw new TypeError("Generator is already executing.");for(;p;)try{if(g=1,x&&(C=2&o[0]?x.return:o[0]?x.throw||((C=x.return)&&C.call(x),0):x.next)&&!(C=C.call(x,o[1])).done)return C;switch(x=0,C&&(o=[2&o[0],C.value]),o[0]){case 0:case 1:C=o;break;case 4:return p.label++,{value:o[1],done:!1};case 5:p.label++,x=o[1],o=[0];continue;case 7:o=p.ops.pop(),p.trys.pop();continue;default:if(!((C=(C=p.trys).length>0&&C[C.length-1])||o[0]!==6&&o[0]!==2)){p=0;continue}if(o[0]===3&&(!C||o[1]>C[0]&&o[1]=this._array.length)return[2];if(this._getKey(this._array[g])!==_)return[2];x.label=1;case 1:return[4,this._array[g]];case 2:x.sent(),x.label=3;case 3:if(++g_)return this._search(_,g,C-1);if(this._getKey(this._array[C])<_)return this._search(_,C+1,x);for(;C>0&&this._getKey(this._array[C-1])===_;)C--;return C},y}();f.SortedList=m},8273:(R,f)=>{function k(m,y,_,g){if(_===void 0&&(_=0),g===void 0&&(g=m.length),_>=m.length)return m;_=(m.length+_)%m.length,g=g>=m.length?m.length:(m.length+g)%m.length;for(var x=_;x{Object.defineProperty(f,"__esModule",{value:!0}),f.updateWindowsModeWrappedState=void 0;var m=k(643);f.updateWindowsModeWrappedState=function(y){var _=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),g=_?.get(y.cols-1),x=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);x&&g&&(x.isWrapped=g[m.CHAR_DATA_CODE_INDEX]!==m.NULL_CELL_CODE&&g[m.CHAR_DATA_CODE_INDEX]!==m.WHITESPACE_CELL_CODE)}},3734:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ExtendedAttrs=f.AttributeData=void 0;var k=function(){function y(){this.fg=0,this.bg=0,this.extended=new m}return y.toColorRGB=function(_){return[_>>>16&255,_>>>8&255,255&_]},y.fromColorRGB=function(_){return(255&_[0])<<16|(255&_[1])<<8|255&_[2]},y.prototype.clone=function(){var _=new y;return _.fg=this.fg,_.bg=this.bg,_.extended=this.extended.clone(),_},y.prototype.isInverse=function(){return 67108864&this.fg},y.prototype.isBold=function(){return 134217728&this.fg},y.prototype.isUnderline=function(){return 268435456&this.fg},y.prototype.isBlink=function(){return 536870912&this.fg},y.prototype.isInvisible=function(){return 1073741824&this.fg},y.prototype.isItalic=function(){return 67108864&this.bg},y.prototype.isDim=function(){return 134217728&this.bg},y.prototype.isStrikethrough=function(){return 2147483648&this.fg},y.prototype.getFgColorMode=function(){return 50331648&this.fg},y.prototype.getBgColorMode=function(){return 50331648&this.bg},y.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},y.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},y.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},y.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},y.prototype.isFgDefault=function(){return(50331648&this.fg)==0},y.prototype.isBgDefault=function(){return(50331648&this.bg)==0},y.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},y.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},y.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},y.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},y.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},y.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},y.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},y.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},y.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},y.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},y.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},y}();f.AttributeData=k;var m=function(){function y(_,g){_===void 0&&(_=0),g===void 0&&(g=-1),this.underlineStyle=_,this.underlineColor=g}return y.prototype.clone=function(){return new y(this.underlineStyle,this.underlineColor)},y.prototype.isEmpty=function(){return this.underlineStyle===0},y}();f.ExtendedAttrs=m},9092:function(R,f,k){var m=this&&this.__read||function(l,n){var a=typeof Symbol=="function"&&l[Symbol.iterator];if(!a)return l;var h,d,S=a.call(l),T=[];try{for(;(n===void 0||n-- >0)&&!(h=S.next()).done;)T.push(h.value)}catch(E){d={error:E}}finally{try{h&&!h.done&&(a=S.return)&&a.call(S)}finally{if(d)throw d.error}}return T},y=this&&this.__spreadArray||function(l,n,a){if(a||arguments.length===2)for(var h,d=0,S=n.length;dthis._rows},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isCursorInViewport",{get:function(){var n=this.ybase+this.y-this.ydisp;return n>=0&&nf.MAX_BUFFER_SIZE?f.MAX_BUFFER_SIZE:a},l.prototype.fillViewportRows=function(n){if(this.lines.length===0){n===void 0&&(n=g.DEFAULT_ATTR_DATA);for(var a=this._rows;a--;)this.lines.push(this.getBlankLine(n))}},l.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new _.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},l.prototype.resize=function(n,a){var h=this.getNullCell(g.DEFAULT_ATTR_DATA),d=this._getCorrectBufferLength(a);if(d>this.lines.maxLength&&(this.lines.maxLength=d),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(n,h)));else for(E=this._rows;E>a;E--)this.lines.length>a+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(d0&&(this.lines.trimStart(M),this.ybase=Math.max(this.ybase-M,0),this.ydisp=Math.max(this.ydisp-M,0),this.savedY=Math.max(this.savedY-M,0)),this.lines.maxLength=d}this.x=Math.min(this.x,n-1),this.y=Math.min(this.y,a-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,n-1),this.scrollTop=0}if(this.scrollBottom=a-1,this._isReflowEnabled&&(this._reflow(n,a),this._cols>n))for(S=0;Sthis._cols?this._reflowLarger(n,a):this._reflowSmaller(n,a))},l.prototype._reflowLarger=function(n,a){var h=(0,u.reflowLargerGetLinesToRemove)(this.lines,this._cols,n,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(h.length>0){var d=(0,u.reflowLargerCreateNewLayout)(this.lines,h);(0,u.reflowLargerApplyNewLayout)(this.lines,d.layout),this._reflowLargerAdjustViewport(n,a,d.countRemoved)}},l.prototype._reflowLargerAdjustViewport=function(n,a,h){for(var d=this.getNullCell(g.DEFAULT_ATTR_DATA),S=h;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;T--){var E=this.lines.get(T);if(!(!E||!E.isWrapped&&E.getTrimmedLength()<=n)){for(var M=[E];E.isWrapped&&T>0;)E=this.lines.get(--T),M.unshift(E);var D=this.ybase+this.y;if(!(D>=T&&D0&&(d.push({start:T+M.length+S,newLines:F}),S+=F.length),M.push.apply(M,y([],m(F),!1));var te=A.length-1,ce=A[te];ce===0&&(ce=A[--te]);for(var ee=M.length-H-1,fe=I;ee>=0;){var _e=Math.min(fe,ce);if(M[te]===void 0)break;if(M[te].copyCellsFrom(M[ee],fe-_e,ce-_e,_e,!0),(ce-=_e)==0&&(ce=A[--te]),(fe-=_e)==0){ee--;var q=Math.max(ee,0);fe=(0,u.getWrappedLineTrimmedLength)(M,q,this._cols)}}for(z=0;z0;)this.ybase===0?this.y0){var de=[],ke=[];for(z=0;z=0;z--)if(le&&le.start>Ie+V){for(var Y=le.newLines.length-1;Y>=0;Y--)this.lines.set(z--,le.newLines[Y]);z++,de.push({index:Ie+1,amount:le.newLines.length}),V+=le.newLines.length,le=d[++ge]}else this.lines.set(z,ke[Ie--]);var se=0;for(z=de.length-1;z>=0;z--)de[z].index+=se,this.lines.onInsertEmitter.fire(de[z]),se+=de[z].amount;var xe=Math.max(0,$+S-this.lines.maxLength);xe>0&&this.lines.onTrimEmitter.fire(xe)}},l.prototype.stringIndexToBufferIndex=function(n,a,h){for(h===void 0&&(h=!1);a;){var d=this.lines.get(n);if(!d)return[-1,-1];for(var S=h?d.getTrimmedLength():d.length,T=0;T0&&this.lines.get(a).isWrapped;)a--;for(;h+10;);return n>=this._cols?this._cols-1:n<0?0:n},l.prototype.nextStop=function(n){for(n==null&&(n=this.x);!this.tabs[++n]&&n=this._cols?this._cols-1:n<0?0:n},l.prototype.clearMarkers=function(n){this._isClearing=!0;for(var a=0;a=d.index&&(h.line+=d.amount)})),h.register(this.lines.onDelete(function(d){h.line>=d.index&&h.lined.index&&(h.line-=d.amount)})),h.register(h.onDispose(function(){return a._removeMarker(h)})),h},l.prototype._removeMarker=function(n){this._isClearing||this.markers.splice(this.markers.indexOf(n),1)},l.prototype.iterator=function(n,a,h,d,S){return new o(this,n,a,h,d,S)},l}();f.Buffer=c;var o=function(){function l(n,a,h,d,S,T){h===void 0&&(h=0),d===void 0&&(d=n.lines.length),S===void 0&&(S=0),T===void 0&&(T=0),this._buffer=n,this._trimRight=a,this._startIndex=h,this._endIndex=d,this._startOverscan=S,this._endOverscan=T,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return l.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(n.last=this._endIndex+this._endOverscan),n.first=Math.max(n.first,0),n.last=Math.min(n.last,this._buffer.lines.length);for(var a="",h=n.first;h<=n.last;++h)a+=this._buffer.translateBufferLineToString(h,this._trimRight);return this._current=n.last+1,{range:n,content:a}},l}();f.BufferStringIterator=o},8437:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BufferLine=f.DEFAULT_ATTR_DATA=void 0;var m=k(482),y=k(643),_=k(511),g=k(3734);f.DEFAULT_ATTR_DATA=Object.freeze(new g.AttributeData);var x=function(){function C(u,p,w){w===void 0&&(w=!1),this.isWrapped=w,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);for(var b=p||_.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),c=0;c>22,2097152&p?this._combined[u].charCodeAt(this._combined[u].length-1):w]},C.prototype.set=function(u,p){this._data[3*u+1]=p[y.CHAR_DATA_ATTR_INDEX],p[y.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=p[1],this._data[3*u+0]=2097152|u|p[y.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=p[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[y.CHAR_DATA_WIDTH_INDEX]<<22},C.prototype.getWidth=function(u){return this._data[3*u+0]>>22},C.prototype.hasWidth=function(u){return 12582912&this._data[3*u+0]},C.prototype.getFg=function(u){return this._data[3*u+1]},C.prototype.getBg=function(u){return this._data[3*u+2]},C.prototype.hasContent=function(u){return 4194303&this._data[3*u+0]},C.prototype.getCodePoint=function(u){var p=this._data[3*u+0];return 2097152&p?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&p},C.prototype.isCombined=function(u){return 2097152&this._data[3*u+0]},C.prototype.getString=function(u){var p=this._data[3*u+0];return 2097152&p?this._combined[u]:2097151&p?(0,m.stringFromCodePoint)(2097151&p):""},C.prototype.loadCell=function(u,p){var w=3*u;return p.content=this._data[w+0],p.fg=this._data[w+1],p.bg=this._data[w+2],2097152&p.content&&(p.combinedData=this._combined[u]),268435456&p.bg&&(p.extended=this._extendedAttrs[u]),p},C.prototype.setCell=function(u,p){2097152&p.content&&(this._combined[u]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[u]=p.extended),this._data[3*u+0]=p.content,this._data[3*u+1]=p.fg,this._data[3*u+2]=p.bg},C.prototype.setCellFromCodePoint=function(u,p,w,b,c,o){268435456&c&&(this._extendedAttrs[u]=o),this._data[3*u+0]=p|w<<22,this._data[3*u+1]=b,this._data[3*u+2]=c},C.prototype.addCodepointToCell=function(u,p){var w=this._data[3*u+0];2097152&w?this._combined[u]+=(0,m.stringFromCodePoint)(p):(2097151&w?(this._combined[u]=(0,m.stringFromCodePoint)(2097151&w)+(0,m.stringFromCodePoint)(p),w&=-2097152,w|=2097152):w=p|1<<22,this._data[3*u+0]=w)},C.prototype.insertCells=function(u,p,w,b){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,b?.fg||0,b?.bg||0,b?.extended||new g.ExtendedAttrs),p=0;--o)this.setCell(u+p+o,this.loadCell(u+o,c));for(o=0;othis.length){var w=new Uint32Array(3*u);this.length&&(3*u=u&&delete this._combined[o]}}else this._data=new Uint32Array(0),this._combined={};this.length=u}},C.prototype.fill=function(u){this._combined={},this._extendedAttrs={};for(var p=0;p=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0},C.prototype.copyCellsFrom=function(u,p,w,b,c){var o=u._data;if(c)for(var l=b-1;l>=0;l--)for(var n=0;n<3;n++)this._data[3*(w+l)+n]=o[3*(p+l)+n];else for(l=0;l=p&&(this._combined[h-p+w]=u._combined[h])}},C.prototype.translateToString=function(u,p,w){u===void 0&&(u=!1),p===void 0&&(p=0),w===void 0&&(w=this.length),u&&(w=Math.min(w,this.getTrimmedLength()));for(var b="";p>22||1}return b},C}();f.BufferLine=x},4841:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.getRangeLength=void 0,f.getRangeLength=function(k,m){if(k.start.y>k.end.y)throw new Error("Buffer range end ("+k.end.x+", "+k.end.y+") cannot be before start ("+k.start.x+", "+k.start.y+")");return m*(k.end.y-k.start.y)+(k.end.x-k.start.x+1)}},4634:(R,f)=>{function k(m,y,_){if(y===m.length-1)return m[y].getTrimmedLength();var g=!m[y].hasContent(_-1)&&m[y].getWidth(_-1)===1,x=m[y+1].getWidth(0)===2;return g&&x?_-1:_}Object.defineProperty(f,"__esModule",{value:!0}),f.getWrappedLineTrimmedLength=f.reflowSmallerGetNewLineLengths=f.reflowLargerApplyNewLayout=f.reflowLargerCreateNewLayout=f.reflowLargerGetLinesToRemove=void 0,f.reflowLargerGetLinesToRemove=function(m,y,_,g,x){for(var C=[],u=0;u=u&&g0&&(E>c||b[E].getTrimmedLength()===0);E--)T++;T>0&&(C.push(u+b.length-T),C.push(T)),u+=b.length-1}}}return C},f.reflowLargerCreateNewLayout=function(m,y){for(var _=[],g=0,x=y[g],C=0,u=0;uw&&(C-=w,u++);var b=m[u].getWidth(C-1)===2;b&&C--;var c=b?_-1:_;g.push(c),p+=c}return g},f.getWrappedLineTrimmedLength=k},5295:function(R,f,k){var m,y=this&&this.__extends||(m=function(C,u){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,w){p.__proto__=w}||function(p,w){for(var b in w)Object.prototype.hasOwnProperty.call(w,b)&&(p[b]=w[b])},m(C,u)},function(C,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function p(){this.constructor=C}m(C,u),C.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)});Object.defineProperty(f,"__esModule",{value:!0}),f.BufferSet=void 0;var _=k(9092),g=k(8460),x=function(C){function u(p,w){var b=C.call(this)||this;return b._optionsService=p,b._bufferService=w,b._onBufferActivate=b.register(new g.EventEmitter),b.reset(),b}return y(u,C),Object.defineProperty(u.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),u.prototype.reset=function(){this._normal=new _.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new _.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()},Object.defineProperty(u.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),u.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},u.prototype.activateAltBuffer=function(p){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(p),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},u.prototype.resize=function(p,w){this._normal.resize(p,w),this._alt.resize(p,w)},u.prototype.setupTabStops=function(p){this._normal.setupTabStops(p),this._alt.setupTabStops(p)},u}(k(844).Disposable);f.BufferSet=x},511:function(R,f,k){var m,y=this&&this.__extends||(m=function(u,p){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,b){w.__proto__=b}||function(w,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(w[c]=b[c])},m(u,p)},function(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");function w(){this.constructor=u}m(u,p),u.prototype=p===null?Object.create(p):(w.prototype=p.prototype,new w)});Object.defineProperty(f,"__esModule",{value:!0}),f.CellData=void 0;var _=k(482),g=k(643),x=k(3734),C=function(u){function p(){var w=u!==null&&u.apply(this,arguments)||this;return w.content=0,w.fg=0,w.bg=0,w.extended=new x.ExtendedAttrs,w.combinedData="",w}return y(p,u),p.fromCharData=function(w){var b=new p;return b.setFromCharData(w),b},p.prototype.isCombined=function(){return 2097152&this.content},p.prototype.getWidth=function(){return this.content>>22},p.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,_.stringFromCodePoint)(2097151&this.content):""},p.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},p.prototype.setFromCharData=function(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;var b=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){var c=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){var o=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(c-55296)+o-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)},p.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},p}(x.AttributeData);f.CellData=C},643:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.WHITESPACE_CELL_CODE=f.WHITESPACE_CELL_WIDTH=f.WHITESPACE_CELL_CHAR=f.NULL_CELL_CODE=f.NULL_CELL_WIDTH=f.NULL_CELL_CHAR=f.CHAR_DATA_CODE_INDEX=f.CHAR_DATA_WIDTH_INDEX=f.CHAR_DATA_CHAR_INDEX=f.CHAR_DATA_ATTR_INDEX=f.DEFAULT_ATTR=f.DEFAULT_COLOR=void 0,f.DEFAULT_COLOR=256,f.DEFAULT_ATTR=256|f.DEFAULT_COLOR<<9,f.CHAR_DATA_ATTR_INDEX=0,f.CHAR_DATA_CHAR_INDEX=1,f.CHAR_DATA_WIDTH_INDEX=2,f.CHAR_DATA_CODE_INDEX=3,f.NULL_CELL_CHAR="",f.NULL_CELL_WIDTH=1,f.NULL_CELL_CODE=0,f.WHITESPACE_CELL_CHAR=" ",f.WHITESPACE_CELL_WIDTH=1,f.WHITESPACE_CELL_CODE=32},4863:function(R,f,k){var m,y=this&&this.__extends||(m=function(x,C){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var w in p)Object.prototype.hasOwnProperty.call(p,w)&&(u[w]=p[w])},m(x,C)},function(x,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");function u(){this.constructor=x}m(x,C),x.prototype=C===null?Object.create(C):(u.prototype=C.prototype,new u)});Object.defineProperty(f,"__esModule",{value:!0}),f.Marker=void 0;var _=k(8460),g=function(x){function C(u){var p=x.call(this)||this;return p.line=u,p._id=C._nextId++,p.isDisposed=!1,p._onDispose=new _.EventEmitter,p}return y(C,x),Object.defineProperty(C.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),C.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),x.prototype.dispose.call(this))},C._nextId=1,C}(k(844).Disposable);f.Marker=g},7116:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.DEFAULT_CHARSET=f.CHARSETS=void 0,f.CHARSETS={},f.DEFAULT_CHARSET=f.CHARSETS.B,f.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},f.CHARSETS.A={"#":"\xA3"},f.CHARSETS.B=void 0,f.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},f.CHARSETS.C=f.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},f.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},f.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},f.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},f.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},f.CHARSETS.E=f.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},f.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},f.CHARSETS.H=f.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},f.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(R,f)=>{var k,m;Object.defineProperty(f,"__esModule",{value:!0}),f.C1_ESCAPED=f.C1=f.C0=void 0,function(y){y.NUL="\0",y.SOH="",y.STX="",y.ETX="",y.EOT="",y.ENQ="",y.ACK="",y.BEL="\x07",y.BS="\b",y.HT=" ",y.LF=` +`,y.VT="\v",y.FF="\f",y.CR="\r",y.SO="",y.SI="",y.DLE="",y.DC1="",y.DC2="",y.DC3="",y.DC4="",y.NAK="",y.SYN="",y.ETB="",y.CAN="",y.EM="",y.SUB="",y.ESC="\x1B",y.FS="",y.GS="",y.RS="",y.US="",y.SP=" ",y.DEL="\x7F"}(k=f.C0||(f.C0={})),(m=f.C1||(f.C1={})).PAD="\x80",m.HOP="\x81",m.BPH="\x82",m.NBH="\x83",m.IND="\x84",m.NEL="\x85",m.SSA="\x86",m.ESA="\x87",m.HTS="\x88",m.HTJ="\x89",m.VTS="\x8A",m.PLD="\x8B",m.PLU="\x8C",m.RI="\x8D",m.SS2="\x8E",m.SS3="\x8F",m.DCS="\x90",m.PU1="\x91",m.PU2="\x92",m.STS="\x93",m.CCH="\x94",m.MW="\x95",m.SPA="\x96",m.EPA="\x97",m.SOS="\x98",m.SGCI="\x99",m.SCI="\x9A",m.CSI="\x9B",m.ST="\x9C",m.OSC="\x9D",m.PM="\x9E",m.APC="\x9F",(f.C1_ESCAPED||(f.C1_ESCAPED={})).ST=k.ESC+"\\"},7399:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.evaluateKeyboardEvent=void 0;var m=k(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};f.evaluateKeyboardEvent=function(_,g,x,C){var u={type:0,cancel:!1,key:void 0},p=(_.shiftKey?1:0)|(_.altKey?2:0)|(_.ctrlKey?4:0)|(_.metaKey?8:0);switch(_.keyCode){case 0:_.key==="UIKeyInputUpArrow"?u.key=g?m.C0.ESC+"OA":m.C0.ESC+"[A":_.key==="UIKeyInputLeftArrow"?u.key=g?m.C0.ESC+"OD":m.C0.ESC+"[D":_.key==="UIKeyInputRightArrow"?u.key=g?m.C0.ESC+"OC":m.C0.ESC+"[C":_.key==="UIKeyInputDownArrow"&&(u.key=g?m.C0.ESC+"OB":m.C0.ESC+"[B");break;case 8:if(_.shiftKey){u.key=m.C0.BS;break}if(_.altKey){u.key=m.C0.ESC+m.C0.DEL;break}u.key=m.C0.DEL;break;case 9:if(_.shiftKey){u.key=m.C0.ESC+"[Z";break}u.key=m.C0.HT,u.cancel=!0;break;case 13:u.key=_.altKey?m.C0.ESC+m.C0.CR:m.C0.CR,u.cancel=!0;break;case 27:u.key=m.C0.ESC,_.altKey&&(u.key=m.C0.ESC+m.C0.ESC),u.cancel=!0;break;case 37:if(_.metaKey)break;p?(u.key=m.C0.ESC+"[1;"+(p+1)+"D",u.key===m.C0.ESC+"[1;3D"&&(u.key=m.C0.ESC+(x?"b":"[1;5D"))):u.key=g?m.C0.ESC+"OD":m.C0.ESC+"[D";break;case 39:if(_.metaKey)break;p?(u.key=m.C0.ESC+"[1;"+(p+1)+"C",u.key===m.C0.ESC+"[1;3C"&&(u.key=m.C0.ESC+(x?"f":"[1;5C"))):u.key=g?m.C0.ESC+"OC":m.C0.ESC+"[C";break;case 38:if(_.metaKey)break;p?(u.key=m.C0.ESC+"[1;"+(p+1)+"A",x||u.key!==m.C0.ESC+"[1;3A"||(u.key=m.C0.ESC+"[1;5A")):u.key=g?m.C0.ESC+"OA":m.C0.ESC+"[A";break;case 40:if(_.metaKey)break;p?(u.key=m.C0.ESC+"[1;"+(p+1)+"B",x||u.key!==m.C0.ESC+"[1;3B"||(u.key=m.C0.ESC+"[1;5B")):u.key=g?m.C0.ESC+"OB":m.C0.ESC+"[B";break;case 45:_.shiftKey||_.ctrlKey||(u.key=m.C0.ESC+"[2~");break;case 46:u.key=p?m.C0.ESC+"[3;"+(p+1)+"~":m.C0.ESC+"[3~";break;case 36:u.key=p?m.C0.ESC+"[1;"+(p+1)+"H":g?m.C0.ESC+"OH":m.C0.ESC+"[H";break;case 35:u.key=p?m.C0.ESC+"[1;"+(p+1)+"F":g?m.C0.ESC+"OF":m.C0.ESC+"[F";break;case 33:_.shiftKey?u.type=2:_.ctrlKey?u.key=m.C0.ESC+"[5;"+(p+1)+"~":u.key=m.C0.ESC+"[5~";break;case 34:_.shiftKey?u.type=3:_.ctrlKey?u.key=m.C0.ESC+"[6;"+(p+1)+"~":u.key=m.C0.ESC+"[6~";break;case 112:u.key=p?m.C0.ESC+"[1;"+(p+1)+"P":m.C0.ESC+"OP";break;case 113:u.key=p?m.C0.ESC+"[1;"+(p+1)+"Q":m.C0.ESC+"OQ";break;case 114:u.key=p?m.C0.ESC+"[1;"+(p+1)+"R":m.C0.ESC+"OR";break;case 115:u.key=p?m.C0.ESC+"[1;"+(p+1)+"S":m.C0.ESC+"OS";break;case 116:u.key=p?m.C0.ESC+"[15;"+(p+1)+"~":m.C0.ESC+"[15~";break;case 117:u.key=p?m.C0.ESC+"[17;"+(p+1)+"~":m.C0.ESC+"[17~";break;case 118:u.key=p?m.C0.ESC+"[18;"+(p+1)+"~":m.C0.ESC+"[18~";break;case 119:u.key=p?m.C0.ESC+"[19;"+(p+1)+"~":m.C0.ESC+"[19~";break;case 120:u.key=p?m.C0.ESC+"[20;"+(p+1)+"~":m.C0.ESC+"[20~";break;case 121:u.key=p?m.C0.ESC+"[21;"+(p+1)+"~":m.C0.ESC+"[21~";break;case 122:u.key=p?m.C0.ESC+"[23;"+(p+1)+"~":m.C0.ESC+"[23~";break;case 123:u.key=p?m.C0.ESC+"[24;"+(p+1)+"~":m.C0.ESC+"[24~";break;default:if(!_.ctrlKey||_.shiftKey||_.altKey||_.metaKey)if(x&&!C||!_.altKey||_.metaKey)!x||_.altKey||_.ctrlKey||_.shiftKey||!_.metaKey?_.key&&!_.ctrlKey&&!_.altKey&&!_.metaKey&&_.keyCode>=48&&_.key.length===1?u.key=_.key:_.key&&_.ctrlKey&&(_.key==="_"&&(u.key=m.C0.US),_.key==="@"&&(u.key=m.C0.NUL)):_.keyCode===65&&(u.type=1);else{var w=y[_.keyCode],b=w?.[_.shiftKey?1:0];if(b)u.key=m.C0.ESC+b;else if(_.keyCode>=65&&_.keyCode<=90){var c=_.ctrlKey?_.keyCode-64:_.keyCode+32,o=String.fromCharCode(c);_.shiftKey&&(o=o.toUpperCase()),u.key=m.C0.ESC+o}else _.key==="Dead"&&_.code.startsWith("Key")&&(o=_.code.slice(3,4),_.shiftKey||(o=o.toLowerCase()),u.key=m.C0.ESC+o,u.cancel=!0)}else _.keyCode>=65&&_.keyCode<=90?u.key=String.fromCharCode(_.keyCode-64):_.keyCode===32?u.key=m.C0.NUL:_.keyCode>=51&&_.keyCode<=55?u.key=String.fromCharCode(_.keyCode-51+27):_.keyCode===56?u.key=m.C0.DEL:_.keyCode===219?u.key=m.C0.ESC:_.keyCode===220?u.key=m.C0.FS:_.keyCode===221&&(u.key=m.C0.GS)}return u}},482:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.Utf8ToUtf32=f.StringToUtf32=f.utf32ToString=f.stringFromCodePoint=void 0,f.stringFromCodePoint=function(y){return y>65535?(y-=65536,String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):String.fromCharCode(y)},f.utf32ToString=function(y,_,g){_===void 0&&(_=0),g===void 0&&(g=y.length);for(var x="",C=_;C65535?(u-=65536,x+=String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):x+=String.fromCharCode(u)}return x};var k=function(){function y(){this._interim=0}return y.prototype.clear=function(){this._interim=0},y.prototype.decode=function(_,g){var x=_.length;if(!x)return 0;var C=0,u=0;this._interim&&(56320<=(b=_.charCodeAt(u++))&&b<=57343?g[C++]=1024*(this._interim-55296)+b-56320+65536:(g[C++]=this._interim,g[C++]=b),this._interim=0);for(var p=u;p=x)return this._interim=w,C;var b;56320<=(b=_.charCodeAt(p))&&b<=57343?g[C++]=1024*(w-55296)+b-56320+65536:(g[C++]=w,g[C++]=b)}else w!==65279&&(g[C++]=w)}return C},y}();f.StringToUtf32=k;var m=function(){function y(){this.interim=new Uint8Array(3)}return y.prototype.clear=function(){this.interim.fill(0)},y.prototype.decode=function(_,g){var x=_.length;if(!x)return 0;var C,u,p,w,b=0,c=0,o=0;if(this.interim[0]){var l=!1,n=this.interim[0];n&=(224&n)==192?31:(240&n)==224?15:7;for(var a=0,h=void 0;(h=63&this.interim[++a])&&a<4;)n<<=6,n|=h;for(var d=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=d-a;o=x)return 0;if((192&(h=_[o++]))!=128){o--,l=!0;break}this.interim[a++]=h,n<<=6,n|=63&h}l||(d===2?n<128?o--:g[b++]=n:d===3?n<2048||n>=55296&&n<=57343||n===65279||(g[b++]=n):n<65536||n>1114111||(g[b++]=n)),this.interim.fill(0)}for(var T=x-4,E=o;E=x)return this.interim[0]=C,b;if((192&(u=_[E++]))!=128){E--;continue}if((c=(31&C)<<6|63&u)<128){E--;continue}g[b++]=c}else if((240&C)==224){if(E>=x)return this.interim[0]=C,b;if((192&(u=_[E++]))!=128){E--;continue}if(E>=x)return this.interim[0]=C,this.interim[1]=u,b;if((192&(p=_[E++]))!=128){E--;continue}if((c=(15&C)<<12|(63&u)<<6|63&p)<2048||c>=55296&&c<=57343||c===65279)continue;g[b++]=c}else if((248&C)==240){if(E>=x)return this.interim[0]=C,b;if((192&(u=_[E++]))!=128){E--;continue}if(E>=x)return this.interim[0]=C,this.interim[1]=u,b;if((192&(p=_[E++]))!=128){E--;continue}if(E>=x)return this.interim[0]=C,this.interim[1]=u,this.interim[2]=p,b;if((192&(w=_[E++]))!=128){E--;continue}if((c=(7&C)<<18|(63&u)<<12|(63&p)<<6|63&w)<65536||c>1114111)continue;g[b++]=c}}return b},y}();f.Utf8ToUtf32=m},225:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.UnicodeV6=void 0;var m,y=k(8273),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],g=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],x=function(){function C(){if(this.version="6",!m){m=new Uint8Array(65536),(0,y.fill)(m,1),m[0]=0,(0,y.fill)(m,0,1,32),(0,y.fill)(m,0,127,160),(0,y.fill)(m,2,4352,4448),m[9001]=2,m[9002]=2,(0,y.fill)(m,2,11904,42192),m[12351]=1,(0,y.fill)(m,2,44032,55204),(0,y.fill)(m,2,63744,64256),(0,y.fill)(m,2,65040,65050),(0,y.fill)(m,2,65072,65136),(0,y.fill)(m,2,65280,65377),(0,y.fill)(m,2,65504,65511);for(var u=0;u<_.length;++u)(0,y.fill)(m,0,_[u][0],_[u][1]+1)}}return C.prototype.wcwidth=function(u){return u<32?0:u<127?1:u<65536?m[u]:function(p,w){var b,c=0,o=w.length-1;if(pw[o][1])return!1;for(;o>=c;)if(p>w[b=c+o>>1][1])c=b+1;else{if(!(p=131072&&u<=196605||u>=196608&&u<=262141?2:1},C}();f.UnicodeV6=x},5981:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.WriteBuffer=void 0;var m=k(8460),y=typeof queueMicrotask>"u"?function(g){Promise.resolve().then(g)}:queueMicrotask,_=function(){function g(x){this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new m.EventEmitter}return Object.defineProperty(g.prototype,"onWriteParsed",{get:function(){return this._onWriteParsed.event},enumerable:!1,configurable:!0}),g.prototype.writeSync=function(x,C){if(C!==void 0&&this._syncCalls>C)this._syncCalls=0;else if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){var u;for(this._isSyncWriting=!0;u=this._writeBuffer.shift();){this._action(u);var p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}},g.prototype.write=function(x,C){var u=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return u._innerWrite()})),this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)},g.prototype._innerWrite=function(x,C){var u=this;x===void 0&&(x=0),C===void 0&&(C=!0);for(var p=x||Date.now();this._writeBuffer.length>this._bufferOffset;){var w=this._writeBuffer[this._bufferOffset],b=this._action(w,C);if(b)return void b.catch(function(o){return y(function(){throw o}),Promise.resolve(!1)}).then(function(o){return Date.now()-p>=12?setTimeout(function(){return u._innerWrite(0,o)}):u._innerWrite(p,o)});var c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=w.length,Date.now()-p>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return u._innerWrite()})):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()},g}();f.WriteBuffer=_},5941:function(R,f){var k=this&&this.__read||function(g,x){var C=typeof Symbol=="function"&&g[Symbol.iterator];if(!C)return g;var u,p,w=C.call(g),b=[];try{for(;(x===void 0||x-- >0)&&!(u=w.next()).done;)b.push(u.value)}catch(c){p={error:c}}finally{try{u&&!u.done&&(C=w.return)&&C.call(w)}finally{if(p)throw p.error}}return b};Object.defineProperty(f,"__esModule",{value:!0}),f.toRgbString=f.parseColor=void 0;var m=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,y=/^[\da-f]+$/;function _(g,x){var C=g.toString(16),u=C.length<2?"0"+C:C;switch(x){case 4:return C[0];case 8:return u;case 12:return(u+u).slice(0,3);default:return u+u}}f.parseColor=function(g){if(g){var x=g.toLowerCase();if(x.indexOf("rgb:")===0){x=x.slice(4);var C=m.exec(x);if(C){var u=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/u*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/u*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/u*255)]}}else if(x.indexOf("#")===0&&(x=x.slice(1),y.exec(x)&&[3,6,9,12].includes(x.length))){for(var p=x.length/3,w=[0,0,0],b=0;b<3;++b){var c=parseInt(x.slice(p*b,p*b+p),16);w[b]=p===1?c<<4:p===2?c:p===3?c>>4:c>>8}return w}}},f.toRgbString=function(g,x){x===void 0&&(x=16);var C=k(g,3),u=C[0],p=C[1],w=C[2];return"rgb:"+_(u,x)+"/"+_(p,x)+"/"+_(w,x)}},5770:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.PAYLOAD_LIMIT=void 0,f.PAYLOAD_LIMIT=1e7},6351:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.DcsHandler=f.DcsParser=void 0;var m=k(482),y=k(8742),_=k(5770),g=[],x=function(){function p(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return p.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=g},p.prototype.registerHandler=function(w,b){this._handlers[w]===void 0&&(this._handlers[w]=[]);var c=this._handlers[w];return c.push(b),{dispose:function(){var o=c.indexOf(b);o!==-1&&c.splice(o,1)}}},p.prototype.clearHandler=function(w){this._handlers[w]&&delete this._handlers[w]},p.prototype.setHandlerFallback=function(w){this._handlerFb=w},p.prototype.reset=function(){if(this._active.length)for(var w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0},p.prototype.hook=function(w,b){if(this.reset(),this._ident=w,this._active=this._handlers[w]||g,this._active.length)for(var c=this._active.length-1;c>=0;c--)this._active[c].hook(b);else this._handlerFb(this._ident,"HOOK",b)},p.prototype.put=function(w,b,c){if(this._active.length)for(var o=this._active.length-1;o>=0;o--)this._active[o].put(w,b,c);else this._handlerFb(this._ident,"PUT",(0,m.utf32ToString)(w,b,c))},p.prototype.unhook=function(w,b){if(b===void 0&&(b=!0),this._active.length){var c=!1,o=this._active.length-1,l=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,c=b,l=this._stack.fallThrough,this._stack.paused=!1),!l&&c===!1){for(;o>=0&&(c=this._active[o].unhook(w))!==!0;o--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,c;o--}for(;o>=0;o--)if((c=this._active[o].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",w);this._active=g,this._ident=0},p}();f.DcsParser=x;var C=new y.Params;C.addParam(0);var u=function(){function p(w){this._handler=w,this._data="",this._params=C,this._hitLimit=!1}return p.prototype.hook=function(w){this._params=w.length>1||w.params[0]?w.clone():C,this._data="",this._hitLimit=!1},p.prototype.put=function(w,b,c){this._hitLimit||(this._data+=(0,m.utf32ToString)(w,b,c),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},p.prototype.unhook=function(w){var b=this,c=!1;if(this._hitLimit)c=!1;else if(w&&(c=this._handler(this._data,this._params))instanceof Promise)return c.then(function(o){return b._params=C,b._data="",b._hitLimit=!1,o});return this._params=C,this._data="",this._hitLimit=!1,c},p}();f.DcsHandler=u},2015:function(R,f,k){var m,y=this&&this.__extends||(m=function(c,o){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,n){l.__proto__=n}||function(l,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(l[a]=n[a])},m(c,o)},function(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function l(){this.constructor=c}m(c,o),c.prototype=o===null?Object.create(o):(l.prototype=o.prototype,new l)});Object.defineProperty(f,"__esModule",{value:!0}),f.EscapeSequenceParser=f.VT500_TRANSITION_TABLE=f.TransitionTable=void 0;var _=k(844),g=k(8273),x=k(8742),C=k(6242),u=k(6351),p=function(){function c(o){this.table=new Uint8Array(o)}return c.prototype.setDefault=function(o,l){(0,g.fill)(this.table,o<<4|l)},c.prototype.add=function(o,l,n,a){this.table[l<<8|o]=n<<4|a},c.prototype.addMany=function(o,l,n,a){for(var h=0;h1)throw new Error("only one byte as prefix supported");if((a=l.prefix.charCodeAt(0))&&60>a||a>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var h=0;hd||d>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=d}}if(l.final.length!==1)throw new Error("final must be a single byte");var S=l.final.charCodeAt(0);if(n[0]>S||S>n[1])throw new Error("final must be in range "+n[0]+" .. "+n[1]);return(a<<=8)|S},o.prototype.identToString=function(l){for(var n=[];l;)n.push(String.fromCharCode(255&l)),l>>=8;return n.reverse().join("")},o.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},o.prototype.setPrintHandler=function(l){this._printHandler=l},o.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},o.prototype.registerEscHandler=function(l,n){var a=this._identifier(l,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);var h=this._escHandlers[a];return h.push(n),{dispose:function(){var d=h.indexOf(n);d!==-1&&h.splice(d,1)}}},o.prototype.clearEscHandler=function(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]},o.prototype.setEscHandlerFallback=function(l){this._escHandlerFb=l},o.prototype.setExecuteHandler=function(l,n){this._executeHandlers[l.charCodeAt(0)]=n},o.prototype.clearExecuteHandler=function(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]},o.prototype.setExecuteHandlerFallback=function(l){this._executeHandlerFb=l},o.prototype.registerCsiHandler=function(l,n){var a=this._identifier(l);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);var h=this._csiHandlers[a];return h.push(n),{dispose:function(){var d=h.indexOf(n);d!==-1&&h.splice(d,1)}}},o.prototype.clearCsiHandler=function(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]},o.prototype.setCsiHandlerFallback=function(l){this._csiHandlerFb=l},o.prototype.registerDcsHandler=function(l,n){return this._dcsParser.registerHandler(this._identifier(l),n)},o.prototype.clearDcsHandler=function(l){this._dcsParser.clearHandler(this._identifier(l))},o.prototype.setDcsHandlerFallback=function(l){this._dcsParser.setHandlerFallback(l)},o.prototype.registerOscHandler=function(l,n){return this._oscParser.registerHandler(l,n)},o.prototype.clearOscHandler=function(l){this._oscParser.clearHandler(l)},o.prototype.setOscHandlerFallback=function(l){this._oscParser.setHandlerFallback(l)},o.prototype.setErrorHandler=function(l){this._errorHandler=l},o.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},o.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])},o.prototype._preserveStack=function(l,n,a,h,d){this._parseStack.state=l,this._parseStack.handlers=n,this._parseStack.handlerPos=a,this._parseStack.transition=h,this._parseStack.chunkPos=d},o.prototype.parse=function(l,n,a){var h,d=0,S=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(a===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");var E=this._parseStack.handlers,M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(a===!1&&M>-1){for(;M>=0&&(h=E[M](this._params))!==!0;M--)if(h instanceof Promise)return this._parseStack.handlerPos=M,h}this._parseStack.handlers=[];break;case 4:if(a===!1&&M>-1){for(;M>=0&&(h=E[M]())!==!0;M--)if(h instanceof Promise)return this._parseStack.handlerPos=M,h}this._parseStack.handlers=[];break;case 6:if(d=l[this._parseStack.chunkPos],h=this._dcsParser.unhook(d!==24&&d!==26,a))return h;d===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(d=l[this._parseStack.chunkPos],h=this._oscParser.end(d!==24&&d!==26,a))return h;d===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(var D=T;D>4){case 2:for(var W=D+1;;++W){if(W>=n||(d=l[W])<32||d>126&&d=n||(d=l[W])<32||d>126&&d=n||(d=l[W])<32||d>126&&d=n||(d=l[W])<32||d>126&&d=0&&(h=E[I](this._params))!==!0;I--)if(h instanceof Promise)return this._preserveStack(3,E,I,S,D),h;I<0&&this._csiHandlerFb(this._collect<<8|d,this._params),this.precedingCodepoint=0;break;case 8:do switch(d){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(d-48)}while(++D47&&d<60);D--;break;case 9:this._collect<<=8,this._collect|=d;break;case 10:for(var A=this._escHandlers[this._collect<<8|d],H=A?A.length-1:-1;H>=0&&(h=A[H]())!==!0;H--)if(h instanceof Promise)return this._preserveStack(4,A,H,S,D),h;H<0&&this._escHandlerFb(this._collect<<8|d),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|d,this._params);break;case 13:for(var F=D+1;;++F)if(F>=n||(d=l[F])===24||d===26||d===27||d>127&&d=n||(d=l[z])<32||d>127&&d{Object.defineProperty(f,"__esModule",{value:!0}),f.OscHandler=f.OscParser=void 0;var m=k(5770),y=k(482),_=[],g=function(){function C(){this._state=0,this._active=_,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return C.prototype.registerHandler=function(u,p){this._handlers[u]===void 0&&(this._handlers[u]=[]);var w=this._handlers[u];return w.push(p),{dispose:function(){var b=w.indexOf(p);b!==-1&&w.splice(b,1)}}},C.prototype.clearHandler=function(u){this._handlers[u]&&delete this._handlers[u]},C.prototype.setHandlerFallback=function(u){this._handlerFb=u},C.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=_},C.prototype.reset=function(){if(this._state===2)for(var u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].end(!1);this._stack.paused=!1,this._active=_,this._id=-1,this._state=0},C.prototype._start=function(){if(this._active=this._handlers[this._id]||_,this._active.length)for(var u=this._active.length-1;u>=0;u--)this._active[u].start();else this._handlerFb(this._id,"START")},C.prototype._put=function(u,p,w){if(this._active.length)for(var b=this._active.length-1;b>=0;b--)this._active[b].put(u,p,w);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(u,p,w))},C.prototype.start=function(){this.reset(),this._state=1},C.prototype.put=function(u,p,w){if(this._state!==3){if(this._state===1)for(;p0&&this._put(u,p,w)}},C.prototype.end=function(u,p){if(p===void 0&&(p=!0),this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){var w=!1,b=this._active.length-1,c=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,w=p,c=this._stack.fallThrough,this._stack.paused=!1),!c&&w===!1){for(;b>=0&&(w=this._active[b].end(u))!==!0;b--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,w;b--}for(;b>=0;b--)if((w=this._active[b].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",u);this._active=_,this._id=-1,this._state=0}},C}();f.OscParser=g;var x=function(){function C(u){this._handler=u,this._data="",this._hitLimit=!1}return C.prototype.start=function(){this._data="",this._hitLimit=!1},C.prototype.put=function(u,p,w){this._hitLimit||(this._data+=(0,y.utf32ToString)(u,p,w),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},C.prototype.end=function(u){var p=this,w=!1;if(this._hitLimit)w=!1;else if(u&&(w=this._handler(this._data))instanceof Promise)return w.then(function(b){return p._data="",p._hitLimit=!1,b});return this._data="",this._hitLimit=!1,w},C}();f.OscHandler=x},8742:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.Params=void 0;var k=2147483647,m=function(){function y(_,g){if(_===void 0&&(_=32),g===void 0&&(g=32),this.maxLength=_,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(_),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(_),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return y.fromArray=function(_){var g=new y;if(!_.length)return g;for(var x=Array.isArray(_[0])?1:0;x<_.length;++x){var C=_[x];if(Array.isArray(C))for(var u=0;u>8,C=255&this._subParamsIdx[g];C-x>0&&_.push(Array.prototype.slice.call(this._subParams,x,C))}return _},y.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},y.prototype.addParam=function(_){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=_>k?k:_}},y.prototype.addSubParam=function(_){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=_>k?k:_,this._subParamsIdx[this.length-1]++}},y.prototype.hasSubParams=function(_){return(255&this._subParamsIdx[_])-(this._subParamsIdx[_]>>8)>0},y.prototype.getSubParams=function(_){var g=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];return x-g>0?this._subParams.subarray(g,x):null},y.prototype.getSubParamsAll=function(){for(var _={},g=0;g>8,C=255&this._subParamsIdx[g];C-x>0&&(_[g]=this._subParams.slice(x,C))}return _},y.prototype.addDigit=function(_){var g;if(!(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var x=this._digitIsSub?this._subParams:this.params,C=x[g-1];x[g-1]=~C?Math.min(10*C+_,k):_}},y}();f.Params=m},5741:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.AddonManager=void 0;var k=function(){function m(){this._addons=[]}return m.prototype.dispose=function(){for(var y=this._addons.length-1;y>=0;y--)this._addons[y].instance.dispose()},m.prototype.loadAddon=function(y,_){var g=this,x={instance:_,dispose:_.dispose,isDisposed:!1};this._addons.push(x),_.dispose=function(){return g._wrappedAddonDispose(x)},_.activate(y)},m.prototype._wrappedAddonDispose=function(y){if(!y.isDisposed){for(var _=-1,g=0;g{Object.defineProperty(f,"__esModule",{value:!0}),f.BufferApiView=void 0;var m=k(3785),y=k(511),_=function(){function g(x,C){this._buffer=x,this.type=C}return g.prototype.init=function(x){return this._buffer=x,this},Object.defineProperty(g.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),g.prototype.getLine=function(x){var C=this._buffer.lines.get(x);if(C)return new m.BufferLineApiView(C)},g.prototype.getNullCell=function(){return new y.CellData},g}();f.BufferApiView=_},3785:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BufferLineApiView=void 0;var m=k(511),y=function(){function _(g){this._line=g}return Object.defineProperty(_.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),_.prototype.getCell=function(g,x){if(!(g<0||g>=this._line.length))return x?(this._line.loadCell(g,x),x):this._line.loadCell(g,new m.CellData)},_.prototype.translateToString=function(g,x,C){return this._line.translateToString(g,x,C)},_}();f.BufferLineApiView=y},8285:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.BufferNamespaceApi=void 0;var m=k(8771),y=k(8460),_=function(){function g(x){var C=this;this._core=x,this._onBufferChange=new y.EventEmitter,this._normal=new m.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new m.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(function(){return C._onBufferChange.fire(C.active)})}return Object.defineProperty(g.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"active",{get:function(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"normal",{get:function(){return this._normal.init(this._core.buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"alternate",{get:function(){return this._alternate.init(this._core.buffers.alt)},enumerable:!1,configurable:!0}),g}();f.BufferNamespaceApi=_},7975:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.ParserApi=void 0;var k=function(){function m(y){this._core=y}return m.prototype.registerCsiHandler=function(y,_){return this._core.registerCsiHandler(y,function(g){return _(g.toArray())})},m.prototype.addCsiHandler=function(y,_){return this.registerCsiHandler(y,_)},m.prototype.registerDcsHandler=function(y,_){return this._core.registerDcsHandler(y,function(g,x){return _(g,x.toArray())})},m.prototype.addDcsHandler=function(y,_){return this.registerDcsHandler(y,_)},m.prototype.registerEscHandler=function(y,_){return this._core.registerEscHandler(y,_)},m.prototype.addEscHandler=function(y,_){return this.registerEscHandler(y,_)},m.prototype.registerOscHandler=function(y,_){return this._core.registerOscHandler(y,_)},m.prototype.addOscHandler=function(y,_){return this.registerOscHandler(y,_)},m}();f.ParserApi=k},7090:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.UnicodeApi=void 0;var k=function(){function m(y){this._core=y}return m.prototype.register=function(y){this._core.unicodeService.register(y)},Object.defineProperty(m.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(m.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(y){this._core.unicodeService.activeVersion=y},enumerable:!1,configurable:!0}),m}();f.UnicodeApi=k},744:function(R,f,k){var m,y=this&&this.__extends||(m=function(b,c){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(o[n]=l[n])},m(b,c)},function(b,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function o(){this.constructor=b}m(b,c),b.prototype=c===null?Object.create(c):(o.prototype=c.prototype,new o)}),_=this&&this.__decorate||function(b,c,o,l){var n,a=arguments.length,h=a<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(b,c,o,l);else for(var d=b.length-1;d>=0;d--)(n=b[d])&&(h=(a<3?n(h):a>3?n(c,o,h):n(c,o))||h);return a>3&&h&&Object.defineProperty(c,o,h),h},g=this&&this.__param||function(b,c){return function(o,l){c(o,l,b)}};Object.defineProperty(f,"__esModule",{value:!0}),f.BufferService=f.MINIMUM_ROWS=f.MINIMUM_COLS=void 0;var x=k(2585),C=k(5295),u=k(8460),p=k(844);f.MINIMUM_COLS=2,f.MINIMUM_ROWS=1;var w=function(b){function c(o){var l=b.call(this)||this;return l._optionsService=o,l.isUserScrolling=!1,l._onResize=new u.EventEmitter,l._onScroll=new u.EventEmitter,l.cols=Math.max(o.rawOptions.cols||0,f.MINIMUM_COLS),l.rows=Math.max(o.rawOptions.rows||0,f.MINIMUM_ROWS),l.buffers=new C.BufferSet(o,l),l}return y(c,b),Object.defineProperty(c.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),c.prototype.dispose=function(){b.prototype.dispose.call(this),this.buffers.dispose()},c.prototype.resize=function(o,l){this.cols=o,this.rows=l,this.buffers.resize(o,l),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:o,rows:l})},c.prototype.reset=function(){this.buffers.reset(),this.isUserScrolling=!1},c.prototype.scroll=function(o,l){l===void 0&&(l=!1);var n,a=this.buffer;(n=this._cachedBlankLine)&&n.length===this.cols&&n.getFg(0)===o.fg&&n.getBg(0)===o.bg||(n=a.getBlankLine(o,l),this._cachedBlankLine=n),n.isWrapped=l;var h=a.ybase+a.scrollTop,d=a.ybase+a.scrollBottom;if(a.scrollTop===0){var S=a.lines.isFull;d===a.lines.length-1?S?a.lines.recycle().copyFrom(n):a.lines.push(n.clone()):a.lines.splice(d+1,0,n.clone()),S?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{var T=d-h+1;a.lines.shiftElements(h+1,T-1,-1),a.lines.set(d,n.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)},c.prototype.scrollLines=function(o,l,n){var a=this.buffer;if(o<0){if(a.ydisp===0)return;this.isUserScrolling=!0}else o+a.ydisp>=a.ybase&&(this.isUserScrolling=!1);var h=a.ydisp;a.ydisp=Math.max(Math.min(a.ydisp+o,a.ybase),0),h!==a.ydisp&&(l||this._onScroll.fire(a.ydisp))},c.prototype.scrollPages=function(o){this.scrollLines(o*(this.rows-1))},c.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},c.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},c.prototype.scrollToLine=function(o){var l=o-this.buffer.ydisp;l!==0&&this.scrollLines(l)},_([g(0,x.IOptionsService)],c)}(p.Disposable);f.BufferService=w},7994:(R,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.CharsetService=void 0;var k=function(){function m(){this.glevel=0,this._charsets=[]}return m.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},m.prototype.setgLevel=function(y){this.glevel=y,this.charset=this._charsets[y]},m.prototype.setgCharset=function(y,_){this._charsets[y]=_,this.glevel===y&&(this.charset=_)},m}();f.CharsetService=k},1753:function(R,f,k){var m=this&&this.__decorate||function(c,o,l,n){var a,h=arguments.length,d=h<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,l):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(c,o,l,n);else for(var S=c.length-1;S>=0;S--)(a=c[S])&&(d=(h<3?a(d):h>3?a(o,l,d):a(o,l))||d);return h>3&&d&&Object.defineProperty(o,l,d),d},y=this&&this.__param||function(c,o){return function(l,n){o(l,n,c)}},_=this&&this.__values||function(c){var o=typeof Symbol=="function"&&Symbol.iterator,l=o&&c[o],n=0;if(l)return l.call(c);if(c&&typeof c.length=="number")return{next:function(){return c&&n>=c.length&&(c=void 0),{value:c&&c[n++],done:!c}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.CoreMouseService=void 0;var g=k(2585),x=k(8460),C={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(c){return c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)}},VT200:{events:19,restrict:function(c){return c.action!==32}},DRAG:{events:23,restrict:function(c){return c.action!==32||c.button!==3}},ANY:{events:31,restrict:function(c){return!0}}};function u(c,o){var l=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(l|=64,l|=c.action):(l|=3&c.button,4&c.button&&(l|=64),8&c.button&&(l|=128),c.action===32?l|=32:c.action!==0||o||(l|=3)),l}var p=String.fromCharCode,w={DEFAULT:function(c){var o=[u(c,!1)+32,c.col+32,c.row+32];return o[0]>255||o[1]>255||o[2]>255?"":"\x1B[M"+p(o[0])+p(o[1])+p(o[2])},SGR:function(c){var o=c.action===0&&c.button!==4?"m":"M";return"\x1B[<"+u(c,!0)+";"+c.col+";"+c.row+o}},b=function(){function c(o,l){var n,a,h,d;this._bufferService=o,this._coreService=l,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new x.EventEmitter,this._lastEvent=null;try{for(var S=_(Object.keys(C)),T=S.next();!T.done;T=S.next()){var E=T.value;this.addProtocol(E,C[E])}}catch(I){n={error:I}}finally{try{T&&!T.done&&(a=S.return)&&a.call(S)}finally{if(n)throw n.error}}try{for(var M=_(Object.keys(w)),D=M.next();!D.done;D=M.next()){var W=D.value;this.addEncoding(W,w[W])}}catch(I){h={error:I}}finally{try{D&&!D.done&&(d=M.return)&&d.call(M)}finally{if(h)throw h.error}}this.reset()}return c.prototype.addProtocol=function(o,l){this._protocols[o]=l},c.prototype.addEncoding=function(o,l){this._encodings[o]=l},Object.defineProperty(c.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(o){if(!this._protocols[o])throw new Error('unknown protocol "'+o+'"');this._activeProtocol=o,this._onProtocolChange.fire(this._protocols[o].events)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(o){if(!this._encodings[o])throw new Error('unknown encoding "'+o+'"');this._activeEncoding=o},enumerable:!1,configurable:!0}),c.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(c.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),c.prototype.triggerMouseEvent=function(o){if(o.col<0||o.col>=this._bufferService.cols||o.row<0||o.row>=this._bufferService.rows||o.button===4&&o.action===32||o.button===3&&o.action!==32||o.button!==4&&(o.action===2||o.action===3)||(o.col++,o.row++,o.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,o))||!this._protocols[this._activeProtocol].restrict(o))return!1;var l=this._encodings[this._activeEncoding](o);return l&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(l):this._coreService.triggerDataEvent(l,!0)),this._lastEvent=o,!0},c.prototype.explainEvents=function(o){return{down:!!(1&o),up:!!(2&o),drag:!!(4&o),move:!!(8&o),wheel:!!(16&o)}},c.prototype._compareEvents=function(o,l){return o.col===l.col&&o.row===l.row&&o.button===l.button&&o.action===l.action&&o.ctrl===l.ctrl&&o.alt===l.alt&&o.shift===l.shift},m([y(0,g.IBufferService),y(1,g.ICoreService)],c)}();f.CoreMouseService=b},6975:function(R,f,k){var m,y=this&&this.__extends||(m=function(o,l){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var h in a)Object.prototype.hasOwnProperty.call(a,h)&&(n[h]=a[h])},m(o,l)},function(o,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function n(){this.constructor=o}m(o,l),o.prototype=l===null?Object.create(l):(n.prototype=l.prototype,new n)}),_=this&&this.__decorate||function(o,l,n,a){var h,d=arguments.length,S=d<3?l:a===null?a=Object.getOwnPropertyDescriptor(l,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,l,n,a);else for(var T=o.length-1;T>=0;T--)(h=o[T])&&(S=(d<3?h(S):d>3?h(l,n,S):h(l,n))||S);return d>3&&S&&Object.defineProperty(l,n,S),S},g=this&&this.__param||function(o,l){return function(n,a){l(n,a,o)}};Object.defineProperty(f,"__esModule",{value:!0}),f.CoreService=void 0;var x=k(2585),C=k(8460),u=k(1439),p=k(844),w=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),c=function(o){function l(n,a,h,d){var S=o.call(this)||this;return S._bufferService=a,S._logService=h,S._optionsService=d,S.isCursorInitialized=!1,S.isCursorHidden=!1,S._onData=S.register(new C.EventEmitter),S._onUserInput=S.register(new C.EventEmitter),S._onBinary=S.register(new C.EventEmitter),S._scrollToBottom=n,S.register({dispose:function(){return S._scrollToBottom=void 0}}),S.modes=(0,u.clone)(w),S.decPrivateModes=(0,u.clone)(b),S}return y(l,o),Object.defineProperty(l.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),l.prototype.reset=function(){this.modes=(0,u.clone)(w),this.decPrivateModes=(0,u.clone)(b)},l.prototype.triggerDataEvent=function(n,a){if(a===void 0&&(a=!1),!this._optionsService.rawOptions.disableStdin){var h=this._bufferService.buffer;h.ybase!==h.ydisp&&this._scrollToBottom(),a&&this._onUserInput.fire(),this._logService.debug('sending data "'+n+'"',function(){return n.split("").map(function(d){return d.charCodeAt(0)})}),this._onData.fire(n)}},l.prototype.triggerBinaryEvent=function(n){this._optionsService.rawOptions.disableStdin||(this._logService.debug('sending binary "'+n+'"',function(){return n.split("").map(function(a){return a.charCodeAt(0)})}),this._onBinary.fire(n))},_([g(1,x.IBufferService),g(2,x.ILogService),g(3,x.IOptionsService)],l)}(p.Disposable);f.CoreService=c},9074:function(R,f,k){var m,y=this&&this.__extends||(m=function(c,o){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,n){l.__proto__=n}||function(l,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(l[a]=n[a])},m(c,o)},function(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function l(){this.constructor=c}m(c,o),c.prototype=o===null?Object.create(o):(l.prototype=o.prototype,new l)}),_=this&&this.__generator||function(c,o){var l,n,a,h,d={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return h={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function S(T){return function(E){return function(M){if(l)throw new TypeError("Generator is already executing.");for(;d;)try{if(l=1,n&&(a=2&M[0]?n.return:M[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,M[1])).done)return a;switch(n=0,a&&(M=[2&M[0],a.value]),M[0]){case 0:case 1:a=M;break;case 4:return d.label++,{value:M[1],done:!1};case 5:d.label++,n=M[1],M=[0];continue;case 7:M=d.ops.pop(),d.trys.pop();continue;default:if(!((a=(a=d.trys).length>0&&a[a.length-1])||M[0]!==6&&M[0]!==2)){d=0;continue}if(M[0]===3&&(!a||M[1]>a[0]&&M[1]=c.length&&(c=void 0),{value:c&&c[n++],done:!c}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(f,"__esModule",{value:!0}),f.DecorationService=void 0;var x=k(8055),C=k(8460),u=k(844),p=k(6106),w=function(c){function o(){var l=c.call(this)||this;return l._decorations=new p.SortedList(function(n){return n.marker.line}),l._onDecorationRegistered=l.register(new C.EventEmitter),l._onDecorationRemoved=l.register(new C.EventEmitter),l}return y(o,c),Object.defineProperty(o.prototype,"onDecorationRegistered",{get:function(){return this._onDecorationRegistered.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onDecorationRemoved",{get:function(){return this._onDecorationRemoved.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"decorations",{get:function(){return this._decorations.values()},enumerable:!1,configurable:!0}),o.prototype.registerDecoration=function(l){var n=this;if(!l.marker.isDisposed){var a=new b(l);if(a){var h=a.marker.onDispose(function(){return a.dispose()});a.onDispose(function(){a&&(n._decorations.delete(a)&&n._onDecorationRemoved.fire(a),h.dispose())}),this._decorations.insert(a),this._onDecorationRegistered.fire(a)}return a}},o.prototype.reset=function(){var l,n;try{for(var a=g(this._decorations.values()),h=a.next();!h.done;h=a.next())h.value.dispose()}catch(d){l={error:d}}finally{try{h&&!h.done&&(n=a.return)&&n.call(a)}finally{if(l)throw l.error}}this._decorations.clear()},o.prototype.getDecorationsAtLine=function(l){return _(this,function(n){return[2,this._decorations.getKeyIterator(l)]})},o.prototype.getDecorationsAtCell=function(l,n,a){var h,d,S,T,E,M,D,W,I,A,H;return _(this,function(F){switch(F.label){case 0:h=0,d=0,F.label=1;case 1:F.trys.push([1,6,7,8]),S=g(this._decorations.getKeyIterator(n)),T=S.next(),F.label=2;case 2:return T.done?[3,5]:(E=T.value,h=(I=E.options.x)!==null&&I!==void 0?I:0,d=h+((A=E.options.width)!==null&&A!==void 0?A:1),!(l>=h&&l=0;o--)(w=x[o])&&(c=(b<3?w(c):b>3?w(C,u,c):w(C,u))||c);return b>3&&c&&Object.defineProperty(C,u,c),c},y=this&&this.__param||function(x,C){return function(u,p){C(u,p,x)}};Object.defineProperty(f,"__esModule",{value:!0}),f.DirtyRowService=void 0;var _=k(2585),g=function(){function x(C){this._bufferService=C,this.clearRange()}return Object.defineProperty(x.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),x.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},x.prototype.markDirty=function(C){Cthis._end&&(this._end=C)},x.prototype.markRangeDirty=function(C,u){if(C>u){var p=C;C=u,u=p}Cthis._end&&(this._end=u)},x.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},m([y(0,_.IBufferService)],x)}();f.DirtyRowService=g},4348:function(R,f,k){var m=this&&this.__values||function(p){var w=typeof Symbol=="function"&&Symbol.iterator,b=w&&p[w],c=0;if(b)return b.call(p);if(p&&typeof p.length=="number")return{next:function(){return p&&c>=p.length&&(p=void 0),{value:p&&p[c++],done:!p}}};throw new TypeError(w?"Object is not iterable.":"Symbol.iterator is not defined.")},y=this&&this.__read||function(p,w){var b=typeof Symbol=="function"&&p[Symbol.iterator];if(!b)return p;var c,o,l=b.call(p),n=[];try{for(;(w===void 0||w-- >0)&&!(c=l.next()).done;)n.push(c.value)}catch(a){o={error:a}}finally{try{c&&!c.done&&(b=l.return)&&b.call(l)}finally{if(o)throw o.error}}return n},_=this&&this.__spreadArray||function(p,w,b){if(b||arguments.length===2)for(var c,o=0,l=w.length;o0?n[0].index:o.length;if(o.length!==E)throw new Error("[createInstance] First service dependency of "+w.name+" at position "+(E+1)+" conflicts with "+o.length+" static arguments");return new(w.bind.apply(w,_([void 0],y(_(_([],y(o),!1),y(a),!1)),!1)))},p}();f.InstantiationService=u},7866:function(R,f,k){var m=this&&this.__decorate||function(p,w,b,c){var o,l=arguments.length,n=l<3?w:c===null?c=Object.getOwnPropertyDescriptor(w,b):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(p,w,b,c);else for(var a=p.length-1;a>=0;a--)(o=p[a])&&(n=(l<3?o(n):l>3?o(w,b,n):o(w,b))||n);return l>3&&n&&Object.defineProperty(w,b,n),n},y=this&&this.__param||function(p,w){return function(b,c){w(b,c,p)}},_=this&&this.__read||function(p,w){var b=typeof Symbol=="function"&&p[Symbol.iterator];if(!b)return p;var c,o,l=b.call(p),n=[];try{for(;(w===void 0||w-- >0)&&!(c=l.next()).done;)n.push(c.value)}catch(a){o={error:a}}finally{try{c&&!c.done&&(b=l.return)&&b.call(l)}finally{if(o)throw o.error}}return n},g=this&&this.__spreadArray||function(p,w,b){if(b||arguments.length===2)for(var c,o=0,l=w.length;o{function k(m,y,_){y.di$target===y?y.di$dependencies.push({id:m,index:_}):(y.di$dependencies=[{id:m,index:_}],y.di$target=y)}Object.defineProperty(f,"__esModule",{value:!0}),f.createDecorator=f.getServiceDependencies=f.serviceRegistry=void 0,f.serviceRegistry=new Map,f.getServiceDependencies=function(m){return m.di$dependencies||[]},f.createDecorator=function(m){if(f.serviceRegistry.has(m))return f.serviceRegistry.get(m);var y=function(_,g,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");k(y,_,x)};return y.toString=function(){return m},f.serviceRegistry.set(m,y),y}},2585:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.IDecorationService=f.IUnicodeService=f.IOptionsService=f.ILogService=f.LogLevelEnum=f.IInstantiationService=f.IDirtyRowService=f.ICharsetService=f.ICoreService=f.ICoreMouseService=f.IBufferService=void 0;var m,y=k(8343);f.IBufferService=(0,y.createDecorator)("BufferService"),f.ICoreMouseService=(0,y.createDecorator)("CoreMouseService"),f.ICoreService=(0,y.createDecorator)("CoreService"),f.ICharsetService=(0,y.createDecorator)("CharsetService"),f.IDirtyRowService=(0,y.createDecorator)("DirtyRowService"),f.IInstantiationService=(0,y.createDecorator)("InstantiationService"),(m=f.LogLevelEnum||(f.LogLevelEnum={}))[m.DEBUG=0]="DEBUG",m[m.INFO=1]="INFO",m[m.WARN=2]="WARN",m[m.ERROR=3]="ERROR",m[m.OFF=4]="OFF",f.ILogService=(0,y.createDecorator)("LogService"),f.IOptionsService=(0,y.createDecorator)("OptionsService"),f.IUnicodeService=(0,y.createDecorator)("UnicodeService"),f.IDecorationService=(0,y.createDecorator)("DecorationService")},1480:(R,f,k)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.UnicodeService=void 0;var m=k(8460),y=k(225),_=function(){function g(){this._providers=Object.create(null),this._active="",this._onChange=new m.EventEmitter;var x=new y.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}return Object.defineProperty(g.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"activeVersion",{get:function(){return this._active},set:function(x){if(!this._providers[x])throw new Error('unknown Unicode version "'+x+'"');this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)},enumerable:!1,configurable:!0}),g.prototype.register=function(x){this._providers[x.version]=x},g.prototype.wcwidth=function(x){return this._activeProvider.wcwidth(x)},g.prototype.getStringCellWidth=function(x){for(var C=0,u=x.length,p=0;p=u)return C+this.wcwidth(w);var b=x.charCodeAt(p);56320<=b&&b<=57343?w=1024*(w-55296)+b-56320+65536:C+=this.wcwidth(b)}C+=this.wcwidth(w)}return C},g}();f.UnicodeService=_}},B={};return function R(f){var k=B[f];if(k!==void 0)return k.exports;var m=B[f]={exports:{}};return U[f].call(m.exports,m,m.exports,R),m.exports}(4389)})()})});var vc=Nt((dc,pc)=>{(function(U){typeof dc=="object"&&typeof pc=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){"use strict";var B={},R=/[^\s\u00a0]/,f=U.Pos,k=U.cmpPos;function m(g){var x=g.search(R);return x==-1?0:x}U.commands.toggleComment=function(g){g.toggleComment()},U.defineExtension("toggleComment",function(g){g||(g=B);for(var x=this,C=1/0,u=this.listSelections(),p=null,w=u.length-1;w>=0;w--){var b=u[w].from(),c=u[w].to();b.line>=C||(c.line>=C&&(c=f(C,0)),C=b.line,p==null?x.uncomment(b,c,g)?p="un":(x.lineComment(b,c,g),p="line"):p=="un"?x.uncomment(b,c,g):x.lineComment(b,c,g))}});function y(g,x,C){return/\bstring\b/.test(g.getTokenTypeAt(f(x.line,0)))&&!/^[\'\"\`]/.test(C)}function _(g,x){var C=g.getMode();return C.useInnerComments===!1||!C.innerMode?C:g.getModeAt(x)}U.defineExtension("lineComment",function(g,x,C){C||(C=B);var u=this,p=_(u,g),w=u.getLine(g.line);if(!(w==null||y(u,g,w))){var b=C.lineComment||p.lineComment;if(!b){(C.blockCommentStart||p.blockCommentStart)&&(C.fullLines=!0,u.blockComment(g,x,C));return}var c=Math.min(x.ch!=0||x.line==g.line?x.line+1:x.line,u.lastLine()+1),o=C.padding==null?" ":C.padding,l=C.commentBlankLines||g.line==x.line;u.operation(function(){if(C.indent){for(var n=null,a=g.line;ad.length)&&(n=d)}for(var a=g.line;ac||u.operation(function(){if(C.fullLines!=!1){var l=R.test(u.getLine(c));u.replaceRange(o+b,f(c)),u.replaceRange(w+o,f(g.line,0));var n=C.blockCommentLead||p.blockCommentLead;if(n!=null)for(var a=g.line+1;a<=c;++a)(a!=c||l)&&u.replaceRange(n+o,f(a,0))}else{var h=k(u.getCursor("to"),x)==0,d=!u.somethingSelected();u.replaceRange(b,x),h&&u.setSelection(d?x:u.getCursor("from"),x),u.replaceRange(w,g)}})}}),U.defineExtension("uncomment",function(g,x,C){C||(C=B);var u=this,p=_(u,g),w=Math.min(x.ch!=0||x.line==g.line?x.line:x.line-1,u.lastLine()),b=Math.min(g.line,w),c=C.lineComment||p.lineComment,o=[],l=C.padding==null?" ":C.padding,n;e:{if(!c)break e;for(var a=b;a<=w;++a){var h=u.getLine(a),d=h.indexOf(c);if(d>-1&&!/comment/.test(u.getTokenTypeAt(f(a,d+1)))&&(d=-1),d==-1&&R.test(h)||d>-1&&R.test(h.slice(0,d)))break e;o.push(h)}if(u.operation(function(){for(var te=b;te<=w;++te){var ce=o[te-b],ee=ce.indexOf(c),fe=ee+c.length;ee<0||(ce.slice(fe,fe+l.length)==l&&(fe+=l.length),n=!0,u.replaceRange("",f(te,ee),f(te,fe)))}}),n)return!0}var S=C.blockCommentStart||p.blockCommentStart,T=C.blockCommentEnd||p.blockCommentEnd;if(!S||!T)return!1;var E=C.blockCommentLead||p.blockCommentLead,M=u.getLine(b),D=M.indexOf(S);if(D==-1)return!1;var W=w==b?M:u.getLine(w),I=W.indexOf(T,w==b?D+S.length:0),A=f(b,D+1),H=f(w,I+1);if(I==-1||!/comment/.test(u.getTokenTypeAt(A))||!/comment/.test(u.getTokenTypeAt(H))||u.getRange(A,H,` +`).indexOf(T)>-1)return!1;var F=M.lastIndexOf(S,g.ch),z=F==-1?-1:M.slice(0,g.ch).indexOf(T,F+S.length);if(F!=-1&&z!=-1&&z+T.length!=g.ch)return!1;z=W.indexOf(T,x.ch);var G=W.slice(x.ch).lastIndexOf(S,z-x.ch);return F=z==-1||G==-1?-1:x.ch+G,z!=-1&&F!=-1&&F!=x.ch?!1:(u.operation(function(){u.replaceRange("",f(w,I-(l&&W.slice(I-l.length,I)==l?l.length:0)),f(w,I+T.length));var te=D+S.length;if(l&&M.slice(te,te+l.length)==l&&(te+=l.length),u.replaceRange("",f(b,D),f(b,te)),E)for(var ce=b+1;ce<=w;++ce){var ee=u.getLine(ce),fe=ee.indexOf(E);if(!(fe==-1||R.test(ee.slice(0,fe)))){var _e=fe+E.length;l&&ee.slice(_e,_e+l.length)==l&&(_e+=l.length),u.replaceRange("",f(ce,fe),f(ce,_e))}}}),!0)})})});var yc=Nt((gc,_c)=>{(function(U){typeof gc=="object"&&typeof _c=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){var B=/\S/g,R=String.prototype.repeat||function(y){return Array(y+1).join(this)};function f(y){if(y.getOption("disableInput"))return U.Pass;for(var _=y.listSelections(),g,x=[],C=0;C<_.length;C++){var u=_[C].head;if(!/\bcomment\b/.test(y.getTokenTypeAt(u)))return U.Pass;var p=y.getModeAt(u);if(!g)g=p;else if(g!=p)return U.Pass;var w=null,b,c,o=g.blockCommentStart,l=g.lineComment;if(o&&g.blockCommentContinue){b=y.getLine(u.line);var n=b.lastIndexOf(g.blockCommentEnd,u.ch-g.blockCommentEnd.length);if(!(n!=-1&&n==u.ch-g.blockCommentEnd.length||l&&(c=b.lastIndexOf(l,u.ch-1))>-1&&/\bcomment\b/.test(y.getTokenTypeAt({line:u.line,ch:c+1}))))if(u.ch>=o.length&&(c=b.lastIndexOf(o,u.ch-o.length))>-1&&c>n)if(k(0,b)>=c)w=b.slice(0,c);else{var a=y.options.tabSize,h;c=U.countColumn(b,c,a),w=y.options.indentWithTabs?R.call(" ",h=Math.floor(c/a))+R.call(" ",c-a*h):R.call(" ",c)}else(c=b.indexOf(g.blockCommentContinue))>-1&&c<=u.ch&&c<=k(0,b)&&(w=b.slice(0,c));w!=null&&(w+=g.blockCommentContinue)}if(w==null&&l&&m(y)){if(b==null&&(b=y.getLine(u.line)),c=b.indexOf(l),!u.ch&&!c)w="";else if(c>-1&&k(0,b)>=c){if(w=k(u.ch,b)>-1,!w){var d=y.getLine(u.line+1)||"",S=d.indexOf(l);w=S>-1&&k(0,d)>=S||null}w&&(w=b.slice(0,c)+l+b.slice(c+l.length).match(/^\s*/)[0])}}if(w==null)return U.Pass;x[C]=` +`+w}y.operation(function(){for(var T=_.length-1;T>=0;T--)y.replaceRange(x[T],_[T].from(),_[T].to(),"+insert")})}function k(y,_){B.lastIndex=y;var g=B.exec(_);return g?g.index:-1}function m(y){var _=y.getOption("continueComments");return _&&typeof _=="object"?_.continueLineComment!==!1:!0}U.defineOption("continueComments",null,function(y,_,g){if(g&&g!=U.Init&&y.removeKeyMap("continueComment"),_){var x="Enter";typeof _=="string"?x=_:typeof _=="object"&&_.key&&(x=_.key);var C={name:"continueComment"};C[x]=f,y.addKeyMap(C)}})})});var Sc=Nt((mc,bc)=>{(function(U){typeof mc=="object"&&typeof bc=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){U.defineOption("placeholder","",function(_,g,x){var C=x&&x!=U.Init;if(g&&!C)_.on("blur",k),_.on("change",m),_.on("swapDoc",m),U.on(_.getInputField(),"compositionupdate",_.state.placeholderCompose=function(){f(_)}),m(_);else if(!g&&C){_.off("blur",k),_.off("change",m),_.off("swapDoc",m),U.off(_.getInputField(),"compositionupdate",_.state.placeholderCompose),B(_);var u=_.getWrapperElement();u.className=u.className.replace(" CodeMirror-empty","")}g&&!_.hasFocus()&&k(_)});function B(_){_.state.placeholder&&(_.state.placeholder.parentNode.removeChild(_.state.placeholder),_.state.placeholder=null)}function R(_){B(_);var g=_.state.placeholder=document.createElement("pre");g.style.cssText="height: 0; overflow: visible",g.style.direction=_.getOption("direction"),g.className="CodeMirror-placeholder CodeMirror-line-like";var x=_.getOption("placeholder");typeof x=="string"&&(x=document.createTextNode(x)),g.appendChild(x),_.display.lineSpace.insertBefore(g,_.display.lineSpace.firstChild)}function f(_){setTimeout(function(){var g=!1;if(_.lineCount()==1){var x=_.getInputField();g=x.nodeName=="TEXTAREA"?!_.getLine(0).length:!/[^\u200b]/.test(x.querySelector(".CodeMirror-line").textContent)}g?R(_):B(_)},20)}function k(_){y(_)&&R(_)}function m(_){var g=_.getWrapperElement(),x=y(_);g.className=g.className.replace(" CodeMirror-empty","")+(x?" CodeMirror-empty":""),x?R(_):B(_)}function y(_){return _.lineCount()===1&&_.getLine(0)===""}})});var Lc=Nt((Cc,wc)=>{(function(U){typeof Cc=="object"&&typeof wc=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){var B={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},R=U.Pos;U.defineOption("autoCloseBrackets",!1,function(c,o,l){l&&l!=U.Init&&(c.removeKeyMap(k),c.state.closeBrackets=null),o&&(m(f(o,"pairs")),c.state.closeBrackets=o,c.addKeyMap(k))});function f(c,o){return o=="pairs"&&typeof c=="string"?c:typeof c=="object"&&c[o]!=null?c[o]:B[o]}var k={Backspace:g,Enter:x};function m(c){for(var o=0;o=0;a--){var d=n[a].head;c.replaceRange("",R(d.line,d.ch-1),R(d.line,d.ch+1),"+delete")}}function x(c){var o=_(c),l=o&&f(o,"explode");if(!l||c.getOption("disableInput"))return U.Pass;for(var n=c.listSelections(),a=0;a0?{line:d.head.line,ch:d.head.ch+o}:{line:d.head.line-1};l.push({anchor:S,head:S})}c.setSelections(l,a)}function u(c){var o=U.cmpPos(c.anchor,c.head)>0;return{anchor:new R(c.anchor.line,c.anchor.ch+(o?-1:1)),head:new R(c.head.line,c.head.ch+(o?1:-1))}}function p(c,o){var l=_(c);if(!l||c.getOption("disableInput"))return U.Pass;var n=f(l,"pairs"),a=n.indexOf(o);if(a==-1)return U.Pass;for(var h=f(l,"closeBefore"),d=f(l,"triples"),S=n.charAt(a+1)==o,T=c.listSelections(),E=a%2==0,M,D=0;D=0&&c.getRange(I,R(I.line,I.ch+3))==o+o+o?A="skipThree":A="skip";else if(S&&I.ch>1&&d.indexOf(o)>=0&&c.getRange(R(I.line,I.ch-2),I)==o+o){if(I.ch>2&&/\bstring/.test(c.getTokenTypeAt(R(I.line,I.ch-2))))return U.Pass;A="addFour"}else if(S){var F=I.ch==0?" ":c.getRange(R(I.line,I.ch-1),I);if(!U.isWordChar(H)&&F!=o&&!U.isWordChar(F))A="both";else return U.Pass}else if(E&&(H.length===0||/\s/.test(H)||h.indexOf(H)>-1))A="both";else return U.Pass;if(!M)M=A;else if(M!=A)return U.Pass}var z=a%2?n.charAt(a-1):o,G=a%2?o:n.charAt(a+1);c.operation(function(){if(M=="skip")C(c,1);else if(M=="skipThree")C(c,3);else if(M=="surround"){for(var te=c.getSelections(),ce=0;ce{(function(U){typeof xc=="object"&&typeof kc=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){var B=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),R=U.Pos,f={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function k(C){return C&&C.bracketRegex||/[(){}[\]]/}function m(C,u,p){var w=C.getLineHandle(u.line),b=u.ch-1,c=p&&p.afterCursor;c==null&&(c=/(^| )cm-fat-cursor($| )/.test(C.getWrapperElement().className));var o=k(p),l=!c&&b>=0&&o.test(w.text.charAt(b))&&f[w.text.charAt(b)]||o.test(w.text.charAt(b+1))&&f[w.text.charAt(++b)];if(!l)return null;var n=l.charAt(1)==">"?1:-1;if(p&&p.strict&&n>0!=(b==u.ch))return null;var a=C.getTokenTypeAt(R(u.line,b+1)),h=y(C,R(u.line,b+(n>0?1:0)),n,a,p);return h==null?null:{from:R(u.line,b),to:h&&h.pos,match:h&&h.ch==l.charAt(0),forward:n>0}}function y(C,u,p,w,b){for(var c=b&&b.maxScanLineLength||1e4,o=b&&b.maxScanLines||1e3,l=[],n=k(b),a=p>0?Math.min(u.line+o,C.lastLine()+1):Math.max(C.firstLine()-1,u.line-o),h=u.line;h!=a;h+=p){var d=C.getLine(h);if(d){var S=p>0?0:d.length-1,T=p>0?d.length:-1;if(!(d.length>c))for(h==u.line&&(S=u.ch-(p<0?1:0));S!=T;S+=p){var E=d.charAt(S);if(n.test(E)&&(w===void 0||(C.getTokenTypeAt(R(h,S+1))||"")==(w||""))){var M=f[E];if(M&&M.charAt(1)==">"==p>0)l.push(E);else if(l.length)l.pop();else return{pos:R(h,S),ch:E}}}}}return h-p==(p>0?C.lastLine():C.firstLine())?!1:null}function _(C,u,p){for(var w=C.state.matchBrackets.maxHighlightLineLength||1e3,b=p&&p.highlightNonMatching,c=[],o=C.listSelections(),l=0;l{(function(U){typeof Ec=="object"&&typeof Tc=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){"use strict";var B=U.Pos;function R(o){var l=o.flags;return l??(o.ignoreCase?"i":"")+(o.global?"g":"")+(o.multiline?"m":"")}function f(o,l){for(var n=R(o),a=n,h=0;hS);T++){var E=o.getLine(d++);a=a==null?E:a+` +`+E}h=h*2,l.lastIndex=n.ch;var M=l.exec(a);if(M){var D=a.slice(0,M.index).split(` +`),W=M[0].split(` +`),I=n.line+D.length-1,A=D[D.length-1].length;return{from:B(I,A),to:B(I+W.length-1,W.length==1?A+W[0].length:W[W.length-1].length),match:M}}}}function _(o,l,n){for(var a,h=0;h<=o.length;){l.lastIndex=h;var d=l.exec(o);if(!d)break;var S=d.index+d[0].length;if(S>o.length-n)break;(!a||S>a.index+a[0].length)&&(a=d),h=d.index+1}return a}function g(o,l,n){l=f(l,"g");for(var a=n.line,h=n.ch,d=o.firstLine();a>=d;a--,h=-1){var S=o.getLine(a),T=_(S,l,h<0?0:S.length-h);if(T)return{from:B(a,T.index),to:B(a,T.index+T[0].length),match:T}}}function x(o,l,n){if(!k(l))return g(o,l,n);l=f(l,"gm");for(var a,h=1,d=o.getLine(n.line).length-n.ch,S=n.line,T=o.firstLine();S>=T;){for(var E=0;E=T;E++){var M=o.getLine(S--);a=a==null?M:M+` +`+a}h*=2;var D=_(a,l,d);if(D){var W=a.slice(0,D.index).split(` +`),I=D[0].split(` +`),A=S+W.length,H=W[W.length-1].length;return{from:B(A,H),to:B(A+I.length-1,I.length==1?H+I[0].length:I[I.length-1].length),match:D}}}}var C,u;String.prototype.normalize?(C=function(o){return o.normalize("NFD").toLowerCase()},u=function(o){return o.normalize("NFD")}):(C=function(o){return o.toLowerCase()},u=function(o){return o});function p(o,l,n,a){if(o.length==l.length)return n;for(var h=0,d=n+Math.max(0,o.length-l.length);;){if(h==d)return h;var S=h+d>>1,T=a(o.slice(0,S)).length;if(T==n)return S;T>n?d=S:h=S+1}}function w(o,l,n,a){if(!l.length)return null;var h=a?C:u,d=h(l).split(/\r|\n\r?/);e:for(var S=n.line,T=n.ch,E=o.lastLine()+1-d.length;S<=E;S++,T=0){var M=o.getLine(S).slice(T),D=h(M);if(d.length==1){var W=D.indexOf(d[0]);if(W==-1)continue e;var n=p(M,D,W,h)+T;return{from:B(S,p(M,D,W,h)+T),to:B(S,p(M,D,W+d[0].length,h)+T)}}else{var I=D.length-d[0].length;if(D.slice(I)!=d[0])continue e;for(var A=1;A=E;S--,T=-1){var M=o.getLine(S);T>-1&&(M=M.slice(0,T));var D=h(M);if(d.length==1){var W=D.lastIndexOf(d[0]);if(W==-1)continue e;return{from:B(S,p(M,D,W,h)),to:B(S,p(M,D,W+d[0].length,h))}}else{var I=d[d.length-1];if(D.slice(0,I.length)!=I)continue e;for(var A=1,n=S-d.length+1;A(this.doc.getLine(l.line)||"").length&&(l.ch=0,l.line++)),U.cmpPos(l,this.doc.clipPos(l))!=0))return this.atOccurrence=!1;var n=this.matches(o,l);if(this.afterEmptyMatch=n&&U.cmpPos(n.from,n.to)==0,n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var a=B(o?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:a,to:a},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(o,l){if(this.atOccurrence){var n=U.splitLines(o);this.doc.replaceRange(n,this.pos.from,this.pos.to,l),this.pos.to=B(this.pos.from.line+n.length-1,n[n.length-1].length+(n.length==1?this.pos.from.ch:0))}}},U.defineExtension("getSearchCursor",function(o,l,n){return new c(this.doc,o,l,n)}),U.defineDocExtension("getSearchCursor",function(o,l,n){return new c(this,o,l,n)}),U.defineExtension("selectMatches",function(o,l){for(var n=[],a=this.getSearchCursor(o,this.getCursor("from"),l);a.findNext()&&!(U.cmpPos(a.to(),this.getCursor("to"))>0);)n.push({anchor:a.from(),head:a.to()});n.length&&this.setSelections(n,0)})})});var Oc=Nt((Mc,Rc)=>{(function(U){typeof Mc=="object"&&typeof Rc=="object"?U($t(),Ac(),Ys()):typeof define=="function"&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],U):U(CodeMirror)})(function(U){"use strict";var B=U.commands,R=U.Pos;function f(n,a,h){if(h<0&&a.ch==0)return n.clipPos(R(a.line-1));var d=n.getLine(a.line);if(h>0&&a.ch>=d.length)return n.clipPos(R(a.line+1,0));for(var S="start",T,E=a.ch,M=E,D=h<0?0:d.length,W=0;M!=D;M+=h,W++){var I=d.charAt(h<0?M-1:M),A=I!="_"&&U.isWordChar(I)?"w":"o";if(A=="w"&&I.toUpperCase()==I&&(A="W"),S=="start")A!="o"?(S="in",T=A):E=M+h;else if(S=="in"&&T!=A){if(T=="w"&&A=="W"&&h<0&&M--,T=="W"&&A=="w"&&h>0)if(M==E+1){T="w";continue}else M--;break}}return R(a.line,M)}function k(n,a){n.extendSelectionsBy(function(h){return n.display.shift||n.doc.extend||h.empty()?f(n.doc,h.head,a):a<0?h.from():h.to()})}B.goSubwordLeft=function(n){k(n,-1)},B.goSubwordRight=function(n){k(n,1)},B.scrollLineUp=function(n){var a=n.getScrollInfo();if(!n.somethingSelected()){var h=n.lineAtHeight(a.top+a.clientHeight,"local");n.getCursor().line>=h&&n.execCommand("goLineUp")}n.scrollTo(null,a.top-n.defaultTextHeight())},B.scrollLineDown=function(n){var a=n.getScrollInfo();if(!n.somethingSelected()){var h=n.lineAtHeight(a.top,"local")+1;n.getCursor().line<=h&&n.execCommand("goLineDown")}n.scrollTo(null,a.top+n.defaultTextHeight())},B.splitSelectionByLine=function(n){for(var a=n.listSelections(),h=[],d=0;dS.line&&E==T.line&&T.ch==0||h.push({anchor:E==S.line?S:R(E,0),head:E==T.line?T:R(E)});n.setSelections(h,0)},B.singleSelectionTop=function(n){var a=n.listSelections()[0];n.setSelection(a.anchor,a.head,{scroll:!1})},B.selectLine=function(n){for(var a=n.listSelections(),h=[],d=0;dd?h.push(M,D):h.length&&(h[h.length-1]=D),d=D}n.operation(function(){for(var W=0;Wn.lastLine()?n.replaceRange(` +`+H,R(n.lastLine()),null,"+swapLine"):n.replaceRange(H+` +`,R(A,0),null,"+swapLine")}n.setSelections(S),n.scrollIntoView()})},B.swapLineDown=function(n){if(n.isReadOnly())return U.Pass;for(var a=n.listSelections(),h=[],d=n.lastLine()+1,S=a.length-1;S>=0;S--){var T=a[S],E=T.to().line+1,M=T.from().line;T.to().ch==0&&!T.empty()&&E--,E=0;D-=2){var W=h[D],I=h[D+1],A=n.getLine(W);W==n.lastLine()?n.replaceRange("",R(W-1),R(W),"+swapLine"):n.replaceRange("",R(W,0),R(W+1,0),"+swapLine"),n.replaceRange(A+` +`,R(I,0),null,"+swapLine")}n.scrollIntoView()})},B.toggleCommentIndented=function(n){n.toggleComment({indent:!0})},B.joinLines=function(n){for(var a=n.listSelections(),h=[],d=0;d=0;T--){var E=h[d[T]];if(!(M&&U.cmpPos(E.head,M)>0)){var D=y(n,E.head);M=D.from,n.replaceRange(a(D.word),D.from,D.to)}}})}B.smartBackspace=function(n){if(n.somethingSelected())return U.Pass;n.operation(function(){for(var a=n.listSelections(),h=n.getOption("indentUnit"),d=a.length-1;d>=0;d--){var S=a[d].head,T=n.getRange({line:S.line,ch:0},S),E=U.countColumn(T,null,n.getOption("tabSize")),M=n.findPosH(S,-1,"char",!1);if(T&&!/\S/.test(T)&&E%h==0){var D=new R(S.line,U.findColumn(T,E-h,h));D.ch!=S.ch&&(M=D)}n.replaceRange("",M,S,"+delete")}})},B.delLineRight=function(n){n.operation(function(){for(var a=n.listSelections(),h=a.length-1;h>=0;h--)n.replaceRange("",a[h].anchor,R(a[h].to().line),"+delete");n.scrollIntoView()})},B.upcaseAtCursor=function(n){w(n,function(a){return a.toUpperCase()})},B.downcaseAtCursor=function(n){w(n,function(a){return a.toLowerCase()})},B.setSublimeMark=function(n){n.state.sublimeMark&&n.state.sublimeMark.clear(),n.state.sublimeMark=n.setBookmark(n.getCursor())},B.selectToSublimeMark=function(n){var a=n.state.sublimeMark&&n.state.sublimeMark.find();a&&n.setSelection(n.getCursor(),a)},B.deleteToSublimeMark=function(n){var a=n.state.sublimeMark&&n.state.sublimeMark.find();if(a){var h=n.getCursor(),d=a;if(U.cmpPos(h,d)>0){var S=d;d=h,h=S}n.state.sublimeKilled=n.getRange(h,d),n.replaceRange("",h,d)}},B.swapWithSublimeMark=function(n){var a=n.state.sublimeMark&&n.state.sublimeMark.find();a&&(n.state.sublimeMark.clear(),n.state.sublimeMark=n.setBookmark(n.getCursor()),n.setCursor(a))},B.sublimeYank=function(n){n.state.sublimeKilled!=null&&n.replaceSelection(n.state.sublimeKilled,null,"paste")},B.showInCenter=function(n){var a=n.cursorCoords(null,"local");n.scrollTo(null,(a.top+a.bottom)/2-n.getScrollInfo().clientHeight/2)};function b(n){var a=n.getCursor("from"),h=n.getCursor("to");if(U.cmpPos(a,h)==0){var d=y(n,a);if(!d.word)return;a=d.from,h=d.to}return{from:a,to:h,query:n.getRange(a,h),word:d}}function c(n,a){var h=b(n);if(h){var d=h.query,S=n.getSearchCursor(d,a?h.to:h.from);(a?S.findNext():S.findPrevious())?n.setSelection(S.from(),S.to()):(S=n.getSearchCursor(d,a?R(n.firstLine(),0):n.clipPos(R(n.lastLine()))),(a?S.findNext():S.findPrevious())?n.setSelection(S.from(),S.to()):h.word&&n.setSelection(h.from,h.to))}}B.findUnder=function(n){c(n,!0)},B.findUnderPrevious=function(n){c(n,!1)},B.findAllUnder=function(n){var a=b(n);if(a){for(var h=n.getSearchCursor(a.query),d=[],S=-1;h.findNext();)d.push({anchor:h.from(),head:h.to()}),h.from().line<=a.from.line&&h.from().ch<=a.from.ch&&S++;n.setSelections(d,S)}};var o=U.keyMap;o.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},U.normalizeKeyMap(o.macSublime),o.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},U.normalizeKeyMap(o.pcSublime);var l=o.default==o.macDefault;o.sublime=l?o.macSublime:o.pcSublime})});var Fc=Nt((Ic,Hc)=>{(function(U){typeof Ic=="object"&&typeof Hc=="object"?U($t()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],U):U(CodeMirror)})(function(U){"use strict";function B(_){return new RegExp("^(("+_.join(")|(")+"))\\b")}var R=B(["and","or","not","is"]),f=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],k=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];U.registerHelper("hintWords","python",f.concat(k).concat(["exec","print"]));function m(_){return _.scopes[_.scopes.length-1]}U.defineMode("python",function(_,g){for(var x="error",C=g.delimiters||g.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,u=[g.singleOperators,g.doubleOperators,g.doubleDelimiters,g.tripleDelimiters,g.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],p=0;pG?M(F):te0&&W(H,F)&&(ce+=" "+x),ce}}return S(H,F)}function S(H,F,z){if(H.eatSpace())return null;if(!z&&H.match(/^#.*/))return"comment";if(H.match(/^[0-9\.]/,!1)){var G=!1;if(H.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(G=!0),H.match(/^[\d_]+\.\d*/)&&(G=!0),H.match(/^\.\d+/)&&(G=!0),G)return H.eat(/J/i),"number";var te=!1;if(H.match(/^0x[0-9a-f_]+/i)&&(te=!0),H.match(/^0b[01_]+/i)&&(te=!0),H.match(/^0o[0-7_]+/i)&&(te=!0),H.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(H.eat(/J/i),te=!0),H.match(/^0(?![\dx])/i)&&(te=!0),te)return H.eat(/L/i),"number"}if(H.match(n)){var ce=H.current().toLowerCase().indexOf("f")!==-1;return ce?(F.tokenize=T(H.current(),F.tokenize),F.tokenize(H,F)):(F.tokenize=E(H.current(),F.tokenize),F.tokenize(H,F))}for(var ee=0;ee=0;)H=H.substr(1);var z=H.length==1,G="string";function te(ee){return function(fe,_e){var q=S(fe,_e,!0);return q=="punctuation"&&(fe.current()=="{"?_e.tokenize=te(ee+1):fe.current()=="}"&&(ee>1?_e.tokenize=te(ee-1):_e.tokenize=ce)),q}}function ce(ee,fe){for(;!ee.eol();)if(ee.eatWhile(/[^'"\{\}\\]/),ee.eat("\\")){if(ee.next(),z&&ee.eol())return G}else{if(ee.match(H))return fe.tokenize=F,G;if(ee.match("{{"))return G;if(ee.match("{",!1))return fe.tokenize=te(0),ee.current()?G:fe.tokenize(ee,fe);if(ee.match("}}"))return G;if(ee.match("}"))return x;ee.eat(/['"]/)}if(z){if(g.singleLineStringErrors)return x;fe.tokenize=F}return G}return ce.isString=!0,ce}function E(H,F){for(;"rubf".indexOf(H.charAt(0).toLowerCase())>=0;)H=H.substr(1);var z=H.length==1,G="string";function te(ce,ee){for(;!ce.eol();)if(ce.eatWhile(/[^'"\\]/),ce.eat("\\")){if(ce.next(),z&&ce.eol())return G}else{if(ce.match(H))return ee.tokenize=F,G;ce.eat(/['"]/)}if(z){if(g.singleLineStringErrors)return x;ee.tokenize=F}return G}return te.isString=!0,te}function M(H){for(;m(H).type!="py";)H.scopes.pop();H.scopes.push({offset:m(H).offset+_.indentUnit,type:"py",align:null})}function D(H,F,z){var G=H.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:H.column()+1;F.scopes.push({offset:F.indent+w,type:z,align:G})}function W(H,F){for(var z=H.indentation();F.scopes.length>1&&m(F).offset>z;){if(m(F).type!="py")return!0;F.scopes.pop()}return m(F).offset!=z}function I(H,F){H.sol()&&(F.beginningOfLine=!0,F.dedent=!1);var z=F.tokenize(H,F),G=H.current();if(F.beginningOfLine&&G=="@")return H.match(l,!1)?"meta":o?"operator":x;if(/\S/.test(G)&&(F.beginningOfLine=!1),(z=="variable"||z=="builtin")&&F.lastToken=="meta"&&(z="meta"),(G=="pass"||G=="return")&&(F.dedent=!0),G=="lambda"&&(F.lambda=!0),G==":"&&!F.lambda&&m(F).type=="py"&&H.match(/^\s*(?:#|$)/,!1)&&M(F),G.length==1&&!/string|comment/.test(z)){var te="[({".indexOf(G);if(te!=-1&&D(H,F,"])}".slice(te,te+1)),te="])}".indexOf(G),te!=-1)if(m(F).type==G)F.indent=F.scopes.pop().offset-w;else return x}return F.dedent&&H.eol()&&m(F).type=="py"&&F.scopes.length>1&&F.scopes.pop(),z}var A={startState:function(H){return{tokenize:d,scopes:[{offset:H||0,type:"py",align:null}],indent:H||0,lastToken:null,lambda:!1,dedent:0}},token:function(H,F){var z=F.errorToken;z&&(F.errorToken=!1);var G=I(H,F);return G&&G!="comment"&&(F.lastToken=G=="keyword"||G=="punctuation"?H.current():G),G=="punctuation"&&(G=null),H.eol()&&F.lambda&&(F.lambda=!1),z?G+" "+x:G},indent:function(H,F){if(H.tokenize!=d)return H.tokenize.isString?U.Pass:0;var z=m(H),G=z.type==F.charAt(0)||z.type=="py"&&!H.dedent&&/^(else:|elif |except |finally:)/.test(F);return z.align!=null?z.align-(G?1:0):z.offset-(G?w:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:"#",fold:"indent"};return A}),U.defineMIME("text/x-python","python");var y=function(_){return _.split(" ")};U.defineMIME("text/x-cython",{name:"python",extra_keywords:y("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})});var Df=U=>U.reduce((B,R)=>B+String.fromCharCode(R),""),cn=Df;var Bf=U=>U.split("").map(B=>B.charCodeAt(0)),Il=Bf;var vs=class{name(){return"default"}codePointsToString(B){return cn(B)}stringToCodePoints(B){return Il(B)}matches(B){return this.matchesAsString(this.codePointsToString(B))}matchesAsString(B){return!0}decode(B){return this.decodeAsString(this.codePointsToString(B))}decodeAsString(B){return this.stringToCodePoints(B)}},Si=vs;var gs=class extends Si{name(){return"base64"}matchesAsString(B){if(B.length<8||/[^A-Za-z0-9+/=]/.test(B))return!1;try{return atob(B),!0}catch{return!1}}decodeAsString(B){return Array.from(atob(B)).map(R=>R.charCodeAt(0))}},Hl=gs;var Er=class{constructor(B,R,f,k=null,m=null,y=B){this.id=B;this.name=R;this.runner=f;this.url=k;this.args=m;this.highlighterRef=y}getId(){return this.id}getName(){return this.name}getURL(){return this.url}getArgs(){return this.args}getHighlighterRef(){return this.highlighterRef}run(B,R,f){return this.runner(B,R,f)}};var ys=kt(Wl(),1);var ms=class extends ys.default{constructor(){super(),this.on("message",B=>{if(B.type==="run")return this.init(B.code,B.input,B.args);if(B.type==="output")return this.emit("output",{output:B.output,error:B.error});if(B.type==="done")return this.emit("done",{exitCode:B.exitCode}),this.terminate();console.warn("Unhandled message",B)})}},_o=ms;var bs=class extends _o{constructor(B){super(),this.worker=new Worker(B),this.worker.addEventListener("error",R=>this.emit("error",R)),this.worker.addEventListener("message",({data:R})=>this.emit("message",R))}async init(B,R,f){this.postMessage({type:"run",code:B,args:f,input:R})}postMessage(B,R){return this.worker.postMessage(B,R)}terminate(){return this.worker.terminate()}},Nl=bs;import{init as Hf,Wasmer as Ff}from"https://unpkg.com/@wasmer/sdk@latest?module";var Ss=class extends _o{constructor(R,f="script",k){super();this.packageName=R;this.filename=f;this.spawnOptions=k}#e;#t;async init(R,f,k){await Hf();let m=window.setTimeout(()=>this.emit("toast",{message:"Downloading package from wasmer.io. This might take some time...",type:"info"}),1e3);this.#e=await Ff.fromRegistry(this.packageName),this.filename&&(k.includes("$filename")||(k+=(k.length>0?` +`:"")+"$filename"),k=k.replace("$filename",`/app/${this.filename}`));let y={args:k.split(` +`).map(C=>C!=="$code"?C:cn(R)),stdin:f,...this.spawnOptions,mount:{...this.spawnOptions?.mount,"/app":{...this.spawnOptions?.mount&&"/app"in this.spawnOptions?.mount?this.spawnOptions?.mount["/app"]:{},...this.filename?{[this.filename]:new Uint8Array(R)}:{}}}};window.clearTimeout(m),this.#t=await this.#e.entrypoint.run(y);let{code:_,stderr:g,stdout:x}=await this.#t.wait();x.split("").forEach(C=>this.emit("output",{output:C})),g.split("").forEach(C=>this.emit("output",{error:C})),this.emit("done",{code:_})}terminate(){}},yo=Ss;var Cs=class{constructor(){this.data={}}register(...B){B.forEach(R=>{this.data[R.getId()]=R})}get(B){return this.data[B]}all(){return Object.keys(this.data)}async run(B,R,f,k){return await this.data[B].run(R,k,f)}},mo=U=>async(B,R,f)=>{let k=new Nl(U);return k.init(B,R,f),k},bo=(U,B="script",R)=>async(f,k,m)=>{let y=new yo(U,B,R);return y.init(f,k,m),y},Yr=new Cs;var gh=kt(Ul()),xs=class extends Er{constructor(){super("bash-wasmer","Bash (wasmer)",bo("sharrattj/bash","script.sh"),"https://www.gnu.org/software/bash/",[],"shell")}},ql=xs;var ks=class extends Si{name(){return"hexdump"}matchesAsString(B){return/^([0-9a-f]{7}(( ([0-9a-f]{4})){1,8}) *\n)+[0-9a-f]{7}\n?$/.test(B)}decodeAsString(B){return B.trim().replace(/\n[0-9a-f]{7}\n?$/,"").replace(/(?<=^|\n)[0-9a-f]{7}(( ([0-9a-f]{4})){1,8}) */g,"$1").replace(/\s+/g,"").replace(/(..)(..)/g,"$2$1").replace(/00$/,"").match(/../g).map(R=>parseInt(R,16))}},Kl=ks;var Ch=kt(Es()),Ts=class extends Er{constructor(){super("javascript-browser","JavaScript (Browser)",mo("dist/js/langs/javascript-browser/worker.js"),"https://www.ecma-international.org/publications-and-standards/standards/ecma-262/",null,"javascript")}},Xl=Ts;var kh=kt($l()),As=class extends Er{constructor(){super("ruby-wasmer","Ruby (wasmer)",bo("katei/ruby","script.rb"),"https://www.ruby-lang.org/",[],"ruby")}},Jl=As;var Mh=kt(Ms()),Rs=class extends Er{constructor(){super("webperl-5.28.1","Perl 5.28.1 (webperl)",mo("dist/js/langs/webperl-5.28.1/worker.js"),"https://www.perl.org/",["-M5.10.0","-F","-l","-p"],"perl")}},tc=Rs;var Dc=kt($t()),Bc=kt(oc());var Os=class{constructor(...B){this.buffer="";this.prepend="";this.registered=[];this.register(...B)}activate(B){this.registered.reduce((R,f)=>f.matches(B)&&!R?(f.isActive()||(f.activate(B),f.reset(),f.write(this.prepend+this.buffer)),!0):(f.deactivate(),f.reset(),R),!1),this.resize()}refresh(){this.registered.forEach(B=>{this.registered.filter(R=>R.isActive()).forEach(R=>{R.reset(),R.write(this.prepend+this.buffer)})})}register(...B){this.registered.push(...B)}reset(){this.buffer="",this.registered.forEach(B=>{B.reset(),this.prepend&&B.write(this.prepend)})}resize(){this.registered.forEach(B=>{B.isActive()&&B.resize()})}setPrepend(B){this.prepend=B,this.refresh()}write(B){typeof B=="number"&&(B=String.fromCharCode(B)),this.buffer+=B,this.registered.filter(R=>R.isActive()).forEach(R=>R.write(B))}};var Ds=(...U)=>new Os(...U);var ac=kt($t());var Bs=class{constructor(){this.active=!1;this.inputs=null}activate(B){this.container.removeAttribute("hidden"),this.active=!0,this.inputs=B,this.resize()}createElement(B="div"){return this.container=document.createElement(B),this.container.setAttribute("hidden",""),this.container}deactivate(){this.container.setAttribute("hidden",""),this.active=!1}isActive(){return this.active}read(){return this.readAsString(null).split("").map(B=>B.charCodeAt(0))}resize(){}},sc=Bs;var Nf=(U,B=".")=>U.replace(/[^\x09\x0a\x20-\x7e]/g,B),Co=Nf;var Ps=class extends sc{constructor(B,R={}){super();let f=this.createElement("div"),k=document.createElement("textarea");B.append(f),f.append(k),this.editor=(0,ac.fromTextArea)(k,{mode:null,theme:"monokai",viewportMargin:1/0,...R,extraKeys:{"Ctrl-D":"duplicateLine","Ctrl-/":"toggleComment","Shift-Tab":!1,Tab:!1,...Object.keys(R.extraKeys||{}).length?R.extraKeys:{}}}),this.editor.on("change",()=>{this.inputs!==null&&this.inputs.setBuffer(this.editor.getValue().split("").map(m=>m.charCodeAt(0)))})}matches(B){return/^[\t\n -~]*$/.test(B)}on(B,R){this.editor.on(B,(...f)=>R(...f))}readAsString(B="."){let R=unescape(encodeURIComponent(this.editor.getValue()));return B===null?R:Co(R,B)}reset(){this.editor.setValue("")}setOption(B,R){this.editor.setOption(B,R)}setType(B){this.editor.getOption("mode")!==B&&(this.editor.setOption("mode",B),this.editor.setValue(this.editor.getValue()))}write(B){Array.isArray(B)&&(B=B.map(R=>String.fromCharCode(R)).join("")),this.editor.setValue(B)}},Ii=Ps;var Is=class{constructor(){this.active=!1;this.mimeType="text/plain"}activate(B){this.container.removeAttribute("hidden"),this.active=!0,this.mimeType=B,this.resize()}createElement(B="div",R=!0){let f=document.createElement(B);return R&&f.setAttribute("hidden",""),f}deactivate(){this.container.setAttribute("hidden",""),this.active=!1}isActive(){return this.active}matches(B){return!0}resize(){}},un=Is;var Gh=kt(Es()),Zh=kt(Ms()),Hs=class extends un{constructor(B,R={}){super();let f=document.createElement("textarea");this.container=this.createElement("div"),this.container.append(f),B.append(this.container),this.editor=wo.createEditor(f,{...R,readOnly:!0}),B.append(this.container)}activate(B){super.activate(B),this.editor.setOption("mode",B)}deactivate(){super.deactivate()}matches(B){return["application/ecmascript","application/javascript","application/json","application/x-perl","text/ecmascript","text/javascript","text/json","text/x-perl"].includes(B)}reset(){this.editor.setValue("")}write(B){typeof B=="number"&&(B=String.fromCharCode(B)),this.editor.setValue(this.editor.getValue()+B)}},lc=Hs;var Fs=class extends un{constructor(R){super();this.buffer="";this.mimeType="text/html";this.container=this.createElement("iframe"),R.append(this.container),this.update()}activate(R){super.activate(R),this.update()}matches(R){return["text/html"].includes(R)}reset(){this.buffer="",this.update()}write(R){typeof R=="number"&&(R=String.fromCharCode(R)),this.buffer+=R,this.update()}update(){let R=this.createElement("iframe",this.container.hasAttribute("hidden"));R.src=`data:${this.mimeType};base64,${btoa(this.buffer)}`,this.container.replaceWith(R),this.container=R}},Lo=Fs;var Ws=class{constructor(){this.registered=[]}register(...B){this.registered.push(...B)}decode(B){return this.decoder(B).decode(B)}decodeAsString(B){return this.decoderAsString(B).decodeAsString(B)}decoder(B){let[R]=this.registered.filter(f=>f.matches(B));return R}decoderAsString(B){let[R]=this.registered.filter(f=>f.matchesAsString(B));return R}};var si=new Ws;var Ns=class{constructor(B,R){this.stdin=B;this.args=R}getArgs(){return this.args.getValue()}setArgs(B){this.args.setValue(B)}argsRefresh(){this.args.refresh()}getStdin(){return si.decodeAsString(this.stdin.getValue()).reduce((B,R)=>B+String.fromCharCode(R),"")}setStdin(B){this.stdin.setValue(B)}},cc=Ns;var js=class{constructor(){this.options={}}get(B,R=null){return this.options[B]??R}set(B,R){this.options[B]=R}},Hi=new js;var zs=class extends Lo{constructor(){super(...arguments);this.imageBuffer="";this.imageMimeType="image/png";this.zoomLevel=1}activate(R){this.zoomLevel=Hi.get("zoomLevel",1),super.activate("text/html"),this.imageMimeType=R}css(){return` html, body { margin: 0; padding: 0; @@ -105,7 +107,7 @@ body > img { } `.replace(/\s*,\s*/g,",").replace(/\s*>\s*/g,">").replace(/\s*;\s*}\s*/g,"}").replace(/\s*{\s*/g,"{").replace(/\s*:\s*/g,":").replace(/\s*;\s*/g,";")}data(){return` - +
@@ -164,19 +166,21 @@ body > img { storeOption('transparencyCheckerboard', image.classList.contains('checked')); } }); - `}matches(D){return["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/vnd.microsoft.icon","image/webp"].includes(D)}reset(){super.reset(),this.imageBuffer=""}write(D){typeof D=="number"&&(D=String.fromCharCode(D)),this.imageBuffer+=D,this.buffer="",super.write(this.data())}},yo=Ts;var As=class{constructor(...H){this.buffer=[];this.registered=[];this.register(...H)}active(){let[H]=this.registered.filter(D=>D.isActive());return H}activate(H){this.registered.reduce((D,f)=>!D&&(typeof H=="function"&&f instanceof H||f===H)?(f.isActive()||(f.activate(this),f.reset(),f.write(this.buffer)),!0):(f.deactivate(),f.reset(),D),!1),this.resize()}on(H,D){this.registered.forEach(f=>f.on(H,D))}read(){return this.active().read()}readAsString(H="."){return this.active().readAsString(H)}register(...H){this.registered.push(...H)}reset(){this.buffer.splice(0),this.registered.forEach(H=>H.reset())}resize(){this.registered.forEach(H=>{H.isActive()&&H.resize()})}setBuffer(H){this.buffer.push(...H)}setType(H){this.type=H,this.registered.forEach(D=>D.setType(H))}write(H){let D=[];typeof H=="number"&&D.push(H),Array.isArray(H)&&H.forEach(f=>D.push(f)),typeof H=="string"&&H.split("").forEach(f=>D.push(f.charCodeAt(0))),this.registered.filter(f=>{f.isActive()&&f.write(D)}),D.forEach(f=>this.buffer.push(f))}},mo=As;var Ms=class extends TypeError{},Pi=Ms;var Rs=class extends yo{constructor(){super(...arguments);this.ppmBuffer="";this.superTimeout=null}activate(D){super.activate("image/png")}matches(D){return["image/x-portable-bitmap","image/x-portable-graymap","image/x-portable-pixmap","image/x-portable-anymap"].includes(D)}reset(){super.reset(),this.ppmBuffer=""}write(D){typeof D=="number"&&(D=String.fromCharCode(D)),this.ppmBuffer+=D,!(this.ppmBuffer.length<10)&&(this.superTimeout&&clearTimeout(this.superTimeout),this.superTimeout=window.setTimeout(()=>{try{super.reset(),super.write(this.convertToPNG())}catch(f){console.error(f)}},50))}convertToPNG(){if(!/^P[1-7]/.test(this.ppmBuffer))throw new Pi;let D=this.extractPBMHeader();if(!D)throw new Pi;let[f]=D;if(!f)throw new Pi;if(f==="P1"){let[,E,m,y]=D;return this.parseP1(E,m,y)}if(f==="P2"){let[,E,m,y,_]=D;return this.parseP2(E,m,y,_)}if(f==="P3"){let[,E,m,y,_]=D;return this.parseP3(E,m,y,_)}if(f==="P4"){let[,E,m,y]=D;return this.parseP4(E,m,y)}if(f==="P5"){let[,E,m,y,_]=D;return this.parseP2(E,m,y,_,!0)}if(f==="P6"){let[,E,m,y,_]=D;return this.parseP3(E,m,y,_,!0)}throw new Pi("Currently unsupported.")}createCanvas(D,f){let E=document.createElement("canvas"),m=E.getContext("2d"),y=new ImageData(D,f);return E.width=D,E.height=f,[E,m,y]}canvasToRawPNG(D){return atob(D.toDataURL("image/png").replace(/^data:image\/png;base64,/,""))}parseP1(D,f,E){let[m,y,_]=this.createCanvas(D,f),g=this.asciiDataGenerator(E,!1);for(let k=0;k0&&(yield parseInt(E,10),E=""),/\d/.test(_)&&(E+=_),f===!1&&E&&(yield parseInt(E,10),E=""))}yield parseInt(E,10)}*binaryDataGenerator(D){let f="";for(let E=D;EparseInt(C||"1",10)):[parseInt(g,10),1];break}return D>=_&&(D=_),E=Math.max(D,E),m=Math.max(f,m),[D,f,E,m]}switch(y){case` -`:f++,D=0;break;case"\f":case"\r":case"\v":f++;break;case" ":D+=D%8||8;break;case"\b":D--;break;default:D++}return D>=_&&(f++,D=0),E=Math.max(D,E),m=Math.max(f,m),[D,f,E,m]}reprocessBufferForSize(){let D=0,f=0,E=0,m=0,y="",_=this.buffer.match(/\x1b\[(.*?)([\x40-\x7e])|(.)/g);return _?(_.forEach(g=>{[g,y]=this.processInputForEscape(g,y),g&&([E,m,D,f]=this.processInputForSize(E,m,D,f,g))}),[D+1,f+1]):[1,1]}reset(){this.buffer="",this.escapeInput="",this.maxX=0,this.maxY=0,this.x=0,this.y=0,this.terminal.reset()}resize(){if(this.container.hasAttribute("hidden")||this.options.cols&&this.options.rows)return;let[,D]=this.reprocessBufferForSize(),f=this.fit.proposeDimensions();this.terminal.resize(this.options.cols??f?.cols??this.terminal.cols,this.options.rows??D)}write(D){typeof D=="number"&&(D=String.fromCharCode(D)),this.buffer+=D,this.handleInputForSize(D);let f=this.maxY+1;f!==this.terminal.rows&&this.terminal.resize(this.terminal.cols,f),this.terminal.write(G.cleanText(D))}},Bs=Ds;var Mh=ir(zl()),Rh=ir(Gl()),Oh=ir(Yl()),Dh=ir(Jl()),Bh=ir(Ps()),Ph=ir(sc()),Is=class G{constructor(){this.mimeType="text/plain";this.langSelector=document.querySelector('select[name="lang"]'),this.addRegisteredLangs();let H=document.querySelector("div.stdout");this.codeHeader=new mo(new Di(document.querySelector("div.header"),{autoCloseBrackets:!0,matchBrackets:!0,placeholder:"Header..."})),this.codeHeader.activate(Di),this.code=new mo(new Di(document.querySelector("div.code"),{autoCloseBrackets:!0,autofocus:!0,matchBrackets:!0,placeholder:"Code..."})),this.code.activate(Di),this.code.setType(this.langSelector.value),this.langSelector.addEventListener("change",()=>this.code.setType(this.langSelector.value)),this.codeFooter=new mo(new Di(document.querySelector("div.footer"),{autoCloseBrackets:!0,autofocus:!0,matchBrackets:!0,placeholder:"Footer..."})),this.codeFooter.activate(Di),this.stdout=ms(new Il(H),new Fl(H),new yo(H),new _o(H),new Bs(H)),this.stdout.activate("text/plain"),this.stderr=ms(new Bs(document.querySelector("div.stderr"),{rows:8})),this.stderr.setPrepend("\x1B[31m"),this.stderr.activate("text/plain"),this.stdin=G.createEditor(document.querySelector('textarea[name="input"]')),this.args=G.createEditor(document.querySelector('textarea[name="args"]')),this.io=new Hl(this.stdin,this.args),this.expanders=document.querySelectorAll('button[name="expand"]'),this.argsWrapper=document.querySelector(".args-wrapper"),this.addArg=document.querySelector(".args-wrapper .actions"),this.runButton=document.querySelector('button[name="run"]'),this.stopButton=document.querySelector('button[name="stop"]'),this.bytesCount=document.querySelector(".bytes .byte-count"),this.bytesPlural=document.querySelector(".bytes .plural"),this.encoded=document.querySelector(".encoded"),this.format=document.querySelector(".format"),this.copyLinkButton=document.querySelector('button[name="copy"]'),this.markdownButton=document.querySelector('button[name="markdown"]'),this.mimeTypeInput=document.querySelector(".stdout-header input"),this.connectExpanders(),this.code.on("change",()=>this.codeOnChange()),this.runButton.addEventListener("click",()=>this.runCode()),this.langSelector.addEventListener("change",()=>this.populateArgs()),this.copyLinkButton.addEventListener("click",()=>{let f=this.buildLink();location.href!==f&&history.pushState(this.buildHashData(),document.title,f),navigator.clipboard.writeText(f),G.copied(this.copyLinkButton)}),this.markdownButton.addEventListener("click",()=>{navigator.clipboard.writeText(this.buildMarkdown()),G.copied(this.markdownButton)}),this.mimeTypeInput.addEventListener("change",()=>this.setMimeType(this.mimeTypeInput.value||"text/plain",!1)),this.mimeTypeInput.addEventListener("keypress",({key:f})=>{f==="Enter"&&this.mimeType!==this.mimeTypeInput.value&&this.setMimeType(this.mimeTypeInput.value||"text/plain",!1)}),addEventListener("keydown",f=>{if(f.key==="s"&&(f.ctrlKey||f.metaKey)){let E=this.buildLink();history.pushState(this.buildHashData(),document.title,E),navigator.clipboard.writeText(E),this.toast("Saved!","success",{hide:2}),f.preventDefault()}}),addEventListener("hashchange",()=>{this.parseHashData(location.hash),this.code.read().length&&this.runCode()}),addEventListener("resize",()=>this.resize()),addEventListener("message",({data:{name:f,value:E}})=>{f==="setOption"&&Bi.set(E.name,E.value)});let D=window.localStorage.getItem("lastUsedLanguage");D&&this.setLang(D),this.parseHashData(location.hash);try{this.populateArgs()}catch(f){this.toast(f.message,"error")}this.codeOnChange(),this.code.read().length&&this.runCode(),this.resize(),document.querySelector("button.fullscreen-toggle").addEventListener("click",()=>this.enterFullscreen()),document.addEventListener("fullscreenchange",()=>this.exitFullscreen())}addRegisteredLangs(){Gr.all().forEach(H=>{let D=Gr.get(H),f=document.createElement("option");f.setAttribute("value",D.getId()),f.append(document.createTextNode(D.getName())),this.langSelector.append(f)})}setLang(H){if(!Gr.all().includes(H))throw new TypeError(`Unknown lang: ${H}.`);this.langSelector.value=H,this.setCodeHighlight()}getLangId(){return this.langSelector.value}setCodeHighlight(){let H=Gr.get(this.getLangId());[this.codeHeader,this.code,this.codeFooter].forEach(D=>{if(ii.decoderAsString(D.readAsString(null)).name()!=="default"){D.setType(null);return}D.setType(H.getHighlighterRef())})}static createEditor(H,D={}){return(0,ac.fromTextArea)(H,{mode:null,theme:"monokai",viewportMargin:1/0,...D,extraKeys:{"Ctrl-D":"duplicateLine","Ctrl-/":"toggleComment","Shift-Tab":!1,Tab:!1,...D.extraKeys||{}}})}resize(){this.stdout.resize(),this.stderr.resize()}codeOnChange(){let H=this.code.read();this.encoded.setAttribute("hidden",""),this.setCodeHighlight();let D=ii.decoder(H);D.name()!=="default"&&(this.encoded.removeAttribute("hidden"),this.format.innerText=D.name());let f=D.decode(H);this.showBytes(f.length)}runCode(){let H=Date.now(),D=()=>{f.terminate(),this.stderr.write(`Aborted execution after ${Date.now()-H}ms`),this.runButton.removeAttribute("disabled"),this.stopButton.setAttribute("disabled",""),this.stopButton.removeEventListener("click",D)};this.stdout.reset(),this.stderr.reset(),this.runButton.setAttribute("disabled",""),this.stopButton.removeAttribute("disabled");let f=Gr.run(this.getLangId(),[].concat([this.codeHeader.read(),this.code.read(),this.codeFooter.read()].flatMap(E=>ii.decode(E))),this.io.getArgs(),this.io.getStdin());this.stopButton.addEventListener("click",D),f.onmessage=({data:E})=>{let{type:m,output:y,error:_}=E;y&&this.stdout.write(y),_&&this.stderr.write(_??""),m==="done"&&(this.stderr.write(`Completed execution after ${Date.now()-H}ms`),this.runButton.removeAttribute("disabled"),this.stopButton.setAttribute("disabled",""),this.stopButton.removeEventListener("click",D),f.terminate())},f.onerror=E=>{this.toast(`Worker error: ${E.message}`,"error"),this.runButton.removeAttribute("disabled"),this.stopButton.setAttribute("disabled","")}}populateArgs(){for(;this.addArg.firstElementChild;)this.addArg.firstElementChild.remove();let H=Gr.get(this.getLangId());if(!H)throw new TypeError("Unregistered lang: "+this.getLangId());window.localStorage.setItem("lastUsedLanguage",H.getId());let D=H.getArgs();D!==null?(this.argsWrapper.removeAttribute("hidden"),D.forEach(f=>{let E=document.createElement("button");E.append(document.createTextNode(f)),E.addEventListener("click",()=>{let m=this.io.getArgs()??"";new RegExp("(\\n|^)"+f+"(\\n|$)").test(m)||this.io.setArgs((m+` -`+f).trim())}),this.addArg.append(E)})):this.argsWrapper.setAttribute("hidden",""),this.io.argsRefresh()}static expand(H){let D=H.nextElementSibling,f=document.querySelector(H.dataset.target);if(!f){console.debug("No collapser or target for expander: ",H);return}H.setAttribute("hidden",""),f.removeAttribute("hidden"),D.removeAttribute("hidden"),D.focus()}static collapse(H){let D=H.nextElementSibling,f=document.querySelector(H.dataset.target);if(!f){console.debug("No collapser or target for expander: ",H);return}H.removeAttribute("hidden"),f.setAttribute("hidden",""),D.setAttribute("hidden",""),H.focus()}connectExpanders(){this.expanders.forEach(H=>{let D=H.nextElementSibling;if(!D||!D.matches('button[name="collapse"]')){console.debug("No collapser or target for expander: ",H);return}H.addEventListener("click",()=>G.expand(H)),D.addEventListener("click",()=>G.collapse(H))})}setMimeType(H,D=!0){this.mimeType=H,D&&(this.mimeTypeInput.value=H),this.stdout.activate(H),this.stdout.resize()}static copied(H){H.setAttribute("disabled",""),H.style.width=H.offsetWidth+"px",H.classList.toggle("copied"),setTimeout(()=>{H.removeAttribute("disabled"),H.style.width=null,H.classList.toggle("copied")},1e3)}parseHashData(H){if(!H||H.length<2)return;let D;try{let m=atob(H.slice(1));D=JSON.parse(m)}catch(m){if(m instanceof DOMException){this.toast("Unable to decode URL data. Aborting.","error");return}if(m instanceof SyntaxError){this.toast("Unable to decode JSON data. Aborting.","error");return}throw m}let[f]=Array.from(this.expanders).filter(m=>m.parentElement.matches(".code-header")),[E]=Array.from(this.expanders).filter(m=>m.parentElement.matches(".code-footer"));D.header&&G.expand(f),D.footer&&G.expand(E),D.options&&Object.entries(D.options).forEach(([m,y])=>Bi.set(m,y)),this.setLang(D.lang??this.getLangId()),this.codeHeader.write(decodeURIComponent(escape(D.header??""))),this.code.write(decodeURIComponent(escape(D.code??""))),this.codeFooter.write(decodeURIComponent(escape(D.footer??""))),this.io.setArgs(D.args??""),this.io.setStdin(decodeURIComponent(escape(D.input??""))),D.mime&&this.setMimeType(D.mime)}buildHashData(){let H={lang:this.getLangId(),code:this.code.readAsString(null)},D=this.codeHeader.readAsString(null),f=this.codeFooter.readAsString(null),E=this.io.getArgs(),m=this.io.getStdin(),y=this.mimeType,_=Bi.options;return Object.entries({header:D,footer:f,args:E,input:m}).forEach(([g,k])=>{k&&(H[g]=k)}),JSON.stringify(_)!=="{}"&&(H.options=_),y!=="text/plain"&&(H.mime=y),btoa(JSON.stringify(H))}buildLink(){let H=this.buildHashData();return location.protocol+"//"+location.host+location.pathname+"#"+H}buildMarkdown(){let H=this.io.getArgs().trim().split(/\n/).join(" "),D=Gr.get(this.getLangId()),f=Math.random().toString(36).slice(2,10),E=ii.decode(this.code.read()),m=vo(fo(E)),y=m.length;return`# [${D.getName()}]${H?` + \`${H}\``:""}, ${y} byte${y===1?"":"s"} + `}matches(R){return["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/vnd.microsoft.icon","image/webp"].includes(R)}reset(){super.reset(),this.imageBuffer=""}write(R){typeof R=="number"&&(R=String.fromCharCode(R)),this.imageBuffer+=R,this.buffer="",super.write(this.data())}},xo=zs;var Us=class{constructor(...B){this.buffer=[];this.registered=[];this.register(...B)}active(){let[B]=this.registered.filter(R=>R.isActive());return B}activate(B){this.registered.reduce((R,f)=>!R&&(typeof B=="function"&&f instanceof B||f===B)?(f.isActive()||(f.activate(this),f.reset(),f.write(this.buffer)),!0):(f.deactivate(),f.reset(),R),!1),this.resize()}on(B,R){this.registered.forEach(f=>f.on(B,R))}read(){return this.active().read()}readAsString(B="."){return this.active().readAsString(B)}register(...B){this.registered.push(...B)}reset(){this.buffer.splice(0),this.registered.forEach(B=>B.reset())}resize(){this.registered.forEach(B=>{B.isActive()&&B.resize()})}setBuffer(B){this.buffer.push(...B)}setType(B){this.type=B,this.registered.forEach(R=>R.setType(B))}write(B){let R=[];typeof B=="number"&&R.push(B),Array.isArray(B)&&B.forEach(f=>R.push(f)),typeof B=="string"&&B.split("").forEach(f=>R.push(f.charCodeAt(0))),this.registered.filter(f=>{f.isActive()&&f.write(R)}),R.forEach(f=>this.buffer.push(f))}},ko=Us;var qs=class extends TypeError{},Fi=qs;var Ks=class extends xo{constructor(){super(...arguments);this.ppmBuffer="";this.superTimeout=null}activate(R){super.activate("image/png")}matches(R){return["image/x-portable-bitmap","image/x-portable-graymap","image/x-portable-pixmap","image/x-portable-anymap"].includes(R)}reset(){super.reset(),this.ppmBuffer=""}write(R){typeof R=="number"&&(R=String.fromCharCode(R)),this.ppmBuffer+=R,!(this.ppmBuffer.length<10)&&(this.superTimeout&&clearTimeout(this.superTimeout),this.superTimeout=window.setTimeout(()=>{try{super.reset(),super.write(this.convertToPNG())}catch(f){console.error(f)}},50))}convertToPNG(){if(!/^P[1-7]/.test(this.ppmBuffer))throw new Fi;let R=this.extractPBMHeader();if(!R)throw new Fi;let[f]=R;if(!f)throw new Fi;if(f==="P1"){let[,k,m,y]=R;return this.parseP1(k,m,y)}if(f==="P2"){let[,k,m,y,_]=R;return this.parseP2(k,m,y,_)}if(f==="P3"){let[,k,m,y,_]=R;return this.parseP3(k,m,y,_)}if(f==="P4"){let[,k,m,y]=R;return this.parseP4(k,m,y)}if(f==="P5"){let[,k,m,y,_]=R;return this.parseP2(k,m,y,_,!0)}if(f==="P6"){let[,k,m,y,_]=R;return this.parseP3(k,m,y,_,!0)}throw new Fi("Currently unsupported.")}createCanvas(R,f){let k=document.createElement("canvas"),m=k.getContext("2d"),y=new ImageData(R,f);return k.width=R,k.height=f,[k,m,y]}canvasToRawPNG(R){return atob(R.toDataURL("image/png").replace(/^data:image\/png;base64,/,""))}parseP1(R,f,k){let[m,y,_]=this.createCanvas(R,f),g=this.asciiDataGenerator(k,!1);for(let x=0;x0&&(yield parseInt(k,10),k=""),/\d/.test(_)&&(k+=_),f===!1&&k&&(yield parseInt(k,10),k=""))}yield parseInt(k,10)}*binaryDataGenerator(R){let f="";for(let k=R;kparseInt(C||"1",10)):[parseInt(g,10),1];break}return R>=_&&(R=_),k=Math.max(R,k),m=Math.max(f,m),[R,f,k,m]}switch(y){case` +`:f++,R=0;break;case"\f":case"\r":case"\v":f++;break;case" ":R+=R%8||8;break;case"\b":R--;break;default:R++}return R>=_&&(f++,R=0),k=Math.max(R,k),m=Math.max(f,m),[R,f,k,m]}reprocessBufferForSize(){let R=0,f=0,k=0,m=0,y="",_=this.buffer.match(/\x1b\[(.*?)([\x40-\x7e])|(.)/g);return _?(_.forEach(g=>{[g,y]=this.processInputForEscape(g,y),g&&([k,m,R,f]=this.processInputForSize(k,m,R,f,g))}),[R+1,f+1]):[1,1]}reset(){this.buffer="",this.escapeInput="",this.maxX=0,this.maxY=0,this.x=0,this.y=0,this.terminal.reset()}resize(){if(this.container.hasAttribute("hidden")||this.options.cols&&this.options.rows)return;let[,R]=this.reprocessBufferForSize(),f=this.fit.proposeDimensions();this.terminal.resize(this.options.cols??f?.cols??this.terminal.cols,this.options.rows??R)}write(R){typeof R=="number"&&(R=String.fromCharCode(R)),this.buffer+=R,this.handleInputForSize(R);let f=this.maxY+1;f!==this.terminal.rows&&this.terminal.resize(this.terminal.cols,f),this.terminal.write(U.cleanText(R))}},Xs=Zs;var Dd=kt(vc()),Bd=kt(yc()),Pd=kt(Sc()),Id=kt(Lc()),Hd=kt(Ys()),Fd=kt(Oc()),Vs=class U{constructor(){this.mimeType="text/plain";this.langSelector=document.querySelector('select[name="lang"]'),this.addRegisteredLangs();let B=document.querySelector("div.stdout");this.codeHeader=new ko(new Ii(document.querySelector("div.header"),{autoCloseBrackets:!0,matchBrackets:!0,placeholder:"Header..."})),this.codeHeader.activate(Ii),this.code=new ko(new Ii(document.querySelector("div.code"),{autoCloseBrackets:!0,autofocus:!0,matchBrackets:!0,placeholder:"Code..."})),this.code.activate(Ii),this.code.setType(this.langSelector.value),this.langSelector.addEventListener("change",()=>this.code.setType(this.langSelector.value)),this.codeFooter=new ko(new Ii(document.querySelector("div.footer"),{autoCloseBrackets:!0,autofocus:!0,matchBrackets:!0,placeholder:"Footer..."})),this.codeFooter.activate(Ii),this.stdout=Ds(new lc(B),new uc(B),new xo(B),new Lo(B),new Xs(B)),this.stdout.activate("text/plain"),this.stderr=Ds(new Xs(document.querySelector("div.stderr"))),this.stderr.setPrepend("\x1B[31m"),this.stderr.activate("text/plain"),this.stdin=U.createEditor(document.querySelector('textarea[name="input"]')),this.args=U.createEditor(document.querySelector('textarea[name="args"]')),this.io=new cc(this.stdin,this.args),this.expanders=document.querySelectorAll('button[name="expand"]'),this.argsWrapper=document.querySelector(".args-wrapper"),this.addArg=document.querySelector(".args-wrapper .actions"),this.runButton=document.querySelector('button[name="run"]'),this.stopButton=document.querySelector('button[name="stop"]'),this.bytesCount=document.querySelector(".bytes .byte-count"),this.bytesPlural=document.querySelector(".bytes .plural"),this.encoded=document.querySelector(".encoded"),this.format=document.querySelector(".format"),this.copyLinkButton=document.querySelector('button[name="copy"]'),this.markdownButton=document.querySelector('button[name="markdown"]'),this.mimeTypeInput=document.querySelector(".stdout-header input"),this.connectExpanders(),this.code.on("change",()=>this.codeOnChange()),this.runButton.addEventListener("click",()=>this.runCode()),this.langSelector.addEventListener("change",()=>this.populateArgs()),this.copyLinkButton.addEventListener("click",()=>{let f=this.buildLink();location.href!==f&&history.pushState(this.buildHashData(),document.title,f),navigator.clipboard.writeText(f),U.copied(this.copyLinkButton)}),this.markdownButton.addEventListener("click",()=>{navigator.clipboard.writeText(this.buildMarkdown()),U.copied(this.markdownButton)}),this.mimeTypeInput.addEventListener("change",()=>this.setMimeType(this.mimeTypeInput.value||"text/plain",!1)),this.mimeTypeInput.addEventListener("keypress",({key:f})=>{f==="Enter"&&this.mimeType!==this.mimeTypeInput.value&&this.setMimeType(this.mimeTypeInput.value||"text/plain",!1)}),addEventListener("keydown",f=>{if(f.key==="s"&&(f.ctrlKey||f.metaKey)){let k=this.buildLink();history.pushState(this.buildHashData(),document.title,k),navigator.clipboard.writeText(k),this.toast("Saved!","success",{hide:2}),f.preventDefault()}}),addEventListener("hashchange",()=>{this.parseHashData(location.hash),this.code.read().length&&this.runCode()}),addEventListener("resize",()=>this.resize()),addEventListener("message",({data:{name:f,value:k}})=>{f==="setOption"&&Hi.set(k.name,k.value)});let R=window.localStorage.getItem("lastUsedLanguage");R&&this.setLang(R),this.parseHashData(location.hash);try{this.populateArgs()}catch(f){this.toast(f.message,"error")}this.codeOnChange(),this.code.read().length&&this.runCode(),this.resize(),document.querySelector("button.fullscreen-toggle").addEventListener("click",()=>this.enterFullscreen()),document.addEventListener("fullscreenchange",()=>this.exitFullscreen())}addRegisteredLangs(){Yr.all().forEach(B=>{let R=Yr.get(B),f=document.createElement("option");f.setAttribute("value",R.getId()),f.append(document.createTextNode(R.getName())),this.langSelector.append(f)})}setLang(B){if(!Yr.all().includes(B))throw new TypeError(`Unknown lang: ${B}.`);this.langSelector.value=B,this.setCodeHighlight()}getLangId(){return this.langSelector.value}setCodeHighlight(){let B=Yr.get(this.getLangId());[this.codeHeader,this.code,this.codeFooter].forEach(R=>{if(si.decoderAsString(R.readAsString(null)).name()!=="default"){R.setType(null);return}R.setType(B.getHighlighterRef())})}static createEditor(B,R={}){return(0,Dc.fromTextArea)(B,{mode:null,theme:"monokai",viewportMargin:1/0,...R,extraKeys:{"Ctrl-D":"duplicateLine","Ctrl-/":"toggleComment","Shift-Tab":!1,Tab:!1,...R.extraKeys||{}}})}resize(){this.stdout.resize(),this.stderr.resize()}codeOnChange(){let B=this.code.read();this.encoded.setAttribute("hidden",""),this.setCodeHighlight();let R=si.decoder(B);R.name()!=="default"&&(this.encoded.removeAttribute("hidden"),this.format.innerText=R.name());let f=R.decode(B);this.showBytes(f.length)}runCode(){let B=Date.now();this.stdout.reset(),this.stderr.reset(),this.runButton.setAttribute("disabled",""),this.stopButton.removeAttribute("disabled"),Yr.run(this.getLangId(),[].concat([this.codeHeader.read(),this.code.read(),this.codeFooter.read()].flatMap(R=>si.decode(R))),this.io.getArgs(),this.io.getStdin()).then(R=>{let f=()=>{R.terminate(),this.stderr.write(`Aborted execution after ${Date.now()-B}ms`),this.runButton.removeAttribute("disabled"),this.stopButton.setAttribute("disabled",""),this.stopButton.removeEventListener("click",f)};this.stopButton.addEventListener("click",f),R.on("output",({output:k,error:m})=>{this.stdout.write(k??""),this.stderr.write(m??"")}),R.on("done",({exitCode:k})=>{this.stderr.write(`Execution finished with status code ${k} after ${Date.now()-B}ms`),this.runButton.removeAttribute("disabled"),this.stopButton.setAttribute("disabled",""),this.stopButton.removeEventListener("click",f),R.terminate()}),R.on("toast",({message:k,type:m="info"})=>this.toast(k,m)),R.on("error",k=>{this.toast(`Worker error: ${k.message}`,"error"),this.runButton.removeAttribute("disabled"),this.stopButton.setAttribute("disabled","")})})}populateArgs(){for(;this.addArg.firstElementChild;)this.addArg.firstElementChild.remove();let B=Yr.get(this.getLangId());if(!B)throw new TypeError("Unregistered lang: "+this.getLangId());window.localStorage.setItem("lastUsedLanguage",B.getId());let R=B.getArgs();R!==null?(this.argsWrapper.removeAttribute("hidden"),R.forEach(f=>{let k=document.createElement("button");k.append(document.createTextNode(f)),k.addEventListener("click",()=>{let m=this.io.getArgs()??"";new RegExp("(\\n|^)"+f+"(\\n|$)").test(m)||this.io.setArgs((m+` +`+f).trim())}),this.addArg.append(k)})):this.argsWrapper.setAttribute("hidden",""),this.io.argsRefresh()}static expand(B){let R=B.nextElementSibling,f=document.querySelector(B.dataset.target);if(!f){console.debug("No collapser or target for expander: ",B);return}B.setAttribute("hidden",""),f.removeAttribute("hidden"),R.removeAttribute("hidden"),R.focus()}static collapse(B){let R=B.nextElementSibling,f=document.querySelector(B.dataset.target);if(!f){console.debug("No collapser or target for expander: ",B);return}B.removeAttribute("hidden"),f.setAttribute("hidden",""),R.setAttribute("hidden",""),B.focus()}connectExpanders(){this.expanders.forEach(B=>{let R=B.nextElementSibling;if(!R||!R.matches('button[name="collapse"]')){console.debug("No collapser or target for expander: ",B);return}B.addEventListener("click",()=>U.expand(B)),R.addEventListener("click",()=>U.collapse(B))})}setMimeType(B,R=!0){this.mimeType=B,R&&(this.mimeTypeInput.value=B),this.stdout.activate(B),this.stdout.resize()}static copied(B){B.setAttribute("disabled",""),B.style.width=B.offsetWidth+"px",B.classList.toggle("copied"),setTimeout(()=>{B.removeAttribute("disabled"),B.style.width=null,B.classList.toggle("copied")},1e3)}parseHashData(B){if(!B||B.length<2)return;let R;try{let m=atob(B.slice(1));R=JSON.parse(m)}catch(m){if(m instanceof DOMException){this.toast("Unable to decode URL data. Aborting.","error");return}if(m instanceof SyntaxError){this.toast("Unable to decode JSON data. Aborting.","error");return}throw m}let[f]=Array.from(this.expanders).filter(m=>m.parentElement.matches(".code-header")),[k]=Array.from(this.expanders).filter(m=>m.parentElement.matches(".code-footer"));R.header&&U.expand(f),R.footer&&U.expand(k),R.options&&Object.entries(R.options).forEach(([m,y])=>Hi.set(m,y)),this.setLang(R.lang??this.getLangId()),this.codeHeader.write(decodeURIComponent(escape(R.header??""))),this.code.write(decodeURIComponent(escape(R.code??""))),this.codeFooter.write(decodeURIComponent(escape(R.footer??""))),this.io.setArgs(R.args??""),this.io.setStdin(decodeURIComponent(escape(R.input??""))),R.mime&&this.setMimeType(R.mime)}buildHashData(){let B={lang:this.getLangId(),code:this.code.readAsString(null)},R=this.codeHeader.readAsString(null),f=this.codeFooter.readAsString(null),k=this.io.getArgs(),m=this.io.getStdin(),y=this.mimeType,_=Hi.options;return Object.entries({header:R,footer:f,args:k,input:m}).forEach(([g,x])=>{x&&(B[g]=x)}),JSON.stringify(_)!=="{}"&&(B.options=_),y!=="text/plain"&&(B.mime=y),btoa(JSON.stringify(B))}buildLink(){let B=this.buildHashData();return location.protocol+"//"+location.host+location.pathname+"#"+B}buildMarkdown(){let B=this.io.getArgs().trim().split(/\n/).join(" "),R=Yr.get(this.getLangId()),f=Math.random().toString(36).slice(2,10),k=si.decode(this.code.read()),m=Co(cn(k)),y=m.length;return`# [${R.getName()}]${B?` + \`${B}\``:""}, ${y} byte${y===1?"":"s"} - +
${m.replace(/[&<>]/g,_=>_==="<"?"<":_===">"?">":_==="&"?"&":_)}
[Try it online!][TIO-${f}] -[${D.getName()}]: ${D.getURL()} -[TIO-${f}]: ${this.buildLink()}`}showBytes(H){if(this.bytesCount.innerText=H.toString(),H===1){this.bytesPlural.setAttribute("hidden","");return}this.bytesPlural.removeAttribute("hidden")}enterFullscreen(){document.body.requestFullscreen().then(()=>{document.body.classList.add("fullscreen"),this.resize()})}exitFullscreen(){document.body.classList.remove("fullscreen"),this.resize()}toast(H,D,f={}){return f.events||(f.events={}),f.events.click||(f.events.click=[]),f.events.click.push(E=>E.hide()),new lc.Melba({...f,content:H,type:D})}},go=Is;var Hs=class extends yi{name(){return"xxd"}matchesAsString(H){return/^([\da-f]{7,8}: (((.{2}){1,2} ){1,8}) .+(\n|$))+$/.test(H)}decodeAsString(H){return H.trim().replace(/(?<=^|\n)[\da-f]{7,8}: (((.{2}){1,2} ){1,8}).+/g,"$1").replace(/\s+/g,"").match(/../g).map(D=>parseInt(D,16))}},cc=Hs;ii.register(new cc,new wl,new Cl,new yi);Gr.register(new kl,new Al);var Zh=new go;})(); +[${R.getName()}]: ${R.getURL()} +[TIO-${f}]: ${this.buildLink()}`}showBytes(B){if(this.bytesCount.innerText=B.toString(),B===1){this.bytesPlural.setAttribute("hidden","");return}this.bytesPlural.removeAttribute("hidden")}enterFullscreen(){document.body.requestFullscreen().then(()=>{document.body.classList.add("fullscreen"),this.resize()})}exitFullscreen(){document.body.classList.remove("fullscreen"),this.resize()}toast(B,R,f={}){return f.events||(f.events={}),f.events.click||(f.events.click=[]),f.events.click.push(k=>k.hide()),new Bc.Melba({...f,content:B,type:R})}},wo=Vs;var $s=class extends Si{name(){return"xxd"}matchesAsString(B){return/^([\da-f]{7,8}: (((.{2}){1,2} ){1,8}) .+(\n|$))+$/.test(B)}decodeAsString(B){return B.trim().replace(/(?<=^|\n)[\da-f]{7,8}: (((.{2}){1,2} ){1,8}).+/g,"$1").replace(/\s+/g,"").match(/../g).map(R=>parseInt(R,16))}},Pc=$s;var Ud=kt(Fc());var Js=class extends Er{constructor(){super("jq-wasmer","jq (wasmer)",async(B,R,f)=>{let k=new yo("syrusakbary/jq",!1,{mount:{"/app":{"input.json":R}}});return k.init(B,"",(f.length?f+` +`:"")+`$code +/app/input.json`),k},"https://jqlang.github.io/jq/",[],"jq")}},Wc=Js;si.register(new Pc,new Kl,new Hl,new Si);Yr.register(new ql,new Xl,new Jl,new tc,new Wc);var np=new wo; /*! Bundled license information: xterm-addon-fit/src/FitAddon.ts: diff --git a/dist/js/app.js.map b/dist/js/app.js.map index 80a51df..7eb3173 100644 --- a/dist/js/app.js.map +++ b/dist/js/app.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../../node_modules/codemirror/lib/codemirror.js", "../../node_modules/codemirror/mode/javascript/javascript.js", "../../node_modules/codemirror/mode/perl/perl.js", "../../node_modules/melba-toast/dist/Melba.js", "../../node_modules/xterm/lib/webpack:/xterm/webpack/universalModuleDefinition", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/AccessibilityManager.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Clipboard.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/ColorContrastCache.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/ColorManager.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Dom.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Lifecycle.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Linkifier.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Linkifier2.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/LocalizableStrings.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/MouseZoneManager.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/RenderDebouncer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/ScreenDprMonitor.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Terminal.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/TimeBasedDebouncer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Viewport.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/decorations/BufferDecorationRenderer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/decorations/ColorZoneStore.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/decorations/OverviewRulerRenderer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/input/CompositionHelper.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/input/Mouse.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/input/MoveToCell.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/public/Terminal.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/BaseRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/CursorRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/CustomGlyphs.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/GridCache.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/LinkRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/Renderer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/RendererUtils.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/SelectionRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/TextRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/BaseCharAtlas.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/CharAtlasCache.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/CharAtlasUtils.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/Constants.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/DynamicCharAtlas.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/LRUMap.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/dom/DomRenderer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/dom/DomRendererRowFactory.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/selection/SelectionModel.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/CharSizeService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/CharacterJoinerService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/CoreBrowserService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/MouseService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/RenderService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/SelectionService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/Services.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/SoundService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/CircularList.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/Clone.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/Color.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/CoreTerminal.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/EventEmitter.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/InputHandler.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/Lifecycle.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/Platform.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/SortedList.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/TypedArrayUtils.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/WindowsMode.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/AttributeData.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/Buffer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/BufferLine.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/BufferRange.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/BufferReflow.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/BufferSet.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/CellData.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/Constants.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/Marker.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/data/Charsets.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/data/EscapeSequences.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/Keyboard.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/TextDecoder.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/UnicodeV6.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/WriteBuffer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/XParseColor.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/Constants.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/DcsParser.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/EscapeSequenceParser.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/OscParser.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/Params.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/AddonManager.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/BufferApiView.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/BufferLineApiView.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/BufferNamespaceApi.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/ParserApi.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/UnicodeApi.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/BufferService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/CharsetService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/CoreMouseService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/CoreService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/DecorationService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/DirtyRowService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/InstantiationService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/LogService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/OptionsService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/ServiceRegistry.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/Services.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/UnicodeService.ts", "../../node_modules/xterm/lib/webpack:/xterm/webpack/bootstrap", "../../node_modules/xterm/lib/webpack:/xterm/webpack/startup", "../../node_modules/codemirror/addon/comment/comment.js", "../../node_modules/codemirror/addon/comment/continuecomment.js", "../../node_modules/codemirror/addon/display/placeholder.js", "../../node_modules/codemirror/addon/edit/closebrackets.js", "../../node_modules/codemirror/addon/edit/matchbrackets.js", "../../node_modules/codemirror/addon/search/searchcursor.js", "../../node_modules/codemirror/keymap/sublime.js", "../../js/codePointsToString.ts", "../../js/stringToCodePoints.ts", "../../js/Decoders/Default.ts", "../../js/Decoders/Base64.ts", "../../js/Decoders/Hexdump.ts", "../../js/Lang.ts", "../../js/Langs.ts", "../../js/langs/javascript-browser/JavaScript.ts", "../../js/langs/webperl-5.28.1/Perl.ts", "../../js/UI.ts", "../../js/Renderers.ts", "../../js/Inputs/Code.ts", "../../js/Inputs/Abstract.ts", "../../js/replaceBinaryBytes.ts", "../../js/Renderers/Abstract.ts", "../../js/Renderers/Code.ts", "../../js/Renderers/IFrame.ts", "../../js/Decoders.ts", "../../js/IO.ts", "../../js/Options.ts", "../../js/Renderers/Image.ts", "../../js/Inputs.ts", "../../js/Renderers/Error/InvalidFormat.ts", "../../js/Renderers/PBMImage.ts", "../../js/Renderers/TTY.ts", "../../node_modules/xterm-addon-fit/src/FitAddon.ts", "../../js/Decoders/Xxd.ts", "../../js/app.ts"], - "sourcesContent": ["// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(rootNode) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var doc = rootNode.ownerDocument || rootNode;\n var activeElement;\n try {\n activeElement = rootNode.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function root(cm) {\n return rootNode(cm.display.wrapper)\n }\n\n function rootNode(element) {\n // Detect modern browsers (2017+).\n return element.getRootNode ? element.getRootNode() : element.ownerDocument\n }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(root(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(root(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(root(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(root(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(root(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(rootNode(div));\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(rootNode(this.div)) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(rootNode(textarea));\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, \u2026*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.16\";\n\n return CodeMirror;\n\n})));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n pushcontext.lex = pushblockcontext.lex = true\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(maybeexpression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n if (type == \"quasi\") { return pass(quasiType, afterType); }\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function quasiType(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasiType);\n return cont(typeexpr, continueQuasiType);\n }\n function continueQuasiType(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasiType);\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+#?[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"!\") return cont(classfield)\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n parseJS(state, \"atom\", \"atom\", \"true\", new CodeMirror.StringStream(\"\", 2, null))\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08)\n// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com)\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"perl\",function(){\n // http://perldoc.perl.org\n var PERL={ // null - magic touch\n // 1 - keyword\n // 2 - def\n // 3 - atom\n // 4 - operator\n // 5 - variable-2 (predefined)\n // [x,y] - x=1,2,3; y=must be defined if x{...}\n // PERL operators\n '->' : 4,\n '++' : 4,\n '--' : 4,\n '**' : 4,\n // ! ~ \\ and unary + and -\n '=~' : 4,\n '!~' : 4,\n '*' : 4,\n '/' : 4,\n '%' : 4,\n 'x' : 4,\n '+' : 4,\n '-' : 4,\n '.' : 4,\n '<<' : 4,\n '>>' : 4,\n // named unary operators\n '<' : 4,\n '>' : 4,\n '<=' : 4,\n '>=' : 4,\n 'lt' : 4,\n 'gt' : 4,\n 'le' : 4,\n 'ge' : 4,\n '==' : 4,\n '!=' : 4,\n '<=>' : 4,\n 'eq' : 4,\n 'ne' : 4,\n 'cmp' : 4,\n '~~' : 4,\n '&' : 4,\n '|' : 4,\n '^' : 4,\n '&&' : 4,\n '||' : 4,\n '//' : 4,\n '..' : 4,\n '...' : 4,\n '?' : 4,\n ':' : 4,\n '=' : 4,\n '+=' : 4,\n '-=' : 4,\n '*=' : 4, // etc. ???\n ',' : 4,\n '=>' : 4,\n '::' : 4,\n // list operators (rightward)\n 'not' : 4,\n 'and' : 4,\n 'or' : 4,\n 'xor' : 4,\n // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;)\n 'BEGIN' : [5,1],\n 'END' : [5,1],\n 'PRINT' : [5,1],\n 'PRINTF' : [5,1],\n 'GETC' : [5,1],\n 'READ' : [5,1],\n 'READLINE' : [5,1],\n 'DESTROY' : [5,1],\n 'TIE' : [5,1],\n 'TIEHANDLE' : [5,1],\n 'UNTIE' : [5,1],\n 'STDIN' : 5,\n 'STDIN_TOP' : 5,\n 'STDOUT' : 5,\n 'STDOUT_TOP' : 5,\n 'STDERR' : 5,\n 'STDERR_TOP' : 5,\n '$ARG' : 5,\n '$_' : 5,\n '@ARG' : 5,\n '@_' : 5,\n '$LIST_SEPARATOR' : 5,\n '$\"' : 5,\n '$PROCESS_ID' : 5,\n '$PID' : 5,\n '$$' : 5,\n '$REAL_GROUP_ID' : 5,\n '$GID' : 5,\n '$(' : 5,\n '$EFFECTIVE_GROUP_ID' : 5,\n '$EGID' : 5,\n '$)' : 5,\n '$PROGRAM_NAME' : 5,\n '$0' : 5,\n '$SUBSCRIPT_SEPARATOR' : 5,\n '$SUBSEP' : 5,\n '$;' : 5,\n '$REAL_USER_ID' : 5,\n '$UID' : 5,\n '$<' : 5,\n '$EFFECTIVE_USER_ID' : 5,\n '$EUID' : 5,\n '$>' : 5,\n '$a' : 5,\n '$b' : 5,\n '$COMPILING' : 5,\n '$^C' : 5,\n '$DEBUGGING' : 5,\n '$^D' : 5,\n '${^ENCODING}' : 5,\n '$ENV' : 5,\n '%ENV' : 5,\n '$SYSTEM_FD_MAX' : 5,\n '$^F' : 5,\n '@F' : 5,\n '${^GLOBAL_PHASE}' : 5,\n '$^H' : 5,\n '%^H' : 5,\n '@INC' : 5,\n '%INC' : 5,\n '$INPLACE_EDIT' : 5,\n '$^I' : 5,\n '$^M' : 5,\n '$OSNAME' : 5,\n '$^O' : 5,\n '${^OPEN}' : 5,\n '$PERLDB' : 5,\n '$^P' : 5,\n '$SIG' : 5,\n '%SIG' : 5,\n '$BASETIME' : 5,\n '$^T' : 5,\n '${^TAINT}' : 5,\n '${^UNICODE}' : 5,\n '${^UTF8CACHE}' : 5,\n '${^UTF8LOCALE}' : 5,\n '$PERL_VERSION' : 5,\n '$^V' : 5,\n '${^WIN32_SLOPPY_STAT}' : 5,\n '$EXECUTABLE_NAME' : 5,\n '$^X' : 5,\n '$1' : 5, // - regexp $1, $2...\n '$MATCH' : 5,\n '$&' : 5,\n '${^MATCH}' : 5,\n '$PREMATCH' : 5,\n '$`' : 5,\n '${^PREMATCH}' : 5,\n '$POSTMATCH' : 5,\n \"$'\" : 5,\n '${^POSTMATCH}' : 5,\n '$LAST_PAREN_MATCH' : 5,\n '$+' : 5,\n '$LAST_SUBMATCH_RESULT' : 5,\n '$^N' : 5,\n '@LAST_MATCH_END' : 5,\n '@+' : 5,\n '%LAST_PAREN_MATCH' : 5,\n '%+' : 5,\n '@LAST_MATCH_START' : 5,\n '@-' : 5,\n '%LAST_MATCH_START' : 5,\n '%-' : 5,\n '$LAST_REGEXP_CODE_RESULT' : 5,\n '$^R' : 5,\n '${^RE_DEBUG_FLAGS}' : 5,\n '${^RE_TRIE_MAXBUF}' : 5,\n '$ARGV' : 5,\n '@ARGV' : 5,\n 'ARGV' : 5,\n 'ARGVOUT' : 5,\n '$OUTPUT_FIELD_SEPARATOR' : 5,\n '$OFS' : 5,\n '$,' : 5,\n '$INPUT_LINE_NUMBER' : 5,\n '$NR' : 5,\n '$.' : 5,\n '$INPUT_RECORD_SEPARATOR' : 5,\n '$RS' : 5,\n '$/' : 5,\n '$OUTPUT_RECORD_SEPARATOR' : 5,\n '$ORS' : 5,\n '$\\\\' : 5,\n '$OUTPUT_AUTOFLUSH' : 5,\n '$|' : 5,\n '$ACCUMULATOR' : 5,\n '$^A' : 5,\n '$FORMAT_FORMFEED' : 5,\n '$^L' : 5,\n '$FORMAT_PAGE_NUMBER' : 5,\n '$%' : 5,\n '$FORMAT_LINES_LEFT' : 5,\n '$-' : 5,\n '$FORMAT_LINE_BREAK_CHARACTERS' : 5,\n '$:' : 5,\n '$FORMAT_LINES_PER_PAGE' : 5,\n '$=' : 5,\n '$FORMAT_TOP_NAME' : 5,\n '$^' : 5,\n '$FORMAT_NAME' : 5,\n '$~' : 5,\n '${^CHILD_ERROR_NATIVE}' : 5,\n '$EXTENDED_OS_ERROR' : 5,\n '$^E' : 5,\n '$EXCEPTIONS_BEING_CAUGHT' : 5,\n '$^S' : 5,\n '$WARNING' : 5,\n '$^W' : 5,\n '${^WARNING_BITS}' : 5,\n '$OS_ERROR' : 5,\n '$ERRNO' : 5,\n '$!' : 5,\n '%OS_ERROR' : 5,\n '%ERRNO' : 5,\n '%!' : 5,\n '$CHILD_ERROR' : 5,\n '$?' : 5,\n '$EVAL_ERROR' : 5,\n '$@' : 5,\n '$OFMT' : 5,\n '$#' : 5,\n '$*' : 5,\n '$ARRAY_BASE' : 5,\n '$[' : 5,\n '$OLD_PERL_VERSION' : 5,\n '$]' : 5,\n // PERL blocks\n 'if' :[1,1],\n elsif :[1,1],\n 'else' :[1,1],\n 'while' :[1,1],\n unless :[1,1],\n 'for' :[1,1],\n foreach :[1,1],\n // PERL functions\n 'abs' :1, // - absolute value function\n accept :1, // - accept an incoming socket connect\n alarm :1, // - schedule a SIGALRM\n 'atan2' :1, // - arctangent of Y/X in the range -PI to PI\n bind :1, // - binds an address to a socket\n binmode :1, // - prepare binary files for I/O\n bless :1, // - create an object\n bootstrap :1, //\n 'break' :1, // - break out of a \"given\" block\n caller :1, // - get context of the current subroutine call\n chdir :1, // - change your current working directory\n chmod :1, // - changes the permissions on a list of files\n chomp :1, // - remove a trailing record separator from a string\n chop :1, // - remove the last character from a string\n chown :1, // - change the ownership on a list of files\n chr :1, // - get character this number represents\n chroot :1, // - make directory new root for path lookups\n close :1, // - close file (or pipe or socket) handle\n closedir :1, // - close directory handle\n connect :1, // - connect to a remote socket\n 'continue' :[1,1], // - optional trailing block in a while or foreach\n 'cos' :1, // - cosine function\n crypt :1, // - one-way passwd-style encryption\n dbmclose :1, // - breaks binding on a tied dbm file\n dbmopen :1, // - create binding on a tied dbm file\n 'default' :1, //\n defined :1, // - test whether a value, variable, or function is defined\n 'delete' :1, // - deletes a value from a hash\n die :1, // - raise an exception or bail out\n 'do' :1, // - turn a BLOCK into a TERM\n dump :1, // - create an immediate core dump\n each :1, // - retrieve the next key/value pair from a hash\n endgrent :1, // - be done using group file\n endhostent :1, // - be done using hosts file\n endnetent :1, // - be done using networks file\n endprotoent :1, // - be done using protocols file\n endpwent :1, // - be done using passwd file\n endservent :1, // - be done using services file\n eof :1, // - test a filehandle for its end\n 'eval' :1, // - catch exceptions or compile and run code\n 'exec' :1, // - abandon this program to run another\n exists :1, // - test whether a hash key is present\n exit :1, // - terminate this program\n 'exp' :1, // - raise I to a power\n fcntl :1, // - file control system call\n fileno :1, // - return file descriptor from filehandle\n flock :1, // - lock an entire file with an advisory lock\n fork :1, // - create a new process just like this one\n format :1, // - declare a picture format with use by the write() function\n formline :1, // - internal function used for formats\n getc :1, // - get the next character from the filehandle\n getgrent :1, // - get next group record\n getgrgid :1, // - get group record given group user ID\n getgrnam :1, // - get group record given group name\n gethostbyaddr :1, // - get host record given its address\n gethostbyname :1, // - get host record given name\n gethostent :1, // - get next hosts record\n getlogin :1, // - return who logged in at this tty\n getnetbyaddr :1, // - get network record given its address\n getnetbyname :1, // - get networks record given name\n getnetent :1, // - get next networks record\n getpeername :1, // - find the other end of a socket connection\n getpgrp :1, // - get process group\n getppid :1, // - get parent process ID\n getpriority :1, // - get current nice value\n getprotobyname :1, // - get protocol record given name\n getprotobynumber :1, // - get protocol record numeric protocol\n getprotoent :1, // - get next protocols record\n getpwent :1, // - get next passwd record\n getpwnam :1, // - get passwd record given user login name\n getpwuid :1, // - get passwd record given user ID\n getservbyname :1, // - get services record given its name\n getservbyport :1, // - get services record given numeric port\n getservent :1, // - get next services record\n getsockname :1, // - retrieve the sockaddr for a given socket\n getsockopt :1, // - get socket options on a given socket\n given :1, //\n glob :1, // - expand filenames using wildcards\n gmtime :1, // - convert UNIX time into record or string using Greenwich time\n 'goto' :1, // - create spaghetti code\n grep :1, // - locate elements in a list test true against a given criterion\n hex :1, // - convert a string to a hexadecimal number\n 'import' :1, // - patch a module's namespace into your own\n index :1, // - find a substring within a string\n 'int' :1, // - get the integer portion of a number\n ioctl :1, // - system-dependent device control system call\n 'join' :1, // - join a list into a string using a separator\n keys :1, // - retrieve list of indices from a hash\n kill :1, // - send a signal to a process or process group\n last :1, // - exit a block prematurely\n lc :1, // - return lower-case version of a string\n lcfirst :1, // - return a string with just the next letter in lower case\n length :1, // - return the number of bytes in a string\n 'link' :1, // - create a hard link in the filesystem\n listen :1, // - register your socket as a server\n local : 2, // - create a temporary value for a global variable (dynamic scoping)\n localtime :1, // - convert UNIX time into record or string using local time\n lock :1, // - get a thread lock on a variable, subroutine, or method\n 'log' :1, // - retrieve the natural logarithm for a number\n lstat :1, // - stat a symbolic link\n m :null, // - match a string with a regular expression pattern\n map :1, // - apply a change to a list to get back a new list with the changes\n mkdir :1, // - create a directory\n msgctl :1, // - SysV IPC message control operations\n msgget :1, // - get SysV IPC message queue\n msgrcv :1, // - receive a SysV IPC message from a message queue\n msgsnd :1, // - send a SysV IPC message to a message queue\n my : 2, // - declare and assign a local variable (lexical scoping)\n 'new' :1, //\n next :1, // - iterate a block prematurely\n no :1, // - unimport some module symbols or semantics at compile time\n oct :1, // - convert a string to an octal number\n open :1, // - open a file, pipe, or descriptor\n opendir :1, // - open a directory\n ord :1, // - find a character's numeric representation\n our : 2, // - declare and assign a package variable (lexical scoping)\n pack :1, // - convert a list into a binary representation\n 'package' :1, // - declare a separate global namespace\n pipe :1, // - open a pair of connected filehandles\n pop :1, // - remove the last element from an array and return it\n pos :1, // - find or set the offset for the last/next m//g search\n print :1, // - output a list to a filehandle\n printf :1, // - output a formatted list to a filehandle\n prototype :1, // - get the prototype (if any) of a subroutine\n push :1, // - append one or more elements to an array\n q :null, // - singly quote a string\n qq :null, // - doubly quote a string\n qr :null, // - Compile pattern\n quotemeta :null, // - quote regular expression magic characters\n qw :null, // - quote a list of words\n qx :null, // - backquote quote a string\n rand :1, // - retrieve the next pseudorandom number\n read :1, // - fixed-length buffered input from a filehandle\n readdir :1, // - get a directory from a directory handle\n readline :1, // - fetch a record from a file\n readlink :1, // - determine where a symbolic link is pointing\n readpipe :1, // - execute a system command and collect standard output\n recv :1, // - receive a message over a Socket\n redo :1, // - start this loop iteration over again\n ref :1, // - find out the type of thing being referenced\n rename :1, // - change a filename\n require :1, // - load in external functions from a library at runtime\n reset :1, // - clear all variables of a given name\n 'return' :1, // - get out of a function early\n reverse :1, // - flip a string or a list\n rewinddir :1, // - reset directory handle\n rindex :1, // - right-to-left substring search\n rmdir :1, // - remove a directory\n s :null, // - replace a pattern with a string\n say :1, // - print with newline\n scalar :1, // - force a scalar context\n seek :1, // - reposition file pointer for random-access I/O\n seekdir :1, // - reposition directory pointer\n select :1, // - reset default output or do I/O multiplexing\n semctl :1, // - SysV semaphore control operations\n semget :1, // - get set of SysV semaphores\n semop :1, // - SysV semaphore operations\n send :1, // - send a message over a socket\n setgrent :1, // - prepare group file for use\n sethostent :1, // - prepare hosts file for use\n setnetent :1, // - prepare networks file for use\n setpgrp :1, // - set the process group of a process\n setpriority :1, // - set a process's nice value\n setprotoent :1, // - prepare protocols file for use\n setpwent :1, // - prepare passwd file for use\n setservent :1, // - prepare services file for use\n setsockopt :1, // - set some socket options\n shift :1, // - remove the first element of an array, and return it\n shmctl :1, // - SysV shared memory operations\n shmget :1, // - get SysV shared memory segment identifier\n shmread :1, // - read SysV shared memory\n shmwrite :1, // - write SysV shared memory\n shutdown :1, // - close down just half of a socket connection\n 'sin' :1, // - return the sine of a number\n sleep :1, // - block for some number of seconds\n socket :1, // - create a socket\n socketpair :1, // - create a pair of sockets\n 'sort' :1, // - sort a list of values\n splice :1, // - add or remove elements anywhere in an array\n 'split' :1, // - split up a string using a regexp delimiter\n sprintf :1, // - formatted print into a string\n 'sqrt' :1, // - square root function\n srand :1, // - seed the random number generator\n stat :1, // - get a file's status information\n state :1, // - declare and assign a state variable (persistent lexical scoping)\n study :1, // - optimize input data for repeated searches\n 'sub' :1, // - declare a subroutine, possibly anonymously\n 'substr' :1, // - get or alter a portion of a string\n symlink :1, // - create a symbolic link to a file\n syscall :1, // - execute an arbitrary system call\n sysopen :1, // - open a file, pipe, or descriptor\n sysread :1, // - fixed-length unbuffered input from a filehandle\n sysseek :1, // - position I/O pointer on handle used with sysread and syswrite\n system :1, // - run a separate program\n syswrite :1, // - fixed-length unbuffered output to a filehandle\n tell :1, // - get current seekpointer on a filehandle\n telldir :1, // - get current seekpointer on a directory handle\n tie :1, // - bind a variable to an object class\n tied :1, // - get a reference to the object underlying a tied variable\n time :1, // - return number of seconds since 1970\n times :1, // - return elapsed time for self and child processes\n tr :null, // - transliterate a string\n truncate :1, // - shorten a file\n uc :1, // - return upper-case version of a string\n ucfirst :1, // - return a string with just the next letter in upper case\n umask :1, // - set file creation mode mask\n undef :1, // - remove a variable or function definition\n unlink :1, // - remove one link to a file\n unpack :1, // - convert binary structure into normal perl variables\n unshift :1, // - prepend more elements to the beginning of a list\n untie :1, // - break a tie binding to a variable\n use :1, // - load in a module at compile time\n utime :1, // - set a file's last access and modify times\n values :1, // - return a list of the values in a hash\n vec :1, // - test or set particular bits in a string\n wait :1, // - wait for any child process to die\n waitpid :1, // - wait for a particular child process to die\n wantarray :1, // - get void vs scalar vs list context of current subroutine call\n warn :1, // - print debugging info\n when :1, //\n write :1, // - print a picture record\n y :null}; // - transliterate a string\n\n var RXstyle=\"string-2\";\n var RXmodifiers=/[goseximacplud]/; // NOTE: \"m\", \"s\", \"y\" and \"tr\" need to correct real modifiers for each regexp type\n\n function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)\n state.chain=null; // 12 3tail\n state.style=null;\n state.tail=null;\n state.tokenize=function(stream,state){\n var e=false,c,i=0;\n while(c=stream.next()){\n if(c===chain[i]&&!e){\n if(chain[++i]!==undefined){\n state.chain=chain[i];\n state.style=style;\n state.tail=tail;}\n else if(tail)\n stream.eatWhile(tail);\n state.tokenize=tokenPerl;\n return style;}\n e=!e&&c==\"\\\\\";}\n return style;};\n return state.tokenize(stream,state);}\n\n function tokenSOMETHING(stream,state,string){\n state.tokenize=function(stream,state){\n if(stream.string==string)\n state.tokenize=tokenPerl;\n stream.skipToEnd();\n return \"string\";};\n return state.tokenize(stream,state);}\n\n function tokenPerl(stream,state){\n if(stream.eatSpace())\n return null;\n if(state.chain)\n return tokenChain(stream,state,state.chain,state.style,state.tail);\n if(stream.match(/^(\\-?((\\d[\\d_]*)?\\.\\d+(e[+-]?\\d+)?|\\d+\\.\\d*)|0x[\\da-fA-F_]+|0b[01_]+|\\d[\\d_]*(e[+-]?\\d+)?)/))\n return 'number';\n if(stream.match(/^<<(?=[_a-zA-Z])/)){ // NOTE: <\"],RXstyle,RXmodifiers);}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}\n else if(c==\"q\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],\"string\");}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],\"string\");}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],\"string\");}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],\"string\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],\"string\");}}\n else if(c==\"w\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],\"bracket\");}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],\"bracket\");}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],\"bracket\");}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],\"bracket\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],\"bracket\");}}\n else if(c==\"r\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],RXstyle,RXmodifiers);}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],RXstyle,RXmodifiers);}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],RXstyle,RXmodifiers);}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],RXstyle,RXmodifiers);}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}\n else if(/[\\^'\"!~\\/(\\[{<]/.test(c)){\n if(c==\"(\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\")\"],\"string\");}\n if(c==\"[\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\"]\"],\"string\");}\n if(c==\"{\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\"}\"],\"string\");}\n if(c==\"<\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\">\"],\"string\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n return tokenChain(stream,state,[stream.eat(c)],\"string\");}}}}\n if(ch==\"m\"){\n var c=look(stream, -2);\n if(!(c&&/\\w/.test(c))){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(/[\\^'\"!~\\/]/.test(c)){\n return tokenChain(stream,state,[c],RXstyle,RXmodifiers);}\n if(c==\"(\"){\n return tokenChain(stream,state,[\")\"],RXstyle,RXmodifiers);}\n if(c==\"[\"){\n return tokenChain(stream,state,[\"]\"],RXstyle,RXmodifiers);}\n if(c==\"{\"){\n return tokenChain(stream,state,[\"}\"],RXstyle,RXmodifiers);}\n if(c==\"<\"){\n return tokenChain(stream,state,[\">\"],RXstyle,RXmodifiers);}}}}\n if(ch==\"s\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}\n if(ch==\"y\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}\n if(ch==\"t\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(\"r\");if(c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}}\n if(ch==\"`\"){\n return tokenChain(stream,state,[ch],\"variable-2\");}\n if(ch==\"/\"){\n if(!/~\\s*$/.test(prefix(stream)))\n return \"operator\";\n else\n return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);}\n if(ch==\"$\"){\n var p=stream.pos;\n if(stream.eatWhile(/\\d/)||stream.eat(\"{\")&&stream.eatWhile(/\\d/)&&stream.eat(\"}\"))\n return \"variable-2\";\n else\n stream.pos=p;}\n if(/[$@%]/.test(ch)){\n var p=stream.pos;\n if(stream.eat(\"^\")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\\\\-#?@;:&`~\\^!\\[\\]*'\"$+.,\\/<>()]/)){\n var c=stream.current();\n if(PERL[c])\n return \"variable-2\";}\n stream.pos=p;}\n if(/[$@%&]/.test(ch)){\n if(stream.eatWhile(/[\\w$]/)||stream.eat(\"{\")&&stream.eatWhile(/[\\w$]/)&&stream.eat(\"}\")){\n var c=stream.current();\n if(PERL[c])\n return \"variable-2\";\n else\n return \"variable\";}}\n if(ch==\"#\"){\n if(look(stream, -2)!=\"$\"){\n stream.skipToEnd();\n return \"comment\";}}\n if(/[:+\\-\\^*$&%@=<>!?|\\/~\\.]/.test(ch)){\n var p=stream.pos;\n stream.eatWhile(/[:+\\-\\^*$&%@=<>!?|\\/~\\.]/);\n if(PERL[stream.current()])\n return \"operator\";\n else\n stream.pos=p;}\n if(ch==\"_\"){\n if(stream.pos==1){\n if(suffix(stream, 6)==\"_END__\"){\n return tokenChain(stream,state,['\\0'],\"comment\");}\n else if(suffix(stream, 7)==\"_DATA__\"){\n return tokenChain(stream,state,['\\0'],\"variable-2\");}\n else if(suffix(stream, 7)==\"_C__\"){\n return tokenChain(stream,state,['\\0'],\"string\");}}}\n if(/\\w/.test(ch)){\n var p=stream.pos;\n if(look(stream, -2)==\"{\"&&(look(stream, 0)==\"}\"||stream.eatWhile(/\\w/)&&look(stream, 0)==\"}\"))\n return \"string\";\n else\n stream.pos=p;}\n if(/[A-Z]/.test(ch)){\n var l=look(stream, -2);\n var p=stream.pos;\n stream.eatWhile(/[A-Z_]/);\n if(/[\\da-z]/.test(look(stream, 0))){\n stream.pos=p;}\n else{\n var c=PERL[stream.current()];\n if(!c)\n return \"meta\";\n if(c[1])\n c=c[0];\n if(l!=\":\"){\n if(c==1)\n return \"keyword\";\n else if(c==2)\n return \"def\";\n else if(c==3)\n return \"atom\";\n else if(c==4)\n return \"operator\";\n else if(c==5)\n return \"variable-2\";\n else\n return \"meta\";}\n else\n return \"meta\";}}\n if(/[a-zA-Z_]/.test(ch)){\n var l=look(stream, -2);\n stream.eatWhile(/\\w/);\n var c=PERL[stream.current()];\n if(!c)\n return \"meta\";\n if(c[1])\n c=c[0];\n if(l!=\":\"){\n if(c==1)\n return \"keyword\";\n else if(c==2)\n return \"def\";\n else if(c==3)\n return \"atom\";\n else if(c==4)\n return \"operator\";\n else if(c==5)\n return \"variable-2\";\n else\n return \"meta\";}\n else\n return \"meta\";}\n return null;}\n\n return {\n startState: function() {\n return {\n tokenize: tokenPerl,\n chain: null,\n style: null,\n tail: null\n };\n },\n token: function(stream, state) {\n return (state.tokenize || tokenPerl)(stream, state);\n },\n lineComment: '#'\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"perl\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/x-perl\", \"perl\");\n\n// it's like \"peek\", but need for look-ahead or look-behind if index < 0\nfunction look(stream, c){\n return stream.string.charAt(stream.pos+(c||0));\n}\n\n// return a part of prefix of current stream from current position\nfunction prefix(stream, c){\n if(c){\n var x=stream.pos-c;\n return stream.string.substr((x>=0?x:0),c);}\n else{\n return stream.string.substr(0,stream.pos-1);\n }\n}\n\n// return a part of suffix of current stream from current position\nfunction suffix(stream, c){\n var y=stream.string.length;\n var x=y-stream.pos+1;\n return stream.string.substr(stream.pos,(c&&c=(y=stream.string.length-1))\n stream.pos=y;\n else\n stream.pos=x;\n}\n\n});\n", "\"use strict\";var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i0){_this.hide()}}))}this.element.classList.remove(this.toastShowClass);this.element.classList.add(this.toastHideClass);this.trigger(\"hide\");if(this.animation){var transitionEndHandler_1=function(){return _this.remove()},transitionStartHandler_1=function(){if(bound_1){return}_this.element.addEventListener(\"transitionend\",(function(){return transitionEndHandler_1()}));bound_1=true},mouseOverHandler_1=function(){_this.show();_this.element.removeEventListener(\"transitionstart\",(function(){return transitionStartHandler_1()}));_this.element.removeEventListener(\"transitionend\",(function(){return transitionEndHandler_1()}));_this.element.removeEventListener(\"mouseover\",(function(){return mouseOverHandler_1()}));_this.element.addEventListener(\"mouseout\",(function(){return _this.hide()}))};var bound_1=false;this.element.addEventListener(\"mouseover\",(function(){return mouseOverHandler_1()}));this.element.addEventListener(\"transitionstart\",(function(){return transitionStartHandler_1()}));return}this.remove()};Melba.prototype.remove=function(){if(this.element.parentNode===this.container){this.container.removeChild(this.element);this.trigger(\"remove\")}};Melba.prototype.buildClose=function(closeLabel){var _this=this;var closeButton=document.createElement(\"button\");closeButton.setAttribute(\"title\",closeLabel);closeButton.appendChild(document.createTextNode(closeLabel));closeButton.addEventListener(\"click\",(function(){return _this.hide()}));return closeButton};Melba.prototype.getContainer=function(_a){var containerClass=_a.containerClass,containerElement=_a.containerElement,root=_a.root;var existingContainer=root.querySelector(\"\".concat(containerElement,\".\").concat(containerClass));if(existingContainer){return existingContainer}var container=document.createElement(containerElement);container.classList.add(containerClass);root.appendChild(container);return container};Melba.prototype.on=function(event,callable){if(!this.events[event]){this.events[event]=[]}this.events[event].push(callable)};Melba.prototype.off=function(event,callable){if(callable===void 0){callable=null}if(!callable){this.events[event]=[];return}var hasEvent=this.events[event].indexOf(callable);if(hasEvent===-1){this.events[event].splice(hasEvent,1)}};Melba.prototype.trigger=function(event){var _this=this;var args=[];for(var _i=1;_i void;\n private _bottomBoundaryFocusListener: (e: FocusEvent) => void;\n\n /**\n * This queue has a character pushed to it for keys that are pressed, if the\n * next character added to the terminal is equal to the key char then it is\n * not announced (added to live region) because it has already been announced\n * by the textarea event (which cannot be canceled). There are some race\n * condition cases if there is typing while data is streaming, but this covers\n * the main case of typing into the prompt and inputting the answer to a\n * question (Y/N, etc.).\n */\n private _charsToConsume: string[] = [];\n\n private _charsToAnnounce: string = '';\n\n constructor(\n private readonly _terminal: ITerminal,\n private readonly _renderService: IRenderService\n ) {\n super();\n this._accessibilityTreeRoot = document.createElement('div');\n this._accessibilityTreeRoot.classList.add('xterm-accessibility');\n this._accessibilityTreeRoot.tabIndex = 0;\n\n this._rowContainer = document.createElement('div');\n this._rowContainer.setAttribute('role', 'list');\n this._rowContainer.classList.add('xterm-accessibility-tree');\n this._rowElements = [];\n for (let i = 0; i < this._terminal.rows; i++) {\n this._rowElements[i] = this._createAccessibilityTreeNode();\n this._rowContainer.appendChild(this._rowElements[i]);\n }\n\n this._topBoundaryFocusListener = e => this._onBoundaryFocus(e, BoundaryPosition.TOP);\n this._bottomBoundaryFocusListener = e => this._onBoundaryFocus(e, BoundaryPosition.BOTTOM);\n this._rowElements[0].addEventListener('focus', this._topBoundaryFocusListener);\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n this._refreshRowsDimensions();\n this._accessibilityTreeRoot.appendChild(this._rowContainer);\n\n this._renderRowsDebouncer = new TimeBasedDebouncer(this._renderRows.bind(this));\n this._refreshRows();\n\n this._liveRegion = document.createElement('div');\n this._liveRegion.classList.add('live-region');\n this._liveRegion.setAttribute('aria-live', 'assertive');\n this._accessibilityTreeRoot.appendChild(this._liveRegion);\n\n if (!this._terminal.element) {\n throw new Error('Cannot enable accessibility before Terminal.open');\n }\n this._terminal.element.insertAdjacentElement('afterbegin', this._accessibilityTreeRoot);\n\n this.register(this._renderRowsDebouncer);\n this.register(this._terminal.onResize(e => this._onResize(e.rows)));\n this.register(this._terminal.onRender(e => this._refreshRows(e.start, e.end)));\n this.register(this._terminal.onScroll(() => this._refreshRows()));\n // Line feed is an issue as the prompt won't be read out after a command is run\n this.register(this._terminal.onA11yChar(char => this._onChar(char)));\n this.register(this._terminal.onLineFeed(() => this._onChar('\\n')));\n this.register(this._terminal.onA11yTab(spaceCount => this._onTab(spaceCount)));\n this.register(this._terminal.onKey(e => this._onKey(e.key)));\n this.register(this._terminal.onBlur(() => this._clearLiveRegion()));\n this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions()));\n\n this._screenDprMonitor = new ScreenDprMonitor();\n this.register(this._screenDprMonitor);\n this._screenDprMonitor.setListener(() => this._refreshRowsDimensions());\n // This shouldn't be needed on modern browsers but is present in case the\n // media query that drives the ScreenDprMonitor isn't supported\n this.register(addDisposableDomListener(window, 'resize', () => this._refreshRowsDimensions()));\n }\n\n public dispose(): void {\n super.dispose();\n removeElementFromParent(this._accessibilityTreeRoot);\n this._rowElements.length = 0;\n }\n\n private _onBoundaryFocus(e: FocusEvent, position: BoundaryPosition): void {\n const boundaryElement = e.target as HTMLElement;\n const beforeBoundaryElement = this._rowElements[position === BoundaryPosition.TOP ? 1 : this._rowElements.length - 2];\n\n // Don't scroll if the buffer top has reached the end in that direction\n const posInSet = boundaryElement.getAttribute('aria-posinset');\n const lastRowPos = position === BoundaryPosition.TOP ? '1' : `${this._terminal.buffer.lines.length}`;\n if (posInSet === lastRowPos) {\n return;\n }\n\n // Don't scroll when the last focused item was not the second row (focus is going the other\n // direction)\n if (e.relatedTarget !== beforeBoundaryElement) {\n return;\n }\n\n // Remove old boundary element from array\n let topBoundaryElement: HTMLElement;\n let bottomBoundaryElement: HTMLElement;\n if (position === BoundaryPosition.TOP) {\n topBoundaryElement = boundaryElement;\n bottomBoundaryElement = this._rowElements.pop()!;\n this._rowContainer.removeChild(bottomBoundaryElement);\n } else {\n topBoundaryElement = this._rowElements.shift()!;\n bottomBoundaryElement = boundaryElement;\n this._rowContainer.removeChild(topBoundaryElement);\n }\n\n // Remove listeners from old boundary elements\n topBoundaryElement.removeEventListener('focus', this._topBoundaryFocusListener);\n bottomBoundaryElement.removeEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Add new element to array/DOM\n if (position === BoundaryPosition.TOP) {\n const newElement = this._createAccessibilityTreeNode();\n this._rowElements.unshift(newElement);\n this._rowContainer.insertAdjacentElement('afterbegin', newElement);\n } else {\n const newElement = this._createAccessibilityTreeNode();\n this._rowElements.push(newElement);\n this._rowContainer.appendChild(newElement);\n }\n\n // Add listeners to new boundary elements\n this._rowElements[0].addEventListener('focus', this._topBoundaryFocusListener);\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Scroll up\n this._terminal.scrollLines(position === BoundaryPosition.TOP ? -1 : 1);\n\n // Focus new boundary before element\n this._rowElements[position === BoundaryPosition.TOP ? 1 : this._rowElements.length - 2].focus();\n\n // Prevent the standard behavior\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n\n private _onResize(rows: number): void {\n // Remove bottom boundary listener\n this._rowElements[this._rowElements.length - 1].removeEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Grow rows as required\n for (let i = this._rowContainer.children.length; i < this._terminal.rows; i++) {\n this._rowElements[i] = this._createAccessibilityTreeNode();\n this._rowContainer.appendChild(this._rowElements[i]);\n }\n // Shrink rows as required\n while (this._rowElements.length > rows) {\n this._rowContainer.removeChild(this._rowElements.pop()!);\n }\n\n // Add bottom boundary listener\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n this._refreshRowsDimensions();\n }\n\n private _createAccessibilityTreeNode(): HTMLElement {\n const element = document.createElement('div');\n element.setAttribute('role', 'listitem');\n element.tabIndex = -1;\n this._refreshRowDimensions(element);\n return element;\n }\n\n private _onTab(spaceCount: number): void {\n for (let i = 0; i < spaceCount; i++) {\n this._onChar(' ');\n }\n }\n\n private _onChar(char: string): void {\n if (this._liveRegionLineCount < MAX_ROWS_TO_READ + 1) {\n if (this._charsToConsume.length > 0) {\n // Have the screen reader ignore the char if it was just input\n const shiftedChar = this._charsToConsume.shift();\n if (shiftedChar !== char) {\n this._charsToAnnounce += char;\n }\n } else {\n this._charsToAnnounce += char;\n }\n\n if (char === '\\n') {\n this._liveRegionLineCount++;\n if (this._liveRegionLineCount === MAX_ROWS_TO_READ + 1) {\n this._liveRegion.textContent += Strings.tooMuchOutput;\n }\n }\n\n // Only detach/attach on mac as otherwise messages can go unaccounced\n if (isMac) {\n if (this._liveRegion.textContent && this._liveRegion.textContent.length > 0 && !this._liveRegion.parentNode) {\n setTimeout(() => {\n this._accessibilityTreeRoot.appendChild(this._liveRegion);\n }, 0);\n }\n }\n }\n }\n\n private _clearLiveRegion(): void {\n this._liveRegion.textContent = '';\n this._liveRegionLineCount = 0;\n\n // Only detach/attach on mac as otherwise messages can go unaccounced\n if (isMac) {\n removeElementFromParent(this._liveRegion);\n }\n }\n\n private _onKey(keyChar: string): void {\n this._clearLiveRegion();\n this._charsToConsume.push(keyChar);\n }\n\n private _refreshRows(start?: number, end?: number): void {\n this._renderRowsDebouncer.refresh(start, end, this._terminal.rows);\n }\n\n private _renderRows(start: number, end: number): void {\n const buffer: IBuffer = this._terminal.buffer;\n const setSize = buffer.lines.length.toString();\n for (let i = start; i <= end; i++) {\n const lineData = buffer.translateBufferLineToString(buffer.ydisp + i, true);\n const posInSet = (buffer.ydisp + i + 1).toString();\n const element = this._rowElements[i];\n if (element) {\n if (lineData.length === 0) {\n element.innerText = '\\u00a0';\n } else {\n element.textContent = lineData;\n }\n element.setAttribute('aria-posinset', posInSet);\n element.setAttribute('aria-setsize', setSize);\n }\n }\n this._announceCharacters();\n }\n\n private _refreshRowsDimensions(): void {\n if (!this._renderService.dimensions.actualCellHeight) {\n return;\n }\n if (this._rowElements.length !== this._terminal.rows) {\n this._onResize(this._terminal.rows);\n }\n for (let i = 0; i < this._terminal.rows; i++) {\n this._refreshRowDimensions(this._rowElements[i]);\n }\n }\n\n private _refreshRowDimensions(element: HTMLElement): void {\n element.style.height = `${this._renderService.dimensions.actualCellHeight}px`;\n }\n\n private _announceCharacters(): void {\n if (this._charsToAnnounce.length === 0) {\n return;\n }\n this._liveRegion.textContent += this._charsToAnnounce;\n this._charsToAnnounce = '';\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ISelectionService } from 'browser/services/Services';\nimport { ICoreService } from 'common/services/Services';\n\n/**\n * Prepares text to be pasted into the terminal by normalizing the line endings\n * @param text The pasted text that needs processing before inserting into the terminal\n */\nexport function prepareTextForTerminal(text: string): string {\n return text.replace(/\\r?\\n/g, '\\r');\n}\n\n/**\n * Bracket text for paste, if necessary, as per https://cirw.in/blog/bracketed-paste\n * @param text The pasted text to bracket\n */\nexport function bracketTextForPaste(text: string, bracketedPasteMode: boolean): string {\n if (bracketedPasteMode) {\n return '\\x1b[200~' + text + '\\x1b[201~';\n }\n return text;\n}\n\n/**\n * Binds copy functionality to the given terminal.\n * @param ev The original copy event to be handled\n */\nexport function copyHandler(ev: ClipboardEvent, selectionService: ISelectionService): void {\n if (ev.clipboardData) {\n ev.clipboardData.setData('text/plain', selectionService.selectionText);\n }\n // Prevent or the original text will be copied.\n ev.preventDefault();\n}\n\n/**\n * Redirect the clipboard's data to the terminal's input handler.\n * @param ev The original paste event to be handled\n * @param term The terminal on which to apply the handled paste event\n */\nexport function handlePasteEvent(ev: ClipboardEvent, textarea: HTMLTextAreaElement, coreService: ICoreService): void {\n ev.stopPropagation();\n if (ev.clipboardData) {\n const text = ev.clipboardData.getData('text/plain');\n paste(text, textarea, coreService);\n }\n}\n\nexport function paste(text: string, textarea: HTMLTextAreaElement, coreService: ICoreService): void {\n text = prepareTextForTerminal(text);\n text = bracketTextForPaste(text, coreService.decPrivateModes.bracketedPasteMode);\n coreService.triggerDataEvent(text, true);\n textarea.value = '';\n}\n\n/**\n * Moves the textarea under the mouse cursor and focuses it.\n * @param ev The original right click event to be handled.\n * @param textarea The terminal's textarea.\n */\nexport function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextAreaElement, screenElement: HTMLElement): void {\n\n // Calculate textarea position relative to the screen element\n const pos = screenElement.getBoundingClientRect();\n const left = ev.clientX - pos.left - 10;\n const top = ev.clientY - pos.top - 10;\n\n // Bring textarea at the cursor position\n textarea.style.width = '20px';\n textarea.style.height = '20px';\n textarea.style.left = `${left}px`;\n textarea.style.top = `${top}px`;\n textarea.style.zIndex = '1000';\n\n textarea.focus();\n}\n\n/**\n * Bind to right-click event and allow right-click copy and paste.\n * @param ev The original right click event to be handled.\n * @param textarea The terminal's textarea.\n * @param selectionService The terminal's selection manager.\n * @param shouldSelectWord If true and there is no selection the current word will be selected\n */\nexport function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, screenElement: HTMLElement, selectionService: ISelectionService, shouldSelectWord: boolean): void {\n moveTextAreaUnderMouseCursor(ev, textarea, screenElement);\n\n if (shouldSelectWord) {\n selectionService.rightClickSelect(ev);\n }\n\n // Get textarea ready to copy from the context menu\n textarea.value = selectionService.selectionText;\n textarea.select();\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColorContrastCache } from 'browser/Types';\nimport { IColor } from 'common/Types';\n\nexport class ColorContrastCache implements IColorContrastCache {\n private _color: { [bg: number]: { [fg: number]: IColor | null | undefined } | undefined } = {};\n private _rgba: { [bg: number]: { [fg: number]: string | null | undefined } | undefined } = {};\n\n public clear(): void {\n this._color = {};\n this._rgba = {};\n }\n\n public setCss(bg: number, fg: number, value: string | null): void {\n if (!this._rgba[bg]) {\n this._rgba[bg] = {};\n }\n this._rgba[bg]![fg] = value;\n }\n\n public getCss(bg: number, fg: number): string | null | undefined {\n return this._rgba[bg] ? this._rgba[bg]![fg] : undefined;\n }\n\n public setColor(bg: number, fg: number, value: IColor | null): void {\n if (!this._color[bg]) {\n this._color[bg] = {};\n }\n this._color[bg]![fg] = value;\n }\n\n public getColor(bg: number, fg: number): IColor | null | undefined {\n return this._color[bg] ? this._color[bg]![fg] : undefined;\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColorManager, IColorSet, IColorContrastCache } from 'browser/Types';\nimport { ITheme } from 'common/services/Services';\nimport { channels, color, css } from 'common/Color';\nimport { ColorContrastCache } from 'browser/ColorContrastCache';\nimport { ColorIndex, IColor } from 'common/Types';\n\n\ninterface IRestoreColorSet {\n foreground: IColor;\n background: IColor;\n cursor: IColor;\n ansi: IColor[];\n}\n\n\nconst DEFAULT_FOREGROUND = css.toColor('#ffffff');\nconst DEFAULT_BACKGROUND = css.toColor('#000000');\nconst DEFAULT_CURSOR = css.toColor('#ffffff');\nconst DEFAULT_CURSOR_ACCENT = css.toColor('#000000');\nconst DEFAULT_SELECTION = {\n css: 'rgba(255, 255, 255, 0.3)',\n rgba: 0xFFFFFF4D\n};\n\n// An IIFE to generate DEFAULT_ANSI_COLORS.\nexport const DEFAULT_ANSI_COLORS = Object.freeze((() => {\n const colors = [\n // dark:\n css.toColor('#2e3436'),\n css.toColor('#cc0000'),\n css.toColor('#4e9a06'),\n css.toColor('#c4a000'),\n css.toColor('#3465a4'),\n css.toColor('#75507b'),\n css.toColor('#06989a'),\n css.toColor('#d3d7cf'),\n // bright:\n css.toColor('#555753'),\n css.toColor('#ef2929'),\n css.toColor('#8ae234'),\n css.toColor('#fce94f'),\n css.toColor('#729fcf'),\n css.toColor('#ad7fa8'),\n css.toColor('#34e2e2'),\n css.toColor('#eeeeec')\n ];\n\n // Fill in the remaining 240 ANSI colors.\n // Generate colors (16-231)\n const v = [0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff];\n for (let i = 0; i < 216; i++) {\n const r = v[(i / 36) % 6 | 0];\n const g = v[(i / 6) % 6 | 0];\n const b = v[i % 6];\n colors.push({\n css: channels.toCss(r, g, b),\n rgba: channels.toRgba(r, g, b)\n });\n }\n\n // Generate greys (232-255)\n for (let i = 0; i < 24; i++) {\n const c = 8 + i * 10;\n colors.push({\n css: channels.toCss(c, c, c),\n rgba: channels.toRgba(c, c, c)\n });\n }\n\n return colors;\n})());\n\n/**\n * Manages the source of truth for a terminal's colors.\n */\nexport class ColorManager implements IColorManager {\n public colors: IColorSet;\n private _ctx: CanvasRenderingContext2D;\n private _litmusColor: CanvasGradient;\n private _contrastCache: IColorContrastCache;\n private _restoreColors!: IRestoreColorSet;\n\n constructor(document: Document, public allowTransparency: boolean) {\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n throw new Error('Could not get rendering context');\n }\n this._ctx = ctx;\n this._ctx.globalCompositeOperation = 'copy';\n this._litmusColor = this._ctx.createLinearGradient(0, 0, 1, 1);\n this._contrastCache = new ColorContrastCache();\n this.colors = {\n foreground: DEFAULT_FOREGROUND,\n background: DEFAULT_BACKGROUND,\n cursor: DEFAULT_CURSOR,\n cursorAccent: DEFAULT_CURSOR_ACCENT,\n selectionTransparent: DEFAULT_SELECTION,\n selectionOpaque: color.blend(DEFAULT_BACKGROUND, DEFAULT_SELECTION),\n selectionForeground: undefined,\n ansi: DEFAULT_ANSI_COLORS.slice(),\n contrastCache: this._contrastCache\n };\n this._updateRestoreColors();\n }\n\n public onOptionsChange(key: string): void {\n if (key === 'minimumContrastRatio') {\n this._contrastCache.clear();\n }\n }\n\n /**\n * Sets the terminal's theme.\n * @param theme The theme to use. If a partial theme is provided then default\n * colors will be used where colors are not defined.\n */\n public setTheme(theme: ITheme = {}): void {\n this.colors.foreground = this._parseColor(theme.foreground, DEFAULT_FOREGROUND);\n this.colors.background = this._parseColor(theme.background, DEFAULT_BACKGROUND);\n this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);\n this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT, true);\n this.colors.selectionTransparent = this._parseColor(theme.selection, DEFAULT_SELECTION, true);\n this.colors.selectionOpaque = color.blend(this.colors.background, this.colors.selectionTransparent);\n const nullColor: IColor = {\n css: '',\n rgba: 0\n };\n this.colors.selectionForeground = theme.selectionForeground ? this._parseColor(theme.selectionForeground, nullColor) : undefined;\n if (this.colors.selectionForeground === nullColor) {\n this.colors.selectionForeground = undefined;\n }\n\n /**\n * If selection color is opaque, blend it with background with 0.3 opacity\n * Issue #2737\n */\n if (color.isOpaque(this.colors.selectionTransparent)) {\n const opacity = 0.3;\n this.colors.selectionTransparent = color.opacity(this.colors.selectionTransparent, opacity);\n }\n this.colors.ansi[0] = this._parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);\n this.colors.ansi[1] = this._parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);\n this.colors.ansi[2] = this._parseColor(theme.green, DEFAULT_ANSI_COLORS[2]);\n this.colors.ansi[3] = this._parseColor(theme.yellow, DEFAULT_ANSI_COLORS[3]);\n this.colors.ansi[4] = this._parseColor(theme.blue, DEFAULT_ANSI_COLORS[4]);\n this.colors.ansi[5] = this._parseColor(theme.magenta, DEFAULT_ANSI_COLORS[5]);\n this.colors.ansi[6] = this._parseColor(theme.cyan, DEFAULT_ANSI_COLORS[6]);\n this.colors.ansi[7] = this._parseColor(theme.white, DEFAULT_ANSI_COLORS[7]);\n this.colors.ansi[8] = this._parseColor(theme.brightBlack, DEFAULT_ANSI_COLORS[8]);\n this.colors.ansi[9] = this._parseColor(theme.brightRed, DEFAULT_ANSI_COLORS[9]);\n this.colors.ansi[10] = this._parseColor(theme.brightGreen, DEFAULT_ANSI_COLORS[10]);\n this.colors.ansi[11] = this._parseColor(theme.brightYellow, DEFAULT_ANSI_COLORS[11]);\n this.colors.ansi[12] = this._parseColor(theme.brightBlue, DEFAULT_ANSI_COLORS[12]);\n this.colors.ansi[13] = this._parseColor(theme.brightMagenta, DEFAULT_ANSI_COLORS[13]);\n this.colors.ansi[14] = this._parseColor(theme.brightCyan, DEFAULT_ANSI_COLORS[14]);\n this.colors.ansi[15] = this._parseColor(theme.brightWhite, DEFAULT_ANSI_COLORS[15]);\n // Clear our the cache\n this._contrastCache.clear();\n this._updateRestoreColors();\n }\n\n public restoreColor(slot?: ColorIndex): void {\n // unset slot restores all ansi colors\n if (slot === undefined) {\n for (let i = 0; i < this._restoreColors.ansi.length; ++i) {\n this.colors.ansi[i] = this._restoreColors.ansi[i];\n }\n return;\n }\n switch (slot) {\n case ColorIndex.FOREGROUND:\n this.colors.foreground = this._restoreColors.foreground;\n break;\n case ColorIndex.BACKGROUND:\n this.colors.background = this._restoreColors.background;\n break;\n case ColorIndex.CURSOR:\n this.colors.cursor = this._restoreColors.cursor;\n break;\n default:\n this.colors.ansi[slot] = this._restoreColors.ansi[slot];\n }\n }\n\n private _updateRestoreColors(): void {\n this._restoreColors = {\n foreground: this.colors.foreground,\n background: this.colors.background,\n cursor: this.colors.cursor,\n ansi: this.colors.ansi.slice()\n };\n }\n\n private _parseColor(\n css: string | undefined,\n fallback: IColor,\n allowTransparency: boolean = this.allowTransparency\n ): IColor {\n if (css === undefined) {\n return fallback;\n }\n\n // If parsing the value results in failure, then it must be ignored, and the attribute must\n // retain its previous value.\n // -- https://html.spec.whatwg.org/multipage/canvas.html#fill-and-stroke-styles\n this._ctx.fillStyle = this._litmusColor;\n this._ctx.fillStyle = css;\n if (typeof this._ctx.fillStyle !== 'string') {\n console.warn(`Color: ${css} is invalid using fallback ${fallback.css}`);\n return fallback;\n }\n\n this._ctx.fillRect(0, 0, 1, 1);\n const data = this._ctx.getImageData(0, 0, 1, 1).data;\n\n // Check if the printed color was transparent\n if (data[3] !== 0xFF) {\n if (!allowTransparency) {\n // Ideally we'd just ignore the alpha channel, but...\n //\n // Browsers may not give back exactly the same RGB values we put in, because most/all\n // convert the color to a pre-multiplied representation. getImageData converts that back to\n // a un-premultipled representation, but the precision loss may make the RGB channels unuable\n // on their own.\n //\n // E.g. In Chrome #12345610 turns into #10305010, and in the extreme case, 0xFFFFFF00 turns\n // into 0x00000000.\n //\n // \"Note: Due to the lossy nature of converting to and from premultiplied alpha color values,\n // pixels that have just been set using putImageData() might be returned to an equivalent\n // getImageData() as different values.\"\n // -- https://html.spec.whatwg.org/multipage/canvas.html#pixel-manipulation\n //\n // So let's just use the fallback color in this case instead.\n console.warn(\n `Color: ${css} is using transparency, but allowTransparency is false. ` +\n `Using fallback ${fallback.css}.`\n );\n return fallback;\n }\n\n // https://html.spec.whatwg.org/multipage/canvas.html#serialisation-of-a-color\n // the color value has alpha less than 1.0, and the string is the color value in the CSS rgba()\n const [r, g, b, a] = this._ctx.fillStyle.substring(5, this._ctx.fillStyle.length - 1).split(',').map(component => Number(component));\n const alpha = Math.round(a * 255);\n const rgba: number = channels.toRgba(r, g, b, alpha);\n return {\n rgba,\n css\n };\n }\n\n return {\n // https://html.spec.whatwg.org/multipage/canvas.html#serialisation-of-a-color\n // if it has alpha equal to 1.0, then the string is a lowercase six-digit hex value, prefixed with a \"#\" character\n css: this._ctx.fillStyle,\n rgba: channels.toRgba(data[0], data[1], data[2], data[3])\n };\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function removeElementFromParent(...elements: (HTMLElement | undefined)[]): void {\n for (const e of elements) {\n e?.parentElement?.removeChild(e);\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\n/**\n * Adds a disposable listener to a node in the DOM, returning the disposable.\n * @param type The event type.\n * @param handler The handler for the listener.\n */\nexport function addDisposableDomListener(\n node: Element | Window | Document,\n type: string,\n handler: (e: any) => void,\n options?: boolean | AddEventListenerOptions\n): IDisposable {\n node.addEventListener(type, handler, options);\n let disposed = false;\n return {\n dispose: () => {\n if (disposed) {\n return;\n }\n disposed = true;\n node.removeEventListener(type, handler, options);\n }\n };\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILinkifierEvent, ILinkMatcher, LinkMatcherHandler, ILinkMatcherOptions, ILinkifier, IMouseZoneManager, IMouseZone, IRegisteredLinkMatcher } from 'browser/Types';\nimport { IBufferStringIteratorResult } from 'common/buffer/Types';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { ILogService, IBufferService, IOptionsService, IUnicodeService } from 'common/services/Services';\n\n/**\n * Limit of the unwrapping line expansion (overscan) at the top and bottom\n * of the actual viewport in ASCII characters.\n * A limit of 2000 should match most sane urls.\n */\nconst OVERSCAN_CHAR_LIMIT = 2000;\n\n/**\n * The Linkifier applies links to rows shortly after they have been refreshed.\n */\nexport class Linkifier implements ILinkifier {\n /**\n * The time to wait after a row is changed before it is linkified. This prevents\n * the costly operation of searching every row multiple times, potentially a\n * huge amount of times.\n */\n protected static _timeBeforeLatency = 200;\n\n protected _linkMatchers: IRegisteredLinkMatcher[] = [];\n\n private _mouseZoneManager: IMouseZoneManager | undefined;\n private _element: HTMLElement | undefined;\n\n private _rowsTimeoutId: number | undefined;\n private _nextLinkMatcherId = 0;\n private _rowsToLinkify: { start: number | undefined, end: number | undefined };\n\n private _onShowLinkUnderline = new EventEmitter();\n public get onShowLinkUnderline(): IEvent { return this._onShowLinkUnderline.event; }\n private _onHideLinkUnderline = new EventEmitter();\n public get onHideLinkUnderline(): IEvent { return this._onHideLinkUnderline.event; }\n private _onLinkTooltip = new EventEmitter();\n public get onLinkTooltip(): IEvent { return this._onLinkTooltip.event; }\n\n constructor(\n @IBufferService protected readonly _bufferService: IBufferService,\n @ILogService private readonly _logService: ILogService,\n @IUnicodeService private readonly _unicodeService: IUnicodeService\n ) {\n this._rowsToLinkify = {\n start: undefined,\n end: undefined\n };\n }\n\n /**\n * Attaches the linkifier to the DOM, enabling linkification.\n * @param mouseZoneManager The mouse zone manager to register link zones with.\n */\n public attachToDom(element: HTMLElement, mouseZoneManager: IMouseZoneManager): void {\n this._element = element;\n this._mouseZoneManager = mouseZoneManager;\n }\n\n /**\n * Queue linkification on a set of rows.\n * @param start The row to linkify from (inclusive).\n * @param end The row to linkify to (inclusive).\n */\n public linkifyRows(start: number, end: number): void {\n // Don't attempt linkify if not yet attached to DOM\n if (!this._mouseZoneManager) {\n return;\n }\n\n // Increase range to linkify\n if (this._rowsToLinkify.start === undefined || this._rowsToLinkify.end === undefined) {\n this._rowsToLinkify.start = start;\n this._rowsToLinkify.end = end;\n } else {\n this._rowsToLinkify.start = Math.min(this._rowsToLinkify.start, start);\n this._rowsToLinkify.end = Math.max(this._rowsToLinkify.end, end);\n }\n\n // Clear out any existing links on this row range\n this._mouseZoneManager.clearAll(start, end);\n\n // Restart timer\n if (this._rowsTimeoutId) {\n clearTimeout(this._rowsTimeoutId);\n }\n\n // Cannot use window.setTimeout since tests need to run in node\n this._rowsTimeoutId = setTimeout(() => this._linkifyRows(), Linkifier._timeBeforeLatency) as any as number;\n }\n\n /**\n * Linkifies the rows requested.\n */\n private _linkifyRows(): void {\n this._rowsTimeoutId = undefined;\n const buffer = this._bufferService.buffer;\n\n if (this._rowsToLinkify.start === undefined || this._rowsToLinkify.end === undefined) {\n this._logService.debug('_rowToLinkify was unset before _linkifyRows was called');\n return;\n }\n\n // Ensure the start row exists\n const absoluteRowIndexStart = buffer.ydisp + this._rowsToLinkify.start;\n if (absoluteRowIndexStart >= buffer.lines.length) {\n return;\n }\n\n // Invalidate bad end row values (if a resize happened)\n const absoluteRowIndexEnd = buffer.ydisp + Math.min(this._rowsToLinkify.end, this._bufferService.rows) + 1;\n\n // Iterate over the range of unwrapped content strings within start..end\n // (excluding).\n // _doLinkifyRow gets full unwrapped lines with the start row as buffer offset\n // for every matcher.\n // The unwrapping is needed to also match content that got wrapped across\n // several buffer lines. To avoid a worst case scenario where the whole buffer\n // contains just a single unwrapped string we limit this line expansion beyond\n // the viewport to +OVERSCAN_CHAR_LIMIT chars (overscan) at top and bottom.\n // This comes with the tradeoff that matches longer than OVERSCAN_CHAR_LIMIT\n // chars will not match anymore at the viewport borders.\n const overscanLineLimit = Math.ceil(OVERSCAN_CHAR_LIMIT / this._bufferService.cols);\n const iterator = this._bufferService.buffer.iterator(\n false, absoluteRowIndexStart, absoluteRowIndexEnd, overscanLineLimit, overscanLineLimit);\n while (iterator.hasNext()) {\n const lineData: IBufferStringIteratorResult = iterator.next();\n for (let i = 0; i < this._linkMatchers.length; i++) {\n this._doLinkifyRow(lineData.range.first, lineData.content, this._linkMatchers[i]);\n }\n }\n\n this._rowsToLinkify.start = undefined;\n this._rowsToLinkify.end = undefined;\n }\n\n /**\n * Registers a link matcher, allowing custom link patterns to be matched and\n * handled.\n * @param regex The regular expression to search for. Specifically, this\n * searches the textContent of the rows. You will want to use \\s to match a\n * space ' ' character for example.\n * @param handler The callback when the link is called.\n * @param options Options for the link matcher.\n * @return The ID of the new matcher, this can be used to deregister.\n */\n public registerLinkMatcher(regex: RegExp, handler: LinkMatcherHandler, options: ILinkMatcherOptions = {}): number {\n if (!handler) {\n throw new Error('handler must be defined');\n }\n const matcher: IRegisteredLinkMatcher = {\n id: this._nextLinkMatcherId++,\n regex,\n handler,\n matchIndex: options.matchIndex,\n validationCallback: options.validationCallback,\n hoverTooltipCallback: options.tooltipCallback,\n hoverLeaveCallback: options.leaveCallback,\n willLinkActivate: options.willLinkActivate,\n priority: options.priority || 0\n };\n this._addLinkMatcherToList(matcher);\n return matcher.id;\n }\n\n /**\n * Inserts a link matcher to the list in the correct position based on the\n * priority of each link matcher. New link matchers of equal priority are\n * considered after older link matchers.\n * @param matcher The link matcher to be added.\n */\n private _addLinkMatcherToList(matcher: IRegisteredLinkMatcher): void {\n if (this._linkMatchers.length === 0) {\n this._linkMatchers.push(matcher);\n return;\n }\n\n for (let i = this._linkMatchers.length - 1; i >= 0; i--) {\n if (matcher.priority <= this._linkMatchers[i].priority) {\n this._linkMatchers.splice(i + 1, 0, matcher);\n return;\n }\n }\n\n this._linkMatchers.splice(0, 0, matcher);\n }\n\n /**\n * Deregisters a link matcher if it has been registered.\n * @param matcherId The link matcher's ID (returned after register)\n * @return Whether a link matcher was found and deregistered.\n */\n public deregisterLinkMatcher(matcherId: number): boolean {\n for (let i = 0; i < this._linkMatchers.length; i++) {\n if (this._linkMatchers[i].id === matcherId) {\n this._linkMatchers.splice(i, 1);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Linkifies a row given a specific handler.\n * @param rowIndex The row index to linkify (absolute index).\n * @param text string content of the unwrapped row.\n * @param matcher The link matcher for this line.\n */\n private _doLinkifyRow(rowIndex: number, text: string, matcher: ILinkMatcher): void {\n // clone regex to do a global search on text\n const rex = new RegExp(matcher.regex.source, (matcher.regex.flags || '') + 'g');\n let match;\n let stringIndex = -1;\n while ((match = rex.exec(text)) !== null) {\n const uri = match[typeof matcher.matchIndex !== 'number' ? 0 : matcher.matchIndex];\n if (!uri) {\n // something matched but does not comply with the given matchIndex\n // since this is most likely a bug the regex itself we simply do nothing here\n this._logService.debug('match found without corresponding matchIndex', match, matcher);\n break;\n }\n\n // Get index, match.index is for the outer match which includes negated chars\n // therefore we cannot use match.index directly, instead we search the position\n // of the match group in text again\n // also correct regex and string search offsets for the next loop run\n stringIndex = text.indexOf(uri, stringIndex + 1);\n rex.lastIndex = stringIndex + uri.length;\n if (stringIndex < 0) {\n // invalid stringIndex (should not have happened)\n break;\n }\n\n // get the buffer index as [absolute row, col] for the match\n const bufferIndex = this._bufferService.buffer.stringIndexToBufferIndex(rowIndex, stringIndex);\n if (bufferIndex[0] < 0) {\n // invalid bufferIndex (should not have happened)\n break;\n }\n\n const line = this._bufferService.buffer.lines.get(bufferIndex[0]);\n if (!line) {\n break;\n }\n\n const attr = line.getFg(bufferIndex[1]);\n const fg = attr ? (attr >> 9) & 0x1ff : undefined;\n\n if (matcher.validationCallback) {\n matcher.validationCallback(uri, isValid => {\n // Discard link if the line has already changed\n if (this._rowsTimeoutId) {\n return;\n }\n if (isValid) {\n this._addLink(bufferIndex[1], bufferIndex[0] - this._bufferService.buffer.ydisp, uri, matcher, fg);\n }\n });\n } else {\n this._addLink(bufferIndex[1], bufferIndex[0] - this._bufferService.buffer.ydisp, uri, matcher, fg);\n }\n }\n }\n\n /**\n * Registers a link to the mouse zone manager.\n * @param x The column the link starts.\n * @param y The row the link is on.\n * @param uri The URI of the link.\n * @param matcher The link matcher for the link.\n * @param fg The link color for hover event.\n */\n private _addLink(x: number, y: number, uri: string, matcher: ILinkMatcher, fg: number | undefined): void {\n if (!this._mouseZoneManager || !this._element) {\n return;\n }\n // FIXME: get cell length from buffer to avoid mismatch after Unicode version change\n const width = this._unicodeService.getStringCellWidth(uri);\n const x1 = x % this._bufferService.cols;\n const y1 = y + Math.floor(x / this._bufferService.cols);\n let x2 = (x1 + width) % this._bufferService.cols;\n let y2 = y1 + Math.floor((x1 + width) / this._bufferService.cols);\n if (x2 === 0) {\n x2 = this._bufferService.cols;\n y2--;\n }\n\n this._mouseZoneManager.add(new MouseZone(\n x1 + 1,\n y1 + 1,\n x2 + 1,\n y2 + 1,\n e => {\n if (matcher.handler) {\n return matcher.handler(e, uri);\n }\n const newWindow = window.open();\n if (newWindow) {\n newWindow.opener = null;\n newWindow.location.href = uri;\n } else {\n console.warn('Opening link blocked as opener could not be cleared');\n }\n },\n () => {\n this._onShowLinkUnderline.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));\n this._element!.classList.add('xterm-cursor-pointer');\n },\n e => {\n this._onLinkTooltip.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));\n if (matcher.hoverTooltipCallback) {\n // Note that IViewportRange use 1-based coordinates to align with escape sequences such\n // as CUP which use 1,1 as the default for row/col\n matcher.hoverTooltipCallback(e, uri, { start: { x: x1, y: y1 }, end: { x: x2, y: y2 } });\n }\n },\n () => {\n this._onHideLinkUnderline.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));\n this._element!.classList.remove('xterm-cursor-pointer');\n if (matcher.hoverLeaveCallback) {\n matcher.hoverLeaveCallback();\n }\n },\n e => {\n if (matcher.willLinkActivate) {\n return matcher.willLinkActivate(e, uri);\n }\n return true;\n }\n ));\n }\n\n private _createLinkHoverEvent(x1: number, y1: number, x2: number, y2: number, fg: number | undefined): ILinkifierEvent {\n return { x1, y1, x2, y2, cols: this._bufferService.cols, fg };\n }\n}\n\nexport class MouseZone implements IMouseZone {\n constructor(\n public x1: number,\n public y1: number,\n public x2: number,\n public y2: number,\n public clickCallback: (e: MouseEvent) => any,\n public hoverCallback: (e: MouseEvent) => any,\n public tooltipCallback: (e: MouseEvent) => any,\n public leaveCallback: () => void,\n public willLinkActivate: (e: MouseEvent) => boolean\n ) {\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILinkifier2, ILinkProvider, IBufferCellPosition, ILink, ILinkifierEvent, ILinkDecorations, ILinkWithState } from 'browser/Types';\nimport { IDisposable } from 'common/Types';\nimport { IMouseService, IRenderService } from './services/Services';\nimport { IBufferService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable, getDisposeArrayDisposable, disposeArray } from 'common/Lifecycle';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\n\nexport class Linkifier2 extends Disposable implements ILinkifier2 {\n private _element: HTMLElement | undefined;\n private _mouseService: IMouseService | undefined;\n private _renderService: IRenderService | undefined;\n private _linkProviders: ILinkProvider[] = [];\n public get currentLink(): ILinkWithState | undefined { return this._currentLink; }\n protected _currentLink: ILinkWithState | undefined;\n private _mouseDownLink: ILinkWithState | undefined;\n private _lastMouseEvent: MouseEvent | undefined;\n private _linkCacheDisposables: IDisposable[] = [];\n private _lastBufferCell: IBufferCellPosition | undefined;\n private _isMouseOut: boolean = true;\n private _activeProviderReplies: Map | undefined;\n private _activeLine: number = -1;\n\n private _onShowLinkUnderline = this.register(new EventEmitter());\n public get onShowLinkUnderline(): IEvent { return this._onShowLinkUnderline.event; }\n private _onHideLinkUnderline = this.register(new EventEmitter());\n public get onHideLinkUnderline(): IEvent { return this._onHideLinkUnderline.event; }\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n super();\n this.register(getDisposeArrayDisposable(this._linkCacheDisposables));\n }\n\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n this._linkProviders.push(linkProvider);\n return {\n dispose: () => {\n // Remove the link provider from the list\n const providerIndex = this._linkProviders.indexOf(linkProvider);\n\n if (providerIndex !== -1) {\n this._linkProviders.splice(providerIndex, 1);\n }\n }\n };\n }\n\n public attachToDom(element: HTMLElement, mouseService: IMouseService, renderService: IRenderService): void {\n this._element = element;\n this._mouseService = mouseService;\n this._renderService = renderService;\n\n this.register(addDisposableDomListener(this._element, 'mouseleave', () => {\n this._isMouseOut = true;\n this._clearCurrentLink();\n }));\n this.register(addDisposableDomListener(this._element, 'mousemove', this._onMouseMove.bind(this)));\n this.register(addDisposableDomListener(this._element, 'mousedown', this._handleMouseDown.bind(this)));\n this.register(addDisposableDomListener(this._element, 'mouseup', this._handleMouseUp.bind(this)));\n }\n\n private _onMouseMove(event: MouseEvent): void {\n this._lastMouseEvent = event;\n\n if (!this._element || !this._mouseService) {\n return;\n }\n\n const position = this._positionFromMouseEvent(event, this._element, this._mouseService);\n if (!position) {\n return;\n }\n this._isMouseOut = false;\n\n // Ignore the event if it's an embedder created hover widget\n const composedPath = event.composedPath() as HTMLElement[];\n for (let i = 0; i < composedPath.length; i++) {\n const target = composedPath[i];\n // Hit Terminal.element, break and continue\n if (target.classList.contains('xterm')) {\n break;\n }\n // It's a hover, don't respect hover event\n if (target.classList.contains('xterm-hover')) {\n return;\n }\n }\n\n if (!this._lastBufferCell || (position.x !== this._lastBufferCell.x || position.y !== this._lastBufferCell.y)) {\n this._onHover(position);\n this._lastBufferCell = position;\n }\n }\n\n private _onHover(position: IBufferCellPosition): void {\n // TODO: This currently does not cache link provider results across wrapped lines, activeLine should be something like `activeRange: {startY, endY}`\n // Check if we need to clear the link\n if (this._activeLine !== position.y) {\n this._clearCurrentLink();\n this._askForLink(position, false);\n return;\n }\n\n // Check the if the link is in the mouse position\n const isCurrentLinkInPosition = this._currentLink && this._linkAtPosition(this._currentLink.link, position);\n if (!isCurrentLinkInPosition) {\n this._clearCurrentLink();\n this._askForLink(position, true);\n }\n }\n\n private _askForLink(position: IBufferCellPosition, useLineCache: boolean): void {\n if (!this._activeProviderReplies || !useLineCache) {\n this._activeProviderReplies?.forEach(reply => {\n reply?.forEach(linkWithState => {\n if (linkWithState.link.dispose) {\n linkWithState.link.dispose();\n }\n });\n });\n this._activeProviderReplies = new Map();\n this._activeLine = position.y;\n }\n let linkProvided = false;\n\n // There is no link cached, so ask for one\n for (const [i, linkProvider] of this._linkProviders.entries()) {\n if (useLineCache) {\n const existingReply = this._activeProviderReplies?.get(i);\n // If there isn't a reply, the provider hasn't responded yet.\n\n // TODO: If there isn't a reply yet it means that the provider is still resolving. Ensuring\n // provideLinks isn't triggered again saves ILink.hover firing twice though. This probably\n // needs promises to get fixed\n if (existingReply) {\n linkProvided = this._checkLinkProviderResult(i, position, linkProvided);\n }\n } else {\n linkProvider.provideLinks(position.y, (links: ILink[] | undefined) => {\n if (this._isMouseOut) {\n return;\n }\n const linksWithState: ILinkWithState[] | undefined = links?.map(link => ({ link }));\n this._activeProviderReplies?.set(i, linksWithState);\n linkProvided = this._checkLinkProviderResult(i, position, linkProvided);\n\n // If all providers have responded, remove lower priority links that intersect ranges of\n // higher priority links\n if (this._activeProviderReplies?.size === this._linkProviders.length) {\n this._removeIntersectingLinks(position.y, this._activeProviderReplies);\n }\n });\n }\n }\n }\n\n private _removeIntersectingLinks(y: number, replies: Map): void {\n const occupiedCells = new Set();\n for (let i = 0; i < replies.size; i++) {\n const providerReply = replies.get(i);\n if (!providerReply) {\n continue;\n }\n for (let i = 0; i < providerReply.length; i++) {\n const linkWithState = providerReply[i];\n const startX = linkWithState.link.range.start.y < y ? 0 : linkWithState.link.range.start.x;\n const endX = linkWithState.link.range.end.y > y ? this._bufferService.cols : linkWithState.link.range.end.x;\n for (let x = startX; x <= endX; x++) {\n if (occupiedCells.has(x)) {\n providerReply.splice(i--, 1);\n break;\n }\n occupiedCells.add(x);\n }\n }\n }\n }\n\n private _checkLinkProviderResult(index: number, position: IBufferCellPosition, linkProvided: boolean): boolean {\n if (!this._activeProviderReplies) {\n return linkProvided;\n }\n\n const links = this._activeProviderReplies.get(index);\n\n // Check if every provider before this one has come back undefined\n let hasLinkBefore = false;\n for (let j = 0; j < index; j++) {\n if (!this._activeProviderReplies.has(j) || this._activeProviderReplies.get(j)) {\n hasLinkBefore = true;\n }\n }\n\n // If all providers with higher priority came back undefined, then this provider's link for\n // the position should be used\n if (!hasLinkBefore && links) {\n const linkAtPosition = links.find(link => this._linkAtPosition(link.link, position));\n if (linkAtPosition) {\n linkProvided = true;\n this._handleNewLink(linkAtPosition);\n }\n }\n\n // Check if all the providers have responded\n if (this._activeProviderReplies.size === this._linkProviders.length && !linkProvided) {\n // Respect the order of the link providers\n for (let j = 0; j < this._activeProviderReplies.size; j++) {\n const currentLink = this._activeProviderReplies.get(j)?.find(link => this._linkAtPosition(link.link, position));\n if (currentLink) {\n linkProvided = true;\n this._handleNewLink(currentLink);\n break;\n }\n }\n }\n\n return linkProvided;\n }\n\n private _handleMouseDown(): void {\n this._mouseDownLink = this._currentLink;\n }\n\n private _handleMouseUp(event: MouseEvent): void {\n if (!this._element || !this._mouseService || !this._currentLink) {\n return;\n }\n\n const position = this._positionFromMouseEvent(event, this._element, this._mouseService);\n if (!position) {\n return;\n }\n\n if (this._mouseDownLink === this._currentLink && this._linkAtPosition(this._currentLink.link, position)) {\n this._currentLink.link.activate(event, this._currentLink.link.text);\n }\n }\n\n private _clearCurrentLink(startRow?: number, endRow?: number): void {\n if (!this._element || !this._currentLink || !this._lastMouseEvent) {\n return;\n }\n\n // If we have a start and end row, check that the link is within it\n if (!startRow || !endRow || (this._currentLink.link.range.start.y >= startRow && this._currentLink.link.range.end.y <= endRow)) {\n this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent);\n this._currentLink = undefined;\n disposeArray(this._linkCacheDisposables);\n }\n }\n\n private _handleNewLink(linkWithState: ILinkWithState): void {\n if (!this._element || !this._lastMouseEvent || !this._mouseService) {\n return;\n }\n\n const position = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);\n\n if (!position) {\n return;\n }\n\n // Trigger hover if the we have a link at the position\n if (this._linkAtPosition(linkWithState.link, position)) {\n this._currentLink = linkWithState;\n this._currentLink.state = {\n decorations: {\n underline: linkWithState.link.decorations === undefined ? true : linkWithState.link.decorations.underline,\n pointerCursor: linkWithState.link.decorations === undefined ? true : linkWithState.link.decorations.pointerCursor\n },\n isHovered: true\n };\n this._linkHover(this._element, linkWithState.link, this._lastMouseEvent);\n\n // Add listener for tracking decorations changes\n linkWithState.link.decorations = {} as ILinkDecorations;\n Object.defineProperties(linkWithState.link.decorations, {\n pointerCursor: {\n get: () => this._currentLink?.state?.decorations.pointerCursor,\n set: v => {\n if (this._currentLink?.state && this._currentLink.state.decorations.pointerCursor !== v) {\n this._currentLink.state.decorations.pointerCursor = v;\n if (this._currentLink.state.isHovered) {\n this._element?.classList.toggle('xterm-cursor-pointer', v);\n }\n }\n }\n },\n underline: {\n get: () => this._currentLink?.state?.decorations.underline,\n set: v => {\n if (this._currentLink?.state && this._currentLink?.state?.decorations.underline !== v) {\n this._currentLink.state.decorations.underline = v;\n if (this._currentLink.state.isHovered) {\n this._fireUnderlineEvent(linkWithState.link, v);\n }\n }\n }\n }\n });\n\n // Add listener for rerendering\n if (this._renderService) {\n this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e => {\n // When start is 0 a scroll most likely occurred, make sure links above the fold also get\n // cleared.\n const start = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp;\n this._clearCurrentLink(start, e.end + 1 + this._bufferService.buffer.ydisp);\n }));\n }\n }\n }\n\n protected _linkHover(element: HTMLElement, link: ILink, event: MouseEvent): void {\n if (this._currentLink?.state) {\n this._currentLink.state.isHovered = true;\n if (this._currentLink.state.decorations.underline) {\n this._fireUnderlineEvent(link, true);\n }\n if (this._currentLink.state.decorations.pointerCursor) {\n element.classList.add('xterm-cursor-pointer');\n }\n }\n\n if (link.hover) {\n link.hover(event, link.text);\n }\n }\n\n private _fireUnderlineEvent(link: ILink, showEvent: boolean): void {\n const range = link.range;\n const scrollOffset = this._bufferService.buffer.ydisp;\n const event = this._createLinkUnderlineEvent(range.start.x - 1, range.start.y - scrollOffset - 1, range.end.x, range.end.y - scrollOffset - 1, undefined);\n const emitter = showEvent ? this._onShowLinkUnderline : this._onHideLinkUnderline;\n emitter.fire(event);\n }\n\n protected _linkLeave(element: HTMLElement, link: ILink, event: MouseEvent): void {\n if (this._currentLink?.state) {\n this._currentLink.state.isHovered = false;\n if (this._currentLink.state.decorations.underline) {\n this._fireUnderlineEvent(link, false);\n }\n if (this._currentLink.state.decorations.pointerCursor) {\n element.classList.remove('xterm-cursor-pointer');\n }\n }\n\n if (link.leave) {\n link.leave(event, link.text);\n }\n }\n\n /**\n * Check if the buffer position is within the link\n * @param link\n * @param position\n */\n private _linkAtPosition(link: ILink, position: IBufferCellPosition): boolean {\n const sameLine = link.range.start.y === link.range.end.y;\n const wrappedFromLeft = link.range.start.y < position.y;\n const wrappedToRight = link.range.end.y > position.y;\n\n // If the start and end have the same y, then the position must be between start and end x\n // If not, then handle each case seperately, depending on which way it wraps\n return ((sameLine && link.range.start.x <= position.x && link.range.end.x >= position.x) ||\n (wrappedFromLeft && link.range.end.x >= position.x) ||\n (wrappedToRight && link.range.start.x <= position.x) ||\n (wrappedFromLeft && wrappedToRight)) &&\n link.range.start.y <= position.y &&\n link.range.end.y >= position.y;\n }\n\n /**\n * Get the buffer position from a mouse event\n * @param event\n */\n private _positionFromMouseEvent(event: MouseEvent, element: HTMLElement, mouseService: IMouseService): IBufferCellPosition | undefined {\n const coords = mouseService.getCoords(event, element, this._bufferService.cols, this._bufferService.rows);\n if (!coords) {\n return;\n }\n\n return { x: coords[0], y: coords[1] + this._bufferService.buffer.ydisp };\n }\n\n private _createLinkUnderlineEvent(x1: number, y1: number, x2: number, y2: number, fg: number | undefined): ILinkifierEvent {\n return { x1, y1, x2, y2, cols: this._bufferService.cols, fg };\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// eslint-disable-next-line prefer-const\nexport let promptLabel = 'Terminal input';\n\n// eslint-disable-next-line prefer-const\nexport let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read';\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable } from 'common/Lifecycle';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IMouseService, ISelectionService } from 'browser/services/Services';\nimport { IMouseZoneManager, IMouseZone } from 'browser/Types';\nimport { IBufferService, IOptionsService } from 'common/services/Services';\n\n/**\n * The MouseZoneManager allows components to register zones within the terminal\n * that trigger hover and click callbacks.\n *\n * This class was intentionally made not so robust initially as the only case it\n * needed to support was single-line links which never overlap. Improvements can\n * be made in the future.\n */\nexport class MouseZoneManager extends Disposable implements IMouseZoneManager {\n private _zones: IMouseZone[] = [];\n\n private _areZonesActive: boolean = false;\n private _mouseMoveListener: (e: MouseEvent) => any;\n private _mouseLeaveListener: (e: MouseEvent) => any;\n private _clickListener: (e: MouseEvent) => any;\n\n private _tooltipTimeout: number | undefined;\n private _currentZone: IMouseZone | undefined;\n private _lastHoverCoords: [number | undefined, number | undefined] = [undefined, undefined];\n private _initialSelectionLength: number = 0;\n\n constructor(\n private readonly _element: HTMLElement,\n private readonly _screenElement: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IMouseService private readonly _mouseService: IMouseService,\n @ISelectionService private readonly _selectionService: ISelectionService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n\n this.register(addDisposableDomListener(this._element, 'mousedown', e => this._onMouseDown(e)));\n\n // These events are expensive, only listen to it when mouse zones are active\n this._mouseMoveListener = e => this._onMouseMove(e);\n this._mouseLeaveListener = e => this._onMouseLeave(e);\n this._clickListener = e => this._onClick(e);\n }\n\n public dispose(): void {\n super.dispose();\n this._deactivate();\n }\n\n public add(zone: IMouseZone): void {\n this._zones.push(zone);\n if (this._zones.length === 1) {\n this._activate();\n }\n }\n\n public clearAll(start?: number, end?: number): void {\n // Exit if there's nothing to clear\n if (this._zones.length === 0) {\n return;\n }\n\n // Clear all if start/end weren't set\n if (!start || !end) {\n start = 0;\n end = this._bufferService.rows - 1;\n }\n\n // Iterate through zones and clear them out if they're within the range\n for (let i = 0; i < this._zones.length; i++) {\n const zone = this._zones[i];\n if ((zone.y1 > start && zone.y1 <= end + 1) ||\n (zone.y2 > start && zone.y2 <= end + 1) ||\n (zone.y1 < start && zone.y2 > end + 1)) {\n if (this._currentZone && this._currentZone === zone) {\n this._currentZone.leaveCallback();\n this._currentZone = undefined;\n }\n this._zones.splice(i--, 1);\n }\n }\n\n // Deactivate the mouse zone manager if all the zones have been removed\n if (this._zones.length === 0) {\n this._deactivate();\n }\n }\n\n private _activate(): void {\n if (!this._areZonesActive) {\n this._areZonesActive = true;\n this._element.addEventListener('mousemove', this._mouseMoveListener);\n this._element.addEventListener('mouseleave', this._mouseLeaveListener);\n this._element.addEventListener('click', this._clickListener);\n }\n }\n\n private _deactivate(): void {\n if (this._areZonesActive) {\n this._areZonesActive = false;\n this._element.removeEventListener('mousemove', this._mouseMoveListener);\n this._element.removeEventListener('mouseleave', this._mouseLeaveListener);\n this._element.removeEventListener('click', this._clickListener);\n }\n }\n\n private _onMouseMove(e: MouseEvent): void {\n // TODO: Ideally this would only clear the hover state when the mouse moves\n // outside of the mouse zone\n if (this._lastHoverCoords[0] !== e.pageX || this._lastHoverCoords[1] !== e.pageY) {\n this._onHover(e);\n // Record the current coordinates\n this._lastHoverCoords = [e.pageX, e.pageY];\n }\n }\n\n private _onHover(e: MouseEvent): void {\n const zone = this._findZoneEventAt(e);\n\n // Do nothing if the zone is the same\n if (zone === this._currentZone) {\n return;\n }\n\n // Fire the hover end callback and cancel any existing timer if a new zone\n // is being hovered\n if (this._currentZone) {\n this._currentZone.leaveCallback();\n this._currentZone = undefined;\n if (this._tooltipTimeout) {\n clearTimeout(this._tooltipTimeout);\n }\n }\n\n // Exit if there is not zone\n if (!zone) {\n return;\n }\n this._currentZone = zone;\n\n // Trigger the hover callback\n if (zone.hoverCallback) {\n zone.hoverCallback(e);\n }\n\n // Restart the tooltip timeout\n this._tooltipTimeout = window.setTimeout(() => this._onTooltip(e), this._optionsService.rawOptions.linkTooltipHoverDuration);\n }\n\n private _onTooltip(e: MouseEvent): void {\n this._tooltipTimeout = undefined;\n const zone = this._findZoneEventAt(e);\n zone?.tooltipCallback(e);\n }\n\n private _onMouseDown(e: MouseEvent): void {\n // Store current terminal selection length, to check if we're performing\n // a selection operation\n this._initialSelectionLength = this._getSelectionLength();\n\n // Ignore the event if there are no zones active\n if (!this._areZonesActive) {\n return;\n }\n\n // Find the active zone, prevent event propagation if found to prevent other\n // components from handling the mouse event.\n const zone = this._findZoneEventAt(e);\n if (zone?.willLinkActivate(e)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n private _onMouseLeave(e: MouseEvent): void {\n // Fire the hover end callback and cancel any existing timer if the mouse\n // leaves the terminal element\n if (this._currentZone) {\n this._currentZone.leaveCallback();\n this._currentZone = undefined;\n if (this._tooltipTimeout) {\n clearTimeout(this._tooltipTimeout);\n }\n }\n }\n\n private _onClick(e: MouseEvent): void {\n // Find the active zone and click it if found and no selection was\n // being performed\n const zone = this._findZoneEventAt(e);\n const currentSelectionLength = this._getSelectionLength();\n\n if (zone && currentSelectionLength === this._initialSelectionLength) {\n zone.clickCallback(e);\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n private _getSelectionLength(): number {\n const selectionText = this._selectionService.selectionText;\n return selectionText ? selectionText.length : 0;\n }\n\n private _findZoneEventAt(e: MouseEvent): IMouseZone | undefined {\n const coords = this._mouseService.getCoords(e, this._screenElement, this._bufferService.cols, this._bufferService.rows);\n if (!coords) {\n return undefined;\n }\n const x = coords[0];\n const y = coords[1];\n for (let i = 0; i < this._zones.length; i++) {\n const zone = this._zones[i];\n if (zone.y1 === zone.y2) {\n // Single line link\n if (y === zone.y1 && x >= zone.x1 && x < zone.x2) {\n return zone;\n }\n } else {\n // Multi-line link\n if ((y === zone.y1 && x >= zone.x1) ||\n (y === zone.y2 && x < zone.x2) ||\n (y > zone.y1 && y < zone.y2)) {\n return zone;\n }\n }\n }\n return undefined;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDebouncerWithCallback } from 'browser/Types';\n\n/**\n * Debounces calls to render terminal rows using animation frames.\n */\nexport class RenderDebouncer implements IRenderDebouncerWithCallback {\n private _rowStart: number | undefined;\n private _rowEnd: number | undefined;\n private _rowCount: number | undefined;\n private _animationFrame: number | undefined;\n private _refreshCallbacks: FrameRequestCallback[] = [];\n\n constructor(\n private _renderCallback: (start: number, end: number) => void\n ) {\n }\n\n public dispose(): void {\n if (this._animationFrame) {\n window.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public addRefreshCallback(callback: FrameRequestCallback): number {\n this._refreshCallbacks.push(callback);\n if (!this._animationFrame) {\n this._animationFrame = window.requestAnimationFrame(() => this._innerRefresh());\n }\n return this._animationFrame;\n }\n\n public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {\n this._rowCount = rowCount;\n // Get the min/max row start/end for the arg values\n rowStart = rowStart !== undefined ? rowStart : 0;\n rowEnd = rowEnd !== undefined ? rowEnd : this._rowCount - 1;\n // Set the properties to the updated values\n this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart;\n this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd;\n\n if (this._animationFrame) {\n return;\n }\n\n this._animationFrame = window.requestAnimationFrame(() => this._innerRefresh());\n }\n\n private _innerRefresh(): void {\n this._animationFrame = undefined;\n\n // Make sure values are set\n if (this._rowStart === undefined || this._rowEnd === undefined || this._rowCount === undefined) {\n this._runRefreshCallbacks();\n return;\n }\n\n // Clamp values\n const start = Math.max(this._rowStart, 0);\n const end = Math.min(this._rowEnd, this._rowCount - 1);\n\n // Reset debouncer (this happens before render callback as the render could trigger it again)\n this._rowStart = undefined;\n this._rowEnd = undefined;\n\n // Run render callback\n this._renderCallback(start, end);\n this._runRefreshCallbacks();\n }\n\n private _runRefreshCallbacks(): void {\n for (const callback of this._refreshCallbacks) {\n callback(0);\n }\n this._refreshCallbacks = [];\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable } from 'common/Lifecycle';\n\nexport type ScreenDprListener = (newDevicePixelRatio?: number, oldDevicePixelRatio?: number) => void;\n\n/**\n * The screen device pixel ratio monitor allows listening for when the\n * window.devicePixelRatio value changes. This is done not with polling but with\n * the use of window.matchMedia to watch media queries. When the event fires,\n * the listener will be reattached using a different media query to ensure that\n * any further changes will register.\n *\n * The listener should fire on both window zoom changes and switching to a\n * monitor with a different DPI.\n */\nexport class ScreenDprMonitor extends Disposable {\n private _currentDevicePixelRatio: number = window.devicePixelRatio;\n private _outerListener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | undefined;\n private _listener: ScreenDprListener | undefined;\n private _resolutionMediaMatchList: MediaQueryList | undefined;\n\n public setListener(listener: ScreenDprListener): void {\n if (this._listener) {\n this.clearListener();\n }\n this._listener = listener;\n this._outerListener = () => {\n if (!this._listener) {\n return;\n }\n this._listener(window.devicePixelRatio, this._currentDevicePixelRatio);\n this._updateDpr();\n };\n this._updateDpr();\n }\n\n public dispose(): void {\n super.dispose();\n this.clearListener();\n }\n\n private _updateDpr(): void {\n if (!this._outerListener) {\n return;\n }\n\n // Clear listeners for old DPR\n this._resolutionMediaMatchList?.removeListener(this._outerListener);\n\n // Add listeners for new DPR\n this._currentDevicePixelRatio = window.devicePixelRatio;\n this._resolutionMediaMatchList = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);\n this._resolutionMediaMatchList.addListener(this._outerListener);\n }\n\n public clearListener(): void {\n if (!this._resolutionMediaMatchList || !this._listener || !this._outerListener) {\n return;\n }\n this._resolutionMediaMatchList.removeListener(this._outerListener);\n this._resolutionMediaMatchList = undefined;\n this._listener = undefined;\n this._outerListener = undefined;\n }\n}\n", "/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n *\n * Originally forked from (with the author's permission):\n * Fabrice Bellard's javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n *\n * Terminal Emulation References:\n * http://vt100.net/\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html\n * http://invisible-island.net/vttest/\n * http://www.inwap.com/pdp10/ansicode.txt\n * http://linux.die.net/man/4/console_codes\n * http://linux.die.net/man/7/urxvt\n */\n\nimport { ICompositionHelper, ITerminal, IBrowser, CustomKeyEventHandler, ILinkifier, IMouseZoneManager, LinkMatcherHandler, ILinkMatcherOptions, IViewport, ILinkifier2, CharacterJoinerHandler } from 'browser/Types';\nimport { IRenderer } from 'browser/renderer/Types';\nimport { CompositionHelper } from 'browser/input/CompositionHelper';\nimport { Viewport } from 'browser/Viewport';\nimport { rightClickHandler, moveTextAreaUnderMouseCursor, handlePasteEvent, copyHandler, paste } from 'browser/Clipboard';\nimport { C0, C1_ESCAPED } from 'common/data/EscapeSequences';\nimport { WindowsOptionsReportType } from '../common/InputHandler';\nimport { Renderer } from 'browser/renderer/Renderer';\nimport { Linkifier } from 'browser/Linkifier';\nimport { SelectionService } from 'browser/services/SelectionService';\nimport * as Browser from 'common/Platform';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport * as Strings from 'browser/LocalizableStrings';\nimport { SoundService } from 'browser/services/SoundService';\nimport { MouseZoneManager } from 'browser/MouseZoneManager';\nimport { AccessibilityManager } from './AccessibilityManager';\nimport { ITheme, IMarker, IDisposable, ISelectionPosition, ILinkProvider, IDecorationOptions, IDecoration } from 'xterm';\nimport { DomRenderer } from 'browser/renderer/dom/DomRenderer';\nimport { KeyboardResultType, CoreMouseEventType, CoreMouseButton, CoreMouseAction, ITerminalOptions, ScrollSource, IColorEvent, ColorIndex, ColorRequestType } from 'common/Types';\nimport { evaluateKeyboardEvent } from 'common/input/Keyboard';\nimport { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';\nimport { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { ColorManager } from 'browser/ColorManager';\nimport { RenderService } from 'browser/services/RenderService';\nimport { ICharSizeService, IRenderService, IMouseService, ISelectionService, ISoundService, ICoreBrowserService, ICharacterJoinerService } from 'browser/services/Services';\nimport { CharSizeService } from 'browser/services/CharSizeService';\nimport { IBuffer } from 'common/buffer/Types';\nimport { MouseService } from 'browser/services/MouseService';\nimport { Linkifier2 } from 'browser/Linkifier2';\nimport { CoreBrowserService } from 'browser/services/CoreBrowserService';\nimport { CoreTerminal } from 'common/CoreTerminal';\nimport { color, rgba } from 'common/Color';\nimport { CharacterJoinerService } from 'browser/services/CharacterJoinerService';\nimport { toRgbString } from 'common/input/XParseColor';\nimport { BufferDecorationRenderer } from 'browser/decorations/BufferDecorationRenderer';\nimport { OverviewRulerRenderer } from 'browser/decorations/OverviewRulerRenderer';\nimport { DecorationService } from 'common/services/DecorationService';\nimport { IDecorationService } from 'common/services/Services';\n\n// Let it work inside Node.js for automated testing purposes.\nconst document: Document = (typeof window !== 'undefined') ? window.document : null as any;\n\nexport class Terminal extends CoreTerminal implements ITerminal {\n public textarea: HTMLTextAreaElement | undefined;\n public element: HTMLElement | undefined;\n public screenElement: HTMLElement | undefined;\n\n private _document: Document | undefined;\n private _viewportScrollArea: HTMLElement | undefined;\n private _viewportElement: HTMLElement | undefined;\n private _helperContainer: HTMLElement | undefined;\n private _compositionView: HTMLElement | undefined;\n\n private _overviewRulerRenderer: OverviewRulerRenderer | undefined;\n\n // private _visualBellTimer: number;\n\n public browser: IBrowser = Browser as any;\n\n private _customKeyEventHandler: CustomKeyEventHandler | undefined;\n\n // browser services\n private _decorationService: DecorationService;\n private _charSizeService: ICharSizeService | undefined;\n private _mouseService: IMouseService | undefined;\n private _renderService: IRenderService | undefined;\n private _characterJoinerService: ICharacterJoinerService | undefined;\n private _selectionService: ISelectionService | undefined;\n private _soundService: ISoundService | undefined;\n\n /**\n * Records whether the keydown event has already been handled and triggered a data event, if so\n * the keypress event should not trigger a data event but should still print to the textarea so\n * screen readers will announce it.\n */\n private _keyDownHandled: boolean = false;\n\n /**\n * Records whether a keydown event has occured since the last keyup event, i.e. whether a key\n * is currently \"pressed\".\n */\n private _keyDownSeen: boolean = false;\n\n /**\n * Records whether the keypress event has already been handled and triggered a data event, if so\n * the input event should not trigger a data event but should still print to the textarea so\n * screen readers will announce it.\n */\n private _keyPressHandled: boolean = false;\n\n /**\n * Records whether there has been a keydown event for a dead key without a corresponding keydown\n * event for the composed/alternative character. If we cancel the keydown event for the dead key,\n * no events will be emitted for the final character.\n */\n private _unprocessedDeadKey: boolean = false;\n\n public linkifier: ILinkifier;\n public linkifier2: ILinkifier2;\n public viewport: IViewport | undefined;\n private _compositionHelper: ICompositionHelper | undefined;\n private _mouseZoneManager: IMouseZoneManager | undefined;\n private _accessibilityManager: AccessibilityManager | undefined;\n private _colorManager: ColorManager | undefined;\n private _theme: ITheme | undefined;\n\n private _onCursorMove = new EventEmitter();\n public get onCursorMove(): IEvent { return this._onCursorMove.event; }\n private _onKey = new EventEmitter<{ key: string, domEvent: KeyboardEvent }>();\n public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._onKey.event; }\n private _onRender = new EventEmitter<{ start: number, end: number }>();\n public get onRender(): IEvent<{ start: number, end: number }> { return this._onRender.event; }\n private _onSelectionChange = new EventEmitter();\n public get onSelectionChange(): IEvent { return this._onSelectionChange.event; }\n private _onTitleChange = new EventEmitter();\n public get onTitleChange(): IEvent { return this._onTitleChange.event; }\n private _onBell = new EventEmitter();\n public get onBell(): IEvent { return this._onBell.event; }\n\n private _onFocus = new EventEmitter();\n public get onFocus(): IEvent { return this._onFocus.event; }\n private _onBlur = new EventEmitter();\n public get onBlur(): IEvent { return this._onBlur.event; }\n private _onA11yCharEmitter = new EventEmitter();\n public get onA11yChar(): IEvent { return this._onA11yCharEmitter.event; }\n private _onA11yTabEmitter = new EventEmitter();\n public get onA11yTab(): IEvent { return this._onA11yTabEmitter.event; }\n\n /**\n * Creates a new `Terminal` object.\n *\n * @param options An object containing a set of options, the available options are:\n * - `cursorBlink` (boolean): Whether the terminal cursor blinks\n * - `cols` (number): The number of columns of the terminal (horizontal size)\n * - `rows` (number): The number of rows of the terminal (vertical size)\n *\n * @public\n * @class Xterm Xterm\n * @alias module:xterm/src/xterm\n */\n constructor(\n options: Partial = {}\n ) {\n super(options);\n\n this._setup();\n\n this.linkifier = this._instantiationService.createInstance(Linkifier);\n this.linkifier2 = this.register(this._instantiationService.createInstance(Linkifier2));\n this._decorationService = this._instantiationService.createInstance(DecorationService);\n this._instantiationService.setService(IDecorationService, this._decorationService);\n\n // Setup InputHandler listeners\n this.register(this._inputHandler.onRequestBell(() => this.bell()));\n this.register(this._inputHandler.onRequestRefreshRows((start, end) => this.refresh(start, end)));\n this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus()));\n this.register(this._inputHandler.onRequestReset(() => this.reset()));\n this.register(this._inputHandler.onRequestWindowsOptionsReport(type => this._reportWindowsOptions(type)));\n this.register(this._inputHandler.onColor((event) => this._handleColorEvent(event)));\n this.register(forwardEvent(this._inputHandler.onCursorMove, this._onCursorMove));\n this.register(forwardEvent(this._inputHandler.onTitleChange, this._onTitleChange));\n this.register(forwardEvent(this._inputHandler.onA11yChar, this._onA11yCharEmitter));\n this.register(forwardEvent(this._inputHandler.onA11yTab, this._onA11yTabEmitter));\n\n // Setup listeners\n this.register(this._bufferService.onResize(e => this._afterResize(e.cols, e.rows)));\n }\n\n /**\n * Handle color event from inputhandler for OSC 4|104 | 10|110 | 11|111 | 12|112.\n * An event from OSC 4|104 may contain multiple set or report requests, and multiple\n * or none restore requests (resetting all),\n * while an event from OSC 10|110 | 11|111 | 12|112 always contains a single request.\n */\n private _handleColorEvent(event: IColorEvent): void {\n if (!this._colorManager) return;\n for (const req of event) {\n let acc: 'foreground' | 'background' | 'cursor' | 'ansi' | undefined = undefined;\n let ident = '';\n switch (req.index) {\n case ColorIndex.FOREGROUND: // OSC 10 | 110\n acc = 'foreground';\n ident = '10';\n break;\n case ColorIndex.BACKGROUND: // OSC 11 | 111\n acc = 'background';\n ident = '11';\n break;\n case ColorIndex.CURSOR: // OSC 12 | 112\n acc = 'cursor';\n ident = '12';\n break;\n default: // OSC 4 | 104\n // we can skip the [0..255] range check here (already done in inputhandler)\n acc = 'ansi';\n ident = '4;' + req.index;\n }\n if (acc) {\n switch (req.type) {\n case ColorRequestType.REPORT:\n const channels = color.toColorRGB(acc === 'ansi'\n ? this._colorManager.colors.ansi[req.index]\n : this._colorManager.colors[acc]);\n this.coreService.triggerDataEvent(`${C0.ESC}]${ident};${toRgbString(channels)}${C1_ESCAPED.ST}`);\n break;\n case ColorRequestType.SET:\n if (acc === 'ansi') this._colorManager.colors.ansi[req.index] = rgba.toColor(...req.color);\n else this._colorManager.colors[acc] = rgba.toColor(...req.color);\n break;\n case ColorRequestType.RESTORE:\n this._colorManager.restoreColor(req.index);\n break;\n }\n }\n }\n this._renderService?.setColors(this._colorManager.colors);\n this.viewport?.onThemeChange(this._colorManager.colors);\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n super.dispose();\n this._renderService?.dispose();\n this._customKeyEventHandler = undefined;\n this.write = () => { };\n this.element?.parentNode?.removeChild(this.element);\n }\n\n protected _setup(): void {\n super._setup();\n\n this._customKeyEventHandler = undefined;\n }\n\n /**\n * Convenience property to active buffer.\n */\n public get buffer(): IBuffer {\n return this.buffers.active;\n }\n\n /**\n * Focus the terminal. Delegates focus handling to the terminal's DOM element.\n */\n public focus(): void {\n if (this.textarea) {\n this.textarea.focus({ preventScroll: true });\n }\n }\n\n protected _updateOptions(key: string): void {\n super._updateOptions(key);\n\n // TODO: These listeners should be owned by individual components\n switch (key) {\n case 'fontFamily':\n case 'fontSize':\n // When the font changes the size of the cells may change which requires a renderer clear\n this._renderService?.clear();\n this._charSizeService?.measure();\n break;\n case 'cursorBlink':\n case 'cursorStyle':\n // The DOM renderer needs a row refresh to update the cursor styles\n this.refresh(this.buffer.y, this.buffer.y);\n break;\n case 'customGlyphs':\n case 'drawBoldTextInBrightColors':\n case 'letterSpacing':\n case 'lineHeight':\n case 'fontWeight':\n case 'fontWeightBold':\n case 'minimumContrastRatio':\n // When the font changes the size of the cells may change which requires a renderer clear\n if (this._renderService) {\n this._renderService.clear();\n this._renderService.onResize(this.cols, this.rows);\n this.refresh(0, this.rows - 1);\n }\n break;\n case 'rendererType':\n if (this._renderService) {\n this._renderService.setRenderer(this._createRenderer());\n this._renderService.onResize(this.cols, this.rows);\n }\n break;\n case 'scrollback':\n this.viewport?.syncScrollArea();\n break;\n case 'screenReaderMode':\n if (this.optionsService.rawOptions.screenReaderMode) {\n if (!this._accessibilityManager && this._renderService) {\n this._accessibilityManager = new AccessibilityManager(this, this._renderService);\n }\n } else {\n this._accessibilityManager?.dispose();\n this._accessibilityManager = undefined;\n }\n break;\n case 'tabStopWidth': this.buffers.setupTabStops(); break;\n case 'theme':\n this._setTheme(this.optionsService.rawOptions.theme);\n break;\n }\n }\n\n /**\n * Binds the desired focus behavior on a given terminal object.\n */\n private _onTextAreaFocus(ev: KeyboardEvent): void {\n if (this.coreService.decPrivateModes.sendFocus) {\n this.coreService.triggerDataEvent(C0.ESC + '[I');\n }\n this.updateCursorStyle(ev);\n this.element!.classList.add('focus');\n this._showCursor();\n this._onFocus.fire();\n }\n\n /**\n * Blur the terminal, calling the blur function on the terminal's underlying\n * textarea.\n */\n public blur(): void {\n return this.textarea?.blur();\n }\n\n /**\n * Binds the desired blur behavior on a given terminal object.\n */\n private _onTextAreaBlur(): void {\n // Text can safely be removed on blur. Doing it earlier could interfere with\n // screen readers reading it out.\n this.textarea!.value = '';\n this.refresh(this.buffer.y, this.buffer.y);\n if (this.coreService.decPrivateModes.sendFocus) {\n this.coreService.triggerDataEvent(C0.ESC + '[O');\n }\n this.element!.classList.remove('focus');\n this._onBlur.fire();\n }\n\n private _syncTextArea(): void {\n if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper!.isComposing || !this._renderService) {\n return;\n }\n const cursorY = this.buffer.ybase + this.buffer.y;\n const bufferLine = this.buffer.lines.get(cursorY);\n if (!bufferLine) {\n return;\n }\n const cursorX = Math.min(this.buffer.x, this.cols - 1);\n const cellHeight = this._renderService.dimensions.actualCellHeight;\n const width = bufferLine.getWidth(cursorX);\n const cellWidth = this._renderService.dimensions.actualCellWidth * width;\n const cursorTop = this.buffer.y * this._renderService.dimensions.actualCellHeight;\n const cursorLeft = cursorX * this._renderService.dimensions.actualCellWidth;\n\n // Sync the textarea to the exact position of the composition view so the IME knows where the\n // text is.\n this.textarea.style.left = cursorLeft + 'px';\n this.textarea.style.top = cursorTop + 'px';\n this.textarea.style.width = cellWidth + 'px';\n this.textarea.style.height = cellHeight + 'px';\n this.textarea.style.lineHeight = cellHeight + 'px';\n this.textarea.style.zIndex = '-5';\n }\n\n /**\n * Initialize default behavior\n */\n private _initGlobal(): void {\n this._bindKeys();\n\n // Bind clipboard functionality\n this.register(addDisposableDomListener(this.element!, 'copy', (event: ClipboardEvent) => {\n // If mouse events are active it means the selection manager is disabled and\n // copy should be handled by the host program.\n if (!this.hasSelection()) {\n return;\n }\n copyHandler(event, this._selectionService!);\n }));\n const pasteHandlerWrapper = (event: ClipboardEvent): void => handlePasteEvent(event, this.textarea!, this.coreService);\n this.register(addDisposableDomListener(this.textarea!, 'paste', pasteHandlerWrapper));\n this.register(addDisposableDomListener(this.element!, 'paste', pasteHandlerWrapper));\n\n // Handle right click context menus\n if (Browser.isFirefox) {\n // Firefox doesn't appear to fire the contextmenu event on right click\n this.register(addDisposableDomListener(this.element!, 'mousedown', (event: MouseEvent) => {\n if (event.button === 2) {\n rightClickHandler(event, this.textarea!, this.screenElement!, this._selectionService!, this.options.rightClickSelectsWord);\n }\n }));\n } else {\n this.register(addDisposableDomListener(this.element!, 'contextmenu', (event: MouseEvent) => {\n rightClickHandler(event, this.textarea!, this.screenElement!, this._selectionService!, this.options.rightClickSelectsWord);\n }));\n }\n\n // Move the textarea under the cursor when middle clicking on Linux to ensure\n // middle click to paste selection works. This only appears to work in Chrome\n // at the time is writing.\n if (Browser.isLinux) {\n // Use auxclick event over mousedown the latter doesn't seem to work. Note\n // that the regular click event doesn't fire for the middle mouse button.\n this.register(addDisposableDomListener(this.element!, 'auxclick', (event: MouseEvent) => {\n if (event.button === 1) {\n moveTextAreaUnderMouseCursor(event, this.textarea!, this.screenElement!);\n }\n }));\n }\n }\n\n /**\n * Apply key handling to the terminal\n */\n private _bindKeys(): void {\n this.register(addDisposableDomListener(this.textarea!, 'keyup', (ev: KeyboardEvent) => this._keyUp(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'keydown', (ev: KeyboardEvent) => this._keyDown(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'keypress', (ev: KeyboardEvent) => this._keyPress(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'compositionstart', () => this._compositionHelper!.compositionstart()));\n this.register(addDisposableDomListener(this.textarea!, 'compositionupdate', (e: CompositionEvent) => this._compositionHelper!.compositionupdate(e)));\n this.register(addDisposableDomListener(this.textarea!, 'compositionend', () => this._compositionHelper!.compositionend()));\n this.register(addDisposableDomListener(this.textarea!, 'input', (ev: InputEvent) => this._inputEvent(ev), true));\n this.register(this.onRender(() => this._compositionHelper!.updateCompositionElements()));\n this.register(this.onRender(e => this._queueLinkification(e.start, e.end)));\n }\n\n /**\n * Opens the terminal within an element.\n *\n * @param parent The element to create the terminal within.\n */\n public open(parent: HTMLElement): void {\n if (!parent) {\n throw new Error('Terminal requires a parent element.');\n }\n\n if (!parent.isConnected) {\n this._logService.debug('Terminal.open was called on an element that was not attached to the DOM');\n }\n\n this._document = parent.ownerDocument!;\n\n // Create main element container\n this.element = this._document.createElement('div');\n this.element.dir = 'ltr'; // xterm.css assumes LTR\n this.element.classList.add('terminal');\n this.element.classList.add('xterm');\n this.element.setAttribute('tabindex', '0');\n parent.appendChild(this.element);\n\n // Performance: Use a document fragment to build the terminal\n // viewport and helper elements detached from the DOM\n const fragment = document.createDocumentFragment();\n this._viewportElement = document.createElement('div');\n this._viewportElement.classList.add('xterm-viewport');\n fragment.appendChild(this._viewportElement);\n\n this._viewportScrollArea = document.createElement('div');\n this._viewportScrollArea.classList.add('xterm-scroll-area');\n this._viewportElement.appendChild(this._viewportScrollArea);\n\n this.screenElement = document.createElement('div');\n this.screenElement.classList.add('xterm-screen');\n // Create the container that will hold helpers like the textarea for\n // capturing DOM Events. Then produce the helpers.\n this._helperContainer = document.createElement('div');\n this._helperContainer.classList.add('xterm-helpers');\n this.screenElement.appendChild(this._helperContainer);\n fragment.appendChild(this.screenElement);\n\n this.textarea = document.createElement('textarea');\n this.textarea.classList.add('xterm-helper-textarea');\n this.textarea.setAttribute('aria-label', Strings.promptLabel);\n this.textarea.setAttribute('aria-multiline', 'false');\n this.textarea.setAttribute('autocorrect', 'off');\n this.textarea.setAttribute('autocapitalize', 'off');\n this.textarea.setAttribute('spellcheck', 'false');\n this.textarea.tabIndex = 0;\n this.register(addDisposableDomListener(this.textarea, 'focus', (ev: KeyboardEvent) => this._onTextAreaFocus(ev)));\n this.register(addDisposableDomListener(this.textarea, 'blur', () => this._onTextAreaBlur()));\n this._helperContainer.appendChild(this.textarea);\n\n const coreBrowserService = this._instantiationService.createInstance(CoreBrowserService, this.textarea);\n this._instantiationService.setService(ICoreBrowserService, coreBrowserService);\n\n this._charSizeService = this._instantiationService.createInstance(CharSizeService, this._document, this._helperContainer);\n this._instantiationService.setService(ICharSizeService, this._charSizeService);\n\n this._theme = this.options.theme || this._theme;\n this._colorManager = new ColorManager(document, this.options.allowTransparency);\n this.register(this.optionsService.onOptionChange(e => this._colorManager!.onOptionsChange(e)));\n this._colorManager.setTheme(this._theme);\n\n this._characterJoinerService = this._instantiationService.createInstance(CharacterJoinerService);\n this._instantiationService.setService(ICharacterJoinerService, this._characterJoinerService);\n\n const renderer = this._createRenderer();\n this._renderService = this.register(this._instantiationService.createInstance(RenderService, renderer, this.rows, this.screenElement));\n this._instantiationService.setService(IRenderService, this._renderService);\n this.register(this._renderService.onRenderedViewportChange(e => this._onRender.fire(e)));\n this.onResize(e => this._renderService!.resize(e.cols, e.rows));\n\n this._compositionView = document.createElement('div');\n this._compositionView.classList.add('composition-view');\n this._compositionHelper = this._instantiationService.createInstance(CompositionHelper, this.textarea, this._compositionView);\n this._helperContainer.appendChild(this._compositionView);\n\n // Performance: Add viewport and helper elements from the fragment\n this.element.appendChild(fragment);\n\n this._soundService = this._instantiationService.createInstance(SoundService);\n this._instantiationService.setService(ISoundService, this._soundService);\n this._mouseService = this._instantiationService.createInstance(MouseService);\n this._instantiationService.setService(IMouseService, this._mouseService);\n\n this.viewport = this._instantiationService.createInstance(Viewport,\n (amount: number) => this.scrollLines(amount, true, ScrollSource.VIEWPORT),\n this._viewportElement,\n this._viewportScrollArea,\n this.element\n );\n this.viewport.onThemeChange(this._colorManager.colors);\n this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport!.syncScrollArea()));\n this.register(this.viewport);\n\n this.register(this.onCursorMove(() => {\n this._renderService!.onCursorMove();\n this._syncTextArea();\n }));\n this.register(this.onResize(() => this._renderService!.onResize(this.cols, this.rows)));\n this.register(this.onBlur(() => this._renderService!.onBlur()));\n this.register(this.onFocus(() => this._renderService!.onFocus()));\n this.register(this._renderService.onDimensionsChange(() => this.viewport!.syncScrollArea()));\n\n this._selectionService = this.register(this._instantiationService.createInstance(SelectionService,\n this.element,\n this.screenElement,\n this.linkifier2\n ));\n this._instantiationService.setService(ISelectionService, this._selectionService);\n this.register(this._selectionService.onRequestScrollLines(e => this.scrollLines(e.amount, e.suppressScrollEvent)));\n this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire()));\n this.register(this._selectionService.onRequestRedraw(e => this._renderService!.onSelectionChanged(e.start, e.end, e.columnSelectMode)));\n this.register(this._selectionService.onLinuxMouseSelection(text => {\n // If there's a new selection, put it into the textarea, focus and select it\n // in order to register it as a selection on the OS. This event is fired\n // only on Linux to enable middle click to paste selection.\n this.textarea!.value = text;\n this.textarea!.focus();\n this.textarea!.select();\n }));\n this.register(this._onScroll.event(ev => {\n this.viewport!.syncScrollArea();\n this._selectionService!.refresh();\n }));\n this.register(addDisposableDomListener(this._viewportElement, 'scroll', () => this._selectionService!.refresh()));\n\n this._mouseZoneManager = this._instantiationService.createInstance(MouseZoneManager, this.element, this.screenElement);\n this.register(this._mouseZoneManager);\n this.register(this.onScroll(() => this._mouseZoneManager!.clearAll()));\n this.linkifier.attachToDom(this.element, this._mouseZoneManager);\n this.linkifier2.attachToDom(this.screenElement, this._mouseService, this._renderService);\n this.register(this._instantiationService.createInstance(BufferDecorationRenderer, this.screenElement));\n // This event listener must be registered aftre MouseZoneManager is created\n this.register(addDisposableDomListener(this.element, 'mousedown', (e: MouseEvent) => this._selectionService!.onMouseDown(e)));\n\n // apply mouse event classes set by escape codes before terminal was attached\n if (this.coreMouseService.areMouseEventsActive) {\n this._selectionService.disable();\n this.element.classList.add('enable-mouse-events');\n } else {\n this._selectionService.enable();\n }\n\n if (this.options.screenReaderMode) {\n // Note that this must be done *after* the renderer is created in order to\n // ensure the correct order of the dprchange event\n this._accessibilityManager = new AccessibilityManager(this, this._renderService);\n }\n\n if (this.options.overviewRulerWidth) {\n this._overviewRulerRenderer = this._instantiationService.createInstance(OverviewRulerRenderer, this._viewportElement, this.screenElement);\n }\n this.optionsService.onOptionChange(() => {\n if (!this._overviewRulerRenderer && this.options.overviewRulerWidth && this._viewportElement && this.screenElement) {\n this._overviewRulerRenderer = this._instantiationService.createInstance(OverviewRulerRenderer, this._viewportElement, this.screenElement);\n }\n });\n // Measure the character size\n this._charSizeService.measure();\n\n // Setup loop that draws to screen\n this.refresh(0, this.rows - 1);\n\n // Initialize global actions that need to be taken on the document.\n this._initGlobal();\n\n // Listen for mouse events and translate\n // them into terminal mouse protocols.\n this.bindMouse();\n }\n\n private _createRenderer(): IRenderer {\n switch (this.options.rendererType) {\n case 'canvas': return this._instantiationService.createInstance(Renderer, this._colorManager!.colors, this.screenElement!, this.linkifier, this.linkifier2);\n case 'dom': return this._instantiationService.createInstance(DomRenderer, this._colorManager!.colors, this.element!, this.screenElement!, this._viewportElement!, this.linkifier, this.linkifier2);\n default: throw new Error(`Unrecognized rendererType \"${this.options.rendererType}\"`);\n }\n }\n\n /**\n * Sets the theme on the renderer. The renderer must have been initialized.\n * @param theme The theme to set.\n */\n private _setTheme(theme: ITheme): void {\n this._theme = theme;\n this._colorManager?.setTheme(theme);\n this._renderService?.setColors(this._colorManager!.colors);\n this.viewport?.onThemeChange(this._colorManager!.colors);\n }\n\n /**\n * Bind certain mouse events to the terminal.\n * By default only 3 button + wheel up/down is ativated. For higher buttons\n * no mouse report will be created. Typically the standard actions will be active.\n *\n * There are several reasons not to enable support for higher buttons/wheel:\n * - Button 4 and 5 are typically used for history back and forward navigation,\n * there is no straight forward way to supress/intercept those standard actions.\n * - Support for higher buttons does not work in some platform/browser combinations.\n * - Left/right wheel was not tested.\n * - Emulators vary in mouse button support, typically only 3 buttons and\n * wheel up/down work reliable.\n *\n * TODO: Move mouse event code into its own file.\n */\n public bindMouse(): void {\n const self = this;\n const el = this.element!;\n\n // send event to CoreMouseService\n function sendEvent(ev: MouseEvent | WheelEvent): boolean {\n // get mouse coordinates\n const pos = self._mouseService!.getRawByteCoords(ev, self.screenElement!, self.cols, self.rows);\n if (!pos) {\n return false;\n }\n\n let but: CoreMouseButton;\n let action: CoreMouseAction | undefined;\n switch ((ev as any).overrideType || ev.type) {\n case 'mousemove':\n action = CoreMouseAction.MOVE;\n if (ev.buttons === undefined) {\n // buttons is not supported on macOS, try to get a value from button instead\n but = CoreMouseButton.NONE;\n if (ev.button !== undefined) {\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n }\n } else {\n // according to MDN buttons only reports up to button 5 (AUX2)\n but = ev.buttons & 1 ? CoreMouseButton.LEFT :\n ev.buttons & 4 ? CoreMouseButton.MIDDLE :\n ev.buttons & 2 ? CoreMouseButton.RIGHT :\n CoreMouseButton.NONE; // fallback to NONE\n }\n break;\n case 'mouseup':\n action = CoreMouseAction.UP;\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n break;\n case 'mousedown':\n action = CoreMouseAction.DOWN;\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n break;\n case 'wheel':\n const amount = self.viewport!.getLinesScrolled(ev as WheelEvent);\n\n if (amount === 0) {\n return false;\n }\n\n action = (ev as WheelEvent).deltaY < 0 ? CoreMouseAction.UP : CoreMouseAction.DOWN;\n but = CoreMouseButton.WHEEL;\n break;\n default:\n // dont handle other event types by accident\n return false;\n }\n\n // exit if we cannot determine valid button/action values\n // do nothing for higher buttons than wheel\n if (action === undefined || but === undefined || but > CoreMouseButton.WHEEL) {\n return false;\n }\n\n return self.coreMouseService.triggerMouseEvent({\n col: pos.x - 33, // FIXME: why -33 here?\n row: pos.y - 33,\n button: but,\n action,\n ctrl: ev.ctrlKey,\n alt: ev.altKey,\n shift: ev.shiftKey\n });\n }\n\n /**\n * Event listener state handling.\n * We listen to the onProtocolChange event of CoreMouseService and put\n * requested listeners in `requestedEvents`. With this the listeners\n * have all bits to do the event listener juggling.\n * Note: 'mousedown' currently is \"always on\" and not managed\n * by onProtocolChange.\n */\n const requestedEvents: { [key: string]: ((ev: Event) => void) | null } = {\n mouseup: null,\n wheel: null,\n mousedrag: null,\n mousemove: null\n };\n const eventListeners: { [key: string]: (ev: any) => void | boolean } = {\n mouseup: (ev: MouseEvent) => {\n sendEvent(ev);\n if (!ev.buttons) {\n // if no other button is held remove global handlers\n this._document!.removeEventListener('mouseup', requestedEvents.mouseup!);\n if (requestedEvents.mousedrag) {\n this._document!.removeEventListener('mousemove', requestedEvents.mousedrag);\n }\n }\n return this.cancel(ev);\n },\n wheel: (ev: WheelEvent) => {\n sendEvent(ev);\n return this.cancel(ev, true);\n },\n mousedrag: (ev: MouseEvent) => {\n // deal only with move while a button is held\n if (ev.buttons) {\n sendEvent(ev);\n }\n },\n mousemove: (ev: MouseEvent) => {\n // deal only with move without any button\n if (!ev.buttons) {\n sendEvent(ev);\n }\n }\n };\n this.register(this.coreMouseService.onProtocolChange(events => {\n // apply global changes on events\n if (events) {\n if (this.optionsService.rawOptions.logLevel === 'debug') {\n this._logService.debug('Binding to mouse events:', this.coreMouseService.explainEvents(events));\n }\n this.element!.classList.add('enable-mouse-events');\n this._selectionService!.disable();\n } else {\n this._logService.debug('Unbinding from mouse events.');\n this.element!.classList.remove('enable-mouse-events');\n this._selectionService!.enable();\n }\n\n // add/remove handlers from requestedEvents\n\n if (!(events & CoreMouseEventType.MOVE)) {\n el.removeEventListener('mousemove', requestedEvents.mousemove!);\n requestedEvents.mousemove = null;\n } else if (!requestedEvents.mousemove) {\n el.addEventListener('mousemove', eventListeners.mousemove);\n requestedEvents.mousemove = eventListeners.mousemove;\n }\n\n if (!(events & CoreMouseEventType.WHEEL)) {\n el.removeEventListener('wheel', requestedEvents.wheel!);\n requestedEvents.wheel = null;\n } else if (!requestedEvents.wheel) {\n el.addEventListener('wheel', eventListeners.wheel, { passive: false });\n requestedEvents.wheel = eventListeners.wheel;\n }\n\n if (!(events & CoreMouseEventType.UP)) {\n this._document!.removeEventListener('mouseup', requestedEvents.mouseup!);\n requestedEvents.mouseup = null;\n } else if (!requestedEvents.mouseup) {\n requestedEvents.mouseup = eventListeners.mouseup;\n }\n\n if (!(events & CoreMouseEventType.DRAG)) {\n this._document!.removeEventListener('mousemove', requestedEvents.mousedrag!);\n requestedEvents.mousedrag = null;\n } else if (!requestedEvents.mousedrag) {\n requestedEvents.mousedrag = eventListeners.mousedrag;\n }\n }));\n // force initial onProtocolChange so we dont miss early mouse requests\n this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol;\n\n /**\n * \"Always on\" event listeners.\n */\n this.register(addDisposableDomListener(el, 'mousedown', (ev: MouseEvent) => {\n ev.preventDefault();\n this.focus();\n\n // Don't send the mouse button to the pty if mouse events are disabled or\n // if the selection manager is having selection forced (ie. a modifier is\n // held).\n if (!this.coreMouseService.areMouseEventsActive || this._selectionService!.shouldForceSelection(ev)) {\n return;\n }\n\n sendEvent(ev);\n\n // Register additional global handlers which should keep reporting outside\n // of the terminal element.\n // Note: Other emulators also do this for 'mousedown' while a button\n // is held, we currently limit 'mousedown' to the terminal only.\n if (requestedEvents.mouseup) {\n this._document!.addEventListener('mouseup', requestedEvents.mouseup);\n }\n if (requestedEvents.mousedrag) {\n this._document!.addEventListener('mousemove', requestedEvents.mousedrag);\n }\n\n return this.cancel(ev);\n }));\n\n this.register(addDisposableDomListener(el, 'wheel', (ev: WheelEvent) => {\n // do nothing, if app side handles wheel itself\n if (requestedEvents.wheel) return;\n\n if (!this.buffer.hasScrollback) {\n // Convert wheel events into up/down events when the buffer does not have scrollback, this\n // enables scrolling in apps hosted in the alt buffer such as vim or tmux.\n const amount = this.viewport!.getLinesScrolled(ev);\n\n // Do nothing if there's no vertical scroll\n if (amount === 0) {\n return;\n }\n\n // Construct and send sequences\n const sequence = C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? 'O' : '[') + (ev.deltaY < 0 ? 'A' : 'B');\n let data = '';\n for (let i = 0; i < Math.abs(amount); i++) {\n data += sequence;\n }\n this.coreService.triggerDataEvent(data, true);\n return this.cancel(ev, true);\n }\n\n // normal viewport scrolling\n // conditionally stop event, if the viewport still had rows to scroll within\n if (this.viewport!.onWheel(ev)) {\n return this.cancel(ev);\n }\n }, { passive: false }));\n\n this.register(addDisposableDomListener(el, 'touchstart', (ev: TouchEvent) => {\n if (this.coreMouseService.areMouseEventsActive) return;\n this.viewport!.onTouchStart(ev);\n return this.cancel(ev);\n }, { passive: true }));\n\n this.register(addDisposableDomListener(el, 'touchmove', (ev: TouchEvent) => {\n if (this.coreMouseService.areMouseEventsActive) return;\n if (!this.viewport!.onTouchMove(ev)) {\n return this.cancel(ev);\n }\n }, { passive: false }));\n }\n\n\n /**\n * Tells the renderer to refresh terminal content between two rows (inclusive) at the next\n * opportunity.\n * @param start The row to start from (between 0 and this.rows - 1).\n * @param end The row to end at (between start and this.rows - 1).\n */\n public refresh(start: number, end: number): void {\n this._renderService?.refreshRows(start, end);\n }\n\n /**\n * Queues linkification for the specified rows.\n * @param start The row to start from (between 0 and this.rows - 1).\n * @param end The row to end at (between start and this.rows - 1).\n */\n private _queueLinkification(start: number, end: number): void {\n this.linkifier?.linkifyRows(start, end);\n }\n\n /**\n * Change the cursor style for different selection modes\n */\n public updateCursorStyle(ev: KeyboardEvent): void {\n if (this._selectionService?.shouldColumnSelect(ev)) {\n this.element!.classList.add('column-select');\n } else {\n this.element!.classList.remove('column-select');\n }\n }\n\n /**\n * Display the cursor element\n */\n private _showCursor(): void {\n if (!this.coreService.isCursorInitialized) {\n this.coreService.isCursorInitialized = true;\n this.refresh(this.buffer.y, this.buffer.y);\n }\n }\n\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source = ScrollSource.TERMINAL): void {\n super.scrollLines(disp, suppressScrollEvent, source);\n this.refresh(0, this.rows - 1);\n }\n\n public paste(data: string): void {\n paste(data, this.textarea!, this.coreService);\n }\n\n /**\n * Attaches a custom key event handler which is run before keys are processed,\n * giving consumers of xterm.js ultimate control as to what keys should be\n * processed by the terminal and what keys should not.\n * @param customKeyEventHandler The custom KeyboardEvent handler to attach.\n * This is a function that takes a KeyboardEvent, allowing consumers to stop\n * propagation and/or prevent the default action. The function returns whether\n * the event should be processed by xterm.js.\n */\n public attachCustomKeyEventHandler(customKeyEventHandler: CustomKeyEventHandler): void {\n this._customKeyEventHandler = customKeyEventHandler;\n }\n\n /**\n * Registers a link matcher, allowing custom link patterns to be matched and\n * handled.\n * @param regex The regular expression to search for, specifically\n * this searches the textContent of the rows. You will want to use \\s to match\n * a space ' ' character for example.\n * @param handler The callback when the link is called.\n * @param options Options for the link matcher.\n * @return The ID of the new matcher, this can be used to deregister.\n */\n public registerLinkMatcher(regex: RegExp, handler: LinkMatcherHandler, options?: ILinkMatcherOptions): number {\n const matcherId = this.linkifier.registerLinkMatcher(regex, handler, options);\n this.refresh(0, this.rows - 1);\n return matcherId;\n }\n\n /**\n * Deregisters a link matcher if it has been registered.\n * @param matcherId The link matcher's ID (returned after register)\n */\n public deregisterLinkMatcher(matcherId: number): void {\n if (this.linkifier.deregisterLinkMatcher(matcherId)) {\n this.refresh(0, this.rows - 1);\n }\n }\n\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n return this.linkifier2.registerLinkProvider(linkProvider);\n }\n\n public registerCharacterJoiner(handler: CharacterJoinerHandler): number {\n if (!this._characterJoinerService) {\n throw new Error('Terminal must be opened first');\n }\n const joinerId = this._characterJoinerService.register(handler);\n this.refresh(0, this.rows - 1);\n return joinerId;\n }\n\n public deregisterCharacterJoiner(joinerId: number): void {\n if (!this._characterJoinerService) {\n throw new Error('Terminal must be opened first');\n }\n if (this._characterJoinerService.deregister(joinerId)) {\n this.refresh(0, this.rows - 1);\n }\n }\n\n public get markers(): IMarker[] {\n return this.buffer.markers;\n }\n\n public addMarker(cursorYOffset: number): IMarker | undefined {\n // Disallow markers on the alt buffer\n if (this.buffer !== this.buffers.normal) {\n return;\n }\n\n return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset);\n }\n\n public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined {\n return this._decorationService.registerDecoration(decorationOptions);\n }\n\n /**\n * Gets whether the terminal has an active selection.\n */\n public hasSelection(): boolean {\n return this._selectionService ? this._selectionService.hasSelection : false;\n }\n\n /**\n * Selects text within the terminal.\n * @param column The column the selection starts at..\n * @param row The row the selection starts at.\n * @param length The length of the selection.\n */\n public select(column: number, row: number, length: number): void {\n this._selectionService!.setSelection(column, row, length);\n }\n\n /**\n * Gets the terminal's current selection, this is useful for implementing copy\n * behavior outside of xterm.js.\n */\n public getSelection(): string {\n return this._selectionService ? this._selectionService.selectionText : '';\n }\n\n public getSelectionPosition(): ISelectionPosition | undefined {\n if (!this._selectionService || !this._selectionService.hasSelection) {\n return undefined;\n }\n\n return {\n startColumn: this._selectionService.selectionStart![0],\n startRow: this._selectionService.selectionStart![1],\n endColumn: this._selectionService.selectionEnd![0],\n endRow: this._selectionService.selectionEnd![1]\n };\n }\n\n /**\n * Clears the current terminal selection.\n */\n public clearSelection(): void {\n this._selectionService?.clearSelection();\n }\n\n /**\n * Selects all text within the terminal.\n */\n public selectAll(): void {\n this._selectionService?.selectAll();\n }\n\n public selectLines(start: number, end: number): void {\n this._selectionService?.selectLines(start, end);\n }\n\n /**\n * Handle a keydown event\n * Key Resources:\n * - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent\n * @param ev The keydown event to be handled.\n */\n protected _keyDown(event: KeyboardEvent): boolean | undefined {\n this._keyDownHandled = false;\n this._keyDownSeen = true;\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(event) === false) {\n return false;\n }\n\n // Ignore composing with Alt key on Mac when macOptionIsMeta is enabled\n const shouldIgnoreComposition = this.browser.isMac && this.options.macOptionIsMeta && event.altKey;\n\n if (!shouldIgnoreComposition && !this._compositionHelper!.keydown(event)) {\n if (this.buffer.ybase !== this.buffer.ydisp) {\n this._bufferService.scrollToBottom();\n }\n return false;\n }\n\n if (!shouldIgnoreComposition && (event.key === 'Dead' || event.key === 'AltGraph')) {\n this._unprocessedDeadKey = true;\n }\n\n const result = evaluateKeyboardEvent(event, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta);\n\n this.updateCursorStyle(event);\n\n if (result.type === KeyboardResultType.PAGE_DOWN || result.type === KeyboardResultType.PAGE_UP) {\n const scrollCount = this.rows - 1;\n this.scrollLines(result.type === KeyboardResultType.PAGE_UP ? -scrollCount : scrollCount);\n return this.cancel(event, true);\n }\n\n if (result.type === KeyboardResultType.SELECT_ALL) {\n this.selectAll();\n }\n\n if (this._isThirdLevelShift(this.browser, event)) {\n return true;\n }\n\n if (result.cancel) {\n // The event is canceled at the end already, is this necessary?\n this.cancel(event, true);\n }\n\n if (!result.key) {\n return true;\n }\n\n // HACK: Process A-Z in the keypress event to fix an issue with macOS IMEs where lower case\n // letters cannot be input while caps lock is on.\n if (event.key && !event.ctrlKey && !event.altKey && !event.metaKey && event.key.length === 1) {\n if (event.key.charCodeAt(0) >= 65 && event.key.charCodeAt(0) <= 90) {\n return true;\n }\n }\n\n if (this._unprocessedDeadKey) {\n this._unprocessedDeadKey = false;\n return true;\n }\n\n // If ctrl+c or enter is being sent, clear out the textarea. This is done so that screen readers\n // will announce deleted characters. This will not work 100% of the time but it should cover\n // most scenarios.\n if (result.key === C0.ETX || result.key === C0.CR) {\n this.textarea!.value = '';\n }\n\n this._onKey.fire({ key: result.key, domEvent: event });\n this._showCursor();\n this.coreService.triggerDataEvent(result.key, true);\n\n // Cancel events when not in screen reader mode so events don't get bubbled up and handled by\n // other listeners. When screen reader mode is enabled, this could cause issues if the event\n // is handled at a higher level, this is a compromise in order to echo keys to the screen\n // reader.\n if (!this.optionsService.rawOptions.screenReaderMode) {\n return this.cancel(event, true);\n }\n\n this._keyDownHandled = true;\n }\n\n private _isThirdLevelShift(browser: IBrowser, ev: KeyboardEvent): boolean {\n const thirdLevelKey =\n (browser.isMac && !this.options.macOptionIsMeta && ev.altKey && !ev.ctrlKey && !ev.metaKey) ||\n (browser.isWindows && ev.altKey && ev.ctrlKey && !ev.metaKey) ||\n (browser.isWindows && ev.getModifierState('AltGraph'));\n\n if (ev.type === 'keypress') {\n return thirdLevelKey;\n }\n\n // Don't invoke for arrows, pageDown, home, backspace, etc. (on non-keypress events)\n return thirdLevelKey && (!ev.keyCode || ev.keyCode > 47);\n }\n\n protected _keyUp(ev: KeyboardEvent): void {\n this._keyDownSeen = false;\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {\n return;\n }\n\n if (!wasModifierKeyOnlyEvent(ev)) {\n this.focus();\n }\n\n this.updateCursorStyle(ev);\n this._keyPressHandled = false;\n }\n\n /**\n * Handle a keypress event.\n * Key Resources:\n * - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent\n * @param ev The keypress event to be handled.\n */\n protected _keyPress(ev: KeyboardEvent): boolean {\n let key;\n\n this._keyPressHandled = false;\n\n if (this._keyDownHandled) {\n return false;\n }\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {\n return false;\n }\n\n this.cancel(ev);\n\n if (ev.charCode) {\n key = ev.charCode;\n } else if (ev.which === null || ev.which === undefined) {\n key = ev.keyCode;\n } else if (ev.which !== 0 && ev.charCode !== 0) {\n key = ev.which;\n } else {\n return false;\n }\n\n if (!key || (\n (ev.altKey || ev.ctrlKey || ev.metaKey) && !this._isThirdLevelShift(this.browser, ev)\n )) {\n return false;\n }\n\n key = String.fromCharCode(key);\n\n this._onKey.fire({ key, domEvent: ev });\n this._showCursor();\n this.coreService.triggerDataEvent(key, true);\n\n this._keyPressHandled = true;\n\n // The key was handled so clear the dead key state, otherwise certain keystrokes like arrow\n // keys could be ignored\n this._unprocessedDeadKey = false;\n\n return true;\n }\n\n /**\n * Handle an input event.\n * Key Resources:\n * - https://developer.mozilla.org/en-US/docs/Web/API/InputEvent\n * @param ev The input event to be handled.\n */\n protected _inputEvent(ev: InputEvent): boolean {\n // Only support emoji IMEs when screen reader mode is disabled as the event must bubble up to\n // support reading out character input which can doubling up input characters\n // Based on these event traces: https://github.com/xtermjs/xterm.js/issues/3679\n if (ev.data && ev.inputType === 'insertText' && (!ev.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) {\n if (this._keyPressHandled) {\n return false;\n }\n\n // The key was handled so clear the dead key state, otherwise certain keystrokes like arrow\n // keys could be ignored\n this._unprocessedDeadKey = false;\n\n const text = ev.data;\n this.coreService.triggerDataEvent(text, true);\n\n this.cancel(ev);\n return true;\n }\n\n return false;\n }\n\n /**\n * Ring the bell.\n * Note: We could do sweet things with webaudio here\n */\n public bell(): void {\n if (this._soundBell()) {\n this._soundService?.playBellSound();\n }\n\n this._onBell.fire();\n\n // if (this._visualBell()) {\n // this.element.classList.add('visual-bell-active');\n // clearTimeout(this._visualBellTimer);\n // this._visualBellTimer = window.setTimeout(() => {\n // this.element.classList.remove('visual-bell-active');\n // }, 200);\n // }\n }\n\n /**\n * Resizes the terminal.\n *\n * @param x The number of columns to resize to.\n * @param y The number of rows to resize to.\n */\n public resize(x: number, y: number): void {\n if (x === this.cols && y === this.rows) {\n // Check if we still need to measure the char size (fixes #785).\n if (this._charSizeService && !this._charSizeService.hasValidSize) {\n this._charSizeService.measure();\n }\n return;\n }\n\n super.resize(x, y);\n }\n\n private _afterResize(x: number, y: number): void {\n this._charSizeService?.measure();\n\n // Sync the scroll area to make sure scroll events don't fire and scroll the viewport to an\n // invalid location\n this.viewport?.syncScrollArea(true);\n }\n\n /**\n * Clear the entire buffer, making the prompt line the new first line.\n */\n public clear(): void {\n if (this.buffer.ybase === 0 && this.buffer.y === 0) {\n // Don't clear if it's already clear\n return;\n }\n this.buffer.clearAllMarkers();\n this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)!);\n this.buffer.lines.length = 1;\n this.buffer.ydisp = 0;\n this.buffer.ybase = 0;\n this.buffer.y = 0;\n for (let i = 1; i < this.rows; i++) {\n this.buffer.lines.push(this.buffer.getBlankLine(DEFAULT_ATTR_DATA));\n }\n this.refresh(0, this.rows - 1);\n this._onScroll.fire({ position: this.buffer.ydisp, source: ScrollSource.TERMINAL });\n }\n\n /**\n * Reset terminal.\n * Note: Calling this directly from JS is synchronous but does not clear\n * input buffers and does not reset the parser, thus the terminal will\n * continue to apply pending input data.\n * If you need in band reset (synchronous with input data) consider\n * using DECSTR (soft reset, CSI ! p) or RIS instead (hard reset, ESC c).\n */\n public reset(): void {\n /**\n * Since _setup handles a full terminal creation, we have to carry forward\n * a few things that should not reset.\n */\n this.options.rows = this.rows;\n this.options.cols = this.cols;\n const customKeyEventHandler = this._customKeyEventHandler;\n\n this._setup();\n super.reset();\n this._selectionService?.reset();\n this._decorationService.reset();\n\n // reattach\n this._customKeyEventHandler = customKeyEventHandler;\n\n // do a full screen refresh\n this.refresh(0, this.rows - 1);\n this.viewport?.syncScrollArea();\n }\n\n public clearTextureAtlas(): void {\n this._renderService?.clearTextureAtlas();\n }\n\n private _reportFocus(): void {\n if (this.element?.classList.contains('focus')) {\n this.coreService.triggerDataEvent(C0.ESC + '[I');\n } else {\n this.coreService.triggerDataEvent(C0.ESC + '[O');\n }\n }\n\n private _reportWindowsOptions(type: WindowsOptionsReportType): void {\n if (!this._renderService) {\n return;\n }\n\n switch (type) {\n case WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:\n const canvasWidth = this._renderService.dimensions.scaledCanvasWidth.toFixed(0);\n const canvasHeight = this._renderService.dimensions.scaledCanvasHeight.toFixed(0);\n this.coreService.triggerDataEvent(`${C0.ESC}[4;${canvasHeight};${canvasWidth}t`);\n break;\n case WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:\n const cellWidth = this._renderService.dimensions.scaledCellWidth.toFixed(0);\n const cellHeight = this._renderService.dimensions.scaledCellHeight.toFixed(0);\n this.coreService.triggerDataEvent(`${C0.ESC}[6;${cellHeight};${cellWidth}t`);\n break;\n }\n }\n\n // TODO: Remove cancel function and cancelEvents option\n public cancel(ev: Event, force?: boolean): boolean | undefined {\n if (!this.options.cancelEvents && !force) {\n return;\n }\n ev.preventDefault();\n ev.stopPropagation();\n return false;\n }\n\n private _visualBell(): boolean {\n return false;\n // return this.options.bellStyle === 'visual' ||\n // this.options.bellStyle === 'both';\n }\n\n private _soundBell(): boolean {\n return this.options.bellStyle === 'sound';\n // return this.options.bellStyle === 'sound' ||\n // this.options.bellStyle === 'both';\n }\n}\n\n/**\n * Helpers\n */\n\nfunction wasModifierKeyOnlyEvent(ev: KeyboardEvent): boolean {\n return ev.keyCode === 16 || // Shift\n ev.keyCode === 17 || // Ctrl\n ev.keyCode === 18; // Alt\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nconst RENDER_DEBOUNCE_THRESHOLD_MS = 1000; // 1 Second\n\nimport { IRenderDebouncer } from 'browser/Types';\n\n/**\n * Debounces calls to update screen readers to update at most once configurable interval of time.\n */\nexport class TimeBasedDebouncer implements IRenderDebouncer {\n private _rowStart: number | undefined;\n private _rowEnd: number | undefined;\n private _rowCount: number | undefined;\n\n // The last moment that the Terminal was refreshed at\n private _lastRefreshMs = 0;\n // Whether a trailing refresh should be triggered due to a refresh request that was throttled\n private _additionalRefreshRequested = false;\n\n private _refreshTimeoutID: number | undefined;\n\n constructor(\n private _renderCallback: (start: number, end: number) => void,\n private readonly _debounceThresholdMS = RENDER_DEBOUNCE_THRESHOLD_MS\n ) {\n }\n\n public dispose(): void {\n if (this._refreshTimeoutID) {\n clearTimeout(this._refreshTimeoutID);\n }\n }\n\n public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {\n this._rowCount = rowCount;\n // Get the min/max row start/end for the arg values\n rowStart = rowStart !== undefined ? rowStart : 0;\n rowEnd = rowEnd !== undefined ? rowEnd : this._rowCount - 1;\n // Set the properties to the updated values\n this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart;\n this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd;\n\n // Only refresh if the time since last refresh is above a threshold, otherwise wait for\n // enough time to pass before refreshing again.\n const refreshRequestTime: number = Date.now();\n if (refreshRequestTime - this._lastRefreshMs >= this._debounceThresholdMS) {\n // Enough time has lapsed since the last refresh; refresh immediately\n this._lastRefreshMs = refreshRequestTime;\n this._innerRefresh();\n } else if (!this._additionalRefreshRequested) {\n // This is the first additional request throttled; set up trailing refresh\n const elapsed = refreshRequestTime - this._lastRefreshMs;\n const waitPeriodBeforeTrailingRefresh = this._debounceThresholdMS - elapsed;\n this._additionalRefreshRequested = true;\n\n this._refreshTimeoutID = window.setTimeout(() => {\n this._lastRefreshMs = Date.now();\n this._innerRefresh();\n this._additionalRefreshRequested = false;\n this._refreshTimeoutID = undefined; // No longer need to clear the timeout\n }, waitPeriodBeforeTrailingRefresh);\n }\n }\n\n private _innerRefresh(): void {\n // Make sure values are set\n if (this._rowStart === undefined || this._rowEnd === undefined || this._rowCount === undefined) {\n return;\n }\n\n // Clamp values\n const start = Math.max(this._rowStart, 0);\n const end = Math.min(this._rowEnd, this._rowCount - 1);\n\n // Reset debouncer (this happens before render callback as the render could trigger it again)\n this._rowStart = undefined;\n this._rowEnd = undefined;\n\n // Run render callback\n this._renderCallback(start, end);\n }\n}\n\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable } from 'common/Lifecycle';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IColorSet, IViewport } from 'browser/Types';\nimport { ICharSizeService, IRenderService } from 'browser/services/Services';\nimport { IBufferService, IOptionsService } from 'common/services/Services';\nimport { IBuffer } from 'common/buffer/Types';\nimport { IRenderDimensions } from 'browser/renderer/Types';\n\nconst FALLBACK_SCROLL_BAR_WIDTH = 15;\n\n/**\n * Represents the viewport of a terminal, the visible area within the larger buffer of output.\n * Logic for the virtual scroll bar is included in this object.\n */\nexport class Viewport extends Disposable implements IViewport {\n public scrollBarWidth: number = 0;\n private _currentRowHeight: number = 0;\n private _currentScaledCellHeight: number = 0;\n private _lastRecordedBufferLength: number = 0;\n private _lastRecordedViewportHeight: number = 0;\n private _lastRecordedBufferHeight: number = 0;\n private _lastTouchY: number = 0;\n private _lastScrollTop: number = 0;\n private _activeBuffer: IBuffer;\n private _renderDimensions: IRenderDimensions;\n\n // Stores a partial line amount when scrolling, this is used to keep track of how much of a line\n // is scrolled so we can \"scroll\" over partial lines and feel natural on touchpads. This is a\n // quick fix and could have a more robust solution in place that reset the value when needed.\n private _wheelPartialScroll: number = 0;\n\n private _refreshAnimationFrame: number | null = null;\n private _ignoreNextScrollEvent: boolean = false;\n\n constructor(\n private readonly _scrollLines: (amount: number) => void,\n private readonly _viewportElement: HTMLElement,\n private readonly _scrollArea: HTMLElement,\n private readonly _element: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n super();\n\n // Measure the width of the scrollbar. If it is 0 we can assume it's an OSX overlay scrollbar.\n // Unfortunately the overlay scrollbar would be hidden underneath the screen element in that case,\n // therefore we account for a standard amount to make it visible\n this.scrollBarWidth = (this._viewportElement.offsetWidth - this._scrollArea.offsetWidth) || FALLBACK_SCROLL_BAR_WIDTH;\n this.register(addDisposableDomListener(this._viewportElement, 'scroll', this._onScroll.bind(this)));\n\n // Track properties used in performance critical code manually to avoid using slow getters\n this._activeBuffer = this._bufferService.buffer;\n this.register(this._bufferService.buffers.onBufferActivate(e => this._activeBuffer = e.activeBuffer));\n this._renderDimensions = this._renderService.dimensions;\n this.register(this._renderService.onDimensionsChange(e => this._renderDimensions = e));\n\n // Perform this async to ensure the ICharSizeService is ready.\n setTimeout(() => this.syncScrollArea(), 0);\n }\n\n public onThemeChange(colors: IColorSet): void {\n this._viewportElement.style.backgroundColor = colors.background.css;\n }\n\n /**\n * Refreshes row height, setting line-height, viewport height and scroll area height if\n * necessary.\n */\n private _refresh(immediate: boolean): void {\n if (immediate) {\n this._innerRefresh();\n if (this._refreshAnimationFrame !== null) {\n cancelAnimationFrame(this._refreshAnimationFrame);\n }\n return;\n }\n if (this._refreshAnimationFrame === null) {\n this._refreshAnimationFrame = requestAnimationFrame(() => this._innerRefresh());\n }\n }\n\n private _innerRefresh(): void {\n if (this._charSizeService.height > 0) {\n this._currentRowHeight = this._renderService.dimensions.scaledCellHeight / window.devicePixelRatio;\n this._currentScaledCellHeight = this._renderService.dimensions.scaledCellHeight;\n this._lastRecordedViewportHeight = this._viewportElement.offsetHeight;\n const newBufferHeight = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._renderService.dimensions.canvasHeight);\n if (this._lastRecordedBufferHeight !== newBufferHeight) {\n this._lastRecordedBufferHeight = newBufferHeight;\n this._scrollArea.style.height = this._lastRecordedBufferHeight + 'px';\n }\n }\n\n // Sync scrollTop\n const scrollTop = this._bufferService.buffer.ydisp * this._currentRowHeight;\n if (this._viewportElement.scrollTop !== scrollTop) {\n // Ignore the next scroll event which will be triggered by setting the scrollTop as we do not\n // want this event to scroll the terminal\n this._ignoreNextScrollEvent = true;\n this._viewportElement.scrollTop = scrollTop;\n }\n\n this._refreshAnimationFrame = null;\n }\n\n /**\n * Updates dimensions and synchronizes the scroll area if necessary.\n */\n public syncScrollArea(immediate: boolean = false): void {\n // If buffer height changed\n if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length) {\n this._lastRecordedBufferLength = this._bufferService.buffer.lines.length;\n this._refresh(immediate);\n return;\n }\n\n // If viewport height changed\n if (this._lastRecordedViewportHeight !== this._renderService.dimensions.canvasHeight) {\n this._refresh(immediate);\n return;\n }\n\n // If the buffer position doesn't match last scroll top\n if (this._lastScrollTop !== this._activeBuffer.ydisp * this._currentRowHeight) {\n this._refresh(immediate);\n return;\n }\n\n // If row height changed\n if (this._renderDimensions.scaledCellHeight !== this._currentScaledCellHeight) {\n this._refresh(immediate);\n return;\n }\n }\n\n /**\n * Handles scroll events on the viewport, calculating the new viewport and requesting the\n * terminal to scroll to it.\n * @param ev The scroll event.\n */\n private _onScroll(ev: Event): void {\n // Record current scroll top position\n this._lastScrollTop = this._viewportElement.scrollTop;\n\n // Don't attempt to scroll if the element is not visible, otherwise scrollTop will be corrupt\n // which causes the terminal to scroll the buffer to the top\n if (!this._viewportElement.offsetParent) {\n return;\n }\n\n // Ignore the event if it was flagged to ignore (when the source of the event is from Viewport)\n if (this._ignoreNextScrollEvent) {\n this._ignoreNextScrollEvent = false;\n // Still trigger the scroll so lines get refreshed\n this._scrollLines(0);\n return;\n }\n\n const newRow = Math.round(this._lastScrollTop / this._currentRowHeight);\n const diff = newRow - this._bufferService.buffer.ydisp;\n this._scrollLines(diff);\n }\n\n /**\n * Handles bubbling of scroll event in case the viewport has reached top or bottom\n * @param ev The scroll event.\n * @param amount The amount scrolled\n */\n private _bubbleScroll(ev: Event, amount: number): boolean {\n const scrollPosFromTop = this._viewportElement.scrollTop + this._lastRecordedViewportHeight;\n if ((amount < 0 && this._viewportElement.scrollTop !== 0) ||\n (amount > 0 && scrollPosFromTop < this._lastRecordedBufferHeight)) {\n if (ev.cancelable) {\n ev.preventDefault();\n }\n return false;\n }\n return true;\n }\n\n /**\n * Handles mouse wheel events by adjusting the viewport's scrollTop and delegating the actual\n * scrolling to `onScroll`, this event needs to be attached manually by the consumer of\n * `Viewport`.\n * @param ev The mouse wheel event.\n */\n public onWheel(ev: WheelEvent): boolean {\n const amount = this._getPixelsScrolled(ev);\n if (amount === 0) {\n return false;\n }\n this._viewportElement.scrollTop += amount;\n return this._bubbleScroll(ev, amount);\n }\n\n private _getPixelsScrolled(ev: WheelEvent): number {\n // Do nothing if it's not a vertical scroll event\n if (ev.deltaY === 0 || ev.shiftKey) {\n return 0;\n }\n\n // Fallback to WheelEvent.DOM_DELTA_PIXEL\n let amount = this._applyScrollModifier(ev.deltaY, ev);\n if (ev.deltaMode === WheelEvent.DOM_DELTA_LINE) {\n amount *= this._currentRowHeight;\n } else if (ev.deltaMode === WheelEvent.DOM_DELTA_PAGE) {\n amount *= this._currentRowHeight * this._bufferService.rows;\n }\n return amount;\n }\n\n /**\n * Gets the number of pixels scrolled by the mouse event taking into account what type of delta\n * is being used.\n * @param ev The mouse wheel event.\n */\n public getLinesScrolled(ev: WheelEvent): number {\n // Do nothing if it's not a vertical scroll event\n if (ev.deltaY === 0 || ev.shiftKey) {\n return 0;\n }\n\n // Fallback to WheelEvent.DOM_DELTA_LINE\n let amount = this._applyScrollModifier(ev.deltaY, ev);\n if (ev.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n amount /= this._currentRowHeight + 0.0; // Prevent integer division\n this._wheelPartialScroll += amount;\n amount = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1);\n this._wheelPartialScroll %= 1;\n } else if (ev.deltaMode === WheelEvent.DOM_DELTA_PAGE) {\n amount *= this._bufferService.rows;\n }\n return amount;\n }\n\n private _applyScrollModifier(amount: number, ev: WheelEvent): number {\n const modifier = this._optionsService.rawOptions.fastScrollModifier;\n // Multiply the scroll speed when the modifier is down\n if ((modifier === 'alt' && ev.altKey) ||\n (modifier === 'ctrl' && ev.ctrlKey) ||\n (modifier === 'shift' && ev.shiftKey)) {\n return amount * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity;\n }\n\n return amount * this._optionsService.rawOptions.scrollSensitivity;\n }\n\n /**\n * Handles the touchstart event, recording the touch occurred.\n * @param ev The touch event.\n */\n public onTouchStart(ev: TouchEvent): void {\n this._lastTouchY = ev.touches[0].pageY;\n }\n\n /**\n * Handles the touchmove event, scrolling the viewport if the position shifted.\n * @param ev The touch event.\n */\n public onTouchMove(ev: TouchEvent): boolean {\n const deltaY = this._lastTouchY - ev.touches[0].pageY;\n this._lastTouchY = ev.touches[0].pageY;\n if (deltaY === 0) {\n return false;\n }\n this._viewportElement.scrollTop += deltaY;\n return this._bubbleScroll(ev, deltaY);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IRenderService } from 'browser/services/Services';\nimport { Disposable } from 'common/Lifecycle';\nimport { IBufferService, IDecorationService, IInternalDecoration } from 'common/services/Services';\n\nexport class BufferDecorationRenderer extends Disposable {\n private readonly _container: HTMLElement;\n private readonly _decorationElements: Map = new Map();\n\n private _animationFrame: number | undefined;\n private _altBufferIsActive: boolean = false;\n private _dimensionsChanged: boolean = false;\n\n constructor(\n private readonly _screenElement: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IDecorationService private readonly _decorationService: IDecorationService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n super();\n\n this._container = document.createElement('div');\n this._container.classList.add('xterm-decoration-container');\n this._screenElement.appendChild(this._container);\n\n this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh()));\n this.register(this._renderService.onDimensionsChange(() => {\n this._dimensionsChanged = true;\n this._queueRefresh();\n }));\n this.register(addDisposableDomListener(window, 'resize', () => this._queueRefresh()));\n this.register(this._bufferService.buffers.onBufferActivate(() => {\n this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt;\n }));\n this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh()));\n this.register(this._decorationService.onDecorationRemoved(decoration => this._removeDecoration(decoration)));\n }\n\n public override dispose(): void {\n this._container.remove();\n this._decorationElements.clear();\n super.dispose();\n }\n\n private _queueRefresh(): void {\n if (this._animationFrame !== undefined) {\n return;\n }\n this._animationFrame = this._renderService.addRefreshCallback(() => {\n this.refreshDecorations();\n this._animationFrame = undefined;\n });\n }\n\n public refreshDecorations(): void {\n for (const decoration of this._decorationService.decorations) {\n this._renderDecoration(decoration);\n }\n this._dimensionsChanged = false;\n }\n\n private _renderDecoration(decoration: IInternalDecoration): void {\n this._refreshStyle(decoration);\n if (this._dimensionsChanged) {\n this._refreshXPosition(decoration);\n }\n }\n\n private _createElement(decoration: IInternalDecoration): HTMLElement {\n const element = document.createElement('div');\n element.classList.add('xterm-decoration');\n element.style.width = `${Math.round((decoration.options.width || 1) * this._renderService.dimensions.actualCellWidth)}px`;\n element.style.height = `${(decoration.options.height || 1) * this._renderService.dimensions.actualCellHeight}px`;\n element.style.top = `${(decoration.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.actualCellHeight}px`;\n element.style.lineHeight = `${this._renderService.dimensions.actualCellHeight}px`;\n\n const x = decoration.options.x ?? 0;\n if (x && x > this._bufferService.cols) {\n // exceeded the container width, so hide\n element.style.display = 'none';\n }\n this._refreshXPosition(decoration, element);\n\n return element;\n }\n\n private _refreshStyle(decoration: IInternalDecoration): void {\n const line = decoration.marker.line - this._bufferService.buffers.active.ydisp;\n if (line < 0 || line >= this._bufferService.rows) {\n // outside of viewport\n if (decoration.element) {\n decoration.element.style.display = 'none';\n decoration.onRenderEmitter.fire(decoration.element);\n }\n } else {\n let element = this._decorationElements.get(decoration);\n if (!element) {\n decoration.onDispose(() => this._removeDecoration(decoration));\n element = this._createElement(decoration);\n decoration.element = element;\n this._decorationElements.set(decoration, element);\n this._container.appendChild(element);\n }\n element.style.top = `${line * this._renderService.dimensions.actualCellHeight}px`;\n element.style.display = this._altBufferIsActive ? 'none' : 'block';\n decoration.onRenderEmitter.fire(element);\n }\n }\n\n private _refreshXPosition(decoration: IInternalDecoration, element: HTMLElement | undefined = decoration.element): void {\n if (!element) {\n return;\n }\n const x = decoration.options.x ?? 0;\n if ((decoration.options.anchor || 'left') === 'right') {\n element.style.right = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : '';\n } else {\n element.style.left = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : '';\n }\n }\n\n private _removeDecoration(decoration: IInternalDecoration): void {\n this._decorationElements.get(decoration)?.remove();\n this._decorationElements.delete(decoration);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IInternalDecoration } from 'common/services/Services';\n\nexport interface IColorZoneStore {\n readonly zones: IColorZone[];\n clear(): void;\n addDecoration(decoration: IInternalDecoration): void;\n /**\n * Sets the amount of padding in lines that will be added between zones, if new lines intersect\n * the padding they will be merged into the same zone.\n */\n setPadding(padding: { [position: string]: number }): void;\n}\n\nexport interface IColorZone {\n /** Color in a format supported by canvas' fillStyle. */\n color: string;\n position: 'full' | 'left' | 'center' | 'right' | undefined;\n startBufferLine: number;\n endBufferLine: number;\n}\n\ninterface IMinimalDecorationForColorZone {\n marker: Pick;\n options: Pick;\n}\n\nexport class ColorZoneStore implements IColorZoneStore {\n private _zones: IColorZone[] = [];\n\n // The zone pool is used to keep zone objects from being freed between clearing the color zone\n // store and fetching the zones. This helps reduce GC pressure since the color zones are\n // accumulated on potentially every scroll event.\n private _zonePool: IColorZone[] = [];\n private _zonePoolIndex = 0;\n\n private _linePadding: { [position: string]: number } = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n };\n\n public get zones(): IColorZone[] {\n // Trim the zone pool to free unused memory\n this._zonePool.length = Math.min(this._zonePool.length, this._zones.length);\n return this._zones;\n }\n\n public clear(): void {\n this._zones.length = 0;\n this._zonePoolIndex = 0;\n }\n\n public addDecoration(decoration: IMinimalDecorationForColorZone): void {\n if (!decoration.options.overviewRulerOptions) {\n return;\n }\n for (const z of this._zones) {\n if (z.color === decoration.options.overviewRulerOptions.color &&\n z.position === decoration.options.overviewRulerOptions.position) {\n if (this._lineIntersectsZone(z, decoration.marker.line)) {\n return;\n }\n if (this._lineAdjacentToZone(z, decoration.marker.line, decoration.options.overviewRulerOptions.position)) {\n this._addLineToZone(z, decoration.marker.line);\n return;\n }\n }\n }\n // Create using zone pool if possible\n if (this._zonePoolIndex < this._zonePool.length) {\n this._zonePool[this._zonePoolIndex].color = decoration.options.overviewRulerOptions.color;\n this._zonePool[this._zonePoolIndex].position = decoration.options.overviewRulerOptions.position;\n this._zonePool[this._zonePoolIndex].startBufferLine = decoration.marker.line;\n this._zonePool[this._zonePoolIndex].endBufferLine = decoration.marker.line;\n this._zones.push(this._zonePool[this._zonePoolIndex++]);\n return;\n }\n // Create\n this._zones.push({\n color: decoration.options.overviewRulerOptions.color,\n position: decoration.options.overviewRulerOptions.position,\n startBufferLine: decoration.marker.line,\n endBufferLine: decoration.marker.line\n });\n this._zonePool.push(this._zones[this._zones.length - 1]);\n this._zonePoolIndex++;\n }\n\n public setPadding(padding: { [position: string]: number }): void {\n this._linePadding = padding;\n }\n\n private _lineIntersectsZone(zone: IColorZone, line: number): boolean {\n return (\n line >= zone.startBufferLine &&\n line <= zone.endBufferLine\n );\n }\n\n private _lineAdjacentToZone(zone: IColorZone, line: number, position: IColorZone['position']): boolean {\n return (\n (line >= zone.startBufferLine - this._linePadding[position || 'full']) &&\n (line <= zone.endBufferLine + this._linePadding[position || 'full'])\n );\n }\n\n private _addLineToZone(zone: IColorZone, line: number): void {\n zone.startBufferLine = Math.min(zone.startBufferLine, line);\n zone.endBufferLine = Math.max(zone.endBufferLine, line);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ColorZoneStore, IColorZone, IColorZoneStore } from 'browser/decorations/ColorZoneStore';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IRenderService } from 'browser/services/Services';\nimport { Disposable } from 'common/Lifecycle';\nimport { IBufferService, IDecorationService, IInternalDecoration, IOptionsService } from 'common/services/Services';\n\n// Helper objects to avoid excessive calculation and garbage collection during rendering. These are\n// static values for each render and can be accessed using the decoration position as the key.\nconst drawHeight = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\nconst drawWidth = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\nconst drawX = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\n\nexport class OverviewRulerRenderer extends Disposable {\n private readonly _canvas: HTMLCanvasElement;\n private readonly _ctx: CanvasRenderingContext2D;\n private readonly _colorZoneStore: IColorZoneStore = new ColorZoneStore();\n private get _width(): number {\n return this._optionsService.options.overviewRulerWidth || 0;\n }\n private _animationFrame: number | undefined;\n\n private _shouldUpdateDimensions: boolean | undefined = true;\n private _shouldUpdateAnchor: boolean | undefined = true;\n private _lastKnownBufferLength: number = 0;\n\n private _containerHeight: number | undefined;\n\n constructor(\n private readonly _viewportElement: HTMLElement,\n private readonly _screenElement: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IDecorationService private readonly _decorationService: IDecorationService,\n @IRenderService private readonly _renderService: IRenderService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n this._canvas = document.createElement('canvas');\n this._canvas.classList.add('xterm-decoration-overview-ruler');\n this._refreshCanvasDimensions();\n this._viewportElement.parentElement?.insertBefore(this._canvas, this._viewportElement);\n const ctx = this._canvas.getContext('2d');\n if (!ctx) {\n throw new Error('Ctx cannot be null');\n } else {\n this._ctx = ctx;\n }\n this._registerDecorationListeners();\n this._registerBufferChangeListeners();\n this._registerDimensionChangeListeners();\n }\n\n /**\n * On decoration add or remove, redraw\n */\n private _registerDecorationListeners(): void {\n this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(undefined, true)));\n this.register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(undefined, true)));\n }\n\n /**\n * On buffer change, redraw\n * and hide the canvas if the alt buffer is active\n */\n private _registerBufferChangeListeners(): void {\n this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh()));\n this.register(this._bufferService.buffers.onBufferActivate(() => {\n this._canvas!.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? 'none' : 'block';\n }));\n this.register(this._bufferService.onScroll(() => {\n if (this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length) {\n this._refreshDrawHeightConstants();\n this._refreshColorZonePadding();\n }\n }));\n }\n /**\n * On dimension change, update canvas dimensions\n * and then redraw\n */\n private _registerDimensionChangeListeners(): void {\n // container height changed\n this.register(this._renderService.onRender((): void => {\n if (!this._containerHeight || this._containerHeight !== this._screenElement.clientHeight) {\n this._queueRefresh(true);\n this._containerHeight = this._screenElement.clientHeight;\n }\n }));\n // overview ruler width changed\n this.register(this._optionsService.onOptionChange(o => {\n if (o === 'overviewRulerWidth') {\n this._queueRefresh(true);\n }\n }));\n // device pixel ratio changed\n this.register(addDisposableDomListener(window, 'resize', () => {\n this._queueRefresh(true);\n }));\n // set the canvas dimensions\n this._queueRefresh(true);\n }\n\n public override dispose(): void {\n this._canvas?.remove();\n super.dispose();\n }\n\n private _refreshDrawConstants(): void {\n // width\n const outerWidth = Math.floor(this._canvas.width / 3);\n const innerWidth = Math.ceil(this._canvas.width / 3);\n drawWidth.full = this._canvas.width;\n drawWidth.left = outerWidth;\n drawWidth.center = innerWidth;\n drawWidth.right = outerWidth;\n // height\n this._refreshDrawHeightConstants();\n // x\n drawX.full = 0;\n drawX.left = 0;\n drawX.center = drawWidth.left;\n drawX.right = drawWidth.left + drawWidth.center;\n }\n\n private _refreshDrawHeightConstants(): void {\n drawHeight.full = Math.round(2 * window.devicePixelRatio);\n // Calculate actual pixels per line\n const pixelsPerLine = this._canvas.height / this._bufferService.buffer.lines.length;\n // Clamp actual pixels within a range\n const nonFullHeight = Math.round(Math.max(Math.min(pixelsPerLine, 12), 6) * window.devicePixelRatio);\n drawHeight.left = nonFullHeight;\n drawHeight.center = nonFullHeight;\n drawHeight.right = nonFullHeight;\n }\n\n private _refreshColorZonePadding(): void {\n this._colorZoneStore.setPadding({\n full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.full),\n left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.left),\n center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.center),\n right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.right)\n });\n this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length;\n }\n\n private _refreshCanvasDimensions(): void {\n this._canvas.style.width = `${this._width}px`;\n this._canvas.width = Math.round(this._width * window.devicePixelRatio);\n this._canvas.style.height = `${this._screenElement.clientHeight}px`;\n this._canvas.height = Math.round(this._screenElement.clientHeight * window.devicePixelRatio);\n this._refreshDrawConstants();\n this._refreshColorZonePadding();\n }\n\n private _refreshDecorations(): void {\n if (this._shouldUpdateDimensions) {\n this._refreshCanvasDimensions();\n }\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n this._colorZoneStore.clear();\n for (const decoration of this._decorationService.decorations) {\n this._colorZoneStore.addDecoration(decoration);\n }\n this._ctx.lineWidth = 1;\n const zones = this._colorZoneStore.zones;\n for (const zone of zones) {\n if (zone.position !== 'full') {\n this._renderColorZone(zone);\n }\n }\n for (const zone of zones) {\n if (zone.position === 'full') {\n this._renderColorZone(zone);\n }\n }\n this._shouldUpdateDimensions = false;\n this._shouldUpdateAnchor = false;\n }\n\n private _renderColorZone(zone: IColorZone): void {\n // TODO: Is _decorationElements needed?\n\n this._ctx.fillStyle = zone.color;\n this._ctx.fillRect(\n /* x */ drawX[zone.position || 'full'],\n /* y */ Math.round(\n (this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line\n (zone.startBufferLine / this._bufferService.buffers.active.lines.length) - drawHeight[zone.position || 'full'] / 2\n ),\n /* w */ drawWidth[zone.position || 'full'],\n /* h */ Math.round(\n (this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line\n ((zone.endBufferLine - zone.startBufferLine) / this._bufferService.buffers.active.lines.length) + drawHeight[zone.position || 'full']\n )\n );\n }\n\n private _queueRefresh(updateCanvasDimensions?: boolean, updateAnchor?: boolean): void {\n this._shouldUpdateDimensions = updateCanvasDimensions || this._shouldUpdateDimensions;\n this._shouldUpdateAnchor = updateAnchor || this._shouldUpdateAnchor;\n if (this._animationFrame !== undefined) {\n return;\n }\n this._animationFrame = window.requestAnimationFrame(() => {\n this._refreshDecorations();\n this._animationFrame = undefined;\n });\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderService } from 'browser/services/Services';\nimport { IBufferService, ICoreService, IOptionsService } from 'common/services/Services';\n\ninterface IPosition {\n start: number;\n end: number;\n}\n\n/**\n * Encapsulates the logic for handling compositionstart, compositionupdate and compositionend\n * events, displaying the in-progress composition to the UI and forwarding the final composition\n * to the handler.\n */\nexport class CompositionHelper {\n /**\n * Whether input composition is currently happening, eg. via a mobile keyboard, speech input or\n * IME. This variable determines whether the compositionText should be displayed on the UI.\n */\n private _isComposing: boolean;\n public get isComposing(): boolean { return this._isComposing; }\n\n /**\n * The position within the input textarea's value of the current composition.\n */\n private _compositionPosition: IPosition;\n\n /**\n * Whether a composition is in the process of being sent, setting this to false will cancel any\n * in-progress composition.\n */\n private _isSendingComposition: boolean;\n\n /**\n * Data already sent due to keydown event.\n */\n private _dataAlreadySent: string;\n\n constructor(\n private readonly _textarea: HTMLTextAreaElement,\n private readonly _compositionView: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICoreService private readonly _coreService: ICoreService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n this._isComposing = false;\n this._isSendingComposition = false;\n this._compositionPosition = { start: 0, end: 0 };\n this._dataAlreadySent = '';\n }\n\n /**\n * Handles the compositionstart event, activating the composition view.\n */\n public compositionstart(): void {\n this._isComposing = true;\n this._compositionPosition.start = this._textarea.value.length;\n this._compositionView.textContent = '';\n this._dataAlreadySent = '';\n this._compositionView.classList.add('active');\n }\n\n /**\n * Handles the compositionupdate event, updating the composition view.\n * @param ev The event.\n */\n public compositionupdate(ev: Pick): void {\n this._compositionView.textContent = ev.data;\n this.updateCompositionElements();\n setTimeout(() => {\n this._compositionPosition.end = this._textarea.value.length;\n }, 0);\n }\n\n /**\n * Handles the compositionend event, hiding the composition view and sending the composition to\n * the handler.\n */\n public compositionend(): void {\n this._finalizeComposition(true);\n }\n\n /**\n * Handles the keydown event, routing any necessary events to the CompositionHelper functions.\n * @param ev The keydown event.\n * @return Whether the Terminal should continue processing the keydown event.\n */\n public keydown(ev: KeyboardEvent): boolean {\n if (this._isComposing || this._isSendingComposition) {\n if (ev.keyCode === 229) {\n // Continue composing if the keyCode is the \"composition character\"\n return false;\n }\n if (ev.keyCode === 16 || ev.keyCode === 17 || ev.keyCode === 18) {\n // Continue composing if the keyCode is a modifier key\n return false;\n }\n // Finish composition immediately. This is mainly here for the case where enter is\n // pressed and the handler needs to be triggered before the command is executed.\n this._finalizeComposition(false);\n }\n\n if (ev.keyCode === 229) {\n // If the \"composition character\" is used but gets to this point it means a non-composition\n // character (eg. numbers and punctuation) was pressed when the IME was active.\n this._handleAnyTextareaChanges();\n return false;\n }\n\n return true;\n }\n\n /**\n * Finalizes the composition, resuming regular input actions. This is called when a composition\n * is ending.\n * @param waitForPropagation Whether to wait for events to propagate before sending\n * the input. This should be false if a non-composition keystroke is entered before the\n * compositionend event is triggered, such as enter, so that the composition is sent before\n * the command is executed.\n */\n private _finalizeComposition(waitForPropagation: boolean): void {\n this._compositionView.classList.remove('active');\n this._isComposing = false;\n\n if (!waitForPropagation) {\n // Cancel any delayed composition send requests and send the input immediately.\n this._isSendingComposition = false;\n const input = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end);\n this._coreService.triggerDataEvent(input, true);\n } else {\n // Make a deep copy of the composition position here as a new compositionstart event may\n // fire before the setTimeout executes.\n const currentCompositionPosition = {\n start: this._compositionPosition.start,\n end: this._compositionPosition.end\n };\n\n // Since composition* events happen before the changes take place in the textarea on most\n // browsers, use a setTimeout with 0ms time to allow the native compositionend event to\n // complete. This ensures the correct character is retrieved.\n // This solution was used because:\n // - The compositionend event's data property is unreliable, at least on Chromium\n // - The last compositionupdate event's data property does not always accurately describe\n // the character, a counter example being Korean where an ending consonsant can move to\n // the following character if the following input is a vowel.\n this._isSendingComposition = true;\n setTimeout(() => {\n // Ensure that the input has not already been sent\n if (this._isSendingComposition) {\n this._isSendingComposition = false;\n let input;\n // Add length of data already sent due to keydown event,\n // otherwise input characters can be duplicated. (Issue #3191)\n currentCompositionPosition.start += this._dataAlreadySent.length;\n if (this._isComposing) {\n // Use the end position to get the string if a new composition has started.\n input = this._textarea.value.substring(currentCompositionPosition.start, currentCompositionPosition.end);\n } else {\n // Don't use the end position here in order to pick up any characters after the\n // composition has finished, for example when typing a non-composition character\n // (eg. 2) after a composition character.\n input = this._textarea.value.substring(currentCompositionPosition.start);\n }\n if (input.length > 0) {\n this._coreService.triggerDataEvent(input, true);\n }\n }\n }, 0);\n }\n }\n\n /**\n * Apply any changes made to the textarea after the current event chain is allowed to complete.\n * This should be called when not currently composing but a keydown event with the \"composition\n * character\" (229) is triggered, in order to allow non-composition text to be entered when an\n * IME is active.\n */\n private _handleAnyTextareaChanges(): void {\n const oldValue = this._textarea.value;\n setTimeout(() => {\n // Ignore if a composition has started since the timeout\n if (!this._isComposing) {\n const newValue = this._textarea.value;\n const diff = newValue.replace(oldValue, '');\n if (diff.length > 0) {\n this._dataAlreadySent = diff;\n this._coreService.triggerDataEvent(diff, true);\n }\n }\n }, 0);\n }\n\n /**\n * Positions the composition view on top of the cursor and the textarea just below it (so the\n * IME helper dialog is positioned correctly).\n * @param dontRecurse Whether to use setTimeout to recursively trigger another update, this is\n * necessary as the IME events across browsers are not consistently triggered.\n */\n public updateCompositionElements(dontRecurse?: boolean): void {\n if (!this._isComposing) {\n return;\n }\n\n if (this._bufferService.buffer.isCursorInViewport) {\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n\n const cellHeight = this._renderService.dimensions.actualCellHeight;\n const cursorTop = this._bufferService.buffer.y * this._renderService.dimensions.actualCellHeight;\n const cursorLeft = cursorX * this._renderService.dimensions.actualCellWidth;\n\n this._compositionView.style.left = cursorLeft + 'px';\n this._compositionView.style.top = cursorTop + 'px';\n this._compositionView.style.height = cellHeight + 'px';\n this._compositionView.style.lineHeight = cellHeight + 'px';\n this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily;\n this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + 'px';\n // Sync the textarea to the exact position of the composition view so the IME knows where the\n // text is.\n const compositionViewBounds = this._compositionView.getBoundingClientRect();\n this._textarea.style.left = cursorLeft + 'px';\n this._textarea.style.top = cursorTop + 'px';\n // Ensure the text area is at least 1x1, otherwise certain IMEs may break\n this._textarea.style.width = Math.max(compositionViewBounds.width, 1) + 'px';\n this._textarea.style.height = Math.max(compositionViewBounds.height, 1) + 'px';\n this._textarea.style.lineHeight = compositionViewBounds.height + 'px';\n }\n\n if (!dontRecurse) {\n setTimeout(() => this.updateCompositionElements(true), 0);\n }\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function getCoordsRelativeToElement(window: Pick, event: {clientX: number, clientY: number}, element: HTMLElement): [number, number] {\n const rect = element.getBoundingClientRect();\n const elementStyle = window.getComputedStyle(element);\n const leftPadding = parseInt(elementStyle.getPropertyValue('padding-left'));\n const topPadding = parseInt(elementStyle.getPropertyValue('padding-top'));\n return [\n event.clientX - rect.left - leftPadding,\n event.clientY - rect.top - topPadding\n ];\n}\n\n/**\n * Gets coordinates within the terminal for a particular mouse event. The result\n * is returned as an array in the form [x, y] instead of an object as it's a\n * little faster and this function is used in some low level code.\n * @param event The mouse event.\n * @param element The terminal's container element.\n * @param colCount The number of columns in the terminal.\n * @param rowCount The number of rows n the terminal.\n * @param isSelection Whether the request is for the selection or not. This will\n * apply an offset to the x value such that the left half of the cell will\n * select that cell and the right half will select the next cell.\n */\nexport function getCoords(window: Pick, event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, hasValidCharSize: boolean, actualCellWidth: number, actualCellHeight: number, isSelection?: boolean): [number, number] | undefined {\n // Coordinates cannot be measured if there are no valid\n if (!hasValidCharSize) {\n return undefined;\n }\n\n const coords = getCoordsRelativeToElement(window, event, element);\n if (!coords) {\n return undefined;\n }\n\n coords[0] = Math.ceil((coords[0] + (isSelection ? actualCellWidth / 2 : 0)) / actualCellWidth);\n coords[1] = Math.ceil(coords[1] / actualCellHeight);\n\n // Ensure coordinates are within the terminal viewport. Note that selections\n // need an addition point of precision to cover the end point (as characters\n // cover half of one char and half of the next).\n coords[0] = Math.min(Math.max(coords[0], 1), colCount + (isSelection ? 1 : 0));\n coords[1] = Math.min(Math.max(coords[1], 1), rowCount);\n\n return coords;\n}\n\n/**\n * Gets coordinates within the terminal for a particular mouse event, wrapping\n * them to the bounds of the terminal and adding 32 to both the x and y values\n * as expected by xterm.\n */\nexport function getRawByteCoords(coords: [number, number] | undefined): { x: number, y: number } | undefined {\n if (!coords) {\n return undefined;\n }\n\n // xterm sends raw bytes and starts at 32 (SP) for each.\n return { x: coords[0] + 32, y: coords[1] + 32 };\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { C0 } from 'common/data/EscapeSequences';\nimport { IBufferService } from 'common/services/Services';\n\nconst enum Direction {\n UP = 'A',\n DOWN = 'B',\n RIGHT = 'C',\n LEFT = 'D'\n}\n\n/**\n * Concatenates all the arrow sequences together.\n * Resets the starting row to an unwrapped row, moves to the requested row,\n * then moves to requested col.\n */\nexport function moveToCellSequence(targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n const startX = bufferService.buffer.x;\n const startY = bufferService.buffer.y;\n\n // The alt buffer should try to navigate between rows\n if (!bufferService.buffer.hasScrollback) {\n return resetStartingRow(startX, startY, targetX, targetY, bufferService, applicationCursor) +\n moveToRequestedRow(startY, targetY, bufferService, applicationCursor) +\n moveToRequestedCol(startX, startY, targetX, targetY, bufferService, applicationCursor);\n }\n\n // Only move horizontally for the normal buffer\n let direction;\n if (startY === targetY) {\n direction = startX > targetX ? Direction.LEFT : Direction.RIGHT;\n return repeat(Math.abs(startX - targetX), sequence(direction, applicationCursor));\n }\n direction = startY > targetY ? Direction.LEFT : Direction.RIGHT;\n const rowDifference = Math.abs(startY - targetY);\n const cellsToMove = colsFromRowEnd(startY > targetY ? targetX : startX, bufferService) +\n (rowDifference - 1) * bufferService.cols + 1 /* wrap around 1 row */ +\n colsFromRowBeginning(startY > targetY ? startX : targetX, bufferService);\n return repeat(cellsToMove, sequence(direction, applicationCursor));\n}\n\n/**\n * Find the number of cols from a row beginning to a col.\n */\nfunction colsFromRowBeginning(currX: number, bufferService: IBufferService): number {\n return currX - 1;\n}\n\n/**\n * Find the number of cols from a col to row end.\n */\nfunction colsFromRowEnd(currX: number, bufferService: IBufferService): number {\n return bufferService.cols - currX;\n}\n\n/**\n * If the initial position of the cursor is on a row that is wrapped, move the\n * cursor up to the first row that is not wrapped to have accurate vertical\n * positioning.\n */\nfunction resetStartingRow(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length === 0) {\n return '';\n }\n return repeat(bufferLine(\n startX, startY, startX,\n startY - wrappedRowsForRow(bufferService, startY), false, bufferService\n ).length, sequence(Direction.LEFT, applicationCursor));\n}\n\n/**\n * Using the reset starting and ending row, move to the requested row,\n * ignoring wrapped rows\n */\nfunction moveToRequestedRow(startY: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n const startRow = startY - wrappedRowsForRow(bufferService, startY);\n const endRow = targetY - wrappedRowsForRow(bufferService, targetY);\n\n const rowsToMove = Math.abs(startRow - endRow) - wrappedRowsCount(startY, targetY, bufferService);\n\n return repeat(rowsToMove, sequence(verticalDirection(startY, targetY), applicationCursor));\n}\n\n/**\n * Move to the requested col on the ending row\n */\nfunction moveToRequestedCol(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n let startRow;\n if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length > 0) {\n startRow = targetY - wrappedRowsForRow(bufferService, targetY);\n } else {\n startRow = startY;\n }\n\n const endRow = targetY;\n const direction = horizontalDirection(startX, startY, targetX, targetY, bufferService, applicationCursor);\n\n return repeat(bufferLine(\n startX, startRow, targetX, endRow,\n direction === Direction.RIGHT, bufferService\n ).length, sequence(direction, applicationCursor));\n}\n\n/**\n * Utility functions\n */\n\n/**\n * Calculates the number of wrapped rows between the unwrapped starting and\n * ending rows. These rows need to ignored since the cursor skips over them.\n */\nfunction wrappedRowsCount(startY: number, targetY: number, bufferService: IBufferService): number {\n let wrappedRows = 0;\n const startRow = startY - wrappedRowsForRow(bufferService, startY);\n const endRow = targetY - wrappedRowsForRow(bufferService, targetY);\n\n for (let i = 0; i < Math.abs(startRow - endRow); i++) {\n const direction = verticalDirection(startY, targetY) === Direction.UP ? -1 : 1;\n const line = bufferService.buffer.lines.get(startRow + (direction * i));\n if (line?.isWrapped) {\n wrappedRows++;\n }\n }\n\n return wrappedRows;\n}\n\n/**\n * Calculates the number of wrapped rows that make up a given row.\n * @param currentRow The row to determine how many wrapped rows make it up\n */\nfunction wrappedRowsForRow(bufferService: IBufferService, currentRow: number): number {\n let rowCount = 0;\n let line = bufferService.buffer.lines.get(currentRow);\n let lineWraps = line?.isWrapped;\n\n while (lineWraps && currentRow >= 0 && currentRow < bufferService.rows) {\n rowCount++;\n line = bufferService.buffer.lines.get(--currentRow);\n lineWraps = line?.isWrapped;\n }\n\n return rowCount;\n}\n\n/**\n * Direction determiners\n */\n\n/**\n * Determines if the right or left arrow is needed\n */\nfunction horizontalDirection(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): Direction {\n let startRow;\n if (moveToRequestedRow(targetX, targetY, bufferService, applicationCursor).length > 0) {\n startRow = targetY - wrappedRowsForRow(bufferService, targetY);\n } else {\n startRow = startY;\n }\n\n if ((startX < targetX &&\n startRow <= targetY) || // down/right or same y/right\n (startX >= targetX &&\n startRow < targetY)) { // down/left or same y/left\n return Direction.RIGHT;\n }\n return Direction.LEFT;\n}\n\n/**\n * Determines if the up or down arrow is needed\n */\nfunction verticalDirection(startY: number, targetY: number): Direction {\n return startY > targetY ? Direction.UP : Direction.DOWN;\n}\n\n/**\n * Constructs the string of chars in the buffer from a starting row and col\n * to an ending row and col\n * @param startCol The starting column position\n * @param startRow The starting row position\n * @param endCol The ending column position\n * @param endRow The ending row position\n * @param forward Direction to move\n */\nfunction bufferLine(\n startCol: number,\n startRow: number,\n endCol: number,\n endRow: number,\n forward: boolean,\n bufferService: IBufferService\n): string {\n let currentCol = startCol;\n let currentRow = startRow;\n let bufferStr = '';\n\n while (currentCol !== endCol || currentRow !== endRow) {\n currentCol += forward ? 1 : -1;\n\n if (forward && currentCol > bufferService.cols - 1) {\n bufferStr += bufferService.buffer.translateBufferLineToString(\n currentRow, false, startCol, currentCol\n );\n currentCol = 0;\n startCol = 0;\n currentRow++;\n } else if (!forward && currentCol < 0) {\n bufferStr += bufferService.buffer.translateBufferLineToString(\n currentRow, false, 0, startCol + 1\n );\n currentCol = bufferService.cols - 1;\n startCol = currentCol;\n currentRow--;\n }\n }\n\n return bufferStr + bufferService.buffer.translateBufferLineToString(\n currentRow, false, startCol, currentCol\n );\n}\n\n/**\n * Constructs the escape sequence for clicking an arrow\n * @param direction The direction to move\n */\nfunction sequence(direction: Direction, applicationCursor: boolean): string {\n const mod = applicationCursor ? 'O' : '[';\n return C0.ESC + mod + direction;\n}\n\n/**\n * Returns a string repeated a given number of times\n * Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\n * @param count The number of times to repeat the string\n * @param string The string that is to be repeated\n */\nfunction repeat(count: number, str: string): string {\n count = Math.floor(count);\n let rpt = '';\n for (let i = 0; i < count; i++) {\n rpt += str;\n }\n return rpt;\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Terminal as ITerminalApi, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBufferNamespace as IBufferNamespaceApi, IParser, ILinkProvider, IUnicodeHandling, FontWeight, IModes, IDecorationOptions, IDecoration } from 'xterm';\nimport { ITerminal } from 'browser/Types';\nimport { Terminal as TerminalCore } from 'browser/Terminal';\nimport * as Strings from 'browser/LocalizableStrings';\nimport { IEvent } from 'common/EventEmitter';\nimport { ParserApi } from 'common/public/ParserApi';\nimport { UnicodeApi } from 'common/public/UnicodeApi';\nimport { AddonManager } from 'common/public/AddonManager';\nimport { BufferNamespaceApi } from 'common/public/BufferNamespaceApi';\nimport { ITerminalOptions } from 'common/Types';\n\n/**\n * The set of options that only have an effect when set in the Terminal constructor.\n */\nconst CONSTRUCTOR_ONLY_OPTIONS = ['cols', 'rows'];\n\nexport class Terminal implements ITerminalApi {\n private _core: ITerminal;\n private _addonManager: AddonManager;\n private _parser: IParser | undefined;\n private _buffer: BufferNamespaceApi | undefined;\n private _publicOptions: ITerminalOptions;\n\n constructor(options?: ITerminalOptions) {\n this._core = new TerminalCore(options);\n this._addonManager = new AddonManager();\n\n this._publicOptions = { ... this._core.options };\n const getter = (propName: string): any => {\n return this._core.options[propName];\n };\n const setter = (propName: string, value: any): void => {\n this._checkReadonlyOptions(propName);\n this._core.options[propName] = value;\n };\n\n for (const propName in this._core.options) {\n const desc = {\n get: getter.bind(this, propName),\n set: setter.bind(this, propName)\n };\n Object.defineProperty(this._publicOptions, propName, desc);\n }\n }\n\n private _checkReadonlyOptions(propName: string): void {\n // Throw an error if any constructor only option is modified\n // from terminal.options\n // Modifications from anywhere else are allowed\n if (CONSTRUCTOR_ONLY_OPTIONS.includes(propName)) {\n throw new Error(`Option \"${propName}\" can only be set in the constructor`);\n }\n }\n\n private _checkProposedApi(): void {\n if (!this._core.optionsService.rawOptions.allowProposedApi) {\n throw new Error('You must set the allowProposedApi option to true to use proposed API');\n }\n }\n\n public get onBell(): IEvent { return this._core.onBell; }\n public get onBinary(): IEvent { return this._core.onBinary; }\n public get onCursorMove(): IEvent { return this._core.onCursorMove; }\n public get onData(): IEvent { return this._core.onData; }\n public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._core.onKey; }\n public get onLineFeed(): IEvent { return this._core.onLineFeed; }\n public get onRender(): IEvent<{ start: number, end: number }> { return this._core.onRender; }\n public get onResize(): IEvent<{ cols: number, rows: number }> { return this._core.onResize; }\n public get onScroll(): IEvent { return this._core.onScroll; }\n public get onSelectionChange(): IEvent { return this._core.onSelectionChange; }\n public get onTitleChange(): IEvent { return this._core.onTitleChange; }\n public get onWriteParsed(): IEvent { return this._core.onWriteParsed; }\n\n public get element(): HTMLElement | undefined { return this._core.element; }\n public get parser(): IParser {\n this._checkProposedApi();\n if (!this._parser) {\n this._parser = new ParserApi(this._core);\n }\n return this._parser;\n }\n public get unicode(): IUnicodeHandling {\n this._checkProposedApi();\n return new UnicodeApi(this._core);\n }\n public get textarea(): HTMLTextAreaElement | undefined { return this._core.textarea; }\n public get rows(): number { return this._core.rows; }\n public get cols(): number { return this._core.cols; }\n public get buffer(): IBufferNamespaceApi {\n this._checkProposedApi();\n if (!this._buffer) {\n this._buffer = new BufferNamespaceApi(this._core);\n }\n return this._buffer;\n }\n public get markers(): ReadonlyArray {\n this._checkProposedApi();\n return this._core.markers;\n }\n public get modes(): IModes {\n const m = this._core.coreService.decPrivateModes;\n let mouseTrackingMode: 'none' | 'x10' | 'vt200' | 'drag' | 'any' = 'none';\n switch (this._core.coreMouseService.activeProtocol) {\n case 'X10': mouseTrackingMode = 'x10'; break;\n case 'VT200': mouseTrackingMode = 'vt200'; break;\n case 'DRAG': mouseTrackingMode = 'drag'; break;\n case 'ANY': mouseTrackingMode = 'any'; break;\n }\n return {\n applicationCursorKeysMode: m.applicationCursorKeys,\n applicationKeypadMode: m.applicationKeypad,\n bracketedPasteMode: m.bracketedPasteMode,\n insertMode: this._core.coreService.modes.insertMode,\n mouseTrackingMode: mouseTrackingMode,\n originMode: m.origin,\n reverseWraparoundMode: m.reverseWraparound,\n sendFocusMode: m.sendFocus,\n wraparoundMode: m.wraparound\n };\n }\n public get options(): ITerminalOptions {\n return this._publicOptions;\n }\n public set options(options: ITerminalOptions) {\n for (const propName in options) {\n this._publicOptions[propName] = options[propName];\n }\n }\n public blur(): void {\n this._core.blur();\n }\n public focus(): void {\n this._core.focus();\n }\n public resize(columns: number, rows: number): void {\n this._verifyIntegers(columns, rows);\n this._core.resize(columns, rows);\n }\n public open(parent: HTMLElement): void {\n this._core.open(parent);\n }\n public attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void {\n this._core.attachCustomKeyEventHandler(customKeyEventHandler);\n }\n public registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): number {\n this._checkProposedApi();\n return this._core.registerLinkMatcher(regex, handler, options);\n }\n public deregisterLinkMatcher(matcherId: number): void {\n this._checkProposedApi();\n this._core.deregisterLinkMatcher(matcherId);\n }\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n this._checkProposedApi();\n return this._core.registerLinkProvider(linkProvider);\n }\n public registerCharacterJoiner(handler: (text: string) => [number, number][]): number {\n this._checkProposedApi();\n return this._core.registerCharacterJoiner(handler);\n }\n public deregisterCharacterJoiner(joinerId: number): void {\n this._checkProposedApi();\n this._core.deregisterCharacterJoiner(joinerId);\n }\n public registerMarker(cursorYOffset: number = 0): IMarker | undefined {\n this._checkProposedApi();\n this._verifyIntegers(cursorYOffset);\n return this._core.addMarker(cursorYOffset);\n }\n public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined {\n this._checkProposedApi();\n this._verifyPositiveIntegers(decorationOptions.x ?? 0, decorationOptions.width ?? 0, decorationOptions.height ?? 0);\n return this._core.registerDecoration(decorationOptions);\n }\n public addMarker(cursorYOffset: number): IMarker | undefined {\n return this.registerMarker(cursorYOffset);\n }\n public hasSelection(): boolean {\n return this._core.hasSelection();\n }\n public select(column: number, row: number, length: number): void {\n this._verifyIntegers(column, row, length);\n this._core.select(column, row, length);\n }\n public getSelection(): string {\n return this._core.getSelection();\n }\n public getSelectionPosition(): ISelectionPosition | undefined {\n return this._core.getSelectionPosition();\n }\n public clearSelection(): void {\n this._core.clearSelection();\n }\n public selectAll(): void {\n this._core.selectAll();\n }\n public selectLines(start: number, end: number): void {\n this._verifyIntegers(start, end);\n this._core.selectLines(start, end);\n }\n public dispose(): void {\n this._addonManager.dispose();\n this._core.dispose();\n }\n public scrollLines(amount: number): void {\n this._verifyIntegers(amount);\n this._core.scrollLines(amount);\n }\n public scrollPages(pageCount: number): void {\n this._verifyIntegers(pageCount);\n this._core.scrollPages(pageCount);\n }\n public scrollToTop(): void {\n this._core.scrollToTop();\n }\n public scrollToBottom(): void {\n this._core.scrollToBottom();\n }\n public scrollToLine(line: number): void {\n this._verifyIntegers(line);\n this._core.scrollToLine(line);\n }\n public clear(): void {\n this._core.clear();\n }\n public write(data: string | Uint8Array, callback?: () => void): void {\n this._core.write(data, callback);\n }\n public writeUtf8(data: Uint8Array, callback?: () => void): void {\n this._core.write(data, callback);\n }\n public writeln(data: string | Uint8Array, callback?: () => void): void {\n this._core.write(data);\n this._core.write('\\r\\n', callback);\n }\n public paste(data: string): void {\n this._core.paste(data);\n }\n public getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string;\n public getOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell'): boolean;\n public getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number;\n public getOption(key: 'fontWeight' | 'fontWeightBold'): FontWeight;\n public getOption(key: string): any;\n public getOption(key: any): any {\n return this._core.optionsService.getOption(key);\n }\n public setOption(key: 'bellSound' | 'fontFamily' | 'termName' | 'wordSeparator', value: string): void;\n public setOption(key: 'fontWeight' | 'fontWeightBold', value: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number): void;\n public setOption(key: 'logLevel', value: 'debug' | 'info' | 'warn' | 'error' | 'off'): void;\n public setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void;\n public setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void;\n public setOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell', value: boolean): void;\n public setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void;\n public setOption(key: 'theme', value: ITheme): void;\n public setOption(key: 'cols' | 'rows', value: number): void;\n public setOption(key: string, value: any): void;\n public setOption(key: any, value: any): void {\n this._checkReadonlyOptions(key);\n this._core.optionsService.setOption(key, value);\n }\n public refresh(start: number, end: number): void {\n this._verifyIntegers(start, end);\n this._core.refresh(start, end);\n }\n public reset(): void {\n this._core.reset();\n }\n public clearTextureAtlas(): void {\n this._core.clearTextureAtlas();\n }\n public loadAddon(addon: ITerminalAddon): void {\n return this._addonManager.loadAddon(this, addon);\n }\n public static get strings(): ILocalizableStrings {\n return Strings;\n }\n\n private _verifyIntegers(...values: number[]): void {\n for (const value of values) {\n if (value === Infinity || isNaN(value) || value % 1 !== 0) {\n throw new Error('This API only accepts integers');\n }\n }\n }\n\n private _verifyPositiveIntegers(...values: number[]): void {\n for (const value of values) {\n if (value && (value === Infinity || isNaN(value) || value % 1 !== 0 || value < 0)) {\n throw new Error('This API only accepts positive integers');\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions, IRenderLayer } from 'browser/renderer/Types';\nimport { ICellData, IColor } from 'common/Types';\nimport { DEFAULT_COLOR, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_CODE, Attributes } from 'common/buffer/Constants';\nimport { IGlyphIdentifier } from 'browser/renderer/atlas/Types';\nimport { DIM_OPACITY, INVERTED_DEFAULT_COLOR, TEXT_BASELINE } from 'browser/renderer/atlas/Constants';\nimport { BaseCharAtlas } from 'browser/renderer/atlas/BaseCharAtlas';\nimport { acquireCharAtlas } from 'browser/renderer/atlas/CharAtlasCache';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { IColorSet } from 'browser/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { excludeFromContrastRatioDemands, throwIfFalsy } from 'browser/renderer/RendererUtils';\nimport { channels, color, rgba } from 'common/Color';\nimport { removeElementFromParent } from 'browser/Dom';\nimport { tryDrawCustomChar } from 'browser/renderer/CustomGlyphs';\n\nexport abstract class BaseRenderLayer implements IRenderLayer {\n private _canvas: HTMLCanvasElement;\n protected _ctx!: CanvasRenderingContext2D;\n private _scaledCharWidth: number = 0;\n private _scaledCharHeight: number = 0;\n private _scaledCellWidth: number = 0;\n private _scaledCellHeight: number = 0;\n private _scaledCharLeft: number = 0;\n private _scaledCharTop: number = 0;\n\n private _selectionStart: [number, number] | undefined;\n private _selectionEnd: [number, number] | undefined;\n private _columnSelectMode: boolean = false;\n\n protected _charAtlas: BaseCharAtlas | undefined;\n\n /**\n * An object that's reused when drawing glyphs in order to reduce GC.\n */\n private _currentGlyphIdentifier: IGlyphIdentifier = {\n chars: '',\n code: 0,\n bg: 0,\n fg: 0,\n bold: false,\n dim: false,\n italic: false\n };\n\n constructor(\n private _container: HTMLElement,\n id: string,\n zIndex: number,\n private _alpha: boolean,\n protected _colors: IColorSet,\n private _rendererId: number,\n protected readonly _bufferService: IBufferService,\n protected readonly _optionsService: IOptionsService,\n protected readonly _decorationService: IDecorationService\n ) {\n this._canvas = document.createElement('canvas');\n this._canvas.classList.add(`xterm-${id}-layer`);\n this._canvas.style.zIndex = zIndex.toString();\n this._initCanvas();\n this._container.appendChild(this._canvas);\n }\n\n public dispose(): void {\n removeElementFromParent(this._canvas);\n this._charAtlas?.dispose();\n }\n\n private _initCanvas(): void {\n this._ctx = throwIfFalsy(this._canvas.getContext('2d', { alpha: this._alpha }));\n // Draw the background if this is an opaque layer\n if (!this._alpha) {\n this._clearAll();\n }\n }\n\n public onOptionsChanged(): void {}\n public onBlur(): void {}\n public onFocus(): void {}\n public onCursorMove(): void {}\n public onGridChanged(startRow: number, endRow: number): void {}\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {\n this._selectionStart = start;\n this._selectionEnd = end;\n this._columnSelectMode = columnSelectMode;\n }\n\n public setColors(colorSet: IColorSet): void {\n this._refreshCharAtlas(colorSet);\n }\n\n protected _setTransparency(alpha: boolean): void {\n // Do nothing when alpha doesn't change\n if (alpha === this._alpha) {\n return;\n }\n\n // Create new canvas and replace old one\n const oldCanvas = this._canvas;\n this._alpha = alpha;\n // Cloning preserves properties\n this._canvas = this._canvas.cloneNode() as HTMLCanvasElement;\n this._initCanvas();\n this._container.replaceChild(this._canvas, oldCanvas);\n\n // Regenerate char atlas and force a full redraw\n this._refreshCharAtlas(this._colors);\n this.onGridChanged(0, this._bufferService.rows - 1);\n }\n\n /**\n * Refreshes the char atlas, aquiring a new one if necessary.\n * @param colorSet The color set to use for the char atlas.\n */\n private _refreshCharAtlas(colorSet: IColorSet): void {\n if (this._scaledCharWidth <= 0 && this._scaledCharHeight <= 0) {\n return;\n }\n this._charAtlas = acquireCharAtlas(this._optionsService.rawOptions, this._rendererId, colorSet, this._scaledCharWidth, this._scaledCharHeight);\n this._charAtlas.warmUp();\n }\n\n public resize(dim: IRenderDimensions): void {\n this._scaledCellWidth = dim.scaledCellWidth;\n this._scaledCellHeight = dim.scaledCellHeight;\n this._scaledCharWidth = dim.scaledCharWidth;\n this._scaledCharHeight = dim.scaledCharHeight;\n this._scaledCharLeft = dim.scaledCharLeft;\n this._scaledCharTop = dim.scaledCharTop;\n this._canvas.width = dim.scaledCanvasWidth;\n this._canvas.height = dim.scaledCanvasHeight;\n this._canvas.style.width = `${dim.canvasWidth}px`;\n this._canvas.style.height = `${dim.canvasHeight}px`;\n\n // Draw the background if this is an opaque layer\n if (!this._alpha) {\n this._clearAll();\n }\n\n this._refreshCharAtlas(this._colors);\n }\n\n public abstract reset(): void;\n\n public clearTextureAtlas(): void {\n this._charAtlas?.clear();\n }\n\n /**\n * Fills 1+ cells completely. This uses the existing fillStyle on the context.\n * @param x The column to start at.\n * @param y The row to start at\n * @param width The number of columns to fill.\n * @param height The number of rows to fill.\n */\n protected _fillCells(x: number, y: number, width: number, height: number): void {\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n y * this._scaledCellHeight,\n width * this._scaledCellWidth,\n height * this._scaledCellHeight);\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the middle of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillMiddleLineAtCells(x: number, y: number, width: number = 1): void {\n const cellOffset = Math.ceil(this._scaledCellHeight * 0.5);\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n (y + 1) * this._scaledCellHeight - cellOffset - window.devicePixelRatio,\n width * this._scaledCellWidth,\n window.devicePixelRatio);\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the bottom of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillBottomLineAtCells(x: number, y: number, width: number = 1): void {\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n (y + 1) * this._scaledCellHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */,\n width * this._scaledCellWidth,\n window.devicePixelRatio);\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the left of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillLeftLineAtCell(x: number, y: number, width: number): void {\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n y * this._scaledCellHeight,\n window.devicePixelRatio * width,\n this._scaledCellHeight);\n }\n\n /**\n * Strokes a 1px rectangle (2px on HDPI) around a cell. This uses the existing\n * strokeStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _strokeRectAtCell(x: number, y: number, width: number, height: number): void {\n this._ctx.lineWidth = window.devicePixelRatio;\n this._ctx.strokeRect(\n x * this._scaledCellWidth + window.devicePixelRatio / 2,\n y * this._scaledCellHeight + (window.devicePixelRatio / 2),\n width * this._scaledCellWidth - window.devicePixelRatio,\n (height * this._scaledCellHeight) - window.devicePixelRatio);\n }\n\n /**\n * Clears the entire canvas.\n */\n protected _clearAll(): void {\n if (this._alpha) {\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n } else {\n this._ctx.fillStyle = this._colors.background.css;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n }\n\n /**\n * Clears 1+ cells completely.\n * @param x The column to start at.\n * @param y The row to start at.\n * @param width The number of columns to clear.\n * @param height The number of rows to clear.\n */\n protected _clearCells(x: number, y: number, width: number, height: number): void {\n if (this._alpha) {\n this._ctx.clearRect(\n x * this._scaledCellWidth,\n y * this._scaledCellHeight,\n width * this._scaledCellWidth,\n height * this._scaledCellHeight);\n } else {\n this._ctx.fillStyle = this._colors.background.css;\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n y * this._scaledCellHeight,\n width * this._scaledCellWidth,\n height * this._scaledCellHeight);\n }\n }\n\n /**\n * Draws a truecolor character at the cell. The character will be clipped to\n * ensure that it fits with the cell, including the cell to the right if it's\n * a wide character. This uses the existing fillStyle on the context.\n * @param cell The cell data for the character to draw.\n * @param x The column to draw at.\n * @param y The row to draw at.\n * @param color The color of the character.\n */\n protected _fillCharTrueColor(cell: CellData, x: number, y: number): void {\n this._ctx.font = this._getFont(false, false);\n this._ctx.textBaseline = TEXT_BASELINE;\n this._clipRow(y);\n\n // Draw custom characters if applicable\n let drawSuccess = false;\n if (this._optionsService.rawOptions.customGlyphs !== false) {\n drawSuccess = tryDrawCustomChar(this._ctx, cell.getChars(), x * this._scaledCellWidth, y * this._scaledCellHeight, this._scaledCellWidth, this._scaledCellHeight);\n }\n\n // Draw the character\n if (!drawSuccess) {\n this._ctx.fillText(\n cell.getChars(),\n x * this._scaledCellWidth + this._scaledCharLeft,\n y * this._scaledCellHeight + this._scaledCharTop + this._scaledCharHeight);\n }\n }\n\n /**\n * Draws one or more characters at a cell. If possible this will draw using\n * the character atlas to reduce draw time.\n * @param chars The character or characters.\n * @param code The character code.\n * @param width The width of the characters.\n * @param x The column to draw at.\n * @param y The row to draw at.\n * @param fg The foreground color, in the format stored within the attributes.\n * @param bg The background color, in the format stored within the attributes.\n * This is used to validate whether a cached image can be used.\n * @param bold Whether the text is bold.\n */\n protected _drawChars(cell: ICellData, x: number, y: number): void {\n const contrastColor = this._getContrastColor(cell, x, y);\n\n // skip cache right away if we draw in RGB\n // Note: to avoid bad runtime JoinedCellData will be skipped\n // in the cache handler itself (atlasDidDraw == false) and\n // fall through to uncached later down below\n if (contrastColor || cell.isFgRGB() || cell.isBgRGB()) {\n this._drawUncachedChars(cell, x, y, contrastColor);\n return;\n }\n\n let fg;\n let bg;\n if (cell.isInverse()) {\n fg = (cell.isBgDefault()) ? INVERTED_DEFAULT_COLOR : cell.getBgColor();\n bg = (cell.isFgDefault()) ? INVERTED_DEFAULT_COLOR : cell.getFgColor();\n } else {\n bg = (cell.isBgDefault()) ? DEFAULT_COLOR : cell.getBgColor();\n fg = (cell.isFgDefault()) ? DEFAULT_COLOR : cell.getFgColor();\n }\n\n const drawInBrightColor = this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && fg < 8;\n\n fg += drawInBrightColor ? 8 : 0;\n this._currentGlyphIdentifier.chars = cell.getChars() || WHITESPACE_CELL_CHAR;\n this._currentGlyphIdentifier.code = cell.getCode() || WHITESPACE_CELL_CODE;\n this._currentGlyphIdentifier.bg = bg;\n this._currentGlyphIdentifier.fg = fg;\n this._currentGlyphIdentifier.bold = !!cell.isBold();\n this._currentGlyphIdentifier.dim = !!cell.isDim();\n this._currentGlyphIdentifier.italic = !!cell.isItalic();\n\n // Don't try cache the glyph if it uses any decoration foreground/background override.\n let hasOverrides = false;\n for (const d of this._decorationService.getDecorationsAtCell(x, y)) {\n if (d.backgroundColorRGB || d.foregroundColorRGB) {\n hasOverrides = true;\n break;\n }\n }\n\n const atlasDidDraw = hasOverrides ? false : this._charAtlas?.draw(this._ctx, this._currentGlyphIdentifier, x * this._scaledCellWidth + this._scaledCharLeft, y * this._scaledCellHeight + this._scaledCharTop);\n\n if (!atlasDidDraw) {\n this._drawUncachedChars(cell, x, y);\n }\n }\n\n /**\n * Draws one or more characters at one or more cells. The character(s) will be\n * clipped to ensure that they fit with the cell(s), including the cell to the\n * right if the last character is a wide character.\n * @param chars The character.\n * @param width The width of the character.\n * @param fg The foreground color, in the format stored within the attributes.\n * @param x The column to draw at.\n * @param y The row to draw at.\n */\n private _drawUncachedChars(cell: ICellData, x: number, y: number, fgOverride?: IColor): void {\n this._ctx.save();\n this._ctx.font = this._getFont(!!cell.isBold(), !!cell.isItalic());\n this._ctx.textBaseline = TEXT_BASELINE;\n\n if (cell.isInverse()) {\n if (fgOverride) {\n this._ctx.fillStyle = fgOverride.css;\n } else if (cell.isBgDefault()) {\n this._ctx.fillStyle = color.opaque(this._colors.background).css;\n } else if (cell.isBgRGB()) {\n this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getBgColor()).join(',')})`;\n } else {\n let bg = cell.getBgColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && bg < 8) {\n bg += 8;\n }\n this._ctx.fillStyle = this._colors.ansi[bg].css;\n }\n } else {\n if (fgOverride) {\n this._ctx.fillStyle = fgOverride.css;\n } else if (cell.isFgDefault()) {\n this._ctx.fillStyle = this._colors.foreground.css;\n } else if (cell.isFgRGB()) {\n this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`;\n } else {\n let fg = cell.getFgColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && fg < 8) {\n fg += 8;\n }\n this._ctx.fillStyle = this._colors.ansi[fg].css;\n }\n }\n\n this._clipRow(y);\n\n // Apply alpha to dim the character\n if (cell.isDim()) {\n this._ctx.globalAlpha = DIM_OPACITY;\n }\n\n // Draw custom characters if applicable\n let drawSuccess = false;\n if (this._optionsService.rawOptions.customGlyphs !== false) {\n drawSuccess = tryDrawCustomChar(this._ctx, cell.getChars(), x * this._scaledCellWidth, y * this._scaledCellHeight, this._scaledCellWidth, this._scaledCellHeight);\n }\n\n // Draw the character\n if (!drawSuccess) {\n this._ctx.fillText(\n cell.getChars(),\n x * this._scaledCellWidth + this._scaledCharLeft,\n y * this._scaledCellHeight + this._scaledCharTop + this._scaledCharHeight);\n }\n\n this._ctx.restore();\n }\n\n\n /**\n * Clips a row to ensure no pixels will be drawn outside the cells in the row.\n * @param y The row to clip.\n */\n private _clipRow(y: number): void {\n this._ctx.beginPath();\n this._ctx.rect(\n 0,\n y * this._scaledCellHeight,\n this._bufferService.cols * this._scaledCellWidth,\n this._scaledCellHeight);\n this._ctx.clip();\n }\n\n /**\n * Gets the current font.\n * @param isBold If we should use the bold fontWeight.\n */\n protected _getFont(isBold: boolean, isItalic: boolean): string {\n const fontWeight = isBold ? this._optionsService.rawOptions.fontWeightBold : this._optionsService.rawOptions.fontWeight;\n const fontStyle = isItalic ? 'italic' : '';\n\n return `${fontStyle} ${fontWeight} ${this._optionsService.rawOptions.fontSize * window.devicePixelRatio}px ${this._optionsService.rawOptions.fontFamily}`;\n }\n\n private _getContrastColor(cell: CellData, x: number, y: number): IColor | undefined {\n // Get any decoration foreground/background overrides, this must be fetched before the early\n // exist but applied after inverse\n let bgOverride: number | undefined;\n let fgOverride: number | undefined;\n let isTop = false;\n for (const d of this._decorationService.getDecorationsAtCell(x, y)) {\n if (d.options.layer !== 'top' && isTop) {\n continue;\n }\n if (d.backgroundColorRGB) {\n bgOverride = d.backgroundColorRGB.rgba;\n }\n if (d.foregroundColorRGB) {\n fgOverride = d.foregroundColorRGB.rgba;\n }\n isTop = d.options.layer === 'top';\n }\n\n // Apply selection foreground if applicable\n if (!isTop) {\n if (this._colors.selectionForeground && this._isCellInSelection(x, y)) {\n fgOverride = this._colors.selectionForeground.rgba;\n }\n }\n\n if (!bgOverride && !fgOverride && (this._optionsService.rawOptions.minimumContrastRatio === 1 || excludeFromContrastRatioDemands(cell.getCode()))) {\n return undefined;\n }\n\n if (!bgOverride && !fgOverride) {\n // Try get from cache\n const adjustedColor = this._colors.contrastCache.getColor(cell.bg, cell.fg);\n if (adjustedColor !== undefined) {\n return adjustedColor || undefined;\n }\n }\n\n let fgColor = cell.getFgColor();\n let fgColorMode = cell.getFgColorMode();\n let bgColor = cell.getBgColor();\n let bgColorMode = cell.getBgColorMode();\n const isInverse = !!cell.isInverse();\n const isBold = !!cell.isInverse();\n if (isInverse) {\n const temp = fgColor;\n fgColor = bgColor;\n bgColor = temp;\n const temp2 = fgColorMode;\n fgColorMode = bgColorMode;\n bgColorMode = temp2;\n }\n\n const bgRgba = this._resolveBackgroundRgba(bgOverride !== undefined ? Attributes.CM_RGB : bgColorMode, bgOverride ?? bgColor, isInverse);\n const fgRgba = this._resolveForegroundRgba(fgColorMode, fgColor, isInverse, isBold);\n let result = rgba.ensureContrastRatio(bgOverride ?? bgRgba, fgOverride ?? fgRgba, this._optionsService.rawOptions.minimumContrastRatio);\n\n if (!result) {\n if (!fgOverride) {\n this._colors.contrastCache.setColor(cell.bg, cell.fg, null);\n return undefined;\n }\n // If it was an override and there was no contrast change, set as the result\n result = fgOverride;\n }\n\n const color: IColor = {\n css: channels.toCss(\n (result >> 24) & 0xFF,\n (result >> 16) & 0xFF,\n (result >> 8) & 0xFF\n ),\n rgba: result\n };\n if (!bgOverride && !fgOverride) {\n this._colors.contrastCache.setColor(cell.bg, cell.fg, color);\n }\n\n return color;\n }\n\n private _resolveBackgroundRgba(bgColorMode: number, bgColor: number, inverse: boolean): number {\n switch (bgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n return this._colors.ansi[bgColor].rgba;\n case Attributes.CM_RGB:\n return bgColor << 8;\n case Attributes.CM_DEFAULT:\n default:\n if (inverse) {\n return this._colors.foreground.rgba;\n }\n return this._colors.background.rgba;\n }\n }\n\n private _resolveForegroundRgba(fgColorMode: number, fgColor: number, inverse: boolean, bold: boolean): number {\n switch (fgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && bold && fgColor < 8) {\n fgColor += 8;\n }\n return this._colors.ansi[fgColor].rgba;\n case Attributes.CM_RGB:\n return fgColor << 8;\n case Attributes.CM_DEFAULT:\n default:\n if (inverse) {\n return this._colors.background.rgba;\n }\n return this._colors.foreground.rgba;\n }\n }\n\n private _isCellInSelection(x: number, y: number): boolean {\n const start = this._selectionStart;\n const end = this._selectionEnd;\n if (!start || !end) {\n return false;\n }\n if (this._columnSelectMode) {\n return x >= start[0] && y >= start[1] &&\n x < end[0] && y < end[1];\n }\n return (y > start[1] && y < end[1]) ||\n (start[1] === end[1] && y === start[1] && x >= start[0] && x < end[0]) ||\n (start[1] < end[1] && y === end[1] && x < end[0]) ||\n (start[1] < end[1] && y === start[1] && x >= start[0]);\n }\n}\n\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions, IRequestRedrawEvent } from 'browser/renderer/Types';\nimport { BaseRenderLayer } from 'browser/renderer/BaseRenderLayer';\nimport { ICellData } from 'common/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IColorSet } from 'browser/Types';\nimport { IBufferService, IOptionsService, ICoreService, IDecorationService } from 'common/services/Services';\nimport { IEventEmitter } from 'common/EventEmitter';\nimport { ICoreBrowserService } from 'browser/services/Services';\n\ninterface ICursorState {\n x: number;\n y: number;\n isFocused: boolean;\n style: string;\n width: number;\n}\n\n/**\n * The time between cursor blinks.\n */\nconst BLINK_INTERVAL = 600;\n\nexport class CursorRenderLayer extends BaseRenderLayer {\n private _state: ICursorState;\n private _cursorRenderers: {[key: string]: (x: number, y: number, cell: ICellData) => void};\n private _cursorBlinkStateManager: CursorBlinkStateManager | undefined;\n private _cell: ICellData = new CellData();\n\n constructor(\n container: HTMLElement,\n zIndex: number,\n colors: IColorSet,\n rendererId: number,\n private _onRequestRedraw: IEventEmitter,\n @IBufferService bufferService: IBufferService,\n @IOptionsService optionsService: IOptionsService,\n @ICoreService private readonly _coreService: ICoreService,\n @ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,\n @IDecorationService decorationService: IDecorationService\n ) {\n super(container, 'cursor', zIndex, true, colors, rendererId, bufferService, optionsService, decorationService);\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n this._cursorRenderers = {\n 'bar': this._renderBarCursor.bind(this),\n 'block': this._renderBlockCursor.bind(this),\n 'underline': this._renderUnderlineCursor.bind(this)\n };\n }\n\n public dispose(): void {\n if (this._cursorBlinkStateManager) {\n this._cursorBlinkStateManager.dispose();\n this._cursorBlinkStateManager = undefined;\n }\n super.dispose();\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n }\n\n public reset(): void {\n this._clearCursor();\n this._cursorBlinkStateManager?.restartBlinkAnimation();\n this.onOptionsChanged();\n }\n\n public onBlur(): void {\n this._cursorBlinkStateManager?.pause();\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n public onFocus(): void {\n this._cursorBlinkStateManager?.resume();\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n public onOptionsChanged(): void {\n if (this._optionsService.rawOptions.cursorBlink) {\n if (!this._cursorBlinkStateManager) {\n this._cursorBlinkStateManager = new CursorBlinkStateManager(this._coreBrowserService.isFocused, () => {\n this._render(true);\n });\n }\n } else {\n this._cursorBlinkStateManager?.dispose();\n this._cursorBlinkStateManager = undefined;\n }\n // Request a refresh from the terminal as management of rendering is being\n // moved back to the terminal\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n public onCursorMove(): void {\n this._cursorBlinkStateManager?.restartBlinkAnimation();\n }\n\n public onGridChanged(startRow: number, endRow: number): void {\n if (!this._cursorBlinkStateManager || this._cursorBlinkStateManager.isPaused) {\n this._render(false);\n } else {\n this._cursorBlinkStateManager.restartBlinkAnimation();\n }\n }\n\n private _render(triggeredByAnimationFrame: boolean): void {\n // Don't draw the cursor if it's hidden\n if (!this._coreService.isCursorInitialized || this._coreService.isCursorHidden) {\n this._clearCursor();\n return;\n }\n\n const cursorY = this._bufferService.buffer.ybase + this._bufferService.buffer.y;\n const viewportRelativeCursorY = cursorY - this._bufferService.buffer.ydisp;\n\n // Don't draw the cursor if it's off-screen\n if (viewportRelativeCursorY < 0 || viewportRelativeCursorY >= this._bufferService.rows) {\n this._clearCursor();\n return;\n }\n\n // in case cursor.x == cols adjust visual cursor to cols - 1\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n this._bufferService.buffer.lines.get(cursorY)!.loadCell(cursorX, this._cell);\n if (this._cell.content === undefined) {\n return;\n }\n\n if (!this._coreBrowserService.isFocused) {\n this._clearCursor();\n this._ctx.save();\n this._ctx.fillStyle = this._colors.cursor.css;\n const cursorStyle = this._optionsService.rawOptions.cursorStyle;\n if (cursorStyle && cursorStyle !== 'block') {\n this._cursorRenderers[cursorStyle](cursorX, viewportRelativeCursorY, this._cell);\n } else {\n this._renderBlurCursor(cursorX, viewportRelativeCursorY, this._cell);\n }\n this._ctx.restore();\n this._state.x = cursorX;\n this._state.y = viewportRelativeCursorY;\n this._state.isFocused = false;\n this._state.style = cursorStyle;\n this._state.width = this._cell.getWidth();\n return;\n }\n\n // Don't draw the cursor if it's blinking\n if (this._cursorBlinkStateManager && !this._cursorBlinkStateManager.isCursorVisible) {\n this._clearCursor();\n return;\n }\n\n if (this._state) {\n // The cursor is already in the correct spot, don't redraw\n if (this._state.x === cursorX &&\n this._state.y === viewportRelativeCursorY &&\n this._state.isFocused === this._coreBrowserService.isFocused &&\n this._state.style === this._optionsService.rawOptions.cursorStyle &&\n this._state.width === this._cell.getWidth()) {\n return;\n }\n this._clearCursor();\n }\n\n this._ctx.save();\n this._cursorRenderers[this._optionsService.rawOptions.cursorStyle || 'block'](cursorX, viewportRelativeCursorY, this._cell);\n this._ctx.restore();\n\n this._state.x = cursorX;\n this._state.y = viewportRelativeCursorY;\n this._state.isFocused = false;\n this._state.style = this._optionsService.rawOptions.cursorStyle;\n this._state.width = this._cell.getWidth();\n }\n\n private _clearCursor(): void {\n if (this._state) {\n // Avoid potential rounding errors when device pixel ratio is less than 1\n if (window.devicePixelRatio < 1) {\n this._clearAll();\n } else {\n this._clearCells(this._state.x, this._state.y, this._state.width, 1);\n }\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n }\n }\n\n private _renderBarCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._colors.cursor.css;\n this._fillLeftLineAtCell(x, y, this._optionsService.rawOptions.cursorWidth);\n this._ctx.restore();\n }\n\n private _renderBlockCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._colors.cursor.css;\n this._fillCells(x, y, cell.getWidth(), 1);\n this._ctx.fillStyle = this._colors.cursorAccent.css;\n this._fillCharTrueColor(cell, x, y);\n this._ctx.restore();\n }\n\n private _renderUnderlineCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._colors.cursor.css;\n this._fillBottomLineAtCells(x, y);\n this._ctx.restore();\n }\n\n private _renderBlurCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.strokeStyle = this._colors.cursor.css;\n this._strokeRectAtCell(x, y, cell.getWidth(), 1);\n this._ctx.restore();\n }\n}\n\nclass CursorBlinkStateManager {\n public isCursorVisible: boolean;\n\n private _animationFrame: number | undefined;\n private _blinkStartTimeout: number | undefined;\n private _blinkInterval: number | undefined;\n\n /**\n * The time at which the animation frame was restarted, this is used on the\n * next render to restart the timers so they don't need to restart the timers\n * multiple times over a short period.\n */\n private _animationTimeRestarted: number | undefined;\n\n constructor(\n isFocused: boolean,\n private _renderCallback: () => void\n ) {\n this.isCursorVisible = true;\n if (isFocused) {\n this._restartInterval();\n }\n }\n\n public get isPaused(): boolean { return !(this._blinkStartTimeout || this._blinkInterval); }\n\n public dispose(): void {\n if (this._blinkInterval) {\n window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n if (this._blinkStartTimeout) {\n window.clearTimeout(this._blinkStartTimeout);\n this._blinkStartTimeout = undefined;\n }\n if (this._animationFrame) {\n window.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public restartBlinkAnimation(): void {\n if (this.isPaused) {\n return;\n }\n // Save a timestamp so that the restart can be done on the next interval\n this._animationTimeRestarted = Date.now();\n // Force a cursor render to ensure it's visible and in the correct position\n this.isCursorVisible = true;\n if (!this._animationFrame) {\n this._animationFrame = window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n }\n }\n\n private _restartInterval(timeToStart: number = BLINK_INTERVAL): void {\n // Clear any existing interval\n if (this._blinkInterval) {\n window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n\n // Setup the initial timeout which will hide the cursor, this is done before\n // the regular interval is setup in order to support restarting the blink\n // animation in a lightweight way (without thrashing clearInterval and\n // setInterval).\n this._blinkStartTimeout = window.setTimeout(() => {\n // Check if another animation restart was requested while this was being\n // started\n if (this._animationTimeRestarted) {\n const time = BLINK_INTERVAL - (Date.now() - this._animationTimeRestarted);\n this._animationTimeRestarted = undefined;\n if (time > 0) {\n this._restartInterval(time);\n return;\n }\n }\n\n // Hide the cursor\n this.isCursorVisible = false;\n this._animationFrame = window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n\n // Setup the blink interval\n this._blinkInterval = window.setInterval(() => {\n // Adjust the animation time if it was restarted\n if (this._animationTimeRestarted) {\n // calc time diff\n // Make restart interval do a setTimeout initially?\n const time = BLINK_INTERVAL - (Date.now() - this._animationTimeRestarted);\n this._animationTimeRestarted = undefined;\n this._restartInterval(time);\n return;\n }\n\n // Invert visibility and render\n this.isCursorVisible = !this.isCursorVisible;\n this._animationFrame = window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n }, BLINK_INTERVAL);\n }, timeToStart);\n }\n\n public pause(): void {\n this.isCursorVisible = true;\n if (this._blinkInterval) {\n window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n if (this._blinkStartTimeout) {\n window.clearTimeout(this._blinkStartTimeout);\n this._blinkStartTimeout = undefined;\n }\n if (this._animationFrame) {\n window.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public resume(): void {\n // Clear out any existing timers just in case\n this.pause();\n\n this._animationTimeRestarted = undefined;\n this._restartInterval();\n this.restartBlinkAnimation();\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { throwIfFalsy } from 'browser/renderer/RendererUtils';\n\ninterface IBlockVector {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\nexport const blockElementDefinitions: { [index: string]: IBlockVector[] | undefined } = {\n // Block elements (0x2580-0x2590)\n '▀': [{ x: 0, y: 0, w: 8, h: 4 }], // UPPER HALF BLOCK\n '▁': [{ x: 0, y: 7, w: 8, h: 1 }], // LOWER ONE EIGHTH BLOCK\n '▂': [{ x: 0, y: 6, w: 8, h: 2 }], // LOWER ONE QUARTER BLOCK\n '▃': [{ x: 0, y: 5, w: 8, h: 3 }], // LOWER THREE EIGHTHS BLOCK\n '▄': [{ x: 0, y: 4, w: 8, h: 4 }], // LOWER HALF BLOCK\n '▅': [{ x: 0, y: 3, w: 8, h: 5 }], // LOWER FIVE EIGHTHS BLOCK\n '▆': [{ x: 0, y: 2, w: 8, h: 6 }], // LOWER THREE QUARTERS BLOCK\n '▇': [{ x: 0, y: 1, w: 8, h: 7 }], // LOWER SEVEN EIGHTHS BLOCK\n '█': [{ x: 0, y: 0, w: 8, h: 8 }], // FULL BLOCK\n '▉': [{ x: 0, y: 0, w: 7, h: 8 }], // LEFT SEVEN EIGHTHS BLOCK\n '▊': [{ x: 0, y: 0, w: 6, h: 8 }], // LEFT THREE QUARTERS BLOCK\n '▋': [{ x: 0, y: 0, w: 5, h: 8 }], // LEFT FIVE EIGHTHS BLOCK\n '▌': [{ x: 0, y: 0, w: 4, h: 8 }], // LEFT HALF BLOCK\n '▍': [{ x: 0, y: 0, w: 3, h: 8 }], // LEFT THREE EIGHTHS BLOCK\n '▎': [{ x: 0, y: 0, w: 2, h: 8 }], // LEFT ONE QUARTER BLOCK\n '▏': [{ x: 0, y: 0, w: 1, h: 8 }], // LEFT ONE EIGHTH BLOCK\n '▐': [{ x: 4, y: 0, w: 4, h: 8 }], // RIGHT HALF BLOCK\n\n // Block elements (0x2594-0x2595)\n '▔': [{ x: 0, y: 0, w: 9, h: 1 }], // UPPER ONE EIGHTH BLOCK\n '▕': [{ x: 7, y: 0, w: 1, h: 8 }], // RIGHT ONE EIGHTH BLOCK\n\n // Terminal graphic characters (0x2596-0x259F)\n '▖': [{ x: 0, y: 4, w: 4, h: 4 }], // QUADRANT LOWER LEFT\n '▗': [{ x: 4, y: 4, w: 4, h: 4 }], // QUADRANT LOWER RIGHT\n '▘': [{ x: 0, y: 0, w: 4, h: 4 }], // QUADRANT UPPER LEFT\n '▙': [{ x: 0, y: 0, w: 4, h: 8 }, { x: 0, y: 4, w: 8, h: 4 }], // QUADRANT UPPER LEFT AND LOWER LEFT AND LOWER RIGHT\n '▚': [{ x: 0, y: 0, w: 4, h: 4 }, { x: 4, y: 4, w: 4, h: 4 }], // QUADRANT UPPER LEFT AND LOWER RIGHT\n '▛': [{ x: 0, y: 0, w: 4, h: 8 }, { x: 0, y: 0, w: 4, h: 8 }], // QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER LEFT\n '▜': [{ x: 0, y: 0, w: 8, h: 4 }, { x: 4, y: 0, w: 4, h: 8 }], // QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER RIGHT\n '▝': [{ x: 4, y: 0, w: 4, h: 4 }], // QUADRANT UPPER RIGHT\n '▞': [{ x: 4, y: 0, w: 4, h: 4 }, { x: 0, y: 4, w: 4, h: 4 }], // QUADRANT UPPER RIGHT AND LOWER LEFT\n '▟': [{ x: 4, y: 0, w: 4, h: 8 }, { x: 0, y: 4, w: 8, h: 4 }], // QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT\n\n // VERTICAL ONE EIGHTH BLOCK-2 through VERTICAL ONE EIGHTH BLOCK-7\n '\\u{1FB70}': [{ x: 1, y: 0, w: 1, h: 8 }],\n '\\u{1FB71}': [{ x: 2, y: 0, w: 1, h: 8 }],\n '\\u{1FB72}': [{ x: 3, y: 0, w: 1, h: 8 }],\n '\\u{1FB73}': [{ x: 4, y: 0, w: 1, h: 8 }],\n '\\u{1FB74}': [{ x: 5, y: 0, w: 1, h: 8 }],\n '\\u{1FB75}': [{ x: 6, y: 0, w: 1, h: 8 }],\n\n // HORIZONTAL ONE EIGHTH BLOCK-2 through HORIZONTAL ONE EIGHTH BLOCK-7\n '\\u{1FB76}': [{ x: 0, y: 1, w: 8, h: 1 }],\n '\\u{1FB77}': [{ x: 0, y: 2, w: 8, h: 1 }],\n '\\u{1FB78}': [{ x: 0, y: 3, w: 8, h: 1 }],\n '\\u{1FB79}': [{ x: 0, y: 4, w: 8, h: 1 }],\n '\\u{1FB7A}': [{ x: 0, y: 5, w: 8, h: 1 }],\n '\\u{1FB7B}': [{ x: 0, y: 6, w: 8, h: 1 }],\n\n // LEFT AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB7C}': [{ x: 0, y: 0, w: 1, h: 8 }, { x: 0, y: 7, w: 8, h: 1 }],\n // LEFT AND UPPER ONE EIGHTH BLOCK\n '\\u{1FB7D}': [{ x: 0, y: 0, w: 1, h: 8 }, { x: 0, y: 0, w: 8, h: 1 }],\n // RIGHT AND UPPER ONE EIGHTH BLOCK\n '\\u{1FB7E}': [{ x: 7, y: 0, w: 1, h: 8 }, { x: 0, y: 0, w: 8, h: 1 }],\n // RIGHT AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB7F}': [{ x: 7, y: 0, w: 1, h: 8 }, { x: 0, y: 7, w: 8, h: 1 }],\n // UPPER AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB80}': [{ x: 0, y: 0, w: 8, h: 1 }, { x: 0, y: 7, w: 8, h: 1 }],\n // HORIZONTAL ONE EIGHTH BLOCK-1358\n '\\u{1FB81}': [{ x: 0, y: 0, w: 8, h: 1 }, { x: 0, y: 2, w: 8, h: 1 }, { x: 0, y: 4, w: 8, h: 1 }, { x: 0, y: 7, w: 8, h: 1 }],\n\n // UPPER ONE QUARTER BLOCK\n '\\u{1FB82}': [{ x: 0, y: 0, w: 8, h: 2 }],\n // UPPER THREE EIGHTHS BLOCK\n '\\u{1FB83}': [{ x: 0, y: 0, w: 8, h: 3 }],\n // UPPER FIVE EIGHTHS BLOCK\n '\\u{1FB84}': [{ x: 0, y: 0, w: 8, h: 5 }],\n // UPPER THREE QUARTERS BLOCK\n '\\u{1FB85}': [{ x: 0, y: 0, w: 8, h: 6 }],\n // UPPER SEVEN EIGHTHS BLOCK\n '\\u{1FB86}': [{ x: 0, y: 0, w: 8, h: 7 }],\n\n // RIGHT ONE QUARTER BLOCK\n '\\u{1FB87}': [{ x: 6, y: 0, w: 2, h: 8 }],\n // RIGHT THREE EIGHTHS B0OCK\n '\\u{1FB88}': [{ x: 5, y: 0, w: 3, h: 8 }],\n // RIGHT FIVE EIGHTHS BL0CK\n '\\u{1FB89}': [{ x: 3, y: 0, w: 5, h: 8 }],\n // RIGHT THREE QUARTERS 0LOCK\n '\\u{1FB8A}': [{ x: 2, y: 0, w: 6, h: 8 }],\n // RIGHT SEVEN EIGHTHS B0OCK\n '\\u{1FB8B}': [{ x: 1, y: 0, w: 7, h: 8 }],\n\n // CHECKER BOARD FILL\n '\\u{1FB95}': [\n { x: 0, y: 0, w: 2, h: 2 }, { x: 4, y: 0, w: 2, h: 2 },\n { x: 2, y: 2, w: 2, h: 2 }, { x: 6, y: 2, w: 2, h: 2 },\n { x: 0, y: 4, w: 2, h: 2 }, { x: 4, y: 4, w: 2, h: 2 },\n { x: 2, y: 6, w: 2, h: 2 }, { x: 6, y: 6, w: 2, h: 2 }\n ],\n // INVERSE CHECKER BOARD FILL\n '\\u{1FB96}': [\n { x: 2, y: 0, w: 2, h: 2 }, { x: 6, y: 0, w: 2, h: 2 },\n { x: 0, y: 2, w: 2, h: 2 }, { x: 4, y: 2, w: 2, h: 2 },\n { x: 2, y: 4, w: 2, h: 2 }, { x: 6, y: 4, w: 2, h: 2 },\n { x: 0, y: 6, w: 2, h: 2 }, { x: 4, y: 6, w: 2, h: 2 }\n ],\n // HEAVY HORIZONTAL FILL (upper middle and lower one quarter block)\n '\\u{1FB97}': [{ x: 0, y: 2, w: 8, h: 2 }, { x: 0, y: 6, w: 8, h: 2 }]\n};\n\ntype PatternDefinition = number[][];\n\n/**\n * Defines the repeating pattern used by special characters, the pattern is made up of a 2d array of\n * pixel values to be filled (1) or not filled (0).\n */\nconst patternCharacterDefinitions: { [key: string]: PatternDefinition | undefined } = {\n // Shade characters (0x2591-0x2593)\n '░': [ // LIGHT SHADE (25%)\n [1, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 0]\n ],\n '▒': [ // MEDIUM SHADE (50%)\n [1, 0],\n [0, 0],\n [0, 1],\n [0, 0]\n ],\n '▓': [ // DARK SHADE (75%)\n [0, 1],\n [1, 1],\n [1, 0],\n [1, 1]\n ]\n};\n\nconst enum Shapes {\n /** │ */ TOP_TO_BOTTOM = 'M.5,0 L.5,1',\n /** ─ */ LEFT_TO_RIGHT = 'M0,.5 L1,.5',\n\n /** └ */ TOP_TO_RIGHT = 'M.5,0 L.5,.5 L1,.5',\n /** ┘ */ TOP_TO_LEFT = 'M.5,0 L.5,.5 L0,.5',\n /** ┐ */ LEFT_TO_BOTTOM = 'M0,.5 L.5,.5 L.5,1',\n /** ┌ */ RIGHT_TO_BOTTOM = 'M0.5,1 L.5,.5 L1,.5',\n\n /** ╵ */ MIDDLE_TO_TOP = 'M.5,.5 L.5,0',\n /** ╴ */ MIDDLE_TO_LEFT = 'M.5,.5 L0,.5',\n /** ╶ */ MIDDLE_TO_RIGHT = 'M.5,.5 L1,.5',\n /** ╷ */ MIDDLE_TO_BOTTOM = 'M.5,.5 L.5,1',\n\n /** ┴ */ T_TOP = 'M0,.5 L1,.5 M.5,.5 L.5,0',\n /** ┤ */ T_LEFT = 'M.5,0 L.5,1 M.5,.5 L0,.5',\n /** ├ */ T_RIGHT = 'M.5,0 L.5,1 M.5,.5 L1,.5',\n /** ┬ */ T_BOTTOM = 'M0,.5 L1,.5 M.5,.5 L.5,1',\n\n /** ┼ */ CROSS = 'M0,.5 L1,.5 M.5,0 L.5,1',\n\n /** ╌ */ TWO_DASHES_HORIZONTAL = 'M.1,.5 L.4,.5 M.6,.5 L.9,.5', // .2 empty, .3 filled\n /** ┄ */ THREE_DASHES_HORIZONTAL = 'M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5', // .1333 empty, .2 filled\n /** ┉ */ FOUR_DASHES_HORIZONTAL = 'M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5', // .1 empty, .15 filled\n /** ╎ */ TWO_DASHES_VERTICAL = 'M.5,.1 L.5,.4 M.5,.6 L.5,.9',\n /** ┆ */ THREE_DASHES_VERTICAL = 'M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333',\n /** ┊ */ FOUR_DASHES_VERTICAL = 'M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95',\n}\n\nconst enum Style {\n NORMAL = 1,\n BOLD = 3\n}\n\n/**\n * This contains the definitions of all box drawing characters in the format of SVG paths (ie. the\n * svg d attribute).\n */\nexport const boxDrawingDefinitions: { [character: string]: { [fontWeight: number]: string | ((xp: number, yp: number) => string) } | undefined } = {\n // Uniform normal and bold\n '─': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT },\n '━': { [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '│': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM },\n '┃': { [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┌': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM },\n '┏': { [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┐': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM },\n '┓': { [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '└': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT },\n '┗': { [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┘': { [Style.NORMAL]: Shapes.TOP_TO_LEFT },\n '┛': { [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '├': { [Style.NORMAL]: Shapes.T_RIGHT },\n '┣': { [Style.BOLD]: Shapes.T_RIGHT },\n '┤': { [Style.NORMAL]: Shapes.T_LEFT },\n '┫': { [Style.BOLD]: Shapes.T_LEFT },\n '┬': { [Style.NORMAL]: Shapes.T_BOTTOM },\n '┳': { [Style.BOLD]: Shapes.T_BOTTOM },\n '┴': { [Style.NORMAL]: Shapes.T_TOP },\n '┻': { [Style.BOLD]: Shapes.T_TOP },\n '┼': { [Style.NORMAL]: Shapes.CROSS },\n '╋': { [Style.BOLD]: Shapes.CROSS },\n '╴': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT },\n '╸': { [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '╵': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP },\n '╹': { [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '╶': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT },\n '╺': { [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '╷': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM },\n '╻': { [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n\n // Double border\n '═': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '║': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╒': { [Style.NORMAL]: (xp, yp) => `M.5,1 L.5,${.5 - yp} L1,${.5 - yp} M.5,${.5 + yp} L1,${.5 + yp}` },\n '╓': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},1 L${.5 - xp},.5 L1,.5 M${.5 + xp},.5 L${.5 + xp},1` },\n '╔': { [Style.NORMAL]: (xp, yp) => `M1,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1` },\n '╕': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L.5,${.5 - yp} L.5,1 M0,${.5 + yp} L.5,${.5 + yp}` },\n '╖': { [Style.NORMAL]: (xp, yp) => `M${.5 + xp},1 L${.5 + xp},.5 L0,.5 M${.5 - xp},.5 L${.5 - xp},1` },\n '╗': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M0,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},1` },\n '╘': { [Style.NORMAL]: (xp, yp) => `M.5,0 L.5,${.5 + yp} L1,${.5 + yp} M.5,${.5 - yp} L1,${.5 - yp}` },\n '╙': { [Style.NORMAL]: (xp, yp) => `M1,.5 L${.5 - xp},.5 L${.5 - xp},0 M${.5 + xp},.5 L${.5 + xp},0` },\n '╚': { [Style.NORMAL]: (xp, yp) => `M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0 M1,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},0` },\n '╛': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L.5,${.5 + yp} L.5,0 M0,${.5 - yp} L.5,${.5 - yp}` },\n '╜': { [Style.NORMAL]: (xp, yp) => `M0,.5 L${.5 + xp},.5 L${.5 + xp},0 M${.5 - xp},.5 L${.5 - xp},0` },\n '╝': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M0,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},0` },\n '╞': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M.5,${.5 - yp} L1,${.5 - yp} M.5,${.5 + yp} L1,${.5 + yp}` },\n '╟': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1 M${.5 + xp},.5 L1,.5` },\n '╠': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n '╡': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M0,${.5 - yp} L.5,${.5 - yp} M0,${.5 + yp} L.5,${.5 + yp}` },\n '╢': { [Style.NORMAL]: (xp, yp) => `M0,.5 L${.5 - xp},.5 M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╣': { [Style.NORMAL]: (xp, yp) => `M${.5 + xp},0 L${.5 + xp},1 M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0` },\n '╤': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp} M.5,${.5 + yp} L.5,1` },\n '╥': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},.5 L${.5 - xp},1 M${.5 + xp},.5 L${.5 + xp},1` },\n '╦': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1` },\n '╧': { [Style.NORMAL]: (xp, yp) => `M.5,0 L.5,${.5 - yp} M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '╨': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},.5 L${.5 - xp},0 M${.5 + xp},.5 L${.5 + xp},0` },\n '╩': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L1,${.5 + yp} M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n '╪': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '╫': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╬': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1 M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n\n // Diagonal\n '╱': { [Style.NORMAL]: 'M1,0 L0,1' },\n '╲': { [Style.NORMAL]: 'M0,0 L1,1' },\n '╳': { [Style.NORMAL]: 'M1,0 L0,1 M0,0 L1,1' },\n\n // Mixed weight\n '╼': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '╽': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '╾': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '╿': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┍': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┎': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┑': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┒': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┕': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┖': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┙': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┚': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┝': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┞': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┟': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┠': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┡': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┢': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┥': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┦': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┧': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┨': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┩': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '┪': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '┭': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┮': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┯': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '┰': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┱': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '┲': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┵': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┶': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┷': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '┸': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┹': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '┺': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┽': { [Style.NORMAL]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_RIGHT}`, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┾': { [Style.NORMAL]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_LEFT}`, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┿': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '╀': { [Style.NORMAL]: `${Shapes.LEFT_TO_RIGHT} ${Shapes.MIDDLE_TO_BOTTOM}`, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '╁': { [Style.NORMAL]: `${Shapes.MIDDLE_TO_TOP} ${Shapes.LEFT_TO_RIGHT}`, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '╂': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '╃': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '╄': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '╅': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '╆': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '╇': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: `${Shapes.MIDDLE_TO_TOP} ${Shapes.LEFT_TO_RIGHT}` },\n '╈': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: `${Shapes.LEFT_TO_RIGHT} ${Shapes.MIDDLE_TO_BOTTOM}` },\n '╉': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_LEFT}` },\n '╊': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_RIGHT}` },\n\n // Dashed\n '╌': { [Style.NORMAL]: Shapes.TWO_DASHES_HORIZONTAL },\n '╍': { [Style.BOLD]: Shapes.TWO_DASHES_HORIZONTAL },\n '┄': { [Style.NORMAL]: Shapes.THREE_DASHES_HORIZONTAL },\n '┅': { [Style.BOLD]: Shapes.THREE_DASHES_HORIZONTAL },\n '┈': { [Style.NORMAL]: Shapes.FOUR_DASHES_HORIZONTAL },\n '┉': { [Style.BOLD]: Shapes.FOUR_DASHES_HORIZONTAL },\n '╎': { [Style.NORMAL]: Shapes.TWO_DASHES_VERTICAL },\n '╏': { [Style.BOLD]: Shapes.TWO_DASHES_VERTICAL },\n '┆': { [Style.NORMAL]: Shapes.THREE_DASHES_VERTICAL },\n '┇': { [Style.BOLD]: Shapes.THREE_DASHES_VERTICAL },\n '┊': { [Style.NORMAL]: Shapes.FOUR_DASHES_VERTICAL },\n '┋': { [Style.BOLD]: Shapes.FOUR_DASHES_VERTICAL },\n\n // Curved\n '╭': { [Style.NORMAL]: 'C.5,1,.5,.5,1,.5' },\n '╮': { [Style.NORMAL]: 'C.5,1,.5,.5,0,.5' },\n '╯': { [Style.NORMAL]: 'C.5,0,.5,.5,0,.5' },\n '╰': { [Style.NORMAL]: 'C.5,0,.5,.5,1,.5' }\n};\n\ninterface IVectorShape {\n d: string;\n type: VectorType;\n /** Padding to apply to the vector's x axis in CSS pixels. */\n horizontalPadding?: number;\n}\n\nconst enum VectorType {\n FILL,\n STROKE\n}\n\n/**\n * This contains the definitions of the primarily used box drawing characters as vector shapes. The\n * reason these characters are defined specially is to avoid common problems if a user's font has\n * not been patched with powerline characters and also to get pixel perfect rendering as rendering\n * issues can occur around AA/SPAA.\n *\n * Original symbols defined in https://github.com/powerline/fontpatcher\n */\nexport const powerlineDefinitions: { [index: string]: IVectorShape } = {\n // Right triangle solid\n '\\u{E0B0}': { d: 'M0,0 L1,.5 L0,1', type: VectorType.FILL },\n // Right triangle line\n '\\u{E0B1}': { d: 'M0,0 L1,.5 L0,1', type: VectorType.STROKE, horizontalPadding: 0.5 },\n // Left triangle solid\n '\\u{E0B2}': { d: 'M1,0 L0,.5 L1,1', type: VectorType.FILL },\n // Left triangle line\n '\\u{E0B3}': { d: 'M1,0 L0,.5 L1,1', type: VectorType.STROKE, horizontalPadding: 0.5 }\n};\n\n/**\n * Try drawing a custom block element or box drawing character, returning whether it was\n * successfully drawn.\n */\nexport function tryDrawCustomChar(\n ctx: CanvasRenderingContext2D,\n c: string,\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): boolean {\n const blockElementDefinition = blockElementDefinitions[c];\n if (blockElementDefinition) {\n drawBlockElementChar(ctx, blockElementDefinition, xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n return true;\n }\n\n const patternDefinition = patternCharacterDefinitions[c];\n if (patternDefinition) {\n drawPatternChar(ctx, patternDefinition, xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n return true;\n }\n\n const boxDrawingDefinition = boxDrawingDefinitions[c];\n if (boxDrawingDefinition) {\n drawBoxDrawingChar(ctx, boxDrawingDefinition, xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n return true;\n }\n\n const powerlineDefinition = powerlineDefinitions[c];\n if (powerlineDefinition) {\n drawPowerlineChar(ctx, powerlineDefinition, xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n return true;\n }\n\n return false;\n}\n\nfunction drawBlockElementChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: IBlockVector[],\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): void {\n for (let i = 0; i < charDefinition.length; i++) {\n const box = charDefinition[i];\n const xEighth = scaledCellWidth / 8;\n const yEighth = scaledCellHeight / 8;\n ctx.fillRect(\n xOffset + box.x * xEighth,\n yOffset + box.y * yEighth,\n box.w * xEighth,\n box.h * yEighth\n );\n }\n}\n\nconst cachedPatterns: Map> = new Map();\n\nfunction drawPatternChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: number[][],\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): void {\n let patternSet = cachedPatterns.get(charDefinition);\n if (!patternSet) {\n patternSet = new Map();\n cachedPatterns.set(charDefinition, patternSet);\n }\n const fillStyle = ctx.fillStyle;\n if (typeof fillStyle !== 'string') {\n throw new Error(`Unexpected fillStyle type \"${fillStyle}\"`);\n }\n let pattern = patternSet.get(fillStyle);\n if (!pattern) {\n const width = charDefinition[0].length;\n const height = charDefinition.length;\n const tmpCanvas = document.createElement('canvas');\n tmpCanvas.width = width;\n tmpCanvas.height = height;\n const tmpCtx = throwIfFalsy(tmpCanvas.getContext('2d'));\n const imageData = new ImageData(width, height);\n\n // Extract rgba from fillStyle\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n if (fillStyle.startsWith('#')) {\n r = parseInt(fillStyle.slice(1, 3), 16);\n g = parseInt(fillStyle.slice(3, 5), 16);\n b = parseInt(fillStyle.slice(5, 7), 16);\n a = fillStyle.length > 7 && parseInt(fillStyle.slice(7, 9), 16) || 1;\n } else if (fillStyle.startsWith('rgba')) {\n ([r, g, b, a] = fillStyle.substring(5, fillStyle.length - 1).split(',').map(e => parseFloat(e)));\n } else {\n throw new Error(`Unexpected fillStyle color format \"${fillStyle}\" when drawing pattern glyph`);\n }\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n imageData.data[(y * width + x) * 4 ] = r;\n imageData.data[(y * width + x) * 4 + 1] = g;\n imageData.data[(y * width + x) * 4 + 2] = b;\n imageData.data[(y * width + x) * 4 + 3] = charDefinition[y][x] * (a * 255);\n }\n }\n tmpCtx.putImageData(imageData, 0, 0);\n pattern = throwIfFalsy(ctx.createPattern(tmpCanvas, null));\n patternSet.set(fillStyle, pattern);\n }\n ctx.fillStyle = pattern;\n ctx.fillRect(xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n}\n\n/**\n * Draws the following box drawing characters by mapping a subset of SVG d attribute instructions to\n * canvas draw calls.\n *\n * Box styles: ┎┰┒┍┯┑╓╥╖╒╤╕ ┏┳┓┌┲┓┌┬┐┏┱┐\n * ┌─┬─┐ ┏━┳━┓ ╔═╦═╗ ┠╂┨┝┿┥╟╫╢╞╪╡ ┡╇┩├╊┫┢╈┪┣╉┤\n * │ │ │ ┃ ┃ ┃ ║ ║ ║ ┖┸┚┕┷┙╙╨╜╘╧╛ └┴┘└┺┛┗┻┛┗┹┘\n * ├─┼─┤ ┣━╋━┫ ╠═╬═╣ ┏┱┐┌┲┓┌┬┐┌┬┐ ┏┳┓┌┮┓┌┬┐┏┭┐\n * │ │ │ ┃ ┃ ┃ ║ ║ ║ ┡╃┤├╄┩├╆┪┢╅┤ ┞╀┦├┾┫┟╁┧┣┽┤\n * └─┴─┘ ┗━┻━┛ ╚═╩═╝ └┴┘└┴┘└┺┛┗┹┘ └┴┘└┶┛┗┻┛┗┵┘\n *\n * Other:\n * ╭─╮ ╲ ╱ ╷╻╎╏┆┇┊┋ ╺╾╴ ╌╌╌ ┄┄┄ ┈┈┈\n * │ │ ╳ ╽╿╎╏┆┇┊┋ ╶╼╸ ╍╍╍ ┅┅┅ ┉┉┉\n * ╰─╯ ╱ ╲ ╹╵╎╏┆┇┊┋\n *\n * All box drawing characters:\n * ─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏\n * ┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟\n * ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯\n * ┰ ┱ ┲ ┳ ┴ ┵ ┶ ┷ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿\n * ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋ ╌ ╍ ╎ ╏\n * ═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟\n * ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯\n * ╰ ╱ ╲ ╳ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿\n *\n * ---\n *\n * Box drawing alignment tests: █\n * ▉\n * ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳\n * ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳\n * ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳\n * ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳\n * ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎\n * ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏\n * ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█\n *\n * Source: https://www.w3.org/2001/06/utf-8-test/UTF-8-demo.html\n */\nfunction drawBoxDrawingChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: { [fontWeight: number]: string | ((xp: number, yp: number) => string) },\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): void {\n ctx.strokeStyle = ctx.fillStyle;\n for (const [fontWeight, instructions] of Object.entries(charDefinition)) {\n ctx.beginPath();\n ctx.lineWidth = window.devicePixelRatio * Number.parseInt(fontWeight);\n let actualInstructions: string;\n if (typeof instructions === 'function') {\n const xp = .15;\n const yp = .15 / scaledCellHeight * scaledCellWidth;\n actualInstructions = instructions(xp, yp);\n } else {\n actualInstructions = instructions;\n }\n for (const instruction of actualInstructions.split(' ')) {\n const type = instruction[0];\n const f = svgToCanvasInstructionMap[type];\n if (!f) {\n console.error(`Could not find drawing instructions for \"${type}\"`);\n continue;\n }\n const args: string[] = instruction.substring(1).split(',');\n if (!args[0] || !args[1]) {\n continue;\n }\n f(ctx, translateArgs(args, scaledCellWidth, scaledCellHeight, xOffset, yOffset));\n }\n ctx.stroke();\n ctx.closePath();\n }\n}\n\nfunction drawPowerlineChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: IVectorShape,\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): void {\n ctx.beginPath();\n ctx.lineWidth = window.devicePixelRatio;\n for (const instruction of charDefinition.d.split(' ')) {\n const type = instruction[0];\n const f = svgToCanvasInstructionMap[type];\n if (!f) {\n console.error(`Could not find drawing instructions for \"${type}\"`);\n continue;\n }\n const args: string[] = instruction.substring(1).split(',');\n if (!args[0] || !args[1]) {\n continue;\n }\n f(ctx, translateArgs(args, scaledCellWidth, scaledCellHeight, xOffset, yOffset, charDefinition.horizontalPadding));\n }\n if (charDefinition.type === VectorType.STROKE) {\n ctx.strokeStyle = ctx.fillStyle;\n ctx.stroke();\n } else {\n ctx.fill();\n }\n ctx.closePath();\n}\n\nfunction clamp(value: number, max: number, min: number = 0): number {\n return Math.max(Math.min(value, max), min);\n}\n\nconst svgToCanvasInstructionMap: { [index: string]: any } = {\n 'C': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.bezierCurveTo(args[0], args[1], args[2], args[3], args[4], args[5]),\n 'L': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.lineTo(args[0], args[1]),\n 'M': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.moveTo(args[0], args[1])\n};\n\nfunction translateArgs(args: string[], cellWidth: number, cellHeight: number, xOffset: number, yOffset: number, horizontalPadding: number = 0): number[] {\n const result = args.map(e => parseFloat(e) || parseInt(e));\n\n if (result.length < 2) {\n throw new Error('Too few arguments for instruction');\n }\n\n for (let x = 0; x < result.length; x += 2) {\n // Translate from 0-1 to 0-cellWidth\n result[x] *= cellWidth - (horizontalPadding * 2 * window.devicePixelRatio);\n // Ensure coordinate doesn't escape cell bounds and round to the nearest 0.5 to ensure a crisp\n // line at 100% devicePixelRatio\n if (result[x] !== 0) {\n result[x] = clamp(Math.round(result[x] + 0.5) - 0.5, cellWidth, 0);\n }\n // Apply the cell's offset (ie. x*cellWidth)\n result[x] += xOffset + (horizontalPadding * window.devicePixelRatio);\n }\n\n for (let y = 1; y < result.length; y += 2) {\n // Translate from 0-1 to 0-cellHeight\n result[y] *= cellHeight;\n // Ensure coordinate doesn't escape cell bounds and round to the nearest 0.5 to ensure a crisp\n // line at 100% devicePixelRatio\n if (result[y] !== 0) {\n result[y] = clamp(Math.round(result[y] + 0.5) - 0.5, cellHeight, 0);\n }\n // Apply the cell's offset (ie. x*cellHeight)\n result[y] += yOffset;\n }\n\n return result;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport class GridCache {\n public cache: (T | undefined)[][];\n\n public constructor() {\n this.cache = [];\n }\n\n public resize(width: number, height: number): void {\n for (let x = 0; x < width; x++) {\n if (this.cache.length <= x) {\n this.cache.push([]);\n }\n for (let y = this.cache[x].length; y < height; y++) {\n this.cache[x].push(undefined);\n }\n this.cache[x].length = height;\n }\n this.cache.length = width;\n }\n\n public clear(): void {\n for (let x = 0; x < this.cache.length; x++) {\n for (let y = 0; y < this.cache[x].length; y++) {\n this.cache[x][y] = undefined;\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/Types';\nimport { BaseRenderLayer } from './BaseRenderLayer';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';\nimport { is256Color } from 'browser/renderer/atlas/CharAtlasUtils';\nimport { IColorSet, ILinkifierEvent, ILinkifier, ILinkifier2 } from 'browser/Types';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\n\nexport class LinkRenderLayer extends BaseRenderLayer {\n private _state: ILinkifierEvent | undefined;\n\n constructor(\n container: HTMLElement,\n zIndex: number,\n colors: IColorSet,\n rendererId: number,\n linkifier: ILinkifier,\n linkifier2: ILinkifier2,\n @IBufferService bufferService: IBufferService,\n @IOptionsService optionsService: IOptionsService,\n @IDecorationService decorationService: IDecorationService\n ) {\n super(container, 'link', zIndex, true, colors, rendererId, bufferService, optionsService, decorationService);\n linkifier.onShowLinkUnderline(e => this._onShowLinkUnderline(e));\n linkifier.onHideLinkUnderline(e => this._onHideLinkUnderline(e));\n\n linkifier2.onShowLinkUnderline(e => this._onShowLinkUnderline(e));\n linkifier2.onHideLinkUnderline(e => this._onHideLinkUnderline(e));\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state = undefined;\n }\n\n public reset(): void {\n this._clearCurrentLink();\n }\n\n private _clearCurrentLink(): void {\n if (this._state) {\n this._clearCells(this._state.x1, this._state.y1, this._state.cols - this._state.x1, 1);\n const middleRowCount = this._state.y2 - this._state.y1 - 1;\n if (middleRowCount > 0) {\n this._clearCells(0, this._state.y1 + 1, this._state.cols, middleRowCount);\n }\n this._clearCells(0, this._state.y2, this._state.x2, 1);\n this._state = undefined;\n }\n }\n\n private _onShowLinkUnderline(e: ILinkifierEvent): void {\n if (e.fg === INVERTED_DEFAULT_COLOR) {\n this._ctx.fillStyle = this._colors.background.css;\n } else if (e.fg && is256Color(e.fg)) {\n // 256 color support\n this._ctx.fillStyle = this._colors.ansi[e.fg].css;\n } else {\n this._ctx.fillStyle = this._colors.foreground.css;\n }\n\n if (e.y1 === e.y2) {\n // Single line link\n this._fillBottomLineAtCells(e.x1, e.y1, e.x2 - e.x1);\n } else {\n // Multi-line link\n this._fillBottomLineAtCells(e.x1, e.y1, e.cols - e.x1);\n for (let y = e.y1 + 1; y < e.y2; y++) {\n this._fillBottomLineAtCells(0, y, e.cols);\n }\n this._fillBottomLineAtCells(0, e.y2, e.x2);\n }\n this._state = e;\n }\n\n private _onHideLinkUnderline(e: ILinkifierEvent): void {\n this._clearCurrentLink();\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { TextRenderLayer } from 'browser/renderer/TextRenderLayer';\nimport { SelectionRenderLayer } from 'browser/renderer/SelectionRenderLayer';\nimport { CursorRenderLayer } from 'browser/renderer/CursorRenderLayer';\nimport { IRenderLayer, IRenderer, IRenderDimensions, IRequestRedrawEvent } from 'browser/renderer/Types';\nimport { LinkRenderLayer } from 'browser/renderer/LinkRenderLayer';\nimport { Disposable } from 'common/Lifecycle';\nimport { IColorSet, ILinkifier, ILinkifier2 } from 'browser/Types';\nimport { ICharSizeService } from 'browser/services/Services';\nimport { IBufferService, IOptionsService, IInstantiationService } from 'common/services/Services';\nimport { removeTerminalFromCache } from 'browser/renderer/atlas/CharAtlasCache';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\n\nlet nextRendererId = 1;\n\nexport class Renderer extends Disposable implements IRenderer {\n private _id = nextRendererId++;\n\n private _renderLayers: IRenderLayer[];\n private _devicePixelRatio: number;\n\n public dimensions: IRenderDimensions;\n\n private _onRequestRedraw = new EventEmitter();\n public get onRequestRedraw(): IEvent { return this._onRequestRedraw.event; }\n\n constructor(\n private _colors: IColorSet,\n private readonly _screenElement: HTMLElement,\n linkifier: ILinkifier,\n linkifier2: ILinkifier2,\n @IInstantiationService instantiationService: IInstantiationService,\n @IBufferService private readonly _bufferService: IBufferService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n const allowTransparency = this._optionsService.rawOptions.allowTransparency;\n this._renderLayers = [\n instantiationService.createInstance(TextRenderLayer, this._screenElement, 0, this._colors, allowTransparency, this._id),\n instantiationService.createInstance(SelectionRenderLayer, this._screenElement, 1, this._colors, this._id),\n instantiationService.createInstance(LinkRenderLayer, this._screenElement, 2, this._colors, this._id, linkifier, linkifier2),\n instantiationService.createInstance(CursorRenderLayer, this._screenElement, 3, this._colors, this._id, this._onRequestRedraw)\n ];\n this.dimensions = {\n scaledCharWidth: 0,\n scaledCharHeight: 0,\n scaledCellWidth: 0,\n scaledCellHeight: 0,\n scaledCharLeft: 0,\n scaledCharTop: 0,\n scaledCanvasWidth: 0,\n scaledCanvasHeight: 0,\n canvasWidth: 0,\n canvasHeight: 0,\n actualCellWidth: 0,\n actualCellHeight: 0\n };\n this._devicePixelRatio = window.devicePixelRatio;\n this._updateDimensions();\n this.onOptionsChanged();\n }\n\n public dispose(): void {\n for (const l of this._renderLayers) {\n l.dispose();\n }\n super.dispose();\n removeTerminalFromCache(this._id);\n }\n\n public onDevicePixelRatioChange(): void {\n // If the device pixel ratio changed, the char atlas needs to be regenerated\n // and the terminal needs to refreshed\n if (this._devicePixelRatio !== window.devicePixelRatio) {\n this._devicePixelRatio = window.devicePixelRatio;\n this.onResize(this._bufferService.cols, this._bufferService.rows);\n }\n }\n\n public setColors(colors: IColorSet): void {\n this._colors = colors;\n // Clear layers and force a full render\n for (const l of this._renderLayers) {\n l.setColors(this._colors);\n l.reset();\n }\n }\n\n public onResize(cols: number, rows: number): void {\n // Update character and canvas dimensions\n this._updateDimensions();\n\n // Resize all render layers\n for (const l of this._renderLayers) {\n l.resize(this.dimensions);\n }\n\n // Resize the screen\n this._screenElement.style.width = `${this.dimensions.canvasWidth}px`;\n this._screenElement.style.height = `${this.dimensions.canvasHeight}px`;\n }\n\n public onCharSizeChanged(): void {\n this.onResize(this._bufferService.cols, this._bufferService.rows);\n }\n\n public onBlur(): void {\n this._runOperation(l => l.onBlur());\n }\n\n public onFocus(): void {\n this._runOperation(l => l.onFocus());\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {\n this._runOperation(l => l.onSelectionChanged(start, end, columnSelectMode));\n // Selection foreground requires a full re-render\n if (this._colors.selectionForeground) {\n this._onRequestRedraw.fire({ start: 0, end: this._bufferService.rows - 1 });\n }\n }\n\n public onCursorMove(): void {\n this._runOperation(l => l.onCursorMove());\n }\n\n public onOptionsChanged(): void {\n this._runOperation(l => l.onOptionsChanged());\n }\n\n public clear(): void {\n this._runOperation(l => l.reset());\n }\n\n private _runOperation(operation: (layer: IRenderLayer) => void): void {\n for (const l of this._renderLayers) {\n operation(l);\n }\n }\n\n /**\n * Performs the refresh loop callback, calling refresh only if a refresh is\n * necessary before queueing up the next one.\n */\n public renderRows(start: number, end: number): void {\n for (const l of this._renderLayers) {\n l.onGridChanged(start, end);\n }\n }\n\n public clearTextureAtlas(): void {\n for (const layer of this._renderLayers) {\n layer.clearTextureAtlas();\n }\n }\n\n /**\n * Recalculates the character and canvas dimensions.\n */\n private _updateDimensions(): void {\n if (!this._charSizeService.hasValidSize) {\n return;\n }\n\n // Calculate the scaled character width. Width is floored as it must be\n // drawn to an integer grid in order for the CharAtlas \"stamps\" to not be\n // blurry. When text is drawn to the grid not using the CharAtlas, it is\n // clipped to ensure there is no overlap with the next cell.\n this.dimensions.scaledCharWidth = Math.floor(this._charSizeService.width * window.devicePixelRatio);\n\n // Calculate the scaled character height. Height is ceiled in case\n // devicePixelRatio is a floating point number in order to ensure there is\n // enough space to draw the character to the cell.\n this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * window.devicePixelRatio);\n\n // Calculate the scaled cell height, if lineHeight is not 1 then the value\n // will be floored because since lineHeight can never be lower then 1, there\n // is a guarentee that the scaled line height will always be larger than\n // scaled char height.\n this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.rawOptions.lineHeight);\n\n // Calculate the y coordinate within a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharTop = this._optionsService.rawOptions.lineHeight === 1 ? 0 : Math.round((this.dimensions.scaledCellHeight - this.dimensions.scaledCharHeight) / 2);\n\n // Calculate the scaled cell width, taking the letterSpacing into account.\n this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.rawOptions.letterSpacing);\n\n // Calculate the x coordinate with a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharLeft = Math.floor(this._optionsService.rawOptions.letterSpacing / 2);\n\n // Recalculate the canvas dimensions; scaled* define the actual number of\n // pixel in the canvas\n this.dimensions.scaledCanvasHeight = this._bufferService.rows * this.dimensions.scaledCellHeight;\n this.dimensions.scaledCanvasWidth = this._bufferService.cols * this.dimensions.scaledCellWidth;\n\n // The the size of the canvas on the page. It's very important that this\n // rounds to nearest integer and not ceils as browsers often set\n // window.devicePixelRatio as something like 1.100000023841858, when it's\n // actually 1.1. Ceiling causes blurriness as the backing canvas image is 1\n // pixel too large for the canvas element size.\n this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / window.devicePixelRatio);\n this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / window.devicePixelRatio);\n\n // Get the _actual_ dimensions of an individual cell. This needs to be\n // derived from the canvasWidth/Height calculated above which takes into\n // account window.devicePixelRatio. ICharSizeService.width/height by itself\n // is insufficient when the page is not at 100% zoom level as it's measured\n // in CSS pixels, but the actual char size on the canvas can differ.\n this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows;\n this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function throwIfFalsy(value: T | undefined | null): T {\n if (!value) {\n throw new Error('value must not be falsy');\n }\n return value;\n}\n\nexport function isPowerlineGlyph(codepoint: number): boolean {\n // Only return true for Powerline symbols which require\n // different padding and should be excluded from minimum contrast\n // ratio standards\n return 0xE0A4 <= codepoint && codepoint <= 0xE0D6;\n}\n\nfunction isBoxOrBlockGlyph(codepoint: number): boolean {\n return (0x2500 <= codepoint && codepoint <= 0x259F);\n}\n\nexport function excludeFromContrastRatioDemands(codepoint: number): boolean {\n return isPowerlineGlyph(codepoint) || isBoxOrBlockGlyph(codepoint);\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/Types';\nimport { BaseRenderLayer } from 'browser/renderer/BaseRenderLayer';\nimport { IColorSet } from 'browser/Types';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\n\ninterface ISelectionState {\n start?: [number, number];\n end?: [number, number];\n columnSelectMode?: boolean;\n ydisp?: number;\n}\n\nexport class SelectionRenderLayer extends BaseRenderLayer {\n private _state!: ISelectionState;\n\n constructor(\n container: HTMLElement,\n zIndex: number,\n colors: IColorSet,\n rendererId: number,\n @IBufferService bufferService: IBufferService,\n @IOptionsService optionsService: IOptionsService,\n @IDecorationService decorationService: IDecorationService\n ) {\n super(container, 'selection', zIndex, true, colors, rendererId, bufferService, optionsService, decorationService);\n this._clearState();\n }\n\n private _clearState(): void {\n this._state = {\n start: undefined,\n end: undefined,\n columnSelectMode: undefined,\n ydisp: undefined\n };\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // Resizing the canvas discards the contents of the canvas so clear state\n this._clearState();\n }\n\n public reset(): void {\n if (this._state.start && this._state.end) {\n this._clearState();\n this._clearAll();\n }\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n super.onSelectionChanged(start, end, columnSelectMode);\n\n // Selection has not changed\n if (!this._didStateChange(start, end, columnSelectMode, this._bufferService.buffer.ydisp)) {\n return;\n }\n\n // Remove all selections\n this._clearAll();\n\n // Selection does not exist\n if (!start || !end) {\n this._clearState();\n return;\n }\n\n // Translate from buffer position to viewport position\n const viewportStartRow = start[1] - this._bufferService.buffer.ydisp;\n const viewportEndRow = end[1] - this._bufferService.buffer.ydisp;\n const viewportCappedStartRow = Math.max(viewportStartRow, 0);\n const viewportCappedEndRow = Math.min(viewportEndRow, this._bufferService.rows - 1);\n\n // No need to draw the selection\n if (viewportCappedStartRow >= this._bufferService.rows || viewportCappedEndRow < 0) {\n this._state.ydisp = this._bufferService.buffer.ydisp;\n return;\n }\n\n this._ctx.fillStyle = this._colors.selectionTransparent.css;\n\n if (columnSelectMode) {\n const startCol = start[0];\n const width = end[0] - startCol;\n const height = viewportCappedEndRow - viewportCappedStartRow + 1;\n this._fillCells(startCol, viewportCappedStartRow, width, height);\n } else {\n // Draw first row\n const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;\n const startRowEndCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;\n this._fillCells(startCol, viewportCappedStartRow, startRowEndCol - startCol, 1);\n\n // Draw middle rows\n const middleRowsCount = Math.max(viewportCappedEndRow - viewportCappedStartRow - 1, 0);\n this._fillCells(0, viewportCappedStartRow + 1, this._bufferService.cols, middleRowsCount);\n\n // Draw final row\n if (viewportCappedStartRow !== viewportCappedEndRow) {\n // Only draw viewportEndRow if it's not the same as viewportStartRow\n const endCol = viewportEndRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;\n this._fillCells(0, viewportCappedEndRow, endCol, 1);\n }\n }\n\n // Save state for next render\n this._state.start = [start[0], start[1]];\n this._state.end = [end[0], end[1]];\n this._state.columnSelectMode = columnSelectMode;\n this._state.ydisp = this._bufferService.buffer.ydisp;\n }\n\n private _didStateChange(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean, ydisp: number): boolean {\n return !this._areCoordinatesEqual(start, this._state.start) ||\n !this._areCoordinatesEqual(end, this._state.end) ||\n columnSelectMode !== this._state.columnSelectMode ||\n ydisp !== this._state.ydisp;\n }\n\n private _areCoordinatesEqual(coord1: [number, number] | undefined, coord2: [number, number] | undefined): boolean {\n if (!coord1 || !coord2) {\n return false;\n }\n\n return coord1[0] === coord2[0] && coord1[1] === coord2[1];\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/Types';\nimport { CharData, ICellData } from 'common/Types';\nimport { GridCache } from 'browser/renderer/GridCache';\nimport { BaseRenderLayer } from 'browser/renderer/BaseRenderLayer';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { NULL_CELL_CODE, Content } from 'common/buffer/Constants';\nimport { IColorSet } from 'browser/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IOptionsService, IBufferService, IDecorationService } from 'common/services/Services';\nimport { ICharacterJoinerService } from 'browser/services/Services';\nimport { JoinedCellData } from 'browser/services/CharacterJoinerService';\n\n/**\n * This CharData looks like a null character, which will forc a clear and render\n * when the character changes (a regular space ' ' character may not as it's\n * drawn state is a cleared cell).\n */\n// const OVERLAP_OWNED_CHAR_DATA: CharData = [null, '', 0, -1];\n\nexport class TextRenderLayer extends BaseRenderLayer {\n private _state: GridCache;\n private _characterWidth: number = 0;\n private _characterFont: string = '';\n private _characterOverlapCache: { [key: string]: boolean } = {};\n private _workCell = new CellData();\n\n constructor(\n container: HTMLElement,\n zIndex: number,\n colors: IColorSet,\n alpha: boolean,\n rendererId: number,\n @IBufferService bufferService: IBufferService,\n @IOptionsService optionsService: IOptionsService,\n @ICharacterJoinerService private readonly _characterJoinerService: ICharacterJoinerService,\n @IDecorationService decorationService: IDecorationService\n ) {\n super(container, 'text', zIndex, alpha, colors, rendererId, bufferService, optionsService, decorationService);\n this._state = new GridCache();\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n\n // Clear the character width cache if the font or width has changed\n const terminalFont = this._getFont(false, false);\n if (this._characterWidth !== dim.scaledCharWidth || this._characterFont !== terminalFont) {\n this._characterWidth = dim.scaledCharWidth;\n this._characterFont = terminalFont;\n this._characterOverlapCache = {};\n }\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state.clear();\n this._state.resize(this._bufferService.cols, this._bufferService.rows);\n }\n\n public reset(): void {\n this._state.clear();\n this._clearAll();\n }\n\n private _forEachCell(\n firstRow: number,\n lastRow: number,\n callback: (\n cell: ICellData,\n x: number,\n y: number\n ) => void\n ): void {\n for (let y = firstRow; y <= lastRow; y++) {\n const row = y + this._bufferService.buffer.ydisp;\n const line = this._bufferService.buffer.lines.get(row);\n const joinedRanges = this._characterJoinerService.getJoinedCharacters(row);\n for (let x = 0; x < this._bufferService.cols; x++) {\n line!.loadCell(x, this._workCell);\n let cell = this._workCell;\n\n // If true, indicates that the current character(s) to draw were joined.\n let isJoined = false;\n let lastCharX = x;\n\n // The character to the left is a wide character, drawing is owned by\n // the char at x-1\n if (cell.getWidth() === 0) {\n continue;\n }\n\n // Process any joined character ranges as needed. Because of how the\n // ranges are produced, we know that they are valid for the characters\n // and attributes of our input.\n if (joinedRanges.length > 0 && x === joinedRanges[0][0]) {\n isJoined = true;\n const range = joinedRanges.shift()!;\n\n // We already know the exact start and end column of the joined range,\n // so we get the string and width representing it directly\n cell = new JoinedCellData(\n this._workCell,\n line!.translateToString(true, range[0], range[1]),\n range[1] - range[0]\n );\n\n // Skip over the cells occupied by this range in the loop\n lastCharX = range[1] - 1;\n }\n\n // If the character is an overlapping char and the character to the\n // right is a space, take ownership of the cell to the right. We skip\n // this check for joined characters because their rendering likely won't\n // yield the same result as rendering the last character individually.\n if (!isJoined && this._isOverlapping(cell)) {\n // If the character is overlapping, we want to force a re-render on every\n // frame. This is specifically to work around the case where two\n // overlaping chars `a` and `b` are adjacent, the cursor is moved to b and a\n // space is added. Without this, the first half of `b` would never\n // get removed, and `a` would not re-render because it thinks it's\n // already in the correct state.\n // this._state.cache[x][y] = OVERLAP_OWNED_CHAR_DATA;\n if (lastCharX < line!.length - 1 && line!.getCodePoint(lastCharX + 1) === NULL_CELL_CODE) {\n // patch width to 2\n cell.content &= ~Content.WIDTH_MASK;\n cell.content |= 2 << Content.WIDTH_SHIFT;\n // this._clearChar(x + 1, y);\n // The overlapping char's char data will force a clear and render when the\n // overlapping char is no longer to the left of the character and also when\n // the space changes to another character.\n // this._state.cache[x + 1][y] = OVERLAP_OWNED_CHAR_DATA;\n }\n }\n\n callback(\n cell,\n x,\n y\n );\n\n x = lastCharX;\n }\n }\n }\n\n /**\n * Draws the background for a specified range of columns. Tries to batch adjacent cells of the\n * same color together to reduce draw calls.\n */\n private _drawBackground(firstRow: number, lastRow: number): void {\n const ctx = this._ctx;\n const cols = this._bufferService.cols;\n let startX: number = 0;\n let startY: number = 0;\n let prevFillStyle: string | null = null;\n\n ctx.save();\n\n this._forEachCell(firstRow, lastRow, (cell, x, y) => {\n // libvte and xterm both draw the background (but not foreground) of invisible characters,\n // so we should too.\n let nextFillStyle = null; // null represents default background color\n\n if (cell.isInverse()) {\n if (cell.isFgDefault()) {\n nextFillStyle = this._colors.foreground.css;\n } else if (cell.isFgRGB()) {\n nextFillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`;\n } else {\n nextFillStyle = this._colors.ansi[cell.getFgColor()].css;\n }\n } else if (cell.isBgRGB()) {\n nextFillStyle = `rgb(${AttributeData.toColorRGB(cell.getBgColor()).join(',')})`;\n } else if (cell.isBgPalette()) {\n nextFillStyle = this._colors.ansi[cell.getBgColor()].css;\n }\n\n // Get any decoration foreground/background overrides, this must be fetched before the early\n // exist but applied after inverse\n let isTop = false;\n for (const d of this._decorationService.getDecorationsAtCell(x, this._bufferService.buffer.ydisp + y)) {\n if (d.options.layer !== 'top' && isTop) {\n continue;\n }\n if (d.backgroundColorRGB) {\n nextFillStyle = d.backgroundColorRGB.css;\n }\n isTop = d.options.layer === 'top';\n }\n\n if (prevFillStyle === null) {\n // This is either the first iteration, or the default background was set. Either way, we\n // don't need to draw anything.\n startX = x;\n startY = y;\n }\n\n if (y !== startY) {\n // our row changed, draw the previous row\n ctx.fillStyle = prevFillStyle || '';\n this._fillCells(startX, startY, cols - startX, 1);\n startX = x;\n startY = y;\n } else if (prevFillStyle !== nextFillStyle) {\n // our color changed, draw the previous characters in this row\n ctx.fillStyle = prevFillStyle || '';\n this._fillCells(startX, startY, x - startX, 1);\n startX = x;\n startY = y;\n }\n\n prevFillStyle = nextFillStyle;\n });\n\n // flush the last color we encountered\n if (prevFillStyle !== null) {\n ctx.fillStyle = prevFillStyle;\n this._fillCells(startX, startY, cols - startX, 1);\n }\n\n ctx.restore();\n }\n\n private _drawForeground(firstRow: number, lastRow: number): void {\n this._forEachCell(firstRow, lastRow, (cell, x, y) => {\n if (cell.isInvisible()) {\n return;\n }\n this._drawChars(cell, x, y);\n if (cell.isUnderline() || cell.isStrikethrough()) {\n this._ctx.save();\n\n if (cell.isInverse()) {\n if (cell.isBgDefault()) {\n this._ctx.fillStyle = this._colors.background.css;\n } else if (cell.isBgRGB()) {\n this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getBgColor()).join(',')})`;\n } else {\n let bg = cell.getBgColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && bg < 8) {\n bg += 8;\n }\n this._ctx.fillStyle = this._colors.ansi[bg].css;\n }\n } else {\n if (cell.isFgDefault()) {\n this._ctx.fillStyle = this._colors.foreground.css;\n } else if (cell.isFgRGB()) {\n this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`;\n } else {\n let fg = cell.getFgColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && fg < 8) {\n fg += 8;\n }\n this._ctx.fillStyle = this._colors.ansi[fg].css;\n }\n }\n\n if (cell.isStrikethrough()) {\n this._fillMiddleLineAtCells(x, y, cell.getWidth());\n }\n if (cell.isUnderline()) {\n this._fillBottomLineAtCells(x, y, cell.getWidth());\n }\n this._ctx.restore();\n }\n });\n }\n\n public onGridChanged(firstRow: number, lastRow: number): void {\n // Resize has not been called yet\n if (this._state.cache.length === 0) {\n return;\n }\n\n if (this._charAtlas) {\n this._charAtlas.beginFrame();\n }\n\n this._clearCells(0, firstRow, this._bufferService.cols, lastRow - firstRow + 1);\n this._drawBackground(firstRow, lastRow);\n this._drawForeground(firstRow, lastRow);\n }\n\n public onOptionsChanged(): void {\n this._setTransparency(this._optionsService.rawOptions.allowTransparency);\n }\n\n /**\n * Whether a character is overlapping to the next cell.\n */\n private _isOverlapping(cell: ICellData): boolean {\n // Only single cell characters can be overlapping, rendering issues can\n // occur without this check\n if (cell.getWidth() !== 1) {\n return false;\n }\n\n // We assume that any ascii character will not overlap\n if (cell.getCode() < 256) {\n return false;\n }\n\n const chars = cell.getChars();\n\n // Deliver from cache if available\n if (this._characterOverlapCache.hasOwnProperty(chars)) {\n return this._characterOverlapCache[chars];\n }\n\n // Setup the font\n this._ctx.save();\n this._ctx.font = this._characterFont;\n\n // Measure the width of the character, but Math.floor it\n // because that is what the renderer does when it calculates\n // the character dimensions we are comparing against\n const overlaps = Math.floor(this._ctx.measureText(chars).width) > this._characterWidth;\n\n // Restore the original context\n this._ctx.restore();\n\n // Cache and return\n this._characterOverlapCache[chars] = overlaps;\n return overlaps;\n }\n\n /**\n * Clear the charcater at the cell specified.\n * @param x The column of the char.\n * @param y The row of the char.\n */\n // private _clearChar(x: number, y: number): void {\n // let colsToClear = 1;\n // // Clear the adjacent character if it was wide\n // const state = this._state.cache[x][y];\n // if (state && state[CHAR_DATA_WIDTH_INDEX] === 2) {\n // colsToClear = 2;\n // }\n // this.clearCells(x, y, colsToClear, 1);\n // }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IGlyphIdentifier } from 'browser/renderer/atlas/Types';\nimport { IDisposable } from 'common/Types';\n\nexport abstract class BaseCharAtlas implements IDisposable {\n private _didWarmUp: boolean = false;\n\n public dispose(): void { }\n\n /**\n * Perform any work needed to warm the cache before it can be used. May be called multiple times.\n * Implement _doWarmUp instead if you only want to get called once.\n */\n public warmUp(): void {\n if (!this._didWarmUp) {\n this._doWarmUp();\n this._didWarmUp = true;\n }\n }\n\n /**\n * Perform any work needed to warm the cache before it can be used. Used by the default\n * implementation of warmUp(), and will only be called once.\n */\n private _doWarmUp(): void { }\n\n public clear(): void { }\n\n /**\n * Called when we start drawing a new frame.\n *\n * TODO: We rely on this getting called by TextRenderLayer. This should really be called by\n * Renderer instead, but we need to make Renderer the source-of-truth for the char atlas, instead\n * of BaseRenderLayer.\n */\n public beginFrame(): void { }\n\n /**\n * May be called before warmUp finishes, however it is okay for the implementation to\n * do nothing and return false in that case.\n *\n * @param ctx Where to draw the character onto.\n * @param glyph Information about what to draw\n * @param x The position on the context to start drawing at\n * @param y The position on the context to start drawing at\n * @returns The success state. True if we drew the character.\n */\n public abstract draw(\n ctx: CanvasRenderingContext2D,\n glyph: IGlyphIdentifier,\n x: number,\n y: number\n ): boolean;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { generateConfig, configEquals } from 'browser/renderer/atlas/CharAtlasUtils';\nimport { BaseCharAtlas } from 'browser/renderer/atlas/BaseCharAtlas';\nimport { DynamicCharAtlas } from 'browser/renderer/atlas/DynamicCharAtlas';\nimport { ICharAtlasConfig } from 'browser/renderer/atlas/Types';\nimport { IColorSet } from 'browser/Types';\nimport { ITerminalOptions } from 'common/services/Services';\n\ninterface ICharAtlasCacheEntry {\n atlas: BaseCharAtlas;\n config: ICharAtlasConfig;\n // N.B. This implementation potentially holds onto copies of the terminal forever, so\n // this may cause memory leaks.\n ownedBy: number[];\n}\n\nconst charAtlasCache: ICharAtlasCacheEntry[] = [];\n\n/**\n * Acquires a char atlas, either generating a new one or returning an existing\n * one that is in use by another terminal.\n */\nexport function acquireCharAtlas(\n options: ITerminalOptions,\n rendererId: number,\n colors: IColorSet,\n scaledCharWidth: number,\n scaledCharHeight: number\n): BaseCharAtlas {\n const newConfig = generateConfig(scaledCharWidth, scaledCharHeight, options, colors);\n\n // Check to see if the renderer already owns this config\n for (let i = 0; i < charAtlasCache.length; i++) {\n const entry = charAtlasCache[i];\n const ownedByIndex = entry.ownedBy.indexOf(rendererId);\n if (ownedByIndex >= 0) {\n if (configEquals(entry.config, newConfig)) {\n return entry.atlas;\n }\n // The configs differ, release the renderer from the entry\n if (entry.ownedBy.length === 1) {\n entry.atlas.dispose();\n charAtlasCache.splice(i, 1);\n } else {\n entry.ownedBy.splice(ownedByIndex, 1);\n }\n break;\n }\n }\n\n // Try match a char atlas from the cache\n for (let i = 0; i < charAtlasCache.length; i++) {\n const entry = charAtlasCache[i];\n if (configEquals(entry.config, newConfig)) {\n // Add the renderer to the cache entry and return\n entry.ownedBy.push(rendererId);\n return entry.atlas;\n }\n }\n\n const newEntry: ICharAtlasCacheEntry = {\n atlas: new DynamicCharAtlas(\n document,\n newConfig\n ),\n config: newConfig,\n ownedBy: [rendererId]\n };\n charAtlasCache.push(newEntry);\n return newEntry.atlas;\n}\n\n/**\n * Removes a terminal reference from the cache, allowing its memory to be freed.\n */\nexport function removeTerminalFromCache(rendererId: number): void {\n for (let i = 0; i < charAtlasCache.length; i++) {\n const index = charAtlasCache[i].ownedBy.indexOf(rendererId);\n if (index !== -1) {\n if (charAtlasCache[i].ownedBy.length === 1) {\n // Remove the cache entry if it's the only renderer\n charAtlasCache[i].atlas.dispose();\n charAtlasCache.splice(i, 1);\n } else {\n // Remove the reference from the cache entry\n charAtlasCache[i].ownedBy.splice(index, 1);\n }\n break;\n }\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharAtlasConfig } from 'browser/renderer/atlas/Types';\nimport { DEFAULT_COLOR } from 'common/buffer/Constants';\nimport { IColorSet, IPartialColorSet } from 'browser/Types';\nimport { ITerminalOptions } from 'common/services/Services';\n\nexport function generateConfig(scaledCharWidth: number, scaledCharHeight: number, options: ITerminalOptions, colors: IColorSet): ICharAtlasConfig {\n // null out some fields that don't matter\n const clonedColors: IPartialColorSet = {\n foreground: colors.foreground,\n background: colors.background,\n cursor: undefined,\n cursorAccent: undefined,\n selection: undefined,\n ansi: colors.ansi.slice()\n };\n return {\n devicePixelRatio: window.devicePixelRatio,\n scaledCharWidth,\n scaledCharHeight,\n fontFamily: options.fontFamily,\n fontSize: options.fontSize,\n fontWeight: options.fontWeight,\n fontWeightBold: options.fontWeightBold,\n allowTransparency: options.allowTransparency,\n colors: clonedColors\n };\n}\n\nexport function configEquals(a: ICharAtlasConfig, b: ICharAtlasConfig): boolean {\n for (let i = 0; i < a.colors.ansi.length; i++) {\n if (a.colors.ansi[i].rgba !== b.colors.ansi[i].rgba) {\n return false;\n }\n }\n return a.devicePixelRatio === b.devicePixelRatio &&\n a.fontFamily === b.fontFamily &&\n a.fontSize === b.fontSize &&\n a.fontWeight === b.fontWeight &&\n a.fontWeightBold === b.fontWeightBold &&\n a.allowTransparency === b.allowTransparency &&\n a.scaledCharWidth === b.scaledCharWidth &&\n a.scaledCharHeight === b.scaledCharHeight &&\n a.colors.foreground === b.colors.foreground &&\n a.colors.background === b.colors.background;\n}\n\nexport function is256Color(colorCode: number): boolean {\n return colorCode < DEFAULT_COLOR;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { isFirefox, isLegacyEdge } from 'common/Platform';\n\nexport const INVERTED_DEFAULT_COLOR = 257;\nexport const DIM_OPACITY = 0.5;\n// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox or Legacy Edge would\n// result in truncated text (Issue 3353). Using 'bottom' for Chrome would result in slightly\n// unaligned Powerline fonts (PR 3356#issuecomment-850928179).\nexport const TEXT_BASELINE: CanvasTextBaseline = isFirefox || isLegacyEdge ? 'bottom' : 'ideographic';\n\nexport const CHAR_ATLAS_CELL_SPACING = 1;\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { DIM_OPACITY, INVERTED_DEFAULT_COLOR, TEXT_BASELINE } from 'browser/renderer/atlas/Constants';\nimport { IGlyphIdentifier, ICharAtlasConfig } from 'browser/renderer/atlas/Types';\nimport { BaseCharAtlas } from 'browser/renderer/atlas/BaseCharAtlas';\nimport { DEFAULT_ANSI_COLORS } from 'browser/ColorManager';\nimport { LRUMap } from 'browser/renderer/atlas/LRUMap';\nimport { isFirefox, isSafari } from 'common/Platform';\nimport { IColor } from 'common/Types';\nimport { throwIfFalsy } from 'browser/renderer/RendererUtils';\nimport { color } from 'common/Color';\n\n// In practice we're probably never going to exhaust a texture this large. For debugging purposes,\n// however, it can be useful to set this to a really tiny value, to verify that LRU eviction works.\nconst TEXTURE_WIDTH = 1024;\nconst TEXTURE_HEIGHT = 1024;\n\nconst TRANSPARENT_COLOR = {\n css: 'rgba(0, 0, 0, 0)',\n rgba: 0\n};\n\n// Drawing to the cache is expensive: If we have to draw more than this number of glyphs to the\n// cache in a single frame, give up on trying to cache anything else, and try to finish the current\n// frame ASAP.\n//\n// This helps to limit the amount of damage a program can do when it would otherwise thrash the\n// cache.\nconst FRAME_CACHE_DRAW_LIMIT = 100;\n\n/**\n * The number of milliseconds to wait before generating the ImageBitmap, this is to debounce/batch\n * the operation as window.createImageBitmap is asynchronous.\n */\nconst GLYPH_BITMAP_COMMIT_DELAY = 100;\n\ninterface IGlyphCacheValue {\n index: number;\n isEmpty: boolean;\n inBitmap: boolean;\n}\n\nexport function getGlyphCacheKey(glyph: IGlyphIdentifier): number {\n // Note that this only returns a valid key when code < 256\n // Layout:\n // 0b00000000000000000000000000000001: italic (1)\n // 0b00000000000000000000000000000010: dim (1)\n // 0b00000000000000000000000000000100: bold (1)\n // 0b00000000000000000000111111111000: fg (9)\n // 0b00000000000111111111000000000000: bg (9)\n // 0b00011111111000000000000000000000: code (8)\n // 0b11100000000000000000000000000000: unused (3)\n return glyph.code << 21 | glyph.bg << 12 | glyph.fg << 3 | (glyph.bold ? 0 : 4) + (glyph.dim ? 0 : 2) + (glyph.italic ? 0 : 1);\n}\n\nexport class DynamicCharAtlas extends BaseCharAtlas {\n // An ordered map that we're using to keep track of where each glyph is in the atlas texture.\n // It's ordered so that we can determine when to remove the old entries.\n private _cacheMap: LRUMap;\n\n // The texture that the atlas is drawn to\n private _cacheCanvas: HTMLCanvasElement;\n private _cacheCtx: CanvasRenderingContext2D;\n\n // A temporary context that glyphs are drawn to before being transfered to the atlas.\n private _tmpCtx: CanvasRenderingContext2D;\n\n // The number of characters stored in the atlas by width/height\n private _width: number;\n private _height: number;\n\n private _drawToCacheCount: number = 0;\n\n // An array of glyph keys that are waiting on the bitmap to be generated.\n private _glyphsWaitingOnBitmap: IGlyphCacheValue[] = [];\n\n // The timeout that is used to batch bitmap generation so it's not requested for every new glyph.\n private _bitmapCommitTimeout: number | null = null;\n\n // The bitmap to draw from, this is much faster on other browsers than others.\n private _bitmap: ImageBitmap | null = null;\n\n constructor(document: Document, private _config: ICharAtlasConfig) {\n super();\n this._cacheCanvas = document.createElement('canvas');\n this._cacheCanvas.width = TEXTURE_WIDTH;\n this._cacheCanvas.height = TEXTURE_HEIGHT;\n // The canvas needs alpha because we use clearColor to convert the background color to alpha.\n // It might also contain some characters with transparent backgrounds if allowTransparency is\n // set.\n this._cacheCtx = throwIfFalsy(this._cacheCanvas.getContext('2d', { alpha: true }));\n\n const tmpCanvas = document.createElement('canvas');\n tmpCanvas.width = this._config.scaledCharWidth;\n tmpCanvas.height = this._config.scaledCharHeight;\n this._tmpCtx = throwIfFalsy(tmpCanvas.getContext('2d', { alpha: this._config.allowTransparency }));\n\n this._width = Math.floor(TEXTURE_WIDTH / this._config.scaledCharWidth);\n this._height = Math.floor(TEXTURE_HEIGHT / this._config.scaledCharHeight);\n const capacity = this._width * this._height;\n this._cacheMap = new LRUMap(capacity);\n this._cacheMap.prealloc(capacity);\n\n // This is useful for debugging\n // document.body.appendChild(this._cacheCanvas);\n }\n\n public dispose(): void {\n if (this._bitmapCommitTimeout !== null) {\n window.clearTimeout(this._bitmapCommitTimeout);\n this._bitmapCommitTimeout = null;\n }\n }\n\n public beginFrame(): void {\n this._drawToCacheCount = 0;\n }\n\n public clear(): void {\n if (this._cacheMap.size > 0) {\n const capacity = this._width * this._height;\n this._cacheMap = new LRUMap(capacity);\n this._cacheMap.prealloc(capacity);\n }\n this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT);\n this._tmpCtx.clearRect(0, 0, this._config.scaledCharWidth, this._config.scaledCharHeight);\n }\n\n public draw(\n ctx: CanvasRenderingContext2D,\n glyph: IGlyphIdentifier,\n x: number,\n y: number\n ): boolean {\n // Space is always an empty cell, special case this as it's so common\n if (glyph.code === 32) {\n return true;\n }\n\n // Exit early for uncachable glyphs\n if (!this._canCache(glyph)) {\n return false;\n }\n\n const glyphKey = getGlyphCacheKey(glyph);\n const cacheValue = this._cacheMap.get(glyphKey);\n if (cacheValue !== null && cacheValue !== undefined) {\n this._drawFromCache(ctx, cacheValue, x, y);\n return true;\n }\n if (this._drawToCacheCount < FRAME_CACHE_DRAW_LIMIT) {\n let index;\n if (this._cacheMap.size < this._cacheMap.capacity) {\n index = this._cacheMap.size;\n } else {\n // we're out of space, so our call to set will delete this item\n index = this._cacheMap.peek()!.index;\n }\n const cacheValue = this._drawToCache(glyph, index);\n this._cacheMap.set(glyphKey, cacheValue);\n this._drawFromCache(ctx, cacheValue, x, y);\n return true;\n }\n return false;\n }\n\n private _canCache(glyph: IGlyphIdentifier): boolean {\n // Only cache ascii and extended characters for now, to be safe. In the future, we could do\n // something more complicated to determine the expected width of a character.\n //\n // If we switch the renderer over to webgl at some point, we may be able to use blending modes\n // to draw overlapping glyphs from the atlas:\n // https://github.com/servo/webrender/issues/464#issuecomment-255632875\n // https://webglfundamentals.org/webgl/lessons/webgl-text-texture.html\n return glyph.code < 256;\n }\n\n private _toCoordinateX(index: number): number {\n return (index % this._width) * this._config.scaledCharWidth;\n }\n\n private _toCoordinateY(index: number): number {\n return Math.floor(index / this._width) * this._config.scaledCharHeight;\n }\n\n private _drawFromCache(\n ctx: CanvasRenderingContext2D,\n cacheValue: IGlyphCacheValue,\n x: number,\n y: number\n ): void {\n // We don't actually need to do anything if this is whitespace.\n if (cacheValue.isEmpty) {\n return;\n }\n const cacheX = this._toCoordinateX(cacheValue.index);\n const cacheY = this._toCoordinateY(cacheValue.index);\n ctx.drawImage(\n cacheValue.inBitmap ? this._bitmap! : this._cacheCanvas,\n cacheX,\n cacheY,\n this._config.scaledCharWidth,\n this._config.scaledCharHeight,\n x,\n y,\n this._config.scaledCharWidth,\n this._config.scaledCharHeight\n );\n }\n\n private _getColorFromAnsiIndex(idx: number): IColor {\n if (idx < this._config.colors.ansi.length) {\n return this._config.colors.ansi[idx];\n }\n return DEFAULT_ANSI_COLORS[idx];\n }\n\n private _getBackgroundColor(glyph: IGlyphIdentifier): IColor {\n if (this._config.allowTransparency) {\n // The background color might have some transparency, so we need to render it as fully\n // transparent in the atlas. Otherwise we'd end up drawing the transparent background twice\n // around the anti-aliased edges of the glyph, and it would look too dark.\n return TRANSPARENT_COLOR;\n }\n if (glyph.bg === INVERTED_DEFAULT_COLOR) {\n return this._config.colors.foreground;\n }\n if (glyph.bg < 256) {\n return this._getColorFromAnsiIndex(glyph.bg);\n }\n return this._config.colors.background;\n }\n\n private _getForegroundColor(glyph: IGlyphIdentifier): IColor {\n if (glyph.fg === INVERTED_DEFAULT_COLOR) {\n return color.opaque(this._config.colors.background);\n }\n if (glyph.fg < 256) {\n // 256 color support\n return this._getColorFromAnsiIndex(glyph.fg);\n }\n return this._config.colors.foreground;\n }\n\n // TODO: We do this (or something similar) in multiple places. We should split this off\n // into a shared function.\n private _drawToCache(glyph: IGlyphIdentifier, index: number): IGlyphCacheValue {\n this._drawToCacheCount++;\n\n this._tmpCtx.save();\n\n // draw the background\n const backgroundColor = this._getBackgroundColor(glyph);\n // Use a 'copy' composite operation to clear any existing glyph out of _tmpCtxWithAlpha, regardless of\n // transparency in backgroundColor\n this._tmpCtx.globalCompositeOperation = 'copy';\n this._tmpCtx.fillStyle = backgroundColor.css;\n this._tmpCtx.fillRect(0, 0, this._config.scaledCharWidth, this._config.scaledCharHeight);\n this._tmpCtx.globalCompositeOperation = 'source-over';\n\n // draw the foreground/glyph\n const fontWeight = glyph.bold ? this._config.fontWeightBold : this._config.fontWeight;\n const fontStyle = glyph.italic ? 'italic' : '';\n this._tmpCtx.font =\n `${fontStyle} ${fontWeight} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`;\n this._tmpCtx.textBaseline = TEXT_BASELINE;\n\n this._tmpCtx.fillStyle = this._getForegroundColor(glyph).css;\n\n // Apply alpha to dim the character\n if (glyph.dim) {\n this._tmpCtx.globalAlpha = DIM_OPACITY;\n }\n // Draw the character\n this._tmpCtx.fillText(glyph.chars, 0, this._config.scaledCharHeight);\n\n // clear the background from the character to avoid issues with drawing over the previous\n // character if it extends past it's bounds\n let imageData = this._tmpCtx.getImageData(\n 0, 0, this._config.scaledCharWidth, this._config.scaledCharHeight\n );\n let isEmpty = false;\n if (!this._config.allowTransparency) {\n isEmpty = clearColor(imageData, backgroundColor);\n }\n\n // If this charcater is underscore and empty, shift it up until it is visible, try for a maximum\n // of 5 pixels.\n if (isEmpty && glyph.chars === '_' && !this._config.allowTransparency) {\n for (let offset = 1; offset <= 5; offset++) {\n // Draw the character\n this._tmpCtx.fillText(glyph.chars, 0, this._config.scaledCharHeight - offset);\n\n // clear the background from the character to avoid issues with drawing over the previous\n // character if it extends past it's bounds\n imageData = this._tmpCtx.getImageData(\n 0, 0, this._config.scaledCharWidth, this._config.scaledCharHeight\n );\n isEmpty = clearColor(imageData, backgroundColor);\n if (!isEmpty) {\n break;\n }\n }\n }\n\n this._tmpCtx.restore();\n\n // copy the data from imageData to _cacheCanvas\n const x = this._toCoordinateX(index);\n const y = this._toCoordinateY(index);\n // putImageData doesn't do any blending, so it will overwrite any existing cache entry for us\n this._cacheCtx.putImageData(imageData, x, y);\n\n // Add the glyph and queue it to the bitmap (if the browser supports it)\n const cacheValue = {\n index,\n isEmpty,\n inBitmap: false\n };\n this._addGlyphToBitmap(cacheValue);\n\n return cacheValue;\n }\n\n private _addGlyphToBitmap(cacheValue: IGlyphCacheValue): void {\n // Support is patchy for createImageBitmap at the moment, pass a canvas back\n // if support is lacking as drawImage works there too. Firefox is also\n // included here as ImageBitmap appears both buggy and has horrible\n // performance (tested on v55).\n if (!('createImageBitmap' in window) || isFirefox || isSafari) {\n return;\n }\n\n // Add the glyph to the queue\n this._glyphsWaitingOnBitmap.push(cacheValue);\n\n // Check if bitmap generation timeout already exists\n if (this._bitmapCommitTimeout !== null) {\n return;\n }\n\n this._bitmapCommitTimeout = window.setTimeout(() => this._generateBitmap(), GLYPH_BITMAP_COMMIT_DELAY);\n }\n\n private _generateBitmap(): void {\n const glyphsMovingToBitmap = this._glyphsWaitingOnBitmap;\n this._glyphsWaitingOnBitmap = [];\n window.createImageBitmap(this._cacheCanvas).then(bitmap => {\n // Set bitmap\n this._bitmap = bitmap;\n\n // Mark all new glyphs as in bitmap, excluding glyphs that came in after\n // the bitmap was requested\n for (let i = 0; i < glyphsMovingToBitmap.length; i++) {\n const value = glyphsMovingToBitmap[i];\n // It doesn't matter if the value was already evicted, it will be\n // released from memory after this block if so.\n value.inBitmap = true;\n }\n });\n this._bitmapCommitTimeout = null;\n }\n}\n\n// This is used for debugging the renderer, just swap out `new DynamicCharAtlas` with\n// `new NoneCharAtlas`.\nexport class NoneCharAtlas extends BaseCharAtlas {\n constructor(document: Document, config: ICharAtlasConfig) {\n super();\n }\n\n public draw(\n ctx: CanvasRenderingContext2D,\n glyph: IGlyphIdentifier,\n x: number,\n y: number\n ): boolean {\n return false;\n }\n}\n\n/**\n * Makes a partiicular rgb color in an ImageData completely transparent.\n * @returns True if the result is \"empty\", meaning all pixels are fully transparent.\n */\nfunction clearColor(imageData: ImageData, color: IColor): boolean {\n let isEmpty = true;\n const r = color.rgba >>> 24;\n const g = color.rgba >>> 16 & 0xFF;\n const b = color.rgba >>> 8 & 0xFF;\n for (let offset = 0; offset < imageData.data.length; offset += 4) {\n if (imageData.data[offset] === r &&\n imageData.data[offset + 1] === g &&\n imageData.data[offset + 2] === b) {\n imageData.data[offset + 3] = 0;\n } else {\n isEmpty = false;\n }\n }\n return isEmpty;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\ninterface ILinkedListNode {\n prev: ILinkedListNode | null;\n next: ILinkedListNode | null;\n key: number | null;\n value: T | null;\n}\n\nexport class LRUMap {\n private _map: { [key: number]: ILinkedListNode } = {};\n private _head: ILinkedListNode | null = null;\n private _tail: ILinkedListNode | null = null;\n private _nodePool: ILinkedListNode[] = [];\n public size: number = 0;\n\n constructor(public capacity: number) { }\n\n private _unlinkNode(node: ILinkedListNode): void {\n const prev = node.prev;\n const next = node.next;\n if (node === this._head) {\n this._head = next;\n }\n if (node === this._tail) {\n this._tail = prev;\n }\n if (prev !== null) {\n prev.next = next;\n }\n if (next !== null) {\n next.prev = prev;\n }\n }\n\n private _appendNode(node: ILinkedListNode): void {\n const tail = this._tail;\n if (tail !== null) {\n tail.next = node;\n }\n node.prev = tail;\n node.next = null;\n this._tail = node;\n if (this._head === null) {\n this._head = node;\n }\n }\n\n /**\n * Preallocate a bunch of linked-list nodes. Allocating these nodes ahead of time means that\n * they're more likely to live next to each other in memory, which seems to improve performance.\n *\n * Each empty object only consumes about 60 bytes of memory, so this is pretty cheap, even for\n * large maps.\n */\n public prealloc(count: number): void {\n const nodePool = this._nodePool;\n for (let i = 0; i < count; i++) {\n nodePool.push({\n prev: null,\n next: null,\n key: null,\n value: null\n });\n }\n }\n\n public get(key: number): T | null {\n // This is unsafe: We're assuming our keyspace doesn't overlap with Object.prototype. However,\n // it's faster than calling hasOwnProperty, and in our case, it would never overlap.\n const node = this._map[key];\n if (node !== undefined) {\n this._unlinkNode(node);\n this._appendNode(node);\n return node.value;\n }\n return null;\n }\n\n /**\n * Gets a value from a key without marking it as the most recently used item.\n */\n public peekValue(key: number): T | null {\n const node = this._map[key];\n if (node !== undefined) {\n return node.value;\n }\n return null;\n }\n\n public peek(): T | null {\n const head = this._head;\n return head === null ? null : head.value;\n }\n\n public set(key: number, value: T): void {\n // This is unsafe: See note above.\n let node = this._map[key];\n if (node !== undefined) {\n // already exists, we just need to mutate it and move it to the end of the list\n node = this._map[key];\n this._unlinkNode(node);\n node.value = value;\n } else if (this.size >= this.capacity) {\n // we're out of space: recycle the head node, move it to the tail\n node = this._head!;\n this._unlinkNode(node);\n delete this._map[node.key!];\n node.key = key;\n node.value = value;\n this._map[key] = node;\n } else {\n // make a new element\n const nodePool = this._nodePool;\n if (nodePool.length > 0) {\n // use a preallocated node if we can\n node = nodePool.pop()!;\n node.key = key;\n node.value = value;\n } else {\n node = {\n prev: null,\n next: null,\n key,\n value\n };\n }\n this._map[key] = node;\n this.size++;\n }\n this._appendNode(node);\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderer, IRenderDimensions, IRequestRedrawEvent } from 'browser/renderer/Types';\nimport { BOLD_CLASS, ITALIC_CLASS, CURSOR_CLASS, CURSOR_STYLE_BLOCK_CLASS, CURSOR_BLINK_CLASS, CURSOR_STYLE_BAR_CLASS, CURSOR_STYLE_UNDERLINE_CLASS, DomRendererRowFactory } from 'browser/renderer/dom/DomRendererRowFactory';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';\nimport { Disposable } from 'common/Lifecycle';\nimport { IColorSet, ILinkifierEvent, ILinkifier, ILinkifier2 } from 'browser/Types';\nimport { ICharSizeService } from 'browser/services/Services';\nimport { IOptionsService, IBufferService, IInstantiationService, IDecorationService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { color } from 'common/Color';\nimport { removeElementFromParent } from 'browser/Dom';\n\nconst TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-';\nconst ROW_CONTAINER_CLASS = 'xterm-rows';\nconst FG_CLASS_PREFIX = 'xterm-fg-';\nconst BG_CLASS_PREFIX = 'xterm-bg-';\nconst FOCUS_CLASS = 'xterm-focus';\nconst SELECTION_CLASS = 'xterm-selection';\n\nlet nextTerminalId = 1;\n\n/**\n * A fallback renderer for when canvas is slow. This is not meant to be\n * particularly fast or feature complete, more just stable and usable for when\n * canvas is not an option.\n */\nexport class DomRenderer extends Disposable implements IRenderer {\n private _rowFactory: DomRendererRowFactory;\n private _terminalClass: number = nextTerminalId++;\n\n private _themeStyleElement!: HTMLStyleElement;\n private _dimensionsStyleElement!: HTMLStyleElement;\n private _rowContainer: HTMLElement;\n private _rowElements: HTMLElement[] = [];\n private _selectionContainer: HTMLElement;\n\n public dimensions: IRenderDimensions;\n\n public get onRequestRedraw(): IEvent { return new EventEmitter().event; }\n\n constructor(\n private _colors: IColorSet,\n private readonly _element: HTMLElement,\n private readonly _screenElement: HTMLElement,\n private readonly _viewportElement: HTMLElement,\n private readonly _linkifier: ILinkifier,\n private readonly _linkifier2: ILinkifier2,\n @IInstantiationService instantiationService: IInstantiationService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n super();\n this._rowContainer = document.createElement('div');\n this._rowContainer.classList.add(ROW_CONTAINER_CLASS);\n this._rowContainer.style.lineHeight = 'normal';\n this._rowContainer.setAttribute('aria-hidden', 'true');\n this._refreshRowElements(this._bufferService.cols, this._bufferService.rows);\n this._selectionContainer = document.createElement('div');\n this._selectionContainer.classList.add(SELECTION_CLASS);\n this._selectionContainer.setAttribute('aria-hidden', 'true');\n\n this.dimensions = {\n scaledCharWidth: 0,\n scaledCharHeight: 0,\n scaledCellWidth: 0,\n scaledCellHeight: 0,\n scaledCharLeft: 0,\n scaledCharTop: 0,\n scaledCanvasWidth: 0,\n scaledCanvasHeight: 0,\n canvasWidth: 0,\n canvasHeight: 0,\n actualCellWidth: 0,\n actualCellHeight: 0\n };\n this._updateDimensions();\n this._injectCss();\n\n this._rowFactory = instantiationService.createInstance(DomRendererRowFactory, document, this._colors);\n\n this._element.classList.add(TERMINAL_CLASS_PREFIX + this._terminalClass);\n this._screenElement.appendChild(this._rowContainer);\n this._screenElement.appendChild(this._selectionContainer);\n\n this.register(this._linkifier.onShowLinkUnderline(e => this._onLinkHover(e)));\n this.register(this._linkifier.onHideLinkUnderline(e => this._onLinkLeave(e)));\n\n this.register(this._linkifier2.onShowLinkUnderline(e => this._onLinkHover(e)));\n this.register(this._linkifier2.onHideLinkUnderline(e => this._onLinkLeave(e)));\n }\n\n public dispose(): void {\n this._element.classList.remove(TERMINAL_CLASS_PREFIX + this._terminalClass);\n\n // Outside influences such as React unmounts may manipulate the DOM before our disposal.\n // https://github.com/xtermjs/xterm.js/issues/2960\n removeElementFromParent(this._rowContainer, this._selectionContainer, this._themeStyleElement, this._dimensionsStyleElement);\n\n super.dispose();\n }\n\n private _updateDimensions(): void {\n this.dimensions.scaledCharWidth = this._charSizeService.width * window.devicePixelRatio;\n this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * window.devicePixelRatio);\n this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.rawOptions.letterSpacing);\n this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.rawOptions.lineHeight);\n this.dimensions.scaledCharLeft = 0;\n this.dimensions.scaledCharTop = 0;\n this.dimensions.scaledCanvasWidth = this.dimensions.scaledCellWidth * this._bufferService.cols;\n this.dimensions.scaledCanvasHeight = this.dimensions.scaledCellHeight * this._bufferService.rows;\n this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / window.devicePixelRatio);\n this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / window.devicePixelRatio);\n this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols;\n this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows;\n\n for (const element of this._rowElements) {\n element.style.width = `${this.dimensions.canvasWidth}px`;\n element.style.height = `${this.dimensions.actualCellHeight}px`;\n element.style.lineHeight = `${this.dimensions.actualCellHeight}px`;\n // Make sure rows don't overflow onto following row\n element.style.overflow = 'hidden';\n }\n\n if (!this._dimensionsStyleElement) {\n this._dimensionsStyleElement = document.createElement('style');\n this._screenElement.appendChild(this._dimensionsStyleElement);\n }\n\n const styles =\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} span {` +\n ` display: inline-block;` +\n ` height: 100%;` +\n ` vertical-align: top;` +\n ` width: ${this.dimensions.actualCellWidth}px` +\n `}`;\n\n this._dimensionsStyleElement.textContent = styles;\n\n this._selectionContainer.style.height = this._viewportElement.style.height;\n this._screenElement.style.width = `${this.dimensions.canvasWidth}px`;\n this._screenElement.style.height = `${this.dimensions.canvasHeight}px`;\n }\n\n public setColors(colors: IColorSet): void {\n this._colors = colors;\n this._injectCss();\n }\n\n private _injectCss(): void {\n if (!this._themeStyleElement) {\n this._themeStyleElement = document.createElement('style');\n this._screenElement.appendChild(this._themeStyleElement);\n }\n\n // Base CSS\n let styles =\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} {` +\n ` color: ${this._colors.foreground.css};` +\n ` font-family: ${this._optionsService.rawOptions.fontFamily};` +\n ` font-size: ${this._optionsService.rawOptions.fontSize}px;` +\n `}`;\n // Text styles\n styles +=\n `${this._terminalSelector} span:not(.${BOLD_CLASS}) {` +\n ` font-weight: ${this._optionsService.rawOptions.fontWeight};` +\n `}` +\n `${this._terminalSelector} span.${BOLD_CLASS} {` +\n ` font-weight: ${this._optionsService.rawOptions.fontWeightBold};` +\n `}` +\n `${this._terminalSelector} span.${ITALIC_CLASS} {` +\n ` font-style: italic;` +\n `}`;\n // Blink animation\n styles +=\n `@keyframes blink_box_shadow` + `_` + this._terminalClass + ` {` +\n ` 50% {` +\n ` box-shadow: none;` +\n ` }` +\n `}`;\n styles +=\n `@keyframes blink_block` + `_` + this._terminalClass + ` {` +\n ` 0% {` +\n ` background-color: ${this._colors.cursor.css};` +\n ` color: ${this._colors.cursorAccent.css};` +\n ` }` +\n ` 50% {` +\n ` background-color: ${this._colors.cursorAccent.css};` +\n ` color: ${this._colors.cursor.css};` +\n ` }` +\n `}`;\n // Cursor\n styles +=\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}:not(.${FOCUS_CLASS}) .${CURSOR_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` outline: 1px solid ${this._colors.cursor.css};` +\n ` outline-offset: -1px;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_BLINK_CLASS}:not(.${CURSOR_STYLE_BLOCK_CLASS}) {` +\n ` animation: blink_box_shadow` + `_` + this._terminalClass + ` 1s step-end infinite;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_BLINK_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` animation: blink_block` + `_` + this._terminalClass + ` 1s step-end infinite;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` background-color: ${this._colors.cursor.css};` +\n ` color: ${this._colors.cursorAccent.css};` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_BAR_CLASS} {` +\n ` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_UNDERLINE_CLASS} {` +\n ` box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;` +\n `}`;\n // Selection\n styles +=\n `${this._terminalSelector} .${SELECTION_CLASS} {` +\n ` position: absolute;` +\n ` top: 0;` +\n ` left: 0;` +\n ` z-index: 1;` +\n ` pointer-events: none;` +\n `}` +\n `${this._terminalSelector} .${SELECTION_CLASS} div {` +\n ` position: absolute;` +\n ` background-color: ${this._colors.selectionOpaque.css};` +\n `}`;\n // Colors\n this._colors.ansi.forEach((c, i) => {\n styles +=\n `${this._terminalSelector} .${FG_CLASS_PREFIX}${i} { color: ${c.css}; }` +\n `${this._terminalSelector} .${BG_CLASS_PREFIX}${i} { background-color: ${c.css}; }`;\n });\n styles +=\n `${this._terminalSelector} .${FG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { color: ${color.opaque(this._colors.background).css}; }` +\n `${this._terminalSelector} .${BG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`;\n\n this._themeStyleElement.textContent = styles;\n }\n\n public onDevicePixelRatioChange(): void {\n this._updateDimensions();\n }\n\n private _refreshRowElements(cols: number, rows: number): void {\n // Add missing elements\n for (let i = this._rowElements.length; i <= rows; i++) {\n const row = document.createElement('div');\n this._rowContainer.appendChild(row);\n this._rowElements.push(row);\n }\n // Remove excess elements\n while (this._rowElements.length > rows) {\n this._rowContainer.removeChild(this._rowElements.pop()!);\n }\n }\n\n public onResize(cols: number, rows: number): void {\n this._refreshRowElements(cols, rows);\n this._updateDimensions();\n }\n\n public onCharSizeChanged(): void {\n this._updateDimensions();\n }\n\n public onBlur(): void {\n this._rowContainer.classList.remove(FOCUS_CLASS);\n }\n\n public onFocus(): void {\n this._rowContainer.classList.add(FOCUS_CLASS);\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n // Remove all selections\n while (this._selectionContainer.children.length) {\n this._selectionContainer.removeChild(this._selectionContainer.children[0]);\n }\n\n this._rowFactory.onSelectionChanged(start, end, columnSelectMode);\n this.renderRows(0, this._bufferService.rows - 1);\n\n // Selection does not exist\n if (!start || !end) {\n return;\n }\n\n // Translate from buffer position to viewport position\n const viewportStartRow = start[1] - this._bufferService.buffer.ydisp;\n const viewportEndRow = end[1] - this._bufferService.buffer.ydisp;\n const viewportCappedStartRow = Math.max(viewportStartRow, 0);\n const viewportCappedEndRow = Math.min(viewportEndRow, this._bufferService.rows - 1);\n\n // No need to draw the selection\n if (viewportCappedStartRow >= this._bufferService.rows || viewportCappedEndRow < 0) {\n return;\n }\n\n // Create the selections\n const documentFragment = document.createDocumentFragment();\n\n if (columnSelectMode) {\n const isXFlipped = start[0] > end[0];\n documentFragment.appendChild(\n this._createSelectionElement(viewportCappedStartRow, isXFlipped ? end[0] : start[0], isXFlipped ? start[0] : end[0], viewportCappedEndRow - viewportCappedStartRow + 1)\n );\n } else {\n // Draw first row\n const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;\n const endCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow, startCol, endCol));\n // Draw middle rows\n const middleRowsCount = viewportCappedEndRow - viewportCappedStartRow - 1;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow + 1, 0, this._bufferService.cols, middleRowsCount));\n // Draw final row\n if (viewportCappedStartRow !== viewportCappedEndRow) {\n // Only draw viewportEndRow if it's not the same as viewporttartRow\n const endCol = viewportEndRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedEndRow, 0, endCol));\n }\n }\n this._selectionContainer.appendChild(documentFragment);\n }\n\n /**\n * Creates a selection element at the specified position.\n * @param row The row of the selection.\n * @param colStart The start column.\n * @param colEnd The end columns.\n */\n private _createSelectionElement(row: number, colStart: number, colEnd: number, rowCount: number = 1): HTMLElement {\n const element = document.createElement('div');\n element.style.height = `${rowCount * this.dimensions.actualCellHeight}px`;\n element.style.top = `${row * this.dimensions.actualCellHeight}px`;\n element.style.left = `${colStart * this.dimensions.actualCellWidth}px`;\n element.style.width = `${this.dimensions.actualCellWidth * (colEnd - colStart)}px`;\n return element;\n }\n\n public onCursorMove(): void {\n // No-op, the cursor is drawn when rows are drawn\n }\n\n public onOptionsChanged(): void {\n // Force a refresh\n this._updateDimensions();\n this._injectCss();\n }\n\n public clear(): void {\n for (const e of this._rowElements) {\n e.innerText = '';\n }\n }\n\n public renderRows(start: number, end: number): void {\n const cursorAbsoluteY = this._bufferService.buffer.ybase + this._bufferService.buffer.y;\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n const cursorBlink = this._optionsService.rawOptions.cursorBlink;\n\n for (let y = start; y <= end; y++) {\n const rowElement = this._rowElements[y];\n rowElement.innerText = '';\n const row = y + this._bufferService.buffer.ydisp;\n const lineData = this._bufferService.buffer.lines.get(row);\n const cursorStyle = this._optionsService.rawOptions.cursorStyle;\n rowElement.appendChild(this._rowFactory.createRow(lineData!, row, row === cursorAbsoluteY, cursorStyle, cursorX, cursorBlink, this.dimensions.actualCellWidth, this._bufferService.cols));\n }\n }\n\n private get _terminalSelector(): string {\n return `.${TERMINAL_CLASS_PREFIX}${this._terminalClass}`;\n }\n\n private _onLinkHover(e: ILinkifierEvent): void {\n this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, true);\n }\n\n private _onLinkLeave(e: ILinkifierEvent): void {\n this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, false);\n }\n\n private _setCellUnderline(x: number, x2: number, y: number, y2: number, cols: number, enabled: boolean): void {\n while (x !== x2 || y !== y2) {\n const row = this._rowElements[y];\n if (!row) {\n return;\n }\n const span = row.children[x] as HTMLElement;\n if (span) {\n span.style.textDecoration = enabled ? 'underline' : 'none';\n }\n if (++x >= cols) {\n x = 0;\n y++;\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferLine, ICellData, IColor } from 'common/Types';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';\nimport { NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Attributes } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService, ICoreService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { color, rgba } from 'common/Color';\nimport { IColorSet } from 'browser/Types';\nimport { ICharacterJoinerService, ISelectionService } from 'browser/services/Services';\nimport { JoinedCellData } from 'browser/services/CharacterJoinerService';\nimport { excludeFromContrastRatioDemands } from 'browser/renderer/RendererUtils';\n\nexport const BOLD_CLASS = 'xterm-bold';\nexport const DIM_CLASS = 'xterm-dim';\nexport const ITALIC_CLASS = 'xterm-italic';\nexport const UNDERLINE_CLASS = 'xterm-underline';\nexport const STRIKETHROUGH_CLASS = 'xterm-strikethrough';\nexport const CURSOR_CLASS = 'xterm-cursor';\nexport const CURSOR_BLINK_CLASS = 'xterm-cursor-blink';\nexport const CURSOR_STYLE_BLOCK_CLASS = 'xterm-cursor-block';\nexport const CURSOR_STYLE_BAR_CLASS = 'xterm-cursor-bar';\nexport const CURSOR_STYLE_UNDERLINE_CLASS = 'xterm-cursor-underline';\n\nexport class DomRendererRowFactory {\n private _workCell: CellData = new CellData();\n\n private _selectionStart: [number, number] | undefined;\n private _selectionEnd: [number, number] | undefined;\n private _columnSelectMode: boolean = false;\n\n constructor(\n private readonly _document: Document,\n private _colors: IColorSet,\n @ICharacterJoinerService private readonly _characterJoinerService: ICharacterJoinerService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICoreService private readonly _coreService: ICoreService,\n @IDecorationService private readonly _decorationService: IDecorationService\n ) {\n }\n\n public setColors(colors: IColorSet): void {\n this._colors = colors;\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n this._selectionStart = start;\n this._selectionEnd = end;\n this._columnSelectMode = columnSelectMode;\n }\n\n public createRow(lineData: IBufferLine, row: number, isCursorRow: boolean, cursorStyle: string | undefined, cursorX: number, cursorBlink: boolean, cellWidth: number, cols: number): DocumentFragment {\n const fragment = this._document.createDocumentFragment();\n\n const joinedRanges = this._characterJoinerService.getJoinedCharacters(row);\n // Find the line length first, this prevents the need to output a bunch of\n // empty cells at the end. This cannot easily be integrated into the main\n // loop below because of the colCount feature (which can be removed after we\n // properly support reflow and disallow data to go beyond the right-side of\n // the viewport).\n let lineLength = 0;\n for (let x = Math.min(lineData.length, cols) - 1; x >= 0; x--) {\n if (lineData.loadCell(x, this._workCell).getCode() !== NULL_CELL_CODE || (isCursorRow && x === cursorX)) {\n lineLength = x + 1;\n break;\n }\n }\n\n for (let x = 0; x < lineLength; x++) {\n lineData.loadCell(x, this._workCell);\n let width = this._workCell.getWidth();\n\n // The character to the left is a wide character, drawing is owned by the char at x-1\n if (width === 0) {\n continue;\n }\n\n // If true, indicates that the current character(s) to draw were joined.\n let isJoined = false;\n let lastCharX = x;\n\n // Process any joined character ranges as needed. Because of how the\n // ranges are produced, we know that they are valid for the characters\n // and attributes of our input.\n let cell = this._workCell;\n if (joinedRanges.length > 0 && x === joinedRanges[0][0]) {\n isJoined = true;\n const range = joinedRanges.shift()!;\n\n // We already know the exact start and end column of the joined range,\n // so we get the string and width representing it directly\n cell = new JoinedCellData(\n this._workCell,\n lineData.translateToString(true, range[0], range[1]),\n range[1] - range[0]\n );\n\n // Skip over the cells occupied by this range in the loop\n lastCharX = range[1] - 1;\n\n // Recalculate width\n width = cell.getWidth();\n }\n\n const charElement = this._document.createElement('span');\n if (width > 1) {\n charElement.style.width = `${cellWidth * width}px`;\n }\n\n if (isJoined) {\n // Ligatures in the DOM renderer must use display inline, as they may not show with\n // inline-block if they are outside the bounds of the element\n charElement.style.display = 'inline';\n\n // The DOM renderer colors the background of the cursor but for ligatures all cells are\n // joined. The workaround here is to show a cursor around the whole ligature so it shows up,\n // the cursor looks the same when on any character of the ligature though\n if (cursorX >= x && cursorX <= lastCharX) {\n cursorX = x;\n }\n }\n\n if (!this._coreService.isCursorHidden && isCursorRow && x === cursorX) {\n charElement.classList.add(CURSOR_CLASS);\n\n if (cursorBlink) {\n charElement.classList.add(CURSOR_BLINK_CLASS);\n }\n\n switch (cursorStyle) {\n case 'bar':\n charElement.classList.add(CURSOR_STYLE_BAR_CLASS);\n break;\n case 'underline':\n charElement.classList.add(CURSOR_STYLE_UNDERLINE_CLASS);\n break;\n default:\n charElement.classList.add(CURSOR_STYLE_BLOCK_CLASS);\n break;\n }\n }\n\n if (cell.isBold()) {\n charElement.classList.add(BOLD_CLASS);\n }\n\n if (cell.isItalic()) {\n charElement.classList.add(ITALIC_CLASS);\n }\n\n if (cell.isDim()) {\n charElement.classList.add(DIM_CLASS);\n }\n\n if (cell.isUnderline()) {\n charElement.classList.add(UNDERLINE_CLASS);\n }\n\n if (cell.isInvisible()) {\n charElement.textContent = WHITESPACE_CELL_CHAR;\n } else {\n charElement.textContent = cell.getChars() || WHITESPACE_CELL_CHAR;\n }\n\n if (cell.isStrikethrough()) {\n charElement.classList.add(STRIKETHROUGH_CLASS);\n }\n\n let fg = cell.getFgColor();\n let fgColorMode = cell.getFgColorMode();\n let bg = cell.getBgColor();\n let bgColorMode = cell.getBgColorMode();\n const isInverse = !!cell.isInverse();\n if (isInverse) {\n const temp = fg;\n fg = bg;\n bg = temp;\n const temp2 = fgColorMode;\n fgColorMode = bgColorMode;\n bgColorMode = temp2;\n }\n\n // Apply any decoration foreground/background overrides, this must happen after inverse has\n // been applied\n let bgOverride: IColor | undefined;\n let fgOverride: IColor | undefined;\n let isTop = false;\n for (const d of this._decorationService.getDecorationsAtCell(x, row)) {\n if (d.options.layer !== 'top' && isTop) {\n continue;\n }\n if (d.backgroundColorRGB) {\n bgColorMode = Attributes.CM_RGB;\n bg = d.backgroundColorRGB.rgba >> 8 & 0xFFFFFF;\n bgOverride = d.backgroundColorRGB;\n }\n if (d.foregroundColorRGB) {\n fgColorMode = Attributes.CM_RGB;\n fg = d.foregroundColorRGB.rgba >> 8 & 0xFFFFFF;\n fgOverride = d.foregroundColorRGB;\n }\n isTop = d.options.layer === 'top';\n }\n\n // Apply selection foreground if applicable\n const isInSelection = this._isCellInSelection(x, row);\n if (!isTop) {\n if (this._colors.selectionForeground && isInSelection) {\n fgColorMode = Attributes.CM_RGB;\n fg = this._colors.selectionForeground.rgba >> 8 & 0xFFFFFF;\n fgOverride = this._colors.selectionForeground;\n }\n }\n\n // If in the selection, force the element to be above the selection to improve contrast and\n // support opaque selections\n if (isInSelection) {\n bgOverride = this._colors.selectionOpaque;\n isTop = true;\n }\n\n // If it's a top decoration, render above the selection\n if (isTop) {\n charElement.classList.add(`xterm-decoration-top`);\n }\n\n // Background\n let resolvedBg: IColor;\n switch (bgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n resolvedBg = this._colors.ansi[bg];\n charElement.classList.add(`xterm-bg-${bg}`);\n break;\n case Attributes.CM_RGB:\n resolvedBg = rgba.toColor(bg >> 16, bg >> 8 & 0xFF, bg & 0xFF);\n this._addStyle(charElement, `background-color:#${padStart((bg >>> 0).toString(16), '0', 6)}`);\n break;\n case Attributes.CM_DEFAULT:\n default:\n if (isInverse) {\n resolvedBg = this._colors.foreground;\n charElement.classList.add(`xterm-bg-${INVERTED_DEFAULT_COLOR}`);\n } else {\n resolvedBg = this._colors.background;\n }\n }\n\n // Foreground\n switch (fgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n if (cell.isBold() && fg < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors) {\n fg += 8;\n }\n if (!this._applyMinimumContrast(charElement, resolvedBg, this._colors.ansi[fg], cell, bgOverride, undefined)) {\n charElement.classList.add(`xterm-fg-${fg}`);\n }\n break;\n case Attributes.CM_RGB:\n const color = rgba.toColor(\n (fg >> 16) & 0xFF,\n (fg >> 8) & 0xFF,\n (fg ) & 0xFF\n );\n if (!this._applyMinimumContrast(charElement, resolvedBg, color, cell, bgOverride, fgOverride)) {\n this._addStyle(charElement, `color:#${padStart(fg.toString(16), '0', 6)}`);\n }\n break;\n case Attributes.CM_DEFAULT:\n default:\n if (!this._applyMinimumContrast(charElement, resolvedBg, this._colors.foreground, cell, bgOverride, undefined)) {\n if (isInverse) {\n charElement.classList.add(`xterm-fg-${INVERTED_DEFAULT_COLOR}`);\n }\n }\n }\n\n fragment.appendChild(charElement);\n\n x = lastCharX;\n }\n return fragment;\n }\n\n private _applyMinimumContrast(element: HTMLElement, bg: IColor, fg: IColor, cell: ICellData, bgOverride: IColor | undefined, fgOverride: IColor | undefined): boolean {\n if (this._optionsService.rawOptions.minimumContrastRatio === 1 || excludeFromContrastRatioDemands(cell.getCode())) {\n return false;\n }\n\n // Try get from cache first, only use the cache when there are no decoration overrides\n let adjustedColor: IColor | undefined | null = undefined;\n if (!bgOverride && !fgOverride) {\n adjustedColor = this._colors.contrastCache.getColor(bg.rgba, fg.rgba);\n }\n\n // Calculate and store in cache\n if (adjustedColor === undefined) {\n adjustedColor = color.ensureContrastRatio(bgOverride || bg, fgOverride || fg, this._optionsService.rawOptions.minimumContrastRatio);\n this._colors.contrastCache.setColor((bgOverride || bg).rgba, (fgOverride || fg).rgba, adjustedColor ?? null);\n }\n\n if (adjustedColor) {\n this._addStyle(element, `color:${adjustedColor.css}`);\n return true;\n }\n\n return false;\n }\n\n private _addStyle(element: HTMLElement, style: string): void {\n element.setAttribute('style', `${element.getAttribute('style') || ''}${style};`);\n }\n\n private _isCellInSelection(x: number, y: number): boolean {\n const start = this._selectionStart;\n const end = this._selectionEnd;\n if (!start || !end) {\n return false;\n }\n if (this._columnSelectMode) {\n if (start[0] <= end[0]) {\n return x >= start[0] && y >= start[1] &&\n x < end[0] && y <= end[1];\n }\n return x < start[0] && y >= start[1] &&\n x >= end[0] && y <= end[1];\n }\n return (y > start[1] && y < end[1]) ||\n (start[1] === end[1] && y === start[1] && x >= start[0] && x < end[0]) ||\n (start[1] < end[1] && y === end[1] && x < end[0]) ||\n (start[1] < end[1] && y === start[1] && x >= start[0]);\n }\n}\n\nfunction padStart(text: string, padChar: string, length: number): string {\n while (text.length < length) {\n text = padChar + text;\n }\n return text;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferService } from 'common/services/Services';\n\n/**\n * Represents a selection within the buffer. This model only cares about column\n * and row coordinates, not wide characters.\n */\nexport class SelectionModel {\n /**\n * Whether select all is currently active.\n */\n public isSelectAllActive: boolean = false;\n\n /**\n * The minimal length of the selection from the start position. When double\n * clicking on a word, the word will be selected which makes the selection\n * start at the start of the word and makes this variable the length.\n */\n public selectionStartLength: number = 0;\n\n /**\n * The [x, y] position the selection starts at.\n */\n public selectionStart: [number, number] | undefined;\n\n /**\n * The [x, y] position the selection ends at.\n */\n public selectionEnd: [number, number] | undefined;\n\n constructor(\n private _bufferService: IBufferService\n ) {\n }\n\n /**\n * Clears the current selection.\n */\n public clearSelection(): void {\n this.selectionStart = undefined;\n this.selectionEnd = undefined;\n this.isSelectAllActive = false;\n this.selectionStartLength = 0;\n }\n\n /**\n * The final selection start, taking into consideration select all.\n */\n public get finalSelectionStart(): [number, number] | undefined {\n if (this.isSelectAllActive) {\n return [0, 0];\n }\n\n if (!this.selectionEnd || !this.selectionStart) {\n return this.selectionStart;\n }\n\n return this.areSelectionValuesReversed() ? this.selectionEnd : this.selectionStart;\n }\n\n /**\n * The final selection end, taking into consideration select all, double click\n * word selection and triple click line selection.\n */\n public get finalSelectionEnd(): [number, number] | undefined {\n if (this.isSelectAllActive) {\n return [this._bufferService.cols, this._bufferService.buffer.ybase + this._bufferService.rows - 1];\n }\n\n if (!this.selectionStart) {\n return undefined;\n }\n\n // Use the selection start + length if the end doesn't exist or they're reversed\n if (!this.selectionEnd || this.areSelectionValuesReversed()) {\n const startPlusLength = this.selectionStart[0] + this.selectionStartLength;\n if (startPlusLength > this._bufferService.cols) {\n // Ensure the trailing EOL isn't included when the selection ends on the right edge\n if (startPlusLength % this._bufferService.cols === 0) {\n return [this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols) - 1];\n }\n return [startPlusLength % this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols)];\n }\n return [startPlusLength, this.selectionStart[1]];\n }\n\n // Ensure the the word/line is selected after a double/triple click\n if (this.selectionStartLength) {\n // Select the larger of the two when start and end are on the same line\n if (this.selectionEnd[1] === this.selectionStart[1]) {\n // Keep the whole wrapped word/line selected if the content wraps multiple lines\n const startPlusLength = this.selectionStart[0] + this.selectionStartLength;\n if (startPlusLength > this._bufferService.cols) {\n return [startPlusLength % this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols)];\n }\n return [Math.max(startPlusLength, this.selectionEnd[0]), this.selectionEnd[1]];\n }\n }\n return this.selectionEnd;\n }\n\n /**\n * Returns whether the selection start and end are reversed.\n */\n public areSelectionValuesReversed(): boolean {\n const start = this.selectionStart;\n const end = this.selectionEnd;\n if (!start || !end) {\n return false;\n }\n return start[1] > end[1] || (start[1] === end[1] && start[0] > end[0]);\n }\n\n /**\n * Handle the buffer being trimmed, adjust the selection position.\n * @param amount The amount the buffer is being trimmed.\n * @return Whether a refresh is necessary.\n */\n public onTrim(amount: number): boolean {\n // Adjust the selection position based on the trimmed amount.\n if (this.selectionStart) {\n this.selectionStart[1] -= amount;\n }\n if (this.selectionEnd) {\n this.selectionEnd[1] -= amount;\n }\n\n // The selection has moved off the buffer, clear it.\n if (this.selectionEnd && this.selectionEnd[1] < 0) {\n this.clearSelection();\n return true;\n }\n\n // If the selection start is trimmed, ensure the start column is 0.\n if (this.selectionStart && this.selectionStart[1] < 0) {\n this.selectionStart[1] = 0;\n }\n return false;\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOptionsService } from 'common/services/Services';\nimport { IEvent, EventEmitter } from 'common/EventEmitter';\nimport { ICharSizeService } from 'browser/services/Services';\n\nexport class CharSizeService implements ICharSizeService {\n public serviceBrand: undefined;\n\n public width: number = 0;\n public height: number = 0;\n private _measureStrategy: IMeasureStrategy;\n\n public get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }\n\n private _onCharSizeChange = new EventEmitter();\n public get onCharSizeChange(): IEvent { return this._onCharSizeChange.event; }\n\n constructor(\n document: Document,\n parentElement: HTMLElement,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n this._measureStrategy = new DomMeasureStrategy(document, parentElement, this._optionsService);\n }\n\n public measure(): void {\n const result = this._measureStrategy.measure();\n if (result.width !== this.width || result.height !== this.height) {\n this.width = result.width;\n this.height = result.height;\n this._onCharSizeChange.fire();\n }\n }\n}\n\ninterface IMeasureStrategy {\n measure(): IReadonlyMeasureResult;\n}\n\ninterface IReadonlyMeasureResult {\n readonly width: number;\n readonly height: number;\n}\n\ninterface IMeasureResult {\n width: number;\n height: number;\n}\n\n// TODO: For supporting browsers we should also provide a CanvasCharDimensionsProvider that uses ctx.measureText\nclass DomMeasureStrategy implements IMeasureStrategy {\n private _result: IMeasureResult = { width: 0, height: 0 };\n private _measureElement: HTMLElement;\n\n constructor(\n private _document: Document,\n private _parentElement: HTMLElement,\n private _optionsService: IOptionsService\n ) {\n this._measureElement = this._document.createElement('span');\n this._measureElement.classList.add('xterm-char-measure-element');\n this._measureElement.textContent = 'W';\n this._measureElement.setAttribute('aria-hidden', 'true');\n this._parentElement.appendChild(this._measureElement);\n }\n\n public measure(): IReadonlyMeasureResult {\n this._measureElement.style.fontFamily = this._optionsService.rawOptions.fontFamily;\n this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`;\n\n // Note that this triggers a synchronous layout\n const geometry = this._measureElement.getBoundingClientRect();\n\n // If values are 0 then the element is likely currently display:none, in which case we should\n // retain the previous value.\n if (geometry.width !== 0 && geometry.height !== 0) {\n this._result.width = geometry.width;\n this._result.height = Math.ceil(geometry.height);\n }\n\n return this._result;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferLine, ICellData, CharData } from 'common/Types';\nimport { ICharacterJoiner } from 'browser/Types';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { WHITESPACE_CELL_CHAR, Content } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService } from 'common/services/Services';\nimport { ICharacterJoinerService } from 'browser/services/Services';\n\nexport class JoinedCellData extends AttributeData implements ICellData {\n private _width: number;\n // .content carries no meaning for joined CellData, simply nullify it\n // thus we have to overload all other .content accessors\n public content: number = 0;\n public fg: number;\n public bg: number;\n public combinedData: string = '';\n\n constructor(firstCell: ICellData, chars: string, width: number) {\n super();\n this.fg = firstCell.fg;\n this.bg = firstCell.bg;\n this.combinedData = chars;\n this._width = width;\n }\n\n public isCombined(): number {\n // always mark joined cell data as combined\n return Content.IS_COMBINED_MASK;\n }\n\n public getWidth(): number {\n return this._width;\n }\n\n public getChars(): string {\n return this.combinedData;\n }\n\n public getCode(): number {\n // code always gets the highest possible fake codepoint (read as -1)\n // this is needed as code is used by caches as identifier\n return 0x1FFFFF;\n }\n\n public setFromCharData(value: CharData): void {\n throw new Error('not implemented');\n }\n\n public getAsCharData(): CharData {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }\n}\n\nexport class CharacterJoinerService implements ICharacterJoinerService {\n public serviceBrand: undefined;\n\n private _characterJoiners: ICharacterJoiner[] = [];\n private _nextCharacterJoinerId: number = 0;\n private _workCell: CellData = new CellData();\n\n constructor(\n @IBufferService private _bufferService: IBufferService\n ) { }\n\n public register(handler: (text: string) => [number, number][]): number {\n const joiner: ICharacterJoiner = {\n id: this._nextCharacterJoinerId++,\n handler\n };\n\n this._characterJoiners.push(joiner);\n return joiner.id;\n }\n\n public deregister(joinerId: number): boolean {\n for (let i = 0; i < this._characterJoiners.length; i++) {\n if (this._characterJoiners[i].id === joinerId) {\n this._characterJoiners.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n public getJoinedCharacters(row: number): [number, number][] {\n if (this._characterJoiners.length === 0) {\n return [];\n }\n\n const line = this._bufferService.buffer.lines.get(row);\n if (!line || line.length === 0) {\n return [];\n }\n\n const ranges: [number, number][] = [];\n const lineStr = line.translateToString(true);\n\n // Because some cells can be represented by multiple javascript characters,\n // we track the cell and the string indexes separately. This allows us to\n // translate the string ranges we get from the joiners back into cell ranges\n // for use when rendering\n let rangeStartColumn = 0;\n let currentStringIndex = 0;\n let rangeStartStringIndex = 0;\n let rangeAttrFG = line.getFg(0);\n let rangeAttrBG = line.getBg(0);\n\n for (let x = 0; x < line.getTrimmedLength(); x++) {\n line.loadCell(x, this._workCell);\n\n if (this._workCell.getWidth() === 0) {\n // If this character is of width 0, skip it.\n continue;\n }\n\n // End of range\n if (this._workCell.fg !== rangeAttrFG || this._workCell.bg !== rangeAttrBG) {\n // If we ended up with a sequence of more than one character,\n // look for ranges to join.\n if (x - rangeStartColumn > 1) {\n const joinedRanges = this._getJoinedRanges(\n lineStr,\n rangeStartStringIndex,\n currentStringIndex,\n line,\n rangeStartColumn\n );\n for (let i = 0; i < joinedRanges.length; i++) {\n ranges.push(joinedRanges[i]);\n }\n }\n\n // Reset our markers for a new range.\n rangeStartColumn = x;\n rangeStartStringIndex = currentStringIndex;\n rangeAttrFG = this._workCell.fg;\n rangeAttrBG = this._workCell.bg;\n }\n\n currentStringIndex += this._workCell.getChars().length || WHITESPACE_CELL_CHAR.length;\n }\n\n // Process any trailing ranges.\n if (this._bufferService.cols - rangeStartColumn > 1) {\n const joinedRanges = this._getJoinedRanges(\n lineStr,\n rangeStartStringIndex,\n currentStringIndex,\n line,\n rangeStartColumn\n );\n for (let i = 0; i < joinedRanges.length; i++) {\n ranges.push(joinedRanges[i]);\n }\n }\n\n return ranges;\n }\n\n /**\n * Given a segment of a line of text, find all ranges of text that should be\n * joined in a single rendering unit. Ranges are internally converted to\n * column ranges, rather than string ranges.\n * @param line String representation of the full line of text\n * @param startIndex Start position of the range to search in the string (inclusive)\n * @param endIndex End position of the range to search in the string (exclusive)\n */\n private _getJoinedRanges(line: string, startIndex: number, endIndex: number, lineData: IBufferLine, startCol: number): [number, number][] {\n const text = line.substring(startIndex, endIndex);\n // At this point we already know that there is at least one joiner so\n // we can just pull its value and assign it directly rather than\n // merging it into an empty array, which incurs unnecessary writes.\n let allJoinedRanges: [number, number][] = [];\n try {\n allJoinedRanges = this._characterJoiners[0].handler(text);\n } catch (error) {\n console.error(error);\n }\n for (let i = 1; i < this._characterJoiners.length; i++) {\n // We merge any overlapping ranges across the different joiners\n try {\n const joinerRanges = this._characterJoiners[i].handler(text);\n for (let j = 0; j < joinerRanges.length; j++) {\n CharacterJoinerService._mergeRanges(allJoinedRanges, joinerRanges[j]);\n }\n } catch (error) {\n console.error(error);\n }\n }\n this._stringRangesToCellRanges(allJoinedRanges, lineData, startCol);\n return allJoinedRanges;\n }\n\n /**\n * Modifies the provided ranges in-place to adjust for variations between\n * string length and cell width so that the range represents a cell range,\n * rather than the string range the joiner provides.\n * @param ranges String ranges containing start (inclusive) and end (exclusive) index\n * @param line Cell data for the relevant line in the terminal\n * @param startCol Offset within the line to start from\n */\n private _stringRangesToCellRanges(ranges: [number, number][], line: IBufferLine, startCol: number): void {\n let currentRangeIndex = 0;\n let currentRangeStarted = false;\n let currentStringIndex = 0;\n let currentRange = ranges[currentRangeIndex];\n\n // If we got through all of the ranges, stop searching\n if (!currentRange) {\n return;\n }\n\n for (let x = startCol; x < this._bufferService.cols; x++) {\n const width = line.getWidth(x);\n const length = line.getString(x).length || WHITESPACE_CELL_CHAR.length;\n\n // We skip zero-width characters when creating the string to join the text\n // so we do the same here\n if (width === 0) {\n continue;\n }\n\n // Adjust the start of the range\n if (!currentRangeStarted && currentRange[0] <= currentStringIndex) {\n currentRange[0] = x;\n currentRangeStarted = true;\n }\n\n // Adjust the end of the range\n if (currentRange[1] <= currentStringIndex) {\n currentRange[1] = x;\n\n // We're finished with this range, so we move to the next one\n currentRange = ranges[++currentRangeIndex];\n\n // If there are no more ranges left, stop searching\n if (!currentRange) {\n break;\n }\n\n // Ranges can be on adjacent characters. Because the end index of the\n // ranges are exclusive, this means that the index for the start of a\n // range can be the same as the end index of the previous range. To\n // account for the start of the next range, we check here just in case.\n if (currentRange[0] <= currentStringIndex) {\n currentRange[0] = x;\n currentRangeStarted = true;\n } else {\n currentRangeStarted = false;\n }\n }\n\n // Adjust the string index based on the character length to line up with\n // the column adjustment\n currentStringIndex += length;\n }\n\n // If there is still a range left at the end, it must extend all the way to\n // the end of the line.\n if (currentRange) {\n currentRange[1] = this._bufferService.cols;\n }\n }\n\n /**\n * Merges the range defined by the provided start and end into the list of\n * existing ranges. The merge is done in place on the existing range for\n * performance and is also returned.\n * @param ranges Existing range list\n * @param newRange Tuple of two numbers representing the new range to merge in.\n * @returns The ranges input with the new range merged in place\n */\n private static _mergeRanges(ranges: [number, number][], newRange: [number, number]): [number, number][] {\n let inRange = false;\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n if (!inRange) {\n if (newRange[1] <= range[0]) {\n // Case 1: New range is before the search range\n ranges.splice(i, 0, newRange);\n return ranges;\n }\n\n if (newRange[1] <= range[1]) {\n // Case 2: New range is either wholly contained within the\n // search range or overlaps with the front of it\n range[0] = Math.min(newRange[0], range[0]);\n return ranges;\n }\n\n if (newRange[0] < range[1]) {\n // Case 3: New range either wholly contains the search range\n // or overlaps with the end of it\n range[0] = Math.min(newRange[0], range[0]);\n inRange = true;\n }\n\n // Case 4: New range starts after the search range\n continue;\n } else {\n if (newRange[1] <= range[0]) {\n // Case 5: New range extends from previous range but doesn't\n // reach the current one\n ranges[i - 1][1] = newRange[1];\n return ranges;\n }\n\n if (newRange[1] <= range[1]) {\n // Case 6: New range extends from prvious range into the\n // current range\n ranges[i - 1][1] = Math.max(newRange[1], range[1]);\n ranges.splice(i, 1);\n return ranges;\n }\n\n // Case 7: New range extends from previous range past the\n // end of the current range\n ranges.splice(i, 1);\n i--;\n }\n }\n\n if (inRange) {\n // Case 8: New range extends past the last existing range\n ranges[ranges.length - 1][1] = newRange[1];\n } else {\n // Case 9: New range starts after the last existing range\n ranges.push(newRange);\n }\n\n return ranges;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreBrowserService } from './Services';\n\nexport class CoreBrowserService implements ICoreBrowserService {\n public serviceBrand: undefined;\n\n constructor(\n private _textarea: HTMLTextAreaElement\n ) {\n }\n\n public get isFocused(): boolean {\n const docOrShadowRoot = this._textarea.getRootNode ? this._textarea.getRootNode() as Document | ShadowRoot : document;\n return docOrShadowRoot.activeElement === this._textarea && document.hasFocus();\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharSizeService, IRenderService, IMouseService } from './Services';\nimport { getCoords, getRawByteCoords } from 'browser/input/Mouse';\n\nexport class MouseService implements IMouseService {\n public serviceBrand: undefined;\n\n constructor(\n @IRenderService private readonly _renderService: IRenderService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService\n ) {\n }\n\n public getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined {\n return getCoords(\n window,\n event,\n element,\n colCount,\n rowCount,\n this._charSizeService.hasValidSize,\n this._renderService.dimensions.actualCellWidth,\n this._renderService.dimensions.actualCellHeight,\n isSelection\n );\n }\n\n public getRawByteCoords(event: MouseEvent, element: HTMLElement, colCount: number, rowCount: number): { x: number, y: number } | undefined {\n const coords = this.getCoords(event, element, colCount, rowCount);\n return getRawByteCoords(coords);\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderer, IRenderDimensions } from 'browser/renderer/Types';\nimport { RenderDebouncer } from 'browser/RenderDebouncer';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { ScreenDprMonitor } from 'browser/ScreenDprMonitor';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IColorSet, IRenderDebouncer, IRenderDebouncerWithCallback } from 'browser/Types';\nimport { IOptionsService, IBufferService, IDecorationService } from 'common/services/Services';\nimport { ICharSizeService, IRenderService } from 'browser/services/Services';\n\ninterface ISelectionState {\n start: [number, number] | undefined;\n end: [number, number] | undefined;\n columnSelectMode: boolean;\n}\n\nexport class RenderService extends Disposable implements IRenderService {\n public serviceBrand: undefined;\n\n private _renderDebouncer: IRenderDebouncerWithCallback;\n private _screenDprMonitor: ScreenDprMonitor;\n\n private _isPaused: boolean = false;\n private _needsFullRefresh: boolean = false;\n private _isNextRenderRedrawOnly: boolean = true;\n private _needsSelectionRefresh: boolean = false;\n private _canvasWidth: number = 0;\n private _canvasHeight: number = 0;\n private _selectionState: ISelectionState = {\n start: undefined,\n end: undefined,\n columnSelectMode: false\n };\n\n private _onDimensionsChange = new EventEmitter();\n public get onDimensionsChange(): IEvent { return this._onDimensionsChange.event; }\n private _onRenderedViewportChange = new EventEmitter<{ start: number, end: number }>();\n public get onRenderedViewportChange(): IEvent<{ start: number, end: number }> { return this._onRenderedViewportChange.event; }\n private _onRender = new EventEmitter<{ start: number, end: number }>();\n public get onRender(): IEvent<{ start: number, end: number }> { return this._onRender.event; }\n private _onRefreshRequest = new EventEmitter<{ start: number, end: number }>();\n public get onRefreshRequest(): IEvent<{ start: number, end: number }> { return this._onRefreshRequest.event; }\n\n public get dimensions(): IRenderDimensions { return this._renderer.dimensions; }\n\n constructor(\n private _renderer: IRenderer,\n private _rowCount: number,\n screenElement: HTMLElement,\n @IOptionsService optionsService: IOptionsService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IDecorationService decorationService: IDecorationService,\n @IBufferService bufferService: IBufferService\n ) {\n super();\n\n this.register({ dispose: () => this._renderer.dispose() });\n\n this._renderDebouncer = new RenderDebouncer((start, end) => this._renderRows(start, end));\n this.register(this._renderDebouncer);\n\n this._screenDprMonitor = new ScreenDprMonitor();\n this._screenDprMonitor.setListener(() => this.onDevicePixelRatioChange());\n this.register(this._screenDprMonitor);\n\n this.register(bufferService.onResize(() => this._fullRefresh()));\n this.register(bufferService.buffers.onBufferActivate(() => this._renderer?.clear()));\n this.register(optionsService.onOptionChange(() => this._handleOptionsChanged()));\n this.register(this._charSizeService.onCharSizeChange(() => this.onCharSizeChanged()));\n\n // Do a full refresh whenever any decoration is added or removed. This may not actually result\n // in changes but since decorations should be used sparingly or added/removed all in the same\n // frame this should have minimal performance impact.\n this.register(decorationService.onDecorationRegistered(() => this._fullRefresh()));\n this.register(decorationService.onDecorationRemoved(() => this._fullRefresh()));\n\n // No need to register this as renderer is explicitly disposed in RenderService.dispose\n this._renderer.onRequestRedraw(e => this.refreshRows(e.start, e.end, true));\n\n // dprchange should handle this case, we need this as well for browsers that don't support the\n // matchMedia query.\n this.register(addDisposableDomListener(window, 'resize', () => this.onDevicePixelRatioChange()));\n\n // Detect whether IntersectionObserver is detected and enable renderer pause\n // and resume based on terminal visibility if so\n if ('IntersectionObserver' in window) {\n const observer = new IntersectionObserver(e => this._onIntersectionChange(e[e.length - 1]), { threshold: 0 });\n observer.observe(screenElement);\n this.register({ dispose: () => observer.disconnect() });\n }\n }\n\n private _onIntersectionChange(entry: IntersectionObserverEntry): void {\n this._isPaused = entry.isIntersecting === undefined ? (entry.intersectionRatio === 0) : !entry.isIntersecting;\n\n // Terminal was hidden on open\n if (!this._isPaused && !this._charSizeService.hasValidSize) {\n this._charSizeService.measure();\n }\n\n if (!this._isPaused && this._needsFullRefresh) {\n this.refreshRows(0, this._rowCount - 1);\n this._needsFullRefresh = false;\n }\n }\n\n public refreshRows(start: number, end: number, isRedrawOnly: boolean = false): void {\n if (this._isPaused) {\n this._needsFullRefresh = true;\n return;\n }\n if (!isRedrawOnly) {\n this._isNextRenderRedrawOnly = false;\n }\n this._renderDebouncer.refresh(start, end, this._rowCount);\n }\n\n private _renderRows(start: number, end: number): void {\n this._renderer.renderRows(start, end);\n\n // Update selection if needed\n if (this._needsSelectionRefresh) {\n this._renderer.onSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode);\n this._needsSelectionRefresh = false;\n }\n\n // Fire render event only if it was not a redraw\n if (!this._isNextRenderRedrawOnly) {\n this._onRenderedViewportChange.fire({ start, end });\n }\n this._onRender.fire({ start, end });\n this._isNextRenderRedrawOnly = true;\n }\n\n public resize(cols: number, rows: number): void {\n this._rowCount = rows;\n this._fireOnCanvasResize();\n }\n\n private _handleOptionsChanged(): void {\n this._renderer.onOptionsChanged();\n this.refreshRows(0, this._rowCount - 1);\n this._fireOnCanvasResize();\n }\n\n private _fireOnCanvasResize(): void {\n // Don't fire the event if the dimensions haven't changed\n if (this._renderer.dimensions.canvasWidth === this._canvasWidth && this._renderer.dimensions.canvasHeight === this._canvasHeight) {\n return;\n }\n this._onDimensionsChange.fire(this._renderer.dimensions);\n }\n\n public dispose(): void {\n super.dispose();\n }\n\n public setRenderer(renderer: IRenderer): void {\n // TODO: RenderService should be the only one to dispose the renderer\n this._renderer.dispose();\n this._renderer = renderer;\n this._renderer.onRequestRedraw(e => this.refreshRows(e.start, e.end, true));\n\n // Force a refresh\n this._needsSelectionRefresh = true;\n this._fullRefresh();\n }\n\n public addRefreshCallback(callback: FrameRequestCallback): number {\n return this._renderDebouncer.addRefreshCallback(callback);\n }\n\n private _fullRefresh(): void {\n if (this._isPaused) {\n this._needsFullRefresh = true;\n } else {\n this.refreshRows(0, this._rowCount - 1);\n }\n }\n\n public clearTextureAtlas(): void {\n this._renderer?.clearTextureAtlas?.();\n this._fullRefresh();\n }\n\n public setColors(colors: IColorSet): void {\n this._renderer.setColors(colors);\n this._fullRefresh();\n }\n\n public onDevicePixelRatioChange(): void {\n // Force char size measurement as DomMeasureStrategy(getBoundingClientRect) is not stable\n // when devicePixelRatio changes\n this._charSizeService.measure();\n\n this._renderer.onDevicePixelRatioChange();\n this.refreshRows(0, this._rowCount - 1);\n }\n\n public onResize(cols: number, rows: number): void {\n this._renderer.onResize(cols, rows);\n this._fullRefresh();\n }\n\n // TODO: Is this useful when we have onResize?\n public onCharSizeChanged(): void {\n this._renderer.onCharSizeChanged();\n }\n\n public onBlur(): void {\n this._renderer.onBlur();\n }\n\n public onFocus(): void {\n this._renderer.onFocus();\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n this._selectionState.start = start;\n this._selectionState.end = end;\n this._selectionState.columnSelectMode = columnSelectMode;\n this._renderer.onSelectionChanged(start, end, columnSelectMode);\n }\n\n public onCursorMove(): void {\n this._renderer.onCursorMove();\n }\n\n public clear(): void {\n this._renderer.clear();\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ISelectionRedrawRequestEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types';\nimport { IBuffer } from 'common/buffer/Types';\nimport { IBufferLine, IDisposable } from 'common/Types';\nimport * as Browser from 'common/Platform';\nimport { SelectionModel } from 'browser/selection/SelectionModel';\nimport { CellData } from 'common/buffer/CellData';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IMouseService, ISelectionService, IRenderService } from 'browser/services/Services';\nimport { IBufferRange, ILinkifier2 } from 'browser/Types';\nimport { IBufferService, IOptionsService, ICoreService } from 'common/services/Services';\nimport { getCoordsRelativeToElement } from 'browser/input/Mouse';\nimport { moveToCellSequence } from 'browser/input/MoveToCell';\nimport { Disposable } from 'common/Lifecycle';\nimport { getRangeLength } from 'common/buffer/BufferRange';\n\n/**\n * The number of pixels the mouse needs to be above or below the viewport in\n * order to scroll at the maximum speed.\n */\nconst DRAG_SCROLL_MAX_THRESHOLD = 50;\n\n/**\n * The maximum scrolling speed\n */\nconst DRAG_SCROLL_MAX_SPEED = 15;\n\n/**\n * The number of milliseconds between drag scroll updates.\n */\nconst DRAG_SCROLL_INTERVAL = 50;\n\n/**\n * The maximum amount of time that can have elapsed for an alt click to move the\n * cursor.\n */\nconst ALT_CLICK_MOVE_CURSOR_TIME = 500;\n\nconst NON_BREAKING_SPACE_CHAR = String.fromCharCode(160);\nconst ALL_NON_BREAKING_SPACE_REGEX = new RegExp(NON_BREAKING_SPACE_CHAR, 'g');\n\n/**\n * Represents a position of a word on a line.\n */\ninterface IWordPosition {\n start: number;\n length: number;\n}\n\n/**\n * A selection mode, this drives how the selection behaves on mouse move.\n */\nexport const enum SelectionMode {\n NORMAL,\n WORD,\n LINE,\n COLUMN\n}\n\n/**\n * A class that manages the selection of the terminal. With help from\n * SelectionModel, SelectionService handles with all logic associated with\n * dealing with the selection, including handling mouse interaction, wide\n * characters and fetching the actual text within the selection. Rendering is\n * not handled by the SelectionService but the onRedrawRequest event is fired\n * when the selection is ready to be redrawn (on an animation frame).\n */\nexport class SelectionService extends Disposable implements ISelectionService {\n public serviceBrand: undefined;\n\n protected _model: SelectionModel;\n\n /**\n * The amount to scroll every drag scroll update (depends on how far the mouse\n * drag is above or below the terminal).\n */\n private _dragScrollAmount: number = 0;\n\n /**\n * The current selection mode.\n */\n protected _activeSelectionMode: SelectionMode;\n\n /**\n * A setInterval timer that is active while the mouse is down whose callback\n * scrolls the viewport when necessary.\n */\n private _dragScrollIntervalTimer: number | undefined;\n\n /**\n * The animation frame ID used for refreshing the selection.\n */\n private _refreshAnimationFrame: number | undefined;\n\n /**\n * Whether selection is enabled.\n */\n private _enabled = true;\n\n private _mouseMoveListener: EventListener;\n private _mouseUpListener: EventListener;\n private _trimListener: IDisposable;\n private _workCell: CellData = new CellData();\n\n private _mouseDownTimeStamp: number = 0;\n private _oldHasSelection: boolean = false;\n private _oldSelectionStart: [number, number] | undefined = undefined;\n private _oldSelectionEnd: [number, number] | undefined = undefined;\n\n private _onLinuxMouseSelection = this.register(new EventEmitter());\n public get onLinuxMouseSelection(): IEvent { return this._onLinuxMouseSelection.event; }\n private _onRedrawRequest = this.register(new EventEmitter());\n public get onRequestRedraw(): IEvent { return this._onRedrawRequest.event; }\n private _onSelectionChange = this.register(new EventEmitter());\n public get onSelectionChange(): IEvent { return this._onSelectionChange.event; }\n private _onRequestScrollLines = this.register(new EventEmitter());\n public get onRequestScrollLines(): IEvent { return this._onRequestScrollLines.event; }\n\n constructor(\n private readonly _element: HTMLElement,\n private readonly _screenElement: HTMLElement,\n private readonly _linkifier: ILinkifier2,\n @IBufferService private readonly _bufferService: IBufferService,\n @ICoreService private readonly _coreService: ICoreService,\n @IMouseService private readonly _mouseService: IMouseService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n super();\n\n // Init listeners\n this._mouseMoveListener = event => this._onMouseMove(event as MouseEvent);\n this._mouseUpListener = event => this._onMouseUp(event as MouseEvent);\n this._coreService.onUserInput(() => {\n if (this.hasSelection) {\n this.clearSelection();\n }\n });\n this._trimListener = this._bufferService.buffer.lines.onTrim(amount => this._onTrim(amount));\n this.register(this._bufferService.buffers.onBufferActivate(e => this._onBufferActivate(e)));\n\n this.enable();\n\n this._model = new SelectionModel(this._bufferService);\n this._activeSelectionMode = SelectionMode.NORMAL;\n }\n\n public dispose(): void {\n this._removeMouseDownListeners();\n }\n\n public reset(): void {\n this.clearSelection();\n }\n\n /**\n * Disables the selection manager. This is useful for when terminal mouse\n * are enabled.\n */\n public disable(): void {\n this.clearSelection();\n this._enabled = false;\n }\n\n /**\n * Enable the selection manager.\n */\n public enable(): void {\n this._enabled = true;\n }\n\n public get selectionStart(): [number, number] | undefined { return this._model.finalSelectionStart; }\n public get selectionEnd(): [number, number] | undefined { return this._model.finalSelectionEnd; }\n\n /**\n * Gets whether there is an active text selection.\n */\n public get hasSelection(): boolean {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return false;\n }\n return start[0] !== end[0] || start[1] !== end[1];\n }\n\n /**\n * Gets the text currently selected.\n */\n public get selectionText(): string {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return '';\n }\n\n const buffer = this._bufferService.buffer;\n const result: string[] = [];\n\n if (this._activeSelectionMode === SelectionMode.COLUMN) {\n // Ignore zero width selections\n if (start[0] === end[0]) {\n return '';\n }\n\n // For column selection it's not enough to rely on final selection's swapping of reversed\n // values, it also needs the x coordinates to swap independently of the y coordinate is needed\n const startCol = start[0] < end[0] ? start[0] : end[0];\n const endCol = start[0] < end[0] ? end[0] : start[0];\n for (let i = start[1]; i <= end[1]; i++) {\n const lineText = buffer.translateBufferLineToString(i, true, startCol, endCol);\n result.push(lineText);\n }\n } else {\n // Get first row\n const startRowEndCol = start[1] === end[1] ? end[0] : undefined;\n result.push(buffer.translateBufferLineToString(start[1], true, start[0], startRowEndCol));\n\n // Get middle rows\n for (let i = start[1] + 1; i <= end[1] - 1; i++) {\n const bufferLine = buffer.lines.get(i);\n const lineText = buffer.translateBufferLineToString(i, true);\n if (bufferLine?.isWrapped) {\n result[result.length - 1] += lineText;\n } else {\n result.push(lineText);\n }\n }\n\n // Get final row\n if (start[1] !== end[1]) {\n const bufferLine = buffer.lines.get(end[1]);\n const lineText = buffer.translateBufferLineToString(end[1], true, 0, end[0]);\n if (bufferLine && bufferLine!.isWrapped) {\n result[result.length - 1] += lineText;\n } else {\n result.push(lineText);\n }\n }\n }\n\n // Format string by replacing non-breaking space chars with regular spaces\n // and joining the array into a multi-line string.\n const formattedResult = result.map(line => {\n return line.replace(ALL_NON_BREAKING_SPACE_REGEX, ' ');\n }).join(Browser.isWindows ? '\\r\\n' : '\\n');\n\n return formattedResult;\n }\n\n /**\n * Clears the current terminal selection.\n */\n public clearSelection(): void {\n this._model.clearSelection();\n this._removeMouseDownListeners();\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n /**\n * Queues a refresh, redrawing the selection on the next opportunity.\n * @param isLinuxMouseSelection Whether the selection should be registered as a new\n * selection on Linux.\n */\n public refresh(isLinuxMouseSelection?: boolean): void {\n // Queue the refresh for the renderer\n if (!this._refreshAnimationFrame) {\n this._refreshAnimationFrame = window.requestAnimationFrame(() => this._refresh());\n }\n\n // If the platform is Linux and the refresh call comes from a mouse event,\n // we need to update the selection for middle click to paste selection.\n if (Browser.isLinux && isLinuxMouseSelection) {\n const selectionText = this.selectionText;\n if (selectionText.length) {\n this._onLinuxMouseSelection.fire(this.selectionText);\n }\n }\n }\n\n /**\n * Fires the refresh event, causing consumers to pick it up and redraw the\n * selection state.\n */\n private _refresh(): void {\n this._refreshAnimationFrame = undefined;\n this._onRedrawRequest.fire({\n start: this._model.finalSelectionStart,\n end: this._model.finalSelectionEnd,\n columnSelectMode: this._activeSelectionMode === SelectionMode.COLUMN\n });\n }\n\n /**\n * Checks if the current click was inside the current selection\n * @param event The mouse event\n */\n private _isClickInSelection(event: MouseEvent): boolean {\n const coords = this._getMouseBufferCoords(event);\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n\n if (!start || !end || !coords) {\n return false;\n }\n\n return this._areCoordsInSelection(coords, start, end);\n }\n\n public isCellInSelection(x: number, y: number): boolean {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return false;\n }\n return this._areCoordsInSelection([x, y], start, end);\n }\n\n protected _areCoordsInSelection(coords: [number, number], start: [number, number], end: [number, number]): boolean {\n return (coords[1] > start[1] && coords[1] < end[1]) ||\n (start[1] === end[1] && coords[1] === start[1] && coords[0] >= start[0] && coords[0] < end[0]) ||\n (start[1] < end[1] && coords[1] === end[1] && coords[0] < end[0]) ||\n (start[1] < end[1] && coords[1] === start[1] && coords[0] >= start[0]);\n }\n\n /**\n * Selects word at the current mouse event coordinates.\n * @param event The mouse event.\n */\n private _selectWordAtCursor(event: MouseEvent, allowWhitespaceOnlySelection: boolean): boolean {\n // Check if there is a link under the cursor first and select that if so\n const range = this._linkifier.currentLink?.link?.range;\n if (range) {\n this._model.selectionStart = [range.start.x - 1, range.start.y - 1];\n this._model.selectionStartLength = getRangeLength(range, this._bufferService.cols);\n this._model.selectionEnd = undefined;\n return true;\n }\n\n const coords = this._getMouseBufferCoords(event);\n if (coords) {\n this._selectWordAt(coords, allowWhitespaceOnlySelection);\n this._model.selectionEnd = undefined;\n return true;\n }\n return false;\n }\n\n /**\n * Selects all text within the terminal.\n */\n public selectAll(): void {\n this._model.isSelectAllActive = true;\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n public selectLines(start: number, end: number): void {\n this._model.clearSelection();\n start = Math.max(start, 0);\n end = Math.min(end, this._bufferService.buffer.lines.length - 1);\n this._model.selectionStart = [0, start];\n this._model.selectionEnd = [this._bufferService.cols, end];\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n /**\n * Handle the buffer being trimmed, adjust the selection position.\n * @param amount The amount the buffer is being trimmed.\n */\n private _onTrim(amount: number): void {\n const needsRefresh = this._model.onTrim(amount);\n if (needsRefresh) {\n this.refresh();\n }\n }\n\n /**\n * Gets the 0-based [x, y] buffer coordinates of the current mouse event.\n * @param event The mouse event.\n */\n private _getMouseBufferCoords(event: MouseEvent): [number, number] | undefined {\n const coords = this._mouseService.getCoords(event, this._screenElement, this._bufferService.cols, this._bufferService.rows, true);\n if (!coords) {\n return undefined;\n }\n\n // Convert to 0-based\n coords[0]--;\n coords[1]--;\n\n // Convert viewport coords to buffer coords\n coords[1] += this._bufferService.buffer.ydisp;\n return coords;\n }\n\n /**\n * Gets the amount the viewport should be scrolled based on how far out of the\n * terminal the mouse is.\n * @param event The mouse event.\n */\n private _getMouseEventScrollAmount(event: MouseEvent): number {\n let offset = getCoordsRelativeToElement(window, event, this._screenElement)[1];\n const terminalHeight = this._renderService.dimensions.canvasHeight;\n if (offset >= 0 && offset <= terminalHeight) {\n return 0;\n }\n if (offset > terminalHeight) {\n offset -= terminalHeight;\n }\n\n offset = Math.min(Math.max(offset, -DRAG_SCROLL_MAX_THRESHOLD), DRAG_SCROLL_MAX_THRESHOLD);\n offset /= DRAG_SCROLL_MAX_THRESHOLD;\n return (offset / Math.abs(offset)) + Math.round(offset * (DRAG_SCROLL_MAX_SPEED - 1));\n }\n\n /**\n * Returns whether the selection manager should force selection, regardless of\n * whether the terminal is in mouse events mode.\n * @param event The mouse event.\n */\n public shouldForceSelection(event: MouseEvent): boolean {\n if (Browser.isMac) {\n return event.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection;\n }\n\n return event.shiftKey;\n }\n\n /**\n * Handles te mousedown event, setting up for a new selection.\n * @param event The mousedown event.\n */\n public onMouseDown(event: MouseEvent): void {\n this._mouseDownTimeStamp = event.timeStamp;\n // If we have selection, we want the context menu on right click even if the\n // terminal is in mouse mode.\n if (event.button === 2 && this.hasSelection) {\n return;\n }\n\n // Only action the primary button\n if (event.button !== 0) {\n return;\n }\n\n // Allow selection when using a specific modifier key, even when disabled\n if (!this._enabled) {\n if (!this.shouldForceSelection(event)) {\n return;\n }\n\n // Don't send the mouse down event to the current process, we want to select\n event.stopPropagation();\n }\n\n // Tell the browser not to start a regular selection\n event.preventDefault();\n\n // Reset drag scroll state\n this._dragScrollAmount = 0;\n\n if (this._enabled && event.shiftKey) {\n this._onIncrementalClick(event);\n } else {\n if (event.detail === 1) {\n this._onSingleClick(event);\n } else if (event.detail === 2) {\n this._onDoubleClick(event);\n } else if (event.detail === 3) {\n this._onTripleClick(event);\n }\n }\n\n this._addMouseDownListeners();\n this.refresh(true);\n }\n\n /**\n * Adds listeners when mousedown is triggered.\n */\n private _addMouseDownListeners(): void {\n // Listen on the document so that dragging outside of viewport works\n if (this._screenElement.ownerDocument) {\n this._screenElement.ownerDocument.addEventListener('mousemove', this._mouseMoveListener);\n this._screenElement.ownerDocument.addEventListener('mouseup', this._mouseUpListener);\n }\n this._dragScrollIntervalTimer = window.setInterval(() => this._dragScroll(), DRAG_SCROLL_INTERVAL);\n }\n\n /**\n * Removes the listeners that are registered when mousedown is triggered.\n */\n private _removeMouseDownListeners(): void {\n if (this._screenElement.ownerDocument) {\n this._screenElement.ownerDocument.removeEventListener('mousemove', this._mouseMoveListener);\n this._screenElement.ownerDocument.removeEventListener('mouseup', this._mouseUpListener);\n }\n clearInterval(this._dragScrollIntervalTimer);\n this._dragScrollIntervalTimer = undefined;\n }\n\n /**\n * Performs an incremental click, setting the selection end position to the mouse\n * position.\n * @param event The mouse event.\n */\n private _onIncrementalClick(event: MouseEvent): void {\n if (this._model.selectionStart) {\n this._model.selectionEnd = this._getMouseBufferCoords(event);\n }\n }\n\n /**\n * Performs a single click, resetting relevant state and setting the selection\n * start position.\n * @param event The mouse event.\n */\n private _onSingleClick(event: MouseEvent): void {\n this._model.selectionStartLength = 0;\n this._model.isSelectAllActive = false;\n this._activeSelectionMode = this.shouldColumnSelect(event) ? SelectionMode.COLUMN : SelectionMode.NORMAL;\n\n // Initialize the new selection\n this._model.selectionStart = this._getMouseBufferCoords(event);\n if (!this._model.selectionStart) {\n return;\n }\n this._model.selectionEnd = undefined;\n\n // Ensure the line exists\n const line = this._bufferService.buffer.lines.get(this._model.selectionStart[1]);\n if (!line) {\n return;\n }\n\n // Return early if the click event is not in the buffer (eg. in scroll bar)\n if (line.length === this._model.selectionStart[0]) {\n return;\n }\n\n // If the mouse is over the second half of a wide character, adjust the\n // selection to cover the whole character\n if (line.hasWidth(this._model.selectionStart[0]) === 0) {\n this._model.selectionStart[0]++;\n }\n }\n\n /**\n * Performs a double click, selecting the current word.\n * @param event The mouse event.\n */\n private _onDoubleClick(event: MouseEvent): void {\n if (this._selectWordAtCursor(event, true)) {\n this._activeSelectionMode = SelectionMode.WORD;\n }\n }\n\n /**\n * Performs a triple click, selecting the current line and activating line\n * select mode.\n * @param event The mouse event.\n */\n private _onTripleClick(event: MouseEvent): void {\n const coords = this._getMouseBufferCoords(event);\n if (coords) {\n this._activeSelectionMode = SelectionMode.LINE;\n this._selectLineAt(coords[1]);\n }\n }\n\n /**\n * Returns whether the selection manager should operate in column select mode\n * @param event the mouse or keyboard event\n */\n public shouldColumnSelect(event: KeyboardEvent | MouseEvent): boolean {\n return event.altKey && !(Browser.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection);\n }\n\n /**\n * Handles the mousemove event when the mouse button is down, recording the\n * end of the selection and refreshing the selection.\n * @param event The mousemove event.\n */\n private _onMouseMove(event: MouseEvent): void {\n // If the mousemove listener is active it means that a selection is\n // currently being made, we should stop propagation to prevent mouse events\n // to be sent to the pty.\n event.stopImmediatePropagation();\n\n // Do nothing if there is no selection start, this can happen if the first\n // click in the terminal is an incremental click\n if (!this._model.selectionStart) {\n return;\n }\n\n // Record the previous position so we know whether to redraw the selection\n // at the end.\n const previousSelectionEnd = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null;\n\n // Set the initial selection end based on the mouse coordinates\n this._model.selectionEnd = this._getMouseBufferCoords(event);\n if (!this._model.selectionEnd) {\n this.refresh(true);\n return;\n }\n\n // Select the entire line if line select mode is active.\n if (this._activeSelectionMode === SelectionMode.LINE) {\n if (this._model.selectionEnd[1] < this._model.selectionStart[1]) {\n this._model.selectionEnd[0] = 0;\n } else {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n } else if (this._activeSelectionMode === SelectionMode.WORD) {\n this._selectToWordAt(this._model.selectionEnd);\n }\n\n // Determine the amount of scrolling that will happen.\n this._dragScrollAmount = this._getMouseEventScrollAmount(event);\n\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n if (this._dragScrollAmount > 0) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n } else if (this._dragScrollAmount < 0) {\n this._model.selectionEnd[0] = 0;\n }\n }\n\n // If the character is a wide character include the cell to the right in the\n // selection. Note that selections at the very end of the line will never\n // have a character.\n const buffer = this._bufferService.buffer;\n if (this._model.selectionEnd[1] < buffer.lines.length) {\n const line = buffer.lines.get(this._model.selectionEnd[1]);\n if (line && line.hasWidth(this._model.selectionEnd[0]) === 0) {\n this._model.selectionEnd[0]++;\n }\n }\n\n // Only draw here if the selection changes.\n if (!previousSelectionEnd ||\n previousSelectionEnd[0] !== this._model.selectionEnd[0] ||\n previousSelectionEnd[1] !== this._model.selectionEnd[1]) {\n this.refresh(true);\n }\n }\n\n /**\n * The callback that occurs every DRAG_SCROLL_INTERVAL ms that does the\n * scrolling of the viewport.\n */\n private _dragScroll(): void {\n if (!this._model.selectionEnd || !this._model.selectionStart) {\n return;\n }\n if (this._dragScrollAmount) {\n this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false });\n // Re-evaluate selection\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n const buffer = this._bufferService.buffer;\n if (this._dragScrollAmount > 0) {\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n this._model.selectionEnd[1] = Math.min(buffer.ydisp + this._bufferService.rows, buffer.lines.length - 1);\n } else {\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n this._model.selectionEnd[0] = 0;\n }\n this._model.selectionEnd[1] = buffer.ydisp;\n }\n this.refresh();\n }\n }\n\n /**\n * Handles the mouseup event, removing the mousedown listeners.\n * @param event The mouseup event.\n */\n private _onMouseUp(event: MouseEvent): void {\n const timeElapsed = event.timeStamp - this._mouseDownTimeStamp;\n\n this._removeMouseDownListeners();\n\n if (this.selectionText.length <= 1 && timeElapsed < ALT_CLICK_MOVE_CURSOR_TIME && event.altKey && this._optionsService.getOption('altClickMovesCursor')) {\n if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) {\n const coordinates = this._mouseService.getCoords(\n event,\n this._element,\n this._bufferService.cols,\n this._bufferService.rows,\n false\n );\n if (coordinates && coordinates[0] !== undefined && coordinates[1] !== undefined) {\n const sequence = moveToCellSequence(coordinates[0] - 1, coordinates[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys);\n this._coreService.triggerDataEvent(sequence, true);\n }\n }\n } else {\n this._fireEventIfSelectionChanged();\n }\n }\n\n private _fireEventIfSelectionChanged(): void {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n const hasSelection = !!start && !!end && (start[0] !== end[0] || start[1] !== end[1]);\n\n if (!hasSelection) {\n if (this._oldHasSelection) {\n this._fireOnSelectionChange(start, end, hasSelection);\n }\n return;\n }\n\n // Sanity check, these should not be undefined as there is a selection\n if (!start || !end) {\n return;\n }\n\n if (!this._oldSelectionStart || !this._oldSelectionEnd || (\n start[0] !== this._oldSelectionStart[0] || start[1] !== this._oldSelectionStart[1] ||\n end[0] !== this._oldSelectionEnd[0] || end[1] !== this._oldSelectionEnd[1])) {\n\n this._fireOnSelectionChange(start, end, hasSelection);\n }\n }\n\n private _fireOnSelectionChange(start: [number, number] | undefined, end: [number, number] | undefined, hasSelection: boolean): void {\n this._oldSelectionStart = start;\n this._oldSelectionEnd = end;\n this._oldHasSelection = hasSelection;\n this._onSelectionChange.fire();\n }\n\n private _onBufferActivate(e: {activeBuffer: IBuffer, inactiveBuffer: IBuffer}): void {\n this.clearSelection();\n // Only adjust the selection on trim, shiftElements is rarely used (only in\n // reverseIndex) and delete in a splice is only ever used when the same\n // number of elements was just added. Given this is could actually be\n // beneficial to leave the selection as is for these cases.\n this._trimListener.dispose();\n this._trimListener = e.activeBuffer.lines.onTrim(amount => this._onTrim(amount));\n }\n\n /**\n * Converts a viewport column to the character index on the buffer line, the\n * latter takes into account wide characters.\n * @param coords The coordinates to find the 2 index for.\n */\n private _convertViewportColToCharacterIndex(bufferLine: IBufferLine, coords: [number, number]): number {\n let charIndex = coords[0];\n for (let i = 0; coords[0] >= i; i++) {\n const length = bufferLine.loadCell(i, this._workCell).getChars().length;\n if (this._workCell.getWidth() === 0) {\n // Wide characters aren't included in the line string so decrement the\n // index so the index is back on the wide character.\n charIndex--;\n } else if (length > 1 && coords[0] !== i) {\n // Emojis take up multiple characters, so adjust accordingly. For these\n // we don't want ot include the character at the column as we're\n // returning the start index in the string, not the end index.\n charIndex += length - 1;\n }\n }\n return charIndex;\n }\n\n public setSelection(col: number, row: number, length: number): void {\n this._model.clearSelection();\n this._removeMouseDownListeners();\n this._model.selectionStart = [col, row];\n this._model.selectionStartLength = length;\n this.refresh();\n this._fireEventIfSelectionChanged();\n }\n\n public rightClickSelect(ev: MouseEvent): void {\n if (!this._isClickInSelection(ev)) {\n if (this._selectWordAtCursor(ev, false)) {\n this.refresh(true);\n }\n this._fireEventIfSelectionChanged();\n }\n }\n\n /**\n * Gets positional information for the word at the coordinated specified.\n * @param coords The coordinates to get the word at.\n */\n private _getWordAt(coords: [number, number], allowWhitespaceOnlySelection: boolean, followWrappedLinesAbove: boolean = true, followWrappedLinesBelow: boolean = true): IWordPosition | undefined {\n // Ensure coords are within viewport (eg. not within scroll bar)\n if (coords[0] >= this._bufferService.cols) {\n return undefined;\n }\n\n const buffer = this._bufferService.buffer;\n const bufferLine = buffer.lines.get(coords[1]);\n if (!bufferLine) {\n return undefined;\n }\n\n const line = buffer.translateBufferLineToString(coords[1], false);\n\n // Get actual index, taking into consideration wide characters\n let startIndex = this._convertViewportColToCharacterIndex(bufferLine, coords);\n let endIndex = startIndex;\n\n // Record offset to be used later\n const charOffset = coords[0] - startIndex;\n let leftWideCharCount = 0;\n let rightWideCharCount = 0;\n let leftLongCharOffset = 0;\n let rightLongCharOffset = 0;\n\n if (line.charAt(startIndex) === ' ') {\n // Expand until non-whitespace is hit\n while (startIndex > 0 && line.charAt(startIndex - 1) === ' ') {\n startIndex--;\n }\n while (endIndex < line.length && line.charAt(endIndex + 1) === ' ') {\n endIndex++;\n }\n } else {\n // Expand until whitespace is hit. This algorithm works by scanning left\n // and right from the starting position, keeping both the index format\n // (line) and the column format (bufferLine) in sync. When a wide\n // character is hit, it is recorded and the column index is adjusted.\n let startCol = coords[0];\n let endCol = coords[0];\n\n // Consider the initial position, skip it and increment the wide char\n // variable\n if (bufferLine.getWidth(startCol) === 0) {\n leftWideCharCount++;\n startCol--;\n }\n if (bufferLine.getWidth(endCol) === 2) {\n rightWideCharCount++;\n endCol++;\n }\n\n // Adjust the end index for characters whose length are > 1 (emojis)\n const length = bufferLine.getString(endCol).length;\n if (length > 1) {\n rightLongCharOffset += length - 1;\n endIndex += length - 1;\n }\n\n // Expand the string in both directions until a space is hit\n while (startCol > 0 && startIndex > 0 && !this._isCharWordSeparator(bufferLine.loadCell(startCol - 1, this._workCell))) {\n bufferLine.loadCell(startCol - 1, this._workCell);\n const length = this._workCell.getChars().length;\n if (this._workCell.getWidth() === 0) {\n // If the next character is a wide char, record it and skip the column\n leftWideCharCount++;\n startCol--;\n } else if (length > 1) {\n // If the next character's string is longer than 1 char (eg. emoji),\n // adjust the index\n leftLongCharOffset += length - 1;\n startIndex -= length - 1;\n }\n startIndex--;\n startCol--;\n }\n while (endCol < bufferLine.length && endIndex + 1 < line.length && !this._isCharWordSeparator(bufferLine.loadCell(endCol + 1, this._workCell))) {\n bufferLine.loadCell(endCol + 1, this._workCell);\n const length = this._workCell.getChars().length;\n if (this._workCell.getWidth() === 2) {\n // If the next character is a wide char, record it and skip the column\n rightWideCharCount++;\n endCol++;\n } else if (length > 1) {\n // If the next character's string is longer than 1 char (eg. emoji),\n // adjust the index\n rightLongCharOffset += length - 1;\n endIndex += length - 1;\n }\n endIndex++;\n endCol++;\n }\n }\n\n // Incremenet the end index so it is at the start of the next character\n endIndex++;\n\n // Calculate the start _column_, converting the the string indexes back to\n // column coordinates.\n let start =\n startIndex // The index of the selection's start char in the line string\n + charOffset // The difference between the initial char's column and index\n - leftWideCharCount // The number of wide chars left of the initial char\n + leftLongCharOffset; // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)\n\n // Calculate the length in _columns_, converting the the string indexes back\n // to column coordinates.\n let length = Math.min(this._bufferService.cols, // Disallow lengths larger than the terminal cols\n endIndex // The index of the selection's end char in the line string\n - startIndex // The index of the selection's start char in the line string\n + leftWideCharCount // The number of wide chars left of the initial char\n + rightWideCharCount // The number of wide chars right of the initial char (inclusive)\n - leftLongCharOffset // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)\n - rightLongCharOffset); // The number of additional chars right of the initial char (inclusive) added by columns with strings longer than 1 (emojis)\n\n if (!allowWhitespaceOnlySelection && line.slice(startIndex, endIndex).trim() === '') {\n return undefined;\n }\n\n // Recurse upwards if the line is wrapped and the word wraps to the above line\n if (followWrappedLinesAbove) {\n if (start === 0 && bufferLine.getCodePoint(0) !== 32 /* ' ' */) {\n const previousBufferLine = buffer.lines.get(coords[1] - 1);\n if (previousBufferLine && bufferLine.isWrapped && previousBufferLine.getCodePoint(this._bufferService.cols - 1) !== 32 /* ' ' */) {\n const previousLineWordPosition = this._getWordAt([this._bufferService.cols - 1, coords[1] - 1], false, true, false);\n if (previousLineWordPosition) {\n const offset = this._bufferService.cols - previousLineWordPosition.start;\n start -= offset;\n length += offset;\n }\n }\n }\n }\n\n // Recurse downwards if the line is wrapped and the word wraps to the next line\n if (followWrappedLinesBelow) {\n if (start + length === this._bufferService.cols && bufferLine.getCodePoint(this._bufferService.cols - 1) !== 32 /* ' ' */) {\n const nextBufferLine = buffer.lines.get(coords[1] + 1);\n if (nextBufferLine?.isWrapped && nextBufferLine.getCodePoint(0) !== 32 /* ' ' */) {\n const nextLineWordPosition = this._getWordAt([0, coords[1] + 1], false, false, true);\n if (nextLineWordPosition) {\n length += nextLineWordPosition.length;\n }\n }\n }\n }\n\n return { start, length };\n }\n\n /**\n * Selects the word at the coordinates specified.\n * @param coords The coordinates to get the word at.\n * @param allowWhitespaceOnlySelection If whitespace should be selected\n */\n protected _selectWordAt(coords: [number, number], allowWhitespaceOnlySelection: boolean): void {\n const wordPosition = this._getWordAt(coords, allowWhitespaceOnlySelection);\n if (wordPosition) {\n // Adjust negative start value\n while (wordPosition.start < 0) {\n wordPosition.start += this._bufferService.cols;\n coords[1]--;\n }\n this._model.selectionStart = [wordPosition.start, coords[1]];\n this._model.selectionStartLength = wordPosition.length;\n }\n }\n\n /**\n * Sets the selection end to the word at the coordinated specified.\n * @param coords The coordinates to get the word at.\n */\n private _selectToWordAt(coords: [number, number]): void {\n const wordPosition = this._getWordAt(coords, true);\n if (wordPosition) {\n let endRow = coords[1];\n\n // Adjust negative start value\n while (wordPosition.start < 0) {\n wordPosition.start += this._bufferService.cols;\n endRow--;\n }\n\n // Adjust wrapped length value, this only needs to happen when values are reversed as in that\n // case we're interested in the start of the word, not the end\n if (!this._model.areSelectionValuesReversed()) {\n while (wordPosition.start + wordPosition.length > this._bufferService.cols) {\n wordPosition.length -= this._bufferService.cols;\n endRow++;\n }\n }\n\n this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? wordPosition.start : wordPosition.start + wordPosition.length, endRow];\n }\n }\n\n /**\n * Gets whether the character is considered a word separator by the select\n * word logic.\n * @param char The character to check.\n */\n private _isCharWordSeparator(cell: CellData): boolean {\n // Zero width characters are never separators as they are always to the\n // right of wide characters\n if (cell.getWidth() === 0) {\n return false;\n }\n return this._optionsService.rawOptions.wordSeparator.indexOf(cell.getChars()) >= 0;\n }\n\n /**\n * Selects the line specified.\n * @param line The line index.\n */\n protected _selectLineAt(line: number): void {\n const wrappedRange = this._bufferService.buffer.getWrappedRangeForLine(line);\n const range: IBufferRange = {\n start: { x: 0, y: wrappedRange.first },\n end: { x: this._bufferService.cols - 1, y: wrappedRange.last }\n };\n this._model.selectionStart = [0, wrappedRange.first];\n this._model.selectionEnd = undefined;\n this._model.selectionStartLength = getRangeLength(range, this._bufferService.cols);\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IEvent } from 'common/EventEmitter';\nimport { IRenderDimensions, IRenderer } from 'browser/renderer/Types';\nimport { IColorSet, IRenderDebouncer } from 'browser/Types';\nimport { ISelectionRedrawRequestEvent as ISelectionRequestRedrawEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types';\nimport { createDecorator } from 'common/services/ServiceRegistry';\nimport { IDisposable } from 'common/Types';\nimport { IDecorationOptions, IDecoration } from 'xterm';\nimport { IBufferService } from 'common/services/Services';\n\nexport const ICharSizeService = createDecorator('CharSizeService');\nexport interface ICharSizeService {\n serviceBrand: undefined;\n\n readonly width: number;\n readonly height: number;\n readonly hasValidSize: boolean;\n\n readonly onCharSizeChange: IEvent;\n\n measure(): void;\n}\n\nexport const ICoreBrowserService = createDecorator('CoreBrowserService');\nexport interface ICoreBrowserService {\n serviceBrand: undefined;\n\n readonly isFocused: boolean;\n}\n\nexport const IMouseService = createDecorator('MouseService');\nexport interface IMouseService {\n serviceBrand: undefined;\n\n getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined;\n getRawByteCoords(event: MouseEvent, element: HTMLElement, colCount: number, rowCount: number): { x: number, y: number } | undefined;\n}\n\nexport const IRenderService = createDecorator('RenderService');\nexport interface IRenderService extends IDisposable {\n serviceBrand: undefined;\n\n onDimensionsChange: IEvent;\n /**\n * Fires when buffer changes are rendered. This does not fire when only cursor\n * or selections are rendered.\n */\n onRenderedViewportChange: IEvent<{ start: number, end: number }>;\n /**\n * Fires on render\n */\n onRender: IEvent<{ start: number, end: number }>;\n onRefreshRequest: IEvent<{ start: number, end: number }>;\n\n dimensions: IRenderDimensions;\n\n addRefreshCallback(callback: FrameRequestCallback): number;\n\n refreshRows(start: number, end: number): void;\n clearTextureAtlas(): void;\n resize(cols: number, rows: number): void;\n setRenderer(renderer: IRenderer): void;\n setColors(colors: IColorSet): void;\n onDevicePixelRatioChange(): void;\n onResize(cols: number, rows: number): void;\n // TODO: Is this useful when we have onResize?\n onCharSizeChanged(): void;\n onBlur(): void;\n onFocus(): void;\n onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void;\n onCursorMove(): void;\n clear(): void;\n}\n\nexport const ISelectionService = createDecorator('SelectionService');\nexport interface ISelectionService {\n serviceBrand: undefined;\n\n readonly selectionText: string;\n readonly hasSelection: boolean;\n readonly selectionStart: [number, number] | undefined;\n readonly selectionEnd: [number, number] | undefined;\n\n readonly onLinuxMouseSelection: IEvent;\n readonly onRequestRedraw: IEvent;\n readonly onRequestScrollLines: IEvent;\n readonly onSelectionChange: IEvent;\n\n disable(): void;\n enable(): void;\n reset(): void;\n setSelection(row: number, col: number, length: number): void;\n selectAll(): void;\n selectLines(start: number, end: number): void;\n clearSelection(): void;\n rightClickSelect(event: MouseEvent): void;\n shouldColumnSelect(event: KeyboardEvent | MouseEvent): boolean;\n shouldForceSelection(event: MouseEvent): boolean;\n refresh(isLinuxMouseSelection?: boolean): void;\n onMouseDown(event: MouseEvent): void;\n isCellInSelection(x: number, y: number): boolean;\n}\n\nexport const ISoundService = createDecorator('SoundService');\nexport interface ISoundService {\n serviceBrand: undefined;\n\n playBellSound(): void;\n}\n\n\nexport const ICharacterJoinerService = createDecorator('CharacterJoinerService');\nexport interface ICharacterJoinerService {\n serviceBrand: undefined;\n\n register(handler: (text: string) => [number, number][]): number;\n deregister(joinerId: number): boolean;\n getJoinedCharacters(row: number): [number, number][];\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOptionsService } from 'common/services/Services';\nimport { ISoundService } from 'browser/services/Services';\n\nexport class SoundService implements ISoundService {\n public serviceBrand: undefined;\n\n private static _audioContext: AudioContext;\n\n public static get audioContext(): AudioContext | null {\n if (!SoundService._audioContext) {\n const audioContextCtor: typeof AudioContext = (window as any).AudioContext || (window as any).webkitAudioContext;\n if (!audioContextCtor) {\n console.warn('Web Audio API is not supported by this browser. Consider upgrading to the latest version');\n return null;\n }\n SoundService._audioContext = new audioContextCtor();\n }\n return SoundService._audioContext;\n }\n\n constructor(\n @IOptionsService private _optionsService: IOptionsService\n ) {\n }\n\n public playBellSound(): void {\n const ctx = SoundService.audioContext;\n if (!ctx) {\n return;\n }\n const bellAudioSource = ctx.createBufferSource();\n ctx.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.rawOptions.bellSound)), (buffer) => {\n bellAudioSource.buffer = buffer;\n bellAudioSource.connect(ctx.destination);\n bellAudioSource.start(0);\n });\n }\n\n private _base64ToArrayBuffer(base64: string): ArrayBuffer {\n const binaryString = window.atob(base64);\n const len = binaryString.length;\n const bytes = new Uint8Array(len);\n\n for (let i = 0; i < len; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n\n return bytes.buffer;\n }\n\n private _removeMimeType(dataURI: string): string {\n // Split the input to get the mime-type and the data itself\n const splitUri = dataURI.split(',');\n\n // Return only the data\n return splitUri[1];\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICircularList } from 'common/Types';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\n\nexport interface IInsertEvent {\n index: number;\n amount: number;\n}\n\nexport interface IDeleteEvent {\n index: number;\n amount: number;\n}\n\n/**\n * Represents a circular list; a list with a maximum size that wraps around when push is called,\n * overriding values at the start of the list.\n */\nexport class CircularList implements ICircularList {\n protected _array: (T | undefined)[];\n private _startIndex: number;\n private _length: number;\n\n public onDeleteEmitter = new EventEmitter();\n public get onDelete(): IEvent { return this.onDeleteEmitter.event; }\n public onInsertEmitter = new EventEmitter();\n public get onInsert(): IEvent { return this.onInsertEmitter.event; }\n public onTrimEmitter = new EventEmitter();\n public get onTrim(): IEvent { return this.onTrimEmitter.event; }\n\n constructor(\n private _maxLength: number\n ) {\n this._array = new Array(this._maxLength);\n this._startIndex = 0;\n this._length = 0;\n }\n\n public get maxLength(): number {\n return this._maxLength;\n }\n\n public set maxLength(newMaxLength: number) {\n // There was no change in maxLength, return early.\n if (this._maxLength === newMaxLength) {\n return;\n }\n\n // Reconstruct array, starting at index 0. Only transfer values from the\n // indexes 0 to length.\n const newArray = new Array(newMaxLength);\n for (let i = 0; i < Math.min(newMaxLength, this.length); i++) {\n newArray[i] = this._array[this._getCyclicIndex(i)];\n }\n this._array = newArray;\n this._maxLength = newMaxLength;\n this._startIndex = 0;\n }\n\n public get length(): number {\n return this._length;\n }\n\n public set length(newLength: number) {\n if (newLength > this._length) {\n for (let i = this._length; i < newLength; i++) {\n this._array[i] = undefined;\n }\n }\n this._length = newLength;\n }\n\n /**\n * Gets the value at an index.\n *\n * Note that for performance reasons there is no bounds checking here, the index reference is\n * circular so this should always return a value and never throw.\n * @param index The index of the value to get.\n * @return The value corresponding to the index.\n */\n public get(index: number): T | undefined {\n return this._array[this._getCyclicIndex(index)];\n }\n\n /**\n * Sets the value at an index.\n *\n * Note that for performance reasons there is no bounds checking here, the index reference is\n * circular so this should always return a value and never throw.\n * @param index The index to set.\n * @param value The value to set.\n */\n public set(index: number, value: T | undefined): void {\n this._array[this._getCyclicIndex(index)] = value;\n }\n\n /**\n * Pushes a new value onto the list, wrapping around to the start of the array, overriding index 0\n * if the maximum length is reached.\n * @param value The value to push onto the list.\n */\n public push(value: T): void {\n this._array[this._getCyclicIndex(this._length)] = value;\n if (this._length === this._maxLength) {\n this._startIndex = ++this._startIndex % this._maxLength;\n this.onTrimEmitter.fire(1);\n } else {\n this._length++;\n }\n }\n\n /**\n * Advance ringbuffer index and return current element for recycling.\n * Note: The buffer must be full for this method to work.\n * @throws When the buffer is not full.\n */\n public recycle(): T {\n if (this._length !== this._maxLength) {\n throw new Error('Can only recycle when the buffer is full');\n }\n this._startIndex = ++this._startIndex % this._maxLength;\n this.onTrimEmitter.fire(1);\n return this._array[this._getCyclicIndex(this._length - 1)]!;\n }\n\n /**\n * Ringbuffer is at max length.\n */\n public get isFull(): boolean {\n return this._length === this._maxLength;\n }\n\n /**\n * Removes and returns the last value on the list.\n * @return The popped value.\n */\n public pop(): T | undefined {\n return this._array[this._getCyclicIndex(this._length-- - 1)];\n }\n\n /**\n * Deletes and/or inserts items at a particular index (in that order). Unlike\n * Array.prototype.splice, this operation does not return the deleted items as a new array in\n * order to save creating a new array. Note that this operation may shift all values in the list\n * in the worst case.\n * @param start The index to delete and/or insert.\n * @param deleteCount The number of elements to delete.\n * @param items The items to insert.\n */\n public splice(start: number, deleteCount: number, ...items: T[]): void {\n // Delete items\n if (deleteCount) {\n for (let i = start; i < this._length - deleteCount; i++) {\n this._array[this._getCyclicIndex(i)] = this._array[this._getCyclicIndex(i + deleteCount)];\n }\n this._length -= deleteCount;\n this.onDeleteEmitter.fire({ index: start, amount: deleteCount });\n }\n\n // Add items\n for (let i = this._length - 1; i >= start; i--) {\n this._array[this._getCyclicIndex(i + items.length)] = this._array[this._getCyclicIndex(i)];\n }\n for (let i = 0; i < items.length; i++) {\n this._array[this._getCyclicIndex(start + i)] = items[i];\n }\n if (items.length) {\n this.onInsertEmitter.fire({ index: start, amount: items.length });\n }\n\n // Adjust length as needed\n if (this._length + items.length > this._maxLength) {\n const countToTrim = (this._length + items.length) - this._maxLength;\n this._startIndex += countToTrim;\n this._length = this._maxLength;\n this.onTrimEmitter.fire(countToTrim);\n } else {\n this._length += items.length;\n }\n }\n\n /**\n * Trims a number of items from the start of the list.\n * @param count The number of items to remove.\n */\n public trimStart(count: number): void {\n if (count > this._length) {\n count = this._length;\n }\n this._startIndex += count;\n this._length -= count;\n this.onTrimEmitter.fire(count);\n }\n\n public shiftElements(start: number, count: number, offset: number): void {\n if (count <= 0) {\n return;\n }\n if (start < 0 || start >= this._length) {\n throw new Error('start argument out of range');\n }\n if (start + offset < 0) {\n throw new Error('Cannot shift elements in list beyond index 0');\n }\n\n if (offset > 0) {\n for (let i = count - 1; i >= 0; i--) {\n this.set(start + i + offset, this.get(start + i));\n }\n const expandListBy = (start + count + offset) - this._length;\n if (expandListBy > 0) {\n this._length += expandListBy;\n while (this._length > this._maxLength) {\n this._length--;\n this._startIndex++;\n this.onTrimEmitter.fire(1);\n }\n }\n } else {\n for (let i = 0; i < count; i++) {\n this.set(start + i + offset, this.get(start + i));\n }\n }\n }\n\n /**\n * Gets the cyclic index for the specified regular index. The cyclic index can then be used on the\n * backing array to get the element associated with the regular index.\n * @param index The regular index.\n * @returns The cyclic index.\n */\n private _getCyclicIndex(index: number): number {\n return (this._startIndex + index) % this._maxLength;\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/*\n * A simple utility for cloning values\n */\nexport function clone(val: T, depth: number = 5): T {\n if (typeof val !== 'object') {\n return val;\n }\n\n // If we're cloning an array, use an array as the base, otherwise use an object\n const clonedObject: any = Array.isArray(val) ? [] : {};\n\n for (const key in val) {\n // Recursively clone eack item unless we're at the maximum depth\n clonedObject[key] = depth <= 1 ? val[key] : (val[key] && clone(val[key], depth - 1));\n }\n\n return clonedObject as T;\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColor, IColorRGB } from 'common/Types';\n\n/**\n * Helper functions where the source type is \"channels\" (individual color channels as numbers).\n */\nexport namespace channels {\n export function toCss(r: number, g: number, b: number, a?: number): string {\n if (a !== undefined) {\n return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}${toPaddedHex(a)}`;\n }\n return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}`;\n }\n\n export function toRgba(r: number, g: number, b: number, a: number = 0xFF): number {\n // Note: The aggregated number is RGBA32 (BE), thus needs to be converted to ABGR32\n // on LE systems, before it can be used for direct 32-bit buffer writes.\n // >>> 0 forces an unsigned int\n return (r << 24 | g << 16 | b << 8 | a) >>> 0;\n }\n}\n\n/**\n * Helper functions where the source type is `IColor`.\n */\nexport namespace color {\n export function blend(bg: IColor, fg: IColor): IColor {\n const a = (fg.rgba & 0xFF) / 255;\n if (a === 1) {\n return {\n css: fg.css,\n rgba: fg.rgba\n };\n }\n const fgR = (fg.rgba >> 24) & 0xFF;\n const fgG = (fg.rgba >> 16) & 0xFF;\n const fgB = (fg.rgba >> 8) & 0xFF;\n const bgR = (bg.rgba >> 24) & 0xFF;\n const bgG = (bg.rgba >> 16) & 0xFF;\n const bgB = (bg.rgba >> 8) & 0xFF;\n const r = bgR + Math.round((fgR - bgR) * a);\n const g = bgG + Math.round((fgG - bgG) * a);\n const b = bgB + Math.round((fgB - bgB) * a);\n const css = channels.toCss(r, g, b);\n const rgba = channels.toRgba(r, g, b);\n return { css, rgba };\n }\n\n export function isOpaque(color: IColor): boolean {\n return (color.rgba & 0xFF) === 0xFF;\n }\n\n export function ensureContrastRatio(bg: IColor, fg: IColor, ratio: number): IColor | undefined {\n const result = rgba.ensureContrastRatio(bg.rgba, fg.rgba, ratio);\n if (!result) {\n return undefined;\n }\n return rgba.toColor(\n (result >> 24 & 0xFF),\n (result >> 16 & 0xFF),\n (result >> 8 & 0xFF)\n );\n }\n\n export function opaque(color: IColor): IColor {\n const rgbaColor = (color.rgba | 0xFF) >>> 0;\n const [r, g, b] = rgba.toChannels(rgbaColor);\n return {\n css: channels.toCss(r, g, b),\n rgba: rgbaColor\n };\n }\n\n export function opacity(color: IColor, opacity: number): IColor {\n const a = Math.round(opacity * 0xFF);\n const [r, g, b] = rgba.toChannels(color.rgba);\n return {\n css: channels.toCss(r, g, b, a),\n rgba: channels.toRgba(r, g, b, a)\n };\n }\n\n export function toColorRGB(color: IColor): IColorRGB {\n return [(color.rgba >> 24) & 0xFF, (color.rgba >> 16) & 0xFF, (color.rgba >> 8) & 0xFF];\n }\n}\n\n/**\n * Helper functions where the source type is \"css\" (string: '#rgb', '#rgba', '#rrggbb', '#rrggbbaa').\n */\nexport namespace css {\n export function toColor(css: string): IColor {\n if (css.match(/#[0-9a-f]{3,8}/i)) {\n switch (css.length) {\n case 4: { // #rgb\n const r = parseInt(css.slice(1, 2).repeat(2), 16);\n const g = parseInt(css.slice(2, 3).repeat(2), 16);\n const b = parseInt(css.slice(3, 4).repeat(2), 16);\n return rgba.toColor(r, g, b);\n }\n case 5: { // #rgba\n const r = parseInt(css.slice(1, 2).repeat(2), 16);\n const g = parseInt(css.slice(2, 3).repeat(2), 16);\n const b = parseInt(css.slice(3, 4).repeat(2), 16);\n const a = parseInt(css.slice(4, 5).repeat(2), 16);\n return rgba.toColor(r, g, b, a);\n }\n case 7: // #rrggbb\n return {\n css,\n rgba: (parseInt(css.slice(1), 16) << 8 | 0xFF) >>> 0\n };\n case 9: // #rrggbbaa\n return {\n css,\n rgba: parseInt(css.slice(1), 16) >>> 0\n };\n }\n }\n const rgbaMatch = css.match(/rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(,\\s*(0|1|\\d?\\.(\\d+))\\s*)?\\)/);\n if (rgbaMatch) { // rgb() or rgba()\n const r = parseInt(rgbaMatch[1]);\n const g = parseInt(rgbaMatch[2]);\n const b = parseInt(rgbaMatch[3]);\n const a = Math.round((rgbaMatch[5] === undefined ? 1 : parseFloat(rgbaMatch[5])) * 0xFF);\n return rgba.toColor(r, g, b, a);\n }\n throw new Error('css.toColor: Unsupported css format');\n }\n}\n\n/**\n * Helper functions where the source type is \"rgb\" (number: 0xrrggbb).\n */\nexport namespace rgb {\n /**\n * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio\n * between two colors.\n * @param rgb The color to use.\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\n export function relativeLuminance(rgb: number): number {\n return relativeLuminance2(\n (rgb >> 16) & 0xFF,\n (rgb >> 8 ) & 0xFF,\n (rgb ) & 0xFF);\n }\n\n /**\n * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio\n * between two colors.\n * @param r The red channel (0x00 to 0xFF).\n * @param g The green channel (0x00 to 0xFF).\n * @param b The blue channel (0x00 to 0xFF).\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\n export function relativeLuminance2(r: number, g: number, b: number): number {\n const rs = r / 255;\n const gs = g / 255;\n const bs = b / 255;\n const rr = rs <= 0.03928 ? rs / 12.92 : Math.pow((rs + 0.055) / 1.055, 2.4);\n const rg = gs <= 0.03928 ? gs / 12.92 : Math.pow((gs + 0.055) / 1.055, 2.4);\n const rb = bs <= 0.03928 ? bs / 12.92 : Math.pow((bs + 0.055) / 1.055, 2.4);\n return rr * 0.2126 + rg * 0.7152 + rb * 0.0722;\n }\n}\n\n/**\n * Helper functions where the source type is \"rgba\" (number: 0xrrggbbaa).\n */\nexport namespace rgba {\n /**\n * Given a foreground color and a background color, either increase or reduce the luminance of the\n * foreground color until the specified contrast ratio is met. If pure white or black is hit\n * without the contrast ratio being met, go the other direction using the background color as the\n * foreground color and take either the first or second result depending on which has the higher\n * contrast ratio.\n *\n * `undefined` will be returned if the contrast ratio is already met.\n *\n * @param bgRgba The background color in rgba format.\n * @param fgRgba The foreground color in rgba format.\n * @param ratio The contrast ratio to achieve.\n */\n export function ensureContrastRatio(bgRgba: number, fgRgba: number, ratio: number): number | undefined {\n const bgL = rgb.relativeLuminance(bgRgba >> 8);\n const fgL = rgb.relativeLuminance(fgRgba >> 8);\n const cr = contrastRatio(bgL, fgL);\n if (cr < ratio) {\n if (fgL < bgL) {\n const resultA = reduceLuminance(bgRgba, fgRgba, ratio);\n const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));\n if (resultARatio < ratio) {\n const resultB = increaseLuminance(bgRgba, bgRgba, ratio);\n const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));\n return resultARatio > resultBRatio ? resultA : resultB;\n }\n return resultA;\n }\n const resultA = increaseLuminance(bgRgba, fgRgba, ratio);\n const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));\n if (resultARatio < ratio) {\n const resultB = reduceLuminance(bgRgba, bgRgba, ratio);\n const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));\n return resultARatio > resultBRatio ? resultA : resultB;\n }\n return resultA;\n }\n return undefined;\n }\n\n export function reduceLuminance(bgRgba: number, fgRgba: number, ratio: number): number {\n // This is a naive but fast approach to reducing luminance as converting to\n // HSL and back is expensive\n const bgR = (bgRgba >> 24) & 0xFF;\n const bgG = (bgRgba >> 16) & 0xFF;\n const bgB = (bgRgba >> 8) & 0xFF;\n let fgR = (fgRgba >> 24) & 0xFF;\n let fgG = (fgRgba >> 16) & 0xFF;\n let fgB = (fgRgba >> 8) & 0xFF;\n let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n while (cr < ratio && (fgR > 0 || fgG > 0 || fgB > 0)) {\n // Reduce by 10% until the ratio is hit\n fgR -= Math.max(0, Math.ceil(fgR * 0.1));\n fgG -= Math.max(0, Math.ceil(fgG * 0.1));\n fgB -= Math.max(0, Math.ceil(fgB * 0.1));\n cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n }\n return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;\n }\n\n export function increaseLuminance(bgRgba: number, fgRgba: number, ratio: number): number {\n // This is a naive but fast approach to increasing luminance as converting to\n // HSL and back is expensive\n const bgR = (bgRgba >> 24) & 0xFF;\n const bgG = (bgRgba >> 16) & 0xFF;\n const bgB = (bgRgba >> 8) & 0xFF;\n let fgR = (fgRgba >> 24) & 0xFF;\n let fgG = (fgRgba >> 16) & 0xFF;\n let fgB = (fgRgba >> 8) & 0xFF;\n let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n while (cr < ratio && (fgR < 0xFF || fgG < 0xFF || fgB < 0xFF)) {\n // Increase by 10% until the ratio is hit\n fgR = Math.min(0xFF, fgR + Math.ceil((255 - fgR) * 0.1));\n fgG = Math.min(0xFF, fgG + Math.ceil((255 - fgG) * 0.1));\n fgB = Math.min(0xFF, fgB + Math.ceil((255 - fgB) * 0.1));\n cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n }\n return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;\n }\n\n // FIXME: Move this to channels NS?\n export function toChannels(value: number): [number, number, number, number] {\n return [(value >> 24) & 0xFF, (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF];\n }\n\n export function toColor(r: number, g: number, b: number, a?: number): IColor {\n return {\n css: channels.toCss(r, g, b, a),\n rgba: channels.toRgba(r, g, b, a)\n };\n }\n}\n\nexport function toPaddedHex(c: number): string {\n const s = c.toString(16);\n return s.length < 2 ? '0' + s : s;\n}\n\n/**\n * Gets the contrast ratio between two relative luminance values.\n * @param l1 The first relative luminance.\n * @param l2 The first relative luminance.\n * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef\n */\nexport function contrastRatio(l1: number, l2: number): number {\n if (l1 < l2) {\n return (l2 + 0.05) / (l1 + 0.05);\n }\n return (l1 + 0.05) / (l2 + 0.05);\n}\n", "/**\n * Copyright (c) 2014-2020 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n *\n * Originally forked from (with the author's permission):\n * Fabrice Bellard's javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n *\n * Terminal Emulation References:\n * http://vt100.net/\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html\n * http://invisible-island.net/vttest/\n * http://www.inwap.com/pdp10/ansicode.txt\n * http://linux.die.net/man/4/console_codes\n * http://linux.die.net/man/7/urxvt\n */\n\nimport { Disposable } from 'common/Lifecycle';\nimport { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, ICoreMouseService, IUnicodeService, IDirtyRowService, LogLevelEnum, ITerminalOptions } from 'common/services/Services';\nimport { InstantiationService } from 'common/services/InstantiationService';\nimport { LogService } from 'common/services/LogService';\nimport { BufferService, MINIMUM_COLS, MINIMUM_ROWS } from 'common/services/BufferService';\nimport { OptionsService } from 'common/services/OptionsService';\nimport { IDisposable, IBufferLine, IAttributeData, ICoreTerminal, IKeyboardEvent, IScrollEvent, ScrollSource, ITerminalOptions as IPublicTerminalOptions } from 'common/Types';\nimport { CoreService } from 'common/services/CoreService';\nimport { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';\nimport { CoreMouseService } from 'common/services/CoreMouseService';\nimport { DirtyRowService } from 'common/services/DirtyRowService';\nimport { UnicodeService } from 'common/services/UnicodeService';\nimport { CharsetService } from 'common/services/CharsetService';\nimport { updateWindowsModeWrappedState } from 'common/WindowsMode';\nimport { IFunctionIdentifier, IParams } from 'common/parser/Types';\nimport { IBufferSet } from 'common/buffer/Types';\nimport { InputHandler } from 'common/InputHandler';\nimport { WriteBuffer } from 'common/input/WriteBuffer';\n\n// Only trigger this warning a single time per session\nlet hasWriteSyncWarnHappened = false;\n\nexport abstract class CoreTerminal extends Disposable implements ICoreTerminal {\n protected readonly _instantiationService: IInstantiationService;\n protected readonly _bufferService: IBufferService;\n protected readonly _logService: ILogService;\n protected readonly _charsetService: ICharsetService;\n protected readonly _dirtyRowService: IDirtyRowService;\n\n public readonly coreMouseService: ICoreMouseService;\n public readonly coreService: ICoreService;\n public readonly unicodeService: IUnicodeService;\n public readonly optionsService: IOptionsService;\n\n protected _inputHandler: InputHandler;\n private _writeBuffer: WriteBuffer;\n private _windowsMode: IDisposable | undefined;\n\n private _onBinary = new EventEmitter();\n public get onBinary(): IEvent { return this._onBinary.event; }\n private _onData = new EventEmitter();\n public get onData(): IEvent { return this._onData.event; }\n protected _onLineFeed = new EventEmitter();\n public get onLineFeed(): IEvent { return this._onLineFeed.event; }\n private _onResize = new EventEmitter<{ cols: number, rows: number }>();\n public get onResize(): IEvent<{ cols: number, rows: number }> { return this._onResize.event; }\n protected _onScroll = new EventEmitter();\n public get onWriteParsed(): IEvent { return this._onWriteParsed.event; }\n protected _onWriteParsed = new EventEmitter();\n /**\n * Internally we track the source of the scroll but this is meaningless outside the library so\n * it's filtered out.\n */\n protected _onScrollApi?: EventEmitter;\n public get onScroll(): IEvent {\n if (!this._onScrollApi) {\n this._onScrollApi = new EventEmitter();\n this.register(this._onScroll.event(ev => {\n this._onScrollApi?.fire(ev.position);\n }));\n }\n return this._onScrollApi.event;\n }\n\n public get cols(): number { return this._bufferService.cols; }\n public get rows(): number { return this._bufferService.rows; }\n public get buffers(): IBufferSet { return this._bufferService.buffers; }\n public get options(): ITerminalOptions { return this.optionsService.options; }\n public set options(options: ITerminalOptions) {\n for (const key in options) {\n this.optionsService.options[key] = options[key];\n }\n }\n\n constructor(\n options: Partial\n ) {\n super();\n\n // Setup and initialize services\n this._instantiationService = new InstantiationService();\n this.optionsService = new OptionsService(options);\n this._instantiationService.setService(IOptionsService, this.optionsService);\n this._bufferService = this.register(this._instantiationService.createInstance(BufferService));\n this._instantiationService.setService(IBufferService, this._bufferService);\n this._logService = this._instantiationService.createInstance(LogService);\n this._instantiationService.setService(ILogService, this._logService);\n this.coreService = this.register(this._instantiationService.createInstance(CoreService, () => this.scrollToBottom()));\n this._instantiationService.setService(ICoreService, this.coreService);\n this.coreMouseService = this._instantiationService.createInstance(CoreMouseService);\n this._instantiationService.setService(ICoreMouseService, this.coreMouseService);\n this._dirtyRowService = this._instantiationService.createInstance(DirtyRowService);\n this._instantiationService.setService(IDirtyRowService, this._dirtyRowService);\n this.unicodeService = this._instantiationService.createInstance(UnicodeService);\n this._instantiationService.setService(IUnicodeService, this.unicodeService);\n this._charsetService = this._instantiationService.createInstance(CharsetService);\n this._instantiationService.setService(ICharsetService, this._charsetService);\n\n // Register input handler and handle/forward events\n this._inputHandler = new InputHandler(this._bufferService, this._charsetService, this.coreService, this._dirtyRowService, this._logService, this.optionsService, this.coreMouseService, this.unicodeService);\n this.register(forwardEvent(this._inputHandler.onLineFeed, this._onLineFeed));\n this.register(this._inputHandler);\n\n // Setup listeners\n this.register(forwardEvent(this._bufferService.onResize, this._onResize));\n this.register(forwardEvent(this.coreService.onData, this._onData));\n this.register(forwardEvent(this.coreService.onBinary, this._onBinary));\n this.register(this.optionsService.onOptionChange(key => this._updateOptions(key)));\n this.register(this._bufferService.onScroll(event => {\n this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: ScrollSource.TERMINAL });\n this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);\n }));\n this.register(this._inputHandler.onScroll(event => {\n this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: ScrollSource.TERMINAL });\n this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);\n }));\n\n // Setup WriteBuffer\n this._writeBuffer = new WriteBuffer((data, promiseResult) => this._inputHandler.parse(data, promiseResult));\n this.register(forwardEvent(this._writeBuffer.onWriteParsed, this._onWriteParsed));\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n super.dispose();\n this._windowsMode?.dispose();\n this._windowsMode = undefined;\n }\n\n public write(data: string | Uint8Array, callback?: () => void): void {\n this._writeBuffer.write(data, callback);\n }\n\n /**\n * Write data to terminal synchonously.\n *\n * This method is unreliable with async parser handlers, thus should not\n * be used anymore. If you need blocking semantics on data input consider\n * `write` with a callback instead.\n *\n * @deprecated Unreliable, will be removed soon.\n */\n public writeSync(data: string | Uint8Array, maxSubsequentCalls?: number): void {\n if (this._logService.logLevel <= LogLevelEnum.WARN && !hasWriteSyncWarnHappened) {\n this._logService.warn('writeSync is unreliable and will be removed soon.');\n hasWriteSyncWarnHappened = true;\n }\n this._writeBuffer.writeSync(data, maxSubsequentCalls);\n }\n\n public resize(x: number, y: number): void {\n if (isNaN(x) || isNaN(y)) {\n return;\n }\n\n x = Math.max(x, MINIMUM_COLS);\n y = Math.max(y, MINIMUM_ROWS);\n\n this._bufferService.resize(x, y);\n }\n\n /**\n * Scroll the terminal down 1 row, creating a blank line.\n * @param isWrapped Whether the new line is wrapped from the previous line.\n */\n public scroll(eraseAttr: IAttributeData, isWrapped: boolean = false): void {\n this._bufferService.scroll(eraseAttr, isWrapped);\n }\n\n /**\n * Scroll the display of the terminal\n * @param disp The number of lines to scroll down (negative scroll up).\n * @param suppressScrollEvent Don't emit the scroll event as scrollLines. This is used\n * to avoid unwanted events being handled by the viewport when the event was triggered from the\n * viewport originally.\n */\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void {\n this._bufferService.scrollLines(disp, suppressScrollEvent, source);\n }\n\n /**\n * Scroll the display of the terminal by a number of pages.\n * @param pageCount The number of pages to scroll (negative scrolls up).\n */\n public scrollPages(pageCount: number): void {\n this._bufferService.scrollPages(pageCount);\n }\n\n /**\n * Scrolls the display of the terminal to the top.\n */\n public scrollToTop(): void {\n this._bufferService.scrollToTop();\n }\n\n /**\n * Scrolls the display of the terminal to the bottom.\n */\n public scrollToBottom(): void {\n this._bufferService.scrollToBottom();\n }\n\n public scrollToLine(line: number): void {\n this._bufferService.scrollToLine(line);\n }\n\n /** Add handler for ESC escape sequence. See xterm.d.ts for details. */\n public registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise): IDisposable {\n return this._inputHandler.registerEscHandler(id, callback);\n }\n\n /** Add handler for DCS escape sequence. See xterm.d.ts for details. */\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise): IDisposable {\n return this._inputHandler.registerDcsHandler(id, callback);\n }\n\n /** Add handler for CSI escape sequence. See xterm.d.ts for details. */\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise): IDisposable {\n return this._inputHandler.registerCsiHandler(id, callback);\n }\n\n /** Add handler for OSC escape sequence. See xterm.d.ts for details. */\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable {\n return this._inputHandler.registerOscHandler(ident, callback);\n }\n\n protected _setup(): void {\n if (this.optionsService.rawOptions.windowsMode) {\n this._enableWindowsMode();\n }\n }\n\n public reset(): void {\n this._inputHandler.reset();\n this._bufferService.reset();\n this._charsetService.reset();\n this.coreService.reset();\n this.coreMouseService.reset();\n }\n\n protected _updateOptions(key: string): void {\n // TODO: These listeners should be owned by individual components\n switch (key) {\n case 'scrollback':\n this.buffers.resize(this.cols, this.rows);\n break;\n case 'windowsMode':\n if (this.optionsService.rawOptions.windowsMode) {\n this._enableWindowsMode();\n } else {\n this._windowsMode?.dispose();\n this._windowsMode = undefined;\n }\n break;\n }\n }\n\n protected _enableWindowsMode(): void {\n if (!this._windowsMode) {\n const disposables: IDisposable[] = [];\n disposables.push(this.onLineFeed(updateWindowsModeWrappedState.bind(null, this._bufferService)));\n disposables.push(this.registerCsiHandler({ final: 'H' }, () => {\n updateWindowsModeWrappedState(this._bufferService);\n return false;\n }));\n this._windowsMode = {\n dispose: () => {\n for (const d of disposables) {\n d.dispose();\n }\n }\n };\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\ninterface IListener {\n (arg1: T, arg2: U): void;\n}\n\nexport interface IEvent {\n (listener: (arg1: T, arg2: U) => any): IDisposable;\n}\n\nexport interface IEventEmitter {\n event: IEvent;\n fire(arg1: T, arg2: U): void;\n dispose(): void;\n}\n\nexport class EventEmitter implements IEventEmitter {\n private _listeners: IListener[] = [];\n private _event?: IEvent;\n private _disposed: boolean = false;\n\n public get event(): IEvent {\n if (!this._event) {\n this._event = (listener: (arg1: T, arg2: U) => any) => {\n this._listeners.push(listener);\n const disposable = {\n dispose: () => {\n if (!this._disposed) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n }\n }\n };\n return disposable;\n };\n }\n return this._event;\n }\n\n public fire(arg1: T, arg2: U): void {\n const queue: IListener[] = [];\n for (let i = 0; i < this._listeners.length; i++) {\n queue.push(this._listeners[i]);\n }\n for (let i = 0; i < queue.length; i++) {\n queue[i].call(undefined, arg1, arg2);\n }\n }\n\n public dispose(): void {\n if (this._listeners) {\n this._listeners.length = 0;\n }\n this._disposed = true;\n }\n}\n\nexport function forwardEvent(from: IEvent, to: IEventEmitter): IDisposable {\n return from(e => to.fire(e));\n}\n", "/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n */\n\nimport { IInputHandler, IAttributeData, IDisposable, IWindowOptions, IColorEvent, IParseStack, ColorIndex, ColorRequestType } from 'common/Types';\nimport { C0, C1 } from 'common/data/EscapeSequences';\nimport { CHARSETS, DEFAULT_CHARSET } from 'common/data/Charsets';\nimport { EscapeSequenceParser } from 'common/parser/EscapeSequenceParser';\nimport { Disposable } from 'common/Lifecycle';\nimport { concat } from 'common/TypedArrayUtils';\nimport { StringToUtf32, stringFromCodePoint, utf32ToString, Utf8ToUtf32 } from 'common/input/TextDecoder';\nimport { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IParsingState, IDcsHandler, IEscapeSequenceParser, IParams, IFunctionIdentifier } from 'common/parser/Types';\nimport { NULL_CELL_CODE, NULL_CELL_WIDTH, Attributes, FgFlags, BgFlags, Content, UnderlineStyle } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { ICoreService, IBufferService, IOptionsService, ILogService, IDirtyRowService, ICoreMouseService, ICharsetService, IUnicodeService, LogLevelEnum } from 'common/services/Services';\nimport { OscHandler } from 'common/parser/OscParser';\nimport { DcsHandler } from 'common/parser/DcsParser';\nimport { IBuffer } from 'common/buffer/Types';\nimport { parseColor } from 'common/input/XParseColor';\n\n/**\n * Map collect to glevel. Used in `selectCharset`.\n */\nconst GLEVEL: { [key: string]: number } = { '(': 0, ')': 1, '*': 2, '+': 3, '-': 1, '.': 2 };\n\n/**\n * VT commands done by the parser - FIXME: move this to the parser?\n */\n// @vt: #Y ESC CSI \"Control Sequence Introducer\" \"ESC [\" \"Start of a CSI sequence.\"\n// @vt: #Y ESC OSC \"Operating System Command\" \"ESC ]\" \"Start of an OSC sequence.\"\n// @vt: #Y ESC DCS \"Device Control String\" \"ESC P\" \"Start of a DCS sequence.\"\n// @vt: #Y ESC ST \"String Terminator\" \"ESC \\\" \"Terminator used for string type sequences.\"\n// @vt: #Y ESC PM \"Privacy Message\" \"ESC ^\" \"Start of a privacy message.\"\n// @vt: #Y ESC APC \"Application Program Command\" \"ESC _\" \"Start of an APC sequence.\"\n// @vt: #Y C1 CSI \"Control Sequence Introducer\" \"\\x9B\" \"Start of a CSI sequence.\"\n// @vt: #Y C1 OSC \"Operating System Command\" \"\\x9D\" \"Start of an OSC sequence.\"\n// @vt: #Y C1 DCS \"Device Control String\" \"\\x90\" \"Start of a DCS sequence.\"\n// @vt: #Y C1 ST \"String Terminator\" \"\\x9C\" \"Terminator used for string type sequences.\"\n// @vt: #Y C1 PM \"Privacy Message\" \"\\x9E\" \"Start of a privacy message.\"\n// @vt: #Y C1 APC \"Application Program Command\" \"\\x9F\" \"Start of an APC sequence.\"\n// @vt: #Y C0 NUL \"Null\" \"\\0, \\x00\" \"NUL is ignored.\"\n// @vt: #Y C0 ESC \"Escape\" \"\\e, \\x1B\" \"Start of a sequence. Cancels any other sequence.\"\n\n/**\n * Document common VT features here that are currently unsupported\n */\n// @vt: #N DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q \tPt ST\" \"Draw SIXEL image starting at cursor position.\"\n// @vt: #N OSC 1 \"Set Icon Name\" \"OSC 1 ; Pt BEL\" \"Set icon name.\"\n\n/**\n * Max length of the UTF32 input buffer. Real memory consumption is 4 times higher.\n */\nconst MAX_PARSEBUFFER_LENGTH = 131072;\n\n/**\n * Limit length of title and icon name stacks.\n */\nconst STACK_LIMIT = 10;\n\n// map params to window option\nfunction paramToWindowOption(n: number, opts: IWindowOptions): boolean {\n if (n > 24) {\n return opts.setWinLines || false;\n }\n switch (n) {\n case 1: return !!opts.restoreWin;\n case 2: return !!opts.minimizeWin;\n case 3: return !!opts.setWinPosition;\n case 4: return !!opts.setWinSizePixels;\n case 5: return !!opts.raiseWin;\n case 6: return !!opts.lowerWin;\n case 7: return !!opts.refreshWin;\n case 8: return !!opts.setWinSizeChars;\n case 9: return !!opts.maximizeWin;\n case 10: return !!opts.fullscreenWin;\n case 11: return !!opts.getWinState;\n case 13: return !!opts.getWinPosition;\n case 14: return !!opts.getWinSizePixels;\n case 15: return !!opts.getScreenSizePixels;\n case 16: return !!opts.getCellSizePixels;\n case 18: return !!opts.getWinSizeChars;\n case 19: return !!opts.getScreenSizeChars;\n case 20: return !!opts.getIconTitle;\n case 21: return !!opts.getWinTitle;\n case 22: return !!opts.pushTitle;\n case 23: return !!opts.popTitle;\n case 24: return !!opts.setWinLines;\n }\n return false;\n}\n\nexport enum WindowsOptionsReportType {\n GET_WIN_SIZE_PIXELS = 0,\n GET_CELL_SIZE_PIXELS = 1\n}\n\n// create a warning log if an async handler takes longer than the limit (in ms)\nconst SLOW_ASYNC_LIMIT = 5000;\n\n/**\n * DCS subparser implementations\n */\n\n/**\n * DCS $ q Pt ST\n * DECRQSS (https://vt100.net/docs/vt510-rm/DECRQSS.html)\n * Request Status String (DECRQSS), VT420 and up.\n * Response: DECRPSS (https://vt100.net/docs/vt510-rm/DECRPSS.html)\n *\n * @vt: #P[See limited support below.] DCS DECRQSS \"Request Selection or Setting\" \"DCS $ q Pt ST\" \"Request several terminal settings.\"\n * Response is in the form `ESC P 1 $ r Pt ST` for valid requests, where `Pt` contains the corresponding CSI string,\n * `ESC P 0 ST` for invalid requests.\n *\n * Supported requests and responses:\n *\n * | Type | Request | Response (`Pt`) |\n * | -------------------------------- | ----------------- | ----------------------------------------------------- |\n * | Graphic Rendition (SGR) | `DCS $ q m ST` | always reporting `0m` (currently broken) |\n * | Top and Bottom Margins (DECSTBM) | `DCS $ q r ST` | `Ps ; Ps r` |\n * | Cursor Style (DECSCUSR) | `DCS $ q SP q ST` | `Ps SP q` |\n * | Protection Attribute (DECSCA) | `DCS $ q \" q ST` | always reporting `0 \" q` (DECSCA is unsupported) |\n * | Conformance Level (DECSCL) | `DCS $ q \" p ST` | always reporting `61 ; 1 \" p` (DECSCL is unsupported) |\n *\n *\n * TODO:\n * - fix SGR report\n * - either implement DECSCA or remove the report\n * - either check which conformance is better suited or remove the report completely\n * --> we are currently a mixture of all up to VT400 but dont follow anyone strictly\n */\nclass DECRQSS implements IDcsHandler {\n private _data: Uint32Array = new Uint32Array(0);\n\n constructor(\n private _bufferService: IBufferService,\n private _coreService: ICoreService,\n private _logService: ILogService,\n private _optionsService: IOptionsService\n ) { }\n\n public hook(params: IParams): void {\n this._data = new Uint32Array(0);\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n this._data = concat(this._data, data.subarray(start, end));\n }\n\n public unhook(success: boolean): boolean {\n if (!success) {\n this._data = new Uint32Array(0);\n return true;\n }\n const data = utf32ToString(this._data);\n this._data = new Uint32Array(0);\n switch (data) {\n // valid: DCS 1 $ r Pt ST (xterm)\n case '\"q': // DECSCA\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r0\"q${C0.ESC}\\\\`);\n break;\n case '\"p': // DECSCL\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r61;1\"p${C0.ESC}\\\\`);\n break;\n case 'r': // DECSTBM\n const pt = '' + (this._bufferService.buffer.scrollTop + 1) +\n ';' + (this._bufferService.buffer.scrollBottom + 1) + 'r';\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r${pt}${C0.ESC}\\\\`);\n break;\n case 'm': // SGR\n // TODO: report real settings instead of 0m\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r0m${C0.ESC}\\\\`);\n break;\n case ' q': // DECSCUSR\n const STYLES: { [key: string]: number } = { 'block': 2, 'underline': 4, 'bar': 6 };\n let style = STYLES[this._optionsService.rawOptions.cursorStyle];\n style -= this._optionsService.rawOptions.cursorBlink ? 1 : 0;\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r${style} q${C0.ESC}\\\\`);\n break;\n default:\n // invalid: DCS 0 $ r Pt ST (xterm)\n this._logService.debug('Unknown DCS $q %s', data);\n this._coreService.triggerDataEvent(`${C0.ESC}P0$r${C0.ESC}\\\\`);\n }\n return true;\n }\n}\n\n/**\n * DCS Ps; Ps| Pt ST\n * DECUDK (https://vt100.net/docs/vt510-rm/DECUDK.html)\n * not supported\n *\n * @vt: #N DCS DECUDK \"User Defined Keys\" \"DCS Ps ; Ps | Pt ST\" \"Definitions for user-defined keys.\"\n */\n\n/**\n * DCS + q Pt ST (xterm)\n * Request Terminfo String\n * not implemented\n *\n * @vt: #N DCS XTGETTCAP \"Request Terminfo String\" \"DCS + q Pt ST\" \"Request Terminfo String.\"\n */\n\n/**\n * DCS + p Pt ST (xterm)\n * Set Terminfo Data\n * not supported\n *\n * @vt: #N DCS XTSETTCAP \"Set Terminfo Data\" \"DCS + p Pt ST\" \"Set Terminfo Data.\"\n */\n\n\n\n/**\n * The terminal's standard implementation of IInputHandler, this handles all\n * input from the Parser.\n *\n * Refer to http://invisible-island.net/xterm/ctlseqs/ctlseqs.html to understand\n * each function's header comment.\n */\nexport class InputHandler extends Disposable implements IInputHandler {\n private _parseBuffer: Uint32Array = new Uint32Array(4096);\n private _stringDecoder: StringToUtf32 = new StringToUtf32();\n private _utf8Decoder: Utf8ToUtf32 = new Utf8ToUtf32();\n private _workCell: CellData = new CellData();\n private _windowTitle = '';\n private _iconName = '';\n protected _windowTitleStack: string[] = [];\n protected _iconNameStack: string[] = [];\n\n private _curAttrData: IAttributeData = DEFAULT_ATTR_DATA.clone();\n private _eraseAttrDataInternal: IAttributeData = DEFAULT_ATTR_DATA.clone();\n\n private _activeBuffer: IBuffer;\n\n private _onRequestBell = new EventEmitter();\n public get onRequestBell(): IEvent { return this._onRequestBell.event; }\n private _onRequestRefreshRows = new EventEmitter();\n public get onRequestRefreshRows(): IEvent { return this._onRequestRefreshRows.event; }\n private _onRequestReset = new EventEmitter();\n public get onRequestReset(): IEvent { return this._onRequestReset.event; }\n private _onRequestSendFocus = new EventEmitter();\n public get onRequestSendFocus(): IEvent { return this._onRequestSendFocus.event; }\n private _onRequestSyncScrollBar = new EventEmitter();\n public get onRequestSyncScrollBar(): IEvent { return this._onRequestSyncScrollBar.event; }\n private _onRequestWindowsOptionsReport = new EventEmitter();\n public get onRequestWindowsOptionsReport(): IEvent { return this._onRequestWindowsOptionsReport.event; }\n\n private _onA11yChar = new EventEmitter();\n public get onA11yChar(): IEvent { return this._onA11yChar.event; }\n private _onA11yTab = new EventEmitter();\n public get onA11yTab(): IEvent { return this._onA11yTab.event; }\n private _onCursorMove = new EventEmitter();\n public get onCursorMove(): IEvent { return this._onCursorMove.event; }\n private _onLineFeed = new EventEmitter();\n public get onLineFeed(): IEvent { return this._onLineFeed.event; }\n private _onScroll = new EventEmitter();\n public get onScroll(): IEvent { return this._onScroll.event; }\n private _onTitleChange = new EventEmitter();\n public get onTitleChange(): IEvent { return this._onTitleChange.event; }\n private _onColor = new EventEmitter();\n public get onColor(): IEvent { return this._onColor.event; }\n\n private _parseStack: IParseStack = {\n paused: false,\n cursorStartX: 0,\n cursorStartY: 0,\n decodedLength: 0,\n position: 0\n };\n\n constructor(\n private readonly _bufferService: IBufferService,\n private readonly _charsetService: ICharsetService,\n private readonly _coreService: ICoreService,\n private readonly _dirtyRowService: IDirtyRowService,\n private readonly _logService: ILogService,\n private readonly _optionsService: IOptionsService,\n private readonly _coreMouseService: ICoreMouseService,\n private readonly _unicodeService: IUnicodeService,\n private readonly _parser: IEscapeSequenceParser = new EscapeSequenceParser()\n ) {\n super();\n this.register(this._parser);\n\n // Track properties used in performance critical code manually to avoid using slow getters\n this._activeBuffer = this._bufferService.buffer;\n this.register(this._bufferService.buffers.onBufferActivate(e => this._activeBuffer = e.activeBuffer));\n\n /**\n * custom fallback handlers\n */\n this._parser.setCsiHandlerFallback((ident, params) => {\n this._logService.debug('Unknown CSI code: ', { identifier: this._parser.identToString(ident), params: params.toArray() });\n });\n this._parser.setEscHandlerFallback(ident => {\n this._logService.debug('Unknown ESC code: ', { identifier: this._parser.identToString(ident) });\n });\n this._parser.setExecuteHandlerFallback(code => {\n this._logService.debug('Unknown EXECUTE code: ', { code });\n });\n this._parser.setOscHandlerFallback((identifier, action, data) => {\n this._logService.debug('Unknown OSC code: ', { identifier, action, data });\n });\n this._parser.setDcsHandlerFallback((ident, action, payload) => {\n if (action === 'HOOK') {\n payload = payload.toArray();\n }\n this._logService.debug('Unknown DCS code: ', { identifier: this._parser.identToString(ident), action, payload });\n });\n\n /**\n * print handler\n */\n this._parser.setPrintHandler((data, start, end) => this.print(data, start, end));\n\n /**\n * CSI handler\n */\n this._parser.registerCsiHandler({ final: '@' }, params => this.insertChars(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: '@' }, params => this.scrollLeft(params));\n this._parser.registerCsiHandler({ final: 'A' }, params => this.cursorUp(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: 'A' }, params => this.scrollRight(params));\n this._parser.registerCsiHandler({ final: 'B' }, params => this.cursorDown(params));\n this._parser.registerCsiHandler({ final: 'C' }, params => this.cursorForward(params));\n this._parser.registerCsiHandler({ final: 'D' }, params => this.cursorBackward(params));\n this._parser.registerCsiHandler({ final: 'E' }, params => this.cursorNextLine(params));\n this._parser.registerCsiHandler({ final: 'F' }, params => this.cursorPrecedingLine(params));\n this._parser.registerCsiHandler({ final: 'G' }, params => this.cursorCharAbsolute(params));\n this._parser.registerCsiHandler({ final: 'H' }, params => this.cursorPosition(params));\n this._parser.registerCsiHandler({ final: 'I' }, params => this.cursorForwardTab(params));\n this._parser.registerCsiHandler({ final: 'J' }, params => this.eraseInDisplay(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'J' }, params => this.eraseInDisplay(params));\n this._parser.registerCsiHandler({ final: 'K' }, params => this.eraseInLine(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'K' }, params => this.eraseInLine(params));\n this._parser.registerCsiHandler({ final: 'L' }, params => this.insertLines(params));\n this._parser.registerCsiHandler({ final: 'M' }, params => this.deleteLines(params));\n this._parser.registerCsiHandler({ final: 'P' }, params => this.deleteChars(params));\n this._parser.registerCsiHandler({ final: 'S' }, params => this.scrollUp(params));\n this._parser.registerCsiHandler({ final: 'T' }, params => this.scrollDown(params));\n this._parser.registerCsiHandler({ final: 'X' }, params => this.eraseChars(params));\n this._parser.registerCsiHandler({ final: 'Z' }, params => this.cursorBackwardTab(params));\n this._parser.registerCsiHandler({ final: '`' }, params => this.charPosAbsolute(params));\n this._parser.registerCsiHandler({ final: 'a' }, params => this.hPositionRelative(params));\n this._parser.registerCsiHandler({ final: 'b' }, params => this.repeatPrecedingCharacter(params));\n this._parser.registerCsiHandler({ final: 'c' }, params => this.sendDeviceAttributesPrimary(params));\n this._parser.registerCsiHandler({ prefix: '>', final: 'c' }, params => this.sendDeviceAttributesSecondary(params));\n this._parser.registerCsiHandler({ final: 'd' }, params => this.linePosAbsolute(params));\n this._parser.registerCsiHandler({ final: 'e' }, params => this.vPositionRelative(params));\n this._parser.registerCsiHandler({ final: 'f' }, params => this.hVPosition(params));\n this._parser.registerCsiHandler({ final: 'g' }, params => this.tabClear(params));\n this._parser.registerCsiHandler({ final: 'h' }, params => this.setMode(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this.setModePrivate(params));\n this._parser.registerCsiHandler({ final: 'l' }, params => this.resetMode(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this.resetModePrivate(params));\n this._parser.registerCsiHandler({ final: 'm' }, params => this.charAttributes(params));\n this._parser.registerCsiHandler({ final: 'n' }, params => this.deviceStatus(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'n' }, params => this.deviceStatusPrivate(params));\n this._parser.registerCsiHandler({ intermediates: '!', final: 'p' }, params => this.softReset(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: 'q' }, params => this.setCursorStyle(params));\n this._parser.registerCsiHandler({ final: 'r' }, params => this.setScrollRegion(params));\n this._parser.registerCsiHandler({ final: 's' }, params => this.saveCursor(params));\n this._parser.registerCsiHandler({ final: 't' }, params => this.windowOptions(params));\n this._parser.registerCsiHandler({ final: 'u' }, params => this.restoreCursor(params));\n this._parser.registerCsiHandler({ intermediates: '\\'', final: '}' }, params => this.insertColumns(params));\n this._parser.registerCsiHandler({ intermediates: '\\'', final: '~' }, params => this.deleteColumns(params));\n\n /**\n * execute handler\n */\n this._parser.setExecuteHandler(C0.BEL, () => this.bell());\n this._parser.setExecuteHandler(C0.LF, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.VT, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.FF, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.CR, () => this.carriageReturn());\n this._parser.setExecuteHandler(C0.BS, () => this.backspace());\n this._parser.setExecuteHandler(C0.HT, () => this.tab());\n this._parser.setExecuteHandler(C0.SO, () => this.shiftOut());\n this._parser.setExecuteHandler(C0.SI, () => this.shiftIn());\n // FIXME: What do to with missing? Old code just added those to print.\n\n this._parser.setExecuteHandler(C1.IND, () => this.index());\n this._parser.setExecuteHandler(C1.NEL, () => this.nextLine());\n this._parser.setExecuteHandler(C1.HTS, () => this.tabSet());\n\n /**\n * OSC handler\n */\n // 0 - icon name + title\n this._parser.registerOscHandler(0, new OscHandler(data => { this.setTitle(data); this.setIconName(data); return true; }));\n // 1 - icon name\n this._parser.registerOscHandler(1, new OscHandler(data => this.setIconName(data)));\n // 2 - title\n this._parser.registerOscHandler(2, new OscHandler(data => this.setTitle(data)));\n // 3 - set property X in the form \"prop=value\"\n // 4 - Change Color Number\n this._parser.registerOscHandler(4, new OscHandler(data => this.setOrReportIndexedColor(data)));\n // 5 - Change Special Color Number\n // 6 - Enable/disable Special Color Number c\n // 7 - current directory? (not in xterm spec, see https://gitlab.com/gnachman/iterm2/issues/3939)\n // 10 - Change VT100 text foreground color to Pt.\n this._parser.registerOscHandler(10, new OscHandler(data => this.setOrReportFgColor(data)));\n // 11 - Change VT100 text background color to Pt.\n this._parser.registerOscHandler(11, new OscHandler(data => this.setOrReportBgColor(data)));\n // 12 - Change text cursor color to Pt.\n this._parser.registerOscHandler(12, new OscHandler(data => this.setOrReportCursorColor(data)));\n // 13 - Change mouse foreground color to Pt.\n // 14 - Change mouse background color to Pt.\n // 15 - Change Tektronix foreground color to Pt.\n // 16 - Change Tektronix background color to Pt.\n // 17 - Change highlight background color to Pt.\n // 18 - Change Tektronix cursor color to Pt.\n // 19 - Change highlight foreground color to Pt.\n // 46 - Change Log File to Pt.\n // 50 - Set Font to Pt.\n // 51 - reserved for Emacs shell.\n // 52 - Manipulate Selection Data.\n // 104 ; c - Reset Color Number c.\n this._parser.registerOscHandler(104, new OscHandler(data => this.restoreIndexedColor(data)));\n // 105 ; c - Reset Special Color Number c.\n // 106 ; c; f - Enable/disable Special Color Number c.\n // 110 - Reset VT100 text foreground color.\n this._parser.registerOscHandler(110, new OscHandler(data => this.restoreFgColor(data)));\n // 111 - Reset VT100 text background color.\n this._parser.registerOscHandler(111, new OscHandler(data => this.restoreBgColor(data)));\n // 112 - Reset text cursor color.\n this._parser.registerOscHandler(112, new OscHandler(data => this.restoreCursorColor(data)));\n // 113 - Reset mouse foreground color.\n // 114 - Reset mouse background color.\n // 115 - Reset Tektronix foreground color.\n // 116 - Reset Tektronix background color.\n // 117 - Reset highlight color.\n // 118 - Reset Tektronix cursor color.\n // 119 - Reset highlight foreground color.\n\n /**\n * ESC handlers\n */\n this._parser.registerEscHandler({ final: '7' }, () => this.saveCursor());\n this._parser.registerEscHandler({ final: '8' }, () => this.restoreCursor());\n this._parser.registerEscHandler({ final: 'D' }, () => this.index());\n this._parser.registerEscHandler({ final: 'E' }, () => this.nextLine());\n this._parser.registerEscHandler({ final: 'H' }, () => this.tabSet());\n this._parser.registerEscHandler({ final: 'M' }, () => this.reverseIndex());\n this._parser.registerEscHandler({ final: '=' }, () => this.keypadApplicationMode());\n this._parser.registerEscHandler({ final: '>' }, () => this.keypadNumericMode());\n this._parser.registerEscHandler({ final: 'c' }, () => this.fullReset());\n this._parser.registerEscHandler({ final: 'n' }, () => this.setgLevel(2));\n this._parser.registerEscHandler({ final: 'o' }, () => this.setgLevel(3));\n this._parser.registerEscHandler({ final: '|' }, () => this.setgLevel(3));\n this._parser.registerEscHandler({ final: '}' }, () => this.setgLevel(2));\n this._parser.registerEscHandler({ final: '~' }, () => this.setgLevel(1));\n this._parser.registerEscHandler({ intermediates: '%', final: '@' }, () => this.selectDefaultCharset());\n this._parser.registerEscHandler({ intermediates: '%', final: 'G' }, () => this.selectDefaultCharset());\n for (const flag in CHARSETS) {\n this._parser.registerEscHandler({ intermediates: '(', final: flag }, () => this.selectCharset('(' + flag));\n this._parser.registerEscHandler({ intermediates: ')', final: flag }, () => this.selectCharset(')' + flag));\n this._parser.registerEscHandler({ intermediates: '*', final: flag }, () => this.selectCharset('*' + flag));\n this._parser.registerEscHandler({ intermediates: '+', final: flag }, () => this.selectCharset('+' + flag));\n this._parser.registerEscHandler({ intermediates: '-', final: flag }, () => this.selectCharset('-' + flag));\n this._parser.registerEscHandler({ intermediates: '.', final: flag }, () => this.selectCharset('.' + flag));\n this._parser.registerEscHandler({ intermediates: '/', final: flag }, () => this.selectCharset('/' + flag)); // TODO: supported?\n }\n this._parser.registerEscHandler({ intermediates: '#', final: '8' }, () => this.screenAlignmentPattern());\n\n /**\n * error handler\n */\n this._parser.setErrorHandler((state: IParsingState) => {\n this._logService.error('Parsing error: ', state);\n return state;\n });\n\n /**\n * DCS handler\n */\n this._parser.registerDcsHandler({ intermediates: '$', final: 'q' }, new DECRQSS(this._bufferService, this._coreService, this._logService, this._optionsService));\n }\n\n public dispose(): void {\n super.dispose();\n }\n\n /**\n * Async parse support.\n */\n private _preserveStack(cursorStartX: number, cursorStartY: number, decodedLength: number, position: number): void {\n this._parseStack.paused = true;\n this._parseStack.cursorStartX = cursorStartX;\n this._parseStack.cursorStartY = cursorStartY;\n this._parseStack.decodedLength = decodedLength;\n this._parseStack.position = position;\n }\n\n private _logSlowResolvingAsync(p: Promise): void {\n // log a limited warning about an async handler taking too long\n if (this._logService.logLevel <= LogLevelEnum.WARN) {\n Promise.race([p, new Promise((res, rej) => setTimeout(() => rej('#SLOW_TIMEOUT'), SLOW_ASYNC_LIMIT))])\n .catch(err => {\n if (err !== '#SLOW_TIMEOUT') {\n throw err;\n }\n console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`);\n });\n }\n }\n\n /**\n * Parse call with async handler support.\n *\n * Whether the stack state got preserved for the next call, is indicated by the return value:\n * - undefined (void):\n * all handlers were sync, no stack save, continue normally with next chunk\n * - Promise\\:\n * execution stopped at async handler, stack saved, continue with\n * same chunk and the promise resolve value as `promiseResult` until the method returns `undefined`\n *\n * Note: This method should only be called by `Terminal.write` to ensure correct execution order and\n * proper continuation of async parser handlers.\n */\n public parse(data: string | Uint8Array, promiseResult?: boolean): void | Promise {\n let result: void | Promise;\n let cursorStartX = this._activeBuffer.x;\n let cursorStartY = this._activeBuffer.y;\n let start = 0;\n const wasPaused = this._parseStack.paused;\n\n if (wasPaused) {\n // assumption: _parseBuffer never mutates between async calls\n if (result = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, promiseResult)) {\n this._logSlowResolvingAsync(result);\n return result;\n }\n cursorStartX = this._parseStack.cursorStartX;\n cursorStartY = this._parseStack.cursorStartY;\n this._parseStack.paused = false;\n if (data.length > MAX_PARSEBUFFER_LENGTH) {\n start = this._parseStack.position + MAX_PARSEBUFFER_LENGTH;\n }\n }\n\n // Log debug data, the log level gate is to prevent extra work in this hot path\n if (this._logService.logLevel <= LogLevelEnum.DEBUG) {\n this._logService.debug(`parsing data${typeof data === 'string' ? ` \"${data}\"` : ` \"${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}\"`}`, typeof data === 'string'\n ? data.split('').map(e => e.charCodeAt(0))\n : data\n );\n }\n\n // resize input buffer if needed\n if (this._parseBuffer.length < data.length) {\n if (this._parseBuffer.length < MAX_PARSEBUFFER_LENGTH) {\n this._parseBuffer = new Uint32Array(Math.min(data.length, MAX_PARSEBUFFER_LENGTH));\n }\n }\n\n // Clear the dirty row service so we know which lines changed as a result of parsing\n // Important: do not clear between async calls, otherwise we lost pending update information.\n if (!wasPaused) {\n this._dirtyRowService.clearRange();\n }\n\n // process big data in smaller chunks\n if (data.length > MAX_PARSEBUFFER_LENGTH) {\n for (let i = start; i < data.length; i += MAX_PARSEBUFFER_LENGTH) {\n const end = i + MAX_PARSEBUFFER_LENGTH < data.length ? i + MAX_PARSEBUFFER_LENGTH : data.length;\n const len = (typeof data === 'string')\n ? this._stringDecoder.decode(data.substring(i, end), this._parseBuffer)\n : this._utf8Decoder.decode(data.subarray(i, end), this._parseBuffer);\n if (result = this._parser.parse(this._parseBuffer, len)) {\n this._preserveStack(cursorStartX, cursorStartY, len, i);\n this._logSlowResolvingAsync(result);\n return result;\n }\n }\n } else {\n if (!wasPaused) {\n const len = (typeof data === 'string')\n ? this._stringDecoder.decode(data, this._parseBuffer)\n : this._utf8Decoder.decode(data, this._parseBuffer);\n if (result = this._parser.parse(this._parseBuffer, len)) {\n this._preserveStack(cursorStartX, cursorStartY, len, 0);\n this._logSlowResolvingAsync(result);\n return result;\n }\n }\n }\n\n if (this._activeBuffer.x !== cursorStartX || this._activeBuffer.y !== cursorStartY) {\n this._onCursorMove.fire();\n }\n\n // Refresh any dirty rows accumulated as part of parsing\n this._onRequestRefreshRows.fire(this._dirtyRowService.start, this._dirtyRowService.end);\n }\n\n public print(data: Uint32Array, start: number, end: number): void {\n let code: number;\n let chWidth: number;\n const charset = this._charsetService.charset;\n const screenReaderMode = this._optionsService.rawOptions.screenReaderMode;\n const cols = this._bufferService.cols;\n const wraparoundMode = this._coreService.decPrivateModes.wraparound;\n const insertMode = this._coreService.modes.insertMode;\n const curAttr = this._curAttrData;\n let bufferRow = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n\n // handle wide chars: reset start_cell-1 if we would overwrite the second cell of a wide char\n if (this._activeBuffer.x && end - start > 0 && bufferRow.getWidth(this._activeBuffer.x - 1) === 2) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x - 1, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n\n for (let pos = start; pos < end; ++pos) {\n code = data[pos];\n\n // calculate print space\n // expensive call, therefore we save width in line buffer\n chWidth = this._unicodeService.wcwidth(code);\n\n // get charset replacement character\n // charset is only defined for ASCII, therefore we only\n // search for an replacement char if code < 127\n if (code < 127 && charset) {\n const ch = charset[String.fromCharCode(code)];\n if (ch) {\n code = ch.charCodeAt(0);\n }\n }\n\n if (screenReaderMode) {\n this._onA11yChar.fire(stringFromCodePoint(code));\n }\n\n // insert combining char at last cursor position\n // this._activeBuffer.x should never be 0 for a combining char\n // since they always follow a cell consuming char\n // therefore we can test for this._activeBuffer.x to avoid overflow left\n if (!chWidth && this._activeBuffer.x) {\n if (!bufferRow.getWidth(this._activeBuffer.x - 1)) {\n // found empty cell after fullwidth, need to go 2 cells back\n // it is save to step 2 cells back here\n // since an empty cell is only set by fullwidth chars\n bufferRow.addCodepointToCell(this._activeBuffer.x - 2, code);\n } else {\n bufferRow.addCodepointToCell(this._activeBuffer.x - 1, code);\n }\n continue;\n }\n\n // goto next line if ch would overflow\n // NOTE: To avoid costly width checks here,\n // the terminal does not allow a cols < 2.\n if (this._activeBuffer.x + chWidth - 1 >= cols) {\n // autowrap - DECAWM\n // automatically wraps to the beginning of the next line\n if (wraparoundMode) {\n // clear left over cells to the right\n while (this._activeBuffer.x < cols) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n this._activeBuffer.x = 0;\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData(), true);\n } else {\n if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n // The line already exists (eg. the initial viewport), mark it as a\n // wrapped line\n this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!.isWrapped = true;\n }\n // row changed, get it again\n bufferRow = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n } else {\n this._activeBuffer.x = cols - 1;\n if (chWidth === 2) {\n // FIXME: check for xterm behavior\n // What to do here? We got a wide char that does not fit into last cell\n continue;\n }\n }\n }\n\n // insert mode: move characters to right\n if (insertMode) {\n // right shift cells according to the width\n bufferRow.insertCells(this._activeBuffer.x, chWidth, this._activeBuffer.getNullCell(curAttr), curAttr);\n // test last cell - since the last cell has only room for\n // a halfwidth char any fullwidth shifted there is lost\n // and will be set to empty cell\n if (bufferRow.getWidth(cols - 1) === 2) {\n bufferRow.setCellFromCodePoint(cols - 1, NULL_CELL_CODE, NULL_CELL_WIDTH, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n }\n\n // write current char to buffer and advance cursor\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, code, chWidth, curAttr.fg, curAttr.bg, curAttr.extended);\n\n // fullwidth char - also set next cell to placeholder stub and advance cursor\n // for graphemes bigger than fullwidth we can simply loop to zero\n // we already made sure above, that this._activeBuffer.x + chWidth will not overflow right\n if (chWidth > 0) {\n while (--chWidth) {\n // other than a regular empty cell a cell following a wide char has no width\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, 0, 0, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n }\n }\n // store last char in Parser.precedingCodepoint for REP to work correctly\n // This needs to check whether:\n // - fullwidth + surrogates: reset\n // - combining: only base char gets carried on (bug in xterm?)\n if (end - start > 0) {\n bufferRow.loadCell(this._activeBuffer.x - 1, this._workCell);\n if (this._workCell.getWidth() === 2 || this._workCell.getCode() > 0xFFFF) {\n this._parser.precedingCodepoint = 0;\n } else if (this._workCell.isCombined()) {\n this._parser.precedingCodepoint = this._workCell.getChars().charCodeAt(0);\n } else {\n this._parser.precedingCodepoint = this._workCell.content;\n }\n }\n\n // handle wide chars: reset cell to the right if it is second cell of a wide char\n if (this._activeBuffer.x < cols && end - start > 0 && bufferRow.getWidth(this._activeBuffer.x) === 0 && !bufferRow.hasContent(this._activeBuffer.x)) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Forward registerCsiHandler from parser.\n */\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise): IDisposable {\n if (id.final === 't' && !id.prefix && !id.intermediates) {\n // security: always check whether window option is allowed\n return this._parser.registerCsiHandler(id, params => {\n if (!paramToWindowOption(params.params[0], this._optionsService.rawOptions.windowOptions)) {\n return true;\n }\n return callback(params);\n });\n }\n return this._parser.registerCsiHandler(id, callback);\n }\n\n /**\n * Forward registerDcsHandler from parser.\n */\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise): IDisposable {\n return this._parser.registerDcsHandler(id, new DcsHandler(callback));\n }\n\n /**\n * Forward registerEscHandler from parser.\n */\n public registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise): IDisposable {\n return this._parser.registerEscHandler(id, callback);\n }\n\n /**\n * Forward registerOscHandler from parser.\n */\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable {\n return this._parser.registerOscHandler(ident, new OscHandler(callback));\n }\n\n /**\n * BEL\n * Bell (Ctrl-G).\n *\n * @vt: #Y C0 BEL \"Bell\" \"\\a, \\x07\" \"Ring the bell.\"\n * The behavior of the bell is further customizable with `ITerminalOptions.bellStyle`\n * and `ITerminalOptions.bellSound`.\n */\n public bell(): boolean {\n this._onRequestBell.fire();\n return true;\n }\n\n /**\n * LF\n * Line Feed or New Line (NL). (LF is Ctrl-J).\n *\n * @vt: #Y C0 LF \"Line Feed\" \"\\n, \\x0A\" \"Move the cursor one row down, scrolling if needed.\"\n * Scrolling is restricted to scroll margins and will only happen on the bottom line.\n *\n * @vt: #Y C0 VT \"Vertical Tabulation\" \"\\v, \\x0B\" \"Treated as LF.\"\n * @vt: #Y C0 FF \"Form Feed\" \"\\f, \\x0C\" \"Treated as LF.\"\n */\n public lineFeed(): boolean {\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n if (this._optionsService.rawOptions.convertEol) {\n this._activeBuffer.x = 0;\n }\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData());\n } else if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n // If the end of the line is hit, prevent this action from wrapping around to the next line.\n if (this._activeBuffer.x >= this._bufferService.cols) {\n this._activeBuffer.x--;\n }\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n\n this._onLineFeed.fire();\n return true;\n }\n\n /**\n * CR\n * Carriage Return (Ctrl-M).\n *\n * @vt: #Y C0 CR \"Carriage Return\" \"\\r, \\x0D\" \"Move the cursor to the beginning of the row.\"\n */\n public carriageReturn(): boolean {\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * BS\n * Backspace (Ctrl-H).\n *\n * @vt: #Y C0 BS \"Backspace\" \"\\b, \\x08\" \"Move the cursor one position to the left.\"\n * By default it is not possible to move the cursor past the leftmost position.\n * If `reverse wrap-around` (`CSI ? 45 h`) is set, a previous soft line wrap (DECAWM)\n * can be undone with BS within the scroll margins. In that case the cursor will wrap back\n * to the end of the previous row. Note that it is not possible to peek back into the scrollbuffer\n * with the cursor, thus at the home position (top-leftmost cell) this has no effect.\n */\n public backspace(): boolean {\n // reverse wrap-around is disabled\n if (!this._coreService.decPrivateModes.reverseWraparound) {\n this._restrictCursor();\n if (this._activeBuffer.x > 0) {\n this._activeBuffer.x--;\n }\n return true;\n }\n\n // reverse wrap-around is enabled\n // other than for normal operation mode, reverse wrap-around allows the cursor\n // to be at x=cols to be able to address the last cell of a row by BS\n this._restrictCursor(this._bufferService.cols);\n\n if (this._activeBuffer.x > 0) {\n this._activeBuffer.x--;\n } else {\n /**\n * reverse wrap-around handling:\n * Our implementation deviates from xterm on purpose. Details:\n * - only previous soft NLs can be reversed (isWrapped=true)\n * - only works within scrollborders (top/bottom, left/right not yet supported)\n * - cannot peek into scrollbuffer\n * - any cursor movement sequence keeps working as expected\n */\n if (this._activeBuffer.x === 0\n && this._activeBuffer.y > this._activeBuffer.scrollTop\n && this._activeBuffer.y <= this._activeBuffer.scrollBottom\n && this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)?.isWrapped) {\n this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!.isWrapped = false;\n this._activeBuffer.y--;\n this._activeBuffer.x = this._bufferService.cols - 1;\n // find last taken cell - last cell can have 3 different states:\n // - hasContent(true) + hasWidth(1): narrow char - we are done\n // - hasWidth(0): second part of wide char - we are done\n // - hasContent(false) + hasWidth(1): empty cell due to early wrapping wide char, go one cell further back\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n if (line.hasWidth(this._activeBuffer.x) && !line.hasContent(this._activeBuffer.x)) {\n this._activeBuffer.x--;\n // We do this only once, since width=1 + hasContent=false currently happens only once before\n // early wrapping of a wide char.\n // This needs to be fixed once we support graphemes taking more than 2 cells.\n }\n }\n }\n this._restrictCursor();\n return true;\n }\n\n /**\n * TAB\n * Horizontal Tab (HT) (Ctrl-I).\n *\n * @vt: #Y C0 HT \"Horizontal Tabulation\" \"\\t, \\x09\" \"Move the cursor to the next character tab stop.\"\n */\n public tab(): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n const originalX = this._activeBuffer.x;\n this._activeBuffer.x = this._activeBuffer.nextStop();\n if (this._optionsService.rawOptions.screenReaderMode) {\n this._onA11yTab.fire(this._activeBuffer.x - originalX);\n }\n return true;\n }\n\n /**\n * SO\n * Shift Out (Ctrl-N) -> Switch to Alternate Character Set. This invokes the\n * G1 character set.\n *\n * @vt: #P[Only limited ISO-2022 charset support.] C0 SO \"Shift Out\" \"\\x0E\" \"Switch to an alternative character set.\"\n */\n public shiftOut(): boolean {\n this._charsetService.setgLevel(1);\n return true;\n }\n\n /**\n * SI\n * Shift In (Ctrl-O) -> Switch to Standard Character Set. This invokes the G0\n * character set (the default).\n *\n * @vt: #Y C0 SI \"Shift In\" \"\\x0F\" \"Return to regular character set after Shift Out.\"\n */\n public shiftIn(): boolean {\n this._charsetService.setgLevel(0);\n return true;\n }\n\n /**\n * Restrict cursor to viewport size / scroll margin (origin mode).\n */\n private _restrictCursor(maxCol: number = this._bufferService.cols - 1): void {\n this._activeBuffer.x = Math.min(maxCol, Math.max(0, this._activeBuffer.x));\n this._activeBuffer.y = this._coreService.decPrivateModes.origin\n ? Math.min(this._activeBuffer.scrollBottom, Math.max(this._activeBuffer.scrollTop, this._activeBuffer.y))\n : Math.min(this._bufferService.rows - 1, Math.max(0, this._activeBuffer.y));\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Set absolute cursor position.\n */\n private _setCursor(x: number, y: number): void {\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n if (this._coreService.decPrivateModes.origin) {\n this._activeBuffer.x = x;\n this._activeBuffer.y = this._activeBuffer.scrollTop + y;\n } else {\n this._activeBuffer.x = x;\n this._activeBuffer.y = y;\n }\n this._restrictCursor();\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Set relative cursor position.\n */\n private _moveCursor(x: number, y: number): void {\n // for relative changes we have to make sure we are within 0 .. cols/rows - 1\n // before calculating the new position\n this._restrictCursor();\n this._setCursor(this._activeBuffer.x + x, this._activeBuffer.y + y);\n }\n\n /**\n * CSI Ps A\n * Cursor Up Ps Times (default = 1) (CUU).\n *\n * @vt: #Y CSI CUU \"Cursor Up\" \"CSI Ps A\" \"Move cursor `Ps` times up (default=1).\"\n * If the cursor would pass the top scroll margin, it will stop there.\n */\n public cursorUp(params: IParams): boolean {\n // stop at scrollTop\n const diffToTop = this._activeBuffer.y - this._activeBuffer.scrollTop;\n if (diffToTop >= 0) {\n this._moveCursor(0, -Math.min(diffToTop, params.params[0] || 1));\n } else {\n this._moveCursor(0, -(params.params[0] || 1));\n }\n return true;\n }\n\n /**\n * CSI Ps B\n * Cursor Down Ps Times (default = 1) (CUD).\n *\n * @vt: #Y CSI CUD \"Cursor Down\" \"CSI Ps B\" \"Move cursor `Ps` times down (default=1).\"\n * If the cursor would pass the bottom scroll margin, it will stop there.\n */\n public cursorDown(params: IParams): boolean {\n // stop at scrollBottom\n const diffToBottom = this._activeBuffer.scrollBottom - this._activeBuffer.y;\n if (diffToBottom >= 0) {\n this._moveCursor(0, Math.min(diffToBottom, params.params[0] || 1));\n } else {\n this._moveCursor(0, params.params[0] || 1);\n }\n return true;\n }\n\n /**\n * CSI Ps C\n * Cursor Forward Ps Times (default = 1) (CUF).\n *\n * @vt: #Y CSI CUF \"Cursor Forward\" \"CSI Ps C\" \"Move cursor `Ps` times forward (default=1).\"\n */\n public cursorForward(params: IParams): boolean {\n this._moveCursor(params.params[0] || 1, 0);\n return true;\n }\n\n /**\n * CSI Ps D\n * Cursor Backward Ps Times (default = 1) (CUB).\n *\n * @vt: #Y CSI CUB \"Cursor Backward\" \"CSI Ps D\" \"Move cursor `Ps` times backward (default=1).\"\n */\n public cursorBackward(params: IParams): boolean {\n this._moveCursor(-(params.params[0] || 1), 0);\n return true;\n }\n\n /**\n * CSI Ps E\n * Cursor Next Line Ps Times (default = 1) (CNL).\n * Other than cursorDown (CUD) also set the cursor to first column.\n *\n * @vt: #Y CSI CNL \"Cursor Next Line\" \"CSI Ps E\" \"Move cursor `Ps` times down (default=1) and to the first column.\"\n * Same as CUD, additionally places the cursor at the first column.\n */\n public cursorNextLine(params: IParams): boolean {\n this.cursorDown(params);\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * CSI Ps F\n * Cursor Previous Line Ps Times (default = 1) (CPL).\n * Other than cursorUp (CUU) also set the cursor to first column.\n *\n * @vt: #Y CSI CPL \"Cursor Backward\" \"CSI Ps F\" \"Move cursor `Ps` times up (default=1) and to the first column.\"\n * Same as CUU, additionally places the cursor at the first column.\n */\n public cursorPrecedingLine(params: IParams): boolean {\n this.cursorUp(params);\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * CSI Ps G\n * Cursor Character Absolute [column] (default = [row,1]) (CHA).\n *\n * @vt: #Y CSI CHA \"Cursor Horizontal Absolute\" \"CSI Ps G\" \"Move cursor to `Ps`-th column of the active row (default=1).\"\n */\n public cursorCharAbsolute(params: IParams): boolean {\n this._setCursor((params.params[0] || 1) - 1, this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Ps ; Ps H\n * Cursor Position [row;column] (default = [1,1]) (CUP).\n *\n * @vt: #Y CSI CUP \"Cursor Position\" \"CSI Ps ; Ps H\" \"Set cursor to position [`Ps`, `Ps`] (default = [1, 1]).\"\n * If ORIGIN mode is set, places the cursor to the absolute position within the scroll margins.\n * If ORIGIN mode is not set, places the cursor to the absolute position within the viewport.\n * Note that the coordinates are 1-based, thus the top left position starts at `1 ; 1`.\n */\n public cursorPosition(params: IParams): boolean {\n this._setCursor(\n // col\n (params.length >= 2) ? (params.params[1] || 1) - 1 : 0,\n // row\n (params.params[0] || 1) - 1\n );\n return true;\n }\n\n /**\n * CSI Pm ` Character Position Absolute\n * [column] (default = [row,1]) (HPA).\n * Currently same functionality as CHA.\n *\n * @vt: #Y CSI HPA \"Horizontal Position Absolute\" \"CSI Ps ` \" \"Same as CHA.\"\n */\n public charPosAbsolute(params: IParams): boolean {\n this._setCursor((params.params[0] || 1) - 1, this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Pm a Character Position Relative\n * [columns] (default = [row,col+1]) (HPR)\n *\n * @vt: #Y CSI HPR \"Horizontal Position Relative\" \"CSI Ps a\" \"Same as CUF.\"\n */\n public hPositionRelative(params: IParams): boolean {\n this._moveCursor(params.params[0] || 1, 0);\n return true;\n }\n\n /**\n * CSI Pm d Vertical Position Absolute (VPA)\n * [row] (default = [1,column])\n *\n * @vt: #Y CSI VPA \"Vertical Position Absolute\" \"CSI Ps d\" \"Move cursor to `Ps`-th row (default=1).\"\n */\n public linePosAbsolute(params: IParams): boolean {\n this._setCursor(this._activeBuffer.x, (params.params[0] || 1) - 1);\n return true;\n }\n\n /**\n * CSI Pm e Vertical Position Relative (VPR)\n * [rows] (default = [row+1,column])\n * reuse CSI Ps B ?\n *\n * @vt: #Y CSI VPR \"Vertical Position Relative\" \"CSI Ps e\" \"Move cursor `Ps` times down (default=1).\"\n */\n public vPositionRelative(params: IParams): boolean {\n this._moveCursor(0, params.params[0] || 1);\n return true;\n }\n\n /**\n * CSI Ps ; Ps f\n * Horizontal and Vertical Position [row;column] (default =\n * [1,1]) (HVP).\n * Same as CUP.\n *\n * @vt: #Y CSI HVP \"Horizontal and Vertical Position\" \"CSI Ps ; Ps f\" \"Same as CUP.\"\n */\n public hVPosition(params: IParams): boolean {\n this.cursorPosition(params);\n return true;\n }\n\n /**\n * CSI Ps g Tab Clear (TBC).\n * Ps = 0 -> Clear Current Column (default).\n * Ps = 3 -> Clear All.\n * Potentially:\n * Ps = 2 -> Clear Stops on Line.\n * http://vt100.net/annarbor/aaa-ug/section6.html\n *\n * @vt: #Y CSI TBC \"Tab Clear\" \"CSI Ps g\" \"Clear tab stops at current position (0) or all (3) (default=0).\"\n * Clearing tabstops off the active row (Ps = 2, VT100) is currently not supported.\n */\n public tabClear(params: IParams): boolean {\n const param = params.params[0];\n if (param === 0) {\n delete this._activeBuffer.tabs[this._activeBuffer.x];\n } else if (param === 3) {\n this._activeBuffer.tabs = {};\n }\n return true;\n }\n\n /**\n * CSI Ps I\n * Cursor Forward Tabulation Ps tab stops (default = 1) (CHT).\n *\n * @vt: #Y CSI CHT \"Cursor Horizontal Tabulation\" \"CSI Ps I\" \"Move cursor `Ps` times tabs forward (default=1).\"\n */\n public cursorForwardTab(params: IParams): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n let param = params.params[0] || 1;\n while (param--) {\n this._activeBuffer.x = this._activeBuffer.nextStop();\n }\n return true;\n }\n\n /**\n * CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT).\n *\n * @vt: #Y CSI CBT \"Cursor Backward Tabulation\" \"CSI Ps Z\" \"Move cursor `Ps` tabs backward (default=1).\"\n */\n public cursorBackwardTab(params: IParams): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.x = this._activeBuffer.prevStop();\n }\n return true;\n }\n\n\n /**\n * Helper method to erase cells in a terminal row.\n * The cell gets replaced with the eraseChar of the terminal.\n * @param y row index\n * @param start first cell index to be erased\n * @param end end - 1 is last erased cell\n * @param cleanWrap clear the isWrapped flag\n */\n private _eraseInBufferLine(y: number, start: number, end: number, clearWrap: boolean = false): void {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.replaceCells(\n start,\n end,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n if (clearWrap) {\n line.isWrapped = false;\n }\n }\n\n /**\n * Helper method to reset cells in a terminal row.\n * The cell gets replaced with the eraseChar of the terminal and the isWrapped property is set to false.\n * @param y row index\n */\n private _resetBufferLine(y: number): void {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.fill(this._activeBuffer.getNullCell(this._eraseAttrData()));\n this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + y);\n line.isWrapped = false;\n }\n\n /**\n * CSI Ps J Erase in Display (ED).\n * Ps = 0 -> Erase Below (default).\n * Ps = 1 -> Erase Above.\n * Ps = 2 -> Erase All.\n * Ps = 3 -> Erase Saved Lines (xterm).\n * CSI ? Ps J\n * Erase in Display (DECSED).\n * Ps = 0 -> Selective Erase Below (default).\n * Ps = 1 -> Selective Erase Above.\n * Ps = 2 -> Selective Erase All.\n *\n * @vt: #Y CSI ED \"Erase In Display\" \"CSI Ps J\" \"Erase various parts of the viewport.\"\n * Supported param values:\n *\n * | Ps | Effect |\n * | -- | ------------------------------------------------------------ |\n * | 0 | Erase from the cursor through the end of the viewport. |\n * | 1 | Erase from the beginning of the viewport through the cursor. |\n * | 2 | Erase complete viewport. |\n * | 3 | Erase scrollback. |\n *\n * @vt: #P[Protection attributes are not supported.] CSI DECSED \"Selective Erase In Display\" \"CSI ? Ps J\" \"Currently the same as ED.\"\n */\n public eraseInDisplay(params: IParams): boolean {\n this._restrictCursor(this._bufferService.cols);\n let j;\n switch (params.params[0]) {\n case 0:\n j = this._activeBuffer.y;\n this._dirtyRowService.markDirty(j);\n this._eraseInBufferLine(j++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0);\n for (; j < this._bufferService.rows; j++) {\n this._resetBufferLine(j);\n }\n this._dirtyRowService.markDirty(j);\n break;\n case 1:\n j = this._activeBuffer.y;\n this._dirtyRowService.markDirty(j);\n // Deleted front part of line and everything before. This line will no longer be wrapped.\n this._eraseInBufferLine(j, 0, this._activeBuffer.x + 1, true);\n if (this._activeBuffer.x + 1 >= this._bufferService.cols) {\n // Deleted entire previous line. This next line can no longer be wrapped.\n this._activeBuffer.lines.get(j + 1)!.isWrapped = false;\n }\n while (j--) {\n this._resetBufferLine(j);\n }\n this._dirtyRowService.markDirty(0);\n break;\n case 2:\n j = this._bufferService.rows;\n this._dirtyRowService.markDirty(j - 1);\n while (j--) {\n this._resetBufferLine(j);\n }\n this._dirtyRowService.markDirty(0);\n break;\n case 3:\n // Clear scrollback (everything not in viewport)\n const scrollBackSize = this._activeBuffer.lines.length - this._bufferService.rows;\n if (scrollBackSize > 0) {\n this._activeBuffer.lines.trimStart(scrollBackSize);\n this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - scrollBackSize, 0);\n this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - scrollBackSize, 0);\n // Force a scroll event to refresh viewport\n this._onScroll.fire(0);\n }\n break;\n }\n return true;\n }\n\n /**\n * CSI Ps K Erase in Line (EL).\n * Ps = 0 -> Erase to Right (default).\n * Ps = 1 -> Erase to Left.\n * Ps = 2 -> Erase All.\n * CSI ? Ps K\n * Erase in Line (DECSEL).\n * Ps = 0 -> Selective Erase to Right (default).\n * Ps = 1 -> Selective Erase to Left.\n * Ps = 2 -> Selective Erase All.\n *\n * @vt: #Y CSI EL \"Erase In Line\" \"CSI Ps K\" \"Erase various parts of the active row.\"\n * Supported param values:\n *\n * | Ps | Effect |\n * | -- | -------------------------------------------------------- |\n * | 0 | Erase from the cursor through the end of the row. |\n * | 1 | Erase from the beginning of the line through the cursor. |\n * | 2 | Erase complete line. |\n *\n * @vt: #P[Protection attributes are not supported.] CSI DECSEL \"Selective Erase In Line\" \"CSI ? Ps K\" \"Currently the same as EL.\"\n */\n public eraseInLine(params: IParams): boolean {\n this._restrictCursor(this._bufferService.cols);\n switch (params.params[0]) {\n case 0:\n this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0);\n break;\n case 1:\n this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, false);\n break;\n case 2:\n this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, true);\n break;\n }\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Ps L\n * Insert Ps Line(s) (default = 1) (IL).\n *\n * @vt: #Y CSI IL \"Insert Line\" \"CSI Ps L\" \"Insert `Ps` blank lines at active row (default=1).\"\n * For every inserted line at the scroll top one line at the scroll bottom gets removed.\n * The cursor is set to the first column.\n * IL has no effect if the cursor is outside the scroll margins.\n */\n public insertLines(params: IParams): boolean {\n this._restrictCursor();\n let param = params.params[0] || 1;\n\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n\n const row: number = this._activeBuffer.ybase + this._activeBuffer.y;\n\n const scrollBottomRowsOffset = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom;\n const scrollBottomAbsolute = this._bufferService.rows - 1 + this._activeBuffer.ybase - scrollBottomRowsOffset + 1;\n while (param--) {\n // test: echo -e '\\e[44m\\e[1L\\e[0m'\n // blankLine(true) - xterm/linux behavior\n this._activeBuffer.lines.splice(scrollBottomAbsolute - 1, 1);\n this._activeBuffer.lines.splice(row, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n\n this._dirtyRowService.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom);\n this._activeBuffer.x = 0; // see https://vt100.net/docs/vt220-rm/chapter4.html - vt220 only?\n return true;\n }\n\n /**\n * CSI Ps M\n * Delete Ps Line(s) (default = 1) (DL).\n *\n * @vt: #Y CSI DL \"Delete Line\" \"CSI Ps M\" \"Delete `Ps` lines at active row (default=1).\"\n * For every deleted line at the scroll top one blank line at the scroll bottom gets appended.\n * The cursor is set to the first column.\n * DL has no effect if the cursor is outside the scroll margins.\n */\n public deleteLines(params: IParams): boolean {\n this._restrictCursor();\n let param = params.params[0] || 1;\n\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n\n const row: number = this._activeBuffer.ybase + this._activeBuffer.y;\n\n let j: number;\n j = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom;\n j = this._bufferService.rows - 1 + this._activeBuffer.ybase - j;\n while (param--) {\n // test: echo -e '\\e[44m\\e[1M\\e[0m'\n // blankLine(true) - xterm/linux behavior\n this._activeBuffer.lines.splice(row, 1);\n this._activeBuffer.lines.splice(j, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n\n this._dirtyRowService.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom);\n this._activeBuffer.x = 0; // see https://vt100.net/docs/vt220-rm/chapter4.html - vt220 only?\n return true;\n }\n\n /**\n * CSI Ps @\n * Insert Ps (Blank) Character(s) (default = 1) (ICH).\n *\n * @vt: #Y CSI ICH \"Insert Characters\" \"CSI Ps @\" \"Insert `Ps` (blank) characters (default = 1).\"\n * The ICH sequence inserts `Ps` blank characters. The cursor remains at the beginning of the blank characters.\n * Text between the cursor and right margin moves to the right. Characters moved past the right margin are lost.\n *\n *\n * FIXME: check against xterm - should not work outside of scroll margins (see VT520 manual)\n */\n public insertChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.insertCells(\n this._activeBuffer.x,\n params.params[0] || 1,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps P\n * Delete Ps Character(s) (default = 1) (DCH).\n *\n * @vt: #Y CSI DCH \"Delete Character\" \"CSI Ps P\" \"Delete `Ps` characters (default=1).\"\n * As characters are deleted, the remaining characters between the cursor and right margin move to the left.\n * Character attributes move with the characters. The terminal adds blank characters at the right margin.\n *\n *\n * FIXME: check against xterm - should not work outside of scroll margins (see VT520 manual)\n */\n public deleteChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.deleteCells(\n this._activeBuffer.x,\n params.params[0] || 1,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps S Scroll up Ps lines (default = 1) (SU).\n *\n * @vt: #Y CSI SU \"Scroll Up\" \"CSI Ps S\" \"Scroll `Ps` lines up (default=1).\"\n *\n *\n * FIXME: scrolled out lines at top = 1 should add to scrollback (xterm)\n */\n public scrollUp(params: IParams): boolean {\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 1);\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps T Scroll down Ps lines (default = 1) (SD).\n *\n * @vt: #Y CSI SD \"Scroll Down\" \"CSI Ps T\" \"Scroll `Ps` lines down (default=1).\"\n */\n public scrollDown(params: IParams): boolean {\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 1);\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 0, this._activeBuffer.getBlankLine(DEFAULT_ATTR_DATA));\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps SP @ Scroll left Ps columns (default = 1) (SL) ECMA-48\n *\n * Notation: (Pn)\n * Representation: CSI Pn 02/00 04/00\n * Parameter default value: Pn = 1\n * SL causes the data in the presentation component to be moved by n character positions\n * if the line orientation is horizontal, or by n line positions if the line orientation\n * is vertical, such that the data appear to move to the left; where n equals the value of Pn.\n * The active presentation position is not affected by this control function.\n *\n * Supported:\n * - always left shift (no line orientation setting respected)\n *\n * @vt: #Y CSI SL \"Scroll Left\" \"CSI Ps SP @\" \"Scroll viewport `Ps` times to the left.\"\n * SL moves the content of all lines within the scroll margins `Ps` times to the left.\n * SL has no effect outside of the scroll margins.\n */\n public scrollLeft(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.deleteCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps SP A Scroll right Ps columns (default = 1) (SR) ECMA-48\n *\n * Notation: (Pn)\n * Representation: CSI Pn 02/00 04/01\n * Parameter default value: Pn = 1\n * SR causes the data in the presentation component to be moved by n character positions\n * if the line orientation is horizontal, or by n line positions if the line orientation\n * is vertical, such that the data appear to move to the right; where n equals the value of Pn.\n * The active presentation position is not affected by this control function.\n *\n * Supported:\n * - always right shift (no line orientation setting respected)\n *\n * @vt: #Y CSI SR \"Scroll Right\" \"CSI Ps SP A\" \"Scroll viewport `Ps` times to the right.\"\n * SL moves the content of all lines within the scroll margins `Ps` times to the right.\n * Content at the right margin is lost.\n * SL has no effect outside of the scroll margins.\n */\n public scrollRight(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.insertCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Pm ' }\n * Insert Ps Column(s) (default = 1) (DECIC), VT420 and up.\n *\n * @vt: #Y CSI DECIC \"Insert Columns\" \"CSI Ps ' }\" \"Insert `Ps` columns at cursor position.\"\n * DECIC inserts `Ps` times blank columns at the cursor position for all lines with the scroll margins,\n * moving content to the right. Content at the right margin is lost.\n * DECIC has no effect outside the scrolling margins.\n */\n public insertColumns(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.insertCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Pm ' ~\n * Delete Ps Column(s) (default = 1) (DECDC), VT420 and up.\n *\n * @vt: #Y CSI DECDC \"Delete Columns\" \"CSI Ps ' ~\" \"Delete `Ps` columns at cursor position.\"\n * DECDC deletes `Ps` times columns at the cursor position for all lines with the scroll margins,\n * moving content to the left. Blank columns are added at the right margin.\n * DECDC has no effect outside the scrolling margins.\n */\n public deleteColumns(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.deleteCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps X\n * Erase Ps Character(s) (default = 1) (ECH).\n *\n * @vt: #Y CSI ECH \"Erase Character\" \"CSI Ps X\" \"Erase `Ps` characters from current cursor position to the right (default=1).\"\n * ED erases `Ps` characters from current cursor position to the right.\n * ED works inside or outside the scrolling margins.\n */\n public eraseChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.replaceCells(\n this._activeBuffer.x,\n this._activeBuffer.x + (params.params[0] || 1),\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps b Repeat the preceding graphic character Ps times (REP).\n * From ECMA 48 (@see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf)\n * Notation: (Pn)\n * Representation: CSI Pn 06/02\n * Parameter default value: Pn = 1\n * REP is used to indicate that the preceding character in the data stream,\n * if it is a graphic character (represented by one or more bit combinations) including SPACE,\n * is to be repeated n times, where n equals the value of Pn.\n * If the character preceding REP is a control function or part of a control function,\n * the effect of REP is not defined by this Standard.\n *\n * Since we propagate the terminal as xterm-256color we have to follow xterm's behavior:\n * - fullwidth + surrogate chars are ignored\n * - for combining chars only the base char gets repeated\n * - text attrs are applied normally\n * - wrap around is respected\n * - any valid sequence resets the carried forward char\n *\n * Note: To get reset on a valid sequence working correctly without much runtime penalty,\n * the preceding codepoint is stored on the parser in `this.print` and reset during `parser.parse`.\n *\n * @vt: #Y CSI REP \"Repeat Preceding Character\" \"CSI Ps b\" \"Repeat preceding character `Ps` times (default=1).\"\n * REP repeats the previous character `Ps` times advancing the cursor, also wrapping if DECAWM is set.\n * REP has no effect if the sequence does not follow a printable ASCII character\n * (NOOP for any other sequence in between or NON ASCII characters).\n */\n public repeatPrecedingCharacter(params: IParams): boolean {\n if (!this._parser.precedingCodepoint) {\n return true;\n }\n // call print to insert the chars and handle correct wrapping\n const length = params.params[0] || 1;\n const data = new Uint32Array(length);\n for (let i = 0; i < length; ++i) {\n data[i] = this._parser.precedingCodepoint;\n }\n this.print(data, 0, data.length);\n return true;\n }\n\n /**\n * CSI Ps c Send Device Attributes (Primary DA).\n * Ps = 0 or omitted -> request attributes from terminal. The\n * response depends on the decTerminalID resource setting.\n * -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'')\n * -> CSI ? 1 ; 0 c (``VT101 with No Options'')\n * -> CSI ? 6 c (``VT102'')\n * -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'')\n * The VT100-style response parameters do not mean anything by\n * themselves. VT220 parameters do, telling the host what fea-\n * tures the terminal supports:\n * Ps = 1 -> 132-columns.\n * Ps = 2 -> Printer.\n * Ps = 6 -> Selective erase.\n * Ps = 8 -> User-defined keys.\n * Ps = 9 -> National replacement character sets.\n * Ps = 1 5 -> Technical characters.\n * Ps = 2 2 -> ANSI color, e.g., VT525.\n * Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode).\n *\n * @vt: #Y CSI DA1 \"Primary Device Attributes\" \"CSI c\" \"Send primary device attributes.\"\n *\n *\n * TODO: fix and cleanup response\n */\n public sendDeviceAttributesPrimary(params: IParams): boolean {\n if (params.params[0] > 0) {\n return true;\n }\n if (this._is('xterm') || this._is('rxvt-unicode') || this._is('screen')) {\n this._coreService.triggerDataEvent(C0.ESC + '[?1;2c');\n } else if (this._is('linux')) {\n this._coreService.triggerDataEvent(C0.ESC + '[?6c');\n }\n return true;\n }\n\n /**\n * CSI > Ps c\n * Send Device Attributes (Secondary DA).\n * Ps = 0 or omitted -> request the terminal's identification\n * code. The response depends on the decTerminalID resource set-\n * ting. It should apply only to VT220 and up, but xterm extends\n * this to VT100.\n * -> CSI > Pp ; Pv ; Pc c\n * where Pp denotes the terminal type\n * Pp = 0 -> ``VT100''.\n * Pp = 1 -> ``VT220''.\n * and Pv is the firmware version (for xterm, this was originally\n * the XFree86 patch number, starting with 95). In a DEC termi-\n * nal, Pc indicates the ROM cartridge registration number and is\n * always zero.\n * More information:\n * xterm/charproc.c - line 2012, for more information.\n * vim responds with ^[[?0c or ^[[?1c after the terminal's response (?)\n *\n * @vt: #Y CSI DA2 \"Secondary Device Attributes\" \"CSI > c\" \"Send primary device attributes.\"\n *\n *\n * TODO: fix and cleanup response\n */\n public sendDeviceAttributesSecondary(params: IParams): boolean {\n if (params.params[0] > 0) {\n return true;\n }\n // xterm and urxvt\n // seem to spit this\n // out around ~370 times (?).\n if (this._is('xterm')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>0;276;0c');\n } else if (this._is('rxvt-unicode')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>85;95;0c');\n } else if (this._is('linux')) {\n // not supported by linux console.\n // linux console echoes parameters.\n this._coreService.triggerDataEvent(params.params[0] + 'c');\n } else if (this._is('screen')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>83;40003;0c');\n }\n return true;\n }\n\n /**\n * Evaluate if the current terminal is the given argument.\n * @param term The terminal name to evaluate\n */\n private _is(term: string): boolean {\n return (this._optionsService.rawOptions.termName + '').indexOf(term) === 0;\n }\n\n /**\n * CSI Pm h Set Mode (SM).\n * Ps = 2 -> Keyboard Action Mode (AM).\n * Ps = 4 -> Insert Mode (IRM).\n * Ps = 1 2 -> Send/receive (SRM).\n * Ps = 2 0 -> Automatic Newline (LNM).\n *\n * @vt: #P[Only IRM is supported.] CSI SM \"Set Mode\" \"CSI Pm h\" \"Set various terminal modes.\"\n * Supported param values by SM:\n *\n * | Param | Action | Support |\n * | ----- | -------------------------------------- | ------- |\n * | 2 | Keyboard Action Mode (KAM). Always on. | #N |\n * | 4 | Insert Mode (IRM). | #Y |\n * | 12 | Send/receive (SRM). Always off. | #N |\n * | 20 | Automatic Newline (LNM). Always off. | #N |\n */\n public setMode(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 4:\n this._coreService.modes.insertMode = true;\n break;\n case 20:\n // this._t.convertEol = true;\n break;\n }\n }\n return true;\n }\n\n /**\n * CSI ? Pm h\n * DEC Private Mode Set (DECSET).\n * Ps = 1 -> Application Cursor Keys (DECCKM).\n * Ps = 2 -> Designate USASCII for character sets G0-G3\n * (DECANM), and set VT100 mode.\n * Ps = 3 -> 132 Column Mode (DECCOLM).\n * Ps = 4 -> Smooth (Slow) Scroll (DECSCLM).\n * Ps = 5 -> Reverse Video (DECSCNM).\n * Ps = 6 -> Origin Mode (DECOM).\n * Ps = 7 -> Wraparound Mode (DECAWM).\n * Ps = 8 -> Auto-repeat Keys (DECARM).\n * Ps = 9 -> Send Mouse X & Y on button press. See the sec-\n * tion Mouse Tracking.\n * Ps = 1 0 -> Show toolbar (rxvt).\n * Ps = 1 2 -> Start Blinking Cursor (att610).\n * Ps = 1 8 -> Print form feed (DECPFF).\n * Ps = 1 9 -> Set print extent to full screen (DECPEX).\n * Ps = 2 5 -> Show Cursor (DECTCEM).\n * Ps = 3 0 -> Show scrollbar (rxvt).\n * Ps = 3 5 -> Enable font-shifting functions (rxvt).\n * Ps = 3 8 -> Enter Tektronix Mode (DECTEK).\n * Ps = 4 0 -> Allow 80 -> 132 Mode.\n * Ps = 4 1 -> more(1) fix (see curses resource).\n * Ps = 4 2 -> Enable Nation Replacement Character sets (DECN-\n * RCM).\n * Ps = 4 4 -> Turn On Margin Bell.\n * Ps = 4 5 -> Reverse-wraparound Mode.\n * Ps = 4 6 -> Start Logging. This is normally disabled by a\n * compile-time option.\n * Ps = 4 7 -> Use Alternate Screen Buffer. (This may be dis-\n * abled by the titeInhibit resource).\n * Ps = 6 6 -> Application keypad (DECNKM).\n * Ps = 6 7 -> Backarrow key sends backspace (DECBKM).\n * Ps = 1 0 0 0 -> Send Mouse X & Y on button press and\n * release. See the section Mouse Tracking.\n * Ps = 1 0 0 1 -> Use Hilite Mouse Tracking.\n * Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking.\n * Ps = 1 0 0 3 -> Use All Motion Mouse Tracking.\n * Ps = 1 0 0 4 -> Send FocusIn/FocusOut events.\n * Ps = 1 0 0 5 -> Enable Extended Mouse Mode.\n * Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt).\n * Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt).\n * Ps = 1 0 3 4 -> Interpret \"meta\" key, sets eighth bit.\n * (enables the eightBitInput resource).\n * Ps = 1 0 3 5 -> Enable special modifiers for Alt and Num-\n * Lock keys. (This enables the numLock resource).\n * Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This\n * enables the metaSendsEscape resource).\n * Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete\n * key.\n * Ps = 1 0 3 9 -> Send ESC when Alt modifies a key. (This\n * enables the altSendsEscape resource).\n * Ps = 1 0 4 0 -> Keep selection even if not highlighted.\n * (This enables the keepSelection resource).\n * Ps = 1 0 4 1 -> Use the CLIPBOARD selection. (This enables\n * the selectToClipboard resource).\n * Ps = 1 0 4 2 -> Enable Urgency window manager hint when\n * Control-G is received. (This enables the bellIsUrgent\n * resource).\n * Ps = 1 0 4 3 -> Enable raising of the window when Control-G\n * is received. (enables the popOnBell resource).\n * Ps = 1 0 4 7 -> Use Alternate Screen Buffer. (This may be\n * disabled by the titeInhibit resource).\n * Ps = 1 0 4 8 -> Save cursor as in DECSC. (This may be dis-\n * abled by the titeInhibit resource).\n * Ps = 1 0 4 9 -> Save cursor as in DECSC and use Alternate\n * Screen Buffer, clearing it first. (This may be disabled by\n * the titeInhibit resource). This combines the effects of the 1\n * 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based\n * applications rather than the 4 7 mode.\n * Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode.\n * Ps = 1 0 5 1 -> Set Sun function-key mode.\n * Ps = 1 0 5 2 -> Set HP function-key mode.\n * Ps = 1 0 5 3 -> Set SCO function-key mode.\n * Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6).\n * Ps = 1 0 6 1 -> Set VT220 keyboard emulation.\n * Ps = 2 0 0 4 -> Set bracketed paste mode.\n * Modes:\n * http: *vt100.net/docs/vt220-rm/chapter4.html\n *\n * @vt: #P[See below for supported modes.] CSI DECSET \"DEC Private Set Mode\" \"CSI ? Pm h\" \"Set various terminal attributes.\"\n * Supported param values by DECSET:\n *\n * | param | Action | Support |\n * | ----- | ------------------------------------------------------- | --------|\n * | 1 | Application Cursor Keys (DECCKM). | #Y |\n * | 2 | Designate US-ASCII for character sets G0-G3 (DECANM). | #Y |\n * | 3 | 132 Column Mode (DECCOLM). | #Y |\n * | 6 | Origin Mode (DECOM). | #Y |\n * | 7 | Auto-wrap Mode (DECAWM). | #Y |\n * | 8 | Auto-repeat Keys (DECARM). Always on. | #N |\n * | 9 | X10 xterm mouse protocol. | #Y |\n * | 12 | Start Blinking Cursor. | #Y |\n * | 25 | Show Cursor (DECTCEM). | #Y |\n * | 45 | Reverse wrap-around. | #Y |\n * | 47 | Use Alternate Screen Buffer. | #Y |\n * | 66 | Application keypad (DECNKM). | #Y |\n * | 1000 | X11 xterm mouse protocol. | #Y |\n * | 1002 | Use Cell Motion Mouse Tracking. | #Y |\n * | 1003 | Use All Motion Mouse Tracking. | #Y |\n * | 1004 | Send FocusIn/FocusOut events | #Y |\n * | 1005 | Enable UTF-8 Mouse Mode. | #N |\n * | 1006 | Enable SGR Mouse Mode. | #Y |\n * | 1015 | Enable urxvt Mouse Mode. | #N |\n * | 1047 | Use Alternate Screen Buffer. | #Y |\n * | 1048 | Save cursor as in DECSC. | #Y |\n * | 1049 | Save cursor and switch to alternate buffer clearing it. | #P[Does not clear the alternate buffer.] |\n * | 2004 | Set bracketed paste mode. | #Y |\n *\n *\n * FIXME: implement DECSCNM, 1049 should clear altbuffer\n */\n public setModePrivate(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 1:\n this._coreService.decPrivateModes.applicationCursorKeys = true;\n break;\n case 2:\n this._charsetService.setgCharset(0, DEFAULT_CHARSET);\n this._charsetService.setgCharset(1, DEFAULT_CHARSET);\n this._charsetService.setgCharset(2, DEFAULT_CHARSET);\n this._charsetService.setgCharset(3, DEFAULT_CHARSET);\n // set VT100 mode here\n break;\n case 3:\n /**\n * DECCOLM - 132 column mode.\n * This is only active if 'SetWinLines' (24) is enabled\n * through `options.windowsOptions`.\n */\n if (this._optionsService.rawOptions.windowOptions.setWinLines) {\n this._bufferService.resize(132, this._bufferService.rows);\n this._onRequestReset.fire();\n }\n break;\n case 6:\n this._coreService.decPrivateModes.origin = true;\n this._setCursor(0, 0);\n break;\n case 7:\n this._coreService.decPrivateModes.wraparound = true;\n break;\n case 12:\n // this.cursorBlink = true;\n break;\n case 45:\n this._coreService.decPrivateModes.reverseWraparound = true;\n break;\n case 66:\n this._logService.debug('Serial port requested application keypad.');\n this._coreService.decPrivateModes.applicationKeypad = true;\n this._onRequestSyncScrollBar.fire();\n break;\n case 9: // X10 Mouse\n // no release, no motion, no wheel, no modifiers.\n this._coreMouseService.activeProtocol = 'X10';\n break;\n case 1000: // vt200 mouse\n // no motion.\n this._coreMouseService.activeProtocol = 'VT200';\n break;\n case 1002: // button event mouse\n this._coreMouseService.activeProtocol = 'DRAG';\n break;\n case 1003: // any event mouse\n // any event - sends motion events,\n // even if there is no button held down.\n this._coreMouseService.activeProtocol = 'ANY';\n break;\n case 1004: // send focusin/focusout events\n // focusin: ^[[I\n // focusout: ^[[O\n this._coreService.decPrivateModes.sendFocus = true;\n this._onRequestSendFocus.fire();\n break;\n case 1005: // utf8 ext mode mouse - removed in #2507\n this._logService.debug('DECSET 1005 not supported (see #2507)');\n break;\n case 1006: // sgr ext mode mouse\n this._coreMouseService.activeEncoding = 'SGR';\n break;\n case 1015: // urxvt ext mode mouse - removed in #2507\n this._logService.debug('DECSET 1015 not supported (see #2507)');\n break;\n case 25: // show cursor\n this._coreService.isCursorHidden = false;\n break;\n case 1048: // alt screen cursor\n this.saveCursor();\n break;\n case 1049: // alt screen buffer cursor\n this.saveCursor();\n // FALL-THROUGH\n case 47: // alt screen buffer\n case 1047: // alt screen buffer\n this._bufferService.buffers.activateAltBuffer(this._eraseAttrData());\n this._coreService.isCursorInitialized = true;\n this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1);\n this._onRequestSyncScrollBar.fire();\n break;\n case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)\n this._coreService.decPrivateModes.bracketedPasteMode = true;\n break;\n }\n }\n return true;\n }\n\n\n /**\n * CSI Pm l Reset Mode (RM).\n * Ps = 2 -> Keyboard Action Mode (AM).\n * Ps = 4 -> Replace Mode (IRM).\n * Ps = 1 2 -> Send/receive (SRM).\n * Ps = 2 0 -> Normal Linefeed (LNM).\n *\n * @vt: #P[Only IRM is supported.] CSI RM \"Reset Mode\" \"CSI Pm l\" \"Set various terminal attributes.\"\n * Supported param values by RM:\n *\n * | Param | Action | Support |\n * | ----- | -------------------------------------- | ------- |\n * | 2 | Keyboard Action Mode (KAM). Always on. | #N |\n * | 4 | Replace Mode (IRM). (default) | #Y |\n * | 12 | Send/receive (SRM). Always off. | #N |\n * | 20 | Normal Linefeed (LNM). Always off. | #N |\n *\n *\n * FIXME: why is LNM commented out?\n */\n public resetMode(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 4:\n this._coreService.modes.insertMode = false;\n break;\n case 20:\n // this._t.convertEol = false;\n break;\n }\n }\n return true;\n }\n\n /**\n * CSI ? Pm l\n * DEC Private Mode Reset (DECRST).\n * Ps = 1 -> Normal Cursor Keys (DECCKM).\n * Ps = 2 -> Designate VT52 mode (DECANM).\n * Ps = 3 -> 80 Column Mode (DECCOLM).\n * Ps = 4 -> Jump (Fast) Scroll (DECSCLM).\n * Ps = 5 -> Normal Video (DECSCNM).\n * Ps = 6 -> Normal Cursor Mode (DECOM).\n * Ps = 7 -> No Wraparound Mode (DECAWM).\n * Ps = 8 -> No Auto-repeat Keys (DECARM).\n * Ps = 9 -> Don't send Mouse X & Y on button press.\n * Ps = 1 0 -> Hide toolbar (rxvt).\n * Ps = 1 2 -> Stop Blinking Cursor (att610).\n * Ps = 1 8 -> Don't print form feed (DECPFF).\n * Ps = 1 9 -> Limit print to scrolling region (DECPEX).\n * Ps = 2 5 -> Hide Cursor (DECTCEM).\n * Ps = 3 0 -> Don't show scrollbar (rxvt).\n * Ps = 3 5 -> Disable font-shifting functions (rxvt).\n * Ps = 4 0 -> Disallow 80 -> 132 Mode.\n * Ps = 4 1 -> No more(1) fix (see curses resource).\n * Ps = 4 2 -> Disable Nation Replacement Character sets (DEC-\n * NRCM).\n * Ps = 4 4 -> Turn Off Margin Bell.\n * Ps = 4 5 -> No Reverse-wraparound Mode.\n * Ps = 4 6 -> Stop Logging. (This is normally disabled by a\n * compile-time option).\n * Ps = 4 7 -> Use Normal Screen Buffer.\n * Ps = 6 6 -> Numeric keypad (DECNKM).\n * Ps = 6 7 -> Backarrow key sends delete (DECBKM).\n * Ps = 1 0 0 0 -> Don't send Mouse X & Y on button press and\n * release. See the section Mouse Tracking.\n * Ps = 1 0 0 1 -> Don't use Hilite Mouse Tracking.\n * Ps = 1 0 0 2 -> Don't use Cell Motion Mouse Tracking.\n * Ps = 1 0 0 3 -> Don't use All Motion Mouse Tracking.\n * Ps = 1 0 0 4 -> Don't send FocusIn/FocusOut events.\n * Ps = 1 0 0 5 -> Disable Extended Mouse Mode.\n * Ps = 1 0 1 0 -> Don't scroll to bottom on tty output\n * (rxvt).\n * Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt).\n * Ps = 1 0 3 4 -> Don't interpret \"meta\" key. (This disables\n * the eightBitInput resource).\n * Ps = 1 0 3 5 -> Disable special modifiers for Alt and Num-\n * Lock keys. (This disables the numLock resource).\n * Ps = 1 0 3 6 -> Don't send ESC when Meta modifies a key.\n * (This disables the metaSendsEscape resource).\n * Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad\n * Delete key.\n * Ps = 1 0 3 9 -> Don't send ESC when Alt modifies a key.\n * (This disables the altSendsEscape resource).\n * Ps = 1 0 4 0 -> Do not keep selection when not highlighted.\n * (This disables the keepSelection resource).\n * Ps = 1 0 4 1 -> Use the PRIMARY selection. (This disables\n * the selectToClipboard resource).\n * Ps = 1 0 4 2 -> Disable Urgency window manager hint when\n * Control-G is received. (This disables the bellIsUrgent\n * resource).\n * Ps = 1 0 4 3 -> Disable raising of the window when Control-\n * G is received. (This disables the popOnBell resource).\n * Ps = 1 0 4 7 -> Use Normal Screen Buffer, clearing screen\n * first if in the Alternate Screen. (This may be disabled by\n * the titeInhibit resource).\n * Ps = 1 0 4 8 -> Restore cursor as in DECRC. (This may be\n * disabled by the titeInhibit resource).\n * Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor\n * as in DECRC. (This may be disabled by the titeInhibit\n * resource). This combines the effects of the 1 0 4 7 and 1 0\n * 4 8 modes. Use this with terminfo-based applications rather\n * than the 4 7 mode.\n * Ps = 1 0 5 0 -> Reset terminfo/termcap function-key mode.\n * Ps = 1 0 5 1 -> Reset Sun function-key mode.\n * Ps = 1 0 5 2 -> Reset HP function-key mode.\n * Ps = 1 0 5 3 -> Reset SCO function-key mode.\n * Ps = 1 0 6 0 -> Reset legacy keyboard emulation (X11R6).\n * Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style.\n * Ps = 2 0 0 4 -> Reset bracketed paste mode.\n *\n * @vt: #P[See below for supported modes.] CSI DECRST \"DEC Private Reset Mode\" \"CSI ? Pm l\" \"Reset various terminal attributes.\"\n * Supported param values by DECRST:\n *\n * | param | Action | Support |\n * | ----- | ------------------------------------------------------- | ------- |\n * | 1 | Normal Cursor Keys (DECCKM). | #Y |\n * | 2 | Designate VT52 mode (DECANM). | #N |\n * | 3 | 80 Column Mode (DECCOLM). | #B[Switches to old column width instead of 80.] |\n * | 6 | Normal Cursor Mode (DECOM). | #Y |\n * | 7 | No Wraparound Mode (DECAWM). | #Y |\n * | 8 | No Auto-repeat Keys (DECARM). | #N |\n * | 9 | Don't send Mouse X & Y on button press. | #Y |\n * | 12 | Stop Blinking Cursor. | #Y |\n * | 25 | Hide Cursor (DECTCEM). | #Y |\n * | 45 | No reverse wrap-around. | #Y |\n * | 47 | Use Normal Screen Buffer. | #Y |\n * | 66 | Numeric keypad (DECNKM). | #Y |\n * | 1000 | Don't send Mouse reports. | #Y |\n * | 1002 | Don't use Cell Motion Mouse Tracking. | #Y |\n * | 1003 | Don't use All Motion Mouse Tracking. | #Y |\n * | 1004 | Don't send FocusIn/FocusOut events. | #Y |\n * | 1005 | Disable UTF-8 Mouse Mode. | #N |\n * | 1006 | Disable SGR Mouse Mode. | #Y |\n * | 1015 | Disable urxvt Mouse Mode. | #N |\n * | 1047 | Use Normal Screen Buffer (clearing screen if in alt). | #Y |\n * | 1048 | Restore cursor as in DECRC. | #Y |\n * | 1049 | Use Normal Screen Buffer and restore cursor. | #Y |\n * | 2004 | Reset bracketed paste mode. | #Y |\n *\n *\n * FIXME: DECCOLM is currently broken (already fixed in window options PR)\n */\n public resetModePrivate(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 1:\n this._coreService.decPrivateModes.applicationCursorKeys = false;\n break;\n case 3:\n /**\n * DECCOLM - 80 column mode.\n * This is only active if 'SetWinLines' (24) is enabled\n * through `options.windowsOptions`.\n */\n if (this._optionsService.rawOptions.windowOptions.setWinLines) {\n this._bufferService.resize(80, this._bufferService.rows);\n this._onRequestReset.fire();\n }\n break;\n case 6:\n this._coreService.decPrivateModes.origin = false;\n this._setCursor(0, 0);\n break;\n case 7:\n this._coreService.decPrivateModes.wraparound = false;\n break;\n case 12:\n // this.cursorBlink = false;\n break;\n case 45:\n this._coreService.decPrivateModes.reverseWraparound = false;\n break;\n case 66:\n this._logService.debug('Switching back to normal keypad.');\n this._coreService.decPrivateModes.applicationKeypad = false;\n this._onRequestSyncScrollBar.fire();\n break;\n case 9: // X10 Mouse\n case 1000: // vt200 mouse\n case 1002: // button event mouse\n case 1003: // any event mouse\n this._coreMouseService.activeProtocol = 'NONE';\n break;\n case 1004: // send focusin/focusout events\n this._coreService.decPrivateModes.sendFocus = false;\n break;\n case 1005: // utf8 ext mode mouse - removed in #2507\n this._logService.debug('DECRST 1005 not supported (see #2507)');\n break;\n case 1006: // sgr ext mode mouse\n this._coreMouseService.activeEncoding = 'DEFAULT';\n break;\n case 1015: // urxvt ext mode mouse - removed in #2507\n this._logService.debug('DECRST 1015 not supported (see #2507)');\n break;\n case 25: // hide cursor\n this._coreService.isCursorHidden = true;\n break;\n case 1048: // alt screen cursor\n this.restoreCursor();\n break;\n case 1049: // alt screen buffer cursor\n // FALL-THROUGH\n case 47: // normal screen buffer\n case 1047: // normal screen buffer - clearing it first\n // Ensure the selection manager has the correct buffer\n this._bufferService.buffers.activateNormalBuffer();\n if (params.params[i] === 1049) {\n this.restoreCursor();\n }\n this._coreService.isCursorInitialized = true;\n this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1);\n this._onRequestSyncScrollBar.fire();\n break;\n case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)\n this._coreService.decPrivateModes.bracketedPasteMode = false;\n break;\n }\n }\n return true;\n }\n\n /**\n * Helper to write color information packed with color mode.\n */\n private _updateAttrColor(color: number, mode: number, c1: number, c2: number, c3: number): number {\n if (mode === 2) {\n color |= Attributes.CM_RGB;\n color &= ~Attributes.RGB_MASK;\n color |= AttributeData.fromColorRGB([c1, c2, c3]);\n } else if (mode === 5) {\n color &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n color |= Attributes.CM_P256 | (c1 & 0xff);\n }\n return color;\n }\n\n /**\n * Helper to extract and apply color params/subparams.\n * Returns advance for params index.\n */\n private _extractColor(params: IParams, pos: number, attr: IAttributeData): number {\n // normalize params\n // meaning: [target, CM, ign, val, val, val]\n // RGB : [ 38/48, 2, ign, r, g, b]\n // P256 : [ 38/48, 5, ign, v, ign, ign]\n const accu = [0, 0, -1, 0, 0, 0];\n\n // alignment placeholder for non color space sequences\n let cSpace = 0;\n\n // return advance we took in params\n let advance = 0;\n\n do {\n accu[advance + cSpace] = params.params[pos + advance];\n if (params.hasSubParams(pos + advance)) {\n const subparams = params.getSubParams(pos + advance)!;\n let i = 0;\n do {\n if (accu[1] === 5) {\n cSpace = 1;\n }\n accu[advance + i + 1 + cSpace] = subparams[i];\n } while (++i < subparams.length && i + advance + 1 + cSpace < accu.length);\n break;\n }\n // exit early if can decide color mode with semicolons\n if ((accu[1] === 5 && advance + cSpace >= 2)\n || (accu[1] === 2 && advance + cSpace >= 5)) {\n break;\n }\n // offset colorSpace slot for semicolon mode\n if (accu[1]) {\n cSpace = 1;\n }\n } while (++advance + pos < params.length && advance + cSpace < accu.length);\n\n // set default values to 0\n for (let i = 2; i < accu.length; ++i) {\n if (accu[i] === -1) {\n accu[i] = 0;\n }\n }\n\n // apply colors\n switch (accu[0]) {\n case 38:\n attr.fg = this._updateAttrColor(attr.fg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 48:\n attr.bg = this._updateAttrColor(attr.bg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 58:\n attr.extended = attr.extended.clone();\n attr.extended.underlineColor = this._updateAttrColor(attr.extended.underlineColor, accu[1], accu[3], accu[4], accu[5]);\n }\n\n return advance;\n }\n\n /**\n * SGR 4 subparams:\n * 4:0 - equal to SGR 24 (turn off all underline)\n * 4:1 - equal to SGR 4 (single underline)\n * 4:2 - equal to SGR 21 (double underline)\n * 4:3 - curly underline\n * 4:4 - dotted underline\n * 4:5 - dashed underline\n */\n private _processUnderline(style: number, attr: IAttributeData): void {\n // treat extended attrs as immutable, thus always clone from old one\n // this is needed since the buffer only holds references to it\n attr.extended = attr.extended.clone();\n\n // default to 1 == single underline\n if (!~style || style > 5) {\n style = 1;\n }\n attr.extended.underlineStyle = style;\n attr.fg |= FgFlags.UNDERLINE;\n\n // 0 deactivates underline\n if (style === 0) {\n attr.fg &= ~FgFlags.UNDERLINE;\n }\n\n // update HAS_EXTENDED in BG\n attr.updateExtended();\n }\n\n /**\n * CSI Pm m Character Attributes (SGR).\n *\n * @vt: #P[See below for supported attributes.] CSI SGR \"Select Graphic Rendition\" \"CSI Pm m\" \"Set/Reset various text attributes.\"\n * SGR selects one or more character attributes at the same time. Multiple params (up to 32)\n * are applied in order from left to right. The changed attributes are applied to all new\n * characters received. If you move characters in the viewport by scrolling or any other means,\n * then the attributes move with the characters.\n *\n * Supported param values by SGR:\n *\n * | Param | Meaning | Support |\n * | --------- | -------------------------------------------------------- | ------- |\n * | 0 | Normal (default). Resets any other preceding SGR. | #Y |\n * | 1 | Bold. (also see `options.drawBoldTextInBrightColors`) | #Y |\n * | 2 | Faint, decreased intensity. | #Y |\n * | 3 | Italic. | #Y |\n * | 4 | Underlined (see below for style support). | #Y |\n * | 5 | Slowly blinking. | #N |\n * | 6 | Rapidly blinking. | #N |\n * | 7 | Inverse. Flips foreground and background color. | #Y |\n * | 8 | Invisible (hidden). | #Y |\n * | 9 | Crossed-out characters (strikethrough). | #Y |\n * | 21 | Doubly underlined. | #P[Currently outputs a single underline.] |\n * | 22 | Normal (neither bold nor faint). | #Y |\n * | 23 | No italic. | #Y |\n * | 24 | Not underlined. | #Y |\n * | 25 | Steady (not blinking). | #Y |\n * | 27 | Positive (not inverse). | #Y |\n * | 28 | Visible (not hidden). | #Y |\n * | 29 | Not Crossed-out (strikethrough). | #Y |\n * | 30 | Foreground color: Black. | #Y |\n * | 31 | Foreground color: Red. | #Y |\n * | 32 | Foreground color: Green. | #Y |\n * | 33 | Foreground color: Yellow. | #Y |\n * | 34 | Foreground color: Blue. | #Y |\n * | 35 | Foreground color: Magenta. | #Y |\n * | 36 | Foreground color: Cyan. | #Y |\n * | 37 | Foreground color: White. | #Y |\n * | 38 | Foreground color: Extended color. | #P[Support for RGB and indexed colors, see below.] |\n * | 39 | Foreground color: Default (original). | #Y |\n * | 40 | Background color: Black. | #Y |\n * | 41 | Background color: Red. | #Y |\n * | 42 | Background color: Green. | #Y |\n * | 43 | Background color: Yellow. | #Y |\n * | 44 | Background color: Blue. | #Y |\n * | 45 | Background color: Magenta. | #Y |\n * | 46 | Background color: Cyan. | #Y |\n * | 47 | Background color: White. | #Y |\n * | 48 | Background color: Extended color. | #P[Support for RGB and indexed colors, see below.] |\n * | 49 | Background color: Default (original). | #Y |\n * | 90 - 97 | Bright foreground color (analogous to 30 - 37). | #Y |\n * | 100 - 107 | Bright background color (analogous to 40 - 47). | #Y |\n *\n * Underline supports subparams to denote the style in the form `4 : x`:\n *\n * | x | Meaning | Support |\n * | ------ | ------------------------------------------------------------- | ------- |\n * | 0 | No underline. Same as `SGR 24 m`. | #Y |\n * | 1 | Single underline. Same as `SGR 4 m`. | #Y |\n * | 2 | Double underline. | #P[Currently outputs a single underline.] |\n * | 3 | Curly underline. | #P[Currently outputs a single underline.] |\n * | 4 | Dotted underline. | #P[Currently outputs a single underline.] |\n * | 5 | Dashed underline. | #P[Currently outputs a single underline.] |\n * | other | Single underline. Same as `SGR 4 m`. | #Y |\n *\n * Extended colors are supported for foreground (Ps=38) and background (Ps=48) as follows:\n *\n * | Ps + 1 | Meaning | Support |\n * | ------ | ------------------------------------------------------------- | ------- |\n * | 0 | Implementation defined. | #N |\n * | 1 | Transparent. | #N |\n * | 2 | RGB color as `Ps ; 2 ; R ; G ; B` or `Ps : 2 : : R : G : B`. | #Y |\n * | 3 | CMY color. | #N |\n * | 4 | CMYK color. | #N |\n * | 5 | Indexed (256 colors) as `Ps ; 5 ; INDEX` or `Ps : 5 : INDEX`. | #Y |\n *\n *\n * FIXME: blinking is implemented in attrs, but not working in renderers?\n * FIXME: remove dead branch for p=100\n */\n public charAttributes(params: IParams): boolean {\n // Optimize a single SGR0.\n if (params.length === 1 && params.params[0] === 0) {\n this._curAttrData.fg = DEFAULT_ATTR_DATA.fg;\n this._curAttrData.bg = DEFAULT_ATTR_DATA.bg;\n return true;\n }\n\n const l = params.length;\n let p;\n const attr = this._curAttrData;\n\n for (let i = 0; i < l; i++) {\n p = params.params[i];\n if (p >= 30 && p <= 37) {\n // fg color 8\n attr.fg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.fg |= Attributes.CM_P16 | (p - 30);\n } else if (p >= 40 && p <= 47) {\n // bg color 8\n attr.bg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.bg |= Attributes.CM_P16 | (p - 40);\n } else if (p >= 90 && p <= 97) {\n // fg color 16\n attr.fg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.fg |= Attributes.CM_P16 | (p - 90) | 8;\n } else if (p >= 100 && p <= 107) {\n // bg color 16\n attr.bg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.bg |= Attributes.CM_P16 | (p - 100) | 8;\n } else if (p === 0) {\n // default\n attr.fg = DEFAULT_ATTR_DATA.fg;\n attr.bg = DEFAULT_ATTR_DATA.bg;\n } else if (p === 1) {\n // bold text\n attr.fg |= FgFlags.BOLD;\n } else if (p === 3) {\n // italic text\n attr.bg |= BgFlags.ITALIC;\n } else if (p === 4) {\n // underlined text\n attr.fg |= FgFlags.UNDERLINE;\n this._processUnderline(params.hasSubParams(i) ? params.getSubParams(i)![0] : UnderlineStyle.SINGLE, attr);\n } else if (p === 5) {\n // blink\n attr.fg |= FgFlags.BLINK;\n } else if (p === 7) {\n // inverse and positive\n // test with: echo -e '\\e[31m\\e[42mhello\\e[7mworld\\e[27mhi\\e[m'\n attr.fg |= FgFlags.INVERSE;\n } else if (p === 8) {\n // invisible\n attr.fg |= FgFlags.INVISIBLE;\n } else if (p === 9) {\n // strikethrough\n attr.fg |= FgFlags.STRIKETHROUGH;\n } else if (p === 2) {\n // dimmed text\n attr.bg |= BgFlags.DIM;\n } else if (p === 21) {\n // double underline\n this._processUnderline(UnderlineStyle.DOUBLE, attr);\n } else if (p === 22) {\n // not bold nor faint\n attr.fg &= ~FgFlags.BOLD;\n attr.bg &= ~BgFlags.DIM;\n } else if (p === 23) {\n // not italic\n attr.bg &= ~BgFlags.ITALIC;\n } else if (p === 24) {\n // not underlined\n attr.fg &= ~FgFlags.UNDERLINE;\n } else if (p === 25) {\n // not blink\n attr.fg &= ~FgFlags.BLINK;\n } else if (p === 27) {\n // not inverse\n attr.fg &= ~FgFlags.INVERSE;\n } else if (p === 28) {\n // not invisible\n attr.fg &= ~FgFlags.INVISIBLE;\n } else if (p === 29) {\n // not strikethrough\n attr.fg &= ~FgFlags.STRIKETHROUGH;\n } else if (p === 39) {\n // reset fg\n attr.fg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.fg |= DEFAULT_ATTR_DATA.fg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else if (p === 49) {\n // reset bg\n attr.bg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.bg |= DEFAULT_ATTR_DATA.bg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else if (p === 38 || p === 48 || p === 58) {\n // fg color 256 and RGB\n i += this._extractColor(params, i, attr);\n } else if (p === 59) {\n attr.extended = attr.extended.clone();\n attr.extended.underlineColor = -1;\n attr.updateExtended();\n } else if (p === 100) { // FIXME: dead branch, p=100 already handled above!\n // reset fg/bg\n attr.fg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.fg |= DEFAULT_ATTR_DATA.fg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n attr.bg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.bg |= DEFAULT_ATTR_DATA.bg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else {\n this._logService.debug('Unknown SGR attribute: %d.', p);\n }\n }\n return true;\n }\n\n /**\n * CSI Ps n Device Status Report (DSR).\n * Ps = 5 -> Status Report. Result (``OK'') is\n * CSI 0 n\n * Ps = 6 -> Report Cursor Position (CPR) [row;column].\n * Result is\n * CSI r ; c R\n * CSI ? Ps n\n * Device Status Report (DSR, DEC-specific).\n * Ps = 6 -> Report Cursor Position (CPR) [row;column] as CSI\n * ? r ; c R (assumes page is zero).\n * Ps = 1 5 -> Report Printer status as CSI ? 1 0 n (ready).\n * or CSI ? 1 1 n (not ready).\n * Ps = 2 5 -> Report UDK status as CSI ? 2 0 n (unlocked)\n * or CSI ? 2 1 n (locked).\n * Ps = 2 6 -> Report Keyboard status as\n * CSI ? 2 7 ; 1 ; 0 ; 0 n (North American).\n * The last two parameters apply to VT400 & up, and denote key-\n * board ready and LK01 respectively.\n * Ps = 5 3 -> Report Locator status as\n * CSI ? 5 3 n Locator available, if compiled-in, or\n * CSI ? 5 0 n No Locator, if not.\n *\n * @vt: #Y CSI DSR \"Device Status Report\" \"CSI Ps n\" \"Request cursor position (CPR) with `Ps` = 6.\"\n */\n public deviceStatus(params: IParams): boolean {\n switch (params.params[0]) {\n case 5:\n // status report\n this._coreService.triggerDataEvent(`${C0.ESC}[0n`);\n break;\n case 6:\n // cursor position\n const y = this._activeBuffer.y + 1;\n const x = this._activeBuffer.x + 1;\n this._coreService.triggerDataEvent(`${C0.ESC}[${y};${x}R`);\n break;\n }\n return true;\n }\n\n // @vt: #P[Only CPR is supported.] CSI DECDSR \"DEC Device Status Report\" \"CSI ? Ps n\" \"Only CPR is supported (same as DSR).\"\n public deviceStatusPrivate(params: IParams): boolean {\n // modern xterm doesnt seem to\n // respond to any of these except ?6, 6, and 5\n switch (params.params[0]) {\n case 6:\n // cursor position\n const y = this._activeBuffer.y + 1;\n const x = this._activeBuffer.x + 1;\n this._coreService.triggerDataEvent(`${C0.ESC}[?${y};${x}R`);\n break;\n case 15:\n // no printer\n // this.handler(C0.ESC + '[?11n');\n break;\n case 25:\n // dont support user defined keys\n // this.handler(C0.ESC + '[?21n');\n break;\n case 26:\n // north american keyboard\n // this.handler(C0.ESC + '[?27;1;0;0n');\n break;\n case 53:\n // no dec locator/mouse\n // this.handler(C0.ESC + '[?50n');\n break;\n }\n return true;\n }\n\n /**\n * CSI ! p Soft terminal reset (DECSTR).\n * http://vt100.net/docs/vt220-rm/table4-10.html\n *\n * @vt: #Y CSI DECSTR \"Soft Terminal Reset\" \"CSI ! p\" \"Reset several terminal attributes to initial state.\"\n * There are two terminal reset sequences - RIS and DECSTR. While RIS performs almost a full terminal bootstrap,\n * DECSTR only resets certain attributes. For most needs DECSTR should be sufficient.\n *\n * The following terminal attributes are reset to default values:\n * - IRM is reset (dafault = false)\n * - scroll margins are reset (default = viewport size)\n * - erase attributes are reset to default\n * - charsets are reset\n * - DECSC data is reset to initial values\n * - DECOM is reset to absolute mode\n *\n *\n * FIXME: there are several more attributes missing (see VT520 manual)\n */\n public softReset(params: IParams): boolean {\n this._coreService.isCursorHidden = false;\n this._onRequestSyncScrollBar.fire();\n this._activeBuffer.scrollTop = 0;\n this._activeBuffer.scrollBottom = this._bufferService.rows - 1;\n this._curAttrData = DEFAULT_ATTR_DATA.clone();\n this._coreService.reset();\n this._charsetService.reset();\n\n // reset DECSC data\n this._activeBuffer.savedX = 0;\n this._activeBuffer.savedY = this._activeBuffer.ybase;\n this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg;\n this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg;\n this._activeBuffer.savedCharset = this._charsetService.charset;\n\n // reset DECOM\n this._coreService.decPrivateModes.origin = false;\n return true;\n }\n\n /**\n * CSI Ps SP q Set cursor style (DECSCUSR, VT520).\n * Ps = 0 -> blinking block.\n * Ps = 1 -> blinking block (default).\n * Ps = 2 -> steady block.\n * Ps = 3 -> blinking underline.\n * Ps = 4 -> steady underline.\n * Ps = 5 -> blinking bar (xterm).\n * Ps = 6 -> steady bar (xterm).\n *\n * @vt: #Y CSI DECSCUSR \"Set Cursor Style\" \"CSI Ps SP q\" \"Set cursor style.\"\n * Supported cursor styles:\n * - empty, 0 or 1: steady block\n * - 2: blink block\n * - 3: steady underline\n * - 4: blink underline\n * - 5: steady bar\n * - 6: blink bar\n */\n public setCursorStyle(params: IParams): boolean {\n const param = params.params[0] || 1;\n switch (param) {\n case 1:\n case 2:\n this._optionsService.options.cursorStyle = 'block';\n break;\n case 3:\n case 4:\n this._optionsService.options.cursorStyle = 'underline';\n break;\n case 5:\n case 6:\n this._optionsService.options.cursorStyle = 'bar';\n break;\n }\n const isBlinking = param % 2 === 1;\n this._optionsService.options.cursorBlink = isBlinking;\n return true;\n }\n\n /**\n * CSI Ps ; Ps r\n * Set Scrolling Region [top;bottom] (default = full size of win-\n * dow) (DECSTBM).\n *\n * @vt: #Y CSI DECSTBM \"Set Top and Bottom Margin\" \"CSI Ps ; Ps r\" \"Set top and bottom margins of the viewport [top;bottom] (default = viewport size).\"\n */\n public setScrollRegion(params: IParams): boolean {\n const top = params.params[0] || 1;\n let bottom: number;\n\n if (params.length < 2 || (bottom = params.params[1]) > this._bufferService.rows || bottom === 0) {\n bottom = this._bufferService.rows;\n }\n\n if (bottom > top) {\n this._activeBuffer.scrollTop = top - 1;\n this._activeBuffer.scrollBottom = bottom - 1;\n this._setCursor(0, 0);\n }\n return true;\n }\n\n /**\n * CSI Ps ; Ps ; Ps t - Various window manipulations and reports (xterm)\n *\n * Note: Only those listed below are supported. All others are left to integrators and\n * need special treatment based on the embedding environment.\n *\n * Ps = 1 4 supported\n * Report xterm text area size in pixels.\n * Result is CSI 4 ; height ; width t\n * Ps = 14 ; 2 not implemented\n * Ps = 16 supported\n * Report xterm character cell size in pixels.\n * Result is CSI 6 ; height ; width t\n * Ps = 18 supported\n * Report the size of the text area in characters.\n * Result is CSI 8 ; height ; width t\n * Ps = 20 supported\n * Report xterm window's icon label.\n * Result is OSC L label ST\n * Ps = 21 supported\n * Report xterm window's title.\n * Result is OSC l label ST\n * Ps = 22 ; 0 -> Save xterm icon and window title on stack. supported\n * Ps = 22 ; 1 -> Save xterm icon title on stack. supported\n * Ps = 22 ; 2 -> Save xterm window title on stack. supported\n * Ps = 23 ; 0 -> Restore xterm icon and window title from stack. supported\n * Ps = 23 ; 1 -> Restore xterm icon title from stack. supported\n * Ps = 23 ; 2 -> Restore xterm window title from stack. supported\n * Ps >= 24 not implemented\n */\n public windowOptions(params: IParams): boolean {\n if (!paramToWindowOption(params.params[0], this._optionsService.rawOptions.windowOptions)) {\n return true;\n }\n const second = (params.length > 1) ? params.params[1] : 0;\n switch (params.params[0]) {\n case 14: // GetWinSizePixels, returns CSI 4 ; height ; width t\n if (second !== 2) {\n this._onRequestWindowsOptionsReport.fire(WindowsOptionsReportType.GET_WIN_SIZE_PIXELS);\n }\n break;\n case 16: // GetCellSizePixels, returns CSI 6 ; height ; width t\n this._onRequestWindowsOptionsReport.fire(WindowsOptionsReportType.GET_CELL_SIZE_PIXELS);\n break;\n case 18: // GetWinSizeChars, returns CSI 8 ; height ; width t\n if (this._bufferService) {\n this._coreService.triggerDataEvent(`${C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);\n }\n break;\n case 22: // PushTitle\n if (second === 0 || second === 2) {\n this._windowTitleStack.push(this._windowTitle);\n if (this._windowTitleStack.length > STACK_LIMIT) {\n this._windowTitleStack.shift();\n }\n }\n if (second === 0 || second === 1) {\n this._iconNameStack.push(this._iconName);\n if (this._iconNameStack.length > STACK_LIMIT) {\n this._iconNameStack.shift();\n }\n }\n break;\n case 23: // PopTitle\n if (second === 0 || second === 2) {\n if (this._windowTitleStack.length) {\n this.setTitle(this._windowTitleStack.pop()!);\n }\n }\n if (second === 0 || second === 1) {\n if (this._iconNameStack.length) {\n this.setIconName(this._iconNameStack.pop()!);\n }\n }\n break;\n }\n return true;\n }\n\n\n /**\n * CSI s\n * ESC 7\n * Save cursor (ANSI.SYS).\n *\n * @vt: #P[TODO...] CSI SCOSC \"Save Cursor\" \"CSI s\" \"Save cursor position, charmap and text attributes.\"\n * @vt: #Y ESC SC \"Save Cursor\" \"ESC 7\" \"Save cursor position, charmap and text attributes.\"\n */\n public saveCursor(params?: IParams): boolean {\n this._activeBuffer.savedX = this._activeBuffer.x;\n this._activeBuffer.savedY = this._activeBuffer.ybase + this._activeBuffer.y;\n this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg;\n this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg;\n this._activeBuffer.savedCharset = this._charsetService.charset;\n return true;\n }\n\n\n /**\n * CSI u\n * ESC 8\n * Restore cursor (ANSI.SYS).\n *\n * @vt: #P[TODO...] CSI SCORC \"Restore Cursor\" \"CSI u\" \"Restore cursor position, charmap and text attributes.\"\n * @vt: #Y ESC RC \"Restore Cursor\" \"ESC 8\" \"Restore cursor position, charmap and text attributes.\"\n */\n public restoreCursor(params?: IParams): boolean {\n this._activeBuffer.x = this._activeBuffer.savedX || 0;\n this._activeBuffer.y = Math.max(this._activeBuffer.savedY - this._activeBuffer.ybase, 0);\n this._curAttrData.fg = this._activeBuffer.savedCurAttrData.fg;\n this._curAttrData.bg = this._activeBuffer.savedCurAttrData.bg;\n this._charsetService.charset = (this as any)._savedCharset;\n if (this._activeBuffer.savedCharset) {\n this._charsetService.charset = this._activeBuffer.savedCharset;\n }\n this._restrictCursor();\n return true;\n }\n\n\n /**\n * OSC 2; ST (set window title)\n * Proxy to set window title.\n *\n * @vt: #P[Icon name is not exposed.] OSC 0 \"Set Windows Title and Icon Name\" \"OSC 0 ; Pt BEL\" \"Set window title and icon name.\"\n * Icon name is not supported. For Window Title see below.\n *\n * @vt: #Y OSC 2 \"Set Windows Title\" \"OSC 2 ; Pt BEL\" \"Set window title.\"\n * xterm.js does not manipulate the title directly, instead exposes changes via the event `Terminal.onTitleChange`.\n */\n public setTitle(data: string): boolean {\n this._windowTitle = data;\n this._onTitleChange.fire(data);\n return true;\n }\n\n /**\n * OSC 1; ST\n * Note: Icon name is not exposed.\n */\n public setIconName(data: string): boolean {\n this._iconName = data;\n return true;\n }\n\n /**\n * OSC 4; ; ST (set ANSI color to )\n *\n * @vt: #Y OSC 4 \"Set ANSI color\" \"OSC 4 ; c ; spec BEL\" \"Change color number `c` to the color specified by `spec`.\"\n * `c` is the color index between 0 and 255. The color format of `spec` is derived from `XParseColor` (see OSC 10 for supported formats).\n * There may be multipe `c ; spec` pairs present in the same instruction.\n * If `spec` contains `?` the terminal returns a sequence with the currently set color.\n */\n public setOrReportIndexedColor(data: string): boolean {\n const event: IColorEvent = [];\n const slots = data.split(';');\n while (slots.length > 1) {\n const idx = slots.shift() as string;\n const spec = slots.shift() as string;\n if (/^\\d+$/.exec(idx)) {\n const index = parseInt(idx);\n if (0 <= index && index < 256) {\n if (spec === '?') {\n event.push({ type: ColorRequestType.REPORT, index });\n } else {\n const color = parseColor(spec);\n if (color) {\n event.push({ type: ColorRequestType.SET, index, color });\n }\n }\n }\n }\n }\n if (event.length) {\n this._onColor.fire(event);\n }\n return true;\n }\n\n // special colors - OSC 10 | 11 | 12\n private _specialColors = [ColorIndex.FOREGROUND, ColorIndex.BACKGROUND, ColorIndex.CURSOR];\n\n /**\n * Apply colors requests for special colors in OSC 10 | 11 | 12.\n * Since these commands are stacking from multiple parameters,\n * we handle them in a loop with an entry offset to `_specialColors`.\n */\n private _setOrReportSpecialColor(data: string, offset: number): boolean {\n const slots = data.split(';');\n for (let i = 0; i < slots.length; ++i, ++offset) {\n if (offset >= this._specialColors.length) break;\n if (slots[i] === '?') {\n this._onColor.fire([{ type: ColorRequestType.REPORT, index: this._specialColors[offset] }]);\n } else {\n const color = parseColor(slots[i]);\n if (color) {\n this._onColor.fire([{ type: ColorRequestType.SET, index: this._specialColors[offset], color }]);\n }\n }\n }\n return true;\n }\n\n /**\n * OSC 10 ; | ST - set or query default foreground color\n *\n * @vt: #Y OSC 10 \"Set or query default foreground color\" \"OSC 10 ; Pt BEL\" \"Set or query default foreground color.\"\n * To set the color, the following color specification formats are supported:\n * - `rgb://` for `, , ` in `h | hh | hhh | hhhh`, where\n * `h` is a single hexadecimal digit (case insignificant). The different widths scale\n * from 4 bit (`h`) to 16 bit (`hhhh`) and get converted to 8 bit (`hh`).\n * - `#RGB` - 4 bits per channel, expanded to `#R0G0B0`\n * - `#RRGGBB` - 8 bits per channel\n * - `#RRRGGGBBB` - 12 bits per channel, truncated to `#RRGGBB`\n * - `#RRRRGGGGBBBB` - 16 bits per channel, truncated to `#RRGGBB`\n *\n * **Note:** X11 named colors are currently unsupported.\n *\n * If `Pt` contains `?` instead of a color specification, the terminal\n * returns a sequence with the current default foreground color\n * (use that sequence to restore the color after changes).\n *\n * **Note:** Other than xterm, xterm.js does not support OSC 12 - 19.\n * Therefore stacking multiple `Pt` separated by `;` only works for the first two entries.\n */\n public setOrReportFgColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 0);\n }\n\n /**\n * OSC 11 ; | ST - set or query default background color\n *\n * @vt: #Y OSC 11 \"Set or query default background color\" \"OSC 11 ; Pt BEL\" \"Same as OSC 10, but for default background.\"\n */\n public setOrReportBgColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 1);\n }\n\n /**\n * OSC 12 ; | ST - set or query default cursor color\n *\n * @vt: #Y OSC 12 \"Set or query default cursor color\" \"OSC 12 ; Pt BEL\" \"Same as OSC 10, but for default cursor color.\"\n */\n public setOrReportCursorColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 2);\n }\n\n /**\n * OSC 104 ; ST - restore ANSI color \n *\n * @vt: #Y OSC 104 \"Reset ANSI color\" \"OSC 104 ; c BEL\" \"Reset color number `c` to themed color.\"\n * `c` is the color index between 0 and 255. This function restores the default color for `c` as\n * specified by the loaded theme. Any number of `c` parameters may be given.\n * If no parameters are given, the entire indexed color table will be reset.\n */\n public restoreIndexedColor(data: string): boolean {\n if (!data) {\n this._onColor.fire([{ type: ColorRequestType.RESTORE }]);\n return true;\n }\n const event: IColorEvent = [];\n const slots = data.split(';');\n for (let i = 0; i < slots.length; ++i) {\n if (/^\\d+$/.exec(slots[i])) {\n const index = parseInt(slots[i]);\n if (0 <= index && index < 256) {\n event.push({ type: ColorRequestType.RESTORE, index });\n }\n }\n }\n if (event.length) {\n this._onColor.fire(event);\n }\n return true;\n }\n\n /**\n * OSC 110 ST - restore default foreground color\n *\n * @vt: #Y OSC 110 \"Restore default foreground color\" \"OSC 110 BEL\" \"Restore default foreground to themed color.\"\n */\n public restoreFgColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.FOREGROUND }]);\n return true;\n }\n\n /**\n * OSC 111 ST - restore default background color\n *\n * @vt: #Y OSC 111 \"Restore default background color\" \"OSC 111 BEL\" \"Restore default background to themed color.\"\n */\n public restoreBgColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.BACKGROUND }]);\n return true;\n }\n\n /**\n * OSC 112 ST - restore default cursor color\n *\n * @vt: #Y OSC 112 \"Restore default cursor color\" \"OSC 112 BEL\" \"Restore default cursor to themed color.\"\n */\n public restoreCursorColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.CURSOR }]);\n return true;\n }\n\n /**\n * ESC E\n * C1.NEL\n * DEC mnemonic: NEL (https://vt100.net/docs/vt510-rm/NEL)\n * Moves cursor to first position on next line.\n *\n * @vt: #Y C1 NEL \"Next Line\" \"\\x85\" \"Move the cursor to the beginning of the next row.\"\n * @vt: #Y ESC NEL \"Next Line\" \"ESC E\" \"Move the cursor to the beginning of the next row.\"\n */\n public nextLine(): boolean {\n this._activeBuffer.x = 0;\n this.index();\n return true;\n }\n\n /**\n * ESC =\n * DEC mnemonic: DECKPAM (https://vt100.net/docs/vt510-rm/DECKPAM.html)\n * Enables the numeric keypad to send application sequences to the host.\n */\n public keypadApplicationMode(): boolean {\n this._logService.debug('Serial port requested application keypad.');\n this._coreService.decPrivateModes.applicationKeypad = true;\n this._onRequestSyncScrollBar.fire();\n return true;\n }\n\n /**\n * ESC >\n * DEC mnemonic: DECKPNM (https://vt100.net/docs/vt510-rm/DECKPNM.html)\n * Enables the keypad to send numeric characters to the host.\n */\n public keypadNumericMode(): boolean {\n this._logService.debug('Switching back to normal keypad.');\n this._coreService.decPrivateModes.applicationKeypad = false;\n this._onRequestSyncScrollBar.fire();\n return true;\n }\n\n /**\n * ESC % @\n * ESC % G\n * Select default character set. UTF-8 is not supported (string are unicode anyways)\n * therefore ESC % G does the same.\n */\n public selectDefaultCharset(): boolean {\n this._charsetService.setgLevel(0);\n this._charsetService.setgCharset(0, DEFAULT_CHARSET); // US (default)\n return true;\n }\n\n /**\n * ESC ( C\n * Designate G0 Character Set, VT100, ISO 2022.\n * ESC ) C\n * Designate G1 Character Set (ISO 2022, VT100).\n * ESC * C\n * Designate G2 Character Set (ISO 2022, VT220).\n * ESC + C\n * Designate G3 Character Set (ISO 2022, VT220).\n * ESC - C\n * Designate G1 Character Set (VT300).\n * ESC . C\n * Designate G2 Character Set (VT300).\n * ESC / C\n * Designate G3 Character Set (VT300). C = A -> ISO Latin-1 Supplemental. - Supported?\n */\n public selectCharset(collectAndFlag: string): boolean {\n if (collectAndFlag.length !== 2) {\n this.selectDefaultCharset();\n return true;\n }\n if (collectAndFlag[0] === '/') {\n return true; // TODO: Is this supported?\n }\n this._charsetService.setgCharset(GLEVEL[collectAndFlag[0]], CHARSETS[collectAndFlag[1]] || DEFAULT_CHARSET);\n return true;\n }\n\n /**\n * ESC D\n * C1.IND\n * DEC mnemonic: IND (https://vt100.net/docs/vt510-rm/IND.html)\n * Moves the cursor down one line in the same column.\n *\n * @vt: #Y C1 IND \"Index\" \"\\x84\" \"Move the cursor one line down scrolling if needed.\"\n * @vt: #Y ESC IND \"Index\" \"ESC D\" \"Move the cursor one line down scrolling if needed.\"\n */\n public index(): boolean {\n this._restrictCursor();\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData());\n } else if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n this._restrictCursor();\n return true;\n }\n\n /**\n * ESC H\n * C1.HTS\n * DEC mnemonic: HTS (https://vt100.net/docs/vt510-rm/HTS.html)\n * Sets a horizontal tab stop at the column position indicated by\n * the value of the active column when the terminal receives an HTS.\n *\n * @vt: #Y C1 HTS \"Horizontal Tabulation Set\" \"\\x88\" \"Places a tab stop at the current cursor position.\"\n * @vt: #Y ESC HTS \"Horizontal Tabulation Set\" \"ESC H\" \"Places a tab stop at the current cursor position.\"\n */\n public tabSet(): boolean {\n this._activeBuffer.tabs[this._activeBuffer.x] = true;\n return true;\n }\n\n /**\n * ESC M\n * C1.RI\n * DEC mnemonic: HTS\n * Moves the cursor up one line in the same column. If the cursor is at the top margin,\n * the page scrolls down.\n *\n * @vt: #Y ESC IR \"Reverse Index\" \"ESC M\" \"Move the cursor one line up scrolling if needed.\"\n */\n public reverseIndex(): boolean {\n this._restrictCursor();\n if (this._activeBuffer.y === this._activeBuffer.scrollTop) {\n // possibly move the code below to term.reverseScroll();\n // test: echo -ne '\\e[1;1H\\e[44m\\eM\\e[0m'\n // blankLine(true) is xterm/linux behavior\n const scrollRegionHeight = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop;\n this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, scrollRegionHeight, 1);\n this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n } else {\n this._activeBuffer.y--;\n this._restrictCursor(); // quickfix to not run out of bounds\n }\n return true;\n }\n\n /**\n * ESC c\n * DEC mnemonic: RIS (https://vt100.net/docs/vt510-rm/RIS.html)\n * Reset to initial state.\n */\n public fullReset(): boolean {\n this._parser.reset();\n this._onRequestReset.fire();\n return true;\n }\n\n public reset(): void {\n this._curAttrData = DEFAULT_ATTR_DATA.clone();\n this._eraseAttrDataInternal = DEFAULT_ATTR_DATA.clone();\n }\n\n /**\n * back_color_erase feature for xterm.\n */\n private _eraseAttrData(): IAttributeData {\n this._eraseAttrDataInternal.bg &= ~(Attributes.CM_MASK | 0xFFFFFF);\n this._eraseAttrDataInternal.bg |= this._curAttrData.bg & ~0xFC000000;\n return this._eraseAttrDataInternal;\n }\n\n /**\n * ESC n\n * ESC o\n * ESC |\n * ESC }\n * ESC ~\n * DEC mnemonic: LS (https://vt100.net/docs/vt510-rm/LS.html)\n * When you use a locking shift, the character set remains in GL or GR until\n * you use another locking shift. (partly supported)\n */\n public setgLevel(level: number): boolean {\n this._charsetService.setgLevel(level);\n return true;\n }\n\n /**\n * ESC # 8\n * DEC mnemonic: DECALN (https://vt100.net/docs/vt510-rm/DECALN.html)\n * This control function fills the complete screen area with\n * a test pattern (E) used for adjusting screen alignment.\n *\n * @vt: #Y ESC DECALN \"Screen Alignment Pattern\" \"ESC # 8\" \"Fill viewport with a test pattern (E).\"\n */\n public screenAlignmentPattern(): boolean {\n // prepare cell data\n const cell = new CellData();\n cell.content = 1 << Content.WIDTH_SHIFT | 'E'.charCodeAt(0);\n cell.fg = this._curAttrData.fg;\n cell.bg = this._curAttrData.bg;\n\n\n this._setCursor(0, 0);\n for (let yOffset = 0; yOffset < this._bufferService.rows; ++yOffset) {\n const row = this._activeBuffer.ybase + this._activeBuffer.y + yOffset;\n const line = this._activeBuffer.lines.get(row);\n if (line) {\n line.fill(cell);\n line.isWrapped = false;\n }\n }\n this._dirtyRowService.markAllDirty();\n this._setCursor(0, 0);\n return true;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\n/**\n * A base class that can be extended to provide convenience methods for managing the lifecycle of an\n * object and its components.\n */\nexport abstract class Disposable implements IDisposable {\n protected _disposables: IDisposable[] = [];\n protected _isDisposed: boolean = false;\n\n constructor() {\n }\n\n /**\n * Disposes the object, triggering the `dispose` method on all registered IDisposables.\n */\n public dispose(): void {\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.length = 0;\n }\n\n /**\n * Registers a disposable object.\n * @param d The disposable to register.\n * @returns The disposable.\n */\n public register(d: T): T {\n this._disposables.push(d);\n return d;\n }\n\n /**\n * Unregisters a disposable object if it has been registered, if not do\n * nothing.\n * @param d The disposable to unregister.\n */\n public unregister(d: T): void {\n const index = this._disposables.indexOf(d);\n if (index !== -1) {\n this._disposables.splice(index, 1);\n }\n }\n}\n\n/**\n * Dispose of all disposables in an array and set its length to 0.\n */\nexport function disposeArray(disposables: IDisposable[]): void {\n for (const d of disposables) {\n d.dispose();\n }\n disposables.length = 0;\n}\n\n/**\n * Creates a disposable that will dispose of an array of disposables when disposed.\n */\nexport function getDisposeArrayDisposable(array: IDisposable[]): IDisposable {\n return { dispose: () => disposeArray(array) };\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\ninterface INavigator {\n userAgent: string;\n language: string;\n platform: string;\n}\n\n// We're declaring a navigator global here as we expect it in all runtimes (node and browser), but\n// we want this module to live in common.\ndeclare const navigator: INavigator;\n\nconst isNode = (typeof navigator === 'undefined') ? true : false;\nconst userAgent = (isNode) ? 'node' : navigator.userAgent;\nconst platform = (isNode) ? 'node' : navigator.platform;\n\nexport const isFirefox = userAgent.includes('Firefox');\nexport const isLegacyEdge = userAgent.includes('Edge');\nexport const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);\n\n// Find the users platform. We use this to interpret the meta key\n// and ISO third level shifts.\n// http://stackoverflow.com/q/19877924/577598\nexport const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform);\nexport const isIpad = platform === 'iPad';\nexport const isIphone = platform === 'iPhone';\nexport const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(platform);\nexport const isLinux = platform.indexOf('Linux') >= 0;\n", "/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * A generic list that is maintained in sorted order and allows values with duplicate keys. This\n * list is based on binary search and as such locating a key will take O(log n) amortized, this\n * includes the by key iterator.\n */\nexport class SortedList {\n private readonly _array: T[] = [];\n\n constructor(\n private readonly _getKey: (value: T) => number\n ) {\n }\n\n public clear(): void {\n this._array.length = 0;\n }\n\n public insert(value: T): void {\n if (this._array.length === 0) {\n this._array.push(value);\n return;\n }\n const i = this._search(this._getKey(value), 0, this._array.length - 1);\n this._array.splice(i, 0, value);\n }\n\n public delete(value: T): boolean {\n if (this._array.length === 0) {\n return false;\n }\n const key = this._getKey(value);\n let i = this._search(key, 0, this._array.length - 1);\n if (this._getKey(this._array[i]) !== key) {\n return false;\n }\n do {\n if (this._array[i] === value) {\n this._array.splice(i, 1);\n return true;\n }\n } while (++i < this._array.length && this._getKey(this._array[i]) === key);\n return false;\n }\n\n public *getKeyIterator(key: number): IterableIterator {\n if (this._array.length === 0) {\n return;\n }\n let i = this._search(key, 0, this._array.length - 1);\n if (i < 0 || i >= this._array.length) {\n return;\n }\n if (this._getKey(this._array[i]) !== key) {\n return;\n }\n do {\n yield this._array[i];\n } while (++i < this._array.length && this._getKey(this._array[i]) === key);\n }\n\n public values(): IterableIterator {\n return this._array.values();\n }\n\n private _search(key: number, min: number, max: number): number {\n if (max < min) {\n return min;\n }\n let mid = Math.floor((min + max) / 2);\n if (this._getKey(this._array[mid]) > key) {\n return this._search(key, min, mid - 1);\n }\n if (this._getKey(this._array[mid]) < key) {\n return this._search(key, mid + 1, max);\n }\n // Value found! Since keys can be duplicates, move the result index back to the lowest index\n // that matches the key.\n while (mid > 0 && this._getKey(this._array[mid - 1]) === key) {\n mid--;\n }\n return mid;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport type TypedArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;\n\n\n/**\n * polyfill for TypedArray.fill\n * This is needed to support .fill in all safari versions and IE 11.\n */\nexport function fill(array: T, value: number, start?: number, end?: number): T {\n // all modern engines that support .fill\n if (array.fill) {\n return array.fill(value, start, end) as T;\n }\n return fillFallback(array, value, start, end);\n}\n\nexport function fillFallback(array: T, value: number, start: number = 0, end: number = array.length): T {\n // safari and IE 11\n // since IE 11 does not support Array.prototype.fill either\n // we cannot use the suggested polyfill from MDN\n // instead we simply fall back to looping\n if (start >= array.length) {\n return array;\n }\n start = (array.length + start) % array.length;\n if (end >= array.length) {\n end = array.length;\n } else {\n end = (array.length + end) % array.length;\n }\n for (let i = start; i < end; ++i) {\n array[i] = value;\n }\n return array;\n}\n\n/**\n * Concat two typed arrays `a` and `b`.\n * Returns a new typed array.\n */\nexport function concat(a: T, b: T): T {\n const result = new (a.constructor as any)(a.length + b.length);\n result.set(a);\n result.set(b, a.length);\n return result;\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CHAR_DATA_CODE_INDEX, NULL_CELL_CODE, WHITESPACE_CELL_CODE } from 'common/buffer/Constants';\nimport { IBufferService } from 'common/services/Services';\n\nexport function updateWindowsModeWrappedState(bufferService: IBufferService): void {\n // Winpty does not support wraparound mode which means that lines will never\n // be marked as wrapped. This causes issues for things like copying a line\n // retaining the wrapped new line characters or if consumers are listening\n // in on the data stream.\n //\n // The workaround for this is to listen to every incoming line feed and mark\n // the line as wrapped if the last character in the previous line is not a\n // space. This is certainly not without its problems, but generally on\n // Windows when text reaches the end of the terminal it's likely going to be\n // wrapped.\n const line = bufferService.buffer.lines.get(bufferService.buffer.ybase + bufferService.buffer.y - 1);\n const lastChar = line?.get(bufferService.cols - 1);\n\n const nextLine = bufferService.buffer.lines.get(bufferService.buffer.ybase + bufferService.buffer.y);\n if (nextLine && lastChar) {\n nextLine.isWrapped = (lastChar[CHAR_DATA_CODE_INDEX] !== NULL_CELL_CODE && lastChar[CHAR_DATA_CODE_INDEX] !== WHITESPACE_CELL_CODE);\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAttributeData, IColorRGB, IExtendedAttrs } from 'common/Types';\nimport { Attributes, FgFlags, BgFlags, UnderlineStyle } from 'common/buffer/Constants';\n\nexport class AttributeData implements IAttributeData {\n public static toColorRGB(value: number): IColorRGB {\n return [\n value >>> Attributes.RED_SHIFT & 255,\n value >>> Attributes.GREEN_SHIFT & 255,\n value & 255\n ];\n }\n\n public static fromColorRGB(value: IColorRGB): number {\n return (value[0] & 255) << Attributes.RED_SHIFT | (value[1] & 255) << Attributes.GREEN_SHIFT | value[2] & 255;\n }\n\n public clone(): IAttributeData {\n const newObj = new AttributeData();\n newObj.fg = this.fg;\n newObj.bg = this.bg;\n newObj.extended = this.extended.clone();\n return newObj;\n }\n\n // data\n public fg = 0;\n public bg = 0;\n public extended = new ExtendedAttrs();\n\n // flags\n public isInverse(): number { return this.fg & FgFlags.INVERSE; }\n public isBold(): number { return this.fg & FgFlags.BOLD; }\n public isUnderline(): number { return this.fg & FgFlags.UNDERLINE; }\n public isBlink(): number { return this.fg & FgFlags.BLINK; }\n public isInvisible(): number { return this.fg & FgFlags.INVISIBLE; }\n public isItalic(): number { return this.bg & BgFlags.ITALIC; }\n public isDim(): number { return this.bg & BgFlags.DIM; }\n public isStrikethrough(): number { return this.fg & FgFlags.STRIKETHROUGH; }\n\n // color modes\n public getFgColorMode(): number { return this.fg & Attributes.CM_MASK; }\n public getBgColorMode(): number { return this.bg & Attributes.CM_MASK; }\n public isFgRGB(): boolean { return (this.fg & Attributes.CM_MASK) === Attributes.CM_RGB; }\n public isBgRGB(): boolean { return (this.bg & Attributes.CM_MASK) === Attributes.CM_RGB; }\n public isFgPalette(): boolean { return (this.fg & Attributes.CM_MASK) === Attributes.CM_P16 || (this.fg & Attributes.CM_MASK) === Attributes.CM_P256; }\n public isBgPalette(): boolean { return (this.bg & Attributes.CM_MASK) === Attributes.CM_P16 || (this.bg & Attributes.CM_MASK) === Attributes.CM_P256; }\n public isFgDefault(): boolean { return (this.fg & Attributes.CM_MASK) === 0; }\n public isBgDefault(): boolean { return (this.bg & Attributes.CM_MASK) === 0; }\n public isAttributeDefault(): boolean { return this.fg === 0 && this.bg === 0; }\n\n // colors\n public getFgColor(): number {\n switch (this.fg & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.fg & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.fg & Attributes.RGB_MASK;\n default: return -1; // CM_DEFAULT defaults to -1\n }\n }\n public getBgColor(): number {\n switch (this.bg & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.bg & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.bg & Attributes.RGB_MASK;\n default: return -1; // CM_DEFAULT defaults to -1\n }\n }\n\n // extended attrs\n public hasExtendedAttrs(): number {\n return this.bg & BgFlags.HAS_EXTENDED;\n }\n public updateExtended(): void {\n if (this.extended.isEmpty()) {\n this.bg &= ~BgFlags.HAS_EXTENDED;\n } else {\n this.bg |= BgFlags.HAS_EXTENDED;\n }\n }\n public getUnderlineColor(): number {\n if ((this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor) {\n switch (this.extended.underlineColor & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.extended.underlineColor & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.extended.underlineColor & Attributes.RGB_MASK;\n default: return this.getFgColor();\n }\n }\n return this.getFgColor();\n }\n public getUnderlineColorMode(): number {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? this.extended.underlineColor & Attributes.CM_MASK\n : this.getFgColorMode();\n }\n public isUnderlineColorRGB(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_RGB\n : this.isFgRGB();\n }\n public isUnderlineColorPalette(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_P16\n || (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_P256\n : this.isFgPalette();\n }\n public isUnderlineColorDefault(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === 0\n : this.isFgDefault();\n }\n public getUnderlineStyle(): UnderlineStyle {\n return this.fg & FgFlags.UNDERLINE\n ? (this.bg & BgFlags.HAS_EXTENDED ? this.extended.underlineStyle : UnderlineStyle.SINGLE)\n : UnderlineStyle.NONE;\n }\n}\n\n\n/**\n * Extended attributes for a cell.\n * Holds information about different underline styles and color.\n */\nexport class ExtendedAttrs implements IExtendedAttrs {\n constructor(\n // underline style, NONE is empty\n public underlineStyle: UnderlineStyle = UnderlineStyle.NONE,\n // underline color, -1 is empty (same as FG)\n public underlineColor: number = -1\n ) {}\n\n public clone(): IExtendedAttrs {\n return new ExtendedAttrs(this.underlineStyle, this.underlineColor);\n }\n\n /**\n * Convenient method to indicate whether the object holds no additional information,\n * that needs to be persistant in the buffer.\n */\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE;\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CircularList, IInsertEvent } from 'common/CircularList';\nimport { IBuffer, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult } from 'common/buffer/Types';\nimport { IBufferLine, ICellData, IAttributeData, ICharset } from 'common/Types';\nimport { BufferLine, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { CellData } from 'common/buffer/CellData';\nimport { NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_CHAR_INDEX } from 'common/buffer/Constants';\nimport { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths, getWrappedLineTrimmedLength } from 'common/buffer/BufferReflow';\nimport { Marker } from 'common/buffer/Marker';\nimport { IOptionsService, IBufferService } from 'common/services/Services';\nimport { DEFAULT_CHARSET } from 'common/data/Charsets';\nimport { ExtendedAttrs } from 'common/buffer/AttributeData';\n\nexport const MAX_BUFFER_SIZE = 4294967295; // 2^32 - 1\n\n/**\n * This class represents a terminal buffer (an internal state of the terminal), where the\n * following information is stored (in high-level):\n * - text content of this particular buffer\n * - cursor position\n * - scroll position\n */\nexport class Buffer implements IBuffer {\n public lines: CircularList;\n public ydisp: number = 0;\n public ybase: number = 0;\n public y: number = 0;\n public x: number = 0;\n public scrollBottom: number;\n public scrollTop: number;\n // TODO: Type me\n public tabs: any;\n public savedY: number = 0;\n public savedX: number = 0;\n public savedCurAttrData = DEFAULT_ATTR_DATA.clone();\n public savedCharset: ICharset | undefined = DEFAULT_CHARSET;\n public markers: Marker[] = [];\n private _nullCell: ICellData = CellData.fromCharData([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);\n private _whitespaceCell: ICellData = CellData.fromCharData([0, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE]);\n private _cols: number;\n private _rows: number;\n private _isClearing: boolean = false;\n\n constructor(\n private _hasScrollback: boolean,\n private _optionsService: IOptionsService,\n private _bufferService: IBufferService\n ) {\n this._cols = this._bufferService.cols;\n this._rows = this._bufferService.rows;\n this.lines = new CircularList(this._getCorrectBufferLength(this._rows));\n this.scrollTop = 0;\n this.scrollBottom = this._rows - 1;\n this.setupTabStops();\n }\n\n public getNullCell(attr?: IAttributeData): ICellData {\n if (attr) {\n this._nullCell.fg = attr.fg;\n this._nullCell.bg = attr.bg;\n this._nullCell.extended = attr.extended;\n } else {\n this._nullCell.fg = 0;\n this._nullCell.bg = 0;\n this._nullCell.extended = new ExtendedAttrs();\n }\n return this._nullCell;\n }\n\n public getWhitespaceCell(attr?: IAttributeData): ICellData {\n if (attr) {\n this._whitespaceCell.fg = attr.fg;\n this._whitespaceCell.bg = attr.bg;\n this._whitespaceCell.extended = attr.extended;\n } else {\n this._whitespaceCell.fg = 0;\n this._whitespaceCell.bg = 0;\n this._whitespaceCell.extended = new ExtendedAttrs();\n }\n return this._whitespaceCell;\n }\n\n public getBlankLine(attr: IAttributeData, isWrapped?: boolean): IBufferLine {\n return new BufferLine(this._bufferService.cols, this.getNullCell(attr), isWrapped);\n }\n\n public get hasScrollback(): boolean {\n return this._hasScrollback && this.lines.maxLength > this._rows;\n }\n\n public get isCursorInViewport(): boolean {\n const absoluteY = this.ybase + this.y;\n const relativeY = absoluteY - this.ydisp;\n return (relativeY >= 0 && relativeY < this._rows);\n }\n\n /**\n * Gets the correct buffer length based on the rows provided, the terminal's\n * scrollback and whether this buffer is flagged to have scrollback or not.\n * @param rows The terminal rows to use in the calculation.\n */\n private _getCorrectBufferLength(rows: number): number {\n if (!this._hasScrollback) {\n return rows;\n }\n\n const correctBufferLength = rows + this._optionsService.rawOptions.scrollback;\n\n return correctBufferLength > MAX_BUFFER_SIZE ? MAX_BUFFER_SIZE : correctBufferLength;\n }\n\n /**\n * Fills the buffer's viewport with blank lines.\n */\n public fillViewportRows(fillAttr?: IAttributeData): void {\n if (this.lines.length === 0) {\n if (fillAttr === undefined) {\n fillAttr = DEFAULT_ATTR_DATA;\n }\n let i = this._rows;\n while (i--) {\n this.lines.push(this.getBlankLine(fillAttr));\n }\n }\n }\n\n /**\n * Clears the buffer to it's initial state, discarding all previous data.\n */\n public clear(): void {\n this.ydisp = 0;\n this.ybase = 0;\n this.y = 0;\n this.x = 0;\n this.lines = new CircularList(this._getCorrectBufferLength(this._rows));\n this.scrollTop = 0;\n this.scrollBottom = this._rows - 1;\n this.setupTabStops();\n }\n\n /**\n * Resizes the buffer, adjusting its data accordingly.\n * @param newCols The new number of columns.\n * @param newRows The new number of rows.\n */\n public resize(newCols: number, newRows: number): void {\n // store reference to null cell with default attrs\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n\n // Increase max length if needed before adjustments to allow space to fill\n // as required.\n const newMaxLength = this._getCorrectBufferLength(newRows);\n if (newMaxLength > this.lines.maxLength) {\n this.lines.maxLength = newMaxLength;\n }\n\n // The following adjustments should only happen if the buffer has been\n // initialized/filled.\n if (this.lines.length > 0) {\n // Deal with columns increasing (reducing needs to happen after reflow)\n if (this._cols < newCols) {\n for (let i = 0; i < this.lines.length; i++) {\n this.lines.get(i)!.resize(newCols, nullCell);\n }\n }\n\n // Resize rows in both directions as needed\n let addToY = 0;\n if (this._rows < newRows) {\n for (let y = this._rows; y < newRows; y++) {\n if (this.lines.length < newRows + this.ybase) {\n if (this._optionsService.rawOptions.windowsMode) {\n // Just add the new missing rows on Windows as conpty reprints the screen with it's\n // view of the world. Once a line enters scrollback for conpty it remains there\n this.lines.push(new BufferLine(newCols, nullCell));\n } else {\n if (this.ybase > 0 && this.lines.length <= this.ybase + this.y + addToY + 1) {\n // There is room above the buffer and there are no empty elements below the line,\n // scroll up\n this.ybase--;\n addToY++;\n if (this.ydisp > 0) {\n // Viewport is at the top of the buffer, must increase downwards\n this.ydisp--;\n }\n } else {\n // Add a blank line if there is no buffer left at the top to scroll to, or if there\n // are blank lines after the cursor\n this.lines.push(new BufferLine(newCols, nullCell));\n }\n }\n }\n }\n } else { // (this._rows >= newRows)\n for (let y = this._rows; y > newRows; y--) {\n if (this.lines.length > newRows + this.ybase) {\n if (this.lines.length > this.ybase + this.y + 1) {\n // The line is a blank line below the cursor, remove it\n this.lines.pop();\n } else {\n // The line is the cursor, scroll down\n this.ybase++;\n this.ydisp++;\n }\n }\n }\n }\n\n // Reduce max length if needed after adjustments, this is done after as it\n // would otherwise cut data from the bottom of the buffer.\n if (newMaxLength < this.lines.maxLength) {\n // Trim from the top of the buffer and adjust ybase and ydisp.\n const amountToTrim = this.lines.length - newMaxLength;\n if (amountToTrim > 0) {\n this.lines.trimStart(amountToTrim);\n this.ybase = Math.max(this.ybase - amountToTrim, 0);\n this.ydisp = Math.max(this.ydisp - amountToTrim, 0);\n this.savedY = Math.max(this.savedY - amountToTrim, 0);\n }\n this.lines.maxLength = newMaxLength;\n }\n\n // Make sure that the cursor stays on screen\n this.x = Math.min(this.x, newCols - 1);\n this.y = Math.min(this.y, newRows - 1);\n if (addToY) {\n this.y += addToY;\n }\n this.savedX = Math.min(this.savedX, newCols - 1);\n\n this.scrollTop = 0;\n }\n\n this.scrollBottom = newRows - 1;\n\n if (this._isReflowEnabled) {\n this._reflow(newCols, newRows);\n\n // Trim the end of the line off if cols shrunk\n if (this._cols > newCols) {\n for (let i = 0; i < this.lines.length; i++) {\n this.lines.get(i)!.resize(newCols, nullCell);\n }\n }\n }\n\n this._cols = newCols;\n this._rows = newRows;\n }\n\n private get _isReflowEnabled(): boolean {\n return this._hasScrollback && !this._optionsService.rawOptions.windowsMode;\n }\n\n private _reflow(newCols: number, newRows: number): void {\n if (this._cols === newCols) {\n return;\n }\n\n // Iterate through rows, ignore the last one as it cannot be wrapped\n if (newCols > this._cols) {\n this._reflowLarger(newCols, newRows);\n } else {\n this._reflowSmaller(newCols, newRows);\n }\n }\n\n private _reflowLarger(newCols: number, newRows: number): void {\n const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, this._cols, newCols, this.ybase + this.y, this.getNullCell(DEFAULT_ATTR_DATA));\n if (toRemove.length > 0) {\n const newLayoutResult = reflowLargerCreateNewLayout(this.lines, toRemove);\n reflowLargerApplyNewLayout(this.lines, newLayoutResult.layout);\n this._reflowLargerAdjustViewport(newCols, newRows, newLayoutResult.countRemoved);\n }\n }\n\n private _reflowLargerAdjustViewport(newCols: number, newRows: number, countRemoved: number): void {\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n // Adjust viewport based on number of items removed\n let viewportAdjustments = countRemoved;\n while (viewportAdjustments-- > 0) {\n if (this.ybase === 0) {\n if (this.y > 0) {\n this.y--;\n }\n if (this.lines.length < newRows) {\n // Add an extra row at the bottom of the viewport\n this.lines.push(new BufferLine(newCols, nullCell));\n }\n } else {\n if (this.ydisp === this.ybase) {\n this.ydisp--;\n }\n this.ybase--;\n }\n }\n this.savedY = Math.max(this.savedY - countRemoved, 0);\n }\n\n private _reflowSmaller(newCols: number, newRows: number): void {\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n // Gather all BufferLines that need to be inserted into the Buffer here so that they can be\n // batched up and only committed once\n const toInsert = [];\n let countToInsert = 0;\n // Go backwards as many lines may be trimmed and this will avoid considering them\n for (let y = this.lines.length - 1; y >= 0; y--) {\n // Check whether this line is a problem\n let nextLine = this.lines.get(y) as BufferLine;\n if (!nextLine || !nextLine.isWrapped && nextLine.getTrimmedLength() <= newCols) {\n continue;\n }\n\n // Gather wrapped lines and adjust y to be the starting line\n const wrappedLines: BufferLine[] = [nextLine];\n while (nextLine.isWrapped && y > 0) {\n nextLine = this.lines.get(--y) as BufferLine;\n wrappedLines.unshift(nextLine);\n }\n\n // If these lines contain the cursor don't touch them, the program will handle fixing up\n // wrapped lines with the cursor\n const absoluteY = this.ybase + this.y;\n if (absoluteY >= y && absoluteY < y + wrappedLines.length) {\n continue;\n }\n\n const lastLineLength = wrappedLines[wrappedLines.length - 1].getTrimmedLength();\n const destLineLengths = reflowSmallerGetNewLineLengths(wrappedLines, this._cols, newCols);\n const linesToAdd = destLineLengths.length - wrappedLines.length;\n let trimmedLines: number;\n if (this.ybase === 0 && this.y !== this.lines.length - 1) {\n // If the top section of the buffer is not yet filled\n trimmedLines = Math.max(0, this.y - this.lines.maxLength + linesToAdd);\n } else {\n trimmedLines = Math.max(0, this.lines.length - this.lines.maxLength + linesToAdd);\n }\n\n // Add the new lines\n const newLines: BufferLine[] = [];\n for (let i = 0; i < linesToAdd; i++) {\n const newLine = this.getBlankLine(DEFAULT_ATTR_DATA, true) as BufferLine;\n newLines.push(newLine);\n }\n if (newLines.length > 0) {\n toInsert.push({\n // countToInsert here gets the actual index, taking into account other inserted items.\n // using this we can iterate through the list forwards\n start: y + wrappedLines.length + countToInsert,\n newLines\n });\n countToInsert += newLines.length;\n }\n wrappedLines.push(...newLines);\n\n // Copy buffer data to new locations, this needs to happen backwards to do in-place\n let destLineIndex = destLineLengths.length - 1; // Math.floor(cellsNeeded / newCols);\n let destCol = destLineLengths[destLineIndex]; // cellsNeeded % newCols;\n if (destCol === 0) {\n destLineIndex--;\n destCol = destLineLengths[destLineIndex];\n }\n let srcLineIndex = wrappedLines.length - linesToAdd - 1;\n let srcCol = lastLineLength;\n while (srcLineIndex >= 0) {\n const cellsToCopy = Math.min(srcCol, destCol);\n if (wrappedLines[destLineIndex] === undefined) {\n // Sanity check that the line exists, this has been known to fail for an unknown reason\n // which would stop the reflow from happening if an exception would throw.\n break;\n }\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[srcLineIndex], srcCol - cellsToCopy, destCol - cellsToCopy, cellsToCopy, true);\n destCol -= cellsToCopy;\n if (destCol === 0) {\n destLineIndex--;\n destCol = destLineLengths[destLineIndex];\n }\n srcCol -= cellsToCopy;\n if (srcCol === 0) {\n srcLineIndex--;\n const wrappedLinesIndex = Math.max(srcLineIndex, 0);\n srcCol = getWrappedLineTrimmedLength(wrappedLines, wrappedLinesIndex, this._cols);\n }\n }\n\n // Null out the end of the line ends if a wide character wrapped to the following line\n for (let i = 0; i < wrappedLines.length; i++) {\n if (destLineLengths[i] < newCols) {\n wrappedLines[i].setCell(destLineLengths[i], nullCell);\n }\n }\n\n // Adjust viewport as needed\n let viewportAdjustments = linesToAdd - trimmedLines;\n while (viewportAdjustments-- > 0) {\n if (this.ybase === 0) {\n if (this.y < newRows - 1) {\n this.y++;\n this.lines.pop();\n } else {\n this.ybase++;\n this.ydisp++;\n }\n } else {\n // Ensure ybase does not exceed its maximum value\n if (this.ybase < Math.min(this.lines.maxLength, this.lines.length + countToInsert) - newRows) {\n if (this.ybase === this.ydisp) {\n this.ydisp++;\n }\n this.ybase++;\n }\n }\n }\n this.savedY = Math.min(this.savedY + linesToAdd, this.ybase + newRows - 1);\n }\n\n // Rearrange lines in the buffer if there are any insertions, this is done at the end rather\n // than earlier so that it's a single O(n) pass through the buffer, instead of O(n^2) from many\n // costly calls to CircularList.splice.\n if (toInsert.length > 0) {\n // Record buffer insert events and then play them back backwards so that the indexes are\n // correct\n const insertEvents: IInsertEvent[] = [];\n\n // Record original lines so they don't get overridden when we rearrange the list\n const originalLines: BufferLine[] = [];\n for (let i = 0; i < this.lines.length; i++) {\n originalLines.push(this.lines.get(i) as BufferLine);\n }\n const originalLinesLength = this.lines.length;\n\n let originalLineIndex = originalLinesLength - 1;\n let nextToInsertIndex = 0;\n let nextToInsert = toInsert[nextToInsertIndex];\n this.lines.length = Math.min(this.lines.maxLength, this.lines.length + countToInsert);\n let countInsertedSoFar = 0;\n for (let i = Math.min(this.lines.maxLength - 1, originalLinesLength + countToInsert - 1); i >= 0; i--) {\n if (nextToInsert && nextToInsert.start > originalLineIndex + countInsertedSoFar) {\n // Insert extra lines here, adjusting i as needed\n for (let nextI = nextToInsert.newLines.length - 1; nextI >= 0; nextI--) {\n this.lines.set(i--, nextToInsert.newLines[nextI]);\n }\n i++;\n\n // Create insert events for later\n insertEvents.push({\n index: originalLineIndex + 1,\n amount: nextToInsert.newLines.length\n });\n\n countInsertedSoFar += nextToInsert.newLines.length;\n nextToInsert = toInsert[++nextToInsertIndex];\n } else {\n this.lines.set(i, originalLines[originalLineIndex--]);\n }\n }\n\n // Update markers\n let insertCountEmitted = 0;\n for (let i = insertEvents.length - 1; i >= 0; i--) {\n insertEvents[i].index += insertCountEmitted;\n this.lines.onInsertEmitter.fire(insertEvents[i]);\n insertCountEmitted += insertEvents[i].amount;\n }\n const amountToTrim = Math.max(0, originalLinesLength + countToInsert - this.lines.maxLength);\n if (amountToTrim > 0) {\n this.lines.onTrimEmitter.fire(amountToTrim);\n }\n }\n }\n\n // private _reflowSmallerGetLinesNeeded()\n\n /**\n * Translates a string index back to a BufferIndex.\n * To get the correct buffer position the string must start at `startCol` 0\n * (default in translateBufferLineToString).\n * The method also works on wrapped line strings given rows were not trimmed.\n * The method operates on the CharData string length, there are no\n * additional content or boundary checks. Therefore the string and the buffer\n * should not be altered in between.\n * TODO: respect trim flag after fixing #1685\n * @param lineIndex line index the string was retrieved from\n * @param stringIndex index within the string\n * @param startCol column offset the string was retrieved from\n */\n public stringIndexToBufferIndex(lineIndex: number, stringIndex: number, trimRight: boolean = false): BufferIndex {\n while (stringIndex) {\n const line = this.lines.get(lineIndex);\n if (!line) {\n return [-1, -1];\n }\n const length = (trimRight) ? line.getTrimmedLength() : line.length;\n for (let i = 0; i < length; ++i) {\n if (line.get(i)[CHAR_DATA_WIDTH_INDEX]) {\n // empty cells report a string length of 0, but get replaced\n // with a whitespace in translateToString, thus replace with 1\n stringIndex -= line.get(i)[CHAR_DATA_CHAR_INDEX].length || 1;\n }\n if (stringIndex < 0) {\n return [lineIndex, i];\n }\n }\n lineIndex++;\n }\n return [lineIndex, 0];\n }\n\n /**\n * Translates a buffer line to a string, with optional start and end columns.\n * Wide characters will count as two columns in the resulting string. This\n * function is useful for getting the actual text underneath the raw selection\n * position.\n * @param line The line being translated.\n * @param trimRight Whether to trim whitespace to the right.\n * @param startCol The column to start at.\n * @param endCol The column to end at.\n */\n public translateBufferLineToString(lineIndex: number, trimRight: boolean, startCol: number = 0, endCol?: number): string {\n const line = this.lines.get(lineIndex);\n if (!line) {\n return '';\n }\n return line.translateToString(trimRight, startCol, endCol);\n }\n\n public getWrappedRangeForLine(y: number): { first: number, last: number } {\n let first = y;\n let last = y;\n // Scan upwards for wrapped lines\n while (first > 0 && this.lines.get(first)!.isWrapped) {\n first--;\n }\n // Scan downwards for wrapped lines\n while (last + 1 < this.lines.length && this.lines.get(last + 1)!.isWrapped) {\n last++;\n }\n return { first, last };\n }\n\n /**\n * Setup the tab stops.\n * @param i The index to start setting up tab stops from.\n */\n public setupTabStops(i?: number): void {\n if (i !== null && i !== undefined) {\n if (!this.tabs[i]) {\n i = this.prevStop(i);\n }\n } else {\n this.tabs = {};\n i = 0;\n }\n\n for (; i < this._cols; i += this._optionsService.rawOptions.tabStopWidth) {\n this.tabs[i] = true;\n }\n }\n\n /**\n * Move the cursor to the previous tab stop from the given position (default is current).\n * @param x The position to move the cursor to the previous tab stop.\n */\n public prevStop(x?: number): number {\n if (x === null || x === undefined) {\n x = this.x;\n }\n while (!this.tabs[--x] && x > 0);\n return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;\n }\n\n /**\n * Move the cursor one tab stop forward from the given position (default is current).\n * @param x The position to move the cursor one tab stop forward.\n */\n public nextStop(x?: number): number {\n if (x === null || x === undefined) {\n x = this.x;\n }\n while (!this.tabs[++x] && x < this._cols);\n return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;\n }\n\n /**\n * Clears markers on single line.\n * @param y The line to clear.\n */\n public clearMarkers(y: number): void {\n this._isClearing = true;\n for (let i = 0; i < this.markers.length; i++) {\n if (this.markers[i].line === y) {\n this.markers[i].dispose();\n this.markers.splice(i--, 1);\n }\n }\n this._isClearing = false;\n }\n\n /**\n * Clears markers on all lines\n */\n public clearAllMarkers(): void {\n this._isClearing = true;\n for (let i = 0; i < this.markers.length; i++) {\n this.markers[i].dispose();\n this.markers.splice(i--, 1);\n }\n this._isClearing = false;\n }\n\n public addMarker(y: number): Marker {\n const marker = new Marker(y);\n this.markers.push(marker);\n marker.register(this.lines.onTrim(amount => {\n marker.line -= amount;\n // The marker should be disposed when the line is trimmed from the buffer\n if (marker.line < 0) {\n marker.dispose();\n }\n }));\n marker.register(this.lines.onInsert(event => {\n if (marker.line >= event.index) {\n marker.line += event.amount;\n }\n }));\n marker.register(this.lines.onDelete(event => {\n // Delete the marker if it's within the range\n if (marker.line >= event.index && marker.line < event.index + event.amount) {\n marker.dispose();\n }\n\n // Shift the marker if it's after the deleted range\n if (marker.line > event.index) {\n marker.line -= event.amount;\n }\n }));\n marker.register(marker.onDispose(() => this._removeMarker(marker)));\n return marker;\n }\n\n private _removeMarker(marker: Marker): void {\n if (!this._isClearing) {\n this.markers.splice(this.markers.indexOf(marker), 1);\n }\n }\n\n public iterator(trimRight: boolean, startIndex?: number, endIndex?: number, startOverscan?: number, endOverscan?: number): IBufferStringIterator {\n return new BufferStringIterator(this, trimRight, startIndex, endIndex, startOverscan, endOverscan);\n }\n}\n\n/**\n * Iterator to get unwrapped content strings from the buffer.\n * The iterator returns at least the string data between the borders\n * `startIndex` and `endIndex` (exclusive) and will expand the lines\n * by `startOverscan` to the top and by `endOverscan` to the bottom,\n * if no new line was found in between.\n * It will never read/return string data beyond `startIndex - startOverscan`\n * or `endIndex + endOverscan`. Therefore the first and last line might be truncated.\n * It is possible to always get the full string for the first and last line as well\n * by setting the overscan values to the actual buffer length. This not recommended\n * since it might return the whole buffer within a single string in a worst case scenario.\n */\nexport class BufferStringIterator implements IBufferStringIterator {\n private _current: number;\n\n constructor(\n private _buffer: IBuffer,\n private _trimRight: boolean,\n private _startIndex: number = 0,\n private _endIndex: number = _buffer.lines.length,\n private _startOverscan: number = 0,\n private _endOverscan: number = 0\n ) {\n if (this._startIndex < 0) {\n this._startIndex = 0;\n }\n if (this._endIndex > this._buffer.lines.length) {\n this._endIndex = this._buffer.lines.length;\n }\n this._current = this._startIndex;\n }\n\n public hasNext(): boolean {\n return this._current < this._endIndex;\n }\n\n public next(): IBufferStringIteratorResult {\n const range = this._buffer.getWrappedRangeForLine(this._current);\n // limit search window to overscan value at both borders\n if (range.first < this._startIndex - this._startOverscan) {\n range.first = this._startIndex - this._startOverscan;\n }\n if (range.last > this._endIndex + this._endOverscan) {\n range.last = this._endIndex + this._endOverscan;\n }\n // limit to current buffer length\n range.first = Math.max(range.first, 0);\n range.last = Math.min(range.last, this._buffer.lines.length);\n let content = '';\n for (let i = range.first; i <= range.last; ++i) {\n content += this._buffer.translateBufferLineToString(i, this._trimRight);\n }\n this._current = range.last + 1;\n return { range, content };\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, IBufferLine, ICellData, IAttributeData, IExtendedAttrs } from 'common/Types';\nimport { stringFromCodePoint } from 'common/input/TextDecoder';\nimport { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Content, BgFlags } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';\n\n/**\n * buffer memory layout:\n *\n * | uint32_t | uint32_t | uint32_t |\n * | `content` | `FG` | `BG` |\n * | wcwidth(2) comb(1) codepoint(21) | flags(8) R(8) G(8) B(8) | flags(8) R(8) G(8) B(8) |\n */\n\n\n/** typed array slots taken by one cell */\nconst CELL_SIZE = 3;\n\n/**\n * Cell member indices.\n *\n * Direct access:\n * `content = data[column * CELL_SIZE + Cell.CONTENT];`\n * `fg = data[column * CELL_SIZE + Cell.FG];`\n * `bg = data[column * CELL_SIZE + Cell.BG];`\n */\nconst enum Cell {\n CONTENT = 0,\n FG = 1, // currently simply holds all known attrs\n BG = 2 // currently unused\n}\n\nexport const DEFAULT_ATTR_DATA = Object.freeze(new AttributeData());\n\n/**\n * Typed array based bufferline implementation.\n *\n * There are 2 ways to insert data into the cell buffer:\n * - `setCellFromCodepoint` + `addCodepointToCell`\n * Use these for data that is already UTF32.\n * Used during normal input in `InputHandler` for faster buffer access.\n * - `setCell`\n * This method takes a CellData object and stores the data in the buffer.\n * Use `CellData.fromCharData` to create the CellData object (e.g. from JS string).\n *\n * To retrieve data from the buffer use either one of the primitive methods\n * (if only one particular value is needed) or `loadCell`. For `loadCell` in a loop\n * memory allocs / GC pressure can be greatly reduced by reusing the CellData object.\n */\nexport class BufferLine implements IBufferLine {\n protected _data: Uint32Array;\n protected _combined: {[index: number]: string} = {};\n protected _extendedAttrs: {[index: number]: ExtendedAttrs} = {};\n public length: number;\n\n constructor(cols: number, fillCellData?: ICellData, public isWrapped: boolean = false) {\n this._data = new Uint32Array(cols * CELL_SIZE);\n const cell = fillCellData || CellData.fromCharData([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);\n for (let i = 0; i < cols; ++i) {\n this.setCell(i, cell);\n }\n this.length = cols;\n }\n\n /**\n * Get cell data CharData.\n * @deprecated\n */\n public get(index: number): CharData {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n const cp = content & Content.CODEPOINT_MASK;\n return [\n this._data[index * CELL_SIZE + Cell.FG],\n (content & Content.IS_COMBINED_MASK)\n ? this._combined[index]\n : (cp) ? stringFromCodePoint(cp) : '',\n content >> Content.WIDTH_SHIFT,\n (content & Content.IS_COMBINED_MASK)\n ? this._combined[index].charCodeAt(this._combined[index].length - 1)\n : cp\n ];\n }\n\n /**\n * Set cell data from CharData.\n * @deprecated\n */\n public set(index: number, value: CharData): void {\n this._data[index * CELL_SIZE + Cell.FG] = value[CHAR_DATA_ATTR_INDEX];\n if (value[CHAR_DATA_CHAR_INDEX].length > 1) {\n this._combined[index] = value[1];\n this._data[index * CELL_SIZE + Cell.CONTENT] = index | Content.IS_COMBINED_MASK | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n } else {\n this._data[index * CELL_SIZE + Cell.CONTENT] = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n }\n\n /**\n * primitive getters\n * use these when only one value is needed, otherwise use `loadCell`\n */\n public getWidth(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] >> Content.WIDTH_SHIFT;\n }\n\n /** Test whether content has width. */\n public hasWidth(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.WIDTH_MASK;\n }\n\n /** Get FG cell component. */\n public getFg(index: number): number {\n return this._data[index * CELL_SIZE + Cell.FG];\n }\n\n /** Get BG cell component. */\n public getBg(index: number): number {\n return this._data[index * CELL_SIZE + Cell.BG];\n }\n\n /**\n * Test whether contains any chars.\n * Basically an empty has no content, but other cells might differ in FG/BG\n * from real empty cells.\n * */\n public hasContent(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK;\n }\n\n /**\n * Get codepoint of the cell.\n * To be in line with `code` in CharData this either returns\n * a single UTF32 codepoint or the last codepoint of a combined string.\n */\n public getCodePoint(index: number): number {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n return this._combined[index].charCodeAt(this._combined[index].length - 1);\n }\n return content & Content.CODEPOINT_MASK;\n }\n\n /** Test whether the cell contains a combined string. */\n public isCombined(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.IS_COMBINED_MASK;\n }\n\n /** Returns the string content of the cell. */\n public getString(index: number): string {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n return this._combined[index];\n }\n if (content & Content.CODEPOINT_MASK) {\n return stringFromCodePoint(content & Content.CODEPOINT_MASK);\n }\n // return empty string for empty cells\n return '';\n }\n\n /**\n * Load data at `index` into `cell`. This is used to access cells in a way that's more friendly\n * to GC as it significantly reduced the amount of new objects/references needed.\n */\n public loadCell(index: number, cell: ICellData): ICellData {\n const startIndex = index * CELL_SIZE;\n cell.content = this._data[startIndex + Cell.CONTENT];\n cell.fg = this._data[startIndex + Cell.FG];\n cell.bg = this._data[startIndex + Cell.BG];\n if (cell.content & Content.IS_COMBINED_MASK) {\n cell.combinedData = this._combined[index];\n }\n if (cell.bg & BgFlags.HAS_EXTENDED) {\n cell.extended = this._extendedAttrs[index];\n }\n return cell;\n }\n\n /**\n * Set data at `index` to `cell`.\n */\n public setCell(index: number, cell: ICellData): void {\n if (cell.content & Content.IS_COMBINED_MASK) {\n this._combined[index] = cell.combinedData;\n }\n if (cell.bg & BgFlags.HAS_EXTENDED) {\n this._extendedAttrs[index] = cell.extended;\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = cell.content;\n this._data[index * CELL_SIZE + Cell.FG] = cell.fg;\n this._data[index * CELL_SIZE + Cell.BG] = cell.bg;\n }\n\n /**\n * Set cell data from input handler.\n * Since the input handler see the incoming chars as UTF32 codepoints,\n * it gets an optimized access method.\n */\n public setCellFromCodePoint(index: number, codePoint: number, width: number, fg: number, bg: number, eAttrs: IExtendedAttrs): void {\n if (bg & BgFlags.HAS_EXTENDED) {\n this._extendedAttrs[index] = eAttrs;\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = codePoint | (width << Content.WIDTH_SHIFT);\n this._data[index * CELL_SIZE + Cell.FG] = fg;\n this._data[index * CELL_SIZE + Cell.BG] = bg;\n }\n\n /**\n * Add a codepoint to a cell from input handler.\n * During input stage combining chars with a width of 0 follow and stack\n * onto a leading char. Since we already set the attrs\n * by the previous `setDataFromCodePoint` call, we can omit it here.\n */\n public addCodepointToCell(index: number, codePoint: number): void {\n let content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n // we already have a combined string, simply add\n this._combined[index] += stringFromCodePoint(codePoint);\n } else {\n if (content & Content.CODEPOINT_MASK) {\n // normal case for combining chars:\n // - move current leading char + new one into combined string\n // - set combined flag\n this._combined[index] = stringFromCodePoint(content & Content.CODEPOINT_MASK) + stringFromCodePoint(codePoint);\n content &= ~Content.CODEPOINT_MASK; // set codepoint in buffer to 0\n content |= Content.IS_COMBINED_MASK;\n } else {\n // should not happen - we actually have no data in the cell yet\n // simply set the data in the cell buffer with a width of 1\n content = codePoint | (1 << Content.WIDTH_SHIFT);\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = content;\n }\n }\n\n public insertCells(pos: number, n: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {\n pos %= this.length;\n\n // handle fullwidth at pos: reset cell one to the left if pos is second cell of a wide char\n if (pos && this.getWidth(pos - 1) === 2) {\n this.setCellFromCodePoint(pos - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n\n if (n < this.length - pos) {\n const cell = new CellData();\n for (let i = this.length - pos - n - 1; i >= 0; --i) {\n this.setCell(pos + n + i, this.loadCell(pos + i, cell));\n }\n for (let i = 0; i < n; ++i) {\n this.setCell(pos + i, fillCellData);\n }\n } else {\n for (let i = pos; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n // handle fullwidth at line end: reset last cell if it is first cell of a wide char\n if (this.getWidth(this.length - 1) === 2) {\n this.setCellFromCodePoint(this.length - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n }\n\n public deleteCells(pos: number, n: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {\n pos %= this.length;\n if (n < this.length - pos) {\n const cell = new CellData();\n for (let i = 0; i < this.length - pos - n; ++i) {\n this.setCell(pos + i, this.loadCell(pos + n + i, cell));\n }\n for (let i = this.length - n; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n } else {\n for (let i = pos; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n // handle fullwidth at pos:\n // - reset pos-1 if wide char\n // - reset pos if width==0 (previous second cell of a wide char)\n if (pos && this.getWidth(pos - 1) === 2) {\n this.setCellFromCodePoint(pos - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n if (this.getWidth(pos) === 0 && !this.hasContent(pos)) {\n this.setCellFromCodePoint(pos, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n }\n\n public replaceCells(start: number, end: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {\n // handle fullwidth at start: reset cell one to the left if start is second cell of a wide char\n if (start && this.getWidth(start - 1) === 2) {\n this.setCellFromCodePoint(start - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n // handle fullwidth at last cell + 1: reset to empty cell if it is second part of a wide char\n if (end < this.length && this.getWidth(end - 1) === 2) {\n this.setCellFromCodePoint(end, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n\n while (start < end && start < this.length) {\n this.setCell(start++, fillCellData);\n }\n }\n\n public resize(cols: number, fillCellData: ICellData): void {\n if (cols === this.length) {\n return;\n }\n if (cols > this.length) {\n const data = new Uint32Array(cols * CELL_SIZE);\n if (this.length) {\n if (cols * CELL_SIZE < this._data.length) {\n data.set(this._data.subarray(0, cols * CELL_SIZE));\n } else {\n data.set(this._data);\n }\n }\n this._data = data;\n for (let i = this.length; i < cols; ++i) {\n this.setCell(i, fillCellData);\n }\n } else {\n if (cols) {\n const data = new Uint32Array(cols * CELL_SIZE);\n data.set(this._data.subarray(0, cols * CELL_SIZE));\n this._data = data;\n // Remove any cut off combined data, FIXME: repeat this for extended attrs\n const keys = Object.keys(this._combined);\n for (let i = 0; i < keys.length; i++) {\n const key = parseInt(keys[i], 10);\n if (key >= cols) {\n delete this._combined[key];\n }\n }\n } else {\n this._data = new Uint32Array(0);\n this._combined = {};\n }\n }\n this.length = cols;\n }\n\n /** fill a line with fillCharData */\n public fill(fillCellData: ICellData): void {\n this._combined = {};\n this._extendedAttrs = {};\n for (let i = 0; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n /** alter to a full copy of line */\n public copyFrom(line: BufferLine): void {\n if (this.length !== line.length) {\n this._data = new Uint32Array(line._data);\n } else {\n // use high speed copy if lengths are equal\n this._data.set(line._data);\n }\n this.length = line.length;\n this._combined = {};\n for (const el in line._combined) {\n this._combined[el] = line._combined[el];\n }\n this._extendedAttrs = {};\n for (const el in line._extendedAttrs) {\n this._extendedAttrs[el] = line._extendedAttrs[el];\n }\n this.isWrapped = line.isWrapped;\n }\n\n /** create a new clone */\n public clone(): IBufferLine {\n const newLine = new BufferLine(0);\n newLine._data = new Uint32Array(this._data);\n newLine.length = this.length;\n for (const el in this._combined) {\n newLine._combined[el] = this._combined[el];\n }\n for (const el in this._extendedAttrs) {\n newLine._extendedAttrs[el] = this._extendedAttrs[el];\n }\n newLine.isWrapped = this.isWrapped;\n return newLine;\n }\n\n public getTrimmedLength(): number {\n for (let i = this.length - 1; i >= 0; --i) {\n if ((this._data[i * CELL_SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK)) {\n return i + (this._data[i * CELL_SIZE + Cell.CONTENT] >> Content.WIDTH_SHIFT);\n }\n }\n return 0;\n }\n\n public copyCellsFrom(src: BufferLine, srcCol: number, destCol: number, length: number, applyInReverse: boolean): void {\n const srcData = src._data;\n if (applyInReverse) {\n for (let cell = length - 1; cell >= 0; cell--) {\n for (let i = 0; i < CELL_SIZE; i++) {\n this._data[(destCol + cell) * CELL_SIZE + i] = srcData[(srcCol + cell) * CELL_SIZE + i];\n }\n }\n } else {\n for (let cell = 0; cell < length; cell++) {\n for (let i = 0; i < CELL_SIZE; i++) {\n this._data[(destCol + cell) * CELL_SIZE + i] = srcData[(srcCol + cell) * CELL_SIZE + i];\n }\n }\n }\n\n // Move any combined data over as needed, FIXME: repeat for extended attrs\n const srcCombinedKeys = Object.keys(src._combined);\n for (let i = 0; i < srcCombinedKeys.length; i++) {\n const key = parseInt(srcCombinedKeys[i], 10);\n if (key >= srcCol) {\n this._combined[key - srcCol + destCol] = src._combined[key];\n }\n }\n }\n\n public translateToString(trimRight: boolean = false, startCol: number = 0, endCol: number = this.length): string {\n if (trimRight) {\n endCol = Math.min(endCol, this.getTrimmedLength());\n }\n let result = '';\n while (startCol < endCol) {\n const content = this._data[startCol * CELL_SIZE + Cell.CONTENT];\n const cp = content & Content.CODEPOINT_MASK;\n result += (content & Content.IS_COMBINED_MASK) ? this._combined[startCol] : (cp) ? stringFromCodePoint(cp) : WHITESPACE_CELL_CHAR;\n startCol += (content >> Content.WIDTH_SHIFT) || 1; // always advance by 1\n }\n return result;\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferRange } from 'xterm';\n\nexport function getRangeLength(range: IBufferRange, bufferCols: number): number {\n if (range.start.y > range.end.y) {\n throw new Error(`Buffer range end (${range.end.x}, ${range.end.y}) cannot be before start (${range.start.x}, ${range.start.y})`);\n }\n return bufferCols * (range.end.y - range.start.y) + (range.end.x - range.start.x + 1);\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { BufferLine } from 'common/buffer/BufferLine';\nimport { CircularList } from 'common/CircularList';\nimport { IBufferLine, ICellData } from 'common/Types';\n\nexport interface INewLayoutResult {\n layout: number[];\n countRemoved: number;\n}\n\n/**\n * Evaluates and returns indexes to be removed after a reflow larger occurs. Lines will be removed\n * when a wrapped line unwraps.\n * @param lines The buffer lines.\n * @param newCols The columns after resize.\n */\nexport function reflowLargerGetLinesToRemove(lines: CircularList, oldCols: number, newCols: number, bufferAbsoluteY: number, nullCell: ICellData): number[] {\n // Gather all BufferLines that need to be removed from the Buffer here so that they can be\n // batched up and only committed once\n const toRemove: number[] = [];\n\n for (let y = 0; y < lines.length - 1; y++) {\n // Check if this row is wrapped\n let i = y;\n let nextLine = lines.get(++i) as BufferLine;\n if (!nextLine.isWrapped) {\n continue;\n }\n\n // Check how many lines it's wrapped for\n const wrappedLines: BufferLine[] = [lines.get(y) as BufferLine];\n while (i < lines.length && nextLine.isWrapped) {\n wrappedLines.push(nextLine);\n nextLine = lines.get(++i) as BufferLine;\n }\n\n // If these lines contain the cursor don't touch them, the program will handle fixing up wrapped\n // lines with the cursor\n if (bufferAbsoluteY >= y && bufferAbsoluteY < i) {\n y += wrappedLines.length - 1;\n continue;\n }\n\n // Copy buffer data to new locations\n let destLineIndex = 0;\n let destCol = getWrappedLineTrimmedLength(wrappedLines, destLineIndex, oldCols);\n let srcLineIndex = 1;\n let srcCol = 0;\n while (srcLineIndex < wrappedLines.length) {\n const srcTrimmedTineLength = getWrappedLineTrimmedLength(wrappedLines, srcLineIndex, oldCols);\n const srcRemainingCells = srcTrimmedTineLength - srcCol;\n const destRemainingCells = newCols - destCol;\n const cellsToCopy = Math.min(srcRemainingCells, destRemainingCells);\n\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[srcLineIndex], srcCol, destCol, cellsToCopy, false);\n\n destCol += cellsToCopy;\n if (destCol === newCols) {\n destLineIndex++;\n destCol = 0;\n }\n srcCol += cellsToCopy;\n if (srcCol === srcTrimmedTineLength) {\n srcLineIndex++;\n srcCol = 0;\n }\n\n // Make sure the last cell isn't wide, if it is copy it to the current dest\n if (destCol === 0 && destLineIndex !== 0) {\n if (wrappedLines[destLineIndex - 1].getWidth(newCols - 1) === 2) {\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[destLineIndex - 1], newCols - 1, destCol++, 1, false);\n // Null out the end of the last row\n wrappedLines[destLineIndex - 1].setCell(newCols - 1, nullCell);\n }\n }\n }\n\n // Clear out remaining cells or fragments could remain;\n wrappedLines[destLineIndex].replaceCells(destCol, newCols, nullCell);\n\n // Work backwards and remove any rows at the end that only contain null cells\n let countToRemove = 0;\n for (let i = wrappedLines.length - 1; i > 0; i--) {\n if (i > destLineIndex || wrappedLines[i].getTrimmedLength() === 0) {\n countToRemove++;\n } else {\n break;\n }\n }\n\n if (countToRemove > 0) {\n toRemove.push(y + wrappedLines.length - countToRemove); // index\n toRemove.push(countToRemove);\n }\n\n y += wrappedLines.length - 1;\n }\n return toRemove;\n}\n\n/**\n * Creates and return the new layout for lines given an array of indexes to be removed.\n * @param lines The buffer lines.\n * @param toRemove The indexes to remove.\n */\nexport function reflowLargerCreateNewLayout(lines: CircularList, toRemove: number[]): INewLayoutResult {\n const layout: number[] = [];\n // First iterate through the list and get the actual indexes to use for rows\n let nextToRemoveIndex = 0;\n let nextToRemoveStart = toRemove[nextToRemoveIndex];\n let countRemovedSoFar = 0;\n for (let i = 0; i < lines.length; i++) {\n if (nextToRemoveStart === i) {\n const countToRemove = toRemove[++nextToRemoveIndex];\n\n // Tell markers that there was a deletion\n lines.onDeleteEmitter.fire({\n index: i - countRemovedSoFar,\n amount: countToRemove\n });\n\n i += countToRemove - 1;\n countRemovedSoFar += countToRemove;\n nextToRemoveStart = toRemove[++nextToRemoveIndex];\n } else {\n layout.push(i);\n }\n }\n return {\n layout,\n countRemoved: countRemovedSoFar\n };\n}\n\n/**\n * Applies a new layout to the buffer. This essentially does the same as many splice calls but it's\n * done all at once in a single iteration through the list since splice is very expensive.\n * @param lines The buffer lines.\n * @param newLayout The new layout to apply.\n */\nexport function reflowLargerApplyNewLayout(lines: CircularList, newLayout: number[]): void {\n // Record original lines so they don't get overridden when we rearrange the list\n const newLayoutLines: BufferLine[] = [];\n for (let i = 0; i < newLayout.length; i++) {\n newLayoutLines.push(lines.get(newLayout[i]) as BufferLine);\n }\n\n // Rearrange the list\n for (let i = 0; i < newLayoutLines.length; i++) {\n lines.set(i, newLayoutLines[i]);\n }\n lines.length = newLayout.length;\n}\n\n/**\n * Gets the new line lengths for a given wrapped line. The purpose of this function it to pre-\n * compute the wrapping points since wide characters may need to be wrapped onto the following line.\n * This function will return an array of numbers of where each line wraps to, the resulting array\n * will only contain the values `newCols` (when the line does not end with a wide character) and\n * `newCols - 1` (when the line does end with a wide character), except for the last value which\n * will contain the remaining items to fill the line.\n *\n * Calling this with a `newCols` value of `1` will lock up.\n *\n * @param wrappedLines The wrapped lines to evaluate.\n * @param oldCols The columns before resize.\n * @param newCols The columns after resize.\n */\nexport function reflowSmallerGetNewLineLengths(wrappedLines: BufferLine[], oldCols: number, newCols: number): number[] {\n const newLineLengths: number[] = [];\n const cellsNeeded = wrappedLines.map((l, i) => getWrappedLineTrimmedLength(wrappedLines, i, oldCols)).reduce((p, c) => p + c);\n\n // Use srcCol and srcLine to find the new wrapping point, use that to get the cellsAvailable and\n // linesNeeded\n let srcCol = 0;\n let srcLine = 0;\n let cellsAvailable = 0;\n while (cellsAvailable < cellsNeeded) {\n if (cellsNeeded - cellsAvailable < newCols) {\n // Add the final line and exit the loop\n newLineLengths.push(cellsNeeded - cellsAvailable);\n break;\n }\n srcCol += newCols;\n const oldTrimmedLength = getWrappedLineTrimmedLength(wrappedLines, srcLine, oldCols);\n if (srcCol > oldTrimmedLength) {\n srcCol -= oldTrimmedLength;\n srcLine++;\n }\n const endsWithWide = wrappedLines[srcLine].getWidth(srcCol - 1) === 2;\n if (endsWithWide) {\n srcCol--;\n }\n const lineLength = endsWithWide ? newCols - 1 : newCols;\n newLineLengths.push(lineLength);\n cellsAvailable += lineLength;\n }\n\n return newLineLengths;\n}\n\nexport function getWrappedLineTrimmedLength(lines: BufferLine[], i: number, cols: number): number {\n // If this is the last row in the wrapped line, get the actual trimmed length\n if (i === lines.length - 1) {\n return lines[i].getTrimmedLength();\n }\n // Detect whether the following line starts with a wide character and the end of the current line\n // is null, if so then we can be pretty sure the null character should be excluded from the line\n // length]\n const endsInNull = !(lines[i].hasContent(cols - 1)) && lines[i].getWidth(cols - 1) === 1;\n const followingLineStartsWithWide = lines[i + 1].getWidth(0) === 2;\n if (endsInNull && followingLineStartsWithWide) {\n return cols - 1;\n }\n return cols;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer, IBufferSet } from 'common/buffer/Types';\nimport { IAttributeData } from 'common/Types';\nimport { Buffer } from 'common/buffer/Buffer';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IOptionsService, IBufferService } from 'common/services/Services';\nimport { Disposable } from 'common/Lifecycle';\n\n/**\n * The BufferSet represents the set of two buffers used by xterm terminals (normal and alt) and\n * provides also utilities for working with them.\n */\nexport class BufferSet extends Disposable implements IBufferSet {\n private _normal!: Buffer;\n private _alt!: Buffer;\n private _activeBuffer!: Buffer;\n\n private _onBufferActivate = this.register(new EventEmitter<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}>());\n public get onBufferActivate(): IEvent<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}> { return this._onBufferActivate.event; }\n\n /**\n * Create a new BufferSet for the given terminal.\n * @param _terminal - The terminal the BufferSet will belong to\n */\n constructor(\n private readonly _optionsService: IOptionsService,\n private readonly _bufferService: IBufferService\n ) {\n super();\n this.reset();\n }\n\n public reset(): void {\n this._normal = new Buffer(true, this._optionsService, this._bufferService);\n this._normal.fillViewportRows();\n\n // The alt buffer should never have scrollback.\n // See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer\n this._alt = new Buffer(false, this._optionsService, this._bufferService);\n this._activeBuffer = this._normal;\n this._onBufferActivate.fire({\n activeBuffer: this._normal,\n inactiveBuffer: this._alt\n });\n\n this.setupTabStops();\n }\n\n /**\n * Returns the alt Buffer of the BufferSet\n */\n public get alt(): Buffer {\n return this._alt;\n }\n\n /**\n * Returns the normal Buffer of the BufferSet\n */\n public get active(): Buffer {\n return this._activeBuffer;\n }\n\n /**\n * Returns the currently active Buffer of the BufferSet\n */\n public get normal(): Buffer {\n return this._normal;\n }\n\n /**\n * Sets the normal Buffer of the BufferSet as its currently active Buffer\n */\n public activateNormalBuffer(): void {\n if (this._activeBuffer === this._normal) {\n return;\n }\n this._normal.x = this._alt.x;\n this._normal.y = this._alt.y;\n // The alt buffer should always be cleared when we switch to the normal\n // buffer. This frees up memory since the alt buffer should always be new\n // when activated.\n this._alt.clear();\n this._activeBuffer = this._normal;\n this._onBufferActivate.fire({\n activeBuffer: this._normal,\n inactiveBuffer: this._alt\n });\n }\n\n /**\n * Sets the alt Buffer of the BufferSet as its currently active Buffer\n */\n public activateAltBuffer(fillAttr?: IAttributeData): void {\n if (this._activeBuffer === this._alt) {\n return;\n }\n // Since the alt buffer is always cleared when the normal buffer is\n // activated, we want to fill it when switching to it.\n this._alt.fillViewportRows(fillAttr);\n this._alt.x = this._normal.x;\n this._alt.y = this._normal.y;\n this._activeBuffer = this._alt;\n this._onBufferActivate.fire({\n activeBuffer: this._alt,\n inactiveBuffer: this._normal\n });\n }\n\n /**\n * Resizes both normal and alt buffers, adjusting their data accordingly.\n * @param newCols The new number of columns.\n * @param newRows The new number of rows.\n */\n public resize(newCols: number, newRows: number): void {\n this._normal.resize(newCols, newRows);\n this._alt.resize(newCols, newRows);\n }\n\n /**\n * Setup the tab stops.\n * @param i The index to start setting up tab stops from.\n */\n public setupTabStops(i?: number): void {\n this._normal.setupTabStops(i);\n this._alt.setupTabStops(i);\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, ICellData, IExtendedAttrs } from 'common/Types';\nimport { stringFromCodePoint } from 'common/input/TextDecoder';\nimport { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, Content } from 'common/buffer/Constants';\nimport { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';\n\n/**\n * CellData - represents a single Cell in the terminal buffer.\n */\nexport class CellData extends AttributeData implements ICellData {\n /** Helper to create CellData from CharData. */\n public static fromCharData(value: CharData): CellData {\n const obj = new CellData();\n obj.setFromCharData(value);\n return obj;\n }\n /** Primitives from terminal buffer. */\n public content = 0;\n public fg = 0;\n public bg = 0;\n public extended: IExtendedAttrs = new ExtendedAttrs();\n public combinedData = '';\n /** Whether cell contains a combined string. */\n public isCombined(): number {\n return this.content & Content.IS_COMBINED_MASK;\n }\n /** Width of the cell. */\n public getWidth(): number {\n return this.content >> Content.WIDTH_SHIFT;\n }\n /** JS string of the content. */\n public getChars(): string {\n if (this.content & Content.IS_COMBINED_MASK) {\n return this.combinedData;\n }\n if (this.content & Content.CODEPOINT_MASK) {\n return stringFromCodePoint(this.content & Content.CODEPOINT_MASK);\n }\n return '';\n }\n /**\n * Codepoint of cell\n * Note this returns the UTF32 codepoint of single chars,\n * if content is a combined string it returns the codepoint\n * of the last char in string to be in line with code in CharData.\n * */\n public getCode(): number {\n return (this.isCombined())\n ? this.combinedData.charCodeAt(this.combinedData.length - 1)\n : this.content & Content.CODEPOINT_MASK;\n }\n /** Set data from CharData */\n public setFromCharData(value: CharData): void {\n this.fg = value[CHAR_DATA_ATTR_INDEX];\n this.bg = 0;\n let combined = false;\n // surrogates and combined strings need special treatment\n if (value[CHAR_DATA_CHAR_INDEX].length > 2) {\n combined = true;\n }\n else if (value[CHAR_DATA_CHAR_INDEX].length === 2) {\n const code = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0);\n // if the 2-char string is a surrogate create single codepoint\n // everything else is combined\n if (0xD800 <= code && code <= 0xDBFF) {\n const second = value[CHAR_DATA_CHAR_INDEX].charCodeAt(1);\n if (0xDC00 <= second && second <= 0xDFFF) {\n this.content = ((code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n else {\n combined = true;\n }\n }\n else {\n combined = true;\n }\n }\n else {\n this.content = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n if (combined) {\n this.combinedData = value[CHAR_DATA_CHAR_INDEX];\n this.content = Content.IS_COMBINED_MASK | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n }\n /** Get data as CharData. */\n public getAsCharData(): CharData {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport const DEFAULT_COLOR = 256;\nexport const DEFAULT_ATTR = (0 << 18) | (DEFAULT_COLOR << 9) | (256 << 0);\n\nexport const CHAR_DATA_ATTR_INDEX = 0;\nexport const CHAR_DATA_CHAR_INDEX = 1;\nexport const CHAR_DATA_WIDTH_INDEX = 2;\nexport const CHAR_DATA_CODE_INDEX = 3;\n\n/**\n * Null cell - a real empty cell (containing nothing).\n * Note that code should always be 0 for a null cell as\n * several test condition of the buffer line rely on this.\n */\nexport const NULL_CELL_CHAR = '';\nexport const NULL_CELL_WIDTH = 1;\nexport const NULL_CELL_CODE = 0;\n\n/**\n * Whitespace cell.\n * This is meant as a replacement for empty cells when needed\n * during rendering lines to preserve correct aligment.\n */\nexport const WHITESPACE_CELL_CHAR = ' ';\nexport const WHITESPACE_CELL_WIDTH = 1;\nexport const WHITESPACE_CELL_CODE = 32;\n\n/**\n * Bitmasks for accessing data in `content`.\n */\nexport const enum Content {\n /**\n * bit 1..21 codepoint, max allowed in UTF32 is 0x10FFFF (21 bits taken)\n * read: `codepoint = content & Content.codepointMask;`\n * write: `content |= codepoint & Content.codepointMask;`\n * shortcut if precondition `codepoint <= 0x10FFFF` is met:\n * `content |= codepoint;`\n */\n CODEPOINT_MASK = 0x1FFFFF,\n\n /**\n * bit 22 flag indication whether a cell contains combined content\n * read: `isCombined = content & Content.isCombined;`\n * set: `content |= Content.isCombined;`\n * clear: `content &= ~Content.isCombined;`\n */\n IS_COMBINED_MASK = 0x200000, // 1 << 21\n\n /**\n * bit 1..22 mask to check whether a cell contains any string data\n * we need to check for codepoint and isCombined bits to see\n * whether a cell contains anything\n * read: `isEmpty = !(content & Content.hasContent)`\n */\n HAS_CONTENT_MASK = 0x3FFFFF,\n\n /**\n * bit 23..24 wcwidth value of cell, takes 2 bits (ranges from 0..2)\n * read: `width = (content & Content.widthMask) >> Content.widthShift;`\n * `hasWidth = content & Content.widthMask;`\n * as long as wcwidth is highest value in `content`:\n * `width = content >> Content.widthShift;`\n * write: `content |= (width << Content.widthShift) & Content.widthMask;`\n * shortcut if precondition `0 <= width <= 3` is met:\n * `content |= width << Content.widthShift;`\n */\n WIDTH_MASK = 0xC00000, // 3 << 22\n WIDTH_SHIFT = 22\n}\n\nexport const enum Attributes {\n /**\n * bit 1..8 blue in RGB, color in P256 and P16\n */\n BLUE_MASK = 0xFF,\n BLUE_SHIFT = 0,\n PCOLOR_MASK = 0xFF,\n PCOLOR_SHIFT = 0,\n\n /**\n * bit 9..16 green in RGB\n */\n GREEN_MASK = 0xFF00,\n GREEN_SHIFT = 8,\n\n /**\n * bit 17..24 red in RGB\n */\n RED_MASK = 0xFF0000,\n RED_SHIFT = 16,\n\n /**\n * bit 25..26 color mode: DEFAULT (0) | P16 (1) | P256 (2) | RGB (3)\n */\n CM_MASK = 0x3000000,\n CM_DEFAULT = 0,\n CM_P16 = 0x1000000,\n CM_P256 = 0x2000000,\n CM_RGB = 0x3000000,\n\n /**\n * bit 1..24 RGB room\n */\n RGB_MASK = 0xFFFFFF\n}\n\nexport const enum FgFlags {\n /**\n * bit 27..32\n */\n INVERSE = 0x4000000,\n BOLD = 0x8000000,\n UNDERLINE = 0x10000000,\n BLINK = 0x20000000,\n INVISIBLE = 0x40000000,\n STRIKETHROUGH = 0x80000000,\n}\n\nexport const enum BgFlags {\n /**\n * bit 27..32 (upper 3 unused)\n */\n ITALIC = 0x4000000,\n DIM = 0x8000000,\n HAS_EXTENDED = 0x10000000\n}\n\nexport const enum UnderlineStyle {\n NONE = 0,\n SINGLE = 1,\n DOUBLE = 2,\n CURLY = 3,\n DOTTED = 4,\n DASHED = 5\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { IMarker } from 'common/Types';\n\nexport class Marker extends Disposable implements IMarker {\n private static _nextId = 1;\n\n private _id: number = Marker._nextId++;\n public isDisposed: boolean = false;\n\n public get id(): number { return this._id; }\n\n private _onDispose = new EventEmitter();\n public get onDispose(): IEvent { return this._onDispose.event; }\n\n constructor(\n public line: number\n ) {\n super();\n }\n\n public dispose(): void {\n if (this.isDisposed) {\n return;\n }\n this.isDisposed = true;\n this.line = -1;\n // Emit before super.dispose such that dispose listeners get a change to react\n this._onDispose.fire();\n super.dispose();\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharset } from 'common/Types';\n\n/**\n * The character sets supported by the terminal. These enable several languages\n * to be represented within the terminal with only 8-bit encoding. See ISO 2022\n * for a discussion on character sets. Only VT100 character sets are supported.\n */\nexport const CHARSETS: { [key: string]: ICharset | undefined } = {};\n\n/**\n * The default character set, US.\n */\nexport const DEFAULT_CHARSET: ICharset | undefined = CHARSETS['B'];\n\n/**\n * DEC Special Character and Line Drawing Set.\n * Reference: http://vt100.net/docs/vt102-ug/table5-13.html\n * A lot of curses apps use this if they see TERM=xterm.\n * testing: echo -e '\\e(0a\\e(B'\n * The xterm output sometimes seems to conflict with the\n * reference above. xterm seems in line with the reference\n * when running vttest however.\n * The table below now uses xterm's output from vttest.\n */\nCHARSETS['0'] = {\n '`': '\\u25c6', // '◆'\n 'a': '\\u2592', // '▒'\n 'b': '\\u2409', // '␉' (HT)\n 'c': '\\u240c', // '␌' (FF)\n 'd': '\\u240d', // '␍' (CR)\n 'e': '\\u240a', // '␊' (LF)\n 'f': '\\u00b0', // '°'\n 'g': '\\u00b1', // '±'\n 'h': '\\u2424', // '␤' (NL)\n 'i': '\\u240b', // '␋' (VT)\n 'j': '\\u2518', // '┘'\n 'k': '\\u2510', // '┐'\n 'l': '\\u250c', // '┌'\n 'm': '\\u2514', // '└'\n 'n': '\\u253c', // '┼'\n 'o': '\\u23ba', // '⎺'\n 'p': '\\u23bb', // '⎻'\n 'q': '\\u2500', // '─'\n 'r': '\\u23bc', // '⎼'\n 's': '\\u23bd', // '⎽'\n 't': '\\u251c', // '├'\n 'u': '\\u2524', // '┤'\n 'v': '\\u2534', // '┴'\n 'w': '\\u252c', // '┬'\n 'x': '\\u2502', // '│'\n 'y': '\\u2264', // '≤'\n 'z': '\\u2265', // '≥'\n '{': '\\u03c0', // 'π'\n '|': '\\u2260', // '≠'\n '}': '\\u00a3', // '£'\n '~': '\\u00b7' // '·'\n};\n\n/**\n * British character set\n * ESC (A\n * Reference: http://vt100.net/docs/vt220-rm/table2-5.html\n */\nCHARSETS['A'] = {\n '#': '£'\n};\n\n/**\n * United States character set\n * ESC (B\n */\nCHARSETS['B'] = undefined;\n\n/**\n * Dutch character set\n * ESC (4\n * Reference: http://vt100.net/docs/vt220-rm/table2-6.html\n */\nCHARSETS['4'] = {\n '#': '£',\n '@': '¾',\n '[': 'ij',\n '\\\\': '½',\n ']': '|',\n '{': '¨',\n '|': 'f',\n '}': '¼',\n '~': '´'\n};\n\n/**\n * Finnish character set\n * ESC (C or ESC (5\n * Reference: http://vt100.net/docs/vt220-rm/table2-7.html\n */\nCHARSETS['C'] =\nCHARSETS['5'] = {\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Å',\n '^': 'Ü',\n '`': 'é',\n '{': 'ä',\n '|': 'ö',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * French character set\n * ESC (R\n * Reference: http://vt100.net/docs/vt220-rm/table2-8.html\n */\nCHARSETS['R'] = {\n '#': '£',\n '@': 'à',\n '[': '°',\n '\\\\': 'ç',\n ']': '§',\n '{': 'é',\n '|': 'ù',\n '}': 'è',\n '~': '¨'\n};\n\n/**\n * French Canadian character set\n * ESC (Q\n * Reference: http://vt100.net/docs/vt220-rm/table2-9.html\n */\nCHARSETS['Q'] = {\n '@': 'à',\n '[': 'â',\n '\\\\': 'ç',\n ']': 'ê',\n '^': 'î',\n '`': 'ô',\n '{': 'é',\n '|': 'ù',\n '}': 'è',\n '~': 'û'\n};\n\n/**\n * German character set\n * ESC (K\n * Reference: http://vt100.net/docs/vt220-rm/table2-10.html\n */\nCHARSETS['K'] = {\n '@': '§',\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Ü',\n '{': 'ä',\n '|': 'ö',\n '}': 'ü',\n '~': 'ß'\n};\n\n/**\n * Italian character set\n * ESC (Y\n * Reference: http://vt100.net/docs/vt220-rm/table2-11.html\n */\nCHARSETS['Y'] = {\n '#': '£',\n '@': '§',\n '[': '°',\n '\\\\': 'ç',\n ']': 'é',\n '`': 'ù',\n '{': 'à',\n '|': 'ò',\n '}': 'è',\n '~': 'ì'\n};\n\n/**\n * Norwegian/Danish character set\n * ESC (E or ESC (6\n * Reference: http://vt100.net/docs/vt220-rm/table2-12.html\n */\nCHARSETS['E'] =\nCHARSETS['6'] = {\n '@': 'Ä',\n '[': 'Æ',\n '\\\\': 'Ø',\n ']': 'Å',\n '^': 'Ü',\n '`': 'ä',\n '{': 'æ',\n '|': 'ø',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * Spanish character set\n * ESC (Z\n * Reference: http://vt100.net/docs/vt220-rm/table2-13.html\n */\nCHARSETS['Z'] = {\n '#': '£',\n '@': '§',\n '[': '¡',\n '\\\\': 'Ñ',\n ']': '¿',\n '{': '°',\n '|': 'ñ',\n '}': 'ç'\n};\n\n/**\n * Swedish character set\n * ESC (H or ESC (7\n * Reference: http://vt100.net/docs/vt220-rm/table2-14.html\n */\nCHARSETS['H'] =\nCHARSETS['7'] = {\n '@': 'É',\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Å',\n '^': 'Ü',\n '`': 'é',\n '{': 'ä',\n '|': 'ö',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * Swiss character set\n * ESC (=\n * Reference: http://vt100.net/docs/vt220-rm/table2-15.html\n */\nCHARSETS['='] = {\n '#': 'ù',\n '@': 'à',\n '[': 'é',\n '\\\\': 'ç',\n ']': 'ê',\n '^': 'î',\n // eslint-disable-next-line @typescript-eslint/naming-convention\n '_': 'è',\n '`': 'ô',\n '{': 'ä',\n '|': 'ö',\n '}': 'ü',\n '~': 'û'\n};\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * C0 control codes\n * See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes\n */\nexport namespace C0 {\n /** Null (Caret = ^@, C = \\0) */\n export const NUL = '\\x00';\n /** Start of Heading (Caret = ^A) */\n export const SOH = '\\x01';\n /** Start of Text (Caret = ^B) */\n export const STX = '\\x02';\n /** End of Text (Caret = ^C) */\n export const ETX = '\\x03';\n /** End of Transmission (Caret = ^D) */\n export const EOT = '\\x04';\n /** Enquiry (Caret = ^E) */\n export const ENQ = '\\x05';\n /** Acknowledge (Caret = ^F) */\n export const ACK = '\\x06';\n /** Bell (Caret = ^G, C = \\a) */\n export const BEL = '\\x07';\n /** Backspace (Caret = ^H, C = \\b) */\n export const BS = '\\x08';\n /** Character Tabulation, Horizontal Tabulation (Caret = ^I, C = \\t) */\n export const HT = '\\x09';\n /** Line Feed (Caret = ^J, C = \\n) */\n export const LF = '\\x0a';\n /** Line Tabulation, Vertical Tabulation (Caret = ^K, C = \\v) */\n export const VT = '\\x0b';\n /** Form Feed (Caret = ^L, C = \\f) */\n export const FF = '\\x0c';\n /** Carriage Return (Caret = ^M, C = \\r) */\n export const CR = '\\x0d';\n /** Shift Out (Caret = ^N) */\n export const SO = '\\x0e';\n /** Shift In (Caret = ^O) */\n export const SI = '\\x0f';\n /** Data Link Escape (Caret = ^P) */\n export const DLE = '\\x10';\n /** Device Control One (XON) (Caret = ^Q) */\n export const DC1 = '\\x11';\n /** Device Control Two (Caret = ^R) */\n export const DC2 = '\\x12';\n /** Device Control Three (XOFF) (Caret = ^S) */\n export const DC3 = '\\x13';\n /** Device Control Four (Caret = ^T) */\n export const DC4 = '\\x14';\n /** Negative Acknowledge (Caret = ^U) */\n export const NAK = '\\x15';\n /** Synchronous Idle (Caret = ^V) */\n export const SYN = '\\x16';\n /** End of Transmission Block (Caret = ^W) */\n export const ETB = '\\x17';\n /** Cancel (Caret = ^X) */\n export const CAN = '\\x18';\n /** End of Medium (Caret = ^Y) */\n export const EM = '\\x19';\n /** Substitute (Caret = ^Z) */\n export const SUB = '\\x1a';\n /** Escape (Caret = ^[, C = \\e) */\n export const ESC = '\\x1b';\n /** File Separator (Caret = ^\\) */\n export const FS = '\\x1c';\n /** Group Separator (Caret = ^]) */\n export const GS = '\\x1d';\n /** Record Separator (Caret = ^^) */\n export const RS = '\\x1e';\n /** Unit Separator (Caret = ^_) */\n export const US = '\\x1f';\n /** Space */\n export const SP = '\\x20';\n /** Delete (Caret = ^?) */\n export const DEL = '\\x7f';\n}\n\n/**\n * C1 control codes\n * See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes\n */\nexport namespace C1 {\n /** padding character */\n export const PAD = '\\x80';\n /** High Octet Preset */\n export const HOP = '\\x81';\n /** Break Permitted Here */\n export const BPH = '\\x82';\n /** No Break Here */\n export const NBH = '\\x83';\n /** Index */\n export const IND = '\\x84';\n /** Next Line */\n export const NEL = '\\x85';\n /** Start of Selected Area */\n export const SSA = '\\x86';\n /** End of Selected Area */\n export const ESA = '\\x87';\n /** Horizontal Tabulation Set */\n export const HTS = '\\x88';\n /** Horizontal Tabulation With Justification */\n export const HTJ = '\\x89';\n /** Vertical Tabulation Set */\n export const VTS = '\\x8a';\n /** Partial Line Down */\n export const PLD = '\\x8b';\n /** Partial Line Up */\n export const PLU = '\\x8c';\n /** Reverse Index */\n export const RI = '\\x8d';\n /** Single-Shift 2 */\n export const SS2 = '\\x8e';\n /** Single-Shift 3 */\n export const SS3 = '\\x8f';\n /** Device Control String */\n export const DCS = '\\x90';\n /** Private Use 1 */\n export const PU1 = '\\x91';\n /** Private Use 2 */\n export const PU2 = '\\x92';\n /** Set Transmit State */\n export const STS = '\\x93';\n /** Destructive backspace, intended to eliminate ambiguity about meaning of BS. */\n export const CCH = '\\x94';\n /** Message Waiting */\n export const MW = '\\x95';\n /** Start of Protected Area */\n export const SPA = '\\x96';\n /** End of Protected Area */\n export const EPA = '\\x97';\n /** Start of String */\n export const SOS = '\\x98';\n /** Single Graphic Character Introducer */\n export const SGCI = '\\x99';\n /** Single Character Introducer */\n export const SCI = '\\x9a';\n /** Control Sequence Introducer */\n export const CSI = '\\x9b';\n /** String Terminator */\n export const ST = '\\x9c';\n /** Operating System Command */\n export const OSC = '\\x9d';\n /** Privacy Message */\n export const PM = '\\x9e';\n /** Application Program Command */\n export const APC = '\\x9f';\n}\nexport namespace C1_ESCAPED {\n export const ST = `${C0.ESC}\\\\`;\n}\n", "/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n */\n\nimport { IKeyboardEvent, IKeyboardResult, KeyboardResultType } from 'common/Types';\nimport { C0 } from 'common/data/EscapeSequences';\n\n// reg + shift key mappings for digits and special chars\nconst KEYCODE_KEY_MAPPINGS: { [key: number]: [string, string]} = {\n // digits 0-9\n 48: ['0', ')'],\n 49: ['1', '!'],\n 50: ['2', '@'],\n 51: ['3', '#'],\n 52: ['4', '$'],\n 53: ['5', '%'],\n 54: ['6', '^'],\n 55: ['7', '&'],\n 56: ['8', '*'],\n 57: ['9', '('],\n\n // special chars\n 186: [';', ':'],\n 187: ['=', '+'],\n 188: [',', '<'],\n 189: ['-', '_'],\n 190: ['.', '>'],\n 191: ['/', '?'],\n 192: ['`', '~'],\n 219: ['[', '{'],\n 220: ['\\\\', '|'],\n 221: [']', '}'],\n 222: ['\\'', '\"']\n};\n\nexport function evaluateKeyboardEvent(\n ev: IKeyboardEvent,\n applicationCursorMode: boolean,\n isMac: boolean,\n macOptionIsMeta: boolean\n): IKeyboardResult {\n const result: IKeyboardResult = {\n type: KeyboardResultType.SEND_KEY,\n // Whether to cancel event propagation (NOTE: this may not be needed since the event is\n // canceled at the end of keyDown\n cancel: false,\n // The new key even to emit\n key: undefined\n };\n const modifiers = (ev.shiftKey ? 1 : 0) | (ev.altKey ? 2 : 0) | (ev.ctrlKey ? 4 : 0) | (ev.metaKey ? 8 : 0);\n switch (ev.keyCode) {\n case 0:\n if (ev.key === 'UIKeyInputUpArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OA';\n } else {\n result.key = C0.ESC + '[A';\n }\n }\n else if (ev.key === 'UIKeyInputLeftArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OD';\n } else {\n result.key = C0.ESC + '[D';\n }\n }\n else if (ev.key === 'UIKeyInputRightArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OC';\n } else {\n result.key = C0.ESC + '[C';\n }\n }\n else if (ev.key === 'UIKeyInputDownArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OB';\n } else {\n result.key = C0.ESC + '[B';\n }\n }\n break;\n case 8:\n // backspace\n if (ev.shiftKey) {\n result.key = C0.BS; // ^H\n break;\n } else if (ev.altKey) {\n result.key = C0.ESC + C0.DEL; // \\e ^?\n break;\n }\n result.key = C0.DEL; // ^?\n break;\n case 9:\n // tab\n if (ev.shiftKey) {\n result.key = C0.ESC + '[Z';\n break;\n }\n result.key = C0.HT;\n result.cancel = true;\n break;\n case 13:\n // return/enter\n result.key = ev.altKey ? C0.ESC + C0.CR : C0.CR;\n result.cancel = true;\n break;\n case 27:\n // escape\n result.key = C0.ESC;\n if (ev.altKey) {\n result.key = C0.ESC + C0.ESC;\n }\n result.cancel = true;\n break;\n case 37:\n // left-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'D';\n // HACK: Make Alt + left-arrow behave like Ctrl + left-arrow: move one word backwards\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (result.key === C0.ESC + '[1;3D') {\n result.key = C0.ESC + (isMac ? 'b' : '[1;5D');\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OD';\n } else {\n result.key = C0.ESC + '[D';\n }\n break;\n case 39:\n // right-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'C';\n // HACK: Make Alt + right-arrow behave like Ctrl + right-arrow: move one word forward\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (result.key === C0.ESC + '[1;3C') {\n result.key = C0.ESC + (isMac ? 'f' : '[1;5C');\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OC';\n } else {\n result.key = C0.ESC + '[C';\n }\n break;\n case 38:\n // up-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'A';\n // HACK: Make Alt + up-arrow behave like Ctrl + up-arrow\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (!isMac && result.key === C0.ESC + '[1;3A') {\n result.key = C0.ESC + '[1;5A';\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OA';\n } else {\n result.key = C0.ESC + '[A';\n }\n break;\n case 40:\n // down-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'B';\n // HACK: Make Alt + down-arrow behave like Ctrl + down-arrow\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (!isMac && result.key === C0.ESC + '[1;3B') {\n result.key = C0.ESC + '[1;5B';\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OB';\n } else {\n result.key = C0.ESC + '[B';\n }\n break;\n case 45:\n // insert\n if (!ev.shiftKey && !ev.ctrlKey) {\n // or + are used to\n // copy-paste on some systems.\n result.key = C0.ESC + '[2~';\n }\n break;\n case 46:\n // delete\n if (modifiers) {\n result.key = C0.ESC + '[3;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[3~';\n }\n break;\n case 36:\n // home\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'H';\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OH';\n } else {\n result.key = C0.ESC + '[H';\n }\n break;\n case 35:\n // end\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'F';\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OF';\n } else {\n result.key = C0.ESC + '[F';\n }\n break;\n case 33:\n // page up\n if (ev.shiftKey) {\n result.type = KeyboardResultType.PAGE_UP;\n } else if (ev.ctrlKey) {\n result.key = C0.ESC + '[5;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[5~';\n }\n break;\n case 34:\n // page down\n if (ev.shiftKey) {\n result.type = KeyboardResultType.PAGE_DOWN;\n } else if (ev.ctrlKey) {\n result.key = C0.ESC + '[6;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[6~';\n }\n break;\n case 112:\n // F1-F12\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'P';\n } else {\n result.key = C0.ESC + 'OP';\n }\n break;\n case 113:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'Q';\n } else {\n result.key = C0.ESC + 'OQ';\n }\n break;\n case 114:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'R';\n } else {\n result.key = C0.ESC + 'OR';\n }\n break;\n case 115:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'S';\n } else {\n result.key = C0.ESC + 'OS';\n }\n break;\n case 116:\n if (modifiers) {\n result.key = C0.ESC + '[15;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[15~';\n }\n break;\n case 117:\n if (modifiers) {\n result.key = C0.ESC + '[17;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[17~';\n }\n break;\n case 118:\n if (modifiers) {\n result.key = C0.ESC + '[18;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[18~';\n }\n break;\n case 119:\n if (modifiers) {\n result.key = C0.ESC + '[19;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[19~';\n }\n break;\n case 120:\n if (modifiers) {\n result.key = C0.ESC + '[20;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[20~';\n }\n break;\n case 121:\n if (modifiers) {\n result.key = C0.ESC + '[21;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[21~';\n }\n break;\n case 122:\n if (modifiers) {\n result.key = C0.ESC + '[23;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[23~';\n }\n break;\n case 123:\n if (modifiers) {\n result.key = C0.ESC + '[24;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[24~';\n }\n break;\n default:\n // a-z and space\n if (ev.ctrlKey && !ev.shiftKey && !ev.altKey && !ev.metaKey) {\n if (ev.keyCode >= 65 && ev.keyCode <= 90) {\n result.key = String.fromCharCode(ev.keyCode - 64);\n } else if (ev.keyCode === 32) {\n result.key = C0.NUL;\n } else if (ev.keyCode >= 51 && ev.keyCode <= 55) {\n // escape, file sep, group sep, record sep, unit sep\n result.key = String.fromCharCode(ev.keyCode - 51 + 27);\n } else if (ev.keyCode === 56) {\n result.key = C0.DEL;\n } else if (ev.keyCode === 219) {\n result.key = C0.ESC;\n } else if (ev.keyCode === 220) {\n result.key = C0.FS;\n } else if (ev.keyCode === 221) {\n result.key = C0.GS;\n }\n } else if ((!isMac || macOptionIsMeta) && ev.altKey && !ev.metaKey) {\n // On macOS this is a third level shift when !macOptionIsMeta. Use instead.\n const keyMapping = KEYCODE_KEY_MAPPINGS[ev.keyCode];\n const key = keyMapping?.[!ev.shiftKey ? 0 : 1];\n if (key) {\n result.key = C0.ESC + key;\n } else if (ev.keyCode >= 65 && ev.keyCode <= 90) {\n const keyCode = ev.ctrlKey ? ev.keyCode - 64 : ev.keyCode + 32;\n let keyString = String.fromCharCode(keyCode);\n if (ev.shiftKey) {\n keyString = keyString.toUpperCase();\n }\n result.key = C0.ESC + keyString;\n } else if (ev.key === 'Dead' && ev.code.startsWith('Key')) {\n // Reference: https://github.com/xtermjs/xterm.js/issues/3725\n // Alt will produce a \"dead key\" (initate composition) with some\n // of the letters in US layout (e.g. N/E/U).\n // It's safe to match against Key* since no other `code` values begin with \"Key\".\n // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values#code_values_on_mac\n let keyString = ev.code.slice(3, 4);\n if (!ev.shiftKey) {\n keyString = keyString.toLowerCase();\n }\n result.key = C0.ESC + keyString;\n result.cancel = true;\n }\n } else if (isMac && !ev.altKey && !ev.ctrlKey && !ev.shiftKey && ev.metaKey) {\n if (ev.keyCode === 65) { // cmd + a\n result.type = KeyboardResultType.SELECT_ALL;\n }\n } else if (ev.key && !ev.ctrlKey && !ev.altKey && !ev.metaKey && ev.keyCode >= 48 && ev.key.length === 1) {\n // Include only keys that that result in a _single_ character; don't include num lock, volume up, etc.\n result.key = ev.key;\n } else if (ev.key && ev.ctrlKey) {\n if (ev.key === '_') { // ^_\n result.key = C0.US;\n }\n if (ev.key === '@') { // ^ + shift + 2 = ^ + @\n result.key = C0.NUL;\n }\n }\n break;\n }\n\n return result;\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * Polyfill - Convert UTF32 codepoint into JS string.\n * Note: The built-in String.fromCodePoint happens to be much slower\n * due to additional sanity checks. We can avoid them since\n * we always operate on legal UTF32 (granted by the input decoders)\n * and use this faster version instead.\n */\nexport function stringFromCodePoint(codePoint: number): string {\n if (codePoint > 0xFFFF) {\n codePoint -= 0x10000;\n return String.fromCharCode((codePoint >> 10) + 0xD800) + String.fromCharCode((codePoint % 0x400) + 0xDC00);\n }\n return String.fromCharCode(codePoint);\n}\n\n/**\n * Convert UTF32 char codes into JS string.\n * Basically the same as `stringFromCodePoint` but for multiple codepoints\n * in a loop (which is a lot faster).\n */\nexport function utf32ToString(data: Uint32Array, start: number = 0, end: number = data.length): string {\n let result = '';\n for (let i = start; i < end; ++i) {\n let codepoint = data[i];\n if (codepoint > 0xFFFF) {\n // JS strings are encoded as UTF16, thus a non BMP codepoint gets converted into a surrogate pair\n // conversion rules:\n // - subtract 0x10000 from code point, leaving a 20 bit number\n // - add high 10 bits to 0xD800 --> first surrogate\n // - add low 10 bits to 0xDC00 --> second surrogate\n codepoint -= 0x10000;\n result += String.fromCharCode((codepoint >> 10) + 0xD800) + String.fromCharCode((codepoint % 0x400) + 0xDC00);\n } else {\n result += String.fromCharCode(codepoint);\n }\n }\n return result;\n}\n\n/**\n * StringToUtf32 - decodes UTF16 sequences into UTF32 codepoints.\n * To keep the decoder in line with JS strings it handles single surrogates as UCS2.\n */\nexport class StringToUtf32 {\n private _interim: number = 0;\n\n /**\n * Clears interim and resets decoder to clean state.\n */\n public clear(): void {\n this._interim = 0;\n }\n\n /**\n * Decode JS string to UTF32 codepoints.\n * The methods assumes stream input and will store partly transmitted\n * surrogate pairs and decode them with the next data chunk.\n * Note: The method does no bound checks for target, therefore make sure\n * the provided input data does not exceed the size of `target`.\n * Returns the number of written codepoints in `target`.\n */\n public decode(input: string, target: Uint32Array): number {\n const length = input.length;\n\n if (!length) {\n return 0;\n }\n\n let size = 0;\n let startPos = 0;\n\n // handle leftover surrogate high\n if (this._interim) {\n const second = input.charCodeAt(startPos++);\n if (0xDC00 <= second && second <= 0xDFFF) {\n target[size++] = (this._interim - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n // illegal codepoint (USC2 handling)\n target[size++] = this._interim;\n target[size++] = second;\n }\n this._interim = 0;\n }\n\n for (let i = startPos; i < length; ++i) {\n const code = input.charCodeAt(i);\n // surrogate pair first\n if (0xD800 <= code && code <= 0xDBFF) {\n if (++i >= length) {\n this._interim = code;\n return size;\n }\n const second = input.charCodeAt(i);\n if (0xDC00 <= second && second <= 0xDFFF) {\n target[size++] = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n // illegal codepoint (USC2 handling)\n target[size++] = code;\n target[size++] = second;\n }\n continue;\n }\n if (code === 0xFEFF) {\n // BOM\n continue;\n }\n target[size++] = code;\n }\n return size;\n }\n}\n\n/**\n * Utf8Decoder - decodes UTF8 byte sequences into UTF32 codepoints.\n */\nexport class Utf8ToUtf32 {\n public interim: Uint8Array = new Uint8Array(3);\n\n /**\n * Clears interim bytes and resets decoder to clean state.\n */\n public clear(): void {\n this.interim.fill(0);\n }\n\n /**\n * Decodes UTF8 byte sequences in `input` to UTF32 codepoints in `target`.\n * The methods assumes stream input and will store partly transmitted bytes\n * and decode them with the next data chunk.\n * Note: The method does no bound checks for target, therefore make sure\n * the provided data chunk does not exceed the size of `target`.\n * Returns the number of written codepoints in `target`.\n */\n public decode(input: Uint8Array, target: Uint32Array): number {\n const length = input.length;\n\n if (!length) {\n return 0;\n }\n\n let size = 0;\n let byte1: number;\n let byte2: number;\n let byte3: number;\n let byte4: number;\n let codepoint = 0;\n let startPos = 0;\n\n // handle leftover bytes\n if (this.interim[0]) {\n let discardInterim = false;\n let cp = this.interim[0];\n cp &= ((((cp & 0xE0) === 0xC0)) ? 0x1F : (((cp & 0xF0) === 0xE0)) ? 0x0F : 0x07);\n let pos = 0;\n let tmp: number;\n while ((tmp = this.interim[++pos] & 0x3F) && pos < 4) {\n cp <<= 6;\n cp |= tmp;\n }\n // missing bytes - read ahead from input\n const type = (((this.interim[0] & 0xE0) === 0xC0)) ? 2 : (((this.interim[0] & 0xF0) === 0xE0)) ? 3 : 4;\n const missing = type - pos;\n while (startPos < missing) {\n if (startPos >= length) {\n return 0;\n }\n tmp = input[startPos++];\n if ((tmp & 0xC0) !== 0x80) {\n // wrong continuation, discard interim bytes completely\n startPos--;\n discardInterim = true;\n break;\n } else {\n // need to save so we can continue short inputs in next call\n this.interim[pos++] = tmp;\n cp <<= 6;\n cp |= tmp & 0x3F;\n }\n }\n if (!discardInterim) {\n // final test is type dependent\n if (type === 2) {\n if (cp < 0x80) {\n // wrong starter byte\n startPos--;\n } else {\n target[size++] = cp;\n }\n } else if (type === 3) {\n if (cp < 0x0800 || (cp >= 0xD800 && cp <= 0xDFFF) || cp === 0xFEFF) {\n // illegal codepoint or BOM\n } else {\n target[size++] = cp;\n }\n } else {\n if (cp < 0x010000 || cp > 0x10FFFF) {\n // illegal codepoint\n } else {\n target[size++] = cp;\n }\n }\n }\n this.interim.fill(0);\n }\n\n // loop through input\n const fourStop = length - 4;\n let i = startPos;\n while (i < length) {\n /**\n * ASCII shortcut with loop unrolled to 4 consecutive ASCII chars.\n * This is a compromise between speed gain for ASCII\n * and penalty for non ASCII:\n * For best ASCII performance the char should be stored directly into target,\n * but even a single attempt to write to target and compare afterwards\n * penalizes non ASCII really bad (-50%), thus we load the char into byteX first,\n * which reduces ASCII performance by ~15%.\n * This trial for ASCII reduces non ASCII performance by ~10% which seems acceptible\n * compared to the gains.\n * Note that this optimization only takes place for 4 consecutive ASCII chars,\n * for any shorter it bails out. Worst case - all 4 bytes being read but\n * thrown away due to the last being a non ASCII char (-10% performance).\n */\n while (i < fourStop\n && !((byte1 = input[i]) & 0x80)\n && !((byte2 = input[i + 1]) & 0x80)\n && !((byte3 = input[i + 2]) & 0x80)\n && !((byte4 = input[i + 3]) & 0x80))\n {\n target[size++] = byte1;\n target[size++] = byte2;\n target[size++] = byte3;\n target[size++] = byte4;\n i += 4;\n }\n\n // reread byte1\n byte1 = input[i++];\n\n // 1 byte\n if (byte1 < 0x80) {\n target[size++] = byte1;\n\n // 2 bytes\n } else if ((byte1 & 0xE0) === 0xC0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x1F) << 6 | (byte2 & 0x3F);\n if (codepoint < 0x80) {\n // wrong starter byte\n i--;\n continue;\n }\n target[size++] = codepoint;\n\n // 3 bytes\n } else if ((byte1 & 0xF0) === 0xE0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n return size;\n }\n byte3 = input[i++];\n if ((byte3 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x0F) << 12 | (byte2 & 0x3F) << 6 | (byte3 & 0x3F);\n if (codepoint < 0x0800 || (codepoint >= 0xD800 && codepoint <= 0xDFFF) || codepoint === 0xFEFF) {\n // illegal codepoint or BOM, no i-- here\n continue;\n }\n target[size++] = codepoint;\n\n // 4 bytes\n } else if ((byte1 & 0xF8) === 0xF0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n return size;\n }\n byte3 = input[i++];\n if ((byte3 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n this.interim[2] = byte3;\n return size;\n }\n byte4 = input[i++];\n if ((byte4 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x07) << 18 | (byte2 & 0x3F) << 12 | (byte3 & 0x3F) << 6 | (byte4 & 0x3F);\n if (codepoint < 0x010000 || codepoint > 0x10FFFF) {\n // illegal codepoint, no i-- here\n continue;\n }\n target[size++] = codepoint;\n } else {\n // illegal byte, just skip\n }\n }\n return size;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IUnicodeVersionProvider } from 'common/services/Services';\nimport { fill } from 'common/TypedArrayUtils';\n\ntype CharWidth = 0 | 1 | 2;\n\nconst BMP_COMBINING = [\n [0x0300, 0x036F], [0x0483, 0x0486], [0x0488, 0x0489],\n [0x0591, 0x05BD], [0x05BF, 0x05BF], [0x05C1, 0x05C2],\n [0x05C4, 0x05C5], [0x05C7, 0x05C7], [0x0600, 0x0603],\n [0x0610, 0x0615], [0x064B, 0x065E], [0x0670, 0x0670],\n [0x06D6, 0x06E4], [0x06E7, 0x06E8], [0x06EA, 0x06ED],\n [0x070F, 0x070F], [0x0711, 0x0711], [0x0730, 0x074A],\n [0x07A6, 0x07B0], [0x07EB, 0x07F3], [0x0901, 0x0902],\n [0x093C, 0x093C], [0x0941, 0x0948], [0x094D, 0x094D],\n [0x0951, 0x0954], [0x0962, 0x0963], [0x0981, 0x0981],\n [0x09BC, 0x09BC], [0x09C1, 0x09C4], [0x09CD, 0x09CD],\n [0x09E2, 0x09E3], [0x0A01, 0x0A02], [0x0A3C, 0x0A3C],\n [0x0A41, 0x0A42], [0x0A47, 0x0A48], [0x0A4B, 0x0A4D],\n [0x0A70, 0x0A71], [0x0A81, 0x0A82], [0x0ABC, 0x0ABC],\n [0x0AC1, 0x0AC5], [0x0AC7, 0x0AC8], [0x0ACD, 0x0ACD],\n [0x0AE2, 0x0AE3], [0x0B01, 0x0B01], [0x0B3C, 0x0B3C],\n [0x0B3F, 0x0B3F], [0x0B41, 0x0B43], [0x0B4D, 0x0B4D],\n [0x0B56, 0x0B56], [0x0B82, 0x0B82], [0x0BC0, 0x0BC0],\n [0x0BCD, 0x0BCD], [0x0C3E, 0x0C40], [0x0C46, 0x0C48],\n [0x0C4A, 0x0C4D], [0x0C55, 0x0C56], [0x0CBC, 0x0CBC],\n [0x0CBF, 0x0CBF], [0x0CC6, 0x0CC6], [0x0CCC, 0x0CCD],\n [0x0CE2, 0x0CE3], [0x0D41, 0x0D43], [0x0D4D, 0x0D4D],\n [0x0DCA, 0x0DCA], [0x0DD2, 0x0DD4], [0x0DD6, 0x0DD6],\n [0x0E31, 0x0E31], [0x0E34, 0x0E3A], [0x0E47, 0x0E4E],\n [0x0EB1, 0x0EB1], [0x0EB4, 0x0EB9], [0x0EBB, 0x0EBC],\n [0x0EC8, 0x0ECD], [0x0F18, 0x0F19], [0x0F35, 0x0F35],\n [0x0F37, 0x0F37], [0x0F39, 0x0F39], [0x0F71, 0x0F7E],\n [0x0F80, 0x0F84], [0x0F86, 0x0F87], [0x0F90, 0x0F97],\n [0x0F99, 0x0FBC], [0x0FC6, 0x0FC6], [0x102D, 0x1030],\n [0x1032, 0x1032], [0x1036, 0x1037], [0x1039, 0x1039],\n [0x1058, 0x1059], [0x1160, 0x11FF], [0x135F, 0x135F],\n [0x1712, 0x1714], [0x1732, 0x1734], [0x1752, 0x1753],\n [0x1772, 0x1773], [0x17B4, 0x17B5], [0x17B7, 0x17BD],\n [0x17C6, 0x17C6], [0x17C9, 0x17D3], [0x17DD, 0x17DD],\n [0x180B, 0x180D], [0x18A9, 0x18A9], [0x1920, 0x1922],\n [0x1927, 0x1928], [0x1932, 0x1932], [0x1939, 0x193B],\n [0x1A17, 0x1A18], [0x1B00, 0x1B03], [0x1B34, 0x1B34],\n [0x1B36, 0x1B3A], [0x1B3C, 0x1B3C], [0x1B42, 0x1B42],\n [0x1B6B, 0x1B73], [0x1DC0, 0x1DCA], [0x1DFE, 0x1DFF],\n [0x200B, 0x200F], [0x202A, 0x202E], [0x2060, 0x2063],\n [0x206A, 0x206F], [0x20D0, 0x20EF], [0x302A, 0x302F],\n [0x3099, 0x309A], [0xA806, 0xA806], [0xA80B, 0xA80B],\n [0xA825, 0xA826], [0xFB1E, 0xFB1E], [0xFE00, 0xFE0F],\n [0xFE20, 0xFE23], [0xFEFF, 0xFEFF], [0xFFF9, 0xFFFB]\n];\nconst HIGH_COMBINING = [\n [0x10A01, 0x10A03], [0x10A05, 0x10A06], [0x10A0C, 0x10A0F],\n [0x10A38, 0x10A3A], [0x10A3F, 0x10A3F], [0x1D167, 0x1D169],\n [0x1D173, 0x1D182], [0x1D185, 0x1D18B], [0x1D1AA, 0x1D1AD],\n [0x1D242, 0x1D244], [0xE0001, 0xE0001], [0xE0020, 0xE007F],\n [0xE0100, 0xE01EF]\n];\n\n// BMP lookup table, lazy initialized during first addon loading\nlet table: Uint8Array;\n\nfunction bisearch(ucs: number, data: number[][]): boolean {\n let min = 0;\n let max = data.length - 1;\n let mid;\n if (ucs < data[0][0] || ucs > data[max][1]) {\n return false;\n }\n while (max >= min) {\n mid = (min + max) >> 1;\n if (ucs > data[mid][1]) {\n min = mid + 1;\n } else if (ucs < data[mid][0]) {\n max = mid - 1;\n } else {\n return true;\n }\n }\n return false;\n}\n\nexport class UnicodeV6 implements IUnicodeVersionProvider {\n public readonly version = '6';\n\n constructor() {\n // init lookup table once\n if (!table) {\n table = new Uint8Array(65536);\n fill(table, 1);\n table[0] = 0;\n // control chars\n fill(table, 0, 1, 32);\n fill(table, 0, 0x7f, 0xa0);\n\n // apply wide char rules first\n // wide chars\n fill(table, 2, 0x1100, 0x1160);\n table[0x2329] = 2;\n table[0x232a] = 2;\n fill(table, 2, 0x2e80, 0xa4d0);\n table[0x303f] = 1; // wrongly in last line\n\n fill(table, 2, 0xac00, 0xd7a4);\n fill(table, 2, 0xf900, 0xfb00);\n fill(table, 2, 0xfe10, 0xfe1a);\n fill(table, 2, 0xfe30, 0xfe70);\n fill(table, 2, 0xff00, 0xff61);\n fill(table, 2, 0xffe0, 0xffe7);\n\n // apply combining last to ensure we overwrite\n // wrongly wide set chars:\n // the original algo evals combining first and falls\n // through to wide check so we simply do here the opposite\n // combining 0\n for (let r = 0; r < BMP_COMBINING.length; ++r) {\n fill(table, 0, BMP_COMBINING[r][0], BMP_COMBINING[r][1] + 1);\n }\n }\n }\n\n public wcwidth(num: number): CharWidth {\n if (num < 32) return 0;\n if (num < 127) return 1;\n if (num < 65536) return table[num] as CharWidth;\n if (bisearch(num, HIGH_COMBINING)) return 0;\n if ((num >= 0x20000 && num <= 0x2fffd) || (num >= 0x30000 && num <= 0x3fffd)) return 2;\n return 1;\n }\n}\n", "\n/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\n\ndeclare const setTimeout: (handler: () => void, timeout?: number) => void;\n\n/**\n * Safety watermark to avoid memory exhaustion and browser engine crash on fast data input.\n * Enable flow control to avoid this limit and make sure that your backend correctly\n * propagates this to the underlying pty. (see docs for further instructions)\n * Since this limit is meant as a safety parachute to prevent browser crashs,\n * it is set to a very high number. Typically xterm.js gets unresponsive with\n * a 100 times lower number (>500 kB).\n */\nconst DISCARD_WATERMARK = 50000000; // ~50 MB\n\n/**\n * The max number of ms to spend on writes before allowing the renderer to\n * catch up with a 0ms setTimeout. A value of < 33 to keep us close to\n * 30fps, and a value of < 16 to try to run at 60fps. Of course, the real FPS\n * depends on the time it takes for the renderer to draw the frame.\n */\nconst WRITE_TIMEOUT_MS = 12;\n\n/**\n * Threshold of max held chunks in the write buffer, that were already processed.\n * This is a tradeoff between extensive write buffer shifts (bad runtime) and high\n * memory consumption by data thats not used anymore.\n */\nconst WRITE_BUFFER_LENGTH_THRESHOLD = 50;\n\n// queueMicrotask polyfill for nodejs < v11\nconst qmt: (cb: () => void) => void = (typeof queueMicrotask === 'undefined')\n ? (cb: () => void) => { Promise.resolve().then(cb); }\n : queueMicrotask;\n\n\nexport class WriteBuffer {\n private _writeBuffer: (string | Uint8Array)[] = [];\n private _callbacks: ((() => void) | undefined)[] = [];\n private _pendingData = 0;\n private _bufferOffset = 0;\n private _isSyncWriting = false;\n private _syncCalls = 0;\n public get onWriteParsed(): IEvent { return this._onWriteParsed.event; }\n private _onWriteParsed = new EventEmitter();\n\n constructor(private _action: (data: string | Uint8Array, promiseResult?: boolean) => void | Promise) { }\n\n /**\n * @deprecated Unreliable, to be removed soon.\n */\n public writeSync(data: string | Uint8Array, maxSubsequentCalls?: number): void {\n // stop writeSync recursions with maxSubsequentCalls argument\n // This is dangerous to use as it will lose the current data chunk\n // and return immediately.\n if (maxSubsequentCalls !== undefined && this._syncCalls > maxSubsequentCalls) {\n // comment next line if a whole loop block should only contain x `writeSync` calls\n // (total flat vs. deep nested limit)\n this._syncCalls = 0;\n return;\n }\n // append chunk to buffer\n this._pendingData += data.length;\n this._writeBuffer.push(data);\n this._callbacks.push(undefined);\n\n // increase recursion counter\n this._syncCalls++;\n // exit early if another writeSync loop is active\n if (this._isSyncWriting) {\n return;\n }\n this._isSyncWriting = true;\n\n // force sync processing on pending data chunks to avoid in-band data scrambling\n // does the same as innerWrite but without event loop\n // we have to do it here as single loop steps to not corrupt loop subject\n // by another writeSync call triggered from _action\n let chunk: string | Uint8Array | undefined;\n while (chunk = this._writeBuffer.shift()) {\n this._action(chunk);\n const cb = this._callbacks.shift();\n if (cb) cb();\n }\n // reset to avoid reprocessing of chunks with scheduled innerWrite call\n // stopping scheduled innerWrite by offset > length condition\n this._pendingData = 0;\n this._bufferOffset = 0x7FFFFFFF;\n\n // allow another writeSync to loop\n this._isSyncWriting = false;\n this._syncCalls = 0;\n }\n\n public write(data: string | Uint8Array, callback?: () => void): void {\n if (this._pendingData > DISCARD_WATERMARK) {\n throw new Error('write data discarded, use flow control to avoid losing data');\n }\n\n // schedule chunk processing for next event loop run\n if (!this._writeBuffer.length) {\n this._bufferOffset = 0;\n setTimeout(() => this._innerWrite());\n }\n\n this._pendingData += data.length;\n this._writeBuffer.push(data);\n this._callbacks.push(callback);\n }\n\n /**\n * Inner write call, that enters the sliced chunk processing by timing.\n *\n * `lastTime` indicates, when the last _innerWrite call had started.\n * It is used to aggregate async handler execution under a timeout constraint\n * effectively lowering the redrawing needs, schematically:\n *\n * macroTask _innerWrite:\n * if (Date.now() - (lastTime | 0) < WRITE_TIMEOUT_MS):\n * schedule microTask _innerWrite(lastTime)\n * else:\n * schedule macroTask _innerWrite(0)\n *\n * overall execution order on task queues:\n *\n * macrotasks: [...] --> _innerWrite(0) --> [...] --> screenUpdate --> [...]\n * m t: |\n * i a: [...]\n * c s: |\n * r k: while < timeout:\n * o s: _innerWrite(timeout)\n *\n * `promiseResult` depicts the promise resolve value of an async handler.\n * This value gets carried forward through all saved stack states of the\n * paused parser for proper continuation.\n *\n * Note, for pure sync code `lastTime` and `promiseResult` have no meaning.\n */\n protected _innerWrite(lastTime: number = 0, promiseResult: boolean = true): void {\n const startTime = lastTime || Date.now();\n while (this._writeBuffer.length > this._bufferOffset) {\n const data = this._writeBuffer[this._bufferOffset];\n const result = this._action(data, promiseResult);\n if (result) {\n /**\n * If we get a promise as return value, we re-schedule the continuation\n * as thenable on the promise and exit right away.\n *\n * The exit here means, that we block input processing at the current active chunk,\n * the exact execution position within the chunk is preserved by the saved\n * stack content in InputHandler and EscapeSequenceParser.\n *\n * Resuming happens automatically from that saved stack state.\n * Also the resolved promise value is passed along the callstack to\n * `EscapeSequenceParser.parse` to correctly resume the stopped handler loop.\n *\n * Exceptions on async handlers will be logged to console async, but do not interrupt\n * the input processing (continues with next handler at the current input position).\n */\n\n /**\n * If a promise takes long to resolve, we should schedule continuation behind setTimeout.\n * This might already be too late, if our .then enters really late (executor + prev thens took very long).\n * This cannot be solved here for the handler itself (it is the handlers responsibility to slice hard work),\n * but we can at least schedule a screen update as we gain control.\n */\n const continuation: (r: boolean) => void = (r: boolean) => Date.now() - startTime >= WRITE_TIMEOUT_MS\n ? setTimeout(() => this._innerWrite(0, r))\n : this._innerWrite(startTime, r);\n\n /**\n * Optimization considerations:\n * The continuation above favors FPS over throughput by eval'ing `startTime` on resolve.\n * This might schedule too many screen updates with bad throughput drops (in case a slow\n * resolving handler sliced its work properly behind setTimeout calls). We cannot spot\n * this condition here, also the renderer has no way to spot nonsense updates either.\n * FIXME: A proper fix for this would track the FPS at the renderer entry level separately.\n *\n * If favoring of FPS shows bad throughtput impact, use the following instead. It favors\n * throughput by eval'ing `startTime` upfront pulling at least one more chunk into the\n * current microtask queue (executed before setTimeout).\n */\n // const continuation: (r: boolean) => void = Date.now() - startTime >= WRITE_TIMEOUT_MS\n // ? r => setTimeout(() => this._innerWrite(0, r))\n // : r => this._innerWrite(startTime, r);\n\n // Handle exceptions synchronously to current band position, idea:\n // 1. spawn a single microtask which we allow to throw hard\n // 2. spawn a promise immediately resolving to `true`\n // (executed on the same queue, thus properly aligned before continuation happens)\n result.catch(err => {\n qmt(() => {throw err;});\n return Promise.resolve(false);\n }).then(continuation);\n return;\n }\n\n const cb = this._callbacks[this._bufferOffset];\n if (cb) cb();\n this._bufferOffset++;\n this._pendingData -= data.length;\n\n if (Date.now() - startTime >= WRITE_TIMEOUT_MS) {\n break;\n }\n }\n if (this._writeBuffer.length > this._bufferOffset) {\n // Allow renderer to catch up before processing the next batch\n // trim already processed chunks if we are above threshold\n if (this._bufferOffset > WRITE_BUFFER_LENGTH_THRESHOLD) {\n this._writeBuffer = this._writeBuffer.slice(this._bufferOffset);\n this._callbacks = this._callbacks.slice(this._bufferOffset);\n this._bufferOffset = 0;\n }\n setTimeout(() => this._innerWrite());\n } else {\n this._writeBuffer.length = 0;\n this._callbacks.length = 0;\n this._pendingData = 0;\n this._bufferOffset = 0;\n }\n this._onWriteParsed.fire();\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\n// 'rgb:' rule - matching: r/g/b | rr/gg/bb | rrr/ggg/bbb | rrrr/gggg/bbbb (hex digits)\nconst RGB_REX = /^([\\da-f])\\/([\\da-f])\\/([\\da-f])$|^([\\da-f]{2})\\/([\\da-f]{2})\\/([\\da-f]{2})$|^([\\da-f]{3})\\/([\\da-f]{3})\\/([\\da-f]{3})$|^([\\da-f]{4})\\/([\\da-f]{4})\\/([\\da-f]{4})$/;\n// '#...' rule - matching any hex digits\nconst HASH_REX = /^[\\da-f]+$/;\n\n/**\n * Parse color spec to RGB values (8 bit per channel).\n * See `man xparsecolor` for details about certain format specifications.\n *\n * Supported formats:\n * - rgb:// with , , in h | hh | hhh | hhhh\n * - #RGB, #RRGGBB, #RRRGGGBBB, #RRRRGGGGBBBB\n *\n * All other formats like rgbi: or device-independent string specifications\n * with float numbering are not supported.\n */\nexport function parseColor(data: string): [number, number, number] | undefined {\n if (!data) return;\n // also handle uppercases\n let low = data.toLowerCase();\n if (low.indexOf('rgb:') === 0) {\n // 'rgb:' specifier\n low = low.slice(4);\n const m = RGB_REX.exec(low);\n if (m) {\n const base = m[1] ? 15 : m[4] ? 255 : m[7] ? 4095 : 65535;\n return [\n Math.round(parseInt(m[1] || m[4] || m[7] || m[10], 16) / base * 255),\n Math.round(parseInt(m[2] || m[5] || m[8] || m[11], 16) / base * 255),\n Math.round(parseInt(m[3] || m[6] || m[9] || m[12], 16) / base * 255)\n ];\n }\n } else if (low.indexOf('#') === 0) {\n // '#' specifier\n low = low.slice(1);\n if (HASH_REX.exec(low) && [3, 6, 9, 12].includes(low.length)) {\n const adv = low.length / 3;\n const result: [number, number, number] = [0, 0, 0];\n for (let i = 0; i < 3; ++i) {\n const c = parseInt(low.slice(adv * i, adv * i + adv), 16);\n result[i] = adv === 1 ? c << 4 : adv === 2 ? c : adv === 3 ? c >> 4 : c >> 8;\n }\n return result;\n }\n }\n\n // Named colors are currently not supported due to the large addition to the xterm.js bundle size\n // they would add. In order to support named colors, we would need some way of optionally loading\n // additional payloads so startup/download time is not bloated (see #3530).\n}\n\n// pad hex output to requested bit width\nfunction pad(n: number, bits: number): string {\n const s = n.toString(16);\n const s2 = s.length < 2 ? '0' + s : s;\n switch (bits) {\n case 4:\n return s[0];\n case 8:\n return s2;\n case 12:\n return (s2 + s2).slice(0, 3);\n default:\n return s2 + s2;\n }\n}\n\n/**\n * Convert a given color to rgb:../../.. string of `bits` depth.\n */\nexport function toRgbString(color: [number, number, number], bits: number = 16): string {\n const [r, g, b] = color;\n return `rgb:${pad(r, bits)}/${pad(g, bits)}/${pad(b, bits)}`;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * Internal states of EscapeSequenceParser.\n */\nexport const enum ParserState {\n GROUND = 0,\n ESCAPE = 1,\n ESCAPE_INTERMEDIATE = 2,\n CSI_ENTRY = 3,\n CSI_PARAM = 4,\n CSI_INTERMEDIATE = 5,\n CSI_IGNORE = 6,\n SOS_PM_APC_STRING = 7,\n OSC_STRING = 8,\n DCS_ENTRY = 9,\n DCS_PARAM = 10,\n DCS_IGNORE = 11,\n DCS_INTERMEDIATE = 12,\n DCS_PASSTHROUGH = 13\n}\n\n/**\n* Internal actions of EscapeSequenceParser.\n*/\nexport const enum ParserAction {\n IGNORE = 0,\n ERROR = 1,\n PRINT = 2,\n EXECUTE = 3,\n OSC_START = 4,\n OSC_PUT = 5,\n OSC_END = 6,\n CSI_DISPATCH = 7,\n PARAM = 8,\n COLLECT = 9,\n ESC_DISPATCH = 10,\n CLEAR = 11,\n DCS_HOOK = 12,\n DCS_PUT = 13,\n DCS_UNHOOK = 14\n}\n\n/**\n * Internal states of OscParser.\n */\nexport const enum OscState {\n START = 0,\n ID = 1,\n PAYLOAD = 2,\n ABORT = 3\n}\n\n// payload limit for OSC and DCS\nexport const PAYLOAD_LIMIT = 10000000;\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\nimport { IDcsHandler, IParams, IHandlerCollection, IDcsParser, DcsFallbackHandlerType, ISubParserStackState } from 'common/parser/Types';\nimport { utf32ToString } from 'common/input/TextDecoder';\nimport { Params } from 'common/parser/Params';\nimport { PAYLOAD_LIMIT } from 'common/parser/Constants';\n\nconst EMPTY_HANDLERS: IDcsHandler[] = [];\n\nexport class DcsParser implements IDcsParser {\n private _handlers: IHandlerCollection = Object.create(null);\n private _active: IDcsHandler[] = EMPTY_HANDLERS;\n private _ident: number = 0;\n private _handlerFb: DcsFallbackHandlerType = () => { };\n private _stack: ISubParserStackState = {\n paused: false,\n loopPosition: 0,\n fallThrough: false\n };\n\n public dispose(): void {\n this._handlers = Object.create(null);\n this._handlerFb = () => { };\n this._active = EMPTY_HANDLERS;\n }\n\n public registerHandler(ident: number, handler: IDcsHandler): IDisposable {\n if (this._handlers[ident] === undefined) {\n this._handlers[ident] = [];\n }\n const handlerList = this._handlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n\n public clearHandler(ident: number): void {\n if (this._handlers[ident]) delete this._handlers[ident];\n }\n\n public setHandlerFallback(handler: DcsFallbackHandlerType): void {\n this._handlerFb = handler;\n }\n\n public reset(): void {\n // force cleanup leftover handlers\n if (this._active.length) {\n for (let j = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; j >= 0; --j) {\n this._active[j].unhook(false);\n }\n }\n this._stack.paused = false;\n this._active = EMPTY_HANDLERS;\n this._ident = 0;\n }\n\n public hook(ident: number, params: IParams): void {\n // always reset leftover handlers\n this.reset();\n this._ident = ident;\n this._active = this._handlers[ident] || EMPTY_HANDLERS;\n if (!this._active.length) {\n this._handlerFb(this._ident, 'HOOK', params);\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].hook(params);\n }\n }\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (!this._active.length) {\n this._handlerFb(this._ident, 'PUT', utf32ToString(data, start, end));\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].put(data, start, end);\n }\n }\n }\n\n public unhook(success: boolean, promiseResult: boolean = true): void | Promise {\n if (!this._active.length) {\n this._handlerFb(this._ident, 'UNHOOK', success);\n } else {\n let handlerResult: boolean | Promise = false;\n let j = this._active.length - 1;\n let fallThrough = false;\n if (this._stack.paused) {\n j = this._stack.loopPosition - 1;\n handlerResult = promiseResult;\n fallThrough = this._stack.fallThrough;\n this._stack.paused = false;\n }\n if (!fallThrough && handlerResult === false) {\n for (; j >= 0; j--) {\n handlerResult = this._active[j].unhook(success);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = false;\n return handlerResult;\n }\n }\n j--;\n }\n // cleanup left over handlers (fallThrough for async)\n for (; j >= 0; j--) {\n handlerResult = this._active[j].unhook(false);\n if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = true;\n return handlerResult;\n }\n }\n }\n this._active = EMPTY_HANDLERS;\n this._ident = 0;\n }\n}\n\n// predefine empty params as [0] (ZDM)\nconst EMPTY_PARAMS = new Params();\nEMPTY_PARAMS.addParam(0);\n\n/**\n * Convenient class to create a DCS handler from a single callback function.\n * Note: The payload is currently limited to 50 MB (hardcoded).\n */\nexport class DcsHandler implements IDcsHandler {\n private _data = '';\n private _params: IParams = EMPTY_PARAMS;\n private _hitLimit: boolean = false;\n\n constructor(private _handler: (data: string, params: IParams) => boolean | Promise) { }\n\n public hook(params: IParams): void {\n // since we need to preserve params until `unhook`, we have to clone it\n // (only borrowed from parser and spans multiple parser states)\n // perf optimization:\n // clone only, if we have non empty params, otherwise stick with default\n this._params = (params.length > 1 || params.params[0]) ? params.clone() : EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._hitLimit) {\n return;\n }\n this._data += utf32ToString(data, start, end);\n if (this._data.length > PAYLOAD_LIMIT) {\n this._data = '';\n this._hitLimit = true;\n }\n }\n\n public unhook(success: boolean): boolean | Promise {\n let ret: boolean | Promise = false;\n if (this._hitLimit) {\n ret = false;\n } else if (success) {\n ret = this._handler(this._data, this._params);\n if (ret instanceof Promise) {\n // need to hold data and params until `ret` got resolved\n // dont care for errors, data will be freed anyway on next start\n return ret.then(res => {\n this._params = EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n return res;\n });\n }\n }\n this._params = EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n return ret;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IParsingState, IDcsHandler, IEscapeSequenceParser, IParams, IOscHandler, IHandlerCollection, CsiHandlerType, OscFallbackHandlerType, IOscParser, EscHandlerType, IDcsParser, DcsFallbackHandlerType, IFunctionIdentifier, ExecuteFallbackHandlerType, CsiFallbackHandlerType, EscFallbackHandlerType, PrintHandlerType, PrintFallbackHandlerType, ExecuteHandlerType, IParserStackState, ParserStackType, ResumableHandlersType } from 'common/parser/Types';\nimport { ParserState, ParserAction } from 'common/parser/Constants';\nimport { Disposable } from 'common/Lifecycle';\nimport { IDisposable } from 'common/Types';\nimport { fill } from 'common/TypedArrayUtils';\nimport { Params } from 'common/parser/Params';\nimport { OscParser } from 'common/parser/OscParser';\nimport { DcsParser } from 'common/parser/DcsParser';\n\n/**\n * Table values are generated like this:\n * index: currentState << TableValue.INDEX_STATE_SHIFT | charCode\n * value: action << TableValue.TRANSITION_ACTION_SHIFT | nextState\n */\nconst enum TableAccess {\n TRANSITION_ACTION_SHIFT = 4,\n TRANSITION_STATE_MASK = 15,\n INDEX_STATE_SHIFT = 8\n}\n\n/**\n * Transition table for EscapeSequenceParser.\n */\nexport class TransitionTable {\n public table: Uint8Array;\n\n constructor(length: number) {\n this.table = new Uint8Array(length);\n }\n\n /**\n * Set default transition.\n * @param action default action\n * @param next default next state\n */\n public setDefault(action: ParserAction, next: ParserState): void {\n fill(this.table, action << TableAccess.TRANSITION_ACTION_SHIFT | next);\n }\n\n /**\n * Add a transition to the transition table.\n * @param code input character code\n * @param state current parser state\n * @param action parser action to be done\n * @param next next parser state\n */\n public add(code: number, state: ParserState, action: ParserAction, next: ParserState): void {\n this.table[state << TableAccess.INDEX_STATE_SHIFT | code] = action << TableAccess.TRANSITION_ACTION_SHIFT | next;\n }\n\n /**\n * Add transitions for multiple input character codes.\n * @param codes input character code array\n * @param state current parser state\n * @param action parser action to be done\n * @param next next parser state\n */\n public addMany(codes: number[], state: ParserState, action: ParserAction, next: ParserState): void {\n for (let i = 0; i < codes.length; i++) {\n this.table[state << TableAccess.INDEX_STATE_SHIFT | codes[i]] = action << TableAccess.TRANSITION_ACTION_SHIFT | next;\n }\n }\n}\n\n\n// Pseudo-character placeholder for printable non-ascii characters (unicode).\nconst NON_ASCII_PRINTABLE = 0xA0;\n\n\n/**\n * VT500 compatible transition table.\n * Taken from https://vt100.net/emu/dec_ansi_parser.\n */\nexport const VT500_TRANSITION_TABLE = (function (): TransitionTable {\n const table: TransitionTable = new TransitionTable(4095);\n\n // range macro for byte\n const BYTE_VALUES = 256;\n const blueprint = Array.apply(null, Array(BYTE_VALUES)).map((unused: any, i: number) => i);\n const r = (start: number, end: number): number[] => blueprint.slice(start, end);\n\n // Default definitions.\n const PRINTABLES = r(0x20, 0x7f); // 0x20 (SP) included, 0x7F (DEL) excluded\n const EXECUTABLES = r(0x00, 0x18);\n EXECUTABLES.push(0x19);\n EXECUTABLES.push.apply(EXECUTABLES, r(0x1c, 0x20));\n\n const states: number[] = r(ParserState.GROUND, ParserState.DCS_PASSTHROUGH + 1);\n let state: any;\n\n // set default transition\n table.setDefault(ParserAction.ERROR, ParserState.GROUND);\n // printables\n table.addMany(PRINTABLES, ParserState.GROUND, ParserAction.PRINT, ParserState.GROUND);\n // global anywhere rules\n for (state in states) {\n table.addMany([0x18, 0x1a, 0x99, 0x9a], state, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(r(0x80, 0x90), state, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(r(0x90, 0x98), state, ParserAction.EXECUTE, ParserState.GROUND);\n table.add(0x9c, state, ParserAction.IGNORE, ParserState.GROUND); // ST as terminator\n table.add(0x1b, state, ParserAction.CLEAR, ParserState.ESCAPE); // ESC\n table.add(0x9d, state, ParserAction.OSC_START, ParserState.OSC_STRING); // OSC\n table.addMany([0x98, 0x9e, 0x9f], state, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.add(0x9b, state, ParserAction.CLEAR, ParserState.CSI_ENTRY); // CSI\n table.add(0x90, state, ParserAction.CLEAR, ParserState.DCS_ENTRY); // DCS\n }\n // rules for executables and 7f\n table.addMany(EXECUTABLES, ParserState.GROUND, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(EXECUTABLES, ParserState.ESCAPE, ParserAction.EXECUTE, ParserState.ESCAPE);\n table.add(0x7f, ParserState.ESCAPE, ParserAction.IGNORE, ParserState.ESCAPE);\n table.addMany(EXECUTABLES, ParserState.OSC_STRING, ParserAction.IGNORE, ParserState.OSC_STRING);\n table.addMany(EXECUTABLES, ParserState.CSI_ENTRY, ParserAction.EXECUTE, ParserState.CSI_ENTRY);\n table.add(0x7f, ParserState.CSI_ENTRY, ParserAction.IGNORE, ParserState.CSI_ENTRY);\n table.addMany(EXECUTABLES, ParserState.CSI_PARAM, ParserAction.EXECUTE, ParserState.CSI_PARAM);\n table.add(0x7f, ParserState.CSI_PARAM, ParserAction.IGNORE, ParserState.CSI_PARAM);\n table.addMany(EXECUTABLES, ParserState.CSI_IGNORE, ParserAction.EXECUTE, ParserState.CSI_IGNORE);\n table.addMany(EXECUTABLES, ParserState.CSI_INTERMEDIATE, ParserAction.EXECUTE, ParserState.CSI_INTERMEDIATE);\n table.add(0x7f, ParserState.CSI_INTERMEDIATE, ParserAction.IGNORE, ParserState.CSI_INTERMEDIATE);\n table.addMany(EXECUTABLES, ParserState.ESCAPE_INTERMEDIATE, ParserAction.EXECUTE, ParserState.ESCAPE_INTERMEDIATE);\n table.add(0x7f, ParserState.ESCAPE_INTERMEDIATE, ParserAction.IGNORE, ParserState.ESCAPE_INTERMEDIATE);\n // osc\n table.add(0x5d, ParserState.ESCAPE, ParserAction.OSC_START, ParserState.OSC_STRING);\n table.addMany(PRINTABLES, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.add(0x7f, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.addMany([0x9c, 0x1b, 0x18, 0x1a, 0x07], ParserState.OSC_STRING, ParserAction.OSC_END, ParserState.GROUND);\n table.addMany(r(0x1c, 0x20), ParserState.OSC_STRING, ParserAction.IGNORE, ParserState.OSC_STRING);\n // sos/pm/apc does nothing\n table.addMany([0x58, 0x5e, 0x5f], ParserState.ESCAPE, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.addMany(PRINTABLES, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.addMany(EXECUTABLES, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.add(0x9c, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.GROUND);\n table.add(0x7f, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n // csi entries\n table.add(0x5b, ParserState.ESCAPE, ParserAction.CLEAR, ParserState.CSI_ENTRY);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_ENTRY, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x30, 0x3c), ParserState.CSI_ENTRY, ParserAction.PARAM, ParserState.CSI_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.CSI_ENTRY, ParserAction.COLLECT, ParserState.CSI_PARAM);\n table.addMany(r(0x30, 0x3c), ParserState.CSI_PARAM, ParserAction.PARAM, ParserState.CSI_PARAM);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_PARAM, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.CSI_PARAM, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x20, 0x40), ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.add(0x7f, ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.GROUND);\n table.addMany(r(0x20, 0x30), ParserState.CSI_ENTRY, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.CSI_INTERMEDIATE, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n table.addMany(r(0x30, 0x40), ParserState.CSI_INTERMEDIATE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_INTERMEDIATE, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x20, 0x30), ParserState.CSI_PARAM, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n // esc_intermediate\n table.addMany(r(0x20, 0x30), ParserState.ESCAPE, ParserAction.COLLECT, ParserState.ESCAPE_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.ESCAPE_INTERMEDIATE, ParserAction.COLLECT, ParserState.ESCAPE_INTERMEDIATE);\n table.addMany(r(0x30, 0x7f), ParserState.ESCAPE_INTERMEDIATE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x30, 0x50), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x51, 0x58), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany([0x59, 0x5a, 0x5c], ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x60, 0x7f), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n // dcs entry\n table.add(0x50, ParserState.ESCAPE, ParserAction.CLEAR, ParserState.DCS_ENTRY);\n table.addMany(EXECUTABLES, ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.add(0x7f, ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.addMany(r(0x20, 0x30), ParserState.DCS_ENTRY, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x30, 0x3c), ParserState.DCS_ENTRY, ParserAction.PARAM, ParserState.DCS_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.DCS_ENTRY, ParserAction.COLLECT, ParserState.DCS_PARAM);\n table.addMany(EXECUTABLES, ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x20, 0x80), ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(EXECUTABLES, ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.add(0x7f, ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.addMany(r(0x30, 0x3c), ParserState.DCS_PARAM, ParserAction.PARAM, ParserState.DCS_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x20, 0x30), ParserState.DCS_PARAM, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(EXECUTABLES, ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.add(0x7f, ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.DCS_INTERMEDIATE, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x30, 0x40), ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_INTERMEDIATE, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_PARAM, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_ENTRY, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(EXECUTABLES, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n table.addMany(PRINTABLES, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n table.add(0x7f, ParserState.DCS_PASSTHROUGH, ParserAction.IGNORE, ParserState.DCS_PASSTHROUGH);\n table.addMany([0x1b, 0x9c, 0x18, 0x1a], ParserState.DCS_PASSTHROUGH, ParserAction.DCS_UNHOOK, ParserState.GROUND);\n // special handling of unicode chars\n table.add(NON_ASCII_PRINTABLE, ParserState.GROUND, ParserAction.PRINT, ParserState.GROUND);\n table.add(NON_ASCII_PRINTABLE, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.add(NON_ASCII_PRINTABLE, ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.add(NON_ASCII_PRINTABLE, ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.add(NON_ASCII_PRINTABLE, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n return table;\n})();\n\n\n/**\n * EscapeSequenceParser.\n * This class implements the ANSI/DEC compatible parser described by\n * Paul Williams (https://vt100.net/emu/dec_ansi_parser).\n *\n * To implement custom ANSI compliant escape sequences it is not needed to\n * alter this parser, instead consider registering a custom handler.\n * For non ANSI compliant sequences change the transition table with\n * the optional `transitions` constructor argument and\n * reimplement the `parse` method.\n *\n * This parser is currently hardcoded to operate in ZDM (Zero Default Mode)\n * as suggested by the original parser, thus empty parameters are set to 0.\n * This this is not in line with the latest ECMA-48 specification\n * (ZDM was part of the early specs and got completely removed later on).\n *\n * Other than the original parser from vt100.net this parser supports\n * sub parameters in digital parameters separated by colons. Empty sub parameters\n * are set to -1 (no ZDM for sub parameters).\n *\n * About prefix and intermediate bytes:\n * This parser follows the assumptions of the vt100.net parser with these restrictions:\n * - only one prefix byte is allowed as first parameter byte, byte range 0x3c .. 0x3f\n * - max. two intermediates are respected, byte range 0x20 .. 0x2f\n * Note that this is not in line with ECMA-48 which does not limit either of those.\n * Furthermore ECMA-48 allows the prefix byte range at any param byte position. Currently\n * there are no known sequences that follow the broader definition of the specification.\n *\n * TODO: implement error recovery hook via error handler return values\n */\nexport class EscapeSequenceParser extends Disposable implements IEscapeSequenceParser {\n public initialState: number;\n public currentState: number;\n public precedingCodepoint: number;\n\n // buffers over several parse calls\n protected _params: Params;\n protected _collect: number;\n\n // handler lookup containers\n protected _printHandler: PrintHandlerType;\n protected _executeHandlers: { [flag: number]: ExecuteHandlerType };\n protected _csiHandlers: IHandlerCollection;\n protected _escHandlers: IHandlerCollection;\n protected _oscParser: IOscParser;\n protected _dcsParser: IDcsParser;\n protected _errorHandler: (state: IParsingState) => IParsingState;\n\n // fallback handlers\n protected _printHandlerFb: PrintFallbackHandlerType;\n protected _executeHandlerFb: ExecuteFallbackHandlerType;\n protected _csiHandlerFb: CsiFallbackHandlerType;\n protected _escHandlerFb: EscFallbackHandlerType;\n protected _errorHandlerFb: (state: IParsingState) => IParsingState;\n\n // parser stack save for async handler support\n protected _parseStack: IParserStackState = {\n state: ParserStackType.NONE,\n handlers: [],\n handlerPos: 0,\n transition: 0,\n chunkPos: 0\n };\n\n constructor(\n protected readonly _transitions: TransitionTable = VT500_TRANSITION_TABLE\n ) {\n super();\n\n this.initialState = ParserState.GROUND;\n this.currentState = this.initialState;\n this._params = new Params(); // defaults to 32 storable params/subparams\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n\n // set default fallback handlers and handler lookup containers\n this._printHandlerFb = (data, start, end): void => { };\n this._executeHandlerFb = (code: number): void => { };\n this._csiHandlerFb = (ident: number, params: IParams): void => { };\n this._escHandlerFb = (ident: number): void => { };\n this._errorHandlerFb = (state: IParsingState): IParsingState => state;\n this._printHandler = this._printHandlerFb;\n this._executeHandlers = Object.create(null);\n this._csiHandlers = Object.create(null);\n this._escHandlers = Object.create(null);\n this._oscParser = new OscParser();\n this._dcsParser = new DcsParser();\n this._errorHandler = this._errorHandlerFb;\n\n // swallow 7bit ST (ESC+\\)\n this.registerEscHandler({ final: '\\\\' }, () => true);\n }\n\n protected _identifier(id: IFunctionIdentifier, finalRange: number[] = [0x40, 0x7e]): number {\n let res = 0;\n if (id.prefix) {\n if (id.prefix.length > 1) {\n throw new Error('only one byte as prefix supported');\n }\n res = id.prefix.charCodeAt(0);\n if (res && 0x3c > res || res > 0x3f) {\n throw new Error('prefix must be in range 0x3c .. 0x3f');\n }\n }\n if (id.intermediates) {\n if (id.intermediates.length > 2) {\n throw new Error('only two bytes as intermediates are supported');\n }\n for (let i = 0; i < id.intermediates.length; ++i) {\n const intermediate = id.intermediates.charCodeAt(i);\n if (0x20 > intermediate || intermediate > 0x2f) {\n throw new Error('intermediate must be in range 0x20 .. 0x2f');\n }\n res <<= 8;\n res |= intermediate;\n }\n }\n if (id.final.length !== 1) {\n throw new Error('final must be a single byte');\n }\n const finalCode = id.final.charCodeAt(0);\n if (finalRange[0] > finalCode || finalCode > finalRange[1]) {\n throw new Error(`final must be in range ${finalRange[0]} .. ${finalRange[1]}`);\n }\n res <<= 8;\n res |= finalCode;\n\n return res;\n }\n\n public identToString(ident: number): string {\n const res: string[] = [];\n while (ident) {\n res.push(String.fromCharCode(ident & 0xFF));\n ident >>= 8;\n }\n return res.reverse().join('');\n }\n\n public dispose(): void {\n this._csiHandlers = Object.create(null);\n this._executeHandlers = Object.create(null);\n this._escHandlers = Object.create(null);\n this._oscParser.dispose();\n this._dcsParser.dispose();\n }\n\n public setPrintHandler(handler: PrintHandlerType): void {\n this._printHandler = handler;\n }\n public clearPrintHandler(): void {\n this._printHandler = this._printHandlerFb;\n }\n\n public registerEscHandler(id: IFunctionIdentifier, handler: EscHandlerType): IDisposable {\n const ident = this._identifier(id, [0x30, 0x7e]);\n if (this._escHandlers[ident] === undefined) {\n this._escHandlers[ident] = [];\n }\n const handlerList = this._escHandlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearEscHandler(id: IFunctionIdentifier): void {\n if (this._escHandlers[this._identifier(id, [0x30, 0x7e])]) delete this._escHandlers[this._identifier(id, [0x30, 0x7e])];\n }\n public setEscHandlerFallback(handler: EscFallbackHandlerType): void {\n this._escHandlerFb = handler;\n }\n\n public setExecuteHandler(flag: string, handler: ExecuteHandlerType): void {\n this._executeHandlers[flag.charCodeAt(0)] = handler;\n }\n public clearExecuteHandler(flag: string): void {\n if (this._executeHandlers[flag.charCodeAt(0)]) delete this._executeHandlers[flag.charCodeAt(0)];\n }\n public setExecuteHandlerFallback(handler: ExecuteFallbackHandlerType): void {\n this._executeHandlerFb = handler;\n }\n\n public registerCsiHandler(id: IFunctionIdentifier, handler: CsiHandlerType): IDisposable {\n const ident = this._identifier(id);\n if (this._csiHandlers[ident] === undefined) {\n this._csiHandlers[ident] = [];\n }\n const handlerList = this._csiHandlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearCsiHandler(id: IFunctionIdentifier): void {\n if (this._csiHandlers[this._identifier(id)]) delete this._csiHandlers[this._identifier(id)];\n }\n public setCsiHandlerFallback(callback: (ident: number, params: IParams) => void): void {\n this._csiHandlerFb = callback;\n }\n\n public registerDcsHandler(id: IFunctionIdentifier, handler: IDcsHandler): IDisposable {\n return this._dcsParser.registerHandler(this._identifier(id), handler);\n }\n public clearDcsHandler(id: IFunctionIdentifier): void {\n this._dcsParser.clearHandler(this._identifier(id));\n }\n public setDcsHandlerFallback(handler: DcsFallbackHandlerType): void {\n this._dcsParser.setHandlerFallback(handler);\n }\n\n public registerOscHandler(ident: number, handler: IOscHandler): IDisposable {\n return this._oscParser.registerHandler(ident, handler);\n }\n public clearOscHandler(ident: number): void {\n this._oscParser.clearHandler(ident);\n }\n public setOscHandlerFallback(handler: OscFallbackHandlerType): void {\n this._oscParser.setHandlerFallback(handler);\n }\n\n public setErrorHandler(callback: (state: IParsingState) => IParsingState): void {\n this._errorHandler = callback;\n }\n public clearErrorHandler(): void {\n this._errorHandler = this._errorHandlerFb;\n }\n\n /**\n * Reset parser to initial values.\n *\n * This can also be used to lift the improper continuation error condition\n * when dealing with async handlers. Use this only as a last resort to silence\n * that error when the terminal has no pending data to be processed. Note that\n * the interrupted async handler might continue its work in the future messing\n * up the terminal state even further.\n */\n public reset(): void {\n this.currentState = this.initialState;\n this._oscParser.reset();\n this._dcsParser.reset();\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n // abort pending continuation from async handler\n // Here the RESET type indicates, that the next parse call will\n // ignore any saved stack, instead continues sync with next codepoint from GROUND\n if (this._parseStack.state !== ParserStackType.NONE) {\n this._parseStack.state = ParserStackType.RESET;\n this._parseStack.handlers = []; // also release handlers ref\n }\n }\n\n /**\n * Async parse support.\n */\n protected _preserveStack(\n state: ParserStackType,\n handlers: ResumableHandlersType,\n handlerPos: number,\n transition: number,\n chunkPos: number\n ): void {\n this._parseStack.state = state;\n this._parseStack.handlers = handlers;\n this._parseStack.handlerPos = handlerPos;\n this._parseStack.transition = transition;\n this._parseStack.chunkPos = chunkPos;\n }\n\n /**\n * Parse UTF32 codepoints in `data` up to `length`.\n *\n * Note: For several actions with high data load the parsing is optimized\n * by using local read ahead loops with hardcoded conditions to\n * avoid costly table lookups. Make sure that any change of table values\n * will be reflected in the loop conditions as well and vice versa.\n * Affected states/actions:\n * - GROUND:PRINT\n * - CSI_PARAM:PARAM\n * - DCS_PARAM:PARAM\n * - OSC_STRING:OSC_PUT\n * - DCS_PASSTHROUGH:DCS_PUT\n *\n * Note on asynchronous handler support:\n * Any handler returning a promise will be treated as asynchronous.\n * To keep the in-band blocking working for async handlers, `parse` pauses execution,\n * creates a stack save and returns the promise to the caller.\n * For proper continuation of the paused state it is important\n * to await the promise resolving. On resolve the parse must be repeated\n * with the same chunk of data and the resolved value in `promiseResult`\n * until no promise is returned.\n *\n * Important: With only sync handlers defined, parsing is completely synchronous as well.\n * As soon as an async handler is involved, synchronous parsing is not possible anymore.\n *\n * Boilerplate for proper parsing of multiple chunks with async handlers:\n *\n * ```typescript\n * async function parseMultipleChunks(chunks: Uint32Array[]): Promise {\n * for (const chunk of chunks) {\n * let result: void | Promise;\n * let prev: boolean | undefined;\n * while (result = parser.parse(chunk, chunk.length, prev)) {\n * prev = await result;\n * }\n * }\n * // finished parsing all chunks...\n * }\n * ```\n */\n public parse(data: Uint32Array, length: number, promiseResult?: boolean): void | Promise {\n let code = 0;\n let transition = 0;\n let start = 0;\n let handlerResult: void | boolean | Promise;\n\n // resume from async handler\n if (this._parseStack.state) {\n // allow sync parser reset even in continuation mode\n // Note: can be used to recover parser from improper continuation error below\n if (this._parseStack.state === ParserStackType.RESET) {\n this._parseStack.state = ParserStackType.NONE;\n start = this._parseStack.chunkPos + 1; // continue with next codepoint in GROUND\n } else {\n if (promiseResult === undefined || this._parseStack.state === ParserStackType.FAIL) {\n /**\n * Reject further parsing on improper continuation after pausing.\n * This is a really bad condition with screwed up execution order and prolly messed up\n * terminal state, therefore we exit hard with an exception and reject any further parsing.\n *\n * Note: With `Terminal.write` usage this exception should never occur, as the top level\n * calls are guaranteed to handle async conditions properly. If you ever encounter this\n * exception in your terminal integration it indicates, that you injected data chunks to\n * `InputHandler.parse` or `EscapeSequenceParser.parse` synchronously without waiting for\n * continuation of a running async handler.\n *\n * It is possible to get rid of this error by calling `reset`. But dont rely on that,\n * as the pending async handler still might mess up the terminal later. Instead fix the faulty\n * async handling, so this error will not be thrown anymore.\n */\n this._parseStack.state = ParserStackType.FAIL;\n throw new Error('improper continuation due to previous async handler, giving up parsing');\n }\n\n // we have to resume the old handler loop if:\n // - return value of the promise was `false`\n // - handlers are not exhausted yet\n const handlers = this._parseStack.handlers;\n let handlerPos = this._parseStack.handlerPos - 1;\n switch (this._parseStack.state) {\n case ParserStackType.CSI:\n if (promiseResult === false && handlerPos > -1) {\n for (; handlerPos >= 0; handlerPos--) {\n handlerResult = (handlers as CsiHandlerType[])[handlerPos](this._params);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._parseStack.handlerPos = handlerPos;\n return handlerResult;\n }\n }\n }\n this._parseStack.handlers = [];\n break;\n case ParserStackType.ESC:\n if (promiseResult === false && handlerPos > -1) {\n for (; handlerPos >= 0; handlerPos--) {\n handlerResult = (handlers as EscHandlerType[])[handlerPos]();\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._parseStack.handlerPos = handlerPos;\n return handlerResult;\n }\n }\n }\n this._parseStack.handlers = [];\n break;\n case ParserStackType.DCS:\n code = data[this._parseStack.chunkPos];\n handlerResult = this._dcsParser.unhook(code !== 0x18 && code !== 0x1a, promiseResult);\n if (handlerResult) {\n return handlerResult;\n }\n if (code === 0x1b) this._parseStack.transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n case ParserStackType.OSC:\n code = data[this._parseStack.chunkPos];\n handlerResult = this._oscParser.end(code !== 0x18 && code !== 0x1a, promiseResult);\n if (handlerResult) {\n return handlerResult;\n }\n if (code === 0x1b) this._parseStack.transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n }\n // cleanup before continuing with the main sync loop\n this._parseStack.state = ParserStackType.NONE;\n start = this._parseStack.chunkPos + 1;\n this.precedingCodepoint = 0;\n this.currentState = this._parseStack.transition & TableAccess.TRANSITION_STATE_MASK;\n }\n }\n\n // continue with main sync loop\n\n // process input string\n for (let i = start; i < length; ++i) {\n code = data[i];\n\n // normal transition & action lookup\n transition = this._transitions.table[this.currentState << TableAccess.INDEX_STATE_SHIFT | (code < 0xa0 ? code : NON_ASCII_PRINTABLE)];\n switch (transition >> TableAccess.TRANSITION_ACTION_SHIFT) {\n case ParserAction.PRINT:\n // read ahead with loop unrolling\n // Note: 0x20 (SP) is included, 0x7F (DEL) is excluded\n for (let j = i + 1; ; ++j) {\n if (j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.EXECUTE:\n if (this._executeHandlers[code]) this._executeHandlers[code]();\n else this._executeHandlerFb(code);\n this.precedingCodepoint = 0;\n break;\n case ParserAction.IGNORE:\n break;\n case ParserAction.ERROR:\n const inject: IParsingState = this._errorHandler(\n {\n position: i,\n code,\n currentState: this.currentState,\n collect: this._collect,\n params: this._params,\n abort: false\n });\n if (inject.abort) return;\n // inject values: currently not implemented\n break;\n case ParserAction.CSI_DISPATCH:\n // Trigger CSI Handler\n const handlers = this._csiHandlers[this._collect << 8 | code];\n let j = handlers ? handlers.length - 1 : -1;\n for (; j >= 0; j--) {\n // true means success and to stop bubbling\n // a promise indicates an async handler that needs to finish before progressing\n handlerResult = handlers[j](this._params);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._preserveStack(ParserStackType.CSI, handlers, j, transition, i);\n return handlerResult;\n }\n }\n if (j < 0) {\n this._csiHandlerFb(this._collect << 8 | code, this._params);\n }\n this.precedingCodepoint = 0;\n break;\n case ParserAction.PARAM:\n // inner loop: digits (0x30 - 0x39) and ; (0x3b) and : (0x3a)\n do {\n switch (code) {\n case 0x3b:\n this._params.addParam(0); // ZDM\n break;\n case 0x3a:\n this._params.addSubParam(-1);\n break;\n default: // 0x30 - 0x39\n this._params.addDigit(code - 48);\n }\n } while (++i < length && (code = data[i]) > 0x2f && code < 0x3c);\n i--;\n break;\n case ParserAction.COLLECT:\n this._collect <<= 8;\n this._collect |= code;\n break;\n case ParserAction.ESC_DISPATCH:\n const handlersEsc = this._escHandlers[this._collect << 8 | code];\n let jj = handlersEsc ? handlersEsc.length - 1 : -1;\n for (; jj >= 0; jj--) {\n // true means success and to stop bubbling\n // a promise indicates an async handler that needs to finish before progressing\n handlerResult = handlersEsc[jj]();\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._preserveStack(ParserStackType.ESC, handlersEsc, jj, transition, i);\n return handlerResult;\n }\n }\n if (jj < 0) {\n this._escHandlerFb(this._collect << 8 | code);\n }\n this.precedingCodepoint = 0;\n break;\n case ParserAction.CLEAR:\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n case ParserAction.DCS_HOOK:\n this._dcsParser.hook(this._collect << 8 | code, this._params);\n break;\n case ParserAction.DCS_PUT:\n // inner loop - exit DCS_PUT: 0x18, 0x1a, 0x1b, 0x7f, 0x80 - 0x9f\n // unhook triggered by: 0x1b, 0x9c (success) and 0x18, 0x1a (abort)\n for (let j = i + 1; ; ++j) {\n if (j >= length || (code = data[j]) === 0x18 || code === 0x1a || code === 0x1b || (code > 0x7f && code < NON_ASCII_PRINTABLE)) {\n this._dcsParser.put(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.DCS_UNHOOK:\n handlerResult = this._dcsParser.unhook(code !== 0x18 && code !== 0x1a);\n if (handlerResult) {\n this._preserveStack(ParserStackType.DCS, [], 0, transition, i);\n return handlerResult;\n }\n if (code === 0x1b) transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n break;\n case ParserAction.OSC_START:\n this._oscParser.start();\n break;\n case ParserAction.OSC_PUT:\n // inner loop: 0x20 (SP) included, 0x7F (DEL) included\n for (let j = i + 1; ; j++) {\n if (j >= length || (code = data[j]) < 0x20 || (code > 0x7f && code < NON_ASCII_PRINTABLE)) {\n this._oscParser.put(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.OSC_END:\n handlerResult = this._oscParser.end(code !== 0x18 && code !== 0x1a);\n if (handlerResult) {\n this._preserveStack(ParserStackType.OSC, [], 0, transition, i);\n return handlerResult;\n }\n if (code === 0x1b) transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n break;\n }\n this.currentState = transition & TableAccess.TRANSITION_STATE_MASK;\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOscHandler, IHandlerCollection, OscFallbackHandlerType, IOscParser, ISubParserStackState } from 'common/parser/Types';\nimport { OscState, PAYLOAD_LIMIT } from 'common/parser/Constants';\nimport { utf32ToString } from 'common/input/TextDecoder';\nimport { IDisposable } from 'common/Types';\n\nconst EMPTY_HANDLERS: IOscHandler[] = [];\n\nexport class OscParser implements IOscParser {\n private _state = OscState.START;\n private _active = EMPTY_HANDLERS;\n private _id = -1;\n private _handlers: IHandlerCollection = Object.create(null);\n private _handlerFb: OscFallbackHandlerType = () => { };\n private _stack: ISubParserStackState = {\n paused: false,\n loopPosition: 0,\n fallThrough: false\n };\n\n public registerHandler(ident: number, handler: IOscHandler): IDisposable {\n if (this._handlers[ident] === undefined) {\n this._handlers[ident] = [];\n }\n const handlerList = this._handlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearHandler(ident: number): void {\n if (this._handlers[ident]) delete this._handlers[ident];\n }\n public setHandlerFallback(handler: OscFallbackHandlerType): void {\n this._handlerFb = handler;\n }\n\n public dispose(): void {\n this._handlers = Object.create(null);\n this._handlerFb = () => { };\n this._active = EMPTY_HANDLERS;\n }\n\n public reset(): void {\n // force cleanup handlers if payload was already sent\n if (this._state === OscState.PAYLOAD) {\n for (let j = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; j >= 0; --j) {\n this._active[j].end(false);\n }\n }\n this._stack.paused = false;\n this._active = EMPTY_HANDLERS;\n this._id = -1;\n this._state = OscState.START;\n }\n\n private _start(): void {\n this._active = this._handlers[this._id] || EMPTY_HANDLERS;\n if (!this._active.length) {\n this._handlerFb(this._id, 'START');\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].start();\n }\n }\n }\n\n private _put(data: Uint32Array, start: number, end: number): void {\n if (!this._active.length) {\n this._handlerFb(this._id, 'PUT', utf32ToString(data, start, end));\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].put(data, start, end);\n }\n }\n }\n\n public start(): void {\n // always reset leftover handlers\n this.reset();\n this._state = OscState.ID;\n }\n\n /**\n * Put data to current OSC command.\n * Expects the identifier of the OSC command in the form\n * OSC id ; payload ST/BEL\n * Payload chunks are not further processed and get\n * directly passed to the handlers.\n */\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._state === OscState.ABORT) {\n return;\n }\n if (this._state === OscState.ID) {\n while (start < end) {\n const code = data[start++];\n if (code === 0x3b) {\n this._state = OscState.PAYLOAD;\n this._start();\n break;\n }\n if (code < 0x30 || 0x39 < code) {\n this._state = OscState.ABORT;\n return;\n }\n if (this._id === -1) {\n this._id = 0;\n }\n this._id = this._id * 10 + code - 48;\n }\n }\n if (this._state === OscState.PAYLOAD && end - start > 0) {\n this._put(data, start, end);\n }\n }\n\n /**\n * Indicates end of an OSC command.\n * Whether the OSC got aborted or finished normally\n * is indicated by `success`.\n */\n public end(success: boolean, promiseResult: boolean = true): void | Promise {\n if (this._state === OscState.START) {\n return;\n }\n // do nothing if command was faulty\n if (this._state !== OscState.ABORT) {\n // if we are still in ID state and get an early end\n // means that the command has no payload thus we still have\n // to announce START and send END right after\n if (this._state === OscState.ID) {\n this._start();\n }\n\n if (!this._active.length) {\n this._handlerFb(this._id, 'END', success);\n } else {\n let handlerResult: boolean | Promise = false;\n let j = this._active.length - 1;\n let fallThrough = false;\n if (this._stack.paused) {\n j = this._stack.loopPosition - 1;\n handlerResult = promiseResult;\n fallThrough = this._stack.fallThrough;\n this._stack.paused = false;\n }\n if (!fallThrough && handlerResult === false) {\n for (; j >= 0; j--) {\n handlerResult = this._active[j].end(success);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = false;\n return handlerResult;\n }\n }\n j--;\n }\n // cleanup left over handlers\n // we always have to call .end for proper cleanup,\n // here we use `success` to indicate whether a handler should execute\n for (; j >= 0; j--) {\n handlerResult = this._active[j].end(false);\n if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = true;\n return handlerResult;\n }\n }\n }\n\n }\n this._active = EMPTY_HANDLERS;\n this._id = -1;\n this._state = OscState.START;\n }\n}\n\n/**\n * Convenient class to allow attaching string based handler functions\n * as OSC handlers.\n */\nexport class OscHandler implements IOscHandler {\n private _data = '';\n private _hitLimit: boolean = false;\n\n constructor(private _handler: (data: string) => boolean | Promise) { }\n\n public start(): void {\n this._data = '';\n this._hitLimit = false;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._hitLimit) {\n return;\n }\n this._data += utf32ToString(data, start, end);\n if (this._data.length > PAYLOAD_LIMIT) {\n this._data = '';\n this._hitLimit = true;\n }\n }\n\n public end(success: boolean): boolean | Promise {\n let ret: boolean | Promise = false;\n if (this._hitLimit) {\n ret = false;\n } else if (success) {\n ret = this._handler(this._data);\n if (ret instanceof Promise) {\n // need to hold data until `ret` got resolved\n // dont care for errors, data will be freed anyway on next start\n return ret.then(res => {\n this._data = '';\n this._hitLimit = false;\n return res;\n });\n }\n }\n this._data = '';\n this._hitLimit = false;\n return ret;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IParams, ParamsArray } from 'common/parser/Types';\n\n// max value supported for a single param/subparam (clamped to positive int32 range)\nconst MAX_VALUE = 0x7FFFFFFF;\n// max allowed subparams for a single sequence (hardcoded limitation)\nconst MAX_SUBPARAMS = 256;\n\n/**\n * Params storage class.\n * This type is used by the parser to accumulate sequence parameters and sub parameters\n * and transmit them to the input handler actions.\n *\n * NOTES:\n * - params object for action handlers is borrowed, use `.toArray` or `.clone` to get a copy\n * - never read beyond `params.length - 1` (likely to contain arbitrary data)\n * - `.getSubParams` returns a borrowed typed array, use `.getSubParamsAll` for cloned sub params\n * - hardcoded limitations:\n * - max. value for a single (sub) param is 2^31 - 1 (greater values are clamped to that)\n * - max. 256 sub params possible\n * - negative values are not allowed beside -1 (placeholder for default value)\n *\n * About ZDM (Zero Default Mode):\n * ZDM is not orchestrated by this class. If the parser is in ZDM,\n * it should add 0 for empty params, otherwise -1. This does not apply\n * to subparams, empty subparams should always be added with -1.\n */\nexport class Params implements IParams {\n // params store and length\n public params: Int32Array;\n public length: number;\n\n // sub params store and length\n protected _subParams: Int32Array;\n protected _subParamsLength: number;\n\n // sub params offsets from param: param idx --> [start, end] offset\n private _subParamsIdx: Uint16Array;\n private _rejectDigits: boolean;\n private _rejectSubDigits: boolean;\n private _digitIsSub: boolean;\n\n /**\n * Create a `Params` type from JS array representation.\n */\n public static fromArray(values: ParamsArray): Params {\n const params = new Params();\n if (!values.length) {\n return params;\n }\n // skip leading sub params\n for (let i = (Array.isArray(values[0])) ? 1 : 0; i < values.length; ++i) {\n const value = values[i];\n if (Array.isArray(value)) {\n for (let k = 0; k < value.length; ++k) {\n params.addSubParam(value[k]);\n }\n } else {\n params.addParam(value);\n }\n }\n return params;\n }\n\n /**\n * @param maxLength max length of storable parameters\n * @param maxSubParamsLength max length of storable sub parameters\n */\n constructor(public maxLength: number = 32, public maxSubParamsLength: number = 32) {\n if (maxSubParamsLength > MAX_SUBPARAMS) {\n throw new Error('maxSubParamsLength must not be greater than 256');\n }\n this.params = new Int32Array(maxLength);\n this.length = 0;\n this._subParams = new Int32Array(maxSubParamsLength);\n this._subParamsLength = 0;\n this._subParamsIdx = new Uint16Array(maxLength);\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }\n\n /**\n * Clone object.\n */\n public clone(): Params {\n const newParams = new Params(this.maxLength, this.maxSubParamsLength);\n newParams.params.set(this.params);\n newParams.length = this.length;\n newParams._subParams.set(this._subParams);\n newParams._subParamsLength = this._subParamsLength;\n newParams._subParamsIdx.set(this._subParamsIdx);\n newParams._rejectDigits = this._rejectDigits;\n newParams._rejectSubDigits = this._rejectSubDigits;\n newParams._digitIsSub = this._digitIsSub;\n return newParams;\n }\n\n /**\n * Get a JS array representation of the current parameters and sub parameters.\n * The array is structured as follows:\n * sequence: \"1;2:3:4;5::6\"\n * array : [1, 2, [3, 4], 5, [-1, 6]]\n */\n public toArray(): ParamsArray {\n const res: ParamsArray = [];\n for (let i = 0; i < this.length; ++i) {\n res.push(this.params[i]);\n const start = this._subParamsIdx[i] >> 8;\n const end = this._subParamsIdx[i] & 0xFF;\n if (end - start > 0) {\n res.push(Array.prototype.slice.call(this._subParams, start, end));\n }\n }\n return res;\n }\n\n /**\n * Reset to initial empty state.\n */\n public reset(): void {\n this.length = 0;\n this._subParamsLength = 0;\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }\n\n /**\n * Add a parameter value.\n * `Params` only stores up to `maxLength` parameters, any later\n * parameter will be ignored.\n * Note: VT devices only stored up to 16 values, xterm seems to\n * store up to 30.\n */\n public addParam(value: number): void {\n this._digitIsSub = false;\n if (this.length >= this.maxLength) {\n this._rejectDigits = true;\n return;\n }\n if (value < -1) {\n throw new Error('values lesser than -1 are not allowed');\n }\n this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength;\n this.params[this.length++] = value > MAX_VALUE ? MAX_VALUE : value;\n }\n\n /**\n * Add a sub parameter value.\n * The sub parameter is automatically associated with the last parameter value.\n * Thus it is not possible to add a subparameter without any parameter added yet.\n * `Params` only stores up to `subParamsLength` sub parameters, any later\n * sub parameter will be ignored.\n */\n public addSubParam(value: number): void {\n this._digitIsSub = true;\n if (!this.length) {\n return;\n }\n if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) {\n this._rejectSubDigits = true;\n return;\n }\n if (value < -1) {\n throw new Error('values lesser than -1 are not allowed');\n }\n this._subParams[this._subParamsLength++] = value > MAX_VALUE ? MAX_VALUE : value;\n this._subParamsIdx[this.length - 1]++;\n }\n\n /**\n * Whether parameter at index `idx` has sub parameters.\n */\n public hasSubParams(idx: number): boolean {\n return ((this._subParamsIdx[idx] & 0xFF) - (this._subParamsIdx[idx] >> 8) > 0);\n }\n\n /**\n * Return sub parameters for parameter at index `idx`.\n * Note: The values are borrowed, thus you need to copy\n * the values if you need to hold them in nonlocal scope.\n */\n public getSubParams(idx: number): Int32Array | null {\n const start = this._subParamsIdx[idx] >> 8;\n const end = this._subParamsIdx[idx] & 0xFF;\n if (end - start > 0) {\n return this._subParams.subarray(start, end);\n }\n return null;\n }\n\n /**\n * Return all sub parameters as {idx: subparams} mapping.\n * Note: The values are not borrowed.\n */\n public getSubParamsAll(): {[idx: number]: Int32Array} {\n const result: {[idx: number]: Int32Array} = {};\n for (let i = 0; i < this.length; ++i) {\n const start = this._subParamsIdx[i] >> 8;\n const end = this._subParamsIdx[i] & 0xFF;\n if (end - start > 0) {\n result[i] = this._subParams.slice(start, end);\n }\n }\n return result;\n }\n\n /**\n * Add a single digit value to current parameter.\n * This is used by the parser to account digits on a char by char basis.\n */\n public addDigit(value: number): void {\n let length;\n if (this._rejectDigits\n || !(length = this._digitIsSub ? this._subParamsLength : this.length)\n || (this._digitIsSub && this._rejectSubDigits)\n ) {\n return;\n }\n\n const store = this._digitIsSub ? this._subParams : this.params;\n const cur = store[length - 1];\n store[length - 1] = ~cur ? Math.min(cur * 10 + value, MAX_VALUE) : value;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ITerminalAddon, IDisposable, Terminal } from 'xterm';\n\nexport interface ILoadedAddon {\n instance: ITerminalAddon;\n dispose: () => void;\n isDisposed: boolean;\n}\n\nexport class AddonManager implements IDisposable {\n protected _addons: ILoadedAddon[] = [];\n\n constructor() {\n }\n\n public dispose(): void {\n for (let i = this._addons.length - 1; i >= 0; i--) {\n this._addons[i].instance.dispose();\n }\n }\n\n public loadAddon(terminal: Terminal, instance: ITerminalAddon): void {\n const loadedAddon: ILoadedAddon = {\n instance,\n dispose: instance.dispose,\n isDisposed: false\n };\n this._addons.push(loadedAddon);\n instance.dispose = () => this._wrappedAddonDispose(loadedAddon);\n instance.activate(terminal as any);\n }\n\n private _wrappedAddonDispose(loadedAddon: ILoadedAddon): void {\n if (loadedAddon.isDisposed) {\n // Do nothing if already disposed\n return;\n }\n let index = -1;\n for (let i = 0; i < this._addons.length; i++) {\n if (this._addons[i] === loadedAddon) {\n index = i;\n break;\n }\n }\n if (index === -1) {\n throw new Error('Could not dispose an addon that has not been loaded');\n }\n loadedAddon.isDisposed = true;\n loadedAddon.dispose.apply(loadedAddon.instance);\n this._addons.splice(index, 1);\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from 'xterm';\nimport { IBuffer } from 'common/buffer/Types';\nimport { BufferLineApiView } from 'common/public/BufferLineApiView';\nimport { CellData } from 'common/buffer/CellData';\n\nexport class BufferApiView implements IBufferApi {\n constructor(\n private _buffer: IBuffer,\n public readonly type: 'normal' | 'alternate'\n ) { }\n\n public init(buffer: IBuffer): BufferApiView {\n this._buffer = buffer;\n return this;\n }\n\n public get cursorY(): number { return this._buffer.y; }\n public get cursorX(): number { return this._buffer.x; }\n public get viewportY(): number { return this._buffer.ydisp; }\n public get baseY(): number { return this._buffer.ybase; }\n public get length(): number { return this._buffer.lines.length; }\n public getLine(y: number): IBufferLineApi | undefined {\n const line = this._buffer.lines.get(y);\n if (!line) {\n return undefined;\n }\n return new BufferLineApiView(line);\n }\n public getNullCell(): IBufferCellApi { return new CellData(); }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferLine, ICellData } from 'common/Types';\nimport { IBufferCell as IBufferCellApi, IBufferLine as IBufferLineApi } from 'xterm';\n\nexport class BufferLineApiView implements IBufferLineApi {\n constructor(private _line: IBufferLine) { }\n\n public get isWrapped(): boolean { return this._line.isWrapped; }\n public get length(): number { return this._line.length; }\n public getCell(x: number, cell?: IBufferCellApi): IBufferCellApi | undefined {\n if (x < 0 || x >= this._line.length) {\n return undefined;\n }\n\n if (cell) {\n this._line.loadCell(x, cell as ICellData);\n return cell;\n }\n return this._line.loadCell(x, new CellData());\n }\n public translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string {\n return this._line.translateToString(trimRight, startColumn, endColumn);\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi } from 'xterm';\nimport { BufferApiView } from 'common/public/BufferApiView';\nimport { IEvent, EventEmitter } from 'common/EventEmitter';\nimport { ICoreTerminal } from 'common/Types';\n\nexport class BufferNamespaceApi implements IBufferNamespaceApi {\n private _normal: BufferApiView;\n private _alternate: BufferApiView;\n private _onBufferChange = new EventEmitter();\n public get onBufferChange(): IEvent { return this._onBufferChange.event; }\n\n constructor(private _core: ICoreTerminal) {\n this._normal = new BufferApiView(this._core.buffers.normal, 'normal');\n this._alternate = new BufferApiView(this._core.buffers.alt, 'alternate');\n this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active));\n }\n public get active(): IBufferApi {\n if (this._core.buffers.active === this._core.buffers.normal) { return this.normal; }\n if (this._core.buffers.active === this._core.buffers.alt) { return this.alternate; }\n throw new Error('Active buffer is neither normal nor alternate');\n }\n public get normal(): IBufferApi {\n return this._normal.init(this._core.buffers.normal);\n }\n public get alternate(): IBufferApi {\n return this._alternate.init(this._core.buffers.alt);\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IParams } from 'common/parser/Types';\nimport { IDisposable, IFunctionIdentifier, IParser } from 'xterm';\nimport { ICoreTerminal } from 'common/Types';\n\nexport class ParserApi implements IParser {\n constructor(private _core: ICoreTerminal) { }\n\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean | Promise): IDisposable {\n return this._core.registerCsiHandler(id, (params: IParams) => callback(params.toArray()));\n }\n public addCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean | Promise): IDisposable {\n return this.registerCsiHandler(id, callback);\n }\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean | Promise): IDisposable {\n return this._core.registerDcsHandler(id, (data: string, params: IParams) => callback(data, params.toArray()));\n }\n public addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean | Promise): IDisposable {\n return this.registerDcsHandler(id, callback);\n }\n public registerEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise): IDisposable {\n return this._core.registerEscHandler(id, handler);\n }\n public addEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise): IDisposable {\n return this.registerEscHandler(id, handler);\n }\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable {\n return this._core.registerOscHandler(ident, callback);\n }\n public addOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable {\n return this.registerOscHandler(ident, callback);\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreTerminal } from 'common/Types';\nimport { IUnicodeHandling, IUnicodeVersionProvider } from 'xterm';\n\nexport class UnicodeApi implements IUnicodeHandling {\n constructor(private _core: ICoreTerminal) { }\n\n public register(provider: IUnicodeVersionProvider): void {\n this._core.unicodeService.register(provider);\n }\n\n public get versions(): string[] {\n return this._core.unicodeService.versions;\n }\n\n public get activeVersion(): string {\n return this._core.unicodeService.activeVersion;\n }\n\n public set activeVersion(version: string) {\n this._core.unicodeService.activeVersion = version;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferService, IOptionsService } from 'common/services/Services';\nimport { BufferSet } from 'common/buffer/BufferSet';\nimport { IBufferSet, IBuffer } from 'common/buffer/Types';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { IAttributeData, IBufferLine, ScrollSource } from 'common/Types';\n\nexport const MINIMUM_COLS = 2; // Less than 2 can mess with wide chars\nexport const MINIMUM_ROWS = 1;\n\nexport class BufferService extends Disposable implements IBufferService {\n public serviceBrand: any;\n\n public cols: number;\n public rows: number;\n public buffers: IBufferSet;\n /** Whether the user is scrolling (locks the scroll position) */\n public isUserScrolling: boolean = false;\n\n private _onResize = new EventEmitter<{ cols: number, rows: number }>();\n public get onResize(): IEvent<{ cols: number, rows: number }> { return this._onResize.event; }\n private _onScroll = new EventEmitter();\n public get onScroll(): IEvent { return this._onScroll.event; }\n\n public get buffer(): IBuffer { return this.buffers.active; }\n\n /** An IBufferline to clone/copy from for new blank lines */\n private _cachedBlankLine: IBufferLine | undefined;\n\n constructor(\n @IOptionsService private _optionsService: IOptionsService\n ) {\n super();\n this.cols = Math.max(_optionsService.rawOptions.cols || 0, MINIMUM_COLS);\n this.rows = Math.max(_optionsService.rawOptions.rows || 0, MINIMUM_ROWS);\n this.buffers = new BufferSet(_optionsService, this);\n }\n\n public dispose(): void {\n super.dispose();\n this.buffers.dispose();\n }\n\n public resize(cols: number, rows: number): void {\n this.cols = cols;\n this.rows = rows;\n this.buffers.resize(cols, rows);\n this.buffers.setupTabStops(this.cols);\n this._onResize.fire({ cols, rows });\n }\n\n public reset(): void {\n this.buffers.reset();\n this.isUserScrolling = false;\n }\n\n /**\n * Scroll the terminal down 1 row, creating a blank line.\n * @param isWrapped Whether the new line is wrapped from the previous line.\n */\n public scroll(eraseAttr: IAttributeData, isWrapped: boolean = false): void {\n const buffer = this.buffer;\n\n let newLine: IBufferLine | undefined;\n newLine = this._cachedBlankLine;\n if (!newLine || newLine.length !== this.cols || newLine.getFg(0) !== eraseAttr.fg || newLine.getBg(0) !== eraseAttr.bg) {\n newLine = buffer.getBlankLine(eraseAttr, isWrapped);\n this._cachedBlankLine = newLine;\n }\n newLine.isWrapped = isWrapped;\n\n const topRow = buffer.ybase + buffer.scrollTop;\n const bottomRow = buffer.ybase + buffer.scrollBottom;\n\n if (buffer.scrollTop === 0) {\n // Determine whether the buffer is going to be trimmed after insertion.\n const willBufferBeTrimmed = buffer.lines.isFull;\n\n // Insert the line using the fastest method\n if (bottomRow === buffer.lines.length - 1) {\n if (willBufferBeTrimmed) {\n buffer.lines.recycle().copyFrom(newLine);\n } else {\n buffer.lines.push(newLine.clone());\n }\n } else {\n buffer.lines.splice(bottomRow + 1, 0, newLine.clone());\n }\n\n // Only adjust ybase and ydisp when the buffer is not trimmed\n if (!willBufferBeTrimmed) {\n buffer.ybase++;\n // Only scroll the ydisp with ybase if the user has not scrolled up\n if (!this.isUserScrolling) {\n buffer.ydisp++;\n }\n } else {\n // When the buffer is full and the user has scrolled up, keep the text\n // stable unless ydisp is right at the top\n if (this.isUserScrolling) {\n buffer.ydisp = Math.max(buffer.ydisp - 1, 0);\n }\n }\n } else {\n // scrollTop is non-zero which means no line will be going to the\n // scrollback, instead we can just shift them in-place.\n const scrollRegionHeight = bottomRow - topRow + 1 /* as it's zero-based */;\n buffer.lines.shiftElements(topRow + 1, scrollRegionHeight - 1, -1);\n buffer.lines.set(bottomRow, newLine.clone());\n }\n\n // Move the viewport to the bottom of the buffer unless the user is\n // scrolling.\n if (!this.isUserScrolling) {\n buffer.ydisp = buffer.ybase;\n }\n\n this._onScroll.fire(buffer.ydisp);\n }\n\n /**\n * Scroll the display of the terminal\n * @param disp The number of lines to scroll down (negative scroll up).\n * @param suppressScrollEvent Don't emit the scroll event as scrollLines. This is used\n * to avoid unwanted events being handled by the viewport when the event was triggered from the\n * viewport originally.\n */\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void {\n const buffer = this.buffer;\n if (disp < 0) {\n if (buffer.ydisp === 0) {\n return;\n }\n this.isUserScrolling = true;\n } else if (disp + buffer.ydisp >= buffer.ybase) {\n this.isUserScrolling = false;\n }\n\n const oldYdisp = buffer.ydisp;\n buffer.ydisp = Math.max(Math.min(buffer.ydisp + disp, buffer.ybase), 0);\n\n // No change occurred, don't trigger scroll/refresh\n if (oldYdisp === buffer.ydisp) {\n return;\n }\n\n if (!suppressScrollEvent) {\n this._onScroll.fire(buffer.ydisp);\n }\n }\n\n /**\n * Scroll the display of the terminal by a number of pages.\n * @param pageCount The number of pages to scroll (negative scrolls up).\n */\n public scrollPages(pageCount: number): void {\n this.scrollLines(pageCount * (this.rows - 1));\n }\n\n /**\n * Scrolls the display of the terminal to the top.\n */\n public scrollToTop(): void {\n this.scrollLines(-this.buffer.ydisp);\n }\n\n /**\n * Scrolls the display of the terminal to the bottom.\n */\n public scrollToBottom(): void {\n this.scrollLines(this.buffer.ybase - this.buffer.ydisp);\n }\n\n public scrollToLine(line: number): void {\n const scrollAmount = line - this.buffer.ydisp;\n if (scrollAmount !== 0) {\n this.scrollLines(scrollAmount);\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharsetService } from 'common/services/Services';\nimport { ICharset } from 'common/Types';\n\nexport class CharsetService implements ICharsetService {\n public serviceBrand: any;\n\n public charset: ICharset | undefined;\n public glevel: number = 0;\n\n private _charsets: (ICharset | undefined)[] = [];\n\n public reset(): void {\n this.charset = undefined;\n this._charsets = [];\n this.glevel = 0;\n }\n\n public setgLevel(g: number): void {\n this.glevel = g;\n this.charset = this._charsets[g];\n }\n\n public setgCharset(g: number, charset: ICharset | undefined): void {\n this._charsets[g] = charset;\n if (this.glevel === g) {\n this.charset = charset;\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IBufferService, ICoreService, ICoreMouseService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { ICoreMouseProtocol, ICoreMouseEvent, CoreMouseEncoding, CoreMouseEventType, CoreMouseButton, CoreMouseAction } from 'common/Types';\n\n/**\n * Supported default protocols.\n */\nconst DEFAULT_PROTOCOLS: {[key: string]: ICoreMouseProtocol} = {\n /**\n * NONE\n * Events: none\n * Modifiers: none\n */\n NONE: {\n events: CoreMouseEventType.NONE,\n restrict: () => false\n },\n /**\n * X10\n * Events: mousedown\n * Modifiers: none\n */\n X10: {\n events: CoreMouseEventType.DOWN,\n restrict: (e: ICoreMouseEvent) => {\n // no wheel, no move, no up\n if (e.button === CoreMouseButton.WHEEL || e.action !== CoreMouseAction.DOWN) {\n return false;\n }\n // no modifiers\n e.ctrl = false;\n e.alt = false;\n e.shift = false;\n return true;\n }\n },\n /**\n * VT200\n * Events: mousedown / mouseup / wheel\n * Modifiers: all\n */\n VT200: {\n events: CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL,\n restrict: (e: ICoreMouseEvent) => {\n // no move\n if (e.action === CoreMouseAction.MOVE) {\n return false;\n }\n return true;\n }\n },\n /**\n * DRAG\n * Events: mousedown / mouseup / wheel / mousedrag\n * Modifiers: all\n */\n DRAG: {\n events: CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL | CoreMouseEventType.DRAG,\n restrict: (e: ICoreMouseEvent) => {\n // no move without button\n if (e.action === CoreMouseAction.MOVE && e.button === CoreMouseButton.NONE) {\n return false;\n }\n return true;\n }\n },\n /**\n * ANY\n * Events: all mouse related events\n * Modifiers: all\n */\n ANY: {\n events:\n CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL\n | CoreMouseEventType.DRAG | CoreMouseEventType.MOVE,\n restrict: (e: ICoreMouseEvent) => true\n }\n};\n\nconst enum Modifiers {\n SHIFT = 4,\n ALT = 8,\n CTRL = 16\n}\n\n// helper for default encoders to generate the event code.\nfunction eventCode(e: ICoreMouseEvent, isSGR: boolean): number {\n let code = (e.ctrl ? Modifiers.CTRL : 0) | (e.shift ? Modifiers.SHIFT : 0) | (e.alt ? Modifiers.ALT : 0);\n if (e.button === CoreMouseButton.WHEEL) {\n code |= 64;\n code |= e.action;\n } else {\n code |= e.button & 3;\n if (e.button & 4) {\n code |= 64;\n }\n if (e.button & 8) {\n code |= 128;\n }\n if (e.action === CoreMouseAction.MOVE) {\n code |= CoreMouseAction.MOVE;\n } else if (e.action === CoreMouseAction.UP && !isSGR) {\n // special case - only SGR can report button on release\n // all others have to go with NONE\n code |= CoreMouseButton.NONE;\n }\n }\n return code;\n}\n\nconst S = String.fromCharCode;\n\n/**\n * Supported default encodings.\n */\nconst DEFAULT_ENCODINGS: {[key: string]: CoreMouseEncoding} = {\n /**\n * DEFAULT - CSI M Pb Px Py\n * Single byte encoding for coords and event code.\n * Can encode values up to 223 (1-based).\n */\n DEFAULT: (e: ICoreMouseEvent) => {\n const params = [eventCode(e, false) + 32, e.col + 32, e.row + 32];\n // supress mouse report if we exceed addressible range\n // Note this is handled differently by emulators\n // - xterm: sends 0;0 coords instead\n // - vte, konsole: no report\n if (params[0] > 255 || params[1] > 255 || params[2] > 255) {\n return '';\n }\n return `\\x1b[M${S(params[0])}${S(params[1])}${S(params[2])}`;\n },\n /**\n * SGR - CSI < Pb ; Px ; Py M|m\n * No encoding limitation.\n * Can report button on release and works with a well formed sequence.\n */\n SGR: (e: ICoreMouseEvent) => {\n const final = (e.action === CoreMouseAction.UP && e.button !== CoreMouseButton.WHEEL) ? 'm' : 'M';\n return `\\x1b[<${eventCode(e, true)};${e.col};${e.row}${final}`;\n }\n};\n\n/**\n * CoreMouseService\n *\n * Provides mouse tracking reports with different protocols and encodings.\n * - protocols: NONE (default), X10, VT200, DRAG, ANY\n * - encodings: DEFAULT, SGR (UTF8, URXVT removed in #2507)\n *\n * Custom protocols/encodings can be added by `addProtocol` / `addEncoding`.\n * To activate a protocol/encoding, set `activeProtocol` / `activeEncoding`.\n * Switching a protocol will send a notification event `onProtocolChange`\n * with a list of needed events to track.\n *\n * The service handles the mouse tracking state and decides whether to send\n * a tracking report to the backend based on protocol and encoding limitations.\n * To send a mouse event call `triggerMouseEvent`.\n */\nexport class CoreMouseService implements ICoreMouseService {\n private _protocols: {[name: string]: ICoreMouseProtocol} = {};\n private _encodings: {[name: string]: CoreMouseEncoding} = {};\n private _activeProtocol: string = '';\n private _activeEncoding: string = '';\n private _onProtocolChange = new EventEmitter();\n private _lastEvent: ICoreMouseEvent | null = null;\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService,\n @ICoreService private readonly _coreService: ICoreService\n ) {\n // register default protocols and encodings\n for (const name of Object.keys(DEFAULT_PROTOCOLS)) this.addProtocol(name, DEFAULT_PROTOCOLS[name]);\n for (const name of Object.keys(DEFAULT_ENCODINGS)) this.addEncoding(name, DEFAULT_ENCODINGS[name]);\n // call reset to set defaults\n this.reset();\n }\n\n public addProtocol(name: string, protocol: ICoreMouseProtocol): void {\n this._protocols[name] = protocol;\n }\n\n public addEncoding(name: string, encoding: CoreMouseEncoding): void {\n this._encodings[name] = encoding;\n }\n\n public get activeProtocol(): string {\n return this._activeProtocol;\n }\n\n public get areMouseEventsActive(): boolean {\n return this._protocols[this._activeProtocol].events !== 0;\n }\n\n public set activeProtocol(name: string) {\n if (!this._protocols[name]) {\n throw new Error(`unknown protocol \"${name}\"`);\n }\n this._activeProtocol = name;\n this._onProtocolChange.fire(this._protocols[name].events);\n }\n\n public get activeEncoding(): string {\n return this._activeEncoding;\n }\n\n public set activeEncoding(name: string) {\n if (!this._encodings[name]) {\n throw new Error(`unknown encoding \"${name}\"`);\n }\n this._activeEncoding = name;\n }\n\n public reset(): void {\n this.activeProtocol = 'NONE';\n this.activeEncoding = 'DEFAULT';\n this._lastEvent = null;\n }\n\n /**\n * Event to announce changes in mouse tracking.\n */\n public get onProtocolChange(): IEvent {\n return this._onProtocolChange.event;\n }\n\n /**\n * Triggers a mouse event to be sent.\n *\n * Returns true if the event passed all protocol restrictions and a report\n * was sent, otherwise false. The return value may be used to decide whether\n * the default event action in the bowser component should be omitted.\n *\n * Note: The method will change values of the given event object\n * to fullfill protocol and encoding restrictions.\n */\n public triggerMouseEvent(e: ICoreMouseEvent): boolean {\n // range check for col/row\n if (e.col < 0 || e.col >= this._bufferService.cols\n || e.row < 0 || e.row >= this._bufferService.rows) {\n return false;\n }\n\n // filter nonsense combinations of button + action\n if (e.button === CoreMouseButton.WHEEL && e.action === CoreMouseAction.MOVE) {\n return false;\n }\n if (e.button === CoreMouseButton.NONE && e.action !== CoreMouseAction.MOVE) {\n return false;\n }\n if (e.button !== CoreMouseButton.WHEEL && (e.action === CoreMouseAction.LEFT || e.action === CoreMouseAction.RIGHT)) {\n return false;\n }\n\n // report 1-based coords\n e.col++;\n e.row++;\n\n // debounce move at grid level\n if (e.action === CoreMouseAction.MOVE && this._lastEvent && this._compareEvents(this._lastEvent, e)) {\n return false;\n }\n\n // apply protocol restrictions\n if (!this._protocols[this._activeProtocol].restrict(e)) {\n return false;\n }\n\n // encode report and send\n const report = this._encodings[this._activeEncoding](e);\n if (report) {\n // always send DEFAULT as binary data\n if (this._activeEncoding === 'DEFAULT') {\n this._coreService.triggerBinaryEvent(report);\n } else {\n this._coreService.triggerDataEvent(report, true);\n }\n }\n\n this._lastEvent = e;\n\n return true;\n }\n\n public explainEvents(events: CoreMouseEventType): {[event: string]: boolean} {\n return {\n down: !!(events & CoreMouseEventType.DOWN),\n up: !!(events & CoreMouseEventType.UP),\n drag: !!(events & CoreMouseEventType.DRAG),\n move: !!(events & CoreMouseEventType.MOVE),\n wheel: !!(events & CoreMouseEventType.WHEEL)\n };\n }\n\n private _compareEvents(e1: ICoreMouseEvent, e2: ICoreMouseEvent): boolean {\n if (e1.col !== e2.col) return false;\n if (e1.row !== e2.row) return false;\n if (e1.button !== e2.button) return false;\n if (e1.action !== e2.action) return false;\n if (e1.ctrl !== e2.ctrl) return false;\n if (e1.alt !== e2.alt) return false;\n if (e1.shift !== e2.shift) return false;\n return true;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreService, ILogService, IOptionsService, IBufferService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IDecPrivateModes, IModes } from 'common/Types';\nimport { clone } from 'common/Clone';\nimport { Disposable } from 'common/Lifecycle';\n\nconst DEFAULT_MODES: IModes = Object.freeze({\n insertMode: false\n});\n\nconst DEFAULT_DEC_PRIVATE_MODES: IDecPrivateModes = Object.freeze({\n applicationCursorKeys: false,\n applicationKeypad: false,\n bracketedPasteMode: false,\n origin: false,\n reverseWraparound: false,\n sendFocus: false,\n wraparound: true // defaults: xterm - true, vt100 - false\n});\n\nexport class CoreService extends Disposable implements ICoreService {\n public serviceBrand: any;\n\n public isCursorInitialized: boolean = false;\n public isCursorHidden: boolean = false;\n public modes: IModes;\n public decPrivateModes: IDecPrivateModes;\n\n // Circular dependency, this must be unset or memory will leak after Terminal.dispose\n private _scrollToBottom: (() => void) | undefined;\n\n private _onData = this.register(new EventEmitter());\n public get onData(): IEvent { return this._onData.event; }\n private _onUserInput = this.register(new EventEmitter());\n public get onUserInput(): IEvent { return this._onUserInput.event; }\n private _onBinary = this.register(new EventEmitter());\n public get onBinary(): IEvent { return this._onBinary.event; }\n\n constructor(\n // TODO: Move this into a service\n scrollToBottom: () => void,\n @IBufferService private readonly _bufferService: IBufferService,\n @ILogService private readonly _logService: ILogService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n this._scrollToBottom = scrollToBottom;\n this.register({ dispose: () => this._scrollToBottom = undefined });\n this.modes = clone(DEFAULT_MODES);\n this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);\n }\n\n public reset(): void {\n this.modes = clone(DEFAULT_MODES);\n this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);\n }\n\n public triggerDataEvent(data: string, wasUserInput: boolean = false): void {\n // Prevents all events to pty process if stdin is disabled\n if (this._optionsService.rawOptions.disableStdin) {\n return;\n }\n\n // Input is being sent to the terminal, the terminal should focus the prompt.\n const buffer = this._bufferService.buffer;\n if (buffer.ybase !== buffer.ydisp) {\n this._scrollToBottom!();\n }\n\n // Fire onUserInput so listeners can react as well (eg. clear selection)\n if (wasUserInput) {\n this._onUserInput.fire();\n }\n\n // Fire onData API\n this._logService.debug(`sending data \"${data}\"`, () => data.split('').map(e => e.charCodeAt(0)));\n this._onData.fire(data);\n }\n\n public triggerBinaryEvent(data: string): void {\n if (this._optionsService.rawOptions.disableStdin) {\n return;\n }\n this._logService.debug(`sending binary \"${data}\"`, () => data.split('').map(e => e.charCodeAt(0)));\n this._onBinary.fire(data);\n }\n}\n", "/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { css } from 'common/Color';\nimport { EventEmitter } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { IDecorationService, IInternalDecoration } from 'common/services/Services';\nimport { SortedList } from 'common/SortedList';\nimport { IColor } from 'common/Types';\nimport { IDecorationOptions, IDecoration, IMarker, IEvent } from 'xterm';\n\nexport class DecorationService extends Disposable implements IDecorationService {\n public serviceBrand: any;\n\n /**\n * A list of all decorations, sorted by the marker's line value. This relies on the fact that\n * while marker line values do change, they should all change by the same amount so this should\n * never become out of order.\n */\n private readonly _decorations: SortedList = new SortedList(e => e.marker.line);\n\n private _onDecorationRegistered = this.register(new EventEmitter());\n public get onDecorationRegistered(): IEvent { return this._onDecorationRegistered.event; }\n private _onDecorationRemoved = this.register(new EventEmitter());\n public get onDecorationRemoved(): IEvent { return this._onDecorationRemoved.event; }\n\n public get decorations(): IterableIterator { return this._decorations.values(); }\n\n constructor() {\n super();\n }\n\n public registerDecoration(options: IDecorationOptions): IDecoration | undefined {\n if (options.marker.isDisposed) {\n return undefined;\n }\n const decoration = new Decoration(options);\n if (decoration) {\n const markerDispose = decoration.marker.onDispose(() => decoration.dispose());\n decoration.onDispose(() => {\n if (decoration) {\n if (this._decorations.delete(decoration)) {\n this._onDecorationRemoved.fire(decoration);\n }\n markerDispose.dispose();\n }\n });\n this._decorations.insert(decoration);\n this._onDecorationRegistered.fire(decoration);\n }\n return decoration;\n }\n\n public reset(): void {\n for (const d of this._decorations.values()) {\n d.dispose();\n }\n this._decorations.clear();\n }\n\n public *getDecorationsAtLine(line: number): IterableIterator {\n return this._decorations.getKeyIterator(line);\n }\n\n public *getDecorationsAtCell(x: number, line: number, layer?: 'bottom' | 'top'): IterableIterator {\n let xmin = 0;\n let xmax = 0;\n for (const d of this._decorations.getKeyIterator(line)) {\n xmin = d.options.x ?? 0;\n xmax = xmin + (d.options.width ?? 1);\n if (x >= xmin && x < xmax && (!layer || (d.options.layer ?? 'bottom') === layer)) {\n yield d;\n }\n }\n }\n\n public dispose(): void {\n for (const d of this._decorations.values()) {\n this._onDecorationRemoved.fire(d);\n }\n this.reset();\n }\n}\n\nclass Decoration extends Disposable implements IInternalDecoration {\n public readonly marker: IMarker;\n public element: HTMLElement | undefined;\n public isDisposed: boolean = false;\n\n public readonly onRenderEmitter = this.register(new EventEmitter());\n public readonly onRender = this.onRenderEmitter.event;\n private _onDispose = this.register(new EventEmitter());\n public readonly onDispose = this._onDispose.event;\n\n private _cachedBg: IColor | undefined | null = null;\n public get backgroundColorRGB(): IColor | undefined {\n if (this._cachedBg === null) {\n if (this.options.backgroundColor) {\n this._cachedBg = css.toColor(this.options.backgroundColor);\n } else {\n this._cachedBg = undefined;\n }\n }\n return this._cachedBg;\n }\n\n private _cachedFg: IColor | undefined | null = null;\n public get foregroundColorRGB(): IColor | undefined {\n if (this._cachedFg === null) {\n if (this.options.foregroundColor) {\n this._cachedFg = css.toColor(this.options.foregroundColor);\n } else {\n this._cachedFg = undefined;\n }\n }\n return this._cachedFg;\n }\n\n constructor(\n public readonly options: IDecorationOptions\n ) {\n super();\n this.marker = options.marker;\n if (this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position) {\n this.options.overviewRulerOptions.position = 'full';\n }\n }\n\n public override dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._onDispose.fire();\n super.dispose();\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferService, IDirtyRowService } from 'common/services/Services';\n\nexport class DirtyRowService implements IDirtyRowService {\n public serviceBrand: any;\n\n private _start!: number;\n private _end!: number;\n\n public get start(): number { return this._start; }\n public get end(): number { return this._end; }\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n this.clearRange();\n }\n\n public clearRange(): void {\n this._start = this._bufferService.buffer.y;\n this._end = this._bufferService.buffer.y;\n }\n\n public markDirty(y: number): void {\n if (y < this._start) {\n this._start = y;\n } else if (y > this._end) {\n this._end = y;\n }\n }\n\n public markRangeDirty(y1: number, y2: number): void {\n if (y1 > y2) {\n const temp = y1;\n y1 = y2;\n y2 = temp;\n }\n if (y1 < this._start) {\n this._start = y1;\n }\n if (y2 > this._end) {\n this._end = y2;\n }\n }\n\n public markAllDirty(): void {\n this.markRangeDirty(0, this._bufferService.rows - 1);\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * This was heavily inspired from microsoft/vscode's dependency injection system (MIT).\n */\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IInstantiationService, IServiceIdentifier } from 'common/services/Services';\nimport { getServiceDependencies } from 'common/services/ServiceRegistry';\n\nexport class ServiceCollection {\n\n private _entries = new Map, any>();\n\n constructor(...entries: [IServiceIdentifier, any][]) {\n for (const [id, service] of entries) {\n this.set(id, service);\n }\n }\n\n public set(id: IServiceIdentifier, instance: T): T {\n const result = this._entries.get(id);\n this._entries.set(id, instance);\n return result;\n }\n\n public forEach(callback: (id: IServiceIdentifier, instance: any) => any): void {\n this._entries.forEach((value, key) => callback(key, value));\n }\n\n public has(id: IServiceIdentifier): boolean {\n return this._entries.has(id);\n }\n\n public get(id: IServiceIdentifier): T | undefined {\n return this._entries.get(id);\n }\n}\n\nexport class InstantiationService implements IInstantiationService {\n public serviceBrand: undefined;\n\n private readonly _services: ServiceCollection = new ServiceCollection();\n\n constructor() {\n this._services.set(IInstantiationService, this);\n }\n\n public setService(id: IServiceIdentifier, instance: T): void {\n this._services.set(id, instance);\n }\n\n public getService(id: IServiceIdentifier): T | undefined {\n return this._services.get(id);\n }\n\n public createInstance(ctor: any, ...args: any[]): T {\n const serviceDependencies = getServiceDependencies(ctor).sort((a, b) => a.index - b.index);\n\n const serviceArgs: any[] = [];\n for (const dependency of serviceDependencies) {\n const service = this._services.get(dependency.id);\n if (!service) {\n throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`);\n }\n serviceArgs.push(service);\n }\n\n const firstServiceArgPos = serviceDependencies.length > 0 ? serviceDependencies[0].index : args.length;\n\n // check for argument mismatches, adjust static args if needed\n if (args.length !== firstServiceArgPos) {\n throw new Error(`[createInstance] First service dependency of ${ctor.name} at position ${firstServiceArgPos + 1} conflicts with ${args.length} static arguments`);\n }\n\n // now create the instance\n return new ctor(...[...args, ...serviceArgs]);\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILogService, IOptionsService, LogLevelEnum } from 'common/services/Services';\n\ntype LogType = (message?: any, ...optionalParams: any[]) => void;\n\ninterface IConsole {\n log: LogType;\n error: LogType;\n info: LogType;\n trace: LogType;\n warn: LogType;\n}\n\n// console is available on both node.js and browser contexts but the common\n// module doesn't depend on them so we need to explicitly declare it.\ndeclare const console: IConsole;\n\nconst optionsKeyToLogLevel: { [key: string]: LogLevelEnum } = {\n debug: LogLevelEnum.DEBUG,\n info: LogLevelEnum.INFO,\n warn: LogLevelEnum.WARN,\n error: LogLevelEnum.ERROR,\n off: LogLevelEnum.OFF\n};\n\nconst LOG_PREFIX = 'xterm.js: ';\n\nexport class LogService implements ILogService {\n public serviceBrand: any;\n\n public logLevel: LogLevelEnum = LogLevelEnum.OFF;\n\n constructor(\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n this._updateLogLevel();\n this._optionsService.onOptionChange(key => {\n if (key === 'logLevel') {\n this._updateLogLevel();\n }\n });\n }\n\n private _updateLogLevel(): void {\n this.logLevel = optionsKeyToLogLevel[this._optionsService.rawOptions.logLevel];\n }\n\n private _evalLazyOptionalParams(optionalParams: any[]): void {\n for (let i = 0; i < optionalParams.length; i++) {\n if (typeof optionalParams[i] === 'function') {\n optionalParams[i] = optionalParams[i]();\n }\n }\n }\n\n private _log(type: LogType, message: string, optionalParams: any[]): void {\n this._evalLazyOptionalParams(optionalParams);\n type.call(console, LOG_PREFIX + message, ...optionalParams);\n }\n\n public debug(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.DEBUG) {\n this._log(console.log, message, optionalParams);\n }\n }\n\n public info(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.INFO) {\n this._log(console.info, message, optionalParams);\n }\n }\n\n public warn(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.WARN) {\n this._log(console.warn, message, optionalParams);\n }\n }\n\n public error(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.ERROR) {\n this._log(console.error, message, optionalParams);\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOptionsService, ITerminalOptions, FontWeight } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { isMac } from 'common/Platform';\n\n// Source: https://freesound.org/people/altemark/sounds/45759/\n// This sound is released under the Creative Commons Attribution 3.0 Unported\n// (CC BY 3.0) license. It was created by 'altemark'. No modifications have been\n// made, apart from the conversion to base64.\nexport const DEFAULT_BELL_SOUND = 'data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq';\n\nexport const DEFAULT_OPTIONS: Readonly = {\n cols: 80,\n rows: 24,\n cursorBlink: false,\n cursorStyle: 'block',\n cursorWidth: 1,\n customGlyphs: true,\n bellSound: DEFAULT_BELL_SOUND,\n bellStyle: 'none',\n drawBoldTextInBrightColors: true,\n fastScrollModifier: 'alt',\n fastScrollSensitivity: 5,\n fontFamily: 'courier-new, courier, monospace',\n fontSize: 15,\n fontWeight: 'normal',\n fontWeightBold: 'bold',\n lineHeight: 1.0,\n linkTooltipHoverDuration: 500,\n letterSpacing: 0,\n logLevel: 'info',\n scrollback: 1000,\n scrollSensitivity: 1,\n screenReaderMode: false,\n macOptionIsMeta: false,\n macOptionClickForcesSelection: false,\n minimumContrastRatio: 1,\n disableStdin: false,\n allowProposedApi: true,\n allowTransparency: false,\n tabStopWidth: 8,\n theme: {},\n rightClickSelectsWord: isMac,\n rendererType: 'canvas',\n windowOptions: {},\n windowsMode: false,\n wordSeparator: ' ()[]{}\\',\"`',\n altClickMovesCursor: true,\n convertEol: false,\n termName: 'xterm',\n cancelEvents: false,\n overviewRulerWidth: undefined\n};\n\nconst FONT_WEIGHT_OPTIONS: Extract[] = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];\n\nexport class OptionsService implements IOptionsService {\n public serviceBrand: any;\n\n public readonly rawOptions: ITerminalOptions;\n public options: ITerminalOptions;\n\n private _onOptionChange = new EventEmitter();\n public get onOptionChange(): IEvent { return this._onOptionChange.event; }\n\n constructor(options: Partial) {\n // set the default value of each option\n const defaultOptions = { ...DEFAULT_OPTIONS };\n for (const key in options) {\n if (key in defaultOptions) {\n try {\n const newValue = options[key];\n defaultOptions[key] = this._sanitizeAndValidateOption(key, newValue);\n } catch (e) {\n console.error(e);\n }\n }\n }\n\n // set up getters and setters for each option\n this.rawOptions = defaultOptions;\n this.options = { ... defaultOptions };\n this._setupOptions();\n }\n\n private _setupOptions(): void {\n const getter = (propName: string): any => {\n if (!(propName in DEFAULT_OPTIONS)) {\n throw new Error(`No option with key \"${propName}\"`);\n }\n return this.rawOptions[propName];\n };\n\n const setter = (propName: string, value: any): void => {\n if (!(propName in DEFAULT_OPTIONS)) {\n throw new Error(`No option with key \"${propName}\"`);\n }\n\n value = this._sanitizeAndValidateOption(propName, value);\n // Don't fire an option change event if they didn't change\n if (this.rawOptions[propName] !== value) {\n this.rawOptions[propName] = value;\n this._onOptionChange.fire(propName);\n }\n };\n\n for (const propName in this.rawOptions) {\n const desc = {\n get: getter.bind(this, propName),\n set: setter.bind(this, propName)\n };\n Object.defineProperty(this.options, propName, desc);\n }\n }\n\n public setOption(key: string, value: any): void {\n this.options[key] = value;\n }\n\n private _sanitizeAndValidateOption(key: string, value: any): any {\n switch (key) {\n case 'bellStyle':\n case 'cursorStyle':\n case 'rendererType':\n case 'wordSeparator':\n if (!value) {\n value = DEFAULT_OPTIONS[key];\n }\n break;\n case 'fontWeight':\n case 'fontWeightBold':\n if (typeof value === 'number' && 1 <= value && value <= 1000) {\n // already valid numeric value\n break;\n }\n value = FONT_WEIGHT_OPTIONS.includes(value) ? value : DEFAULT_OPTIONS[key];\n break;\n case 'cursorWidth':\n value = Math.floor(value);\n // Fall through for bounds check\n case 'lineHeight':\n case 'tabStopWidth':\n if (value < 1) {\n throw new Error(`${key} cannot be less than 1, value: ${value}`);\n }\n break;\n case 'minimumContrastRatio':\n value = Math.max(1, Math.min(21, Math.round(value * 10) / 10));\n break;\n case 'scrollback':\n value = Math.min(value, 4294967295);\n if (value < 0) {\n throw new Error(`${key} cannot be less than 0, value: ${value}`);\n }\n break;\n case 'fastScrollSensitivity':\n case 'scrollSensitivity':\n if (value <= 0) {\n throw new Error(`${key} cannot be less than or equal to 0, value: ${value}`);\n }\n case 'rows':\n case 'cols':\n if (!value && value !== 0) {\n throw new Error(`${key} must be numeric, value: ${value}`);\n }\n break;\n }\n return value;\n }\n\n public getOption(key: string): any {\n return this.options[key];\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * This was heavily inspired from microsoft/vscode's dependency injection system (MIT).\n */\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IServiceIdentifier } from 'common/services/Services';\n\nconst DI_TARGET = 'di$target';\nconst DI_DEPENDENCIES = 'di$dependencies';\n\nexport const serviceRegistry: Map> = new Map();\n\nexport function getServiceDependencies(ctor: any): { id: IServiceIdentifier, index: number, optional: boolean }[] {\n return ctor[DI_DEPENDENCIES] || [];\n}\n\nexport function createDecorator(id: string): IServiceIdentifier {\n if (serviceRegistry.has(id)) {\n return serviceRegistry.get(id)!;\n }\n\n const decorator: any = function (target: Function, key: string, index: number): any {\n if (arguments.length !== 3) {\n throw new Error('@IServiceName-decorator can only be used to decorate a parameter');\n }\n\n storeServiceDependency(decorator, target, index);\n };\n\n decorator.toString = () => id;\n\n serviceRegistry.set(id, decorator);\n return decorator;\n}\n\nfunction storeServiceDependency(id: Function, target: Function, index: number): void {\n if ((target as any)[DI_TARGET] === target) {\n (target as any)[DI_DEPENDENCIES].push({ id, index });\n } else {\n (target as any)[DI_DEPENDENCIES] = [{ id, index }];\n (target as any)[DI_TARGET] = target;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IEvent, IEventEmitter } from 'common/EventEmitter';\nimport { IBuffer, IBufferSet } from 'common/buffer/Types';\nimport { IDecPrivateModes, ICoreMouseEvent, CoreMouseEncoding, ICoreMouseProtocol, CoreMouseEventType, ICharset, IWindowOptions, IModes, IAttributeData, ScrollSource, IDisposable, IColorRGB, IColor } from 'common/Types';\nimport { createDecorator } from 'common/services/ServiceRegistry';\nimport { IDecorationOptions, IDecoration } from 'xterm';\n\nexport const IBufferService = createDecorator('BufferService');\nexport interface IBufferService {\n serviceBrand: undefined;\n\n readonly cols: number;\n readonly rows: number;\n readonly buffer: IBuffer;\n readonly buffers: IBufferSet;\n isUserScrolling: boolean;\n onResize: IEvent<{ cols: number, rows: number }>;\n onScroll: IEvent;\n scroll(eraseAttr: IAttributeData, isWrapped?: boolean): void;\n scrollToBottom(): void;\n scrollToTop(): void;\n scrollToLine(line: number): void;\n scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void;\n scrollPages(pageCount: number): void;\n resize(cols: number, rows: number): void;\n reset(): void;\n}\n\nexport const ICoreMouseService = createDecorator('CoreMouseService');\nexport interface ICoreMouseService {\n activeProtocol: string;\n activeEncoding: string;\n areMouseEventsActive: boolean;\n addProtocol(name: string, protocol: ICoreMouseProtocol): void;\n addEncoding(name: string, encoding: CoreMouseEncoding): void;\n reset(): void;\n\n /**\n * Triggers a mouse event to be sent.\n *\n * Returns true if the event passed all protocol restrictions and a report\n * was sent, otherwise false. The return value may be used to decide whether\n * the default event action in the bowser component should be omitted.\n *\n * Note: The method will change values of the given event object\n * to fullfill protocol and encoding restrictions.\n */\n triggerMouseEvent(event: ICoreMouseEvent): boolean;\n\n /**\n * Event to announce changes in mouse tracking.\n */\n onProtocolChange: IEvent;\n\n /**\n * Human readable version of mouse events.\n */\n explainEvents(events: CoreMouseEventType): { [event: string]: boolean };\n}\n\nexport const ICoreService = createDecorator('CoreService');\nexport interface ICoreService {\n serviceBrand: undefined;\n\n /**\n * Initially the cursor will not be visible until the first time the terminal\n * is focused.\n */\n isCursorInitialized: boolean;\n isCursorHidden: boolean;\n\n readonly modes: IModes;\n readonly decPrivateModes: IDecPrivateModes;\n\n readonly onData: IEvent;\n readonly onUserInput: IEvent;\n readonly onBinary: IEvent;\n\n reset(): void;\n\n /**\n * Triggers the onData event in the public API.\n * @param data The data that is being emitted.\n * @param wasFromUser Whether the data originated from the user (as opposed to\n * resulting from parsing incoming data). When true this will also:\n * - Scroll to the bottom of the buffer.s\n * - Fire the `onUserInput` event (so selection can be cleared).\n */\n triggerDataEvent(data: string, wasUserInput?: boolean): void;\n\n /**\n * Triggers the onBinary event in the public API.\n * @param data The data that is being emitted.\n */\n triggerBinaryEvent(data: string): void;\n}\n\nexport const ICharsetService = createDecorator('CharsetService');\nexport interface ICharsetService {\n serviceBrand: undefined;\n\n charset: ICharset | undefined;\n readonly glevel: number;\n\n reset(): void;\n\n /**\n * Set the G level of the terminal.\n * @param g\n */\n setgLevel(g: number): void;\n\n /**\n * Set the charset for the given G level of the terminal.\n * @param g\n * @param charset\n */\n setgCharset(g: number, charset: ICharset | undefined): void;\n}\n\nexport const IDirtyRowService = createDecorator('DirtyRowService');\nexport interface IDirtyRowService {\n serviceBrand: undefined;\n\n readonly start: number;\n readonly end: number;\n\n clearRange(): void;\n markDirty(y: number): void;\n markRangeDirty(y1: number, y2: number): void;\n markAllDirty(): void;\n}\n\nexport interface IServiceIdentifier {\n (...args: any[]): void;\n type: T;\n}\n\nexport interface IBrandedService {\n serviceBrand: undefined;\n}\n\ntype GetLeadingNonServiceArgs =\n Args extends [...IBrandedService[]] ? []\n : Args extends [infer A1, ...IBrandedService[]] ? [A1]\n : Args extends [infer A1, infer A2, ...IBrandedService[]] ? [A1, A2]\n : Args extends [infer A1, infer A2, infer A3, ...IBrandedService[]] ? [A1, A2, A3]\n : Args extends [infer A1, infer A2, infer A3, infer A4, ...IBrandedService[]] ? [A1, A2, A3, A4]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, ...IBrandedService[]] ? [A1, A2, A3, A4, A5]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6, A7]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6, A7, A8]\n : never;\n\nexport const IInstantiationService = createDecorator('InstantiationService');\nexport interface IInstantiationService {\n serviceBrand: undefined;\n\n setService(id: IServiceIdentifier, instance: T): void;\n getService(id: IServiceIdentifier): T | undefined;\n createInstance any, R extends InstanceType>(t: Ctor, ...args: GetLeadingNonServiceArgs>): R;\n}\n\nexport enum LogLevelEnum {\n DEBUG = 0,\n INFO = 1,\n WARN = 2,\n ERROR = 3,\n OFF = 4\n}\n\nexport const ILogService = createDecorator('LogService');\nexport interface ILogService {\n serviceBrand: undefined;\n\n logLevel: LogLevelEnum;\n\n debug(message: any, ...optionalParams: any[]): void;\n info(message: any, ...optionalParams: any[]): void;\n warn(message: any, ...optionalParams: any[]): void;\n error(message: any, ...optionalParams: any[]): void;\n}\n\nexport const IOptionsService = createDecorator('OptionsService');\nexport interface IOptionsService {\n serviceBrand: undefined;\n\n /**\n * Read only access to the raw options object, this is an internal-only fast path for accessing\n * single options without any validation as we trust TypeScript to enforce correct usage\n * internally.\n */\n readonly rawOptions: Readonly;\n readonly options: ITerminalOptions;\n\n readonly onOptionChange: IEvent;\n\n setOption(key: string, value: T): void;\n getOption(key: string): T | undefined;\n}\n\nexport type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number;\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';\n\nexport type RendererType = 'dom' | 'canvas';\n\nexport interface ITerminalOptions {\n allowProposedApi: boolean;\n allowTransparency: boolean;\n altClickMovesCursor: boolean;\n bellSound: string;\n bellStyle: 'none' | 'sound' /* | 'visual' | 'both' */;\n cols: number;\n convertEol: boolean;\n cursorBlink: boolean;\n cursorStyle: 'block' | 'underline' | 'bar';\n cursorWidth: number;\n customGlyphs: boolean;\n disableStdin: boolean;\n drawBoldTextInBrightColors: boolean;\n fastScrollModifier: 'alt' | 'ctrl' | 'shift' | undefined;\n fastScrollSensitivity: number;\n fontSize: number;\n fontFamily: string;\n fontWeight: FontWeight;\n fontWeightBold: FontWeight;\n letterSpacing: number;\n lineHeight: number;\n linkTooltipHoverDuration: number;\n logLevel: LogLevel;\n macOptionIsMeta: boolean;\n macOptionClickForcesSelection: boolean;\n minimumContrastRatio: number;\n rendererType: RendererType;\n rightClickSelectsWord: boolean;\n rows: number;\n screenReaderMode: boolean;\n scrollback: number;\n scrollSensitivity: number;\n tabStopWidth: number;\n theme: ITheme;\n windowsMode: boolean;\n windowOptions: IWindowOptions;\n wordSeparator: string;\n overviewRulerWidth?: number;\n\n [key: string]: any;\n cancelEvents: boolean;\n termName: string;\n}\n\nexport interface ITheme {\n foreground?: string;\n background?: string;\n cursor?: string;\n cursorAccent?: string;\n selection?: string;\n selectionForeground?: string;\n black?: string;\n red?: string;\n green?: string;\n yellow?: string;\n blue?: string;\n magenta?: string;\n cyan?: string;\n white?: string;\n brightBlack?: string;\n brightRed?: string;\n brightGreen?: string;\n brightYellow?: string;\n brightBlue?: string;\n brightMagenta?: string;\n brightCyan?: string;\n brightWhite?: string;\n}\n\nexport const IUnicodeService = createDecorator('UnicodeService');\nexport interface IUnicodeService {\n serviceBrand: undefined;\n /** Register an Unicode version provider. */\n register(provider: IUnicodeVersionProvider): void;\n /** Registered Unicode versions. */\n readonly versions: string[];\n /** Currently active version. */\n activeVersion: string;\n /** Event triggered, when activate version changed. */\n readonly onChange: IEvent;\n\n /**\n * Unicode version dependent\n */\n wcwidth(codepoint: number): number;\n getStringCellWidth(s: string): number;\n}\n\nexport interface IUnicodeVersionProvider {\n readonly version: string;\n wcwidth(ucs: number): 0 | 1 | 2;\n}\n\nexport const IDecorationService = createDecorator('DecorationService');\nexport interface IDecorationService extends IDisposable {\n serviceBrand: undefined;\n readonly decorations: IterableIterator;\n readonly onDecorationRegistered: IEvent;\n readonly onDecorationRemoved: IEvent;\n registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined;\n reset(): void;\n /** Iterates over the decorations at a line (in no particular order). */\n getDecorationsAtLine(line: number): IterableIterator;\n /** Iterates over the decorations at a cell (in no particular order). */\n getDecorationsAtCell(x: number, line: number, layer?: 'bottom' | 'top'): IterableIterator;\n}\nexport interface IInternalDecoration extends IDecoration {\n readonly options: IDecorationOptions;\n readonly backgroundColorRGB: IColor | undefined;\n readonly foregroundColorRGB: IColor | undefined;\n readonly onRenderEmitter: IEventEmitter;\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IUnicodeService, IUnicodeVersionProvider } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { UnicodeV6 } from 'common/input/UnicodeV6';\n\n\nexport class UnicodeService implements IUnicodeService {\n public serviceBrand: any;\n\n private _providers: {[key: string]: IUnicodeVersionProvider} = Object.create(null);\n private _active: string = '';\n private _activeProvider: IUnicodeVersionProvider;\n private _onChange = new EventEmitter();\n public get onChange(): IEvent { return this._onChange.event; }\n\n constructor() {\n const defaultProvider = new UnicodeV6();\n this.register(defaultProvider);\n this._active = defaultProvider.version;\n this._activeProvider = defaultProvider;\n }\n\n public get versions(): string[] {\n return Object.keys(this._providers);\n }\n\n public get activeVersion(): string {\n return this._active;\n }\n\n public set activeVersion(version: string) {\n if (!this._providers[version]) {\n throw new Error(`unknown Unicode version \"${version}\"`);\n }\n this._active = version;\n this._activeProvider = this._providers[version];\n this._onChange.fire(version);\n }\n\n public register(provider: IUnicodeVersionProvider): void {\n this._providers[provider.version] = provider;\n }\n\n /**\n * Unicode version dependent interface.\n */\n public wcwidth(num: number): number {\n return this._activeProvider.wcwidth(num);\n }\n\n public getStringCellWidth(s: string): number {\n let result = 0;\n const length = s.length;\n for (let i = 0; i < length; ++i) {\n let code = s.charCodeAt(i);\n // surrogate pair first\n if (0xD800 <= code && code <= 0xDBFF) {\n if (++i >= length) {\n // this should not happen with strings retrieved from\n // Buffer.translateToString as it converts from UTF-32\n // and therefore always should contain the second part\n // for any other string we still have to handle it somehow:\n // simply treat the lonely surrogate first as a single char (UCS-2 behavior)\n return result + this.wcwidth(code);\n }\n const second = s.charCodeAt(i);\n // convert surrogate pair to high codepoint only for valid second part (UTF-16)\n // otherwise treat them independently (UCS-2 behavior)\n if (0xDC00 <= second && second <= 0xDFFF) {\n code = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n result += this.wcwidth(second);\n }\n }\n result += this.wcwidth(code);\n }\n return result;\n }\n}\n", "// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n", "// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(4389);\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var noOptions = {};\n var nonWS = /[^\\s\\u00a0]/;\n var Pos = CodeMirror.Pos, cmp = CodeMirror.cmpPos;\n\n function firstNonWS(str) {\n var found = str.search(nonWS);\n return found == -1 ? 0 : found;\n }\n\n CodeMirror.commands.toggleComment = function(cm) {\n cm.toggleComment();\n };\n\n CodeMirror.defineExtension(\"toggleComment\", function(options) {\n if (!options) options = noOptions;\n var cm = this;\n var minLine = Infinity, ranges = this.listSelections(), mode = null;\n for (var i = ranges.length - 1; i >= 0; i--) {\n var from = ranges[i].from(), to = ranges[i].to();\n if (from.line >= minLine) continue;\n if (to.line >= minLine) to = Pos(minLine, 0);\n minLine = from.line;\n if (mode == null) {\n if (cm.uncomment(from, to, options)) mode = \"un\";\n else { cm.lineComment(from, to, options); mode = \"line\"; }\n } else if (mode == \"un\") {\n cm.uncomment(from, to, options);\n } else {\n cm.lineComment(from, to, options);\n }\n }\n });\n\n // Rough heuristic to try and detect lines that are part of multi-line string\n function probablyInsideString(cm, pos, line) {\n return /\\bstring\\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\\'\\\"\\`]/.test(line)\n }\n\n function getMode(cm, pos) {\n var mode = cm.getMode()\n return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos)\n }\n\n CodeMirror.defineExtension(\"lineComment\", function(from, to, options) {\n if (!options) options = noOptions;\n var self = this, mode = getMode(self, from);\n var firstLine = self.getLine(from.line);\n if (firstLine == null || probablyInsideString(self, from, firstLine)) return;\n\n var commentString = options.lineComment || mode.lineComment;\n if (!commentString) {\n if (options.blockCommentStart || mode.blockCommentStart) {\n options.fullLines = true;\n self.blockComment(from, to, options);\n }\n return;\n }\n\n var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);\n var pad = options.padding == null ? \" \" : options.padding;\n var blankLines = options.commentBlankLines || from.line == to.line;\n\n self.operation(function() {\n if (options.indent) {\n var baseString = null;\n for (var i = from.line; i < end; ++i) {\n var line = self.getLine(i);\n var whitespace = line.search(nonWS) === -1 ? line : line.slice(0, firstNonWS(line));\n if (baseString == null || baseString.length > whitespace.length) {\n baseString = whitespace;\n }\n }\n for (var i = from.line; i < end; ++i) {\n var line = self.getLine(i), cut = baseString.length;\n if (!blankLines && !nonWS.test(line)) continue;\n if (line.slice(0, cut) != baseString) cut = firstNonWS(line);\n self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));\n }\n } else {\n for (var i = from.line; i < end; ++i) {\n if (blankLines || nonWS.test(self.getLine(i)))\n self.replaceRange(commentString + pad, Pos(i, 0));\n }\n }\n });\n });\n\n CodeMirror.defineExtension(\"blockComment\", function(from, to, options) {\n if (!options) options = noOptions;\n var self = this, mode = getMode(self, from);\n var startString = options.blockCommentStart || mode.blockCommentStart;\n var endString = options.blockCommentEnd || mode.blockCommentEnd;\n if (!startString || !endString) {\n if ((options.lineComment || mode.lineComment) && options.fullLines != false)\n self.lineComment(from, to, options);\n return;\n }\n if (/\\bcomment\\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return\n\n var end = Math.min(to.line, self.lastLine());\n if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;\n\n var pad = options.padding == null ? \" \" : options.padding;\n if (from.line > end) return;\n\n self.operation(function() {\n if (options.fullLines != false) {\n var lastLineHasText = nonWS.test(self.getLine(end));\n self.replaceRange(pad + endString, Pos(end));\n self.replaceRange(startString + pad, Pos(from.line, 0));\n var lead = options.blockCommentLead || mode.blockCommentLead;\n if (lead != null) for (var i = from.line + 1; i <= end; ++i)\n if (i != end || lastLineHasText)\n self.replaceRange(lead + pad, Pos(i, 0));\n } else {\n var atCursor = cmp(self.getCursor(\"to\"), to) == 0, empty = !self.somethingSelected()\n self.replaceRange(endString, to);\n if (atCursor) self.setSelection(empty ? to : self.getCursor(\"from\"), to)\n self.replaceRange(startString, from);\n }\n });\n });\n\n CodeMirror.defineExtension(\"uncomment\", function(from, to, options) {\n if (!options) options = noOptions;\n var self = this, mode = getMode(self, from);\n var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);\n\n // Try finding line comments\n var lineString = options.lineComment || mode.lineComment, lines = [];\n var pad = options.padding == null ? \" \" : options.padding, didSomething;\n lineComment: {\n if (!lineString) break lineComment;\n for (var i = start; i <= end; ++i) {\n var line = self.getLine(i);\n var found = line.indexOf(lineString);\n if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;\n if (found == -1 && nonWS.test(line)) break lineComment;\n if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;\n lines.push(line);\n }\n self.operation(function() {\n for (var i = start; i <= end; ++i) {\n var line = lines[i - start];\n var pos = line.indexOf(lineString), endPos = pos + lineString.length;\n if (pos < 0) continue;\n if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;\n didSomething = true;\n self.replaceRange(\"\", Pos(i, pos), Pos(i, endPos));\n }\n });\n if (didSomething) return true;\n }\n\n // Try block comments\n var startString = options.blockCommentStart || mode.blockCommentStart;\n var endString = options.blockCommentEnd || mode.blockCommentEnd;\n if (!startString || !endString) return false;\n var lead = options.blockCommentLead || mode.blockCommentLead;\n var startLine = self.getLine(start), open = startLine.indexOf(startString)\n if (open == -1) return false\n var endLine = end == start ? startLine : self.getLine(end)\n var close = endLine.indexOf(endString, end == start ? open + startString.length : 0);\n var insideStart = Pos(start, open + 1), insideEnd = Pos(end, close + 1)\n if (close == -1 ||\n !/comment/.test(self.getTokenTypeAt(insideStart)) ||\n !/comment/.test(self.getTokenTypeAt(insideEnd)) ||\n self.getRange(insideStart, insideEnd, \"\\n\").indexOf(endString) > -1)\n return false;\n\n // Avoid killing block comments completely outside the selection.\n // Positions of the last startString before the start of the selection, and the first endString after it.\n var lastStart = startLine.lastIndexOf(startString, from.ch);\n var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length);\n if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false;\n // Positions of the first endString after the end of the selection, and the last startString before it.\n firstEnd = endLine.indexOf(endString, to.ch);\n var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch);\n lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart;\n if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false;\n\n self.operation(function() {\n self.replaceRange(\"\", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),\n Pos(end, close + endString.length));\n var openEnd = open + startString.length;\n if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;\n self.replaceRange(\"\", Pos(start, open), Pos(start, openEnd));\n if (lead) for (var i = start + 1; i <= end; ++i) {\n var line = self.getLine(i), found = line.indexOf(lead);\n if (found == -1 || nonWS.test(line.slice(0, found))) continue;\n var foundEnd = found + lead.length;\n if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;\n self.replaceRange(\"\", Pos(i, found), Pos(i, foundEnd));\n }\n });\n return true;\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var nonspace = /\\S/g;\n var repeat = String.prototype.repeat || function (n) { return Array(n + 1).join(this); };\n function continueComment(cm) {\n if (cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n var ranges = cm.listSelections(), mode, inserts = [];\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].head\n if (!/\\bcomment\\b/.test(cm.getTokenTypeAt(pos))) return CodeMirror.Pass;\n var modeHere = cm.getModeAt(pos)\n if (!mode) mode = modeHere;\n else if (mode != modeHere) return CodeMirror.Pass;\n\n var insert = null, line, found;\n var blockStart = mode.blockCommentStart, lineCmt = mode.lineComment;\n if (blockStart && mode.blockCommentContinue) {\n line = cm.getLine(pos.line);\n var end = line.lastIndexOf(mode.blockCommentEnd, pos.ch - mode.blockCommentEnd.length);\n // 1. if this block comment ended\n // 2. if this is actually inside a line comment\n if (end != -1 && end == pos.ch - mode.blockCommentEnd.length ||\n lineCmt && (found = line.lastIndexOf(lineCmt, pos.ch - 1)) > -1 &&\n /\\bcomment\\b/.test(cm.getTokenTypeAt({line: pos.line, ch: found + 1}))) {\n // ...then don't continue it\n } else if (pos.ch >= blockStart.length &&\n (found = line.lastIndexOf(blockStart, pos.ch - blockStart.length)) > -1 &&\n found > end) {\n // reuse the existing leading spaces/tabs/mixed\n // or build the correct indent using CM's tab/indent options\n if (nonspaceAfter(0, line) >= found) {\n insert = line.slice(0, found);\n } else {\n var tabSize = cm.options.tabSize, numTabs;\n found = CodeMirror.countColumn(line, found, tabSize);\n insert = !cm.options.indentWithTabs ? repeat.call(\" \", found) :\n repeat.call(\"\\t\", (numTabs = Math.floor(found / tabSize))) +\n repeat.call(\" \", found - tabSize * numTabs);\n }\n } else if ((found = line.indexOf(mode.blockCommentContinue)) > -1 &&\n found <= pos.ch &&\n found <= nonspaceAfter(0, line)) {\n insert = line.slice(0, found);\n }\n if (insert != null) insert += mode.blockCommentContinue\n }\n if (insert == null && lineCmt && continueLineCommentEnabled(cm)) {\n if (line == null) line = cm.getLine(pos.line);\n found = line.indexOf(lineCmt);\n // cursor at pos 0, line comment also at pos 0 => shift it down, don't continue\n if (!pos.ch && !found) insert = \"\";\n // continue only if the line starts with an optional space + line comment\n else if (found > -1 && nonspaceAfter(0, line) >= found) {\n // don't continue if there's only space(s) after cursor or the end of the line\n insert = nonspaceAfter(pos.ch, line) > -1;\n // but always continue if the next line starts with a line comment too\n if (!insert) {\n var next = cm.getLine(pos.line + 1) || '',\n nextFound = next.indexOf(lineCmt);\n insert = nextFound > -1 && nonspaceAfter(0, next) >= nextFound || null;\n }\n if (insert) {\n insert = line.slice(0, found) + lineCmt +\n line.slice(found + lineCmt.length).match(/^\\s*/)[0];\n }\n }\n }\n if (insert == null) return CodeMirror.Pass;\n inserts[i] = \"\\n\" + insert;\n }\n\n cm.operation(function() {\n for (var i = ranges.length - 1; i >= 0; i--)\n cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), \"+insert\");\n });\n }\n\n function nonspaceAfter(ch, str) {\n nonspace.lastIndex = ch;\n var m = nonspace.exec(str);\n return m ? m.index : -1;\n }\n\n function continueLineCommentEnabled(cm) {\n var opt = cm.getOption(\"continueComments\");\n if (opt && typeof opt == \"object\")\n return opt.continueLineComment !== false;\n return true;\n }\n\n CodeMirror.defineOption(\"continueComments\", null, function(cm, val, prev) {\n if (prev && prev != CodeMirror.Init)\n cm.removeKeyMap(\"continueComment\");\n if (val) {\n var key = \"Enter\";\n if (typeof val == \"string\")\n key = val;\n else if (typeof val == \"object\" && val.key)\n key = val.key;\n var map = {name: \"continueComment\"};\n map[key] = continueComment;\n cm.addKeyMap(map);\n }\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n CodeMirror.defineOption(\"placeholder\", \"\", function(cm, val, old) {\n var prev = old && old != CodeMirror.Init;\n if (val && !prev) {\n cm.on(\"blur\", onBlur);\n cm.on(\"change\", onChange);\n cm.on(\"swapDoc\", onChange);\n CodeMirror.on(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose = function() { onComposition(cm) })\n onChange(cm);\n } else if (!val && prev) {\n cm.off(\"blur\", onBlur);\n cm.off(\"change\", onChange);\n cm.off(\"swapDoc\", onChange);\n CodeMirror.off(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose)\n clearPlaceholder(cm);\n var wrapper = cm.getWrapperElement();\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\");\n }\n\n if (val && !cm.hasFocus()) onBlur(cm);\n });\n\n function clearPlaceholder(cm) {\n if (cm.state.placeholder) {\n cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);\n cm.state.placeholder = null;\n }\n }\n function setPlaceholder(cm) {\n clearPlaceholder(cm);\n var elt = cm.state.placeholder = document.createElement(\"pre\");\n elt.style.cssText = \"height: 0; overflow: visible\";\n elt.style.direction = cm.getOption(\"direction\");\n elt.className = \"CodeMirror-placeholder CodeMirror-line-like\";\n var placeHolder = cm.getOption(\"placeholder\")\n if (typeof placeHolder == \"string\") placeHolder = document.createTextNode(placeHolder)\n elt.appendChild(placeHolder)\n cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);\n }\n\n function onComposition(cm) {\n setTimeout(function() {\n var empty = false\n if (cm.lineCount() == 1) {\n var input = cm.getInputField()\n empty = input.nodeName == \"TEXTAREA\" ? !cm.getLine(0).length\n : !/[^\\u200b]/.test(input.querySelector(\".CodeMirror-line\").textContent)\n }\n if (empty) setPlaceholder(cm)\n else clearPlaceholder(cm)\n }, 20)\n }\n\n function onBlur(cm) {\n if (isEmpty(cm)) setPlaceholder(cm);\n }\n function onChange(cm) {\n var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\") + (empty ? \" CodeMirror-empty\" : \"\");\n\n if (empty) setPlaceholder(cm);\n else clearPlaceholder(cm);\n }\n\n function isEmpty(cm) {\n return (cm.lineCount() === 1) && (cm.getLine(0) === \"\");\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var defaults = {\n pairs: \"()[]{}''\\\"\\\"\",\n closeBefore: \")]}'\\\":;>\",\n triples: \"\",\n explode: \"[]{}\"\n };\n\n var Pos = CodeMirror.Pos;\n\n CodeMirror.defineOption(\"autoCloseBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.removeKeyMap(keyMap);\n cm.state.closeBrackets = null;\n }\n if (val) {\n ensureBound(getOption(val, \"pairs\"))\n cm.state.closeBrackets = val;\n cm.addKeyMap(keyMap);\n }\n });\n\n function getOption(conf, name) {\n if (name == \"pairs\" && typeof conf == \"string\") return conf;\n if (typeof conf == \"object\" && conf[name] != null) return conf[name];\n return defaults[name];\n }\n\n var keyMap = {Backspace: handleBackspace, Enter: handleEnter};\n function ensureBound(chars) {\n for (var i = 0; i < chars.length; i++) {\n var ch = chars.charAt(i), key = \"'\" + ch + \"'\"\n if (!keyMap[key]) keyMap[key] = handler(ch)\n }\n }\n ensureBound(defaults.pairs + \"`\")\n\n function handler(ch) {\n return function(cm) { return handleChar(cm, ch); };\n }\n\n function getConfig(cm) {\n var deflt = cm.state.closeBrackets;\n if (!deflt || deflt.override) return deflt;\n var mode = cm.getModeAt(cm.getCursor());\n return mode.closeBrackets || deflt;\n }\n\n function handleBackspace(cm) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n for (var i = ranges.length - 1; i >= 0; i--) {\n var cur = ranges[i].head;\n cm.replaceRange(\"\", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), \"+delete\");\n }\n }\n\n function handleEnter(cm) {\n var conf = getConfig(cm);\n var explode = conf && getOption(conf, \"explode\");\n if (!explode || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n cm.operation(function() {\n var linesep = cm.lineSeparator() || \"\\n\";\n cm.replaceSelection(linesep + linesep, null);\n moveSel(cm, -1)\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var line = ranges[i].head.line;\n cm.indentLine(line, null, true);\n cm.indentLine(line + 1, null, true);\n }\n });\n }\n\n function moveSel(cm, dir) {\n var newRanges = [], ranges = cm.listSelections(), primary = 0\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (range.head == cm.getCursor()) primary = i\n var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1}\n newRanges.push({anchor: pos, head: pos})\n }\n cm.setSelections(newRanges, primary)\n }\n\n function contractSelection(sel) {\n var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;\n return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),\n head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};\n }\n\n function handleChar(cm, ch) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var pos = pairs.indexOf(ch);\n if (pos == -1) return CodeMirror.Pass;\n\n var closeBefore = getOption(conf,\"closeBefore\");\n\n var triples = getOption(conf, \"triples\");\n\n var identical = pairs.charAt(pos + 1) == ch;\n var ranges = cm.listSelections();\n var opening = pos % 2 == 0;\n\n var type;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], cur = range.head, curType;\n var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));\n if (opening && !range.empty()) {\n curType = \"surround\";\n } else if ((identical || !opening) && next == ch) {\n if (identical && stringStartsAfter(cm, cur))\n curType = \"both\";\n else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)\n curType = \"skipThree\";\n else\n curType = \"skip\";\n } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&\n cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {\n if (cur.ch > 2 && /\\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;\n curType = \"addFour\";\n } else if (identical) {\n var prev = cur.ch == 0 ? \" \" : cm.getRange(Pos(cur.line, cur.ch - 1), cur)\n if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = \"both\";\n else return CodeMirror.Pass;\n } else if (opening && (next.length === 0 || /\\s/.test(next) || closeBefore.indexOf(next) > -1)) {\n curType = \"both\";\n } else {\n return CodeMirror.Pass;\n }\n if (!type) type = curType;\n else if (type != curType) return CodeMirror.Pass;\n }\n\n var left = pos % 2 ? pairs.charAt(pos - 1) : ch;\n var right = pos % 2 ? ch : pairs.charAt(pos + 1);\n cm.operation(function() {\n if (type == \"skip\") {\n moveSel(cm, 1)\n } else if (type == \"skipThree\") {\n moveSel(cm, 3)\n } else if (type == \"surround\") {\n var sels = cm.getSelections();\n for (var i = 0; i < sels.length; i++)\n sels[i] = left + sels[i] + right;\n cm.replaceSelections(sels, \"around\");\n sels = cm.listSelections().slice();\n for (var i = 0; i < sels.length; i++)\n sels[i] = contractSelection(sels[i]);\n cm.setSelections(sels);\n } else if (type == \"both\") {\n cm.replaceSelection(left + right, null);\n cm.triggerElectric(left + right);\n moveSel(cm, -1)\n } else if (type == \"addFour\") {\n cm.replaceSelection(left + left + left + left, \"before\");\n moveSel(cm, 1)\n }\n });\n }\n\n function charsAround(cm, pos) {\n var str = cm.getRange(Pos(pos.line, pos.ch - 1),\n Pos(pos.line, pos.ch + 1));\n return str.length == 2 ? str : null;\n }\n\n function stringStartsAfter(cm, pos) {\n var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))\n return /\\bstring/.test(token.type) && token.start == pos.ch &&\n (pos.ch == 0 || !/\\bstring/.test(cm.getTokenTypeAt(pos)))\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\", \"<\": \">>\", \">\": \"<<\"};\n\n function bracketRegex(config) {\n return config && config.bracketRegex || /[(){}[\\]]/\n }\n\n function findMatchingBracket(cm, where, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var afterCursor = config && config.afterCursor\n if (afterCursor == null)\n afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)\n var re = bracketRegex(config)\n\n // A cursor is defined as between two characters, but in in vim command mode\n // (i.e. not insert mode), the cursor is visually represented as a\n // highlighted box on top of the 2nd character. Otherwise, we allow matches\n // from before or after the cursor.\n var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||\n re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = bracketRegex(config)\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined ||\n (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || \"\") == (style || \"\"))) {\n var match = matching[ch];\n if (match && (match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000,\n highlightNonMatching = config && config.highlightNonMatching;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);\n if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) {\n var style = match.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n }\n }\n\n if (marks.length) {\n // Kludge to work around the IE bug from issue #1193, where text\n // input stops going to the textarea whenever this fires.\n if (ie_lt8 && cm.state.focused) cm.focus();\n\n var clear = function() {\n cm.operation(function() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n });\n };\n if (autoclear) setTimeout(clear, 800);\n else return clear;\n }\n }\n\n function doMatchBrackets(cm) {\n cm.operation(function() {\n if (cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n });\n }\n\n function clearHighlighted(cm) {\n if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n }\n\n CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.off(\"cursorActivity\", doMatchBrackets);\n cm.off(\"focus\", doMatchBrackets)\n cm.off(\"blur\", clearHighlighted)\n clearHighlighted(cm);\n }\n if (val) {\n cm.state.matchBrackets = typeof val == \"object\" ? val : {};\n cm.on(\"cursorActivity\", doMatchBrackets);\n cm.on(\"focus\", doMatchBrackets)\n cm.on(\"blur\", clearHighlighted)\n }\n });\n\n CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n CodeMirror.defineExtension(\"findMatchingBracket\", function(pos, config, oldConfig){\n // Backwards-compatibility kludge\n if (oldConfig || typeof config == \"boolean\") {\n if (!oldConfig) {\n config = config ? {strict: true} : null\n } else {\n oldConfig.strict = config\n config = oldConfig\n }\n }\n return findMatchingBracket(this, pos, config)\n });\n CodeMirror.defineExtension(\"scanForBracket\", function(pos, dir, style, config){\n return scanForBracket(this, pos, dir, style, config);\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"))\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod)\n else // Plain browser env\n mod(CodeMirror)\n})(function(CodeMirror) {\n \"use strict\"\n var Pos = CodeMirror.Pos\n\n function regexpFlags(regexp) {\n var flags = regexp.flags\n return flags != null ? flags : (regexp.ignoreCase ? \"i\" : \"\")\n + (regexp.global ? \"g\" : \"\")\n + (regexp.multiline ? \"m\" : \"\")\n }\n\n function ensureFlags(regexp, flags) {\n var current = regexpFlags(regexp), target = current\n for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)\n target += flags.charAt(i)\n return current == target ? regexp : new RegExp(regexp.source, target)\n }\n\n function maybeMultiline(regexp) {\n return /\\\\s|\\\\n|\\n|\\\\W|\\\\D|\\[\\^/.test(regexp.source)\n }\n\n function searchRegexpForward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {\n regexp.lastIndex = ch\n var string = doc.getLine(line), match = regexp.exec(string)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpForwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)\n\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunk = 1\n for (var line = start.line, last = doc.lastLine(); line <= last;) {\n // This grows the search buffer in exponentially-sized chunks\n // between matches, so that nearby matches are fast and don't\n // require concatenating the whole document (in case we're\n // searching for something that has tons of matches), but at the\n // same time, the amount of retries is limited.\n for (var i = 0; i < chunk; i++) {\n if (line > last) break\n var curLine = doc.getLine(line++)\n string = string == null ? curLine : string + \"\\n\" + curLine\n }\n chunk = chunk * 2\n regexp.lastIndex = start.ch\n var match = regexp.exec(string)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n function lastMatchIn(string, regexp, endMargin) {\n var match, from = 0\n while (from <= string.length) {\n regexp.lastIndex = from\n var newMatch = regexp.exec(string)\n if (!newMatch) break\n var end = newMatch.index + newMatch[0].length\n if (end > string.length - endMargin) break\n if (!match || end > match.index + match[0].length)\n match = newMatch\n from = newMatch.index + 1\n }\n return match\n }\n\n function searchRegexpBackward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {\n var string = doc.getLine(line)\n var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpBackwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start)\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunkSize = 1, endMargin = doc.getLine(start.line).length - start.ch\n for (var line = start.line, first = doc.firstLine(); line >= first;) {\n for (var i = 0; i < chunkSize && line >= first; i++) {\n var curLine = doc.getLine(line--)\n string = string == null ? curLine : curLine + \"\\n\" + string\n }\n chunkSize *= 2\n\n var match = lastMatchIn(string, regexp, endMargin)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = line + before.length, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n var doFold, noFold\n if (String.prototype.normalize) {\n doFold = function(str) { return str.normalize(\"NFD\").toLowerCase() }\n noFold = function(str) { return str.normalize(\"NFD\") }\n } else {\n doFold = function(str) { return str.toLowerCase() }\n noFold = function(str) { return str }\n }\n\n // Maps a position in a case-folded line back to a position in the original line\n // (compensating for codepoints increasing in number during folding)\n function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }\n\n function searchStringForward(doc, query, start, caseFold) {\n // Empty string would match anything and never progress, so we\n // define it to match nothing instead.\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) {\n var orig = doc.getLine(line).slice(ch), string = fold(orig)\n if (lines.length == 1) {\n var found = string.indexOf(lines[0])\n if (found == -1) continue search\n var start = adjustPos(orig, string, found, fold) + ch\n return {from: Pos(line, adjustPos(orig, string, found, fold) + ch),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)}\n } else {\n var cutFrom = string.length - lines[0].length\n if (string.slice(cutFrom) != lines[0]) continue search\n for (var i = 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(line + i)) != lines[i]) continue search\n var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1]\n if (endString.slice(0, lastLine.length) != lastLine) continue search\n return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch),\n to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))}\n }\n }\n }\n\n function searchStringBackward(doc, query, start, caseFold) {\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) {\n var orig = doc.getLine(line)\n if (ch > -1) orig = orig.slice(0, ch)\n var string = fold(orig)\n if (lines.length == 1) {\n var found = string.lastIndexOf(lines[0])\n if (found == -1) continue search\n return {from: Pos(line, adjustPos(orig, string, found, fold)),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))}\n } else {\n var lastLine = lines[lines.length - 1]\n if (string.slice(0, lastLine.length) != lastLine) continue search\n for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(start + i)) != lines[i]) continue search\n var top = doc.getLine(line + 1 - lines.length), topString = fold(top)\n if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search\n return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)),\n to: Pos(line, adjustPos(orig, string, lastLine.length, fold))}\n }\n }\n }\n\n function SearchCursor(doc, query, pos, options) {\n this.atOccurrence = false\n this.afterEmptyMatch = false\n this.doc = doc\n pos = pos ? doc.clipPos(pos) : Pos(0, 0)\n this.pos = {from: pos, to: pos}\n\n var caseFold\n if (typeof options == \"object\") {\n caseFold = options.caseFold\n } else { // Backwards compat for when caseFold was the 4th argument\n caseFold = options\n options = null\n }\n\n if (typeof query == \"string\") {\n if (caseFold == null) caseFold = false\n this.matches = function(reverse, pos) {\n return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)\n }\n } else {\n query = ensureFlags(query, \"gm\")\n if (!options || options.multiline !== false)\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)\n }\n else\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos)\n }\n }\n }\n\n SearchCursor.prototype = {\n findNext: function() {return this.find(false)},\n findPrevious: function() {return this.find(true)},\n\n find: function(reverse) {\n var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);\n if (this.afterEmptyMatch && this.atOccurrence) {\n // do not return the same 0 width match twice\n head = Pos(head.line, head.ch)\n if (reverse) {\n head.ch--;\n if (head.ch < 0) {\n head.line--;\n head.ch = (this.doc.getLine(head.line) || \"\").length;\n }\n } else {\n head.ch++;\n if (head.ch > (this.doc.getLine(head.line) || \"\").length) {\n head.ch = 0;\n head.line++;\n }\n }\n if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) {\n return this.atOccurrence = false\n }\n }\n var result = this.matches(reverse, head)\n this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0\n\n if (result) {\n this.pos = result\n this.atOccurrence = true\n return this.pos.match || true\n } else {\n var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0)\n this.pos = {from: end, to: end}\n return this.atOccurrence = false\n }\n },\n\n from: function() {if (this.atOccurrence) return this.pos.from},\n to: function() {if (this.atOccurrence) return this.pos.to},\n\n replace: function(newText, origin) {\n if (!this.atOccurrence) return\n var lines = CodeMirror.splitLines(newText)\n this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin)\n this.pos.to = Pos(this.pos.from.line + lines.length - 1,\n lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0))\n }\n }\n\n CodeMirror.defineExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this.doc, query, pos, caseFold)\n })\n CodeMirror.defineDocExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this, query, pos, caseFold)\n })\n\n CodeMirror.defineExtension(\"selectMatches\", function(query, caseFold) {\n var ranges = []\n var cur = this.getSearchCursor(query, this.getCursor(\"from\"), caseFold)\n while (cur.findNext()) {\n if (CodeMirror.cmpPos(cur.to(), this.getCursor(\"to\")) > 0) break\n ranges.push({anchor: cur.from(), head: cur.to()})\n }\n if (ranges.length)\n this.setSelections(ranges, 0)\n })\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// A rough approximation of Sublime Text's keybindings\n// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"), require(\"../addon/search/searchcursor\"), require(\"../addon/edit/matchbrackets\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../lib/codemirror\", \"../addon/search/searchcursor\", \"../addon/edit/matchbrackets\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var cmds = CodeMirror.commands;\n var Pos = CodeMirror.Pos;\n\n // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that.\n function findPosSubword(doc, start, dir) {\n if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1));\n var line = doc.getLine(start.line);\n if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0));\n var state = \"start\", type, startPos = start.ch;\n for (var pos = startPos, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) {\n var next = line.charAt(dir < 0 ? pos - 1 : pos);\n var cat = next != \"_\" && CodeMirror.isWordChar(next) ? \"w\" : \"o\";\n if (cat == \"w\" && next.toUpperCase() == next) cat = \"W\";\n if (state == \"start\") {\n if (cat != \"o\") { state = \"in\"; type = cat; }\n else startPos = pos + dir\n } else if (state == \"in\") {\n if (type != cat) {\n if (type == \"w\" && cat == \"W\" && dir < 0) pos--;\n if (type == \"W\" && cat == \"w\" && dir > 0) { // From uppercase to lowercase\n if (pos == startPos + 1) { type = \"w\"; continue; }\n else pos--;\n }\n break;\n }\n }\n }\n return Pos(start.line, pos);\n }\n\n function moveSubword(cm, dir) {\n cm.extendSelectionsBy(function(range) {\n if (cm.display.shift || cm.doc.extend || range.empty())\n return findPosSubword(cm.doc, range.head, dir);\n else\n return dir < 0 ? range.from() : range.to();\n });\n }\n\n cmds.goSubwordLeft = function(cm) { moveSubword(cm, -1); };\n cmds.goSubwordRight = function(cm) { moveSubword(cm, 1); };\n\n cmds.scrollLineUp = function(cm) {\n var info = cm.getScrollInfo();\n if (!cm.somethingSelected()) {\n var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, \"local\");\n if (cm.getCursor().line >= visibleBottomLine)\n cm.execCommand(\"goLineUp\");\n }\n cm.scrollTo(null, info.top - cm.defaultTextHeight());\n };\n cmds.scrollLineDown = function(cm) {\n var info = cm.getScrollInfo();\n if (!cm.somethingSelected()) {\n var visibleTopLine = cm.lineAtHeight(info.top, \"local\")+1;\n if (cm.getCursor().line <= visibleTopLine)\n cm.execCommand(\"goLineDown\");\n }\n cm.scrollTo(null, info.top + cm.defaultTextHeight());\n };\n\n cmds.splitSelectionByLine = function(cm) {\n var ranges = cm.listSelections(), lineRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var from = ranges[i].from(), to = ranges[i].to();\n for (var line = from.line; line <= to.line; ++line)\n if (!(to.line > from.line && line == to.line && to.ch == 0))\n lineRanges.push({anchor: line == from.line ? from : Pos(line, 0),\n head: line == to.line ? to : Pos(line)});\n }\n cm.setSelections(lineRanges, 0);\n };\n\n cmds.singleSelectionTop = function(cm) {\n var range = cm.listSelections()[0];\n cm.setSelection(range.anchor, range.head, {scroll: false});\n };\n\n cmds.selectLine = function(cm) {\n var ranges = cm.listSelections(), extended = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n extended.push({anchor: Pos(range.from().line, 0),\n head: Pos(range.to().line + 1, 0)});\n }\n cm.setSelections(extended);\n };\n\n function insertLine(cm, above) {\n if (cm.isReadOnly()) return CodeMirror.Pass\n cm.operation(function() {\n var len = cm.listSelections().length, newSelection = [], last = -1;\n for (var i = 0; i < len; i++) {\n var head = cm.listSelections()[i].head;\n if (head.line <= last) continue;\n var at = Pos(head.line + (above ? 0 : 1), 0);\n cm.replaceRange(\"\\n\", at, null, \"+insertLine\");\n cm.indentLine(at.line, null, true);\n newSelection.push({head: at, anchor: at});\n last = head.line + 1;\n }\n cm.setSelections(newSelection);\n });\n cm.execCommand(\"indentAuto\");\n }\n\n cmds.insertLineAfter = function(cm) { return insertLine(cm, false); };\n\n cmds.insertLineBefore = function(cm) { return insertLine(cm, true); };\n\n function wordAt(cm, pos) {\n var start = pos.ch, end = start, line = cm.getLine(pos.line);\n while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start;\n while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end;\n return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)};\n }\n\n cmds.selectNextOccurrence = function(cm) {\n var from = cm.getCursor(\"from\"), to = cm.getCursor(\"to\");\n var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel;\n if (CodeMirror.cmpPos(from, to) == 0) {\n var word = wordAt(cm, from);\n if (!word.word) return;\n cm.setSelection(word.from, word.to);\n fullWord = true;\n } else {\n var text = cm.getRange(from, to);\n var query = fullWord ? new RegExp(\"\\\\b\" + text + \"\\\\b\") : text;\n var cur = cm.getSearchCursor(query, to);\n var found = cur.findNext();\n if (!found) {\n cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0));\n found = cur.findNext();\n }\n if (!found || isSelectedRange(cm.listSelections(), cur.from(), cur.to())) return\n cm.addSelection(cur.from(), cur.to());\n }\n if (fullWord)\n cm.state.sublimeFindFullWord = cm.doc.sel;\n };\n\n cmds.skipAndSelectNextOccurrence = function(cm) {\n var prevAnchor = cm.getCursor(\"anchor\"), prevHead = cm.getCursor(\"head\");\n cmds.selectNextOccurrence(cm);\n if (CodeMirror.cmpPos(prevAnchor, prevHead) != 0) {\n cm.doc.setSelections(cm.doc.listSelections()\n .filter(function (sel) {\n return sel.anchor != prevAnchor || sel.head != prevHead;\n }));\n }\n }\n\n function addCursorToSelection(cm, dir) {\n var ranges = cm.listSelections(), newRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var newAnchor = cm.findPosV(\n range.anchor, dir, \"line\", range.anchor.goalColumn);\n var newHead = cm.findPosV(\n range.head, dir, \"line\", range.head.goalColumn);\n newAnchor.goalColumn = range.anchor.goalColumn != null ?\n range.anchor.goalColumn : cm.cursorCoords(range.anchor, \"div\").left;\n newHead.goalColumn = range.head.goalColumn != null ?\n range.head.goalColumn : cm.cursorCoords(range.head, \"div\").left;\n var newRange = {anchor: newAnchor, head: newHead};\n newRanges.push(range);\n newRanges.push(newRange);\n }\n cm.setSelections(newRanges);\n }\n cmds.addCursorToPrevLine = function(cm) { addCursorToSelection(cm, -1); };\n cmds.addCursorToNextLine = function(cm) { addCursorToSelection(cm, 1); };\n\n function isSelectedRange(ranges, from, to) {\n for (var i = 0; i < ranges.length; i++)\n if (CodeMirror.cmpPos(ranges[i].from(), from) == 0 &&\n CodeMirror.cmpPos(ranges[i].to(), to) == 0) return true\n return false\n }\n\n var mirror = \"(){}[]\";\n function selectBetweenBrackets(cm) {\n var ranges = cm.listSelections(), newRanges = []\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], pos = range.head, opening = cm.scanForBracket(pos, -1);\n if (!opening) return false;\n for (;;) {\n var closing = cm.scanForBracket(pos, 1);\n if (!closing) return false;\n if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {\n var startPos = Pos(opening.pos.line, opening.pos.ch + 1);\n if (CodeMirror.cmpPos(startPos, range.from()) == 0 &&\n CodeMirror.cmpPos(closing.pos, range.to()) == 0) {\n opening = cm.scanForBracket(opening.pos, -1);\n if (!opening) return false;\n } else {\n newRanges.push({anchor: startPos, head: closing.pos});\n break;\n }\n }\n pos = Pos(closing.pos.line, closing.pos.ch + 1);\n }\n }\n cm.setSelections(newRanges);\n return true;\n }\n\n cmds.selectScope = function(cm) {\n selectBetweenBrackets(cm) || cm.execCommand(\"selectAll\");\n };\n cmds.selectBetweenBrackets = function(cm) {\n if (!selectBetweenBrackets(cm)) return CodeMirror.Pass;\n };\n\n function puncType(type) {\n return !type ? null : /\\bpunctuation\\b/.test(type) ? type : undefined\n }\n\n cmds.goToBracket = function(cm) {\n cm.extendSelectionsBy(function(range) {\n var next = cm.scanForBracket(range.head, 1, puncType(cm.getTokenTypeAt(range.head)));\n if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos;\n var prev = cm.scanForBracket(range.head, -1, puncType(cm.getTokenTypeAt(Pos(range.head.line, range.head.ch + 1))));\n return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head;\n });\n };\n\n cmds.swapLineUp = function(cm) {\n if (cm.isReadOnly()) return CodeMirror.Pass\n var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], from = range.from().line - 1, to = range.to().line;\n newSels.push({anchor: Pos(range.anchor.line - 1, range.anchor.ch),\n head: Pos(range.head.line - 1, range.head.ch)});\n if (range.to().ch == 0 && !range.empty()) --to;\n if (from > at) linesToMove.push(from, to);\n else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;\n at = to;\n }\n cm.operation(function() {\n for (var i = 0; i < linesToMove.length; i += 2) {\n var from = linesToMove[i], to = linesToMove[i + 1];\n var line = cm.getLine(from);\n cm.replaceRange(\"\", Pos(from, 0), Pos(from + 1, 0), \"+swapLine\");\n if (to > cm.lastLine())\n cm.replaceRange(\"\\n\" + line, Pos(cm.lastLine()), null, \"+swapLine\");\n else\n cm.replaceRange(line + \"\\n\", Pos(to, 0), null, \"+swapLine\");\n }\n cm.setSelections(newSels);\n cm.scrollIntoView();\n });\n };\n\n cmds.swapLineDown = function(cm) {\n if (cm.isReadOnly()) return CodeMirror.Pass\n var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1;\n for (var i = ranges.length - 1; i >= 0; i--) {\n var range = ranges[i], from = range.to().line + 1, to = range.from().line;\n if (range.to().ch == 0 && !range.empty()) from--;\n if (from < at) linesToMove.push(from, to);\n else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;\n at = to;\n }\n cm.operation(function() {\n for (var i = linesToMove.length - 2; i >= 0; i -= 2) {\n var from = linesToMove[i], to = linesToMove[i + 1];\n var line = cm.getLine(from);\n if (from == cm.lastLine())\n cm.replaceRange(\"\", Pos(from - 1), Pos(from), \"+swapLine\");\n else\n cm.replaceRange(\"\", Pos(from, 0), Pos(from + 1, 0), \"+swapLine\");\n cm.replaceRange(line + \"\\n\", Pos(to, 0), null, \"+swapLine\");\n }\n cm.scrollIntoView();\n });\n };\n\n cmds.toggleCommentIndented = function(cm) {\n cm.toggleComment({ indent: true });\n }\n\n cmds.joinLines = function(cm) {\n var ranges = cm.listSelections(), joined = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], from = range.from();\n var start = from.line, end = range.to().line;\n while (i < ranges.length - 1 && ranges[i + 1].from().line == end)\n end = ranges[++i].to().line;\n joined.push({start: start, end: end, anchor: !range.empty() && from});\n }\n cm.operation(function() {\n var offset = 0, ranges = [];\n for (var i = 0; i < joined.length; i++) {\n var obj = joined[i];\n var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), head;\n for (var line = obj.start; line <= obj.end; line++) {\n var actual = line - offset;\n if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1);\n if (actual < cm.lastLine()) {\n cm.replaceRange(\" \", Pos(actual), Pos(actual + 1, /^\\s*/.exec(cm.getLine(actual + 1))[0].length));\n ++offset;\n }\n }\n ranges.push({anchor: anchor || head, head: head});\n }\n cm.setSelections(ranges, 0);\n });\n };\n\n cmds.duplicateLine = function(cm) {\n cm.operation(function() {\n var rangeCount = cm.listSelections().length;\n for (var i = 0; i < rangeCount; i++) {\n var range = cm.listSelections()[i];\n if (range.empty())\n cm.replaceRange(cm.getLine(range.head.line) + \"\\n\", Pos(range.head.line, 0));\n else\n cm.replaceRange(cm.getRange(range.from(), range.to()), range.from());\n }\n cm.scrollIntoView();\n });\n };\n\n\n function sortLines(cm, caseSensitive, direction) {\n if (cm.isReadOnly()) return CodeMirror.Pass\n var ranges = cm.listSelections(), toSort = [], selected;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.empty()) continue;\n var from = range.from().line, to = range.to().line;\n while (i < ranges.length - 1 && ranges[i + 1].from().line == to)\n to = ranges[++i].to().line;\n if (!ranges[i].to().ch) to--;\n toSort.push(from, to);\n }\n if (toSort.length) selected = true;\n else toSort.push(cm.firstLine(), cm.lastLine());\n\n cm.operation(function() {\n var ranges = [];\n for (var i = 0; i < toSort.length; i += 2) {\n var from = toSort[i], to = toSort[i + 1];\n var start = Pos(from, 0), end = Pos(to);\n var lines = cm.getRange(start, end, false);\n if (caseSensitive)\n lines.sort(function(a, b) { return a < b ? -direction : a == b ? 0 : direction; });\n else\n lines.sort(function(a, b) {\n var au = a.toUpperCase(), bu = b.toUpperCase();\n if (au != bu) { a = au; b = bu; }\n return a < b ? -direction : a == b ? 0 : direction;\n });\n cm.replaceRange(lines, start, end);\n if (selected) ranges.push({anchor: start, head: Pos(to + 1, 0)});\n }\n if (selected) cm.setSelections(ranges, 0);\n });\n }\n\n cmds.sortLines = function(cm) { sortLines(cm, true, 1); };\n cmds.reverseSortLines = function(cm) { sortLines(cm, true, -1); };\n cmds.sortLinesInsensitive = function(cm) { sortLines(cm, false, 1); };\n cmds.reverseSortLinesInsensitive = function(cm) { sortLines(cm, false, -1); };\n\n cmds.nextBookmark = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) while (marks.length) {\n var current = marks.shift();\n var found = current.find();\n if (found) {\n marks.push(current);\n return cm.setSelection(found.from, found.to);\n }\n }\n };\n\n cmds.prevBookmark = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) while (marks.length) {\n marks.unshift(marks.pop());\n var found = marks[marks.length - 1].find();\n if (!found)\n marks.pop();\n else\n return cm.setSelection(found.from, found.to);\n }\n };\n\n cmds.toggleBookmark = function(cm) {\n var ranges = cm.listSelections();\n var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);\n for (var i = 0; i < ranges.length; i++) {\n var from = ranges[i].from(), to = ranges[i].to();\n var found = ranges[i].empty() ? cm.findMarksAt(from) : cm.findMarks(from, to);\n for (var j = 0; j < found.length; j++) {\n if (found[j].sublimeBookmark) {\n found[j].clear();\n for (var k = 0; k < marks.length; k++)\n if (marks[k] == found[j])\n marks.splice(k--, 1);\n break;\n }\n }\n if (j == found.length)\n marks.push(cm.markText(from, to, {sublimeBookmark: true, clearWhenEmpty: false}));\n }\n };\n\n cmds.clearBookmarks = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();\n marks.length = 0;\n };\n\n cmds.selectBookmarks = function(cm) {\n var marks = cm.state.sublimeBookmarks, ranges = [];\n if (marks) for (var i = 0; i < marks.length; i++) {\n var found = marks[i].find();\n if (!found)\n marks.splice(i--, 0);\n else\n ranges.push({anchor: found.from, head: found.to});\n }\n if (ranges.length)\n cm.setSelections(ranges, 0);\n };\n\n function modifyWordOrSelection(cm, mod) {\n cm.operation(function() {\n var ranges = cm.listSelections(), indices = [], replacements = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.empty()) { indices.push(i); replacements.push(\"\"); }\n else replacements.push(mod(cm.getRange(range.from(), range.to())));\n }\n cm.replaceSelections(replacements, \"around\", \"case\");\n for (var i = indices.length - 1, at; i >= 0; i--) {\n var range = ranges[indices[i]];\n if (at && CodeMirror.cmpPos(range.head, at) > 0) continue;\n var word = wordAt(cm, range.head);\n at = word.from;\n cm.replaceRange(mod(word.word), word.from, word.to);\n }\n });\n }\n\n cmds.smartBackspace = function(cm) {\n if (cm.somethingSelected()) return CodeMirror.Pass;\n\n cm.operation(function() {\n var cursors = cm.listSelections();\n var indentUnit = cm.getOption(\"indentUnit\");\n\n for (var i = cursors.length - 1; i >= 0; i--) {\n var cursor = cursors[i].head;\n var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor);\n var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption(\"tabSize\"));\n\n // Delete by one character by default\n var deletePos = cm.findPosH(cursor, -1, \"char\", false);\n\n if (toStartOfLine && !/\\S/.test(toStartOfLine) && column % indentUnit == 0) {\n var prevIndent = new Pos(cursor.line,\n CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit));\n\n // Smart delete only if we found a valid prevIndent location\n if (prevIndent.ch != cursor.ch) deletePos = prevIndent;\n }\n\n cm.replaceRange(\"\", deletePos, cursor, \"+delete\");\n }\n });\n };\n\n cmds.delLineRight = function(cm) {\n cm.operation(function() {\n var ranges = cm.listSelections();\n for (var i = ranges.length - 1; i >= 0; i--)\n cm.replaceRange(\"\", ranges[i].anchor, Pos(ranges[i].to().line), \"+delete\");\n cm.scrollIntoView();\n });\n };\n\n cmds.upcaseAtCursor = function(cm) {\n modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); });\n };\n cmds.downcaseAtCursor = function(cm) {\n modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); });\n };\n\n cmds.setSublimeMark = function(cm) {\n if (cm.state.sublimeMark) cm.state.sublimeMark.clear();\n cm.state.sublimeMark = cm.setBookmark(cm.getCursor());\n };\n cmds.selectToSublimeMark = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) cm.setSelection(cm.getCursor(), found);\n };\n cmds.deleteToSublimeMark = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) {\n var from = cm.getCursor(), to = found;\n if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; }\n cm.state.sublimeKilled = cm.getRange(from, to);\n cm.replaceRange(\"\", from, to);\n }\n };\n cmds.swapWithSublimeMark = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) {\n cm.state.sublimeMark.clear();\n cm.state.sublimeMark = cm.setBookmark(cm.getCursor());\n cm.setCursor(found);\n }\n };\n cmds.sublimeYank = function(cm) {\n if (cm.state.sublimeKilled != null)\n cm.replaceSelection(cm.state.sublimeKilled, null, \"paste\");\n };\n\n cmds.showInCenter = function(cm) {\n var pos = cm.cursorCoords(null, \"local\");\n cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);\n };\n\n function getTarget(cm) {\n var from = cm.getCursor(\"from\"), to = cm.getCursor(\"to\");\n if (CodeMirror.cmpPos(from, to) == 0) {\n var word = wordAt(cm, from);\n if (!word.word) return;\n from = word.from;\n to = word.to;\n }\n return {from: from, to: to, query: cm.getRange(from, to), word: word};\n }\n\n function findAndGoTo(cm, forward) {\n var target = getTarget(cm);\n if (!target) return;\n var query = target.query;\n var cur = cm.getSearchCursor(query, forward ? target.to : target.from);\n\n if (forward ? cur.findNext() : cur.findPrevious()) {\n cm.setSelection(cur.from(), cur.to());\n } else {\n cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0)\n : cm.clipPos(Pos(cm.lastLine())));\n if (forward ? cur.findNext() : cur.findPrevious())\n cm.setSelection(cur.from(), cur.to());\n else if (target.word)\n cm.setSelection(target.from, target.to);\n }\n };\n cmds.findUnder = function(cm) { findAndGoTo(cm, true); };\n cmds.findUnderPrevious = function(cm) { findAndGoTo(cm,false); };\n cmds.findAllUnder = function(cm) {\n var target = getTarget(cm);\n if (!target) return;\n var cur = cm.getSearchCursor(target.query);\n var matches = [];\n var primaryIndex = -1;\n while (cur.findNext()) {\n matches.push({anchor: cur.from(), head: cur.to()});\n if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch)\n primaryIndex++;\n }\n cm.setSelections(matches, primaryIndex);\n };\n\n\n var keyMap = CodeMirror.keyMap;\n keyMap.macSublime = {\n \"Cmd-Left\": \"goLineStartSmart\",\n \"Shift-Tab\": \"indentLess\",\n \"Shift-Ctrl-K\": \"deleteLine\",\n \"Alt-Q\": \"wrapLines\",\n \"Ctrl-Left\": \"goSubwordLeft\",\n \"Ctrl-Right\": \"goSubwordRight\",\n \"Ctrl-Alt-Up\": \"scrollLineUp\",\n \"Ctrl-Alt-Down\": \"scrollLineDown\",\n \"Cmd-L\": \"selectLine\",\n \"Shift-Cmd-L\": \"splitSelectionByLine\",\n \"Esc\": \"singleSelectionTop\",\n \"Cmd-Enter\": \"insertLineAfter\",\n \"Shift-Cmd-Enter\": \"insertLineBefore\",\n \"Cmd-D\": \"selectNextOccurrence\",\n \"Shift-Cmd-Space\": \"selectScope\",\n \"Shift-Cmd-M\": \"selectBetweenBrackets\",\n \"Cmd-M\": \"goToBracket\",\n \"Cmd-Ctrl-Up\": \"swapLineUp\",\n \"Cmd-Ctrl-Down\": \"swapLineDown\",\n \"Cmd-/\": \"toggleCommentIndented\",\n \"Cmd-J\": \"joinLines\",\n \"Shift-Cmd-D\": \"duplicateLine\",\n \"F5\": \"sortLines\",\n \"Shift-F5\": \"reverseSortLines\",\n \"Cmd-F5\": \"sortLinesInsensitive\",\n \"Shift-Cmd-F5\": \"reverseSortLinesInsensitive\",\n \"F2\": \"nextBookmark\",\n \"Shift-F2\": \"prevBookmark\",\n \"Cmd-F2\": \"toggleBookmark\",\n \"Shift-Cmd-F2\": \"clearBookmarks\",\n \"Alt-F2\": \"selectBookmarks\",\n \"Backspace\": \"smartBackspace\",\n \"Cmd-K Cmd-D\": \"skipAndSelectNextOccurrence\",\n \"Cmd-K Cmd-K\": \"delLineRight\",\n \"Cmd-K Cmd-U\": \"upcaseAtCursor\",\n \"Cmd-K Cmd-L\": \"downcaseAtCursor\",\n \"Cmd-K Cmd-Space\": \"setSublimeMark\",\n \"Cmd-K Cmd-A\": \"selectToSublimeMark\",\n \"Cmd-K Cmd-W\": \"deleteToSublimeMark\",\n \"Cmd-K Cmd-X\": \"swapWithSublimeMark\",\n \"Cmd-K Cmd-Y\": \"sublimeYank\",\n \"Cmd-K Cmd-C\": \"showInCenter\",\n \"Cmd-K Cmd-G\": \"clearBookmarks\",\n \"Cmd-K Cmd-Backspace\": \"delLineLeft\",\n \"Cmd-K Cmd-1\": \"foldAll\",\n \"Cmd-K Cmd-0\": \"unfoldAll\",\n \"Cmd-K Cmd-J\": \"unfoldAll\",\n \"Ctrl-Shift-Up\": \"addCursorToPrevLine\",\n \"Ctrl-Shift-Down\": \"addCursorToNextLine\",\n \"Cmd-F3\": \"findUnder\",\n \"Shift-Cmd-F3\": \"findUnderPrevious\",\n \"Alt-F3\": \"findAllUnder\",\n \"Shift-Cmd-[\": \"fold\",\n \"Shift-Cmd-]\": \"unfold\",\n \"Cmd-I\": \"findIncremental\",\n \"Shift-Cmd-I\": \"findIncrementalReverse\",\n \"Cmd-H\": \"replace\",\n \"F3\": \"findNext\",\n \"Shift-F3\": \"findPrev\",\n \"fallthrough\": \"macDefault\"\n };\n CodeMirror.normalizeKeyMap(keyMap.macSublime);\n\n keyMap.pcSublime = {\n \"Shift-Tab\": \"indentLess\",\n \"Shift-Ctrl-K\": \"deleteLine\",\n \"Alt-Q\": \"wrapLines\",\n \"Ctrl-T\": \"transposeChars\",\n \"Alt-Left\": \"goSubwordLeft\",\n \"Alt-Right\": \"goSubwordRight\",\n \"Ctrl-Up\": \"scrollLineUp\",\n \"Ctrl-Down\": \"scrollLineDown\",\n \"Ctrl-L\": \"selectLine\",\n \"Shift-Ctrl-L\": \"splitSelectionByLine\",\n \"Esc\": \"singleSelectionTop\",\n \"Ctrl-Enter\": \"insertLineAfter\",\n \"Shift-Ctrl-Enter\": \"insertLineBefore\",\n \"Ctrl-D\": \"selectNextOccurrence\",\n \"Shift-Ctrl-Space\": \"selectScope\",\n \"Shift-Ctrl-M\": \"selectBetweenBrackets\",\n \"Ctrl-M\": \"goToBracket\",\n \"Shift-Ctrl-Up\": \"swapLineUp\",\n \"Shift-Ctrl-Down\": \"swapLineDown\",\n \"Ctrl-/\": \"toggleCommentIndented\",\n \"Ctrl-J\": \"joinLines\",\n \"Shift-Ctrl-D\": \"duplicateLine\",\n \"F9\": \"sortLines\",\n \"Shift-F9\": \"reverseSortLines\",\n \"Ctrl-F9\": \"sortLinesInsensitive\",\n \"Shift-Ctrl-F9\": \"reverseSortLinesInsensitive\",\n \"F2\": \"nextBookmark\",\n \"Shift-F2\": \"prevBookmark\",\n \"Ctrl-F2\": \"toggleBookmark\",\n \"Shift-Ctrl-F2\": \"clearBookmarks\",\n \"Alt-F2\": \"selectBookmarks\",\n \"Backspace\": \"smartBackspace\",\n \"Ctrl-K Ctrl-D\": \"skipAndSelectNextOccurrence\",\n \"Ctrl-K Ctrl-K\": \"delLineRight\",\n \"Ctrl-K Ctrl-U\": \"upcaseAtCursor\",\n \"Ctrl-K Ctrl-L\": \"downcaseAtCursor\",\n \"Ctrl-K Ctrl-Space\": \"setSublimeMark\",\n \"Ctrl-K Ctrl-A\": \"selectToSublimeMark\",\n \"Ctrl-K Ctrl-W\": \"deleteToSublimeMark\",\n \"Ctrl-K Ctrl-X\": \"swapWithSublimeMark\",\n \"Ctrl-K Ctrl-Y\": \"sublimeYank\",\n \"Ctrl-K Ctrl-C\": \"showInCenter\",\n \"Ctrl-K Ctrl-G\": \"clearBookmarks\",\n \"Ctrl-K Ctrl-Backspace\": \"delLineLeft\",\n \"Ctrl-K Ctrl-1\": \"foldAll\",\n \"Ctrl-K Ctrl-0\": \"unfoldAll\",\n \"Ctrl-K Ctrl-J\": \"unfoldAll\",\n \"Ctrl-Alt-Up\": \"addCursorToPrevLine\",\n \"Ctrl-Alt-Down\": \"addCursorToNextLine\",\n \"Ctrl-F3\": \"findUnder\",\n \"Shift-Ctrl-F3\": \"findUnderPrevious\",\n \"Alt-F3\": \"findAllUnder\",\n \"Shift-Ctrl-[\": \"fold\",\n \"Shift-Ctrl-]\": \"unfold\",\n \"Ctrl-I\": \"findIncremental\",\n \"Shift-Ctrl-I\": \"findIncrementalReverse\",\n \"Ctrl-H\": \"replace\",\n \"F3\": \"findNext\",\n \"Shift-F3\": \"findPrev\",\n \"fallthrough\": \"pcDefault\"\n };\n CodeMirror.normalizeKeyMap(keyMap.pcSublime);\n\n var mac = keyMap.default == keyMap.macDefault;\n keyMap.sublime = mac ? keyMap.macSublime : keyMap.pcSublime;\n});\n", "export const codePointsToString = (code: number[]): string =>\n code.reduce((code, ord) => code + String.fromCharCode(ord), '');\n\nexport default codePointsToString;\n", "export const stringToCodePoints = (code: string): number[] =>\n code.split('').map((c: string): number => c.charCodeAt(0));\n\nexport default stringToCodePoints;\n", "import { Decoder } from '../Decoders';\nimport codePointsToString from '../codePointsToString';\nimport stringToCodePoints from '../stringToCodePoints';\n\nexport class Default implements Decoder {\n public name(): string {\n return 'default';\n }\n\n protected codePointsToString(code: number[]): string {\n return codePointsToString(code);\n }\n\n protected stringToCodePoints(code: string): number[] {\n return stringToCodePoints(code);\n }\n\n public matches(code: number[]): boolean {\n return this.matchesAsString(this.codePointsToString(code));\n }\n\n public matchesAsString(code: string): boolean {\n return true;\n }\n\n public decode(code: number[]): number[] {\n return this.decodeAsString(this.codePointsToString(code));\n }\n\n public decodeAsString(code: string): number[] {\n return this.stringToCodePoints(code);\n }\n}\n\nexport default Default;\n", "import { Decoder } from '../Decoders';\nimport Default from './Default';\n\nexport class Base64 extends Default implements Decoder {\n public name(): string {\n return 'base64';\n }\n\n public matchesAsString(code: string): boolean {\n // base64 input is at least 4 chars\n if (code.length < 4) {\n return false;\n }\n\n try {\n atob(code);\n\n return true;\n } catch (e) {\n return false;\n }\n }\n\n public decodeAsString(code: string): number[] {\n return Array.from(atob(code)).map((c: string): number => c.charCodeAt(0));\n }\n}\nexport default Base64;\n", "import { Decoder } from '../Decoders';\nimport Default from './Default';\n\nexport class Hexdump extends Default implements Decoder {\n public name(): string {\n return 'hexdump';\n }\n\n public matchesAsString(code: string): boolean {\n // TODO: could use the length to check that it's actually valid...\n return /^([0-9a-f]{7}(( ([0-9a-f]{4})){1,8}) *\\n)+[0-9a-f]{7}\\n?$/.test(\n code\n );\n }\n\n public decodeAsString(code: string): number[] {\n return code\n .trim()\n .replace(/\\n[0-9a-f]{7}\\n?$/, '')\n .replace(/(?<=^|\\n)[0-9a-f]{7}(( ([0-9a-f]{4})){1,8}) */g, '$1')\n .replace(/\\s+/g, '')\n .replace(/(..)(..)/g, '$2$1')\n .replace(/00$/, '')\n .match(/../g)\n .map((c: string): number => parseInt(c, 16));\n }\n}\n\nexport default Hexdump;\n", "export type Runner = (code: number[], input: string, args: string) => Worker;\n\nexport class Lang {\n constructor(\n private id: string,\n private name: string,\n private runner: Runner,\n private url: string = null,\n private args: string[] | null = null,\n private highlighterRef: string = id\n ) {}\n\n getId(): string {\n return this.id;\n }\n\n getName(): string {\n return this.name;\n }\n\n getURL(): string {\n return this.url;\n }\n\n getArgs(): string[] | null {\n return this.args;\n }\n\n getHighlighterRef(): string {\n return this.highlighterRef;\n }\n\n run(code: number[], args: string, input: string): Worker {\n return this.runner(code, input, args);\n }\n}\n\nexport default Lang;\n", "import Lang, { Runner } from './Lang';\n\nexport class Langs {\n private data: { [key: string]: Lang } = {};\n\n public register(...langs: Lang[]): void {\n langs.forEach((lang: Lang): void => {\n this.data[lang.getId()] = lang;\n });\n }\n\n public get(lang: string): Lang {\n return this.data[lang];\n }\n\n public all(): string[] {\n return Object.keys(this.data);\n }\n\n public run(\n langId: string,\n code: number[],\n args: string,\n input: string\n ): Worker {\n return this.data[langId].run(code, args, input);\n }\n}\n\nexport const defaultRunner =\n (workerURL): Runner =>\n (code: number[], input: string, args: string) => {\n const worker = new Worker(workerURL);\n\n worker.postMessage({\n type: 'run',\n code,\n args,\n input,\n });\n\n return worker;\n };\n\nexport const langs = new Langs();\n\nexport default langs;\n", "import { Lang } from '../../Lang';\nimport { defaultRunner } from '../../Langs';\nimport 'codemirror/mode/javascript/javascript';\n\nexport class JavaScript extends Lang {\n constructor() {\n super(\n 'javascript-browser',\n 'JavaScript (Browser)',\n defaultRunner('dist/js/langs/javascript-browser/worker.js'),\n 'https://www.ecma-international.org/publications-and-standards/standards/ecma-262/',\n null,\n 'javascript'\n );\n }\n}\n\nexport default JavaScript;\n", "import { Lang } from '../../Lang';\nimport { defaultRunner } from '../../Langs';\nimport 'codemirror/mode/perl/perl';\n\nexport class Perl extends Lang {\n constructor() {\n super(\n 'webperl-5.28.1',\n 'Perl 5.28.1 (webperl)',\n defaultRunner('dist/js/langs/webperl-5.28.1/worker.js'),\n 'https://www.perl.org/',\n ['-M5.10.0', '-F', '-l', '-p'],\n 'perl'\n );\n }\n}\n\nexport default Perl;\n", "import { Editor, EditorConfiguration, fromTextArea } from 'codemirror';\nimport { Melba, MelbaConstructorOptions, MelbaType } from 'melba-toast';\nimport { Renderers, createDevice } from './Renderers';\nimport CodeInput from './Inputs/Code';\nimport CodeRenderer from './Renderers/Code';\nimport IFrame from './Renderers/IFrame';\nimport IO from './IO';\nimport Image from './Renderers/Image';\nimport Inputs from './Inputs';\nimport PBMImage from './Renderers/PBMImage';\nimport TTY from './Renderers/TTY';\nimport codePointsToString from './codePointsToString';\nimport { decoders } from './Decoders';\nimport { langs } from './Langs';\nimport { options } from './Options';\nimport replaceBinaryBytes from './replaceBinaryBytes';\n\nimport 'codemirror/addon/comment/comment';\nimport 'codemirror/addon/comment/continuecomment';\nimport 'codemirror/addon/display/placeholder';\nimport 'codemirror/addon/edit/closebrackets';\nimport 'codemirror/addon/edit/matchbrackets';\nimport 'codemirror/keymap/sublime';\n\ntype Message = {\n name: 'setOption';\n value: {\n name: string;\n value: unknown;\n };\n};\n\nexport type IHashData = {\n lang: string;\n header?: string;\n code: string;\n footer?: string;\n args?: string;\n input?: string;\n type?: 'tty' | 'resource';\n mime?: string;\n options?: { [key: string]: unknown };\n};\n\nexport class UI {\n private addArg: HTMLHeadingElement;\n private args: Editor;\n private argsWrapper: HTMLDivElement;\n private bytesCount: HTMLSpanElement;\n private bytesPlural: HTMLSpanElement;\n private code: Inputs;\n private codeFooter: Inputs;\n private codeHeader: Inputs;\n private copyLinkButton: HTMLButtonElement;\n private encoded: HTMLSpanElement;\n private expanders: NodeListOf;\n private format: HTMLSpanElement;\n private io: IO;\n private langSelector: HTMLSelectElement;\n private markdownButton: HTMLButtonElement;\n private mimeType: string = 'text/plain';\n private mimeTypeInput: HTMLInputElement;\n private runButton: HTMLButtonElement;\n private stderr: Renderers;\n private stdin: Editor;\n private stdout: Renderers;\n private stopButton: HTMLButtonElement;\n\n constructor() {\n this.langSelector = document.querySelector(\n 'select[name=\"lang\"]'\n ) as HTMLSelectElement;\n\n this.addRegisteredLangs();\n\n const stdoutContainer = document.querySelector(\n 'div.stdout'\n ) as HTMLDivElement;\n\n this.codeHeader = new Inputs(\n new CodeInput(document.querySelector('div.header') as HTMLDivElement, {\n autoCloseBrackets: true,\n matchBrackets: true,\n placeholder: 'Header...',\n })\n );\n this.codeHeader.activate(CodeInput);\n\n this.code = new Inputs(\n new CodeInput(document.querySelector('div.code') as HTMLDivElement, {\n autoCloseBrackets: true,\n autofocus: true,\n matchBrackets: true,\n placeholder: 'Code...',\n })\n );\n this.code.activate(CodeInput);\n this.code.setType(this.langSelector.value);\n\n this.langSelector.addEventListener('change', () =>\n this.code.setType(this.langSelector.value)\n );\n\n this.codeFooter = new Inputs(\n new CodeInput(document.querySelector('div.footer') as HTMLDivElement, {\n autoCloseBrackets: true,\n autofocus: true,\n matchBrackets: true,\n placeholder: 'Footer...',\n })\n );\n this.codeFooter.activate(CodeInput);\n\n this.stdout = createDevice(\n new CodeRenderer(stdoutContainer),\n new PBMImage(stdoutContainer),\n new Image(stdoutContainer),\n new IFrame(stdoutContainer),\n new TTY(stdoutContainer)\n );\n this.stdout.activate('text/plain');\n\n this.stderr = createDevice(\n new TTY(document.querySelector('div.stderr') as HTMLDivElement, {\n rows: 8,\n })\n );\n this.stderr.setPrepend('\\x1b[31m');\n this.stderr.activate('text/plain');\n this.stdin = UI.createEditor(\n document.querySelector('textarea[name=\"input\"]') as HTMLTextAreaElement\n );\n this.args = UI.createEditor(\n document.querySelector('textarea[name=\"args\"]') as HTMLTextAreaElement\n );\n\n this.io = new IO(this.stdin, this.args);\n\n this.expanders = document.querySelectorAll(\n 'button[name=\"expand\"]'\n ) as NodeListOf;\n this.argsWrapper = document.querySelector(\n '.args-wrapper'\n ) as HTMLDivElement;\n this.addArg = document.querySelector(\n '.args-wrapper .actions'\n ) as HTMLHeadingElement;\n this.runButton = document.querySelector(\n 'button[name=\"run\"]'\n ) as HTMLButtonElement;\n this.stopButton = document.querySelector(\n 'button[name=\"stop\"]'\n ) as HTMLButtonElement;\n this.bytesCount = document.querySelector(\n '.bytes .byte-count'\n ) as HTMLSpanElement;\n this.bytesPlural = document.querySelector(\n '.bytes .plural'\n ) as HTMLSpanElement;\n this.encoded = document.querySelector('.encoded') as HTMLSpanElement;\n this.format = document.querySelector('.format') as HTMLSpanElement;\n this.copyLinkButton = document.querySelector(\n 'button[name=\"copy\"]'\n ) as HTMLButtonElement;\n this.markdownButton = document.querySelector(\n 'button[name=\"markdown\"]'\n ) as HTMLButtonElement;\n this.mimeTypeInput = document.querySelector('.stdout-header input');\n this.connectExpanders();\n\n // bind events\n this.code.on('change', () => this.codeOnChange());\n\n this.runButton.addEventListener('click', () => this.runCode());\n this.langSelector.addEventListener('change', () => this.populateArgs());\n this.copyLinkButton.addEventListener('click', () => {\n const link = this.buildLink();\n\n if (location.href !== link) {\n history.pushState(this.buildHashData(), document.title, link);\n }\n\n navigator.clipboard.writeText(link);\n\n UI.copied(this.copyLinkButton);\n });\n this.markdownButton.addEventListener('click', () => {\n navigator.clipboard.writeText(this.buildMarkdown());\n\n UI.copied(this.markdownButton);\n });\n this.mimeTypeInput.addEventListener('change', () =>\n this.setMimeType(this.mimeTypeInput.value || 'text/plain', false)\n );\n this.mimeTypeInput.addEventListener('keypress', ({ key }) => {\n if (key === 'Enter' && this.mimeType !== this.mimeTypeInput.value) {\n this.setMimeType(this.mimeTypeInput.value || 'text/plain', false);\n }\n });\n\n addEventListener('keydown', (event) => {\n if (event.key === 's' && (event.ctrlKey || event.metaKey)) {\n const link = this.buildLink();\n\n history.pushState(this.buildHashData(), document.title, link);\n navigator.clipboard.writeText(link);\n\n this.toast('Saved!', 'success', {\n hide: 2,\n });\n\n event.preventDefault();\n }\n });\n\n addEventListener('hashchange', () => {\n this.parseHashData(location.hash);\n\n if (this.code.read().length) {\n this.runCode();\n }\n });\n addEventListener('resize', () => this.resize());\n addEventListener(\n 'message',\n ({ data: { name, value } }: { data: Message }) => {\n if (name === 'setOption') {\n options.set(value.name, value.value);\n }\n }\n );\n\n // onload\n const previousLang = window.localStorage.getItem('lastUsedLanguage');\n if (previousLang) {\n this.setLang(previousLang);\n }\n\n this.parseHashData(location.hash);\n try {\n this.populateArgs();\n } catch (e) {\n this.toast(e.message, 'error');\n }\n this.codeOnChange();\n\n if (this.code.read().length) {\n this.runCode();\n }\n\n this.resize();\n\n document\n .querySelector('button.fullscreen-toggle')\n .addEventListener('click', () => this.enterFullscreen());\n\n document.addEventListener('fullscreenchange', () => this.exitFullscreen());\n }\n\n private addRegisteredLangs(): void {\n langs.all().forEach((langKey) => {\n const lang = langs.get(langKey),\n option = document.createElement('option');\n\n option.setAttribute('value', lang.getId());\n option.append(document.createTextNode(lang.getName()));\n\n this.langSelector.append(option);\n });\n }\n\n private setLang(lang: string): void {\n const availableLangs = langs.all();\n\n if (!availableLangs.includes(lang)) {\n throw new TypeError(`Unknown lang: ${lang}.`);\n }\n\n this.langSelector.value = lang;\n\n this.setCodeHighlight();\n }\n\n private getLangId(): string {\n return this.langSelector.value;\n }\n\n private setCodeHighlight(): void {\n const lang = langs.get(this.getLangId());\n\n [this.codeHeader, this.code, this.codeFooter].forEach((inputs) => {\n const decoder = decoders.decoderAsString(inputs.readAsString(null));\n\n if (decoder.name() !== 'default') {\n inputs.setType(null);\n\n return;\n }\n\n inputs.setType(lang.getHighlighterRef());\n });\n }\n\n public static createEditor(\n element: HTMLTextAreaElement,\n options: EditorConfiguration = {}\n ): Editor {\n return fromTextArea(element, {\n mode: null,\n theme: 'monokai',\n viewportMargin: Infinity,\n ...options,\n extraKeys: {\n 'Ctrl-D': 'duplicateLine',\n 'Ctrl-/': 'toggleComment',\n 'Shift-Tab': false,\n Tab: false,\n // @ts-ignore\n ...(options.extraKeys || {}),\n },\n });\n }\n\n private resize(): void {\n this.stdout.resize();\n this.stderr.resize();\n }\n\n private codeOnChange(): void {\n const code = this.code.read();\n\n this.encoded.setAttribute('hidden', '');\n\n this.setCodeHighlight();\n\n const decoder = decoders.decoder(code);\n\n if (decoder.name() !== 'default') {\n this.encoded.removeAttribute('hidden');\n\n this.format.innerText = decoder.name();\n }\n\n const decodedCode = decoder.decode(code);\n\n this.showBytes(decodedCode.length);\n }\n\n private runCode(): void {\n const started = Date.now(),\n stopHandler = () => {\n worker.terminate();\n\n this.stderr.write(`Aborted execution after ${Date.now() - started}ms`);\n\n this.runButton.removeAttribute('disabled');\n this.stopButton.setAttribute('disabled', '');\n\n this.stopButton.removeEventListener('click', stopHandler);\n };\n\n this.stdout.reset();\n this.stderr.reset();\n\n this.runButton.setAttribute('disabled', '');\n this.stopButton.removeAttribute('disabled');\n\n const worker = langs.run(\n this.getLangId(),\n [].concat(\n [\n this.codeHeader.read(),\n this.code.read(),\n this.codeFooter.read(),\n ].flatMap((code) => decoders.decode(code))\n ),\n this.io.getArgs(),\n this.io.getStdin()\n );\n\n this.stopButton.addEventListener('click', stopHandler);\n\n worker.onmessage = ({ data }) => {\n const { type, output, error } = data;\n\n if (output) {\n this.stdout.write(output);\n }\n\n if (error) {\n this.stderr.write(error ?? '');\n }\n\n if (type === 'done') {\n this.stderr.write(\n `Completed execution after ${Date.now() - started}ms`\n );\n\n this.runButton.removeAttribute('disabled');\n this.stopButton.setAttribute('disabled', '');\n\n this.stopButton.removeEventListener('click', stopHandler);\n\n // Make sure the process is stopped\n worker.terminate();\n }\n };\n\n worker.onerror = (e) => {\n this.toast(`Worker error: ${e.message}`, 'error');\n\n this.runButton.removeAttribute('disabled');\n this.stopButton.setAttribute('disabled', '');\n };\n }\n\n private populateArgs(): void {\n while (this.addArg.firstElementChild) {\n this.addArg.firstElementChild.remove();\n }\n\n const lang = langs.get(this.getLangId());\n\n if (!lang) {\n throw new TypeError('Unregistered lang: ' + this.getLangId());\n }\n\n window.localStorage.setItem('lastUsedLanguage', lang.getId());\n\n const args = lang.getArgs();\n\n if (args !== null) {\n this.argsWrapper.removeAttribute('hidden');\n\n args.forEach((arg) => {\n const argButton = document.createElement('button');\n\n argButton.append(document.createTextNode(arg));\n\n argButton.addEventListener('click', () => {\n const currentValue = this.io.getArgs() ?? '',\n match = new RegExp('(\\\\n|^)' + arg + '(\\\\n|$)');\n\n if (match.test(currentValue)) {\n return;\n }\n\n this.io.setArgs((currentValue + '\\n' + arg).trim());\n });\n\n this.addArg.append(argButton);\n });\n } else {\n this.argsWrapper.setAttribute('hidden', '');\n }\n\n this.io.argsRefresh();\n }\n\n private static expand(expander: HTMLButtonElement): void {\n const collapser = expander.nextElementSibling as HTMLButtonElement,\n target = document.querySelector(expander.dataset.target);\n\n if (!target) {\n console.debug('No collapser or target for expander: ', expander);\n\n return;\n }\n\n expander.setAttribute('hidden', '');\n target.removeAttribute('hidden');\n collapser.removeAttribute('hidden');\n collapser.focus();\n }\n\n private static collapse(expander: HTMLButtonElement): void {\n const collapser = expander.nextElementSibling,\n target = document.querySelector(expander.dataset.target);\n\n if (!target) {\n console.debug('No collapser or target for expander: ', expander);\n\n return;\n }\n\n expander.removeAttribute('hidden');\n target.setAttribute('hidden', '');\n collapser.setAttribute('hidden', '');\n expander.focus();\n }\n\n private connectExpanders(): void {\n this.expanders.forEach((expander) => {\n const collapser = expander.nextElementSibling;\n\n if (!collapser || !collapser.matches('button[name=\"collapse\"]')) {\n console.debug('No collapser or target for expander: ', expander);\n\n return;\n }\n\n expander.addEventListener('click', () => UI.expand(expander));\n collapser.addEventListener('click', () => UI.collapse(expander));\n });\n }\n\n private setMimeType(mimeType: string, setInput: boolean = true): void {\n this.mimeType = mimeType;\n\n if (setInput) {\n this.mimeTypeInput.value = mimeType;\n }\n\n this.stdout.activate(mimeType);\n this.stdout.resize();\n }\n\n private static copied(button: HTMLButtonElement | HTMLInputElement): void {\n button.setAttribute('disabled', '');\n button.style.width = button.offsetWidth + 'px';\n button.classList.toggle('copied');\n\n setTimeout(() => {\n button.removeAttribute('disabled');\n button.style.width = null;\n button.classList.toggle('copied');\n }, 1000);\n }\n\n private parseHashData(hash): void {\n if (!hash || hash.length < 2) {\n return;\n }\n\n let data;\n\n try {\n const jsonData = atob(hash.slice(1));\n\n data = JSON.parse(jsonData);\n } catch (e) {\n if (e instanceof DOMException) {\n this.toast('Unable to decode URL data. Aborting.', 'error');\n\n return;\n }\n\n if (e instanceof SyntaxError) {\n this.toast('Unable to decode JSON data. Aborting.', 'error');\n\n return;\n }\n\n throw e;\n }\n\n const [headerExpander] = Array.from(this.expanders).filter((expander) =>\n expander.parentElement.matches('.code-header')\n ),\n [footerExpander] = Array.from(this.expanders).filter((expander) =>\n expander.parentElement.matches('.code-footer')\n );\n\n if (data.header) {\n UI.expand(headerExpander);\n }\n\n if (data.footer) {\n UI.expand(footerExpander);\n }\n\n if (data.options) {\n Object.entries(data.options).forEach(([key, value]) =>\n options.set(key, value)\n );\n }\n\n this.setLang(data.lang ?? this.getLangId());\n this.codeHeader.write(decodeURIComponent(escape(data.header ?? '')));\n this.code.write(decodeURIComponent(escape(data.code ?? '')));\n this.codeFooter.write(decodeURIComponent(escape(data.footer ?? '')));\n this.io.setArgs(data.args ?? '');\n this.io.setStdin(decodeURIComponent(escape(data.input ?? '')));\n\n if (data.mime) {\n this.setMimeType(data.mime);\n }\n }\n\n private buildHashData() {\n const data: IHashData = {\n lang: this.getLangId(),\n code: this.code.readAsString(null),\n },\n header = this.codeHeader.readAsString(null),\n footer = this.codeFooter.readAsString(null),\n args = this.io.getArgs(),\n input = this.io.getStdin(),\n mime = this.mimeType,\n optionValues = options.options;\n\n Object.entries({\n header,\n footer,\n args,\n input,\n }).forEach(([key, value]) => {\n if (value) {\n data[key] = value;\n }\n });\n\n if (JSON.stringify(optionValues) !== '{}') {\n data.options = optionValues;\n }\n\n if (mime !== 'text/plain') {\n data.mime = mime;\n }\n\n return btoa(JSON.stringify(data));\n }\n\n private buildLink(): string {\n const hash = this.buildHashData();\n\n return (\n location.protocol + '//' + location.host + location.pathname + '#' + hash\n );\n }\n\n private buildMarkdown(): string {\n const args = this.io.getArgs().trim().split(/\\n/).join(' '),\n lang = langs.get(this.getLangId()),\n key = Math.random().toString(36).slice(2, 10),\n rawCode = decoders.decode(this.code.read()),\n code = replaceBinaryBytes(codePointsToString(rawCode)),\n bytes = code.length;\n\n return `# [${lang.getName()}]${\n args ? ` + \\`${args}\\`` : ''\n }, ${bytes} byte${bytes === 1 ? '' : 's'}\n\n\n\n
${code.replace(/[&<>]/g, (char) =>\n      char === '<'\n        ? '<'\n        : char === '>'\n        ? '>'\n        : char === '&'\n        ? '&'\n        : char\n    )}
\n\n[Try it online!][TIO-${key}]\n\n[${lang.getName()}]: ${lang.getURL()}\n[TIO-${key}]: ${this.buildLink()}`;\n }\n\n private showBytes(byteCount: number): void {\n this.bytesCount.innerText = byteCount.toString();\n\n if (byteCount === 1) {\n this.bytesPlural.setAttribute('hidden', '');\n\n return;\n }\n\n this.bytesPlural.removeAttribute('hidden');\n }\n\n private enterFullscreen(): void {\n document.body.requestFullscreen().then(() => {\n document.body.classList.add('fullscreen');\n this.resize();\n });\n }\n\n private exitFullscreen(): void {\n document.body.classList.remove('fullscreen');\n this.resize();\n }\n\n public toast(\n content: string,\n type: MelbaType,\n options: Omit = {}\n ): Melba {\n if (!options.events) {\n options.events = {};\n }\n\n if (!options.events.click) {\n options.events.click = [];\n }\n\n options.events.click.push((toast) => toast.hide());\n\n return new Melba({\n ...options,\n content,\n type,\n });\n }\n}\n\nexport default UI;\n", "export interface Renderer {\n activate(mimeType: string): void;\n deactivate(): void;\n isActive(): boolean;\n matches(mimeType: string): boolean;\n reset(): void;\n resize(): void;\n write(char: number | string): void;\n}\n\nexport class Renderers {\n private buffer: string = '';\n private prepend: string = '';\n private registered: Renderer[] = [];\n\n public constructor(...renderers: Renderer[]) {\n this.register(...renderers);\n }\n\n public activate(mimeType: string): void {\n this.registered.reduce((value, renderer): boolean => {\n // Activate the first Renderer that matches\n if (renderer.matches(mimeType) && !value) {\n if (!renderer.isActive()) {\n renderer.activate(mimeType);\n renderer.reset();\n renderer.write(this.prepend + this.buffer);\n }\n\n return true;\n }\n\n renderer.deactivate();\n renderer.reset();\n\n return value;\n }, false);\n\n this.resize();\n }\n\n public refresh(): void {\n this.registered.forEach((renderer) => {\n this.registered\n .filter((renderer) => renderer.isActive())\n .forEach((renderer) => {\n renderer.reset();\n renderer.write(this.prepend + this.buffer);\n });\n });\n }\n\n public register(...renderers: Renderer[]): void {\n this.registered.push(...renderers);\n }\n\n public reset(): void {\n this.buffer = '';\n this.registered.forEach((renderer) => {\n renderer.reset();\n\n if (this.prepend) {\n renderer.write(this.prepend);\n }\n });\n }\n\n public resize(): void {\n this.registered.forEach((renderer) => {\n if (renderer.isActive()) {\n renderer.resize();\n }\n });\n }\n\n public setPrepend(prepend: string): void {\n this.prepend = prepend;\n\n this.refresh();\n }\n\n public write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.buffer += char;\n this.registered\n .filter((renderer) => renderer.isActive())\n .forEach((renderer) => renderer.write(char));\n }\n}\n\nexport default Renderers;\n\nexport const createDevice = (...renderers: Renderer[]): Renderers =>\n new Renderers(...renderers);\n", "import {\n Editor,\n EditorConfiguration,\n KeyMap,\n fromTextArea,\n EditorEventMap,\n} from 'codemirror';\nimport Abstract from './Abstract';\nimport { Input } from '../Inputs';\nimport replaceBinaryBytes from '../replaceBinaryBytes';\n\nexport class Code extends Abstract implements Input {\n private editor: Editor;\n\n public constructor(parent: HTMLElement, options: EditorConfiguration = {}) {\n super();\n\n const element = this.createElement('div'),\n textarea = document.createElement('textarea') as HTMLTextAreaElement;\n\n parent.append(element);\n element.append(textarea);\n\n this.editor = fromTextArea(textarea, {\n mode: null,\n theme: 'monokai',\n viewportMargin: Infinity,\n ...options,\n extraKeys: {\n 'Ctrl-D': 'duplicateLine',\n 'Ctrl-/': 'toggleComment',\n 'Shift-Tab': false,\n Tab: false,\n ...(Object.keys(options.extraKeys || {}).length\n ? (options.extraKeys as KeyMap)\n : {}),\n },\n });\n\n this.editor.on('change', () => {\n if (this.inputs === null) {\n return;\n }\n\n // Could be smarter about this...\n this.inputs.setBuffer(\n this.editor\n .getValue()\n .split('')\n .map((char) => char.charCodeAt(0))\n );\n });\n }\n\n public matches(data: string): boolean {\n return /^[\\t\\n -~]*$/.test(data);\n }\n\n public on(eventName: string, handler: (...args: any[]) => void): void {\n this.editor.on(eventName as keyof EditorEventMap, (...args: any[]) =>\n handler(...args)\n );\n }\n\n public readAsString(binaryReplacementChar: string | null = '.'): string {\n const code = unescape(encodeURIComponent(this.editor.getValue()));\n\n if (binaryReplacementChar === null) {\n return code;\n }\n\n return replaceBinaryBytes(code, binaryReplacementChar);\n }\n\n public reset(): void {\n this.editor.setValue('');\n }\n\n public setOption(\n key: keyof EditorConfiguration,\n value: EditorConfiguration[keyof EditorConfiguration]\n ): void {\n this.editor.setOption(key, value);\n }\n\n public setType(type: string | null): void {\n if (this.editor.getOption('mode') !== type) {\n this.editor.setOption('mode', type);\n }\n }\n\n public write(data: string | number[]): void {\n if (Array.isArray(data)) {\n // String.fromCharCode(...data) causes an error with really long input!\n data = data.map((c) => String.fromCharCode(c)).join('');\n }\n\n this.editor.setValue(data);\n }\n}\n\nexport default Code;\n", "import { Input, Inputs } from '../Inputs';\n\nexport abstract class Abstract implements Input {\n protected active: boolean = false;\n private container: HTMLElement;\n protected inputs: Inputs | null = null;\n\n public activate(inputs: Inputs): void {\n this.container.removeAttribute('hidden');\n this.active = true;\n this.inputs = inputs;\n\n this.resize();\n }\n\n protected createElement(tag: string = 'div'): HTMLElement {\n this.container = document.createElement(tag);\n\n this.container.setAttribute('hidden', '');\n\n return this.container;\n }\n\n public deactivate(): void {\n this.container.setAttribute('hidden', '');\n this.active = false;\n }\n\n public isActive(): boolean {\n return this.active;\n }\n\n abstract matches(data: string): boolean;\n\n abstract on(eventName: string, handler: (...args: any[]) => void): void;\n\n public read(): number[] {\n return this.readAsString(null)\n .split('')\n .map((c) => c.charCodeAt(0));\n }\n\n abstract readAsString(replaceBinaryBytes: string | null): string;\n\n abstract setType(type: string | null): void;\n\n abstract write(data: string | number[]): void;\n\n abstract reset(): void;\n\n public resize(): void {}\n}\n\nexport default Abstract;\n", "// Don't replace newlines\nexport const replaceBinaryBytes = (code: string, replacement: string = '.') =>\n code.replace(/[^\\x09\\x0a\\x20-\\x7e]/g, replacement);\n\nexport default replaceBinaryBytes;\n", "import { Renderer } from '../Renderers';\n\nexport abstract class Abstract implements Renderer {\n protected active: boolean = false;\n protected container: HTMLElement;\n protected mimeType: string = 'text/plain';\n\n public activate(mimeType: string): void {\n this.container.removeAttribute('hidden');\n this.active = true;\n this.mimeType = mimeType;\n\n this.resize();\n }\n\n protected createElement(tag: 'div', hidden?: boolean): HTMLDivElement;\n protected createElement(tag: 'iframe', hidden?: boolean): HTMLIFrameElement;\n protected createElement(\n tag: string = 'div',\n hidden: boolean = true\n ): HTMLElement {\n const element = document.createElement(tag);\n\n if (hidden) {\n element.setAttribute('hidden', '');\n }\n\n return element;\n }\n\n public deactivate(): void {\n this.container.setAttribute('hidden', '');\n this.active = false;\n }\n\n public isActive(): boolean {\n return this.active;\n }\n\n public matches(mimeType: string): boolean {\n return true;\n }\n\n abstract write(char: number): void;\n abstract write(data: string): void;\n\n abstract reset(): void;\n\n public resize(): void {}\n}\n\nexport default Abstract;\n", "import { Editor, EditorConfiguration } from 'codemirror';\nimport Abstract from './Abstract';\nimport { Renderer } from '../Renderers';\nimport UI from '../UI';\n\nimport 'codemirror/mode/javascript/javascript';\nimport 'codemirror/mode/perl/perl';\n\nexport class Code extends Abstract implements Renderer {\n private editor: Editor;\n\n constructor(parent: HTMLElement, options: EditorConfiguration = {}) {\n super();\n\n const textarea = document.createElement('textarea');\n\n this.container = this.createElement('div');\n\n this.container.append(textarea);\n parent.append(this.container);\n\n this.editor = UI.createEditor(textarea, {\n ...options,\n readOnly: true,\n });\n\n parent.append(this.container);\n }\n\n activate(mimeType: string) {\n super.activate(mimeType);\n\n this.editor.setOption('mode', mimeType);\n }\n\n deactivate() {\n super.deactivate();\n }\n\n matches(mimeType: string): boolean {\n return [\n 'application/ecmascript',\n 'application/javascript',\n 'application/json',\n 'application/x-perl',\n 'text/ecmascript',\n 'text/javascript',\n 'text/json',\n 'text/x-perl',\n ].includes(mimeType);\n }\n\n reset(): void {\n this.editor.setValue('');\n }\n\n write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.editor.setValue(this.editor.getValue() + char);\n }\n}\n\nexport default Code;\n", "import Abstract from './Abstract';\nimport { Renderer } from '../Renderers';\n\nexport class IFrame extends Abstract implements Renderer {\n protected buffer: string = '';\n protected container: HTMLIFrameElement;\n protected mimeType: string = 'text/html';\n\n public constructor(parent: HTMLElement) {\n super();\n\n this.container = this.createElement('iframe');\n\n parent.append(this.container);\n\n this.update();\n }\n\n public activate(mimeType: string) {\n super.activate(mimeType);\n\n this.update();\n }\n\n public matches(mimeType: string): boolean {\n return ['text/html'].includes(mimeType);\n }\n\n public reset(): void {\n this.buffer = '';\n this.update();\n }\n\n public write(char: number): void;\n public write(data: string): void;\n public write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.buffer += char;\n this.update();\n }\n\n private update(): void {\n // We need to destroy and recreate the IFrame so that we don't clobber the back button.\n const container = this.createElement(\n 'iframe',\n this.container.hasAttribute('hidden')\n );\n\n container.src = `data:${this.mimeType};base64,${btoa(this.buffer)}`;\n\n this.container.replaceWith(container);\n\n this.container = container;\n }\n}\n\nexport default IFrame;\n", "export interface Decoder {\n name(): string;\n matches(code: number[]): boolean;\n matchesAsString(code: string): boolean;\n decode(code: number[]): number[];\n decodeAsString(code: string): number[];\n}\n\nexport class Decoders {\n private registered: Decoder[] = [];\n\n public register(...decoders: Decoder[]): void {\n this.registered.push(...decoders);\n }\n\n public decode(code: number[]): number[] {\n return this.decoder(code).decode(code);\n }\n\n public decodeAsString(code: string): number[] {\n return this.decoderAsString(code).decodeAsString(code);\n }\n\n public decoder(code: number[]): Decoder {\n const [decoder] = this.registered.filter((decoder): boolean =>\n decoder.matches(code)\n );\n\n return decoder;\n }\n\n public decoderAsString(code: string): Decoder {\n const [decoder] = this.registered.filter((decoder): boolean =>\n decoder.matchesAsString(code)\n );\n\n return decoder;\n }\n}\n\nexport default Decoders;\n\nexport const decoders = new Decoders();\n", "import { Editor } from 'codemirror';\nimport { decoders } from './Decoders';\n\nexport class IO {\n constructor(private stdin: Editor, private args: Editor) {}\n\n public getArgs(): string {\n return this.args.getValue();\n }\n\n public setArgs(value: string): void {\n this.args.setValue(value);\n }\n\n public argsRefresh(): void {\n this.args.refresh();\n }\n\n public getStdin(): string {\n return decoders\n .decodeAsString(this.stdin.getValue())\n .reduce((value, char) => value + String.fromCharCode(char), '');\n }\n\n public setStdin(value: string): void {\n this.stdin.setValue(value);\n }\n}\n\nexport default IO;\n", "export class Options {\n public options: {\n [key: string]: any;\n } = {};\n\n get(name: string, defaultValue: T = null): T {\n return (this.options[name] as T) ?? defaultValue;\n }\n\n set(name: string, value: any): void {\n this.options[name] = value;\n }\n}\n\nexport const options = new Options();\n\nexport default Options;\n", "import IFrame from './IFrame';\nimport { options } from '../Options';\n\n/**\n * Uses the following icons:\n * https://iconmonstr.com/magnifier-7-svg/\n * https://iconmonstr.com/magnifier-8-svg/\n */\nexport class Image extends IFrame {\n private imageBuffer: string = '';\n private imageMimeType: string = 'image/png';\n private zoomLevel: number = 1;\n\n public activate(mimeType: string) {\n this.zoomLevel = options.get('zoomLevel', 1);\n\n super.activate('text/html');\n\n this.imageMimeType = mimeType;\n }\n\n // TODO: this whole renderer should be a separate package with the contents parsed into a minified file\n private css(): string {\n return `\nhtml, body {\n margin: 0;\n padding: 0;\n}\n\nbody > img {\n --z: ${this.zoomLevel};\n image-rendering: pixelated;\n transform: scale(var(--z));\n transform-origin: 0 0;\n}\n\n.checked {\n background-image: linear-gradient(to right, rgba(192, 192, 192, 0.75), rgba(192, 192, 192, 0.75)),\n linear-gradient(to right, black 50%, white 50%),\n linear-gradient(to bottom, black 50%, white 50%);\n background-blend-mode: normal, difference, normal;\n background-size: 2em 2em;\n}\n\n.controls {\n background: rgba(255, 255, 255, .2);\n border: solid rgba(255, 255, 255, .6);\n border-radius: .3em 0 0 .3em;\n border-width: 1px 0 1px 1px;\n padding: .2em .2em .5em;\n position: fixed;\n right: 0;\n top: 1em;\n}\n\n.controls button {\n appearance: none;\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n\n.controls button.toggle:after {\n content: '\\\\27f5';\n}\n\n.controls.left {\n border-radius: 0 .3em .3em 0;\n border-width: 1px 1px 1px 0;\n left: 0;\n right: auto;\n}\n\n.controls.left header {\n text-align: right;\n}\n\n.controls.left button.toggle:after {\n content: '\\\\27f6';\n}\n\n.controls .zoom-level {\n font-family: sans-serif;\n text-align: center;\n}\n`\n .replace(/\\s*,\\s*/g, ',')\n .replace(/\\s*>\\s*/g, '>')\n .replace(/\\s*;\\s*}\\s*/g, '}')\n .replace(/\\s*{\\s*/g, '{')\n .replace(/\\s*:\\s*/g, ':')\n .replace(/\\s*;\\s*/g, ';');\n }\n\n private data(): string {\n return `\n\n('transparencyCheckerboard', false) ? 'checked' : ''\n }\">\n
\n
\n \n
\n
\n \n \n
${this.zoomLevel * 100}%
\n
\n
\n \n
\n
\n\n`;\n }\n\n // TODO: this whole renderer should be a separate package with the contents parsed into a minified file\n private js(): string {\n return `\n const image = document.querySelector('img'),\n controls = document.querySelector('.controls'),\n zoomLevel = controls.querySelector('.zoom-level'),\n storeOption = (name, value) => {\n if (!parent) {\n return;\n }\n \n parent.postMessage({name:\"setOption\",value:{name,value}}, '${\n location.protocol + '//' + location.host\n }');\n };\n\n document.addEventListener('click', (event) => {\n const target = event.target,\n currentZoom = getComputedStyle(image).getPropertyValue('--z');\n\n if (target.matches('.zoom-in,.zoom-in *')) {\n const newZoom = currentZoom * 2;\n\n image.style.setProperty('--z', newZoom);\n zoomLevel.innerText = (newZoom * 100) + '%';\n \n storeOption('zoomLevel', newZoom);\n }\n\n if (target.matches('.zoom-out,.zoom-out *')) {\n const newZoom = currentZoom / 2;\n\n image.style.setProperty('--z', newZoom);\n zoomLevel.innerText = (newZoom * 100) + '%';\n\n storeOption('zoomLevel', newZoom);\n }\n\n if (target.matches('.toggle,.toggle *')) {\n controls.classList.toggle('left');\n }\n\n if (target.matches('button.checked')) {\n image.classList.toggle('checked');\n\n storeOption('transparencyCheckerboard', image.classList.contains('checked'));\n }\n });\n `;\n }\n\n public matches(mimeType: string): boolean {\n // Using data from: https://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support\n // and: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n return [\n 'image/apng',\n 'image/avif',\n 'image/bmp',\n 'image/gif',\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/vnd.microsoft.icon',\n 'image/webp',\n ].includes(mimeType);\n }\n\n public reset(): void {\n super.reset();\n\n this.imageBuffer = '';\n }\n\n public write(char: number): void;\n public write(data: string): void;\n public write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.imageBuffer += char;\n this.buffer = '';\n\n super.write(this.data());\n }\n}\n\nexport default Image;\n", "export interface Input {\n activate(device: Inputs): void;\n deactivate(): void;\n isActive(): boolean;\n matches(data: string): boolean;\n on(eventName: string, handler: (...args: any[]) => void): void;\n read(): number[];\n readAsString(replaceBinaryBytes: string | null): string;\n reset(): void;\n resize(): void;\n setType(type: string | null): void;\n write(data: string | number[]): void;\n}\n\nexport type InputConstructor = new (\n parent: HTMLElement,\n ...args: any[]\n) => Input;\n\nexport class Inputs {\n private buffer: number[] = [];\n private registered: Input[] = [];\n private type: string;\n\n public constructor(...inputs: Input[]) {\n this.register(...inputs);\n }\n\n private active(): Input {\n const [input] = this.registered.filter((input) => input.isActive());\n\n return input;\n }\n\n public activate(toActivate: InputConstructor | Input): void {\n this.registered.reduce((value, input): boolean => {\n // Activate the required input\n if (\n !value &&\n ((typeof toActivate === 'function' && input instanceof toActivate) ||\n input === toActivate)\n ) {\n if (!input.isActive()) {\n input.activate(this);\n input.reset();\n input.write(this.buffer);\n }\n\n return true;\n }\n\n input.deactivate();\n input.reset();\n\n return value;\n }, false);\n\n this.resize();\n }\n\n public on(eventName: string, handler: (event: Event) => void): void {\n this.registered.forEach((input) => input.on(eventName, handler));\n }\n\n public read(): number[] {\n return this.active().read();\n }\n\n public readAsString(replaceBinaryBytes: string | null = '.'): string {\n return this.active().readAsString(replaceBinaryBytes);\n }\n\n public register(...inputs: Input[]): void {\n this.registered.push(...inputs);\n }\n\n public reset(): void {\n this.buffer.splice(0);\n this.registered.forEach((input) => input.reset());\n }\n\n public resize(): void {\n this.registered.forEach((input) => {\n if (input.isActive()) {\n input.resize();\n }\n });\n }\n\n public setBuffer(buffer: number[]): void {\n this.buffer.push(...buffer);\n }\n\n public setType(type: string | null): void {\n this.type = type;\n\n this.registered.forEach((input) => input.setType(type));\n }\n\n public write(char: number | number[] | string): void {\n const writeBuffer = [];\n\n if (typeof char === 'number') {\n writeBuffer.push(char);\n }\n\n if (Array.isArray(char)) {\n char.forEach((char) => writeBuffer.push(char));\n }\n\n if (typeof char === 'string') {\n char.split('').forEach((char) => writeBuffer.push(char.charCodeAt(0)));\n }\n\n this.registered.filter((input) => {\n if (input.isActive()) {\n input.write(writeBuffer);\n }\n });\n\n writeBuffer.forEach((char) => this.buffer.push(char));\n }\n}\n\nexport default Inputs;\n", "export class InvalidFormat extends TypeError {}\n\nexport default InvalidFormat;\n", "import Image from './Image';\nimport InvalidFormat from './Error/InvalidFormat';\nimport { Renderer } from '../Renderers';\n\nexport type PBMHeader =\n | [string, number, number, number] // P1: type, width, height, offset\n | [string, number, number, number, number]; // P3: type, width, height, maxValue, offset\n\n/**\n * @see https://en.wikipedia.org/wiki/Netpbm\n */\nexport class PBMImage extends Image implements Renderer {\n ppmBuffer: string = '';\n superTimeout: number | null = null;\n\n public activate(mimeType: string) {\n super.activate('image/png');\n }\n\n public matches(mimeType: string): boolean {\n return [\n 'image/x-portable-bitmap',\n 'image/x-portable-graymap',\n 'image/x-portable-pixmap',\n 'image/x-portable-anymap',\n ].includes(mimeType);\n }\n\n public reset() {\n super.reset();\n\n this.ppmBuffer = '';\n }\n\n public write(char: string | number): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.ppmBuffer += char;\n\n if (this.ppmBuffer.length < 10) {\n return;\n }\n\n // Wait for data to stop streaming\n if (this.superTimeout) {\n clearTimeout(this.superTimeout);\n }\n\n this.superTimeout = window.setTimeout(() => {\n try {\n super.reset();\n\n super.write(this.convertToPNG());\n } catch (e) {\n console.error(e);\n }\n }, 50);\n }\n\n private convertToPNG(): string {\n if (!/^P[1-7]/.test(this.ppmBuffer)) {\n throw new InvalidFormat();\n }\n\n const header = this.extractPBMHeader();\n\n if (!header) {\n throw new InvalidFormat();\n }\n\n const [format] = header;\n\n if (!format) {\n throw new InvalidFormat();\n }\n\n if (format === 'P1') {\n const [, width, height, offset] = header;\n\n return this.parseP1(width, height, offset);\n }\n\n if (format === 'P2') {\n const [, width, height, maxValue, offset] = header;\n\n return this.parseP2(width, height, maxValue, offset);\n }\n\n if (format === 'P3') {\n const [, width, height, maxValue, offset] = header;\n\n return this.parseP3(width, height, maxValue, offset);\n }\n\n if (format === 'P4') {\n const [, width, height, offset] = header;\n\n return this.parseP4(width, height, offset);\n }\n\n if (format === 'P5') {\n const [, width, height, maxValue, offset] = header;\n\n return this.parseP2(width, height, maxValue, offset, true);\n }\n\n if (format === 'P6') {\n const [, width, height, maxValue, offset] = header;\n\n return this.parseP3(width, height, maxValue, offset, true);\n }\n\n throw new InvalidFormat('Currently unsupported.');\n }\n\n private createCanvas(\n width: number,\n height: number\n ): [HTMLCanvasElement, CanvasRenderingContext2D, ImageData] {\n const canvas = document.createElement('canvas'),\n context = canvas.getContext('2d'),\n imageData = new ImageData(width, height);\n\n canvas.width = width;\n canvas.height = height;\n\n return [canvas, context, imageData];\n }\n\n private canvasToRawPNG(canvas: HTMLCanvasElement): string {\n // Convert back to raw data from a data: URI\n return atob(\n canvas.toDataURL('image/png').replace(/^data:image\\/png;base64,/, '')\n );\n }\n\n private parseP1(width: number, height: number, offset: number): string {\n const [canvas, context, imageData] = this.createCanvas(width, height),\n data = this.asciiDataGenerator(offset, false);\n\n for (let index = 0; index < width * height * 4; ) {\n const value = data.next().value === 1 ? 0 : 255;\n\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = 255;\n }\n\n context.putImageData(imageData, 0, 0, 0, 0, width, height);\n\n return this.canvasToRawPNG(canvas);\n }\n\n private parseP2(\n width: number,\n height: number,\n maxValue: number,\n offset: number,\n binary: boolean = false\n ): string {\n const [canvas, context, imageData] = this.createCanvas(width, height),\n data = binary\n ? this.binaryDataGenerator(offset)\n : this.asciiDataGenerator(offset);\n\n for (let index = 0; index < width * height * 4; ) {\n const value = Math.floor((data.next().value / maxValue) * 255);\n\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = 255;\n }\n\n context.putImageData(imageData, 0, 0, 0, 0, width, height);\n\n return this.canvasToRawPNG(canvas);\n }\n\n private parseP3(\n width: number,\n height: number,\n maxValue: number,\n offset: number,\n binary: boolean = false\n ): string {\n const [canvas, context, imageData] = this.createCanvas(width, height),\n data = binary\n ? this.binaryDataGenerator(offset)\n : this.asciiDataGenerator(offset);\n\n for (let index = 0; index < width * height * 4; ) {\n imageData.data[index++] = Math.floor(\n ((data.next().value || 0) / maxValue) * 255\n );\n imageData.data[index++] = Math.floor(\n ((data.next().value || 0) / maxValue) * 255\n );\n imageData.data[index++] = Math.floor(\n ((data.next().value || 0) / maxValue) * 255\n );\n imageData.data[index++] = 255;\n }\n\n context.putImageData(imageData, 0, 0, 0, 0, width, height);\n\n return this.canvasToRawPNG(canvas);\n }\n\n private parseP4(width: number, height: number, offset: number): string {\n const [canvas, context, imageData] = this.createCanvas(width, height),\n data = this.binaryBitDataGenerator(offset);\n\n for (let index = 0; index < width * height * 4; ) {\n const value = data.next().value === 1 ? 0 : 255;\n\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = 255;\n }\n\n context.putImageData(imageData, 0, 0, 0, 0, width, height);\n\n return this.canvasToRawPNG(canvas);\n }\n\n private extractPBMHeader(): PBMHeader | null {\n const type = this.ppmBuffer.slice(0, 2),\n withoutMaxValue =\n /^(P[14])\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s*(?:#[^\\n]*\\s*)*/,\n withMaxValue =\n /^(P[2356])\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s*(?:#[^\\n]*\\s*)*/;\n\n if (type === 'P1' || type === 'P4') {\n const match = this.ppmBuffer.match(withoutMaxValue);\n\n if (!match) {\n throw new InvalidFormat();\n }\n\n return [\n match[1], // format\n parseInt(match[2], 10), // width\n parseInt(match[3], 10), // height\n match[0].length, // offset\n ];\n }\n\n if (type === 'P2' || type === 'P3' || type === 'P5' || type === 'P6') {\n const match = this.ppmBuffer.match(withMaxValue);\n\n if (!match) {\n throw new InvalidFormat();\n }\n\n return [\n match[1], // format\n parseInt(match[2], 10), // width\n parseInt(match[3], 10), // height\n parseInt(match[4], 10), // max value\n match[0].length, // offset\n ];\n }\n }\n\n private *asciiDataGenerator(\n offset: number,\n separator: boolean = true\n ): Generator {\n let block = '';\n\n for (\n let currentPosition = offset, comment = false;\n currentPosition < this.ppmBuffer.length;\n currentPosition++\n ) {\n const currentChar = this.ppmBuffer[currentPosition];\n\n if (/#/.test(currentChar)) {\n if (block) {\n yield parseInt(block, 10);\n\n block = '';\n }\n\n comment = true;\n }\n\n if (/\\n/.test(currentChar) && comment) {\n comment = false;\n }\n\n if (comment) {\n continue;\n }\n\n if (/\\s/.test(currentChar) && block.length > 0) {\n yield parseInt(block, 10);\n\n block = '';\n }\n\n if (/\\d/.test(currentChar)) {\n block += currentChar;\n }\n\n if (separator === false && block) {\n yield parseInt(block, 10);\n\n block = '';\n }\n }\n\n yield parseInt(block, 10);\n }\n\n private *binaryDataGenerator(offset: number): Generator {\n let block = '';\n\n for (\n let currentPosition = offset;\n currentPosition < this.ppmBuffer.length;\n currentPosition++\n ) {\n const currentChar = this.ppmBuffer[currentPosition];\n\n yield currentChar.charCodeAt(0);\n }\n\n yield parseInt(block, 10);\n }\n\n private *binaryBitDataGenerator(offset: number): Generator {\n let block = '';\n\n for (\n let currentPosition = offset;\n currentPosition < this.ppmBuffer.length;\n currentPosition++\n ) {\n const currentChar = this.ppmBuffer[currentPosition],\n bitMask = ('0000000' + currentChar.charCodeAt(0).toString(2)).slice(-8);\n\n for (let rowPosition = 0; rowPosition < 8; rowPosition++) {\n yield parseInt(bitMask[rowPosition], 10);\n }\n }\n\n yield parseInt(block, 10);\n }\n}\n\nexport default PBMImage;\n", "import { ITerminalOptions, Terminal } from 'xterm';\nimport Abstract from './Abstract';\nimport { FitAddon } from 'xterm-addon-fit/src/FitAddon';\nimport { Renderer } from '../Renderers';\n\nexport class TTY extends Abstract implements Renderer {\n private buffer: string = '';\n private escapeInput: string = '';\n private fit: FitAddon;\n private maxX: number = 0;\n private maxY: number = 0;\n private options: ITerminalOptions;\n private terminal: Terminal;\n private x: number = 0;\n private y: number = 0;\n\n constructor(parent: HTMLElement, options: ITerminalOptions = {}) {\n super();\n\n this.container = this.createElement('div');\n this.container.classList.add('tty');\n\n parent.append(this.container);\n\n this.fit = new FitAddon();\n\n this.terminal = TTY.createTerminal(options);\n this.terminal.loadAddon(this.fit);\n this.terminal.open(this.container);\n\n this.options = options;\n }\n\n private static cleanText(text: string): string {\n // patch for xterm.js - this allows VT and FF but patches \\n, vs. convertEol option\n return text.replace(/(? parseInt(value || '1', 10))\n : [parseInt(value, 10), 1];\n break;\n }\n\n if (x >= cols) {\n x = cols;\n }\n\n maxX = Math.max(x, maxX);\n maxY = Math.max(y, maxY);\n\n return [x, y, maxX, maxY];\n }\n\n switch (input) {\n case '\\n':\n y++;\n x = 0;\n break;\n\n case '\\f':\n case '\\r':\n case '\\v':\n y++;\n break;\n\n case '\\t':\n x += x % 8 || 8;\n break;\n\n // backspace\n case '\\x08':\n x--;\n break;\n\n default:\n x++;\n }\n\n if (x >= cols) {\n y++;\n x = 0;\n }\n\n maxX = Math.max(x, maxX);\n maxY = Math.max(y, maxY);\n\n return [x, y, maxX, maxY];\n }\n\n private reprocessBufferForSize(): number[] {\n let maxX = 0,\n maxY = 0,\n x = 0,\n y = 0,\n escapeInput = '';\n\n const results = this.buffer.match(/\\x1b\\[(.*?)([\\x40-\\x7e])|(.)/g);\n\n if (!results) {\n return [1, 1];\n }\n\n results.forEach((input) => {\n [input, escapeInput] = this.processInputForEscape(input, escapeInput);\n\n if (input) {\n [x, y, maxX, maxY] = this.processInputForSize(x, y, maxX, maxY, input);\n }\n });\n\n return [maxX + 1, maxY + 1];\n }\n\n public reset(): void {\n this.buffer = '';\n this.escapeInput = '';\n this.maxX = 0;\n this.maxY = 0;\n this.x = 0;\n this.y = 0;\n\n this.terminal.reset();\n }\n\n public resize(): void {\n if (\n this.container.hasAttribute('hidden') ||\n (this.options.cols && this.options.rows)\n ) {\n return;\n }\n\n const [, visibleLines] = this.reprocessBufferForSize(),\n dimensions = this.fit.proposeDimensions();\n\n this.terminal.resize(\n this.options.cols ?? dimensions?.cols ?? this.terminal.cols,\n this.options.rows ?? visibleLines\n );\n }\n\n public write(char: number): void;\n public write(data: string): void;\n public write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.buffer += char;\n\n this.handleInputForSize(char);\n\n const rows = this.maxY + 1;\n\n if (rows !== this.terminal.rows) {\n this.terminal.resize(this.terminal.cols, rows);\n }\n\n this.terminal.write(TTY.cleanText(char));\n }\n}\n\nexport default TTY;\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Terminal, ITerminalAddon } from 'xterm';\n\ninterface ITerminalDimensions {\n /**\n * The number of rows in the terminal.\n */\n rows: number;\n\n /**\n * The number of columns in the terminal.\n */\n cols: number;\n}\n\nconst MINIMUM_COLS = 2;\nconst MINIMUM_ROWS = 1;\n\nexport class FitAddon implements ITerminalAddon {\n private _terminal: Terminal | undefined;\n\n constructor() {}\n\n public activate(terminal: Terminal): void {\n this._terminal = terminal;\n }\n\n public dispose(): void {}\n\n public fit(): void {\n const dims = this.proposeDimensions();\n if (!dims || !this._terminal) {\n return;\n }\n\n // TODO: Remove reliance on private API\n const core = (this._terminal as any)._core;\n\n // Force a full render\n if (this._terminal.rows !== dims.rows || this._terminal.cols !== dims.cols) {\n core._renderService.clear();\n this._terminal.resize(dims.cols, dims.rows);\n }\n }\n\n public proposeDimensions(): ITerminalDimensions | undefined {\n if (!this._terminal) {\n return undefined;\n }\n\n if (!this._terminal.element || !this._terminal.element.parentElement) {\n return undefined;\n }\n\n // TODO: Remove reliance on private API\n const core = (this._terminal as any)._core;\n\n if (core._renderService.dimensions.actualCellWidth === 0 || core._renderService.dimensions.actualCellHeight === 0) {\n return undefined;\n }\n\n const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement);\n const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));\n const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width')));\n const elementStyle = window.getComputedStyle(this._terminal.element);\n const elementPadding = {\n top: parseInt(elementStyle.getPropertyValue('padding-top')),\n bottom: parseInt(elementStyle.getPropertyValue('padding-bottom')),\n right: parseInt(elementStyle.getPropertyValue('padding-right')),\n left: parseInt(elementStyle.getPropertyValue('padding-left'))\n };\n const elementPaddingVer = elementPadding.top + elementPadding.bottom;\n const elementPaddingHor = elementPadding.right + elementPadding.left;\n const availableHeight = parentElementHeight - elementPaddingVer;\n const availableWidth = parentElementWidth - elementPaddingHor - core.viewport.scrollBarWidth;\n const geometry = {\n cols: Math.max(MINIMUM_COLS, Math.floor(availableWidth / core._renderService.dimensions.actualCellWidth)),\n rows: Math.max(MINIMUM_ROWS, Math.floor(availableHeight / core._renderService.dimensions.actualCellHeight))\n };\n return geometry;\n }\n}\n", "import { Decoder } from '../Decoders';\nimport Default from './Default';\n\nexport class Xxd extends Default implements Decoder {\n public name(): string {\n return 'xxd';\n }\n\n public matchesAsString(code: string): boolean {\n return /^([\\da-f]{7,8}: (((.{2}){1,2} ){1,8}) .+(\\n|$))+$/.test(code);\n }\n\n public decodeAsString(code: string): number[] {\n return code\n .trim()\n .replace(/(?<=^|\\n)[\\da-f]{7,8}: (((.{2}){1,2} ){1,8}).+/g, '$1')\n .replace(/\\s+/g, '')\n .match(/../g)\n .map((c: string): number => parseInt(c, 16));\n }\n}\nexport default Xxd;\n", "import Base64 from './Decoders/Base64';\nimport Default from './Decoders/Default';\nimport Hexdump from './Decoders/Hexdump';\nimport JavaScript from './langs/javascript-browser/JavaScript';\nimport Perl from './langs/webperl-5.28.1/Perl';\nimport UI from './UI';\nimport Xxd from './Decoders/Xxd';\nimport { decoders } from './Decoders';\nimport { langs } from './Langs';\n\ndecoders.register(new Xxd(), new Hexdump(), new Base64(), new Default());\nlangs.register(new JavaScript(), new Perl());\n\nconst ui = new UI();\n"], - "mappings": "giBAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,EASC,SAAUC,EAAQC,EAAS,CAC1B,OAAOH,IAAY,UAAY,OAAOC,GAAW,IAAcA,GAAO,QAAUE,EAAQ,EACxF,OAAO,QAAW,YAAc,OAAO,IAAM,OAAOA,CAAO,GAC1DD,EAASA,GAAU,KAAMA,EAAO,WAAaC,EAAQ,EACxD,GAAEH,GAAO,UAAY,CAAE,aAIrB,IAAII,EAAY,UAAU,UACtBC,EAAW,UAAU,SAErBC,EAAQ,aAAa,KAAKF,CAAS,EACnCG,EAAY,UAAU,KAAKH,CAAS,EACpCI,EAAU,wCAAwC,KAAKJ,CAAS,EAChEK,EAAO,cAAc,KAAKL,CAAS,EACnCM,EAAKH,GAAaC,GAAWC,EAC7BE,EAAaD,IAAOH,EAAY,SAAS,cAAgB,EAAI,EAAEE,GAAQD,GAAS,CAAC,GACjFI,EAAS,CAACH,GAAQ,WAAW,KAAKL,CA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AAK,EACX,IAAKC,GAAsB,SAASA,EAAG,EAAE,CAAC,CAC/C,CACF,EACOC,GAAQJ,GCXfK,GAAS,SAAS,IAAIC,GAAO,IAAIC,GAAW,IAAIC,GAAU,IAAIC,EAAS,EACvEC,GAAM,SAAS,IAAIC,GAAc,IAAIC,EAAM,EAE3C,IAAMC,GAAK,IAAIC", - "names": ["require_codemirror", "__commonJSMin", "exports", "module", "global", "factory", "userAgent", "platform", "gecko", "ie_upto10", "ie_11up", "edge", "ie", "ie_version", "webkit", "qtwebkit", "chrome", "chrome_version", "presto", "safari", "mac_geMountainLion", "phantom", "ios", "android", "mobile", "mac", "chromeOS", "windows", "presto_version", "flipCtrlCmd", "captureRightClick", "classTest", "cls", "rmClass", "node", "current", "match", "after", "removeChildren", "count", "removeChildrenAndAdd", "parent", "e", "elt", "tag", "content", "className", "style", "i", "eltP", "range", "start", "end", "endNode", "r", "contains", "child", "activeElt", "rootNode", "doc", "activeElement", "addClass", "joinClasses", "a", "b", "as", "selectInput", "cm", "root", "element", "win", "bind", "f", "args", "copyObj", "obj", "target", "overwrite", "prop", "countColumn", "string", "tabSize", "startIndex", "startValue", "n", "nextTab", "Delayed", "self", "ms", "time", "indexOf", "array", "scrollerGap", "Pass", "sel_dontScroll", "sel_mouse", "sel_move", "findColumn", "goal", "pos", "col", "skipped", "spaceStrs", "spaceStr", "lst", "arr", "map", "out", "insertSorted", "value", "score", "priority", "nothing", "createObj", "base", "props", "inst", "nonASCIISingleCaseWordChar", "isWordCharBasic", "ch", "isWordChar", "helper", "isEmpty", "extendingChars", "isExtendingChar", "skipExtendingChars", "str", "dir", "findFirst", "pred", "from", "to", "midF", "mid", "iterateBidiSections", "order", "found", "part", "bidiOther", "getBidiPartAt", "sticky", "cur", "bidiOrdering", "lowTypes", "arabicTypes", "charType", "code", "bidiRE", "isNeutral", "isStrong", "countsAsLeft", "countsAsNum", "BidiSpan", "level", "direction", "outerType", "len", "types", "i$1", "prev", "type", "i$2", "type$1", "i$3", "prev$1", "type$2", "i$4", "type$3", "replace", "j", "i$5", "cur$1", "type$4", "i$6", "end$1", "before", "replace$1", "j$1", "m", "i$7", "at", "isRTL", "j$2", "nstart", "getOrder", "line", "noHandlers", "on", "emitter", "getHandlers", "off", "index", "signal", "handlers", "signalDOMEvent", "override", "e_defaultPrevented", "signalCursorActivity", "set", "hasHandler", "eventMixin", "ctor", "e_preventDefault", "e_stopPropagation", "e_stop", "e_target", "e_button", "dragAndDrop", "div", "zwspSupported", "zeroWidthElement", "measure", "test", "badBidiRects", "hasBadBidiRects", "txt", "r0", "r1", "splitLinesAuto", "result", "l", "nl", "rt", "hasSelection", "te", "hasCopyEvent", "badZoomedRects", "hasBadZoomedRects", "normal", "fromRange", "modes", "mimeModes", "defineMode", "name", "mode", "defineMIME", "mime", "spec", "resolveMode", "getMode", "options", "mfactory", "modeObj", "modeExtensions", "exts", "prop$1", "extendMode", "properties", "copyState", "state", "nstate", "val", "innerMode", "info", "startState", "a1", "a2", "StringStream", "lineOracle", "ok", "pattern", "consume", "caseInsensitive", "cased", "substr", "inner", "oracle", "getLine", "chunk", "sz", "getBetween", "text", "getLines", "updateLineHeight", "height", "diff", "lineNo", "no", "lineAtHeight", "h", "outer", "lh", "isLine", "lineNumberFor", "Pos", "cmp", "equalCursorPos", "copyPos", "x", "maxPos", "minPos", "clipLine", "clipPos", "last", "clipToLen", "linelen", "clipPosArray", "SavedContext", "lookAhead", "Context", "saved", "copy", "highlightLine", "context", "forceToEnd", "st", "lineClasses", "runMode", "loop", "o", "overlay", "i_end", "getLineStyles", "updateFrontier", "getContextBefore", "resetState", "precise", "display", "findStartLine", "processLine", "startAt", "stream", "callBlankLine", "readToken", "Token", "takeToken", "asArray", "tokens", "extractLineClasses", "output", "lineClass", "flattenSpans", "curStart", "curStyle", "mName", "minindent", "minline", "lim", "search", "indented", "retreatFrontier", "sawReadOnlySpans", "sawCollapsedSpans", "seeReadOnlySpans", "seeCollapsedSpans", "MarkedSpan", "marker", "getMarkedSpanFor", "spans", "span", "removeMarkedSpan", "addMarkedSpan", "op", "inThisOp", "markedSpansBefore", "old", "startCh", "isInsert", "nw", "startsBefore", "endsAfter", "markedSpansAfter", "endCh", "stretchSpansOverChange", "change", "oldFirst", "oldLast", "first", "sameLine", "offset", "span$1", "found$1", "clearEmptySpans", "newMarkers", "gap", "gapMarkers", "removeReadOnlyRanges", "markers", "mark", "parts", "mk", "p", "newParts", "dfrom", "dto", "detachMarkedSpans", "attachMarkedSpans", "extraLeft", "extraRight", "compareCollapsedMarkers", "lenDiff", "aPos", "bPos", "fromCmp", "toCmp", "collapsedSpanAtSide", "sps", "sp", "collapsedSpanAtStart", "collapsedSpanAtEnd", "collapsedSpanAround", "conflictingCollapsedRange", "visualLine", "merged", "visualLineEnd", "visualLineContinued", "lines", "visualLineNo", "lineN", "vis", "visualLineEndNo", "lineIsHidden", "lineIsHiddenInner", "heightAtLine", "lineObj", "lineLength", "findMaxLine", "d", "Line", "markedSpans", "estimateHeight", "updateLine", "estHeight", "cleanUpLine", "styleToClassCache", "styleToClassCacheWithMode", "interpretTokenStyle", "cache", "buildLineContent", "lineView", "builder", "buildToken", "buildTokenBadBidi", "allowFrontierUpdate", "insertLineContent", "defaultSpecialCharPlaceholder", "token", "startStyle", "endStyle", "css", "attributes", "displayText", "splitSpaces", "special", "mustWrap", "txt$1", "tabWidth", "fullStyle", "attr", "trailingBefore", "spaceBefore", "buildCollapsedSpan", "size", "ignoreWidget", "widget", "styles", "allText", "nextChange", "spanStyle", "spanEndStyle", "spanStartStyle", "collapsed", "foundBookmarks", "endStyles", "upto", "tokenText", "LineView", "buildViewArray", "nextPos", "view", "operationGroup", "pushOperation", "fireCallbacksForOps", "group", "callbacks", "finishOperation", "endCb", "orphanDelayedCallbacks", "signalLater", "list", "fireOrphanDelayed", "delayed", "updateLineForChanges", "dims", "updateLineText", "updateLineGutter", "updateLineClasses", "updateLineWidgets", "ensureLineWrapped", "updateLineBackground", "wrap", "getLineContent", "ext", "built", "textClass", "wrap$1", "gutterWrap", "k", "id", "isWidget", "next", "insertLineWidgets", "buildLineElement", "insertLineWidgetsFor", "allowAbove", "ws", "positionLineWidget", "width", "widgetHeight", "parentStyle", "eventInWidget", "paddingTop", "paddingVert", "paddingH", "data", "scrollGap", "displayWidth", "displayHeight", "ensureLineHeights", "rect", "wrapping", "curWidth", "heights", "rects", "mapFromLineView", "updateExternalMeasurement", "measureChar", "bias", "measureCharPrepared", "prepareMeasureForLine", "findViewForLine", "findViewIndex", "getDimensions", "prepared", "varHeight", "key", "measureCharInner", "nullRect", "nodeAndOffsetInLineMap", "collapse", "mStart", "mEnd", "getUsefulRect", "place", "maybeUpdateRectForZooming", "rSpan", "charWidth", "rtop", "rbot", "top", "bot", "scaleX", "scaleY", "clearLineMeasurementCacheFor", "clearLineMeasurementCache", "clearCaches", "pageScrollX", "pageScrollY", "widgetTopHeight", "ref", "widgets", "intoCoordSystem", "includeWidgets", "yOff", "lOff", "xOff", "fromCoordSystem", "coords", "left", "localBox", "lineSpaceBox", "charCoords", "cursorCoords", "preparedMeasure", "get", "right", "getBidi", "partPos", "invert", "other", "estimateCoords", "PosWithInfo", "outside", "xRel", "coordsChar", "y", "coordsCharInner", "rangeEnd", "wrappedLineExtent", "begin", "wrappedLineExtentChar", "targetTop", "boxIsAfter", "box", "ltr", "coordsBidiPartWrapped", "coordsBidiPart", "chAround", "boxAround", "baseX", "atLeft", "atStart", "_lineNo", "closestDist", "endX", "dist", "measureText", "textHeight", "anchor", "pre", "gutterLeft", "compensateForHScroll", "th", "perLine", "widgetsHeight", "estimateLineHeights", "est", "posFromMouse", "liberal", "forRect", "space", "colDiff", "regChange", "lendiff", "resetView", "cut", "viewCuttingPoint", "cut$1", "cutTop", "cutBot", "regLineChange", "oldN", "newN", "adjustView", "countDirtyView", "dirty", "updateSelection", "prepareSelection", "primary", "curFragment", "selFragment", "customCursor", "head", "drawSelectionCursor", "drawSelectionRange", "cursor", "charPos", "otherCursor", "cmpCoords", "fragment", "padding", "leftSide", "rightSide", "docLTR", "add", "bottom", "drawForLine", "fromArg", "toArg", "lineLen", "wrapX", "side", "extent", "fromPos", "toPos", "openStart", "openEnd", "openLeft", "openRight", "topLeft", "topRight", "botLeft", "botRight", "sFrom", "sTo", "fromLine", "toLine", "singleVLine", "leftEnd", "rightStart", "restartBlink", "onBlur", "ensureFocus", "onFocus", "delayBlurEvent", "updateHeightsInViewport", "prevBottom", "viewTop", "oldHeight", "mustScroll", "updateWidgetHeight", "chWidth", "w", "visibleLines", "viewport", "ensureFrom", "ensureTo", "maybeScrollWindow", "doScroll", "scrollNode", "scrollPosIntoView", "margin", "limit", "changed", "endCoords", "scrollPos", "calculateScrollPos", "startTop", "startLeft", "updateScrollTop", "setScrollLeft", "scrollIntoView", "snapMargin", "screentop", "screen", "docBottom", "atTop", "atBottom", "newTop", "gutterSpace", "screenleft", "screenw", "tooWide", "addToScrollTop", "resolveScrollToPos", "ensureCursorVisible", "scrollToCoords", "scrollToRange", "scrollToCoordsRange", "sPos", "updateDisplaySimple", "setScrollTop", "startWorker", "forceScroll", "isScroller", "alignHorizontally", "measureForScrollbars", "gutterW", "docH", "NativeScrollbars", "scroll", "vert", "horiz", "needsH", "needsV", "sWidth", "totalHeight", "totalWidth", "bar", "delay", "maybeDisable", "NullScrollbars", "updateScrollbars", "startWidth", "startHeight", "updateScrollbarsInner", "sizes", "scrollbarModel", "initScrollbars", "axis", "nextOpId", "startOperation", "endOperation", "endOperations", "ops", "endOperation_R1", "endOperation_W1", "endOperation_R2", "endOperation_W2", "endOperation_finish", "maybeClipScrollbars", "DisplayUpdate", "updateDisplayIfNeeded", "takeFocus", "setDocumentHeight", "postUpdateDisplay", "hidden", "unhidden", "runInOp", "operation", "methodOp", "docMethodOp", "highlightWorker", "changedLines", "oldStyles", "highlighted", "oldCls", "newCls", "ischange", "force", "selectionSnapshot", "active", "sel", "restoreSelection", "snapshot", "update", "maybeUpdateLineNumberWidth", "different", "toUpdate", "selSnapshot", "patchDisplay", "barMeasure", "updateNumbersFrom", "lineNumbers", "container", "rm", "updateNumber", "updateGutterSpace", "comp", "align", "innerW", "getGutters", "gutters", "sawLineNumbers", "renderGutters", "specs", "gElt", "updateGutters", "Display", "input", "wheelSamples", "wheelPixelsPerUnit", "wheelEventDelta", "dx", "dy", "wheelEventPixels", "delta", "onScrollWheel", "pixelsPerUnit", "canScrollX", "canScrollY", "pixels", "movedX", "movedY", "sample", "Selection", "ranges", "primIndex", "here", "there", "Range", "normalizeSelection", "mayTouch", "prim", "inv", "simpleSelection", "changeEnd", "adjustForChange", "computeSelAfterChange", "offsetPos", "computeReplacedSel", "changes", "hint", "oldPrev", "newPrev", "loadMode", "resetModeState", "isWholeLineUpdate", "updateDoc", "spansFor", "linesFor", "firstLine", "lastLine", "lastText", "lastSpans", "nlines", "added", "added$1", "added$2", "linkedDocs", "sharedHistOnly", "propagate", "skip", "sharedHist", "rel", "shared", "attachDoc", "setDirectionClass", "directionChanged", "History", "historyChangeFromChange", "histChange", "attachLocalSpans", "clearSelectionEvents", "lastChangeEvent", "hist", "addChangeToHistory", "selAfter", "opId", "pushSelectionToHistory", "selectionEventCanBeMerged", "origin", "addSelectionToHistory", "dest", "existing", "removeClearedSpans", "getOldSpans", "mergeOldSpans", "stretched", "oldCur", "stretchCur", "copyHistoryArray", "events", "newGroup", "instantiateSel", "event", "newChanges", "extendRange", "extend", "posBefore", "extendSelection", "setSelection", "extendSelections", "heads", "newSel", "replaceOneSelection", "setSimpleSelection", "filterSelectionChange", "setSelectionReplaceHistory", "done", "setSelectionNoUndo", "setSelectionInner", "skipAtomicInSelection", "reCheckSelection", "mayClear", "newAnchor", "skipAtomic", "newHead", "skipAtomicInner", "oldPos", "preventCursorLeft", "preventCursorRight", "near", "movePos", "far", "selectAll", "filterChange", "makeChange", "ignoreReadOnly", "split", "makeChangeInner", "makeChangeSingleDoc", "rebased", "rebaseHist", "makeChangeFromHistory", "allowSelectionOnly", "suppress", "source", "antiChanges", "filter", "returned", "shiftDoc", "distance", "shift", "makeChangeSingleDocInEditor", "recomputeMaxLength", "checkWidthStart", "changesHandler", "changeHandler", "replaceRange", "assign", "rebaseHistSelSingle", "rebaseHistArray", "sub", "changeLine", "handle", "changeType", "LeafChunk", "BranchChunk", "children", "remaining", "leaf", "me", "spilled", "sibling", "myIndex", "used", "LineWidget", "opt", "adjustScrollWhenAboveVisible", "this$1", "oldH", "addLineWidget", "aboveVisible", "nextMarkerId", "TextMarker", "withOp", "min", "max", "visual", "dHeight", "markText", "markTextShared", "curLine", "updateMaxLine", "SharedTextMarker", "findSharedMarkers", "copySharedMarkers", "mFrom", "mTo", "subMark", "detachSharedMarkers", "linked", "subMarker", "nextDocId", "Doc", "lineSep", "dup", "undone", "forceSplit", "gen", "histData", "gutterID", "where", "realOpts", "sepSize", "copyHistory", "CodeMirror", "link", "splitIds", "lastDrop", "onDrop", "clearDragCursor", "files", "read", "markAsReadAndPasteIfAllFilesAreRead", "t", "readTextFromFile", "file", "reader", "text$1", "selected", "onDragStart", "img", "onDragOver", "frag", "forEachCodeMirror", "byClass", "editors", "globalsRegistered", "ensureGlobalHandlers", "registerGlobalHandlers", "resizeTimer", "onResize", "keyNames", "keyMap", "normalizeKeyName", "alt", "ctrl", "cmd", "mod", "normalizeKeyMap", "keymap", "keyname", "keys", "lookupKey", "getKeyMap", "isModifierKey", "addModifierNames", "noShift", "keyName", "deleteNearSelection", "compute", "kill", "toKill", "replaced", "moveCharLogically", "moveLogically", "endOfLine", "visually", "moveInStorageOrder", "prep", "moveVisually", "bidi", "mv", "getWrappedLineExtent", "searchInVisualLine", "getRes", "res", "nextCh", "commands", "leftPos", "rightPos", "lineStart", "lineStartSmart", "lineEnd", "spaces", "sels", "firstNonWS", "inWS", "doHandleBinding", "bound", "dropShift", "prevShift", "lookupKeyForEditor", "stopSeq", "dispatchKey", "seq", "dispatchKeyInner", "handleKeyBinding", "handleCharBinding", "lastStoppedKey", "onKeyDown", "handled", "showCrossHair", "lineDiv", "up", "onKeyUp", "onKeyPress", "keyCode", "charCode", "DOUBLECLICK_DELAY", "PastClick", "button", "lastClick", "lastDoubleClick", "clickRepeat", "now", "onMouseDown", "clickInGutter", "repeat", "handleMappedButton", "leftButtonDown", "configureMouse", "option", "behavior", "contained", "leftButtonStartDrag", "leftButtonSelect", "moved", "dragEnd", "mouseMove", "dragStart", "e2", "rangeForUnit", "unit", "ourRange", "ourIndex", "startSel", "lastPos", "extendTo", "startCol", "posCol", "oldRange", "ranges$1", "bidiSimplify", "editorSize", "counter", "curCount", "visible", "move", "anchorLine", "boundary", "headIndex", "usePart", "gutterEvent", "prevent", "mX", "mY", "lineBox", "g", "gutter", "onContextMenu", "contextMenuInGutter", "themeChanged", "Init", "defaults", "optionHandlers", "defineOptions", "deflt", "notOnInit", "newBreaks", "wrappingChanged", "integer", "dragDropChanged", "wasOn", "funcs", "toggle", "registerEventHandlers", "initHooks", "word", "touchFinished", "prevTouch", "finishTouch", "isMouseLikeTouchEvent", "touch", "farAway", "inp", "indentLine", "how", "aggressive", "curSpace", "curSpaceString", "indentation", "indentString", "pos$1", "lastCopied", "setLastCopied", "newLastCopied", "applyTextInput", "inserted", "deleted", "recent", "paste", "textLines", "multiPaste", "updateInput", "changeEvent", "triggerElectric", "handlePaste", "pasted", "copyableRanges", "lineRange", "disableBrowserMagic", "field", "spellcheck", "autocorrect", "autocapitalize", "hiddenTextarea", "addEditorMethods", "helpers", "maps", "overlays", "newRanges", "help", "vspace", "hspace", "amount", "findPosH", "goalColumn", "findPosV", "goals", "headPos", "startChar", "check", "scroller", "interpret", "phraseText", "phrases", "predicate", "origDir", "lineDir", "findNextLine", "moveOnce", "boundToLine", "astral", "sawType", "pageSize", "moveAmount", "ContentEditableInput", "belongsToInput", "onCopyCut", "kludge", "hadFocus", "label", "curAnchor", "domToPos", "curFocus", "posToDOM", "rng", "poll", "isInGutter", "fromIndex", "fromNode", "toIndex", "toNode", "newText", "domTextBetween", "oldText", "cutFront", "cutEnd", "oldTop", "maxCutFront", "newBot", "oldBot", "maxCutEnd", "chFrom", "chTo", "scan", "badPos", "bad", "closing", "extraLinebreak", "recognizeMarker", "close", "addText", "walk", "cmText", "markerID", "isBlock", "lineNode", "locateNodeInLineView", "wrapper", "textNode", "topNode", "find", "curNode", "dist$1", "TextareaInput", "prepareCopyCut", "_display", "opts", "wrapOff", "lineOff", "drawn", "typing", "missed", "prevInput", "same", "reset", "oldCSS", "oldWrapperCSS", "wrapperBox", "oldScrollY", "rehide", "prepareSelectAllHack", "extval", "mouseup", "fromTextArea", "textarea", "hasFocus", "save", "realSubmit", "form", "wrappedSubmit", "addLegacyProps", "dontDelegate", "method", "func", "require_javascript", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "config", "parserConfig", "indentUnit", "statementIndent", "jsonldMode", "jsonMode", "trackScope", "isTS", "wordRE", "keywords", "kw", "type", "A", "B", "C", "D", "operator", "atom", "isOperatorChar", "isJsonldKeyword", "readRegexp", "stream", "escaped", "next", "inSet", "content", "ret", "tp", "style", "cont", "tokenBase", "state", "ch", "tokenString", "tokenComment", "expressionAllowed", "tokenQuasi", "word", "quote", "maybeEnd", "brackets", "findFatArrow", "arrow", "m", "depth", "sawSomething", "pos", "bracket", "atomicTypes", "JSLexical", "indented", "column", "align", "prev", "info", "inScope", "varname", "v", "cx", "parseJS", "cc", "combinator", "expression", "statement", "pass", "i", "inList", "name", "list", "register", "newContext", "registerVarScoped", "Var", "context", "inner", "Context", "isModifier", "vars", "block", "defaultVars", "pushcontext", "pushblockcontext", "popcontext", "pushlex", "result", "indent", "outer", "poplex", "expect", "wanted", "exp", "value", "vardef", "parenExpr", "maybeexpression", "maybeelse", "functiondef", "forspec", "className", "enumdef", "typename", "typeexpr", "pattern", "maybelabel", "maybeCatchBinding", "afterExport", "afterImport", "funarg", "expressionInner", "expressionNoComma", "noComma", "body", "arrowBodyNoComma", "arrowBody", "commasep", "maybeop", "maybeoperatorNoComma", "maybeoperatorComma", "classExpression", "arrayLiteral", "contCommasep", "objprop", "quasi", "maybeTarget", "me", "expr", "property", "continueQuasi", "targetNoComma", "target", "maybeTypeArgs", "_", "getterSetter", "afterprop", "maybetype", "what", "end", "sep", "proceed", "lex", "maybetypeOrIn", "mayberettype", "isKW", "afterType", "typeprops", "typearg", "maybeReturnType", "quasiType", "typeprop", "functiondecl", "continueQuasiType", "typeparam", "maybeTypeDefault", "maybeAssign", "vardefCont", "eltpattern", "proppattern", "_type", "forspec1", "forspec2", "classNameAfter", "classBody", "classfield", "isInterface", "maybeFrom", "exportField", "importSpec", "maybeMoreImports", "maybeAs", "enummember", "isContinuedStatement", "textAfter", "backUp", "basecolumn", "firstChar", "lexical", "top", "c", "closing", "require_perl", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "PERL", "RXstyle", "RXmodifiers", "tokenChain", "stream", "state", "chain", "style", "tail", "e", "c", "i", "tokenPerl", "tokenSOMETHING", "string", "ch", "prefix", "p", "n", "look", "eatSuffix", "suffix", "x", "y", "require_Melba", "__commonJSMin", "exports", "__assign", "t", "s", "i", "n", "p", "__spreadArray", "to", "from", "pack", "l", "ar", "matchesFunction", "element", "property", "focusedSelector", "Melba", "_a", "_this", "_b", "animation", "_c", "animationDuration", "_d", "closeLabel", "_e", "container", "_f", "containerClass", "_g", "containerElement", "content", "_h", "events", "_j", "hide", "_k", "root", "_l", "toastClass", "_m", "toastElement", "_o", "toastEvents", "_p", "toastHideClass", "_q", "toastShowClass", "_r", "type", "event", "eventName", "force", "transitionEndHandler_1", "transitionStartHandler_1", "bound_1", "mouseOverHandler_1", "closeButton", "existingContainer", "callable", "hasEvent", "args", "_i", "settings", "root", "factory", "exports", "module", "define", "amd", "a", "i", "self", "e", "t", "r", "n", "o", "s", "c", "l", "h", "u", "f", "_terminal", "_renderService", "_liveRegionLineCount", "_charsToConsume", "_charsToAnnounce", "_accessibilityTreeRoot", "document", "createElement", "classList", "add", "tabIndex", "_rowContainer", "setAttribute", "_rowElements", "rows", "_createAccessibilityTreeNode", "appendChild", "_topBoundaryFocusListener", "_onBoundaryFocus", "_bottomBoundaryFocusListener", "addEventListener", "length", "_refreshRowsDimensions", "_renderRowsDebouncer", "TimeBasedDebouncer", "_renderRows", "bind", "_refreshRows", "_liveRegion", "element", "Error", "insertAdjacentElement", "register", "onResize", "_onResize", "onRender", "start", "end", "onScroll", "onA11yChar", "char", "_onChar", "onLineFeed", "onA11yTab", "spaceCount", "_onTab", "onKey", "_onKey", "key", "onBlur", "_clearLiveRegion", "onDimensionsChange", "_screenDprMonitor", "ScreenDprMonitor", "setListener", "addDisposableDomListener", "window", "dispose", "removeElementFromParent", "this", "position", "boundaryElement", "target", "beforeBoundaryElement", "getAttribute", "buffer", "lines", "relatedTarget", "topBoundaryElement", "bottomBoundaryElement", "pop", "removeChild", "shift", "removeEventListener", "newElement", "unshift", "push", "scrollLines", "focus", "preventDefault", "stopImmediatePropagation", "children", "_refreshRowDimensions", "MAX_ROWS_TO_READ", "textContent", "Strings", "tooMuchOutput", "isMac", "parentNode", "setTimeout", "keyChar", "refresh", "setSize", "toString", "lineData", "translateBufferLineToString", "ydisp", "posInSet", "innerText", "_announceCharacters", "dimensions", "actualCellHeight", "style", "height", "Disposable", "AccessibilityManager", "prepareTextForTerminal", "text", "replace", "bracketTextForPaste", "bracketedPasteMode", "paste", "textarea", "coreService", "decPrivateModes", "triggerDataEvent", "value", "moveTextAreaUnderMouseCursor", "ev", "screenElement", "pos", "getBoundingClientRect", "left", "clientX", "top", "clientY", "width", "zIndex", "selectionService", "clipboardData", "setData", "selectionText", "stopPropagation", "getData", "shouldSelectWord", "rightClickSelect", "select", "_color", "_rgba", "clear", "setCss", "bg", "fg", "getCss", "undefined", "setColor", "getColor", "ColorContrastCache", "DEFAULT_FOREGROUND", "css", "toColor", "DEFAULT_BACKGROUND", "DEFAULT_CURSOR", "DEFAULT_CURSOR_ACCENT", "DEFAULT_SELECTION", "rgba", "DEFAULT_ANSI_COLORS", "Object", "freeze", "colors", "v", "g", "b", "channels", "toCss", "toRgba", "allowTransparency", "canvas", "ctx", "getContext", "_ctx", "globalCompositeOperation", "_litmusColor", "createLinearGradient", "_contrastCache", "foreground", "background", "cursor", "cursorAccent", "selectionTransparent", "selectionOpaque", "color", "blend", "selectionForeground", "ansi", "slice", "contrastCache", "_updateRestoreColors", "onOptionsChange", "setTheme", "theme", "_parseColor", "selection", "nullColor", "isOpaque", "opacity", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "brightBlack", "brightRed", "brightGreen", "brightYellow", "brightBlue", "brightMagenta", "brightCyan", "brightWhite", "restoreColor", "slot", "_restoreColors", "fallback", "fillStyle", "console", "warn", "fillRect", "data", "getImageData", "substring", "split", "map", "component", "Number", "alpha", "Math", "round", "ColorManager", "elements", "parentElement", "node", "type", "handler", "options", "disposed", "_bufferService", "_logService", "_unicodeService", "_linkMatchers", "_nextLinkMatcherId", "_onShowLinkUnderline", "EventEmitter", "_onHideLinkUnderline", "_onLinkTooltip", "_rowsToLinkify", "event", "attachToDom", "mouseZoneManager", "_element", "_mouseZoneManager", "linkifyRows", "min", "max", "clearAll", "_rowsTimeoutId", "clearTimeout", "_linkifyRows", "Linkifier", "_timeBeforeLatency", "absoluteRowIndexStart", "absoluteRowIndexEnd", "overscanLineLimit", "ceil", "cols", "iterator", "hasNext", "next", "_doLinkifyRow", "range", "first", "content", "debug", "registerLinkMatcher", "regex", "matcher", "id", "matchIndex", "validationCallback", "hoverTooltipCallback", "tooltipCallback", "hoverLeaveCallback", "leaveCallback", "willLinkActivate", "priority", "_addLinkMatcherToList", "splice", "deregisterLinkMatcher", "matcherId", "rowIndex", "match", "rex", "RegExp", "source", "flags", "stringIndex", "uri", "indexOf", "lastIndex", "bufferIndex", "stringIndexToBufferIndex", "line", "get", "attr", "getFg", "isValid", "_addLink", "exec", "x", "y", "getStringCellWidth", "x1", "y1", "floor", "x2", "y2", "MouseZone", "newWindow", "open", "opener", "location", "href", "fire", "_createLinkHoverEvent", "remove", "IBufferService", "ILogService", "IUnicodeService", "clickCallback", "hoverCallback", "_", "_linkProviders", "_linkCacheDisposables", "_isMouseOut", "_activeLine", "getDisposeArrayDisposable", "_currentLink", "registerLinkProvider", "linkProvider", "providerIndex", "mouseService", "renderService", "_mouseService", "_clearCurrentLink", "_onMouseMove", "_handleMouseDown", "_handleMouseUp", "_lastMouseEvent", "_positionFromMouseEvent", "composedPath", "contains", "_lastBufferCell", "_onHover", "_askForLink", "_linkAtPosition", "link", "useLineCache", "_activeProviderReplies", "forEach", "reply", "linkWithState", "Map", "linkProvided", "_checkLinkProviderResult", "provideLinks", "links", "linksWithState", "set", "size", "_removeIntersectingLinks", "entries", "d", "replies", "occupiedCells", "Set", "providerReply", "startX", "endX", "has", "index", "hasLinkBefore", "j", "linkAtPosition", "find", "_handleNewLink", "currentLink", "_mouseDownLink", "activate", "startRow", "endRow", "_linkLeave", "disposeArray", "state", "decorations", "underline", "pointerCursor", "isHovered", "_linkHover", "defineProperties", "toggle", "_fireUnderlineEvent", "onRenderedViewportChange", "hover", "showEvent", "scrollOffset", "_createLinkUnderlineEvent", "leave", "sameLine", "wrappedFromLeft", "wrappedToRight", "coords", "getCoords", "Linkifier2", "promptLabel", "_screenElement", "_selectionService", "_optionsService", "_zones", "_areZonesActive", "_lastHoverCoords", "_initialSelectionLength", "_onMouseDown", "_mouseMoveListener", "_mouseLeaveListener", "_onMouseLeave", "_clickListener", "_onClick", "_deactivate", "zone", "_activate", "_currentZone", "pageX", "pageY", "_findZoneEventAt", "_tooltipTimeout", "_onTooltip", "rawOptions", "linkTooltipHoverDuration", "_getSelectionLength", "currentSelectionLength", "IMouseService", "ISelectionService", "IOptionsService", "MouseZoneManager", "_renderCallback", "_refreshCallbacks", "_animationFrame", "cancelAnimationFrame", "addRefreshCallback", "callback", "requestAnimationFrame", "_innerRefresh", "rowStart", "rowEnd", "rowCount", "_rowCount", "_rowStart", "_rowEnd", "_runRefreshCallbacks", "RenderDebouncer", "_currentDevicePixelRatio", "devicePixelRatio", "listener", "_listener", "clearListener", "_outerListener", "_updateDpr", "_resolutionMediaMatchList", "removeListener", "matchMedia", "addListener", "p", "m", "S", "C", "w", "L", "E", "R", "k", "M", "A", "O", "D", "T", "B", "P", "I", "H", "F", "W", "q", "browser", "Browser", "_keyDownHandled", "_keyDownSeen", "_keyPressHandled", "_unprocessedDeadKey", "_onCursorMove", "_onRender", "_onSelectionChange", "_onTitleChange", "_onBell", "_onFocus", "_onBlur", "_onA11yCharEmitter", "_onA11yTabEmitter", "_setup", "linkifier", "_instantiationService", "createInstance", "linkifier2", "_decorationService", "DecorationService", "setService", "IDecorationService", "_inputHandler", "onRequestBell", "bell", "onRequestRefreshRows", "onRequestSendFocus", "_reportFocus", "onRequestReset", "reset", "onRequestWindowsOptionsReport", "_reportWindowsOptions", "onColor", "_handleColorEvent", "forwardEvent", "onCursorMove", "onTitleChange", "_afterResize", "_colorManager", "req", "acc", "ident", "toColorRGB", "C0", "ESC", "toRgbString", "C1_ESCAPED", "ST", "setColors", "viewport", "onThemeChange", "_isDisposed", "_customKeyEventHandler", "write", "buffers", "active", "preventScroll", "_updateOptions", "_charSizeService", "measure", "setRenderer", "_createRenderer", "syncScrollArea", "optionsService", "screenReaderMode", "_accessibilityManager", "setupTabStops", "_setTheme", "_onTextAreaFocus", "sendFocus", "updateCursorStyle", "_showCursor", "blur", "_onTextAreaBlur", "_syncTextArea", "isCursorInViewport", "_compositionHelper", "isComposing", "cursorY", "ybase", "bufferLine", "cursorX", "cellHeight", "getWidth", "cellWidth", "actualCellWidth", "cursorTop", "cursorLeft", "lineHeight", "_initGlobal", "_bindKeys", "hasSelection", "copyHandler", "pasteHandlerWrapper", "handlePasteEvent", "isFirefox", "button", "rightClickHandler", "rightClickSelectsWord", "isLinux", "_keyUp", "_keyDown", "_keyPress", "compositionstart", "compositionupdate", "compositionend", "_inputEvent", "updateCompositionElements", "_queueLinkification", "parent", "isConnected", "_document", "ownerDocument", "dir", "fragment", "createDocumentFragment", "_viewportElement", "_viewportScrollArea", "_helperContainer", "coreBrowserService", "CoreBrowserService", "ICoreBrowserService", "CharSizeService", "ICharSizeService", "_theme", "onOptionChange", "_characterJoinerService", "CharacterJoinerService", "ICharacterJoinerService", "renderer", "RenderService", "IRenderService", "resize", "_compositionView", "CompositionHelper", "_soundService", "SoundService", "ISoundService", "MouseService", "Viewport", "amount", "onRequestSyncScrollBar", "onFocus", "SelectionService", "onRequestScrollLines", "suppressScrollEvent", "onSelectionChange", "onRequestRedraw", "onSelectionChanged", "columnSelectMode", "onLinuxMouseSelection", "_onScroll", "BufferDecorationRenderer", "onMouseDown", "coreMouseService", "areMouseEventsActive", "disable", "enable", "overviewRulerWidth", "_overviewRulerRenderer", "OverviewRulerRenderer", "bindMouse", "rendererType", "Renderer", "DomRenderer", "el", "sendEvent", "but", "action", "getRawByteCoords", "overrideType", "buttons", "getLinesScrolled", "deltaY", "triggerMouseEvent", "col", "row", "ctrl", "ctrlKey", "alt", "altKey", "shiftKey", "requestedEvents", "mouseup", "wheel", "mousedrag", "mousemove", "eventListeners", "cancel", "onProtocolChange", "events", "logLevel", "explainEvents", "passive", "activeProtocol", "shouldForceSelection", "hasScrollback", "sequence", "applicationCursorKeys", "abs", "onWheel", "onTouchStart", "onTouchMove", "refreshRows", "shouldColumnSelect", "isCursorInitialized", "disp", "attachCustomKeyEventHandler", "customKeyEventHandler", "registerCharacterJoiner", "joinerId", "deregisterCharacterJoiner", "deregister", "markers", "addMarker", "cursorYOffset", "normal", "registerDecoration", "decorationOptions", "column", "setSelection", "getSelection", "getSelectionPosition", "startColumn", "selectionStart", "endColumn", "selectionEnd", "clearSelection", "selectAll", "selectLines", "shouldIgnoreComposition", "macOptionIsMeta", "keydown", "scrollToBottom", "result", "evaluateKeyboardEvent", "scrollCount", "_isThirdLevelShift", "metaKey", "charCodeAt", "ETX", "CR", "domEvent", "thirdLevelKey", "isWindows", "getModifierState", "keyCode", "charCode", "which", "String", "fromCharCode", "inputType", "composed", "_soundBell", "playBellSound", "hasValidSize", "clearAllMarkers", "getBlankLine", "DEFAULT_ATTR_DATA", "clearTextureAtlas", "WindowsOptionsReportType", "GET_WIN_SIZE_PIXELS", "canvasWidth", "scaledCanvasWidth", "toFixed", "canvasHeight", "scaledCanvasHeight", "GET_CELL_SIZE_PIXELS", "scaledCellWidth", "scaledCellHeight", "force", "cancelEvents", "_visualBell", "bellStyle", "CoreTerminal", "Terminal", "_debounceThresholdMS", "_lastRefreshMs", "_additionalRefreshRequested", "_refreshTimeoutID", "refreshRequestTime", "Date", "now", "elapsed", "waitPeriodBeforeTrailingRefresh", "_scrollLines", "_scrollArea", "scrollBarWidth", "_currentRowHeight", "_currentScaledCellHeight", "_lastRecordedBufferLength", "_lastRecordedViewportHeight", "_lastRecordedBufferHeight", "_lastTouchY", "_lastScrollTop", "_wheelPartialScroll", "_refreshAnimationFrame", "_ignoreNextScrollEvent", "offsetWidth", "_activeBuffer", "onBufferActivate", "activeBuffer", "_renderDimensions", "backgroundColor", "_refresh", "immediate", "offsetHeight", "newBufferHeight", "scrollTop", "offsetParent", "diff", "_bubbleScroll", "scrollPosFromTop", "cancelable", "_getPixelsScrolled", "_applyScrollModifier", "deltaMode", "WheelEvent", "DOM_DELTA_LINE", "DOM_DELTA_PAGE", "DOM_DELTA_PIXEL", "modifier", "fastScrollModifier", "fastScrollSensitivity", "scrollSensitivity", "touches", "_decorationElements", "_altBufferIsActive", "_dimensionsChanged", "_container", "_queueRefresh", "onDecorationRegistered", "onDecorationRemoved", "decoration", "_removeDecoration", "refreshDecorations", "_renderDecoration", "_refreshStyle", "_refreshXPosition", "_createElement", "marker", "display", "onRenderEmitter", "onDispose", "anchor", "right", "delete", "_zonePool", "_zonePoolIndex", "_linePadding", "full", "center", "addDecoration", "overviewRulerOptions", "z", "_lineIntersectsZone", "_lineAdjacentToZone", "_addLineToZone", "startBufferLine", "endBufferLine", "setPadding", "padding", "ColorZoneStore", "drawHeight", "drawWidth", "drawX", "_colorZoneStore", "_shouldUpdateDimensions", "_shouldUpdateAnchor", "_lastKnownBufferLength", "_canvas", "_refreshCanvasDimensions", "insertBefore", "_registerDecorationListeners", "_registerBufferChangeListeners", "_registerDimensionChangeListeners", "_refreshDrawHeightConstants", "_refreshColorZonePadding", "_containerHeight", "clientHeight", "_refreshDrawConstants", "outerWidth", "innerWidth", "pixelsPerLine", "nonFullHeight", "_width", "_refreshDecorations", "clearRect", "lineWidth", "zones", "_renderColorZone", "updateCanvasDimensions", "updateAnchor", "_textarea", "_coreService", "_isComposing", "_isSendingComposition", "_compositionPosition", "_dataAlreadySent", "_finalizeComposition", "_handleAnyTextareaChanges", "waitForPropagation", "input", "oldValue", "dontRecurse", "fontFamily", "fontSize", "compositionViewBounds", "ICoreService", "getCoordsRelativeToElement", "rect", "elementStyle", "getComputedStyle", "leftPadding", "parseInt", "getPropertyValue", "topPadding", "colCount", "hasValidCharSize", "isSelection", "moveToRequestedRow", "startY", "targetY", "bufferService", "applicationCursor", "wrappedRowsForRow", "rowsToMove", "wrappedRows", "direction", "verticalDirection", "isWrapped", "repeat", "currentRow", "lineWraps", "startCol", "endCol", "forward", "currentCol", "bufferStr", "mod", "count", "str", "rpt", "targetX", "rowDifference", "currX", "CONSTRUCTOR_ONLY_OPTIONS", "_core", "_addonManager", "AddonManager", "_publicOptions", "getter", "propName", "setter", "_checkReadonlyOptions", "desc", "defineProperty", "includes", "_checkProposedApi", "allowProposedApi", "onBell", "onBinary", "onData", "onWriteParsed", "_parser", "ParserApi", "UnicodeApi", "_buffer", "BufferNamespaceApi", "mouseTrackingMode", "applicationCursorKeysMode", "applicationKeypadMode", "applicationKeypad", "insertMode", "modes", "originMode", "origin", "reverseWraparoundMode", "reverseWraparound", "sendFocusMode", "wraparoundMode", "wraparound", "columns", "_verifyIntegers", "registerMarker", "_verifyPositiveIntegers", "scrollPages", "pageCount", "scrollToTop", "scrollToLine", "writeUtf8", "writeln", "getOption", "setOption", "loadAddon", "addon", "values", "Infinity", "isNaN", "_alpha", "_colors", "_rendererId", "_scaledCharWidth", "_scaledCharHeight", "_scaledCellWidth", "_scaledCellHeight", "_scaledCharLeft", "_scaledCharTop", "_columnSelectMode", "_currentGlyphIdentifier", "chars", "code", "bold", "dim", "italic", "_initCanvas", "_charAtlas", "throwIfFalsy", "_clearAll", "onOptionsChanged", "onGridChanged", "_selectionStart", "_selectionEnd", "colorSet", "_refreshCharAtlas", "_setTransparency", "oldCanvas", "cloneNode", "replaceChild", "acquireCharAtlas", "warmUp", "scaledCharWidth", "scaledCharHeight", "scaledCharLeft", "scaledCharTop", "_fillCells", "_fillMiddleLineAtCells", "cellOffset", "_fillBottomLineAtCells", "_fillLeftLineAtCell", "_strokeRectAtCell", "strokeRect", "_clearCells", "_fillCharTrueColor", "cell", "font", "_getFont", "textBaseline", "TEXT_BASELINE", "_clipRow", "drawSuccess", "customGlyphs", "tryDrawCustomChar", "getChars", "fillText", "_drawChars", "contrastColor", "_getContrastColor", "isFgRGB", "isBgRGB", "_drawUncachedChars", "isInverse", "isBgDefault", "INVERTED_DEFAULT_COLOR", "getBgColor", "isFgDefault", "getFgColor", "DEFAULT_COLOR", "drawBoldTextInBrightColors", "isBold", "WHITESPACE_CELL_CHAR", "getCode", "WHITESPACE_CELL_CODE", "isDim", "isItalic", "hasOverrides", "getDecorationsAtCell", "backgroundColorRGB", "foregroundColorRGB", "draw", "fgOverride", "save", "opaque", "AttributeData", "join", "globalAlpha", "DIM_OPACITY", "restore", "beginPath", "clip", "fontWeightBold", "fontWeight", "bgOverride", "isTop", "layer", "_isCellInSelection", "minimumContrastRatio", "excludeFromContrastRatioDemands", "adjustedColor", "fgColor", "fgColorMode", "getFgColorMode", "bgColor", "bgColorMode", "getBgColorMode", "temp", "temp2", "bgRgba", "_resolveBackgroundRgba", "fgRgba", "_resolveForegroundRgba", "ensureContrastRatio", "inverse", "BaseRenderLayer", "BLINK_INTERVAL", "container", "rendererId", "_onRequestRedraw", "_coreBrowserService", "decorationService", "_cell", "CellData", "_state", "isFocused", "_cursorRenderers", "_renderBarCursor", "_renderBlockCursor", "_renderUnderlineCursor", "_cursorBlinkStateManager", "_clearCursor", "restartBlinkAnimation", "pause", "resume", "cursorBlink", "CursorBlinkStateManager", "_render", "isPaused", "triggeredByAnimationFrame", "isCursorHidden", "viewportRelativeCursorY", "loadCell", "cursorStyle", "_renderBlurCursor", "isCursorVisible", "cursorWidth", "strokeStyle", "CursorRenderLayer", "_restartInterval", "_blinkStartTimeout", "_blinkInterval", "clearInterval", "_animationTimeRestarted", "timeToStart", "time", "setInterval", "U", "N", "K", "G", "V", "X", "Z", "Y", "J", "$", "Q", "ee", "te", "re", "ie", "ne", "oe", "se", "ae", "ce", "le", "he", "ue", "fe", "_e", "de", "pe", "ve", "ye", "ge", "me", "be", "Se", "Ce", "we", "Le", "Ee", "xe", "Re", "ke", "Me", "Ae", "Oe", "De", "Te", "Be", "Pe", "Ie", "He", "je", "Fe", "We", "Ue", "qe", "Ne", "ze", "Ke", "Ge", "Ve", "Xe", "Ze", "Ye", "Je", "$e", "Qe", "et", "tt", "rt", "it", "nt", "ot", "st", "at", "ct", "lt", "ht", "ut", "ft", "_t", "dt", "pt", "vt", "yt", "gt", "mt", "bt", "St", "Ct", "wt", "Lt", "Et", "blockElementDefinitions", "patternCharacterDefinitions", "boxDrawingDefinitions", "xp", "yp", "powerlineDefinitions", "horizontalPadding", "xOffset", "yOffset", "blockElementDefinition", "charDefinition", "box", "xEighth", "yEighth", "patternDefinition", "patternSet", "cachedPatterns", "pattern", "tmpCanvas", "tmpCtx", "imageData", "ImageData", "startsWith", "parseFloat", "putImageData", "createPattern", "boxDrawingDefinition", "instructions", "actualInstructions", "instruction", "svgToCanvasInstructionMap", "args", "translateArgs", "error", "stroke", "closePath", "powerlineDefinition", "fill", "clamp", "bezierCurveTo", "lineTo", "moveTo", "cache", "GridCache", "onShowLinkUnderline", "onHideLinkUnderline", "middleRowCount", "is256Color", "LinkRenderLayer", "nextRendererId", "instantiationService", "_id", "_renderLayers", "TextRenderLayer", "SelectionRenderLayer", "_devicePixelRatio", "_updateDimensions", "removeTerminalFromCache", "onDevicePixelRatioChange", "onCharSizeChanged", "_runOperation", "operation", "renderRows", "letterSpacing", "IInstantiationService", "isPowerlineGlyph", "codepoint", "_clearState", "_didStateChange", "viewportStartRow", "viewportEndRow", "viewportCappedStartRow", "viewportCappedEndRow", "startRowEndCol", "middleRowsCount", "_areCoordinatesEqual", "coord1", "coord2", "_characterWidth", "_characterFont", "_characterOverlapCache", "_workCell", "terminalFont", "_forEachCell", "firstRow", "lastRow", "joinedRanges", "getJoinedCharacters", "isJoined", "lastCharX", "JoinedCellData", "translateToString", "_isOverlapping", "getCodePoint", "NULL_CELL_CODE", "_drawBackground", "prevFillStyle", "nextFillStyle", "isBgPalette", "_drawForeground", "isInvisible", "isUnderline", "isStrikethrough", "beginFrame", "hasOwnProperty", "overlaps", "measureText", "_didWarmUp", "_doWarmUp", "BaseCharAtlas", "charAtlasCache", "newConfig", "generateConfig", "ownedByIndex", "entry", "ownedBy", "configEquals", "config", "atlas", "newEntry", "DynamicCharAtlas", "clonedColors", "colorCode", "isLegacyEdge", "CHAR_ATLAS_CELL_SPACING", "TEXTURE_WIDTH", "TEXTURE_HEIGHT", "TRANSPARENT_COLOR", "getGlyphCacheKey", "glyph", "_config", "_drawToCacheCount", "_glyphsWaitingOnBitmap", "_bitmapCommitTimeout", "_bitmap", "_cacheCanvas", "_cacheCtx", "_tmpCtx", "_height", "capacity", "_cacheMap", "LRUMap", "prealloc", "_canCache", "glyphKey", "cacheValue", "_drawFromCache", "peek", "_drawToCache", "_toCoordinateX", "_toCoordinateY", "isEmpty", "cacheX", "cacheY", "drawImage", "inBitmap", "_getColorFromAnsiIndex", "idx", "_getBackgroundColor", "_getForegroundColor", "fontStyle", "clearColor", "offset", "_addGlyphToBitmap", "isSafari", "_generateBitmap", "glyphsMovingToBitmap", "createImageBitmap", "then", "bitmap", "NoneCharAtlas", "_map", "_head", "_tail", "_nodePool", "_unlinkNode", "prev", "_appendNode", "tail", "nodePool", "peekValue", "head", "TERMINAL_CLASS_PREFIX", "FG_CLASS_PREFIX", "BG_CLASS_PREFIX", "FOCUS_CLASS", "nextTerminalId", "_linkifier", "_linkifier2", "_terminalClass", "_refreshRowElements", "_selectionContainer", "_injectCss", "_rowFactory", "DomRendererRowFactory", "_onLinkHover", "_onLinkLeave", "_themeStyleElement", "_dimensionsStyleElement", "overflow", "styles", "_terminalSelector", "BOLD_CLASS", "ITALIC_CLASS", "CURSOR_CLASS", "CURSOR_STYLE_BLOCK_CLASS", "CURSOR_BLINK_CLASS", "CURSOR_STYLE_BAR_CLASS", "CURSOR_STYLE_UNDERLINE_CLASS", "documentFragment", "isXFlipped", "_createSelectionElement", "colStart", "colEnd", "cursorAbsoluteY", "rowElement", "createRow", "_setCellUnderline", "enabled", "span", "textDecoration", "DIM_CLASS", "UNDERLINE_CLASS", "STRIKETHROUGH_CLASS", "isCursorRow", "lineLength", "charElement", "isInSelection", "resolvedBg", "_addStyle", "padStart", "_applyMinimumContrast", "padChar", "isSelectAllActive", "selectionStartLength", "areSelectionValuesReversed", "startPlusLength", "onTrim", "SelectionModel", "_onCharSizeChange", "_measureStrategy", "DomMeasureStrategy", "_parentElement", "_result", "_measureElement", "geometry", "firstCell", "combinedData", "isCombined", "setFromCharData", "getAsCharData", "_characterJoiners", "_nextCharacterJoinerId", "joiner", "ranges", "lineStr", "rangeStartColumn", "currentStringIndex", "rangeStartStringIndex", "rangeAttrFG", "rangeAttrBG", "getBg", "getTrimmedLength", "_getJoinedRanges", "startIndex", "endIndex", "allJoinedRanges", "joinerRanges", "_mergeRanges", "_stringRangesToCellRanges", "currentRangeIndex", "currentRangeStarted", "currentRange", "getString", "newRange", "inRange", "getRootNode", "activeElement", "hasFocus", "_renderer", "_isPaused", "_needsFullRefresh", "_isNextRenderRedrawOnly", "_needsSelectionRefresh", "_canvasWidth", "_canvasHeight", "_selectionState", "_onDimensionsChange", "_onRenderedViewportChange", "_onRefreshRequest", "_renderDebouncer", "_fullRefresh", "_handleOptionsChanged", "onCharSizeChange", "IntersectionObserver", "_onIntersectionChange", "threshold", "observe", "disconnect", "isIntersecting", "intersectionRatio", "isRedrawOnly", "_fireOnCanvasResize", "NON_BREAKING_SPACE_CHAR", "ALL_NON_BREAKING_SPACE_REGEX", "_dragScrollAmount", "_enabled", "_mouseDownTimeStamp", "_oldHasSelection", "_oldSelectionStart", "_oldSelectionEnd", "_onLinuxMouseSelection", "_onRedrawRequest", "_onRequestScrollLines", "_mouseUpListener", "_onMouseUp", "onUserInput", "_trimListener", "_onTrim", "_onBufferActivate", "_model", "_activeSelectionMode", "_removeMouseDownListeners", "finalSelectionStart", "finalSelectionEnd", "lineText", "isLinuxMouseSelection", "_isClickInSelection", "_getMouseBufferCoords", "_areCoordsInSelection", "isCellInSelection", "_selectWordAtCursor", "allowWhitespaceOnlySelection", "getRangeLength", "_selectWordAt", "_getMouseEventScrollAmount", "terminalHeight", "macOptionClickForcesSelection", "timeStamp", "_onIncrementalClick", "detail", "_onSingleClick", "_onDoubleClick", "_onTripleClick", "_addMouseDownListeners", "_dragScrollIntervalTimer", "_dragScroll", "hasWidth", "_selectLineAt", "previousSelectionEnd", "_selectToWordAt", "timeElapsed", "coordinates", "moveToCellSequence", "_fireEventIfSelectionChanged", "_fireOnSelectionChange", "_convertViewportColToCharacterIndex", "charIndex", "_getWordAt", "followWrappedLinesAbove", "followWrappedLinesBelow", "charOffset", "leftWideCharCount", "rightWideCharCount", "leftLongCharOffset", "rightLongCharOffset", "charAt", "_isCharWordSeparator", "trim", "previousBufferLine", "previousLineWordPosition", "nextBufferLine", "nextLineWordPosition", "wordPosition", "wordSeparator", "wrappedRange", "getWrappedRangeForLine", "last", "createDecorator", "_audioContext", "audioContextCtor", "AudioContext", "webkitAudioContext", "audioContext", "bellAudioSource", "createBufferSource", "decodeAudioData", "_base64ToArrayBuffer", "_removeMimeType", "bellSound", "connect", "destination", "base64", "binaryString", "atob", "len", "bytes", "Uint8Array", "dataURI", "_maxLength", "onDeleteEmitter", "onInsertEmitter", "onTrimEmitter", "_array", "Array", "_startIndex", "_length", "newMaxLength", "newArray", "_getCyclicIndex", "newLength", "recycle", "deleteCount", "items", "countToTrim", "trimStart", "shiftElements", "expandListBy", "CircularList", "clone", "val", "depth", "clonedObject", "isArray", "rgb", "toPaddedHex", "contrastRatio", "l1", "l2", "fgR", "fgG", "fgB", "bgR", "bgG", "bgB", "ratio", "rgbaColor", "toChannels", "rgbaMatch", "relativeLuminance2", "rs", "gs", "bs", "pow", "relativeLuminance", "reduceLuminance", "cr", "increaseLuminance", "bgL", "fgL", "resultB", "resultA", "resultARatio", "hasWriteSyncWarnHappened", "_onBinary", "_onData", "_onLineFeed", "_onWriteParsed", "InstantiationService", "OptionsService", "BufferService", "LogService", "CoreService", "CoreMouseService", "ICoreMouseService", "_dirtyRowService", "DirtyRowService", "IDirtyRowService", "unicodeService", "UnicodeService", "_charsetService", "CharsetService", "ICharsetService", "InputHandler", "markRangeDirty", "scrollBottom", "_writeBuffer", "WriteBuffer", "promiseResult", "parse", "_onScrollApi", "_windowsMode", "writeSync", "maxSubsequentCalls", "LogLevelEnum", "WARN", "MINIMUM_COLS", "MINIMUM_ROWS", "scroll", "eraseAttr", "registerEscHandler", "registerDcsHandler", "registerCsiHandler", "registerOscHandler", "windowsMode", "_enableWindowsMode", "updateWindowsModeWrappedState", "final", "_listeners", "_disposed", "_event", "arg1", "arg2", "queue", "call", "from", "to", "GLEVEL", "MAX_PARSEBUFFER_LENGTH", "paramToWindowOption", "opts", "setWinLines", "restoreWin", "minimizeWin", "setWinPosition", "setWinSizePixels", "raiseWin", "lowerWin", "refreshWin", "setWinSizeChars", "maximizeWin", "fullscreenWin", "getWinState", "getWinPosition", "getWinSizePixels", "getScreenSizePixels", "getCellSizePixels", "getWinSizeChars", "getScreenSizeChars", "getIconTitle", "getWinTitle", "pushTitle", "popTitle", "_data", "Uint32Array", "hook", "params", "put", "concat", "subarray", "unhook", "success", "utf32ToString", "_coreMouseService", "EscapeSequenceParser", "_parseBuffer", "_stringDecoder", "StringToUtf32", "_utf8Decoder", "Utf8ToUtf32", "_windowTitle", "_iconName", "_windowTitleStack", "_iconNameStack", "_curAttrData", "_eraseAttrDataInternal", "_onRequestBell", "_onRequestRefreshRows", "_onRequestReset", "_onRequestSendFocus", "_onRequestSyncScrollBar", "_onRequestWindowsOptionsReport", "_onA11yChar", "_onA11yTab", "_onColor", "_parseStack", "paused", "cursorStartX", "cursorStartY", "decodedLength", "_specialColors", "setCsiHandlerFallback", "identifier", "identToString", "toArray", "setEscHandlerFallback", "setExecuteHandlerFallback", "setOscHandlerFallback", "setDcsHandlerFallback", "payload", "setPrintHandler", "print", "insertChars", "intermediates", "scrollLeft", "cursorUp", "scrollRight", "cursorDown", "cursorForward", "cursorBackward", "cursorNextLine", "cursorPrecedingLine", "cursorCharAbsolute", "cursorPosition", "cursorForwardTab", "eraseInDisplay", "prefix", "eraseInLine", "insertLines", "deleteLines", "deleteChars", "scrollUp", "scrollDown", "eraseChars", "cursorBackwardTab", "charPosAbsolute", "hPositionRelative", "repeatPrecedingCharacter", "sendDeviceAttributesPrimary", "sendDeviceAttributesSecondary", "linePosAbsolute", "vPositionRelative", "hVPosition", "tabClear", "setMode", "setModePrivate", "resetMode", "resetModePrivate", "charAttributes", "deviceStatus", "deviceStatusPrivate", "softReset", "setCursorStyle", "setScrollRegion", "saveCursor", "windowOptions", "restoreCursor", "insertColumns", "deleteColumns", "setExecuteHandler", "BEL", "LF", "lineFeed", "VT", "FF", "carriageReturn", "BS", "backspace", "HT", "tab", "SO", "shiftOut", "SI", "shiftIn", "C1", "IND", "NEL", "nextLine", "HTS", "tabSet", "OscHandler", "setTitle", "setIconName", "setOrReportIndexedColor", "setOrReportFgColor", "setOrReportBgColor", "setOrReportCursorColor", "restoreIndexedColor", "restoreFgColor", "restoreBgColor", "restoreCursorColor", "reverseIndex", "keypadApplicationMode", "keypadNumericMode", "fullReset", "setgLevel", "selectDefaultCharset", "flag", "selectCharset", "CHARSETS", "screenAlignmentPattern", "setErrorHandler", "DECRQSS", "_preserveStack", "_logSlowResolvingAsync", "Promise", "race", "res", "rej", "catch", "err", "wasPaused", "DEBUG", "prototype", "clearRange", "decode", "chWidth", "charset", "curAttr", "bufferRow", "markDirty", "setCellFromCodePoint", "extended", "wcwidth", "ch", "stringFromCodePoint", "_eraseAttrData", "insertCells", "getNullCell", "NULL_CELL_WIDTH", "addCodepointToCell", "precedingCodepoint", "hasContent", "DcsHandler", "convertEol", "_restrictCursor", "originalX", "nextStop", "maxCol", "_setCursor", "_moveCursor", "diffToTop", "diffToBottom", "param", "tabs", "prevStop", "_eraseInBufferLine", "clearWrap", "replaceCells", "_resetBufferLine", "clearMarkers", "scrollBackSize", "scrollBottomRowsOffset", "scrollBottomAbsolute", "deleteCells", "_is", "term", "termName", "setgCharset", "DEFAULT_CHARSET", "activeEncoding", "activateAltBuffer", "activateNormalBuffer", "_updateAttrColor", "mode", "c1", "c2", "c3", "fromColorRGB", "_extractColor", "accu", "cSpace", "advance", "hasSubParams", "subparams", "getSubParams", "underlineColor", "_processUnderline", "underlineStyle", "updateExtended", "savedX", "savedY", "savedCurAttrData", "savedCharset", "isBlinking", "bottom", "second", "_savedCharset", "slots", "spec", "parseColor", "_setOrReportSpecialColor", "collectAndFlag", "scrollRegionHeight", "level", "markAllDirty", "_disposables", "unregister", "disposables", "array", "isNode", "navigator", "userAgent", "platform", "test", "isIpad", "isIphone", "_getKey", "insert", "_search", "getKeyIterator", "mid", "SortedList", "fillFallback", "constructor", "lastChar", "CHAR_DATA_CODE_INDEX", "ExtendedAttrs", "newObj", "isBlink", "isFgPalette", "isAttributeDefault", "hasExtendedAttrs", "getUnderlineColor", "getUnderlineColorMode", "isUnderlineColorRGB", "isUnderlineColorPalette", "isUnderlineColorDefault", "getUnderlineStyle", "MAX_BUFFER_SIZE", "_hasScrollback", "_nullCell", "fromCharData", "NULL_CELL_CHAR", "_whitespaceCell", "WHITESPACE_CELL_WIDTH", "_isClearing", "_cols", "_rows", "_getCorrectBufferLength", "getWhitespaceCell", "BufferLine", "maxLength", "relativeY", "correctBufferLength", "scrollback", "fillViewportRows", "fillAttr", "newCols", "newRows", "nullCell", "addToY", "amountToTrim", "_isReflowEnabled", "_reflow", "_reflowLarger", "_reflowSmaller", "toRemove", "reflowLargerGetLinesToRemove", "newLayoutResult", "reflowLargerCreateNewLayout", "reflowLargerApplyNewLayout", "layout", "_reflowLargerAdjustViewport", "countRemoved", "viewportAdjustments", "toInsert", "countToInsert", "wrappedLines", "absoluteY", "trimmedLines", "lastLineLength", "destLineLengths", "reflowSmallerGetNewLineLengths", "linesToAdd", "newLines", "newLine", "destLineIndex", "destCol", "srcLineIndex", "srcCol", "cellsToCopy", "copyCellsFrom", "wrappedLinesIndex", "getWrappedLineTrimmedLength", "setCell", "insertEvents", "originalLines", "originalLinesLength", "originalLineIndex", "nextToInsertIndex", "nextToInsert", "countInsertedSoFar", "nextI", "insertCountEmitted", "lineIndex", "trimRight", "CHAR_DATA_WIDTH_INDEX", "CHAR_DATA_CHAR_INDEX", "tabStopWidth", "Marker", "onInsert", "onDelete", "_removeMarker", "startOverscan", "endOverscan", "BufferStringIterator", "Buffer", "_trimRight", "_endIndex", "_startOverscan", "_endOverscan", "_current", "fillCellData", "_combined", "_extendedAttrs", "cp", "CHAR_DATA_ATTR_INDEX", "codePoint", "eAttrs", "keys", "copyFrom", "src", "applyInReverse", "srcData", "srcCombinedKeys", "bufferCols", "endsInNull", "followingLineStartsWithWide", "oldCols", "bufferAbsoluteY", "srcTrimmedTineLength", "srcRemainingCells", "destRemainingCells", "countToRemove", "nextToRemoveIndex", "nextToRemoveStart", "countRemovedSoFar", "newLayout", "newLayoutLines", "newLineLengths", "cellsNeeded", "reduce", "srcLine", "cellsAvailable", "oldTrimmedLength", "endsWithWide", "_normal", "_alt", "inactiveBuffer", "BufferSet", "obj", "combined", "DEFAULT_ATTR", "_nextId", "isDisposed", "_onDispose", "NUL", "SOH", "STX", "EOT", "ENQ", "ACK", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "FS", "GS", "RS", "US", "SP", "DEL", "PAD", "HOP", "BPH", "NBH", "SSA", "ESA", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3", "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA", "SOS", "SGCI", "SCI", "CSI", "OSC", "PM", "APC", "KEYCODE_KEY_MAPPINGS", "applicationCursorMode", "modifiers", "keyMapping", "keyString", "toUpperCase", "toLowerCase", "_interim", "startPos", "interim", "byte1", "byte2", "byte3", "byte4", "discardInterim", "tmp", "missing", "fourStop", "table", "BMP_COMBINING", "HIGH_COMBINING", "version", "num", "ucs", "UnicodeV6", "qmt", "queueMicrotask", "cb", "resolve", "_action", "_callbacks", "_pendingData", "_bufferOffset", "_isSyncWriting", "_syncCalls", "chunk", "_innerWrite", "lastTime", "startTime", "RGB_REX", "HASH_REX", "pad", "bits", "s2", "low", "base", "adv", "PAYLOAD_LIMIT", "EMPTY_HANDLERS", "_handlers", "create", "_active", "_ident", "_handlerFb", "_stack", "loopPosition", "fallThrough", "registerHandler", "handlerList", "handlerIndex", "clearHandler", "setHandlerFallback", "handlerResult", "DcsParser", "EMPTY_PARAMS", "Params", "addParam", "_handler", "_params", "_hitLimit", "ret", "setDefault", "addMany", "codes", "TransitionTable", "NON_ASCII_PRINTABLE", "VT500_TRANSITION_TABLE", "blueprint", "apply", "unused", "PRINTABLES", "EXECUTABLES", "states", "_transitions", "handlers", "handlerPos", "transition", "chunkPos", "initialState", "currentState", "_collect", "_printHandlerFb", "_executeHandlerFb", "_csiHandlerFb", "_escHandlerFb", "_errorHandlerFb", "_printHandler", "_executeHandlers", "_csiHandlers", "_escHandlers", "_oscParser", "OscParser", "_dcsParser", "_errorHandler", "_identifier", "finalRange", "intermediate", "finalCode", "reverse", "clearPrintHandler", "clearEscHandler", "clearExecuteHandler", "clearCsiHandler", "clearDcsHandler", "clearOscHandler", "clearErrorHandler", "collect", "abort", "addSubParam", "addDigit", "handlersEsc", "jj", "_start", "_put", "MAX_VALUE", "maxSubParamsLength", "Int32Array", "_subParams", "_subParamsLength", "_subParamsIdx", "Uint16Array", "_rejectDigits", "_rejectSubDigits", "_digitIsSub", "fromArray", "newParams", "getSubParamsAll", "store", "cur", "_addons", "instance", "terminal", "loadedAddon", "_wrappedAddonDispose", "init", "getLine", "BufferLineApiView", "BufferApiView", "_line", "getCell", "_onBufferChange", "_alternate", "alternate", "addCsiHandler", "addDcsHandler", "addEscHandler", "addOscHandler", "provider", "versions", "activeVersion", "isUserScrolling", "_cachedBlankLine", "topRow", "bottomRow", "willBufferBeTrimmed", "isFull", "oldYdisp", "scrollAmount", "glevel", "_charsets", "DEFAULT_PROTOCOLS", "NONE", "restrict", "X10", "VT200", "DRAG", "ANY", "eventCode", "isSGR", "DEFAULT_ENCODINGS", "DEFAULT", "SGR", "_protocols", "_encodings", "_activeProtocol", "_activeEncoding", "_onProtocolChange", "_lastEvent", "addProtocol", "addEncoding", "name", "protocol", "encoding", "_compareEvents", "report", "triggerBinaryEvent", "down", "up", "drag", "move", "e1", "e2", "DEFAULT_MODES", "DEFAULT_DEC_PRIVATE_MODES", "_onUserInput", "_scrollToBottom", "wasUserInput", "disableStdin", "_decorations", "_onDecorationRegistered", "_onDecorationRemoved", "Decoration", "getDecorationsAtLine", "xmin", "xmax", "_cachedBg", "_cachedFg", "foregroundColor", "_end", "_entries", "service", "ServiceCollection", "_services", "getService", "ctor", "serviceDependencies", "getServiceDependencies", "sort", "serviceArgs", "dependency", "firstServiceArgPos", "optionsKeyToLogLevel", "info", "INFO", "ERROR", "off", "OFF", "_updateLogLevel", "_evalLazyOptionalParams", "optionalParams", "_log", "message", "log", "DEFAULT_BELL_SOUND", "DEFAULT_OPTIONS", "altClickMovesCursor", "FONT_WEIGHT_OPTIONS", "_onOptionChange", "defaultOptions", "newValue", "_sanitizeAndValidateOption", "_setupOptions", "storeServiceDependency", "serviceRegistry", "decorator", "arguments", "_providers", "_onChange", "defaultProvider", "_activeProvider", "__webpack_module_cache__", "__webpack_require__", "moduleId", "cachedModule", "__webpack_modules__", "require_comment", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "noOptions", "nonWS", "Pos", "cmp", "firstNonWS", "str", "found", "cm", "options", "minLine", "ranges", "mode", "i", "from", "to", "probablyInsideString", "pos", "line", "getMode", "self", "firstLine", "commentString", "end", "pad", "blankLines", "baseString", "whitespace", "cut", "startString", "endString", "lastLineHasText", "lead", "atCursor", "empty", "start", "lineString", "lines", "didSomething", "lineComment", "endPos", "startLine", "open", "endLine", "close", "insideStart", "insideEnd", "lastStart", "firstEnd", "almostLastStart", "openEnd", "foundEnd", "require_continuecomment", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "nonspace", "repeat", "n", "continueComment", "cm", "ranges", "mode", "inserts", "i", "pos", "modeHere", "insert", "line", "found", "blockStart", "lineCmt", "end", "nonspaceAfter", "tabSize", "numTabs", "continueLineCommentEnabled", "next", "nextFound", "ch", "str", "m", "opt", "val", "prev", "key", "map", "require_placeholder", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "cm", "val", "old", "prev", "onBlur", "onChange", "onComposition", "clearPlaceholder", "wrapper", "setPlaceholder", "elt", "placeHolder", "empty", "input", "isEmpty", "require_closebrackets", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "defaults", "Pos", "cm", "val", "old", "keyMap", "ensureBound", "getOption", "conf", "name", "handleBackspace", "handleEnter", "chars", "i", "ch", "key", "handler", "handleChar", "getConfig", "deflt", "mode", "pairs", "ranges", "around", "charsAround", "cur", "explode", "linesep", "moveSel", "line", "dir", "newRanges", "primary", "range", "pos", "contractSelection", "sel", "inverted", "closeBefore", "triples", "identical", "opening", "type", "curType", "next", "stringStartsAfter", "prev", "left", "right", "sels", "str", "token", "require_matchbrackets", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "ie_lt8", "Pos", "matching", "bracketRegex", "config", "findMatchingBracket", "cm", "where", "line", "pos", "afterCursor", "re", "match", "dir", "style", "found", "scanForBracket", "maxScanLen", "maxScanLines", "stack", "lineEnd", "lineNo", "end", "ch", "matchBrackets", "autoclear", "maxHighlightLen", "highlightNonMatching", "marks", "ranges", "i", "clear", "doMatchBrackets", "clearHighlighted", "val", "old", "oldConfig", "require_searchcursor", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "Pos", "regexpFlags", "regexp", "flags", "ensureFlags", "current", "target", "i", "maybeMultiline", "searchRegexpForward", "doc", "start", "line", "ch", "last", "string", "match", "searchRegexpForwardMultiline", "chunk", "curLine", "before", "inside", "startLine", "startCh", "lastMatchIn", "endMargin", "from", "newMatch", "end", "searchRegexpBackward", "first", "searchRegexpBackwardMultiline", "chunkSize", "doFold", "noFold", "str", "adjustPos", "orig", "folded", "pos", "foldFunc", "min", "max", "mid", "len", "searchStringForward", "query", "caseFold", "fold", "lines", "search", "found", "cutFrom", "endString", "lastLine", "searchStringBackward", "top", "topString", "SearchCursor", "options", "reverse", "head", "result", "newText", "origin", "ranges", "cur", "require_sublime", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "cmds", "Pos", "findPosSubword", "doc", "start", "dir", "line", "state", "type", "startPos", "pos", "e", "i", "next", "cat", "moveSubword", "cm", "range", "info", "visibleBottomLine", "visibleTopLine", "ranges", "lineRanges", "from", "to", "extended", "insertLine", "above", "len", "newSelection", "last", "head", "at", "wordAt", "end", "fullWord", "word", "text", "query", "cur", "found", "isSelectedRange", "prevAnchor", "prevHead", "sel", "addCursorToSelection", "newRanges", "newAnchor", "newHead", "newRange", "mirror", "selectBetweenBrackets", "opening", "closing", "puncType", "prev", "linesToMove", "newSels", "joined", "offset", "obj", "anchor", "actual", "rangeCount", "sortLines", "caseSensitive", "direction", "toSort", "selected", "lines", "a", "b", "au", "bu", "marks", "current", "j", "k", "modifyWordOrSelection", "indices", "replacements", "cursors", "indentUnit", "cursor", "toStartOfLine", "column", "deletePos", "prevIndent", "str", "tmp", "getTarget", "findAndGoTo", "forward", "target", "matches", "primaryIndex", "keyMap", "mac", "codePointsToString", "code", "ord", "codePointsToString_default", "stringToCodePoints", "code", "c", "stringToCodePoints_default", "Default", "code", "codePointsToString_default", "stringToCodePoints_default", "Default_default", "Base64", "Default_default", "code", "c", "Base64_default", "Hexdump", "Default_default", "code", "c", "Hexdump_default", "Lang", "id", "name", "runner", "url", "args", "highlighterRef", "code", "input", "Langs", "langs", "lang", "langId", "code", "args", "input", "defaultRunner", "workerURL", "worker", "import_javascript", "JavaScript", "Lang", "defaultRunner", "JavaScript_default", "import_perl", "Perl", "Lang", "defaultRunner", "Perl_default", "import_codemirror", "import_melba_toast", "Renderers", "renderers", "mimeType", "value", "renderer", "prepend", "char", "createDevice", "renderers", "Renderers", "import_codemirror", "Abstract", "inputs", "tag", "c", "Abstract_default", "replaceBinaryBytes", "code", "replacement", "replaceBinaryBytes_default", "Code", "Abstract_default", "parent", "options", "element", "textarea", "char", "data", "eventName", "handler", "args", "binaryReplacementChar", "code", "replaceBinaryBytes_default", "key", "value", "type", "c", "Code_default", "Abstract", "mimeType", "tag", "hidden", "element", "Abstract_default", "import_javascript", "import_perl", "Code", "Abstract_default", "parent", "options", "textarea", "UI_default", "mimeType", "char", "Code_default", "IFrame", "Abstract_default", "parent", "mimeType", "char", "container", "IFrame_default", "Decoders", "decoders", "code", "decoder", "decoders", "Decoders", "IO", "stdin", "args", "value", "decoders", "char", "IO_default", "Options", "name", "defaultValue", "value", "options", "Image", "IFrame_default", "mimeType", "options", "char", "Image_default", "Inputs", "inputs", "input", "toActivate", "value", "eventName", "handler", "replaceBinaryBytes", "buffer", "type", "char", "writeBuffer", "Inputs_default", "InvalidFormat", "InvalidFormat_default", "PBMImage", "Image_default", "mimeType", "char", "e", "InvalidFormat_default", "header", "format", "width", "height", "offset", "maxValue", "canvas", "context", "imageData", "data", "index", "value", "binary", "type", "withoutMaxValue", "withMaxValue", "match", "separator", "block", "currentPosition", "comment", "currentChar", "bitMask", "rowPosition", "PBMImage_default", "import_xterm", "MINIMUM_COLS", "MINIMUM_ROWS", "FitAddon", "terminal", "dims", "core", "parentElementStyle", "parentElementHeight", "parentElementWidth", "elementStyle", "elementPadding", "elementPaddingVer", "elementPaddingHor", "availableHeight", "availableWidth", "TTY", "_TTY", "Abstract_default", "parent", "options", "FitAddon", "text", "input", "escapeInput", "x", "y", "maxX", "maxY", "cols", "value", "type", "results", "visibleLines", "dimensions", "char", "rows", "TTY_default", "import_comment", "import_continuecomment", "import_placeholder", "import_closebrackets", "import_matchbrackets", "import_sublime", "UI", "_UI", "stdoutContainer", "Inputs_default", "Code_default", "createDevice", "PBMImage_default", "Image_default", "IFrame_default", "TTY_default", "IO_default", "link", "key", "event", "name", "value", "options", "previousLang", "e", "langs", "langKey", "lang", "option", "inputs", "decoders", "element", "code", "decoder", "decodedCode", "started", "stopHandler", "worker", "data", "type", "output", "error", "args", "arg", "argButton", "currentValue", "expander", "collapser", "target", "mimeType", "setInput", "button", "hash", "jsonData", "headerExpander", "footerExpander", "header", "footer", "input", "mime", "optionValues", "rawCode", "replaceBinaryBytes_default", "codePointsToString_default", "bytes", "char", "byteCount", "content", "toast", "UI_default", "Xxd", "Default_default", "code", "c", "Xxd_default", "decoders", "Xxd_default", "Hexdump_default", "Base64_default", "Default_default", "langs", "JavaScript_default", "Perl_default", "ui", "UI_default"] + "sources": ["../../node_modules/eventemitter3/index.js", "../../node_modules/codemirror/lib/codemirror.js", "../../node_modules/codemirror/mode/shell/shell.js", "../../node_modules/codemirror/mode/javascript/javascript.js", "../../node_modules/codemirror/mode/ruby/ruby.js", "../../node_modules/codemirror/mode/perl/perl.js", "../../node_modules/melba-toast/dist/Melba.js", "../../node_modules/xterm/lib/webpack:/xterm/webpack/universalModuleDefinition", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/AccessibilityManager.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Clipboard.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/ColorContrastCache.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/ColorManager.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Dom.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Lifecycle.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Linkifier.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Linkifier2.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/LocalizableStrings.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/MouseZoneManager.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/RenderDebouncer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/ScreenDprMonitor.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Terminal.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/TimeBasedDebouncer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/Viewport.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/decorations/BufferDecorationRenderer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/decorations/ColorZoneStore.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/decorations/OverviewRulerRenderer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/input/CompositionHelper.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/input/Mouse.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/input/MoveToCell.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/public/Terminal.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/BaseRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/CursorRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/CustomGlyphs.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/GridCache.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/LinkRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/Renderer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/RendererUtils.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/SelectionRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/TextRenderLayer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/BaseCharAtlas.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/CharAtlasCache.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/CharAtlasUtils.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/Constants.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/DynamicCharAtlas.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/atlas/LRUMap.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/dom/DomRenderer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/renderer/dom/DomRendererRowFactory.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/selection/SelectionModel.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/CharSizeService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/CharacterJoinerService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/CoreBrowserService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/MouseService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/RenderService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/SelectionService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/Services.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/browser/services/SoundService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/CircularList.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/Clone.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/Color.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/CoreTerminal.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/EventEmitter.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/InputHandler.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/Lifecycle.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/Platform.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/SortedList.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/TypedArrayUtils.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/WindowsMode.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/AttributeData.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/Buffer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/BufferLine.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/BufferRange.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/BufferReflow.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/BufferSet.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/CellData.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/Constants.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/buffer/Marker.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/data/Charsets.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/data/EscapeSequences.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/Keyboard.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/TextDecoder.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/UnicodeV6.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/WriteBuffer.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/input/XParseColor.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/Constants.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/DcsParser.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/EscapeSequenceParser.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/OscParser.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/parser/Params.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/AddonManager.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/BufferApiView.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/BufferLineApiView.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/BufferNamespaceApi.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/ParserApi.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/public/UnicodeApi.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/BufferService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/CharsetService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/CoreMouseService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/CoreService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/DecorationService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/DirtyRowService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/InstantiationService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/LogService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/OptionsService.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/ServiceRegistry.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/Services.ts", "../../node_modules/xterm/lib/webpack:/xterm/src/common/services/UnicodeService.ts", "../../node_modules/xterm/lib/webpack:/xterm/webpack/bootstrap", "../../node_modules/xterm/lib/webpack:/xterm/webpack/startup", "../../node_modules/codemirror/addon/comment/comment.js", "../../node_modules/codemirror/addon/comment/continuecomment.js", "../../node_modules/codemirror/addon/display/placeholder.js", "../../node_modules/codemirror/addon/edit/closebrackets.js", "../../node_modules/codemirror/addon/edit/matchbrackets.js", "../../node_modules/codemirror/addon/search/searchcursor.js", "../../node_modules/codemirror/keymap/sublime.js", "../../node_modules/codemirror/mode/python/python.js", "../../js/codePointsToString.ts", "../../js/stringToCodePoints.ts", "../../js/Decoders/Default.ts", "../../js/Decoders/Base64.ts", "../../js/Lang.ts", "../../node_modules/eventemitter3/index.mjs", "../../js/Runner.ts", "../../js/Runners/Worker.ts", "../../js/Runners/Wasmer.ts", "../../js/Langs.ts", "../../js/langs/bash-wasmer/Bash.ts", "../../js/Decoders/Hexdump.ts", "../../js/langs/javascript-browser/JavaScript.ts", "../../js/langs/ruby-wasmer/Ruby.ts", "../../js/langs/webperl-5.28.1/Perl.ts", "../../js/UI.ts", "../../js/Renderers.ts", "../../js/Inputs/Code.ts", "../../js/Inputs/Abstract.ts", "../../js/replaceBinaryBytes.ts", "../../js/Renderers/Abstract.ts", "../../js/Renderers/Code.ts", "../../js/Renderers/IFrame.ts", "../../js/Decoders.ts", "../../js/IO.ts", "../../js/Options.ts", "../../js/Renderers/Image.ts", "../../js/Inputs.ts", "../../js/Renderers/Error/InvalidFormat.ts", "../../js/Renderers/PBMImage.ts", "../../js/Renderers/TTY.ts", "../../node_modules/xterm-addon-fit/src/FitAddon.ts", "../../js/Decoders/Xxd.ts", "../../js/langs/jq-wasmer/jq.ts", "../../js/app.ts"], + "sourcesContent": ["'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(rootNode) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var doc = rootNode.ownerDocument || rootNode;\n var activeElement;\n try {\n activeElement = rootNode.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function root(cm) {\n return rootNode(cm.display.wrapper)\n }\n\n function rootNode(element) {\n // Detect modern browsers (2017+).\n return element.getRootNode ? element.getRootNode() : element.ownerDocument\n }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(root(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(root(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(rootNode(snapshot.activeElt))) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(root(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(root(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(root(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(root(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(rootNode(div));\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(rootNode(this.div)) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(rootNode(this.div)) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(rootNode(this.textarea)) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(rootNode(textarea));\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, \u2026*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.16\";\n\n return CodeMirror;\n\n})));\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, dict) {\n for(var i = 0; i < dict.length; i++) {\n words[dict[i]] = style;\n }\n };\n\n var commonAtoms = [\"true\", \"false\"];\n var commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\n var commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n \"yes\", \"zsh\"];\n\n CodeMirror.registerHelper(\"hintWords\", \"shell\", commonAtoms.concat(commonKeywords, commonCommands));\n\n define('atom', commonAtoms);\n define('keyword', commonKeywords);\n define('builtin', commonCommands);\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (ch == \"<\") {\n if (stream.match(\"<<\")) return \"operator\"\n var heredoc = stream.match(/^<-?\\s*['\"]?([^'\"]*)['\"]?/)\n if (heredoc) {\n state.tokens.unshift(tokenHeredoc(heredoc[1]))\n return 'string-2'\n }\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote, style) {\n var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n return function(stream, state) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === close && !escaped) {\n state.tokens.shift();\n break;\n } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n } else if (!escaped && quote !== close && next === quote) {\n state.tokens.unshift(tokenString(quote, style))\n return tokenize(stream, state)\n } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n state.tokens.unshift(tokenStringStart(next, \"string\"));\n stream.backUp(1);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return style;\n };\n };\n\n function tokenStringStart(quote, style) {\n return function(stream, state) {\n state.tokens[0] = tokenString(quote, style)\n stream.next()\n return tokenize(stream, state)\n }\n }\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next()\n if (/['\"({]/.test(ch)) {\n state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n state.tokens.shift();\n return 'def';\n };\n\n function tokenHeredoc(delim) {\n return function(stream, state) {\n if (stream.sol() && stream.string == delim) state.tokens.shift()\n stream.skipToEnd()\n return \"string-2\"\n }\n }\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n// Apache uses a slightly different Media Type for Shell scripts\n// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\nCodeMirror.defineMIME('application/x-sh', 'shell');\n\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n pushcontext.lex = pushblockcontext.lex = true\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(maybeexpression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n if (type == \"quasi\") { return pass(quasiType, afterType); }\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function quasiType(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasiType);\n return cont(typeexpr, continueQuasiType);\n }\n function continueQuasiType(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasiType);\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+#?[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"!\") return cont(classfield)\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n parseJS(state, \"atom\", \"atom\", \"true\", new CodeMirror.StringStream(\"\", 2, null))\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nfunction wordObj(words) {\n var o = {};\n for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;\n return o;\n}\n\nvar keywordList = [\n \"alias\", \"and\", \"BEGIN\", \"begin\", \"break\", \"case\", \"class\", \"def\", \"defined?\", \"do\", \"else\",\n \"elsif\", \"END\", \"end\", \"ensure\", \"false\", \"for\", \"if\", \"in\", \"module\", \"next\", \"not\", \"or\",\n \"redo\", \"rescue\", \"retry\", \"return\", \"self\", \"super\", \"then\", \"true\", \"undef\", \"unless\",\n \"until\", \"when\", \"while\", \"yield\", \"nil\", \"raise\", \"throw\", \"catch\", \"fail\", \"loop\", \"callcc\",\n \"caller\", \"lambda\", \"proc\", \"public\", \"protected\", \"private\", \"require\", \"load\",\n \"require_relative\", \"extend\", \"autoload\", \"__END__\", \"__FILE__\", \"__LINE__\", \"__dir__\"\n], keywords = wordObj(keywordList);\n\nvar indentWords = wordObj([\"def\", \"class\", \"case\", \"for\", \"while\", \"until\", \"module\",\n \"catch\", \"loop\", \"proc\", \"begin\"]);\nvar dedentWords = wordObj([\"end\", \"until\"]);\nvar opening = {\"[\": \"]\", \"{\": \"}\", \"(\": \")\"};\nvar closing = {\"]\": \"[\", \"}\": \"{\", \")\": \"(\"};\n\nCodeMirror.defineMode(\"ruby\", function(config) {\n var curPunc;\n\n function chain(newtok, stream, state) {\n state.tokenize.push(newtok);\n return newtok(stream, state);\n }\n\n function tokenBase(stream, state) {\n if (stream.sol() && stream.match(\"=begin\") && stream.eol()) {\n state.tokenize.push(readBlockComment);\n return \"comment\";\n }\n if (stream.eatSpace()) return null;\n var ch = stream.next(), m;\n if (ch == \"`\" || ch == \"'\" || ch == '\"') {\n return chain(readQuoted(ch, \"string\", ch == '\"' || ch == \"`\"), stream, state);\n } else if (ch == \"/\") {\n if (regexpAhead(stream))\n return chain(readQuoted(ch, \"string-2\", true), stream, state);\n else\n return \"operator\";\n } else if (ch == \"%\") {\n var style = \"string\", embed = true;\n if (stream.eat(\"s\")) style = \"atom\";\n else if (stream.eat(/[WQ]/)) style = \"string\";\n else if (stream.eat(/[r]/)) style = \"string-2\";\n else if (stream.eat(/[wxq]/)) { style = \"string\"; embed = false; }\n var delim = stream.eat(/[^\\w\\s=]/);\n if (!delim) return \"operator\";\n if (opening.propertyIsEnumerable(delim)) delim = opening[delim];\n return chain(readQuoted(delim, style, embed, true), stream, state);\n } else if (ch == \"#\") {\n stream.skipToEnd();\n return \"comment\";\n } else if (ch == \"<\" && (m = stream.match(/^<([-~])[\\`\\\"\\']?([a-zA-Z_?]\\w*)[\\`\\\"\\']?(?:;|$)/))) {\n return chain(readHereDoc(m[2], m[1]), stream, state);\n } else if (ch == \"0\") {\n if (stream.eat(\"x\")) stream.eatWhile(/[\\da-fA-F]/);\n else if (stream.eat(\"b\")) stream.eatWhile(/[01]/);\n else stream.eatWhile(/[0-7]/);\n return \"number\";\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:\\.[\\d_]+)?(?:[eE][+\\-]?[\\d_]+)?/);\n return \"number\";\n } else if (ch == \"?\") {\n while (stream.match(/^\\\\[CM]-/)) {}\n if (stream.eat(\"\\\\\")) stream.eatWhile(/\\w/);\n else stream.next();\n return \"string\";\n } else if (ch == \":\") {\n if (stream.eat(\"'\")) return chain(readQuoted(\"'\", \"atom\", false), stream, state);\n if (stream.eat('\"')) return chain(readQuoted('\"', \"atom\", true), stream, state);\n\n // :> :>> :< :<< are valid symbols\n if (stream.eat(/[\\<\\>]/)) {\n stream.eat(/[\\<\\>]/);\n return \"atom\";\n }\n\n // :+ :- :/ :* :| :& :! are valid symbols\n if (stream.eat(/[\\+\\-\\*\\/\\&\\|\\:\\!]/)) {\n return \"atom\";\n }\n\n // Symbols can't start by a digit\n if (stream.eat(/[a-zA-Z$@_\\xa1-\\uffff]/)) {\n stream.eatWhile(/[\\w$\\xa1-\\uffff]/);\n // Only one ? ! = is allowed and only as the last character\n stream.eat(/[\\?\\!\\=]/);\n return \"atom\";\n }\n return \"operator\";\n } else if (ch == \"@\" && stream.match(/^@?[a-zA-Z_\\xa1-\\uffff]/)) {\n stream.eat(\"@\");\n stream.eatWhile(/[\\w\\xa1-\\uffff]/);\n return \"variable-2\";\n } else if (ch == \"$\") {\n if (stream.eat(/[a-zA-Z_]/)) {\n stream.eatWhile(/[\\w]/);\n } else if (stream.eat(/\\d/)) {\n stream.eat(/\\d/);\n } else {\n stream.next(); // Must be a special global like $: or $!\n }\n return \"variable-3\";\n } else if (/[a-zA-Z_\\xa1-\\uffff]/.test(ch)) {\n stream.eatWhile(/[\\w\\xa1-\\uffff]/);\n stream.eat(/[\\?\\!]/);\n if (stream.eat(\":\")) return \"atom\";\n return \"ident\";\n } else if (ch == \"|\" && (state.varList || state.lastTok == \"{\" || state.lastTok == \"do\")) {\n curPunc = \"|\";\n return null;\n } else if (/[\\(\\)\\[\\]{}\\\\;]/.test(ch)) {\n curPunc = ch;\n return null;\n } else if (ch == \"-\" && stream.eat(\">\")) {\n return \"arrow\";\n } else if (/[=+\\-\\/*:\\.^%<>~|]/.test(ch)) {\n var more = stream.eatWhile(/[=+\\-\\/*:\\.^%<>~|]/);\n if (ch == \".\" && !more) curPunc = \".\";\n return \"operator\";\n } else {\n return null;\n }\n }\n\n function regexpAhead(stream) {\n var start = stream.pos, depth = 0, next, found = false, escaped = false\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (\"[{(\".indexOf(next) > -1) {\n depth++\n } else if (\"]})\".indexOf(next) > -1) {\n depth--\n if (depth < 0) break\n } else if (next == \"/\" && depth == 0) {\n found = true\n break\n }\n escaped = next == \"\\\\\"\n } else {\n escaped = false\n }\n }\n stream.backUp(stream.pos - start)\n return found\n }\n\n function tokenBaseUntilBrace(depth) {\n if (!depth) depth = 1;\n return function(stream, state) {\n if (stream.peek() == \"}\") {\n if (depth == 1) {\n state.tokenize.pop();\n return state.tokenize[state.tokenize.length-1](stream, state);\n } else {\n state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1);\n }\n } else if (stream.peek() == \"{\") {\n state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1);\n }\n return tokenBase(stream, state);\n };\n }\n function tokenBaseOnce() {\n var alreadyCalled = false;\n return function(stream, state) {\n if (alreadyCalled) {\n state.tokenize.pop();\n return state.tokenize[state.tokenize.length-1](stream, state);\n }\n alreadyCalled = true;\n return tokenBase(stream, state);\n };\n }\n function readQuoted(quote, style, embed, unescaped) {\n return function(stream, state) {\n var escaped = false, ch;\n\n if (state.context.type === 'read-quoted-paused') {\n state.context = state.context.prev;\n stream.eat(\"}\");\n }\n\n while ((ch = stream.next()) != null) {\n if (ch == quote && (unescaped || !escaped)) {\n state.tokenize.pop();\n break;\n }\n if (embed && ch == \"#\" && !escaped) {\n if (stream.eat(\"{\")) {\n if (quote == \"}\") {\n state.context = {prev: state.context, type: 'read-quoted-paused'};\n }\n state.tokenize.push(tokenBaseUntilBrace());\n break;\n } else if (/[@\\$]/.test(stream.peek())) {\n state.tokenize.push(tokenBaseOnce());\n break;\n }\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return style;\n };\n }\n function readHereDoc(phrase, mayIndent) {\n return function(stream, state) {\n if (mayIndent) stream.eatSpace()\n if (stream.match(phrase)) state.tokenize.pop();\n else stream.skipToEnd();\n return \"string\";\n };\n }\n function readBlockComment(stream, state) {\n if (stream.sol() && stream.match(\"=end\") && stream.eol())\n state.tokenize.pop();\n stream.skipToEnd();\n return \"comment\";\n }\n\n return {\n startState: function() {\n return {tokenize: [tokenBase],\n indented: 0,\n context: {type: \"top\", indented: -config.indentUnit},\n continuedLine: false,\n lastTok: null,\n varList: false};\n },\n\n token: function(stream, state) {\n curPunc = null;\n if (stream.sol()) state.indented = stream.indentation();\n var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;\n var thisTok = curPunc;\n if (style == \"ident\") {\n var word = stream.current();\n style = state.lastTok == \".\" ? \"property\"\n : keywords.propertyIsEnumerable(stream.current()) ? \"keyword\"\n : /^[A-Z]/.test(word) ? \"tag\"\n : (state.lastTok == \"def\" || state.lastTok == \"class\" || state.varList) ? \"def\"\n : \"variable\";\n if (style == \"keyword\") {\n thisTok = word;\n if (indentWords.propertyIsEnumerable(word)) kwtype = \"indent\";\n else if (dedentWords.propertyIsEnumerable(word)) kwtype = \"dedent\";\n else if ((word == \"if\" || word == \"unless\") && stream.column() == stream.indentation())\n kwtype = \"indent\";\n else if (word == \"do\" && state.context.indented < state.indented)\n kwtype = \"indent\";\n }\n }\n if (curPunc || (style && style != \"comment\")) state.lastTok = thisTok;\n if (curPunc == \"|\") state.varList = !state.varList;\n\n if (kwtype == \"indent\" || /[\\(\\[\\{]/.test(curPunc))\n state.context = {prev: state.context, type: curPunc || style, indented: state.indented};\n else if ((kwtype == \"dedent\" || /[\\)\\]\\}]/.test(curPunc)) && state.context.prev)\n state.context = state.context.prev;\n\n if (stream.eol())\n state.continuedLine = (curPunc == \"\\\\\" || style == \"operator\");\n return style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize[state.tokenize.length-1] != tokenBase) return CodeMirror.Pass;\n var firstChar = textAfter && textAfter.charAt(0);\n var ct = state.context;\n var closed = ct.type == closing[firstChar] ||\n ct.type == \"keyword\" && /^(?:end|until|else|elsif|when|rescue)\\b/.test(textAfter);\n return ct.indented + (closed ? 0 : config.indentUnit) +\n (state.continuedLine ? config.indentUnit : 0);\n },\n\n electricInput: /^\\s*(?:end|rescue|elsif|else|\\})$/,\n lineComment: \"#\",\n fold: \"indent\"\n };\n});\n\nCodeMirror.defineMIME(\"text/x-ruby\", \"ruby\");\n\nCodeMirror.registerHelper(\"hintWords\", \"ruby\", keywordList);\n\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08)\n// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com)\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"perl\",function(){\n // http://perldoc.perl.org\n var PERL={ // null - magic touch\n // 1 - keyword\n // 2 - def\n // 3 - atom\n // 4 - operator\n // 5 - variable-2 (predefined)\n // [x,y] - x=1,2,3; y=must be defined if x{...}\n // PERL operators\n '->' : 4,\n '++' : 4,\n '--' : 4,\n '**' : 4,\n // ! ~ \\ and unary + and -\n '=~' : 4,\n '!~' : 4,\n '*' : 4,\n '/' : 4,\n '%' : 4,\n 'x' : 4,\n '+' : 4,\n '-' : 4,\n '.' : 4,\n '<<' : 4,\n '>>' : 4,\n // named unary operators\n '<' : 4,\n '>' : 4,\n '<=' : 4,\n '>=' : 4,\n 'lt' : 4,\n 'gt' : 4,\n 'le' : 4,\n 'ge' : 4,\n '==' : 4,\n '!=' : 4,\n '<=>' : 4,\n 'eq' : 4,\n 'ne' : 4,\n 'cmp' : 4,\n '~~' : 4,\n '&' : 4,\n '|' : 4,\n '^' : 4,\n '&&' : 4,\n '||' : 4,\n '//' : 4,\n '..' : 4,\n '...' : 4,\n '?' : 4,\n ':' : 4,\n '=' : 4,\n '+=' : 4,\n '-=' : 4,\n '*=' : 4, // etc. ???\n ',' : 4,\n '=>' : 4,\n '::' : 4,\n // list operators (rightward)\n 'not' : 4,\n 'and' : 4,\n 'or' : 4,\n 'xor' : 4,\n // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;)\n 'BEGIN' : [5,1],\n 'END' : [5,1],\n 'PRINT' : [5,1],\n 'PRINTF' : [5,1],\n 'GETC' : [5,1],\n 'READ' : [5,1],\n 'READLINE' : [5,1],\n 'DESTROY' : [5,1],\n 'TIE' : [5,1],\n 'TIEHANDLE' : [5,1],\n 'UNTIE' : [5,1],\n 'STDIN' : 5,\n 'STDIN_TOP' : 5,\n 'STDOUT' : 5,\n 'STDOUT_TOP' : 5,\n 'STDERR' : 5,\n 'STDERR_TOP' : 5,\n '$ARG' : 5,\n '$_' : 5,\n '@ARG' : 5,\n '@_' : 5,\n '$LIST_SEPARATOR' : 5,\n '$\"' : 5,\n '$PROCESS_ID' : 5,\n '$PID' : 5,\n '$$' : 5,\n '$REAL_GROUP_ID' : 5,\n '$GID' : 5,\n '$(' : 5,\n '$EFFECTIVE_GROUP_ID' : 5,\n '$EGID' : 5,\n '$)' : 5,\n '$PROGRAM_NAME' : 5,\n '$0' : 5,\n '$SUBSCRIPT_SEPARATOR' : 5,\n '$SUBSEP' : 5,\n '$;' : 5,\n '$REAL_USER_ID' : 5,\n '$UID' : 5,\n '$<' : 5,\n '$EFFECTIVE_USER_ID' : 5,\n '$EUID' : 5,\n '$>' : 5,\n '$a' : 5,\n '$b' : 5,\n '$COMPILING' : 5,\n '$^C' : 5,\n '$DEBUGGING' : 5,\n '$^D' : 5,\n '${^ENCODING}' : 5,\n '$ENV' : 5,\n '%ENV' : 5,\n '$SYSTEM_FD_MAX' : 5,\n '$^F' : 5,\n '@F' : 5,\n '${^GLOBAL_PHASE}' : 5,\n '$^H' : 5,\n '%^H' : 5,\n '@INC' : 5,\n '%INC' : 5,\n '$INPLACE_EDIT' : 5,\n '$^I' : 5,\n '$^M' : 5,\n '$OSNAME' : 5,\n '$^O' : 5,\n '${^OPEN}' : 5,\n '$PERLDB' : 5,\n '$^P' : 5,\n '$SIG' : 5,\n '%SIG' : 5,\n '$BASETIME' : 5,\n '$^T' : 5,\n '${^TAINT}' : 5,\n '${^UNICODE}' : 5,\n '${^UTF8CACHE}' : 5,\n '${^UTF8LOCALE}' : 5,\n '$PERL_VERSION' : 5,\n '$^V' : 5,\n '${^WIN32_SLOPPY_STAT}' : 5,\n '$EXECUTABLE_NAME' : 5,\n '$^X' : 5,\n '$1' : 5, // - regexp $1, $2...\n '$MATCH' : 5,\n '$&' : 5,\n '${^MATCH}' : 5,\n '$PREMATCH' : 5,\n '$`' : 5,\n '${^PREMATCH}' : 5,\n '$POSTMATCH' : 5,\n \"$'\" : 5,\n '${^POSTMATCH}' : 5,\n '$LAST_PAREN_MATCH' : 5,\n '$+' : 5,\n '$LAST_SUBMATCH_RESULT' : 5,\n '$^N' : 5,\n '@LAST_MATCH_END' : 5,\n '@+' : 5,\n '%LAST_PAREN_MATCH' : 5,\n '%+' : 5,\n '@LAST_MATCH_START' : 5,\n '@-' : 5,\n '%LAST_MATCH_START' : 5,\n '%-' : 5,\n '$LAST_REGEXP_CODE_RESULT' : 5,\n '$^R' : 5,\n '${^RE_DEBUG_FLAGS}' : 5,\n '${^RE_TRIE_MAXBUF}' : 5,\n '$ARGV' : 5,\n '@ARGV' : 5,\n 'ARGV' : 5,\n 'ARGVOUT' : 5,\n '$OUTPUT_FIELD_SEPARATOR' : 5,\n '$OFS' : 5,\n '$,' : 5,\n '$INPUT_LINE_NUMBER' : 5,\n '$NR' : 5,\n '$.' : 5,\n '$INPUT_RECORD_SEPARATOR' : 5,\n '$RS' : 5,\n '$/' : 5,\n '$OUTPUT_RECORD_SEPARATOR' : 5,\n '$ORS' : 5,\n '$\\\\' : 5,\n '$OUTPUT_AUTOFLUSH' : 5,\n '$|' : 5,\n '$ACCUMULATOR' : 5,\n '$^A' : 5,\n '$FORMAT_FORMFEED' : 5,\n '$^L' : 5,\n '$FORMAT_PAGE_NUMBER' : 5,\n '$%' : 5,\n '$FORMAT_LINES_LEFT' : 5,\n '$-' : 5,\n '$FORMAT_LINE_BREAK_CHARACTERS' : 5,\n '$:' : 5,\n '$FORMAT_LINES_PER_PAGE' : 5,\n '$=' : 5,\n '$FORMAT_TOP_NAME' : 5,\n '$^' : 5,\n '$FORMAT_NAME' : 5,\n '$~' : 5,\n '${^CHILD_ERROR_NATIVE}' : 5,\n '$EXTENDED_OS_ERROR' : 5,\n '$^E' : 5,\n '$EXCEPTIONS_BEING_CAUGHT' : 5,\n '$^S' : 5,\n '$WARNING' : 5,\n '$^W' : 5,\n '${^WARNING_BITS}' : 5,\n '$OS_ERROR' : 5,\n '$ERRNO' : 5,\n '$!' : 5,\n '%OS_ERROR' : 5,\n '%ERRNO' : 5,\n '%!' : 5,\n '$CHILD_ERROR' : 5,\n '$?' : 5,\n '$EVAL_ERROR' : 5,\n '$@' : 5,\n '$OFMT' : 5,\n '$#' : 5,\n '$*' : 5,\n '$ARRAY_BASE' : 5,\n '$[' : 5,\n '$OLD_PERL_VERSION' : 5,\n '$]' : 5,\n // PERL blocks\n 'if' :[1,1],\n elsif :[1,1],\n 'else' :[1,1],\n 'while' :[1,1],\n unless :[1,1],\n 'for' :[1,1],\n foreach :[1,1],\n // PERL functions\n 'abs' :1, // - absolute value function\n accept :1, // - accept an incoming socket connect\n alarm :1, // - schedule a SIGALRM\n 'atan2' :1, // - arctangent of Y/X in the range -PI to PI\n bind :1, // - binds an address to a socket\n binmode :1, // - prepare binary files for I/O\n bless :1, // - create an object\n bootstrap :1, //\n 'break' :1, // - break out of a \"given\" block\n caller :1, // - get context of the current subroutine call\n chdir :1, // - change your current working directory\n chmod :1, // - changes the permissions on a list of files\n chomp :1, // - remove a trailing record separator from a string\n chop :1, // - remove the last character from a string\n chown :1, // - change the ownership on a list of files\n chr :1, // - get character this number represents\n chroot :1, // - make directory new root for path lookups\n close :1, // - close file (or pipe or socket) handle\n closedir :1, // - close directory handle\n connect :1, // - connect to a remote socket\n 'continue' :[1,1], // - optional trailing block in a while or foreach\n 'cos' :1, // - cosine function\n crypt :1, // - one-way passwd-style encryption\n dbmclose :1, // - breaks binding on a tied dbm file\n dbmopen :1, // - create binding on a tied dbm file\n 'default' :1, //\n defined :1, // - test whether a value, variable, or function is defined\n 'delete' :1, // - deletes a value from a hash\n die :1, // - raise an exception or bail out\n 'do' :1, // - turn a BLOCK into a TERM\n dump :1, // - create an immediate core dump\n each :1, // - retrieve the next key/value pair from a hash\n endgrent :1, // - be done using group file\n endhostent :1, // - be done using hosts file\n endnetent :1, // - be done using networks file\n endprotoent :1, // - be done using protocols file\n endpwent :1, // - be done using passwd file\n endservent :1, // - be done using services file\n eof :1, // - test a filehandle for its end\n 'eval' :1, // - catch exceptions or compile and run code\n 'exec' :1, // - abandon this program to run another\n exists :1, // - test whether a hash key is present\n exit :1, // - terminate this program\n 'exp' :1, // - raise I to a power\n fcntl :1, // - file control system call\n fileno :1, // - return file descriptor from filehandle\n flock :1, // - lock an entire file with an advisory lock\n fork :1, // - create a new process just like this one\n format :1, // - declare a picture format with use by the write() function\n formline :1, // - internal function used for formats\n getc :1, // - get the next character from the filehandle\n getgrent :1, // - get next group record\n getgrgid :1, // - get group record given group user ID\n getgrnam :1, // - get group record given group name\n gethostbyaddr :1, // - get host record given its address\n gethostbyname :1, // - get host record given name\n gethostent :1, // - get next hosts record\n getlogin :1, // - return who logged in at this tty\n getnetbyaddr :1, // - get network record given its address\n getnetbyname :1, // - get networks record given name\n getnetent :1, // - get next networks record\n getpeername :1, // - find the other end of a socket connection\n getpgrp :1, // - get process group\n getppid :1, // - get parent process ID\n getpriority :1, // - get current nice value\n getprotobyname :1, // - get protocol record given name\n getprotobynumber :1, // - get protocol record numeric protocol\n getprotoent :1, // - get next protocols record\n getpwent :1, // - get next passwd record\n getpwnam :1, // - get passwd record given user login name\n getpwuid :1, // - get passwd record given user ID\n getservbyname :1, // - get services record given its name\n getservbyport :1, // - get services record given numeric port\n getservent :1, // - get next services record\n getsockname :1, // - retrieve the sockaddr for a given socket\n getsockopt :1, // - get socket options on a given socket\n given :1, //\n glob :1, // - expand filenames using wildcards\n gmtime :1, // - convert UNIX time into record or string using Greenwich time\n 'goto' :1, // - create spaghetti code\n grep :1, // - locate elements in a list test true against a given criterion\n hex :1, // - convert a string to a hexadecimal number\n 'import' :1, // - patch a module's namespace into your own\n index :1, // - find a substring within a string\n 'int' :1, // - get the integer portion of a number\n ioctl :1, // - system-dependent device control system call\n 'join' :1, // - join a list into a string using a separator\n keys :1, // - retrieve list of indices from a hash\n kill :1, // - send a signal to a process or process group\n last :1, // - exit a block prematurely\n lc :1, // - return lower-case version of a string\n lcfirst :1, // - return a string with just the next letter in lower case\n length :1, // - return the number of bytes in a string\n 'link' :1, // - create a hard link in the filesystem\n listen :1, // - register your socket as a server\n local : 2, // - create a temporary value for a global variable (dynamic scoping)\n localtime :1, // - convert UNIX time into record or string using local time\n lock :1, // - get a thread lock on a variable, subroutine, or method\n 'log' :1, // - retrieve the natural logarithm for a number\n lstat :1, // - stat a symbolic link\n m :null, // - match a string with a regular expression pattern\n map :1, // - apply a change to a list to get back a new list with the changes\n mkdir :1, // - create a directory\n msgctl :1, // - SysV IPC message control operations\n msgget :1, // - get SysV IPC message queue\n msgrcv :1, // - receive a SysV IPC message from a message queue\n msgsnd :1, // - send a SysV IPC message to a message queue\n my : 2, // - declare and assign a local variable (lexical scoping)\n 'new' :1, //\n next :1, // - iterate a block prematurely\n no :1, // - unimport some module symbols or semantics at compile time\n oct :1, // - convert a string to an octal number\n open :1, // - open a file, pipe, or descriptor\n opendir :1, // - open a directory\n ord :1, // - find a character's numeric representation\n our : 2, // - declare and assign a package variable (lexical scoping)\n pack :1, // - convert a list into a binary representation\n 'package' :1, // - declare a separate global namespace\n pipe :1, // - open a pair of connected filehandles\n pop :1, // - remove the last element from an array and return it\n pos :1, // - find or set the offset for the last/next m//g search\n print :1, // - output a list to a filehandle\n printf :1, // - output a formatted list to a filehandle\n prototype :1, // - get the prototype (if any) of a subroutine\n push :1, // - append one or more elements to an array\n q :null, // - singly quote a string\n qq :null, // - doubly quote a string\n qr :null, // - Compile pattern\n quotemeta :null, // - quote regular expression magic characters\n qw :null, // - quote a list of words\n qx :null, // - backquote quote a string\n rand :1, // - retrieve the next pseudorandom number\n read :1, // - fixed-length buffered input from a filehandle\n readdir :1, // - get a directory from a directory handle\n readline :1, // - fetch a record from a file\n readlink :1, // - determine where a symbolic link is pointing\n readpipe :1, // - execute a system command and collect standard output\n recv :1, // - receive a message over a Socket\n redo :1, // - start this loop iteration over again\n ref :1, // - find out the type of thing being referenced\n rename :1, // - change a filename\n require :1, // - load in external functions from a library at runtime\n reset :1, // - clear all variables of a given name\n 'return' :1, // - get out of a function early\n reverse :1, // - flip a string or a list\n rewinddir :1, // - reset directory handle\n rindex :1, // - right-to-left substring search\n rmdir :1, // - remove a directory\n s :null, // - replace a pattern with a string\n say :1, // - print with newline\n scalar :1, // - force a scalar context\n seek :1, // - reposition file pointer for random-access I/O\n seekdir :1, // - reposition directory pointer\n select :1, // - reset default output or do I/O multiplexing\n semctl :1, // - SysV semaphore control operations\n semget :1, // - get set of SysV semaphores\n semop :1, // - SysV semaphore operations\n send :1, // - send a message over a socket\n setgrent :1, // - prepare group file for use\n sethostent :1, // - prepare hosts file for use\n setnetent :1, // - prepare networks file for use\n setpgrp :1, // - set the process group of a process\n setpriority :1, // - set a process's nice value\n setprotoent :1, // - prepare protocols file for use\n setpwent :1, // - prepare passwd file for use\n setservent :1, // - prepare services file for use\n setsockopt :1, // - set some socket options\n shift :1, // - remove the first element of an array, and return it\n shmctl :1, // - SysV shared memory operations\n shmget :1, // - get SysV shared memory segment identifier\n shmread :1, // - read SysV shared memory\n shmwrite :1, // - write SysV shared memory\n shutdown :1, // - close down just half of a socket connection\n 'sin' :1, // - return the sine of a number\n sleep :1, // - block for some number of seconds\n socket :1, // - create a socket\n socketpair :1, // - create a pair of sockets\n 'sort' :1, // - sort a list of values\n splice :1, // - add or remove elements anywhere in an array\n 'split' :1, // - split up a string using a regexp delimiter\n sprintf :1, // - formatted print into a string\n 'sqrt' :1, // - square root function\n srand :1, // - seed the random number generator\n stat :1, // - get a file's status information\n state :1, // - declare and assign a state variable (persistent lexical scoping)\n study :1, // - optimize input data for repeated searches\n 'sub' :1, // - declare a subroutine, possibly anonymously\n 'substr' :1, // - get or alter a portion of a string\n symlink :1, // - create a symbolic link to a file\n syscall :1, // - execute an arbitrary system call\n sysopen :1, // - open a file, pipe, or descriptor\n sysread :1, // - fixed-length unbuffered input from a filehandle\n sysseek :1, // - position I/O pointer on handle used with sysread and syswrite\n system :1, // - run a separate program\n syswrite :1, // - fixed-length unbuffered output to a filehandle\n tell :1, // - get current seekpointer on a filehandle\n telldir :1, // - get current seekpointer on a directory handle\n tie :1, // - bind a variable to an object class\n tied :1, // - get a reference to the object underlying a tied variable\n time :1, // - return number of seconds since 1970\n times :1, // - return elapsed time for self and child processes\n tr :null, // - transliterate a string\n truncate :1, // - shorten a file\n uc :1, // - return upper-case version of a string\n ucfirst :1, // - return a string with just the next letter in upper case\n umask :1, // - set file creation mode mask\n undef :1, // - remove a variable or function definition\n unlink :1, // - remove one link to a file\n unpack :1, // - convert binary structure into normal perl variables\n unshift :1, // - prepend more elements to the beginning of a list\n untie :1, // - break a tie binding to a variable\n use :1, // - load in a module at compile time\n utime :1, // - set a file's last access and modify times\n values :1, // - return a list of the values in a hash\n vec :1, // - test or set particular bits in a string\n wait :1, // - wait for any child process to die\n waitpid :1, // - wait for a particular child process to die\n wantarray :1, // - get void vs scalar vs list context of current subroutine call\n warn :1, // - print debugging info\n when :1, //\n write :1, // - print a picture record\n y :null}; // - transliterate a string\n\n var RXstyle=\"string-2\";\n var RXmodifiers=/[goseximacplud]/; // NOTE: \"m\", \"s\", \"y\" and \"tr\" need to correct real modifiers for each regexp type\n\n function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)\n state.chain=null; // 12 3tail\n state.style=null;\n state.tail=null;\n state.tokenize=function(stream,state){\n var e=false,c,i=0;\n while(c=stream.next()){\n if(c===chain[i]&&!e){\n if(chain[++i]!==undefined){\n state.chain=chain[i];\n state.style=style;\n state.tail=tail;}\n else if(tail)\n stream.eatWhile(tail);\n state.tokenize=tokenPerl;\n return style;}\n e=!e&&c==\"\\\\\";}\n return style;};\n return state.tokenize(stream,state);}\n\n function tokenSOMETHING(stream,state,string){\n state.tokenize=function(stream,state){\n if(stream.string==string)\n state.tokenize=tokenPerl;\n stream.skipToEnd();\n return \"string\";};\n return state.tokenize(stream,state);}\n\n function tokenPerl(stream,state){\n if(stream.eatSpace())\n return null;\n if(state.chain)\n return tokenChain(stream,state,state.chain,state.style,state.tail);\n if(stream.match(/^(\\-?((\\d[\\d_]*)?\\.\\d+(e[+-]?\\d+)?|\\d+\\.\\d*)|0x[\\da-fA-F_]+|0b[01_]+|\\d[\\d_]*(e[+-]?\\d+)?)/))\n return 'number';\n if(stream.match(/^<<(?=[_a-zA-Z])/)){ // NOTE: <\"],RXstyle,RXmodifiers);}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}\n else if(c==\"q\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],\"string\");}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],\"string\");}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],\"string\");}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],\"string\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],\"string\");}}\n else if(c==\"w\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],\"bracket\");}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],\"bracket\");}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],\"bracket\");}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],\"bracket\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],\"bracket\");}}\n else if(c==\"r\"){\n c=look(stream, 1);\n if(c==\"(\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\")\"],RXstyle,RXmodifiers);}\n if(c==\"[\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"]\"],RXstyle,RXmodifiers);}\n if(c==\"{\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\"}\"],RXstyle,RXmodifiers);}\n if(c==\"<\"){\n eatSuffix(stream, 2);\n return tokenChain(stream,state,[\">\"],RXstyle,RXmodifiers);}\n if(/[\\^'\"!~\\/]/.test(c)){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}\n else if(/[\\^'\"!~\\/(\\[{<]/.test(c)){\n if(c==\"(\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\")\"],\"string\");}\n if(c==\"[\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\"]\"],\"string\");}\n if(c==\"{\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\"}\"],\"string\");}\n if(c==\"<\"){\n eatSuffix(stream, 1);\n return tokenChain(stream,state,[\">\"],\"string\");}\n if(/[\\^'\"!~\\/]/.test(c)){\n return tokenChain(stream,state,[stream.eat(c)],\"string\");}}}}\n if(ch==\"m\"){\n var c=look(stream, -2);\n if(!(c&&/\\w/.test(c))){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(/[\\^'\"!~\\/]/.test(c)){\n return tokenChain(stream,state,[c],RXstyle,RXmodifiers);}\n if(c==\"(\"){\n return tokenChain(stream,state,[\")\"],RXstyle,RXmodifiers);}\n if(c==\"[\"){\n return tokenChain(stream,state,[\"]\"],RXstyle,RXmodifiers);}\n if(c==\"{\"){\n return tokenChain(stream,state,[\"}\"],RXstyle,RXmodifiers);}\n if(c==\"<\"){\n return tokenChain(stream,state,[\">\"],RXstyle,RXmodifiers);}}}}\n if(ch==\"s\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}\n if(ch==\"y\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}\n if(ch==\"t\"){\n var c=/[\\/>\\]})\\w]/.test(look(stream, -2));\n if(!c){\n c=stream.eat(\"r\");if(c){\n c=stream.eat(/[(\\[{<\\^'\"!~\\/]/);\n if(c){\n if(c==\"[\")\n return tokenChain(stream,state,[\"]\",\"]\"],RXstyle,RXmodifiers);\n if(c==\"{\")\n return tokenChain(stream,state,[\"}\",\"}\"],RXstyle,RXmodifiers);\n if(c==\"<\")\n return tokenChain(stream,state,[\">\",\">\"],RXstyle,RXmodifiers);\n if(c==\"(\")\n return tokenChain(stream,state,[\")\",\")\"],RXstyle,RXmodifiers);\n return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}}\n if(ch==\"`\"){\n return tokenChain(stream,state,[ch],\"variable-2\");}\n if(ch==\"/\"){\n if(!/~\\s*$/.test(prefix(stream)))\n return \"operator\";\n else\n return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);}\n if(ch==\"$\"){\n var p=stream.pos;\n if(stream.eatWhile(/\\d/)||stream.eat(\"{\")&&stream.eatWhile(/\\d/)&&stream.eat(\"}\"))\n return \"variable-2\";\n else\n stream.pos=p;}\n if(/[$@%]/.test(ch)){\n var p=stream.pos;\n if(stream.eat(\"^\")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\\\\-#?@;:&`~\\^!\\[\\]*'\"$+.,\\/<>()]/)){\n var c=stream.current();\n if(PERL[c])\n return \"variable-2\";}\n stream.pos=p;}\n if(/[$@%&]/.test(ch)){\n if(stream.eatWhile(/[\\w$]/)||stream.eat(\"{\")&&stream.eatWhile(/[\\w$]/)&&stream.eat(\"}\")){\n var c=stream.current();\n if(PERL[c])\n return \"variable-2\";\n else\n return \"variable\";}}\n if(ch==\"#\"){\n if(look(stream, -2)!=\"$\"){\n stream.skipToEnd();\n return \"comment\";}}\n if(/[:+\\-\\^*$&%@=<>!?|\\/~\\.]/.test(ch)){\n var p=stream.pos;\n stream.eatWhile(/[:+\\-\\^*$&%@=<>!?|\\/~\\.]/);\n if(PERL[stream.current()])\n return \"operator\";\n else\n stream.pos=p;}\n if(ch==\"_\"){\n if(stream.pos==1){\n if(suffix(stream, 6)==\"_END__\"){\n return tokenChain(stream,state,['\\0'],\"comment\");}\n else if(suffix(stream, 7)==\"_DATA__\"){\n return tokenChain(stream,state,['\\0'],\"variable-2\");}\n else if(suffix(stream, 7)==\"_C__\"){\n return tokenChain(stream,state,['\\0'],\"string\");}}}\n if(/\\w/.test(ch)){\n var p=stream.pos;\n if(look(stream, -2)==\"{\"&&(look(stream, 0)==\"}\"||stream.eatWhile(/\\w/)&&look(stream, 0)==\"}\"))\n return \"string\";\n else\n stream.pos=p;}\n if(/[A-Z]/.test(ch)){\n var l=look(stream, -2);\n var p=stream.pos;\n stream.eatWhile(/[A-Z_]/);\n if(/[\\da-z]/.test(look(stream, 0))){\n stream.pos=p;}\n else{\n var c=PERL[stream.current()];\n if(!c)\n return \"meta\";\n if(c[1])\n c=c[0];\n if(l!=\":\"){\n if(c==1)\n return \"keyword\";\n else if(c==2)\n return \"def\";\n else if(c==3)\n return \"atom\";\n else if(c==4)\n return \"operator\";\n else if(c==5)\n return \"variable-2\";\n else\n return \"meta\";}\n else\n return \"meta\";}}\n if(/[a-zA-Z_]/.test(ch)){\n var l=look(stream, -2);\n stream.eatWhile(/\\w/);\n var c=PERL[stream.current()];\n if(!c)\n return \"meta\";\n if(c[1])\n c=c[0];\n if(l!=\":\"){\n if(c==1)\n return \"keyword\";\n else if(c==2)\n return \"def\";\n else if(c==3)\n return \"atom\";\n else if(c==4)\n return \"operator\";\n else if(c==5)\n return \"variable-2\";\n else\n return \"meta\";}\n else\n return \"meta\";}\n return null;}\n\n return {\n startState: function() {\n return {\n tokenize: tokenPerl,\n chain: null,\n style: null,\n tail: null\n };\n },\n token: function(stream, state) {\n return (state.tokenize || tokenPerl)(stream, state);\n },\n lineComment: '#'\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"perl\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/x-perl\", \"perl\");\n\n// it's like \"peek\", but need for look-ahead or look-behind if index < 0\nfunction look(stream, c){\n return stream.string.charAt(stream.pos+(c||0));\n}\n\n// return a part of prefix of current stream from current position\nfunction prefix(stream, c){\n if(c){\n var x=stream.pos-c;\n return stream.string.substr((x>=0?x:0),c);}\n else{\n return stream.string.substr(0,stream.pos-1);\n }\n}\n\n// return a part of suffix of current stream from current position\nfunction suffix(stream, c){\n var y=stream.string.length;\n var x=y-stream.pos+1;\n return stream.string.substr(stream.pos,(c&&c=(y=stream.string.length-1))\n stream.pos=y;\n else\n stream.pos=x;\n}\n\n});\n", "\"use strict\";var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i0){_this.hide()}}))}this.element.classList.remove(this.toastShowClass);this.element.classList.add(this.toastHideClass);this.trigger(\"hide\");if(this.animation){var transitionEndHandler_1=function(){return _this.remove()},transitionStartHandler_1=function(){if(bound_1){return}_this.element.addEventListener(\"transitionend\",(function(){return transitionEndHandler_1()}));bound_1=true},mouseOverHandler_1=function(){_this.show();_this.element.removeEventListener(\"transitionstart\",(function(){return transitionStartHandler_1()}));_this.element.removeEventListener(\"transitionend\",(function(){return transitionEndHandler_1()}));_this.element.removeEventListener(\"mouseover\",(function(){return mouseOverHandler_1()}));_this.element.addEventListener(\"mouseout\",(function(){return _this.hide()}))};var bound_1=false;this.element.addEventListener(\"mouseover\",(function(){return mouseOverHandler_1()}));this.element.addEventListener(\"transitionstart\",(function(){return transitionStartHandler_1()}));return}this.remove()};Melba.prototype.remove=function(){if(this.element.parentNode===this.container){this.container.removeChild(this.element);this.trigger(\"remove\")}};Melba.prototype.buildClose=function(closeLabel){var _this=this;var closeButton=document.createElement(\"button\");closeButton.setAttribute(\"title\",closeLabel);closeButton.appendChild(document.createTextNode(closeLabel));closeButton.addEventListener(\"click\",(function(){return _this.hide()}));return closeButton};Melba.prototype.getContainer=function(_a){var containerClass=_a.containerClass,containerElement=_a.containerElement,root=_a.root;var existingContainer=root.querySelector(\"\".concat(containerElement,\".\").concat(containerClass));if(existingContainer){return existingContainer}var container=document.createElement(containerElement);container.classList.add(containerClass);root.appendChild(container);return container};Melba.prototype.on=function(event,callable){if(!this.events[event]){this.events[event]=[]}this.events[event].push(callable)};Melba.prototype.off=function(event,callable){if(callable===void 0){callable=null}if(!callable){this.events[event]=[];return}var hasEvent=this.events[event].indexOf(callable);if(hasEvent===-1){this.events[event].splice(hasEvent,1)}};Melba.prototype.trigger=function(event){var _this=this;var args=[];for(var _i=1;_i void;\n private _bottomBoundaryFocusListener: (e: FocusEvent) => void;\n\n /**\n * This queue has a character pushed to it for keys that are pressed, if the\n * next character added to the terminal is equal to the key char then it is\n * not announced (added to live region) because it has already been announced\n * by the textarea event (which cannot be canceled). There are some race\n * condition cases if there is typing while data is streaming, but this covers\n * the main case of typing into the prompt and inputting the answer to a\n * question (Y/N, etc.).\n */\n private _charsToConsume: string[] = [];\n\n private _charsToAnnounce: string = '';\n\n constructor(\n private readonly _terminal: ITerminal,\n private readonly _renderService: IRenderService\n ) {\n super();\n this._accessibilityTreeRoot = document.createElement('div');\n this._accessibilityTreeRoot.classList.add('xterm-accessibility');\n this._accessibilityTreeRoot.tabIndex = 0;\n\n this._rowContainer = document.createElement('div');\n this._rowContainer.setAttribute('role', 'list');\n this._rowContainer.classList.add('xterm-accessibility-tree');\n this._rowElements = [];\n for (let i = 0; i < this._terminal.rows; i++) {\n this._rowElements[i] = this._createAccessibilityTreeNode();\n this._rowContainer.appendChild(this._rowElements[i]);\n }\n\n this._topBoundaryFocusListener = e => this._onBoundaryFocus(e, BoundaryPosition.TOP);\n this._bottomBoundaryFocusListener = e => this._onBoundaryFocus(e, BoundaryPosition.BOTTOM);\n this._rowElements[0].addEventListener('focus', this._topBoundaryFocusListener);\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n this._refreshRowsDimensions();\n this._accessibilityTreeRoot.appendChild(this._rowContainer);\n\n this._renderRowsDebouncer = new TimeBasedDebouncer(this._renderRows.bind(this));\n this._refreshRows();\n\n this._liveRegion = document.createElement('div');\n this._liveRegion.classList.add('live-region');\n this._liveRegion.setAttribute('aria-live', 'assertive');\n this._accessibilityTreeRoot.appendChild(this._liveRegion);\n\n if (!this._terminal.element) {\n throw new Error('Cannot enable accessibility before Terminal.open');\n }\n this._terminal.element.insertAdjacentElement('afterbegin', this._accessibilityTreeRoot);\n\n this.register(this._renderRowsDebouncer);\n this.register(this._terminal.onResize(e => this._onResize(e.rows)));\n this.register(this._terminal.onRender(e => this._refreshRows(e.start, e.end)));\n this.register(this._terminal.onScroll(() => this._refreshRows()));\n // Line feed is an issue as the prompt won't be read out after a command is run\n this.register(this._terminal.onA11yChar(char => this._onChar(char)));\n this.register(this._terminal.onLineFeed(() => this._onChar('\\n')));\n this.register(this._terminal.onA11yTab(spaceCount => this._onTab(spaceCount)));\n this.register(this._terminal.onKey(e => this._onKey(e.key)));\n this.register(this._terminal.onBlur(() => this._clearLiveRegion()));\n this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions()));\n\n this._screenDprMonitor = new ScreenDprMonitor();\n this.register(this._screenDprMonitor);\n this._screenDprMonitor.setListener(() => this._refreshRowsDimensions());\n // This shouldn't be needed on modern browsers but is present in case the\n // media query that drives the ScreenDprMonitor isn't supported\n this.register(addDisposableDomListener(window, 'resize', () => this._refreshRowsDimensions()));\n }\n\n public dispose(): void {\n super.dispose();\n removeElementFromParent(this._accessibilityTreeRoot);\n this._rowElements.length = 0;\n }\n\n private _onBoundaryFocus(e: FocusEvent, position: BoundaryPosition): void {\n const boundaryElement = e.target as HTMLElement;\n const beforeBoundaryElement = this._rowElements[position === BoundaryPosition.TOP ? 1 : this._rowElements.length - 2];\n\n // Don't scroll if the buffer top has reached the end in that direction\n const posInSet = boundaryElement.getAttribute('aria-posinset');\n const lastRowPos = position === BoundaryPosition.TOP ? '1' : `${this._terminal.buffer.lines.length}`;\n if (posInSet === lastRowPos) {\n return;\n }\n\n // Don't scroll when the last focused item was not the second row (focus is going the other\n // direction)\n if (e.relatedTarget !== beforeBoundaryElement) {\n return;\n }\n\n // Remove old boundary element from array\n let topBoundaryElement: HTMLElement;\n let bottomBoundaryElement: HTMLElement;\n if (position === BoundaryPosition.TOP) {\n topBoundaryElement = boundaryElement;\n bottomBoundaryElement = this._rowElements.pop()!;\n this._rowContainer.removeChild(bottomBoundaryElement);\n } else {\n topBoundaryElement = this._rowElements.shift()!;\n bottomBoundaryElement = boundaryElement;\n this._rowContainer.removeChild(topBoundaryElement);\n }\n\n // Remove listeners from old boundary elements\n topBoundaryElement.removeEventListener('focus', this._topBoundaryFocusListener);\n bottomBoundaryElement.removeEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Add new element to array/DOM\n if (position === BoundaryPosition.TOP) {\n const newElement = this._createAccessibilityTreeNode();\n this._rowElements.unshift(newElement);\n this._rowContainer.insertAdjacentElement('afterbegin', newElement);\n } else {\n const newElement = this._createAccessibilityTreeNode();\n this._rowElements.push(newElement);\n this._rowContainer.appendChild(newElement);\n }\n\n // Add listeners to new boundary elements\n this._rowElements[0].addEventListener('focus', this._topBoundaryFocusListener);\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Scroll up\n this._terminal.scrollLines(position === BoundaryPosition.TOP ? -1 : 1);\n\n // Focus new boundary before element\n this._rowElements[position === BoundaryPosition.TOP ? 1 : this._rowElements.length - 2].focus();\n\n // Prevent the standard behavior\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n\n private _onResize(rows: number): void {\n // Remove bottom boundary listener\n this._rowElements[this._rowElements.length - 1].removeEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Grow rows as required\n for (let i = this._rowContainer.children.length; i < this._terminal.rows; i++) {\n this._rowElements[i] = this._createAccessibilityTreeNode();\n this._rowContainer.appendChild(this._rowElements[i]);\n }\n // Shrink rows as required\n while (this._rowElements.length > rows) {\n this._rowContainer.removeChild(this._rowElements.pop()!);\n }\n\n // Add bottom boundary listener\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n this._refreshRowsDimensions();\n }\n\n private _createAccessibilityTreeNode(): HTMLElement {\n const element = document.createElement('div');\n element.setAttribute('role', 'listitem');\n element.tabIndex = -1;\n this._refreshRowDimensions(element);\n return element;\n }\n\n private _onTab(spaceCount: number): void {\n for (let i = 0; i < spaceCount; i++) {\n this._onChar(' ');\n }\n }\n\n private _onChar(char: string): void {\n if (this._liveRegionLineCount < MAX_ROWS_TO_READ + 1) {\n if (this._charsToConsume.length > 0) {\n // Have the screen reader ignore the char if it was just input\n const shiftedChar = this._charsToConsume.shift();\n if (shiftedChar !== char) {\n this._charsToAnnounce += char;\n }\n } else {\n this._charsToAnnounce += char;\n }\n\n if (char === '\\n') {\n this._liveRegionLineCount++;\n if (this._liveRegionLineCount === MAX_ROWS_TO_READ + 1) {\n this._liveRegion.textContent += Strings.tooMuchOutput;\n }\n }\n\n // Only detach/attach on mac as otherwise messages can go unaccounced\n if (isMac) {\n if (this._liveRegion.textContent && this._liveRegion.textContent.length > 0 && !this._liveRegion.parentNode) {\n setTimeout(() => {\n this._accessibilityTreeRoot.appendChild(this._liveRegion);\n }, 0);\n }\n }\n }\n }\n\n private _clearLiveRegion(): void {\n this._liveRegion.textContent = '';\n this._liveRegionLineCount = 0;\n\n // Only detach/attach on mac as otherwise messages can go unaccounced\n if (isMac) {\n removeElementFromParent(this._liveRegion);\n }\n }\n\n private _onKey(keyChar: string): void {\n this._clearLiveRegion();\n this._charsToConsume.push(keyChar);\n }\n\n private _refreshRows(start?: number, end?: number): void {\n this._renderRowsDebouncer.refresh(start, end, this._terminal.rows);\n }\n\n private _renderRows(start: number, end: number): void {\n const buffer: IBuffer = this._terminal.buffer;\n const setSize = buffer.lines.length.toString();\n for (let i = start; i <= end; i++) {\n const lineData = buffer.translateBufferLineToString(buffer.ydisp + i, true);\n const posInSet = (buffer.ydisp + i + 1).toString();\n const element = this._rowElements[i];\n if (element) {\n if (lineData.length === 0) {\n element.innerText = '\\u00a0';\n } else {\n element.textContent = lineData;\n }\n element.setAttribute('aria-posinset', posInSet);\n element.setAttribute('aria-setsize', setSize);\n }\n }\n this._announceCharacters();\n }\n\n private _refreshRowsDimensions(): void {\n if (!this._renderService.dimensions.actualCellHeight) {\n return;\n }\n if (this._rowElements.length !== this._terminal.rows) {\n this._onResize(this._terminal.rows);\n }\n for (let i = 0; i < this._terminal.rows; i++) {\n this._refreshRowDimensions(this._rowElements[i]);\n }\n }\n\n private _refreshRowDimensions(element: HTMLElement): void {\n element.style.height = `${this._renderService.dimensions.actualCellHeight}px`;\n }\n\n private _announceCharacters(): void {\n if (this._charsToAnnounce.length === 0) {\n return;\n }\n this._liveRegion.textContent += this._charsToAnnounce;\n this._charsToAnnounce = '';\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ISelectionService } from 'browser/services/Services';\nimport { ICoreService } from 'common/services/Services';\n\n/**\n * Prepares text to be pasted into the terminal by normalizing the line endings\n * @param text The pasted text that needs processing before inserting into the terminal\n */\nexport function prepareTextForTerminal(text: string): string {\n return text.replace(/\\r?\\n/g, '\\r');\n}\n\n/**\n * Bracket text for paste, if necessary, as per https://cirw.in/blog/bracketed-paste\n * @param text The pasted text to bracket\n */\nexport function bracketTextForPaste(text: string, bracketedPasteMode: boolean): string {\n if (bracketedPasteMode) {\n return '\\x1b[200~' + text + '\\x1b[201~';\n }\n return text;\n}\n\n/**\n * Binds copy functionality to the given terminal.\n * @param ev The original copy event to be handled\n */\nexport function copyHandler(ev: ClipboardEvent, selectionService: ISelectionService): void {\n if (ev.clipboardData) {\n ev.clipboardData.setData('text/plain', selectionService.selectionText);\n }\n // Prevent or the original text will be copied.\n ev.preventDefault();\n}\n\n/**\n * Redirect the clipboard's data to the terminal's input handler.\n * @param ev The original paste event to be handled\n * @param term The terminal on which to apply the handled paste event\n */\nexport function handlePasteEvent(ev: ClipboardEvent, textarea: HTMLTextAreaElement, coreService: ICoreService): void {\n ev.stopPropagation();\n if (ev.clipboardData) {\n const text = ev.clipboardData.getData('text/plain');\n paste(text, textarea, coreService);\n }\n}\n\nexport function paste(text: string, textarea: HTMLTextAreaElement, coreService: ICoreService): void {\n text = prepareTextForTerminal(text);\n text = bracketTextForPaste(text, coreService.decPrivateModes.bracketedPasteMode);\n coreService.triggerDataEvent(text, true);\n textarea.value = '';\n}\n\n/**\n * Moves the textarea under the mouse cursor and focuses it.\n * @param ev The original right click event to be handled.\n * @param textarea The terminal's textarea.\n */\nexport function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextAreaElement, screenElement: HTMLElement): void {\n\n // Calculate textarea position relative to the screen element\n const pos = screenElement.getBoundingClientRect();\n const left = ev.clientX - pos.left - 10;\n const top = ev.clientY - pos.top - 10;\n\n // Bring textarea at the cursor position\n textarea.style.width = '20px';\n textarea.style.height = '20px';\n textarea.style.left = `${left}px`;\n textarea.style.top = `${top}px`;\n textarea.style.zIndex = '1000';\n\n textarea.focus();\n}\n\n/**\n * Bind to right-click event and allow right-click copy and paste.\n * @param ev The original right click event to be handled.\n * @param textarea The terminal's textarea.\n * @param selectionService The terminal's selection manager.\n * @param shouldSelectWord If true and there is no selection the current word will be selected\n */\nexport function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, screenElement: HTMLElement, selectionService: ISelectionService, shouldSelectWord: boolean): void {\n moveTextAreaUnderMouseCursor(ev, textarea, screenElement);\n\n if (shouldSelectWord) {\n selectionService.rightClickSelect(ev);\n }\n\n // Get textarea ready to copy from the context menu\n textarea.value = selectionService.selectionText;\n textarea.select();\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColorContrastCache } from 'browser/Types';\nimport { IColor } from 'common/Types';\n\nexport class ColorContrastCache implements IColorContrastCache {\n private _color: { [bg: number]: { [fg: number]: IColor | null | undefined } | undefined } = {};\n private _rgba: { [bg: number]: { [fg: number]: string | null | undefined } | undefined } = {};\n\n public clear(): void {\n this._color = {};\n this._rgba = {};\n }\n\n public setCss(bg: number, fg: number, value: string | null): void {\n if (!this._rgba[bg]) {\n this._rgba[bg] = {};\n }\n this._rgba[bg]![fg] = value;\n }\n\n public getCss(bg: number, fg: number): string | null | undefined {\n return this._rgba[bg] ? this._rgba[bg]![fg] : undefined;\n }\n\n public setColor(bg: number, fg: number, value: IColor | null): void {\n if (!this._color[bg]) {\n this._color[bg] = {};\n }\n this._color[bg]![fg] = value;\n }\n\n public getColor(bg: number, fg: number): IColor | null | undefined {\n return this._color[bg] ? this._color[bg]![fg] : undefined;\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColorManager, IColorSet, IColorContrastCache } from 'browser/Types';\nimport { ITheme } from 'common/services/Services';\nimport { channels, color, css } from 'common/Color';\nimport { ColorContrastCache } from 'browser/ColorContrastCache';\nimport { ColorIndex, IColor } from 'common/Types';\n\n\ninterface IRestoreColorSet {\n foreground: IColor;\n background: IColor;\n cursor: IColor;\n ansi: IColor[];\n}\n\n\nconst DEFAULT_FOREGROUND = css.toColor('#ffffff');\nconst DEFAULT_BACKGROUND = css.toColor('#000000');\nconst DEFAULT_CURSOR = css.toColor('#ffffff');\nconst DEFAULT_CURSOR_ACCENT = css.toColor('#000000');\nconst DEFAULT_SELECTION = {\n css: 'rgba(255, 255, 255, 0.3)',\n rgba: 0xFFFFFF4D\n};\n\n// An IIFE to generate DEFAULT_ANSI_COLORS.\nexport const DEFAULT_ANSI_COLORS = Object.freeze((() => {\n const colors = [\n // dark:\n css.toColor('#2e3436'),\n css.toColor('#cc0000'),\n css.toColor('#4e9a06'),\n css.toColor('#c4a000'),\n css.toColor('#3465a4'),\n css.toColor('#75507b'),\n css.toColor('#06989a'),\n css.toColor('#d3d7cf'),\n // bright:\n css.toColor('#555753'),\n css.toColor('#ef2929'),\n css.toColor('#8ae234'),\n css.toColor('#fce94f'),\n css.toColor('#729fcf'),\n css.toColor('#ad7fa8'),\n css.toColor('#34e2e2'),\n css.toColor('#eeeeec')\n ];\n\n // Fill in the remaining 240 ANSI colors.\n // Generate colors (16-231)\n const v = [0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff];\n for (let i = 0; i < 216; i++) {\n const r = v[(i / 36) % 6 | 0];\n const g = v[(i / 6) % 6 | 0];\n const b = v[i % 6];\n colors.push({\n css: channels.toCss(r, g, b),\n rgba: channels.toRgba(r, g, b)\n });\n }\n\n // Generate greys (232-255)\n for (let i = 0; i < 24; i++) {\n const c = 8 + i * 10;\n colors.push({\n css: channels.toCss(c, c, c),\n rgba: channels.toRgba(c, c, c)\n });\n }\n\n return colors;\n})());\n\n/**\n * Manages the source of truth for a terminal's colors.\n */\nexport class ColorManager implements IColorManager {\n public colors: IColorSet;\n private _ctx: CanvasRenderingContext2D;\n private _litmusColor: CanvasGradient;\n private _contrastCache: IColorContrastCache;\n private _restoreColors!: IRestoreColorSet;\n\n constructor(document: Document, public allowTransparency: boolean) {\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n throw new Error('Could not get rendering context');\n }\n this._ctx = ctx;\n this._ctx.globalCompositeOperation = 'copy';\n this._litmusColor = this._ctx.createLinearGradient(0, 0, 1, 1);\n this._contrastCache = new ColorContrastCache();\n this.colors = {\n foreground: DEFAULT_FOREGROUND,\n background: DEFAULT_BACKGROUND,\n cursor: DEFAULT_CURSOR,\n cursorAccent: DEFAULT_CURSOR_ACCENT,\n selectionTransparent: DEFAULT_SELECTION,\n selectionOpaque: color.blend(DEFAULT_BACKGROUND, DEFAULT_SELECTION),\n selectionForeground: undefined,\n ansi: DEFAULT_ANSI_COLORS.slice(),\n contrastCache: this._contrastCache\n };\n this._updateRestoreColors();\n }\n\n public onOptionsChange(key: string): void {\n if (key === 'minimumContrastRatio') {\n this._contrastCache.clear();\n }\n }\n\n /**\n * Sets the terminal's theme.\n * @param theme The theme to use. If a partial theme is provided then default\n * colors will be used where colors are not defined.\n */\n public setTheme(theme: ITheme = {}): void {\n this.colors.foreground = this._parseColor(theme.foreground, DEFAULT_FOREGROUND);\n this.colors.background = this._parseColor(theme.background, DEFAULT_BACKGROUND);\n this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);\n this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT, true);\n this.colors.selectionTransparent = this._parseColor(theme.selection, DEFAULT_SELECTION, true);\n this.colors.selectionOpaque = color.blend(this.colors.background, this.colors.selectionTransparent);\n const nullColor: IColor = {\n css: '',\n rgba: 0\n };\n this.colors.selectionForeground = theme.selectionForeground ? this._parseColor(theme.selectionForeground, nullColor) : undefined;\n if (this.colors.selectionForeground === nullColor) {\n this.colors.selectionForeground = undefined;\n }\n\n /**\n * If selection color is opaque, blend it with background with 0.3 opacity\n * Issue #2737\n */\n if (color.isOpaque(this.colors.selectionTransparent)) {\n const opacity = 0.3;\n this.colors.selectionTransparent = color.opacity(this.colors.selectionTransparent, opacity);\n }\n this.colors.ansi[0] = this._parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);\n this.colors.ansi[1] = this._parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);\n this.colors.ansi[2] = this._parseColor(theme.green, DEFAULT_ANSI_COLORS[2]);\n this.colors.ansi[3] = this._parseColor(theme.yellow, DEFAULT_ANSI_COLORS[3]);\n this.colors.ansi[4] = this._parseColor(theme.blue, DEFAULT_ANSI_COLORS[4]);\n this.colors.ansi[5] = this._parseColor(theme.magenta, DEFAULT_ANSI_COLORS[5]);\n this.colors.ansi[6] = this._parseColor(theme.cyan, DEFAULT_ANSI_COLORS[6]);\n this.colors.ansi[7] = this._parseColor(theme.white, DEFAULT_ANSI_COLORS[7]);\n this.colors.ansi[8] = this._parseColor(theme.brightBlack, DEFAULT_ANSI_COLORS[8]);\n this.colors.ansi[9] = this._parseColor(theme.brightRed, DEFAULT_ANSI_COLORS[9]);\n this.colors.ansi[10] = this._parseColor(theme.brightGreen, DEFAULT_ANSI_COLORS[10]);\n this.colors.ansi[11] = this._parseColor(theme.brightYellow, DEFAULT_ANSI_COLORS[11]);\n this.colors.ansi[12] = this._parseColor(theme.brightBlue, DEFAULT_ANSI_COLORS[12]);\n this.colors.ansi[13] = this._parseColor(theme.brightMagenta, DEFAULT_ANSI_COLORS[13]);\n this.colors.ansi[14] = this._parseColor(theme.brightCyan, DEFAULT_ANSI_COLORS[14]);\n this.colors.ansi[15] = this._parseColor(theme.brightWhite, DEFAULT_ANSI_COLORS[15]);\n // Clear our the cache\n this._contrastCache.clear();\n this._updateRestoreColors();\n }\n\n public restoreColor(slot?: ColorIndex): void {\n // unset slot restores all ansi colors\n if (slot === undefined) {\n for (let i = 0; i < this._restoreColors.ansi.length; ++i) {\n this.colors.ansi[i] = this._restoreColors.ansi[i];\n }\n return;\n }\n switch (slot) {\n case ColorIndex.FOREGROUND:\n this.colors.foreground = this._restoreColors.foreground;\n break;\n case ColorIndex.BACKGROUND:\n this.colors.background = this._restoreColors.background;\n break;\n case ColorIndex.CURSOR:\n this.colors.cursor = this._restoreColors.cursor;\n break;\n default:\n this.colors.ansi[slot] = this._restoreColors.ansi[slot];\n }\n }\n\n private _updateRestoreColors(): void {\n this._restoreColors = {\n foreground: this.colors.foreground,\n background: this.colors.background,\n cursor: this.colors.cursor,\n ansi: this.colors.ansi.slice()\n };\n }\n\n private _parseColor(\n css: string | undefined,\n fallback: IColor,\n allowTransparency: boolean = this.allowTransparency\n ): IColor {\n if (css === undefined) {\n return fallback;\n }\n\n // If parsing the value results in failure, then it must be ignored, and the attribute must\n // retain its previous value.\n // -- https://html.spec.whatwg.org/multipage/canvas.html#fill-and-stroke-styles\n this._ctx.fillStyle = this._litmusColor;\n this._ctx.fillStyle = css;\n if (typeof this._ctx.fillStyle !== 'string') {\n console.warn(`Color: ${css} is invalid using fallback ${fallback.css}`);\n return fallback;\n }\n\n this._ctx.fillRect(0, 0, 1, 1);\n const data = this._ctx.getImageData(0, 0, 1, 1).data;\n\n // Check if the printed color was transparent\n if (data[3] !== 0xFF) {\n if (!allowTransparency) {\n // Ideally we'd just ignore the alpha channel, but...\n //\n // Browsers may not give back exactly the same RGB values we put in, because most/all\n // convert the color to a pre-multiplied representation. getImageData converts that back to\n // a un-premultipled representation, but the precision loss may make the RGB channels unuable\n // on their own.\n //\n // E.g. In Chrome #12345610 turns into #10305010, and in the extreme case, 0xFFFFFF00 turns\n // into 0x00000000.\n //\n // \"Note: Due to the lossy nature of converting to and from premultiplied alpha color values,\n // pixels that have just been set using putImageData() might be returned to an equivalent\n // getImageData() as different values.\"\n // -- https://html.spec.whatwg.org/multipage/canvas.html#pixel-manipulation\n //\n // So let's just use the fallback color in this case instead.\n console.warn(\n `Color: ${css} is using transparency, but allowTransparency is false. ` +\n `Using fallback ${fallback.css}.`\n );\n return fallback;\n }\n\n // https://html.spec.whatwg.org/multipage/canvas.html#serialisation-of-a-color\n // the color value has alpha less than 1.0, and the string is the color value in the CSS rgba()\n const [r, g, b, a] = this._ctx.fillStyle.substring(5, this._ctx.fillStyle.length - 1).split(',').map(component => Number(component));\n const alpha = Math.round(a * 255);\n const rgba: number = channels.toRgba(r, g, b, alpha);\n return {\n rgba,\n css\n };\n }\n\n return {\n // https://html.spec.whatwg.org/multipage/canvas.html#serialisation-of-a-color\n // if it has alpha equal to 1.0, then the string is a lowercase six-digit hex value, prefixed with a \"#\" character\n css: this._ctx.fillStyle,\n rgba: channels.toRgba(data[0], data[1], data[2], data[3])\n };\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function removeElementFromParent(...elements: (HTMLElement | undefined)[]): void {\n for (const e of elements) {\n e?.parentElement?.removeChild(e);\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\n/**\n * Adds a disposable listener to a node in the DOM, returning the disposable.\n * @param type The event type.\n * @param handler The handler for the listener.\n */\nexport function addDisposableDomListener(\n node: Element | Window | Document,\n type: string,\n handler: (e: any) => void,\n options?: boolean | AddEventListenerOptions\n): IDisposable {\n node.addEventListener(type, handler, options);\n let disposed = false;\n return {\n dispose: () => {\n if (disposed) {\n return;\n }\n disposed = true;\n node.removeEventListener(type, handler, options);\n }\n };\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILinkifierEvent, ILinkMatcher, LinkMatcherHandler, ILinkMatcherOptions, ILinkifier, IMouseZoneManager, IMouseZone, IRegisteredLinkMatcher } from 'browser/Types';\nimport { IBufferStringIteratorResult } from 'common/buffer/Types';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { ILogService, IBufferService, IOptionsService, IUnicodeService } from 'common/services/Services';\n\n/**\n * Limit of the unwrapping line expansion (overscan) at the top and bottom\n * of the actual viewport in ASCII characters.\n * A limit of 2000 should match most sane urls.\n */\nconst OVERSCAN_CHAR_LIMIT = 2000;\n\n/**\n * The Linkifier applies links to rows shortly after they have been refreshed.\n */\nexport class Linkifier implements ILinkifier {\n /**\n * The time to wait after a row is changed before it is linkified. This prevents\n * the costly operation of searching every row multiple times, potentially a\n * huge amount of times.\n */\n protected static _timeBeforeLatency = 200;\n\n protected _linkMatchers: IRegisteredLinkMatcher[] = [];\n\n private _mouseZoneManager: IMouseZoneManager | undefined;\n private _element: HTMLElement | undefined;\n\n private _rowsTimeoutId: number | undefined;\n private _nextLinkMatcherId = 0;\n private _rowsToLinkify: { start: number | undefined, end: number | undefined };\n\n private _onShowLinkUnderline = new EventEmitter();\n public get onShowLinkUnderline(): IEvent { return this._onShowLinkUnderline.event; }\n private _onHideLinkUnderline = new EventEmitter();\n public get onHideLinkUnderline(): IEvent { return this._onHideLinkUnderline.event; }\n private _onLinkTooltip = new EventEmitter();\n public get onLinkTooltip(): IEvent { return this._onLinkTooltip.event; }\n\n constructor(\n @IBufferService protected readonly _bufferService: IBufferService,\n @ILogService private readonly _logService: ILogService,\n @IUnicodeService private readonly _unicodeService: IUnicodeService\n ) {\n this._rowsToLinkify = {\n start: undefined,\n end: undefined\n };\n }\n\n /**\n * Attaches the linkifier to the DOM, enabling linkification.\n * @param mouseZoneManager The mouse zone manager to register link zones with.\n */\n public attachToDom(element: HTMLElement, mouseZoneManager: IMouseZoneManager): void {\n this._element = element;\n this._mouseZoneManager = mouseZoneManager;\n }\n\n /**\n * Queue linkification on a set of rows.\n * @param start The row to linkify from (inclusive).\n * @param end The row to linkify to (inclusive).\n */\n public linkifyRows(start: number, end: number): void {\n // Don't attempt linkify if not yet attached to DOM\n if (!this._mouseZoneManager) {\n return;\n }\n\n // Increase range to linkify\n if (this._rowsToLinkify.start === undefined || this._rowsToLinkify.end === undefined) {\n this._rowsToLinkify.start = start;\n this._rowsToLinkify.end = end;\n } else {\n this._rowsToLinkify.start = Math.min(this._rowsToLinkify.start, start);\n this._rowsToLinkify.end = Math.max(this._rowsToLinkify.end, end);\n }\n\n // Clear out any existing links on this row range\n this._mouseZoneManager.clearAll(start, end);\n\n // Restart timer\n if (this._rowsTimeoutId) {\n clearTimeout(this._rowsTimeoutId);\n }\n\n // Cannot use window.setTimeout since tests need to run in node\n this._rowsTimeoutId = setTimeout(() => this._linkifyRows(), Linkifier._timeBeforeLatency) as any as number;\n }\n\n /**\n * Linkifies the rows requested.\n */\n private _linkifyRows(): void {\n this._rowsTimeoutId = undefined;\n const buffer = this._bufferService.buffer;\n\n if (this._rowsToLinkify.start === undefined || this._rowsToLinkify.end === undefined) {\n this._logService.debug('_rowToLinkify was unset before _linkifyRows was called');\n return;\n }\n\n // Ensure the start row exists\n const absoluteRowIndexStart = buffer.ydisp + this._rowsToLinkify.start;\n if (absoluteRowIndexStart >= buffer.lines.length) {\n return;\n }\n\n // Invalidate bad end row values (if a resize happened)\n const absoluteRowIndexEnd = buffer.ydisp + Math.min(this._rowsToLinkify.end, this._bufferService.rows) + 1;\n\n // Iterate over the range of unwrapped content strings within start..end\n // (excluding).\n // _doLinkifyRow gets full unwrapped lines with the start row as buffer offset\n // for every matcher.\n // The unwrapping is needed to also match content that got wrapped across\n // several buffer lines. To avoid a worst case scenario where the whole buffer\n // contains just a single unwrapped string we limit this line expansion beyond\n // the viewport to +OVERSCAN_CHAR_LIMIT chars (overscan) at top and bottom.\n // This comes with the tradeoff that matches longer than OVERSCAN_CHAR_LIMIT\n // chars will not match anymore at the viewport borders.\n const overscanLineLimit = Math.ceil(OVERSCAN_CHAR_LIMIT / this._bufferService.cols);\n const iterator = this._bufferService.buffer.iterator(\n false, absoluteRowIndexStart, absoluteRowIndexEnd, overscanLineLimit, overscanLineLimit);\n while (iterator.hasNext()) {\n const lineData: IBufferStringIteratorResult = iterator.next();\n for (let i = 0; i < this._linkMatchers.length; i++) {\n this._doLinkifyRow(lineData.range.first, lineData.content, this._linkMatchers[i]);\n }\n }\n\n this._rowsToLinkify.start = undefined;\n this._rowsToLinkify.end = undefined;\n }\n\n /**\n * Registers a link matcher, allowing custom link patterns to be matched and\n * handled.\n * @param regex The regular expression to search for. Specifically, this\n * searches the textContent of the rows. You will want to use \\s to match a\n * space ' ' character for example.\n * @param handler The callback when the link is called.\n * @param options Options for the link matcher.\n * @return The ID of the new matcher, this can be used to deregister.\n */\n public registerLinkMatcher(regex: RegExp, handler: LinkMatcherHandler, options: ILinkMatcherOptions = {}): number {\n if (!handler) {\n throw new Error('handler must be defined');\n }\n const matcher: IRegisteredLinkMatcher = {\n id: this._nextLinkMatcherId++,\n regex,\n handler,\n matchIndex: options.matchIndex,\n validationCallback: options.validationCallback,\n hoverTooltipCallback: options.tooltipCallback,\n hoverLeaveCallback: options.leaveCallback,\n willLinkActivate: options.willLinkActivate,\n priority: options.priority || 0\n };\n this._addLinkMatcherToList(matcher);\n return matcher.id;\n }\n\n /**\n * Inserts a link matcher to the list in the correct position based on the\n * priority of each link matcher. New link matchers of equal priority are\n * considered after older link matchers.\n * @param matcher The link matcher to be added.\n */\n private _addLinkMatcherToList(matcher: IRegisteredLinkMatcher): void {\n if (this._linkMatchers.length === 0) {\n this._linkMatchers.push(matcher);\n return;\n }\n\n for (let i = this._linkMatchers.length - 1; i >= 0; i--) {\n if (matcher.priority <= this._linkMatchers[i].priority) {\n this._linkMatchers.splice(i + 1, 0, matcher);\n return;\n }\n }\n\n this._linkMatchers.splice(0, 0, matcher);\n }\n\n /**\n * Deregisters a link matcher if it has been registered.\n * @param matcherId The link matcher's ID (returned after register)\n * @return Whether a link matcher was found and deregistered.\n */\n public deregisterLinkMatcher(matcherId: number): boolean {\n for (let i = 0; i < this._linkMatchers.length; i++) {\n if (this._linkMatchers[i].id === matcherId) {\n this._linkMatchers.splice(i, 1);\n return true;\n }\n }\n return false;\n }\n\n /**\n * Linkifies a row given a specific handler.\n * @param rowIndex The row index to linkify (absolute index).\n * @param text string content of the unwrapped row.\n * @param matcher The link matcher for this line.\n */\n private _doLinkifyRow(rowIndex: number, text: string, matcher: ILinkMatcher): void {\n // clone regex to do a global search on text\n const rex = new RegExp(matcher.regex.source, (matcher.regex.flags || '') + 'g');\n let match;\n let stringIndex = -1;\n while ((match = rex.exec(text)) !== null) {\n const uri = match[typeof matcher.matchIndex !== 'number' ? 0 : matcher.matchIndex];\n if (!uri) {\n // something matched but does not comply with the given matchIndex\n // since this is most likely a bug the regex itself we simply do nothing here\n this._logService.debug('match found without corresponding matchIndex', match, matcher);\n break;\n }\n\n // Get index, match.index is for the outer match which includes negated chars\n // therefore we cannot use match.index directly, instead we search the position\n // of the match group in text again\n // also correct regex and string search offsets for the next loop run\n stringIndex = text.indexOf(uri, stringIndex + 1);\n rex.lastIndex = stringIndex + uri.length;\n if (stringIndex < 0) {\n // invalid stringIndex (should not have happened)\n break;\n }\n\n // get the buffer index as [absolute row, col] for the match\n const bufferIndex = this._bufferService.buffer.stringIndexToBufferIndex(rowIndex, stringIndex);\n if (bufferIndex[0] < 0) {\n // invalid bufferIndex (should not have happened)\n break;\n }\n\n const line = this._bufferService.buffer.lines.get(bufferIndex[0]);\n if (!line) {\n break;\n }\n\n const attr = line.getFg(bufferIndex[1]);\n const fg = attr ? (attr >> 9) & 0x1ff : undefined;\n\n if (matcher.validationCallback) {\n matcher.validationCallback(uri, isValid => {\n // Discard link if the line has already changed\n if (this._rowsTimeoutId) {\n return;\n }\n if (isValid) {\n this._addLink(bufferIndex[1], bufferIndex[0] - this._bufferService.buffer.ydisp, uri, matcher, fg);\n }\n });\n } else {\n this._addLink(bufferIndex[1], bufferIndex[0] - this._bufferService.buffer.ydisp, uri, matcher, fg);\n }\n }\n }\n\n /**\n * Registers a link to the mouse zone manager.\n * @param x The column the link starts.\n * @param y The row the link is on.\n * @param uri The URI of the link.\n * @param matcher The link matcher for the link.\n * @param fg The link color for hover event.\n */\n private _addLink(x: number, y: number, uri: string, matcher: ILinkMatcher, fg: number | undefined): void {\n if (!this._mouseZoneManager || !this._element) {\n return;\n }\n // FIXME: get cell length from buffer to avoid mismatch after Unicode version change\n const width = this._unicodeService.getStringCellWidth(uri);\n const x1 = x % this._bufferService.cols;\n const y1 = y + Math.floor(x / this._bufferService.cols);\n let x2 = (x1 + width) % this._bufferService.cols;\n let y2 = y1 + Math.floor((x1 + width) / this._bufferService.cols);\n if (x2 === 0) {\n x2 = this._bufferService.cols;\n y2--;\n }\n\n this._mouseZoneManager.add(new MouseZone(\n x1 + 1,\n y1 + 1,\n x2 + 1,\n y2 + 1,\n e => {\n if (matcher.handler) {\n return matcher.handler(e, uri);\n }\n const newWindow = window.open();\n if (newWindow) {\n newWindow.opener = null;\n newWindow.location.href = uri;\n } else {\n console.warn('Opening link blocked as opener could not be cleared');\n }\n },\n () => {\n this._onShowLinkUnderline.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));\n this._element!.classList.add('xterm-cursor-pointer');\n },\n e => {\n this._onLinkTooltip.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));\n if (matcher.hoverTooltipCallback) {\n // Note that IViewportRange use 1-based coordinates to align with escape sequences such\n // as CUP which use 1,1 as the default for row/col\n matcher.hoverTooltipCallback(e, uri, { start: { x: x1, y: y1 }, end: { x: x2, y: y2 } });\n }\n },\n () => {\n this._onHideLinkUnderline.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));\n this._element!.classList.remove('xterm-cursor-pointer');\n if (matcher.hoverLeaveCallback) {\n matcher.hoverLeaveCallback();\n }\n },\n e => {\n if (matcher.willLinkActivate) {\n return matcher.willLinkActivate(e, uri);\n }\n return true;\n }\n ));\n }\n\n private _createLinkHoverEvent(x1: number, y1: number, x2: number, y2: number, fg: number | undefined): ILinkifierEvent {\n return { x1, y1, x2, y2, cols: this._bufferService.cols, fg };\n }\n}\n\nexport class MouseZone implements IMouseZone {\n constructor(\n public x1: number,\n public y1: number,\n public x2: number,\n public y2: number,\n public clickCallback: (e: MouseEvent) => any,\n public hoverCallback: (e: MouseEvent) => any,\n public tooltipCallback: (e: MouseEvent) => any,\n public leaveCallback: () => void,\n public willLinkActivate: (e: MouseEvent) => boolean\n ) {\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILinkifier2, ILinkProvider, IBufferCellPosition, ILink, ILinkifierEvent, ILinkDecorations, ILinkWithState } from 'browser/Types';\nimport { IDisposable } from 'common/Types';\nimport { IMouseService, IRenderService } from './services/Services';\nimport { IBufferService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable, getDisposeArrayDisposable, disposeArray } from 'common/Lifecycle';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\n\nexport class Linkifier2 extends Disposable implements ILinkifier2 {\n private _element: HTMLElement | undefined;\n private _mouseService: IMouseService | undefined;\n private _renderService: IRenderService | undefined;\n private _linkProviders: ILinkProvider[] = [];\n public get currentLink(): ILinkWithState | undefined { return this._currentLink; }\n protected _currentLink: ILinkWithState | undefined;\n private _mouseDownLink: ILinkWithState | undefined;\n private _lastMouseEvent: MouseEvent | undefined;\n private _linkCacheDisposables: IDisposable[] = [];\n private _lastBufferCell: IBufferCellPosition | undefined;\n private _isMouseOut: boolean = true;\n private _activeProviderReplies: Map | undefined;\n private _activeLine: number = -1;\n\n private _onShowLinkUnderline = this.register(new EventEmitter());\n public get onShowLinkUnderline(): IEvent { return this._onShowLinkUnderline.event; }\n private _onHideLinkUnderline = this.register(new EventEmitter());\n public get onHideLinkUnderline(): IEvent { return this._onHideLinkUnderline.event; }\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n super();\n this.register(getDisposeArrayDisposable(this._linkCacheDisposables));\n }\n\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n this._linkProviders.push(linkProvider);\n return {\n dispose: () => {\n // Remove the link provider from the list\n const providerIndex = this._linkProviders.indexOf(linkProvider);\n\n if (providerIndex !== -1) {\n this._linkProviders.splice(providerIndex, 1);\n }\n }\n };\n }\n\n public attachToDom(element: HTMLElement, mouseService: IMouseService, renderService: IRenderService): void {\n this._element = element;\n this._mouseService = mouseService;\n this._renderService = renderService;\n\n this.register(addDisposableDomListener(this._element, 'mouseleave', () => {\n this._isMouseOut = true;\n this._clearCurrentLink();\n }));\n this.register(addDisposableDomListener(this._element, 'mousemove', this._onMouseMove.bind(this)));\n this.register(addDisposableDomListener(this._element, 'mousedown', this._handleMouseDown.bind(this)));\n this.register(addDisposableDomListener(this._element, 'mouseup', this._handleMouseUp.bind(this)));\n }\n\n private _onMouseMove(event: MouseEvent): void {\n this._lastMouseEvent = event;\n\n if (!this._element || !this._mouseService) {\n return;\n }\n\n const position = this._positionFromMouseEvent(event, this._element, this._mouseService);\n if (!position) {\n return;\n }\n this._isMouseOut = false;\n\n // Ignore the event if it's an embedder created hover widget\n const composedPath = event.composedPath() as HTMLElement[];\n for (let i = 0; i < composedPath.length; i++) {\n const target = composedPath[i];\n // Hit Terminal.element, break and continue\n if (target.classList.contains('xterm')) {\n break;\n }\n // It's a hover, don't respect hover event\n if (target.classList.contains('xterm-hover')) {\n return;\n }\n }\n\n if (!this._lastBufferCell || (position.x !== this._lastBufferCell.x || position.y !== this._lastBufferCell.y)) {\n this._onHover(position);\n this._lastBufferCell = position;\n }\n }\n\n private _onHover(position: IBufferCellPosition): void {\n // TODO: This currently does not cache link provider results across wrapped lines, activeLine should be something like `activeRange: {startY, endY}`\n // Check if we need to clear the link\n if (this._activeLine !== position.y) {\n this._clearCurrentLink();\n this._askForLink(position, false);\n return;\n }\n\n // Check the if the link is in the mouse position\n const isCurrentLinkInPosition = this._currentLink && this._linkAtPosition(this._currentLink.link, position);\n if (!isCurrentLinkInPosition) {\n this._clearCurrentLink();\n this._askForLink(position, true);\n }\n }\n\n private _askForLink(position: IBufferCellPosition, useLineCache: boolean): void {\n if (!this._activeProviderReplies || !useLineCache) {\n this._activeProviderReplies?.forEach(reply => {\n reply?.forEach(linkWithState => {\n if (linkWithState.link.dispose) {\n linkWithState.link.dispose();\n }\n });\n });\n this._activeProviderReplies = new Map();\n this._activeLine = position.y;\n }\n let linkProvided = false;\n\n // There is no link cached, so ask for one\n for (const [i, linkProvider] of this._linkProviders.entries()) {\n if (useLineCache) {\n const existingReply = this._activeProviderReplies?.get(i);\n // If there isn't a reply, the provider hasn't responded yet.\n\n // TODO: If there isn't a reply yet it means that the provider is still resolving. Ensuring\n // provideLinks isn't triggered again saves ILink.hover firing twice though. This probably\n // needs promises to get fixed\n if (existingReply) {\n linkProvided = this._checkLinkProviderResult(i, position, linkProvided);\n }\n } else {\n linkProvider.provideLinks(position.y, (links: ILink[] | undefined) => {\n if (this._isMouseOut) {\n return;\n }\n const linksWithState: ILinkWithState[] | undefined = links?.map(link => ({ link }));\n this._activeProviderReplies?.set(i, linksWithState);\n linkProvided = this._checkLinkProviderResult(i, position, linkProvided);\n\n // If all providers have responded, remove lower priority links that intersect ranges of\n // higher priority links\n if (this._activeProviderReplies?.size === this._linkProviders.length) {\n this._removeIntersectingLinks(position.y, this._activeProviderReplies);\n }\n });\n }\n }\n }\n\n private _removeIntersectingLinks(y: number, replies: Map): void {\n const occupiedCells = new Set();\n for (let i = 0; i < replies.size; i++) {\n const providerReply = replies.get(i);\n if (!providerReply) {\n continue;\n }\n for (let i = 0; i < providerReply.length; i++) {\n const linkWithState = providerReply[i];\n const startX = linkWithState.link.range.start.y < y ? 0 : linkWithState.link.range.start.x;\n const endX = linkWithState.link.range.end.y > y ? this._bufferService.cols : linkWithState.link.range.end.x;\n for (let x = startX; x <= endX; x++) {\n if (occupiedCells.has(x)) {\n providerReply.splice(i--, 1);\n break;\n }\n occupiedCells.add(x);\n }\n }\n }\n }\n\n private _checkLinkProviderResult(index: number, position: IBufferCellPosition, linkProvided: boolean): boolean {\n if (!this._activeProviderReplies) {\n return linkProvided;\n }\n\n const links = this._activeProviderReplies.get(index);\n\n // Check if every provider before this one has come back undefined\n let hasLinkBefore = false;\n for (let j = 0; j < index; j++) {\n if (!this._activeProviderReplies.has(j) || this._activeProviderReplies.get(j)) {\n hasLinkBefore = true;\n }\n }\n\n // If all providers with higher priority came back undefined, then this provider's link for\n // the position should be used\n if (!hasLinkBefore && links) {\n const linkAtPosition = links.find(link => this._linkAtPosition(link.link, position));\n if (linkAtPosition) {\n linkProvided = true;\n this._handleNewLink(linkAtPosition);\n }\n }\n\n // Check if all the providers have responded\n if (this._activeProviderReplies.size === this._linkProviders.length && !linkProvided) {\n // Respect the order of the link providers\n for (let j = 0; j < this._activeProviderReplies.size; j++) {\n const currentLink = this._activeProviderReplies.get(j)?.find(link => this._linkAtPosition(link.link, position));\n if (currentLink) {\n linkProvided = true;\n this._handleNewLink(currentLink);\n break;\n }\n }\n }\n\n return linkProvided;\n }\n\n private _handleMouseDown(): void {\n this._mouseDownLink = this._currentLink;\n }\n\n private _handleMouseUp(event: MouseEvent): void {\n if (!this._element || !this._mouseService || !this._currentLink) {\n return;\n }\n\n const position = this._positionFromMouseEvent(event, this._element, this._mouseService);\n if (!position) {\n return;\n }\n\n if (this._mouseDownLink === this._currentLink && this._linkAtPosition(this._currentLink.link, position)) {\n this._currentLink.link.activate(event, this._currentLink.link.text);\n }\n }\n\n private _clearCurrentLink(startRow?: number, endRow?: number): void {\n if (!this._element || !this._currentLink || !this._lastMouseEvent) {\n return;\n }\n\n // If we have a start and end row, check that the link is within it\n if (!startRow || !endRow || (this._currentLink.link.range.start.y >= startRow && this._currentLink.link.range.end.y <= endRow)) {\n this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent);\n this._currentLink = undefined;\n disposeArray(this._linkCacheDisposables);\n }\n }\n\n private _handleNewLink(linkWithState: ILinkWithState): void {\n if (!this._element || !this._lastMouseEvent || !this._mouseService) {\n return;\n }\n\n const position = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);\n\n if (!position) {\n return;\n }\n\n // Trigger hover if the we have a link at the position\n if (this._linkAtPosition(linkWithState.link, position)) {\n this._currentLink = linkWithState;\n this._currentLink.state = {\n decorations: {\n underline: linkWithState.link.decorations === undefined ? true : linkWithState.link.decorations.underline,\n pointerCursor: linkWithState.link.decorations === undefined ? true : linkWithState.link.decorations.pointerCursor\n },\n isHovered: true\n };\n this._linkHover(this._element, linkWithState.link, this._lastMouseEvent);\n\n // Add listener for tracking decorations changes\n linkWithState.link.decorations = {} as ILinkDecorations;\n Object.defineProperties(linkWithState.link.decorations, {\n pointerCursor: {\n get: () => this._currentLink?.state?.decorations.pointerCursor,\n set: v => {\n if (this._currentLink?.state && this._currentLink.state.decorations.pointerCursor !== v) {\n this._currentLink.state.decorations.pointerCursor = v;\n if (this._currentLink.state.isHovered) {\n this._element?.classList.toggle('xterm-cursor-pointer', v);\n }\n }\n }\n },\n underline: {\n get: () => this._currentLink?.state?.decorations.underline,\n set: v => {\n if (this._currentLink?.state && this._currentLink?.state?.decorations.underline !== v) {\n this._currentLink.state.decorations.underline = v;\n if (this._currentLink.state.isHovered) {\n this._fireUnderlineEvent(linkWithState.link, v);\n }\n }\n }\n }\n });\n\n // Add listener for rerendering\n if (this._renderService) {\n this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e => {\n // When start is 0 a scroll most likely occurred, make sure links above the fold also get\n // cleared.\n const start = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp;\n this._clearCurrentLink(start, e.end + 1 + this._bufferService.buffer.ydisp);\n }));\n }\n }\n }\n\n protected _linkHover(element: HTMLElement, link: ILink, event: MouseEvent): void {\n if (this._currentLink?.state) {\n this._currentLink.state.isHovered = true;\n if (this._currentLink.state.decorations.underline) {\n this._fireUnderlineEvent(link, true);\n }\n if (this._currentLink.state.decorations.pointerCursor) {\n element.classList.add('xterm-cursor-pointer');\n }\n }\n\n if (link.hover) {\n link.hover(event, link.text);\n }\n }\n\n private _fireUnderlineEvent(link: ILink, showEvent: boolean): void {\n const range = link.range;\n const scrollOffset = this._bufferService.buffer.ydisp;\n const event = this._createLinkUnderlineEvent(range.start.x - 1, range.start.y - scrollOffset - 1, range.end.x, range.end.y - scrollOffset - 1, undefined);\n const emitter = showEvent ? this._onShowLinkUnderline : this._onHideLinkUnderline;\n emitter.fire(event);\n }\n\n protected _linkLeave(element: HTMLElement, link: ILink, event: MouseEvent): void {\n if (this._currentLink?.state) {\n this._currentLink.state.isHovered = false;\n if (this._currentLink.state.decorations.underline) {\n this._fireUnderlineEvent(link, false);\n }\n if (this._currentLink.state.decorations.pointerCursor) {\n element.classList.remove('xterm-cursor-pointer');\n }\n }\n\n if (link.leave) {\n link.leave(event, link.text);\n }\n }\n\n /**\n * Check if the buffer position is within the link\n * @param link\n * @param position\n */\n private _linkAtPosition(link: ILink, position: IBufferCellPosition): boolean {\n const sameLine = link.range.start.y === link.range.end.y;\n const wrappedFromLeft = link.range.start.y < position.y;\n const wrappedToRight = link.range.end.y > position.y;\n\n // If the start and end have the same y, then the position must be between start and end x\n // If not, then handle each case seperately, depending on which way it wraps\n return ((sameLine && link.range.start.x <= position.x && link.range.end.x >= position.x) ||\n (wrappedFromLeft && link.range.end.x >= position.x) ||\n (wrappedToRight && link.range.start.x <= position.x) ||\n (wrappedFromLeft && wrappedToRight)) &&\n link.range.start.y <= position.y &&\n link.range.end.y >= position.y;\n }\n\n /**\n * Get the buffer position from a mouse event\n * @param event\n */\n private _positionFromMouseEvent(event: MouseEvent, element: HTMLElement, mouseService: IMouseService): IBufferCellPosition | undefined {\n const coords = mouseService.getCoords(event, element, this._bufferService.cols, this._bufferService.rows);\n if (!coords) {\n return;\n }\n\n return { x: coords[0], y: coords[1] + this._bufferService.buffer.ydisp };\n }\n\n private _createLinkUnderlineEvent(x1: number, y1: number, x2: number, y2: number, fg: number | undefined): ILinkifierEvent {\n return { x1, y1, x2, y2, cols: this._bufferService.cols, fg };\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// eslint-disable-next-line prefer-const\nexport let promptLabel = 'Terminal input';\n\n// eslint-disable-next-line prefer-const\nexport let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read';\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable } from 'common/Lifecycle';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IMouseService, ISelectionService } from 'browser/services/Services';\nimport { IMouseZoneManager, IMouseZone } from 'browser/Types';\nimport { IBufferService, IOptionsService } from 'common/services/Services';\n\n/**\n * The MouseZoneManager allows components to register zones within the terminal\n * that trigger hover and click callbacks.\n *\n * This class was intentionally made not so robust initially as the only case it\n * needed to support was single-line links which never overlap. Improvements can\n * be made in the future.\n */\nexport class MouseZoneManager extends Disposable implements IMouseZoneManager {\n private _zones: IMouseZone[] = [];\n\n private _areZonesActive: boolean = false;\n private _mouseMoveListener: (e: MouseEvent) => any;\n private _mouseLeaveListener: (e: MouseEvent) => any;\n private _clickListener: (e: MouseEvent) => any;\n\n private _tooltipTimeout: number | undefined;\n private _currentZone: IMouseZone | undefined;\n private _lastHoverCoords: [number | undefined, number | undefined] = [undefined, undefined];\n private _initialSelectionLength: number = 0;\n\n constructor(\n private readonly _element: HTMLElement,\n private readonly _screenElement: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IMouseService private readonly _mouseService: IMouseService,\n @ISelectionService private readonly _selectionService: ISelectionService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n\n this.register(addDisposableDomListener(this._element, 'mousedown', e => this._onMouseDown(e)));\n\n // These events are expensive, only listen to it when mouse zones are active\n this._mouseMoveListener = e => this._onMouseMove(e);\n this._mouseLeaveListener = e => this._onMouseLeave(e);\n this._clickListener = e => this._onClick(e);\n }\n\n public dispose(): void {\n super.dispose();\n this._deactivate();\n }\n\n public add(zone: IMouseZone): void {\n this._zones.push(zone);\n if (this._zones.length === 1) {\n this._activate();\n }\n }\n\n public clearAll(start?: number, end?: number): void {\n // Exit if there's nothing to clear\n if (this._zones.length === 0) {\n return;\n }\n\n // Clear all if start/end weren't set\n if (!start || !end) {\n start = 0;\n end = this._bufferService.rows - 1;\n }\n\n // Iterate through zones and clear them out if they're within the range\n for (let i = 0; i < this._zones.length; i++) {\n const zone = this._zones[i];\n if ((zone.y1 > start && zone.y1 <= end + 1) ||\n (zone.y2 > start && zone.y2 <= end + 1) ||\n (zone.y1 < start && zone.y2 > end + 1)) {\n if (this._currentZone && this._currentZone === zone) {\n this._currentZone.leaveCallback();\n this._currentZone = undefined;\n }\n this._zones.splice(i--, 1);\n }\n }\n\n // Deactivate the mouse zone manager if all the zones have been removed\n if (this._zones.length === 0) {\n this._deactivate();\n }\n }\n\n private _activate(): void {\n if (!this._areZonesActive) {\n this._areZonesActive = true;\n this._element.addEventListener('mousemove', this._mouseMoveListener);\n this._element.addEventListener('mouseleave', this._mouseLeaveListener);\n this._element.addEventListener('click', this._clickListener);\n }\n }\n\n private _deactivate(): void {\n if (this._areZonesActive) {\n this._areZonesActive = false;\n this._element.removeEventListener('mousemove', this._mouseMoveListener);\n this._element.removeEventListener('mouseleave', this._mouseLeaveListener);\n this._element.removeEventListener('click', this._clickListener);\n }\n }\n\n private _onMouseMove(e: MouseEvent): void {\n // TODO: Ideally this would only clear the hover state when the mouse moves\n // outside of the mouse zone\n if (this._lastHoverCoords[0] !== e.pageX || this._lastHoverCoords[1] !== e.pageY) {\n this._onHover(e);\n // Record the current coordinates\n this._lastHoverCoords = [e.pageX, e.pageY];\n }\n }\n\n private _onHover(e: MouseEvent): void {\n const zone = this._findZoneEventAt(e);\n\n // Do nothing if the zone is the same\n if (zone === this._currentZone) {\n return;\n }\n\n // Fire the hover end callback and cancel any existing timer if a new zone\n // is being hovered\n if (this._currentZone) {\n this._currentZone.leaveCallback();\n this._currentZone = undefined;\n if (this._tooltipTimeout) {\n clearTimeout(this._tooltipTimeout);\n }\n }\n\n // Exit if there is not zone\n if (!zone) {\n return;\n }\n this._currentZone = zone;\n\n // Trigger the hover callback\n if (zone.hoverCallback) {\n zone.hoverCallback(e);\n }\n\n // Restart the tooltip timeout\n this._tooltipTimeout = window.setTimeout(() => this._onTooltip(e), this._optionsService.rawOptions.linkTooltipHoverDuration);\n }\n\n private _onTooltip(e: MouseEvent): void {\n this._tooltipTimeout = undefined;\n const zone = this._findZoneEventAt(e);\n zone?.tooltipCallback(e);\n }\n\n private _onMouseDown(e: MouseEvent): void {\n // Store current terminal selection length, to check if we're performing\n // a selection operation\n this._initialSelectionLength = this._getSelectionLength();\n\n // Ignore the event if there are no zones active\n if (!this._areZonesActive) {\n return;\n }\n\n // Find the active zone, prevent event propagation if found to prevent other\n // components from handling the mouse event.\n const zone = this._findZoneEventAt(e);\n if (zone?.willLinkActivate(e)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n private _onMouseLeave(e: MouseEvent): void {\n // Fire the hover end callback and cancel any existing timer if the mouse\n // leaves the terminal element\n if (this._currentZone) {\n this._currentZone.leaveCallback();\n this._currentZone = undefined;\n if (this._tooltipTimeout) {\n clearTimeout(this._tooltipTimeout);\n }\n }\n }\n\n private _onClick(e: MouseEvent): void {\n // Find the active zone and click it if found and no selection was\n // being performed\n const zone = this._findZoneEventAt(e);\n const currentSelectionLength = this._getSelectionLength();\n\n if (zone && currentSelectionLength === this._initialSelectionLength) {\n zone.clickCallback(e);\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n private _getSelectionLength(): number {\n const selectionText = this._selectionService.selectionText;\n return selectionText ? selectionText.length : 0;\n }\n\n private _findZoneEventAt(e: MouseEvent): IMouseZone | undefined {\n const coords = this._mouseService.getCoords(e, this._screenElement, this._bufferService.cols, this._bufferService.rows);\n if (!coords) {\n return undefined;\n }\n const x = coords[0];\n const y = coords[1];\n for (let i = 0; i < this._zones.length; i++) {\n const zone = this._zones[i];\n if (zone.y1 === zone.y2) {\n // Single line link\n if (y === zone.y1 && x >= zone.x1 && x < zone.x2) {\n return zone;\n }\n } else {\n // Multi-line link\n if ((y === zone.y1 && x >= zone.x1) ||\n (y === zone.y2 && x < zone.x2) ||\n (y > zone.y1 && y < zone.y2)) {\n return zone;\n }\n }\n }\n return undefined;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDebouncerWithCallback } from 'browser/Types';\n\n/**\n * Debounces calls to render terminal rows using animation frames.\n */\nexport class RenderDebouncer implements IRenderDebouncerWithCallback {\n private _rowStart: number | undefined;\n private _rowEnd: number | undefined;\n private _rowCount: number | undefined;\n private _animationFrame: number | undefined;\n private _refreshCallbacks: FrameRequestCallback[] = [];\n\n constructor(\n private _renderCallback: (start: number, end: number) => void\n ) {\n }\n\n public dispose(): void {\n if (this._animationFrame) {\n window.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public addRefreshCallback(callback: FrameRequestCallback): number {\n this._refreshCallbacks.push(callback);\n if (!this._animationFrame) {\n this._animationFrame = window.requestAnimationFrame(() => this._innerRefresh());\n }\n return this._animationFrame;\n }\n\n public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {\n this._rowCount = rowCount;\n // Get the min/max row start/end for the arg values\n rowStart = rowStart !== undefined ? rowStart : 0;\n rowEnd = rowEnd !== undefined ? rowEnd : this._rowCount - 1;\n // Set the properties to the updated values\n this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart;\n this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd;\n\n if (this._animationFrame) {\n return;\n }\n\n this._animationFrame = window.requestAnimationFrame(() => this._innerRefresh());\n }\n\n private _innerRefresh(): void {\n this._animationFrame = undefined;\n\n // Make sure values are set\n if (this._rowStart === undefined || this._rowEnd === undefined || this._rowCount === undefined) {\n this._runRefreshCallbacks();\n return;\n }\n\n // Clamp values\n const start = Math.max(this._rowStart, 0);\n const end = Math.min(this._rowEnd, this._rowCount - 1);\n\n // Reset debouncer (this happens before render callback as the render could trigger it again)\n this._rowStart = undefined;\n this._rowEnd = undefined;\n\n // Run render callback\n this._renderCallback(start, end);\n this._runRefreshCallbacks();\n }\n\n private _runRefreshCallbacks(): void {\n for (const callback of this._refreshCallbacks) {\n callback(0);\n }\n this._refreshCallbacks = [];\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable } from 'common/Lifecycle';\n\nexport type ScreenDprListener = (newDevicePixelRatio?: number, oldDevicePixelRatio?: number) => void;\n\n/**\n * The screen device pixel ratio monitor allows listening for when the\n * window.devicePixelRatio value changes. This is done not with polling but with\n * the use of window.matchMedia to watch media queries. When the event fires,\n * the listener will be reattached using a different media query to ensure that\n * any further changes will register.\n *\n * The listener should fire on both window zoom changes and switching to a\n * monitor with a different DPI.\n */\nexport class ScreenDprMonitor extends Disposable {\n private _currentDevicePixelRatio: number = window.devicePixelRatio;\n private _outerListener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | undefined;\n private _listener: ScreenDprListener | undefined;\n private _resolutionMediaMatchList: MediaQueryList | undefined;\n\n public setListener(listener: ScreenDprListener): void {\n if (this._listener) {\n this.clearListener();\n }\n this._listener = listener;\n this._outerListener = () => {\n if (!this._listener) {\n return;\n }\n this._listener(window.devicePixelRatio, this._currentDevicePixelRatio);\n this._updateDpr();\n };\n this._updateDpr();\n }\n\n public dispose(): void {\n super.dispose();\n this.clearListener();\n }\n\n private _updateDpr(): void {\n if (!this._outerListener) {\n return;\n }\n\n // Clear listeners for old DPR\n this._resolutionMediaMatchList?.removeListener(this._outerListener);\n\n // Add listeners for new DPR\n this._currentDevicePixelRatio = window.devicePixelRatio;\n this._resolutionMediaMatchList = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);\n this._resolutionMediaMatchList.addListener(this._outerListener);\n }\n\n public clearListener(): void {\n if (!this._resolutionMediaMatchList || !this._listener || !this._outerListener) {\n return;\n }\n this._resolutionMediaMatchList.removeListener(this._outerListener);\n this._resolutionMediaMatchList = undefined;\n this._listener = undefined;\n this._outerListener = undefined;\n }\n}\n", "/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n *\n * Originally forked from (with the author's permission):\n * Fabrice Bellard's javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n *\n * Terminal Emulation References:\n * http://vt100.net/\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html\n * http://invisible-island.net/vttest/\n * http://www.inwap.com/pdp10/ansicode.txt\n * http://linux.die.net/man/4/console_codes\n * http://linux.die.net/man/7/urxvt\n */\n\nimport { ICompositionHelper, ITerminal, IBrowser, CustomKeyEventHandler, ILinkifier, IMouseZoneManager, LinkMatcherHandler, ILinkMatcherOptions, IViewport, ILinkifier2, CharacterJoinerHandler } from 'browser/Types';\nimport { IRenderer } from 'browser/renderer/Types';\nimport { CompositionHelper } from 'browser/input/CompositionHelper';\nimport { Viewport } from 'browser/Viewport';\nimport { rightClickHandler, moveTextAreaUnderMouseCursor, handlePasteEvent, copyHandler, paste } from 'browser/Clipboard';\nimport { C0, C1_ESCAPED } from 'common/data/EscapeSequences';\nimport { WindowsOptionsReportType } from '../common/InputHandler';\nimport { Renderer } from 'browser/renderer/Renderer';\nimport { Linkifier } from 'browser/Linkifier';\nimport { SelectionService } from 'browser/services/SelectionService';\nimport * as Browser from 'common/Platform';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport * as Strings from 'browser/LocalizableStrings';\nimport { SoundService } from 'browser/services/SoundService';\nimport { MouseZoneManager } from 'browser/MouseZoneManager';\nimport { AccessibilityManager } from './AccessibilityManager';\nimport { ITheme, IMarker, IDisposable, ISelectionPosition, ILinkProvider, IDecorationOptions, IDecoration } from 'xterm';\nimport { DomRenderer } from 'browser/renderer/dom/DomRenderer';\nimport { KeyboardResultType, CoreMouseEventType, CoreMouseButton, CoreMouseAction, ITerminalOptions, ScrollSource, IColorEvent, ColorIndex, ColorRequestType } from 'common/Types';\nimport { evaluateKeyboardEvent } from 'common/input/Keyboard';\nimport { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';\nimport { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { ColorManager } from 'browser/ColorManager';\nimport { RenderService } from 'browser/services/RenderService';\nimport { ICharSizeService, IRenderService, IMouseService, ISelectionService, ISoundService, ICoreBrowserService, ICharacterJoinerService } from 'browser/services/Services';\nimport { CharSizeService } from 'browser/services/CharSizeService';\nimport { IBuffer } from 'common/buffer/Types';\nimport { MouseService } from 'browser/services/MouseService';\nimport { Linkifier2 } from 'browser/Linkifier2';\nimport { CoreBrowserService } from 'browser/services/CoreBrowserService';\nimport { CoreTerminal } from 'common/CoreTerminal';\nimport { color, rgba } from 'common/Color';\nimport { CharacterJoinerService } from 'browser/services/CharacterJoinerService';\nimport { toRgbString } from 'common/input/XParseColor';\nimport { BufferDecorationRenderer } from 'browser/decorations/BufferDecorationRenderer';\nimport { OverviewRulerRenderer } from 'browser/decorations/OverviewRulerRenderer';\nimport { DecorationService } from 'common/services/DecorationService';\nimport { IDecorationService } from 'common/services/Services';\n\n// Let it work inside Node.js for automated testing purposes.\nconst document: Document = (typeof window !== 'undefined') ? window.document : null as any;\n\nexport class Terminal extends CoreTerminal implements ITerminal {\n public textarea: HTMLTextAreaElement | undefined;\n public element: HTMLElement | undefined;\n public screenElement: HTMLElement | undefined;\n\n private _document: Document | undefined;\n private _viewportScrollArea: HTMLElement | undefined;\n private _viewportElement: HTMLElement | undefined;\n private _helperContainer: HTMLElement | undefined;\n private _compositionView: HTMLElement | undefined;\n\n private _overviewRulerRenderer: OverviewRulerRenderer | undefined;\n\n // private _visualBellTimer: number;\n\n public browser: IBrowser = Browser as any;\n\n private _customKeyEventHandler: CustomKeyEventHandler | undefined;\n\n // browser services\n private _decorationService: DecorationService;\n private _charSizeService: ICharSizeService | undefined;\n private _mouseService: IMouseService | undefined;\n private _renderService: IRenderService | undefined;\n private _characterJoinerService: ICharacterJoinerService | undefined;\n private _selectionService: ISelectionService | undefined;\n private _soundService: ISoundService | undefined;\n\n /**\n * Records whether the keydown event has already been handled and triggered a data event, if so\n * the keypress event should not trigger a data event but should still print to the textarea so\n * screen readers will announce it.\n */\n private _keyDownHandled: boolean = false;\n\n /**\n * Records whether a keydown event has occured since the last keyup event, i.e. whether a key\n * is currently \"pressed\".\n */\n private _keyDownSeen: boolean = false;\n\n /**\n * Records whether the keypress event has already been handled and triggered a data event, if so\n * the input event should not trigger a data event but should still print to the textarea so\n * screen readers will announce it.\n */\n private _keyPressHandled: boolean = false;\n\n /**\n * Records whether there has been a keydown event for a dead key without a corresponding keydown\n * event for the composed/alternative character. If we cancel the keydown event for the dead key,\n * no events will be emitted for the final character.\n */\n private _unprocessedDeadKey: boolean = false;\n\n public linkifier: ILinkifier;\n public linkifier2: ILinkifier2;\n public viewport: IViewport | undefined;\n private _compositionHelper: ICompositionHelper | undefined;\n private _mouseZoneManager: IMouseZoneManager | undefined;\n private _accessibilityManager: AccessibilityManager | undefined;\n private _colorManager: ColorManager | undefined;\n private _theme: ITheme | undefined;\n\n private _onCursorMove = new EventEmitter();\n public get onCursorMove(): IEvent { return this._onCursorMove.event; }\n private _onKey = new EventEmitter<{ key: string, domEvent: KeyboardEvent }>();\n public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._onKey.event; }\n private _onRender = new EventEmitter<{ start: number, end: number }>();\n public get onRender(): IEvent<{ start: number, end: number }> { return this._onRender.event; }\n private _onSelectionChange = new EventEmitter();\n public get onSelectionChange(): IEvent { return this._onSelectionChange.event; }\n private _onTitleChange = new EventEmitter();\n public get onTitleChange(): IEvent { return this._onTitleChange.event; }\n private _onBell = new EventEmitter();\n public get onBell(): IEvent { return this._onBell.event; }\n\n private _onFocus = new EventEmitter();\n public get onFocus(): IEvent { return this._onFocus.event; }\n private _onBlur = new EventEmitter();\n public get onBlur(): IEvent { return this._onBlur.event; }\n private _onA11yCharEmitter = new EventEmitter();\n public get onA11yChar(): IEvent { return this._onA11yCharEmitter.event; }\n private _onA11yTabEmitter = new EventEmitter();\n public get onA11yTab(): IEvent { return this._onA11yTabEmitter.event; }\n\n /**\n * Creates a new `Terminal` object.\n *\n * @param options An object containing a set of options, the available options are:\n * - `cursorBlink` (boolean): Whether the terminal cursor blinks\n * - `cols` (number): The number of columns of the terminal (horizontal size)\n * - `rows` (number): The number of rows of the terminal (vertical size)\n *\n * @public\n * @class Xterm Xterm\n * @alias module:xterm/src/xterm\n */\n constructor(\n options: Partial = {}\n ) {\n super(options);\n\n this._setup();\n\n this.linkifier = this._instantiationService.createInstance(Linkifier);\n this.linkifier2 = this.register(this._instantiationService.createInstance(Linkifier2));\n this._decorationService = this._instantiationService.createInstance(DecorationService);\n this._instantiationService.setService(IDecorationService, this._decorationService);\n\n // Setup InputHandler listeners\n this.register(this._inputHandler.onRequestBell(() => this.bell()));\n this.register(this._inputHandler.onRequestRefreshRows((start, end) => this.refresh(start, end)));\n this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus()));\n this.register(this._inputHandler.onRequestReset(() => this.reset()));\n this.register(this._inputHandler.onRequestWindowsOptionsReport(type => this._reportWindowsOptions(type)));\n this.register(this._inputHandler.onColor((event) => this._handleColorEvent(event)));\n this.register(forwardEvent(this._inputHandler.onCursorMove, this._onCursorMove));\n this.register(forwardEvent(this._inputHandler.onTitleChange, this._onTitleChange));\n this.register(forwardEvent(this._inputHandler.onA11yChar, this._onA11yCharEmitter));\n this.register(forwardEvent(this._inputHandler.onA11yTab, this._onA11yTabEmitter));\n\n // Setup listeners\n this.register(this._bufferService.onResize(e => this._afterResize(e.cols, e.rows)));\n }\n\n /**\n * Handle color event from inputhandler for OSC 4|104 | 10|110 | 11|111 | 12|112.\n * An event from OSC 4|104 may contain multiple set or report requests, and multiple\n * or none restore requests (resetting all),\n * while an event from OSC 10|110 | 11|111 | 12|112 always contains a single request.\n */\n private _handleColorEvent(event: IColorEvent): void {\n if (!this._colorManager) return;\n for (const req of event) {\n let acc: 'foreground' | 'background' | 'cursor' | 'ansi' | undefined = undefined;\n let ident = '';\n switch (req.index) {\n case ColorIndex.FOREGROUND: // OSC 10 | 110\n acc = 'foreground';\n ident = '10';\n break;\n case ColorIndex.BACKGROUND: // OSC 11 | 111\n acc = 'background';\n ident = '11';\n break;\n case ColorIndex.CURSOR: // OSC 12 | 112\n acc = 'cursor';\n ident = '12';\n break;\n default: // OSC 4 | 104\n // we can skip the [0..255] range check here (already done in inputhandler)\n acc = 'ansi';\n ident = '4;' + req.index;\n }\n if (acc) {\n switch (req.type) {\n case ColorRequestType.REPORT:\n const channels = color.toColorRGB(acc === 'ansi'\n ? this._colorManager.colors.ansi[req.index]\n : this._colorManager.colors[acc]);\n this.coreService.triggerDataEvent(`${C0.ESC}]${ident};${toRgbString(channels)}${C1_ESCAPED.ST}`);\n break;\n case ColorRequestType.SET:\n if (acc === 'ansi') this._colorManager.colors.ansi[req.index] = rgba.toColor(...req.color);\n else this._colorManager.colors[acc] = rgba.toColor(...req.color);\n break;\n case ColorRequestType.RESTORE:\n this._colorManager.restoreColor(req.index);\n break;\n }\n }\n }\n this._renderService?.setColors(this._colorManager.colors);\n this.viewport?.onThemeChange(this._colorManager.colors);\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n super.dispose();\n this._renderService?.dispose();\n this._customKeyEventHandler = undefined;\n this.write = () => { };\n this.element?.parentNode?.removeChild(this.element);\n }\n\n protected _setup(): void {\n super._setup();\n\n this._customKeyEventHandler = undefined;\n }\n\n /**\n * Convenience property to active buffer.\n */\n public get buffer(): IBuffer {\n return this.buffers.active;\n }\n\n /**\n * Focus the terminal. Delegates focus handling to the terminal's DOM element.\n */\n public focus(): void {\n if (this.textarea) {\n this.textarea.focus({ preventScroll: true });\n }\n }\n\n protected _updateOptions(key: string): void {\n super._updateOptions(key);\n\n // TODO: These listeners should be owned by individual components\n switch (key) {\n case 'fontFamily':\n case 'fontSize':\n // When the font changes the size of the cells may change which requires a renderer clear\n this._renderService?.clear();\n this._charSizeService?.measure();\n break;\n case 'cursorBlink':\n case 'cursorStyle':\n // The DOM renderer needs a row refresh to update the cursor styles\n this.refresh(this.buffer.y, this.buffer.y);\n break;\n case 'customGlyphs':\n case 'drawBoldTextInBrightColors':\n case 'letterSpacing':\n case 'lineHeight':\n case 'fontWeight':\n case 'fontWeightBold':\n case 'minimumContrastRatio':\n // When the font changes the size of the cells may change which requires a renderer clear\n if (this._renderService) {\n this._renderService.clear();\n this._renderService.onResize(this.cols, this.rows);\n this.refresh(0, this.rows - 1);\n }\n break;\n case 'rendererType':\n if (this._renderService) {\n this._renderService.setRenderer(this._createRenderer());\n this._renderService.onResize(this.cols, this.rows);\n }\n break;\n case 'scrollback':\n this.viewport?.syncScrollArea();\n break;\n case 'screenReaderMode':\n if (this.optionsService.rawOptions.screenReaderMode) {\n if (!this._accessibilityManager && this._renderService) {\n this._accessibilityManager = new AccessibilityManager(this, this._renderService);\n }\n } else {\n this._accessibilityManager?.dispose();\n this._accessibilityManager = undefined;\n }\n break;\n case 'tabStopWidth': this.buffers.setupTabStops(); break;\n case 'theme':\n this._setTheme(this.optionsService.rawOptions.theme);\n break;\n }\n }\n\n /**\n * Binds the desired focus behavior on a given terminal object.\n */\n private _onTextAreaFocus(ev: KeyboardEvent): void {\n if (this.coreService.decPrivateModes.sendFocus) {\n this.coreService.triggerDataEvent(C0.ESC + '[I');\n }\n this.updateCursorStyle(ev);\n this.element!.classList.add('focus');\n this._showCursor();\n this._onFocus.fire();\n }\n\n /**\n * Blur the terminal, calling the blur function on the terminal's underlying\n * textarea.\n */\n public blur(): void {\n return this.textarea?.blur();\n }\n\n /**\n * Binds the desired blur behavior on a given terminal object.\n */\n private _onTextAreaBlur(): void {\n // Text can safely be removed on blur. Doing it earlier could interfere with\n // screen readers reading it out.\n this.textarea!.value = '';\n this.refresh(this.buffer.y, this.buffer.y);\n if (this.coreService.decPrivateModes.sendFocus) {\n this.coreService.triggerDataEvent(C0.ESC + '[O');\n }\n this.element!.classList.remove('focus');\n this._onBlur.fire();\n }\n\n private _syncTextArea(): void {\n if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper!.isComposing || !this._renderService) {\n return;\n }\n const cursorY = this.buffer.ybase + this.buffer.y;\n const bufferLine = this.buffer.lines.get(cursorY);\n if (!bufferLine) {\n return;\n }\n const cursorX = Math.min(this.buffer.x, this.cols - 1);\n const cellHeight = this._renderService.dimensions.actualCellHeight;\n const width = bufferLine.getWidth(cursorX);\n const cellWidth = this._renderService.dimensions.actualCellWidth * width;\n const cursorTop = this.buffer.y * this._renderService.dimensions.actualCellHeight;\n const cursorLeft = cursorX * this._renderService.dimensions.actualCellWidth;\n\n // Sync the textarea to the exact position of the composition view so the IME knows where the\n // text is.\n this.textarea.style.left = cursorLeft + 'px';\n this.textarea.style.top = cursorTop + 'px';\n this.textarea.style.width = cellWidth + 'px';\n this.textarea.style.height = cellHeight + 'px';\n this.textarea.style.lineHeight = cellHeight + 'px';\n this.textarea.style.zIndex = '-5';\n }\n\n /**\n * Initialize default behavior\n */\n private _initGlobal(): void {\n this._bindKeys();\n\n // Bind clipboard functionality\n this.register(addDisposableDomListener(this.element!, 'copy', (event: ClipboardEvent) => {\n // If mouse events are active it means the selection manager is disabled and\n // copy should be handled by the host program.\n if (!this.hasSelection()) {\n return;\n }\n copyHandler(event, this._selectionService!);\n }));\n const pasteHandlerWrapper = (event: ClipboardEvent): void => handlePasteEvent(event, this.textarea!, this.coreService);\n this.register(addDisposableDomListener(this.textarea!, 'paste', pasteHandlerWrapper));\n this.register(addDisposableDomListener(this.element!, 'paste', pasteHandlerWrapper));\n\n // Handle right click context menus\n if (Browser.isFirefox) {\n // Firefox doesn't appear to fire the contextmenu event on right click\n this.register(addDisposableDomListener(this.element!, 'mousedown', (event: MouseEvent) => {\n if (event.button === 2) {\n rightClickHandler(event, this.textarea!, this.screenElement!, this._selectionService!, this.options.rightClickSelectsWord);\n }\n }));\n } else {\n this.register(addDisposableDomListener(this.element!, 'contextmenu', (event: MouseEvent) => {\n rightClickHandler(event, this.textarea!, this.screenElement!, this._selectionService!, this.options.rightClickSelectsWord);\n }));\n }\n\n // Move the textarea under the cursor when middle clicking on Linux to ensure\n // middle click to paste selection works. This only appears to work in Chrome\n // at the time is writing.\n if (Browser.isLinux) {\n // Use auxclick event over mousedown the latter doesn't seem to work. Note\n // that the regular click event doesn't fire for the middle mouse button.\n this.register(addDisposableDomListener(this.element!, 'auxclick', (event: MouseEvent) => {\n if (event.button === 1) {\n moveTextAreaUnderMouseCursor(event, this.textarea!, this.screenElement!);\n }\n }));\n }\n }\n\n /**\n * Apply key handling to the terminal\n */\n private _bindKeys(): void {\n this.register(addDisposableDomListener(this.textarea!, 'keyup', (ev: KeyboardEvent) => this._keyUp(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'keydown', (ev: KeyboardEvent) => this._keyDown(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'keypress', (ev: KeyboardEvent) => this._keyPress(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'compositionstart', () => this._compositionHelper!.compositionstart()));\n this.register(addDisposableDomListener(this.textarea!, 'compositionupdate', (e: CompositionEvent) => this._compositionHelper!.compositionupdate(e)));\n this.register(addDisposableDomListener(this.textarea!, 'compositionend', () => this._compositionHelper!.compositionend()));\n this.register(addDisposableDomListener(this.textarea!, 'input', (ev: InputEvent) => this._inputEvent(ev), true));\n this.register(this.onRender(() => this._compositionHelper!.updateCompositionElements()));\n this.register(this.onRender(e => this._queueLinkification(e.start, e.end)));\n }\n\n /**\n * Opens the terminal within an element.\n *\n * @param parent The element to create the terminal within.\n */\n public open(parent: HTMLElement): void {\n if (!parent) {\n throw new Error('Terminal requires a parent element.');\n }\n\n if (!parent.isConnected) {\n this._logService.debug('Terminal.open was called on an element that was not attached to the DOM');\n }\n\n this._document = parent.ownerDocument!;\n\n // Create main element container\n this.element = this._document.createElement('div');\n this.element.dir = 'ltr'; // xterm.css assumes LTR\n this.element.classList.add('terminal');\n this.element.classList.add('xterm');\n this.element.setAttribute('tabindex', '0');\n parent.appendChild(this.element);\n\n // Performance: Use a document fragment to build the terminal\n // viewport and helper elements detached from the DOM\n const fragment = document.createDocumentFragment();\n this._viewportElement = document.createElement('div');\n this._viewportElement.classList.add('xterm-viewport');\n fragment.appendChild(this._viewportElement);\n\n this._viewportScrollArea = document.createElement('div');\n this._viewportScrollArea.classList.add('xterm-scroll-area');\n this._viewportElement.appendChild(this._viewportScrollArea);\n\n this.screenElement = document.createElement('div');\n this.screenElement.classList.add('xterm-screen');\n // Create the container that will hold helpers like the textarea for\n // capturing DOM Events. Then produce the helpers.\n this._helperContainer = document.createElement('div');\n this._helperContainer.classList.add('xterm-helpers');\n this.screenElement.appendChild(this._helperContainer);\n fragment.appendChild(this.screenElement);\n\n this.textarea = document.createElement('textarea');\n this.textarea.classList.add('xterm-helper-textarea');\n this.textarea.setAttribute('aria-label', Strings.promptLabel);\n this.textarea.setAttribute('aria-multiline', 'false');\n this.textarea.setAttribute('autocorrect', 'off');\n this.textarea.setAttribute('autocapitalize', 'off');\n this.textarea.setAttribute('spellcheck', 'false');\n this.textarea.tabIndex = 0;\n this.register(addDisposableDomListener(this.textarea, 'focus', (ev: KeyboardEvent) => this._onTextAreaFocus(ev)));\n this.register(addDisposableDomListener(this.textarea, 'blur', () => this._onTextAreaBlur()));\n this._helperContainer.appendChild(this.textarea);\n\n const coreBrowserService = this._instantiationService.createInstance(CoreBrowserService, this.textarea);\n this._instantiationService.setService(ICoreBrowserService, coreBrowserService);\n\n this._charSizeService = this._instantiationService.createInstance(CharSizeService, this._document, this._helperContainer);\n this._instantiationService.setService(ICharSizeService, this._charSizeService);\n\n this._theme = this.options.theme || this._theme;\n this._colorManager = new ColorManager(document, this.options.allowTransparency);\n this.register(this.optionsService.onOptionChange(e => this._colorManager!.onOptionsChange(e)));\n this._colorManager.setTheme(this._theme);\n\n this._characterJoinerService = this._instantiationService.createInstance(CharacterJoinerService);\n this._instantiationService.setService(ICharacterJoinerService, this._characterJoinerService);\n\n const renderer = this._createRenderer();\n this._renderService = this.register(this._instantiationService.createInstance(RenderService, renderer, this.rows, this.screenElement));\n this._instantiationService.setService(IRenderService, this._renderService);\n this.register(this._renderService.onRenderedViewportChange(e => this._onRender.fire(e)));\n this.onResize(e => this._renderService!.resize(e.cols, e.rows));\n\n this._compositionView = document.createElement('div');\n this._compositionView.classList.add('composition-view');\n this._compositionHelper = this._instantiationService.createInstance(CompositionHelper, this.textarea, this._compositionView);\n this._helperContainer.appendChild(this._compositionView);\n\n // Performance: Add viewport and helper elements from the fragment\n this.element.appendChild(fragment);\n\n this._soundService = this._instantiationService.createInstance(SoundService);\n this._instantiationService.setService(ISoundService, this._soundService);\n this._mouseService = this._instantiationService.createInstance(MouseService);\n this._instantiationService.setService(IMouseService, this._mouseService);\n\n this.viewport = this._instantiationService.createInstance(Viewport,\n (amount: number) => this.scrollLines(amount, true, ScrollSource.VIEWPORT),\n this._viewportElement,\n this._viewportScrollArea,\n this.element\n );\n this.viewport.onThemeChange(this._colorManager.colors);\n this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport!.syncScrollArea()));\n this.register(this.viewport);\n\n this.register(this.onCursorMove(() => {\n this._renderService!.onCursorMove();\n this._syncTextArea();\n }));\n this.register(this.onResize(() => this._renderService!.onResize(this.cols, this.rows)));\n this.register(this.onBlur(() => this._renderService!.onBlur()));\n this.register(this.onFocus(() => this._renderService!.onFocus()));\n this.register(this._renderService.onDimensionsChange(() => this.viewport!.syncScrollArea()));\n\n this._selectionService = this.register(this._instantiationService.createInstance(SelectionService,\n this.element,\n this.screenElement,\n this.linkifier2\n ));\n this._instantiationService.setService(ISelectionService, this._selectionService);\n this.register(this._selectionService.onRequestScrollLines(e => this.scrollLines(e.amount, e.suppressScrollEvent)));\n this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire()));\n this.register(this._selectionService.onRequestRedraw(e => this._renderService!.onSelectionChanged(e.start, e.end, e.columnSelectMode)));\n this.register(this._selectionService.onLinuxMouseSelection(text => {\n // If there's a new selection, put it into the textarea, focus and select it\n // in order to register it as a selection on the OS. This event is fired\n // only on Linux to enable middle click to paste selection.\n this.textarea!.value = text;\n this.textarea!.focus();\n this.textarea!.select();\n }));\n this.register(this._onScroll.event(ev => {\n this.viewport!.syncScrollArea();\n this._selectionService!.refresh();\n }));\n this.register(addDisposableDomListener(this._viewportElement, 'scroll', () => this._selectionService!.refresh()));\n\n this._mouseZoneManager = this._instantiationService.createInstance(MouseZoneManager, this.element, this.screenElement);\n this.register(this._mouseZoneManager);\n this.register(this.onScroll(() => this._mouseZoneManager!.clearAll()));\n this.linkifier.attachToDom(this.element, this._mouseZoneManager);\n this.linkifier2.attachToDom(this.screenElement, this._mouseService, this._renderService);\n this.register(this._instantiationService.createInstance(BufferDecorationRenderer, this.screenElement));\n // This event listener must be registered aftre MouseZoneManager is created\n this.register(addDisposableDomListener(this.element, 'mousedown', (e: MouseEvent) => this._selectionService!.onMouseDown(e)));\n\n // apply mouse event classes set by escape codes before terminal was attached\n if (this.coreMouseService.areMouseEventsActive) {\n this._selectionService.disable();\n this.element.classList.add('enable-mouse-events');\n } else {\n this._selectionService.enable();\n }\n\n if (this.options.screenReaderMode) {\n // Note that this must be done *after* the renderer is created in order to\n // ensure the correct order of the dprchange event\n this._accessibilityManager = new AccessibilityManager(this, this._renderService);\n }\n\n if (this.options.overviewRulerWidth) {\n this._overviewRulerRenderer = this._instantiationService.createInstance(OverviewRulerRenderer, this._viewportElement, this.screenElement);\n }\n this.optionsService.onOptionChange(() => {\n if (!this._overviewRulerRenderer && this.options.overviewRulerWidth && this._viewportElement && this.screenElement) {\n this._overviewRulerRenderer = this._instantiationService.createInstance(OverviewRulerRenderer, this._viewportElement, this.screenElement);\n }\n });\n // Measure the character size\n this._charSizeService.measure();\n\n // Setup loop that draws to screen\n this.refresh(0, this.rows - 1);\n\n // Initialize global actions that need to be taken on the document.\n this._initGlobal();\n\n // Listen for mouse events and translate\n // them into terminal mouse protocols.\n this.bindMouse();\n }\n\n private _createRenderer(): IRenderer {\n switch (this.options.rendererType) {\n case 'canvas': return this._instantiationService.createInstance(Renderer, this._colorManager!.colors, this.screenElement!, this.linkifier, this.linkifier2);\n case 'dom': return this._instantiationService.createInstance(DomRenderer, this._colorManager!.colors, this.element!, this.screenElement!, this._viewportElement!, this.linkifier, this.linkifier2);\n default: throw new Error(`Unrecognized rendererType \"${this.options.rendererType}\"`);\n }\n }\n\n /**\n * Sets the theme on the renderer. The renderer must have been initialized.\n * @param theme The theme to set.\n */\n private _setTheme(theme: ITheme): void {\n this._theme = theme;\n this._colorManager?.setTheme(theme);\n this._renderService?.setColors(this._colorManager!.colors);\n this.viewport?.onThemeChange(this._colorManager!.colors);\n }\n\n /**\n * Bind certain mouse events to the terminal.\n * By default only 3 button + wheel up/down is ativated. For higher buttons\n * no mouse report will be created. Typically the standard actions will be active.\n *\n * There are several reasons not to enable support for higher buttons/wheel:\n * - Button 4 and 5 are typically used for history back and forward navigation,\n * there is no straight forward way to supress/intercept those standard actions.\n * - Support for higher buttons does not work in some platform/browser combinations.\n * - Left/right wheel was not tested.\n * - Emulators vary in mouse button support, typically only 3 buttons and\n * wheel up/down work reliable.\n *\n * TODO: Move mouse event code into its own file.\n */\n public bindMouse(): void {\n const self = this;\n const el = this.element!;\n\n // send event to CoreMouseService\n function sendEvent(ev: MouseEvent | WheelEvent): boolean {\n // get mouse coordinates\n const pos = self._mouseService!.getRawByteCoords(ev, self.screenElement!, self.cols, self.rows);\n if (!pos) {\n return false;\n }\n\n let but: CoreMouseButton;\n let action: CoreMouseAction | undefined;\n switch ((ev as any).overrideType || ev.type) {\n case 'mousemove':\n action = CoreMouseAction.MOVE;\n if (ev.buttons === undefined) {\n // buttons is not supported on macOS, try to get a value from button instead\n but = CoreMouseButton.NONE;\n if (ev.button !== undefined) {\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n }\n } else {\n // according to MDN buttons only reports up to button 5 (AUX2)\n but = ev.buttons & 1 ? CoreMouseButton.LEFT :\n ev.buttons & 4 ? CoreMouseButton.MIDDLE :\n ev.buttons & 2 ? CoreMouseButton.RIGHT :\n CoreMouseButton.NONE; // fallback to NONE\n }\n break;\n case 'mouseup':\n action = CoreMouseAction.UP;\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n break;\n case 'mousedown':\n action = CoreMouseAction.DOWN;\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n break;\n case 'wheel':\n const amount = self.viewport!.getLinesScrolled(ev as WheelEvent);\n\n if (amount === 0) {\n return false;\n }\n\n action = (ev as WheelEvent).deltaY < 0 ? CoreMouseAction.UP : CoreMouseAction.DOWN;\n but = CoreMouseButton.WHEEL;\n break;\n default:\n // dont handle other event types by accident\n return false;\n }\n\n // exit if we cannot determine valid button/action values\n // do nothing for higher buttons than wheel\n if (action === undefined || but === undefined || but > CoreMouseButton.WHEEL) {\n return false;\n }\n\n return self.coreMouseService.triggerMouseEvent({\n col: pos.x - 33, // FIXME: why -33 here?\n row: pos.y - 33,\n button: but,\n action,\n ctrl: ev.ctrlKey,\n alt: ev.altKey,\n shift: ev.shiftKey\n });\n }\n\n /**\n * Event listener state handling.\n * We listen to the onProtocolChange event of CoreMouseService and put\n * requested listeners in `requestedEvents`. With this the listeners\n * have all bits to do the event listener juggling.\n * Note: 'mousedown' currently is \"always on\" and not managed\n * by onProtocolChange.\n */\n const requestedEvents: { [key: string]: ((ev: Event) => void) | null } = {\n mouseup: null,\n wheel: null,\n mousedrag: null,\n mousemove: null\n };\n const eventListeners: { [key: string]: (ev: any) => void | boolean } = {\n mouseup: (ev: MouseEvent) => {\n sendEvent(ev);\n if (!ev.buttons) {\n // if no other button is held remove global handlers\n this._document!.removeEventListener('mouseup', requestedEvents.mouseup!);\n if (requestedEvents.mousedrag) {\n this._document!.removeEventListener('mousemove', requestedEvents.mousedrag);\n }\n }\n return this.cancel(ev);\n },\n wheel: (ev: WheelEvent) => {\n sendEvent(ev);\n return this.cancel(ev, true);\n },\n mousedrag: (ev: MouseEvent) => {\n // deal only with move while a button is held\n if (ev.buttons) {\n sendEvent(ev);\n }\n },\n mousemove: (ev: MouseEvent) => {\n // deal only with move without any button\n if (!ev.buttons) {\n sendEvent(ev);\n }\n }\n };\n this.register(this.coreMouseService.onProtocolChange(events => {\n // apply global changes on events\n if (events) {\n if (this.optionsService.rawOptions.logLevel === 'debug') {\n this._logService.debug('Binding to mouse events:', this.coreMouseService.explainEvents(events));\n }\n this.element!.classList.add('enable-mouse-events');\n this._selectionService!.disable();\n } else {\n this._logService.debug('Unbinding from mouse events.');\n this.element!.classList.remove('enable-mouse-events');\n this._selectionService!.enable();\n }\n\n // add/remove handlers from requestedEvents\n\n if (!(events & CoreMouseEventType.MOVE)) {\n el.removeEventListener('mousemove', requestedEvents.mousemove!);\n requestedEvents.mousemove = null;\n } else if (!requestedEvents.mousemove) {\n el.addEventListener('mousemove', eventListeners.mousemove);\n requestedEvents.mousemove = eventListeners.mousemove;\n }\n\n if (!(events & CoreMouseEventType.WHEEL)) {\n el.removeEventListener('wheel', requestedEvents.wheel!);\n requestedEvents.wheel = null;\n } else if (!requestedEvents.wheel) {\n el.addEventListener('wheel', eventListeners.wheel, { passive: false });\n requestedEvents.wheel = eventListeners.wheel;\n }\n\n if (!(events & CoreMouseEventType.UP)) {\n this._document!.removeEventListener('mouseup', requestedEvents.mouseup!);\n requestedEvents.mouseup = null;\n } else if (!requestedEvents.mouseup) {\n requestedEvents.mouseup = eventListeners.mouseup;\n }\n\n if (!(events & CoreMouseEventType.DRAG)) {\n this._document!.removeEventListener('mousemove', requestedEvents.mousedrag!);\n requestedEvents.mousedrag = null;\n } else if (!requestedEvents.mousedrag) {\n requestedEvents.mousedrag = eventListeners.mousedrag;\n }\n }));\n // force initial onProtocolChange so we dont miss early mouse requests\n this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol;\n\n /**\n * \"Always on\" event listeners.\n */\n this.register(addDisposableDomListener(el, 'mousedown', (ev: MouseEvent) => {\n ev.preventDefault();\n this.focus();\n\n // Don't send the mouse button to the pty if mouse events are disabled or\n // if the selection manager is having selection forced (ie. a modifier is\n // held).\n if (!this.coreMouseService.areMouseEventsActive || this._selectionService!.shouldForceSelection(ev)) {\n return;\n }\n\n sendEvent(ev);\n\n // Register additional global handlers which should keep reporting outside\n // of the terminal element.\n // Note: Other emulators also do this for 'mousedown' while a button\n // is held, we currently limit 'mousedown' to the terminal only.\n if (requestedEvents.mouseup) {\n this._document!.addEventListener('mouseup', requestedEvents.mouseup);\n }\n if (requestedEvents.mousedrag) {\n this._document!.addEventListener('mousemove', requestedEvents.mousedrag);\n }\n\n return this.cancel(ev);\n }));\n\n this.register(addDisposableDomListener(el, 'wheel', (ev: WheelEvent) => {\n // do nothing, if app side handles wheel itself\n if (requestedEvents.wheel) return;\n\n if (!this.buffer.hasScrollback) {\n // Convert wheel events into up/down events when the buffer does not have scrollback, this\n // enables scrolling in apps hosted in the alt buffer such as vim or tmux.\n const amount = this.viewport!.getLinesScrolled(ev);\n\n // Do nothing if there's no vertical scroll\n if (amount === 0) {\n return;\n }\n\n // Construct and send sequences\n const sequence = C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? 'O' : '[') + (ev.deltaY < 0 ? 'A' : 'B');\n let data = '';\n for (let i = 0; i < Math.abs(amount); i++) {\n data += sequence;\n }\n this.coreService.triggerDataEvent(data, true);\n return this.cancel(ev, true);\n }\n\n // normal viewport scrolling\n // conditionally stop event, if the viewport still had rows to scroll within\n if (this.viewport!.onWheel(ev)) {\n return this.cancel(ev);\n }\n }, { passive: false }));\n\n this.register(addDisposableDomListener(el, 'touchstart', (ev: TouchEvent) => {\n if (this.coreMouseService.areMouseEventsActive) return;\n this.viewport!.onTouchStart(ev);\n return this.cancel(ev);\n }, { passive: true }));\n\n this.register(addDisposableDomListener(el, 'touchmove', (ev: TouchEvent) => {\n if (this.coreMouseService.areMouseEventsActive) return;\n if (!this.viewport!.onTouchMove(ev)) {\n return this.cancel(ev);\n }\n }, { passive: false }));\n }\n\n\n /**\n * Tells the renderer to refresh terminal content between two rows (inclusive) at the next\n * opportunity.\n * @param start The row to start from (between 0 and this.rows - 1).\n * @param end The row to end at (between start and this.rows - 1).\n */\n public refresh(start: number, end: number): void {\n this._renderService?.refreshRows(start, end);\n }\n\n /**\n * Queues linkification for the specified rows.\n * @param start The row to start from (between 0 and this.rows - 1).\n * @param end The row to end at (between start and this.rows - 1).\n */\n private _queueLinkification(start: number, end: number): void {\n this.linkifier?.linkifyRows(start, end);\n }\n\n /**\n * Change the cursor style for different selection modes\n */\n public updateCursorStyle(ev: KeyboardEvent): void {\n if (this._selectionService?.shouldColumnSelect(ev)) {\n this.element!.classList.add('column-select');\n } else {\n this.element!.classList.remove('column-select');\n }\n }\n\n /**\n * Display the cursor element\n */\n private _showCursor(): void {\n if (!this.coreService.isCursorInitialized) {\n this.coreService.isCursorInitialized = true;\n this.refresh(this.buffer.y, this.buffer.y);\n }\n }\n\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source = ScrollSource.TERMINAL): void {\n super.scrollLines(disp, suppressScrollEvent, source);\n this.refresh(0, this.rows - 1);\n }\n\n public paste(data: string): void {\n paste(data, this.textarea!, this.coreService);\n }\n\n /**\n * Attaches a custom key event handler which is run before keys are processed,\n * giving consumers of xterm.js ultimate control as to what keys should be\n * processed by the terminal and what keys should not.\n * @param customKeyEventHandler The custom KeyboardEvent handler to attach.\n * This is a function that takes a KeyboardEvent, allowing consumers to stop\n * propagation and/or prevent the default action. The function returns whether\n * the event should be processed by xterm.js.\n */\n public attachCustomKeyEventHandler(customKeyEventHandler: CustomKeyEventHandler): void {\n this._customKeyEventHandler = customKeyEventHandler;\n }\n\n /**\n * Registers a link matcher, allowing custom link patterns to be matched and\n * handled.\n * @param regex The regular expression to search for, specifically\n * this searches the textContent of the rows. You will want to use \\s to match\n * a space ' ' character for example.\n * @param handler The callback when the link is called.\n * @param options Options for the link matcher.\n * @return The ID of the new matcher, this can be used to deregister.\n */\n public registerLinkMatcher(regex: RegExp, handler: LinkMatcherHandler, options?: ILinkMatcherOptions): number {\n const matcherId = this.linkifier.registerLinkMatcher(regex, handler, options);\n this.refresh(0, this.rows - 1);\n return matcherId;\n }\n\n /**\n * Deregisters a link matcher if it has been registered.\n * @param matcherId The link matcher's ID (returned after register)\n */\n public deregisterLinkMatcher(matcherId: number): void {\n if (this.linkifier.deregisterLinkMatcher(matcherId)) {\n this.refresh(0, this.rows - 1);\n }\n }\n\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n return this.linkifier2.registerLinkProvider(linkProvider);\n }\n\n public registerCharacterJoiner(handler: CharacterJoinerHandler): number {\n if (!this._characterJoinerService) {\n throw new Error('Terminal must be opened first');\n }\n const joinerId = this._characterJoinerService.register(handler);\n this.refresh(0, this.rows - 1);\n return joinerId;\n }\n\n public deregisterCharacterJoiner(joinerId: number): void {\n if (!this._characterJoinerService) {\n throw new Error('Terminal must be opened first');\n }\n if (this._characterJoinerService.deregister(joinerId)) {\n this.refresh(0, this.rows - 1);\n }\n }\n\n public get markers(): IMarker[] {\n return this.buffer.markers;\n }\n\n public addMarker(cursorYOffset: number): IMarker | undefined {\n // Disallow markers on the alt buffer\n if (this.buffer !== this.buffers.normal) {\n return;\n }\n\n return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset);\n }\n\n public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined {\n return this._decorationService.registerDecoration(decorationOptions);\n }\n\n /**\n * Gets whether the terminal has an active selection.\n */\n public hasSelection(): boolean {\n return this._selectionService ? this._selectionService.hasSelection : false;\n }\n\n /**\n * Selects text within the terminal.\n * @param column The column the selection starts at..\n * @param row The row the selection starts at.\n * @param length The length of the selection.\n */\n public select(column: number, row: number, length: number): void {\n this._selectionService!.setSelection(column, row, length);\n }\n\n /**\n * Gets the terminal's current selection, this is useful for implementing copy\n * behavior outside of xterm.js.\n */\n public getSelection(): string {\n return this._selectionService ? this._selectionService.selectionText : '';\n }\n\n public getSelectionPosition(): ISelectionPosition | undefined {\n if (!this._selectionService || !this._selectionService.hasSelection) {\n return undefined;\n }\n\n return {\n startColumn: this._selectionService.selectionStart![0],\n startRow: this._selectionService.selectionStart![1],\n endColumn: this._selectionService.selectionEnd![0],\n endRow: this._selectionService.selectionEnd![1]\n };\n }\n\n /**\n * Clears the current terminal selection.\n */\n public clearSelection(): void {\n this._selectionService?.clearSelection();\n }\n\n /**\n * Selects all text within the terminal.\n */\n public selectAll(): void {\n this._selectionService?.selectAll();\n }\n\n public selectLines(start: number, end: number): void {\n this._selectionService?.selectLines(start, end);\n }\n\n /**\n * Handle a keydown event\n * Key Resources:\n * - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent\n * @param ev The keydown event to be handled.\n */\n protected _keyDown(event: KeyboardEvent): boolean | undefined {\n this._keyDownHandled = false;\n this._keyDownSeen = true;\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(event) === false) {\n return false;\n }\n\n // Ignore composing with Alt key on Mac when macOptionIsMeta is enabled\n const shouldIgnoreComposition = this.browser.isMac && this.options.macOptionIsMeta && event.altKey;\n\n if (!shouldIgnoreComposition && !this._compositionHelper!.keydown(event)) {\n if (this.buffer.ybase !== this.buffer.ydisp) {\n this._bufferService.scrollToBottom();\n }\n return false;\n }\n\n if (!shouldIgnoreComposition && (event.key === 'Dead' || event.key === 'AltGraph')) {\n this._unprocessedDeadKey = true;\n }\n\n const result = evaluateKeyboardEvent(event, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta);\n\n this.updateCursorStyle(event);\n\n if (result.type === KeyboardResultType.PAGE_DOWN || result.type === KeyboardResultType.PAGE_UP) {\n const scrollCount = this.rows - 1;\n this.scrollLines(result.type === KeyboardResultType.PAGE_UP ? -scrollCount : scrollCount);\n return this.cancel(event, true);\n }\n\n if (result.type === KeyboardResultType.SELECT_ALL) {\n this.selectAll();\n }\n\n if (this._isThirdLevelShift(this.browser, event)) {\n return true;\n }\n\n if (result.cancel) {\n // The event is canceled at the end already, is this necessary?\n this.cancel(event, true);\n }\n\n if (!result.key) {\n return true;\n }\n\n // HACK: Process A-Z in the keypress event to fix an issue with macOS IMEs where lower case\n // letters cannot be input while caps lock is on.\n if (event.key && !event.ctrlKey && !event.altKey && !event.metaKey && event.key.length === 1) {\n if (event.key.charCodeAt(0) >= 65 && event.key.charCodeAt(0) <= 90) {\n return true;\n }\n }\n\n if (this._unprocessedDeadKey) {\n this._unprocessedDeadKey = false;\n return true;\n }\n\n // If ctrl+c or enter is being sent, clear out the textarea. This is done so that screen readers\n // will announce deleted characters. This will not work 100% of the time but it should cover\n // most scenarios.\n if (result.key === C0.ETX || result.key === C0.CR) {\n this.textarea!.value = '';\n }\n\n this._onKey.fire({ key: result.key, domEvent: event });\n this._showCursor();\n this.coreService.triggerDataEvent(result.key, true);\n\n // Cancel events when not in screen reader mode so events don't get bubbled up and handled by\n // other listeners. When screen reader mode is enabled, this could cause issues if the event\n // is handled at a higher level, this is a compromise in order to echo keys to the screen\n // reader.\n if (!this.optionsService.rawOptions.screenReaderMode) {\n return this.cancel(event, true);\n }\n\n this._keyDownHandled = true;\n }\n\n private _isThirdLevelShift(browser: IBrowser, ev: KeyboardEvent): boolean {\n const thirdLevelKey =\n (browser.isMac && !this.options.macOptionIsMeta && ev.altKey && !ev.ctrlKey && !ev.metaKey) ||\n (browser.isWindows && ev.altKey && ev.ctrlKey && !ev.metaKey) ||\n (browser.isWindows && ev.getModifierState('AltGraph'));\n\n if (ev.type === 'keypress') {\n return thirdLevelKey;\n }\n\n // Don't invoke for arrows, pageDown, home, backspace, etc. (on non-keypress events)\n return thirdLevelKey && (!ev.keyCode || ev.keyCode > 47);\n }\n\n protected _keyUp(ev: KeyboardEvent): void {\n this._keyDownSeen = false;\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {\n return;\n }\n\n if (!wasModifierKeyOnlyEvent(ev)) {\n this.focus();\n }\n\n this.updateCursorStyle(ev);\n this._keyPressHandled = false;\n }\n\n /**\n * Handle a keypress event.\n * Key Resources:\n * - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent\n * @param ev The keypress event to be handled.\n */\n protected _keyPress(ev: KeyboardEvent): boolean {\n let key;\n\n this._keyPressHandled = false;\n\n if (this._keyDownHandled) {\n return false;\n }\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {\n return false;\n }\n\n this.cancel(ev);\n\n if (ev.charCode) {\n key = ev.charCode;\n } else if (ev.which === null || ev.which === undefined) {\n key = ev.keyCode;\n } else if (ev.which !== 0 && ev.charCode !== 0) {\n key = ev.which;\n } else {\n return false;\n }\n\n if (!key || (\n (ev.altKey || ev.ctrlKey || ev.metaKey) && !this._isThirdLevelShift(this.browser, ev)\n )) {\n return false;\n }\n\n key = String.fromCharCode(key);\n\n this._onKey.fire({ key, domEvent: ev });\n this._showCursor();\n this.coreService.triggerDataEvent(key, true);\n\n this._keyPressHandled = true;\n\n // The key was handled so clear the dead key state, otherwise certain keystrokes like arrow\n // keys could be ignored\n this._unprocessedDeadKey = false;\n\n return true;\n }\n\n /**\n * Handle an input event.\n * Key Resources:\n * - https://developer.mozilla.org/en-US/docs/Web/API/InputEvent\n * @param ev The input event to be handled.\n */\n protected _inputEvent(ev: InputEvent): boolean {\n // Only support emoji IMEs when screen reader mode is disabled as the event must bubble up to\n // support reading out character input which can doubling up input characters\n // Based on these event traces: https://github.com/xtermjs/xterm.js/issues/3679\n if (ev.data && ev.inputType === 'insertText' && (!ev.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) {\n if (this._keyPressHandled) {\n return false;\n }\n\n // The key was handled so clear the dead key state, otherwise certain keystrokes like arrow\n // keys could be ignored\n this._unprocessedDeadKey = false;\n\n const text = ev.data;\n this.coreService.triggerDataEvent(text, true);\n\n this.cancel(ev);\n return true;\n }\n\n return false;\n }\n\n /**\n * Ring the bell.\n * Note: We could do sweet things with webaudio here\n */\n public bell(): void {\n if (this._soundBell()) {\n this._soundService?.playBellSound();\n }\n\n this._onBell.fire();\n\n // if (this._visualBell()) {\n // this.element.classList.add('visual-bell-active');\n // clearTimeout(this._visualBellTimer);\n // this._visualBellTimer = window.setTimeout(() => {\n // this.element.classList.remove('visual-bell-active');\n // }, 200);\n // }\n }\n\n /**\n * Resizes the terminal.\n *\n * @param x The number of columns to resize to.\n * @param y The number of rows to resize to.\n */\n public resize(x: number, y: number): void {\n if (x === this.cols && y === this.rows) {\n // Check if we still need to measure the char size (fixes #785).\n if (this._charSizeService && !this._charSizeService.hasValidSize) {\n this._charSizeService.measure();\n }\n return;\n }\n\n super.resize(x, y);\n }\n\n private _afterResize(x: number, y: number): void {\n this._charSizeService?.measure();\n\n // Sync the scroll area to make sure scroll events don't fire and scroll the viewport to an\n // invalid location\n this.viewport?.syncScrollArea(true);\n }\n\n /**\n * Clear the entire buffer, making the prompt line the new first line.\n */\n public clear(): void {\n if (this.buffer.ybase === 0 && this.buffer.y === 0) {\n // Don't clear if it's already clear\n return;\n }\n this.buffer.clearAllMarkers();\n this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)!);\n this.buffer.lines.length = 1;\n this.buffer.ydisp = 0;\n this.buffer.ybase = 0;\n this.buffer.y = 0;\n for (let i = 1; i < this.rows; i++) {\n this.buffer.lines.push(this.buffer.getBlankLine(DEFAULT_ATTR_DATA));\n }\n this.refresh(0, this.rows - 1);\n this._onScroll.fire({ position: this.buffer.ydisp, source: ScrollSource.TERMINAL });\n }\n\n /**\n * Reset terminal.\n * Note: Calling this directly from JS is synchronous but does not clear\n * input buffers and does not reset the parser, thus the terminal will\n * continue to apply pending input data.\n * If you need in band reset (synchronous with input data) consider\n * using DECSTR (soft reset, CSI ! p) or RIS instead (hard reset, ESC c).\n */\n public reset(): void {\n /**\n * Since _setup handles a full terminal creation, we have to carry forward\n * a few things that should not reset.\n */\n this.options.rows = this.rows;\n this.options.cols = this.cols;\n const customKeyEventHandler = this._customKeyEventHandler;\n\n this._setup();\n super.reset();\n this._selectionService?.reset();\n this._decorationService.reset();\n\n // reattach\n this._customKeyEventHandler = customKeyEventHandler;\n\n // do a full screen refresh\n this.refresh(0, this.rows - 1);\n this.viewport?.syncScrollArea();\n }\n\n public clearTextureAtlas(): void {\n this._renderService?.clearTextureAtlas();\n }\n\n private _reportFocus(): void {\n if (this.element?.classList.contains('focus')) {\n this.coreService.triggerDataEvent(C0.ESC + '[I');\n } else {\n this.coreService.triggerDataEvent(C0.ESC + '[O');\n }\n }\n\n private _reportWindowsOptions(type: WindowsOptionsReportType): void {\n if (!this._renderService) {\n return;\n }\n\n switch (type) {\n case WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:\n const canvasWidth = this._renderService.dimensions.scaledCanvasWidth.toFixed(0);\n const canvasHeight = this._renderService.dimensions.scaledCanvasHeight.toFixed(0);\n this.coreService.triggerDataEvent(`${C0.ESC}[4;${canvasHeight};${canvasWidth}t`);\n break;\n case WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:\n const cellWidth = this._renderService.dimensions.scaledCellWidth.toFixed(0);\n const cellHeight = this._renderService.dimensions.scaledCellHeight.toFixed(0);\n this.coreService.triggerDataEvent(`${C0.ESC}[6;${cellHeight};${cellWidth}t`);\n break;\n }\n }\n\n // TODO: Remove cancel function and cancelEvents option\n public cancel(ev: Event, force?: boolean): boolean | undefined {\n if (!this.options.cancelEvents && !force) {\n return;\n }\n ev.preventDefault();\n ev.stopPropagation();\n return false;\n }\n\n private _visualBell(): boolean {\n return false;\n // return this.options.bellStyle === 'visual' ||\n // this.options.bellStyle === 'both';\n }\n\n private _soundBell(): boolean {\n return this.options.bellStyle === 'sound';\n // return this.options.bellStyle === 'sound' ||\n // this.options.bellStyle === 'both';\n }\n}\n\n/**\n * Helpers\n */\n\nfunction wasModifierKeyOnlyEvent(ev: KeyboardEvent): boolean {\n return ev.keyCode === 16 || // Shift\n ev.keyCode === 17 || // Ctrl\n ev.keyCode === 18; // Alt\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nconst RENDER_DEBOUNCE_THRESHOLD_MS = 1000; // 1 Second\n\nimport { IRenderDebouncer } from 'browser/Types';\n\n/**\n * Debounces calls to update screen readers to update at most once configurable interval of time.\n */\nexport class TimeBasedDebouncer implements IRenderDebouncer {\n private _rowStart: number | undefined;\n private _rowEnd: number | undefined;\n private _rowCount: number | undefined;\n\n // The last moment that the Terminal was refreshed at\n private _lastRefreshMs = 0;\n // Whether a trailing refresh should be triggered due to a refresh request that was throttled\n private _additionalRefreshRequested = false;\n\n private _refreshTimeoutID: number | undefined;\n\n constructor(\n private _renderCallback: (start: number, end: number) => void,\n private readonly _debounceThresholdMS = RENDER_DEBOUNCE_THRESHOLD_MS\n ) {\n }\n\n public dispose(): void {\n if (this._refreshTimeoutID) {\n clearTimeout(this._refreshTimeoutID);\n }\n }\n\n public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {\n this._rowCount = rowCount;\n // Get the min/max row start/end for the arg values\n rowStart = rowStart !== undefined ? rowStart : 0;\n rowEnd = rowEnd !== undefined ? rowEnd : this._rowCount - 1;\n // Set the properties to the updated values\n this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart;\n this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd;\n\n // Only refresh if the time since last refresh is above a threshold, otherwise wait for\n // enough time to pass before refreshing again.\n const refreshRequestTime: number = Date.now();\n if (refreshRequestTime - this._lastRefreshMs >= this._debounceThresholdMS) {\n // Enough time has lapsed since the last refresh; refresh immediately\n this._lastRefreshMs = refreshRequestTime;\n this._innerRefresh();\n } else if (!this._additionalRefreshRequested) {\n // This is the first additional request throttled; set up trailing refresh\n const elapsed = refreshRequestTime - this._lastRefreshMs;\n const waitPeriodBeforeTrailingRefresh = this._debounceThresholdMS - elapsed;\n this._additionalRefreshRequested = true;\n\n this._refreshTimeoutID = window.setTimeout(() => {\n this._lastRefreshMs = Date.now();\n this._innerRefresh();\n this._additionalRefreshRequested = false;\n this._refreshTimeoutID = undefined; // No longer need to clear the timeout\n }, waitPeriodBeforeTrailingRefresh);\n }\n }\n\n private _innerRefresh(): void {\n // Make sure values are set\n if (this._rowStart === undefined || this._rowEnd === undefined || this._rowCount === undefined) {\n return;\n }\n\n // Clamp values\n const start = Math.max(this._rowStart, 0);\n const end = Math.min(this._rowEnd, this._rowCount - 1);\n\n // Reset debouncer (this happens before render callback as the render could trigger it again)\n this._rowStart = undefined;\n this._rowEnd = undefined;\n\n // Run render callback\n this._renderCallback(start, end);\n }\n}\n\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable } from 'common/Lifecycle';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IColorSet, IViewport } from 'browser/Types';\nimport { ICharSizeService, IRenderService } from 'browser/services/Services';\nimport { IBufferService, IOptionsService } from 'common/services/Services';\nimport { IBuffer } from 'common/buffer/Types';\nimport { IRenderDimensions } from 'browser/renderer/Types';\n\nconst FALLBACK_SCROLL_BAR_WIDTH = 15;\n\n/**\n * Represents the viewport of a terminal, the visible area within the larger buffer of output.\n * Logic for the virtual scroll bar is included in this object.\n */\nexport class Viewport extends Disposable implements IViewport {\n public scrollBarWidth: number = 0;\n private _currentRowHeight: number = 0;\n private _currentScaledCellHeight: number = 0;\n private _lastRecordedBufferLength: number = 0;\n private _lastRecordedViewportHeight: number = 0;\n private _lastRecordedBufferHeight: number = 0;\n private _lastTouchY: number = 0;\n private _lastScrollTop: number = 0;\n private _activeBuffer: IBuffer;\n private _renderDimensions: IRenderDimensions;\n\n // Stores a partial line amount when scrolling, this is used to keep track of how much of a line\n // is scrolled so we can \"scroll\" over partial lines and feel natural on touchpads. This is a\n // quick fix and could have a more robust solution in place that reset the value when needed.\n private _wheelPartialScroll: number = 0;\n\n private _refreshAnimationFrame: number | null = null;\n private _ignoreNextScrollEvent: boolean = false;\n\n constructor(\n private readonly _scrollLines: (amount: number) => void,\n private readonly _viewportElement: HTMLElement,\n private readonly _scrollArea: HTMLElement,\n private readonly _element: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n super();\n\n // Measure the width of the scrollbar. If it is 0 we can assume it's an OSX overlay scrollbar.\n // Unfortunately the overlay scrollbar would be hidden underneath the screen element in that case,\n // therefore we account for a standard amount to make it visible\n this.scrollBarWidth = (this._viewportElement.offsetWidth - this._scrollArea.offsetWidth) || FALLBACK_SCROLL_BAR_WIDTH;\n this.register(addDisposableDomListener(this._viewportElement, 'scroll', this._onScroll.bind(this)));\n\n // Track properties used in performance critical code manually to avoid using slow getters\n this._activeBuffer = this._bufferService.buffer;\n this.register(this._bufferService.buffers.onBufferActivate(e => this._activeBuffer = e.activeBuffer));\n this._renderDimensions = this._renderService.dimensions;\n this.register(this._renderService.onDimensionsChange(e => this._renderDimensions = e));\n\n // Perform this async to ensure the ICharSizeService is ready.\n setTimeout(() => this.syncScrollArea(), 0);\n }\n\n public onThemeChange(colors: IColorSet): void {\n this._viewportElement.style.backgroundColor = colors.background.css;\n }\n\n /**\n * Refreshes row height, setting line-height, viewport height and scroll area height if\n * necessary.\n */\n private _refresh(immediate: boolean): void {\n if (immediate) {\n this._innerRefresh();\n if (this._refreshAnimationFrame !== null) {\n cancelAnimationFrame(this._refreshAnimationFrame);\n }\n return;\n }\n if (this._refreshAnimationFrame === null) {\n this._refreshAnimationFrame = requestAnimationFrame(() => this._innerRefresh());\n }\n }\n\n private _innerRefresh(): void {\n if (this._charSizeService.height > 0) {\n this._currentRowHeight = this._renderService.dimensions.scaledCellHeight / window.devicePixelRatio;\n this._currentScaledCellHeight = this._renderService.dimensions.scaledCellHeight;\n this._lastRecordedViewportHeight = this._viewportElement.offsetHeight;\n const newBufferHeight = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._renderService.dimensions.canvasHeight);\n if (this._lastRecordedBufferHeight !== newBufferHeight) {\n this._lastRecordedBufferHeight = newBufferHeight;\n this._scrollArea.style.height = this._lastRecordedBufferHeight + 'px';\n }\n }\n\n // Sync scrollTop\n const scrollTop = this._bufferService.buffer.ydisp * this._currentRowHeight;\n if (this._viewportElement.scrollTop !== scrollTop) {\n // Ignore the next scroll event which will be triggered by setting the scrollTop as we do not\n // want this event to scroll the terminal\n this._ignoreNextScrollEvent = true;\n this._viewportElement.scrollTop = scrollTop;\n }\n\n this._refreshAnimationFrame = null;\n }\n\n /**\n * Updates dimensions and synchronizes the scroll area if necessary.\n */\n public syncScrollArea(immediate: boolean = false): void {\n // If buffer height changed\n if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length) {\n this._lastRecordedBufferLength = this._bufferService.buffer.lines.length;\n this._refresh(immediate);\n return;\n }\n\n // If viewport height changed\n if (this._lastRecordedViewportHeight !== this._renderService.dimensions.canvasHeight) {\n this._refresh(immediate);\n return;\n }\n\n // If the buffer position doesn't match last scroll top\n if (this._lastScrollTop !== this._activeBuffer.ydisp * this._currentRowHeight) {\n this._refresh(immediate);\n return;\n }\n\n // If row height changed\n if (this._renderDimensions.scaledCellHeight !== this._currentScaledCellHeight) {\n this._refresh(immediate);\n return;\n }\n }\n\n /**\n * Handles scroll events on the viewport, calculating the new viewport and requesting the\n * terminal to scroll to it.\n * @param ev The scroll event.\n */\n private _onScroll(ev: Event): void {\n // Record current scroll top position\n this._lastScrollTop = this._viewportElement.scrollTop;\n\n // Don't attempt to scroll if the element is not visible, otherwise scrollTop will be corrupt\n // which causes the terminal to scroll the buffer to the top\n if (!this._viewportElement.offsetParent) {\n return;\n }\n\n // Ignore the event if it was flagged to ignore (when the source of the event is from Viewport)\n if (this._ignoreNextScrollEvent) {\n this._ignoreNextScrollEvent = false;\n // Still trigger the scroll so lines get refreshed\n this._scrollLines(0);\n return;\n }\n\n const newRow = Math.round(this._lastScrollTop / this._currentRowHeight);\n const diff = newRow - this._bufferService.buffer.ydisp;\n this._scrollLines(diff);\n }\n\n /**\n * Handles bubbling of scroll event in case the viewport has reached top or bottom\n * @param ev The scroll event.\n * @param amount The amount scrolled\n */\n private _bubbleScroll(ev: Event, amount: number): boolean {\n const scrollPosFromTop = this._viewportElement.scrollTop + this._lastRecordedViewportHeight;\n if ((amount < 0 && this._viewportElement.scrollTop !== 0) ||\n (amount > 0 && scrollPosFromTop < this._lastRecordedBufferHeight)) {\n if (ev.cancelable) {\n ev.preventDefault();\n }\n return false;\n }\n return true;\n }\n\n /**\n * Handles mouse wheel events by adjusting the viewport's scrollTop and delegating the actual\n * scrolling to `onScroll`, this event needs to be attached manually by the consumer of\n * `Viewport`.\n * @param ev The mouse wheel event.\n */\n public onWheel(ev: WheelEvent): boolean {\n const amount = this._getPixelsScrolled(ev);\n if (amount === 0) {\n return false;\n }\n this._viewportElement.scrollTop += amount;\n return this._bubbleScroll(ev, amount);\n }\n\n private _getPixelsScrolled(ev: WheelEvent): number {\n // Do nothing if it's not a vertical scroll event\n if (ev.deltaY === 0 || ev.shiftKey) {\n return 0;\n }\n\n // Fallback to WheelEvent.DOM_DELTA_PIXEL\n let amount = this._applyScrollModifier(ev.deltaY, ev);\n if (ev.deltaMode === WheelEvent.DOM_DELTA_LINE) {\n amount *= this._currentRowHeight;\n } else if (ev.deltaMode === WheelEvent.DOM_DELTA_PAGE) {\n amount *= this._currentRowHeight * this._bufferService.rows;\n }\n return amount;\n }\n\n /**\n * Gets the number of pixels scrolled by the mouse event taking into account what type of delta\n * is being used.\n * @param ev The mouse wheel event.\n */\n public getLinesScrolled(ev: WheelEvent): number {\n // Do nothing if it's not a vertical scroll event\n if (ev.deltaY === 0 || ev.shiftKey) {\n return 0;\n }\n\n // Fallback to WheelEvent.DOM_DELTA_LINE\n let amount = this._applyScrollModifier(ev.deltaY, ev);\n if (ev.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n amount /= this._currentRowHeight + 0.0; // Prevent integer division\n this._wheelPartialScroll += amount;\n amount = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1);\n this._wheelPartialScroll %= 1;\n } else if (ev.deltaMode === WheelEvent.DOM_DELTA_PAGE) {\n amount *= this._bufferService.rows;\n }\n return amount;\n }\n\n private _applyScrollModifier(amount: number, ev: WheelEvent): number {\n const modifier = this._optionsService.rawOptions.fastScrollModifier;\n // Multiply the scroll speed when the modifier is down\n if ((modifier === 'alt' && ev.altKey) ||\n (modifier === 'ctrl' && ev.ctrlKey) ||\n (modifier === 'shift' && ev.shiftKey)) {\n return amount * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity;\n }\n\n return amount * this._optionsService.rawOptions.scrollSensitivity;\n }\n\n /**\n * Handles the touchstart event, recording the touch occurred.\n * @param ev The touch event.\n */\n public onTouchStart(ev: TouchEvent): void {\n this._lastTouchY = ev.touches[0].pageY;\n }\n\n /**\n * Handles the touchmove event, scrolling the viewport if the position shifted.\n * @param ev The touch event.\n */\n public onTouchMove(ev: TouchEvent): boolean {\n const deltaY = this._lastTouchY - ev.touches[0].pageY;\n this._lastTouchY = ev.touches[0].pageY;\n if (deltaY === 0) {\n return false;\n }\n this._viewportElement.scrollTop += deltaY;\n return this._bubbleScroll(ev, deltaY);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IRenderService } from 'browser/services/Services';\nimport { Disposable } from 'common/Lifecycle';\nimport { IBufferService, IDecorationService, IInternalDecoration } from 'common/services/Services';\n\nexport class BufferDecorationRenderer extends Disposable {\n private readonly _container: HTMLElement;\n private readonly _decorationElements: Map = new Map();\n\n private _animationFrame: number | undefined;\n private _altBufferIsActive: boolean = false;\n private _dimensionsChanged: boolean = false;\n\n constructor(\n private readonly _screenElement: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IDecorationService private readonly _decorationService: IDecorationService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n super();\n\n this._container = document.createElement('div');\n this._container.classList.add('xterm-decoration-container');\n this._screenElement.appendChild(this._container);\n\n this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh()));\n this.register(this._renderService.onDimensionsChange(() => {\n this._dimensionsChanged = true;\n this._queueRefresh();\n }));\n this.register(addDisposableDomListener(window, 'resize', () => this._queueRefresh()));\n this.register(this._bufferService.buffers.onBufferActivate(() => {\n this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt;\n }));\n this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh()));\n this.register(this._decorationService.onDecorationRemoved(decoration => this._removeDecoration(decoration)));\n }\n\n public override dispose(): void {\n this._container.remove();\n this._decorationElements.clear();\n super.dispose();\n }\n\n private _queueRefresh(): void {\n if (this._animationFrame !== undefined) {\n return;\n }\n this._animationFrame = this._renderService.addRefreshCallback(() => {\n this.refreshDecorations();\n this._animationFrame = undefined;\n });\n }\n\n public refreshDecorations(): void {\n for (const decoration of this._decorationService.decorations) {\n this._renderDecoration(decoration);\n }\n this._dimensionsChanged = false;\n }\n\n private _renderDecoration(decoration: IInternalDecoration): void {\n this._refreshStyle(decoration);\n if (this._dimensionsChanged) {\n this._refreshXPosition(decoration);\n }\n }\n\n private _createElement(decoration: IInternalDecoration): HTMLElement {\n const element = document.createElement('div');\n element.classList.add('xterm-decoration');\n element.style.width = `${Math.round((decoration.options.width || 1) * this._renderService.dimensions.actualCellWidth)}px`;\n element.style.height = `${(decoration.options.height || 1) * this._renderService.dimensions.actualCellHeight}px`;\n element.style.top = `${(decoration.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.actualCellHeight}px`;\n element.style.lineHeight = `${this._renderService.dimensions.actualCellHeight}px`;\n\n const x = decoration.options.x ?? 0;\n if (x && x > this._bufferService.cols) {\n // exceeded the container width, so hide\n element.style.display = 'none';\n }\n this._refreshXPosition(decoration, element);\n\n return element;\n }\n\n private _refreshStyle(decoration: IInternalDecoration): void {\n const line = decoration.marker.line - this._bufferService.buffers.active.ydisp;\n if (line < 0 || line >= this._bufferService.rows) {\n // outside of viewport\n if (decoration.element) {\n decoration.element.style.display = 'none';\n decoration.onRenderEmitter.fire(decoration.element);\n }\n } else {\n let element = this._decorationElements.get(decoration);\n if (!element) {\n decoration.onDispose(() => this._removeDecoration(decoration));\n element = this._createElement(decoration);\n decoration.element = element;\n this._decorationElements.set(decoration, element);\n this._container.appendChild(element);\n }\n element.style.top = `${line * this._renderService.dimensions.actualCellHeight}px`;\n element.style.display = this._altBufferIsActive ? 'none' : 'block';\n decoration.onRenderEmitter.fire(element);\n }\n }\n\n private _refreshXPosition(decoration: IInternalDecoration, element: HTMLElement | undefined = decoration.element): void {\n if (!element) {\n return;\n }\n const x = decoration.options.x ?? 0;\n if ((decoration.options.anchor || 'left') === 'right') {\n element.style.right = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : '';\n } else {\n element.style.left = x ? `${x * this._renderService.dimensions.actualCellWidth}px` : '';\n }\n }\n\n private _removeDecoration(decoration: IInternalDecoration): void {\n this._decorationElements.get(decoration)?.remove();\n this._decorationElements.delete(decoration);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IInternalDecoration } from 'common/services/Services';\n\nexport interface IColorZoneStore {\n readonly zones: IColorZone[];\n clear(): void;\n addDecoration(decoration: IInternalDecoration): void;\n /**\n * Sets the amount of padding in lines that will be added between zones, if new lines intersect\n * the padding they will be merged into the same zone.\n */\n setPadding(padding: { [position: string]: number }): void;\n}\n\nexport interface IColorZone {\n /** Color in a format supported by canvas' fillStyle. */\n color: string;\n position: 'full' | 'left' | 'center' | 'right' | undefined;\n startBufferLine: number;\n endBufferLine: number;\n}\n\ninterface IMinimalDecorationForColorZone {\n marker: Pick;\n options: Pick;\n}\n\nexport class ColorZoneStore implements IColorZoneStore {\n private _zones: IColorZone[] = [];\n\n // The zone pool is used to keep zone objects from being freed between clearing the color zone\n // store and fetching the zones. This helps reduce GC pressure since the color zones are\n // accumulated on potentially every scroll event.\n private _zonePool: IColorZone[] = [];\n private _zonePoolIndex = 0;\n\n private _linePadding: { [position: string]: number } = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n };\n\n public get zones(): IColorZone[] {\n // Trim the zone pool to free unused memory\n this._zonePool.length = Math.min(this._zonePool.length, this._zones.length);\n return this._zones;\n }\n\n public clear(): void {\n this._zones.length = 0;\n this._zonePoolIndex = 0;\n }\n\n public addDecoration(decoration: IMinimalDecorationForColorZone): void {\n if (!decoration.options.overviewRulerOptions) {\n return;\n }\n for (const z of this._zones) {\n if (z.color === decoration.options.overviewRulerOptions.color &&\n z.position === decoration.options.overviewRulerOptions.position) {\n if (this._lineIntersectsZone(z, decoration.marker.line)) {\n return;\n }\n if (this._lineAdjacentToZone(z, decoration.marker.line, decoration.options.overviewRulerOptions.position)) {\n this._addLineToZone(z, decoration.marker.line);\n return;\n }\n }\n }\n // Create using zone pool if possible\n if (this._zonePoolIndex < this._zonePool.length) {\n this._zonePool[this._zonePoolIndex].color = decoration.options.overviewRulerOptions.color;\n this._zonePool[this._zonePoolIndex].position = decoration.options.overviewRulerOptions.position;\n this._zonePool[this._zonePoolIndex].startBufferLine = decoration.marker.line;\n this._zonePool[this._zonePoolIndex].endBufferLine = decoration.marker.line;\n this._zones.push(this._zonePool[this._zonePoolIndex++]);\n return;\n }\n // Create\n this._zones.push({\n color: decoration.options.overviewRulerOptions.color,\n position: decoration.options.overviewRulerOptions.position,\n startBufferLine: decoration.marker.line,\n endBufferLine: decoration.marker.line\n });\n this._zonePool.push(this._zones[this._zones.length - 1]);\n this._zonePoolIndex++;\n }\n\n public setPadding(padding: { [position: string]: number }): void {\n this._linePadding = padding;\n }\n\n private _lineIntersectsZone(zone: IColorZone, line: number): boolean {\n return (\n line >= zone.startBufferLine &&\n line <= zone.endBufferLine\n );\n }\n\n private _lineAdjacentToZone(zone: IColorZone, line: number, position: IColorZone['position']): boolean {\n return (\n (line >= zone.startBufferLine - this._linePadding[position || 'full']) &&\n (line <= zone.endBufferLine + this._linePadding[position || 'full'])\n );\n }\n\n private _addLineToZone(zone: IColorZone, line: number): void {\n zone.startBufferLine = Math.min(zone.startBufferLine, line);\n zone.endBufferLine = Math.max(zone.endBufferLine, line);\n }\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ColorZoneStore, IColorZone, IColorZoneStore } from 'browser/decorations/ColorZoneStore';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IRenderService } from 'browser/services/Services';\nimport { Disposable } from 'common/Lifecycle';\nimport { IBufferService, IDecorationService, IInternalDecoration, IOptionsService } from 'common/services/Services';\n\n// Helper objects to avoid excessive calculation and garbage collection during rendering. These are\n// static values for each render and can be accessed using the decoration position as the key.\nconst drawHeight = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\nconst drawWidth = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\nconst drawX = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\n\nexport class OverviewRulerRenderer extends Disposable {\n private readonly _canvas: HTMLCanvasElement;\n private readonly _ctx: CanvasRenderingContext2D;\n private readonly _colorZoneStore: IColorZoneStore = new ColorZoneStore();\n private get _width(): number {\n return this._optionsService.options.overviewRulerWidth || 0;\n }\n private _animationFrame: number | undefined;\n\n private _shouldUpdateDimensions: boolean | undefined = true;\n private _shouldUpdateAnchor: boolean | undefined = true;\n private _lastKnownBufferLength: number = 0;\n\n private _containerHeight: number | undefined;\n\n constructor(\n private readonly _viewportElement: HTMLElement,\n private readonly _screenElement: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IDecorationService private readonly _decorationService: IDecorationService,\n @IRenderService private readonly _renderService: IRenderService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n this._canvas = document.createElement('canvas');\n this._canvas.classList.add('xterm-decoration-overview-ruler');\n this._refreshCanvasDimensions();\n this._viewportElement.parentElement?.insertBefore(this._canvas, this._viewportElement);\n const ctx = this._canvas.getContext('2d');\n if (!ctx) {\n throw new Error('Ctx cannot be null');\n } else {\n this._ctx = ctx;\n }\n this._registerDecorationListeners();\n this._registerBufferChangeListeners();\n this._registerDimensionChangeListeners();\n }\n\n /**\n * On decoration add or remove, redraw\n */\n private _registerDecorationListeners(): void {\n this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(undefined, true)));\n this.register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(undefined, true)));\n }\n\n /**\n * On buffer change, redraw\n * and hide the canvas if the alt buffer is active\n */\n private _registerBufferChangeListeners(): void {\n this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh()));\n this.register(this._bufferService.buffers.onBufferActivate(() => {\n this._canvas!.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? 'none' : 'block';\n }));\n this.register(this._bufferService.onScroll(() => {\n if (this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length) {\n this._refreshDrawHeightConstants();\n this._refreshColorZonePadding();\n }\n }));\n }\n /**\n * On dimension change, update canvas dimensions\n * and then redraw\n */\n private _registerDimensionChangeListeners(): void {\n // container height changed\n this.register(this._renderService.onRender((): void => {\n if (!this._containerHeight || this._containerHeight !== this._screenElement.clientHeight) {\n this._queueRefresh(true);\n this._containerHeight = this._screenElement.clientHeight;\n }\n }));\n // overview ruler width changed\n this.register(this._optionsService.onOptionChange(o => {\n if (o === 'overviewRulerWidth') {\n this._queueRefresh(true);\n }\n }));\n // device pixel ratio changed\n this.register(addDisposableDomListener(window, 'resize', () => {\n this._queueRefresh(true);\n }));\n // set the canvas dimensions\n this._queueRefresh(true);\n }\n\n public override dispose(): void {\n this._canvas?.remove();\n super.dispose();\n }\n\n private _refreshDrawConstants(): void {\n // width\n const outerWidth = Math.floor(this._canvas.width / 3);\n const innerWidth = Math.ceil(this._canvas.width / 3);\n drawWidth.full = this._canvas.width;\n drawWidth.left = outerWidth;\n drawWidth.center = innerWidth;\n drawWidth.right = outerWidth;\n // height\n this._refreshDrawHeightConstants();\n // x\n drawX.full = 0;\n drawX.left = 0;\n drawX.center = drawWidth.left;\n drawX.right = drawWidth.left + drawWidth.center;\n }\n\n private _refreshDrawHeightConstants(): void {\n drawHeight.full = Math.round(2 * window.devicePixelRatio);\n // Calculate actual pixels per line\n const pixelsPerLine = this._canvas.height / this._bufferService.buffer.lines.length;\n // Clamp actual pixels within a range\n const nonFullHeight = Math.round(Math.max(Math.min(pixelsPerLine, 12), 6) * window.devicePixelRatio);\n drawHeight.left = nonFullHeight;\n drawHeight.center = nonFullHeight;\n drawHeight.right = nonFullHeight;\n }\n\n private _refreshColorZonePadding(): void {\n this._colorZoneStore.setPadding({\n full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.full),\n left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.left),\n center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.center),\n right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.right)\n });\n this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length;\n }\n\n private _refreshCanvasDimensions(): void {\n this._canvas.style.width = `${this._width}px`;\n this._canvas.width = Math.round(this._width * window.devicePixelRatio);\n this._canvas.style.height = `${this._screenElement.clientHeight}px`;\n this._canvas.height = Math.round(this._screenElement.clientHeight * window.devicePixelRatio);\n this._refreshDrawConstants();\n this._refreshColorZonePadding();\n }\n\n private _refreshDecorations(): void {\n if (this._shouldUpdateDimensions) {\n this._refreshCanvasDimensions();\n }\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n this._colorZoneStore.clear();\n for (const decoration of this._decorationService.decorations) {\n this._colorZoneStore.addDecoration(decoration);\n }\n this._ctx.lineWidth = 1;\n const zones = this._colorZoneStore.zones;\n for (const zone of zones) {\n if (zone.position !== 'full') {\n this._renderColorZone(zone);\n }\n }\n for (const zone of zones) {\n if (zone.position === 'full') {\n this._renderColorZone(zone);\n }\n }\n this._shouldUpdateDimensions = false;\n this._shouldUpdateAnchor = false;\n }\n\n private _renderColorZone(zone: IColorZone): void {\n // TODO: Is _decorationElements needed?\n\n this._ctx.fillStyle = zone.color;\n this._ctx.fillRect(\n /* x */ drawX[zone.position || 'full'],\n /* y */ Math.round(\n (this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line\n (zone.startBufferLine / this._bufferService.buffers.active.lines.length) - drawHeight[zone.position || 'full'] / 2\n ),\n /* w */ drawWidth[zone.position || 'full'],\n /* h */ Math.round(\n (this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line\n ((zone.endBufferLine - zone.startBufferLine) / this._bufferService.buffers.active.lines.length) + drawHeight[zone.position || 'full']\n )\n );\n }\n\n private _queueRefresh(updateCanvasDimensions?: boolean, updateAnchor?: boolean): void {\n this._shouldUpdateDimensions = updateCanvasDimensions || this._shouldUpdateDimensions;\n this._shouldUpdateAnchor = updateAnchor || this._shouldUpdateAnchor;\n if (this._animationFrame !== undefined) {\n return;\n }\n this._animationFrame = window.requestAnimationFrame(() => {\n this._refreshDecorations();\n this._animationFrame = undefined;\n });\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderService } from 'browser/services/Services';\nimport { IBufferService, ICoreService, IOptionsService } from 'common/services/Services';\n\ninterface IPosition {\n start: number;\n end: number;\n}\n\n/**\n * Encapsulates the logic for handling compositionstart, compositionupdate and compositionend\n * events, displaying the in-progress composition to the UI and forwarding the final composition\n * to the handler.\n */\nexport class CompositionHelper {\n /**\n * Whether input composition is currently happening, eg. via a mobile keyboard, speech input or\n * IME. This variable determines whether the compositionText should be displayed on the UI.\n */\n private _isComposing: boolean;\n public get isComposing(): boolean { return this._isComposing; }\n\n /**\n * The position within the input textarea's value of the current composition.\n */\n private _compositionPosition: IPosition;\n\n /**\n * Whether a composition is in the process of being sent, setting this to false will cancel any\n * in-progress composition.\n */\n private _isSendingComposition: boolean;\n\n /**\n * Data already sent due to keydown event.\n */\n private _dataAlreadySent: string;\n\n constructor(\n private readonly _textarea: HTMLTextAreaElement,\n private readonly _compositionView: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICoreService private readonly _coreService: ICoreService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n this._isComposing = false;\n this._isSendingComposition = false;\n this._compositionPosition = { start: 0, end: 0 };\n this._dataAlreadySent = '';\n }\n\n /**\n * Handles the compositionstart event, activating the composition view.\n */\n public compositionstart(): void {\n this._isComposing = true;\n this._compositionPosition.start = this._textarea.value.length;\n this._compositionView.textContent = '';\n this._dataAlreadySent = '';\n this._compositionView.classList.add('active');\n }\n\n /**\n * Handles the compositionupdate event, updating the composition view.\n * @param ev The event.\n */\n public compositionupdate(ev: Pick): void {\n this._compositionView.textContent = ev.data;\n this.updateCompositionElements();\n setTimeout(() => {\n this._compositionPosition.end = this._textarea.value.length;\n }, 0);\n }\n\n /**\n * Handles the compositionend event, hiding the composition view and sending the composition to\n * the handler.\n */\n public compositionend(): void {\n this._finalizeComposition(true);\n }\n\n /**\n * Handles the keydown event, routing any necessary events to the CompositionHelper functions.\n * @param ev The keydown event.\n * @return Whether the Terminal should continue processing the keydown event.\n */\n public keydown(ev: KeyboardEvent): boolean {\n if (this._isComposing || this._isSendingComposition) {\n if (ev.keyCode === 229) {\n // Continue composing if the keyCode is the \"composition character\"\n return false;\n }\n if (ev.keyCode === 16 || ev.keyCode === 17 || ev.keyCode === 18) {\n // Continue composing if the keyCode is a modifier key\n return false;\n }\n // Finish composition immediately. This is mainly here for the case where enter is\n // pressed and the handler needs to be triggered before the command is executed.\n this._finalizeComposition(false);\n }\n\n if (ev.keyCode === 229) {\n // If the \"composition character\" is used but gets to this point it means a non-composition\n // character (eg. numbers and punctuation) was pressed when the IME was active.\n this._handleAnyTextareaChanges();\n return false;\n }\n\n return true;\n }\n\n /**\n * Finalizes the composition, resuming regular input actions. This is called when a composition\n * is ending.\n * @param waitForPropagation Whether to wait for events to propagate before sending\n * the input. This should be false if a non-composition keystroke is entered before the\n * compositionend event is triggered, such as enter, so that the composition is sent before\n * the command is executed.\n */\n private _finalizeComposition(waitForPropagation: boolean): void {\n this._compositionView.classList.remove('active');\n this._isComposing = false;\n\n if (!waitForPropagation) {\n // Cancel any delayed composition send requests and send the input immediately.\n this._isSendingComposition = false;\n const input = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end);\n this._coreService.triggerDataEvent(input, true);\n } else {\n // Make a deep copy of the composition position here as a new compositionstart event may\n // fire before the setTimeout executes.\n const currentCompositionPosition = {\n start: this._compositionPosition.start,\n end: this._compositionPosition.end\n };\n\n // Since composition* events happen before the changes take place in the textarea on most\n // browsers, use a setTimeout with 0ms time to allow the native compositionend event to\n // complete. This ensures the correct character is retrieved.\n // This solution was used because:\n // - The compositionend event's data property is unreliable, at least on Chromium\n // - The last compositionupdate event's data property does not always accurately describe\n // the character, a counter example being Korean where an ending consonsant can move to\n // the following character if the following input is a vowel.\n this._isSendingComposition = true;\n setTimeout(() => {\n // Ensure that the input has not already been sent\n if (this._isSendingComposition) {\n this._isSendingComposition = false;\n let input;\n // Add length of data already sent due to keydown event,\n // otherwise input characters can be duplicated. (Issue #3191)\n currentCompositionPosition.start += this._dataAlreadySent.length;\n if (this._isComposing) {\n // Use the end position to get the string if a new composition has started.\n input = this._textarea.value.substring(currentCompositionPosition.start, currentCompositionPosition.end);\n } else {\n // Don't use the end position here in order to pick up any characters after the\n // composition has finished, for example when typing a non-composition character\n // (eg. 2) after a composition character.\n input = this._textarea.value.substring(currentCompositionPosition.start);\n }\n if (input.length > 0) {\n this._coreService.triggerDataEvent(input, true);\n }\n }\n }, 0);\n }\n }\n\n /**\n * Apply any changes made to the textarea after the current event chain is allowed to complete.\n * This should be called when not currently composing but a keydown event with the \"composition\n * character\" (229) is triggered, in order to allow non-composition text to be entered when an\n * IME is active.\n */\n private _handleAnyTextareaChanges(): void {\n const oldValue = this._textarea.value;\n setTimeout(() => {\n // Ignore if a composition has started since the timeout\n if (!this._isComposing) {\n const newValue = this._textarea.value;\n const diff = newValue.replace(oldValue, '');\n if (diff.length > 0) {\n this._dataAlreadySent = diff;\n this._coreService.triggerDataEvent(diff, true);\n }\n }\n }, 0);\n }\n\n /**\n * Positions the composition view on top of the cursor and the textarea just below it (so the\n * IME helper dialog is positioned correctly).\n * @param dontRecurse Whether to use setTimeout to recursively trigger another update, this is\n * necessary as the IME events across browsers are not consistently triggered.\n */\n public updateCompositionElements(dontRecurse?: boolean): void {\n if (!this._isComposing) {\n return;\n }\n\n if (this._bufferService.buffer.isCursorInViewport) {\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n\n const cellHeight = this._renderService.dimensions.actualCellHeight;\n const cursorTop = this._bufferService.buffer.y * this._renderService.dimensions.actualCellHeight;\n const cursorLeft = cursorX * this._renderService.dimensions.actualCellWidth;\n\n this._compositionView.style.left = cursorLeft + 'px';\n this._compositionView.style.top = cursorTop + 'px';\n this._compositionView.style.height = cellHeight + 'px';\n this._compositionView.style.lineHeight = cellHeight + 'px';\n this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily;\n this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + 'px';\n // Sync the textarea to the exact position of the composition view so the IME knows where the\n // text is.\n const compositionViewBounds = this._compositionView.getBoundingClientRect();\n this._textarea.style.left = cursorLeft + 'px';\n this._textarea.style.top = cursorTop + 'px';\n // Ensure the text area is at least 1x1, otherwise certain IMEs may break\n this._textarea.style.width = Math.max(compositionViewBounds.width, 1) + 'px';\n this._textarea.style.height = Math.max(compositionViewBounds.height, 1) + 'px';\n this._textarea.style.lineHeight = compositionViewBounds.height + 'px';\n }\n\n if (!dontRecurse) {\n setTimeout(() => this.updateCompositionElements(true), 0);\n }\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function getCoordsRelativeToElement(window: Pick, event: {clientX: number, clientY: number}, element: HTMLElement): [number, number] {\n const rect = element.getBoundingClientRect();\n const elementStyle = window.getComputedStyle(element);\n const leftPadding = parseInt(elementStyle.getPropertyValue('padding-left'));\n const topPadding = parseInt(elementStyle.getPropertyValue('padding-top'));\n return [\n event.clientX - rect.left - leftPadding,\n event.clientY - rect.top - topPadding\n ];\n}\n\n/**\n * Gets coordinates within the terminal for a particular mouse event. The result\n * is returned as an array in the form [x, y] instead of an object as it's a\n * little faster and this function is used in some low level code.\n * @param event The mouse event.\n * @param element The terminal's container element.\n * @param colCount The number of columns in the terminal.\n * @param rowCount The number of rows n the terminal.\n * @param isSelection Whether the request is for the selection or not. This will\n * apply an offset to the x value such that the left half of the cell will\n * select that cell and the right half will select the next cell.\n */\nexport function getCoords(window: Pick, event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, hasValidCharSize: boolean, actualCellWidth: number, actualCellHeight: number, isSelection?: boolean): [number, number] | undefined {\n // Coordinates cannot be measured if there are no valid\n if (!hasValidCharSize) {\n return undefined;\n }\n\n const coords = getCoordsRelativeToElement(window, event, element);\n if (!coords) {\n return undefined;\n }\n\n coords[0] = Math.ceil((coords[0] + (isSelection ? actualCellWidth / 2 : 0)) / actualCellWidth);\n coords[1] = Math.ceil(coords[1] / actualCellHeight);\n\n // Ensure coordinates are within the terminal viewport. Note that selections\n // need an addition point of precision to cover the end point (as characters\n // cover half of one char and half of the next).\n coords[0] = Math.min(Math.max(coords[0], 1), colCount + (isSelection ? 1 : 0));\n coords[1] = Math.min(Math.max(coords[1], 1), rowCount);\n\n return coords;\n}\n\n/**\n * Gets coordinates within the terminal for a particular mouse event, wrapping\n * them to the bounds of the terminal and adding 32 to both the x and y values\n * as expected by xterm.\n */\nexport function getRawByteCoords(coords: [number, number] | undefined): { x: number, y: number } | undefined {\n if (!coords) {\n return undefined;\n }\n\n // xterm sends raw bytes and starts at 32 (SP) for each.\n return { x: coords[0] + 32, y: coords[1] + 32 };\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { C0 } from 'common/data/EscapeSequences';\nimport { IBufferService } from 'common/services/Services';\n\nconst enum Direction {\n UP = 'A',\n DOWN = 'B',\n RIGHT = 'C',\n LEFT = 'D'\n}\n\n/**\n * Concatenates all the arrow sequences together.\n * Resets the starting row to an unwrapped row, moves to the requested row,\n * then moves to requested col.\n */\nexport function moveToCellSequence(targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n const startX = bufferService.buffer.x;\n const startY = bufferService.buffer.y;\n\n // The alt buffer should try to navigate between rows\n if (!bufferService.buffer.hasScrollback) {\n return resetStartingRow(startX, startY, targetX, targetY, bufferService, applicationCursor) +\n moveToRequestedRow(startY, targetY, bufferService, applicationCursor) +\n moveToRequestedCol(startX, startY, targetX, targetY, bufferService, applicationCursor);\n }\n\n // Only move horizontally for the normal buffer\n let direction;\n if (startY === targetY) {\n direction = startX > targetX ? Direction.LEFT : Direction.RIGHT;\n return repeat(Math.abs(startX - targetX), sequence(direction, applicationCursor));\n }\n direction = startY > targetY ? Direction.LEFT : Direction.RIGHT;\n const rowDifference = Math.abs(startY - targetY);\n const cellsToMove = colsFromRowEnd(startY > targetY ? targetX : startX, bufferService) +\n (rowDifference - 1) * bufferService.cols + 1 /* wrap around 1 row */ +\n colsFromRowBeginning(startY > targetY ? startX : targetX, bufferService);\n return repeat(cellsToMove, sequence(direction, applicationCursor));\n}\n\n/**\n * Find the number of cols from a row beginning to a col.\n */\nfunction colsFromRowBeginning(currX: number, bufferService: IBufferService): number {\n return currX - 1;\n}\n\n/**\n * Find the number of cols from a col to row end.\n */\nfunction colsFromRowEnd(currX: number, bufferService: IBufferService): number {\n return bufferService.cols - currX;\n}\n\n/**\n * If the initial position of the cursor is on a row that is wrapped, move the\n * cursor up to the first row that is not wrapped to have accurate vertical\n * positioning.\n */\nfunction resetStartingRow(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length === 0) {\n return '';\n }\n return repeat(bufferLine(\n startX, startY, startX,\n startY - wrappedRowsForRow(bufferService, startY), false, bufferService\n ).length, sequence(Direction.LEFT, applicationCursor));\n}\n\n/**\n * Using the reset starting and ending row, move to the requested row,\n * ignoring wrapped rows\n */\nfunction moveToRequestedRow(startY: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n const startRow = startY - wrappedRowsForRow(bufferService, startY);\n const endRow = targetY - wrappedRowsForRow(bufferService, targetY);\n\n const rowsToMove = Math.abs(startRow - endRow) - wrappedRowsCount(startY, targetY, bufferService);\n\n return repeat(rowsToMove, sequence(verticalDirection(startY, targetY), applicationCursor));\n}\n\n/**\n * Move to the requested col on the ending row\n */\nfunction moveToRequestedCol(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n let startRow;\n if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length > 0) {\n startRow = targetY - wrappedRowsForRow(bufferService, targetY);\n } else {\n startRow = startY;\n }\n\n const endRow = targetY;\n const direction = horizontalDirection(startX, startY, targetX, targetY, bufferService, applicationCursor);\n\n return repeat(bufferLine(\n startX, startRow, targetX, endRow,\n direction === Direction.RIGHT, bufferService\n ).length, sequence(direction, applicationCursor));\n}\n\n/**\n * Utility functions\n */\n\n/**\n * Calculates the number of wrapped rows between the unwrapped starting and\n * ending rows. These rows need to ignored since the cursor skips over them.\n */\nfunction wrappedRowsCount(startY: number, targetY: number, bufferService: IBufferService): number {\n let wrappedRows = 0;\n const startRow = startY - wrappedRowsForRow(bufferService, startY);\n const endRow = targetY - wrappedRowsForRow(bufferService, targetY);\n\n for (let i = 0; i < Math.abs(startRow - endRow); i++) {\n const direction = verticalDirection(startY, targetY) === Direction.UP ? -1 : 1;\n const line = bufferService.buffer.lines.get(startRow + (direction * i));\n if (line?.isWrapped) {\n wrappedRows++;\n }\n }\n\n return wrappedRows;\n}\n\n/**\n * Calculates the number of wrapped rows that make up a given row.\n * @param currentRow The row to determine how many wrapped rows make it up\n */\nfunction wrappedRowsForRow(bufferService: IBufferService, currentRow: number): number {\n let rowCount = 0;\n let line = bufferService.buffer.lines.get(currentRow);\n let lineWraps = line?.isWrapped;\n\n while (lineWraps && currentRow >= 0 && currentRow < bufferService.rows) {\n rowCount++;\n line = bufferService.buffer.lines.get(--currentRow);\n lineWraps = line?.isWrapped;\n }\n\n return rowCount;\n}\n\n/**\n * Direction determiners\n */\n\n/**\n * Determines if the right or left arrow is needed\n */\nfunction horizontalDirection(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): Direction {\n let startRow;\n if (moveToRequestedRow(targetX, targetY, bufferService, applicationCursor).length > 0) {\n startRow = targetY - wrappedRowsForRow(bufferService, targetY);\n } else {\n startRow = startY;\n }\n\n if ((startX < targetX &&\n startRow <= targetY) || // down/right or same y/right\n (startX >= targetX &&\n startRow < targetY)) { // down/left or same y/left\n return Direction.RIGHT;\n }\n return Direction.LEFT;\n}\n\n/**\n * Determines if the up or down arrow is needed\n */\nfunction verticalDirection(startY: number, targetY: number): Direction {\n return startY > targetY ? Direction.UP : Direction.DOWN;\n}\n\n/**\n * Constructs the string of chars in the buffer from a starting row and col\n * to an ending row and col\n * @param startCol The starting column position\n * @param startRow The starting row position\n * @param endCol The ending column position\n * @param endRow The ending row position\n * @param forward Direction to move\n */\nfunction bufferLine(\n startCol: number,\n startRow: number,\n endCol: number,\n endRow: number,\n forward: boolean,\n bufferService: IBufferService\n): string {\n let currentCol = startCol;\n let currentRow = startRow;\n let bufferStr = '';\n\n while (currentCol !== endCol || currentRow !== endRow) {\n currentCol += forward ? 1 : -1;\n\n if (forward && currentCol > bufferService.cols - 1) {\n bufferStr += bufferService.buffer.translateBufferLineToString(\n currentRow, false, startCol, currentCol\n );\n currentCol = 0;\n startCol = 0;\n currentRow++;\n } else if (!forward && currentCol < 0) {\n bufferStr += bufferService.buffer.translateBufferLineToString(\n currentRow, false, 0, startCol + 1\n );\n currentCol = bufferService.cols - 1;\n startCol = currentCol;\n currentRow--;\n }\n }\n\n return bufferStr + bufferService.buffer.translateBufferLineToString(\n currentRow, false, startCol, currentCol\n );\n}\n\n/**\n * Constructs the escape sequence for clicking an arrow\n * @param direction The direction to move\n */\nfunction sequence(direction: Direction, applicationCursor: boolean): string {\n const mod = applicationCursor ? 'O' : '[';\n return C0.ESC + mod + direction;\n}\n\n/**\n * Returns a string repeated a given number of times\n * Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\n * @param count The number of times to repeat the string\n * @param string The string that is to be repeated\n */\nfunction repeat(count: number, str: string): string {\n count = Math.floor(count);\n let rpt = '';\n for (let i = 0; i < count; i++) {\n rpt += str;\n }\n return rpt;\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Terminal as ITerminalApi, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBufferNamespace as IBufferNamespaceApi, IParser, ILinkProvider, IUnicodeHandling, FontWeight, IModes, IDecorationOptions, IDecoration } from 'xterm';\nimport { ITerminal } from 'browser/Types';\nimport { Terminal as TerminalCore } from 'browser/Terminal';\nimport * as Strings from 'browser/LocalizableStrings';\nimport { IEvent } from 'common/EventEmitter';\nimport { ParserApi } from 'common/public/ParserApi';\nimport { UnicodeApi } from 'common/public/UnicodeApi';\nimport { AddonManager } from 'common/public/AddonManager';\nimport { BufferNamespaceApi } from 'common/public/BufferNamespaceApi';\nimport { ITerminalOptions } from 'common/Types';\n\n/**\n * The set of options that only have an effect when set in the Terminal constructor.\n */\nconst CONSTRUCTOR_ONLY_OPTIONS = ['cols', 'rows'];\n\nexport class Terminal implements ITerminalApi {\n private _core: ITerminal;\n private _addonManager: AddonManager;\n private _parser: IParser | undefined;\n private _buffer: BufferNamespaceApi | undefined;\n private _publicOptions: ITerminalOptions;\n\n constructor(options?: ITerminalOptions) {\n this._core = new TerminalCore(options);\n this._addonManager = new AddonManager();\n\n this._publicOptions = { ... this._core.options };\n const getter = (propName: string): any => {\n return this._core.options[propName];\n };\n const setter = (propName: string, value: any): void => {\n this._checkReadonlyOptions(propName);\n this._core.options[propName] = value;\n };\n\n for (const propName in this._core.options) {\n const desc = {\n get: getter.bind(this, propName),\n set: setter.bind(this, propName)\n };\n Object.defineProperty(this._publicOptions, propName, desc);\n }\n }\n\n private _checkReadonlyOptions(propName: string): void {\n // Throw an error if any constructor only option is modified\n // from terminal.options\n // Modifications from anywhere else are allowed\n if (CONSTRUCTOR_ONLY_OPTIONS.includes(propName)) {\n throw new Error(`Option \"${propName}\" can only be set in the constructor`);\n }\n }\n\n private _checkProposedApi(): void {\n if (!this._core.optionsService.rawOptions.allowProposedApi) {\n throw new Error('You must set the allowProposedApi option to true to use proposed API');\n }\n }\n\n public get onBell(): IEvent { return this._core.onBell; }\n public get onBinary(): IEvent { return this._core.onBinary; }\n public get onCursorMove(): IEvent { return this._core.onCursorMove; }\n public get onData(): IEvent { return this._core.onData; }\n public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._core.onKey; }\n public get onLineFeed(): IEvent { return this._core.onLineFeed; }\n public get onRender(): IEvent<{ start: number, end: number }> { return this._core.onRender; }\n public get onResize(): IEvent<{ cols: number, rows: number }> { return this._core.onResize; }\n public get onScroll(): IEvent { return this._core.onScroll; }\n public get onSelectionChange(): IEvent { return this._core.onSelectionChange; }\n public get onTitleChange(): IEvent { return this._core.onTitleChange; }\n public get onWriteParsed(): IEvent { return this._core.onWriteParsed; }\n\n public get element(): HTMLElement | undefined { return this._core.element; }\n public get parser(): IParser {\n this._checkProposedApi();\n if (!this._parser) {\n this._parser = new ParserApi(this._core);\n }\n return this._parser;\n }\n public get unicode(): IUnicodeHandling {\n this._checkProposedApi();\n return new UnicodeApi(this._core);\n }\n public get textarea(): HTMLTextAreaElement | undefined { return this._core.textarea; }\n public get rows(): number { return this._core.rows; }\n public get cols(): number { return this._core.cols; }\n public get buffer(): IBufferNamespaceApi {\n this._checkProposedApi();\n if (!this._buffer) {\n this._buffer = new BufferNamespaceApi(this._core);\n }\n return this._buffer;\n }\n public get markers(): ReadonlyArray {\n this._checkProposedApi();\n return this._core.markers;\n }\n public get modes(): IModes {\n const m = this._core.coreService.decPrivateModes;\n let mouseTrackingMode: 'none' | 'x10' | 'vt200' | 'drag' | 'any' = 'none';\n switch (this._core.coreMouseService.activeProtocol) {\n case 'X10': mouseTrackingMode = 'x10'; break;\n case 'VT200': mouseTrackingMode = 'vt200'; break;\n case 'DRAG': mouseTrackingMode = 'drag'; break;\n case 'ANY': mouseTrackingMode = 'any'; break;\n }\n return {\n applicationCursorKeysMode: m.applicationCursorKeys,\n applicationKeypadMode: m.applicationKeypad,\n bracketedPasteMode: m.bracketedPasteMode,\n insertMode: this._core.coreService.modes.insertMode,\n mouseTrackingMode: mouseTrackingMode,\n originMode: m.origin,\n reverseWraparoundMode: m.reverseWraparound,\n sendFocusMode: m.sendFocus,\n wraparoundMode: m.wraparound\n };\n }\n public get options(): ITerminalOptions {\n return this._publicOptions;\n }\n public set options(options: ITerminalOptions) {\n for (const propName in options) {\n this._publicOptions[propName] = options[propName];\n }\n }\n public blur(): void {\n this._core.blur();\n }\n public focus(): void {\n this._core.focus();\n }\n public resize(columns: number, rows: number): void {\n this._verifyIntegers(columns, rows);\n this._core.resize(columns, rows);\n }\n public open(parent: HTMLElement): void {\n this._core.open(parent);\n }\n public attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void {\n this._core.attachCustomKeyEventHandler(customKeyEventHandler);\n }\n public registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): number {\n this._checkProposedApi();\n return this._core.registerLinkMatcher(regex, handler, options);\n }\n public deregisterLinkMatcher(matcherId: number): void {\n this._checkProposedApi();\n this._core.deregisterLinkMatcher(matcherId);\n }\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n this._checkProposedApi();\n return this._core.registerLinkProvider(linkProvider);\n }\n public registerCharacterJoiner(handler: (text: string) => [number, number][]): number {\n this._checkProposedApi();\n return this._core.registerCharacterJoiner(handler);\n }\n public deregisterCharacterJoiner(joinerId: number): void {\n this._checkProposedApi();\n this._core.deregisterCharacterJoiner(joinerId);\n }\n public registerMarker(cursorYOffset: number = 0): IMarker | undefined {\n this._checkProposedApi();\n this._verifyIntegers(cursorYOffset);\n return this._core.addMarker(cursorYOffset);\n }\n public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined {\n this._checkProposedApi();\n this._verifyPositiveIntegers(decorationOptions.x ?? 0, decorationOptions.width ?? 0, decorationOptions.height ?? 0);\n return this._core.registerDecoration(decorationOptions);\n }\n public addMarker(cursorYOffset: number): IMarker | undefined {\n return this.registerMarker(cursorYOffset);\n }\n public hasSelection(): boolean {\n return this._core.hasSelection();\n }\n public select(column: number, row: number, length: number): void {\n this._verifyIntegers(column, row, length);\n this._core.select(column, row, length);\n }\n public getSelection(): string {\n return this._core.getSelection();\n }\n public getSelectionPosition(): ISelectionPosition | undefined {\n return this._core.getSelectionPosition();\n }\n public clearSelection(): void {\n this._core.clearSelection();\n }\n public selectAll(): void {\n this._core.selectAll();\n }\n public selectLines(start: number, end: number): void {\n this._verifyIntegers(start, end);\n this._core.selectLines(start, end);\n }\n public dispose(): void {\n this._addonManager.dispose();\n this._core.dispose();\n }\n public scrollLines(amount: number): void {\n this._verifyIntegers(amount);\n this._core.scrollLines(amount);\n }\n public scrollPages(pageCount: number): void {\n this._verifyIntegers(pageCount);\n this._core.scrollPages(pageCount);\n }\n public scrollToTop(): void {\n this._core.scrollToTop();\n }\n public scrollToBottom(): void {\n this._core.scrollToBottom();\n }\n public scrollToLine(line: number): void {\n this._verifyIntegers(line);\n this._core.scrollToLine(line);\n }\n public clear(): void {\n this._core.clear();\n }\n public write(data: string | Uint8Array, callback?: () => void): void {\n this._core.write(data, callback);\n }\n public writeUtf8(data: Uint8Array, callback?: () => void): void {\n this._core.write(data, callback);\n }\n public writeln(data: string | Uint8Array, callback?: () => void): void {\n this._core.write(data);\n this._core.write('\\r\\n', callback);\n }\n public paste(data: string): void {\n this._core.paste(data);\n }\n public getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string;\n public getOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell'): boolean;\n public getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number;\n public getOption(key: 'fontWeight' | 'fontWeightBold'): FontWeight;\n public getOption(key: string): any;\n public getOption(key: any): any {\n return this._core.optionsService.getOption(key);\n }\n public setOption(key: 'bellSound' | 'fontFamily' | 'termName' | 'wordSeparator', value: string): void;\n public setOption(key: 'fontWeight' | 'fontWeightBold', value: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number): void;\n public setOption(key: 'logLevel', value: 'debug' | 'info' | 'warn' | 'error' | 'off'): void;\n public setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void;\n public setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void;\n public setOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell', value: boolean): void;\n public setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void;\n public setOption(key: 'theme', value: ITheme): void;\n public setOption(key: 'cols' | 'rows', value: number): void;\n public setOption(key: string, value: any): void;\n public setOption(key: any, value: any): void {\n this._checkReadonlyOptions(key);\n this._core.optionsService.setOption(key, value);\n }\n public refresh(start: number, end: number): void {\n this._verifyIntegers(start, end);\n this._core.refresh(start, end);\n }\n public reset(): void {\n this._core.reset();\n }\n public clearTextureAtlas(): void {\n this._core.clearTextureAtlas();\n }\n public loadAddon(addon: ITerminalAddon): void {\n return this._addonManager.loadAddon(this, addon);\n }\n public static get strings(): ILocalizableStrings {\n return Strings;\n }\n\n private _verifyIntegers(...values: number[]): void {\n for (const value of values) {\n if (value === Infinity || isNaN(value) || value % 1 !== 0) {\n throw new Error('This API only accepts integers');\n }\n }\n }\n\n private _verifyPositiveIntegers(...values: number[]): void {\n for (const value of values) {\n if (value && (value === Infinity || isNaN(value) || value % 1 !== 0 || value < 0)) {\n throw new Error('This API only accepts positive integers');\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions, IRenderLayer } from 'browser/renderer/Types';\nimport { ICellData, IColor } from 'common/Types';\nimport { DEFAULT_COLOR, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_CODE, Attributes } from 'common/buffer/Constants';\nimport { IGlyphIdentifier } from 'browser/renderer/atlas/Types';\nimport { DIM_OPACITY, INVERTED_DEFAULT_COLOR, TEXT_BASELINE } from 'browser/renderer/atlas/Constants';\nimport { BaseCharAtlas } from 'browser/renderer/atlas/BaseCharAtlas';\nimport { acquireCharAtlas } from 'browser/renderer/atlas/CharAtlasCache';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { IColorSet } from 'browser/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { excludeFromContrastRatioDemands, throwIfFalsy } from 'browser/renderer/RendererUtils';\nimport { channels, color, rgba } from 'common/Color';\nimport { removeElementFromParent } from 'browser/Dom';\nimport { tryDrawCustomChar } from 'browser/renderer/CustomGlyphs';\n\nexport abstract class BaseRenderLayer implements IRenderLayer {\n private _canvas: HTMLCanvasElement;\n protected _ctx!: CanvasRenderingContext2D;\n private _scaledCharWidth: number = 0;\n private _scaledCharHeight: number = 0;\n private _scaledCellWidth: number = 0;\n private _scaledCellHeight: number = 0;\n private _scaledCharLeft: number = 0;\n private _scaledCharTop: number = 0;\n\n private _selectionStart: [number, number] | undefined;\n private _selectionEnd: [number, number] | undefined;\n private _columnSelectMode: boolean = false;\n\n protected _charAtlas: BaseCharAtlas | undefined;\n\n /**\n * An object that's reused when drawing glyphs in order to reduce GC.\n */\n private _currentGlyphIdentifier: IGlyphIdentifier = {\n chars: '',\n code: 0,\n bg: 0,\n fg: 0,\n bold: false,\n dim: false,\n italic: false\n };\n\n constructor(\n private _container: HTMLElement,\n id: string,\n zIndex: number,\n private _alpha: boolean,\n protected _colors: IColorSet,\n private _rendererId: number,\n protected readonly _bufferService: IBufferService,\n protected readonly _optionsService: IOptionsService,\n protected readonly _decorationService: IDecorationService\n ) {\n this._canvas = document.createElement('canvas');\n this._canvas.classList.add(`xterm-${id}-layer`);\n this._canvas.style.zIndex = zIndex.toString();\n this._initCanvas();\n this._container.appendChild(this._canvas);\n }\n\n public dispose(): void {\n removeElementFromParent(this._canvas);\n this._charAtlas?.dispose();\n }\n\n private _initCanvas(): void {\n this._ctx = throwIfFalsy(this._canvas.getContext('2d', { alpha: this._alpha }));\n // Draw the background if this is an opaque layer\n if (!this._alpha) {\n this._clearAll();\n }\n }\n\n public onOptionsChanged(): void {}\n public onBlur(): void {}\n public onFocus(): void {}\n public onCursorMove(): void {}\n public onGridChanged(startRow: number, endRow: number): void {}\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {\n this._selectionStart = start;\n this._selectionEnd = end;\n this._columnSelectMode = columnSelectMode;\n }\n\n public setColors(colorSet: IColorSet): void {\n this._refreshCharAtlas(colorSet);\n }\n\n protected _setTransparency(alpha: boolean): void {\n // Do nothing when alpha doesn't change\n if (alpha === this._alpha) {\n return;\n }\n\n // Create new canvas and replace old one\n const oldCanvas = this._canvas;\n this._alpha = alpha;\n // Cloning preserves properties\n this._canvas = this._canvas.cloneNode() as HTMLCanvasElement;\n this._initCanvas();\n this._container.replaceChild(this._canvas, oldCanvas);\n\n // Regenerate char atlas and force a full redraw\n this._refreshCharAtlas(this._colors);\n this.onGridChanged(0, this._bufferService.rows - 1);\n }\n\n /**\n * Refreshes the char atlas, aquiring a new one if necessary.\n * @param colorSet The color set to use for the char atlas.\n */\n private _refreshCharAtlas(colorSet: IColorSet): void {\n if (this._scaledCharWidth <= 0 && this._scaledCharHeight <= 0) {\n return;\n }\n this._charAtlas = acquireCharAtlas(this._optionsService.rawOptions, this._rendererId, colorSet, this._scaledCharWidth, this._scaledCharHeight);\n this._charAtlas.warmUp();\n }\n\n public resize(dim: IRenderDimensions): void {\n this._scaledCellWidth = dim.scaledCellWidth;\n this._scaledCellHeight = dim.scaledCellHeight;\n this._scaledCharWidth = dim.scaledCharWidth;\n this._scaledCharHeight = dim.scaledCharHeight;\n this._scaledCharLeft = dim.scaledCharLeft;\n this._scaledCharTop = dim.scaledCharTop;\n this._canvas.width = dim.scaledCanvasWidth;\n this._canvas.height = dim.scaledCanvasHeight;\n this._canvas.style.width = `${dim.canvasWidth}px`;\n this._canvas.style.height = `${dim.canvasHeight}px`;\n\n // Draw the background if this is an opaque layer\n if (!this._alpha) {\n this._clearAll();\n }\n\n this._refreshCharAtlas(this._colors);\n }\n\n public abstract reset(): void;\n\n public clearTextureAtlas(): void {\n this._charAtlas?.clear();\n }\n\n /**\n * Fills 1+ cells completely. This uses the existing fillStyle on the context.\n * @param x The column to start at.\n * @param y The row to start at\n * @param width The number of columns to fill.\n * @param height The number of rows to fill.\n */\n protected _fillCells(x: number, y: number, width: number, height: number): void {\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n y * this._scaledCellHeight,\n width * this._scaledCellWidth,\n height * this._scaledCellHeight);\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the middle of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillMiddleLineAtCells(x: number, y: number, width: number = 1): void {\n const cellOffset = Math.ceil(this._scaledCellHeight * 0.5);\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n (y + 1) * this._scaledCellHeight - cellOffset - window.devicePixelRatio,\n width * this._scaledCellWidth,\n window.devicePixelRatio);\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the bottom of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillBottomLineAtCells(x: number, y: number, width: number = 1): void {\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n (y + 1) * this._scaledCellHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */,\n width * this._scaledCellWidth,\n window.devicePixelRatio);\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the left of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillLeftLineAtCell(x: number, y: number, width: number): void {\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n y * this._scaledCellHeight,\n window.devicePixelRatio * width,\n this._scaledCellHeight);\n }\n\n /**\n * Strokes a 1px rectangle (2px on HDPI) around a cell. This uses the existing\n * strokeStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _strokeRectAtCell(x: number, y: number, width: number, height: number): void {\n this._ctx.lineWidth = window.devicePixelRatio;\n this._ctx.strokeRect(\n x * this._scaledCellWidth + window.devicePixelRatio / 2,\n y * this._scaledCellHeight + (window.devicePixelRatio / 2),\n width * this._scaledCellWidth - window.devicePixelRatio,\n (height * this._scaledCellHeight) - window.devicePixelRatio);\n }\n\n /**\n * Clears the entire canvas.\n */\n protected _clearAll(): void {\n if (this._alpha) {\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n } else {\n this._ctx.fillStyle = this._colors.background.css;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n }\n\n /**\n * Clears 1+ cells completely.\n * @param x The column to start at.\n * @param y The row to start at.\n * @param width The number of columns to clear.\n * @param height The number of rows to clear.\n */\n protected _clearCells(x: number, y: number, width: number, height: number): void {\n if (this._alpha) {\n this._ctx.clearRect(\n x * this._scaledCellWidth,\n y * this._scaledCellHeight,\n width * this._scaledCellWidth,\n height * this._scaledCellHeight);\n } else {\n this._ctx.fillStyle = this._colors.background.css;\n this._ctx.fillRect(\n x * this._scaledCellWidth,\n y * this._scaledCellHeight,\n width * this._scaledCellWidth,\n height * this._scaledCellHeight);\n }\n }\n\n /**\n * Draws a truecolor character at the cell. The character will be clipped to\n * ensure that it fits with the cell, including the cell to the right if it's\n * a wide character. This uses the existing fillStyle on the context.\n * @param cell The cell data for the character to draw.\n * @param x The column to draw at.\n * @param y The row to draw at.\n * @param color The color of the character.\n */\n protected _fillCharTrueColor(cell: CellData, x: number, y: number): void {\n this._ctx.font = this._getFont(false, false);\n this._ctx.textBaseline = TEXT_BASELINE;\n this._clipRow(y);\n\n // Draw custom characters if applicable\n let drawSuccess = false;\n if (this._optionsService.rawOptions.customGlyphs !== false) {\n drawSuccess = tryDrawCustomChar(this._ctx, cell.getChars(), x * this._scaledCellWidth, y * this._scaledCellHeight, this._scaledCellWidth, this._scaledCellHeight);\n }\n\n // Draw the character\n if (!drawSuccess) {\n this._ctx.fillText(\n cell.getChars(),\n x * this._scaledCellWidth + this._scaledCharLeft,\n y * this._scaledCellHeight + this._scaledCharTop + this._scaledCharHeight);\n }\n }\n\n /**\n * Draws one or more characters at a cell. If possible this will draw using\n * the character atlas to reduce draw time.\n * @param chars The character or characters.\n * @param code The character code.\n * @param width The width of the characters.\n * @param x The column to draw at.\n * @param y The row to draw at.\n * @param fg The foreground color, in the format stored within the attributes.\n * @param bg The background color, in the format stored within the attributes.\n * This is used to validate whether a cached image can be used.\n * @param bold Whether the text is bold.\n */\n protected _drawChars(cell: ICellData, x: number, y: number): void {\n const contrastColor = this._getContrastColor(cell, x, y);\n\n // skip cache right away if we draw in RGB\n // Note: to avoid bad runtime JoinedCellData will be skipped\n // in the cache handler itself (atlasDidDraw == false) and\n // fall through to uncached later down below\n if (contrastColor || cell.isFgRGB() || cell.isBgRGB()) {\n this._drawUncachedChars(cell, x, y, contrastColor);\n return;\n }\n\n let fg;\n let bg;\n if (cell.isInverse()) {\n fg = (cell.isBgDefault()) ? INVERTED_DEFAULT_COLOR : cell.getBgColor();\n bg = (cell.isFgDefault()) ? INVERTED_DEFAULT_COLOR : cell.getFgColor();\n } else {\n bg = (cell.isBgDefault()) ? DEFAULT_COLOR : cell.getBgColor();\n fg = (cell.isFgDefault()) ? DEFAULT_COLOR : cell.getFgColor();\n }\n\n const drawInBrightColor = this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && fg < 8;\n\n fg += drawInBrightColor ? 8 : 0;\n this._currentGlyphIdentifier.chars = cell.getChars() || WHITESPACE_CELL_CHAR;\n this._currentGlyphIdentifier.code = cell.getCode() || WHITESPACE_CELL_CODE;\n this._currentGlyphIdentifier.bg = bg;\n this._currentGlyphIdentifier.fg = fg;\n this._currentGlyphIdentifier.bold = !!cell.isBold();\n this._currentGlyphIdentifier.dim = !!cell.isDim();\n this._currentGlyphIdentifier.italic = !!cell.isItalic();\n\n // Don't try cache the glyph if it uses any decoration foreground/background override.\n let hasOverrides = false;\n for (const d of this._decorationService.getDecorationsAtCell(x, y)) {\n if (d.backgroundColorRGB || d.foregroundColorRGB) {\n hasOverrides = true;\n break;\n }\n }\n\n const atlasDidDraw = hasOverrides ? false : this._charAtlas?.draw(this._ctx, this._currentGlyphIdentifier, x * this._scaledCellWidth + this._scaledCharLeft, y * this._scaledCellHeight + this._scaledCharTop);\n\n if (!atlasDidDraw) {\n this._drawUncachedChars(cell, x, y);\n }\n }\n\n /**\n * Draws one or more characters at one or more cells. The character(s) will be\n * clipped to ensure that they fit with the cell(s), including the cell to the\n * right if the last character is a wide character.\n * @param chars The character.\n * @param width The width of the character.\n * @param fg The foreground color, in the format stored within the attributes.\n * @param x The column to draw at.\n * @param y The row to draw at.\n */\n private _drawUncachedChars(cell: ICellData, x: number, y: number, fgOverride?: IColor): void {\n this._ctx.save();\n this._ctx.font = this._getFont(!!cell.isBold(), !!cell.isItalic());\n this._ctx.textBaseline = TEXT_BASELINE;\n\n if (cell.isInverse()) {\n if (fgOverride) {\n this._ctx.fillStyle = fgOverride.css;\n } else if (cell.isBgDefault()) {\n this._ctx.fillStyle = color.opaque(this._colors.background).css;\n } else if (cell.isBgRGB()) {\n this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getBgColor()).join(',')})`;\n } else {\n let bg = cell.getBgColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && bg < 8) {\n bg += 8;\n }\n this._ctx.fillStyle = this._colors.ansi[bg].css;\n }\n } else {\n if (fgOverride) {\n this._ctx.fillStyle = fgOverride.css;\n } else if (cell.isFgDefault()) {\n this._ctx.fillStyle = this._colors.foreground.css;\n } else if (cell.isFgRGB()) {\n this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`;\n } else {\n let fg = cell.getFgColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && fg < 8) {\n fg += 8;\n }\n this._ctx.fillStyle = this._colors.ansi[fg].css;\n }\n }\n\n this._clipRow(y);\n\n // Apply alpha to dim the character\n if (cell.isDim()) {\n this._ctx.globalAlpha = DIM_OPACITY;\n }\n\n // Draw custom characters if applicable\n let drawSuccess = false;\n if (this._optionsService.rawOptions.customGlyphs !== false) {\n drawSuccess = tryDrawCustomChar(this._ctx, cell.getChars(), x * this._scaledCellWidth, y * this._scaledCellHeight, this._scaledCellWidth, this._scaledCellHeight);\n }\n\n // Draw the character\n if (!drawSuccess) {\n this._ctx.fillText(\n cell.getChars(),\n x * this._scaledCellWidth + this._scaledCharLeft,\n y * this._scaledCellHeight + this._scaledCharTop + this._scaledCharHeight);\n }\n\n this._ctx.restore();\n }\n\n\n /**\n * Clips a row to ensure no pixels will be drawn outside the cells in the row.\n * @param y The row to clip.\n */\n private _clipRow(y: number): void {\n this._ctx.beginPath();\n this._ctx.rect(\n 0,\n y * this._scaledCellHeight,\n this._bufferService.cols * this._scaledCellWidth,\n this._scaledCellHeight);\n this._ctx.clip();\n }\n\n /**\n * Gets the current font.\n * @param isBold If we should use the bold fontWeight.\n */\n protected _getFont(isBold: boolean, isItalic: boolean): string {\n const fontWeight = isBold ? this._optionsService.rawOptions.fontWeightBold : this._optionsService.rawOptions.fontWeight;\n const fontStyle = isItalic ? 'italic' : '';\n\n return `${fontStyle} ${fontWeight} ${this._optionsService.rawOptions.fontSize * window.devicePixelRatio}px ${this._optionsService.rawOptions.fontFamily}`;\n }\n\n private _getContrastColor(cell: CellData, x: number, y: number): IColor | undefined {\n // Get any decoration foreground/background overrides, this must be fetched before the early\n // exist but applied after inverse\n let bgOverride: number | undefined;\n let fgOverride: number | undefined;\n let isTop = false;\n for (const d of this._decorationService.getDecorationsAtCell(x, y)) {\n if (d.options.layer !== 'top' && isTop) {\n continue;\n }\n if (d.backgroundColorRGB) {\n bgOverride = d.backgroundColorRGB.rgba;\n }\n if (d.foregroundColorRGB) {\n fgOverride = d.foregroundColorRGB.rgba;\n }\n isTop = d.options.layer === 'top';\n }\n\n // Apply selection foreground if applicable\n if (!isTop) {\n if (this._colors.selectionForeground && this._isCellInSelection(x, y)) {\n fgOverride = this._colors.selectionForeground.rgba;\n }\n }\n\n if (!bgOverride && !fgOverride && (this._optionsService.rawOptions.minimumContrastRatio === 1 || excludeFromContrastRatioDemands(cell.getCode()))) {\n return undefined;\n }\n\n if (!bgOverride && !fgOverride) {\n // Try get from cache\n const adjustedColor = this._colors.contrastCache.getColor(cell.bg, cell.fg);\n if (adjustedColor !== undefined) {\n return adjustedColor || undefined;\n }\n }\n\n let fgColor = cell.getFgColor();\n let fgColorMode = cell.getFgColorMode();\n let bgColor = cell.getBgColor();\n let bgColorMode = cell.getBgColorMode();\n const isInverse = !!cell.isInverse();\n const isBold = !!cell.isInverse();\n if (isInverse) {\n const temp = fgColor;\n fgColor = bgColor;\n bgColor = temp;\n const temp2 = fgColorMode;\n fgColorMode = bgColorMode;\n bgColorMode = temp2;\n }\n\n const bgRgba = this._resolveBackgroundRgba(bgOverride !== undefined ? Attributes.CM_RGB : bgColorMode, bgOverride ?? bgColor, isInverse);\n const fgRgba = this._resolveForegroundRgba(fgColorMode, fgColor, isInverse, isBold);\n let result = rgba.ensureContrastRatio(bgOverride ?? bgRgba, fgOverride ?? fgRgba, this._optionsService.rawOptions.minimumContrastRatio);\n\n if (!result) {\n if (!fgOverride) {\n this._colors.contrastCache.setColor(cell.bg, cell.fg, null);\n return undefined;\n }\n // If it was an override and there was no contrast change, set as the result\n result = fgOverride;\n }\n\n const color: IColor = {\n css: channels.toCss(\n (result >> 24) & 0xFF,\n (result >> 16) & 0xFF,\n (result >> 8) & 0xFF\n ),\n rgba: result\n };\n if (!bgOverride && !fgOverride) {\n this._colors.contrastCache.setColor(cell.bg, cell.fg, color);\n }\n\n return color;\n }\n\n private _resolveBackgroundRgba(bgColorMode: number, bgColor: number, inverse: boolean): number {\n switch (bgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n return this._colors.ansi[bgColor].rgba;\n case Attributes.CM_RGB:\n return bgColor << 8;\n case Attributes.CM_DEFAULT:\n default:\n if (inverse) {\n return this._colors.foreground.rgba;\n }\n return this._colors.background.rgba;\n }\n }\n\n private _resolveForegroundRgba(fgColorMode: number, fgColor: number, inverse: boolean, bold: boolean): number {\n switch (fgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && bold && fgColor < 8) {\n fgColor += 8;\n }\n return this._colors.ansi[fgColor].rgba;\n case Attributes.CM_RGB:\n return fgColor << 8;\n case Attributes.CM_DEFAULT:\n default:\n if (inverse) {\n return this._colors.background.rgba;\n }\n return this._colors.foreground.rgba;\n }\n }\n\n private _isCellInSelection(x: number, y: number): boolean {\n const start = this._selectionStart;\n const end = this._selectionEnd;\n if (!start || !end) {\n return false;\n }\n if (this._columnSelectMode) {\n return x >= start[0] && y >= start[1] &&\n x < end[0] && y < end[1];\n }\n return (y > start[1] && y < end[1]) ||\n (start[1] === end[1] && y === start[1] && x >= start[0] && x < end[0]) ||\n (start[1] < end[1] && y === end[1] && x < end[0]) ||\n (start[1] < end[1] && y === start[1] && x >= start[0]);\n }\n}\n\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions, IRequestRedrawEvent } from 'browser/renderer/Types';\nimport { BaseRenderLayer } from 'browser/renderer/BaseRenderLayer';\nimport { ICellData } from 'common/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IColorSet } from 'browser/Types';\nimport { IBufferService, IOptionsService, ICoreService, IDecorationService } from 'common/services/Services';\nimport { IEventEmitter } from 'common/EventEmitter';\nimport { ICoreBrowserService } from 'browser/services/Services';\n\ninterface ICursorState {\n x: number;\n y: number;\n isFocused: boolean;\n style: string;\n width: number;\n}\n\n/**\n * The time between cursor blinks.\n */\nconst BLINK_INTERVAL = 600;\n\nexport class CursorRenderLayer extends BaseRenderLayer {\n private _state: ICursorState;\n private _cursorRenderers: {[key: string]: (x: number, y: number, cell: ICellData) => void};\n private _cursorBlinkStateManager: CursorBlinkStateManager | undefined;\n private _cell: ICellData = new CellData();\n\n constructor(\n container: HTMLElement,\n zIndex: number,\n colors: IColorSet,\n rendererId: number,\n private _onRequestRedraw: IEventEmitter,\n @IBufferService bufferService: IBufferService,\n @IOptionsService optionsService: IOptionsService,\n @ICoreService private readonly _coreService: ICoreService,\n @ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,\n @IDecorationService decorationService: IDecorationService\n ) {\n super(container, 'cursor', zIndex, true, colors, rendererId, bufferService, optionsService, decorationService);\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n this._cursorRenderers = {\n 'bar': this._renderBarCursor.bind(this),\n 'block': this._renderBlockCursor.bind(this),\n 'underline': this._renderUnderlineCursor.bind(this)\n };\n }\n\n public dispose(): void {\n if (this._cursorBlinkStateManager) {\n this._cursorBlinkStateManager.dispose();\n this._cursorBlinkStateManager = undefined;\n }\n super.dispose();\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n }\n\n public reset(): void {\n this._clearCursor();\n this._cursorBlinkStateManager?.restartBlinkAnimation();\n this.onOptionsChanged();\n }\n\n public onBlur(): void {\n this._cursorBlinkStateManager?.pause();\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n public onFocus(): void {\n this._cursorBlinkStateManager?.resume();\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n public onOptionsChanged(): void {\n if (this._optionsService.rawOptions.cursorBlink) {\n if (!this._cursorBlinkStateManager) {\n this._cursorBlinkStateManager = new CursorBlinkStateManager(this._coreBrowserService.isFocused, () => {\n this._render(true);\n });\n }\n } else {\n this._cursorBlinkStateManager?.dispose();\n this._cursorBlinkStateManager = undefined;\n }\n // Request a refresh from the terminal as management of rendering is being\n // moved back to the terminal\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n public onCursorMove(): void {\n this._cursorBlinkStateManager?.restartBlinkAnimation();\n }\n\n public onGridChanged(startRow: number, endRow: number): void {\n if (!this._cursorBlinkStateManager || this._cursorBlinkStateManager.isPaused) {\n this._render(false);\n } else {\n this._cursorBlinkStateManager.restartBlinkAnimation();\n }\n }\n\n private _render(triggeredByAnimationFrame: boolean): void {\n // Don't draw the cursor if it's hidden\n if (!this._coreService.isCursorInitialized || this._coreService.isCursorHidden) {\n this._clearCursor();\n return;\n }\n\n const cursorY = this._bufferService.buffer.ybase + this._bufferService.buffer.y;\n const viewportRelativeCursorY = cursorY - this._bufferService.buffer.ydisp;\n\n // Don't draw the cursor if it's off-screen\n if (viewportRelativeCursorY < 0 || viewportRelativeCursorY >= this._bufferService.rows) {\n this._clearCursor();\n return;\n }\n\n // in case cursor.x == cols adjust visual cursor to cols - 1\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n this._bufferService.buffer.lines.get(cursorY)!.loadCell(cursorX, this._cell);\n if (this._cell.content === undefined) {\n return;\n }\n\n if (!this._coreBrowserService.isFocused) {\n this._clearCursor();\n this._ctx.save();\n this._ctx.fillStyle = this._colors.cursor.css;\n const cursorStyle = this._optionsService.rawOptions.cursorStyle;\n if (cursorStyle && cursorStyle !== 'block') {\n this._cursorRenderers[cursorStyle](cursorX, viewportRelativeCursorY, this._cell);\n } else {\n this._renderBlurCursor(cursorX, viewportRelativeCursorY, this._cell);\n }\n this._ctx.restore();\n this._state.x = cursorX;\n this._state.y = viewportRelativeCursorY;\n this._state.isFocused = false;\n this._state.style = cursorStyle;\n this._state.width = this._cell.getWidth();\n return;\n }\n\n // Don't draw the cursor if it's blinking\n if (this._cursorBlinkStateManager && !this._cursorBlinkStateManager.isCursorVisible) {\n this._clearCursor();\n return;\n }\n\n if (this._state) {\n // The cursor is already in the correct spot, don't redraw\n if (this._state.x === cursorX &&\n this._state.y === viewportRelativeCursorY &&\n this._state.isFocused === this._coreBrowserService.isFocused &&\n this._state.style === this._optionsService.rawOptions.cursorStyle &&\n this._state.width === this._cell.getWidth()) {\n return;\n }\n this._clearCursor();\n }\n\n this._ctx.save();\n this._cursorRenderers[this._optionsService.rawOptions.cursorStyle || 'block'](cursorX, viewportRelativeCursorY, this._cell);\n this._ctx.restore();\n\n this._state.x = cursorX;\n this._state.y = viewportRelativeCursorY;\n this._state.isFocused = false;\n this._state.style = this._optionsService.rawOptions.cursorStyle;\n this._state.width = this._cell.getWidth();\n }\n\n private _clearCursor(): void {\n if (this._state) {\n // Avoid potential rounding errors when device pixel ratio is less than 1\n if (window.devicePixelRatio < 1) {\n this._clearAll();\n } else {\n this._clearCells(this._state.x, this._state.y, this._state.width, 1);\n }\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n }\n }\n\n private _renderBarCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._colors.cursor.css;\n this._fillLeftLineAtCell(x, y, this._optionsService.rawOptions.cursorWidth);\n this._ctx.restore();\n }\n\n private _renderBlockCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._colors.cursor.css;\n this._fillCells(x, y, cell.getWidth(), 1);\n this._ctx.fillStyle = this._colors.cursorAccent.css;\n this._fillCharTrueColor(cell, x, y);\n this._ctx.restore();\n }\n\n private _renderUnderlineCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._colors.cursor.css;\n this._fillBottomLineAtCells(x, y);\n this._ctx.restore();\n }\n\n private _renderBlurCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.strokeStyle = this._colors.cursor.css;\n this._strokeRectAtCell(x, y, cell.getWidth(), 1);\n this._ctx.restore();\n }\n}\n\nclass CursorBlinkStateManager {\n public isCursorVisible: boolean;\n\n private _animationFrame: number | undefined;\n private _blinkStartTimeout: number | undefined;\n private _blinkInterval: number | undefined;\n\n /**\n * The time at which the animation frame was restarted, this is used on the\n * next render to restart the timers so they don't need to restart the timers\n * multiple times over a short period.\n */\n private _animationTimeRestarted: number | undefined;\n\n constructor(\n isFocused: boolean,\n private _renderCallback: () => void\n ) {\n this.isCursorVisible = true;\n if (isFocused) {\n this._restartInterval();\n }\n }\n\n public get isPaused(): boolean { return !(this._blinkStartTimeout || this._blinkInterval); }\n\n public dispose(): void {\n if (this._blinkInterval) {\n window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n if (this._blinkStartTimeout) {\n window.clearTimeout(this._blinkStartTimeout);\n this._blinkStartTimeout = undefined;\n }\n if (this._animationFrame) {\n window.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public restartBlinkAnimation(): void {\n if (this.isPaused) {\n return;\n }\n // Save a timestamp so that the restart can be done on the next interval\n this._animationTimeRestarted = Date.now();\n // Force a cursor render to ensure it's visible and in the correct position\n this.isCursorVisible = true;\n if (!this._animationFrame) {\n this._animationFrame = window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n }\n }\n\n private _restartInterval(timeToStart: number = BLINK_INTERVAL): void {\n // Clear any existing interval\n if (this._blinkInterval) {\n window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n\n // Setup the initial timeout which will hide the cursor, this is done before\n // the regular interval is setup in order to support restarting the blink\n // animation in a lightweight way (without thrashing clearInterval and\n // setInterval).\n this._blinkStartTimeout = window.setTimeout(() => {\n // Check if another animation restart was requested while this was being\n // started\n if (this._animationTimeRestarted) {\n const time = BLINK_INTERVAL - (Date.now() - this._animationTimeRestarted);\n this._animationTimeRestarted = undefined;\n if (time > 0) {\n this._restartInterval(time);\n return;\n }\n }\n\n // Hide the cursor\n this.isCursorVisible = false;\n this._animationFrame = window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n\n // Setup the blink interval\n this._blinkInterval = window.setInterval(() => {\n // Adjust the animation time if it was restarted\n if (this._animationTimeRestarted) {\n // calc time diff\n // Make restart interval do a setTimeout initially?\n const time = BLINK_INTERVAL - (Date.now() - this._animationTimeRestarted);\n this._animationTimeRestarted = undefined;\n this._restartInterval(time);\n return;\n }\n\n // Invert visibility and render\n this.isCursorVisible = !this.isCursorVisible;\n this._animationFrame = window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n }, BLINK_INTERVAL);\n }, timeToStart);\n }\n\n public pause(): void {\n this.isCursorVisible = true;\n if (this._blinkInterval) {\n window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n if (this._blinkStartTimeout) {\n window.clearTimeout(this._blinkStartTimeout);\n this._blinkStartTimeout = undefined;\n }\n if (this._animationFrame) {\n window.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public resume(): void {\n // Clear out any existing timers just in case\n this.pause();\n\n this._animationTimeRestarted = undefined;\n this._restartInterval();\n this.restartBlinkAnimation();\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { throwIfFalsy } from 'browser/renderer/RendererUtils';\n\ninterface IBlockVector {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\nexport const blockElementDefinitions: { [index: string]: IBlockVector[] | undefined } = {\n // Block elements (0x2580-0x2590)\n '▀': [{ x: 0, y: 0, w: 8, h: 4 }], // UPPER HALF BLOCK\n '▁': [{ x: 0, y: 7, w: 8, h: 1 }], // LOWER ONE EIGHTH BLOCK\n '▂': [{ x: 0, y: 6, w: 8, h: 2 }], // LOWER ONE QUARTER BLOCK\n '▃': [{ x: 0, y: 5, w: 8, h: 3 }], // LOWER THREE EIGHTHS BLOCK\n '▄': [{ x: 0, y: 4, w: 8, h: 4 }], // LOWER HALF BLOCK\n '▅': [{ x: 0, y: 3, w: 8, h: 5 }], // LOWER FIVE EIGHTHS BLOCK\n '▆': [{ x: 0, y: 2, w: 8, h: 6 }], // LOWER THREE QUARTERS BLOCK\n '▇': [{ x: 0, y: 1, w: 8, h: 7 }], // LOWER SEVEN EIGHTHS BLOCK\n '█': [{ x: 0, y: 0, w: 8, h: 8 }], // FULL BLOCK\n '▉': [{ x: 0, y: 0, w: 7, h: 8 }], // LEFT SEVEN EIGHTHS BLOCK\n '▊': [{ x: 0, y: 0, w: 6, h: 8 }], // LEFT THREE QUARTERS BLOCK\n '▋': [{ x: 0, y: 0, w: 5, h: 8 }], // LEFT FIVE EIGHTHS BLOCK\n '▌': [{ x: 0, y: 0, w: 4, h: 8 }], // LEFT HALF BLOCK\n '▍': [{ x: 0, y: 0, w: 3, h: 8 }], // LEFT THREE EIGHTHS BLOCK\n '▎': [{ x: 0, y: 0, w: 2, h: 8 }], // LEFT ONE QUARTER BLOCK\n '▏': [{ x: 0, y: 0, w: 1, h: 8 }], // LEFT ONE EIGHTH BLOCK\n '▐': [{ x: 4, y: 0, w: 4, h: 8 }], // RIGHT HALF BLOCK\n\n // Block elements (0x2594-0x2595)\n '▔': [{ x: 0, y: 0, w: 9, h: 1 }], // UPPER ONE EIGHTH BLOCK\n '▕': [{ x: 7, y: 0, w: 1, h: 8 }], // RIGHT ONE EIGHTH BLOCK\n\n // Terminal graphic characters (0x2596-0x259F)\n '▖': [{ x: 0, y: 4, w: 4, h: 4 }], // QUADRANT LOWER LEFT\n '▗': [{ x: 4, y: 4, w: 4, h: 4 }], // QUADRANT LOWER RIGHT\n '▘': [{ x: 0, y: 0, w: 4, h: 4 }], // QUADRANT UPPER LEFT\n '▙': [{ x: 0, y: 0, w: 4, h: 8 }, { x: 0, y: 4, w: 8, h: 4 }], // QUADRANT UPPER LEFT AND LOWER LEFT AND LOWER RIGHT\n '▚': [{ x: 0, y: 0, w: 4, h: 4 }, { x: 4, y: 4, w: 4, h: 4 }], // QUADRANT UPPER LEFT AND LOWER RIGHT\n '▛': [{ x: 0, y: 0, w: 4, h: 8 }, { x: 0, y: 0, w: 4, h: 8 }], // QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER LEFT\n '▜': [{ x: 0, y: 0, w: 8, h: 4 }, { x: 4, y: 0, w: 4, h: 8 }], // QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER RIGHT\n '▝': [{ x: 4, y: 0, w: 4, h: 4 }], // QUADRANT UPPER RIGHT\n '▞': [{ x: 4, y: 0, w: 4, h: 4 }, { x: 0, y: 4, w: 4, h: 4 }], // QUADRANT UPPER RIGHT AND LOWER LEFT\n '▟': [{ x: 4, y: 0, w: 4, h: 8 }, { x: 0, y: 4, w: 8, h: 4 }], // QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT\n\n // VERTICAL ONE EIGHTH BLOCK-2 through VERTICAL ONE EIGHTH BLOCK-7\n '\\u{1FB70}': [{ x: 1, y: 0, w: 1, h: 8 }],\n '\\u{1FB71}': [{ x: 2, y: 0, w: 1, h: 8 }],\n '\\u{1FB72}': [{ x: 3, y: 0, w: 1, h: 8 }],\n '\\u{1FB73}': [{ x: 4, y: 0, w: 1, h: 8 }],\n '\\u{1FB74}': [{ x: 5, y: 0, w: 1, h: 8 }],\n '\\u{1FB75}': [{ x: 6, y: 0, w: 1, h: 8 }],\n\n // HORIZONTAL ONE EIGHTH BLOCK-2 through HORIZONTAL ONE EIGHTH BLOCK-7\n '\\u{1FB76}': [{ x: 0, y: 1, w: 8, h: 1 }],\n '\\u{1FB77}': [{ x: 0, y: 2, w: 8, h: 1 }],\n '\\u{1FB78}': [{ x: 0, y: 3, w: 8, h: 1 }],\n '\\u{1FB79}': [{ x: 0, y: 4, w: 8, h: 1 }],\n '\\u{1FB7A}': [{ x: 0, y: 5, w: 8, h: 1 }],\n '\\u{1FB7B}': [{ x: 0, y: 6, w: 8, h: 1 }],\n\n // LEFT AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB7C}': [{ x: 0, y: 0, w: 1, h: 8 }, { x: 0, y: 7, w: 8, h: 1 }],\n // LEFT AND UPPER ONE EIGHTH BLOCK\n '\\u{1FB7D}': [{ x: 0, y: 0, w: 1, h: 8 }, { x: 0, y: 0, w: 8, h: 1 }],\n // RIGHT AND UPPER ONE EIGHTH BLOCK\n '\\u{1FB7E}': [{ x: 7, y: 0, w: 1, h: 8 }, { x: 0, y: 0, w: 8, h: 1 }],\n // RIGHT AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB7F}': [{ x: 7, y: 0, w: 1, h: 8 }, { x: 0, y: 7, w: 8, h: 1 }],\n // UPPER AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB80}': [{ x: 0, y: 0, w: 8, h: 1 }, { x: 0, y: 7, w: 8, h: 1 }],\n // HORIZONTAL ONE EIGHTH BLOCK-1358\n '\\u{1FB81}': [{ x: 0, y: 0, w: 8, h: 1 }, { x: 0, y: 2, w: 8, h: 1 }, { x: 0, y: 4, w: 8, h: 1 }, { x: 0, y: 7, w: 8, h: 1 }],\n\n // UPPER ONE QUARTER BLOCK\n '\\u{1FB82}': [{ x: 0, y: 0, w: 8, h: 2 }],\n // UPPER THREE EIGHTHS BLOCK\n '\\u{1FB83}': [{ x: 0, y: 0, w: 8, h: 3 }],\n // UPPER FIVE EIGHTHS BLOCK\n '\\u{1FB84}': [{ x: 0, y: 0, w: 8, h: 5 }],\n // UPPER THREE QUARTERS BLOCK\n '\\u{1FB85}': [{ x: 0, y: 0, w: 8, h: 6 }],\n // UPPER SEVEN EIGHTHS BLOCK\n '\\u{1FB86}': [{ x: 0, y: 0, w: 8, h: 7 }],\n\n // RIGHT ONE QUARTER BLOCK\n '\\u{1FB87}': [{ x: 6, y: 0, w: 2, h: 8 }],\n // RIGHT THREE EIGHTHS B0OCK\n '\\u{1FB88}': [{ x: 5, y: 0, w: 3, h: 8 }],\n // RIGHT FIVE EIGHTHS BL0CK\n '\\u{1FB89}': [{ x: 3, y: 0, w: 5, h: 8 }],\n // RIGHT THREE QUARTERS 0LOCK\n '\\u{1FB8A}': [{ x: 2, y: 0, w: 6, h: 8 }],\n // RIGHT SEVEN EIGHTHS B0OCK\n '\\u{1FB8B}': [{ x: 1, y: 0, w: 7, h: 8 }],\n\n // CHECKER BOARD FILL\n '\\u{1FB95}': [\n { x: 0, y: 0, w: 2, h: 2 }, { x: 4, y: 0, w: 2, h: 2 },\n { x: 2, y: 2, w: 2, h: 2 }, { x: 6, y: 2, w: 2, h: 2 },\n { x: 0, y: 4, w: 2, h: 2 }, { x: 4, y: 4, w: 2, h: 2 },\n { x: 2, y: 6, w: 2, h: 2 }, { x: 6, y: 6, w: 2, h: 2 }\n ],\n // INVERSE CHECKER BOARD FILL\n '\\u{1FB96}': [\n { x: 2, y: 0, w: 2, h: 2 }, { x: 6, y: 0, w: 2, h: 2 },\n { x: 0, y: 2, w: 2, h: 2 }, { x: 4, y: 2, w: 2, h: 2 },\n { x: 2, y: 4, w: 2, h: 2 }, { x: 6, y: 4, w: 2, h: 2 },\n { x: 0, y: 6, w: 2, h: 2 }, { x: 4, y: 6, w: 2, h: 2 }\n ],\n // HEAVY HORIZONTAL FILL (upper middle and lower one quarter block)\n '\\u{1FB97}': [{ x: 0, y: 2, w: 8, h: 2 }, { x: 0, y: 6, w: 8, h: 2 }]\n};\n\ntype PatternDefinition = number[][];\n\n/**\n * Defines the repeating pattern used by special characters, the pattern is made up of a 2d array of\n * pixel values to be filled (1) or not filled (0).\n */\nconst patternCharacterDefinitions: { [key: string]: PatternDefinition | undefined } = {\n // Shade characters (0x2591-0x2593)\n '░': [ // LIGHT SHADE (25%)\n [1, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 0]\n ],\n '▒': [ // MEDIUM SHADE (50%)\n [1, 0],\n [0, 0],\n [0, 1],\n [0, 0]\n ],\n '▓': [ // DARK SHADE (75%)\n [0, 1],\n [1, 1],\n [1, 0],\n [1, 1]\n ]\n};\n\nconst enum Shapes {\n /** │ */ TOP_TO_BOTTOM = 'M.5,0 L.5,1',\n /** ─ */ LEFT_TO_RIGHT = 'M0,.5 L1,.5',\n\n /** └ */ TOP_TO_RIGHT = 'M.5,0 L.5,.5 L1,.5',\n /** ┘ */ TOP_TO_LEFT = 'M.5,0 L.5,.5 L0,.5',\n /** ┐ */ LEFT_TO_BOTTOM = 'M0,.5 L.5,.5 L.5,1',\n /** ┌ */ RIGHT_TO_BOTTOM = 'M0.5,1 L.5,.5 L1,.5',\n\n /** ╵ */ MIDDLE_TO_TOP = 'M.5,.5 L.5,0',\n /** ╴ */ MIDDLE_TO_LEFT = 'M.5,.5 L0,.5',\n /** ╶ */ MIDDLE_TO_RIGHT = 'M.5,.5 L1,.5',\n /** ╷ */ MIDDLE_TO_BOTTOM = 'M.5,.5 L.5,1',\n\n /** ┴ */ T_TOP = 'M0,.5 L1,.5 M.5,.5 L.5,0',\n /** ┤ */ T_LEFT = 'M.5,0 L.5,1 M.5,.5 L0,.5',\n /** ├ */ T_RIGHT = 'M.5,0 L.5,1 M.5,.5 L1,.5',\n /** ┬ */ T_BOTTOM = 'M0,.5 L1,.5 M.5,.5 L.5,1',\n\n /** ┼ */ CROSS = 'M0,.5 L1,.5 M.5,0 L.5,1',\n\n /** ╌ */ TWO_DASHES_HORIZONTAL = 'M.1,.5 L.4,.5 M.6,.5 L.9,.5', // .2 empty, .3 filled\n /** ┄ */ THREE_DASHES_HORIZONTAL = 'M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5', // .1333 empty, .2 filled\n /** ┉ */ FOUR_DASHES_HORIZONTAL = 'M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5', // .1 empty, .15 filled\n /** ╎ */ TWO_DASHES_VERTICAL = 'M.5,.1 L.5,.4 M.5,.6 L.5,.9',\n /** ┆ */ THREE_DASHES_VERTICAL = 'M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333',\n /** ┊ */ FOUR_DASHES_VERTICAL = 'M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95',\n}\n\nconst enum Style {\n NORMAL = 1,\n BOLD = 3\n}\n\n/**\n * This contains the definitions of all box drawing characters in the format of SVG paths (ie. the\n * svg d attribute).\n */\nexport const boxDrawingDefinitions: { [character: string]: { [fontWeight: number]: string | ((xp: number, yp: number) => string) } | undefined } = {\n // Uniform normal and bold\n '─': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT },\n '━': { [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '│': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM },\n '┃': { [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┌': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM },\n '┏': { [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┐': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM },\n '┓': { [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '└': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT },\n '┗': { [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┘': { [Style.NORMAL]: Shapes.TOP_TO_LEFT },\n '┛': { [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '├': { [Style.NORMAL]: Shapes.T_RIGHT },\n '┣': { [Style.BOLD]: Shapes.T_RIGHT },\n '┤': { [Style.NORMAL]: Shapes.T_LEFT },\n '┫': { [Style.BOLD]: Shapes.T_LEFT },\n '┬': { [Style.NORMAL]: Shapes.T_BOTTOM },\n '┳': { [Style.BOLD]: Shapes.T_BOTTOM },\n '┴': { [Style.NORMAL]: Shapes.T_TOP },\n '┻': { [Style.BOLD]: Shapes.T_TOP },\n '┼': { [Style.NORMAL]: Shapes.CROSS },\n '╋': { [Style.BOLD]: Shapes.CROSS },\n '╴': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT },\n '╸': { [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '╵': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP },\n '╹': { [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '╶': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT },\n '╺': { [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '╷': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM },\n '╻': { [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n\n // Double border\n '═': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '║': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╒': { [Style.NORMAL]: (xp, yp) => `M.5,1 L.5,${.5 - yp} L1,${.5 - yp} M.5,${.5 + yp} L1,${.5 + yp}` },\n '╓': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},1 L${.5 - xp},.5 L1,.5 M${.5 + xp},.5 L${.5 + xp},1` },\n '╔': { [Style.NORMAL]: (xp, yp) => `M1,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1` },\n '╕': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L.5,${.5 - yp} L.5,1 M0,${.5 + yp} L.5,${.5 + yp}` },\n '╖': { [Style.NORMAL]: (xp, yp) => `M${.5 + xp},1 L${.5 + xp},.5 L0,.5 M${.5 - xp},.5 L${.5 - xp},1` },\n '╗': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M0,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},1` },\n '╘': { [Style.NORMAL]: (xp, yp) => `M.5,0 L.5,${.5 + yp} L1,${.5 + yp} M.5,${.5 - yp} L1,${.5 - yp}` },\n '╙': { [Style.NORMAL]: (xp, yp) => `M1,.5 L${.5 - xp},.5 L${.5 - xp},0 M${.5 + xp},.5 L${.5 + xp},0` },\n '╚': { [Style.NORMAL]: (xp, yp) => `M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0 M1,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},0` },\n '╛': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L.5,${.5 + yp} L.5,0 M0,${.5 - yp} L.5,${.5 - yp}` },\n '╜': { [Style.NORMAL]: (xp, yp) => `M0,.5 L${.5 + xp},.5 L${.5 + xp},0 M${.5 - xp},.5 L${.5 - xp},0` },\n '╝': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M0,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},0` },\n '╞': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M.5,${.5 - yp} L1,${.5 - yp} M.5,${.5 + yp} L1,${.5 + yp}` },\n '╟': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1 M${.5 + xp},.5 L1,.5` },\n '╠': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n '╡': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M0,${.5 - yp} L.5,${.5 - yp} M0,${.5 + yp} L.5,${.5 + yp}` },\n '╢': { [Style.NORMAL]: (xp, yp) => `M0,.5 L${.5 - xp},.5 M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╣': { [Style.NORMAL]: (xp, yp) => `M${.5 + xp},0 L${.5 + xp},1 M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0` },\n '╤': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp} M.5,${.5 + yp} L.5,1` },\n '╥': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},.5 L${.5 - xp},1 M${.5 + xp},.5 L${.5 + xp},1` },\n '╦': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1` },\n '╧': { [Style.NORMAL]: (xp, yp) => `M.5,0 L.5,${.5 - yp} M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '╨': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},.5 L${.5 - xp},0 M${.5 + xp},.5 L${.5 + xp},0` },\n '╩': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L1,${.5 + yp} M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n '╪': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '╫': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╬': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1 M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n\n // Diagonal\n '╱': { [Style.NORMAL]: 'M1,0 L0,1' },\n '╲': { [Style.NORMAL]: 'M0,0 L1,1' },\n '╳': { [Style.NORMAL]: 'M1,0 L0,1 M0,0 L1,1' },\n\n // Mixed weight\n '╼': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '╽': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '╾': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '╿': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┍': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┎': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┑': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┒': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┕': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┖': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┙': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┚': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┝': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┞': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┟': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┠': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┡': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┢': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┥': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┦': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┧': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┨': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┩': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '┪': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '┭': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┮': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┯': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '┰': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┱': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '┲': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┵': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┶': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┷': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '┸': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┹': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '┺': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┽': { [Style.NORMAL]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_RIGHT}`, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┾': { [Style.NORMAL]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_LEFT}`, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┿': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '╀': { [Style.NORMAL]: `${Shapes.LEFT_TO_RIGHT} ${Shapes.MIDDLE_TO_BOTTOM}`, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '╁': { [Style.NORMAL]: `${Shapes.MIDDLE_TO_TOP} ${Shapes.LEFT_TO_RIGHT}`, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '╂': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '╃': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '╄': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '╅': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '╆': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '╇': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: `${Shapes.MIDDLE_TO_TOP} ${Shapes.LEFT_TO_RIGHT}` },\n '╈': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: `${Shapes.LEFT_TO_RIGHT} ${Shapes.MIDDLE_TO_BOTTOM}` },\n '╉': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_LEFT}` },\n '╊': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_RIGHT}` },\n\n // Dashed\n '╌': { [Style.NORMAL]: Shapes.TWO_DASHES_HORIZONTAL },\n '╍': { [Style.BOLD]: Shapes.TWO_DASHES_HORIZONTAL },\n '┄': { [Style.NORMAL]: Shapes.THREE_DASHES_HORIZONTAL },\n '┅': { [Style.BOLD]: Shapes.THREE_DASHES_HORIZONTAL },\n '┈': { [Style.NORMAL]: Shapes.FOUR_DASHES_HORIZONTAL },\n '┉': { [Style.BOLD]: Shapes.FOUR_DASHES_HORIZONTAL },\n '╎': { [Style.NORMAL]: Shapes.TWO_DASHES_VERTICAL },\n '╏': { [Style.BOLD]: Shapes.TWO_DASHES_VERTICAL },\n '┆': { [Style.NORMAL]: Shapes.THREE_DASHES_VERTICAL },\n '┇': { [Style.BOLD]: Shapes.THREE_DASHES_VERTICAL },\n '┊': { [Style.NORMAL]: Shapes.FOUR_DASHES_VERTICAL },\n '┋': { [Style.BOLD]: Shapes.FOUR_DASHES_VERTICAL },\n\n // Curved\n '╭': { [Style.NORMAL]: 'C.5,1,.5,.5,1,.5' },\n '╮': { [Style.NORMAL]: 'C.5,1,.5,.5,0,.5' },\n '╯': { [Style.NORMAL]: 'C.5,0,.5,.5,0,.5' },\n '╰': { [Style.NORMAL]: 'C.5,0,.5,.5,1,.5' }\n};\n\ninterface IVectorShape {\n d: string;\n type: VectorType;\n /** Padding to apply to the vector's x axis in CSS pixels. */\n horizontalPadding?: number;\n}\n\nconst enum VectorType {\n FILL,\n STROKE\n}\n\n/**\n * This contains the definitions of the primarily used box drawing characters as vector shapes. The\n * reason these characters are defined specially is to avoid common problems if a user's font has\n * not been patched with powerline characters and also to get pixel perfect rendering as rendering\n * issues can occur around AA/SPAA.\n *\n * Original symbols defined in https://github.com/powerline/fontpatcher\n */\nexport const powerlineDefinitions: { [index: string]: IVectorShape } = {\n // Right triangle solid\n '\\u{E0B0}': { d: 'M0,0 L1,.5 L0,1', type: VectorType.FILL },\n // Right triangle line\n '\\u{E0B1}': { d: 'M0,0 L1,.5 L0,1', type: VectorType.STROKE, horizontalPadding: 0.5 },\n // Left triangle solid\n '\\u{E0B2}': { d: 'M1,0 L0,.5 L1,1', type: VectorType.FILL },\n // Left triangle line\n '\\u{E0B3}': { d: 'M1,0 L0,.5 L1,1', type: VectorType.STROKE, horizontalPadding: 0.5 }\n};\n\n/**\n * Try drawing a custom block element or box drawing character, returning whether it was\n * successfully drawn.\n */\nexport function tryDrawCustomChar(\n ctx: CanvasRenderingContext2D,\n c: string,\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): boolean {\n const blockElementDefinition = blockElementDefinitions[c];\n if (blockElementDefinition) {\n drawBlockElementChar(ctx, blockElementDefinition, xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n return true;\n }\n\n const patternDefinition = patternCharacterDefinitions[c];\n if (patternDefinition) {\n drawPatternChar(ctx, patternDefinition, xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n return true;\n }\n\n const boxDrawingDefinition = boxDrawingDefinitions[c];\n if (boxDrawingDefinition) {\n drawBoxDrawingChar(ctx, boxDrawingDefinition, xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n return true;\n }\n\n const powerlineDefinition = powerlineDefinitions[c];\n if (powerlineDefinition) {\n drawPowerlineChar(ctx, powerlineDefinition, xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n return true;\n }\n\n return false;\n}\n\nfunction drawBlockElementChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: IBlockVector[],\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): void {\n for (let i = 0; i < charDefinition.length; i++) {\n const box = charDefinition[i];\n const xEighth = scaledCellWidth / 8;\n const yEighth = scaledCellHeight / 8;\n ctx.fillRect(\n xOffset + box.x * xEighth,\n yOffset + box.y * yEighth,\n box.w * xEighth,\n box.h * yEighth\n );\n }\n}\n\nconst cachedPatterns: Map> = new Map();\n\nfunction drawPatternChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: number[][],\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): void {\n let patternSet = cachedPatterns.get(charDefinition);\n if (!patternSet) {\n patternSet = new Map();\n cachedPatterns.set(charDefinition, patternSet);\n }\n const fillStyle = ctx.fillStyle;\n if (typeof fillStyle !== 'string') {\n throw new Error(`Unexpected fillStyle type \"${fillStyle}\"`);\n }\n let pattern = patternSet.get(fillStyle);\n if (!pattern) {\n const width = charDefinition[0].length;\n const height = charDefinition.length;\n const tmpCanvas = document.createElement('canvas');\n tmpCanvas.width = width;\n tmpCanvas.height = height;\n const tmpCtx = throwIfFalsy(tmpCanvas.getContext('2d'));\n const imageData = new ImageData(width, height);\n\n // Extract rgba from fillStyle\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n if (fillStyle.startsWith('#')) {\n r = parseInt(fillStyle.slice(1, 3), 16);\n g = parseInt(fillStyle.slice(3, 5), 16);\n b = parseInt(fillStyle.slice(5, 7), 16);\n a = fillStyle.length > 7 && parseInt(fillStyle.slice(7, 9), 16) || 1;\n } else if (fillStyle.startsWith('rgba')) {\n ([r, g, b, a] = fillStyle.substring(5, fillStyle.length - 1).split(',').map(e => parseFloat(e)));\n } else {\n throw new Error(`Unexpected fillStyle color format \"${fillStyle}\" when drawing pattern glyph`);\n }\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n imageData.data[(y * width + x) * 4 ] = r;\n imageData.data[(y * width + x) * 4 + 1] = g;\n imageData.data[(y * width + x) * 4 + 2] = b;\n imageData.data[(y * width + x) * 4 + 3] = charDefinition[y][x] * (a * 255);\n }\n }\n tmpCtx.putImageData(imageData, 0, 0);\n pattern = throwIfFalsy(ctx.createPattern(tmpCanvas, null));\n patternSet.set(fillStyle, pattern);\n }\n ctx.fillStyle = pattern;\n ctx.fillRect(xOffset, yOffset, scaledCellWidth, scaledCellHeight);\n}\n\n/**\n * Draws the following box drawing characters by mapping a subset of SVG d attribute instructions to\n * canvas draw calls.\n *\n * Box styles: ┎┰┒┍┯┑╓╥╖╒╤╕ ┏┳┓┌┲┓┌┬┐┏┱┐\n * ┌─┬─┐ ┏━┳━┓ ╔═╦═╗ ┠╂┨┝┿┥╟╫╢╞╪╡ ┡╇┩├╊┫┢╈┪┣╉┤\n * │ │ │ ┃ ┃ ┃ ║ ║ ║ ┖┸┚┕┷┙╙╨╜╘╧╛ └┴┘└┺┛┗┻┛┗┹┘\n * ├─┼─┤ ┣━╋━┫ ╠═╬═╣ ┏┱┐┌┲┓┌┬┐┌┬┐ ┏┳┓┌┮┓┌┬┐┏┭┐\n * │ │ │ ┃ ┃ ┃ ║ ║ ║ ┡╃┤├╄┩├╆┪┢╅┤ ┞╀┦├┾┫┟╁┧┣┽┤\n * └─┴─┘ ┗━┻━┛ ╚═╩═╝ └┴┘└┴┘└┺┛┗┹┘ └┴┘└┶┛┗┻┛┗┵┘\n *\n * Other:\n * ╭─╮ ╲ ╱ ╷╻╎╏┆┇┊┋ ╺╾╴ ╌╌╌ ┄┄┄ ┈┈┈\n * │ │ ╳ ╽╿╎╏┆┇┊┋ ╶╼╸ ╍╍╍ ┅┅┅ ┉┉┉\n * ╰─╯ ╱ ╲ ╹╵╎╏┆┇┊┋\n *\n * All box drawing characters:\n * ─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏\n * ┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟\n * ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯\n * ┰ ┱ ┲ ┳ ┴ ┵ ┶ ┷ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿\n * ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋ ╌ ╍ ╎ ╏\n * ═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟\n * ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯\n * ╰ ╱ ╲ ╳ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿\n *\n * ---\n *\n * Box drawing alignment tests: █\n * ▉\n * ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳\n * ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳\n * ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳\n * ╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳\n * ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎\n * ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏\n * ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█\n *\n * Source: https://www.w3.org/2001/06/utf-8-test/UTF-8-demo.html\n */\nfunction drawBoxDrawingChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: { [fontWeight: number]: string | ((xp: number, yp: number) => string) },\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): void {\n ctx.strokeStyle = ctx.fillStyle;\n for (const [fontWeight, instructions] of Object.entries(charDefinition)) {\n ctx.beginPath();\n ctx.lineWidth = window.devicePixelRatio * Number.parseInt(fontWeight);\n let actualInstructions: string;\n if (typeof instructions === 'function') {\n const xp = .15;\n const yp = .15 / scaledCellHeight * scaledCellWidth;\n actualInstructions = instructions(xp, yp);\n } else {\n actualInstructions = instructions;\n }\n for (const instruction of actualInstructions.split(' ')) {\n const type = instruction[0];\n const f = svgToCanvasInstructionMap[type];\n if (!f) {\n console.error(`Could not find drawing instructions for \"${type}\"`);\n continue;\n }\n const args: string[] = instruction.substring(1).split(',');\n if (!args[0] || !args[1]) {\n continue;\n }\n f(ctx, translateArgs(args, scaledCellWidth, scaledCellHeight, xOffset, yOffset));\n }\n ctx.stroke();\n ctx.closePath();\n }\n}\n\nfunction drawPowerlineChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: IVectorShape,\n xOffset: number,\n yOffset: number,\n scaledCellWidth: number,\n scaledCellHeight: number\n): void {\n ctx.beginPath();\n ctx.lineWidth = window.devicePixelRatio;\n for (const instruction of charDefinition.d.split(' ')) {\n const type = instruction[0];\n const f = svgToCanvasInstructionMap[type];\n if (!f) {\n console.error(`Could not find drawing instructions for \"${type}\"`);\n continue;\n }\n const args: string[] = instruction.substring(1).split(',');\n if (!args[0] || !args[1]) {\n continue;\n }\n f(ctx, translateArgs(args, scaledCellWidth, scaledCellHeight, xOffset, yOffset, charDefinition.horizontalPadding));\n }\n if (charDefinition.type === VectorType.STROKE) {\n ctx.strokeStyle = ctx.fillStyle;\n ctx.stroke();\n } else {\n ctx.fill();\n }\n ctx.closePath();\n}\n\nfunction clamp(value: number, max: number, min: number = 0): number {\n return Math.max(Math.min(value, max), min);\n}\n\nconst svgToCanvasInstructionMap: { [index: string]: any } = {\n 'C': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.bezierCurveTo(args[0], args[1], args[2], args[3], args[4], args[5]),\n 'L': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.lineTo(args[0], args[1]),\n 'M': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.moveTo(args[0], args[1])\n};\n\nfunction translateArgs(args: string[], cellWidth: number, cellHeight: number, xOffset: number, yOffset: number, horizontalPadding: number = 0): number[] {\n const result = args.map(e => parseFloat(e) || parseInt(e));\n\n if (result.length < 2) {\n throw new Error('Too few arguments for instruction');\n }\n\n for (let x = 0; x < result.length; x += 2) {\n // Translate from 0-1 to 0-cellWidth\n result[x] *= cellWidth - (horizontalPadding * 2 * window.devicePixelRatio);\n // Ensure coordinate doesn't escape cell bounds and round to the nearest 0.5 to ensure a crisp\n // line at 100% devicePixelRatio\n if (result[x] !== 0) {\n result[x] = clamp(Math.round(result[x] + 0.5) - 0.5, cellWidth, 0);\n }\n // Apply the cell's offset (ie. x*cellWidth)\n result[x] += xOffset + (horizontalPadding * window.devicePixelRatio);\n }\n\n for (let y = 1; y < result.length; y += 2) {\n // Translate from 0-1 to 0-cellHeight\n result[y] *= cellHeight;\n // Ensure coordinate doesn't escape cell bounds and round to the nearest 0.5 to ensure a crisp\n // line at 100% devicePixelRatio\n if (result[y] !== 0) {\n result[y] = clamp(Math.round(result[y] + 0.5) - 0.5, cellHeight, 0);\n }\n // Apply the cell's offset (ie. x*cellHeight)\n result[y] += yOffset;\n }\n\n return result;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport class GridCache {\n public cache: (T | undefined)[][];\n\n public constructor() {\n this.cache = [];\n }\n\n public resize(width: number, height: number): void {\n for (let x = 0; x < width; x++) {\n if (this.cache.length <= x) {\n this.cache.push([]);\n }\n for (let y = this.cache[x].length; y < height; y++) {\n this.cache[x].push(undefined);\n }\n this.cache[x].length = height;\n }\n this.cache.length = width;\n }\n\n public clear(): void {\n for (let x = 0; x < this.cache.length; x++) {\n for (let y = 0; y < this.cache[x].length; y++) {\n this.cache[x][y] = undefined;\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/Types';\nimport { BaseRenderLayer } from './BaseRenderLayer';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';\nimport { is256Color } from 'browser/renderer/atlas/CharAtlasUtils';\nimport { IColorSet, ILinkifierEvent, ILinkifier, ILinkifier2 } from 'browser/Types';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\n\nexport class LinkRenderLayer extends BaseRenderLayer {\n private _state: ILinkifierEvent | undefined;\n\n constructor(\n container: HTMLElement,\n zIndex: number,\n colors: IColorSet,\n rendererId: number,\n linkifier: ILinkifier,\n linkifier2: ILinkifier2,\n @IBufferService bufferService: IBufferService,\n @IOptionsService optionsService: IOptionsService,\n @IDecorationService decorationService: IDecorationService\n ) {\n super(container, 'link', zIndex, true, colors, rendererId, bufferService, optionsService, decorationService);\n linkifier.onShowLinkUnderline(e => this._onShowLinkUnderline(e));\n linkifier.onHideLinkUnderline(e => this._onHideLinkUnderline(e));\n\n linkifier2.onShowLinkUnderline(e => this._onShowLinkUnderline(e));\n linkifier2.onHideLinkUnderline(e => this._onHideLinkUnderline(e));\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state = undefined;\n }\n\n public reset(): void {\n this._clearCurrentLink();\n }\n\n private _clearCurrentLink(): void {\n if (this._state) {\n this._clearCells(this._state.x1, this._state.y1, this._state.cols - this._state.x1, 1);\n const middleRowCount = this._state.y2 - this._state.y1 - 1;\n if (middleRowCount > 0) {\n this._clearCells(0, this._state.y1 + 1, this._state.cols, middleRowCount);\n }\n this._clearCells(0, this._state.y2, this._state.x2, 1);\n this._state = undefined;\n }\n }\n\n private _onShowLinkUnderline(e: ILinkifierEvent): void {\n if (e.fg === INVERTED_DEFAULT_COLOR) {\n this._ctx.fillStyle = this._colors.background.css;\n } else if (e.fg && is256Color(e.fg)) {\n // 256 color support\n this._ctx.fillStyle = this._colors.ansi[e.fg].css;\n } else {\n this._ctx.fillStyle = this._colors.foreground.css;\n }\n\n if (e.y1 === e.y2) {\n // Single line link\n this._fillBottomLineAtCells(e.x1, e.y1, e.x2 - e.x1);\n } else {\n // Multi-line link\n this._fillBottomLineAtCells(e.x1, e.y1, e.cols - e.x1);\n for (let y = e.y1 + 1; y < e.y2; y++) {\n this._fillBottomLineAtCells(0, y, e.cols);\n }\n this._fillBottomLineAtCells(0, e.y2, e.x2);\n }\n this._state = e;\n }\n\n private _onHideLinkUnderline(e: ILinkifierEvent): void {\n this._clearCurrentLink();\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { TextRenderLayer } from 'browser/renderer/TextRenderLayer';\nimport { SelectionRenderLayer } from 'browser/renderer/SelectionRenderLayer';\nimport { CursorRenderLayer } from 'browser/renderer/CursorRenderLayer';\nimport { IRenderLayer, IRenderer, IRenderDimensions, IRequestRedrawEvent } from 'browser/renderer/Types';\nimport { LinkRenderLayer } from 'browser/renderer/LinkRenderLayer';\nimport { Disposable } from 'common/Lifecycle';\nimport { IColorSet, ILinkifier, ILinkifier2 } from 'browser/Types';\nimport { ICharSizeService } from 'browser/services/Services';\nimport { IBufferService, IOptionsService, IInstantiationService } from 'common/services/Services';\nimport { removeTerminalFromCache } from 'browser/renderer/atlas/CharAtlasCache';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\n\nlet nextRendererId = 1;\n\nexport class Renderer extends Disposable implements IRenderer {\n private _id = nextRendererId++;\n\n private _renderLayers: IRenderLayer[];\n private _devicePixelRatio: number;\n\n public dimensions: IRenderDimensions;\n\n private _onRequestRedraw = new EventEmitter();\n public get onRequestRedraw(): IEvent { return this._onRequestRedraw.event; }\n\n constructor(\n private _colors: IColorSet,\n private readonly _screenElement: HTMLElement,\n linkifier: ILinkifier,\n linkifier2: ILinkifier2,\n @IInstantiationService instantiationService: IInstantiationService,\n @IBufferService private readonly _bufferService: IBufferService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n const allowTransparency = this._optionsService.rawOptions.allowTransparency;\n this._renderLayers = [\n instantiationService.createInstance(TextRenderLayer, this._screenElement, 0, this._colors, allowTransparency, this._id),\n instantiationService.createInstance(SelectionRenderLayer, this._screenElement, 1, this._colors, this._id),\n instantiationService.createInstance(LinkRenderLayer, this._screenElement, 2, this._colors, this._id, linkifier, linkifier2),\n instantiationService.createInstance(CursorRenderLayer, this._screenElement, 3, this._colors, this._id, this._onRequestRedraw)\n ];\n this.dimensions = {\n scaledCharWidth: 0,\n scaledCharHeight: 0,\n scaledCellWidth: 0,\n scaledCellHeight: 0,\n scaledCharLeft: 0,\n scaledCharTop: 0,\n scaledCanvasWidth: 0,\n scaledCanvasHeight: 0,\n canvasWidth: 0,\n canvasHeight: 0,\n actualCellWidth: 0,\n actualCellHeight: 0\n };\n this._devicePixelRatio = window.devicePixelRatio;\n this._updateDimensions();\n this.onOptionsChanged();\n }\n\n public dispose(): void {\n for (const l of this._renderLayers) {\n l.dispose();\n }\n super.dispose();\n removeTerminalFromCache(this._id);\n }\n\n public onDevicePixelRatioChange(): void {\n // If the device pixel ratio changed, the char atlas needs to be regenerated\n // and the terminal needs to refreshed\n if (this._devicePixelRatio !== window.devicePixelRatio) {\n this._devicePixelRatio = window.devicePixelRatio;\n this.onResize(this._bufferService.cols, this._bufferService.rows);\n }\n }\n\n public setColors(colors: IColorSet): void {\n this._colors = colors;\n // Clear layers and force a full render\n for (const l of this._renderLayers) {\n l.setColors(this._colors);\n l.reset();\n }\n }\n\n public onResize(cols: number, rows: number): void {\n // Update character and canvas dimensions\n this._updateDimensions();\n\n // Resize all render layers\n for (const l of this._renderLayers) {\n l.resize(this.dimensions);\n }\n\n // Resize the screen\n this._screenElement.style.width = `${this.dimensions.canvasWidth}px`;\n this._screenElement.style.height = `${this.dimensions.canvasHeight}px`;\n }\n\n public onCharSizeChanged(): void {\n this.onResize(this._bufferService.cols, this._bufferService.rows);\n }\n\n public onBlur(): void {\n this._runOperation(l => l.onBlur());\n }\n\n public onFocus(): void {\n this._runOperation(l => l.onFocus());\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {\n this._runOperation(l => l.onSelectionChanged(start, end, columnSelectMode));\n // Selection foreground requires a full re-render\n if (this._colors.selectionForeground) {\n this._onRequestRedraw.fire({ start: 0, end: this._bufferService.rows - 1 });\n }\n }\n\n public onCursorMove(): void {\n this._runOperation(l => l.onCursorMove());\n }\n\n public onOptionsChanged(): void {\n this._runOperation(l => l.onOptionsChanged());\n }\n\n public clear(): void {\n this._runOperation(l => l.reset());\n }\n\n private _runOperation(operation: (layer: IRenderLayer) => void): void {\n for (const l of this._renderLayers) {\n operation(l);\n }\n }\n\n /**\n * Performs the refresh loop callback, calling refresh only if a refresh is\n * necessary before queueing up the next one.\n */\n public renderRows(start: number, end: number): void {\n for (const l of this._renderLayers) {\n l.onGridChanged(start, end);\n }\n }\n\n public clearTextureAtlas(): void {\n for (const layer of this._renderLayers) {\n layer.clearTextureAtlas();\n }\n }\n\n /**\n * Recalculates the character and canvas dimensions.\n */\n private _updateDimensions(): void {\n if (!this._charSizeService.hasValidSize) {\n return;\n }\n\n // Calculate the scaled character width. Width is floored as it must be\n // drawn to an integer grid in order for the CharAtlas \"stamps\" to not be\n // blurry. When text is drawn to the grid not using the CharAtlas, it is\n // clipped to ensure there is no overlap with the next cell.\n this.dimensions.scaledCharWidth = Math.floor(this._charSizeService.width * window.devicePixelRatio);\n\n // Calculate the scaled character height. Height is ceiled in case\n // devicePixelRatio is a floating point number in order to ensure there is\n // enough space to draw the character to the cell.\n this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * window.devicePixelRatio);\n\n // Calculate the scaled cell height, if lineHeight is not 1 then the value\n // will be floored because since lineHeight can never be lower then 1, there\n // is a guarentee that the scaled line height will always be larger than\n // scaled char height.\n this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.rawOptions.lineHeight);\n\n // Calculate the y coordinate within a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharTop = this._optionsService.rawOptions.lineHeight === 1 ? 0 : Math.round((this.dimensions.scaledCellHeight - this.dimensions.scaledCharHeight) / 2);\n\n // Calculate the scaled cell width, taking the letterSpacing into account.\n this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.rawOptions.letterSpacing);\n\n // Calculate the x coordinate with a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharLeft = Math.floor(this._optionsService.rawOptions.letterSpacing / 2);\n\n // Recalculate the canvas dimensions; scaled* define the actual number of\n // pixel in the canvas\n this.dimensions.scaledCanvasHeight = this._bufferService.rows * this.dimensions.scaledCellHeight;\n this.dimensions.scaledCanvasWidth = this._bufferService.cols * this.dimensions.scaledCellWidth;\n\n // The the size of the canvas on the page. It's very important that this\n // rounds to nearest integer and not ceils as browsers often set\n // window.devicePixelRatio as something like 1.100000023841858, when it's\n // actually 1.1. Ceiling causes blurriness as the backing canvas image is 1\n // pixel too large for the canvas element size.\n this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / window.devicePixelRatio);\n this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / window.devicePixelRatio);\n\n // Get the _actual_ dimensions of an individual cell. This needs to be\n // derived from the canvasWidth/Height calculated above which takes into\n // account window.devicePixelRatio. ICharSizeService.width/height by itself\n // is insufficient when the page is not at 100% zoom level as it's measured\n // in CSS pixels, but the actual char size on the canvas can differ.\n this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows;\n this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function throwIfFalsy(value: T | undefined | null): T {\n if (!value) {\n throw new Error('value must not be falsy');\n }\n return value;\n}\n\nexport function isPowerlineGlyph(codepoint: number): boolean {\n // Only return true for Powerline symbols which require\n // different padding and should be excluded from minimum contrast\n // ratio standards\n return 0xE0A4 <= codepoint && codepoint <= 0xE0D6;\n}\n\nfunction isBoxOrBlockGlyph(codepoint: number): boolean {\n return (0x2500 <= codepoint && codepoint <= 0x259F);\n}\n\nexport function excludeFromContrastRatioDemands(codepoint: number): boolean {\n return isPowerlineGlyph(codepoint) || isBoxOrBlockGlyph(codepoint);\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/Types';\nimport { BaseRenderLayer } from 'browser/renderer/BaseRenderLayer';\nimport { IColorSet } from 'browser/Types';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\n\ninterface ISelectionState {\n start?: [number, number];\n end?: [number, number];\n columnSelectMode?: boolean;\n ydisp?: number;\n}\n\nexport class SelectionRenderLayer extends BaseRenderLayer {\n private _state!: ISelectionState;\n\n constructor(\n container: HTMLElement,\n zIndex: number,\n colors: IColorSet,\n rendererId: number,\n @IBufferService bufferService: IBufferService,\n @IOptionsService optionsService: IOptionsService,\n @IDecorationService decorationService: IDecorationService\n ) {\n super(container, 'selection', zIndex, true, colors, rendererId, bufferService, optionsService, decorationService);\n this._clearState();\n }\n\n private _clearState(): void {\n this._state = {\n start: undefined,\n end: undefined,\n columnSelectMode: undefined,\n ydisp: undefined\n };\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // Resizing the canvas discards the contents of the canvas so clear state\n this._clearState();\n }\n\n public reset(): void {\n if (this._state.start && this._state.end) {\n this._clearState();\n this._clearAll();\n }\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n super.onSelectionChanged(start, end, columnSelectMode);\n\n // Selection has not changed\n if (!this._didStateChange(start, end, columnSelectMode, this._bufferService.buffer.ydisp)) {\n return;\n }\n\n // Remove all selections\n this._clearAll();\n\n // Selection does not exist\n if (!start || !end) {\n this._clearState();\n return;\n }\n\n // Translate from buffer position to viewport position\n const viewportStartRow = start[1] - this._bufferService.buffer.ydisp;\n const viewportEndRow = end[1] - this._bufferService.buffer.ydisp;\n const viewportCappedStartRow = Math.max(viewportStartRow, 0);\n const viewportCappedEndRow = Math.min(viewportEndRow, this._bufferService.rows - 1);\n\n // No need to draw the selection\n if (viewportCappedStartRow >= this._bufferService.rows || viewportCappedEndRow < 0) {\n this._state.ydisp = this._bufferService.buffer.ydisp;\n return;\n }\n\n this._ctx.fillStyle = this._colors.selectionTransparent.css;\n\n if (columnSelectMode) {\n const startCol = start[0];\n const width = end[0] - startCol;\n const height = viewportCappedEndRow - viewportCappedStartRow + 1;\n this._fillCells(startCol, viewportCappedStartRow, width, height);\n } else {\n // Draw first row\n const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;\n const startRowEndCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;\n this._fillCells(startCol, viewportCappedStartRow, startRowEndCol - startCol, 1);\n\n // Draw middle rows\n const middleRowsCount = Math.max(viewportCappedEndRow - viewportCappedStartRow - 1, 0);\n this._fillCells(0, viewportCappedStartRow + 1, this._bufferService.cols, middleRowsCount);\n\n // Draw final row\n if (viewportCappedStartRow !== viewportCappedEndRow) {\n // Only draw viewportEndRow if it's not the same as viewportStartRow\n const endCol = viewportEndRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;\n this._fillCells(0, viewportCappedEndRow, endCol, 1);\n }\n }\n\n // Save state for next render\n this._state.start = [start[0], start[1]];\n this._state.end = [end[0], end[1]];\n this._state.columnSelectMode = columnSelectMode;\n this._state.ydisp = this._bufferService.buffer.ydisp;\n }\n\n private _didStateChange(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean, ydisp: number): boolean {\n return !this._areCoordinatesEqual(start, this._state.start) ||\n !this._areCoordinatesEqual(end, this._state.end) ||\n columnSelectMode !== this._state.columnSelectMode ||\n ydisp !== this._state.ydisp;\n }\n\n private _areCoordinatesEqual(coord1: [number, number] | undefined, coord2: [number, number] | undefined): boolean {\n if (!coord1 || !coord2) {\n return false;\n }\n\n return coord1[0] === coord2[0] && coord1[1] === coord2[1];\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/Types';\nimport { CharData, ICellData } from 'common/Types';\nimport { GridCache } from 'browser/renderer/GridCache';\nimport { BaseRenderLayer } from 'browser/renderer/BaseRenderLayer';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { NULL_CELL_CODE, Content } from 'common/buffer/Constants';\nimport { IColorSet } from 'browser/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IOptionsService, IBufferService, IDecorationService } from 'common/services/Services';\nimport { ICharacterJoinerService } from 'browser/services/Services';\nimport { JoinedCellData } from 'browser/services/CharacterJoinerService';\n\n/**\n * This CharData looks like a null character, which will forc a clear and render\n * when the character changes (a regular space ' ' character may not as it's\n * drawn state is a cleared cell).\n */\n// const OVERLAP_OWNED_CHAR_DATA: CharData = [null, '', 0, -1];\n\nexport class TextRenderLayer extends BaseRenderLayer {\n private _state: GridCache;\n private _characterWidth: number = 0;\n private _characterFont: string = '';\n private _characterOverlapCache: { [key: string]: boolean } = {};\n private _workCell = new CellData();\n\n constructor(\n container: HTMLElement,\n zIndex: number,\n colors: IColorSet,\n alpha: boolean,\n rendererId: number,\n @IBufferService bufferService: IBufferService,\n @IOptionsService optionsService: IOptionsService,\n @ICharacterJoinerService private readonly _characterJoinerService: ICharacterJoinerService,\n @IDecorationService decorationService: IDecorationService\n ) {\n super(container, 'text', zIndex, alpha, colors, rendererId, bufferService, optionsService, decorationService);\n this._state = new GridCache();\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n\n // Clear the character width cache if the font or width has changed\n const terminalFont = this._getFont(false, false);\n if (this._characterWidth !== dim.scaledCharWidth || this._characterFont !== terminalFont) {\n this._characterWidth = dim.scaledCharWidth;\n this._characterFont = terminalFont;\n this._characterOverlapCache = {};\n }\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state.clear();\n this._state.resize(this._bufferService.cols, this._bufferService.rows);\n }\n\n public reset(): void {\n this._state.clear();\n this._clearAll();\n }\n\n private _forEachCell(\n firstRow: number,\n lastRow: number,\n callback: (\n cell: ICellData,\n x: number,\n y: number\n ) => void\n ): void {\n for (let y = firstRow; y <= lastRow; y++) {\n const row = y + this._bufferService.buffer.ydisp;\n const line = this._bufferService.buffer.lines.get(row);\n const joinedRanges = this._characterJoinerService.getJoinedCharacters(row);\n for (let x = 0; x < this._bufferService.cols; x++) {\n line!.loadCell(x, this._workCell);\n let cell = this._workCell;\n\n // If true, indicates that the current character(s) to draw were joined.\n let isJoined = false;\n let lastCharX = x;\n\n // The character to the left is a wide character, drawing is owned by\n // the char at x-1\n if (cell.getWidth() === 0) {\n continue;\n }\n\n // Process any joined character ranges as needed. Because of how the\n // ranges are produced, we know that they are valid for the characters\n // and attributes of our input.\n if (joinedRanges.length > 0 && x === joinedRanges[0][0]) {\n isJoined = true;\n const range = joinedRanges.shift()!;\n\n // We already know the exact start and end column of the joined range,\n // so we get the string and width representing it directly\n cell = new JoinedCellData(\n this._workCell,\n line!.translateToString(true, range[0], range[1]),\n range[1] - range[0]\n );\n\n // Skip over the cells occupied by this range in the loop\n lastCharX = range[1] - 1;\n }\n\n // If the character is an overlapping char and the character to the\n // right is a space, take ownership of the cell to the right. We skip\n // this check for joined characters because their rendering likely won't\n // yield the same result as rendering the last character individually.\n if (!isJoined && this._isOverlapping(cell)) {\n // If the character is overlapping, we want to force a re-render on every\n // frame. This is specifically to work around the case where two\n // overlaping chars `a` and `b` are adjacent, the cursor is moved to b and a\n // space is added. Without this, the first half of `b` would never\n // get removed, and `a` would not re-render because it thinks it's\n // already in the correct state.\n // this._state.cache[x][y] = OVERLAP_OWNED_CHAR_DATA;\n if (lastCharX < line!.length - 1 && line!.getCodePoint(lastCharX + 1) === NULL_CELL_CODE) {\n // patch width to 2\n cell.content &= ~Content.WIDTH_MASK;\n cell.content |= 2 << Content.WIDTH_SHIFT;\n // this._clearChar(x + 1, y);\n // The overlapping char's char data will force a clear and render when the\n // overlapping char is no longer to the left of the character and also when\n // the space changes to another character.\n // this._state.cache[x + 1][y] = OVERLAP_OWNED_CHAR_DATA;\n }\n }\n\n callback(\n cell,\n x,\n y\n );\n\n x = lastCharX;\n }\n }\n }\n\n /**\n * Draws the background for a specified range of columns. Tries to batch adjacent cells of the\n * same color together to reduce draw calls.\n */\n private _drawBackground(firstRow: number, lastRow: number): void {\n const ctx = this._ctx;\n const cols = this._bufferService.cols;\n let startX: number = 0;\n let startY: number = 0;\n let prevFillStyle: string | null = null;\n\n ctx.save();\n\n this._forEachCell(firstRow, lastRow, (cell, x, y) => {\n // libvte and xterm both draw the background (but not foreground) of invisible characters,\n // so we should too.\n let nextFillStyle = null; // null represents default background color\n\n if (cell.isInverse()) {\n if (cell.isFgDefault()) {\n nextFillStyle = this._colors.foreground.css;\n } else if (cell.isFgRGB()) {\n nextFillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`;\n } else {\n nextFillStyle = this._colors.ansi[cell.getFgColor()].css;\n }\n } else if (cell.isBgRGB()) {\n nextFillStyle = `rgb(${AttributeData.toColorRGB(cell.getBgColor()).join(',')})`;\n } else if (cell.isBgPalette()) {\n nextFillStyle = this._colors.ansi[cell.getBgColor()].css;\n }\n\n // Get any decoration foreground/background overrides, this must be fetched before the early\n // exist but applied after inverse\n let isTop = false;\n for (const d of this._decorationService.getDecorationsAtCell(x, this._bufferService.buffer.ydisp + y)) {\n if (d.options.layer !== 'top' && isTop) {\n continue;\n }\n if (d.backgroundColorRGB) {\n nextFillStyle = d.backgroundColorRGB.css;\n }\n isTop = d.options.layer === 'top';\n }\n\n if (prevFillStyle === null) {\n // This is either the first iteration, or the default background was set. Either way, we\n // don't need to draw anything.\n startX = x;\n startY = y;\n }\n\n if (y !== startY) {\n // our row changed, draw the previous row\n ctx.fillStyle = prevFillStyle || '';\n this._fillCells(startX, startY, cols - startX, 1);\n startX = x;\n startY = y;\n } else if (prevFillStyle !== nextFillStyle) {\n // our color changed, draw the previous characters in this row\n ctx.fillStyle = prevFillStyle || '';\n this._fillCells(startX, startY, x - startX, 1);\n startX = x;\n startY = y;\n }\n\n prevFillStyle = nextFillStyle;\n });\n\n // flush the last color we encountered\n if (prevFillStyle !== null) {\n ctx.fillStyle = prevFillStyle;\n this._fillCells(startX, startY, cols - startX, 1);\n }\n\n ctx.restore();\n }\n\n private _drawForeground(firstRow: number, lastRow: number): void {\n this._forEachCell(firstRow, lastRow, (cell, x, y) => {\n if (cell.isInvisible()) {\n return;\n }\n this._drawChars(cell, x, y);\n if (cell.isUnderline() || cell.isStrikethrough()) {\n this._ctx.save();\n\n if (cell.isInverse()) {\n if (cell.isBgDefault()) {\n this._ctx.fillStyle = this._colors.background.css;\n } else if (cell.isBgRGB()) {\n this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getBgColor()).join(',')})`;\n } else {\n let bg = cell.getBgColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && bg < 8) {\n bg += 8;\n }\n this._ctx.fillStyle = this._colors.ansi[bg].css;\n }\n } else {\n if (cell.isFgDefault()) {\n this._ctx.fillStyle = this._colors.foreground.css;\n } else if (cell.isFgRGB()) {\n this._ctx.fillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`;\n } else {\n let fg = cell.getFgColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && fg < 8) {\n fg += 8;\n }\n this._ctx.fillStyle = this._colors.ansi[fg].css;\n }\n }\n\n if (cell.isStrikethrough()) {\n this._fillMiddleLineAtCells(x, y, cell.getWidth());\n }\n if (cell.isUnderline()) {\n this._fillBottomLineAtCells(x, y, cell.getWidth());\n }\n this._ctx.restore();\n }\n });\n }\n\n public onGridChanged(firstRow: number, lastRow: number): void {\n // Resize has not been called yet\n if (this._state.cache.length === 0) {\n return;\n }\n\n if (this._charAtlas) {\n this._charAtlas.beginFrame();\n }\n\n this._clearCells(0, firstRow, this._bufferService.cols, lastRow - firstRow + 1);\n this._drawBackground(firstRow, lastRow);\n this._drawForeground(firstRow, lastRow);\n }\n\n public onOptionsChanged(): void {\n this._setTransparency(this._optionsService.rawOptions.allowTransparency);\n }\n\n /**\n * Whether a character is overlapping to the next cell.\n */\n private _isOverlapping(cell: ICellData): boolean {\n // Only single cell characters can be overlapping, rendering issues can\n // occur without this check\n if (cell.getWidth() !== 1) {\n return false;\n }\n\n // We assume that any ascii character will not overlap\n if (cell.getCode() < 256) {\n return false;\n }\n\n const chars = cell.getChars();\n\n // Deliver from cache if available\n if (this._characterOverlapCache.hasOwnProperty(chars)) {\n return this._characterOverlapCache[chars];\n }\n\n // Setup the font\n this._ctx.save();\n this._ctx.font = this._characterFont;\n\n // Measure the width of the character, but Math.floor it\n // because that is what the renderer does when it calculates\n // the character dimensions we are comparing against\n const overlaps = Math.floor(this._ctx.measureText(chars).width) > this._characterWidth;\n\n // Restore the original context\n this._ctx.restore();\n\n // Cache and return\n this._characterOverlapCache[chars] = overlaps;\n return overlaps;\n }\n\n /**\n * Clear the charcater at the cell specified.\n * @param x The column of the char.\n * @param y The row of the char.\n */\n // private _clearChar(x: number, y: number): void {\n // let colsToClear = 1;\n // // Clear the adjacent character if it was wide\n // const state = this._state.cache[x][y];\n // if (state && state[CHAR_DATA_WIDTH_INDEX] === 2) {\n // colsToClear = 2;\n // }\n // this.clearCells(x, y, colsToClear, 1);\n // }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IGlyphIdentifier } from 'browser/renderer/atlas/Types';\nimport { IDisposable } from 'common/Types';\n\nexport abstract class BaseCharAtlas implements IDisposable {\n private _didWarmUp: boolean = false;\n\n public dispose(): void { }\n\n /**\n * Perform any work needed to warm the cache before it can be used. May be called multiple times.\n * Implement _doWarmUp instead if you only want to get called once.\n */\n public warmUp(): void {\n if (!this._didWarmUp) {\n this._doWarmUp();\n this._didWarmUp = true;\n }\n }\n\n /**\n * Perform any work needed to warm the cache before it can be used. Used by the default\n * implementation of warmUp(), and will only be called once.\n */\n private _doWarmUp(): void { }\n\n public clear(): void { }\n\n /**\n * Called when we start drawing a new frame.\n *\n * TODO: We rely on this getting called by TextRenderLayer. This should really be called by\n * Renderer instead, but we need to make Renderer the source-of-truth for the char atlas, instead\n * of BaseRenderLayer.\n */\n public beginFrame(): void { }\n\n /**\n * May be called before warmUp finishes, however it is okay for the implementation to\n * do nothing and return false in that case.\n *\n * @param ctx Where to draw the character onto.\n * @param glyph Information about what to draw\n * @param x The position on the context to start drawing at\n * @param y The position on the context to start drawing at\n * @returns The success state. True if we drew the character.\n */\n public abstract draw(\n ctx: CanvasRenderingContext2D,\n glyph: IGlyphIdentifier,\n x: number,\n y: number\n ): boolean;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { generateConfig, configEquals } from 'browser/renderer/atlas/CharAtlasUtils';\nimport { BaseCharAtlas } from 'browser/renderer/atlas/BaseCharAtlas';\nimport { DynamicCharAtlas } from 'browser/renderer/atlas/DynamicCharAtlas';\nimport { ICharAtlasConfig } from 'browser/renderer/atlas/Types';\nimport { IColorSet } from 'browser/Types';\nimport { ITerminalOptions } from 'common/services/Services';\n\ninterface ICharAtlasCacheEntry {\n atlas: BaseCharAtlas;\n config: ICharAtlasConfig;\n // N.B. This implementation potentially holds onto copies of the terminal forever, so\n // this may cause memory leaks.\n ownedBy: number[];\n}\n\nconst charAtlasCache: ICharAtlasCacheEntry[] = [];\n\n/**\n * Acquires a char atlas, either generating a new one or returning an existing\n * one that is in use by another terminal.\n */\nexport function acquireCharAtlas(\n options: ITerminalOptions,\n rendererId: number,\n colors: IColorSet,\n scaledCharWidth: number,\n scaledCharHeight: number\n): BaseCharAtlas {\n const newConfig = generateConfig(scaledCharWidth, scaledCharHeight, options, colors);\n\n // Check to see if the renderer already owns this config\n for (let i = 0; i < charAtlasCache.length; i++) {\n const entry = charAtlasCache[i];\n const ownedByIndex = entry.ownedBy.indexOf(rendererId);\n if (ownedByIndex >= 0) {\n if (configEquals(entry.config, newConfig)) {\n return entry.atlas;\n }\n // The configs differ, release the renderer from the entry\n if (entry.ownedBy.length === 1) {\n entry.atlas.dispose();\n charAtlasCache.splice(i, 1);\n } else {\n entry.ownedBy.splice(ownedByIndex, 1);\n }\n break;\n }\n }\n\n // Try match a char atlas from the cache\n for (let i = 0; i < charAtlasCache.length; i++) {\n const entry = charAtlasCache[i];\n if (configEquals(entry.config, newConfig)) {\n // Add the renderer to the cache entry and return\n entry.ownedBy.push(rendererId);\n return entry.atlas;\n }\n }\n\n const newEntry: ICharAtlasCacheEntry = {\n atlas: new DynamicCharAtlas(\n document,\n newConfig\n ),\n config: newConfig,\n ownedBy: [rendererId]\n };\n charAtlasCache.push(newEntry);\n return newEntry.atlas;\n}\n\n/**\n * Removes a terminal reference from the cache, allowing its memory to be freed.\n */\nexport function removeTerminalFromCache(rendererId: number): void {\n for (let i = 0; i < charAtlasCache.length; i++) {\n const index = charAtlasCache[i].ownedBy.indexOf(rendererId);\n if (index !== -1) {\n if (charAtlasCache[i].ownedBy.length === 1) {\n // Remove the cache entry if it's the only renderer\n charAtlasCache[i].atlas.dispose();\n charAtlasCache.splice(i, 1);\n } else {\n // Remove the reference from the cache entry\n charAtlasCache[i].ownedBy.splice(index, 1);\n }\n break;\n }\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharAtlasConfig } from 'browser/renderer/atlas/Types';\nimport { DEFAULT_COLOR } from 'common/buffer/Constants';\nimport { IColorSet, IPartialColorSet } from 'browser/Types';\nimport { ITerminalOptions } from 'common/services/Services';\n\nexport function generateConfig(scaledCharWidth: number, scaledCharHeight: number, options: ITerminalOptions, colors: IColorSet): ICharAtlasConfig {\n // null out some fields that don't matter\n const clonedColors: IPartialColorSet = {\n foreground: colors.foreground,\n background: colors.background,\n cursor: undefined,\n cursorAccent: undefined,\n selection: undefined,\n ansi: colors.ansi.slice()\n };\n return {\n devicePixelRatio: window.devicePixelRatio,\n scaledCharWidth,\n scaledCharHeight,\n fontFamily: options.fontFamily,\n fontSize: options.fontSize,\n fontWeight: options.fontWeight,\n fontWeightBold: options.fontWeightBold,\n allowTransparency: options.allowTransparency,\n colors: clonedColors\n };\n}\n\nexport function configEquals(a: ICharAtlasConfig, b: ICharAtlasConfig): boolean {\n for (let i = 0; i < a.colors.ansi.length; i++) {\n if (a.colors.ansi[i].rgba !== b.colors.ansi[i].rgba) {\n return false;\n }\n }\n return a.devicePixelRatio === b.devicePixelRatio &&\n a.fontFamily === b.fontFamily &&\n a.fontSize === b.fontSize &&\n a.fontWeight === b.fontWeight &&\n a.fontWeightBold === b.fontWeightBold &&\n a.allowTransparency === b.allowTransparency &&\n a.scaledCharWidth === b.scaledCharWidth &&\n a.scaledCharHeight === b.scaledCharHeight &&\n a.colors.foreground === b.colors.foreground &&\n a.colors.background === b.colors.background;\n}\n\nexport function is256Color(colorCode: number): boolean {\n return colorCode < DEFAULT_COLOR;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { isFirefox, isLegacyEdge } from 'common/Platform';\n\nexport const INVERTED_DEFAULT_COLOR = 257;\nexport const DIM_OPACITY = 0.5;\n// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox or Legacy Edge would\n// result in truncated text (Issue 3353). Using 'bottom' for Chrome would result in slightly\n// unaligned Powerline fonts (PR 3356#issuecomment-850928179).\nexport const TEXT_BASELINE: CanvasTextBaseline = isFirefox || isLegacyEdge ? 'bottom' : 'ideographic';\n\nexport const CHAR_ATLAS_CELL_SPACING = 1;\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { DIM_OPACITY, INVERTED_DEFAULT_COLOR, TEXT_BASELINE } from 'browser/renderer/atlas/Constants';\nimport { IGlyphIdentifier, ICharAtlasConfig } from 'browser/renderer/atlas/Types';\nimport { BaseCharAtlas } from 'browser/renderer/atlas/BaseCharAtlas';\nimport { DEFAULT_ANSI_COLORS } from 'browser/ColorManager';\nimport { LRUMap } from 'browser/renderer/atlas/LRUMap';\nimport { isFirefox, isSafari } from 'common/Platform';\nimport { IColor } from 'common/Types';\nimport { throwIfFalsy } from 'browser/renderer/RendererUtils';\nimport { color } from 'common/Color';\n\n// In practice we're probably never going to exhaust a texture this large. For debugging purposes,\n// however, it can be useful to set this to a really tiny value, to verify that LRU eviction works.\nconst TEXTURE_WIDTH = 1024;\nconst TEXTURE_HEIGHT = 1024;\n\nconst TRANSPARENT_COLOR = {\n css: 'rgba(0, 0, 0, 0)',\n rgba: 0\n};\n\n// Drawing to the cache is expensive: If we have to draw more than this number of glyphs to the\n// cache in a single frame, give up on trying to cache anything else, and try to finish the current\n// frame ASAP.\n//\n// This helps to limit the amount of damage a program can do when it would otherwise thrash the\n// cache.\nconst FRAME_CACHE_DRAW_LIMIT = 100;\n\n/**\n * The number of milliseconds to wait before generating the ImageBitmap, this is to debounce/batch\n * the operation as window.createImageBitmap is asynchronous.\n */\nconst GLYPH_BITMAP_COMMIT_DELAY = 100;\n\ninterface IGlyphCacheValue {\n index: number;\n isEmpty: boolean;\n inBitmap: boolean;\n}\n\nexport function getGlyphCacheKey(glyph: IGlyphIdentifier): number {\n // Note that this only returns a valid key when code < 256\n // Layout:\n // 0b00000000000000000000000000000001: italic (1)\n // 0b00000000000000000000000000000010: dim (1)\n // 0b00000000000000000000000000000100: bold (1)\n // 0b00000000000000000000111111111000: fg (9)\n // 0b00000000000111111111000000000000: bg (9)\n // 0b00011111111000000000000000000000: code (8)\n // 0b11100000000000000000000000000000: unused (3)\n return glyph.code << 21 | glyph.bg << 12 | glyph.fg << 3 | (glyph.bold ? 0 : 4) + (glyph.dim ? 0 : 2) + (glyph.italic ? 0 : 1);\n}\n\nexport class DynamicCharAtlas extends BaseCharAtlas {\n // An ordered map that we're using to keep track of where each glyph is in the atlas texture.\n // It's ordered so that we can determine when to remove the old entries.\n private _cacheMap: LRUMap;\n\n // The texture that the atlas is drawn to\n private _cacheCanvas: HTMLCanvasElement;\n private _cacheCtx: CanvasRenderingContext2D;\n\n // A temporary context that glyphs are drawn to before being transfered to the atlas.\n private _tmpCtx: CanvasRenderingContext2D;\n\n // The number of characters stored in the atlas by width/height\n private _width: number;\n private _height: number;\n\n private _drawToCacheCount: number = 0;\n\n // An array of glyph keys that are waiting on the bitmap to be generated.\n private _glyphsWaitingOnBitmap: IGlyphCacheValue[] = [];\n\n // The timeout that is used to batch bitmap generation so it's not requested for every new glyph.\n private _bitmapCommitTimeout: number | null = null;\n\n // The bitmap to draw from, this is much faster on other browsers than others.\n private _bitmap: ImageBitmap | null = null;\n\n constructor(document: Document, private _config: ICharAtlasConfig) {\n super();\n this._cacheCanvas = document.createElement('canvas');\n this._cacheCanvas.width = TEXTURE_WIDTH;\n this._cacheCanvas.height = TEXTURE_HEIGHT;\n // The canvas needs alpha because we use clearColor to convert the background color to alpha.\n // It might also contain some characters with transparent backgrounds if allowTransparency is\n // set.\n this._cacheCtx = throwIfFalsy(this._cacheCanvas.getContext('2d', { alpha: true }));\n\n const tmpCanvas = document.createElement('canvas');\n tmpCanvas.width = this._config.scaledCharWidth;\n tmpCanvas.height = this._config.scaledCharHeight;\n this._tmpCtx = throwIfFalsy(tmpCanvas.getContext('2d', { alpha: this._config.allowTransparency }));\n\n this._width = Math.floor(TEXTURE_WIDTH / this._config.scaledCharWidth);\n this._height = Math.floor(TEXTURE_HEIGHT / this._config.scaledCharHeight);\n const capacity = this._width * this._height;\n this._cacheMap = new LRUMap(capacity);\n this._cacheMap.prealloc(capacity);\n\n // This is useful for debugging\n // document.body.appendChild(this._cacheCanvas);\n }\n\n public dispose(): void {\n if (this._bitmapCommitTimeout !== null) {\n window.clearTimeout(this._bitmapCommitTimeout);\n this._bitmapCommitTimeout = null;\n }\n }\n\n public beginFrame(): void {\n this._drawToCacheCount = 0;\n }\n\n public clear(): void {\n if (this._cacheMap.size > 0) {\n const capacity = this._width * this._height;\n this._cacheMap = new LRUMap(capacity);\n this._cacheMap.prealloc(capacity);\n }\n this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT);\n this._tmpCtx.clearRect(0, 0, this._config.scaledCharWidth, this._config.scaledCharHeight);\n }\n\n public draw(\n ctx: CanvasRenderingContext2D,\n glyph: IGlyphIdentifier,\n x: number,\n y: number\n ): boolean {\n // Space is always an empty cell, special case this as it's so common\n if (glyph.code === 32) {\n return true;\n }\n\n // Exit early for uncachable glyphs\n if (!this._canCache(glyph)) {\n return false;\n }\n\n const glyphKey = getGlyphCacheKey(glyph);\n const cacheValue = this._cacheMap.get(glyphKey);\n if (cacheValue !== null && cacheValue !== undefined) {\n this._drawFromCache(ctx, cacheValue, x, y);\n return true;\n }\n if (this._drawToCacheCount < FRAME_CACHE_DRAW_LIMIT) {\n let index;\n if (this._cacheMap.size < this._cacheMap.capacity) {\n index = this._cacheMap.size;\n } else {\n // we're out of space, so our call to set will delete this item\n index = this._cacheMap.peek()!.index;\n }\n const cacheValue = this._drawToCache(glyph, index);\n this._cacheMap.set(glyphKey, cacheValue);\n this._drawFromCache(ctx, cacheValue, x, y);\n return true;\n }\n return false;\n }\n\n private _canCache(glyph: IGlyphIdentifier): boolean {\n // Only cache ascii and extended characters for now, to be safe. In the future, we could do\n // something more complicated to determine the expected width of a character.\n //\n // If we switch the renderer over to webgl at some point, we may be able to use blending modes\n // to draw overlapping glyphs from the atlas:\n // https://github.com/servo/webrender/issues/464#issuecomment-255632875\n // https://webglfundamentals.org/webgl/lessons/webgl-text-texture.html\n return glyph.code < 256;\n }\n\n private _toCoordinateX(index: number): number {\n return (index % this._width) * this._config.scaledCharWidth;\n }\n\n private _toCoordinateY(index: number): number {\n return Math.floor(index / this._width) * this._config.scaledCharHeight;\n }\n\n private _drawFromCache(\n ctx: CanvasRenderingContext2D,\n cacheValue: IGlyphCacheValue,\n x: number,\n y: number\n ): void {\n // We don't actually need to do anything if this is whitespace.\n if (cacheValue.isEmpty) {\n return;\n }\n const cacheX = this._toCoordinateX(cacheValue.index);\n const cacheY = this._toCoordinateY(cacheValue.index);\n ctx.drawImage(\n cacheValue.inBitmap ? this._bitmap! : this._cacheCanvas,\n cacheX,\n cacheY,\n this._config.scaledCharWidth,\n this._config.scaledCharHeight,\n x,\n y,\n this._config.scaledCharWidth,\n this._config.scaledCharHeight\n );\n }\n\n private _getColorFromAnsiIndex(idx: number): IColor {\n if (idx < this._config.colors.ansi.length) {\n return this._config.colors.ansi[idx];\n }\n return DEFAULT_ANSI_COLORS[idx];\n }\n\n private _getBackgroundColor(glyph: IGlyphIdentifier): IColor {\n if (this._config.allowTransparency) {\n // The background color might have some transparency, so we need to render it as fully\n // transparent in the atlas. Otherwise we'd end up drawing the transparent background twice\n // around the anti-aliased edges of the glyph, and it would look too dark.\n return TRANSPARENT_COLOR;\n }\n if (glyph.bg === INVERTED_DEFAULT_COLOR) {\n return this._config.colors.foreground;\n }\n if (glyph.bg < 256) {\n return this._getColorFromAnsiIndex(glyph.bg);\n }\n return this._config.colors.background;\n }\n\n private _getForegroundColor(glyph: IGlyphIdentifier): IColor {\n if (glyph.fg === INVERTED_DEFAULT_COLOR) {\n return color.opaque(this._config.colors.background);\n }\n if (glyph.fg < 256) {\n // 256 color support\n return this._getColorFromAnsiIndex(glyph.fg);\n }\n return this._config.colors.foreground;\n }\n\n // TODO: We do this (or something similar) in multiple places. We should split this off\n // into a shared function.\n private _drawToCache(glyph: IGlyphIdentifier, index: number): IGlyphCacheValue {\n this._drawToCacheCount++;\n\n this._tmpCtx.save();\n\n // draw the background\n const backgroundColor = this._getBackgroundColor(glyph);\n // Use a 'copy' composite operation to clear any existing glyph out of _tmpCtxWithAlpha, regardless of\n // transparency in backgroundColor\n this._tmpCtx.globalCompositeOperation = 'copy';\n this._tmpCtx.fillStyle = backgroundColor.css;\n this._tmpCtx.fillRect(0, 0, this._config.scaledCharWidth, this._config.scaledCharHeight);\n this._tmpCtx.globalCompositeOperation = 'source-over';\n\n // draw the foreground/glyph\n const fontWeight = glyph.bold ? this._config.fontWeightBold : this._config.fontWeight;\n const fontStyle = glyph.italic ? 'italic' : '';\n this._tmpCtx.font =\n `${fontStyle} ${fontWeight} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`;\n this._tmpCtx.textBaseline = TEXT_BASELINE;\n\n this._tmpCtx.fillStyle = this._getForegroundColor(glyph).css;\n\n // Apply alpha to dim the character\n if (glyph.dim) {\n this._tmpCtx.globalAlpha = DIM_OPACITY;\n }\n // Draw the character\n this._tmpCtx.fillText(glyph.chars, 0, this._config.scaledCharHeight);\n\n // clear the background from the character to avoid issues with drawing over the previous\n // character if it extends past it's bounds\n let imageData = this._tmpCtx.getImageData(\n 0, 0, this._config.scaledCharWidth, this._config.scaledCharHeight\n );\n let isEmpty = false;\n if (!this._config.allowTransparency) {\n isEmpty = clearColor(imageData, backgroundColor);\n }\n\n // If this charcater is underscore and empty, shift it up until it is visible, try for a maximum\n // of 5 pixels.\n if (isEmpty && glyph.chars === '_' && !this._config.allowTransparency) {\n for (let offset = 1; offset <= 5; offset++) {\n // Draw the character\n this._tmpCtx.fillText(glyph.chars, 0, this._config.scaledCharHeight - offset);\n\n // clear the background from the character to avoid issues with drawing over the previous\n // character if it extends past it's bounds\n imageData = this._tmpCtx.getImageData(\n 0, 0, this._config.scaledCharWidth, this._config.scaledCharHeight\n );\n isEmpty = clearColor(imageData, backgroundColor);\n if (!isEmpty) {\n break;\n }\n }\n }\n\n this._tmpCtx.restore();\n\n // copy the data from imageData to _cacheCanvas\n const x = this._toCoordinateX(index);\n const y = this._toCoordinateY(index);\n // putImageData doesn't do any blending, so it will overwrite any existing cache entry for us\n this._cacheCtx.putImageData(imageData, x, y);\n\n // Add the glyph and queue it to the bitmap (if the browser supports it)\n const cacheValue = {\n index,\n isEmpty,\n inBitmap: false\n };\n this._addGlyphToBitmap(cacheValue);\n\n return cacheValue;\n }\n\n private _addGlyphToBitmap(cacheValue: IGlyphCacheValue): void {\n // Support is patchy for createImageBitmap at the moment, pass a canvas back\n // if support is lacking as drawImage works there too. Firefox is also\n // included here as ImageBitmap appears both buggy and has horrible\n // performance (tested on v55).\n if (!('createImageBitmap' in window) || isFirefox || isSafari) {\n return;\n }\n\n // Add the glyph to the queue\n this._glyphsWaitingOnBitmap.push(cacheValue);\n\n // Check if bitmap generation timeout already exists\n if (this._bitmapCommitTimeout !== null) {\n return;\n }\n\n this._bitmapCommitTimeout = window.setTimeout(() => this._generateBitmap(), GLYPH_BITMAP_COMMIT_DELAY);\n }\n\n private _generateBitmap(): void {\n const glyphsMovingToBitmap = this._glyphsWaitingOnBitmap;\n this._glyphsWaitingOnBitmap = [];\n window.createImageBitmap(this._cacheCanvas).then(bitmap => {\n // Set bitmap\n this._bitmap = bitmap;\n\n // Mark all new glyphs as in bitmap, excluding glyphs that came in after\n // the bitmap was requested\n for (let i = 0; i < glyphsMovingToBitmap.length; i++) {\n const value = glyphsMovingToBitmap[i];\n // It doesn't matter if the value was already evicted, it will be\n // released from memory after this block if so.\n value.inBitmap = true;\n }\n });\n this._bitmapCommitTimeout = null;\n }\n}\n\n// This is used for debugging the renderer, just swap out `new DynamicCharAtlas` with\n// `new NoneCharAtlas`.\nexport class NoneCharAtlas extends BaseCharAtlas {\n constructor(document: Document, config: ICharAtlasConfig) {\n super();\n }\n\n public draw(\n ctx: CanvasRenderingContext2D,\n glyph: IGlyphIdentifier,\n x: number,\n y: number\n ): boolean {\n return false;\n }\n}\n\n/**\n * Makes a partiicular rgb color in an ImageData completely transparent.\n * @returns True if the result is \"empty\", meaning all pixels are fully transparent.\n */\nfunction clearColor(imageData: ImageData, color: IColor): boolean {\n let isEmpty = true;\n const r = color.rgba >>> 24;\n const g = color.rgba >>> 16 & 0xFF;\n const b = color.rgba >>> 8 & 0xFF;\n for (let offset = 0; offset < imageData.data.length; offset += 4) {\n if (imageData.data[offset] === r &&\n imageData.data[offset + 1] === g &&\n imageData.data[offset + 2] === b) {\n imageData.data[offset + 3] = 0;\n } else {\n isEmpty = false;\n }\n }\n return isEmpty;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\ninterface ILinkedListNode {\n prev: ILinkedListNode | null;\n next: ILinkedListNode | null;\n key: number | null;\n value: T | null;\n}\n\nexport class LRUMap {\n private _map: { [key: number]: ILinkedListNode } = {};\n private _head: ILinkedListNode | null = null;\n private _tail: ILinkedListNode | null = null;\n private _nodePool: ILinkedListNode[] = [];\n public size: number = 0;\n\n constructor(public capacity: number) { }\n\n private _unlinkNode(node: ILinkedListNode): void {\n const prev = node.prev;\n const next = node.next;\n if (node === this._head) {\n this._head = next;\n }\n if (node === this._tail) {\n this._tail = prev;\n }\n if (prev !== null) {\n prev.next = next;\n }\n if (next !== null) {\n next.prev = prev;\n }\n }\n\n private _appendNode(node: ILinkedListNode): void {\n const tail = this._tail;\n if (tail !== null) {\n tail.next = node;\n }\n node.prev = tail;\n node.next = null;\n this._tail = node;\n if (this._head === null) {\n this._head = node;\n }\n }\n\n /**\n * Preallocate a bunch of linked-list nodes. Allocating these nodes ahead of time means that\n * they're more likely to live next to each other in memory, which seems to improve performance.\n *\n * Each empty object only consumes about 60 bytes of memory, so this is pretty cheap, even for\n * large maps.\n */\n public prealloc(count: number): void {\n const nodePool = this._nodePool;\n for (let i = 0; i < count; i++) {\n nodePool.push({\n prev: null,\n next: null,\n key: null,\n value: null\n });\n }\n }\n\n public get(key: number): T | null {\n // This is unsafe: We're assuming our keyspace doesn't overlap with Object.prototype. However,\n // it's faster than calling hasOwnProperty, and in our case, it would never overlap.\n const node = this._map[key];\n if (node !== undefined) {\n this._unlinkNode(node);\n this._appendNode(node);\n return node.value;\n }\n return null;\n }\n\n /**\n * Gets a value from a key without marking it as the most recently used item.\n */\n public peekValue(key: number): T | null {\n const node = this._map[key];\n if (node !== undefined) {\n return node.value;\n }\n return null;\n }\n\n public peek(): T | null {\n const head = this._head;\n return head === null ? null : head.value;\n }\n\n public set(key: number, value: T): void {\n // This is unsafe: See note above.\n let node = this._map[key];\n if (node !== undefined) {\n // already exists, we just need to mutate it and move it to the end of the list\n node = this._map[key];\n this._unlinkNode(node);\n node.value = value;\n } else if (this.size >= this.capacity) {\n // we're out of space: recycle the head node, move it to the tail\n node = this._head!;\n this._unlinkNode(node);\n delete this._map[node.key!];\n node.key = key;\n node.value = value;\n this._map[key] = node;\n } else {\n // make a new element\n const nodePool = this._nodePool;\n if (nodePool.length > 0) {\n // use a preallocated node if we can\n node = nodePool.pop()!;\n node.key = key;\n node.value = value;\n } else {\n node = {\n prev: null,\n next: null,\n key,\n value\n };\n }\n this._map[key] = node;\n this.size++;\n }\n this._appendNode(node);\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderer, IRenderDimensions, IRequestRedrawEvent } from 'browser/renderer/Types';\nimport { BOLD_CLASS, ITALIC_CLASS, CURSOR_CLASS, CURSOR_STYLE_BLOCK_CLASS, CURSOR_BLINK_CLASS, CURSOR_STYLE_BAR_CLASS, CURSOR_STYLE_UNDERLINE_CLASS, DomRendererRowFactory } from 'browser/renderer/dom/DomRendererRowFactory';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';\nimport { Disposable } from 'common/Lifecycle';\nimport { IColorSet, ILinkifierEvent, ILinkifier, ILinkifier2 } from 'browser/Types';\nimport { ICharSizeService } from 'browser/services/Services';\nimport { IOptionsService, IBufferService, IInstantiationService, IDecorationService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { color } from 'common/Color';\nimport { removeElementFromParent } from 'browser/Dom';\n\nconst TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-';\nconst ROW_CONTAINER_CLASS = 'xterm-rows';\nconst FG_CLASS_PREFIX = 'xterm-fg-';\nconst BG_CLASS_PREFIX = 'xterm-bg-';\nconst FOCUS_CLASS = 'xterm-focus';\nconst SELECTION_CLASS = 'xterm-selection';\n\nlet nextTerminalId = 1;\n\n/**\n * A fallback renderer for when canvas is slow. This is not meant to be\n * particularly fast or feature complete, more just stable and usable for when\n * canvas is not an option.\n */\nexport class DomRenderer extends Disposable implements IRenderer {\n private _rowFactory: DomRendererRowFactory;\n private _terminalClass: number = nextTerminalId++;\n\n private _themeStyleElement!: HTMLStyleElement;\n private _dimensionsStyleElement!: HTMLStyleElement;\n private _rowContainer: HTMLElement;\n private _rowElements: HTMLElement[] = [];\n private _selectionContainer: HTMLElement;\n\n public dimensions: IRenderDimensions;\n\n public get onRequestRedraw(): IEvent { return new EventEmitter().event; }\n\n constructor(\n private _colors: IColorSet,\n private readonly _element: HTMLElement,\n private readonly _screenElement: HTMLElement,\n private readonly _viewportElement: HTMLElement,\n private readonly _linkifier: ILinkifier,\n private readonly _linkifier2: ILinkifier2,\n @IInstantiationService instantiationService: IInstantiationService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n super();\n this._rowContainer = document.createElement('div');\n this._rowContainer.classList.add(ROW_CONTAINER_CLASS);\n this._rowContainer.style.lineHeight = 'normal';\n this._rowContainer.setAttribute('aria-hidden', 'true');\n this._refreshRowElements(this._bufferService.cols, this._bufferService.rows);\n this._selectionContainer = document.createElement('div');\n this._selectionContainer.classList.add(SELECTION_CLASS);\n this._selectionContainer.setAttribute('aria-hidden', 'true');\n\n this.dimensions = {\n scaledCharWidth: 0,\n scaledCharHeight: 0,\n scaledCellWidth: 0,\n scaledCellHeight: 0,\n scaledCharLeft: 0,\n scaledCharTop: 0,\n scaledCanvasWidth: 0,\n scaledCanvasHeight: 0,\n canvasWidth: 0,\n canvasHeight: 0,\n actualCellWidth: 0,\n actualCellHeight: 0\n };\n this._updateDimensions();\n this._injectCss();\n\n this._rowFactory = instantiationService.createInstance(DomRendererRowFactory, document, this._colors);\n\n this._element.classList.add(TERMINAL_CLASS_PREFIX + this._terminalClass);\n this._screenElement.appendChild(this._rowContainer);\n this._screenElement.appendChild(this._selectionContainer);\n\n this.register(this._linkifier.onShowLinkUnderline(e => this._onLinkHover(e)));\n this.register(this._linkifier.onHideLinkUnderline(e => this._onLinkLeave(e)));\n\n this.register(this._linkifier2.onShowLinkUnderline(e => this._onLinkHover(e)));\n this.register(this._linkifier2.onHideLinkUnderline(e => this._onLinkLeave(e)));\n }\n\n public dispose(): void {\n this._element.classList.remove(TERMINAL_CLASS_PREFIX + this._terminalClass);\n\n // Outside influences such as React unmounts may manipulate the DOM before our disposal.\n // https://github.com/xtermjs/xterm.js/issues/2960\n removeElementFromParent(this._rowContainer, this._selectionContainer, this._themeStyleElement, this._dimensionsStyleElement);\n\n super.dispose();\n }\n\n private _updateDimensions(): void {\n this.dimensions.scaledCharWidth = this._charSizeService.width * window.devicePixelRatio;\n this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * window.devicePixelRatio);\n this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.rawOptions.letterSpacing);\n this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.rawOptions.lineHeight);\n this.dimensions.scaledCharLeft = 0;\n this.dimensions.scaledCharTop = 0;\n this.dimensions.scaledCanvasWidth = this.dimensions.scaledCellWidth * this._bufferService.cols;\n this.dimensions.scaledCanvasHeight = this.dimensions.scaledCellHeight * this._bufferService.rows;\n this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / window.devicePixelRatio);\n this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / window.devicePixelRatio);\n this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols;\n this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows;\n\n for (const element of this._rowElements) {\n element.style.width = `${this.dimensions.canvasWidth}px`;\n element.style.height = `${this.dimensions.actualCellHeight}px`;\n element.style.lineHeight = `${this.dimensions.actualCellHeight}px`;\n // Make sure rows don't overflow onto following row\n element.style.overflow = 'hidden';\n }\n\n if (!this._dimensionsStyleElement) {\n this._dimensionsStyleElement = document.createElement('style');\n this._screenElement.appendChild(this._dimensionsStyleElement);\n }\n\n const styles =\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} span {` +\n ` display: inline-block;` +\n ` height: 100%;` +\n ` vertical-align: top;` +\n ` width: ${this.dimensions.actualCellWidth}px` +\n `}`;\n\n this._dimensionsStyleElement.textContent = styles;\n\n this._selectionContainer.style.height = this._viewportElement.style.height;\n this._screenElement.style.width = `${this.dimensions.canvasWidth}px`;\n this._screenElement.style.height = `${this.dimensions.canvasHeight}px`;\n }\n\n public setColors(colors: IColorSet): void {\n this._colors = colors;\n this._injectCss();\n }\n\n private _injectCss(): void {\n if (!this._themeStyleElement) {\n this._themeStyleElement = document.createElement('style');\n this._screenElement.appendChild(this._themeStyleElement);\n }\n\n // Base CSS\n let styles =\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} {` +\n ` color: ${this._colors.foreground.css};` +\n ` font-family: ${this._optionsService.rawOptions.fontFamily};` +\n ` font-size: ${this._optionsService.rawOptions.fontSize}px;` +\n `}`;\n // Text styles\n styles +=\n `${this._terminalSelector} span:not(.${BOLD_CLASS}) {` +\n ` font-weight: ${this._optionsService.rawOptions.fontWeight};` +\n `}` +\n `${this._terminalSelector} span.${BOLD_CLASS} {` +\n ` font-weight: ${this._optionsService.rawOptions.fontWeightBold};` +\n `}` +\n `${this._terminalSelector} span.${ITALIC_CLASS} {` +\n ` font-style: italic;` +\n `}`;\n // Blink animation\n styles +=\n `@keyframes blink_box_shadow` + `_` + this._terminalClass + ` {` +\n ` 50% {` +\n ` box-shadow: none;` +\n ` }` +\n `}`;\n styles +=\n `@keyframes blink_block` + `_` + this._terminalClass + ` {` +\n ` 0% {` +\n ` background-color: ${this._colors.cursor.css};` +\n ` color: ${this._colors.cursorAccent.css};` +\n ` }` +\n ` 50% {` +\n ` background-color: ${this._colors.cursorAccent.css};` +\n ` color: ${this._colors.cursor.css};` +\n ` }` +\n `}`;\n // Cursor\n styles +=\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}:not(.${FOCUS_CLASS}) .${CURSOR_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` outline: 1px solid ${this._colors.cursor.css};` +\n ` outline-offset: -1px;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_BLINK_CLASS}:not(.${CURSOR_STYLE_BLOCK_CLASS}) {` +\n ` animation: blink_box_shadow` + `_` + this._terminalClass + ` 1s step-end infinite;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_BLINK_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` animation: blink_block` + `_` + this._terminalClass + ` 1s step-end infinite;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` background-color: ${this._colors.cursor.css};` +\n ` color: ${this._colors.cursorAccent.css};` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_BAR_CLASS} {` +\n ` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_UNDERLINE_CLASS} {` +\n ` box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;` +\n `}`;\n // Selection\n styles +=\n `${this._terminalSelector} .${SELECTION_CLASS} {` +\n ` position: absolute;` +\n ` top: 0;` +\n ` left: 0;` +\n ` z-index: 1;` +\n ` pointer-events: none;` +\n `}` +\n `${this._terminalSelector} .${SELECTION_CLASS} div {` +\n ` position: absolute;` +\n ` background-color: ${this._colors.selectionOpaque.css};` +\n `}`;\n // Colors\n this._colors.ansi.forEach((c, i) => {\n styles +=\n `${this._terminalSelector} .${FG_CLASS_PREFIX}${i} { color: ${c.css}; }` +\n `${this._terminalSelector} .${BG_CLASS_PREFIX}${i} { background-color: ${c.css}; }`;\n });\n styles +=\n `${this._terminalSelector} .${FG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { color: ${color.opaque(this._colors.background).css}; }` +\n `${this._terminalSelector} .${BG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`;\n\n this._themeStyleElement.textContent = styles;\n }\n\n public onDevicePixelRatioChange(): void {\n this._updateDimensions();\n }\n\n private _refreshRowElements(cols: number, rows: number): void {\n // Add missing elements\n for (let i = this._rowElements.length; i <= rows; i++) {\n const row = document.createElement('div');\n this._rowContainer.appendChild(row);\n this._rowElements.push(row);\n }\n // Remove excess elements\n while (this._rowElements.length > rows) {\n this._rowContainer.removeChild(this._rowElements.pop()!);\n }\n }\n\n public onResize(cols: number, rows: number): void {\n this._refreshRowElements(cols, rows);\n this._updateDimensions();\n }\n\n public onCharSizeChanged(): void {\n this._updateDimensions();\n }\n\n public onBlur(): void {\n this._rowContainer.classList.remove(FOCUS_CLASS);\n }\n\n public onFocus(): void {\n this._rowContainer.classList.add(FOCUS_CLASS);\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n // Remove all selections\n while (this._selectionContainer.children.length) {\n this._selectionContainer.removeChild(this._selectionContainer.children[0]);\n }\n\n this._rowFactory.onSelectionChanged(start, end, columnSelectMode);\n this.renderRows(0, this._bufferService.rows - 1);\n\n // Selection does not exist\n if (!start || !end) {\n return;\n }\n\n // Translate from buffer position to viewport position\n const viewportStartRow = start[1] - this._bufferService.buffer.ydisp;\n const viewportEndRow = end[1] - this._bufferService.buffer.ydisp;\n const viewportCappedStartRow = Math.max(viewportStartRow, 0);\n const viewportCappedEndRow = Math.min(viewportEndRow, this._bufferService.rows - 1);\n\n // No need to draw the selection\n if (viewportCappedStartRow >= this._bufferService.rows || viewportCappedEndRow < 0) {\n return;\n }\n\n // Create the selections\n const documentFragment = document.createDocumentFragment();\n\n if (columnSelectMode) {\n const isXFlipped = start[0] > end[0];\n documentFragment.appendChild(\n this._createSelectionElement(viewportCappedStartRow, isXFlipped ? end[0] : start[0], isXFlipped ? start[0] : end[0], viewportCappedEndRow - viewportCappedStartRow + 1)\n );\n } else {\n // Draw first row\n const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;\n const endCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow, startCol, endCol));\n // Draw middle rows\n const middleRowsCount = viewportCappedEndRow - viewportCappedStartRow - 1;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow + 1, 0, this._bufferService.cols, middleRowsCount));\n // Draw final row\n if (viewportCappedStartRow !== viewportCappedEndRow) {\n // Only draw viewportEndRow if it's not the same as viewporttartRow\n const endCol = viewportEndRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedEndRow, 0, endCol));\n }\n }\n this._selectionContainer.appendChild(documentFragment);\n }\n\n /**\n * Creates a selection element at the specified position.\n * @param row The row of the selection.\n * @param colStart The start column.\n * @param colEnd The end columns.\n */\n private _createSelectionElement(row: number, colStart: number, colEnd: number, rowCount: number = 1): HTMLElement {\n const element = document.createElement('div');\n element.style.height = `${rowCount * this.dimensions.actualCellHeight}px`;\n element.style.top = `${row * this.dimensions.actualCellHeight}px`;\n element.style.left = `${colStart * this.dimensions.actualCellWidth}px`;\n element.style.width = `${this.dimensions.actualCellWidth * (colEnd - colStart)}px`;\n return element;\n }\n\n public onCursorMove(): void {\n // No-op, the cursor is drawn when rows are drawn\n }\n\n public onOptionsChanged(): void {\n // Force a refresh\n this._updateDimensions();\n this._injectCss();\n }\n\n public clear(): void {\n for (const e of this._rowElements) {\n e.innerText = '';\n }\n }\n\n public renderRows(start: number, end: number): void {\n const cursorAbsoluteY = this._bufferService.buffer.ybase + this._bufferService.buffer.y;\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n const cursorBlink = this._optionsService.rawOptions.cursorBlink;\n\n for (let y = start; y <= end; y++) {\n const rowElement = this._rowElements[y];\n rowElement.innerText = '';\n const row = y + this._bufferService.buffer.ydisp;\n const lineData = this._bufferService.buffer.lines.get(row);\n const cursorStyle = this._optionsService.rawOptions.cursorStyle;\n rowElement.appendChild(this._rowFactory.createRow(lineData!, row, row === cursorAbsoluteY, cursorStyle, cursorX, cursorBlink, this.dimensions.actualCellWidth, this._bufferService.cols));\n }\n }\n\n private get _terminalSelector(): string {\n return `.${TERMINAL_CLASS_PREFIX}${this._terminalClass}`;\n }\n\n private _onLinkHover(e: ILinkifierEvent): void {\n this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, true);\n }\n\n private _onLinkLeave(e: ILinkifierEvent): void {\n this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, false);\n }\n\n private _setCellUnderline(x: number, x2: number, y: number, y2: number, cols: number, enabled: boolean): void {\n while (x !== x2 || y !== y2) {\n const row = this._rowElements[y];\n if (!row) {\n return;\n }\n const span = row.children[x] as HTMLElement;\n if (span) {\n span.style.textDecoration = enabled ? 'underline' : 'none';\n }\n if (++x >= cols) {\n x = 0;\n y++;\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferLine, ICellData, IColor } from 'common/Types';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';\nimport { NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Attributes } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService, ICoreService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { color, rgba } from 'common/Color';\nimport { IColorSet } from 'browser/Types';\nimport { ICharacterJoinerService, ISelectionService } from 'browser/services/Services';\nimport { JoinedCellData } from 'browser/services/CharacterJoinerService';\nimport { excludeFromContrastRatioDemands } from 'browser/renderer/RendererUtils';\n\nexport const BOLD_CLASS = 'xterm-bold';\nexport const DIM_CLASS = 'xterm-dim';\nexport const ITALIC_CLASS = 'xterm-italic';\nexport const UNDERLINE_CLASS = 'xterm-underline';\nexport const STRIKETHROUGH_CLASS = 'xterm-strikethrough';\nexport const CURSOR_CLASS = 'xterm-cursor';\nexport const CURSOR_BLINK_CLASS = 'xterm-cursor-blink';\nexport const CURSOR_STYLE_BLOCK_CLASS = 'xterm-cursor-block';\nexport const CURSOR_STYLE_BAR_CLASS = 'xterm-cursor-bar';\nexport const CURSOR_STYLE_UNDERLINE_CLASS = 'xterm-cursor-underline';\n\nexport class DomRendererRowFactory {\n private _workCell: CellData = new CellData();\n\n private _selectionStart: [number, number] | undefined;\n private _selectionEnd: [number, number] | undefined;\n private _columnSelectMode: boolean = false;\n\n constructor(\n private readonly _document: Document,\n private _colors: IColorSet,\n @ICharacterJoinerService private readonly _characterJoinerService: ICharacterJoinerService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICoreService private readonly _coreService: ICoreService,\n @IDecorationService private readonly _decorationService: IDecorationService\n ) {\n }\n\n public setColors(colors: IColorSet): void {\n this._colors = colors;\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n this._selectionStart = start;\n this._selectionEnd = end;\n this._columnSelectMode = columnSelectMode;\n }\n\n public createRow(lineData: IBufferLine, row: number, isCursorRow: boolean, cursorStyle: string | undefined, cursorX: number, cursorBlink: boolean, cellWidth: number, cols: number): DocumentFragment {\n const fragment = this._document.createDocumentFragment();\n\n const joinedRanges = this._characterJoinerService.getJoinedCharacters(row);\n // Find the line length first, this prevents the need to output a bunch of\n // empty cells at the end. This cannot easily be integrated into the main\n // loop below because of the colCount feature (which can be removed after we\n // properly support reflow and disallow data to go beyond the right-side of\n // the viewport).\n let lineLength = 0;\n for (let x = Math.min(lineData.length, cols) - 1; x >= 0; x--) {\n if (lineData.loadCell(x, this._workCell).getCode() !== NULL_CELL_CODE || (isCursorRow && x === cursorX)) {\n lineLength = x + 1;\n break;\n }\n }\n\n for (let x = 0; x < lineLength; x++) {\n lineData.loadCell(x, this._workCell);\n let width = this._workCell.getWidth();\n\n // The character to the left is a wide character, drawing is owned by the char at x-1\n if (width === 0) {\n continue;\n }\n\n // If true, indicates that the current character(s) to draw were joined.\n let isJoined = false;\n let lastCharX = x;\n\n // Process any joined character ranges as needed. Because of how the\n // ranges are produced, we know that they are valid for the characters\n // and attributes of our input.\n let cell = this._workCell;\n if (joinedRanges.length > 0 && x === joinedRanges[0][0]) {\n isJoined = true;\n const range = joinedRanges.shift()!;\n\n // We already know the exact start and end column of the joined range,\n // so we get the string and width representing it directly\n cell = new JoinedCellData(\n this._workCell,\n lineData.translateToString(true, range[0], range[1]),\n range[1] - range[0]\n );\n\n // Skip over the cells occupied by this range in the loop\n lastCharX = range[1] - 1;\n\n // Recalculate width\n width = cell.getWidth();\n }\n\n const charElement = this._document.createElement('span');\n if (width > 1) {\n charElement.style.width = `${cellWidth * width}px`;\n }\n\n if (isJoined) {\n // Ligatures in the DOM renderer must use display inline, as they may not show with\n // inline-block if they are outside the bounds of the element\n charElement.style.display = 'inline';\n\n // The DOM renderer colors the background of the cursor but for ligatures all cells are\n // joined. The workaround here is to show a cursor around the whole ligature so it shows up,\n // the cursor looks the same when on any character of the ligature though\n if (cursorX >= x && cursorX <= lastCharX) {\n cursorX = x;\n }\n }\n\n if (!this._coreService.isCursorHidden && isCursorRow && x === cursorX) {\n charElement.classList.add(CURSOR_CLASS);\n\n if (cursorBlink) {\n charElement.classList.add(CURSOR_BLINK_CLASS);\n }\n\n switch (cursorStyle) {\n case 'bar':\n charElement.classList.add(CURSOR_STYLE_BAR_CLASS);\n break;\n case 'underline':\n charElement.classList.add(CURSOR_STYLE_UNDERLINE_CLASS);\n break;\n default:\n charElement.classList.add(CURSOR_STYLE_BLOCK_CLASS);\n break;\n }\n }\n\n if (cell.isBold()) {\n charElement.classList.add(BOLD_CLASS);\n }\n\n if (cell.isItalic()) {\n charElement.classList.add(ITALIC_CLASS);\n }\n\n if (cell.isDim()) {\n charElement.classList.add(DIM_CLASS);\n }\n\n if (cell.isUnderline()) {\n charElement.classList.add(UNDERLINE_CLASS);\n }\n\n if (cell.isInvisible()) {\n charElement.textContent = WHITESPACE_CELL_CHAR;\n } else {\n charElement.textContent = cell.getChars() || WHITESPACE_CELL_CHAR;\n }\n\n if (cell.isStrikethrough()) {\n charElement.classList.add(STRIKETHROUGH_CLASS);\n }\n\n let fg = cell.getFgColor();\n let fgColorMode = cell.getFgColorMode();\n let bg = cell.getBgColor();\n let bgColorMode = cell.getBgColorMode();\n const isInverse = !!cell.isInverse();\n if (isInverse) {\n const temp = fg;\n fg = bg;\n bg = temp;\n const temp2 = fgColorMode;\n fgColorMode = bgColorMode;\n bgColorMode = temp2;\n }\n\n // Apply any decoration foreground/background overrides, this must happen after inverse has\n // been applied\n let bgOverride: IColor | undefined;\n let fgOverride: IColor | undefined;\n let isTop = false;\n for (const d of this._decorationService.getDecorationsAtCell(x, row)) {\n if (d.options.layer !== 'top' && isTop) {\n continue;\n }\n if (d.backgroundColorRGB) {\n bgColorMode = Attributes.CM_RGB;\n bg = d.backgroundColorRGB.rgba >> 8 & 0xFFFFFF;\n bgOverride = d.backgroundColorRGB;\n }\n if (d.foregroundColorRGB) {\n fgColorMode = Attributes.CM_RGB;\n fg = d.foregroundColorRGB.rgba >> 8 & 0xFFFFFF;\n fgOverride = d.foregroundColorRGB;\n }\n isTop = d.options.layer === 'top';\n }\n\n // Apply selection foreground if applicable\n const isInSelection = this._isCellInSelection(x, row);\n if (!isTop) {\n if (this._colors.selectionForeground && isInSelection) {\n fgColorMode = Attributes.CM_RGB;\n fg = this._colors.selectionForeground.rgba >> 8 & 0xFFFFFF;\n fgOverride = this._colors.selectionForeground;\n }\n }\n\n // If in the selection, force the element to be above the selection to improve contrast and\n // support opaque selections\n if (isInSelection) {\n bgOverride = this._colors.selectionOpaque;\n isTop = true;\n }\n\n // If it's a top decoration, render above the selection\n if (isTop) {\n charElement.classList.add(`xterm-decoration-top`);\n }\n\n // Background\n let resolvedBg: IColor;\n switch (bgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n resolvedBg = this._colors.ansi[bg];\n charElement.classList.add(`xterm-bg-${bg}`);\n break;\n case Attributes.CM_RGB:\n resolvedBg = rgba.toColor(bg >> 16, bg >> 8 & 0xFF, bg & 0xFF);\n this._addStyle(charElement, `background-color:#${padStart((bg >>> 0).toString(16), '0', 6)}`);\n break;\n case Attributes.CM_DEFAULT:\n default:\n if (isInverse) {\n resolvedBg = this._colors.foreground;\n charElement.classList.add(`xterm-bg-${INVERTED_DEFAULT_COLOR}`);\n } else {\n resolvedBg = this._colors.background;\n }\n }\n\n // Foreground\n switch (fgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n if (cell.isBold() && fg < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors) {\n fg += 8;\n }\n if (!this._applyMinimumContrast(charElement, resolvedBg, this._colors.ansi[fg], cell, bgOverride, undefined)) {\n charElement.classList.add(`xterm-fg-${fg}`);\n }\n break;\n case Attributes.CM_RGB:\n const color = rgba.toColor(\n (fg >> 16) & 0xFF,\n (fg >> 8) & 0xFF,\n (fg ) & 0xFF\n );\n if (!this._applyMinimumContrast(charElement, resolvedBg, color, cell, bgOverride, fgOverride)) {\n this._addStyle(charElement, `color:#${padStart(fg.toString(16), '0', 6)}`);\n }\n break;\n case Attributes.CM_DEFAULT:\n default:\n if (!this._applyMinimumContrast(charElement, resolvedBg, this._colors.foreground, cell, bgOverride, undefined)) {\n if (isInverse) {\n charElement.classList.add(`xterm-fg-${INVERTED_DEFAULT_COLOR}`);\n }\n }\n }\n\n fragment.appendChild(charElement);\n\n x = lastCharX;\n }\n return fragment;\n }\n\n private _applyMinimumContrast(element: HTMLElement, bg: IColor, fg: IColor, cell: ICellData, bgOverride: IColor | undefined, fgOverride: IColor | undefined): boolean {\n if (this._optionsService.rawOptions.minimumContrastRatio === 1 || excludeFromContrastRatioDemands(cell.getCode())) {\n return false;\n }\n\n // Try get from cache first, only use the cache when there are no decoration overrides\n let adjustedColor: IColor | undefined | null = undefined;\n if (!bgOverride && !fgOverride) {\n adjustedColor = this._colors.contrastCache.getColor(bg.rgba, fg.rgba);\n }\n\n // Calculate and store in cache\n if (adjustedColor === undefined) {\n adjustedColor = color.ensureContrastRatio(bgOverride || bg, fgOverride || fg, this._optionsService.rawOptions.minimumContrastRatio);\n this._colors.contrastCache.setColor((bgOverride || bg).rgba, (fgOverride || fg).rgba, adjustedColor ?? null);\n }\n\n if (adjustedColor) {\n this._addStyle(element, `color:${adjustedColor.css}`);\n return true;\n }\n\n return false;\n }\n\n private _addStyle(element: HTMLElement, style: string): void {\n element.setAttribute('style', `${element.getAttribute('style') || ''}${style};`);\n }\n\n private _isCellInSelection(x: number, y: number): boolean {\n const start = this._selectionStart;\n const end = this._selectionEnd;\n if (!start || !end) {\n return false;\n }\n if (this._columnSelectMode) {\n if (start[0] <= end[0]) {\n return x >= start[0] && y >= start[1] &&\n x < end[0] && y <= end[1];\n }\n return x < start[0] && y >= start[1] &&\n x >= end[0] && y <= end[1];\n }\n return (y > start[1] && y < end[1]) ||\n (start[1] === end[1] && y === start[1] && x >= start[0] && x < end[0]) ||\n (start[1] < end[1] && y === end[1] && x < end[0]) ||\n (start[1] < end[1] && y === start[1] && x >= start[0]);\n }\n}\n\nfunction padStart(text: string, padChar: string, length: number): string {\n while (text.length < length) {\n text = padChar + text;\n }\n return text;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferService } from 'common/services/Services';\n\n/**\n * Represents a selection within the buffer. This model only cares about column\n * and row coordinates, not wide characters.\n */\nexport class SelectionModel {\n /**\n * Whether select all is currently active.\n */\n public isSelectAllActive: boolean = false;\n\n /**\n * The minimal length of the selection from the start position. When double\n * clicking on a word, the word will be selected which makes the selection\n * start at the start of the word and makes this variable the length.\n */\n public selectionStartLength: number = 0;\n\n /**\n * The [x, y] position the selection starts at.\n */\n public selectionStart: [number, number] | undefined;\n\n /**\n * The [x, y] position the selection ends at.\n */\n public selectionEnd: [number, number] | undefined;\n\n constructor(\n private _bufferService: IBufferService\n ) {\n }\n\n /**\n * Clears the current selection.\n */\n public clearSelection(): void {\n this.selectionStart = undefined;\n this.selectionEnd = undefined;\n this.isSelectAllActive = false;\n this.selectionStartLength = 0;\n }\n\n /**\n * The final selection start, taking into consideration select all.\n */\n public get finalSelectionStart(): [number, number] | undefined {\n if (this.isSelectAllActive) {\n return [0, 0];\n }\n\n if (!this.selectionEnd || !this.selectionStart) {\n return this.selectionStart;\n }\n\n return this.areSelectionValuesReversed() ? this.selectionEnd : this.selectionStart;\n }\n\n /**\n * The final selection end, taking into consideration select all, double click\n * word selection and triple click line selection.\n */\n public get finalSelectionEnd(): [number, number] | undefined {\n if (this.isSelectAllActive) {\n return [this._bufferService.cols, this._bufferService.buffer.ybase + this._bufferService.rows - 1];\n }\n\n if (!this.selectionStart) {\n return undefined;\n }\n\n // Use the selection start + length if the end doesn't exist or they're reversed\n if (!this.selectionEnd || this.areSelectionValuesReversed()) {\n const startPlusLength = this.selectionStart[0] + this.selectionStartLength;\n if (startPlusLength > this._bufferService.cols) {\n // Ensure the trailing EOL isn't included when the selection ends on the right edge\n if (startPlusLength % this._bufferService.cols === 0) {\n return [this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols) - 1];\n }\n return [startPlusLength % this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols)];\n }\n return [startPlusLength, this.selectionStart[1]];\n }\n\n // Ensure the the word/line is selected after a double/triple click\n if (this.selectionStartLength) {\n // Select the larger of the two when start and end are on the same line\n if (this.selectionEnd[1] === this.selectionStart[1]) {\n // Keep the whole wrapped word/line selected if the content wraps multiple lines\n const startPlusLength = this.selectionStart[0] + this.selectionStartLength;\n if (startPlusLength > this._bufferService.cols) {\n return [startPlusLength % this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols)];\n }\n return [Math.max(startPlusLength, this.selectionEnd[0]), this.selectionEnd[1]];\n }\n }\n return this.selectionEnd;\n }\n\n /**\n * Returns whether the selection start and end are reversed.\n */\n public areSelectionValuesReversed(): boolean {\n const start = this.selectionStart;\n const end = this.selectionEnd;\n if (!start || !end) {\n return false;\n }\n return start[1] > end[1] || (start[1] === end[1] && start[0] > end[0]);\n }\n\n /**\n * Handle the buffer being trimmed, adjust the selection position.\n * @param amount The amount the buffer is being trimmed.\n * @return Whether a refresh is necessary.\n */\n public onTrim(amount: number): boolean {\n // Adjust the selection position based on the trimmed amount.\n if (this.selectionStart) {\n this.selectionStart[1] -= amount;\n }\n if (this.selectionEnd) {\n this.selectionEnd[1] -= amount;\n }\n\n // The selection has moved off the buffer, clear it.\n if (this.selectionEnd && this.selectionEnd[1] < 0) {\n this.clearSelection();\n return true;\n }\n\n // If the selection start is trimmed, ensure the start column is 0.\n if (this.selectionStart && this.selectionStart[1] < 0) {\n this.selectionStart[1] = 0;\n }\n return false;\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOptionsService } from 'common/services/Services';\nimport { IEvent, EventEmitter } from 'common/EventEmitter';\nimport { ICharSizeService } from 'browser/services/Services';\n\nexport class CharSizeService implements ICharSizeService {\n public serviceBrand: undefined;\n\n public width: number = 0;\n public height: number = 0;\n private _measureStrategy: IMeasureStrategy;\n\n public get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }\n\n private _onCharSizeChange = new EventEmitter();\n public get onCharSizeChange(): IEvent { return this._onCharSizeChange.event; }\n\n constructor(\n document: Document,\n parentElement: HTMLElement,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n this._measureStrategy = new DomMeasureStrategy(document, parentElement, this._optionsService);\n }\n\n public measure(): void {\n const result = this._measureStrategy.measure();\n if (result.width !== this.width || result.height !== this.height) {\n this.width = result.width;\n this.height = result.height;\n this._onCharSizeChange.fire();\n }\n }\n}\n\ninterface IMeasureStrategy {\n measure(): IReadonlyMeasureResult;\n}\n\ninterface IReadonlyMeasureResult {\n readonly width: number;\n readonly height: number;\n}\n\ninterface IMeasureResult {\n width: number;\n height: number;\n}\n\n// TODO: For supporting browsers we should also provide a CanvasCharDimensionsProvider that uses ctx.measureText\nclass DomMeasureStrategy implements IMeasureStrategy {\n private _result: IMeasureResult = { width: 0, height: 0 };\n private _measureElement: HTMLElement;\n\n constructor(\n private _document: Document,\n private _parentElement: HTMLElement,\n private _optionsService: IOptionsService\n ) {\n this._measureElement = this._document.createElement('span');\n this._measureElement.classList.add('xterm-char-measure-element');\n this._measureElement.textContent = 'W';\n this._measureElement.setAttribute('aria-hidden', 'true');\n this._parentElement.appendChild(this._measureElement);\n }\n\n public measure(): IReadonlyMeasureResult {\n this._measureElement.style.fontFamily = this._optionsService.rawOptions.fontFamily;\n this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`;\n\n // Note that this triggers a synchronous layout\n const geometry = this._measureElement.getBoundingClientRect();\n\n // If values are 0 then the element is likely currently display:none, in which case we should\n // retain the previous value.\n if (geometry.width !== 0 && geometry.height !== 0) {\n this._result.width = geometry.width;\n this._result.height = Math.ceil(geometry.height);\n }\n\n return this._result;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferLine, ICellData, CharData } from 'common/Types';\nimport { ICharacterJoiner } from 'browser/Types';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { WHITESPACE_CELL_CHAR, Content } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService } from 'common/services/Services';\nimport { ICharacterJoinerService } from 'browser/services/Services';\n\nexport class JoinedCellData extends AttributeData implements ICellData {\n private _width: number;\n // .content carries no meaning for joined CellData, simply nullify it\n // thus we have to overload all other .content accessors\n public content: number = 0;\n public fg: number;\n public bg: number;\n public combinedData: string = '';\n\n constructor(firstCell: ICellData, chars: string, width: number) {\n super();\n this.fg = firstCell.fg;\n this.bg = firstCell.bg;\n this.combinedData = chars;\n this._width = width;\n }\n\n public isCombined(): number {\n // always mark joined cell data as combined\n return Content.IS_COMBINED_MASK;\n }\n\n public getWidth(): number {\n return this._width;\n }\n\n public getChars(): string {\n return this.combinedData;\n }\n\n public getCode(): number {\n // code always gets the highest possible fake codepoint (read as -1)\n // this is needed as code is used by caches as identifier\n return 0x1FFFFF;\n }\n\n public setFromCharData(value: CharData): void {\n throw new Error('not implemented');\n }\n\n public getAsCharData(): CharData {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }\n}\n\nexport class CharacterJoinerService implements ICharacterJoinerService {\n public serviceBrand: undefined;\n\n private _characterJoiners: ICharacterJoiner[] = [];\n private _nextCharacterJoinerId: number = 0;\n private _workCell: CellData = new CellData();\n\n constructor(\n @IBufferService private _bufferService: IBufferService\n ) { }\n\n public register(handler: (text: string) => [number, number][]): number {\n const joiner: ICharacterJoiner = {\n id: this._nextCharacterJoinerId++,\n handler\n };\n\n this._characterJoiners.push(joiner);\n return joiner.id;\n }\n\n public deregister(joinerId: number): boolean {\n for (let i = 0; i < this._characterJoiners.length; i++) {\n if (this._characterJoiners[i].id === joinerId) {\n this._characterJoiners.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n public getJoinedCharacters(row: number): [number, number][] {\n if (this._characterJoiners.length === 0) {\n return [];\n }\n\n const line = this._bufferService.buffer.lines.get(row);\n if (!line || line.length === 0) {\n return [];\n }\n\n const ranges: [number, number][] = [];\n const lineStr = line.translateToString(true);\n\n // Because some cells can be represented by multiple javascript characters,\n // we track the cell and the string indexes separately. This allows us to\n // translate the string ranges we get from the joiners back into cell ranges\n // for use when rendering\n let rangeStartColumn = 0;\n let currentStringIndex = 0;\n let rangeStartStringIndex = 0;\n let rangeAttrFG = line.getFg(0);\n let rangeAttrBG = line.getBg(0);\n\n for (let x = 0; x < line.getTrimmedLength(); x++) {\n line.loadCell(x, this._workCell);\n\n if (this._workCell.getWidth() === 0) {\n // If this character is of width 0, skip it.\n continue;\n }\n\n // End of range\n if (this._workCell.fg !== rangeAttrFG || this._workCell.bg !== rangeAttrBG) {\n // If we ended up with a sequence of more than one character,\n // look for ranges to join.\n if (x - rangeStartColumn > 1) {\n const joinedRanges = this._getJoinedRanges(\n lineStr,\n rangeStartStringIndex,\n currentStringIndex,\n line,\n rangeStartColumn\n );\n for (let i = 0; i < joinedRanges.length; i++) {\n ranges.push(joinedRanges[i]);\n }\n }\n\n // Reset our markers for a new range.\n rangeStartColumn = x;\n rangeStartStringIndex = currentStringIndex;\n rangeAttrFG = this._workCell.fg;\n rangeAttrBG = this._workCell.bg;\n }\n\n currentStringIndex += this._workCell.getChars().length || WHITESPACE_CELL_CHAR.length;\n }\n\n // Process any trailing ranges.\n if (this._bufferService.cols - rangeStartColumn > 1) {\n const joinedRanges = this._getJoinedRanges(\n lineStr,\n rangeStartStringIndex,\n currentStringIndex,\n line,\n rangeStartColumn\n );\n for (let i = 0; i < joinedRanges.length; i++) {\n ranges.push(joinedRanges[i]);\n }\n }\n\n return ranges;\n }\n\n /**\n * Given a segment of a line of text, find all ranges of text that should be\n * joined in a single rendering unit. Ranges are internally converted to\n * column ranges, rather than string ranges.\n * @param line String representation of the full line of text\n * @param startIndex Start position of the range to search in the string (inclusive)\n * @param endIndex End position of the range to search in the string (exclusive)\n */\n private _getJoinedRanges(line: string, startIndex: number, endIndex: number, lineData: IBufferLine, startCol: number): [number, number][] {\n const text = line.substring(startIndex, endIndex);\n // At this point we already know that there is at least one joiner so\n // we can just pull its value and assign it directly rather than\n // merging it into an empty array, which incurs unnecessary writes.\n let allJoinedRanges: [number, number][] = [];\n try {\n allJoinedRanges = this._characterJoiners[0].handler(text);\n } catch (error) {\n console.error(error);\n }\n for (let i = 1; i < this._characterJoiners.length; i++) {\n // We merge any overlapping ranges across the different joiners\n try {\n const joinerRanges = this._characterJoiners[i].handler(text);\n for (let j = 0; j < joinerRanges.length; j++) {\n CharacterJoinerService._mergeRanges(allJoinedRanges, joinerRanges[j]);\n }\n } catch (error) {\n console.error(error);\n }\n }\n this._stringRangesToCellRanges(allJoinedRanges, lineData, startCol);\n return allJoinedRanges;\n }\n\n /**\n * Modifies the provided ranges in-place to adjust for variations between\n * string length and cell width so that the range represents a cell range,\n * rather than the string range the joiner provides.\n * @param ranges String ranges containing start (inclusive) and end (exclusive) index\n * @param line Cell data for the relevant line in the terminal\n * @param startCol Offset within the line to start from\n */\n private _stringRangesToCellRanges(ranges: [number, number][], line: IBufferLine, startCol: number): void {\n let currentRangeIndex = 0;\n let currentRangeStarted = false;\n let currentStringIndex = 0;\n let currentRange = ranges[currentRangeIndex];\n\n // If we got through all of the ranges, stop searching\n if (!currentRange) {\n return;\n }\n\n for (let x = startCol; x < this._bufferService.cols; x++) {\n const width = line.getWidth(x);\n const length = line.getString(x).length || WHITESPACE_CELL_CHAR.length;\n\n // We skip zero-width characters when creating the string to join the text\n // so we do the same here\n if (width === 0) {\n continue;\n }\n\n // Adjust the start of the range\n if (!currentRangeStarted && currentRange[0] <= currentStringIndex) {\n currentRange[0] = x;\n currentRangeStarted = true;\n }\n\n // Adjust the end of the range\n if (currentRange[1] <= currentStringIndex) {\n currentRange[1] = x;\n\n // We're finished with this range, so we move to the next one\n currentRange = ranges[++currentRangeIndex];\n\n // If there are no more ranges left, stop searching\n if (!currentRange) {\n break;\n }\n\n // Ranges can be on adjacent characters. Because the end index of the\n // ranges are exclusive, this means that the index for the start of a\n // range can be the same as the end index of the previous range. To\n // account for the start of the next range, we check here just in case.\n if (currentRange[0] <= currentStringIndex) {\n currentRange[0] = x;\n currentRangeStarted = true;\n } else {\n currentRangeStarted = false;\n }\n }\n\n // Adjust the string index based on the character length to line up with\n // the column adjustment\n currentStringIndex += length;\n }\n\n // If there is still a range left at the end, it must extend all the way to\n // the end of the line.\n if (currentRange) {\n currentRange[1] = this._bufferService.cols;\n }\n }\n\n /**\n * Merges the range defined by the provided start and end into the list of\n * existing ranges. The merge is done in place on the existing range for\n * performance and is also returned.\n * @param ranges Existing range list\n * @param newRange Tuple of two numbers representing the new range to merge in.\n * @returns The ranges input with the new range merged in place\n */\n private static _mergeRanges(ranges: [number, number][], newRange: [number, number]): [number, number][] {\n let inRange = false;\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n if (!inRange) {\n if (newRange[1] <= range[0]) {\n // Case 1: New range is before the search range\n ranges.splice(i, 0, newRange);\n return ranges;\n }\n\n if (newRange[1] <= range[1]) {\n // Case 2: New range is either wholly contained within the\n // search range or overlaps with the front of it\n range[0] = Math.min(newRange[0], range[0]);\n return ranges;\n }\n\n if (newRange[0] < range[1]) {\n // Case 3: New range either wholly contains the search range\n // or overlaps with the end of it\n range[0] = Math.min(newRange[0], range[0]);\n inRange = true;\n }\n\n // Case 4: New range starts after the search range\n continue;\n } else {\n if (newRange[1] <= range[0]) {\n // Case 5: New range extends from previous range but doesn't\n // reach the current one\n ranges[i - 1][1] = newRange[1];\n return ranges;\n }\n\n if (newRange[1] <= range[1]) {\n // Case 6: New range extends from prvious range into the\n // current range\n ranges[i - 1][1] = Math.max(newRange[1], range[1]);\n ranges.splice(i, 1);\n return ranges;\n }\n\n // Case 7: New range extends from previous range past the\n // end of the current range\n ranges.splice(i, 1);\n i--;\n }\n }\n\n if (inRange) {\n // Case 8: New range extends past the last existing range\n ranges[ranges.length - 1][1] = newRange[1];\n } else {\n // Case 9: New range starts after the last existing range\n ranges.push(newRange);\n }\n\n return ranges;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreBrowserService } from './Services';\n\nexport class CoreBrowserService implements ICoreBrowserService {\n public serviceBrand: undefined;\n\n constructor(\n private _textarea: HTMLTextAreaElement\n ) {\n }\n\n public get isFocused(): boolean {\n const docOrShadowRoot = this._textarea.getRootNode ? this._textarea.getRootNode() as Document | ShadowRoot : document;\n return docOrShadowRoot.activeElement === this._textarea && document.hasFocus();\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharSizeService, IRenderService, IMouseService } from './Services';\nimport { getCoords, getRawByteCoords } from 'browser/input/Mouse';\n\nexport class MouseService implements IMouseService {\n public serviceBrand: undefined;\n\n constructor(\n @IRenderService private readonly _renderService: IRenderService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService\n ) {\n }\n\n public getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined {\n return getCoords(\n window,\n event,\n element,\n colCount,\n rowCount,\n this._charSizeService.hasValidSize,\n this._renderService.dimensions.actualCellWidth,\n this._renderService.dimensions.actualCellHeight,\n isSelection\n );\n }\n\n public getRawByteCoords(event: MouseEvent, element: HTMLElement, colCount: number, rowCount: number): { x: number, y: number } | undefined {\n const coords = this.getCoords(event, element, colCount, rowCount);\n return getRawByteCoords(coords);\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderer, IRenderDimensions } from 'browser/renderer/Types';\nimport { RenderDebouncer } from 'browser/RenderDebouncer';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { ScreenDprMonitor } from 'browser/ScreenDprMonitor';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IColorSet, IRenderDebouncer, IRenderDebouncerWithCallback } from 'browser/Types';\nimport { IOptionsService, IBufferService, IDecorationService } from 'common/services/Services';\nimport { ICharSizeService, IRenderService } from 'browser/services/Services';\n\ninterface ISelectionState {\n start: [number, number] | undefined;\n end: [number, number] | undefined;\n columnSelectMode: boolean;\n}\n\nexport class RenderService extends Disposable implements IRenderService {\n public serviceBrand: undefined;\n\n private _renderDebouncer: IRenderDebouncerWithCallback;\n private _screenDprMonitor: ScreenDprMonitor;\n\n private _isPaused: boolean = false;\n private _needsFullRefresh: boolean = false;\n private _isNextRenderRedrawOnly: boolean = true;\n private _needsSelectionRefresh: boolean = false;\n private _canvasWidth: number = 0;\n private _canvasHeight: number = 0;\n private _selectionState: ISelectionState = {\n start: undefined,\n end: undefined,\n columnSelectMode: false\n };\n\n private _onDimensionsChange = new EventEmitter();\n public get onDimensionsChange(): IEvent { return this._onDimensionsChange.event; }\n private _onRenderedViewportChange = new EventEmitter<{ start: number, end: number }>();\n public get onRenderedViewportChange(): IEvent<{ start: number, end: number }> { return this._onRenderedViewportChange.event; }\n private _onRender = new EventEmitter<{ start: number, end: number }>();\n public get onRender(): IEvent<{ start: number, end: number }> { return this._onRender.event; }\n private _onRefreshRequest = new EventEmitter<{ start: number, end: number }>();\n public get onRefreshRequest(): IEvent<{ start: number, end: number }> { return this._onRefreshRequest.event; }\n\n public get dimensions(): IRenderDimensions { return this._renderer.dimensions; }\n\n constructor(\n private _renderer: IRenderer,\n private _rowCount: number,\n screenElement: HTMLElement,\n @IOptionsService optionsService: IOptionsService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IDecorationService decorationService: IDecorationService,\n @IBufferService bufferService: IBufferService\n ) {\n super();\n\n this.register({ dispose: () => this._renderer.dispose() });\n\n this._renderDebouncer = new RenderDebouncer((start, end) => this._renderRows(start, end));\n this.register(this._renderDebouncer);\n\n this._screenDprMonitor = new ScreenDprMonitor();\n this._screenDprMonitor.setListener(() => this.onDevicePixelRatioChange());\n this.register(this._screenDprMonitor);\n\n this.register(bufferService.onResize(() => this._fullRefresh()));\n this.register(bufferService.buffers.onBufferActivate(() => this._renderer?.clear()));\n this.register(optionsService.onOptionChange(() => this._handleOptionsChanged()));\n this.register(this._charSizeService.onCharSizeChange(() => this.onCharSizeChanged()));\n\n // Do a full refresh whenever any decoration is added or removed. This may not actually result\n // in changes but since decorations should be used sparingly or added/removed all in the same\n // frame this should have minimal performance impact.\n this.register(decorationService.onDecorationRegistered(() => this._fullRefresh()));\n this.register(decorationService.onDecorationRemoved(() => this._fullRefresh()));\n\n // No need to register this as renderer is explicitly disposed in RenderService.dispose\n this._renderer.onRequestRedraw(e => this.refreshRows(e.start, e.end, true));\n\n // dprchange should handle this case, we need this as well for browsers that don't support the\n // matchMedia query.\n this.register(addDisposableDomListener(window, 'resize', () => this.onDevicePixelRatioChange()));\n\n // Detect whether IntersectionObserver is detected and enable renderer pause\n // and resume based on terminal visibility if so\n if ('IntersectionObserver' in window) {\n const observer = new IntersectionObserver(e => this._onIntersectionChange(e[e.length - 1]), { threshold: 0 });\n observer.observe(screenElement);\n this.register({ dispose: () => observer.disconnect() });\n }\n }\n\n private _onIntersectionChange(entry: IntersectionObserverEntry): void {\n this._isPaused = entry.isIntersecting === undefined ? (entry.intersectionRatio === 0) : !entry.isIntersecting;\n\n // Terminal was hidden on open\n if (!this._isPaused && !this._charSizeService.hasValidSize) {\n this._charSizeService.measure();\n }\n\n if (!this._isPaused && this._needsFullRefresh) {\n this.refreshRows(0, this._rowCount - 1);\n this._needsFullRefresh = false;\n }\n }\n\n public refreshRows(start: number, end: number, isRedrawOnly: boolean = false): void {\n if (this._isPaused) {\n this._needsFullRefresh = true;\n return;\n }\n if (!isRedrawOnly) {\n this._isNextRenderRedrawOnly = false;\n }\n this._renderDebouncer.refresh(start, end, this._rowCount);\n }\n\n private _renderRows(start: number, end: number): void {\n this._renderer.renderRows(start, end);\n\n // Update selection if needed\n if (this._needsSelectionRefresh) {\n this._renderer.onSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode);\n this._needsSelectionRefresh = false;\n }\n\n // Fire render event only if it was not a redraw\n if (!this._isNextRenderRedrawOnly) {\n this._onRenderedViewportChange.fire({ start, end });\n }\n this._onRender.fire({ start, end });\n this._isNextRenderRedrawOnly = true;\n }\n\n public resize(cols: number, rows: number): void {\n this._rowCount = rows;\n this._fireOnCanvasResize();\n }\n\n private _handleOptionsChanged(): void {\n this._renderer.onOptionsChanged();\n this.refreshRows(0, this._rowCount - 1);\n this._fireOnCanvasResize();\n }\n\n private _fireOnCanvasResize(): void {\n // Don't fire the event if the dimensions haven't changed\n if (this._renderer.dimensions.canvasWidth === this._canvasWidth && this._renderer.dimensions.canvasHeight === this._canvasHeight) {\n return;\n }\n this._onDimensionsChange.fire(this._renderer.dimensions);\n }\n\n public dispose(): void {\n super.dispose();\n }\n\n public setRenderer(renderer: IRenderer): void {\n // TODO: RenderService should be the only one to dispose the renderer\n this._renderer.dispose();\n this._renderer = renderer;\n this._renderer.onRequestRedraw(e => this.refreshRows(e.start, e.end, true));\n\n // Force a refresh\n this._needsSelectionRefresh = true;\n this._fullRefresh();\n }\n\n public addRefreshCallback(callback: FrameRequestCallback): number {\n return this._renderDebouncer.addRefreshCallback(callback);\n }\n\n private _fullRefresh(): void {\n if (this._isPaused) {\n this._needsFullRefresh = true;\n } else {\n this.refreshRows(0, this._rowCount - 1);\n }\n }\n\n public clearTextureAtlas(): void {\n this._renderer?.clearTextureAtlas?.();\n this._fullRefresh();\n }\n\n public setColors(colors: IColorSet): void {\n this._renderer.setColors(colors);\n this._fullRefresh();\n }\n\n public onDevicePixelRatioChange(): void {\n // Force char size measurement as DomMeasureStrategy(getBoundingClientRect) is not stable\n // when devicePixelRatio changes\n this._charSizeService.measure();\n\n this._renderer.onDevicePixelRatioChange();\n this.refreshRows(0, this._rowCount - 1);\n }\n\n public onResize(cols: number, rows: number): void {\n this._renderer.onResize(cols, rows);\n this._fullRefresh();\n }\n\n // TODO: Is this useful when we have onResize?\n public onCharSizeChanged(): void {\n this._renderer.onCharSizeChanged();\n }\n\n public onBlur(): void {\n this._renderer.onBlur();\n }\n\n public onFocus(): void {\n this._renderer.onFocus();\n }\n\n public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n this._selectionState.start = start;\n this._selectionState.end = end;\n this._selectionState.columnSelectMode = columnSelectMode;\n this._renderer.onSelectionChanged(start, end, columnSelectMode);\n }\n\n public onCursorMove(): void {\n this._renderer.onCursorMove();\n }\n\n public clear(): void {\n this._renderer.clear();\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ISelectionRedrawRequestEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types';\nimport { IBuffer } from 'common/buffer/Types';\nimport { IBufferLine, IDisposable } from 'common/Types';\nimport * as Browser from 'common/Platform';\nimport { SelectionModel } from 'browser/selection/SelectionModel';\nimport { CellData } from 'common/buffer/CellData';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IMouseService, ISelectionService, IRenderService } from 'browser/services/Services';\nimport { IBufferRange, ILinkifier2 } from 'browser/Types';\nimport { IBufferService, IOptionsService, ICoreService } from 'common/services/Services';\nimport { getCoordsRelativeToElement } from 'browser/input/Mouse';\nimport { moveToCellSequence } from 'browser/input/MoveToCell';\nimport { Disposable } from 'common/Lifecycle';\nimport { getRangeLength } from 'common/buffer/BufferRange';\n\n/**\n * The number of pixels the mouse needs to be above or below the viewport in\n * order to scroll at the maximum speed.\n */\nconst DRAG_SCROLL_MAX_THRESHOLD = 50;\n\n/**\n * The maximum scrolling speed\n */\nconst DRAG_SCROLL_MAX_SPEED = 15;\n\n/**\n * The number of milliseconds between drag scroll updates.\n */\nconst DRAG_SCROLL_INTERVAL = 50;\n\n/**\n * The maximum amount of time that can have elapsed for an alt click to move the\n * cursor.\n */\nconst ALT_CLICK_MOVE_CURSOR_TIME = 500;\n\nconst NON_BREAKING_SPACE_CHAR = String.fromCharCode(160);\nconst ALL_NON_BREAKING_SPACE_REGEX = new RegExp(NON_BREAKING_SPACE_CHAR, 'g');\n\n/**\n * Represents a position of a word on a line.\n */\ninterface IWordPosition {\n start: number;\n length: number;\n}\n\n/**\n * A selection mode, this drives how the selection behaves on mouse move.\n */\nexport const enum SelectionMode {\n NORMAL,\n WORD,\n LINE,\n COLUMN\n}\n\n/**\n * A class that manages the selection of the terminal. With help from\n * SelectionModel, SelectionService handles with all logic associated with\n * dealing with the selection, including handling mouse interaction, wide\n * characters and fetching the actual text within the selection. Rendering is\n * not handled by the SelectionService but the onRedrawRequest event is fired\n * when the selection is ready to be redrawn (on an animation frame).\n */\nexport class SelectionService extends Disposable implements ISelectionService {\n public serviceBrand: undefined;\n\n protected _model: SelectionModel;\n\n /**\n * The amount to scroll every drag scroll update (depends on how far the mouse\n * drag is above or below the terminal).\n */\n private _dragScrollAmount: number = 0;\n\n /**\n * The current selection mode.\n */\n protected _activeSelectionMode: SelectionMode;\n\n /**\n * A setInterval timer that is active while the mouse is down whose callback\n * scrolls the viewport when necessary.\n */\n private _dragScrollIntervalTimer: number | undefined;\n\n /**\n * The animation frame ID used for refreshing the selection.\n */\n private _refreshAnimationFrame: number | undefined;\n\n /**\n * Whether selection is enabled.\n */\n private _enabled = true;\n\n private _mouseMoveListener: EventListener;\n private _mouseUpListener: EventListener;\n private _trimListener: IDisposable;\n private _workCell: CellData = new CellData();\n\n private _mouseDownTimeStamp: number = 0;\n private _oldHasSelection: boolean = false;\n private _oldSelectionStart: [number, number] | undefined = undefined;\n private _oldSelectionEnd: [number, number] | undefined = undefined;\n\n private _onLinuxMouseSelection = this.register(new EventEmitter());\n public get onLinuxMouseSelection(): IEvent { return this._onLinuxMouseSelection.event; }\n private _onRedrawRequest = this.register(new EventEmitter());\n public get onRequestRedraw(): IEvent { return this._onRedrawRequest.event; }\n private _onSelectionChange = this.register(new EventEmitter());\n public get onSelectionChange(): IEvent { return this._onSelectionChange.event; }\n private _onRequestScrollLines = this.register(new EventEmitter());\n public get onRequestScrollLines(): IEvent { return this._onRequestScrollLines.event; }\n\n constructor(\n private readonly _element: HTMLElement,\n private readonly _screenElement: HTMLElement,\n private readonly _linkifier: ILinkifier2,\n @IBufferService private readonly _bufferService: IBufferService,\n @ICoreService private readonly _coreService: ICoreService,\n @IMouseService private readonly _mouseService: IMouseService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n super();\n\n // Init listeners\n this._mouseMoveListener = event => this._onMouseMove(event as MouseEvent);\n this._mouseUpListener = event => this._onMouseUp(event as MouseEvent);\n this._coreService.onUserInput(() => {\n if (this.hasSelection) {\n this.clearSelection();\n }\n });\n this._trimListener = this._bufferService.buffer.lines.onTrim(amount => this._onTrim(amount));\n this.register(this._bufferService.buffers.onBufferActivate(e => this._onBufferActivate(e)));\n\n this.enable();\n\n this._model = new SelectionModel(this._bufferService);\n this._activeSelectionMode = SelectionMode.NORMAL;\n }\n\n public dispose(): void {\n this._removeMouseDownListeners();\n }\n\n public reset(): void {\n this.clearSelection();\n }\n\n /**\n * Disables the selection manager. This is useful for when terminal mouse\n * are enabled.\n */\n public disable(): void {\n this.clearSelection();\n this._enabled = false;\n }\n\n /**\n * Enable the selection manager.\n */\n public enable(): void {\n this._enabled = true;\n }\n\n public get selectionStart(): [number, number] | undefined { return this._model.finalSelectionStart; }\n public get selectionEnd(): [number, number] | undefined { return this._model.finalSelectionEnd; }\n\n /**\n * Gets whether there is an active text selection.\n */\n public get hasSelection(): boolean {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return false;\n }\n return start[0] !== end[0] || start[1] !== end[1];\n }\n\n /**\n * Gets the text currently selected.\n */\n public get selectionText(): string {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return '';\n }\n\n const buffer = this._bufferService.buffer;\n const result: string[] = [];\n\n if (this._activeSelectionMode === SelectionMode.COLUMN) {\n // Ignore zero width selections\n if (start[0] === end[0]) {\n return '';\n }\n\n // For column selection it's not enough to rely on final selection's swapping of reversed\n // values, it also needs the x coordinates to swap independently of the y coordinate is needed\n const startCol = start[0] < end[0] ? start[0] : end[0];\n const endCol = start[0] < end[0] ? end[0] : start[0];\n for (let i = start[1]; i <= end[1]; i++) {\n const lineText = buffer.translateBufferLineToString(i, true, startCol, endCol);\n result.push(lineText);\n }\n } else {\n // Get first row\n const startRowEndCol = start[1] === end[1] ? end[0] : undefined;\n result.push(buffer.translateBufferLineToString(start[1], true, start[0], startRowEndCol));\n\n // Get middle rows\n for (let i = start[1] + 1; i <= end[1] - 1; i++) {\n const bufferLine = buffer.lines.get(i);\n const lineText = buffer.translateBufferLineToString(i, true);\n if (bufferLine?.isWrapped) {\n result[result.length - 1] += lineText;\n } else {\n result.push(lineText);\n }\n }\n\n // Get final row\n if (start[1] !== end[1]) {\n const bufferLine = buffer.lines.get(end[1]);\n const lineText = buffer.translateBufferLineToString(end[1], true, 0, end[0]);\n if (bufferLine && bufferLine!.isWrapped) {\n result[result.length - 1] += lineText;\n } else {\n result.push(lineText);\n }\n }\n }\n\n // Format string by replacing non-breaking space chars with regular spaces\n // and joining the array into a multi-line string.\n const formattedResult = result.map(line => {\n return line.replace(ALL_NON_BREAKING_SPACE_REGEX, ' ');\n }).join(Browser.isWindows ? '\\r\\n' : '\\n');\n\n return formattedResult;\n }\n\n /**\n * Clears the current terminal selection.\n */\n public clearSelection(): void {\n this._model.clearSelection();\n this._removeMouseDownListeners();\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n /**\n * Queues a refresh, redrawing the selection on the next opportunity.\n * @param isLinuxMouseSelection Whether the selection should be registered as a new\n * selection on Linux.\n */\n public refresh(isLinuxMouseSelection?: boolean): void {\n // Queue the refresh for the renderer\n if (!this._refreshAnimationFrame) {\n this._refreshAnimationFrame = window.requestAnimationFrame(() => this._refresh());\n }\n\n // If the platform is Linux and the refresh call comes from a mouse event,\n // we need to update the selection for middle click to paste selection.\n if (Browser.isLinux && isLinuxMouseSelection) {\n const selectionText = this.selectionText;\n if (selectionText.length) {\n this._onLinuxMouseSelection.fire(this.selectionText);\n }\n }\n }\n\n /**\n * Fires the refresh event, causing consumers to pick it up and redraw the\n * selection state.\n */\n private _refresh(): void {\n this._refreshAnimationFrame = undefined;\n this._onRedrawRequest.fire({\n start: this._model.finalSelectionStart,\n end: this._model.finalSelectionEnd,\n columnSelectMode: this._activeSelectionMode === SelectionMode.COLUMN\n });\n }\n\n /**\n * Checks if the current click was inside the current selection\n * @param event The mouse event\n */\n private _isClickInSelection(event: MouseEvent): boolean {\n const coords = this._getMouseBufferCoords(event);\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n\n if (!start || !end || !coords) {\n return false;\n }\n\n return this._areCoordsInSelection(coords, start, end);\n }\n\n public isCellInSelection(x: number, y: number): boolean {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return false;\n }\n return this._areCoordsInSelection([x, y], start, end);\n }\n\n protected _areCoordsInSelection(coords: [number, number], start: [number, number], end: [number, number]): boolean {\n return (coords[1] > start[1] && coords[1] < end[1]) ||\n (start[1] === end[1] && coords[1] === start[1] && coords[0] >= start[0] && coords[0] < end[0]) ||\n (start[1] < end[1] && coords[1] === end[1] && coords[0] < end[0]) ||\n (start[1] < end[1] && coords[1] === start[1] && coords[0] >= start[0]);\n }\n\n /**\n * Selects word at the current mouse event coordinates.\n * @param event The mouse event.\n */\n private _selectWordAtCursor(event: MouseEvent, allowWhitespaceOnlySelection: boolean): boolean {\n // Check if there is a link under the cursor first and select that if so\n const range = this._linkifier.currentLink?.link?.range;\n if (range) {\n this._model.selectionStart = [range.start.x - 1, range.start.y - 1];\n this._model.selectionStartLength = getRangeLength(range, this._bufferService.cols);\n this._model.selectionEnd = undefined;\n return true;\n }\n\n const coords = this._getMouseBufferCoords(event);\n if (coords) {\n this._selectWordAt(coords, allowWhitespaceOnlySelection);\n this._model.selectionEnd = undefined;\n return true;\n }\n return false;\n }\n\n /**\n * Selects all text within the terminal.\n */\n public selectAll(): void {\n this._model.isSelectAllActive = true;\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n public selectLines(start: number, end: number): void {\n this._model.clearSelection();\n start = Math.max(start, 0);\n end = Math.min(end, this._bufferService.buffer.lines.length - 1);\n this._model.selectionStart = [0, start];\n this._model.selectionEnd = [this._bufferService.cols, end];\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n /**\n * Handle the buffer being trimmed, adjust the selection position.\n * @param amount The amount the buffer is being trimmed.\n */\n private _onTrim(amount: number): void {\n const needsRefresh = this._model.onTrim(amount);\n if (needsRefresh) {\n this.refresh();\n }\n }\n\n /**\n * Gets the 0-based [x, y] buffer coordinates of the current mouse event.\n * @param event The mouse event.\n */\n private _getMouseBufferCoords(event: MouseEvent): [number, number] | undefined {\n const coords = this._mouseService.getCoords(event, this._screenElement, this._bufferService.cols, this._bufferService.rows, true);\n if (!coords) {\n return undefined;\n }\n\n // Convert to 0-based\n coords[0]--;\n coords[1]--;\n\n // Convert viewport coords to buffer coords\n coords[1] += this._bufferService.buffer.ydisp;\n return coords;\n }\n\n /**\n * Gets the amount the viewport should be scrolled based on how far out of the\n * terminal the mouse is.\n * @param event The mouse event.\n */\n private _getMouseEventScrollAmount(event: MouseEvent): number {\n let offset = getCoordsRelativeToElement(window, event, this._screenElement)[1];\n const terminalHeight = this._renderService.dimensions.canvasHeight;\n if (offset >= 0 && offset <= terminalHeight) {\n return 0;\n }\n if (offset > terminalHeight) {\n offset -= terminalHeight;\n }\n\n offset = Math.min(Math.max(offset, -DRAG_SCROLL_MAX_THRESHOLD), DRAG_SCROLL_MAX_THRESHOLD);\n offset /= DRAG_SCROLL_MAX_THRESHOLD;\n return (offset / Math.abs(offset)) + Math.round(offset * (DRAG_SCROLL_MAX_SPEED - 1));\n }\n\n /**\n * Returns whether the selection manager should force selection, regardless of\n * whether the terminal is in mouse events mode.\n * @param event The mouse event.\n */\n public shouldForceSelection(event: MouseEvent): boolean {\n if (Browser.isMac) {\n return event.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection;\n }\n\n return event.shiftKey;\n }\n\n /**\n * Handles te mousedown event, setting up for a new selection.\n * @param event The mousedown event.\n */\n public onMouseDown(event: MouseEvent): void {\n this._mouseDownTimeStamp = event.timeStamp;\n // If we have selection, we want the context menu on right click even if the\n // terminal is in mouse mode.\n if (event.button === 2 && this.hasSelection) {\n return;\n }\n\n // Only action the primary button\n if (event.button !== 0) {\n return;\n }\n\n // Allow selection when using a specific modifier key, even when disabled\n if (!this._enabled) {\n if (!this.shouldForceSelection(event)) {\n return;\n }\n\n // Don't send the mouse down event to the current process, we want to select\n event.stopPropagation();\n }\n\n // Tell the browser not to start a regular selection\n event.preventDefault();\n\n // Reset drag scroll state\n this._dragScrollAmount = 0;\n\n if (this._enabled && event.shiftKey) {\n this._onIncrementalClick(event);\n } else {\n if (event.detail === 1) {\n this._onSingleClick(event);\n } else if (event.detail === 2) {\n this._onDoubleClick(event);\n } else if (event.detail === 3) {\n this._onTripleClick(event);\n }\n }\n\n this._addMouseDownListeners();\n this.refresh(true);\n }\n\n /**\n * Adds listeners when mousedown is triggered.\n */\n private _addMouseDownListeners(): void {\n // Listen on the document so that dragging outside of viewport works\n if (this._screenElement.ownerDocument) {\n this._screenElement.ownerDocument.addEventListener('mousemove', this._mouseMoveListener);\n this._screenElement.ownerDocument.addEventListener('mouseup', this._mouseUpListener);\n }\n this._dragScrollIntervalTimer = window.setInterval(() => this._dragScroll(), DRAG_SCROLL_INTERVAL);\n }\n\n /**\n * Removes the listeners that are registered when mousedown is triggered.\n */\n private _removeMouseDownListeners(): void {\n if (this._screenElement.ownerDocument) {\n this._screenElement.ownerDocument.removeEventListener('mousemove', this._mouseMoveListener);\n this._screenElement.ownerDocument.removeEventListener('mouseup', this._mouseUpListener);\n }\n clearInterval(this._dragScrollIntervalTimer);\n this._dragScrollIntervalTimer = undefined;\n }\n\n /**\n * Performs an incremental click, setting the selection end position to the mouse\n * position.\n * @param event The mouse event.\n */\n private _onIncrementalClick(event: MouseEvent): void {\n if (this._model.selectionStart) {\n this._model.selectionEnd = this._getMouseBufferCoords(event);\n }\n }\n\n /**\n * Performs a single click, resetting relevant state and setting the selection\n * start position.\n * @param event The mouse event.\n */\n private _onSingleClick(event: MouseEvent): void {\n this._model.selectionStartLength = 0;\n this._model.isSelectAllActive = false;\n this._activeSelectionMode = this.shouldColumnSelect(event) ? SelectionMode.COLUMN : SelectionMode.NORMAL;\n\n // Initialize the new selection\n this._model.selectionStart = this._getMouseBufferCoords(event);\n if (!this._model.selectionStart) {\n return;\n }\n this._model.selectionEnd = undefined;\n\n // Ensure the line exists\n const line = this._bufferService.buffer.lines.get(this._model.selectionStart[1]);\n if (!line) {\n return;\n }\n\n // Return early if the click event is not in the buffer (eg. in scroll bar)\n if (line.length === this._model.selectionStart[0]) {\n return;\n }\n\n // If the mouse is over the second half of a wide character, adjust the\n // selection to cover the whole character\n if (line.hasWidth(this._model.selectionStart[0]) === 0) {\n this._model.selectionStart[0]++;\n }\n }\n\n /**\n * Performs a double click, selecting the current word.\n * @param event The mouse event.\n */\n private _onDoubleClick(event: MouseEvent): void {\n if (this._selectWordAtCursor(event, true)) {\n this._activeSelectionMode = SelectionMode.WORD;\n }\n }\n\n /**\n * Performs a triple click, selecting the current line and activating line\n * select mode.\n * @param event The mouse event.\n */\n private _onTripleClick(event: MouseEvent): void {\n const coords = this._getMouseBufferCoords(event);\n if (coords) {\n this._activeSelectionMode = SelectionMode.LINE;\n this._selectLineAt(coords[1]);\n }\n }\n\n /**\n * Returns whether the selection manager should operate in column select mode\n * @param event the mouse or keyboard event\n */\n public shouldColumnSelect(event: KeyboardEvent | MouseEvent): boolean {\n return event.altKey && !(Browser.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection);\n }\n\n /**\n * Handles the mousemove event when the mouse button is down, recording the\n * end of the selection and refreshing the selection.\n * @param event The mousemove event.\n */\n private _onMouseMove(event: MouseEvent): void {\n // If the mousemove listener is active it means that a selection is\n // currently being made, we should stop propagation to prevent mouse events\n // to be sent to the pty.\n event.stopImmediatePropagation();\n\n // Do nothing if there is no selection start, this can happen if the first\n // click in the terminal is an incremental click\n if (!this._model.selectionStart) {\n return;\n }\n\n // Record the previous position so we know whether to redraw the selection\n // at the end.\n const previousSelectionEnd = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null;\n\n // Set the initial selection end based on the mouse coordinates\n this._model.selectionEnd = this._getMouseBufferCoords(event);\n if (!this._model.selectionEnd) {\n this.refresh(true);\n return;\n }\n\n // Select the entire line if line select mode is active.\n if (this._activeSelectionMode === SelectionMode.LINE) {\n if (this._model.selectionEnd[1] < this._model.selectionStart[1]) {\n this._model.selectionEnd[0] = 0;\n } else {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n } else if (this._activeSelectionMode === SelectionMode.WORD) {\n this._selectToWordAt(this._model.selectionEnd);\n }\n\n // Determine the amount of scrolling that will happen.\n this._dragScrollAmount = this._getMouseEventScrollAmount(event);\n\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n if (this._dragScrollAmount > 0) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n } else if (this._dragScrollAmount < 0) {\n this._model.selectionEnd[0] = 0;\n }\n }\n\n // If the character is a wide character include the cell to the right in the\n // selection. Note that selections at the very end of the line will never\n // have a character.\n const buffer = this._bufferService.buffer;\n if (this._model.selectionEnd[1] < buffer.lines.length) {\n const line = buffer.lines.get(this._model.selectionEnd[1]);\n if (line && line.hasWidth(this._model.selectionEnd[0]) === 0) {\n this._model.selectionEnd[0]++;\n }\n }\n\n // Only draw here if the selection changes.\n if (!previousSelectionEnd ||\n previousSelectionEnd[0] !== this._model.selectionEnd[0] ||\n previousSelectionEnd[1] !== this._model.selectionEnd[1]) {\n this.refresh(true);\n }\n }\n\n /**\n * The callback that occurs every DRAG_SCROLL_INTERVAL ms that does the\n * scrolling of the viewport.\n */\n private _dragScroll(): void {\n if (!this._model.selectionEnd || !this._model.selectionStart) {\n return;\n }\n if (this._dragScrollAmount) {\n this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false });\n // Re-evaluate selection\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n const buffer = this._bufferService.buffer;\n if (this._dragScrollAmount > 0) {\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n this._model.selectionEnd[1] = Math.min(buffer.ydisp + this._bufferService.rows, buffer.lines.length - 1);\n } else {\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n this._model.selectionEnd[0] = 0;\n }\n this._model.selectionEnd[1] = buffer.ydisp;\n }\n this.refresh();\n }\n }\n\n /**\n * Handles the mouseup event, removing the mousedown listeners.\n * @param event The mouseup event.\n */\n private _onMouseUp(event: MouseEvent): void {\n const timeElapsed = event.timeStamp - this._mouseDownTimeStamp;\n\n this._removeMouseDownListeners();\n\n if (this.selectionText.length <= 1 && timeElapsed < ALT_CLICK_MOVE_CURSOR_TIME && event.altKey && this._optionsService.getOption('altClickMovesCursor')) {\n if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) {\n const coordinates = this._mouseService.getCoords(\n event,\n this._element,\n this._bufferService.cols,\n this._bufferService.rows,\n false\n );\n if (coordinates && coordinates[0] !== undefined && coordinates[1] !== undefined) {\n const sequence = moveToCellSequence(coordinates[0] - 1, coordinates[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys);\n this._coreService.triggerDataEvent(sequence, true);\n }\n }\n } else {\n this._fireEventIfSelectionChanged();\n }\n }\n\n private _fireEventIfSelectionChanged(): void {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n const hasSelection = !!start && !!end && (start[0] !== end[0] || start[1] !== end[1]);\n\n if (!hasSelection) {\n if (this._oldHasSelection) {\n this._fireOnSelectionChange(start, end, hasSelection);\n }\n return;\n }\n\n // Sanity check, these should not be undefined as there is a selection\n if (!start || !end) {\n return;\n }\n\n if (!this._oldSelectionStart || !this._oldSelectionEnd || (\n start[0] !== this._oldSelectionStart[0] || start[1] !== this._oldSelectionStart[1] ||\n end[0] !== this._oldSelectionEnd[0] || end[1] !== this._oldSelectionEnd[1])) {\n\n this._fireOnSelectionChange(start, end, hasSelection);\n }\n }\n\n private _fireOnSelectionChange(start: [number, number] | undefined, end: [number, number] | undefined, hasSelection: boolean): void {\n this._oldSelectionStart = start;\n this._oldSelectionEnd = end;\n this._oldHasSelection = hasSelection;\n this._onSelectionChange.fire();\n }\n\n private _onBufferActivate(e: {activeBuffer: IBuffer, inactiveBuffer: IBuffer}): void {\n this.clearSelection();\n // Only adjust the selection on trim, shiftElements is rarely used (only in\n // reverseIndex) and delete in a splice is only ever used when the same\n // number of elements was just added. Given this is could actually be\n // beneficial to leave the selection as is for these cases.\n this._trimListener.dispose();\n this._trimListener = e.activeBuffer.lines.onTrim(amount => this._onTrim(amount));\n }\n\n /**\n * Converts a viewport column to the character index on the buffer line, the\n * latter takes into account wide characters.\n * @param coords The coordinates to find the 2 index for.\n */\n private _convertViewportColToCharacterIndex(bufferLine: IBufferLine, coords: [number, number]): number {\n let charIndex = coords[0];\n for (let i = 0; coords[0] >= i; i++) {\n const length = bufferLine.loadCell(i, this._workCell).getChars().length;\n if (this._workCell.getWidth() === 0) {\n // Wide characters aren't included in the line string so decrement the\n // index so the index is back on the wide character.\n charIndex--;\n } else if (length > 1 && coords[0] !== i) {\n // Emojis take up multiple characters, so adjust accordingly. For these\n // we don't want ot include the character at the column as we're\n // returning the start index in the string, not the end index.\n charIndex += length - 1;\n }\n }\n return charIndex;\n }\n\n public setSelection(col: number, row: number, length: number): void {\n this._model.clearSelection();\n this._removeMouseDownListeners();\n this._model.selectionStart = [col, row];\n this._model.selectionStartLength = length;\n this.refresh();\n this._fireEventIfSelectionChanged();\n }\n\n public rightClickSelect(ev: MouseEvent): void {\n if (!this._isClickInSelection(ev)) {\n if (this._selectWordAtCursor(ev, false)) {\n this.refresh(true);\n }\n this._fireEventIfSelectionChanged();\n }\n }\n\n /**\n * Gets positional information for the word at the coordinated specified.\n * @param coords The coordinates to get the word at.\n */\n private _getWordAt(coords: [number, number], allowWhitespaceOnlySelection: boolean, followWrappedLinesAbove: boolean = true, followWrappedLinesBelow: boolean = true): IWordPosition | undefined {\n // Ensure coords are within viewport (eg. not within scroll bar)\n if (coords[0] >= this._bufferService.cols) {\n return undefined;\n }\n\n const buffer = this._bufferService.buffer;\n const bufferLine = buffer.lines.get(coords[1]);\n if (!bufferLine) {\n return undefined;\n }\n\n const line = buffer.translateBufferLineToString(coords[1], false);\n\n // Get actual index, taking into consideration wide characters\n let startIndex = this._convertViewportColToCharacterIndex(bufferLine, coords);\n let endIndex = startIndex;\n\n // Record offset to be used later\n const charOffset = coords[0] - startIndex;\n let leftWideCharCount = 0;\n let rightWideCharCount = 0;\n let leftLongCharOffset = 0;\n let rightLongCharOffset = 0;\n\n if (line.charAt(startIndex) === ' ') {\n // Expand until non-whitespace is hit\n while (startIndex > 0 && line.charAt(startIndex - 1) === ' ') {\n startIndex--;\n }\n while (endIndex < line.length && line.charAt(endIndex + 1) === ' ') {\n endIndex++;\n }\n } else {\n // Expand until whitespace is hit. This algorithm works by scanning left\n // and right from the starting position, keeping both the index format\n // (line) and the column format (bufferLine) in sync. When a wide\n // character is hit, it is recorded and the column index is adjusted.\n let startCol = coords[0];\n let endCol = coords[0];\n\n // Consider the initial position, skip it and increment the wide char\n // variable\n if (bufferLine.getWidth(startCol) === 0) {\n leftWideCharCount++;\n startCol--;\n }\n if (bufferLine.getWidth(endCol) === 2) {\n rightWideCharCount++;\n endCol++;\n }\n\n // Adjust the end index for characters whose length are > 1 (emojis)\n const length = bufferLine.getString(endCol).length;\n if (length > 1) {\n rightLongCharOffset += length - 1;\n endIndex += length - 1;\n }\n\n // Expand the string in both directions until a space is hit\n while (startCol > 0 && startIndex > 0 && !this._isCharWordSeparator(bufferLine.loadCell(startCol - 1, this._workCell))) {\n bufferLine.loadCell(startCol - 1, this._workCell);\n const length = this._workCell.getChars().length;\n if (this._workCell.getWidth() === 0) {\n // If the next character is a wide char, record it and skip the column\n leftWideCharCount++;\n startCol--;\n } else if (length > 1) {\n // If the next character's string is longer than 1 char (eg. emoji),\n // adjust the index\n leftLongCharOffset += length - 1;\n startIndex -= length - 1;\n }\n startIndex--;\n startCol--;\n }\n while (endCol < bufferLine.length && endIndex + 1 < line.length && !this._isCharWordSeparator(bufferLine.loadCell(endCol + 1, this._workCell))) {\n bufferLine.loadCell(endCol + 1, this._workCell);\n const length = this._workCell.getChars().length;\n if (this._workCell.getWidth() === 2) {\n // If the next character is a wide char, record it and skip the column\n rightWideCharCount++;\n endCol++;\n } else if (length > 1) {\n // If the next character's string is longer than 1 char (eg. emoji),\n // adjust the index\n rightLongCharOffset += length - 1;\n endIndex += length - 1;\n }\n endIndex++;\n endCol++;\n }\n }\n\n // Incremenet the end index so it is at the start of the next character\n endIndex++;\n\n // Calculate the start _column_, converting the the string indexes back to\n // column coordinates.\n let start =\n startIndex // The index of the selection's start char in the line string\n + charOffset // The difference between the initial char's column and index\n - leftWideCharCount // The number of wide chars left of the initial char\n + leftLongCharOffset; // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)\n\n // Calculate the length in _columns_, converting the the string indexes back\n // to column coordinates.\n let length = Math.min(this._bufferService.cols, // Disallow lengths larger than the terminal cols\n endIndex // The index of the selection's end char in the line string\n - startIndex // The index of the selection's start char in the line string\n + leftWideCharCount // The number of wide chars left of the initial char\n + rightWideCharCount // The number of wide chars right of the initial char (inclusive)\n - leftLongCharOffset // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)\n - rightLongCharOffset); // The number of additional chars right of the initial char (inclusive) added by columns with strings longer than 1 (emojis)\n\n if (!allowWhitespaceOnlySelection && line.slice(startIndex, endIndex).trim() === '') {\n return undefined;\n }\n\n // Recurse upwards if the line is wrapped and the word wraps to the above line\n if (followWrappedLinesAbove) {\n if (start === 0 && bufferLine.getCodePoint(0) !== 32 /* ' ' */) {\n const previousBufferLine = buffer.lines.get(coords[1] - 1);\n if (previousBufferLine && bufferLine.isWrapped && previousBufferLine.getCodePoint(this._bufferService.cols - 1) !== 32 /* ' ' */) {\n const previousLineWordPosition = this._getWordAt([this._bufferService.cols - 1, coords[1] - 1], false, true, false);\n if (previousLineWordPosition) {\n const offset = this._bufferService.cols - previousLineWordPosition.start;\n start -= offset;\n length += offset;\n }\n }\n }\n }\n\n // Recurse downwards if the line is wrapped and the word wraps to the next line\n if (followWrappedLinesBelow) {\n if (start + length === this._bufferService.cols && bufferLine.getCodePoint(this._bufferService.cols - 1) !== 32 /* ' ' */) {\n const nextBufferLine = buffer.lines.get(coords[1] + 1);\n if (nextBufferLine?.isWrapped && nextBufferLine.getCodePoint(0) !== 32 /* ' ' */) {\n const nextLineWordPosition = this._getWordAt([0, coords[1] + 1], false, false, true);\n if (nextLineWordPosition) {\n length += nextLineWordPosition.length;\n }\n }\n }\n }\n\n return { start, length };\n }\n\n /**\n * Selects the word at the coordinates specified.\n * @param coords The coordinates to get the word at.\n * @param allowWhitespaceOnlySelection If whitespace should be selected\n */\n protected _selectWordAt(coords: [number, number], allowWhitespaceOnlySelection: boolean): void {\n const wordPosition = this._getWordAt(coords, allowWhitespaceOnlySelection);\n if (wordPosition) {\n // Adjust negative start value\n while (wordPosition.start < 0) {\n wordPosition.start += this._bufferService.cols;\n coords[1]--;\n }\n this._model.selectionStart = [wordPosition.start, coords[1]];\n this._model.selectionStartLength = wordPosition.length;\n }\n }\n\n /**\n * Sets the selection end to the word at the coordinated specified.\n * @param coords The coordinates to get the word at.\n */\n private _selectToWordAt(coords: [number, number]): void {\n const wordPosition = this._getWordAt(coords, true);\n if (wordPosition) {\n let endRow = coords[1];\n\n // Adjust negative start value\n while (wordPosition.start < 0) {\n wordPosition.start += this._bufferService.cols;\n endRow--;\n }\n\n // Adjust wrapped length value, this only needs to happen when values are reversed as in that\n // case we're interested in the start of the word, not the end\n if (!this._model.areSelectionValuesReversed()) {\n while (wordPosition.start + wordPosition.length > this._bufferService.cols) {\n wordPosition.length -= this._bufferService.cols;\n endRow++;\n }\n }\n\n this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? wordPosition.start : wordPosition.start + wordPosition.length, endRow];\n }\n }\n\n /**\n * Gets whether the character is considered a word separator by the select\n * word logic.\n * @param char The character to check.\n */\n private _isCharWordSeparator(cell: CellData): boolean {\n // Zero width characters are never separators as they are always to the\n // right of wide characters\n if (cell.getWidth() === 0) {\n return false;\n }\n return this._optionsService.rawOptions.wordSeparator.indexOf(cell.getChars()) >= 0;\n }\n\n /**\n * Selects the line specified.\n * @param line The line index.\n */\n protected _selectLineAt(line: number): void {\n const wrappedRange = this._bufferService.buffer.getWrappedRangeForLine(line);\n const range: IBufferRange = {\n start: { x: 0, y: wrappedRange.first },\n end: { x: this._bufferService.cols - 1, y: wrappedRange.last }\n };\n this._model.selectionStart = [0, wrappedRange.first];\n this._model.selectionEnd = undefined;\n this._model.selectionStartLength = getRangeLength(range, this._bufferService.cols);\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IEvent } from 'common/EventEmitter';\nimport { IRenderDimensions, IRenderer } from 'browser/renderer/Types';\nimport { IColorSet, IRenderDebouncer } from 'browser/Types';\nimport { ISelectionRedrawRequestEvent as ISelectionRequestRedrawEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types';\nimport { createDecorator } from 'common/services/ServiceRegistry';\nimport { IDisposable } from 'common/Types';\nimport { IDecorationOptions, IDecoration } from 'xterm';\nimport { IBufferService } from 'common/services/Services';\n\nexport const ICharSizeService = createDecorator('CharSizeService');\nexport interface ICharSizeService {\n serviceBrand: undefined;\n\n readonly width: number;\n readonly height: number;\n readonly hasValidSize: boolean;\n\n readonly onCharSizeChange: IEvent;\n\n measure(): void;\n}\n\nexport const ICoreBrowserService = createDecorator('CoreBrowserService');\nexport interface ICoreBrowserService {\n serviceBrand: undefined;\n\n readonly isFocused: boolean;\n}\n\nexport const IMouseService = createDecorator('MouseService');\nexport interface IMouseService {\n serviceBrand: undefined;\n\n getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined;\n getRawByteCoords(event: MouseEvent, element: HTMLElement, colCount: number, rowCount: number): { x: number, y: number } | undefined;\n}\n\nexport const IRenderService = createDecorator('RenderService');\nexport interface IRenderService extends IDisposable {\n serviceBrand: undefined;\n\n onDimensionsChange: IEvent;\n /**\n * Fires when buffer changes are rendered. This does not fire when only cursor\n * or selections are rendered.\n */\n onRenderedViewportChange: IEvent<{ start: number, end: number }>;\n /**\n * Fires on render\n */\n onRender: IEvent<{ start: number, end: number }>;\n onRefreshRequest: IEvent<{ start: number, end: number }>;\n\n dimensions: IRenderDimensions;\n\n addRefreshCallback(callback: FrameRequestCallback): number;\n\n refreshRows(start: number, end: number): void;\n clearTextureAtlas(): void;\n resize(cols: number, rows: number): void;\n setRenderer(renderer: IRenderer): void;\n setColors(colors: IColorSet): void;\n onDevicePixelRatioChange(): void;\n onResize(cols: number, rows: number): void;\n // TODO: Is this useful when we have onResize?\n onCharSizeChanged(): void;\n onBlur(): void;\n onFocus(): void;\n onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void;\n onCursorMove(): void;\n clear(): void;\n}\n\nexport const ISelectionService = createDecorator('SelectionService');\nexport interface ISelectionService {\n serviceBrand: undefined;\n\n readonly selectionText: string;\n readonly hasSelection: boolean;\n readonly selectionStart: [number, number] | undefined;\n readonly selectionEnd: [number, number] | undefined;\n\n readonly onLinuxMouseSelection: IEvent;\n readonly onRequestRedraw: IEvent;\n readonly onRequestScrollLines: IEvent;\n readonly onSelectionChange: IEvent;\n\n disable(): void;\n enable(): void;\n reset(): void;\n setSelection(row: number, col: number, length: number): void;\n selectAll(): void;\n selectLines(start: number, end: number): void;\n clearSelection(): void;\n rightClickSelect(event: MouseEvent): void;\n shouldColumnSelect(event: KeyboardEvent | MouseEvent): boolean;\n shouldForceSelection(event: MouseEvent): boolean;\n refresh(isLinuxMouseSelection?: boolean): void;\n onMouseDown(event: MouseEvent): void;\n isCellInSelection(x: number, y: number): boolean;\n}\n\nexport const ISoundService = createDecorator('SoundService');\nexport interface ISoundService {\n serviceBrand: undefined;\n\n playBellSound(): void;\n}\n\n\nexport const ICharacterJoinerService = createDecorator('CharacterJoinerService');\nexport interface ICharacterJoinerService {\n serviceBrand: undefined;\n\n register(handler: (text: string) => [number, number][]): number;\n deregister(joinerId: number): boolean;\n getJoinedCharacters(row: number): [number, number][];\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOptionsService } from 'common/services/Services';\nimport { ISoundService } from 'browser/services/Services';\n\nexport class SoundService implements ISoundService {\n public serviceBrand: undefined;\n\n private static _audioContext: AudioContext;\n\n public static get audioContext(): AudioContext | null {\n if (!SoundService._audioContext) {\n const audioContextCtor: typeof AudioContext = (window as any).AudioContext || (window as any).webkitAudioContext;\n if (!audioContextCtor) {\n console.warn('Web Audio API is not supported by this browser. Consider upgrading to the latest version');\n return null;\n }\n SoundService._audioContext = new audioContextCtor();\n }\n return SoundService._audioContext;\n }\n\n constructor(\n @IOptionsService private _optionsService: IOptionsService\n ) {\n }\n\n public playBellSound(): void {\n const ctx = SoundService.audioContext;\n if (!ctx) {\n return;\n }\n const bellAudioSource = ctx.createBufferSource();\n ctx.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.rawOptions.bellSound)), (buffer) => {\n bellAudioSource.buffer = buffer;\n bellAudioSource.connect(ctx.destination);\n bellAudioSource.start(0);\n });\n }\n\n private _base64ToArrayBuffer(base64: string): ArrayBuffer {\n const binaryString = window.atob(base64);\n const len = binaryString.length;\n const bytes = new Uint8Array(len);\n\n for (let i = 0; i < len; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n\n return bytes.buffer;\n }\n\n private _removeMimeType(dataURI: string): string {\n // Split the input to get the mime-type and the data itself\n const splitUri = dataURI.split(',');\n\n // Return only the data\n return splitUri[1];\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICircularList } from 'common/Types';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\n\nexport interface IInsertEvent {\n index: number;\n amount: number;\n}\n\nexport interface IDeleteEvent {\n index: number;\n amount: number;\n}\n\n/**\n * Represents a circular list; a list with a maximum size that wraps around when push is called,\n * overriding values at the start of the list.\n */\nexport class CircularList implements ICircularList {\n protected _array: (T | undefined)[];\n private _startIndex: number;\n private _length: number;\n\n public onDeleteEmitter = new EventEmitter();\n public get onDelete(): IEvent { return this.onDeleteEmitter.event; }\n public onInsertEmitter = new EventEmitter();\n public get onInsert(): IEvent { return this.onInsertEmitter.event; }\n public onTrimEmitter = new EventEmitter();\n public get onTrim(): IEvent { return this.onTrimEmitter.event; }\n\n constructor(\n private _maxLength: number\n ) {\n this._array = new Array(this._maxLength);\n this._startIndex = 0;\n this._length = 0;\n }\n\n public get maxLength(): number {\n return this._maxLength;\n }\n\n public set maxLength(newMaxLength: number) {\n // There was no change in maxLength, return early.\n if (this._maxLength === newMaxLength) {\n return;\n }\n\n // Reconstruct array, starting at index 0. Only transfer values from the\n // indexes 0 to length.\n const newArray = new Array(newMaxLength);\n for (let i = 0; i < Math.min(newMaxLength, this.length); i++) {\n newArray[i] = this._array[this._getCyclicIndex(i)];\n }\n this._array = newArray;\n this._maxLength = newMaxLength;\n this._startIndex = 0;\n }\n\n public get length(): number {\n return this._length;\n }\n\n public set length(newLength: number) {\n if (newLength > this._length) {\n for (let i = this._length; i < newLength; i++) {\n this._array[i] = undefined;\n }\n }\n this._length = newLength;\n }\n\n /**\n * Gets the value at an index.\n *\n * Note that for performance reasons there is no bounds checking here, the index reference is\n * circular so this should always return a value and never throw.\n * @param index The index of the value to get.\n * @return The value corresponding to the index.\n */\n public get(index: number): T | undefined {\n return this._array[this._getCyclicIndex(index)];\n }\n\n /**\n * Sets the value at an index.\n *\n * Note that for performance reasons there is no bounds checking here, the index reference is\n * circular so this should always return a value and never throw.\n * @param index The index to set.\n * @param value The value to set.\n */\n public set(index: number, value: T | undefined): void {\n this._array[this._getCyclicIndex(index)] = value;\n }\n\n /**\n * Pushes a new value onto the list, wrapping around to the start of the array, overriding index 0\n * if the maximum length is reached.\n * @param value The value to push onto the list.\n */\n public push(value: T): void {\n this._array[this._getCyclicIndex(this._length)] = value;\n if (this._length === this._maxLength) {\n this._startIndex = ++this._startIndex % this._maxLength;\n this.onTrimEmitter.fire(1);\n } else {\n this._length++;\n }\n }\n\n /**\n * Advance ringbuffer index and return current element for recycling.\n * Note: The buffer must be full for this method to work.\n * @throws When the buffer is not full.\n */\n public recycle(): T {\n if (this._length !== this._maxLength) {\n throw new Error('Can only recycle when the buffer is full');\n }\n this._startIndex = ++this._startIndex % this._maxLength;\n this.onTrimEmitter.fire(1);\n return this._array[this._getCyclicIndex(this._length - 1)]!;\n }\n\n /**\n * Ringbuffer is at max length.\n */\n public get isFull(): boolean {\n return this._length === this._maxLength;\n }\n\n /**\n * Removes and returns the last value on the list.\n * @return The popped value.\n */\n public pop(): T | undefined {\n return this._array[this._getCyclicIndex(this._length-- - 1)];\n }\n\n /**\n * Deletes and/or inserts items at a particular index (in that order). Unlike\n * Array.prototype.splice, this operation does not return the deleted items as a new array in\n * order to save creating a new array. Note that this operation may shift all values in the list\n * in the worst case.\n * @param start The index to delete and/or insert.\n * @param deleteCount The number of elements to delete.\n * @param items The items to insert.\n */\n public splice(start: number, deleteCount: number, ...items: T[]): void {\n // Delete items\n if (deleteCount) {\n for (let i = start; i < this._length - deleteCount; i++) {\n this._array[this._getCyclicIndex(i)] = this._array[this._getCyclicIndex(i + deleteCount)];\n }\n this._length -= deleteCount;\n this.onDeleteEmitter.fire({ index: start, amount: deleteCount });\n }\n\n // Add items\n for (let i = this._length - 1; i >= start; i--) {\n this._array[this._getCyclicIndex(i + items.length)] = this._array[this._getCyclicIndex(i)];\n }\n for (let i = 0; i < items.length; i++) {\n this._array[this._getCyclicIndex(start + i)] = items[i];\n }\n if (items.length) {\n this.onInsertEmitter.fire({ index: start, amount: items.length });\n }\n\n // Adjust length as needed\n if (this._length + items.length > this._maxLength) {\n const countToTrim = (this._length + items.length) - this._maxLength;\n this._startIndex += countToTrim;\n this._length = this._maxLength;\n this.onTrimEmitter.fire(countToTrim);\n } else {\n this._length += items.length;\n }\n }\n\n /**\n * Trims a number of items from the start of the list.\n * @param count The number of items to remove.\n */\n public trimStart(count: number): void {\n if (count > this._length) {\n count = this._length;\n }\n this._startIndex += count;\n this._length -= count;\n this.onTrimEmitter.fire(count);\n }\n\n public shiftElements(start: number, count: number, offset: number): void {\n if (count <= 0) {\n return;\n }\n if (start < 0 || start >= this._length) {\n throw new Error('start argument out of range');\n }\n if (start + offset < 0) {\n throw new Error('Cannot shift elements in list beyond index 0');\n }\n\n if (offset > 0) {\n for (let i = count - 1; i >= 0; i--) {\n this.set(start + i + offset, this.get(start + i));\n }\n const expandListBy = (start + count + offset) - this._length;\n if (expandListBy > 0) {\n this._length += expandListBy;\n while (this._length > this._maxLength) {\n this._length--;\n this._startIndex++;\n this.onTrimEmitter.fire(1);\n }\n }\n } else {\n for (let i = 0; i < count; i++) {\n this.set(start + i + offset, this.get(start + i));\n }\n }\n }\n\n /**\n * Gets the cyclic index for the specified regular index. The cyclic index can then be used on the\n * backing array to get the element associated with the regular index.\n * @param index The regular index.\n * @returns The cyclic index.\n */\n private _getCyclicIndex(index: number): number {\n return (this._startIndex + index) % this._maxLength;\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/*\n * A simple utility for cloning values\n */\nexport function clone(val: T, depth: number = 5): T {\n if (typeof val !== 'object') {\n return val;\n }\n\n // If we're cloning an array, use an array as the base, otherwise use an object\n const clonedObject: any = Array.isArray(val) ? [] : {};\n\n for (const key in val) {\n // Recursively clone eack item unless we're at the maximum depth\n clonedObject[key] = depth <= 1 ? val[key] : (val[key] && clone(val[key], depth - 1));\n }\n\n return clonedObject as T;\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColor, IColorRGB } from 'common/Types';\n\n/**\n * Helper functions where the source type is \"channels\" (individual color channels as numbers).\n */\nexport namespace channels {\n export function toCss(r: number, g: number, b: number, a?: number): string {\n if (a !== undefined) {\n return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}${toPaddedHex(a)}`;\n }\n return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}`;\n }\n\n export function toRgba(r: number, g: number, b: number, a: number = 0xFF): number {\n // Note: The aggregated number is RGBA32 (BE), thus needs to be converted to ABGR32\n // on LE systems, before it can be used for direct 32-bit buffer writes.\n // >>> 0 forces an unsigned int\n return (r << 24 | g << 16 | b << 8 | a) >>> 0;\n }\n}\n\n/**\n * Helper functions where the source type is `IColor`.\n */\nexport namespace color {\n export function blend(bg: IColor, fg: IColor): IColor {\n const a = (fg.rgba & 0xFF) / 255;\n if (a === 1) {\n return {\n css: fg.css,\n rgba: fg.rgba\n };\n }\n const fgR = (fg.rgba >> 24) & 0xFF;\n const fgG = (fg.rgba >> 16) & 0xFF;\n const fgB = (fg.rgba >> 8) & 0xFF;\n const bgR = (bg.rgba >> 24) & 0xFF;\n const bgG = (bg.rgba >> 16) & 0xFF;\n const bgB = (bg.rgba >> 8) & 0xFF;\n const r = bgR + Math.round((fgR - bgR) * a);\n const g = bgG + Math.round((fgG - bgG) * a);\n const b = bgB + Math.round((fgB - bgB) * a);\n const css = channels.toCss(r, g, b);\n const rgba = channels.toRgba(r, g, b);\n return { css, rgba };\n }\n\n export function isOpaque(color: IColor): boolean {\n return (color.rgba & 0xFF) === 0xFF;\n }\n\n export function ensureContrastRatio(bg: IColor, fg: IColor, ratio: number): IColor | undefined {\n const result = rgba.ensureContrastRatio(bg.rgba, fg.rgba, ratio);\n if (!result) {\n return undefined;\n }\n return rgba.toColor(\n (result >> 24 & 0xFF),\n (result >> 16 & 0xFF),\n (result >> 8 & 0xFF)\n );\n }\n\n export function opaque(color: IColor): IColor {\n const rgbaColor = (color.rgba | 0xFF) >>> 0;\n const [r, g, b] = rgba.toChannels(rgbaColor);\n return {\n css: channels.toCss(r, g, b),\n rgba: rgbaColor\n };\n }\n\n export function opacity(color: IColor, opacity: number): IColor {\n const a = Math.round(opacity * 0xFF);\n const [r, g, b] = rgba.toChannels(color.rgba);\n return {\n css: channels.toCss(r, g, b, a),\n rgba: channels.toRgba(r, g, b, a)\n };\n }\n\n export function toColorRGB(color: IColor): IColorRGB {\n return [(color.rgba >> 24) & 0xFF, (color.rgba >> 16) & 0xFF, (color.rgba >> 8) & 0xFF];\n }\n}\n\n/**\n * Helper functions where the source type is \"css\" (string: '#rgb', '#rgba', '#rrggbb', '#rrggbbaa').\n */\nexport namespace css {\n export function toColor(css: string): IColor {\n if (css.match(/#[0-9a-f]{3,8}/i)) {\n switch (css.length) {\n case 4: { // #rgb\n const r = parseInt(css.slice(1, 2).repeat(2), 16);\n const g = parseInt(css.slice(2, 3).repeat(2), 16);\n const b = parseInt(css.slice(3, 4).repeat(2), 16);\n return rgba.toColor(r, g, b);\n }\n case 5: { // #rgba\n const r = parseInt(css.slice(1, 2).repeat(2), 16);\n const g = parseInt(css.slice(2, 3).repeat(2), 16);\n const b = parseInt(css.slice(3, 4).repeat(2), 16);\n const a = parseInt(css.slice(4, 5).repeat(2), 16);\n return rgba.toColor(r, g, b, a);\n }\n case 7: // #rrggbb\n return {\n css,\n rgba: (parseInt(css.slice(1), 16) << 8 | 0xFF) >>> 0\n };\n case 9: // #rrggbbaa\n return {\n css,\n rgba: parseInt(css.slice(1), 16) >>> 0\n };\n }\n }\n const rgbaMatch = css.match(/rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(,\\s*(0|1|\\d?\\.(\\d+))\\s*)?\\)/);\n if (rgbaMatch) { // rgb() or rgba()\n const r = parseInt(rgbaMatch[1]);\n const g = parseInt(rgbaMatch[2]);\n const b = parseInt(rgbaMatch[3]);\n const a = Math.round((rgbaMatch[5] === undefined ? 1 : parseFloat(rgbaMatch[5])) * 0xFF);\n return rgba.toColor(r, g, b, a);\n }\n throw new Error('css.toColor: Unsupported css format');\n }\n}\n\n/**\n * Helper functions where the source type is \"rgb\" (number: 0xrrggbb).\n */\nexport namespace rgb {\n /**\n * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio\n * between two colors.\n * @param rgb The color to use.\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\n export function relativeLuminance(rgb: number): number {\n return relativeLuminance2(\n (rgb >> 16) & 0xFF,\n (rgb >> 8 ) & 0xFF,\n (rgb ) & 0xFF);\n }\n\n /**\n * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio\n * between two colors.\n * @param r The red channel (0x00 to 0xFF).\n * @param g The green channel (0x00 to 0xFF).\n * @param b The blue channel (0x00 to 0xFF).\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\n export function relativeLuminance2(r: number, g: number, b: number): number {\n const rs = r / 255;\n const gs = g / 255;\n const bs = b / 255;\n const rr = rs <= 0.03928 ? rs / 12.92 : Math.pow((rs + 0.055) / 1.055, 2.4);\n const rg = gs <= 0.03928 ? gs / 12.92 : Math.pow((gs + 0.055) / 1.055, 2.4);\n const rb = bs <= 0.03928 ? bs / 12.92 : Math.pow((bs + 0.055) / 1.055, 2.4);\n return rr * 0.2126 + rg * 0.7152 + rb * 0.0722;\n }\n}\n\n/**\n * Helper functions where the source type is \"rgba\" (number: 0xrrggbbaa).\n */\nexport namespace rgba {\n /**\n * Given a foreground color and a background color, either increase or reduce the luminance of the\n * foreground color until the specified contrast ratio is met. If pure white or black is hit\n * without the contrast ratio being met, go the other direction using the background color as the\n * foreground color and take either the first or second result depending on which has the higher\n * contrast ratio.\n *\n * `undefined` will be returned if the contrast ratio is already met.\n *\n * @param bgRgba The background color in rgba format.\n * @param fgRgba The foreground color in rgba format.\n * @param ratio The contrast ratio to achieve.\n */\n export function ensureContrastRatio(bgRgba: number, fgRgba: number, ratio: number): number | undefined {\n const bgL = rgb.relativeLuminance(bgRgba >> 8);\n const fgL = rgb.relativeLuminance(fgRgba >> 8);\n const cr = contrastRatio(bgL, fgL);\n if (cr < ratio) {\n if (fgL < bgL) {\n const resultA = reduceLuminance(bgRgba, fgRgba, ratio);\n const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));\n if (resultARatio < ratio) {\n const resultB = increaseLuminance(bgRgba, bgRgba, ratio);\n const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));\n return resultARatio > resultBRatio ? resultA : resultB;\n }\n return resultA;\n }\n const resultA = increaseLuminance(bgRgba, fgRgba, ratio);\n const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));\n if (resultARatio < ratio) {\n const resultB = reduceLuminance(bgRgba, bgRgba, ratio);\n const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));\n return resultARatio > resultBRatio ? resultA : resultB;\n }\n return resultA;\n }\n return undefined;\n }\n\n export function reduceLuminance(bgRgba: number, fgRgba: number, ratio: number): number {\n // This is a naive but fast approach to reducing luminance as converting to\n // HSL and back is expensive\n const bgR = (bgRgba >> 24) & 0xFF;\n const bgG = (bgRgba >> 16) & 0xFF;\n const bgB = (bgRgba >> 8) & 0xFF;\n let fgR = (fgRgba >> 24) & 0xFF;\n let fgG = (fgRgba >> 16) & 0xFF;\n let fgB = (fgRgba >> 8) & 0xFF;\n let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n while (cr < ratio && (fgR > 0 || fgG > 0 || fgB > 0)) {\n // Reduce by 10% until the ratio is hit\n fgR -= Math.max(0, Math.ceil(fgR * 0.1));\n fgG -= Math.max(0, Math.ceil(fgG * 0.1));\n fgB -= Math.max(0, Math.ceil(fgB * 0.1));\n cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n }\n return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;\n }\n\n export function increaseLuminance(bgRgba: number, fgRgba: number, ratio: number): number {\n // This is a naive but fast approach to increasing luminance as converting to\n // HSL and back is expensive\n const bgR = (bgRgba >> 24) & 0xFF;\n const bgG = (bgRgba >> 16) & 0xFF;\n const bgB = (bgRgba >> 8) & 0xFF;\n let fgR = (fgRgba >> 24) & 0xFF;\n let fgG = (fgRgba >> 16) & 0xFF;\n let fgB = (fgRgba >> 8) & 0xFF;\n let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n while (cr < ratio && (fgR < 0xFF || fgG < 0xFF || fgB < 0xFF)) {\n // Increase by 10% until the ratio is hit\n fgR = Math.min(0xFF, fgR + Math.ceil((255 - fgR) * 0.1));\n fgG = Math.min(0xFF, fgG + Math.ceil((255 - fgG) * 0.1));\n fgB = Math.min(0xFF, fgB + Math.ceil((255 - fgB) * 0.1));\n cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n }\n return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;\n }\n\n // FIXME: Move this to channels NS?\n export function toChannels(value: number): [number, number, number, number] {\n return [(value >> 24) & 0xFF, (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF];\n }\n\n export function toColor(r: number, g: number, b: number, a?: number): IColor {\n return {\n css: channels.toCss(r, g, b, a),\n rgba: channels.toRgba(r, g, b, a)\n };\n }\n}\n\nexport function toPaddedHex(c: number): string {\n const s = c.toString(16);\n return s.length < 2 ? '0' + s : s;\n}\n\n/**\n * Gets the contrast ratio between two relative luminance values.\n * @param l1 The first relative luminance.\n * @param l2 The first relative luminance.\n * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef\n */\nexport function contrastRatio(l1: number, l2: number): number {\n if (l1 < l2) {\n return (l2 + 0.05) / (l1 + 0.05);\n }\n return (l1 + 0.05) / (l2 + 0.05);\n}\n", "/**\n * Copyright (c) 2014-2020 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n *\n * Originally forked from (with the author's permission):\n * Fabrice Bellard's javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n *\n * Terminal Emulation References:\n * http://vt100.net/\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html\n * http://invisible-island.net/vttest/\n * http://www.inwap.com/pdp10/ansicode.txt\n * http://linux.die.net/man/4/console_codes\n * http://linux.die.net/man/7/urxvt\n */\n\nimport { Disposable } from 'common/Lifecycle';\nimport { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, ICoreMouseService, IUnicodeService, IDirtyRowService, LogLevelEnum, ITerminalOptions } from 'common/services/Services';\nimport { InstantiationService } from 'common/services/InstantiationService';\nimport { LogService } from 'common/services/LogService';\nimport { BufferService, MINIMUM_COLS, MINIMUM_ROWS } from 'common/services/BufferService';\nimport { OptionsService } from 'common/services/OptionsService';\nimport { IDisposable, IBufferLine, IAttributeData, ICoreTerminal, IKeyboardEvent, IScrollEvent, ScrollSource, ITerminalOptions as IPublicTerminalOptions } from 'common/Types';\nimport { CoreService } from 'common/services/CoreService';\nimport { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';\nimport { CoreMouseService } from 'common/services/CoreMouseService';\nimport { DirtyRowService } from 'common/services/DirtyRowService';\nimport { UnicodeService } from 'common/services/UnicodeService';\nimport { CharsetService } from 'common/services/CharsetService';\nimport { updateWindowsModeWrappedState } from 'common/WindowsMode';\nimport { IFunctionIdentifier, IParams } from 'common/parser/Types';\nimport { IBufferSet } from 'common/buffer/Types';\nimport { InputHandler } from 'common/InputHandler';\nimport { WriteBuffer } from 'common/input/WriteBuffer';\n\n// Only trigger this warning a single time per session\nlet hasWriteSyncWarnHappened = false;\n\nexport abstract class CoreTerminal extends Disposable implements ICoreTerminal {\n protected readonly _instantiationService: IInstantiationService;\n protected readonly _bufferService: IBufferService;\n protected readonly _logService: ILogService;\n protected readonly _charsetService: ICharsetService;\n protected readonly _dirtyRowService: IDirtyRowService;\n\n public readonly coreMouseService: ICoreMouseService;\n public readonly coreService: ICoreService;\n public readonly unicodeService: IUnicodeService;\n public readonly optionsService: IOptionsService;\n\n protected _inputHandler: InputHandler;\n private _writeBuffer: WriteBuffer;\n private _windowsMode: IDisposable | undefined;\n\n private _onBinary = new EventEmitter();\n public get onBinary(): IEvent { return this._onBinary.event; }\n private _onData = new EventEmitter();\n public get onData(): IEvent { return this._onData.event; }\n protected _onLineFeed = new EventEmitter();\n public get onLineFeed(): IEvent { return this._onLineFeed.event; }\n private _onResize = new EventEmitter<{ cols: number, rows: number }>();\n public get onResize(): IEvent<{ cols: number, rows: number }> { return this._onResize.event; }\n protected _onScroll = new EventEmitter();\n public get onWriteParsed(): IEvent { return this._onWriteParsed.event; }\n protected _onWriteParsed = new EventEmitter();\n /**\n * Internally we track the source of the scroll but this is meaningless outside the library so\n * it's filtered out.\n */\n protected _onScrollApi?: EventEmitter;\n public get onScroll(): IEvent {\n if (!this._onScrollApi) {\n this._onScrollApi = new EventEmitter();\n this.register(this._onScroll.event(ev => {\n this._onScrollApi?.fire(ev.position);\n }));\n }\n return this._onScrollApi.event;\n }\n\n public get cols(): number { return this._bufferService.cols; }\n public get rows(): number { return this._bufferService.rows; }\n public get buffers(): IBufferSet { return this._bufferService.buffers; }\n public get options(): ITerminalOptions { return this.optionsService.options; }\n public set options(options: ITerminalOptions) {\n for (const key in options) {\n this.optionsService.options[key] = options[key];\n }\n }\n\n constructor(\n options: Partial\n ) {\n super();\n\n // Setup and initialize services\n this._instantiationService = new InstantiationService();\n this.optionsService = new OptionsService(options);\n this._instantiationService.setService(IOptionsService, this.optionsService);\n this._bufferService = this.register(this._instantiationService.createInstance(BufferService));\n this._instantiationService.setService(IBufferService, this._bufferService);\n this._logService = this._instantiationService.createInstance(LogService);\n this._instantiationService.setService(ILogService, this._logService);\n this.coreService = this.register(this._instantiationService.createInstance(CoreService, () => this.scrollToBottom()));\n this._instantiationService.setService(ICoreService, this.coreService);\n this.coreMouseService = this._instantiationService.createInstance(CoreMouseService);\n this._instantiationService.setService(ICoreMouseService, this.coreMouseService);\n this._dirtyRowService = this._instantiationService.createInstance(DirtyRowService);\n this._instantiationService.setService(IDirtyRowService, this._dirtyRowService);\n this.unicodeService = this._instantiationService.createInstance(UnicodeService);\n this._instantiationService.setService(IUnicodeService, this.unicodeService);\n this._charsetService = this._instantiationService.createInstance(CharsetService);\n this._instantiationService.setService(ICharsetService, this._charsetService);\n\n // Register input handler and handle/forward events\n this._inputHandler = new InputHandler(this._bufferService, this._charsetService, this.coreService, this._dirtyRowService, this._logService, this.optionsService, this.coreMouseService, this.unicodeService);\n this.register(forwardEvent(this._inputHandler.onLineFeed, this._onLineFeed));\n this.register(this._inputHandler);\n\n // Setup listeners\n this.register(forwardEvent(this._bufferService.onResize, this._onResize));\n this.register(forwardEvent(this.coreService.onData, this._onData));\n this.register(forwardEvent(this.coreService.onBinary, this._onBinary));\n this.register(this.optionsService.onOptionChange(key => this._updateOptions(key)));\n this.register(this._bufferService.onScroll(event => {\n this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: ScrollSource.TERMINAL });\n this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);\n }));\n this.register(this._inputHandler.onScroll(event => {\n this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: ScrollSource.TERMINAL });\n this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);\n }));\n\n // Setup WriteBuffer\n this._writeBuffer = new WriteBuffer((data, promiseResult) => this._inputHandler.parse(data, promiseResult));\n this.register(forwardEvent(this._writeBuffer.onWriteParsed, this._onWriteParsed));\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n super.dispose();\n this._windowsMode?.dispose();\n this._windowsMode = undefined;\n }\n\n public write(data: string | Uint8Array, callback?: () => void): void {\n this._writeBuffer.write(data, callback);\n }\n\n /**\n * Write data to terminal synchonously.\n *\n * This method is unreliable with async parser handlers, thus should not\n * be used anymore. If you need blocking semantics on data input consider\n * `write` with a callback instead.\n *\n * @deprecated Unreliable, will be removed soon.\n */\n public writeSync(data: string | Uint8Array, maxSubsequentCalls?: number): void {\n if (this._logService.logLevel <= LogLevelEnum.WARN && !hasWriteSyncWarnHappened) {\n this._logService.warn('writeSync is unreliable and will be removed soon.');\n hasWriteSyncWarnHappened = true;\n }\n this._writeBuffer.writeSync(data, maxSubsequentCalls);\n }\n\n public resize(x: number, y: number): void {\n if (isNaN(x) || isNaN(y)) {\n return;\n }\n\n x = Math.max(x, MINIMUM_COLS);\n y = Math.max(y, MINIMUM_ROWS);\n\n this._bufferService.resize(x, y);\n }\n\n /**\n * Scroll the terminal down 1 row, creating a blank line.\n * @param isWrapped Whether the new line is wrapped from the previous line.\n */\n public scroll(eraseAttr: IAttributeData, isWrapped: boolean = false): void {\n this._bufferService.scroll(eraseAttr, isWrapped);\n }\n\n /**\n * Scroll the display of the terminal\n * @param disp The number of lines to scroll down (negative scroll up).\n * @param suppressScrollEvent Don't emit the scroll event as scrollLines. This is used\n * to avoid unwanted events being handled by the viewport when the event was triggered from the\n * viewport originally.\n */\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void {\n this._bufferService.scrollLines(disp, suppressScrollEvent, source);\n }\n\n /**\n * Scroll the display of the terminal by a number of pages.\n * @param pageCount The number of pages to scroll (negative scrolls up).\n */\n public scrollPages(pageCount: number): void {\n this._bufferService.scrollPages(pageCount);\n }\n\n /**\n * Scrolls the display of the terminal to the top.\n */\n public scrollToTop(): void {\n this._bufferService.scrollToTop();\n }\n\n /**\n * Scrolls the display of the terminal to the bottom.\n */\n public scrollToBottom(): void {\n this._bufferService.scrollToBottom();\n }\n\n public scrollToLine(line: number): void {\n this._bufferService.scrollToLine(line);\n }\n\n /** Add handler for ESC escape sequence. See xterm.d.ts for details. */\n public registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise): IDisposable {\n return this._inputHandler.registerEscHandler(id, callback);\n }\n\n /** Add handler for DCS escape sequence. See xterm.d.ts for details. */\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise): IDisposable {\n return this._inputHandler.registerDcsHandler(id, callback);\n }\n\n /** Add handler for CSI escape sequence. See xterm.d.ts for details. */\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise): IDisposable {\n return this._inputHandler.registerCsiHandler(id, callback);\n }\n\n /** Add handler for OSC escape sequence. See xterm.d.ts for details. */\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable {\n return this._inputHandler.registerOscHandler(ident, callback);\n }\n\n protected _setup(): void {\n if (this.optionsService.rawOptions.windowsMode) {\n this._enableWindowsMode();\n }\n }\n\n public reset(): void {\n this._inputHandler.reset();\n this._bufferService.reset();\n this._charsetService.reset();\n this.coreService.reset();\n this.coreMouseService.reset();\n }\n\n protected _updateOptions(key: string): void {\n // TODO: These listeners should be owned by individual components\n switch (key) {\n case 'scrollback':\n this.buffers.resize(this.cols, this.rows);\n break;\n case 'windowsMode':\n if (this.optionsService.rawOptions.windowsMode) {\n this._enableWindowsMode();\n } else {\n this._windowsMode?.dispose();\n this._windowsMode = undefined;\n }\n break;\n }\n }\n\n protected _enableWindowsMode(): void {\n if (!this._windowsMode) {\n const disposables: IDisposable[] = [];\n disposables.push(this.onLineFeed(updateWindowsModeWrappedState.bind(null, this._bufferService)));\n disposables.push(this.registerCsiHandler({ final: 'H' }, () => {\n updateWindowsModeWrappedState(this._bufferService);\n return false;\n }));\n this._windowsMode = {\n dispose: () => {\n for (const d of disposables) {\n d.dispose();\n }\n }\n };\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\ninterface IListener {\n (arg1: T, arg2: U): void;\n}\n\nexport interface IEvent {\n (listener: (arg1: T, arg2: U) => any): IDisposable;\n}\n\nexport interface IEventEmitter {\n event: IEvent;\n fire(arg1: T, arg2: U): void;\n dispose(): void;\n}\n\nexport class EventEmitter implements IEventEmitter {\n private _listeners: IListener[] = [];\n private _event?: IEvent;\n private _disposed: boolean = false;\n\n public get event(): IEvent {\n if (!this._event) {\n this._event = (listener: (arg1: T, arg2: U) => any) => {\n this._listeners.push(listener);\n const disposable = {\n dispose: () => {\n if (!this._disposed) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n }\n }\n };\n return disposable;\n };\n }\n return this._event;\n }\n\n public fire(arg1: T, arg2: U): void {\n const queue: IListener[] = [];\n for (let i = 0; i < this._listeners.length; i++) {\n queue.push(this._listeners[i]);\n }\n for (let i = 0; i < queue.length; i++) {\n queue[i].call(undefined, arg1, arg2);\n }\n }\n\n public dispose(): void {\n if (this._listeners) {\n this._listeners.length = 0;\n }\n this._disposed = true;\n }\n}\n\nexport function forwardEvent(from: IEvent, to: IEventEmitter): IDisposable {\n return from(e => to.fire(e));\n}\n", "/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n */\n\nimport { IInputHandler, IAttributeData, IDisposable, IWindowOptions, IColorEvent, IParseStack, ColorIndex, ColorRequestType } from 'common/Types';\nimport { C0, C1 } from 'common/data/EscapeSequences';\nimport { CHARSETS, DEFAULT_CHARSET } from 'common/data/Charsets';\nimport { EscapeSequenceParser } from 'common/parser/EscapeSequenceParser';\nimport { Disposable } from 'common/Lifecycle';\nimport { concat } from 'common/TypedArrayUtils';\nimport { StringToUtf32, stringFromCodePoint, utf32ToString, Utf8ToUtf32 } from 'common/input/TextDecoder';\nimport { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IParsingState, IDcsHandler, IEscapeSequenceParser, IParams, IFunctionIdentifier } from 'common/parser/Types';\nimport { NULL_CELL_CODE, NULL_CELL_WIDTH, Attributes, FgFlags, BgFlags, Content, UnderlineStyle } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { ICoreService, IBufferService, IOptionsService, ILogService, IDirtyRowService, ICoreMouseService, ICharsetService, IUnicodeService, LogLevelEnum } from 'common/services/Services';\nimport { OscHandler } from 'common/parser/OscParser';\nimport { DcsHandler } from 'common/parser/DcsParser';\nimport { IBuffer } from 'common/buffer/Types';\nimport { parseColor } from 'common/input/XParseColor';\n\n/**\n * Map collect to glevel. Used in `selectCharset`.\n */\nconst GLEVEL: { [key: string]: number } = { '(': 0, ')': 1, '*': 2, '+': 3, '-': 1, '.': 2 };\n\n/**\n * VT commands done by the parser - FIXME: move this to the parser?\n */\n// @vt: #Y ESC CSI \"Control Sequence Introducer\" \"ESC [\" \"Start of a CSI sequence.\"\n// @vt: #Y ESC OSC \"Operating System Command\" \"ESC ]\" \"Start of an OSC sequence.\"\n// @vt: #Y ESC DCS \"Device Control String\" \"ESC P\" \"Start of a DCS sequence.\"\n// @vt: #Y ESC ST \"String Terminator\" \"ESC \\\" \"Terminator used for string type sequences.\"\n// @vt: #Y ESC PM \"Privacy Message\" \"ESC ^\" \"Start of a privacy message.\"\n// @vt: #Y ESC APC \"Application Program Command\" \"ESC _\" \"Start of an APC sequence.\"\n// @vt: #Y C1 CSI \"Control Sequence Introducer\" \"\\x9B\" \"Start of a CSI sequence.\"\n// @vt: #Y C1 OSC \"Operating System Command\" \"\\x9D\" \"Start of an OSC sequence.\"\n// @vt: #Y C1 DCS \"Device Control String\" \"\\x90\" \"Start of a DCS sequence.\"\n// @vt: #Y C1 ST \"String Terminator\" \"\\x9C\" \"Terminator used for string type sequences.\"\n// @vt: #Y C1 PM \"Privacy Message\" \"\\x9E\" \"Start of a privacy message.\"\n// @vt: #Y C1 APC \"Application Program Command\" \"\\x9F\" \"Start of an APC sequence.\"\n// @vt: #Y C0 NUL \"Null\" \"\\0, \\x00\" \"NUL is ignored.\"\n// @vt: #Y C0 ESC \"Escape\" \"\\e, \\x1B\" \"Start of a sequence. Cancels any other sequence.\"\n\n/**\n * Document common VT features here that are currently unsupported\n */\n// @vt: #N DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q \tPt ST\" \"Draw SIXEL image starting at cursor position.\"\n// @vt: #N OSC 1 \"Set Icon Name\" \"OSC 1 ; Pt BEL\" \"Set icon name.\"\n\n/**\n * Max length of the UTF32 input buffer. Real memory consumption is 4 times higher.\n */\nconst MAX_PARSEBUFFER_LENGTH = 131072;\n\n/**\n * Limit length of title and icon name stacks.\n */\nconst STACK_LIMIT = 10;\n\n// map params to window option\nfunction paramToWindowOption(n: number, opts: IWindowOptions): boolean {\n if (n > 24) {\n return opts.setWinLines || false;\n }\n switch (n) {\n case 1: return !!opts.restoreWin;\n case 2: return !!opts.minimizeWin;\n case 3: return !!opts.setWinPosition;\n case 4: return !!opts.setWinSizePixels;\n case 5: return !!opts.raiseWin;\n case 6: return !!opts.lowerWin;\n case 7: return !!opts.refreshWin;\n case 8: return !!opts.setWinSizeChars;\n case 9: return !!opts.maximizeWin;\n case 10: return !!opts.fullscreenWin;\n case 11: return !!opts.getWinState;\n case 13: return !!opts.getWinPosition;\n case 14: return !!opts.getWinSizePixels;\n case 15: return !!opts.getScreenSizePixels;\n case 16: return !!opts.getCellSizePixels;\n case 18: return !!opts.getWinSizeChars;\n case 19: return !!opts.getScreenSizeChars;\n case 20: return !!opts.getIconTitle;\n case 21: return !!opts.getWinTitle;\n case 22: return !!opts.pushTitle;\n case 23: return !!opts.popTitle;\n case 24: return !!opts.setWinLines;\n }\n return false;\n}\n\nexport enum WindowsOptionsReportType {\n GET_WIN_SIZE_PIXELS = 0,\n GET_CELL_SIZE_PIXELS = 1\n}\n\n// create a warning log if an async handler takes longer than the limit (in ms)\nconst SLOW_ASYNC_LIMIT = 5000;\n\n/**\n * DCS subparser implementations\n */\n\n/**\n * DCS $ q Pt ST\n * DECRQSS (https://vt100.net/docs/vt510-rm/DECRQSS.html)\n * Request Status String (DECRQSS), VT420 and up.\n * Response: DECRPSS (https://vt100.net/docs/vt510-rm/DECRPSS.html)\n *\n * @vt: #P[See limited support below.] DCS DECRQSS \"Request Selection or Setting\" \"DCS $ q Pt ST\" \"Request several terminal settings.\"\n * Response is in the form `ESC P 1 $ r Pt ST` for valid requests, where `Pt` contains the corresponding CSI string,\n * `ESC P 0 ST` for invalid requests.\n *\n * Supported requests and responses:\n *\n * | Type | Request | Response (`Pt`) |\n * | -------------------------------- | ----------------- | ----------------------------------------------------- |\n * | Graphic Rendition (SGR) | `DCS $ q m ST` | always reporting `0m` (currently broken) |\n * | Top and Bottom Margins (DECSTBM) | `DCS $ q r ST` | `Ps ; Ps r` |\n * | Cursor Style (DECSCUSR) | `DCS $ q SP q ST` | `Ps SP q` |\n * | Protection Attribute (DECSCA) | `DCS $ q \" q ST` | always reporting `0 \" q` (DECSCA is unsupported) |\n * | Conformance Level (DECSCL) | `DCS $ q \" p ST` | always reporting `61 ; 1 \" p` (DECSCL is unsupported) |\n *\n *\n * TODO:\n * - fix SGR report\n * - either implement DECSCA or remove the report\n * - either check which conformance is better suited or remove the report completely\n * --> we are currently a mixture of all up to VT400 but dont follow anyone strictly\n */\nclass DECRQSS implements IDcsHandler {\n private _data: Uint32Array = new Uint32Array(0);\n\n constructor(\n private _bufferService: IBufferService,\n private _coreService: ICoreService,\n private _logService: ILogService,\n private _optionsService: IOptionsService\n ) { }\n\n public hook(params: IParams): void {\n this._data = new Uint32Array(0);\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n this._data = concat(this._data, data.subarray(start, end));\n }\n\n public unhook(success: boolean): boolean {\n if (!success) {\n this._data = new Uint32Array(0);\n return true;\n }\n const data = utf32ToString(this._data);\n this._data = new Uint32Array(0);\n switch (data) {\n // valid: DCS 1 $ r Pt ST (xterm)\n case '\"q': // DECSCA\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r0\"q${C0.ESC}\\\\`);\n break;\n case '\"p': // DECSCL\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r61;1\"p${C0.ESC}\\\\`);\n break;\n case 'r': // DECSTBM\n const pt = '' + (this._bufferService.buffer.scrollTop + 1) +\n ';' + (this._bufferService.buffer.scrollBottom + 1) + 'r';\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r${pt}${C0.ESC}\\\\`);\n break;\n case 'm': // SGR\n // TODO: report real settings instead of 0m\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r0m${C0.ESC}\\\\`);\n break;\n case ' q': // DECSCUSR\n const STYLES: { [key: string]: number } = { 'block': 2, 'underline': 4, 'bar': 6 };\n let style = STYLES[this._optionsService.rawOptions.cursorStyle];\n style -= this._optionsService.rawOptions.cursorBlink ? 1 : 0;\n this._coreService.triggerDataEvent(`${C0.ESC}P1$r${style} q${C0.ESC}\\\\`);\n break;\n default:\n // invalid: DCS 0 $ r Pt ST (xterm)\n this._logService.debug('Unknown DCS $q %s', data);\n this._coreService.triggerDataEvent(`${C0.ESC}P0$r${C0.ESC}\\\\`);\n }\n return true;\n }\n}\n\n/**\n * DCS Ps; Ps| Pt ST\n * DECUDK (https://vt100.net/docs/vt510-rm/DECUDK.html)\n * not supported\n *\n * @vt: #N DCS DECUDK \"User Defined Keys\" \"DCS Ps ; Ps | Pt ST\" \"Definitions for user-defined keys.\"\n */\n\n/**\n * DCS + q Pt ST (xterm)\n * Request Terminfo String\n * not implemented\n *\n * @vt: #N DCS XTGETTCAP \"Request Terminfo String\" \"DCS + q Pt ST\" \"Request Terminfo String.\"\n */\n\n/**\n * DCS + p Pt ST (xterm)\n * Set Terminfo Data\n * not supported\n *\n * @vt: #N DCS XTSETTCAP \"Set Terminfo Data\" \"DCS + p Pt ST\" \"Set Terminfo Data.\"\n */\n\n\n\n/**\n * The terminal's standard implementation of IInputHandler, this handles all\n * input from the Parser.\n *\n * Refer to http://invisible-island.net/xterm/ctlseqs/ctlseqs.html to understand\n * each function's header comment.\n */\nexport class InputHandler extends Disposable implements IInputHandler {\n private _parseBuffer: Uint32Array = new Uint32Array(4096);\n private _stringDecoder: StringToUtf32 = new StringToUtf32();\n private _utf8Decoder: Utf8ToUtf32 = new Utf8ToUtf32();\n private _workCell: CellData = new CellData();\n private _windowTitle = '';\n private _iconName = '';\n protected _windowTitleStack: string[] = [];\n protected _iconNameStack: string[] = [];\n\n private _curAttrData: IAttributeData = DEFAULT_ATTR_DATA.clone();\n private _eraseAttrDataInternal: IAttributeData = DEFAULT_ATTR_DATA.clone();\n\n private _activeBuffer: IBuffer;\n\n private _onRequestBell = new EventEmitter();\n public get onRequestBell(): IEvent { return this._onRequestBell.event; }\n private _onRequestRefreshRows = new EventEmitter();\n public get onRequestRefreshRows(): IEvent { return this._onRequestRefreshRows.event; }\n private _onRequestReset = new EventEmitter();\n public get onRequestReset(): IEvent { return this._onRequestReset.event; }\n private _onRequestSendFocus = new EventEmitter();\n public get onRequestSendFocus(): IEvent { return this._onRequestSendFocus.event; }\n private _onRequestSyncScrollBar = new EventEmitter();\n public get onRequestSyncScrollBar(): IEvent { return this._onRequestSyncScrollBar.event; }\n private _onRequestWindowsOptionsReport = new EventEmitter();\n public get onRequestWindowsOptionsReport(): IEvent { return this._onRequestWindowsOptionsReport.event; }\n\n private _onA11yChar = new EventEmitter();\n public get onA11yChar(): IEvent { return this._onA11yChar.event; }\n private _onA11yTab = new EventEmitter();\n public get onA11yTab(): IEvent { return this._onA11yTab.event; }\n private _onCursorMove = new EventEmitter();\n public get onCursorMove(): IEvent { return this._onCursorMove.event; }\n private _onLineFeed = new EventEmitter();\n public get onLineFeed(): IEvent { return this._onLineFeed.event; }\n private _onScroll = new EventEmitter();\n public get onScroll(): IEvent { return this._onScroll.event; }\n private _onTitleChange = new EventEmitter();\n public get onTitleChange(): IEvent { return this._onTitleChange.event; }\n private _onColor = new EventEmitter();\n public get onColor(): IEvent { return this._onColor.event; }\n\n private _parseStack: IParseStack = {\n paused: false,\n cursorStartX: 0,\n cursorStartY: 0,\n decodedLength: 0,\n position: 0\n };\n\n constructor(\n private readonly _bufferService: IBufferService,\n private readonly _charsetService: ICharsetService,\n private readonly _coreService: ICoreService,\n private readonly _dirtyRowService: IDirtyRowService,\n private readonly _logService: ILogService,\n private readonly _optionsService: IOptionsService,\n private readonly _coreMouseService: ICoreMouseService,\n private readonly _unicodeService: IUnicodeService,\n private readonly _parser: IEscapeSequenceParser = new EscapeSequenceParser()\n ) {\n super();\n this.register(this._parser);\n\n // Track properties used in performance critical code manually to avoid using slow getters\n this._activeBuffer = this._bufferService.buffer;\n this.register(this._bufferService.buffers.onBufferActivate(e => this._activeBuffer = e.activeBuffer));\n\n /**\n * custom fallback handlers\n */\n this._parser.setCsiHandlerFallback((ident, params) => {\n this._logService.debug('Unknown CSI code: ', { identifier: this._parser.identToString(ident), params: params.toArray() });\n });\n this._parser.setEscHandlerFallback(ident => {\n this._logService.debug('Unknown ESC code: ', { identifier: this._parser.identToString(ident) });\n });\n this._parser.setExecuteHandlerFallback(code => {\n this._logService.debug('Unknown EXECUTE code: ', { code });\n });\n this._parser.setOscHandlerFallback((identifier, action, data) => {\n this._logService.debug('Unknown OSC code: ', { identifier, action, data });\n });\n this._parser.setDcsHandlerFallback((ident, action, payload) => {\n if (action === 'HOOK') {\n payload = payload.toArray();\n }\n this._logService.debug('Unknown DCS code: ', { identifier: this._parser.identToString(ident), action, payload });\n });\n\n /**\n * print handler\n */\n this._parser.setPrintHandler((data, start, end) => this.print(data, start, end));\n\n /**\n * CSI handler\n */\n this._parser.registerCsiHandler({ final: '@' }, params => this.insertChars(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: '@' }, params => this.scrollLeft(params));\n this._parser.registerCsiHandler({ final: 'A' }, params => this.cursorUp(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: 'A' }, params => this.scrollRight(params));\n this._parser.registerCsiHandler({ final: 'B' }, params => this.cursorDown(params));\n this._parser.registerCsiHandler({ final: 'C' }, params => this.cursorForward(params));\n this._parser.registerCsiHandler({ final: 'D' }, params => this.cursorBackward(params));\n this._parser.registerCsiHandler({ final: 'E' }, params => this.cursorNextLine(params));\n this._parser.registerCsiHandler({ final: 'F' }, params => this.cursorPrecedingLine(params));\n this._parser.registerCsiHandler({ final: 'G' }, params => this.cursorCharAbsolute(params));\n this._parser.registerCsiHandler({ final: 'H' }, params => this.cursorPosition(params));\n this._parser.registerCsiHandler({ final: 'I' }, params => this.cursorForwardTab(params));\n this._parser.registerCsiHandler({ final: 'J' }, params => this.eraseInDisplay(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'J' }, params => this.eraseInDisplay(params));\n this._parser.registerCsiHandler({ final: 'K' }, params => this.eraseInLine(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'K' }, params => this.eraseInLine(params));\n this._parser.registerCsiHandler({ final: 'L' }, params => this.insertLines(params));\n this._parser.registerCsiHandler({ final: 'M' }, params => this.deleteLines(params));\n this._parser.registerCsiHandler({ final: 'P' }, params => this.deleteChars(params));\n this._parser.registerCsiHandler({ final: 'S' }, params => this.scrollUp(params));\n this._parser.registerCsiHandler({ final: 'T' }, params => this.scrollDown(params));\n this._parser.registerCsiHandler({ final: 'X' }, params => this.eraseChars(params));\n this._parser.registerCsiHandler({ final: 'Z' }, params => this.cursorBackwardTab(params));\n this._parser.registerCsiHandler({ final: '`' }, params => this.charPosAbsolute(params));\n this._parser.registerCsiHandler({ final: 'a' }, params => this.hPositionRelative(params));\n this._parser.registerCsiHandler({ final: 'b' }, params => this.repeatPrecedingCharacter(params));\n this._parser.registerCsiHandler({ final: 'c' }, params => this.sendDeviceAttributesPrimary(params));\n this._parser.registerCsiHandler({ prefix: '>', final: 'c' }, params => this.sendDeviceAttributesSecondary(params));\n this._parser.registerCsiHandler({ final: 'd' }, params => this.linePosAbsolute(params));\n this._parser.registerCsiHandler({ final: 'e' }, params => this.vPositionRelative(params));\n this._parser.registerCsiHandler({ final: 'f' }, params => this.hVPosition(params));\n this._parser.registerCsiHandler({ final: 'g' }, params => this.tabClear(params));\n this._parser.registerCsiHandler({ final: 'h' }, params => this.setMode(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this.setModePrivate(params));\n this._parser.registerCsiHandler({ final: 'l' }, params => this.resetMode(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this.resetModePrivate(params));\n this._parser.registerCsiHandler({ final: 'm' }, params => this.charAttributes(params));\n this._parser.registerCsiHandler({ final: 'n' }, params => this.deviceStatus(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'n' }, params => this.deviceStatusPrivate(params));\n this._parser.registerCsiHandler({ intermediates: '!', final: 'p' }, params => this.softReset(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: 'q' }, params => this.setCursorStyle(params));\n this._parser.registerCsiHandler({ final: 'r' }, params => this.setScrollRegion(params));\n this._parser.registerCsiHandler({ final: 's' }, params => this.saveCursor(params));\n this._parser.registerCsiHandler({ final: 't' }, params => this.windowOptions(params));\n this._parser.registerCsiHandler({ final: 'u' }, params => this.restoreCursor(params));\n this._parser.registerCsiHandler({ intermediates: '\\'', final: '}' }, params => this.insertColumns(params));\n this._parser.registerCsiHandler({ intermediates: '\\'', final: '~' }, params => this.deleteColumns(params));\n\n /**\n * execute handler\n */\n this._parser.setExecuteHandler(C0.BEL, () => this.bell());\n this._parser.setExecuteHandler(C0.LF, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.VT, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.FF, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.CR, () => this.carriageReturn());\n this._parser.setExecuteHandler(C0.BS, () => this.backspace());\n this._parser.setExecuteHandler(C0.HT, () => this.tab());\n this._parser.setExecuteHandler(C0.SO, () => this.shiftOut());\n this._parser.setExecuteHandler(C0.SI, () => this.shiftIn());\n // FIXME: What do to with missing? Old code just added those to print.\n\n this._parser.setExecuteHandler(C1.IND, () => this.index());\n this._parser.setExecuteHandler(C1.NEL, () => this.nextLine());\n this._parser.setExecuteHandler(C1.HTS, () => this.tabSet());\n\n /**\n * OSC handler\n */\n // 0 - icon name + title\n this._parser.registerOscHandler(0, new OscHandler(data => { this.setTitle(data); this.setIconName(data); return true; }));\n // 1 - icon name\n this._parser.registerOscHandler(1, new OscHandler(data => this.setIconName(data)));\n // 2 - title\n this._parser.registerOscHandler(2, new OscHandler(data => this.setTitle(data)));\n // 3 - set property X in the form \"prop=value\"\n // 4 - Change Color Number\n this._parser.registerOscHandler(4, new OscHandler(data => this.setOrReportIndexedColor(data)));\n // 5 - Change Special Color Number\n // 6 - Enable/disable Special Color Number c\n // 7 - current directory? (not in xterm spec, see https://gitlab.com/gnachman/iterm2/issues/3939)\n // 10 - Change VT100 text foreground color to Pt.\n this._parser.registerOscHandler(10, new OscHandler(data => this.setOrReportFgColor(data)));\n // 11 - Change VT100 text background color to Pt.\n this._parser.registerOscHandler(11, new OscHandler(data => this.setOrReportBgColor(data)));\n // 12 - Change text cursor color to Pt.\n this._parser.registerOscHandler(12, new OscHandler(data => this.setOrReportCursorColor(data)));\n // 13 - Change mouse foreground color to Pt.\n // 14 - Change mouse background color to Pt.\n // 15 - Change Tektronix foreground color to Pt.\n // 16 - Change Tektronix background color to Pt.\n // 17 - Change highlight background color to Pt.\n // 18 - Change Tektronix cursor color to Pt.\n // 19 - Change highlight foreground color to Pt.\n // 46 - Change Log File to Pt.\n // 50 - Set Font to Pt.\n // 51 - reserved for Emacs shell.\n // 52 - Manipulate Selection Data.\n // 104 ; c - Reset Color Number c.\n this._parser.registerOscHandler(104, new OscHandler(data => this.restoreIndexedColor(data)));\n // 105 ; c - Reset Special Color Number c.\n // 106 ; c; f - Enable/disable Special Color Number c.\n // 110 - Reset VT100 text foreground color.\n this._parser.registerOscHandler(110, new OscHandler(data => this.restoreFgColor(data)));\n // 111 - Reset VT100 text background color.\n this._parser.registerOscHandler(111, new OscHandler(data => this.restoreBgColor(data)));\n // 112 - Reset text cursor color.\n this._parser.registerOscHandler(112, new OscHandler(data => this.restoreCursorColor(data)));\n // 113 - Reset mouse foreground color.\n // 114 - Reset mouse background color.\n // 115 - Reset Tektronix foreground color.\n // 116 - Reset Tektronix background color.\n // 117 - Reset highlight color.\n // 118 - Reset Tektronix cursor color.\n // 119 - Reset highlight foreground color.\n\n /**\n * ESC handlers\n */\n this._parser.registerEscHandler({ final: '7' }, () => this.saveCursor());\n this._parser.registerEscHandler({ final: '8' }, () => this.restoreCursor());\n this._parser.registerEscHandler({ final: 'D' }, () => this.index());\n this._parser.registerEscHandler({ final: 'E' }, () => this.nextLine());\n this._parser.registerEscHandler({ final: 'H' }, () => this.tabSet());\n this._parser.registerEscHandler({ final: 'M' }, () => this.reverseIndex());\n this._parser.registerEscHandler({ final: '=' }, () => this.keypadApplicationMode());\n this._parser.registerEscHandler({ final: '>' }, () => this.keypadNumericMode());\n this._parser.registerEscHandler({ final: 'c' }, () => this.fullReset());\n this._parser.registerEscHandler({ final: 'n' }, () => this.setgLevel(2));\n this._parser.registerEscHandler({ final: 'o' }, () => this.setgLevel(3));\n this._parser.registerEscHandler({ final: '|' }, () => this.setgLevel(3));\n this._parser.registerEscHandler({ final: '}' }, () => this.setgLevel(2));\n this._parser.registerEscHandler({ final: '~' }, () => this.setgLevel(1));\n this._parser.registerEscHandler({ intermediates: '%', final: '@' }, () => this.selectDefaultCharset());\n this._parser.registerEscHandler({ intermediates: '%', final: 'G' }, () => this.selectDefaultCharset());\n for (const flag in CHARSETS) {\n this._parser.registerEscHandler({ intermediates: '(', final: flag }, () => this.selectCharset('(' + flag));\n this._parser.registerEscHandler({ intermediates: ')', final: flag }, () => this.selectCharset(')' + flag));\n this._parser.registerEscHandler({ intermediates: '*', final: flag }, () => this.selectCharset('*' + flag));\n this._parser.registerEscHandler({ intermediates: '+', final: flag }, () => this.selectCharset('+' + flag));\n this._parser.registerEscHandler({ intermediates: '-', final: flag }, () => this.selectCharset('-' + flag));\n this._parser.registerEscHandler({ intermediates: '.', final: flag }, () => this.selectCharset('.' + flag));\n this._parser.registerEscHandler({ intermediates: '/', final: flag }, () => this.selectCharset('/' + flag)); // TODO: supported?\n }\n this._parser.registerEscHandler({ intermediates: '#', final: '8' }, () => this.screenAlignmentPattern());\n\n /**\n * error handler\n */\n this._parser.setErrorHandler((state: IParsingState) => {\n this._logService.error('Parsing error: ', state);\n return state;\n });\n\n /**\n * DCS handler\n */\n this._parser.registerDcsHandler({ intermediates: '$', final: 'q' }, new DECRQSS(this._bufferService, this._coreService, this._logService, this._optionsService));\n }\n\n public dispose(): void {\n super.dispose();\n }\n\n /**\n * Async parse support.\n */\n private _preserveStack(cursorStartX: number, cursorStartY: number, decodedLength: number, position: number): void {\n this._parseStack.paused = true;\n this._parseStack.cursorStartX = cursorStartX;\n this._parseStack.cursorStartY = cursorStartY;\n this._parseStack.decodedLength = decodedLength;\n this._parseStack.position = position;\n }\n\n private _logSlowResolvingAsync(p: Promise): void {\n // log a limited warning about an async handler taking too long\n if (this._logService.logLevel <= LogLevelEnum.WARN) {\n Promise.race([p, new Promise((res, rej) => setTimeout(() => rej('#SLOW_TIMEOUT'), SLOW_ASYNC_LIMIT))])\n .catch(err => {\n if (err !== '#SLOW_TIMEOUT') {\n throw err;\n }\n console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`);\n });\n }\n }\n\n /**\n * Parse call with async handler support.\n *\n * Whether the stack state got preserved for the next call, is indicated by the return value:\n * - undefined (void):\n * all handlers were sync, no stack save, continue normally with next chunk\n * - Promise\\:\n * execution stopped at async handler, stack saved, continue with\n * same chunk and the promise resolve value as `promiseResult` until the method returns `undefined`\n *\n * Note: This method should only be called by `Terminal.write` to ensure correct execution order and\n * proper continuation of async parser handlers.\n */\n public parse(data: string | Uint8Array, promiseResult?: boolean): void | Promise {\n let result: void | Promise;\n let cursorStartX = this._activeBuffer.x;\n let cursorStartY = this._activeBuffer.y;\n let start = 0;\n const wasPaused = this._parseStack.paused;\n\n if (wasPaused) {\n // assumption: _parseBuffer never mutates between async calls\n if (result = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, promiseResult)) {\n this._logSlowResolvingAsync(result);\n return result;\n }\n cursorStartX = this._parseStack.cursorStartX;\n cursorStartY = this._parseStack.cursorStartY;\n this._parseStack.paused = false;\n if (data.length > MAX_PARSEBUFFER_LENGTH) {\n start = this._parseStack.position + MAX_PARSEBUFFER_LENGTH;\n }\n }\n\n // Log debug data, the log level gate is to prevent extra work in this hot path\n if (this._logService.logLevel <= LogLevelEnum.DEBUG) {\n this._logService.debug(`parsing data${typeof data === 'string' ? ` \"${data}\"` : ` \"${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}\"`}`, typeof data === 'string'\n ? data.split('').map(e => e.charCodeAt(0))\n : data\n );\n }\n\n // resize input buffer if needed\n if (this._parseBuffer.length < data.length) {\n if (this._parseBuffer.length < MAX_PARSEBUFFER_LENGTH) {\n this._parseBuffer = new Uint32Array(Math.min(data.length, MAX_PARSEBUFFER_LENGTH));\n }\n }\n\n // Clear the dirty row service so we know which lines changed as a result of parsing\n // Important: do not clear between async calls, otherwise we lost pending update information.\n if (!wasPaused) {\n this._dirtyRowService.clearRange();\n }\n\n // process big data in smaller chunks\n if (data.length > MAX_PARSEBUFFER_LENGTH) {\n for (let i = start; i < data.length; i += MAX_PARSEBUFFER_LENGTH) {\n const end = i + MAX_PARSEBUFFER_LENGTH < data.length ? i + MAX_PARSEBUFFER_LENGTH : data.length;\n const len = (typeof data === 'string')\n ? this._stringDecoder.decode(data.substring(i, end), this._parseBuffer)\n : this._utf8Decoder.decode(data.subarray(i, end), this._parseBuffer);\n if (result = this._parser.parse(this._parseBuffer, len)) {\n this._preserveStack(cursorStartX, cursorStartY, len, i);\n this._logSlowResolvingAsync(result);\n return result;\n }\n }\n } else {\n if (!wasPaused) {\n const len = (typeof data === 'string')\n ? this._stringDecoder.decode(data, this._parseBuffer)\n : this._utf8Decoder.decode(data, this._parseBuffer);\n if (result = this._parser.parse(this._parseBuffer, len)) {\n this._preserveStack(cursorStartX, cursorStartY, len, 0);\n this._logSlowResolvingAsync(result);\n return result;\n }\n }\n }\n\n if (this._activeBuffer.x !== cursorStartX || this._activeBuffer.y !== cursorStartY) {\n this._onCursorMove.fire();\n }\n\n // Refresh any dirty rows accumulated as part of parsing\n this._onRequestRefreshRows.fire(this._dirtyRowService.start, this._dirtyRowService.end);\n }\n\n public print(data: Uint32Array, start: number, end: number): void {\n let code: number;\n let chWidth: number;\n const charset = this._charsetService.charset;\n const screenReaderMode = this._optionsService.rawOptions.screenReaderMode;\n const cols = this._bufferService.cols;\n const wraparoundMode = this._coreService.decPrivateModes.wraparound;\n const insertMode = this._coreService.modes.insertMode;\n const curAttr = this._curAttrData;\n let bufferRow = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n\n // handle wide chars: reset start_cell-1 if we would overwrite the second cell of a wide char\n if (this._activeBuffer.x && end - start > 0 && bufferRow.getWidth(this._activeBuffer.x - 1) === 2) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x - 1, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n\n for (let pos = start; pos < end; ++pos) {\n code = data[pos];\n\n // calculate print space\n // expensive call, therefore we save width in line buffer\n chWidth = this._unicodeService.wcwidth(code);\n\n // get charset replacement character\n // charset is only defined for ASCII, therefore we only\n // search for an replacement char if code < 127\n if (code < 127 && charset) {\n const ch = charset[String.fromCharCode(code)];\n if (ch) {\n code = ch.charCodeAt(0);\n }\n }\n\n if (screenReaderMode) {\n this._onA11yChar.fire(stringFromCodePoint(code));\n }\n\n // insert combining char at last cursor position\n // this._activeBuffer.x should never be 0 for a combining char\n // since they always follow a cell consuming char\n // therefore we can test for this._activeBuffer.x to avoid overflow left\n if (!chWidth && this._activeBuffer.x) {\n if (!bufferRow.getWidth(this._activeBuffer.x - 1)) {\n // found empty cell after fullwidth, need to go 2 cells back\n // it is save to step 2 cells back here\n // since an empty cell is only set by fullwidth chars\n bufferRow.addCodepointToCell(this._activeBuffer.x - 2, code);\n } else {\n bufferRow.addCodepointToCell(this._activeBuffer.x - 1, code);\n }\n continue;\n }\n\n // goto next line if ch would overflow\n // NOTE: To avoid costly width checks here,\n // the terminal does not allow a cols < 2.\n if (this._activeBuffer.x + chWidth - 1 >= cols) {\n // autowrap - DECAWM\n // automatically wraps to the beginning of the next line\n if (wraparoundMode) {\n // clear left over cells to the right\n while (this._activeBuffer.x < cols) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n this._activeBuffer.x = 0;\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData(), true);\n } else {\n if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n // The line already exists (eg. the initial viewport), mark it as a\n // wrapped line\n this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!.isWrapped = true;\n }\n // row changed, get it again\n bufferRow = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n } else {\n this._activeBuffer.x = cols - 1;\n if (chWidth === 2) {\n // FIXME: check for xterm behavior\n // What to do here? We got a wide char that does not fit into last cell\n continue;\n }\n }\n }\n\n // insert mode: move characters to right\n if (insertMode) {\n // right shift cells according to the width\n bufferRow.insertCells(this._activeBuffer.x, chWidth, this._activeBuffer.getNullCell(curAttr), curAttr);\n // test last cell - since the last cell has only room for\n // a halfwidth char any fullwidth shifted there is lost\n // and will be set to empty cell\n if (bufferRow.getWidth(cols - 1) === 2) {\n bufferRow.setCellFromCodePoint(cols - 1, NULL_CELL_CODE, NULL_CELL_WIDTH, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n }\n\n // write current char to buffer and advance cursor\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, code, chWidth, curAttr.fg, curAttr.bg, curAttr.extended);\n\n // fullwidth char - also set next cell to placeholder stub and advance cursor\n // for graphemes bigger than fullwidth we can simply loop to zero\n // we already made sure above, that this._activeBuffer.x + chWidth will not overflow right\n if (chWidth > 0) {\n while (--chWidth) {\n // other than a regular empty cell a cell following a wide char has no width\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, 0, 0, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n }\n }\n // store last char in Parser.precedingCodepoint for REP to work correctly\n // This needs to check whether:\n // - fullwidth + surrogates: reset\n // - combining: only base char gets carried on (bug in xterm?)\n if (end - start > 0) {\n bufferRow.loadCell(this._activeBuffer.x - 1, this._workCell);\n if (this._workCell.getWidth() === 2 || this._workCell.getCode() > 0xFFFF) {\n this._parser.precedingCodepoint = 0;\n } else if (this._workCell.isCombined()) {\n this._parser.precedingCodepoint = this._workCell.getChars().charCodeAt(0);\n } else {\n this._parser.precedingCodepoint = this._workCell.content;\n }\n }\n\n // handle wide chars: reset cell to the right if it is second cell of a wide char\n if (this._activeBuffer.x < cols && end - start > 0 && bufferRow.getWidth(this._activeBuffer.x) === 0 && !bufferRow.hasContent(this._activeBuffer.x)) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Forward registerCsiHandler from parser.\n */\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise): IDisposable {\n if (id.final === 't' && !id.prefix && !id.intermediates) {\n // security: always check whether window option is allowed\n return this._parser.registerCsiHandler(id, params => {\n if (!paramToWindowOption(params.params[0], this._optionsService.rawOptions.windowOptions)) {\n return true;\n }\n return callback(params);\n });\n }\n return this._parser.registerCsiHandler(id, callback);\n }\n\n /**\n * Forward registerDcsHandler from parser.\n */\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise): IDisposable {\n return this._parser.registerDcsHandler(id, new DcsHandler(callback));\n }\n\n /**\n * Forward registerEscHandler from parser.\n */\n public registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise): IDisposable {\n return this._parser.registerEscHandler(id, callback);\n }\n\n /**\n * Forward registerOscHandler from parser.\n */\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable {\n return this._parser.registerOscHandler(ident, new OscHandler(callback));\n }\n\n /**\n * BEL\n * Bell (Ctrl-G).\n *\n * @vt: #Y C0 BEL \"Bell\" \"\\a, \\x07\" \"Ring the bell.\"\n * The behavior of the bell is further customizable with `ITerminalOptions.bellStyle`\n * and `ITerminalOptions.bellSound`.\n */\n public bell(): boolean {\n this._onRequestBell.fire();\n return true;\n }\n\n /**\n * LF\n * Line Feed or New Line (NL). (LF is Ctrl-J).\n *\n * @vt: #Y C0 LF \"Line Feed\" \"\\n, \\x0A\" \"Move the cursor one row down, scrolling if needed.\"\n * Scrolling is restricted to scroll margins and will only happen on the bottom line.\n *\n * @vt: #Y C0 VT \"Vertical Tabulation\" \"\\v, \\x0B\" \"Treated as LF.\"\n * @vt: #Y C0 FF \"Form Feed\" \"\\f, \\x0C\" \"Treated as LF.\"\n */\n public lineFeed(): boolean {\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n if (this._optionsService.rawOptions.convertEol) {\n this._activeBuffer.x = 0;\n }\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData());\n } else if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n // If the end of the line is hit, prevent this action from wrapping around to the next line.\n if (this._activeBuffer.x >= this._bufferService.cols) {\n this._activeBuffer.x--;\n }\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n\n this._onLineFeed.fire();\n return true;\n }\n\n /**\n * CR\n * Carriage Return (Ctrl-M).\n *\n * @vt: #Y C0 CR \"Carriage Return\" \"\\r, \\x0D\" \"Move the cursor to the beginning of the row.\"\n */\n public carriageReturn(): boolean {\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * BS\n * Backspace (Ctrl-H).\n *\n * @vt: #Y C0 BS \"Backspace\" \"\\b, \\x08\" \"Move the cursor one position to the left.\"\n * By default it is not possible to move the cursor past the leftmost position.\n * If `reverse wrap-around` (`CSI ? 45 h`) is set, a previous soft line wrap (DECAWM)\n * can be undone with BS within the scroll margins. In that case the cursor will wrap back\n * to the end of the previous row. Note that it is not possible to peek back into the scrollbuffer\n * with the cursor, thus at the home position (top-leftmost cell) this has no effect.\n */\n public backspace(): boolean {\n // reverse wrap-around is disabled\n if (!this._coreService.decPrivateModes.reverseWraparound) {\n this._restrictCursor();\n if (this._activeBuffer.x > 0) {\n this._activeBuffer.x--;\n }\n return true;\n }\n\n // reverse wrap-around is enabled\n // other than for normal operation mode, reverse wrap-around allows the cursor\n // to be at x=cols to be able to address the last cell of a row by BS\n this._restrictCursor(this._bufferService.cols);\n\n if (this._activeBuffer.x > 0) {\n this._activeBuffer.x--;\n } else {\n /**\n * reverse wrap-around handling:\n * Our implementation deviates from xterm on purpose. Details:\n * - only previous soft NLs can be reversed (isWrapped=true)\n * - only works within scrollborders (top/bottom, left/right not yet supported)\n * - cannot peek into scrollbuffer\n * - any cursor movement sequence keeps working as expected\n */\n if (this._activeBuffer.x === 0\n && this._activeBuffer.y > this._activeBuffer.scrollTop\n && this._activeBuffer.y <= this._activeBuffer.scrollBottom\n && this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)?.isWrapped) {\n this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!.isWrapped = false;\n this._activeBuffer.y--;\n this._activeBuffer.x = this._bufferService.cols - 1;\n // find last taken cell - last cell can have 3 different states:\n // - hasContent(true) + hasWidth(1): narrow char - we are done\n // - hasWidth(0): second part of wide char - we are done\n // - hasContent(false) + hasWidth(1): empty cell due to early wrapping wide char, go one cell further back\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n if (line.hasWidth(this._activeBuffer.x) && !line.hasContent(this._activeBuffer.x)) {\n this._activeBuffer.x--;\n // We do this only once, since width=1 + hasContent=false currently happens only once before\n // early wrapping of a wide char.\n // This needs to be fixed once we support graphemes taking more than 2 cells.\n }\n }\n }\n this._restrictCursor();\n return true;\n }\n\n /**\n * TAB\n * Horizontal Tab (HT) (Ctrl-I).\n *\n * @vt: #Y C0 HT \"Horizontal Tabulation\" \"\\t, \\x09\" \"Move the cursor to the next character tab stop.\"\n */\n public tab(): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n const originalX = this._activeBuffer.x;\n this._activeBuffer.x = this._activeBuffer.nextStop();\n if (this._optionsService.rawOptions.screenReaderMode) {\n this._onA11yTab.fire(this._activeBuffer.x - originalX);\n }\n return true;\n }\n\n /**\n * SO\n * Shift Out (Ctrl-N) -> Switch to Alternate Character Set. This invokes the\n * G1 character set.\n *\n * @vt: #P[Only limited ISO-2022 charset support.] C0 SO \"Shift Out\" \"\\x0E\" \"Switch to an alternative character set.\"\n */\n public shiftOut(): boolean {\n this._charsetService.setgLevel(1);\n return true;\n }\n\n /**\n * SI\n * Shift In (Ctrl-O) -> Switch to Standard Character Set. This invokes the G0\n * character set (the default).\n *\n * @vt: #Y C0 SI \"Shift In\" \"\\x0F\" \"Return to regular character set after Shift Out.\"\n */\n public shiftIn(): boolean {\n this._charsetService.setgLevel(0);\n return true;\n }\n\n /**\n * Restrict cursor to viewport size / scroll margin (origin mode).\n */\n private _restrictCursor(maxCol: number = this._bufferService.cols - 1): void {\n this._activeBuffer.x = Math.min(maxCol, Math.max(0, this._activeBuffer.x));\n this._activeBuffer.y = this._coreService.decPrivateModes.origin\n ? Math.min(this._activeBuffer.scrollBottom, Math.max(this._activeBuffer.scrollTop, this._activeBuffer.y))\n : Math.min(this._bufferService.rows - 1, Math.max(0, this._activeBuffer.y));\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Set absolute cursor position.\n */\n private _setCursor(x: number, y: number): void {\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n if (this._coreService.decPrivateModes.origin) {\n this._activeBuffer.x = x;\n this._activeBuffer.y = this._activeBuffer.scrollTop + y;\n } else {\n this._activeBuffer.x = x;\n this._activeBuffer.y = y;\n }\n this._restrictCursor();\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Set relative cursor position.\n */\n private _moveCursor(x: number, y: number): void {\n // for relative changes we have to make sure we are within 0 .. cols/rows - 1\n // before calculating the new position\n this._restrictCursor();\n this._setCursor(this._activeBuffer.x + x, this._activeBuffer.y + y);\n }\n\n /**\n * CSI Ps A\n * Cursor Up Ps Times (default = 1) (CUU).\n *\n * @vt: #Y CSI CUU \"Cursor Up\" \"CSI Ps A\" \"Move cursor `Ps` times up (default=1).\"\n * If the cursor would pass the top scroll margin, it will stop there.\n */\n public cursorUp(params: IParams): boolean {\n // stop at scrollTop\n const diffToTop = this._activeBuffer.y - this._activeBuffer.scrollTop;\n if (diffToTop >= 0) {\n this._moveCursor(0, -Math.min(diffToTop, params.params[0] || 1));\n } else {\n this._moveCursor(0, -(params.params[0] || 1));\n }\n return true;\n }\n\n /**\n * CSI Ps B\n * Cursor Down Ps Times (default = 1) (CUD).\n *\n * @vt: #Y CSI CUD \"Cursor Down\" \"CSI Ps B\" \"Move cursor `Ps` times down (default=1).\"\n * If the cursor would pass the bottom scroll margin, it will stop there.\n */\n public cursorDown(params: IParams): boolean {\n // stop at scrollBottom\n const diffToBottom = this._activeBuffer.scrollBottom - this._activeBuffer.y;\n if (diffToBottom >= 0) {\n this._moveCursor(0, Math.min(diffToBottom, params.params[0] || 1));\n } else {\n this._moveCursor(0, params.params[0] || 1);\n }\n return true;\n }\n\n /**\n * CSI Ps C\n * Cursor Forward Ps Times (default = 1) (CUF).\n *\n * @vt: #Y CSI CUF \"Cursor Forward\" \"CSI Ps C\" \"Move cursor `Ps` times forward (default=1).\"\n */\n public cursorForward(params: IParams): boolean {\n this._moveCursor(params.params[0] || 1, 0);\n return true;\n }\n\n /**\n * CSI Ps D\n * Cursor Backward Ps Times (default = 1) (CUB).\n *\n * @vt: #Y CSI CUB \"Cursor Backward\" \"CSI Ps D\" \"Move cursor `Ps` times backward (default=1).\"\n */\n public cursorBackward(params: IParams): boolean {\n this._moveCursor(-(params.params[0] || 1), 0);\n return true;\n }\n\n /**\n * CSI Ps E\n * Cursor Next Line Ps Times (default = 1) (CNL).\n * Other than cursorDown (CUD) also set the cursor to first column.\n *\n * @vt: #Y CSI CNL \"Cursor Next Line\" \"CSI Ps E\" \"Move cursor `Ps` times down (default=1) and to the first column.\"\n * Same as CUD, additionally places the cursor at the first column.\n */\n public cursorNextLine(params: IParams): boolean {\n this.cursorDown(params);\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * CSI Ps F\n * Cursor Previous Line Ps Times (default = 1) (CPL).\n * Other than cursorUp (CUU) also set the cursor to first column.\n *\n * @vt: #Y CSI CPL \"Cursor Backward\" \"CSI Ps F\" \"Move cursor `Ps` times up (default=1) and to the first column.\"\n * Same as CUU, additionally places the cursor at the first column.\n */\n public cursorPrecedingLine(params: IParams): boolean {\n this.cursorUp(params);\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * CSI Ps G\n * Cursor Character Absolute [column] (default = [row,1]) (CHA).\n *\n * @vt: #Y CSI CHA \"Cursor Horizontal Absolute\" \"CSI Ps G\" \"Move cursor to `Ps`-th column of the active row (default=1).\"\n */\n public cursorCharAbsolute(params: IParams): boolean {\n this._setCursor((params.params[0] || 1) - 1, this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Ps ; Ps H\n * Cursor Position [row;column] (default = [1,1]) (CUP).\n *\n * @vt: #Y CSI CUP \"Cursor Position\" \"CSI Ps ; Ps H\" \"Set cursor to position [`Ps`, `Ps`] (default = [1, 1]).\"\n * If ORIGIN mode is set, places the cursor to the absolute position within the scroll margins.\n * If ORIGIN mode is not set, places the cursor to the absolute position within the viewport.\n * Note that the coordinates are 1-based, thus the top left position starts at `1 ; 1`.\n */\n public cursorPosition(params: IParams): boolean {\n this._setCursor(\n // col\n (params.length >= 2) ? (params.params[1] || 1) - 1 : 0,\n // row\n (params.params[0] || 1) - 1\n );\n return true;\n }\n\n /**\n * CSI Pm ` Character Position Absolute\n * [column] (default = [row,1]) (HPA).\n * Currently same functionality as CHA.\n *\n * @vt: #Y CSI HPA \"Horizontal Position Absolute\" \"CSI Ps ` \" \"Same as CHA.\"\n */\n public charPosAbsolute(params: IParams): boolean {\n this._setCursor((params.params[0] || 1) - 1, this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Pm a Character Position Relative\n * [columns] (default = [row,col+1]) (HPR)\n *\n * @vt: #Y CSI HPR \"Horizontal Position Relative\" \"CSI Ps a\" \"Same as CUF.\"\n */\n public hPositionRelative(params: IParams): boolean {\n this._moveCursor(params.params[0] || 1, 0);\n return true;\n }\n\n /**\n * CSI Pm d Vertical Position Absolute (VPA)\n * [row] (default = [1,column])\n *\n * @vt: #Y CSI VPA \"Vertical Position Absolute\" \"CSI Ps d\" \"Move cursor to `Ps`-th row (default=1).\"\n */\n public linePosAbsolute(params: IParams): boolean {\n this._setCursor(this._activeBuffer.x, (params.params[0] || 1) - 1);\n return true;\n }\n\n /**\n * CSI Pm e Vertical Position Relative (VPR)\n * [rows] (default = [row+1,column])\n * reuse CSI Ps B ?\n *\n * @vt: #Y CSI VPR \"Vertical Position Relative\" \"CSI Ps e\" \"Move cursor `Ps` times down (default=1).\"\n */\n public vPositionRelative(params: IParams): boolean {\n this._moveCursor(0, params.params[0] || 1);\n return true;\n }\n\n /**\n * CSI Ps ; Ps f\n * Horizontal and Vertical Position [row;column] (default =\n * [1,1]) (HVP).\n * Same as CUP.\n *\n * @vt: #Y CSI HVP \"Horizontal and Vertical Position\" \"CSI Ps ; Ps f\" \"Same as CUP.\"\n */\n public hVPosition(params: IParams): boolean {\n this.cursorPosition(params);\n return true;\n }\n\n /**\n * CSI Ps g Tab Clear (TBC).\n * Ps = 0 -> Clear Current Column (default).\n * Ps = 3 -> Clear All.\n * Potentially:\n * Ps = 2 -> Clear Stops on Line.\n * http://vt100.net/annarbor/aaa-ug/section6.html\n *\n * @vt: #Y CSI TBC \"Tab Clear\" \"CSI Ps g\" \"Clear tab stops at current position (0) or all (3) (default=0).\"\n * Clearing tabstops off the active row (Ps = 2, VT100) is currently not supported.\n */\n public tabClear(params: IParams): boolean {\n const param = params.params[0];\n if (param === 0) {\n delete this._activeBuffer.tabs[this._activeBuffer.x];\n } else if (param === 3) {\n this._activeBuffer.tabs = {};\n }\n return true;\n }\n\n /**\n * CSI Ps I\n * Cursor Forward Tabulation Ps tab stops (default = 1) (CHT).\n *\n * @vt: #Y CSI CHT \"Cursor Horizontal Tabulation\" \"CSI Ps I\" \"Move cursor `Ps` times tabs forward (default=1).\"\n */\n public cursorForwardTab(params: IParams): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n let param = params.params[0] || 1;\n while (param--) {\n this._activeBuffer.x = this._activeBuffer.nextStop();\n }\n return true;\n }\n\n /**\n * CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT).\n *\n * @vt: #Y CSI CBT \"Cursor Backward Tabulation\" \"CSI Ps Z\" \"Move cursor `Ps` tabs backward (default=1).\"\n */\n public cursorBackwardTab(params: IParams): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.x = this._activeBuffer.prevStop();\n }\n return true;\n }\n\n\n /**\n * Helper method to erase cells in a terminal row.\n * The cell gets replaced with the eraseChar of the terminal.\n * @param y row index\n * @param start first cell index to be erased\n * @param end end - 1 is last erased cell\n * @param cleanWrap clear the isWrapped flag\n */\n private _eraseInBufferLine(y: number, start: number, end: number, clearWrap: boolean = false): void {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.replaceCells(\n start,\n end,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n if (clearWrap) {\n line.isWrapped = false;\n }\n }\n\n /**\n * Helper method to reset cells in a terminal row.\n * The cell gets replaced with the eraseChar of the terminal and the isWrapped property is set to false.\n * @param y row index\n */\n private _resetBufferLine(y: number): void {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.fill(this._activeBuffer.getNullCell(this._eraseAttrData()));\n this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + y);\n line.isWrapped = false;\n }\n\n /**\n * CSI Ps J Erase in Display (ED).\n * Ps = 0 -> Erase Below (default).\n * Ps = 1 -> Erase Above.\n * Ps = 2 -> Erase All.\n * Ps = 3 -> Erase Saved Lines (xterm).\n * CSI ? Ps J\n * Erase in Display (DECSED).\n * Ps = 0 -> Selective Erase Below (default).\n * Ps = 1 -> Selective Erase Above.\n * Ps = 2 -> Selective Erase All.\n *\n * @vt: #Y CSI ED \"Erase In Display\" \"CSI Ps J\" \"Erase various parts of the viewport.\"\n * Supported param values:\n *\n * | Ps | Effect |\n * | -- | ------------------------------------------------------------ |\n * | 0 | Erase from the cursor through the end of the viewport. |\n * | 1 | Erase from the beginning of the viewport through the cursor. |\n * | 2 | Erase complete viewport. |\n * | 3 | Erase scrollback. |\n *\n * @vt: #P[Protection attributes are not supported.] CSI DECSED \"Selective Erase In Display\" \"CSI ? Ps J\" \"Currently the same as ED.\"\n */\n public eraseInDisplay(params: IParams): boolean {\n this._restrictCursor(this._bufferService.cols);\n let j;\n switch (params.params[0]) {\n case 0:\n j = this._activeBuffer.y;\n this._dirtyRowService.markDirty(j);\n this._eraseInBufferLine(j++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0);\n for (; j < this._bufferService.rows; j++) {\n this._resetBufferLine(j);\n }\n this._dirtyRowService.markDirty(j);\n break;\n case 1:\n j = this._activeBuffer.y;\n this._dirtyRowService.markDirty(j);\n // Deleted front part of line and everything before. This line will no longer be wrapped.\n this._eraseInBufferLine(j, 0, this._activeBuffer.x + 1, true);\n if (this._activeBuffer.x + 1 >= this._bufferService.cols) {\n // Deleted entire previous line. This next line can no longer be wrapped.\n this._activeBuffer.lines.get(j + 1)!.isWrapped = false;\n }\n while (j--) {\n this._resetBufferLine(j);\n }\n this._dirtyRowService.markDirty(0);\n break;\n case 2:\n j = this._bufferService.rows;\n this._dirtyRowService.markDirty(j - 1);\n while (j--) {\n this._resetBufferLine(j);\n }\n this._dirtyRowService.markDirty(0);\n break;\n case 3:\n // Clear scrollback (everything not in viewport)\n const scrollBackSize = this._activeBuffer.lines.length - this._bufferService.rows;\n if (scrollBackSize > 0) {\n this._activeBuffer.lines.trimStart(scrollBackSize);\n this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - scrollBackSize, 0);\n this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - scrollBackSize, 0);\n // Force a scroll event to refresh viewport\n this._onScroll.fire(0);\n }\n break;\n }\n return true;\n }\n\n /**\n * CSI Ps K Erase in Line (EL).\n * Ps = 0 -> Erase to Right (default).\n * Ps = 1 -> Erase to Left.\n * Ps = 2 -> Erase All.\n * CSI ? Ps K\n * Erase in Line (DECSEL).\n * Ps = 0 -> Selective Erase to Right (default).\n * Ps = 1 -> Selective Erase to Left.\n * Ps = 2 -> Selective Erase All.\n *\n * @vt: #Y CSI EL \"Erase In Line\" \"CSI Ps K\" \"Erase various parts of the active row.\"\n * Supported param values:\n *\n * | Ps | Effect |\n * | -- | -------------------------------------------------------- |\n * | 0 | Erase from the cursor through the end of the row. |\n * | 1 | Erase from the beginning of the line through the cursor. |\n * | 2 | Erase complete line. |\n *\n * @vt: #P[Protection attributes are not supported.] CSI DECSEL \"Selective Erase In Line\" \"CSI ? Ps K\" \"Currently the same as EL.\"\n */\n public eraseInLine(params: IParams): boolean {\n this._restrictCursor(this._bufferService.cols);\n switch (params.params[0]) {\n case 0:\n this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0);\n break;\n case 1:\n this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, false);\n break;\n case 2:\n this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, true);\n break;\n }\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Ps L\n * Insert Ps Line(s) (default = 1) (IL).\n *\n * @vt: #Y CSI IL \"Insert Line\" \"CSI Ps L\" \"Insert `Ps` blank lines at active row (default=1).\"\n * For every inserted line at the scroll top one line at the scroll bottom gets removed.\n * The cursor is set to the first column.\n * IL has no effect if the cursor is outside the scroll margins.\n */\n public insertLines(params: IParams): boolean {\n this._restrictCursor();\n let param = params.params[0] || 1;\n\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n\n const row: number = this._activeBuffer.ybase + this._activeBuffer.y;\n\n const scrollBottomRowsOffset = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom;\n const scrollBottomAbsolute = this._bufferService.rows - 1 + this._activeBuffer.ybase - scrollBottomRowsOffset + 1;\n while (param--) {\n // test: echo -e '\\e[44m\\e[1L\\e[0m'\n // blankLine(true) - xterm/linux behavior\n this._activeBuffer.lines.splice(scrollBottomAbsolute - 1, 1);\n this._activeBuffer.lines.splice(row, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n\n this._dirtyRowService.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom);\n this._activeBuffer.x = 0; // see https://vt100.net/docs/vt220-rm/chapter4.html - vt220 only?\n return true;\n }\n\n /**\n * CSI Ps M\n * Delete Ps Line(s) (default = 1) (DL).\n *\n * @vt: #Y CSI DL \"Delete Line\" \"CSI Ps M\" \"Delete `Ps` lines at active row (default=1).\"\n * For every deleted line at the scroll top one blank line at the scroll bottom gets appended.\n * The cursor is set to the first column.\n * DL has no effect if the cursor is outside the scroll margins.\n */\n public deleteLines(params: IParams): boolean {\n this._restrictCursor();\n let param = params.params[0] || 1;\n\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n\n const row: number = this._activeBuffer.ybase + this._activeBuffer.y;\n\n let j: number;\n j = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom;\n j = this._bufferService.rows - 1 + this._activeBuffer.ybase - j;\n while (param--) {\n // test: echo -e '\\e[44m\\e[1M\\e[0m'\n // blankLine(true) - xterm/linux behavior\n this._activeBuffer.lines.splice(row, 1);\n this._activeBuffer.lines.splice(j, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n\n this._dirtyRowService.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom);\n this._activeBuffer.x = 0; // see https://vt100.net/docs/vt220-rm/chapter4.html - vt220 only?\n return true;\n }\n\n /**\n * CSI Ps @\n * Insert Ps (Blank) Character(s) (default = 1) (ICH).\n *\n * @vt: #Y CSI ICH \"Insert Characters\" \"CSI Ps @\" \"Insert `Ps` (blank) characters (default = 1).\"\n * The ICH sequence inserts `Ps` blank characters. The cursor remains at the beginning of the blank characters.\n * Text between the cursor and right margin moves to the right. Characters moved past the right margin are lost.\n *\n *\n * FIXME: check against xterm - should not work outside of scroll margins (see VT520 manual)\n */\n public insertChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.insertCells(\n this._activeBuffer.x,\n params.params[0] || 1,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps P\n * Delete Ps Character(s) (default = 1) (DCH).\n *\n * @vt: #Y CSI DCH \"Delete Character\" \"CSI Ps P\" \"Delete `Ps` characters (default=1).\"\n * As characters are deleted, the remaining characters between the cursor and right margin move to the left.\n * Character attributes move with the characters. The terminal adds blank characters at the right margin.\n *\n *\n * FIXME: check against xterm - should not work outside of scroll margins (see VT520 manual)\n */\n public deleteChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.deleteCells(\n this._activeBuffer.x,\n params.params[0] || 1,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps S Scroll up Ps lines (default = 1) (SU).\n *\n * @vt: #Y CSI SU \"Scroll Up\" \"CSI Ps S\" \"Scroll `Ps` lines up (default=1).\"\n *\n *\n * FIXME: scrolled out lines at top = 1 should add to scrollback (xterm)\n */\n public scrollUp(params: IParams): boolean {\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 1);\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps T Scroll down Ps lines (default = 1) (SD).\n *\n * @vt: #Y CSI SD \"Scroll Down\" \"CSI Ps T\" \"Scroll `Ps` lines down (default=1).\"\n */\n public scrollDown(params: IParams): boolean {\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 1);\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 0, this._activeBuffer.getBlankLine(DEFAULT_ATTR_DATA));\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps SP @ Scroll left Ps columns (default = 1) (SL) ECMA-48\n *\n * Notation: (Pn)\n * Representation: CSI Pn 02/00 04/00\n * Parameter default value: Pn = 1\n * SL causes the data in the presentation component to be moved by n character positions\n * if the line orientation is horizontal, or by n line positions if the line orientation\n * is vertical, such that the data appear to move to the left; where n equals the value of Pn.\n * The active presentation position is not affected by this control function.\n *\n * Supported:\n * - always left shift (no line orientation setting respected)\n *\n * @vt: #Y CSI SL \"Scroll Left\" \"CSI Ps SP @\" \"Scroll viewport `Ps` times to the left.\"\n * SL moves the content of all lines within the scroll margins `Ps` times to the left.\n * SL has no effect outside of the scroll margins.\n */\n public scrollLeft(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.deleteCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps SP A Scroll right Ps columns (default = 1) (SR) ECMA-48\n *\n * Notation: (Pn)\n * Representation: CSI Pn 02/00 04/01\n * Parameter default value: Pn = 1\n * SR causes the data in the presentation component to be moved by n character positions\n * if the line orientation is horizontal, or by n line positions if the line orientation\n * is vertical, such that the data appear to move to the right; where n equals the value of Pn.\n * The active presentation position is not affected by this control function.\n *\n * Supported:\n * - always right shift (no line orientation setting respected)\n *\n * @vt: #Y CSI SR \"Scroll Right\" \"CSI Ps SP A\" \"Scroll viewport `Ps` times to the right.\"\n * SL moves the content of all lines within the scroll margins `Ps` times to the right.\n * Content at the right margin is lost.\n * SL has no effect outside of the scroll margins.\n */\n public scrollRight(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.insertCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Pm ' }\n * Insert Ps Column(s) (default = 1) (DECIC), VT420 and up.\n *\n * @vt: #Y CSI DECIC \"Insert Columns\" \"CSI Ps ' }\" \"Insert `Ps` columns at cursor position.\"\n * DECIC inserts `Ps` times blank columns at the cursor position for all lines with the scroll margins,\n * moving content to the right. Content at the right margin is lost.\n * DECIC has no effect outside the scrolling margins.\n */\n public insertColumns(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.insertCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Pm ' ~\n * Delete Ps Column(s) (default = 1) (DECDC), VT420 and up.\n *\n * @vt: #Y CSI DECDC \"Delete Columns\" \"CSI Ps ' ~\" \"Delete `Ps` columns at cursor position.\"\n * DECDC deletes `Ps` times columns at the cursor position for all lines with the scroll margins,\n * moving content to the left. Blank columns are added at the right margin.\n * DECDC has no effect outside the scrolling margins.\n */\n public deleteColumns(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.deleteCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps X\n * Erase Ps Character(s) (default = 1) (ECH).\n *\n * @vt: #Y CSI ECH \"Erase Character\" \"CSI Ps X\" \"Erase `Ps` characters from current cursor position to the right (default=1).\"\n * ED erases `Ps` characters from current cursor position to the right.\n * ED works inside or outside the scrolling margins.\n */\n public eraseChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.replaceCells(\n this._activeBuffer.x,\n this._activeBuffer.x + (params.params[0] || 1),\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowService.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps b Repeat the preceding graphic character Ps times (REP).\n * From ECMA 48 (@see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf)\n * Notation: (Pn)\n * Representation: CSI Pn 06/02\n * Parameter default value: Pn = 1\n * REP is used to indicate that the preceding character in the data stream,\n * if it is a graphic character (represented by one or more bit combinations) including SPACE,\n * is to be repeated n times, where n equals the value of Pn.\n * If the character preceding REP is a control function or part of a control function,\n * the effect of REP is not defined by this Standard.\n *\n * Since we propagate the terminal as xterm-256color we have to follow xterm's behavior:\n * - fullwidth + surrogate chars are ignored\n * - for combining chars only the base char gets repeated\n * - text attrs are applied normally\n * - wrap around is respected\n * - any valid sequence resets the carried forward char\n *\n * Note: To get reset on a valid sequence working correctly without much runtime penalty,\n * the preceding codepoint is stored on the parser in `this.print` and reset during `parser.parse`.\n *\n * @vt: #Y CSI REP \"Repeat Preceding Character\" \"CSI Ps b\" \"Repeat preceding character `Ps` times (default=1).\"\n * REP repeats the previous character `Ps` times advancing the cursor, also wrapping if DECAWM is set.\n * REP has no effect if the sequence does not follow a printable ASCII character\n * (NOOP for any other sequence in between or NON ASCII characters).\n */\n public repeatPrecedingCharacter(params: IParams): boolean {\n if (!this._parser.precedingCodepoint) {\n return true;\n }\n // call print to insert the chars and handle correct wrapping\n const length = params.params[0] || 1;\n const data = new Uint32Array(length);\n for (let i = 0; i < length; ++i) {\n data[i] = this._parser.precedingCodepoint;\n }\n this.print(data, 0, data.length);\n return true;\n }\n\n /**\n * CSI Ps c Send Device Attributes (Primary DA).\n * Ps = 0 or omitted -> request attributes from terminal. The\n * response depends on the decTerminalID resource setting.\n * -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'')\n * -> CSI ? 1 ; 0 c (``VT101 with No Options'')\n * -> CSI ? 6 c (``VT102'')\n * -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'')\n * The VT100-style response parameters do not mean anything by\n * themselves. VT220 parameters do, telling the host what fea-\n * tures the terminal supports:\n * Ps = 1 -> 132-columns.\n * Ps = 2 -> Printer.\n * Ps = 6 -> Selective erase.\n * Ps = 8 -> User-defined keys.\n * Ps = 9 -> National replacement character sets.\n * Ps = 1 5 -> Technical characters.\n * Ps = 2 2 -> ANSI color, e.g., VT525.\n * Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode).\n *\n * @vt: #Y CSI DA1 \"Primary Device Attributes\" \"CSI c\" \"Send primary device attributes.\"\n *\n *\n * TODO: fix and cleanup response\n */\n public sendDeviceAttributesPrimary(params: IParams): boolean {\n if (params.params[0] > 0) {\n return true;\n }\n if (this._is('xterm') || this._is('rxvt-unicode') || this._is('screen')) {\n this._coreService.triggerDataEvent(C0.ESC + '[?1;2c');\n } else if (this._is('linux')) {\n this._coreService.triggerDataEvent(C0.ESC + '[?6c');\n }\n return true;\n }\n\n /**\n * CSI > Ps c\n * Send Device Attributes (Secondary DA).\n * Ps = 0 or omitted -> request the terminal's identification\n * code. The response depends on the decTerminalID resource set-\n * ting. It should apply only to VT220 and up, but xterm extends\n * this to VT100.\n * -> CSI > Pp ; Pv ; Pc c\n * where Pp denotes the terminal type\n * Pp = 0 -> ``VT100''.\n * Pp = 1 -> ``VT220''.\n * and Pv is the firmware version (for xterm, this was originally\n * the XFree86 patch number, starting with 95). In a DEC termi-\n * nal, Pc indicates the ROM cartridge registration number and is\n * always zero.\n * More information:\n * xterm/charproc.c - line 2012, for more information.\n * vim responds with ^[[?0c or ^[[?1c after the terminal's response (?)\n *\n * @vt: #Y CSI DA2 \"Secondary Device Attributes\" \"CSI > c\" \"Send primary device attributes.\"\n *\n *\n * TODO: fix and cleanup response\n */\n public sendDeviceAttributesSecondary(params: IParams): boolean {\n if (params.params[0] > 0) {\n return true;\n }\n // xterm and urxvt\n // seem to spit this\n // out around ~370 times (?).\n if (this._is('xterm')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>0;276;0c');\n } else if (this._is('rxvt-unicode')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>85;95;0c');\n } else if (this._is('linux')) {\n // not supported by linux console.\n // linux console echoes parameters.\n this._coreService.triggerDataEvent(params.params[0] + 'c');\n } else if (this._is('screen')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>83;40003;0c');\n }\n return true;\n }\n\n /**\n * Evaluate if the current terminal is the given argument.\n * @param term The terminal name to evaluate\n */\n private _is(term: string): boolean {\n return (this._optionsService.rawOptions.termName + '').indexOf(term) === 0;\n }\n\n /**\n * CSI Pm h Set Mode (SM).\n * Ps = 2 -> Keyboard Action Mode (AM).\n * Ps = 4 -> Insert Mode (IRM).\n * Ps = 1 2 -> Send/receive (SRM).\n * Ps = 2 0 -> Automatic Newline (LNM).\n *\n * @vt: #P[Only IRM is supported.] CSI SM \"Set Mode\" \"CSI Pm h\" \"Set various terminal modes.\"\n * Supported param values by SM:\n *\n * | Param | Action | Support |\n * | ----- | -------------------------------------- | ------- |\n * | 2 | Keyboard Action Mode (KAM). Always on. | #N |\n * | 4 | Insert Mode (IRM). | #Y |\n * | 12 | Send/receive (SRM). Always off. | #N |\n * | 20 | Automatic Newline (LNM). Always off. | #N |\n */\n public setMode(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 4:\n this._coreService.modes.insertMode = true;\n break;\n case 20:\n // this._t.convertEol = true;\n break;\n }\n }\n return true;\n }\n\n /**\n * CSI ? Pm h\n * DEC Private Mode Set (DECSET).\n * Ps = 1 -> Application Cursor Keys (DECCKM).\n * Ps = 2 -> Designate USASCII for character sets G0-G3\n * (DECANM), and set VT100 mode.\n * Ps = 3 -> 132 Column Mode (DECCOLM).\n * Ps = 4 -> Smooth (Slow) Scroll (DECSCLM).\n * Ps = 5 -> Reverse Video (DECSCNM).\n * Ps = 6 -> Origin Mode (DECOM).\n * Ps = 7 -> Wraparound Mode (DECAWM).\n * Ps = 8 -> Auto-repeat Keys (DECARM).\n * Ps = 9 -> Send Mouse X & Y on button press. See the sec-\n * tion Mouse Tracking.\n * Ps = 1 0 -> Show toolbar (rxvt).\n * Ps = 1 2 -> Start Blinking Cursor (att610).\n * Ps = 1 8 -> Print form feed (DECPFF).\n * Ps = 1 9 -> Set print extent to full screen (DECPEX).\n * Ps = 2 5 -> Show Cursor (DECTCEM).\n * Ps = 3 0 -> Show scrollbar (rxvt).\n * Ps = 3 5 -> Enable font-shifting functions (rxvt).\n * Ps = 3 8 -> Enter Tektronix Mode (DECTEK).\n * Ps = 4 0 -> Allow 80 -> 132 Mode.\n * Ps = 4 1 -> more(1) fix (see curses resource).\n * Ps = 4 2 -> Enable Nation Replacement Character sets (DECN-\n * RCM).\n * Ps = 4 4 -> Turn On Margin Bell.\n * Ps = 4 5 -> Reverse-wraparound Mode.\n * Ps = 4 6 -> Start Logging. This is normally disabled by a\n * compile-time option.\n * Ps = 4 7 -> Use Alternate Screen Buffer. (This may be dis-\n * abled by the titeInhibit resource).\n * Ps = 6 6 -> Application keypad (DECNKM).\n * Ps = 6 7 -> Backarrow key sends backspace (DECBKM).\n * Ps = 1 0 0 0 -> Send Mouse X & Y on button press and\n * release. See the section Mouse Tracking.\n * Ps = 1 0 0 1 -> Use Hilite Mouse Tracking.\n * Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking.\n * Ps = 1 0 0 3 -> Use All Motion Mouse Tracking.\n * Ps = 1 0 0 4 -> Send FocusIn/FocusOut events.\n * Ps = 1 0 0 5 -> Enable Extended Mouse Mode.\n * Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt).\n * Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt).\n * Ps = 1 0 3 4 -> Interpret \"meta\" key, sets eighth bit.\n * (enables the eightBitInput resource).\n * Ps = 1 0 3 5 -> Enable special modifiers for Alt and Num-\n * Lock keys. (This enables the numLock resource).\n * Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This\n * enables the metaSendsEscape resource).\n * Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete\n * key.\n * Ps = 1 0 3 9 -> Send ESC when Alt modifies a key. (This\n * enables the altSendsEscape resource).\n * Ps = 1 0 4 0 -> Keep selection even if not highlighted.\n * (This enables the keepSelection resource).\n * Ps = 1 0 4 1 -> Use the CLIPBOARD selection. (This enables\n * the selectToClipboard resource).\n * Ps = 1 0 4 2 -> Enable Urgency window manager hint when\n * Control-G is received. (This enables the bellIsUrgent\n * resource).\n * Ps = 1 0 4 3 -> Enable raising of the window when Control-G\n * is received. (enables the popOnBell resource).\n * Ps = 1 0 4 7 -> Use Alternate Screen Buffer. (This may be\n * disabled by the titeInhibit resource).\n * Ps = 1 0 4 8 -> Save cursor as in DECSC. (This may be dis-\n * abled by the titeInhibit resource).\n * Ps = 1 0 4 9 -> Save cursor as in DECSC and use Alternate\n * Screen Buffer, clearing it first. (This may be disabled by\n * the titeInhibit resource). This combines the effects of the 1\n * 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based\n * applications rather than the 4 7 mode.\n * Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode.\n * Ps = 1 0 5 1 -> Set Sun function-key mode.\n * Ps = 1 0 5 2 -> Set HP function-key mode.\n * Ps = 1 0 5 3 -> Set SCO function-key mode.\n * Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6).\n * Ps = 1 0 6 1 -> Set VT220 keyboard emulation.\n * Ps = 2 0 0 4 -> Set bracketed paste mode.\n * Modes:\n * http: *vt100.net/docs/vt220-rm/chapter4.html\n *\n * @vt: #P[See below for supported modes.] CSI DECSET \"DEC Private Set Mode\" \"CSI ? Pm h\" \"Set various terminal attributes.\"\n * Supported param values by DECSET:\n *\n * | param | Action | Support |\n * | ----- | ------------------------------------------------------- | --------|\n * | 1 | Application Cursor Keys (DECCKM). | #Y |\n * | 2 | Designate US-ASCII for character sets G0-G3 (DECANM). | #Y |\n * | 3 | 132 Column Mode (DECCOLM). | #Y |\n * | 6 | Origin Mode (DECOM). | #Y |\n * | 7 | Auto-wrap Mode (DECAWM). | #Y |\n * | 8 | Auto-repeat Keys (DECARM). Always on. | #N |\n * | 9 | X10 xterm mouse protocol. | #Y |\n * | 12 | Start Blinking Cursor. | #Y |\n * | 25 | Show Cursor (DECTCEM). | #Y |\n * | 45 | Reverse wrap-around. | #Y |\n * | 47 | Use Alternate Screen Buffer. | #Y |\n * | 66 | Application keypad (DECNKM). | #Y |\n * | 1000 | X11 xterm mouse protocol. | #Y |\n * | 1002 | Use Cell Motion Mouse Tracking. | #Y |\n * | 1003 | Use All Motion Mouse Tracking. | #Y |\n * | 1004 | Send FocusIn/FocusOut events | #Y |\n * | 1005 | Enable UTF-8 Mouse Mode. | #N |\n * | 1006 | Enable SGR Mouse Mode. | #Y |\n * | 1015 | Enable urxvt Mouse Mode. | #N |\n * | 1047 | Use Alternate Screen Buffer. | #Y |\n * | 1048 | Save cursor as in DECSC. | #Y |\n * | 1049 | Save cursor and switch to alternate buffer clearing it. | #P[Does not clear the alternate buffer.] |\n * | 2004 | Set bracketed paste mode. | #Y |\n *\n *\n * FIXME: implement DECSCNM, 1049 should clear altbuffer\n */\n public setModePrivate(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 1:\n this._coreService.decPrivateModes.applicationCursorKeys = true;\n break;\n case 2:\n this._charsetService.setgCharset(0, DEFAULT_CHARSET);\n this._charsetService.setgCharset(1, DEFAULT_CHARSET);\n this._charsetService.setgCharset(2, DEFAULT_CHARSET);\n this._charsetService.setgCharset(3, DEFAULT_CHARSET);\n // set VT100 mode here\n break;\n case 3:\n /**\n * DECCOLM - 132 column mode.\n * This is only active if 'SetWinLines' (24) is enabled\n * through `options.windowsOptions`.\n */\n if (this._optionsService.rawOptions.windowOptions.setWinLines) {\n this._bufferService.resize(132, this._bufferService.rows);\n this._onRequestReset.fire();\n }\n break;\n case 6:\n this._coreService.decPrivateModes.origin = true;\n this._setCursor(0, 0);\n break;\n case 7:\n this._coreService.decPrivateModes.wraparound = true;\n break;\n case 12:\n // this.cursorBlink = true;\n break;\n case 45:\n this._coreService.decPrivateModes.reverseWraparound = true;\n break;\n case 66:\n this._logService.debug('Serial port requested application keypad.');\n this._coreService.decPrivateModes.applicationKeypad = true;\n this._onRequestSyncScrollBar.fire();\n break;\n case 9: // X10 Mouse\n // no release, no motion, no wheel, no modifiers.\n this._coreMouseService.activeProtocol = 'X10';\n break;\n case 1000: // vt200 mouse\n // no motion.\n this._coreMouseService.activeProtocol = 'VT200';\n break;\n case 1002: // button event mouse\n this._coreMouseService.activeProtocol = 'DRAG';\n break;\n case 1003: // any event mouse\n // any event - sends motion events,\n // even if there is no button held down.\n this._coreMouseService.activeProtocol = 'ANY';\n break;\n case 1004: // send focusin/focusout events\n // focusin: ^[[I\n // focusout: ^[[O\n this._coreService.decPrivateModes.sendFocus = true;\n this._onRequestSendFocus.fire();\n break;\n case 1005: // utf8 ext mode mouse - removed in #2507\n this._logService.debug('DECSET 1005 not supported (see #2507)');\n break;\n case 1006: // sgr ext mode mouse\n this._coreMouseService.activeEncoding = 'SGR';\n break;\n case 1015: // urxvt ext mode mouse - removed in #2507\n this._logService.debug('DECSET 1015 not supported (see #2507)');\n break;\n case 25: // show cursor\n this._coreService.isCursorHidden = false;\n break;\n case 1048: // alt screen cursor\n this.saveCursor();\n break;\n case 1049: // alt screen buffer cursor\n this.saveCursor();\n // FALL-THROUGH\n case 47: // alt screen buffer\n case 1047: // alt screen buffer\n this._bufferService.buffers.activateAltBuffer(this._eraseAttrData());\n this._coreService.isCursorInitialized = true;\n this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1);\n this._onRequestSyncScrollBar.fire();\n break;\n case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)\n this._coreService.decPrivateModes.bracketedPasteMode = true;\n break;\n }\n }\n return true;\n }\n\n\n /**\n * CSI Pm l Reset Mode (RM).\n * Ps = 2 -> Keyboard Action Mode (AM).\n * Ps = 4 -> Replace Mode (IRM).\n * Ps = 1 2 -> Send/receive (SRM).\n * Ps = 2 0 -> Normal Linefeed (LNM).\n *\n * @vt: #P[Only IRM is supported.] CSI RM \"Reset Mode\" \"CSI Pm l\" \"Set various terminal attributes.\"\n * Supported param values by RM:\n *\n * | Param | Action | Support |\n * | ----- | -------------------------------------- | ------- |\n * | 2 | Keyboard Action Mode (KAM). Always on. | #N |\n * | 4 | Replace Mode (IRM). (default) | #Y |\n * | 12 | Send/receive (SRM). Always off. | #N |\n * | 20 | Normal Linefeed (LNM). Always off. | #N |\n *\n *\n * FIXME: why is LNM commented out?\n */\n public resetMode(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 4:\n this._coreService.modes.insertMode = false;\n break;\n case 20:\n // this._t.convertEol = false;\n break;\n }\n }\n return true;\n }\n\n /**\n * CSI ? Pm l\n * DEC Private Mode Reset (DECRST).\n * Ps = 1 -> Normal Cursor Keys (DECCKM).\n * Ps = 2 -> Designate VT52 mode (DECANM).\n * Ps = 3 -> 80 Column Mode (DECCOLM).\n * Ps = 4 -> Jump (Fast) Scroll (DECSCLM).\n * Ps = 5 -> Normal Video (DECSCNM).\n * Ps = 6 -> Normal Cursor Mode (DECOM).\n * Ps = 7 -> No Wraparound Mode (DECAWM).\n * Ps = 8 -> No Auto-repeat Keys (DECARM).\n * Ps = 9 -> Don't send Mouse X & Y on button press.\n * Ps = 1 0 -> Hide toolbar (rxvt).\n * Ps = 1 2 -> Stop Blinking Cursor (att610).\n * Ps = 1 8 -> Don't print form feed (DECPFF).\n * Ps = 1 9 -> Limit print to scrolling region (DECPEX).\n * Ps = 2 5 -> Hide Cursor (DECTCEM).\n * Ps = 3 0 -> Don't show scrollbar (rxvt).\n * Ps = 3 5 -> Disable font-shifting functions (rxvt).\n * Ps = 4 0 -> Disallow 80 -> 132 Mode.\n * Ps = 4 1 -> No more(1) fix (see curses resource).\n * Ps = 4 2 -> Disable Nation Replacement Character sets (DEC-\n * NRCM).\n * Ps = 4 4 -> Turn Off Margin Bell.\n * Ps = 4 5 -> No Reverse-wraparound Mode.\n * Ps = 4 6 -> Stop Logging. (This is normally disabled by a\n * compile-time option).\n * Ps = 4 7 -> Use Normal Screen Buffer.\n * Ps = 6 6 -> Numeric keypad (DECNKM).\n * Ps = 6 7 -> Backarrow key sends delete (DECBKM).\n * Ps = 1 0 0 0 -> Don't send Mouse X & Y on button press and\n * release. See the section Mouse Tracking.\n * Ps = 1 0 0 1 -> Don't use Hilite Mouse Tracking.\n * Ps = 1 0 0 2 -> Don't use Cell Motion Mouse Tracking.\n * Ps = 1 0 0 3 -> Don't use All Motion Mouse Tracking.\n * Ps = 1 0 0 4 -> Don't send FocusIn/FocusOut events.\n * Ps = 1 0 0 5 -> Disable Extended Mouse Mode.\n * Ps = 1 0 1 0 -> Don't scroll to bottom on tty output\n * (rxvt).\n * Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt).\n * Ps = 1 0 3 4 -> Don't interpret \"meta\" key. (This disables\n * the eightBitInput resource).\n * Ps = 1 0 3 5 -> Disable special modifiers for Alt and Num-\n * Lock keys. (This disables the numLock resource).\n * Ps = 1 0 3 6 -> Don't send ESC when Meta modifies a key.\n * (This disables the metaSendsEscape resource).\n * Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad\n * Delete key.\n * Ps = 1 0 3 9 -> Don't send ESC when Alt modifies a key.\n * (This disables the altSendsEscape resource).\n * Ps = 1 0 4 0 -> Do not keep selection when not highlighted.\n * (This disables the keepSelection resource).\n * Ps = 1 0 4 1 -> Use the PRIMARY selection. (This disables\n * the selectToClipboard resource).\n * Ps = 1 0 4 2 -> Disable Urgency window manager hint when\n * Control-G is received. (This disables the bellIsUrgent\n * resource).\n * Ps = 1 0 4 3 -> Disable raising of the window when Control-\n * G is received. (This disables the popOnBell resource).\n * Ps = 1 0 4 7 -> Use Normal Screen Buffer, clearing screen\n * first if in the Alternate Screen. (This may be disabled by\n * the titeInhibit resource).\n * Ps = 1 0 4 8 -> Restore cursor as in DECRC. (This may be\n * disabled by the titeInhibit resource).\n * Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor\n * as in DECRC. (This may be disabled by the titeInhibit\n * resource). This combines the effects of the 1 0 4 7 and 1 0\n * 4 8 modes. Use this with terminfo-based applications rather\n * than the 4 7 mode.\n * Ps = 1 0 5 0 -> Reset terminfo/termcap function-key mode.\n * Ps = 1 0 5 1 -> Reset Sun function-key mode.\n * Ps = 1 0 5 2 -> Reset HP function-key mode.\n * Ps = 1 0 5 3 -> Reset SCO function-key mode.\n * Ps = 1 0 6 0 -> Reset legacy keyboard emulation (X11R6).\n * Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style.\n * Ps = 2 0 0 4 -> Reset bracketed paste mode.\n *\n * @vt: #P[See below for supported modes.] CSI DECRST \"DEC Private Reset Mode\" \"CSI ? Pm l\" \"Reset various terminal attributes.\"\n * Supported param values by DECRST:\n *\n * | param | Action | Support |\n * | ----- | ------------------------------------------------------- | ------- |\n * | 1 | Normal Cursor Keys (DECCKM). | #Y |\n * | 2 | Designate VT52 mode (DECANM). | #N |\n * | 3 | 80 Column Mode (DECCOLM). | #B[Switches to old column width instead of 80.] |\n * | 6 | Normal Cursor Mode (DECOM). | #Y |\n * | 7 | No Wraparound Mode (DECAWM). | #Y |\n * | 8 | No Auto-repeat Keys (DECARM). | #N |\n * | 9 | Don't send Mouse X & Y on button press. | #Y |\n * | 12 | Stop Blinking Cursor. | #Y |\n * | 25 | Hide Cursor (DECTCEM). | #Y |\n * | 45 | No reverse wrap-around. | #Y |\n * | 47 | Use Normal Screen Buffer. | #Y |\n * | 66 | Numeric keypad (DECNKM). | #Y |\n * | 1000 | Don't send Mouse reports. | #Y |\n * | 1002 | Don't use Cell Motion Mouse Tracking. | #Y |\n * | 1003 | Don't use All Motion Mouse Tracking. | #Y |\n * | 1004 | Don't send FocusIn/FocusOut events. | #Y |\n * | 1005 | Disable UTF-8 Mouse Mode. | #N |\n * | 1006 | Disable SGR Mouse Mode. | #Y |\n * | 1015 | Disable urxvt Mouse Mode. | #N |\n * | 1047 | Use Normal Screen Buffer (clearing screen if in alt). | #Y |\n * | 1048 | Restore cursor as in DECRC. | #Y |\n * | 1049 | Use Normal Screen Buffer and restore cursor. | #Y |\n * | 2004 | Reset bracketed paste mode. | #Y |\n *\n *\n * FIXME: DECCOLM is currently broken (already fixed in window options PR)\n */\n public resetModePrivate(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 1:\n this._coreService.decPrivateModes.applicationCursorKeys = false;\n break;\n case 3:\n /**\n * DECCOLM - 80 column mode.\n * This is only active if 'SetWinLines' (24) is enabled\n * through `options.windowsOptions`.\n */\n if (this._optionsService.rawOptions.windowOptions.setWinLines) {\n this._bufferService.resize(80, this._bufferService.rows);\n this._onRequestReset.fire();\n }\n break;\n case 6:\n this._coreService.decPrivateModes.origin = false;\n this._setCursor(0, 0);\n break;\n case 7:\n this._coreService.decPrivateModes.wraparound = false;\n break;\n case 12:\n // this.cursorBlink = false;\n break;\n case 45:\n this._coreService.decPrivateModes.reverseWraparound = false;\n break;\n case 66:\n this._logService.debug('Switching back to normal keypad.');\n this._coreService.decPrivateModes.applicationKeypad = false;\n this._onRequestSyncScrollBar.fire();\n break;\n case 9: // X10 Mouse\n case 1000: // vt200 mouse\n case 1002: // button event mouse\n case 1003: // any event mouse\n this._coreMouseService.activeProtocol = 'NONE';\n break;\n case 1004: // send focusin/focusout events\n this._coreService.decPrivateModes.sendFocus = false;\n break;\n case 1005: // utf8 ext mode mouse - removed in #2507\n this._logService.debug('DECRST 1005 not supported (see #2507)');\n break;\n case 1006: // sgr ext mode mouse\n this._coreMouseService.activeEncoding = 'DEFAULT';\n break;\n case 1015: // urxvt ext mode mouse - removed in #2507\n this._logService.debug('DECRST 1015 not supported (see #2507)');\n break;\n case 25: // hide cursor\n this._coreService.isCursorHidden = true;\n break;\n case 1048: // alt screen cursor\n this.restoreCursor();\n break;\n case 1049: // alt screen buffer cursor\n // FALL-THROUGH\n case 47: // normal screen buffer\n case 1047: // normal screen buffer - clearing it first\n // Ensure the selection manager has the correct buffer\n this._bufferService.buffers.activateNormalBuffer();\n if (params.params[i] === 1049) {\n this.restoreCursor();\n }\n this._coreService.isCursorInitialized = true;\n this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1);\n this._onRequestSyncScrollBar.fire();\n break;\n case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)\n this._coreService.decPrivateModes.bracketedPasteMode = false;\n break;\n }\n }\n return true;\n }\n\n /**\n * Helper to write color information packed with color mode.\n */\n private _updateAttrColor(color: number, mode: number, c1: number, c2: number, c3: number): number {\n if (mode === 2) {\n color |= Attributes.CM_RGB;\n color &= ~Attributes.RGB_MASK;\n color |= AttributeData.fromColorRGB([c1, c2, c3]);\n } else if (mode === 5) {\n color &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n color |= Attributes.CM_P256 | (c1 & 0xff);\n }\n return color;\n }\n\n /**\n * Helper to extract and apply color params/subparams.\n * Returns advance for params index.\n */\n private _extractColor(params: IParams, pos: number, attr: IAttributeData): number {\n // normalize params\n // meaning: [target, CM, ign, val, val, val]\n // RGB : [ 38/48, 2, ign, r, g, b]\n // P256 : [ 38/48, 5, ign, v, ign, ign]\n const accu = [0, 0, -1, 0, 0, 0];\n\n // alignment placeholder for non color space sequences\n let cSpace = 0;\n\n // return advance we took in params\n let advance = 0;\n\n do {\n accu[advance + cSpace] = params.params[pos + advance];\n if (params.hasSubParams(pos + advance)) {\n const subparams = params.getSubParams(pos + advance)!;\n let i = 0;\n do {\n if (accu[1] === 5) {\n cSpace = 1;\n }\n accu[advance + i + 1 + cSpace] = subparams[i];\n } while (++i < subparams.length && i + advance + 1 + cSpace < accu.length);\n break;\n }\n // exit early if can decide color mode with semicolons\n if ((accu[1] === 5 && advance + cSpace >= 2)\n || (accu[1] === 2 && advance + cSpace >= 5)) {\n break;\n }\n // offset colorSpace slot for semicolon mode\n if (accu[1]) {\n cSpace = 1;\n }\n } while (++advance + pos < params.length && advance + cSpace < accu.length);\n\n // set default values to 0\n for (let i = 2; i < accu.length; ++i) {\n if (accu[i] === -1) {\n accu[i] = 0;\n }\n }\n\n // apply colors\n switch (accu[0]) {\n case 38:\n attr.fg = this._updateAttrColor(attr.fg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 48:\n attr.bg = this._updateAttrColor(attr.bg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 58:\n attr.extended = attr.extended.clone();\n attr.extended.underlineColor = this._updateAttrColor(attr.extended.underlineColor, accu[1], accu[3], accu[4], accu[5]);\n }\n\n return advance;\n }\n\n /**\n * SGR 4 subparams:\n * 4:0 - equal to SGR 24 (turn off all underline)\n * 4:1 - equal to SGR 4 (single underline)\n * 4:2 - equal to SGR 21 (double underline)\n * 4:3 - curly underline\n * 4:4 - dotted underline\n * 4:5 - dashed underline\n */\n private _processUnderline(style: number, attr: IAttributeData): void {\n // treat extended attrs as immutable, thus always clone from old one\n // this is needed since the buffer only holds references to it\n attr.extended = attr.extended.clone();\n\n // default to 1 == single underline\n if (!~style || style > 5) {\n style = 1;\n }\n attr.extended.underlineStyle = style;\n attr.fg |= FgFlags.UNDERLINE;\n\n // 0 deactivates underline\n if (style === 0) {\n attr.fg &= ~FgFlags.UNDERLINE;\n }\n\n // update HAS_EXTENDED in BG\n attr.updateExtended();\n }\n\n /**\n * CSI Pm m Character Attributes (SGR).\n *\n * @vt: #P[See below for supported attributes.] CSI SGR \"Select Graphic Rendition\" \"CSI Pm m\" \"Set/Reset various text attributes.\"\n * SGR selects one or more character attributes at the same time. Multiple params (up to 32)\n * are applied in order from left to right. The changed attributes are applied to all new\n * characters received. If you move characters in the viewport by scrolling or any other means,\n * then the attributes move with the characters.\n *\n * Supported param values by SGR:\n *\n * | Param | Meaning | Support |\n * | --------- | -------------------------------------------------------- | ------- |\n * | 0 | Normal (default). Resets any other preceding SGR. | #Y |\n * | 1 | Bold. (also see `options.drawBoldTextInBrightColors`) | #Y |\n * | 2 | Faint, decreased intensity. | #Y |\n * | 3 | Italic. | #Y |\n * | 4 | Underlined (see below for style support). | #Y |\n * | 5 | Slowly blinking. | #N |\n * | 6 | Rapidly blinking. | #N |\n * | 7 | Inverse. Flips foreground and background color. | #Y |\n * | 8 | Invisible (hidden). | #Y |\n * | 9 | Crossed-out characters (strikethrough). | #Y |\n * | 21 | Doubly underlined. | #P[Currently outputs a single underline.] |\n * | 22 | Normal (neither bold nor faint). | #Y |\n * | 23 | No italic. | #Y |\n * | 24 | Not underlined. | #Y |\n * | 25 | Steady (not blinking). | #Y |\n * | 27 | Positive (not inverse). | #Y |\n * | 28 | Visible (not hidden). | #Y |\n * | 29 | Not Crossed-out (strikethrough). | #Y |\n * | 30 | Foreground color: Black. | #Y |\n * | 31 | Foreground color: Red. | #Y |\n * | 32 | Foreground color: Green. | #Y |\n * | 33 | Foreground color: Yellow. | #Y |\n * | 34 | Foreground color: Blue. | #Y |\n * | 35 | Foreground color: Magenta. | #Y |\n * | 36 | Foreground color: Cyan. | #Y |\n * | 37 | Foreground color: White. | #Y |\n * | 38 | Foreground color: Extended color. | #P[Support for RGB and indexed colors, see below.] |\n * | 39 | Foreground color: Default (original). | #Y |\n * | 40 | Background color: Black. | #Y |\n * | 41 | Background color: Red. | #Y |\n * | 42 | Background color: Green. | #Y |\n * | 43 | Background color: Yellow. | #Y |\n * | 44 | Background color: Blue. | #Y |\n * | 45 | Background color: Magenta. | #Y |\n * | 46 | Background color: Cyan. | #Y |\n * | 47 | Background color: White. | #Y |\n * | 48 | Background color: Extended color. | #P[Support for RGB and indexed colors, see below.] |\n * | 49 | Background color: Default (original). | #Y |\n * | 90 - 97 | Bright foreground color (analogous to 30 - 37). | #Y |\n * | 100 - 107 | Bright background color (analogous to 40 - 47). | #Y |\n *\n * Underline supports subparams to denote the style in the form `4 : x`:\n *\n * | x | Meaning | Support |\n * | ------ | ------------------------------------------------------------- | ------- |\n * | 0 | No underline. Same as `SGR 24 m`. | #Y |\n * | 1 | Single underline. Same as `SGR 4 m`. | #Y |\n * | 2 | Double underline. | #P[Currently outputs a single underline.] |\n * | 3 | Curly underline. | #P[Currently outputs a single underline.] |\n * | 4 | Dotted underline. | #P[Currently outputs a single underline.] |\n * | 5 | Dashed underline. | #P[Currently outputs a single underline.] |\n * | other | Single underline. Same as `SGR 4 m`. | #Y |\n *\n * Extended colors are supported for foreground (Ps=38) and background (Ps=48) as follows:\n *\n * | Ps + 1 | Meaning | Support |\n * | ------ | ------------------------------------------------------------- | ------- |\n * | 0 | Implementation defined. | #N |\n * | 1 | Transparent. | #N |\n * | 2 | RGB color as `Ps ; 2 ; R ; G ; B` or `Ps : 2 : : R : G : B`. | #Y |\n * | 3 | CMY color. | #N |\n * | 4 | CMYK color. | #N |\n * | 5 | Indexed (256 colors) as `Ps ; 5 ; INDEX` or `Ps : 5 : INDEX`. | #Y |\n *\n *\n * FIXME: blinking is implemented in attrs, but not working in renderers?\n * FIXME: remove dead branch for p=100\n */\n public charAttributes(params: IParams): boolean {\n // Optimize a single SGR0.\n if (params.length === 1 && params.params[0] === 0) {\n this._curAttrData.fg = DEFAULT_ATTR_DATA.fg;\n this._curAttrData.bg = DEFAULT_ATTR_DATA.bg;\n return true;\n }\n\n const l = params.length;\n let p;\n const attr = this._curAttrData;\n\n for (let i = 0; i < l; i++) {\n p = params.params[i];\n if (p >= 30 && p <= 37) {\n // fg color 8\n attr.fg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.fg |= Attributes.CM_P16 | (p - 30);\n } else if (p >= 40 && p <= 47) {\n // bg color 8\n attr.bg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.bg |= Attributes.CM_P16 | (p - 40);\n } else if (p >= 90 && p <= 97) {\n // fg color 16\n attr.fg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.fg |= Attributes.CM_P16 | (p - 90) | 8;\n } else if (p >= 100 && p <= 107) {\n // bg color 16\n attr.bg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.bg |= Attributes.CM_P16 | (p - 100) | 8;\n } else if (p === 0) {\n // default\n attr.fg = DEFAULT_ATTR_DATA.fg;\n attr.bg = DEFAULT_ATTR_DATA.bg;\n } else if (p === 1) {\n // bold text\n attr.fg |= FgFlags.BOLD;\n } else if (p === 3) {\n // italic text\n attr.bg |= BgFlags.ITALIC;\n } else if (p === 4) {\n // underlined text\n attr.fg |= FgFlags.UNDERLINE;\n this._processUnderline(params.hasSubParams(i) ? params.getSubParams(i)![0] : UnderlineStyle.SINGLE, attr);\n } else if (p === 5) {\n // blink\n attr.fg |= FgFlags.BLINK;\n } else if (p === 7) {\n // inverse and positive\n // test with: echo -e '\\e[31m\\e[42mhello\\e[7mworld\\e[27mhi\\e[m'\n attr.fg |= FgFlags.INVERSE;\n } else if (p === 8) {\n // invisible\n attr.fg |= FgFlags.INVISIBLE;\n } else if (p === 9) {\n // strikethrough\n attr.fg |= FgFlags.STRIKETHROUGH;\n } else if (p === 2) {\n // dimmed text\n attr.bg |= BgFlags.DIM;\n } else if (p === 21) {\n // double underline\n this._processUnderline(UnderlineStyle.DOUBLE, attr);\n } else if (p === 22) {\n // not bold nor faint\n attr.fg &= ~FgFlags.BOLD;\n attr.bg &= ~BgFlags.DIM;\n } else if (p === 23) {\n // not italic\n attr.bg &= ~BgFlags.ITALIC;\n } else if (p === 24) {\n // not underlined\n attr.fg &= ~FgFlags.UNDERLINE;\n } else if (p === 25) {\n // not blink\n attr.fg &= ~FgFlags.BLINK;\n } else if (p === 27) {\n // not inverse\n attr.fg &= ~FgFlags.INVERSE;\n } else if (p === 28) {\n // not invisible\n attr.fg &= ~FgFlags.INVISIBLE;\n } else if (p === 29) {\n // not strikethrough\n attr.fg &= ~FgFlags.STRIKETHROUGH;\n } else if (p === 39) {\n // reset fg\n attr.fg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.fg |= DEFAULT_ATTR_DATA.fg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else if (p === 49) {\n // reset bg\n attr.bg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.bg |= DEFAULT_ATTR_DATA.bg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else if (p === 38 || p === 48 || p === 58) {\n // fg color 256 and RGB\n i += this._extractColor(params, i, attr);\n } else if (p === 59) {\n attr.extended = attr.extended.clone();\n attr.extended.underlineColor = -1;\n attr.updateExtended();\n } else if (p === 100) { // FIXME: dead branch, p=100 already handled above!\n // reset fg/bg\n attr.fg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.fg |= DEFAULT_ATTR_DATA.fg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n attr.bg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.bg |= DEFAULT_ATTR_DATA.bg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else {\n this._logService.debug('Unknown SGR attribute: %d.', p);\n }\n }\n return true;\n }\n\n /**\n * CSI Ps n Device Status Report (DSR).\n * Ps = 5 -> Status Report. Result (``OK'') is\n * CSI 0 n\n * Ps = 6 -> Report Cursor Position (CPR) [row;column].\n * Result is\n * CSI r ; c R\n * CSI ? Ps n\n * Device Status Report (DSR, DEC-specific).\n * Ps = 6 -> Report Cursor Position (CPR) [row;column] as CSI\n * ? r ; c R (assumes page is zero).\n * Ps = 1 5 -> Report Printer status as CSI ? 1 0 n (ready).\n * or CSI ? 1 1 n (not ready).\n * Ps = 2 5 -> Report UDK status as CSI ? 2 0 n (unlocked)\n * or CSI ? 2 1 n (locked).\n * Ps = 2 6 -> Report Keyboard status as\n * CSI ? 2 7 ; 1 ; 0 ; 0 n (North American).\n * The last two parameters apply to VT400 & up, and denote key-\n * board ready and LK01 respectively.\n * Ps = 5 3 -> Report Locator status as\n * CSI ? 5 3 n Locator available, if compiled-in, or\n * CSI ? 5 0 n No Locator, if not.\n *\n * @vt: #Y CSI DSR \"Device Status Report\" \"CSI Ps n\" \"Request cursor position (CPR) with `Ps` = 6.\"\n */\n public deviceStatus(params: IParams): boolean {\n switch (params.params[0]) {\n case 5:\n // status report\n this._coreService.triggerDataEvent(`${C0.ESC}[0n`);\n break;\n case 6:\n // cursor position\n const y = this._activeBuffer.y + 1;\n const x = this._activeBuffer.x + 1;\n this._coreService.triggerDataEvent(`${C0.ESC}[${y};${x}R`);\n break;\n }\n return true;\n }\n\n // @vt: #P[Only CPR is supported.] CSI DECDSR \"DEC Device Status Report\" \"CSI ? Ps n\" \"Only CPR is supported (same as DSR).\"\n public deviceStatusPrivate(params: IParams): boolean {\n // modern xterm doesnt seem to\n // respond to any of these except ?6, 6, and 5\n switch (params.params[0]) {\n case 6:\n // cursor position\n const y = this._activeBuffer.y + 1;\n const x = this._activeBuffer.x + 1;\n this._coreService.triggerDataEvent(`${C0.ESC}[?${y};${x}R`);\n break;\n case 15:\n // no printer\n // this.handler(C0.ESC + '[?11n');\n break;\n case 25:\n // dont support user defined keys\n // this.handler(C0.ESC + '[?21n');\n break;\n case 26:\n // north american keyboard\n // this.handler(C0.ESC + '[?27;1;0;0n');\n break;\n case 53:\n // no dec locator/mouse\n // this.handler(C0.ESC + '[?50n');\n break;\n }\n return true;\n }\n\n /**\n * CSI ! p Soft terminal reset (DECSTR).\n * http://vt100.net/docs/vt220-rm/table4-10.html\n *\n * @vt: #Y CSI DECSTR \"Soft Terminal Reset\" \"CSI ! p\" \"Reset several terminal attributes to initial state.\"\n * There are two terminal reset sequences - RIS and DECSTR. While RIS performs almost a full terminal bootstrap,\n * DECSTR only resets certain attributes. For most needs DECSTR should be sufficient.\n *\n * The following terminal attributes are reset to default values:\n * - IRM is reset (dafault = false)\n * - scroll margins are reset (default = viewport size)\n * - erase attributes are reset to default\n * - charsets are reset\n * - DECSC data is reset to initial values\n * - DECOM is reset to absolute mode\n *\n *\n * FIXME: there are several more attributes missing (see VT520 manual)\n */\n public softReset(params: IParams): boolean {\n this._coreService.isCursorHidden = false;\n this._onRequestSyncScrollBar.fire();\n this._activeBuffer.scrollTop = 0;\n this._activeBuffer.scrollBottom = this._bufferService.rows - 1;\n this._curAttrData = DEFAULT_ATTR_DATA.clone();\n this._coreService.reset();\n this._charsetService.reset();\n\n // reset DECSC data\n this._activeBuffer.savedX = 0;\n this._activeBuffer.savedY = this._activeBuffer.ybase;\n this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg;\n this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg;\n this._activeBuffer.savedCharset = this._charsetService.charset;\n\n // reset DECOM\n this._coreService.decPrivateModes.origin = false;\n return true;\n }\n\n /**\n * CSI Ps SP q Set cursor style (DECSCUSR, VT520).\n * Ps = 0 -> blinking block.\n * Ps = 1 -> blinking block (default).\n * Ps = 2 -> steady block.\n * Ps = 3 -> blinking underline.\n * Ps = 4 -> steady underline.\n * Ps = 5 -> blinking bar (xterm).\n * Ps = 6 -> steady bar (xterm).\n *\n * @vt: #Y CSI DECSCUSR \"Set Cursor Style\" \"CSI Ps SP q\" \"Set cursor style.\"\n * Supported cursor styles:\n * - empty, 0 or 1: steady block\n * - 2: blink block\n * - 3: steady underline\n * - 4: blink underline\n * - 5: steady bar\n * - 6: blink bar\n */\n public setCursorStyle(params: IParams): boolean {\n const param = params.params[0] || 1;\n switch (param) {\n case 1:\n case 2:\n this._optionsService.options.cursorStyle = 'block';\n break;\n case 3:\n case 4:\n this._optionsService.options.cursorStyle = 'underline';\n break;\n case 5:\n case 6:\n this._optionsService.options.cursorStyle = 'bar';\n break;\n }\n const isBlinking = param % 2 === 1;\n this._optionsService.options.cursorBlink = isBlinking;\n return true;\n }\n\n /**\n * CSI Ps ; Ps r\n * Set Scrolling Region [top;bottom] (default = full size of win-\n * dow) (DECSTBM).\n *\n * @vt: #Y CSI DECSTBM \"Set Top and Bottom Margin\" \"CSI Ps ; Ps r\" \"Set top and bottom margins of the viewport [top;bottom] (default = viewport size).\"\n */\n public setScrollRegion(params: IParams): boolean {\n const top = params.params[0] || 1;\n let bottom: number;\n\n if (params.length < 2 || (bottom = params.params[1]) > this._bufferService.rows || bottom === 0) {\n bottom = this._bufferService.rows;\n }\n\n if (bottom > top) {\n this._activeBuffer.scrollTop = top - 1;\n this._activeBuffer.scrollBottom = bottom - 1;\n this._setCursor(0, 0);\n }\n return true;\n }\n\n /**\n * CSI Ps ; Ps ; Ps t - Various window manipulations and reports (xterm)\n *\n * Note: Only those listed below are supported. All others are left to integrators and\n * need special treatment based on the embedding environment.\n *\n * Ps = 1 4 supported\n * Report xterm text area size in pixels.\n * Result is CSI 4 ; height ; width t\n * Ps = 14 ; 2 not implemented\n * Ps = 16 supported\n * Report xterm character cell size in pixels.\n * Result is CSI 6 ; height ; width t\n * Ps = 18 supported\n * Report the size of the text area in characters.\n * Result is CSI 8 ; height ; width t\n * Ps = 20 supported\n * Report xterm window's icon label.\n * Result is OSC L label ST\n * Ps = 21 supported\n * Report xterm window's title.\n * Result is OSC l label ST\n * Ps = 22 ; 0 -> Save xterm icon and window title on stack. supported\n * Ps = 22 ; 1 -> Save xterm icon title on stack. supported\n * Ps = 22 ; 2 -> Save xterm window title on stack. supported\n * Ps = 23 ; 0 -> Restore xterm icon and window title from stack. supported\n * Ps = 23 ; 1 -> Restore xterm icon title from stack. supported\n * Ps = 23 ; 2 -> Restore xterm window title from stack. supported\n * Ps >= 24 not implemented\n */\n public windowOptions(params: IParams): boolean {\n if (!paramToWindowOption(params.params[0], this._optionsService.rawOptions.windowOptions)) {\n return true;\n }\n const second = (params.length > 1) ? params.params[1] : 0;\n switch (params.params[0]) {\n case 14: // GetWinSizePixels, returns CSI 4 ; height ; width t\n if (second !== 2) {\n this._onRequestWindowsOptionsReport.fire(WindowsOptionsReportType.GET_WIN_SIZE_PIXELS);\n }\n break;\n case 16: // GetCellSizePixels, returns CSI 6 ; height ; width t\n this._onRequestWindowsOptionsReport.fire(WindowsOptionsReportType.GET_CELL_SIZE_PIXELS);\n break;\n case 18: // GetWinSizeChars, returns CSI 8 ; height ; width t\n if (this._bufferService) {\n this._coreService.triggerDataEvent(`${C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);\n }\n break;\n case 22: // PushTitle\n if (second === 0 || second === 2) {\n this._windowTitleStack.push(this._windowTitle);\n if (this._windowTitleStack.length > STACK_LIMIT) {\n this._windowTitleStack.shift();\n }\n }\n if (second === 0 || second === 1) {\n this._iconNameStack.push(this._iconName);\n if (this._iconNameStack.length > STACK_LIMIT) {\n this._iconNameStack.shift();\n }\n }\n break;\n case 23: // PopTitle\n if (second === 0 || second === 2) {\n if (this._windowTitleStack.length) {\n this.setTitle(this._windowTitleStack.pop()!);\n }\n }\n if (second === 0 || second === 1) {\n if (this._iconNameStack.length) {\n this.setIconName(this._iconNameStack.pop()!);\n }\n }\n break;\n }\n return true;\n }\n\n\n /**\n * CSI s\n * ESC 7\n * Save cursor (ANSI.SYS).\n *\n * @vt: #P[TODO...] CSI SCOSC \"Save Cursor\" \"CSI s\" \"Save cursor position, charmap and text attributes.\"\n * @vt: #Y ESC SC \"Save Cursor\" \"ESC 7\" \"Save cursor position, charmap and text attributes.\"\n */\n public saveCursor(params?: IParams): boolean {\n this._activeBuffer.savedX = this._activeBuffer.x;\n this._activeBuffer.savedY = this._activeBuffer.ybase + this._activeBuffer.y;\n this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg;\n this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg;\n this._activeBuffer.savedCharset = this._charsetService.charset;\n return true;\n }\n\n\n /**\n * CSI u\n * ESC 8\n * Restore cursor (ANSI.SYS).\n *\n * @vt: #P[TODO...] CSI SCORC \"Restore Cursor\" \"CSI u\" \"Restore cursor position, charmap and text attributes.\"\n * @vt: #Y ESC RC \"Restore Cursor\" \"ESC 8\" \"Restore cursor position, charmap and text attributes.\"\n */\n public restoreCursor(params?: IParams): boolean {\n this._activeBuffer.x = this._activeBuffer.savedX || 0;\n this._activeBuffer.y = Math.max(this._activeBuffer.savedY - this._activeBuffer.ybase, 0);\n this._curAttrData.fg = this._activeBuffer.savedCurAttrData.fg;\n this._curAttrData.bg = this._activeBuffer.savedCurAttrData.bg;\n this._charsetService.charset = (this as any)._savedCharset;\n if (this._activeBuffer.savedCharset) {\n this._charsetService.charset = this._activeBuffer.savedCharset;\n }\n this._restrictCursor();\n return true;\n }\n\n\n /**\n * OSC 2; ST (set window title)\n * Proxy to set window title.\n *\n * @vt: #P[Icon name is not exposed.] OSC 0 \"Set Windows Title and Icon Name\" \"OSC 0 ; Pt BEL\" \"Set window title and icon name.\"\n * Icon name is not supported. For Window Title see below.\n *\n * @vt: #Y OSC 2 \"Set Windows Title\" \"OSC 2 ; Pt BEL\" \"Set window title.\"\n * xterm.js does not manipulate the title directly, instead exposes changes via the event `Terminal.onTitleChange`.\n */\n public setTitle(data: string): boolean {\n this._windowTitle = data;\n this._onTitleChange.fire(data);\n return true;\n }\n\n /**\n * OSC 1; ST\n * Note: Icon name is not exposed.\n */\n public setIconName(data: string): boolean {\n this._iconName = data;\n return true;\n }\n\n /**\n * OSC 4; ; ST (set ANSI color to )\n *\n * @vt: #Y OSC 4 \"Set ANSI color\" \"OSC 4 ; c ; spec BEL\" \"Change color number `c` to the color specified by `spec`.\"\n * `c` is the color index between 0 and 255. The color format of `spec` is derived from `XParseColor` (see OSC 10 for supported formats).\n * There may be multipe `c ; spec` pairs present in the same instruction.\n * If `spec` contains `?` the terminal returns a sequence with the currently set color.\n */\n public setOrReportIndexedColor(data: string): boolean {\n const event: IColorEvent = [];\n const slots = data.split(';');\n while (slots.length > 1) {\n const idx = slots.shift() as string;\n const spec = slots.shift() as string;\n if (/^\\d+$/.exec(idx)) {\n const index = parseInt(idx);\n if (0 <= index && index < 256) {\n if (spec === '?') {\n event.push({ type: ColorRequestType.REPORT, index });\n } else {\n const color = parseColor(spec);\n if (color) {\n event.push({ type: ColorRequestType.SET, index, color });\n }\n }\n }\n }\n }\n if (event.length) {\n this._onColor.fire(event);\n }\n return true;\n }\n\n // special colors - OSC 10 | 11 | 12\n private _specialColors = [ColorIndex.FOREGROUND, ColorIndex.BACKGROUND, ColorIndex.CURSOR];\n\n /**\n * Apply colors requests for special colors in OSC 10 | 11 | 12.\n * Since these commands are stacking from multiple parameters,\n * we handle them in a loop with an entry offset to `_specialColors`.\n */\n private _setOrReportSpecialColor(data: string, offset: number): boolean {\n const slots = data.split(';');\n for (let i = 0; i < slots.length; ++i, ++offset) {\n if (offset >= this._specialColors.length) break;\n if (slots[i] === '?') {\n this._onColor.fire([{ type: ColorRequestType.REPORT, index: this._specialColors[offset] }]);\n } else {\n const color = parseColor(slots[i]);\n if (color) {\n this._onColor.fire([{ type: ColorRequestType.SET, index: this._specialColors[offset], color }]);\n }\n }\n }\n return true;\n }\n\n /**\n * OSC 10 ; | ST - set or query default foreground color\n *\n * @vt: #Y OSC 10 \"Set or query default foreground color\" \"OSC 10 ; Pt BEL\" \"Set or query default foreground color.\"\n * To set the color, the following color specification formats are supported:\n * - `rgb://` for `, , ` in `h | hh | hhh | hhhh`, where\n * `h` is a single hexadecimal digit (case insignificant). The different widths scale\n * from 4 bit (`h`) to 16 bit (`hhhh`) and get converted to 8 bit (`hh`).\n * - `#RGB` - 4 bits per channel, expanded to `#R0G0B0`\n * - `#RRGGBB` - 8 bits per channel\n * - `#RRRGGGBBB` - 12 bits per channel, truncated to `#RRGGBB`\n * - `#RRRRGGGGBBBB` - 16 bits per channel, truncated to `#RRGGBB`\n *\n * **Note:** X11 named colors are currently unsupported.\n *\n * If `Pt` contains `?` instead of a color specification, the terminal\n * returns a sequence with the current default foreground color\n * (use that sequence to restore the color after changes).\n *\n * **Note:** Other than xterm, xterm.js does not support OSC 12 - 19.\n * Therefore stacking multiple `Pt` separated by `;` only works for the first two entries.\n */\n public setOrReportFgColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 0);\n }\n\n /**\n * OSC 11 ; | ST - set or query default background color\n *\n * @vt: #Y OSC 11 \"Set or query default background color\" \"OSC 11 ; Pt BEL\" \"Same as OSC 10, but for default background.\"\n */\n public setOrReportBgColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 1);\n }\n\n /**\n * OSC 12 ; | ST - set or query default cursor color\n *\n * @vt: #Y OSC 12 \"Set or query default cursor color\" \"OSC 12 ; Pt BEL\" \"Same as OSC 10, but for default cursor color.\"\n */\n public setOrReportCursorColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 2);\n }\n\n /**\n * OSC 104 ; ST - restore ANSI color \n *\n * @vt: #Y OSC 104 \"Reset ANSI color\" \"OSC 104 ; c BEL\" \"Reset color number `c` to themed color.\"\n * `c` is the color index between 0 and 255. This function restores the default color for `c` as\n * specified by the loaded theme. Any number of `c` parameters may be given.\n * If no parameters are given, the entire indexed color table will be reset.\n */\n public restoreIndexedColor(data: string): boolean {\n if (!data) {\n this._onColor.fire([{ type: ColorRequestType.RESTORE }]);\n return true;\n }\n const event: IColorEvent = [];\n const slots = data.split(';');\n for (let i = 0; i < slots.length; ++i) {\n if (/^\\d+$/.exec(slots[i])) {\n const index = parseInt(slots[i]);\n if (0 <= index && index < 256) {\n event.push({ type: ColorRequestType.RESTORE, index });\n }\n }\n }\n if (event.length) {\n this._onColor.fire(event);\n }\n return true;\n }\n\n /**\n * OSC 110 ST - restore default foreground color\n *\n * @vt: #Y OSC 110 \"Restore default foreground color\" \"OSC 110 BEL\" \"Restore default foreground to themed color.\"\n */\n public restoreFgColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.FOREGROUND }]);\n return true;\n }\n\n /**\n * OSC 111 ST - restore default background color\n *\n * @vt: #Y OSC 111 \"Restore default background color\" \"OSC 111 BEL\" \"Restore default background to themed color.\"\n */\n public restoreBgColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.BACKGROUND }]);\n return true;\n }\n\n /**\n * OSC 112 ST - restore default cursor color\n *\n * @vt: #Y OSC 112 \"Restore default cursor color\" \"OSC 112 BEL\" \"Restore default cursor to themed color.\"\n */\n public restoreCursorColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.CURSOR }]);\n return true;\n }\n\n /**\n * ESC E\n * C1.NEL\n * DEC mnemonic: NEL (https://vt100.net/docs/vt510-rm/NEL)\n * Moves cursor to first position on next line.\n *\n * @vt: #Y C1 NEL \"Next Line\" \"\\x85\" \"Move the cursor to the beginning of the next row.\"\n * @vt: #Y ESC NEL \"Next Line\" \"ESC E\" \"Move the cursor to the beginning of the next row.\"\n */\n public nextLine(): boolean {\n this._activeBuffer.x = 0;\n this.index();\n return true;\n }\n\n /**\n * ESC =\n * DEC mnemonic: DECKPAM (https://vt100.net/docs/vt510-rm/DECKPAM.html)\n * Enables the numeric keypad to send application sequences to the host.\n */\n public keypadApplicationMode(): boolean {\n this._logService.debug('Serial port requested application keypad.');\n this._coreService.decPrivateModes.applicationKeypad = true;\n this._onRequestSyncScrollBar.fire();\n return true;\n }\n\n /**\n * ESC >\n * DEC mnemonic: DECKPNM (https://vt100.net/docs/vt510-rm/DECKPNM.html)\n * Enables the keypad to send numeric characters to the host.\n */\n public keypadNumericMode(): boolean {\n this._logService.debug('Switching back to normal keypad.');\n this._coreService.decPrivateModes.applicationKeypad = false;\n this._onRequestSyncScrollBar.fire();\n return true;\n }\n\n /**\n * ESC % @\n * ESC % G\n * Select default character set. UTF-8 is not supported (string are unicode anyways)\n * therefore ESC % G does the same.\n */\n public selectDefaultCharset(): boolean {\n this._charsetService.setgLevel(0);\n this._charsetService.setgCharset(0, DEFAULT_CHARSET); // US (default)\n return true;\n }\n\n /**\n * ESC ( C\n * Designate G0 Character Set, VT100, ISO 2022.\n * ESC ) C\n * Designate G1 Character Set (ISO 2022, VT100).\n * ESC * C\n * Designate G2 Character Set (ISO 2022, VT220).\n * ESC + C\n * Designate G3 Character Set (ISO 2022, VT220).\n * ESC - C\n * Designate G1 Character Set (VT300).\n * ESC . C\n * Designate G2 Character Set (VT300).\n * ESC / C\n * Designate G3 Character Set (VT300). C = A -> ISO Latin-1 Supplemental. - Supported?\n */\n public selectCharset(collectAndFlag: string): boolean {\n if (collectAndFlag.length !== 2) {\n this.selectDefaultCharset();\n return true;\n }\n if (collectAndFlag[0] === '/') {\n return true; // TODO: Is this supported?\n }\n this._charsetService.setgCharset(GLEVEL[collectAndFlag[0]], CHARSETS[collectAndFlag[1]] || DEFAULT_CHARSET);\n return true;\n }\n\n /**\n * ESC D\n * C1.IND\n * DEC mnemonic: IND (https://vt100.net/docs/vt510-rm/IND.html)\n * Moves the cursor down one line in the same column.\n *\n * @vt: #Y C1 IND \"Index\" \"\\x84\" \"Move the cursor one line down scrolling if needed.\"\n * @vt: #Y ESC IND \"Index\" \"ESC D\" \"Move the cursor one line down scrolling if needed.\"\n */\n public index(): boolean {\n this._restrictCursor();\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData());\n } else if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n this._restrictCursor();\n return true;\n }\n\n /**\n * ESC H\n * C1.HTS\n * DEC mnemonic: HTS (https://vt100.net/docs/vt510-rm/HTS.html)\n * Sets a horizontal tab stop at the column position indicated by\n * the value of the active column when the terminal receives an HTS.\n *\n * @vt: #Y C1 HTS \"Horizontal Tabulation Set\" \"\\x88\" \"Places a tab stop at the current cursor position.\"\n * @vt: #Y ESC HTS \"Horizontal Tabulation Set\" \"ESC H\" \"Places a tab stop at the current cursor position.\"\n */\n public tabSet(): boolean {\n this._activeBuffer.tabs[this._activeBuffer.x] = true;\n return true;\n }\n\n /**\n * ESC M\n * C1.RI\n * DEC mnemonic: HTS\n * Moves the cursor up one line in the same column. If the cursor is at the top margin,\n * the page scrolls down.\n *\n * @vt: #Y ESC IR \"Reverse Index\" \"ESC M\" \"Move the cursor one line up scrolling if needed.\"\n */\n public reverseIndex(): boolean {\n this._restrictCursor();\n if (this._activeBuffer.y === this._activeBuffer.scrollTop) {\n // possibly move the code below to term.reverseScroll();\n // test: echo -ne '\\e[1;1H\\e[44m\\eM\\e[0m'\n // blankLine(true) is xterm/linux behavior\n const scrollRegionHeight = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop;\n this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, scrollRegionHeight, 1);\n this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n } else {\n this._activeBuffer.y--;\n this._restrictCursor(); // quickfix to not run out of bounds\n }\n return true;\n }\n\n /**\n * ESC c\n * DEC mnemonic: RIS (https://vt100.net/docs/vt510-rm/RIS.html)\n * Reset to initial state.\n */\n public fullReset(): boolean {\n this._parser.reset();\n this._onRequestReset.fire();\n return true;\n }\n\n public reset(): void {\n this._curAttrData = DEFAULT_ATTR_DATA.clone();\n this._eraseAttrDataInternal = DEFAULT_ATTR_DATA.clone();\n }\n\n /**\n * back_color_erase feature for xterm.\n */\n private _eraseAttrData(): IAttributeData {\n this._eraseAttrDataInternal.bg &= ~(Attributes.CM_MASK | 0xFFFFFF);\n this._eraseAttrDataInternal.bg |= this._curAttrData.bg & ~0xFC000000;\n return this._eraseAttrDataInternal;\n }\n\n /**\n * ESC n\n * ESC o\n * ESC |\n * ESC }\n * ESC ~\n * DEC mnemonic: LS (https://vt100.net/docs/vt510-rm/LS.html)\n * When you use a locking shift, the character set remains in GL or GR until\n * you use another locking shift. (partly supported)\n */\n public setgLevel(level: number): boolean {\n this._charsetService.setgLevel(level);\n return true;\n }\n\n /**\n * ESC # 8\n * DEC mnemonic: DECALN (https://vt100.net/docs/vt510-rm/DECALN.html)\n * This control function fills the complete screen area with\n * a test pattern (E) used for adjusting screen alignment.\n *\n * @vt: #Y ESC DECALN \"Screen Alignment Pattern\" \"ESC # 8\" \"Fill viewport with a test pattern (E).\"\n */\n public screenAlignmentPattern(): boolean {\n // prepare cell data\n const cell = new CellData();\n cell.content = 1 << Content.WIDTH_SHIFT | 'E'.charCodeAt(0);\n cell.fg = this._curAttrData.fg;\n cell.bg = this._curAttrData.bg;\n\n\n this._setCursor(0, 0);\n for (let yOffset = 0; yOffset < this._bufferService.rows; ++yOffset) {\n const row = this._activeBuffer.ybase + this._activeBuffer.y + yOffset;\n const line = this._activeBuffer.lines.get(row);\n if (line) {\n line.fill(cell);\n line.isWrapped = false;\n }\n }\n this._dirtyRowService.markAllDirty();\n this._setCursor(0, 0);\n return true;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\n/**\n * A base class that can be extended to provide convenience methods for managing the lifecycle of an\n * object and its components.\n */\nexport abstract class Disposable implements IDisposable {\n protected _disposables: IDisposable[] = [];\n protected _isDisposed: boolean = false;\n\n constructor() {\n }\n\n /**\n * Disposes the object, triggering the `dispose` method on all registered IDisposables.\n */\n public dispose(): void {\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.length = 0;\n }\n\n /**\n * Registers a disposable object.\n * @param d The disposable to register.\n * @returns The disposable.\n */\n public register(d: T): T {\n this._disposables.push(d);\n return d;\n }\n\n /**\n * Unregisters a disposable object if it has been registered, if not do\n * nothing.\n * @param d The disposable to unregister.\n */\n public unregister(d: T): void {\n const index = this._disposables.indexOf(d);\n if (index !== -1) {\n this._disposables.splice(index, 1);\n }\n }\n}\n\n/**\n * Dispose of all disposables in an array and set its length to 0.\n */\nexport function disposeArray(disposables: IDisposable[]): void {\n for (const d of disposables) {\n d.dispose();\n }\n disposables.length = 0;\n}\n\n/**\n * Creates a disposable that will dispose of an array of disposables when disposed.\n */\nexport function getDisposeArrayDisposable(array: IDisposable[]): IDisposable {\n return { dispose: () => disposeArray(array) };\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\ninterface INavigator {\n userAgent: string;\n language: string;\n platform: string;\n}\n\n// We're declaring a navigator global here as we expect it in all runtimes (node and browser), but\n// we want this module to live in common.\ndeclare const navigator: INavigator;\n\nconst isNode = (typeof navigator === 'undefined') ? true : false;\nconst userAgent = (isNode) ? 'node' : navigator.userAgent;\nconst platform = (isNode) ? 'node' : navigator.platform;\n\nexport const isFirefox = userAgent.includes('Firefox');\nexport const isLegacyEdge = userAgent.includes('Edge');\nexport const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);\n\n// Find the users platform. We use this to interpret the meta key\n// and ISO third level shifts.\n// http://stackoverflow.com/q/19877924/577598\nexport const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform);\nexport const isIpad = platform === 'iPad';\nexport const isIphone = platform === 'iPhone';\nexport const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(platform);\nexport const isLinux = platform.indexOf('Linux') >= 0;\n", "/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * A generic list that is maintained in sorted order and allows values with duplicate keys. This\n * list is based on binary search and as such locating a key will take O(log n) amortized, this\n * includes the by key iterator.\n */\nexport class SortedList {\n private readonly _array: T[] = [];\n\n constructor(\n private readonly _getKey: (value: T) => number\n ) {\n }\n\n public clear(): void {\n this._array.length = 0;\n }\n\n public insert(value: T): void {\n if (this._array.length === 0) {\n this._array.push(value);\n return;\n }\n const i = this._search(this._getKey(value), 0, this._array.length - 1);\n this._array.splice(i, 0, value);\n }\n\n public delete(value: T): boolean {\n if (this._array.length === 0) {\n return false;\n }\n const key = this._getKey(value);\n let i = this._search(key, 0, this._array.length - 1);\n if (this._getKey(this._array[i]) !== key) {\n return false;\n }\n do {\n if (this._array[i] === value) {\n this._array.splice(i, 1);\n return true;\n }\n } while (++i < this._array.length && this._getKey(this._array[i]) === key);\n return false;\n }\n\n public *getKeyIterator(key: number): IterableIterator {\n if (this._array.length === 0) {\n return;\n }\n let i = this._search(key, 0, this._array.length - 1);\n if (i < 0 || i >= this._array.length) {\n return;\n }\n if (this._getKey(this._array[i]) !== key) {\n return;\n }\n do {\n yield this._array[i];\n } while (++i < this._array.length && this._getKey(this._array[i]) === key);\n }\n\n public values(): IterableIterator {\n return this._array.values();\n }\n\n private _search(key: number, min: number, max: number): number {\n if (max < min) {\n return min;\n }\n let mid = Math.floor((min + max) / 2);\n if (this._getKey(this._array[mid]) > key) {\n return this._search(key, min, mid - 1);\n }\n if (this._getKey(this._array[mid]) < key) {\n return this._search(key, mid + 1, max);\n }\n // Value found! Since keys can be duplicates, move the result index back to the lowest index\n // that matches the key.\n while (mid > 0 && this._getKey(this._array[mid - 1]) === key) {\n mid--;\n }\n return mid;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport type TypedArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;\n\n\n/**\n * polyfill for TypedArray.fill\n * This is needed to support .fill in all safari versions and IE 11.\n */\nexport function fill(array: T, value: number, start?: number, end?: number): T {\n // all modern engines that support .fill\n if (array.fill) {\n return array.fill(value, start, end) as T;\n }\n return fillFallback(array, value, start, end);\n}\n\nexport function fillFallback(array: T, value: number, start: number = 0, end: number = array.length): T {\n // safari and IE 11\n // since IE 11 does not support Array.prototype.fill either\n // we cannot use the suggested polyfill from MDN\n // instead we simply fall back to looping\n if (start >= array.length) {\n return array;\n }\n start = (array.length + start) % array.length;\n if (end >= array.length) {\n end = array.length;\n } else {\n end = (array.length + end) % array.length;\n }\n for (let i = start; i < end; ++i) {\n array[i] = value;\n }\n return array;\n}\n\n/**\n * Concat two typed arrays `a` and `b`.\n * Returns a new typed array.\n */\nexport function concat(a: T, b: T): T {\n const result = new (a.constructor as any)(a.length + b.length);\n result.set(a);\n result.set(b, a.length);\n return result;\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CHAR_DATA_CODE_INDEX, NULL_CELL_CODE, WHITESPACE_CELL_CODE } from 'common/buffer/Constants';\nimport { IBufferService } from 'common/services/Services';\n\nexport function updateWindowsModeWrappedState(bufferService: IBufferService): void {\n // Winpty does not support wraparound mode which means that lines will never\n // be marked as wrapped. This causes issues for things like copying a line\n // retaining the wrapped new line characters or if consumers are listening\n // in on the data stream.\n //\n // The workaround for this is to listen to every incoming line feed and mark\n // the line as wrapped if the last character in the previous line is not a\n // space. This is certainly not without its problems, but generally on\n // Windows when text reaches the end of the terminal it's likely going to be\n // wrapped.\n const line = bufferService.buffer.lines.get(bufferService.buffer.ybase + bufferService.buffer.y - 1);\n const lastChar = line?.get(bufferService.cols - 1);\n\n const nextLine = bufferService.buffer.lines.get(bufferService.buffer.ybase + bufferService.buffer.y);\n if (nextLine && lastChar) {\n nextLine.isWrapped = (lastChar[CHAR_DATA_CODE_INDEX] !== NULL_CELL_CODE && lastChar[CHAR_DATA_CODE_INDEX] !== WHITESPACE_CELL_CODE);\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAttributeData, IColorRGB, IExtendedAttrs } from 'common/Types';\nimport { Attributes, FgFlags, BgFlags, UnderlineStyle } from 'common/buffer/Constants';\n\nexport class AttributeData implements IAttributeData {\n public static toColorRGB(value: number): IColorRGB {\n return [\n value >>> Attributes.RED_SHIFT & 255,\n value >>> Attributes.GREEN_SHIFT & 255,\n value & 255\n ];\n }\n\n public static fromColorRGB(value: IColorRGB): number {\n return (value[0] & 255) << Attributes.RED_SHIFT | (value[1] & 255) << Attributes.GREEN_SHIFT | value[2] & 255;\n }\n\n public clone(): IAttributeData {\n const newObj = new AttributeData();\n newObj.fg = this.fg;\n newObj.bg = this.bg;\n newObj.extended = this.extended.clone();\n return newObj;\n }\n\n // data\n public fg = 0;\n public bg = 0;\n public extended = new ExtendedAttrs();\n\n // flags\n public isInverse(): number { return this.fg & FgFlags.INVERSE; }\n public isBold(): number { return this.fg & FgFlags.BOLD; }\n public isUnderline(): number { return this.fg & FgFlags.UNDERLINE; }\n public isBlink(): number { return this.fg & FgFlags.BLINK; }\n public isInvisible(): number { return this.fg & FgFlags.INVISIBLE; }\n public isItalic(): number { return this.bg & BgFlags.ITALIC; }\n public isDim(): number { return this.bg & BgFlags.DIM; }\n public isStrikethrough(): number { return this.fg & FgFlags.STRIKETHROUGH; }\n\n // color modes\n public getFgColorMode(): number { return this.fg & Attributes.CM_MASK; }\n public getBgColorMode(): number { return this.bg & Attributes.CM_MASK; }\n public isFgRGB(): boolean { return (this.fg & Attributes.CM_MASK) === Attributes.CM_RGB; }\n public isBgRGB(): boolean { return (this.bg & Attributes.CM_MASK) === Attributes.CM_RGB; }\n public isFgPalette(): boolean { return (this.fg & Attributes.CM_MASK) === Attributes.CM_P16 || (this.fg & Attributes.CM_MASK) === Attributes.CM_P256; }\n public isBgPalette(): boolean { return (this.bg & Attributes.CM_MASK) === Attributes.CM_P16 || (this.bg & Attributes.CM_MASK) === Attributes.CM_P256; }\n public isFgDefault(): boolean { return (this.fg & Attributes.CM_MASK) === 0; }\n public isBgDefault(): boolean { return (this.bg & Attributes.CM_MASK) === 0; }\n public isAttributeDefault(): boolean { return this.fg === 0 && this.bg === 0; }\n\n // colors\n public getFgColor(): number {\n switch (this.fg & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.fg & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.fg & Attributes.RGB_MASK;\n default: return -1; // CM_DEFAULT defaults to -1\n }\n }\n public getBgColor(): number {\n switch (this.bg & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.bg & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.bg & Attributes.RGB_MASK;\n default: return -1; // CM_DEFAULT defaults to -1\n }\n }\n\n // extended attrs\n public hasExtendedAttrs(): number {\n return this.bg & BgFlags.HAS_EXTENDED;\n }\n public updateExtended(): void {\n if (this.extended.isEmpty()) {\n this.bg &= ~BgFlags.HAS_EXTENDED;\n } else {\n this.bg |= BgFlags.HAS_EXTENDED;\n }\n }\n public getUnderlineColor(): number {\n if ((this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor) {\n switch (this.extended.underlineColor & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.extended.underlineColor & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.extended.underlineColor & Attributes.RGB_MASK;\n default: return this.getFgColor();\n }\n }\n return this.getFgColor();\n }\n public getUnderlineColorMode(): number {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? this.extended.underlineColor & Attributes.CM_MASK\n : this.getFgColorMode();\n }\n public isUnderlineColorRGB(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_RGB\n : this.isFgRGB();\n }\n public isUnderlineColorPalette(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_P16\n || (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_P256\n : this.isFgPalette();\n }\n public isUnderlineColorDefault(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === 0\n : this.isFgDefault();\n }\n public getUnderlineStyle(): UnderlineStyle {\n return this.fg & FgFlags.UNDERLINE\n ? (this.bg & BgFlags.HAS_EXTENDED ? this.extended.underlineStyle : UnderlineStyle.SINGLE)\n : UnderlineStyle.NONE;\n }\n}\n\n\n/**\n * Extended attributes for a cell.\n * Holds information about different underline styles and color.\n */\nexport class ExtendedAttrs implements IExtendedAttrs {\n constructor(\n // underline style, NONE is empty\n public underlineStyle: UnderlineStyle = UnderlineStyle.NONE,\n // underline color, -1 is empty (same as FG)\n public underlineColor: number = -1\n ) {}\n\n public clone(): IExtendedAttrs {\n return new ExtendedAttrs(this.underlineStyle, this.underlineColor);\n }\n\n /**\n * Convenient method to indicate whether the object holds no additional information,\n * that needs to be persistant in the buffer.\n */\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE;\n }\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CircularList, IInsertEvent } from 'common/CircularList';\nimport { IBuffer, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult } from 'common/buffer/Types';\nimport { IBufferLine, ICellData, IAttributeData, ICharset } from 'common/Types';\nimport { BufferLine, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { CellData } from 'common/buffer/CellData';\nimport { NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_CHAR_INDEX } from 'common/buffer/Constants';\nimport { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths, getWrappedLineTrimmedLength } from 'common/buffer/BufferReflow';\nimport { Marker } from 'common/buffer/Marker';\nimport { IOptionsService, IBufferService } from 'common/services/Services';\nimport { DEFAULT_CHARSET } from 'common/data/Charsets';\nimport { ExtendedAttrs } from 'common/buffer/AttributeData';\n\nexport const MAX_BUFFER_SIZE = 4294967295; // 2^32 - 1\n\n/**\n * This class represents a terminal buffer (an internal state of the terminal), where the\n * following information is stored (in high-level):\n * - text content of this particular buffer\n * - cursor position\n * - scroll position\n */\nexport class Buffer implements IBuffer {\n public lines: CircularList;\n public ydisp: number = 0;\n public ybase: number = 0;\n public y: number = 0;\n public x: number = 0;\n public scrollBottom: number;\n public scrollTop: number;\n // TODO: Type me\n public tabs: any;\n public savedY: number = 0;\n public savedX: number = 0;\n public savedCurAttrData = DEFAULT_ATTR_DATA.clone();\n public savedCharset: ICharset | undefined = DEFAULT_CHARSET;\n public markers: Marker[] = [];\n private _nullCell: ICellData = CellData.fromCharData([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);\n private _whitespaceCell: ICellData = CellData.fromCharData([0, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE]);\n private _cols: number;\n private _rows: number;\n private _isClearing: boolean = false;\n\n constructor(\n private _hasScrollback: boolean,\n private _optionsService: IOptionsService,\n private _bufferService: IBufferService\n ) {\n this._cols = this._bufferService.cols;\n this._rows = this._bufferService.rows;\n this.lines = new CircularList(this._getCorrectBufferLength(this._rows));\n this.scrollTop = 0;\n this.scrollBottom = this._rows - 1;\n this.setupTabStops();\n }\n\n public getNullCell(attr?: IAttributeData): ICellData {\n if (attr) {\n this._nullCell.fg = attr.fg;\n this._nullCell.bg = attr.bg;\n this._nullCell.extended = attr.extended;\n } else {\n this._nullCell.fg = 0;\n this._nullCell.bg = 0;\n this._nullCell.extended = new ExtendedAttrs();\n }\n return this._nullCell;\n }\n\n public getWhitespaceCell(attr?: IAttributeData): ICellData {\n if (attr) {\n this._whitespaceCell.fg = attr.fg;\n this._whitespaceCell.bg = attr.bg;\n this._whitespaceCell.extended = attr.extended;\n } else {\n this._whitespaceCell.fg = 0;\n this._whitespaceCell.bg = 0;\n this._whitespaceCell.extended = new ExtendedAttrs();\n }\n return this._whitespaceCell;\n }\n\n public getBlankLine(attr: IAttributeData, isWrapped?: boolean): IBufferLine {\n return new BufferLine(this._bufferService.cols, this.getNullCell(attr), isWrapped);\n }\n\n public get hasScrollback(): boolean {\n return this._hasScrollback && this.lines.maxLength > this._rows;\n }\n\n public get isCursorInViewport(): boolean {\n const absoluteY = this.ybase + this.y;\n const relativeY = absoluteY - this.ydisp;\n return (relativeY >= 0 && relativeY < this._rows);\n }\n\n /**\n * Gets the correct buffer length based on the rows provided, the terminal's\n * scrollback and whether this buffer is flagged to have scrollback or not.\n * @param rows The terminal rows to use in the calculation.\n */\n private _getCorrectBufferLength(rows: number): number {\n if (!this._hasScrollback) {\n return rows;\n }\n\n const correctBufferLength = rows + this._optionsService.rawOptions.scrollback;\n\n return correctBufferLength > MAX_BUFFER_SIZE ? MAX_BUFFER_SIZE : correctBufferLength;\n }\n\n /**\n * Fills the buffer's viewport with blank lines.\n */\n public fillViewportRows(fillAttr?: IAttributeData): void {\n if (this.lines.length === 0) {\n if (fillAttr === undefined) {\n fillAttr = DEFAULT_ATTR_DATA;\n }\n let i = this._rows;\n while (i--) {\n this.lines.push(this.getBlankLine(fillAttr));\n }\n }\n }\n\n /**\n * Clears the buffer to it's initial state, discarding all previous data.\n */\n public clear(): void {\n this.ydisp = 0;\n this.ybase = 0;\n this.y = 0;\n this.x = 0;\n this.lines = new CircularList(this._getCorrectBufferLength(this._rows));\n this.scrollTop = 0;\n this.scrollBottom = this._rows - 1;\n this.setupTabStops();\n }\n\n /**\n * Resizes the buffer, adjusting its data accordingly.\n * @param newCols The new number of columns.\n * @param newRows The new number of rows.\n */\n public resize(newCols: number, newRows: number): void {\n // store reference to null cell with default attrs\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n\n // Increase max length if needed before adjustments to allow space to fill\n // as required.\n const newMaxLength = this._getCorrectBufferLength(newRows);\n if (newMaxLength > this.lines.maxLength) {\n this.lines.maxLength = newMaxLength;\n }\n\n // The following adjustments should only happen if the buffer has been\n // initialized/filled.\n if (this.lines.length > 0) {\n // Deal with columns increasing (reducing needs to happen after reflow)\n if (this._cols < newCols) {\n for (let i = 0; i < this.lines.length; i++) {\n this.lines.get(i)!.resize(newCols, nullCell);\n }\n }\n\n // Resize rows in both directions as needed\n let addToY = 0;\n if (this._rows < newRows) {\n for (let y = this._rows; y < newRows; y++) {\n if (this.lines.length < newRows + this.ybase) {\n if (this._optionsService.rawOptions.windowsMode) {\n // Just add the new missing rows on Windows as conpty reprints the screen with it's\n // view of the world. Once a line enters scrollback for conpty it remains there\n this.lines.push(new BufferLine(newCols, nullCell));\n } else {\n if (this.ybase > 0 && this.lines.length <= this.ybase + this.y + addToY + 1) {\n // There is room above the buffer and there are no empty elements below the line,\n // scroll up\n this.ybase--;\n addToY++;\n if (this.ydisp > 0) {\n // Viewport is at the top of the buffer, must increase downwards\n this.ydisp--;\n }\n } else {\n // Add a blank line if there is no buffer left at the top to scroll to, or if there\n // are blank lines after the cursor\n this.lines.push(new BufferLine(newCols, nullCell));\n }\n }\n }\n }\n } else { // (this._rows >= newRows)\n for (let y = this._rows; y > newRows; y--) {\n if (this.lines.length > newRows + this.ybase) {\n if (this.lines.length > this.ybase + this.y + 1) {\n // The line is a blank line below the cursor, remove it\n this.lines.pop();\n } else {\n // The line is the cursor, scroll down\n this.ybase++;\n this.ydisp++;\n }\n }\n }\n }\n\n // Reduce max length if needed after adjustments, this is done after as it\n // would otherwise cut data from the bottom of the buffer.\n if (newMaxLength < this.lines.maxLength) {\n // Trim from the top of the buffer and adjust ybase and ydisp.\n const amountToTrim = this.lines.length - newMaxLength;\n if (amountToTrim > 0) {\n this.lines.trimStart(amountToTrim);\n this.ybase = Math.max(this.ybase - amountToTrim, 0);\n this.ydisp = Math.max(this.ydisp - amountToTrim, 0);\n this.savedY = Math.max(this.savedY - amountToTrim, 0);\n }\n this.lines.maxLength = newMaxLength;\n }\n\n // Make sure that the cursor stays on screen\n this.x = Math.min(this.x, newCols - 1);\n this.y = Math.min(this.y, newRows - 1);\n if (addToY) {\n this.y += addToY;\n }\n this.savedX = Math.min(this.savedX, newCols - 1);\n\n this.scrollTop = 0;\n }\n\n this.scrollBottom = newRows - 1;\n\n if (this._isReflowEnabled) {\n this._reflow(newCols, newRows);\n\n // Trim the end of the line off if cols shrunk\n if (this._cols > newCols) {\n for (let i = 0; i < this.lines.length; i++) {\n this.lines.get(i)!.resize(newCols, nullCell);\n }\n }\n }\n\n this._cols = newCols;\n this._rows = newRows;\n }\n\n private get _isReflowEnabled(): boolean {\n return this._hasScrollback && !this._optionsService.rawOptions.windowsMode;\n }\n\n private _reflow(newCols: number, newRows: number): void {\n if (this._cols === newCols) {\n return;\n }\n\n // Iterate through rows, ignore the last one as it cannot be wrapped\n if (newCols > this._cols) {\n this._reflowLarger(newCols, newRows);\n } else {\n this._reflowSmaller(newCols, newRows);\n }\n }\n\n private _reflowLarger(newCols: number, newRows: number): void {\n const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, this._cols, newCols, this.ybase + this.y, this.getNullCell(DEFAULT_ATTR_DATA));\n if (toRemove.length > 0) {\n const newLayoutResult = reflowLargerCreateNewLayout(this.lines, toRemove);\n reflowLargerApplyNewLayout(this.lines, newLayoutResult.layout);\n this._reflowLargerAdjustViewport(newCols, newRows, newLayoutResult.countRemoved);\n }\n }\n\n private _reflowLargerAdjustViewport(newCols: number, newRows: number, countRemoved: number): void {\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n // Adjust viewport based on number of items removed\n let viewportAdjustments = countRemoved;\n while (viewportAdjustments-- > 0) {\n if (this.ybase === 0) {\n if (this.y > 0) {\n this.y--;\n }\n if (this.lines.length < newRows) {\n // Add an extra row at the bottom of the viewport\n this.lines.push(new BufferLine(newCols, nullCell));\n }\n } else {\n if (this.ydisp === this.ybase) {\n this.ydisp--;\n }\n this.ybase--;\n }\n }\n this.savedY = Math.max(this.savedY - countRemoved, 0);\n }\n\n private _reflowSmaller(newCols: number, newRows: number): void {\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n // Gather all BufferLines that need to be inserted into the Buffer here so that they can be\n // batched up and only committed once\n const toInsert = [];\n let countToInsert = 0;\n // Go backwards as many lines may be trimmed and this will avoid considering them\n for (let y = this.lines.length - 1; y >= 0; y--) {\n // Check whether this line is a problem\n let nextLine = this.lines.get(y) as BufferLine;\n if (!nextLine || !nextLine.isWrapped && nextLine.getTrimmedLength() <= newCols) {\n continue;\n }\n\n // Gather wrapped lines and adjust y to be the starting line\n const wrappedLines: BufferLine[] = [nextLine];\n while (nextLine.isWrapped && y > 0) {\n nextLine = this.lines.get(--y) as BufferLine;\n wrappedLines.unshift(nextLine);\n }\n\n // If these lines contain the cursor don't touch them, the program will handle fixing up\n // wrapped lines with the cursor\n const absoluteY = this.ybase + this.y;\n if (absoluteY >= y && absoluteY < y + wrappedLines.length) {\n continue;\n }\n\n const lastLineLength = wrappedLines[wrappedLines.length - 1].getTrimmedLength();\n const destLineLengths = reflowSmallerGetNewLineLengths(wrappedLines, this._cols, newCols);\n const linesToAdd = destLineLengths.length - wrappedLines.length;\n let trimmedLines: number;\n if (this.ybase === 0 && this.y !== this.lines.length - 1) {\n // If the top section of the buffer is not yet filled\n trimmedLines = Math.max(0, this.y - this.lines.maxLength + linesToAdd);\n } else {\n trimmedLines = Math.max(0, this.lines.length - this.lines.maxLength + linesToAdd);\n }\n\n // Add the new lines\n const newLines: BufferLine[] = [];\n for (let i = 0; i < linesToAdd; i++) {\n const newLine = this.getBlankLine(DEFAULT_ATTR_DATA, true) as BufferLine;\n newLines.push(newLine);\n }\n if (newLines.length > 0) {\n toInsert.push({\n // countToInsert here gets the actual index, taking into account other inserted items.\n // using this we can iterate through the list forwards\n start: y + wrappedLines.length + countToInsert,\n newLines\n });\n countToInsert += newLines.length;\n }\n wrappedLines.push(...newLines);\n\n // Copy buffer data to new locations, this needs to happen backwards to do in-place\n let destLineIndex = destLineLengths.length - 1; // Math.floor(cellsNeeded / newCols);\n let destCol = destLineLengths[destLineIndex]; // cellsNeeded % newCols;\n if (destCol === 0) {\n destLineIndex--;\n destCol = destLineLengths[destLineIndex];\n }\n let srcLineIndex = wrappedLines.length - linesToAdd - 1;\n let srcCol = lastLineLength;\n while (srcLineIndex >= 0) {\n const cellsToCopy = Math.min(srcCol, destCol);\n if (wrappedLines[destLineIndex] === undefined) {\n // Sanity check that the line exists, this has been known to fail for an unknown reason\n // which would stop the reflow from happening if an exception would throw.\n break;\n }\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[srcLineIndex], srcCol - cellsToCopy, destCol - cellsToCopy, cellsToCopy, true);\n destCol -= cellsToCopy;\n if (destCol === 0) {\n destLineIndex--;\n destCol = destLineLengths[destLineIndex];\n }\n srcCol -= cellsToCopy;\n if (srcCol === 0) {\n srcLineIndex--;\n const wrappedLinesIndex = Math.max(srcLineIndex, 0);\n srcCol = getWrappedLineTrimmedLength(wrappedLines, wrappedLinesIndex, this._cols);\n }\n }\n\n // Null out the end of the line ends if a wide character wrapped to the following line\n for (let i = 0; i < wrappedLines.length; i++) {\n if (destLineLengths[i] < newCols) {\n wrappedLines[i].setCell(destLineLengths[i], nullCell);\n }\n }\n\n // Adjust viewport as needed\n let viewportAdjustments = linesToAdd - trimmedLines;\n while (viewportAdjustments-- > 0) {\n if (this.ybase === 0) {\n if (this.y < newRows - 1) {\n this.y++;\n this.lines.pop();\n } else {\n this.ybase++;\n this.ydisp++;\n }\n } else {\n // Ensure ybase does not exceed its maximum value\n if (this.ybase < Math.min(this.lines.maxLength, this.lines.length + countToInsert) - newRows) {\n if (this.ybase === this.ydisp) {\n this.ydisp++;\n }\n this.ybase++;\n }\n }\n }\n this.savedY = Math.min(this.savedY + linesToAdd, this.ybase + newRows - 1);\n }\n\n // Rearrange lines in the buffer if there are any insertions, this is done at the end rather\n // than earlier so that it's a single O(n) pass through the buffer, instead of O(n^2) from many\n // costly calls to CircularList.splice.\n if (toInsert.length > 0) {\n // Record buffer insert events and then play them back backwards so that the indexes are\n // correct\n const insertEvents: IInsertEvent[] = [];\n\n // Record original lines so they don't get overridden when we rearrange the list\n const originalLines: BufferLine[] = [];\n for (let i = 0; i < this.lines.length; i++) {\n originalLines.push(this.lines.get(i) as BufferLine);\n }\n const originalLinesLength = this.lines.length;\n\n let originalLineIndex = originalLinesLength - 1;\n let nextToInsertIndex = 0;\n let nextToInsert = toInsert[nextToInsertIndex];\n this.lines.length = Math.min(this.lines.maxLength, this.lines.length + countToInsert);\n let countInsertedSoFar = 0;\n for (let i = Math.min(this.lines.maxLength - 1, originalLinesLength + countToInsert - 1); i >= 0; i--) {\n if (nextToInsert && nextToInsert.start > originalLineIndex + countInsertedSoFar) {\n // Insert extra lines here, adjusting i as needed\n for (let nextI = nextToInsert.newLines.length - 1; nextI >= 0; nextI--) {\n this.lines.set(i--, nextToInsert.newLines[nextI]);\n }\n i++;\n\n // Create insert events for later\n insertEvents.push({\n index: originalLineIndex + 1,\n amount: nextToInsert.newLines.length\n });\n\n countInsertedSoFar += nextToInsert.newLines.length;\n nextToInsert = toInsert[++nextToInsertIndex];\n } else {\n this.lines.set(i, originalLines[originalLineIndex--]);\n }\n }\n\n // Update markers\n let insertCountEmitted = 0;\n for (let i = insertEvents.length - 1; i >= 0; i--) {\n insertEvents[i].index += insertCountEmitted;\n this.lines.onInsertEmitter.fire(insertEvents[i]);\n insertCountEmitted += insertEvents[i].amount;\n }\n const amountToTrim = Math.max(0, originalLinesLength + countToInsert - this.lines.maxLength);\n if (amountToTrim > 0) {\n this.lines.onTrimEmitter.fire(amountToTrim);\n }\n }\n }\n\n // private _reflowSmallerGetLinesNeeded()\n\n /**\n * Translates a string index back to a BufferIndex.\n * To get the correct buffer position the string must start at `startCol` 0\n * (default in translateBufferLineToString).\n * The method also works on wrapped line strings given rows were not trimmed.\n * The method operates on the CharData string length, there are no\n * additional content or boundary checks. Therefore the string and the buffer\n * should not be altered in between.\n * TODO: respect trim flag after fixing #1685\n * @param lineIndex line index the string was retrieved from\n * @param stringIndex index within the string\n * @param startCol column offset the string was retrieved from\n */\n public stringIndexToBufferIndex(lineIndex: number, stringIndex: number, trimRight: boolean = false): BufferIndex {\n while (stringIndex) {\n const line = this.lines.get(lineIndex);\n if (!line) {\n return [-1, -1];\n }\n const length = (trimRight) ? line.getTrimmedLength() : line.length;\n for (let i = 0; i < length; ++i) {\n if (line.get(i)[CHAR_DATA_WIDTH_INDEX]) {\n // empty cells report a string length of 0, but get replaced\n // with a whitespace in translateToString, thus replace with 1\n stringIndex -= line.get(i)[CHAR_DATA_CHAR_INDEX].length || 1;\n }\n if (stringIndex < 0) {\n return [lineIndex, i];\n }\n }\n lineIndex++;\n }\n return [lineIndex, 0];\n }\n\n /**\n * Translates a buffer line to a string, with optional start and end columns.\n * Wide characters will count as two columns in the resulting string. This\n * function is useful for getting the actual text underneath the raw selection\n * position.\n * @param line The line being translated.\n * @param trimRight Whether to trim whitespace to the right.\n * @param startCol The column to start at.\n * @param endCol The column to end at.\n */\n public translateBufferLineToString(lineIndex: number, trimRight: boolean, startCol: number = 0, endCol?: number): string {\n const line = this.lines.get(lineIndex);\n if (!line) {\n return '';\n }\n return line.translateToString(trimRight, startCol, endCol);\n }\n\n public getWrappedRangeForLine(y: number): { first: number, last: number } {\n let first = y;\n let last = y;\n // Scan upwards for wrapped lines\n while (first > 0 && this.lines.get(first)!.isWrapped) {\n first--;\n }\n // Scan downwards for wrapped lines\n while (last + 1 < this.lines.length && this.lines.get(last + 1)!.isWrapped) {\n last++;\n }\n return { first, last };\n }\n\n /**\n * Setup the tab stops.\n * @param i The index to start setting up tab stops from.\n */\n public setupTabStops(i?: number): void {\n if (i !== null && i !== undefined) {\n if (!this.tabs[i]) {\n i = this.prevStop(i);\n }\n } else {\n this.tabs = {};\n i = 0;\n }\n\n for (; i < this._cols; i += this._optionsService.rawOptions.tabStopWidth) {\n this.tabs[i] = true;\n }\n }\n\n /**\n * Move the cursor to the previous tab stop from the given position (default is current).\n * @param x The position to move the cursor to the previous tab stop.\n */\n public prevStop(x?: number): number {\n if (x === null || x === undefined) {\n x = this.x;\n }\n while (!this.tabs[--x] && x > 0);\n return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;\n }\n\n /**\n * Move the cursor one tab stop forward from the given position (default is current).\n * @param x The position to move the cursor one tab stop forward.\n */\n public nextStop(x?: number): number {\n if (x === null || x === undefined) {\n x = this.x;\n }\n while (!this.tabs[++x] && x < this._cols);\n return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;\n }\n\n /**\n * Clears markers on single line.\n * @param y The line to clear.\n */\n public clearMarkers(y: number): void {\n this._isClearing = true;\n for (let i = 0; i < this.markers.length; i++) {\n if (this.markers[i].line === y) {\n this.markers[i].dispose();\n this.markers.splice(i--, 1);\n }\n }\n this._isClearing = false;\n }\n\n /**\n * Clears markers on all lines\n */\n public clearAllMarkers(): void {\n this._isClearing = true;\n for (let i = 0; i < this.markers.length; i++) {\n this.markers[i].dispose();\n this.markers.splice(i--, 1);\n }\n this._isClearing = false;\n }\n\n public addMarker(y: number): Marker {\n const marker = new Marker(y);\n this.markers.push(marker);\n marker.register(this.lines.onTrim(amount => {\n marker.line -= amount;\n // The marker should be disposed when the line is trimmed from the buffer\n if (marker.line < 0) {\n marker.dispose();\n }\n }));\n marker.register(this.lines.onInsert(event => {\n if (marker.line >= event.index) {\n marker.line += event.amount;\n }\n }));\n marker.register(this.lines.onDelete(event => {\n // Delete the marker if it's within the range\n if (marker.line >= event.index && marker.line < event.index + event.amount) {\n marker.dispose();\n }\n\n // Shift the marker if it's after the deleted range\n if (marker.line > event.index) {\n marker.line -= event.amount;\n }\n }));\n marker.register(marker.onDispose(() => this._removeMarker(marker)));\n return marker;\n }\n\n private _removeMarker(marker: Marker): void {\n if (!this._isClearing) {\n this.markers.splice(this.markers.indexOf(marker), 1);\n }\n }\n\n public iterator(trimRight: boolean, startIndex?: number, endIndex?: number, startOverscan?: number, endOverscan?: number): IBufferStringIterator {\n return new BufferStringIterator(this, trimRight, startIndex, endIndex, startOverscan, endOverscan);\n }\n}\n\n/**\n * Iterator to get unwrapped content strings from the buffer.\n * The iterator returns at least the string data between the borders\n * `startIndex` and `endIndex` (exclusive) and will expand the lines\n * by `startOverscan` to the top and by `endOverscan` to the bottom,\n * if no new line was found in between.\n * It will never read/return string data beyond `startIndex - startOverscan`\n * or `endIndex + endOverscan`. Therefore the first and last line might be truncated.\n * It is possible to always get the full string for the first and last line as well\n * by setting the overscan values to the actual buffer length. This not recommended\n * since it might return the whole buffer within a single string in a worst case scenario.\n */\nexport class BufferStringIterator implements IBufferStringIterator {\n private _current: number;\n\n constructor(\n private _buffer: IBuffer,\n private _trimRight: boolean,\n private _startIndex: number = 0,\n private _endIndex: number = _buffer.lines.length,\n private _startOverscan: number = 0,\n private _endOverscan: number = 0\n ) {\n if (this._startIndex < 0) {\n this._startIndex = 0;\n }\n if (this._endIndex > this._buffer.lines.length) {\n this._endIndex = this._buffer.lines.length;\n }\n this._current = this._startIndex;\n }\n\n public hasNext(): boolean {\n return this._current < this._endIndex;\n }\n\n public next(): IBufferStringIteratorResult {\n const range = this._buffer.getWrappedRangeForLine(this._current);\n // limit search window to overscan value at both borders\n if (range.first < this._startIndex - this._startOverscan) {\n range.first = this._startIndex - this._startOverscan;\n }\n if (range.last > this._endIndex + this._endOverscan) {\n range.last = this._endIndex + this._endOverscan;\n }\n // limit to current buffer length\n range.first = Math.max(range.first, 0);\n range.last = Math.min(range.last, this._buffer.lines.length);\n let content = '';\n for (let i = range.first; i <= range.last; ++i) {\n content += this._buffer.translateBufferLineToString(i, this._trimRight);\n }\n this._current = range.last + 1;\n return { range, content };\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, IBufferLine, ICellData, IAttributeData, IExtendedAttrs } from 'common/Types';\nimport { stringFromCodePoint } from 'common/input/TextDecoder';\nimport { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Content, BgFlags } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';\n\n/**\n * buffer memory layout:\n *\n * | uint32_t | uint32_t | uint32_t |\n * | `content` | `FG` | `BG` |\n * | wcwidth(2) comb(1) codepoint(21) | flags(8) R(8) G(8) B(8) | flags(8) R(8) G(8) B(8) |\n */\n\n\n/** typed array slots taken by one cell */\nconst CELL_SIZE = 3;\n\n/**\n * Cell member indices.\n *\n * Direct access:\n * `content = data[column * CELL_SIZE + Cell.CONTENT];`\n * `fg = data[column * CELL_SIZE + Cell.FG];`\n * `bg = data[column * CELL_SIZE + Cell.BG];`\n */\nconst enum Cell {\n CONTENT = 0,\n FG = 1, // currently simply holds all known attrs\n BG = 2 // currently unused\n}\n\nexport const DEFAULT_ATTR_DATA = Object.freeze(new AttributeData());\n\n/**\n * Typed array based bufferline implementation.\n *\n * There are 2 ways to insert data into the cell buffer:\n * - `setCellFromCodepoint` + `addCodepointToCell`\n * Use these for data that is already UTF32.\n * Used during normal input in `InputHandler` for faster buffer access.\n * - `setCell`\n * This method takes a CellData object and stores the data in the buffer.\n * Use `CellData.fromCharData` to create the CellData object (e.g. from JS string).\n *\n * To retrieve data from the buffer use either one of the primitive methods\n * (if only one particular value is needed) or `loadCell`. For `loadCell` in a loop\n * memory allocs / GC pressure can be greatly reduced by reusing the CellData object.\n */\nexport class BufferLine implements IBufferLine {\n protected _data: Uint32Array;\n protected _combined: {[index: number]: string} = {};\n protected _extendedAttrs: {[index: number]: ExtendedAttrs} = {};\n public length: number;\n\n constructor(cols: number, fillCellData?: ICellData, public isWrapped: boolean = false) {\n this._data = new Uint32Array(cols * CELL_SIZE);\n const cell = fillCellData || CellData.fromCharData([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);\n for (let i = 0; i < cols; ++i) {\n this.setCell(i, cell);\n }\n this.length = cols;\n }\n\n /**\n * Get cell data CharData.\n * @deprecated\n */\n public get(index: number): CharData {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n const cp = content & Content.CODEPOINT_MASK;\n return [\n this._data[index * CELL_SIZE + Cell.FG],\n (content & Content.IS_COMBINED_MASK)\n ? this._combined[index]\n : (cp) ? stringFromCodePoint(cp) : '',\n content >> Content.WIDTH_SHIFT,\n (content & Content.IS_COMBINED_MASK)\n ? this._combined[index].charCodeAt(this._combined[index].length - 1)\n : cp\n ];\n }\n\n /**\n * Set cell data from CharData.\n * @deprecated\n */\n public set(index: number, value: CharData): void {\n this._data[index * CELL_SIZE + Cell.FG] = value[CHAR_DATA_ATTR_INDEX];\n if (value[CHAR_DATA_CHAR_INDEX].length > 1) {\n this._combined[index] = value[1];\n this._data[index * CELL_SIZE + Cell.CONTENT] = index | Content.IS_COMBINED_MASK | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n } else {\n this._data[index * CELL_SIZE + Cell.CONTENT] = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n }\n\n /**\n * primitive getters\n * use these when only one value is needed, otherwise use `loadCell`\n */\n public getWidth(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] >> Content.WIDTH_SHIFT;\n }\n\n /** Test whether content has width. */\n public hasWidth(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.WIDTH_MASK;\n }\n\n /** Get FG cell component. */\n public getFg(index: number): number {\n return this._data[index * CELL_SIZE + Cell.FG];\n }\n\n /** Get BG cell component. */\n public getBg(index: number): number {\n return this._data[index * CELL_SIZE + Cell.BG];\n }\n\n /**\n * Test whether contains any chars.\n * Basically an empty has no content, but other cells might differ in FG/BG\n * from real empty cells.\n * */\n public hasContent(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK;\n }\n\n /**\n * Get codepoint of the cell.\n * To be in line with `code` in CharData this either returns\n * a single UTF32 codepoint or the last codepoint of a combined string.\n */\n public getCodePoint(index: number): number {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n return this._combined[index].charCodeAt(this._combined[index].length - 1);\n }\n return content & Content.CODEPOINT_MASK;\n }\n\n /** Test whether the cell contains a combined string. */\n public isCombined(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.IS_COMBINED_MASK;\n }\n\n /** Returns the string content of the cell. */\n public getString(index: number): string {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n return this._combined[index];\n }\n if (content & Content.CODEPOINT_MASK) {\n return stringFromCodePoint(content & Content.CODEPOINT_MASK);\n }\n // return empty string for empty cells\n return '';\n }\n\n /**\n * Load data at `index` into `cell`. This is used to access cells in a way that's more friendly\n * to GC as it significantly reduced the amount of new objects/references needed.\n */\n public loadCell(index: number, cell: ICellData): ICellData {\n const startIndex = index * CELL_SIZE;\n cell.content = this._data[startIndex + Cell.CONTENT];\n cell.fg = this._data[startIndex + Cell.FG];\n cell.bg = this._data[startIndex + Cell.BG];\n if (cell.content & Content.IS_COMBINED_MASK) {\n cell.combinedData = this._combined[index];\n }\n if (cell.bg & BgFlags.HAS_EXTENDED) {\n cell.extended = this._extendedAttrs[index];\n }\n return cell;\n }\n\n /**\n * Set data at `index` to `cell`.\n */\n public setCell(index: number, cell: ICellData): void {\n if (cell.content & Content.IS_COMBINED_MASK) {\n this._combined[index] = cell.combinedData;\n }\n if (cell.bg & BgFlags.HAS_EXTENDED) {\n this._extendedAttrs[index] = cell.extended;\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = cell.content;\n this._data[index * CELL_SIZE + Cell.FG] = cell.fg;\n this._data[index * CELL_SIZE + Cell.BG] = cell.bg;\n }\n\n /**\n * Set cell data from input handler.\n * Since the input handler see the incoming chars as UTF32 codepoints,\n * it gets an optimized access method.\n */\n public setCellFromCodePoint(index: number, codePoint: number, width: number, fg: number, bg: number, eAttrs: IExtendedAttrs): void {\n if (bg & BgFlags.HAS_EXTENDED) {\n this._extendedAttrs[index] = eAttrs;\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = codePoint | (width << Content.WIDTH_SHIFT);\n this._data[index * CELL_SIZE + Cell.FG] = fg;\n this._data[index * CELL_SIZE + Cell.BG] = bg;\n }\n\n /**\n * Add a codepoint to a cell from input handler.\n * During input stage combining chars with a width of 0 follow and stack\n * onto a leading char. Since we already set the attrs\n * by the previous `setDataFromCodePoint` call, we can omit it here.\n */\n public addCodepointToCell(index: number, codePoint: number): void {\n let content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n // we already have a combined string, simply add\n this._combined[index] += stringFromCodePoint(codePoint);\n } else {\n if (content & Content.CODEPOINT_MASK) {\n // normal case for combining chars:\n // - move current leading char + new one into combined string\n // - set combined flag\n this._combined[index] = stringFromCodePoint(content & Content.CODEPOINT_MASK) + stringFromCodePoint(codePoint);\n content &= ~Content.CODEPOINT_MASK; // set codepoint in buffer to 0\n content |= Content.IS_COMBINED_MASK;\n } else {\n // should not happen - we actually have no data in the cell yet\n // simply set the data in the cell buffer with a width of 1\n content = codePoint | (1 << Content.WIDTH_SHIFT);\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = content;\n }\n }\n\n public insertCells(pos: number, n: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {\n pos %= this.length;\n\n // handle fullwidth at pos: reset cell one to the left if pos is second cell of a wide char\n if (pos && this.getWidth(pos - 1) === 2) {\n this.setCellFromCodePoint(pos - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n\n if (n < this.length - pos) {\n const cell = new CellData();\n for (let i = this.length - pos - n - 1; i >= 0; --i) {\n this.setCell(pos + n + i, this.loadCell(pos + i, cell));\n }\n for (let i = 0; i < n; ++i) {\n this.setCell(pos + i, fillCellData);\n }\n } else {\n for (let i = pos; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n // handle fullwidth at line end: reset last cell if it is first cell of a wide char\n if (this.getWidth(this.length - 1) === 2) {\n this.setCellFromCodePoint(this.length - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n }\n\n public deleteCells(pos: number, n: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {\n pos %= this.length;\n if (n < this.length - pos) {\n const cell = new CellData();\n for (let i = 0; i < this.length - pos - n; ++i) {\n this.setCell(pos + i, this.loadCell(pos + n + i, cell));\n }\n for (let i = this.length - n; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n } else {\n for (let i = pos; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n // handle fullwidth at pos:\n // - reset pos-1 if wide char\n // - reset pos if width==0 (previous second cell of a wide char)\n if (pos && this.getWidth(pos - 1) === 2) {\n this.setCellFromCodePoint(pos - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n if (this.getWidth(pos) === 0 && !this.hasContent(pos)) {\n this.setCellFromCodePoint(pos, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n }\n\n public replaceCells(start: number, end: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {\n // handle fullwidth at start: reset cell one to the left if start is second cell of a wide char\n if (start && this.getWidth(start - 1) === 2) {\n this.setCellFromCodePoint(start - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n // handle fullwidth at last cell + 1: reset to empty cell if it is second part of a wide char\n if (end < this.length && this.getWidth(end - 1) === 2) {\n this.setCellFromCodePoint(end, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n\n while (start < end && start < this.length) {\n this.setCell(start++, fillCellData);\n }\n }\n\n public resize(cols: number, fillCellData: ICellData): void {\n if (cols === this.length) {\n return;\n }\n if (cols > this.length) {\n const data = new Uint32Array(cols * CELL_SIZE);\n if (this.length) {\n if (cols * CELL_SIZE < this._data.length) {\n data.set(this._data.subarray(0, cols * CELL_SIZE));\n } else {\n data.set(this._data);\n }\n }\n this._data = data;\n for (let i = this.length; i < cols; ++i) {\n this.setCell(i, fillCellData);\n }\n } else {\n if (cols) {\n const data = new Uint32Array(cols * CELL_SIZE);\n data.set(this._data.subarray(0, cols * CELL_SIZE));\n this._data = data;\n // Remove any cut off combined data, FIXME: repeat this for extended attrs\n const keys = Object.keys(this._combined);\n for (let i = 0; i < keys.length; i++) {\n const key = parseInt(keys[i], 10);\n if (key >= cols) {\n delete this._combined[key];\n }\n }\n } else {\n this._data = new Uint32Array(0);\n this._combined = {};\n }\n }\n this.length = cols;\n }\n\n /** fill a line with fillCharData */\n public fill(fillCellData: ICellData): void {\n this._combined = {};\n this._extendedAttrs = {};\n for (let i = 0; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n /** alter to a full copy of line */\n public copyFrom(line: BufferLine): void {\n if (this.length !== line.length) {\n this._data = new Uint32Array(line._data);\n } else {\n // use high speed copy if lengths are equal\n this._data.set(line._data);\n }\n this.length = line.length;\n this._combined = {};\n for (const el in line._combined) {\n this._combined[el] = line._combined[el];\n }\n this._extendedAttrs = {};\n for (const el in line._extendedAttrs) {\n this._extendedAttrs[el] = line._extendedAttrs[el];\n }\n this.isWrapped = line.isWrapped;\n }\n\n /** create a new clone */\n public clone(): IBufferLine {\n const newLine = new BufferLine(0);\n newLine._data = new Uint32Array(this._data);\n newLine.length = this.length;\n for (const el in this._combined) {\n newLine._combined[el] = this._combined[el];\n }\n for (const el in this._extendedAttrs) {\n newLine._extendedAttrs[el] = this._extendedAttrs[el];\n }\n newLine.isWrapped = this.isWrapped;\n return newLine;\n }\n\n public getTrimmedLength(): number {\n for (let i = this.length - 1; i >= 0; --i) {\n if ((this._data[i * CELL_SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK)) {\n return i + (this._data[i * CELL_SIZE + Cell.CONTENT] >> Content.WIDTH_SHIFT);\n }\n }\n return 0;\n }\n\n public copyCellsFrom(src: BufferLine, srcCol: number, destCol: number, length: number, applyInReverse: boolean): void {\n const srcData = src._data;\n if (applyInReverse) {\n for (let cell = length - 1; cell >= 0; cell--) {\n for (let i = 0; i < CELL_SIZE; i++) {\n this._data[(destCol + cell) * CELL_SIZE + i] = srcData[(srcCol + cell) * CELL_SIZE + i];\n }\n }\n } else {\n for (let cell = 0; cell < length; cell++) {\n for (let i = 0; i < CELL_SIZE; i++) {\n this._data[(destCol + cell) * CELL_SIZE + i] = srcData[(srcCol + cell) * CELL_SIZE + i];\n }\n }\n }\n\n // Move any combined data over as needed, FIXME: repeat for extended attrs\n const srcCombinedKeys = Object.keys(src._combined);\n for (let i = 0; i < srcCombinedKeys.length; i++) {\n const key = parseInt(srcCombinedKeys[i], 10);\n if (key >= srcCol) {\n this._combined[key - srcCol + destCol] = src._combined[key];\n }\n }\n }\n\n public translateToString(trimRight: boolean = false, startCol: number = 0, endCol: number = this.length): string {\n if (trimRight) {\n endCol = Math.min(endCol, this.getTrimmedLength());\n }\n let result = '';\n while (startCol < endCol) {\n const content = this._data[startCol * CELL_SIZE + Cell.CONTENT];\n const cp = content & Content.CODEPOINT_MASK;\n result += (content & Content.IS_COMBINED_MASK) ? this._combined[startCol] : (cp) ? stringFromCodePoint(cp) : WHITESPACE_CELL_CHAR;\n startCol += (content >> Content.WIDTH_SHIFT) || 1; // always advance by 1\n }\n return result;\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferRange } from 'xterm';\n\nexport function getRangeLength(range: IBufferRange, bufferCols: number): number {\n if (range.start.y > range.end.y) {\n throw new Error(`Buffer range end (${range.end.x}, ${range.end.y}) cannot be before start (${range.start.x}, ${range.start.y})`);\n }\n return bufferCols * (range.end.y - range.start.y) + (range.end.x - range.start.x + 1);\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { BufferLine } from 'common/buffer/BufferLine';\nimport { CircularList } from 'common/CircularList';\nimport { IBufferLine, ICellData } from 'common/Types';\n\nexport interface INewLayoutResult {\n layout: number[];\n countRemoved: number;\n}\n\n/**\n * Evaluates and returns indexes to be removed after a reflow larger occurs. Lines will be removed\n * when a wrapped line unwraps.\n * @param lines The buffer lines.\n * @param newCols The columns after resize.\n */\nexport function reflowLargerGetLinesToRemove(lines: CircularList, oldCols: number, newCols: number, bufferAbsoluteY: number, nullCell: ICellData): number[] {\n // Gather all BufferLines that need to be removed from the Buffer here so that they can be\n // batched up and only committed once\n const toRemove: number[] = [];\n\n for (let y = 0; y < lines.length - 1; y++) {\n // Check if this row is wrapped\n let i = y;\n let nextLine = lines.get(++i) as BufferLine;\n if (!nextLine.isWrapped) {\n continue;\n }\n\n // Check how many lines it's wrapped for\n const wrappedLines: BufferLine[] = [lines.get(y) as BufferLine];\n while (i < lines.length && nextLine.isWrapped) {\n wrappedLines.push(nextLine);\n nextLine = lines.get(++i) as BufferLine;\n }\n\n // If these lines contain the cursor don't touch them, the program will handle fixing up wrapped\n // lines with the cursor\n if (bufferAbsoluteY >= y && bufferAbsoluteY < i) {\n y += wrappedLines.length - 1;\n continue;\n }\n\n // Copy buffer data to new locations\n let destLineIndex = 0;\n let destCol = getWrappedLineTrimmedLength(wrappedLines, destLineIndex, oldCols);\n let srcLineIndex = 1;\n let srcCol = 0;\n while (srcLineIndex < wrappedLines.length) {\n const srcTrimmedTineLength = getWrappedLineTrimmedLength(wrappedLines, srcLineIndex, oldCols);\n const srcRemainingCells = srcTrimmedTineLength - srcCol;\n const destRemainingCells = newCols - destCol;\n const cellsToCopy = Math.min(srcRemainingCells, destRemainingCells);\n\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[srcLineIndex], srcCol, destCol, cellsToCopy, false);\n\n destCol += cellsToCopy;\n if (destCol === newCols) {\n destLineIndex++;\n destCol = 0;\n }\n srcCol += cellsToCopy;\n if (srcCol === srcTrimmedTineLength) {\n srcLineIndex++;\n srcCol = 0;\n }\n\n // Make sure the last cell isn't wide, if it is copy it to the current dest\n if (destCol === 0 && destLineIndex !== 0) {\n if (wrappedLines[destLineIndex - 1].getWidth(newCols - 1) === 2) {\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[destLineIndex - 1], newCols - 1, destCol++, 1, false);\n // Null out the end of the last row\n wrappedLines[destLineIndex - 1].setCell(newCols - 1, nullCell);\n }\n }\n }\n\n // Clear out remaining cells or fragments could remain;\n wrappedLines[destLineIndex].replaceCells(destCol, newCols, nullCell);\n\n // Work backwards and remove any rows at the end that only contain null cells\n let countToRemove = 0;\n for (let i = wrappedLines.length - 1; i > 0; i--) {\n if (i > destLineIndex || wrappedLines[i].getTrimmedLength() === 0) {\n countToRemove++;\n } else {\n break;\n }\n }\n\n if (countToRemove > 0) {\n toRemove.push(y + wrappedLines.length - countToRemove); // index\n toRemove.push(countToRemove);\n }\n\n y += wrappedLines.length - 1;\n }\n return toRemove;\n}\n\n/**\n * Creates and return the new layout for lines given an array of indexes to be removed.\n * @param lines The buffer lines.\n * @param toRemove The indexes to remove.\n */\nexport function reflowLargerCreateNewLayout(lines: CircularList, toRemove: number[]): INewLayoutResult {\n const layout: number[] = [];\n // First iterate through the list and get the actual indexes to use for rows\n let nextToRemoveIndex = 0;\n let nextToRemoveStart = toRemove[nextToRemoveIndex];\n let countRemovedSoFar = 0;\n for (let i = 0; i < lines.length; i++) {\n if (nextToRemoveStart === i) {\n const countToRemove = toRemove[++nextToRemoveIndex];\n\n // Tell markers that there was a deletion\n lines.onDeleteEmitter.fire({\n index: i - countRemovedSoFar,\n amount: countToRemove\n });\n\n i += countToRemove - 1;\n countRemovedSoFar += countToRemove;\n nextToRemoveStart = toRemove[++nextToRemoveIndex];\n } else {\n layout.push(i);\n }\n }\n return {\n layout,\n countRemoved: countRemovedSoFar\n };\n}\n\n/**\n * Applies a new layout to the buffer. This essentially does the same as many splice calls but it's\n * done all at once in a single iteration through the list since splice is very expensive.\n * @param lines The buffer lines.\n * @param newLayout The new layout to apply.\n */\nexport function reflowLargerApplyNewLayout(lines: CircularList, newLayout: number[]): void {\n // Record original lines so they don't get overridden when we rearrange the list\n const newLayoutLines: BufferLine[] = [];\n for (let i = 0; i < newLayout.length; i++) {\n newLayoutLines.push(lines.get(newLayout[i]) as BufferLine);\n }\n\n // Rearrange the list\n for (let i = 0; i < newLayoutLines.length; i++) {\n lines.set(i, newLayoutLines[i]);\n }\n lines.length = newLayout.length;\n}\n\n/**\n * Gets the new line lengths for a given wrapped line. The purpose of this function it to pre-\n * compute the wrapping points since wide characters may need to be wrapped onto the following line.\n * This function will return an array of numbers of where each line wraps to, the resulting array\n * will only contain the values `newCols` (when the line does not end with a wide character) and\n * `newCols - 1` (when the line does end with a wide character), except for the last value which\n * will contain the remaining items to fill the line.\n *\n * Calling this with a `newCols` value of `1` will lock up.\n *\n * @param wrappedLines The wrapped lines to evaluate.\n * @param oldCols The columns before resize.\n * @param newCols The columns after resize.\n */\nexport function reflowSmallerGetNewLineLengths(wrappedLines: BufferLine[], oldCols: number, newCols: number): number[] {\n const newLineLengths: number[] = [];\n const cellsNeeded = wrappedLines.map((l, i) => getWrappedLineTrimmedLength(wrappedLines, i, oldCols)).reduce((p, c) => p + c);\n\n // Use srcCol and srcLine to find the new wrapping point, use that to get the cellsAvailable and\n // linesNeeded\n let srcCol = 0;\n let srcLine = 0;\n let cellsAvailable = 0;\n while (cellsAvailable < cellsNeeded) {\n if (cellsNeeded - cellsAvailable < newCols) {\n // Add the final line and exit the loop\n newLineLengths.push(cellsNeeded - cellsAvailable);\n break;\n }\n srcCol += newCols;\n const oldTrimmedLength = getWrappedLineTrimmedLength(wrappedLines, srcLine, oldCols);\n if (srcCol > oldTrimmedLength) {\n srcCol -= oldTrimmedLength;\n srcLine++;\n }\n const endsWithWide = wrappedLines[srcLine].getWidth(srcCol - 1) === 2;\n if (endsWithWide) {\n srcCol--;\n }\n const lineLength = endsWithWide ? newCols - 1 : newCols;\n newLineLengths.push(lineLength);\n cellsAvailable += lineLength;\n }\n\n return newLineLengths;\n}\n\nexport function getWrappedLineTrimmedLength(lines: BufferLine[], i: number, cols: number): number {\n // If this is the last row in the wrapped line, get the actual trimmed length\n if (i === lines.length - 1) {\n return lines[i].getTrimmedLength();\n }\n // Detect whether the following line starts with a wide character and the end of the current line\n // is null, if so then we can be pretty sure the null character should be excluded from the line\n // length]\n const endsInNull = !(lines[i].hasContent(cols - 1)) && lines[i].getWidth(cols - 1) === 1;\n const followingLineStartsWithWide = lines[i + 1].getWidth(0) === 2;\n if (endsInNull && followingLineStartsWithWide) {\n return cols - 1;\n }\n return cols;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer, IBufferSet } from 'common/buffer/Types';\nimport { IAttributeData } from 'common/Types';\nimport { Buffer } from 'common/buffer/Buffer';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IOptionsService, IBufferService } from 'common/services/Services';\nimport { Disposable } from 'common/Lifecycle';\n\n/**\n * The BufferSet represents the set of two buffers used by xterm terminals (normal and alt) and\n * provides also utilities for working with them.\n */\nexport class BufferSet extends Disposable implements IBufferSet {\n private _normal!: Buffer;\n private _alt!: Buffer;\n private _activeBuffer!: Buffer;\n\n private _onBufferActivate = this.register(new EventEmitter<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}>());\n public get onBufferActivate(): IEvent<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}> { return this._onBufferActivate.event; }\n\n /**\n * Create a new BufferSet for the given terminal.\n * @param _terminal - The terminal the BufferSet will belong to\n */\n constructor(\n private readonly _optionsService: IOptionsService,\n private readonly _bufferService: IBufferService\n ) {\n super();\n this.reset();\n }\n\n public reset(): void {\n this._normal = new Buffer(true, this._optionsService, this._bufferService);\n this._normal.fillViewportRows();\n\n // The alt buffer should never have scrollback.\n // See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer\n this._alt = new Buffer(false, this._optionsService, this._bufferService);\n this._activeBuffer = this._normal;\n this._onBufferActivate.fire({\n activeBuffer: this._normal,\n inactiveBuffer: this._alt\n });\n\n this.setupTabStops();\n }\n\n /**\n * Returns the alt Buffer of the BufferSet\n */\n public get alt(): Buffer {\n return this._alt;\n }\n\n /**\n * Returns the normal Buffer of the BufferSet\n */\n public get active(): Buffer {\n return this._activeBuffer;\n }\n\n /**\n * Returns the currently active Buffer of the BufferSet\n */\n public get normal(): Buffer {\n return this._normal;\n }\n\n /**\n * Sets the normal Buffer of the BufferSet as its currently active Buffer\n */\n public activateNormalBuffer(): void {\n if (this._activeBuffer === this._normal) {\n return;\n }\n this._normal.x = this._alt.x;\n this._normal.y = this._alt.y;\n // The alt buffer should always be cleared when we switch to the normal\n // buffer. This frees up memory since the alt buffer should always be new\n // when activated.\n this._alt.clear();\n this._activeBuffer = this._normal;\n this._onBufferActivate.fire({\n activeBuffer: this._normal,\n inactiveBuffer: this._alt\n });\n }\n\n /**\n * Sets the alt Buffer of the BufferSet as its currently active Buffer\n */\n public activateAltBuffer(fillAttr?: IAttributeData): void {\n if (this._activeBuffer === this._alt) {\n return;\n }\n // Since the alt buffer is always cleared when the normal buffer is\n // activated, we want to fill it when switching to it.\n this._alt.fillViewportRows(fillAttr);\n this._alt.x = this._normal.x;\n this._alt.y = this._normal.y;\n this._activeBuffer = this._alt;\n this._onBufferActivate.fire({\n activeBuffer: this._alt,\n inactiveBuffer: this._normal\n });\n }\n\n /**\n * Resizes both normal and alt buffers, adjusting their data accordingly.\n * @param newCols The new number of columns.\n * @param newRows The new number of rows.\n */\n public resize(newCols: number, newRows: number): void {\n this._normal.resize(newCols, newRows);\n this._alt.resize(newCols, newRows);\n }\n\n /**\n * Setup the tab stops.\n * @param i The index to start setting up tab stops from.\n */\n public setupTabStops(i?: number): void {\n this._normal.setupTabStops(i);\n this._alt.setupTabStops(i);\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, ICellData, IExtendedAttrs } from 'common/Types';\nimport { stringFromCodePoint } from 'common/input/TextDecoder';\nimport { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, Content } from 'common/buffer/Constants';\nimport { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';\n\n/**\n * CellData - represents a single Cell in the terminal buffer.\n */\nexport class CellData extends AttributeData implements ICellData {\n /** Helper to create CellData from CharData. */\n public static fromCharData(value: CharData): CellData {\n const obj = new CellData();\n obj.setFromCharData(value);\n return obj;\n }\n /** Primitives from terminal buffer. */\n public content = 0;\n public fg = 0;\n public bg = 0;\n public extended: IExtendedAttrs = new ExtendedAttrs();\n public combinedData = '';\n /** Whether cell contains a combined string. */\n public isCombined(): number {\n return this.content & Content.IS_COMBINED_MASK;\n }\n /** Width of the cell. */\n public getWidth(): number {\n return this.content >> Content.WIDTH_SHIFT;\n }\n /** JS string of the content. */\n public getChars(): string {\n if (this.content & Content.IS_COMBINED_MASK) {\n return this.combinedData;\n }\n if (this.content & Content.CODEPOINT_MASK) {\n return stringFromCodePoint(this.content & Content.CODEPOINT_MASK);\n }\n return '';\n }\n /**\n * Codepoint of cell\n * Note this returns the UTF32 codepoint of single chars,\n * if content is a combined string it returns the codepoint\n * of the last char in string to be in line with code in CharData.\n * */\n public getCode(): number {\n return (this.isCombined())\n ? this.combinedData.charCodeAt(this.combinedData.length - 1)\n : this.content & Content.CODEPOINT_MASK;\n }\n /** Set data from CharData */\n public setFromCharData(value: CharData): void {\n this.fg = value[CHAR_DATA_ATTR_INDEX];\n this.bg = 0;\n let combined = false;\n // surrogates and combined strings need special treatment\n if (value[CHAR_DATA_CHAR_INDEX].length > 2) {\n combined = true;\n }\n else if (value[CHAR_DATA_CHAR_INDEX].length === 2) {\n const code = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0);\n // if the 2-char string is a surrogate create single codepoint\n // everything else is combined\n if (0xD800 <= code && code <= 0xDBFF) {\n const second = value[CHAR_DATA_CHAR_INDEX].charCodeAt(1);\n if (0xDC00 <= second && second <= 0xDFFF) {\n this.content = ((code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n else {\n combined = true;\n }\n }\n else {\n combined = true;\n }\n }\n else {\n this.content = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n if (combined) {\n this.combinedData = value[CHAR_DATA_CHAR_INDEX];\n this.content = Content.IS_COMBINED_MASK | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n }\n /** Get data as CharData. */\n public getAsCharData(): CharData {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport const DEFAULT_COLOR = 256;\nexport const DEFAULT_ATTR = (0 << 18) | (DEFAULT_COLOR << 9) | (256 << 0);\n\nexport const CHAR_DATA_ATTR_INDEX = 0;\nexport const CHAR_DATA_CHAR_INDEX = 1;\nexport const CHAR_DATA_WIDTH_INDEX = 2;\nexport const CHAR_DATA_CODE_INDEX = 3;\n\n/**\n * Null cell - a real empty cell (containing nothing).\n * Note that code should always be 0 for a null cell as\n * several test condition of the buffer line rely on this.\n */\nexport const NULL_CELL_CHAR = '';\nexport const NULL_CELL_WIDTH = 1;\nexport const NULL_CELL_CODE = 0;\n\n/**\n * Whitespace cell.\n * This is meant as a replacement for empty cells when needed\n * during rendering lines to preserve correct aligment.\n */\nexport const WHITESPACE_CELL_CHAR = ' ';\nexport const WHITESPACE_CELL_WIDTH = 1;\nexport const WHITESPACE_CELL_CODE = 32;\n\n/**\n * Bitmasks for accessing data in `content`.\n */\nexport const enum Content {\n /**\n * bit 1..21 codepoint, max allowed in UTF32 is 0x10FFFF (21 bits taken)\n * read: `codepoint = content & Content.codepointMask;`\n * write: `content |= codepoint & Content.codepointMask;`\n * shortcut if precondition `codepoint <= 0x10FFFF` is met:\n * `content |= codepoint;`\n */\n CODEPOINT_MASK = 0x1FFFFF,\n\n /**\n * bit 22 flag indication whether a cell contains combined content\n * read: `isCombined = content & Content.isCombined;`\n * set: `content |= Content.isCombined;`\n * clear: `content &= ~Content.isCombined;`\n */\n IS_COMBINED_MASK = 0x200000, // 1 << 21\n\n /**\n * bit 1..22 mask to check whether a cell contains any string data\n * we need to check for codepoint and isCombined bits to see\n * whether a cell contains anything\n * read: `isEmpty = !(content & Content.hasContent)`\n */\n HAS_CONTENT_MASK = 0x3FFFFF,\n\n /**\n * bit 23..24 wcwidth value of cell, takes 2 bits (ranges from 0..2)\n * read: `width = (content & Content.widthMask) >> Content.widthShift;`\n * `hasWidth = content & Content.widthMask;`\n * as long as wcwidth is highest value in `content`:\n * `width = content >> Content.widthShift;`\n * write: `content |= (width << Content.widthShift) & Content.widthMask;`\n * shortcut if precondition `0 <= width <= 3` is met:\n * `content |= width << Content.widthShift;`\n */\n WIDTH_MASK = 0xC00000, // 3 << 22\n WIDTH_SHIFT = 22\n}\n\nexport const enum Attributes {\n /**\n * bit 1..8 blue in RGB, color in P256 and P16\n */\n BLUE_MASK = 0xFF,\n BLUE_SHIFT = 0,\n PCOLOR_MASK = 0xFF,\n PCOLOR_SHIFT = 0,\n\n /**\n * bit 9..16 green in RGB\n */\n GREEN_MASK = 0xFF00,\n GREEN_SHIFT = 8,\n\n /**\n * bit 17..24 red in RGB\n */\n RED_MASK = 0xFF0000,\n RED_SHIFT = 16,\n\n /**\n * bit 25..26 color mode: DEFAULT (0) | P16 (1) | P256 (2) | RGB (3)\n */\n CM_MASK = 0x3000000,\n CM_DEFAULT = 0,\n CM_P16 = 0x1000000,\n CM_P256 = 0x2000000,\n CM_RGB = 0x3000000,\n\n /**\n * bit 1..24 RGB room\n */\n RGB_MASK = 0xFFFFFF\n}\n\nexport const enum FgFlags {\n /**\n * bit 27..32\n */\n INVERSE = 0x4000000,\n BOLD = 0x8000000,\n UNDERLINE = 0x10000000,\n BLINK = 0x20000000,\n INVISIBLE = 0x40000000,\n STRIKETHROUGH = 0x80000000,\n}\n\nexport const enum BgFlags {\n /**\n * bit 27..32 (upper 3 unused)\n */\n ITALIC = 0x4000000,\n DIM = 0x8000000,\n HAS_EXTENDED = 0x10000000\n}\n\nexport const enum UnderlineStyle {\n NONE = 0,\n SINGLE = 1,\n DOUBLE = 2,\n CURLY = 3,\n DOTTED = 4,\n DASHED = 5\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { IMarker } from 'common/Types';\n\nexport class Marker extends Disposable implements IMarker {\n private static _nextId = 1;\n\n private _id: number = Marker._nextId++;\n public isDisposed: boolean = false;\n\n public get id(): number { return this._id; }\n\n private _onDispose = new EventEmitter();\n public get onDispose(): IEvent { return this._onDispose.event; }\n\n constructor(\n public line: number\n ) {\n super();\n }\n\n public dispose(): void {\n if (this.isDisposed) {\n return;\n }\n this.isDisposed = true;\n this.line = -1;\n // Emit before super.dispose such that dispose listeners get a change to react\n this._onDispose.fire();\n super.dispose();\n }\n}\n", "/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharset } from 'common/Types';\n\n/**\n * The character sets supported by the terminal. These enable several languages\n * to be represented within the terminal with only 8-bit encoding. See ISO 2022\n * for a discussion on character sets. Only VT100 character sets are supported.\n */\nexport const CHARSETS: { [key: string]: ICharset | undefined } = {};\n\n/**\n * The default character set, US.\n */\nexport const DEFAULT_CHARSET: ICharset | undefined = CHARSETS['B'];\n\n/**\n * DEC Special Character and Line Drawing Set.\n * Reference: http://vt100.net/docs/vt102-ug/table5-13.html\n * A lot of curses apps use this if they see TERM=xterm.\n * testing: echo -e '\\e(0a\\e(B'\n * The xterm output sometimes seems to conflict with the\n * reference above. xterm seems in line with the reference\n * when running vttest however.\n * The table below now uses xterm's output from vttest.\n */\nCHARSETS['0'] = {\n '`': '\\u25c6', // '◆'\n 'a': '\\u2592', // '▒'\n 'b': '\\u2409', // '␉' (HT)\n 'c': '\\u240c', // '␌' (FF)\n 'd': '\\u240d', // '␍' (CR)\n 'e': '\\u240a', // '␊' (LF)\n 'f': '\\u00b0', // '°'\n 'g': '\\u00b1', // '±'\n 'h': '\\u2424', // '␤' (NL)\n 'i': '\\u240b', // '␋' (VT)\n 'j': '\\u2518', // '┘'\n 'k': '\\u2510', // '┐'\n 'l': '\\u250c', // '┌'\n 'm': '\\u2514', // '└'\n 'n': '\\u253c', // '┼'\n 'o': '\\u23ba', // '⎺'\n 'p': '\\u23bb', // '⎻'\n 'q': '\\u2500', // '─'\n 'r': '\\u23bc', // '⎼'\n 's': '\\u23bd', // '⎽'\n 't': '\\u251c', // '├'\n 'u': '\\u2524', // '┤'\n 'v': '\\u2534', // '┴'\n 'w': '\\u252c', // '┬'\n 'x': '\\u2502', // '│'\n 'y': '\\u2264', // '≤'\n 'z': '\\u2265', // '≥'\n '{': '\\u03c0', // 'π'\n '|': '\\u2260', // '≠'\n '}': '\\u00a3', // '£'\n '~': '\\u00b7' // '·'\n};\n\n/**\n * British character set\n * ESC (A\n * Reference: http://vt100.net/docs/vt220-rm/table2-5.html\n */\nCHARSETS['A'] = {\n '#': '£'\n};\n\n/**\n * United States character set\n * ESC (B\n */\nCHARSETS['B'] = undefined;\n\n/**\n * Dutch character set\n * ESC (4\n * Reference: http://vt100.net/docs/vt220-rm/table2-6.html\n */\nCHARSETS['4'] = {\n '#': '£',\n '@': '¾',\n '[': 'ij',\n '\\\\': '½',\n ']': '|',\n '{': '¨',\n '|': 'f',\n '}': '¼',\n '~': '´'\n};\n\n/**\n * Finnish character set\n * ESC (C or ESC (5\n * Reference: http://vt100.net/docs/vt220-rm/table2-7.html\n */\nCHARSETS['C'] =\nCHARSETS['5'] = {\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Å',\n '^': 'Ü',\n '`': 'é',\n '{': 'ä',\n '|': 'ö',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * French character set\n * ESC (R\n * Reference: http://vt100.net/docs/vt220-rm/table2-8.html\n */\nCHARSETS['R'] = {\n '#': '£',\n '@': 'à',\n '[': '°',\n '\\\\': 'ç',\n ']': '§',\n '{': 'é',\n '|': 'ù',\n '}': 'è',\n '~': '¨'\n};\n\n/**\n * French Canadian character set\n * ESC (Q\n * Reference: http://vt100.net/docs/vt220-rm/table2-9.html\n */\nCHARSETS['Q'] = {\n '@': 'à',\n '[': 'â',\n '\\\\': 'ç',\n ']': 'ê',\n '^': 'î',\n '`': 'ô',\n '{': 'é',\n '|': 'ù',\n '}': 'è',\n '~': 'û'\n};\n\n/**\n * German character set\n * ESC (K\n * Reference: http://vt100.net/docs/vt220-rm/table2-10.html\n */\nCHARSETS['K'] = {\n '@': '§',\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Ü',\n '{': 'ä',\n '|': 'ö',\n '}': 'ü',\n '~': 'ß'\n};\n\n/**\n * Italian character set\n * ESC (Y\n * Reference: http://vt100.net/docs/vt220-rm/table2-11.html\n */\nCHARSETS['Y'] = {\n '#': '£',\n '@': '§',\n '[': '°',\n '\\\\': 'ç',\n ']': 'é',\n '`': 'ù',\n '{': 'à',\n '|': 'ò',\n '}': 'è',\n '~': 'ì'\n};\n\n/**\n * Norwegian/Danish character set\n * ESC (E or ESC (6\n * Reference: http://vt100.net/docs/vt220-rm/table2-12.html\n */\nCHARSETS['E'] =\nCHARSETS['6'] = {\n '@': 'Ä',\n '[': 'Æ',\n '\\\\': 'Ø',\n ']': 'Å',\n '^': 'Ü',\n '`': 'ä',\n '{': 'æ',\n '|': 'ø',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * Spanish character set\n * ESC (Z\n * Reference: http://vt100.net/docs/vt220-rm/table2-13.html\n */\nCHARSETS['Z'] = {\n '#': '£',\n '@': '§',\n '[': '¡',\n '\\\\': 'Ñ',\n ']': '¿',\n '{': '°',\n '|': 'ñ',\n '}': 'ç'\n};\n\n/**\n * Swedish character set\n * ESC (H or ESC (7\n * Reference: http://vt100.net/docs/vt220-rm/table2-14.html\n */\nCHARSETS['H'] =\nCHARSETS['7'] = {\n '@': 'É',\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Å',\n '^': 'Ü',\n '`': 'é',\n '{': 'ä',\n '|': 'ö',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * Swiss character set\n * ESC (=\n * Reference: http://vt100.net/docs/vt220-rm/table2-15.html\n */\nCHARSETS['='] = {\n '#': 'ù',\n '@': 'à',\n '[': 'é',\n '\\\\': 'ç',\n ']': 'ê',\n '^': 'î',\n // eslint-disable-next-line @typescript-eslint/naming-convention\n '_': 'è',\n '`': 'ô',\n '{': 'ä',\n '|': 'ö',\n '}': 'ü',\n '~': 'û'\n};\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * C0 control codes\n * See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes\n */\nexport namespace C0 {\n /** Null (Caret = ^@, C = \\0) */\n export const NUL = '\\x00';\n /** Start of Heading (Caret = ^A) */\n export const SOH = '\\x01';\n /** Start of Text (Caret = ^B) */\n export const STX = '\\x02';\n /** End of Text (Caret = ^C) */\n export const ETX = '\\x03';\n /** End of Transmission (Caret = ^D) */\n export const EOT = '\\x04';\n /** Enquiry (Caret = ^E) */\n export const ENQ = '\\x05';\n /** Acknowledge (Caret = ^F) */\n export const ACK = '\\x06';\n /** Bell (Caret = ^G, C = \\a) */\n export const BEL = '\\x07';\n /** Backspace (Caret = ^H, C = \\b) */\n export const BS = '\\x08';\n /** Character Tabulation, Horizontal Tabulation (Caret = ^I, C = \\t) */\n export const HT = '\\x09';\n /** Line Feed (Caret = ^J, C = \\n) */\n export const LF = '\\x0a';\n /** Line Tabulation, Vertical Tabulation (Caret = ^K, C = \\v) */\n export const VT = '\\x0b';\n /** Form Feed (Caret = ^L, C = \\f) */\n export const FF = '\\x0c';\n /** Carriage Return (Caret = ^M, C = \\r) */\n export const CR = '\\x0d';\n /** Shift Out (Caret = ^N) */\n export const SO = '\\x0e';\n /** Shift In (Caret = ^O) */\n export const SI = '\\x0f';\n /** Data Link Escape (Caret = ^P) */\n export const DLE = '\\x10';\n /** Device Control One (XON) (Caret = ^Q) */\n export const DC1 = '\\x11';\n /** Device Control Two (Caret = ^R) */\n export const DC2 = '\\x12';\n /** Device Control Three (XOFF) (Caret = ^S) */\n export const DC3 = '\\x13';\n /** Device Control Four (Caret = ^T) */\n export const DC4 = '\\x14';\n /** Negative Acknowledge (Caret = ^U) */\n export const NAK = '\\x15';\n /** Synchronous Idle (Caret = ^V) */\n export const SYN = '\\x16';\n /** End of Transmission Block (Caret = ^W) */\n export const ETB = '\\x17';\n /** Cancel (Caret = ^X) */\n export const CAN = '\\x18';\n /** End of Medium (Caret = ^Y) */\n export const EM = '\\x19';\n /** Substitute (Caret = ^Z) */\n export const SUB = '\\x1a';\n /** Escape (Caret = ^[, C = \\e) */\n export const ESC = '\\x1b';\n /** File Separator (Caret = ^\\) */\n export const FS = '\\x1c';\n /** Group Separator (Caret = ^]) */\n export const GS = '\\x1d';\n /** Record Separator (Caret = ^^) */\n export const RS = '\\x1e';\n /** Unit Separator (Caret = ^_) */\n export const US = '\\x1f';\n /** Space */\n export const SP = '\\x20';\n /** Delete (Caret = ^?) */\n export const DEL = '\\x7f';\n}\n\n/**\n * C1 control codes\n * See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes\n */\nexport namespace C1 {\n /** padding character */\n export const PAD = '\\x80';\n /** High Octet Preset */\n export const HOP = '\\x81';\n /** Break Permitted Here */\n export const BPH = '\\x82';\n /** No Break Here */\n export const NBH = '\\x83';\n /** Index */\n export const IND = '\\x84';\n /** Next Line */\n export const NEL = '\\x85';\n /** Start of Selected Area */\n export const SSA = '\\x86';\n /** End of Selected Area */\n export const ESA = '\\x87';\n /** Horizontal Tabulation Set */\n export const HTS = '\\x88';\n /** Horizontal Tabulation With Justification */\n export const HTJ = '\\x89';\n /** Vertical Tabulation Set */\n export const VTS = '\\x8a';\n /** Partial Line Down */\n export const PLD = '\\x8b';\n /** Partial Line Up */\n export const PLU = '\\x8c';\n /** Reverse Index */\n export const RI = '\\x8d';\n /** Single-Shift 2 */\n export const SS2 = '\\x8e';\n /** Single-Shift 3 */\n export const SS3 = '\\x8f';\n /** Device Control String */\n export const DCS = '\\x90';\n /** Private Use 1 */\n export const PU1 = '\\x91';\n /** Private Use 2 */\n export const PU2 = '\\x92';\n /** Set Transmit State */\n export const STS = '\\x93';\n /** Destructive backspace, intended to eliminate ambiguity about meaning of BS. */\n export const CCH = '\\x94';\n /** Message Waiting */\n export const MW = '\\x95';\n /** Start of Protected Area */\n export const SPA = '\\x96';\n /** End of Protected Area */\n export const EPA = '\\x97';\n /** Start of String */\n export const SOS = '\\x98';\n /** Single Graphic Character Introducer */\n export const SGCI = '\\x99';\n /** Single Character Introducer */\n export const SCI = '\\x9a';\n /** Control Sequence Introducer */\n export const CSI = '\\x9b';\n /** String Terminator */\n export const ST = '\\x9c';\n /** Operating System Command */\n export const OSC = '\\x9d';\n /** Privacy Message */\n export const PM = '\\x9e';\n /** Application Program Command */\n export const APC = '\\x9f';\n}\nexport namespace C1_ESCAPED {\n export const ST = `${C0.ESC}\\\\`;\n}\n", "/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n */\n\nimport { IKeyboardEvent, IKeyboardResult, KeyboardResultType } from 'common/Types';\nimport { C0 } from 'common/data/EscapeSequences';\n\n// reg + shift key mappings for digits and special chars\nconst KEYCODE_KEY_MAPPINGS: { [key: number]: [string, string]} = {\n // digits 0-9\n 48: ['0', ')'],\n 49: ['1', '!'],\n 50: ['2', '@'],\n 51: ['3', '#'],\n 52: ['4', '$'],\n 53: ['5', '%'],\n 54: ['6', '^'],\n 55: ['7', '&'],\n 56: ['8', '*'],\n 57: ['9', '('],\n\n // special chars\n 186: [';', ':'],\n 187: ['=', '+'],\n 188: [',', '<'],\n 189: ['-', '_'],\n 190: ['.', '>'],\n 191: ['/', '?'],\n 192: ['`', '~'],\n 219: ['[', '{'],\n 220: ['\\\\', '|'],\n 221: [']', '}'],\n 222: ['\\'', '\"']\n};\n\nexport function evaluateKeyboardEvent(\n ev: IKeyboardEvent,\n applicationCursorMode: boolean,\n isMac: boolean,\n macOptionIsMeta: boolean\n): IKeyboardResult {\n const result: IKeyboardResult = {\n type: KeyboardResultType.SEND_KEY,\n // Whether to cancel event propagation (NOTE: this may not be needed since the event is\n // canceled at the end of keyDown\n cancel: false,\n // The new key even to emit\n key: undefined\n };\n const modifiers = (ev.shiftKey ? 1 : 0) | (ev.altKey ? 2 : 0) | (ev.ctrlKey ? 4 : 0) | (ev.metaKey ? 8 : 0);\n switch (ev.keyCode) {\n case 0:\n if (ev.key === 'UIKeyInputUpArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OA';\n } else {\n result.key = C0.ESC + '[A';\n }\n }\n else if (ev.key === 'UIKeyInputLeftArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OD';\n } else {\n result.key = C0.ESC + '[D';\n }\n }\n else if (ev.key === 'UIKeyInputRightArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OC';\n } else {\n result.key = C0.ESC + '[C';\n }\n }\n else if (ev.key === 'UIKeyInputDownArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OB';\n } else {\n result.key = C0.ESC + '[B';\n }\n }\n break;\n case 8:\n // backspace\n if (ev.shiftKey) {\n result.key = C0.BS; // ^H\n break;\n } else if (ev.altKey) {\n result.key = C0.ESC + C0.DEL; // \\e ^?\n break;\n }\n result.key = C0.DEL; // ^?\n break;\n case 9:\n // tab\n if (ev.shiftKey) {\n result.key = C0.ESC + '[Z';\n break;\n }\n result.key = C0.HT;\n result.cancel = true;\n break;\n case 13:\n // return/enter\n result.key = ev.altKey ? C0.ESC + C0.CR : C0.CR;\n result.cancel = true;\n break;\n case 27:\n // escape\n result.key = C0.ESC;\n if (ev.altKey) {\n result.key = C0.ESC + C0.ESC;\n }\n result.cancel = true;\n break;\n case 37:\n // left-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'D';\n // HACK: Make Alt + left-arrow behave like Ctrl + left-arrow: move one word backwards\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (result.key === C0.ESC + '[1;3D') {\n result.key = C0.ESC + (isMac ? 'b' : '[1;5D');\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OD';\n } else {\n result.key = C0.ESC + '[D';\n }\n break;\n case 39:\n // right-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'C';\n // HACK: Make Alt + right-arrow behave like Ctrl + right-arrow: move one word forward\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (result.key === C0.ESC + '[1;3C') {\n result.key = C0.ESC + (isMac ? 'f' : '[1;5C');\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OC';\n } else {\n result.key = C0.ESC + '[C';\n }\n break;\n case 38:\n // up-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'A';\n // HACK: Make Alt + up-arrow behave like Ctrl + up-arrow\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (!isMac && result.key === C0.ESC + '[1;3A') {\n result.key = C0.ESC + '[1;5A';\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OA';\n } else {\n result.key = C0.ESC + '[A';\n }\n break;\n case 40:\n // down-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'B';\n // HACK: Make Alt + down-arrow behave like Ctrl + down-arrow\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (!isMac && result.key === C0.ESC + '[1;3B') {\n result.key = C0.ESC + '[1;5B';\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OB';\n } else {\n result.key = C0.ESC + '[B';\n }\n break;\n case 45:\n // insert\n if (!ev.shiftKey && !ev.ctrlKey) {\n // or + are used to\n // copy-paste on some systems.\n result.key = C0.ESC + '[2~';\n }\n break;\n case 46:\n // delete\n if (modifiers) {\n result.key = C0.ESC + '[3;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[3~';\n }\n break;\n case 36:\n // home\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'H';\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OH';\n } else {\n result.key = C0.ESC + '[H';\n }\n break;\n case 35:\n // end\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'F';\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OF';\n } else {\n result.key = C0.ESC + '[F';\n }\n break;\n case 33:\n // page up\n if (ev.shiftKey) {\n result.type = KeyboardResultType.PAGE_UP;\n } else if (ev.ctrlKey) {\n result.key = C0.ESC + '[5;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[5~';\n }\n break;\n case 34:\n // page down\n if (ev.shiftKey) {\n result.type = KeyboardResultType.PAGE_DOWN;\n } else if (ev.ctrlKey) {\n result.key = C0.ESC + '[6;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[6~';\n }\n break;\n case 112:\n // F1-F12\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'P';\n } else {\n result.key = C0.ESC + 'OP';\n }\n break;\n case 113:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'Q';\n } else {\n result.key = C0.ESC + 'OQ';\n }\n break;\n case 114:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'R';\n } else {\n result.key = C0.ESC + 'OR';\n }\n break;\n case 115:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'S';\n } else {\n result.key = C0.ESC + 'OS';\n }\n break;\n case 116:\n if (modifiers) {\n result.key = C0.ESC + '[15;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[15~';\n }\n break;\n case 117:\n if (modifiers) {\n result.key = C0.ESC + '[17;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[17~';\n }\n break;\n case 118:\n if (modifiers) {\n result.key = C0.ESC + '[18;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[18~';\n }\n break;\n case 119:\n if (modifiers) {\n result.key = C0.ESC + '[19;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[19~';\n }\n break;\n case 120:\n if (modifiers) {\n result.key = C0.ESC + '[20;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[20~';\n }\n break;\n case 121:\n if (modifiers) {\n result.key = C0.ESC + '[21;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[21~';\n }\n break;\n case 122:\n if (modifiers) {\n result.key = C0.ESC + '[23;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[23~';\n }\n break;\n case 123:\n if (modifiers) {\n result.key = C0.ESC + '[24;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[24~';\n }\n break;\n default:\n // a-z and space\n if (ev.ctrlKey && !ev.shiftKey && !ev.altKey && !ev.metaKey) {\n if (ev.keyCode >= 65 && ev.keyCode <= 90) {\n result.key = String.fromCharCode(ev.keyCode - 64);\n } else if (ev.keyCode === 32) {\n result.key = C0.NUL;\n } else if (ev.keyCode >= 51 && ev.keyCode <= 55) {\n // escape, file sep, group sep, record sep, unit sep\n result.key = String.fromCharCode(ev.keyCode - 51 + 27);\n } else if (ev.keyCode === 56) {\n result.key = C0.DEL;\n } else if (ev.keyCode === 219) {\n result.key = C0.ESC;\n } else if (ev.keyCode === 220) {\n result.key = C0.FS;\n } else if (ev.keyCode === 221) {\n result.key = C0.GS;\n }\n } else if ((!isMac || macOptionIsMeta) && ev.altKey && !ev.metaKey) {\n // On macOS this is a third level shift when !macOptionIsMeta. Use instead.\n const keyMapping = KEYCODE_KEY_MAPPINGS[ev.keyCode];\n const key = keyMapping?.[!ev.shiftKey ? 0 : 1];\n if (key) {\n result.key = C0.ESC + key;\n } else if (ev.keyCode >= 65 && ev.keyCode <= 90) {\n const keyCode = ev.ctrlKey ? ev.keyCode - 64 : ev.keyCode + 32;\n let keyString = String.fromCharCode(keyCode);\n if (ev.shiftKey) {\n keyString = keyString.toUpperCase();\n }\n result.key = C0.ESC + keyString;\n } else if (ev.key === 'Dead' && ev.code.startsWith('Key')) {\n // Reference: https://github.com/xtermjs/xterm.js/issues/3725\n // Alt will produce a \"dead key\" (initate composition) with some\n // of the letters in US layout (e.g. N/E/U).\n // It's safe to match against Key* since no other `code` values begin with \"Key\".\n // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values#code_values_on_mac\n let keyString = ev.code.slice(3, 4);\n if (!ev.shiftKey) {\n keyString = keyString.toLowerCase();\n }\n result.key = C0.ESC + keyString;\n result.cancel = true;\n }\n } else if (isMac && !ev.altKey && !ev.ctrlKey && !ev.shiftKey && ev.metaKey) {\n if (ev.keyCode === 65) { // cmd + a\n result.type = KeyboardResultType.SELECT_ALL;\n }\n } else if (ev.key && !ev.ctrlKey && !ev.altKey && !ev.metaKey && ev.keyCode >= 48 && ev.key.length === 1) {\n // Include only keys that that result in a _single_ character; don't include num lock, volume up, etc.\n result.key = ev.key;\n } else if (ev.key && ev.ctrlKey) {\n if (ev.key === '_') { // ^_\n result.key = C0.US;\n }\n if (ev.key === '@') { // ^ + shift + 2 = ^ + @\n result.key = C0.NUL;\n }\n }\n break;\n }\n\n return result;\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * Polyfill - Convert UTF32 codepoint into JS string.\n * Note: The built-in String.fromCodePoint happens to be much slower\n * due to additional sanity checks. We can avoid them since\n * we always operate on legal UTF32 (granted by the input decoders)\n * and use this faster version instead.\n */\nexport function stringFromCodePoint(codePoint: number): string {\n if (codePoint > 0xFFFF) {\n codePoint -= 0x10000;\n return String.fromCharCode((codePoint >> 10) + 0xD800) + String.fromCharCode((codePoint % 0x400) + 0xDC00);\n }\n return String.fromCharCode(codePoint);\n}\n\n/**\n * Convert UTF32 char codes into JS string.\n * Basically the same as `stringFromCodePoint` but for multiple codepoints\n * in a loop (which is a lot faster).\n */\nexport function utf32ToString(data: Uint32Array, start: number = 0, end: number = data.length): string {\n let result = '';\n for (let i = start; i < end; ++i) {\n let codepoint = data[i];\n if (codepoint > 0xFFFF) {\n // JS strings are encoded as UTF16, thus a non BMP codepoint gets converted into a surrogate pair\n // conversion rules:\n // - subtract 0x10000 from code point, leaving a 20 bit number\n // - add high 10 bits to 0xD800 --> first surrogate\n // - add low 10 bits to 0xDC00 --> second surrogate\n codepoint -= 0x10000;\n result += String.fromCharCode((codepoint >> 10) + 0xD800) + String.fromCharCode((codepoint % 0x400) + 0xDC00);\n } else {\n result += String.fromCharCode(codepoint);\n }\n }\n return result;\n}\n\n/**\n * StringToUtf32 - decodes UTF16 sequences into UTF32 codepoints.\n * To keep the decoder in line with JS strings it handles single surrogates as UCS2.\n */\nexport class StringToUtf32 {\n private _interim: number = 0;\n\n /**\n * Clears interim and resets decoder to clean state.\n */\n public clear(): void {\n this._interim = 0;\n }\n\n /**\n * Decode JS string to UTF32 codepoints.\n * The methods assumes stream input and will store partly transmitted\n * surrogate pairs and decode them with the next data chunk.\n * Note: The method does no bound checks for target, therefore make sure\n * the provided input data does not exceed the size of `target`.\n * Returns the number of written codepoints in `target`.\n */\n public decode(input: string, target: Uint32Array): number {\n const length = input.length;\n\n if (!length) {\n return 0;\n }\n\n let size = 0;\n let startPos = 0;\n\n // handle leftover surrogate high\n if (this._interim) {\n const second = input.charCodeAt(startPos++);\n if (0xDC00 <= second && second <= 0xDFFF) {\n target[size++] = (this._interim - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n // illegal codepoint (USC2 handling)\n target[size++] = this._interim;\n target[size++] = second;\n }\n this._interim = 0;\n }\n\n for (let i = startPos; i < length; ++i) {\n const code = input.charCodeAt(i);\n // surrogate pair first\n if (0xD800 <= code && code <= 0xDBFF) {\n if (++i >= length) {\n this._interim = code;\n return size;\n }\n const second = input.charCodeAt(i);\n if (0xDC00 <= second && second <= 0xDFFF) {\n target[size++] = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n // illegal codepoint (USC2 handling)\n target[size++] = code;\n target[size++] = second;\n }\n continue;\n }\n if (code === 0xFEFF) {\n // BOM\n continue;\n }\n target[size++] = code;\n }\n return size;\n }\n}\n\n/**\n * Utf8Decoder - decodes UTF8 byte sequences into UTF32 codepoints.\n */\nexport class Utf8ToUtf32 {\n public interim: Uint8Array = new Uint8Array(3);\n\n /**\n * Clears interim bytes and resets decoder to clean state.\n */\n public clear(): void {\n this.interim.fill(0);\n }\n\n /**\n * Decodes UTF8 byte sequences in `input` to UTF32 codepoints in `target`.\n * The methods assumes stream input and will store partly transmitted bytes\n * and decode them with the next data chunk.\n * Note: The method does no bound checks for target, therefore make sure\n * the provided data chunk does not exceed the size of `target`.\n * Returns the number of written codepoints in `target`.\n */\n public decode(input: Uint8Array, target: Uint32Array): number {\n const length = input.length;\n\n if (!length) {\n return 0;\n }\n\n let size = 0;\n let byte1: number;\n let byte2: number;\n let byte3: number;\n let byte4: number;\n let codepoint = 0;\n let startPos = 0;\n\n // handle leftover bytes\n if (this.interim[0]) {\n let discardInterim = false;\n let cp = this.interim[0];\n cp &= ((((cp & 0xE0) === 0xC0)) ? 0x1F : (((cp & 0xF0) === 0xE0)) ? 0x0F : 0x07);\n let pos = 0;\n let tmp: number;\n while ((tmp = this.interim[++pos] & 0x3F) && pos < 4) {\n cp <<= 6;\n cp |= tmp;\n }\n // missing bytes - read ahead from input\n const type = (((this.interim[0] & 0xE0) === 0xC0)) ? 2 : (((this.interim[0] & 0xF0) === 0xE0)) ? 3 : 4;\n const missing = type - pos;\n while (startPos < missing) {\n if (startPos >= length) {\n return 0;\n }\n tmp = input[startPos++];\n if ((tmp & 0xC0) !== 0x80) {\n // wrong continuation, discard interim bytes completely\n startPos--;\n discardInterim = true;\n break;\n } else {\n // need to save so we can continue short inputs in next call\n this.interim[pos++] = tmp;\n cp <<= 6;\n cp |= tmp & 0x3F;\n }\n }\n if (!discardInterim) {\n // final test is type dependent\n if (type === 2) {\n if (cp < 0x80) {\n // wrong starter byte\n startPos--;\n } else {\n target[size++] = cp;\n }\n } else if (type === 3) {\n if (cp < 0x0800 || (cp >= 0xD800 && cp <= 0xDFFF) || cp === 0xFEFF) {\n // illegal codepoint or BOM\n } else {\n target[size++] = cp;\n }\n } else {\n if (cp < 0x010000 || cp > 0x10FFFF) {\n // illegal codepoint\n } else {\n target[size++] = cp;\n }\n }\n }\n this.interim.fill(0);\n }\n\n // loop through input\n const fourStop = length - 4;\n let i = startPos;\n while (i < length) {\n /**\n * ASCII shortcut with loop unrolled to 4 consecutive ASCII chars.\n * This is a compromise between speed gain for ASCII\n * and penalty for non ASCII:\n * For best ASCII performance the char should be stored directly into target,\n * but even a single attempt to write to target and compare afterwards\n * penalizes non ASCII really bad (-50%), thus we load the char into byteX first,\n * which reduces ASCII performance by ~15%.\n * This trial for ASCII reduces non ASCII performance by ~10% which seems acceptible\n * compared to the gains.\n * Note that this optimization only takes place for 4 consecutive ASCII chars,\n * for any shorter it bails out. Worst case - all 4 bytes being read but\n * thrown away due to the last being a non ASCII char (-10% performance).\n */\n while (i < fourStop\n && !((byte1 = input[i]) & 0x80)\n && !((byte2 = input[i + 1]) & 0x80)\n && !((byte3 = input[i + 2]) & 0x80)\n && !((byte4 = input[i + 3]) & 0x80))\n {\n target[size++] = byte1;\n target[size++] = byte2;\n target[size++] = byte3;\n target[size++] = byte4;\n i += 4;\n }\n\n // reread byte1\n byte1 = input[i++];\n\n // 1 byte\n if (byte1 < 0x80) {\n target[size++] = byte1;\n\n // 2 bytes\n } else if ((byte1 & 0xE0) === 0xC0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x1F) << 6 | (byte2 & 0x3F);\n if (codepoint < 0x80) {\n // wrong starter byte\n i--;\n continue;\n }\n target[size++] = codepoint;\n\n // 3 bytes\n } else if ((byte1 & 0xF0) === 0xE0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n return size;\n }\n byte3 = input[i++];\n if ((byte3 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x0F) << 12 | (byte2 & 0x3F) << 6 | (byte3 & 0x3F);\n if (codepoint < 0x0800 || (codepoint >= 0xD800 && codepoint <= 0xDFFF) || codepoint === 0xFEFF) {\n // illegal codepoint or BOM, no i-- here\n continue;\n }\n target[size++] = codepoint;\n\n // 4 bytes\n } else if ((byte1 & 0xF8) === 0xF0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n return size;\n }\n byte3 = input[i++];\n if ((byte3 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n this.interim[2] = byte3;\n return size;\n }\n byte4 = input[i++];\n if ((byte4 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x07) << 18 | (byte2 & 0x3F) << 12 | (byte3 & 0x3F) << 6 | (byte4 & 0x3F);\n if (codepoint < 0x010000 || codepoint > 0x10FFFF) {\n // illegal codepoint, no i-- here\n continue;\n }\n target[size++] = codepoint;\n } else {\n // illegal byte, just skip\n }\n }\n return size;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IUnicodeVersionProvider } from 'common/services/Services';\nimport { fill } from 'common/TypedArrayUtils';\n\ntype CharWidth = 0 | 1 | 2;\n\nconst BMP_COMBINING = [\n [0x0300, 0x036F], [0x0483, 0x0486], [0x0488, 0x0489],\n [0x0591, 0x05BD], [0x05BF, 0x05BF], [0x05C1, 0x05C2],\n [0x05C4, 0x05C5], [0x05C7, 0x05C7], [0x0600, 0x0603],\n [0x0610, 0x0615], [0x064B, 0x065E], [0x0670, 0x0670],\n [0x06D6, 0x06E4], [0x06E7, 0x06E8], [0x06EA, 0x06ED],\n [0x070F, 0x070F], [0x0711, 0x0711], [0x0730, 0x074A],\n [0x07A6, 0x07B0], [0x07EB, 0x07F3], [0x0901, 0x0902],\n [0x093C, 0x093C], [0x0941, 0x0948], [0x094D, 0x094D],\n [0x0951, 0x0954], [0x0962, 0x0963], [0x0981, 0x0981],\n [0x09BC, 0x09BC], [0x09C1, 0x09C4], [0x09CD, 0x09CD],\n [0x09E2, 0x09E3], [0x0A01, 0x0A02], [0x0A3C, 0x0A3C],\n [0x0A41, 0x0A42], [0x0A47, 0x0A48], [0x0A4B, 0x0A4D],\n [0x0A70, 0x0A71], [0x0A81, 0x0A82], [0x0ABC, 0x0ABC],\n [0x0AC1, 0x0AC5], [0x0AC7, 0x0AC8], [0x0ACD, 0x0ACD],\n [0x0AE2, 0x0AE3], [0x0B01, 0x0B01], [0x0B3C, 0x0B3C],\n [0x0B3F, 0x0B3F], [0x0B41, 0x0B43], [0x0B4D, 0x0B4D],\n [0x0B56, 0x0B56], [0x0B82, 0x0B82], [0x0BC0, 0x0BC0],\n [0x0BCD, 0x0BCD], [0x0C3E, 0x0C40], [0x0C46, 0x0C48],\n [0x0C4A, 0x0C4D], [0x0C55, 0x0C56], [0x0CBC, 0x0CBC],\n [0x0CBF, 0x0CBF], [0x0CC6, 0x0CC6], [0x0CCC, 0x0CCD],\n [0x0CE2, 0x0CE3], [0x0D41, 0x0D43], [0x0D4D, 0x0D4D],\n [0x0DCA, 0x0DCA], [0x0DD2, 0x0DD4], [0x0DD6, 0x0DD6],\n [0x0E31, 0x0E31], [0x0E34, 0x0E3A], [0x0E47, 0x0E4E],\n [0x0EB1, 0x0EB1], [0x0EB4, 0x0EB9], [0x0EBB, 0x0EBC],\n [0x0EC8, 0x0ECD], [0x0F18, 0x0F19], [0x0F35, 0x0F35],\n [0x0F37, 0x0F37], [0x0F39, 0x0F39], [0x0F71, 0x0F7E],\n [0x0F80, 0x0F84], [0x0F86, 0x0F87], [0x0F90, 0x0F97],\n [0x0F99, 0x0FBC], [0x0FC6, 0x0FC6], [0x102D, 0x1030],\n [0x1032, 0x1032], [0x1036, 0x1037], [0x1039, 0x1039],\n [0x1058, 0x1059], [0x1160, 0x11FF], [0x135F, 0x135F],\n [0x1712, 0x1714], [0x1732, 0x1734], [0x1752, 0x1753],\n [0x1772, 0x1773], [0x17B4, 0x17B5], [0x17B7, 0x17BD],\n [0x17C6, 0x17C6], [0x17C9, 0x17D3], [0x17DD, 0x17DD],\n [0x180B, 0x180D], [0x18A9, 0x18A9], [0x1920, 0x1922],\n [0x1927, 0x1928], [0x1932, 0x1932], [0x1939, 0x193B],\n [0x1A17, 0x1A18], [0x1B00, 0x1B03], [0x1B34, 0x1B34],\n [0x1B36, 0x1B3A], [0x1B3C, 0x1B3C], [0x1B42, 0x1B42],\n [0x1B6B, 0x1B73], [0x1DC0, 0x1DCA], [0x1DFE, 0x1DFF],\n [0x200B, 0x200F], [0x202A, 0x202E], [0x2060, 0x2063],\n [0x206A, 0x206F], [0x20D0, 0x20EF], [0x302A, 0x302F],\n [0x3099, 0x309A], [0xA806, 0xA806], [0xA80B, 0xA80B],\n [0xA825, 0xA826], [0xFB1E, 0xFB1E], [0xFE00, 0xFE0F],\n [0xFE20, 0xFE23], [0xFEFF, 0xFEFF], [0xFFF9, 0xFFFB]\n];\nconst HIGH_COMBINING = [\n [0x10A01, 0x10A03], [0x10A05, 0x10A06], [0x10A0C, 0x10A0F],\n [0x10A38, 0x10A3A], [0x10A3F, 0x10A3F], [0x1D167, 0x1D169],\n [0x1D173, 0x1D182], [0x1D185, 0x1D18B], [0x1D1AA, 0x1D1AD],\n [0x1D242, 0x1D244], [0xE0001, 0xE0001], [0xE0020, 0xE007F],\n [0xE0100, 0xE01EF]\n];\n\n// BMP lookup table, lazy initialized during first addon loading\nlet table: Uint8Array;\n\nfunction bisearch(ucs: number, data: number[][]): boolean {\n let min = 0;\n let max = data.length - 1;\n let mid;\n if (ucs < data[0][0] || ucs > data[max][1]) {\n return false;\n }\n while (max >= min) {\n mid = (min + max) >> 1;\n if (ucs > data[mid][1]) {\n min = mid + 1;\n } else if (ucs < data[mid][0]) {\n max = mid - 1;\n } else {\n return true;\n }\n }\n return false;\n}\n\nexport class UnicodeV6 implements IUnicodeVersionProvider {\n public readonly version = '6';\n\n constructor() {\n // init lookup table once\n if (!table) {\n table = new Uint8Array(65536);\n fill(table, 1);\n table[0] = 0;\n // control chars\n fill(table, 0, 1, 32);\n fill(table, 0, 0x7f, 0xa0);\n\n // apply wide char rules first\n // wide chars\n fill(table, 2, 0x1100, 0x1160);\n table[0x2329] = 2;\n table[0x232a] = 2;\n fill(table, 2, 0x2e80, 0xa4d0);\n table[0x303f] = 1; // wrongly in last line\n\n fill(table, 2, 0xac00, 0xd7a4);\n fill(table, 2, 0xf900, 0xfb00);\n fill(table, 2, 0xfe10, 0xfe1a);\n fill(table, 2, 0xfe30, 0xfe70);\n fill(table, 2, 0xff00, 0xff61);\n fill(table, 2, 0xffe0, 0xffe7);\n\n // apply combining last to ensure we overwrite\n // wrongly wide set chars:\n // the original algo evals combining first and falls\n // through to wide check so we simply do here the opposite\n // combining 0\n for (let r = 0; r < BMP_COMBINING.length; ++r) {\n fill(table, 0, BMP_COMBINING[r][0], BMP_COMBINING[r][1] + 1);\n }\n }\n }\n\n public wcwidth(num: number): CharWidth {\n if (num < 32) return 0;\n if (num < 127) return 1;\n if (num < 65536) return table[num] as CharWidth;\n if (bisearch(num, HIGH_COMBINING)) return 0;\n if ((num >= 0x20000 && num <= 0x2fffd) || (num >= 0x30000 && num <= 0x3fffd)) return 2;\n return 1;\n }\n}\n", "\n/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\n\ndeclare const setTimeout: (handler: () => void, timeout?: number) => void;\n\n/**\n * Safety watermark to avoid memory exhaustion and browser engine crash on fast data input.\n * Enable flow control to avoid this limit and make sure that your backend correctly\n * propagates this to the underlying pty. (see docs for further instructions)\n * Since this limit is meant as a safety parachute to prevent browser crashs,\n * it is set to a very high number. Typically xterm.js gets unresponsive with\n * a 100 times lower number (>500 kB).\n */\nconst DISCARD_WATERMARK = 50000000; // ~50 MB\n\n/**\n * The max number of ms to spend on writes before allowing the renderer to\n * catch up with a 0ms setTimeout. A value of < 33 to keep us close to\n * 30fps, and a value of < 16 to try to run at 60fps. Of course, the real FPS\n * depends on the time it takes for the renderer to draw the frame.\n */\nconst WRITE_TIMEOUT_MS = 12;\n\n/**\n * Threshold of max held chunks in the write buffer, that were already processed.\n * This is a tradeoff between extensive write buffer shifts (bad runtime) and high\n * memory consumption by data thats not used anymore.\n */\nconst WRITE_BUFFER_LENGTH_THRESHOLD = 50;\n\n// queueMicrotask polyfill for nodejs < v11\nconst qmt: (cb: () => void) => void = (typeof queueMicrotask === 'undefined')\n ? (cb: () => void) => { Promise.resolve().then(cb); }\n : queueMicrotask;\n\n\nexport class WriteBuffer {\n private _writeBuffer: (string | Uint8Array)[] = [];\n private _callbacks: ((() => void) | undefined)[] = [];\n private _pendingData = 0;\n private _bufferOffset = 0;\n private _isSyncWriting = false;\n private _syncCalls = 0;\n public get onWriteParsed(): IEvent { return this._onWriteParsed.event; }\n private _onWriteParsed = new EventEmitter();\n\n constructor(private _action: (data: string | Uint8Array, promiseResult?: boolean) => void | Promise) { }\n\n /**\n * @deprecated Unreliable, to be removed soon.\n */\n public writeSync(data: string | Uint8Array, maxSubsequentCalls?: number): void {\n // stop writeSync recursions with maxSubsequentCalls argument\n // This is dangerous to use as it will lose the current data chunk\n // and return immediately.\n if (maxSubsequentCalls !== undefined && this._syncCalls > maxSubsequentCalls) {\n // comment next line if a whole loop block should only contain x `writeSync` calls\n // (total flat vs. deep nested limit)\n this._syncCalls = 0;\n return;\n }\n // append chunk to buffer\n this._pendingData += data.length;\n this._writeBuffer.push(data);\n this._callbacks.push(undefined);\n\n // increase recursion counter\n this._syncCalls++;\n // exit early if another writeSync loop is active\n if (this._isSyncWriting) {\n return;\n }\n this._isSyncWriting = true;\n\n // force sync processing on pending data chunks to avoid in-band data scrambling\n // does the same as innerWrite but without event loop\n // we have to do it here as single loop steps to not corrupt loop subject\n // by another writeSync call triggered from _action\n let chunk: string | Uint8Array | undefined;\n while (chunk = this._writeBuffer.shift()) {\n this._action(chunk);\n const cb = this._callbacks.shift();\n if (cb) cb();\n }\n // reset to avoid reprocessing of chunks with scheduled innerWrite call\n // stopping scheduled innerWrite by offset > length condition\n this._pendingData = 0;\n this._bufferOffset = 0x7FFFFFFF;\n\n // allow another writeSync to loop\n this._isSyncWriting = false;\n this._syncCalls = 0;\n }\n\n public write(data: string | Uint8Array, callback?: () => void): void {\n if (this._pendingData > DISCARD_WATERMARK) {\n throw new Error('write data discarded, use flow control to avoid losing data');\n }\n\n // schedule chunk processing for next event loop run\n if (!this._writeBuffer.length) {\n this._bufferOffset = 0;\n setTimeout(() => this._innerWrite());\n }\n\n this._pendingData += data.length;\n this._writeBuffer.push(data);\n this._callbacks.push(callback);\n }\n\n /**\n * Inner write call, that enters the sliced chunk processing by timing.\n *\n * `lastTime` indicates, when the last _innerWrite call had started.\n * It is used to aggregate async handler execution under a timeout constraint\n * effectively lowering the redrawing needs, schematically:\n *\n * macroTask _innerWrite:\n * if (Date.now() - (lastTime | 0) < WRITE_TIMEOUT_MS):\n * schedule microTask _innerWrite(lastTime)\n * else:\n * schedule macroTask _innerWrite(0)\n *\n * overall execution order on task queues:\n *\n * macrotasks: [...] --> _innerWrite(0) --> [...] --> screenUpdate --> [...]\n * m t: |\n * i a: [...]\n * c s: |\n * r k: while < timeout:\n * o s: _innerWrite(timeout)\n *\n * `promiseResult` depicts the promise resolve value of an async handler.\n * This value gets carried forward through all saved stack states of the\n * paused parser for proper continuation.\n *\n * Note, for pure sync code `lastTime` and `promiseResult` have no meaning.\n */\n protected _innerWrite(lastTime: number = 0, promiseResult: boolean = true): void {\n const startTime = lastTime || Date.now();\n while (this._writeBuffer.length > this._bufferOffset) {\n const data = this._writeBuffer[this._bufferOffset];\n const result = this._action(data, promiseResult);\n if (result) {\n /**\n * If we get a promise as return value, we re-schedule the continuation\n * as thenable on the promise and exit right away.\n *\n * The exit here means, that we block input processing at the current active chunk,\n * the exact execution position within the chunk is preserved by the saved\n * stack content in InputHandler and EscapeSequenceParser.\n *\n * Resuming happens automatically from that saved stack state.\n * Also the resolved promise value is passed along the callstack to\n * `EscapeSequenceParser.parse` to correctly resume the stopped handler loop.\n *\n * Exceptions on async handlers will be logged to console async, but do not interrupt\n * the input processing (continues with next handler at the current input position).\n */\n\n /**\n * If a promise takes long to resolve, we should schedule continuation behind setTimeout.\n * This might already be too late, if our .then enters really late (executor + prev thens took very long).\n * This cannot be solved here for the handler itself (it is the handlers responsibility to slice hard work),\n * but we can at least schedule a screen update as we gain control.\n */\n const continuation: (r: boolean) => void = (r: boolean) => Date.now() - startTime >= WRITE_TIMEOUT_MS\n ? setTimeout(() => this._innerWrite(0, r))\n : this._innerWrite(startTime, r);\n\n /**\n * Optimization considerations:\n * The continuation above favors FPS over throughput by eval'ing `startTime` on resolve.\n * This might schedule too many screen updates with bad throughput drops (in case a slow\n * resolving handler sliced its work properly behind setTimeout calls). We cannot spot\n * this condition here, also the renderer has no way to spot nonsense updates either.\n * FIXME: A proper fix for this would track the FPS at the renderer entry level separately.\n *\n * If favoring of FPS shows bad throughtput impact, use the following instead. It favors\n * throughput by eval'ing `startTime` upfront pulling at least one more chunk into the\n * current microtask queue (executed before setTimeout).\n */\n // const continuation: (r: boolean) => void = Date.now() - startTime >= WRITE_TIMEOUT_MS\n // ? r => setTimeout(() => this._innerWrite(0, r))\n // : r => this._innerWrite(startTime, r);\n\n // Handle exceptions synchronously to current band position, idea:\n // 1. spawn a single microtask which we allow to throw hard\n // 2. spawn a promise immediately resolving to `true`\n // (executed on the same queue, thus properly aligned before continuation happens)\n result.catch(err => {\n qmt(() => {throw err;});\n return Promise.resolve(false);\n }).then(continuation);\n return;\n }\n\n const cb = this._callbacks[this._bufferOffset];\n if (cb) cb();\n this._bufferOffset++;\n this._pendingData -= data.length;\n\n if (Date.now() - startTime >= WRITE_TIMEOUT_MS) {\n break;\n }\n }\n if (this._writeBuffer.length > this._bufferOffset) {\n // Allow renderer to catch up before processing the next batch\n // trim already processed chunks if we are above threshold\n if (this._bufferOffset > WRITE_BUFFER_LENGTH_THRESHOLD) {\n this._writeBuffer = this._writeBuffer.slice(this._bufferOffset);\n this._callbacks = this._callbacks.slice(this._bufferOffset);\n this._bufferOffset = 0;\n }\n setTimeout(() => this._innerWrite());\n } else {\n this._writeBuffer.length = 0;\n this._callbacks.length = 0;\n this._pendingData = 0;\n this._bufferOffset = 0;\n }\n this._onWriteParsed.fire();\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\n// 'rgb:' rule - matching: r/g/b | rr/gg/bb | rrr/ggg/bbb | rrrr/gggg/bbbb (hex digits)\nconst RGB_REX = /^([\\da-f])\\/([\\da-f])\\/([\\da-f])$|^([\\da-f]{2})\\/([\\da-f]{2})\\/([\\da-f]{2})$|^([\\da-f]{3})\\/([\\da-f]{3})\\/([\\da-f]{3})$|^([\\da-f]{4})\\/([\\da-f]{4})\\/([\\da-f]{4})$/;\n// '#...' rule - matching any hex digits\nconst HASH_REX = /^[\\da-f]+$/;\n\n/**\n * Parse color spec to RGB values (8 bit per channel).\n * See `man xparsecolor` for details about certain format specifications.\n *\n * Supported formats:\n * - rgb:// with , , in h | hh | hhh | hhhh\n * - #RGB, #RRGGBB, #RRRGGGBBB, #RRRRGGGGBBBB\n *\n * All other formats like rgbi: or device-independent string specifications\n * with float numbering are not supported.\n */\nexport function parseColor(data: string): [number, number, number] | undefined {\n if (!data) return;\n // also handle uppercases\n let low = data.toLowerCase();\n if (low.indexOf('rgb:') === 0) {\n // 'rgb:' specifier\n low = low.slice(4);\n const m = RGB_REX.exec(low);\n if (m) {\n const base = m[1] ? 15 : m[4] ? 255 : m[7] ? 4095 : 65535;\n return [\n Math.round(parseInt(m[1] || m[4] || m[7] || m[10], 16) / base * 255),\n Math.round(parseInt(m[2] || m[5] || m[8] || m[11], 16) / base * 255),\n Math.round(parseInt(m[3] || m[6] || m[9] || m[12], 16) / base * 255)\n ];\n }\n } else if (low.indexOf('#') === 0) {\n // '#' specifier\n low = low.slice(1);\n if (HASH_REX.exec(low) && [3, 6, 9, 12].includes(low.length)) {\n const adv = low.length / 3;\n const result: [number, number, number] = [0, 0, 0];\n for (let i = 0; i < 3; ++i) {\n const c = parseInt(low.slice(adv * i, adv * i + adv), 16);\n result[i] = adv === 1 ? c << 4 : adv === 2 ? c : adv === 3 ? c >> 4 : c >> 8;\n }\n return result;\n }\n }\n\n // Named colors are currently not supported due to the large addition to the xterm.js bundle size\n // they would add. In order to support named colors, we would need some way of optionally loading\n // additional payloads so startup/download time is not bloated (see #3530).\n}\n\n// pad hex output to requested bit width\nfunction pad(n: number, bits: number): string {\n const s = n.toString(16);\n const s2 = s.length < 2 ? '0' + s : s;\n switch (bits) {\n case 4:\n return s[0];\n case 8:\n return s2;\n case 12:\n return (s2 + s2).slice(0, 3);\n default:\n return s2 + s2;\n }\n}\n\n/**\n * Convert a given color to rgb:../../.. string of `bits` depth.\n */\nexport function toRgbString(color: [number, number, number], bits: number = 16): string {\n const [r, g, b] = color;\n return `rgb:${pad(r, bits)}/${pad(g, bits)}/${pad(b, bits)}`;\n}\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * Internal states of EscapeSequenceParser.\n */\nexport const enum ParserState {\n GROUND = 0,\n ESCAPE = 1,\n ESCAPE_INTERMEDIATE = 2,\n CSI_ENTRY = 3,\n CSI_PARAM = 4,\n CSI_INTERMEDIATE = 5,\n CSI_IGNORE = 6,\n SOS_PM_APC_STRING = 7,\n OSC_STRING = 8,\n DCS_ENTRY = 9,\n DCS_PARAM = 10,\n DCS_IGNORE = 11,\n DCS_INTERMEDIATE = 12,\n DCS_PASSTHROUGH = 13\n}\n\n/**\n* Internal actions of EscapeSequenceParser.\n*/\nexport const enum ParserAction {\n IGNORE = 0,\n ERROR = 1,\n PRINT = 2,\n EXECUTE = 3,\n OSC_START = 4,\n OSC_PUT = 5,\n OSC_END = 6,\n CSI_DISPATCH = 7,\n PARAM = 8,\n COLLECT = 9,\n ESC_DISPATCH = 10,\n CLEAR = 11,\n DCS_HOOK = 12,\n DCS_PUT = 13,\n DCS_UNHOOK = 14\n}\n\n/**\n * Internal states of OscParser.\n */\nexport const enum OscState {\n START = 0,\n ID = 1,\n PAYLOAD = 2,\n ABORT = 3\n}\n\n// payload limit for OSC and DCS\nexport const PAYLOAD_LIMIT = 10000000;\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\nimport { IDcsHandler, IParams, IHandlerCollection, IDcsParser, DcsFallbackHandlerType, ISubParserStackState } from 'common/parser/Types';\nimport { utf32ToString } from 'common/input/TextDecoder';\nimport { Params } from 'common/parser/Params';\nimport { PAYLOAD_LIMIT } from 'common/parser/Constants';\n\nconst EMPTY_HANDLERS: IDcsHandler[] = [];\n\nexport class DcsParser implements IDcsParser {\n private _handlers: IHandlerCollection = Object.create(null);\n private _active: IDcsHandler[] = EMPTY_HANDLERS;\n private _ident: number = 0;\n private _handlerFb: DcsFallbackHandlerType = () => { };\n private _stack: ISubParserStackState = {\n paused: false,\n loopPosition: 0,\n fallThrough: false\n };\n\n public dispose(): void {\n this._handlers = Object.create(null);\n this._handlerFb = () => { };\n this._active = EMPTY_HANDLERS;\n }\n\n public registerHandler(ident: number, handler: IDcsHandler): IDisposable {\n if (this._handlers[ident] === undefined) {\n this._handlers[ident] = [];\n }\n const handlerList = this._handlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n\n public clearHandler(ident: number): void {\n if (this._handlers[ident]) delete this._handlers[ident];\n }\n\n public setHandlerFallback(handler: DcsFallbackHandlerType): void {\n this._handlerFb = handler;\n }\n\n public reset(): void {\n // force cleanup leftover handlers\n if (this._active.length) {\n for (let j = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; j >= 0; --j) {\n this._active[j].unhook(false);\n }\n }\n this._stack.paused = false;\n this._active = EMPTY_HANDLERS;\n this._ident = 0;\n }\n\n public hook(ident: number, params: IParams): void {\n // always reset leftover handlers\n this.reset();\n this._ident = ident;\n this._active = this._handlers[ident] || EMPTY_HANDLERS;\n if (!this._active.length) {\n this._handlerFb(this._ident, 'HOOK', params);\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].hook(params);\n }\n }\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (!this._active.length) {\n this._handlerFb(this._ident, 'PUT', utf32ToString(data, start, end));\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].put(data, start, end);\n }\n }\n }\n\n public unhook(success: boolean, promiseResult: boolean = true): void | Promise {\n if (!this._active.length) {\n this._handlerFb(this._ident, 'UNHOOK', success);\n } else {\n let handlerResult: boolean | Promise = false;\n let j = this._active.length - 1;\n let fallThrough = false;\n if (this._stack.paused) {\n j = this._stack.loopPosition - 1;\n handlerResult = promiseResult;\n fallThrough = this._stack.fallThrough;\n this._stack.paused = false;\n }\n if (!fallThrough && handlerResult === false) {\n for (; j >= 0; j--) {\n handlerResult = this._active[j].unhook(success);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = false;\n return handlerResult;\n }\n }\n j--;\n }\n // cleanup left over handlers (fallThrough for async)\n for (; j >= 0; j--) {\n handlerResult = this._active[j].unhook(false);\n if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = true;\n return handlerResult;\n }\n }\n }\n this._active = EMPTY_HANDLERS;\n this._ident = 0;\n }\n}\n\n// predefine empty params as [0] (ZDM)\nconst EMPTY_PARAMS = new Params();\nEMPTY_PARAMS.addParam(0);\n\n/**\n * Convenient class to create a DCS handler from a single callback function.\n * Note: The payload is currently limited to 50 MB (hardcoded).\n */\nexport class DcsHandler implements IDcsHandler {\n private _data = '';\n private _params: IParams = EMPTY_PARAMS;\n private _hitLimit: boolean = false;\n\n constructor(private _handler: (data: string, params: IParams) => boolean | Promise) { }\n\n public hook(params: IParams): void {\n // since we need to preserve params until `unhook`, we have to clone it\n // (only borrowed from parser and spans multiple parser states)\n // perf optimization:\n // clone only, if we have non empty params, otherwise stick with default\n this._params = (params.length > 1 || params.params[0]) ? params.clone() : EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._hitLimit) {\n return;\n }\n this._data += utf32ToString(data, start, end);\n if (this._data.length > PAYLOAD_LIMIT) {\n this._data = '';\n this._hitLimit = true;\n }\n }\n\n public unhook(success: boolean): boolean | Promise {\n let ret: boolean | Promise = false;\n if (this._hitLimit) {\n ret = false;\n } else if (success) {\n ret = this._handler(this._data, this._params);\n if (ret instanceof Promise) {\n // need to hold data and params until `ret` got resolved\n // dont care for errors, data will be freed anyway on next start\n return ret.then(res => {\n this._params = EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n return res;\n });\n }\n }\n this._params = EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n return ret;\n }\n}\n", "/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IParsingState, IDcsHandler, IEscapeSequenceParser, IParams, IOscHandler, IHandlerCollection, CsiHandlerType, OscFallbackHandlerType, IOscParser, EscHandlerType, IDcsParser, DcsFallbackHandlerType, IFunctionIdentifier, ExecuteFallbackHandlerType, CsiFallbackHandlerType, EscFallbackHandlerType, PrintHandlerType, PrintFallbackHandlerType, ExecuteHandlerType, IParserStackState, ParserStackType, ResumableHandlersType } from 'common/parser/Types';\nimport { ParserState, ParserAction } from 'common/parser/Constants';\nimport { Disposable } from 'common/Lifecycle';\nimport { IDisposable } from 'common/Types';\nimport { fill } from 'common/TypedArrayUtils';\nimport { Params } from 'common/parser/Params';\nimport { OscParser } from 'common/parser/OscParser';\nimport { DcsParser } from 'common/parser/DcsParser';\n\n/**\n * Table values are generated like this:\n * index: currentState << TableValue.INDEX_STATE_SHIFT | charCode\n * value: action << TableValue.TRANSITION_ACTION_SHIFT | nextState\n */\nconst enum TableAccess {\n TRANSITION_ACTION_SHIFT = 4,\n TRANSITION_STATE_MASK = 15,\n INDEX_STATE_SHIFT = 8\n}\n\n/**\n * Transition table for EscapeSequenceParser.\n */\nexport class TransitionTable {\n public table: Uint8Array;\n\n constructor(length: number) {\n this.table = new Uint8Array(length);\n }\n\n /**\n * Set default transition.\n * @param action default action\n * @param next default next state\n */\n public setDefault(action: ParserAction, next: ParserState): void {\n fill(this.table, action << TableAccess.TRANSITION_ACTION_SHIFT | next);\n }\n\n /**\n * Add a transition to the transition table.\n * @param code input character code\n * @param state current parser state\n * @param action parser action to be done\n * @param next next parser state\n */\n public add(code: number, state: ParserState, action: ParserAction, next: ParserState): void {\n this.table[state << TableAccess.INDEX_STATE_SHIFT | code] = action << TableAccess.TRANSITION_ACTION_SHIFT | next;\n }\n\n /**\n * Add transitions for multiple input character codes.\n * @param codes input character code array\n * @param state current parser state\n * @param action parser action to be done\n * @param next next parser state\n */\n public addMany(codes: number[], state: ParserState, action: ParserAction, next: ParserState): void {\n for (let i = 0; i < codes.length; i++) {\n this.table[state << TableAccess.INDEX_STATE_SHIFT | codes[i]] = action << TableAccess.TRANSITION_ACTION_SHIFT | next;\n }\n }\n}\n\n\n// Pseudo-character placeholder for printable non-ascii characters (unicode).\nconst NON_ASCII_PRINTABLE = 0xA0;\n\n\n/**\n * VT500 compatible transition table.\n * Taken from https://vt100.net/emu/dec_ansi_parser.\n */\nexport const VT500_TRANSITION_TABLE = (function (): TransitionTable {\n const table: TransitionTable = new TransitionTable(4095);\n\n // range macro for byte\n const BYTE_VALUES = 256;\n const blueprint = Array.apply(null, Array(BYTE_VALUES)).map((unused: any, i: number) => i);\n const r = (start: number, end: number): number[] => blueprint.slice(start, end);\n\n // Default definitions.\n const PRINTABLES = r(0x20, 0x7f); // 0x20 (SP) included, 0x7F (DEL) excluded\n const EXECUTABLES = r(0x00, 0x18);\n EXECUTABLES.push(0x19);\n EXECUTABLES.push.apply(EXECUTABLES, r(0x1c, 0x20));\n\n const states: number[] = r(ParserState.GROUND, ParserState.DCS_PASSTHROUGH + 1);\n let state: any;\n\n // set default transition\n table.setDefault(ParserAction.ERROR, ParserState.GROUND);\n // printables\n table.addMany(PRINTABLES, ParserState.GROUND, ParserAction.PRINT, ParserState.GROUND);\n // global anywhere rules\n for (state in states) {\n table.addMany([0x18, 0x1a, 0x99, 0x9a], state, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(r(0x80, 0x90), state, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(r(0x90, 0x98), state, ParserAction.EXECUTE, ParserState.GROUND);\n table.add(0x9c, state, ParserAction.IGNORE, ParserState.GROUND); // ST as terminator\n table.add(0x1b, state, ParserAction.CLEAR, ParserState.ESCAPE); // ESC\n table.add(0x9d, state, ParserAction.OSC_START, ParserState.OSC_STRING); // OSC\n table.addMany([0x98, 0x9e, 0x9f], state, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.add(0x9b, state, ParserAction.CLEAR, ParserState.CSI_ENTRY); // CSI\n table.add(0x90, state, ParserAction.CLEAR, ParserState.DCS_ENTRY); // DCS\n }\n // rules for executables and 7f\n table.addMany(EXECUTABLES, ParserState.GROUND, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(EXECUTABLES, ParserState.ESCAPE, ParserAction.EXECUTE, ParserState.ESCAPE);\n table.add(0x7f, ParserState.ESCAPE, ParserAction.IGNORE, ParserState.ESCAPE);\n table.addMany(EXECUTABLES, ParserState.OSC_STRING, ParserAction.IGNORE, ParserState.OSC_STRING);\n table.addMany(EXECUTABLES, ParserState.CSI_ENTRY, ParserAction.EXECUTE, ParserState.CSI_ENTRY);\n table.add(0x7f, ParserState.CSI_ENTRY, ParserAction.IGNORE, ParserState.CSI_ENTRY);\n table.addMany(EXECUTABLES, ParserState.CSI_PARAM, ParserAction.EXECUTE, ParserState.CSI_PARAM);\n table.add(0x7f, ParserState.CSI_PARAM, ParserAction.IGNORE, ParserState.CSI_PARAM);\n table.addMany(EXECUTABLES, ParserState.CSI_IGNORE, ParserAction.EXECUTE, ParserState.CSI_IGNORE);\n table.addMany(EXECUTABLES, ParserState.CSI_INTERMEDIATE, ParserAction.EXECUTE, ParserState.CSI_INTERMEDIATE);\n table.add(0x7f, ParserState.CSI_INTERMEDIATE, ParserAction.IGNORE, ParserState.CSI_INTERMEDIATE);\n table.addMany(EXECUTABLES, ParserState.ESCAPE_INTERMEDIATE, ParserAction.EXECUTE, ParserState.ESCAPE_INTERMEDIATE);\n table.add(0x7f, ParserState.ESCAPE_INTERMEDIATE, ParserAction.IGNORE, ParserState.ESCAPE_INTERMEDIATE);\n // osc\n table.add(0x5d, ParserState.ESCAPE, ParserAction.OSC_START, ParserState.OSC_STRING);\n table.addMany(PRINTABLES, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.add(0x7f, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.addMany([0x9c, 0x1b, 0x18, 0x1a, 0x07], ParserState.OSC_STRING, ParserAction.OSC_END, ParserState.GROUND);\n table.addMany(r(0x1c, 0x20), ParserState.OSC_STRING, ParserAction.IGNORE, ParserState.OSC_STRING);\n // sos/pm/apc does nothing\n table.addMany([0x58, 0x5e, 0x5f], ParserState.ESCAPE, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.addMany(PRINTABLES, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.addMany(EXECUTABLES, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.add(0x9c, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.GROUND);\n table.add(0x7f, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n // csi entries\n table.add(0x5b, ParserState.ESCAPE, ParserAction.CLEAR, ParserState.CSI_ENTRY);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_ENTRY, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x30, 0x3c), ParserState.CSI_ENTRY, ParserAction.PARAM, ParserState.CSI_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.CSI_ENTRY, ParserAction.COLLECT, ParserState.CSI_PARAM);\n table.addMany(r(0x30, 0x3c), ParserState.CSI_PARAM, ParserAction.PARAM, ParserState.CSI_PARAM);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_PARAM, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.CSI_PARAM, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x20, 0x40), ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.add(0x7f, ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.GROUND);\n table.addMany(r(0x20, 0x30), ParserState.CSI_ENTRY, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.CSI_INTERMEDIATE, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n table.addMany(r(0x30, 0x40), ParserState.CSI_INTERMEDIATE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_INTERMEDIATE, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x20, 0x30), ParserState.CSI_PARAM, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n // esc_intermediate\n table.addMany(r(0x20, 0x30), ParserState.ESCAPE, ParserAction.COLLECT, ParserState.ESCAPE_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.ESCAPE_INTERMEDIATE, ParserAction.COLLECT, ParserState.ESCAPE_INTERMEDIATE);\n table.addMany(r(0x30, 0x7f), ParserState.ESCAPE_INTERMEDIATE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x30, 0x50), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x51, 0x58), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany([0x59, 0x5a, 0x5c], ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x60, 0x7f), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n // dcs entry\n table.add(0x50, ParserState.ESCAPE, ParserAction.CLEAR, ParserState.DCS_ENTRY);\n table.addMany(EXECUTABLES, ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.add(0x7f, ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.addMany(r(0x20, 0x30), ParserState.DCS_ENTRY, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x30, 0x3c), ParserState.DCS_ENTRY, ParserAction.PARAM, ParserState.DCS_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.DCS_ENTRY, ParserAction.COLLECT, ParserState.DCS_PARAM);\n table.addMany(EXECUTABLES, ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x20, 0x80), ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(EXECUTABLES, ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.add(0x7f, ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.addMany(r(0x30, 0x3c), ParserState.DCS_PARAM, ParserAction.PARAM, ParserState.DCS_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x20, 0x30), ParserState.DCS_PARAM, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(EXECUTABLES, ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.add(0x7f, ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.DCS_INTERMEDIATE, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x30, 0x40), ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_INTERMEDIATE, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_PARAM, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_ENTRY, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(EXECUTABLES, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n table.addMany(PRINTABLES, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n table.add(0x7f, ParserState.DCS_PASSTHROUGH, ParserAction.IGNORE, ParserState.DCS_PASSTHROUGH);\n table.addMany([0x1b, 0x9c, 0x18, 0x1a], ParserState.DCS_PASSTHROUGH, ParserAction.DCS_UNHOOK, ParserState.GROUND);\n // special handling of unicode chars\n table.add(NON_ASCII_PRINTABLE, ParserState.GROUND, ParserAction.PRINT, ParserState.GROUND);\n table.add(NON_ASCII_PRINTABLE, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.add(NON_ASCII_PRINTABLE, ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.add(NON_ASCII_PRINTABLE, ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.add(NON_ASCII_PRINTABLE, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n return table;\n})();\n\n\n/**\n * EscapeSequenceParser.\n * This class implements the ANSI/DEC compatible parser described by\n * Paul Williams (https://vt100.net/emu/dec_ansi_parser).\n *\n * To implement custom ANSI compliant escape sequences it is not needed to\n * alter this parser, instead consider registering a custom handler.\n * For non ANSI compliant sequences change the transition table with\n * the optional `transitions` constructor argument and\n * reimplement the `parse` method.\n *\n * This parser is currently hardcoded to operate in ZDM (Zero Default Mode)\n * as suggested by the original parser, thus empty parameters are set to 0.\n * This this is not in line with the latest ECMA-48 specification\n * (ZDM was part of the early specs and got completely removed later on).\n *\n * Other than the original parser from vt100.net this parser supports\n * sub parameters in digital parameters separated by colons. Empty sub parameters\n * are set to -1 (no ZDM for sub parameters).\n *\n * About prefix and intermediate bytes:\n * This parser follows the assumptions of the vt100.net parser with these restrictions:\n * - only one prefix byte is allowed as first parameter byte, byte range 0x3c .. 0x3f\n * - max. two intermediates are respected, byte range 0x20 .. 0x2f\n * Note that this is not in line with ECMA-48 which does not limit either of those.\n * Furthermore ECMA-48 allows the prefix byte range at any param byte position. Currently\n * there are no known sequences that follow the broader definition of the specification.\n *\n * TODO: implement error recovery hook via error handler return values\n */\nexport class EscapeSequenceParser extends Disposable implements IEscapeSequenceParser {\n public initialState: number;\n public currentState: number;\n public precedingCodepoint: number;\n\n // buffers over several parse calls\n protected _params: Params;\n protected _collect: number;\n\n // handler lookup containers\n protected _printHandler: PrintHandlerType;\n protected _executeHandlers: { [flag: number]: ExecuteHandlerType };\n protected _csiHandlers: IHandlerCollection;\n protected _escHandlers: IHandlerCollection;\n protected _oscParser: IOscParser;\n protected _dcsParser: IDcsParser;\n protected _errorHandler: (state: IParsingState) => IParsingState;\n\n // fallback handlers\n protected _printHandlerFb: PrintFallbackHandlerType;\n protected _executeHandlerFb: ExecuteFallbackHandlerType;\n protected _csiHandlerFb: CsiFallbackHandlerType;\n protected _escHandlerFb: EscFallbackHandlerType;\n protected _errorHandlerFb: (state: IParsingState) => IParsingState;\n\n // parser stack save for async handler support\n protected _parseStack: IParserStackState = {\n state: ParserStackType.NONE,\n handlers: [],\n handlerPos: 0,\n transition: 0,\n chunkPos: 0\n };\n\n constructor(\n protected readonly _transitions: TransitionTable = VT500_TRANSITION_TABLE\n ) {\n super();\n\n this.initialState = ParserState.GROUND;\n this.currentState = this.initialState;\n this._params = new Params(); // defaults to 32 storable params/subparams\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n\n // set default fallback handlers and handler lookup containers\n this._printHandlerFb = (data, start, end): void => { };\n this._executeHandlerFb = (code: number): void => { };\n this._csiHandlerFb = (ident: number, params: IParams): void => { };\n this._escHandlerFb = (ident: number): void => { };\n this._errorHandlerFb = (state: IParsingState): IParsingState => state;\n this._printHandler = this._printHandlerFb;\n this._executeHandlers = Object.create(null);\n this._csiHandlers = Object.create(null);\n this._escHandlers = Object.create(null);\n this._oscParser = new OscParser();\n this._dcsParser = new DcsParser();\n this._errorHandler = this._errorHandlerFb;\n\n // swallow 7bit ST (ESC+\\)\n this.registerEscHandler({ final: '\\\\' }, () => true);\n }\n\n protected _identifier(id: IFunctionIdentifier, finalRange: number[] = [0x40, 0x7e]): number {\n let res = 0;\n if (id.prefix) {\n if (id.prefix.length > 1) {\n throw new Error('only one byte as prefix supported');\n }\n res = id.prefix.charCodeAt(0);\n if (res && 0x3c > res || res > 0x3f) {\n throw new Error('prefix must be in range 0x3c .. 0x3f');\n }\n }\n if (id.intermediates) {\n if (id.intermediates.length > 2) {\n throw new Error('only two bytes as intermediates are supported');\n }\n for (let i = 0; i < id.intermediates.length; ++i) {\n const intermediate = id.intermediates.charCodeAt(i);\n if (0x20 > intermediate || intermediate > 0x2f) {\n throw new Error('intermediate must be in range 0x20 .. 0x2f');\n }\n res <<= 8;\n res |= intermediate;\n }\n }\n if (id.final.length !== 1) {\n throw new Error('final must be a single byte');\n }\n const finalCode = id.final.charCodeAt(0);\n if (finalRange[0] > finalCode || finalCode > finalRange[1]) {\n throw new Error(`final must be in range ${finalRange[0]} .. ${finalRange[1]}`);\n }\n res <<= 8;\n res |= finalCode;\n\n return res;\n }\n\n public identToString(ident: number): string {\n const res: string[] = [];\n while (ident) {\n res.push(String.fromCharCode(ident & 0xFF));\n ident >>= 8;\n }\n return res.reverse().join('');\n }\n\n public dispose(): void {\n this._csiHandlers = Object.create(null);\n this._executeHandlers = Object.create(null);\n this._escHandlers = Object.create(null);\n this._oscParser.dispose();\n this._dcsParser.dispose();\n }\n\n public setPrintHandler(handler: PrintHandlerType): void {\n this._printHandler = handler;\n }\n public clearPrintHandler(): void {\n this._printHandler = this._printHandlerFb;\n }\n\n public registerEscHandler(id: IFunctionIdentifier, handler: EscHandlerType): IDisposable {\n const ident = this._identifier(id, [0x30, 0x7e]);\n if (this._escHandlers[ident] === undefined) {\n this._escHandlers[ident] = [];\n }\n const handlerList = this._escHandlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearEscHandler(id: IFunctionIdentifier): void {\n if (this._escHandlers[this._identifier(id, [0x30, 0x7e])]) delete this._escHandlers[this._identifier(id, [0x30, 0x7e])];\n }\n public setEscHandlerFallback(handler: EscFallbackHandlerType): void {\n this._escHandlerFb = handler;\n }\n\n public setExecuteHandler(flag: string, handler: ExecuteHandlerType): void {\n this._executeHandlers[flag.charCodeAt(0)] = handler;\n }\n public clearExecuteHandler(flag: string): void {\n if (this._executeHandlers[flag.charCodeAt(0)]) delete this._executeHandlers[flag.charCodeAt(0)];\n }\n public setExecuteHandlerFallback(handler: ExecuteFallbackHandlerType): void {\n this._executeHandlerFb = handler;\n }\n\n public registerCsiHandler(id: IFunctionIdentifier, handler: CsiHandlerType): IDisposable {\n const ident = this._identifier(id);\n if (this._csiHandlers[ident] === undefined) {\n this._csiHandlers[ident] = [];\n }\n const handlerList = this._csiHandlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearCsiHandler(id: IFunctionIdentifier): void {\n if (this._csiHandlers[this._identifier(id)]) delete this._csiHandlers[this._identifier(id)];\n }\n public setCsiHandlerFallback(callback: (ident: number, params: IParams) => void): void {\n this._csiHandlerFb = callback;\n }\n\n public registerDcsHandler(id: IFunctionIdentifier, handler: IDcsHandler): IDisposable {\n return this._dcsParser.registerHandler(this._identifier(id), handler);\n }\n public clearDcsHandler(id: IFunctionIdentifier): void {\n this._dcsParser.clearHandler(this._identifier(id));\n }\n public setDcsHandlerFallback(handler: DcsFallbackHandlerType): void {\n this._dcsParser.setHandlerFallback(handler);\n }\n\n public registerOscHandler(ident: number, handler: IOscHandler): IDisposable {\n return this._oscParser.registerHandler(ident, handler);\n }\n public clearOscHandler(ident: number): void {\n this._oscParser.clearHandler(ident);\n }\n public setOscHandlerFallback(handler: OscFallbackHandlerType): void {\n this._oscParser.setHandlerFallback(handler);\n }\n\n public setErrorHandler(callback: (state: IParsingState) => IParsingState): void {\n this._errorHandler = callback;\n }\n public clearErrorHandler(): void {\n this._errorHandler = this._errorHandlerFb;\n }\n\n /**\n * Reset parser to initial values.\n *\n * This can also be used to lift the improper continuation error condition\n * when dealing with async handlers. Use this only as a last resort to silence\n * that error when the terminal has no pending data to be processed. Note that\n * the interrupted async handler might continue its work in the future messing\n * up the terminal state even further.\n */\n public reset(): void {\n this.currentState = this.initialState;\n this._oscParser.reset();\n this._dcsParser.reset();\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n // abort pending continuation from async handler\n // Here the RESET type indicates, that the next parse call will\n // ignore any saved stack, instead continues sync with next codepoint from GROUND\n if (this._parseStack.state !== ParserStackType.NONE) {\n this._parseStack.state = ParserStackType.RESET;\n this._parseStack.handlers = []; // also release handlers ref\n }\n }\n\n /**\n * Async parse support.\n */\n protected _preserveStack(\n state: ParserStackType,\n handlers: ResumableHandlersType,\n handlerPos: number,\n transition: number,\n chunkPos: number\n ): void {\n this._parseStack.state = state;\n this._parseStack.handlers = handlers;\n this._parseStack.handlerPos = handlerPos;\n this._parseStack.transition = transition;\n this._parseStack.chunkPos = chunkPos;\n }\n\n /**\n * Parse UTF32 codepoints in `data` up to `length`.\n *\n * Note: For several actions with high data load the parsing is optimized\n * by using local read ahead loops with hardcoded conditions to\n * avoid costly table lookups. Make sure that any change of table values\n * will be reflected in the loop conditions as well and vice versa.\n * Affected states/actions:\n * - GROUND:PRINT\n * - CSI_PARAM:PARAM\n * - DCS_PARAM:PARAM\n * - OSC_STRING:OSC_PUT\n * - DCS_PASSTHROUGH:DCS_PUT\n *\n * Note on asynchronous handler support:\n * Any handler returning a promise will be treated as asynchronous.\n * To keep the in-band blocking working for async handlers, `parse` pauses execution,\n * creates a stack save and returns the promise to the caller.\n * For proper continuation of the paused state it is important\n * to await the promise resolving. On resolve the parse must be repeated\n * with the same chunk of data and the resolved value in `promiseResult`\n * until no promise is returned.\n *\n * Important: With only sync handlers defined, parsing is completely synchronous as well.\n * As soon as an async handler is involved, synchronous parsing is not possible anymore.\n *\n * Boilerplate for proper parsing of multiple chunks with async handlers:\n *\n * ```typescript\n * async function parseMultipleChunks(chunks: Uint32Array[]): Promise {\n * for (const chunk of chunks) {\n * let result: void | Promise;\n * let prev: boolean | undefined;\n * while (result = parser.parse(chunk, chunk.length, prev)) {\n * prev = await result;\n * }\n * }\n * // finished parsing all chunks...\n * }\n * ```\n */\n public parse(data: Uint32Array, length: number, promiseResult?: boolean): void | Promise {\n let code = 0;\n let transition = 0;\n let start = 0;\n let handlerResult: void | boolean | Promise;\n\n // resume from async handler\n if (this._parseStack.state) {\n // allow sync parser reset even in continuation mode\n // Note: can be used to recover parser from improper continuation error below\n if (this._parseStack.state === ParserStackType.RESET) {\n this._parseStack.state = ParserStackType.NONE;\n start = this._parseStack.chunkPos + 1; // continue with next codepoint in GROUND\n } else {\n if (promiseResult === undefined || this._parseStack.state === ParserStackType.FAIL) {\n /**\n * Reject further parsing on improper continuation after pausing.\n * This is a really bad condition with screwed up execution order and prolly messed up\n * terminal state, therefore we exit hard with an exception and reject any further parsing.\n *\n * Note: With `Terminal.write` usage this exception should never occur, as the top level\n * calls are guaranteed to handle async conditions properly. If you ever encounter this\n * exception in your terminal integration it indicates, that you injected data chunks to\n * `InputHandler.parse` or `EscapeSequenceParser.parse` synchronously without waiting for\n * continuation of a running async handler.\n *\n * It is possible to get rid of this error by calling `reset`. But dont rely on that,\n * as the pending async handler still might mess up the terminal later. Instead fix the faulty\n * async handling, so this error will not be thrown anymore.\n */\n this._parseStack.state = ParserStackType.FAIL;\n throw new Error('improper continuation due to previous async handler, giving up parsing');\n }\n\n // we have to resume the old handler loop if:\n // - return value of the promise was `false`\n // - handlers are not exhausted yet\n const handlers = this._parseStack.handlers;\n let handlerPos = this._parseStack.handlerPos - 1;\n switch (this._parseStack.state) {\n case ParserStackType.CSI:\n if (promiseResult === false && handlerPos > -1) {\n for (; handlerPos >= 0; handlerPos--) {\n handlerResult = (handlers as CsiHandlerType[])[handlerPos](this._params);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._parseStack.handlerPos = handlerPos;\n return handlerResult;\n }\n }\n }\n this._parseStack.handlers = [];\n break;\n case ParserStackType.ESC:\n if (promiseResult === false && handlerPos > -1) {\n for (; handlerPos >= 0; handlerPos--) {\n handlerResult = (handlers as EscHandlerType[])[handlerPos]();\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._parseStack.handlerPos = handlerPos;\n return handlerResult;\n }\n }\n }\n this._parseStack.handlers = [];\n break;\n case ParserStackType.DCS:\n code = data[this._parseStack.chunkPos];\n handlerResult = this._dcsParser.unhook(code !== 0x18 && code !== 0x1a, promiseResult);\n if (handlerResult) {\n return handlerResult;\n }\n if (code === 0x1b) this._parseStack.transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n case ParserStackType.OSC:\n code = data[this._parseStack.chunkPos];\n handlerResult = this._oscParser.end(code !== 0x18 && code !== 0x1a, promiseResult);\n if (handlerResult) {\n return handlerResult;\n }\n if (code === 0x1b) this._parseStack.transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n }\n // cleanup before continuing with the main sync loop\n this._parseStack.state = ParserStackType.NONE;\n start = this._parseStack.chunkPos + 1;\n this.precedingCodepoint = 0;\n this.currentState = this._parseStack.transition & TableAccess.TRANSITION_STATE_MASK;\n }\n }\n\n // continue with main sync loop\n\n // process input string\n for (let i = start; i < length; ++i) {\n code = data[i];\n\n // normal transition & action lookup\n transition = this._transitions.table[this.currentState << TableAccess.INDEX_STATE_SHIFT | (code < 0xa0 ? code : NON_ASCII_PRINTABLE)];\n switch (transition >> TableAccess.TRANSITION_ACTION_SHIFT) {\n case ParserAction.PRINT:\n // read ahead with loop unrolling\n // Note: 0x20 (SP) is included, 0x7F (DEL) is excluded\n for (let j = i + 1; ; ++j) {\n if (j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.EXECUTE:\n if (this._executeHandlers[code]) this._executeHandlers[code]();\n else this._executeHandlerFb(code);\n this.precedingCodepoint = 0;\n break;\n case ParserAction.IGNORE:\n break;\n case ParserAction.ERROR:\n const inject: IParsingState = this._errorHandler(\n {\n position: i,\n code,\n currentState: this.currentState,\n collect: this._collect,\n params: this._params,\n abort: false\n });\n if (inject.abort) return;\n // inject values: currently not implemented\n break;\n case ParserAction.CSI_DISPATCH:\n // Trigger CSI Handler\n const handlers = this._csiHandlers[this._collect << 8 | code];\n let j = handlers ? handlers.length - 1 : -1;\n for (; j >= 0; j--) {\n // true means success and to stop bubbling\n // a promise indicates an async handler that needs to finish before progressing\n handlerResult = handlers[j](this._params);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._preserveStack(ParserStackType.CSI, handlers, j, transition, i);\n return handlerResult;\n }\n }\n if (j < 0) {\n this._csiHandlerFb(this._collect << 8 | code, this._params);\n }\n this.precedingCodepoint = 0;\n break;\n case ParserAction.PARAM:\n // inner loop: digits (0x30 - 0x39) and ; (0x3b) and : (0x3a)\n do {\n switch (code) {\n case 0x3b:\n this._params.addParam(0); // ZDM\n break;\n case 0x3a:\n this._params.addSubParam(-1);\n break;\n default: // 0x30 - 0x39\n this._params.addDigit(code - 48);\n }\n } while (++i < length && (code = data[i]) > 0x2f && code < 0x3c);\n i--;\n break;\n case ParserAction.COLLECT:\n this._collect <<= 8;\n this._collect |= code;\n break;\n case ParserAction.ESC_DISPATCH:\n const handlersEsc = this._escHandlers[this._collect << 8 | code];\n let jj = handlersEsc ? handlersEsc.length - 1 : -1;\n for (; jj >= 0; jj--) {\n // true means success and to stop bubbling\n // a promise indicates an async handler that needs to finish before progressing\n handlerResult = handlersEsc[jj]();\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._preserveStack(ParserStackType.ESC, handlersEsc, jj, transition, i);\n return handlerResult;\n }\n }\n if (jj < 0) {\n this._escHandlerFb(this._collect << 8 | code);\n }\n this.precedingCodepoint = 0;\n break;\n case ParserAction.CLEAR:\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n case ParserAction.DCS_HOOK:\n this._dcsParser.hook(this._collect << 8 | code, this._params);\n break;\n case ParserAction.DCS_PUT:\n // inner loop - exit DCS_PUT: 0x18, 0x1a, 0x1b, 0x7f, 0x80 - 0x9f\n // unhook triggered by: 0x1b, 0x9c (success) and 0x18, 0x1a (abort)\n for (let j = i + 1; ; ++j) {\n if (j >= length || (code = data[j]) === 0x18 || code === 0x1a || code === 0x1b || (code > 0x7f && code < NON_ASCII_PRINTABLE)) {\n this._dcsParser.put(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.DCS_UNHOOK:\n handlerResult = this._dcsParser.unhook(code !== 0x18 && code !== 0x1a);\n if (handlerResult) {\n this._preserveStack(ParserStackType.DCS, [], 0, transition, i);\n return handlerResult;\n }\n if (code === 0x1b) transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n break;\n case ParserAction.OSC_START:\n this._oscParser.start();\n break;\n case ParserAction.OSC_PUT:\n // inner loop: 0x20 (SP) included, 0x7F (DEL) included\n for (let j = i + 1; ; j++) {\n if (j >= length || (code = data[j]) < 0x20 || (code > 0x7f && code < NON_ASCII_PRINTABLE)) {\n this._oscParser.put(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.OSC_END:\n handlerResult = this._oscParser.end(code !== 0x18 && code !== 0x1a);\n if (handlerResult) {\n this._preserveStack(ParserStackType.OSC, [], 0, transition, i);\n return handlerResult;\n }\n if (code === 0x1b) transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n break;\n }\n this.currentState = transition & TableAccess.TRANSITION_STATE_MASK;\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOscHandler, IHandlerCollection, OscFallbackHandlerType, IOscParser, ISubParserStackState } from 'common/parser/Types';\nimport { OscState, PAYLOAD_LIMIT } from 'common/parser/Constants';\nimport { utf32ToString } from 'common/input/TextDecoder';\nimport { IDisposable } from 'common/Types';\n\nconst EMPTY_HANDLERS: IOscHandler[] = [];\n\nexport class OscParser implements IOscParser {\n private _state = OscState.START;\n private _active = EMPTY_HANDLERS;\n private _id = -1;\n private _handlers: IHandlerCollection = Object.create(null);\n private _handlerFb: OscFallbackHandlerType = () => { };\n private _stack: ISubParserStackState = {\n paused: false,\n loopPosition: 0,\n fallThrough: false\n };\n\n public registerHandler(ident: number, handler: IOscHandler): IDisposable {\n if (this._handlers[ident] === undefined) {\n this._handlers[ident] = [];\n }\n const handlerList = this._handlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearHandler(ident: number): void {\n if (this._handlers[ident]) delete this._handlers[ident];\n }\n public setHandlerFallback(handler: OscFallbackHandlerType): void {\n this._handlerFb = handler;\n }\n\n public dispose(): void {\n this._handlers = Object.create(null);\n this._handlerFb = () => { };\n this._active = EMPTY_HANDLERS;\n }\n\n public reset(): void {\n // force cleanup handlers if payload was already sent\n if (this._state === OscState.PAYLOAD) {\n for (let j = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; j >= 0; --j) {\n this._active[j].end(false);\n }\n }\n this._stack.paused = false;\n this._active = EMPTY_HANDLERS;\n this._id = -1;\n this._state = OscState.START;\n }\n\n private _start(): void {\n this._active = this._handlers[this._id] || EMPTY_HANDLERS;\n if (!this._active.length) {\n this._handlerFb(this._id, 'START');\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].start();\n }\n }\n }\n\n private _put(data: Uint32Array, start: number, end: number): void {\n if (!this._active.length) {\n this._handlerFb(this._id, 'PUT', utf32ToString(data, start, end));\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].put(data, start, end);\n }\n }\n }\n\n public start(): void {\n // always reset leftover handlers\n this.reset();\n this._state = OscState.ID;\n }\n\n /**\n * Put data to current OSC command.\n * Expects the identifier of the OSC command in the form\n * OSC id ; payload ST/BEL\n * Payload chunks are not further processed and get\n * directly passed to the handlers.\n */\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._state === OscState.ABORT) {\n return;\n }\n if (this._state === OscState.ID) {\n while (start < end) {\n const code = data[start++];\n if (code === 0x3b) {\n this._state = OscState.PAYLOAD;\n this._start();\n break;\n }\n if (code < 0x30 || 0x39 < code) {\n this._state = OscState.ABORT;\n return;\n }\n if (this._id === -1) {\n this._id = 0;\n }\n this._id = this._id * 10 + code - 48;\n }\n }\n if (this._state === OscState.PAYLOAD && end - start > 0) {\n this._put(data, start, end);\n }\n }\n\n /**\n * Indicates end of an OSC command.\n * Whether the OSC got aborted or finished normally\n * is indicated by `success`.\n */\n public end(success: boolean, promiseResult: boolean = true): void | Promise {\n if (this._state === OscState.START) {\n return;\n }\n // do nothing if command was faulty\n if (this._state !== OscState.ABORT) {\n // if we are still in ID state and get an early end\n // means that the command has no payload thus we still have\n // to announce START and send END right after\n if (this._state === OscState.ID) {\n this._start();\n }\n\n if (!this._active.length) {\n this._handlerFb(this._id, 'END', success);\n } else {\n let handlerResult: boolean | Promise = false;\n let j = this._active.length - 1;\n let fallThrough = false;\n if (this._stack.paused) {\n j = this._stack.loopPosition - 1;\n handlerResult = promiseResult;\n fallThrough = this._stack.fallThrough;\n this._stack.paused = false;\n }\n if (!fallThrough && handlerResult === false) {\n for (; j >= 0; j--) {\n handlerResult = this._active[j].end(success);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = false;\n return handlerResult;\n }\n }\n j--;\n }\n // cleanup left over handlers\n // we always have to call .end for proper cleanup,\n // here we use `success` to indicate whether a handler should execute\n for (; j >= 0; j--) {\n handlerResult = this._active[j].end(false);\n if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = true;\n return handlerResult;\n }\n }\n }\n\n }\n this._active = EMPTY_HANDLERS;\n this._id = -1;\n this._state = OscState.START;\n }\n}\n\n/**\n * Convenient class to allow attaching string based handler functions\n * as OSC handlers.\n */\nexport class OscHandler implements IOscHandler {\n private _data = '';\n private _hitLimit: boolean = false;\n\n constructor(private _handler: (data: string) => boolean | Promise) { }\n\n public start(): void {\n this._data = '';\n this._hitLimit = false;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._hitLimit) {\n return;\n }\n this._data += utf32ToString(data, start, end);\n if (this._data.length > PAYLOAD_LIMIT) {\n this._data = '';\n this._hitLimit = true;\n }\n }\n\n public end(success: boolean): boolean | Promise {\n let ret: boolean | Promise = false;\n if (this._hitLimit) {\n ret = false;\n } else if (success) {\n ret = this._handler(this._data);\n if (ret instanceof Promise) {\n // need to hold data until `ret` got resolved\n // dont care for errors, data will be freed anyway on next start\n return ret.then(res => {\n this._data = '';\n this._hitLimit = false;\n return res;\n });\n }\n }\n this._data = '';\n this._hitLimit = false;\n return ret;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IParams, ParamsArray } from 'common/parser/Types';\n\n// max value supported for a single param/subparam (clamped to positive int32 range)\nconst MAX_VALUE = 0x7FFFFFFF;\n// max allowed subparams for a single sequence (hardcoded limitation)\nconst MAX_SUBPARAMS = 256;\n\n/**\n * Params storage class.\n * This type is used by the parser to accumulate sequence parameters and sub parameters\n * and transmit them to the input handler actions.\n *\n * NOTES:\n * - params object for action handlers is borrowed, use `.toArray` or `.clone` to get a copy\n * - never read beyond `params.length - 1` (likely to contain arbitrary data)\n * - `.getSubParams` returns a borrowed typed array, use `.getSubParamsAll` for cloned sub params\n * - hardcoded limitations:\n * - max. value for a single (sub) param is 2^31 - 1 (greater values are clamped to that)\n * - max. 256 sub params possible\n * - negative values are not allowed beside -1 (placeholder for default value)\n *\n * About ZDM (Zero Default Mode):\n * ZDM is not orchestrated by this class. If the parser is in ZDM,\n * it should add 0 for empty params, otherwise -1. This does not apply\n * to subparams, empty subparams should always be added with -1.\n */\nexport class Params implements IParams {\n // params store and length\n public params: Int32Array;\n public length: number;\n\n // sub params store and length\n protected _subParams: Int32Array;\n protected _subParamsLength: number;\n\n // sub params offsets from param: param idx --> [start, end] offset\n private _subParamsIdx: Uint16Array;\n private _rejectDigits: boolean;\n private _rejectSubDigits: boolean;\n private _digitIsSub: boolean;\n\n /**\n * Create a `Params` type from JS array representation.\n */\n public static fromArray(values: ParamsArray): Params {\n const params = new Params();\n if (!values.length) {\n return params;\n }\n // skip leading sub params\n for (let i = (Array.isArray(values[0])) ? 1 : 0; i < values.length; ++i) {\n const value = values[i];\n if (Array.isArray(value)) {\n for (let k = 0; k < value.length; ++k) {\n params.addSubParam(value[k]);\n }\n } else {\n params.addParam(value);\n }\n }\n return params;\n }\n\n /**\n * @param maxLength max length of storable parameters\n * @param maxSubParamsLength max length of storable sub parameters\n */\n constructor(public maxLength: number = 32, public maxSubParamsLength: number = 32) {\n if (maxSubParamsLength > MAX_SUBPARAMS) {\n throw new Error('maxSubParamsLength must not be greater than 256');\n }\n this.params = new Int32Array(maxLength);\n this.length = 0;\n this._subParams = new Int32Array(maxSubParamsLength);\n this._subParamsLength = 0;\n this._subParamsIdx = new Uint16Array(maxLength);\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }\n\n /**\n * Clone object.\n */\n public clone(): Params {\n const newParams = new Params(this.maxLength, this.maxSubParamsLength);\n newParams.params.set(this.params);\n newParams.length = this.length;\n newParams._subParams.set(this._subParams);\n newParams._subParamsLength = this._subParamsLength;\n newParams._subParamsIdx.set(this._subParamsIdx);\n newParams._rejectDigits = this._rejectDigits;\n newParams._rejectSubDigits = this._rejectSubDigits;\n newParams._digitIsSub = this._digitIsSub;\n return newParams;\n }\n\n /**\n * Get a JS array representation of the current parameters and sub parameters.\n * The array is structured as follows:\n * sequence: \"1;2:3:4;5::6\"\n * array : [1, 2, [3, 4], 5, [-1, 6]]\n */\n public toArray(): ParamsArray {\n const res: ParamsArray = [];\n for (let i = 0; i < this.length; ++i) {\n res.push(this.params[i]);\n const start = this._subParamsIdx[i] >> 8;\n const end = this._subParamsIdx[i] & 0xFF;\n if (end - start > 0) {\n res.push(Array.prototype.slice.call(this._subParams, start, end));\n }\n }\n return res;\n }\n\n /**\n * Reset to initial empty state.\n */\n public reset(): void {\n this.length = 0;\n this._subParamsLength = 0;\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }\n\n /**\n * Add a parameter value.\n * `Params` only stores up to `maxLength` parameters, any later\n * parameter will be ignored.\n * Note: VT devices only stored up to 16 values, xterm seems to\n * store up to 30.\n */\n public addParam(value: number): void {\n this._digitIsSub = false;\n if (this.length >= this.maxLength) {\n this._rejectDigits = true;\n return;\n }\n if (value < -1) {\n throw new Error('values lesser than -1 are not allowed');\n }\n this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength;\n this.params[this.length++] = value > MAX_VALUE ? MAX_VALUE : value;\n }\n\n /**\n * Add a sub parameter value.\n * The sub parameter is automatically associated with the last parameter value.\n * Thus it is not possible to add a subparameter without any parameter added yet.\n * `Params` only stores up to `subParamsLength` sub parameters, any later\n * sub parameter will be ignored.\n */\n public addSubParam(value: number): void {\n this._digitIsSub = true;\n if (!this.length) {\n return;\n }\n if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) {\n this._rejectSubDigits = true;\n return;\n }\n if (value < -1) {\n throw new Error('values lesser than -1 are not allowed');\n }\n this._subParams[this._subParamsLength++] = value > MAX_VALUE ? MAX_VALUE : value;\n this._subParamsIdx[this.length - 1]++;\n }\n\n /**\n * Whether parameter at index `idx` has sub parameters.\n */\n public hasSubParams(idx: number): boolean {\n return ((this._subParamsIdx[idx] & 0xFF) - (this._subParamsIdx[idx] >> 8) > 0);\n }\n\n /**\n * Return sub parameters for parameter at index `idx`.\n * Note: The values are borrowed, thus you need to copy\n * the values if you need to hold them in nonlocal scope.\n */\n public getSubParams(idx: number): Int32Array | null {\n const start = this._subParamsIdx[idx] >> 8;\n const end = this._subParamsIdx[idx] & 0xFF;\n if (end - start > 0) {\n return this._subParams.subarray(start, end);\n }\n return null;\n }\n\n /**\n * Return all sub parameters as {idx: subparams} mapping.\n * Note: The values are not borrowed.\n */\n public getSubParamsAll(): {[idx: number]: Int32Array} {\n const result: {[idx: number]: Int32Array} = {};\n for (let i = 0; i < this.length; ++i) {\n const start = this._subParamsIdx[i] >> 8;\n const end = this._subParamsIdx[i] & 0xFF;\n if (end - start > 0) {\n result[i] = this._subParams.slice(start, end);\n }\n }\n return result;\n }\n\n /**\n * Add a single digit value to current parameter.\n * This is used by the parser to account digits on a char by char basis.\n */\n public addDigit(value: number): void {\n let length;\n if (this._rejectDigits\n || !(length = this._digitIsSub ? this._subParamsLength : this.length)\n || (this._digitIsSub && this._rejectSubDigits)\n ) {\n return;\n }\n\n const store = this._digitIsSub ? this._subParams : this.params;\n const cur = store[length - 1];\n store[length - 1] = ~cur ? Math.min(cur * 10 + value, MAX_VALUE) : value;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ITerminalAddon, IDisposable, Terminal } from 'xterm';\n\nexport interface ILoadedAddon {\n instance: ITerminalAddon;\n dispose: () => void;\n isDisposed: boolean;\n}\n\nexport class AddonManager implements IDisposable {\n protected _addons: ILoadedAddon[] = [];\n\n constructor() {\n }\n\n public dispose(): void {\n for (let i = this._addons.length - 1; i >= 0; i--) {\n this._addons[i].instance.dispose();\n }\n }\n\n public loadAddon(terminal: Terminal, instance: ITerminalAddon): void {\n const loadedAddon: ILoadedAddon = {\n instance,\n dispose: instance.dispose,\n isDisposed: false\n };\n this._addons.push(loadedAddon);\n instance.dispose = () => this._wrappedAddonDispose(loadedAddon);\n instance.activate(terminal as any);\n }\n\n private _wrappedAddonDispose(loadedAddon: ILoadedAddon): void {\n if (loadedAddon.isDisposed) {\n // Do nothing if already disposed\n return;\n }\n let index = -1;\n for (let i = 0; i < this._addons.length; i++) {\n if (this._addons[i] === loadedAddon) {\n index = i;\n break;\n }\n }\n if (index === -1) {\n throw new Error('Could not dispose an addon that has not been loaded');\n }\n loadedAddon.isDisposed = true;\n loadedAddon.dispose.apply(loadedAddon.instance);\n this._addons.splice(index, 1);\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from 'xterm';\nimport { IBuffer } from 'common/buffer/Types';\nimport { BufferLineApiView } from 'common/public/BufferLineApiView';\nimport { CellData } from 'common/buffer/CellData';\n\nexport class BufferApiView implements IBufferApi {\n constructor(\n private _buffer: IBuffer,\n public readonly type: 'normal' | 'alternate'\n ) { }\n\n public init(buffer: IBuffer): BufferApiView {\n this._buffer = buffer;\n return this;\n }\n\n public get cursorY(): number { return this._buffer.y; }\n public get cursorX(): number { return this._buffer.x; }\n public get viewportY(): number { return this._buffer.ydisp; }\n public get baseY(): number { return this._buffer.ybase; }\n public get length(): number { return this._buffer.lines.length; }\n public getLine(y: number): IBufferLineApi | undefined {\n const line = this._buffer.lines.get(y);\n if (!line) {\n return undefined;\n }\n return new BufferLineApiView(line);\n }\n public getNullCell(): IBufferCellApi { return new CellData(); }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferLine, ICellData } from 'common/Types';\nimport { IBufferCell as IBufferCellApi, IBufferLine as IBufferLineApi } from 'xterm';\n\nexport class BufferLineApiView implements IBufferLineApi {\n constructor(private _line: IBufferLine) { }\n\n public get isWrapped(): boolean { return this._line.isWrapped; }\n public get length(): number { return this._line.length; }\n public getCell(x: number, cell?: IBufferCellApi): IBufferCellApi | undefined {\n if (x < 0 || x >= this._line.length) {\n return undefined;\n }\n\n if (cell) {\n this._line.loadCell(x, cell as ICellData);\n return cell;\n }\n return this._line.loadCell(x, new CellData());\n }\n public translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string {\n return this._line.translateToString(trimRight, startColumn, endColumn);\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi } from 'xterm';\nimport { BufferApiView } from 'common/public/BufferApiView';\nimport { IEvent, EventEmitter } from 'common/EventEmitter';\nimport { ICoreTerminal } from 'common/Types';\n\nexport class BufferNamespaceApi implements IBufferNamespaceApi {\n private _normal: BufferApiView;\n private _alternate: BufferApiView;\n private _onBufferChange = new EventEmitter();\n public get onBufferChange(): IEvent { return this._onBufferChange.event; }\n\n constructor(private _core: ICoreTerminal) {\n this._normal = new BufferApiView(this._core.buffers.normal, 'normal');\n this._alternate = new BufferApiView(this._core.buffers.alt, 'alternate');\n this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active));\n }\n public get active(): IBufferApi {\n if (this._core.buffers.active === this._core.buffers.normal) { return this.normal; }\n if (this._core.buffers.active === this._core.buffers.alt) { return this.alternate; }\n throw new Error('Active buffer is neither normal nor alternate');\n }\n public get normal(): IBufferApi {\n return this._normal.init(this._core.buffers.normal);\n }\n public get alternate(): IBufferApi {\n return this._alternate.init(this._core.buffers.alt);\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IParams } from 'common/parser/Types';\nimport { IDisposable, IFunctionIdentifier, IParser } from 'xterm';\nimport { ICoreTerminal } from 'common/Types';\n\nexport class ParserApi implements IParser {\n constructor(private _core: ICoreTerminal) { }\n\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean | Promise): IDisposable {\n return this._core.registerCsiHandler(id, (params: IParams) => callback(params.toArray()));\n }\n public addCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean | Promise): IDisposable {\n return this.registerCsiHandler(id, callback);\n }\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean | Promise): IDisposable {\n return this._core.registerDcsHandler(id, (data: string, params: IParams) => callback(data, params.toArray()));\n }\n public addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean | Promise): IDisposable {\n return this.registerDcsHandler(id, callback);\n }\n public registerEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise): IDisposable {\n return this._core.registerEscHandler(id, handler);\n }\n public addEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise): IDisposable {\n return this.registerEscHandler(id, handler);\n }\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable {\n return this._core.registerOscHandler(ident, callback);\n }\n public addOscHandler(ident: number, callback: (data: string) => boolean | Promise): IDisposable {\n return this.registerOscHandler(ident, callback);\n }\n}\n", "/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreTerminal } from 'common/Types';\nimport { IUnicodeHandling, IUnicodeVersionProvider } from 'xterm';\n\nexport class UnicodeApi implements IUnicodeHandling {\n constructor(private _core: ICoreTerminal) { }\n\n public register(provider: IUnicodeVersionProvider): void {\n this._core.unicodeService.register(provider);\n }\n\n public get versions(): string[] {\n return this._core.unicodeService.versions;\n }\n\n public get activeVersion(): string {\n return this._core.unicodeService.activeVersion;\n }\n\n public set activeVersion(version: string) {\n this._core.unicodeService.activeVersion = version;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferService, IOptionsService } from 'common/services/Services';\nimport { BufferSet } from 'common/buffer/BufferSet';\nimport { IBufferSet, IBuffer } from 'common/buffer/Types';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { IAttributeData, IBufferLine, ScrollSource } from 'common/Types';\n\nexport const MINIMUM_COLS = 2; // Less than 2 can mess with wide chars\nexport const MINIMUM_ROWS = 1;\n\nexport class BufferService extends Disposable implements IBufferService {\n public serviceBrand: any;\n\n public cols: number;\n public rows: number;\n public buffers: IBufferSet;\n /** Whether the user is scrolling (locks the scroll position) */\n public isUserScrolling: boolean = false;\n\n private _onResize = new EventEmitter<{ cols: number, rows: number }>();\n public get onResize(): IEvent<{ cols: number, rows: number }> { return this._onResize.event; }\n private _onScroll = new EventEmitter();\n public get onScroll(): IEvent { return this._onScroll.event; }\n\n public get buffer(): IBuffer { return this.buffers.active; }\n\n /** An IBufferline to clone/copy from for new blank lines */\n private _cachedBlankLine: IBufferLine | undefined;\n\n constructor(\n @IOptionsService private _optionsService: IOptionsService\n ) {\n super();\n this.cols = Math.max(_optionsService.rawOptions.cols || 0, MINIMUM_COLS);\n this.rows = Math.max(_optionsService.rawOptions.rows || 0, MINIMUM_ROWS);\n this.buffers = new BufferSet(_optionsService, this);\n }\n\n public dispose(): void {\n super.dispose();\n this.buffers.dispose();\n }\n\n public resize(cols: number, rows: number): void {\n this.cols = cols;\n this.rows = rows;\n this.buffers.resize(cols, rows);\n this.buffers.setupTabStops(this.cols);\n this._onResize.fire({ cols, rows });\n }\n\n public reset(): void {\n this.buffers.reset();\n this.isUserScrolling = false;\n }\n\n /**\n * Scroll the terminal down 1 row, creating a blank line.\n * @param isWrapped Whether the new line is wrapped from the previous line.\n */\n public scroll(eraseAttr: IAttributeData, isWrapped: boolean = false): void {\n const buffer = this.buffer;\n\n let newLine: IBufferLine | undefined;\n newLine = this._cachedBlankLine;\n if (!newLine || newLine.length !== this.cols || newLine.getFg(0) !== eraseAttr.fg || newLine.getBg(0) !== eraseAttr.bg) {\n newLine = buffer.getBlankLine(eraseAttr, isWrapped);\n this._cachedBlankLine = newLine;\n }\n newLine.isWrapped = isWrapped;\n\n const topRow = buffer.ybase + buffer.scrollTop;\n const bottomRow = buffer.ybase + buffer.scrollBottom;\n\n if (buffer.scrollTop === 0) {\n // Determine whether the buffer is going to be trimmed after insertion.\n const willBufferBeTrimmed = buffer.lines.isFull;\n\n // Insert the line using the fastest method\n if (bottomRow === buffer.lines.length - 1) {\n if (willBufferBeTrimmed) {\n buffer.lines.recycle().copyFrom(newLine);\n } else {\n buffer.lines.push(newLine.clone());\n }\n } else {\n buffer.lines.splice(bottomRow + 1, 0, newLine.clone());\n }\n\n // Only adjust ybase and ydisp when the buffer is not trimmed\n if (!willBufferBeTrimmed) {\n buffer.ybase++;\n // Only scroll the ydisp with ybase if the user has not scrolled up\n if (!this.isUserScrolling) {\n buffer.ydisp++;\n }\n } else {\n // When the buffer is full and the user has scrolled up, keep the text\n // stable unless ydisp is right at the top\n if (this.isUserScrolling) {\n buffer.ydisp = Math.max(buffer.ydisp - 1, 0);\n }\n }\n } else {\n // scrollTop is non-zero which means no line will be going to the\n // scrollback, instead we can just shift them in-place.\n const scrollRegionHeight = bottomRow - topRow + 1 /* as it's zero-based */;\n buffer.lines.shiftElements(topRow + 1, scrollRegionHeight - 1, -1);\n buffer.lines.set(bottomRow, newLine.clone());\n }\n\n // Move the viewport to the bottom of the buffer unless the user is\n // scrolling.\n if (!this.isUserScrolling) {\n buffer.ydisp = buffer.ybase;\n }\n\n this._onScroll.fire(buffer.ydisp);\n }\n\n /**\n * Scroll the display of the terminal\n * @param disp The number of lines to scroll down (negative scroll up).\n * @param suppressScrollEvent Don't emit the scroll event as scrollLines. This is used\n * to avoid unwanted events being handled by the viewport when the event was triggered from the\n * viewport originally.\n */\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void {\n const buffer = this.buffer;\n if (disp < 0) {\n if (buffer.ydisp === 0) {\n return;\n }\n this.isUserScrolling = true;\n } else if (disp + buffer.ydisp >= buffer.ybase) {\n this.isUserScrolling = false;\n }\n\n const oldYdisp = buffer.ydisp;\n buffer.ydisp = Math.max(Math.min(buffer.ydisp + disp, buffer.ybase), 0);\n\n // No change occurred, don't trigger scroll/refresh\n if (oldYdisp === buffer.ydisp) {\n return;\n }\n\n if (!suppressScrollEvent) {\n this._onScroll.fire(buffer.ydisp);\n }\n }\n\n /**\n * Scroll the display of the terminal by a number of pages.\n * @param pageCount The number of pages to scroll (negative scrolls up).\n */\n public scrollPages(pageCount: number): void {\n this.scrollLines(pageCount * (this.rows - 1));\n }\n\n /**\n * Scrolls the display of the terminal to the top.\n */\n public scrollToTop(): void {\n this.scrollLines(-this.buffer.ydisp);\n }\n\n /**\n * Scrolls the display of the terminal to the bottom.\n */\n public scrollToBottom(): void {\n this.scrollLines(this.buffer.ybase - this.buffer.ydisp);\n }\n\n public scrollToLine(line: number): void {\n const scrollAmount = line - this.buffer.ydisp;\n if (scrollAmount !== 0) {\n this.scrollLines(scrollAmount);\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharsetService } from 'common/services/Services';\nimport { ICharset } from 'common/Types';\n\nexport class CharsetService implements ICharsetService {\n public serviceBrand: any;\n\n public charset: ICharset | undefined;\n public glevel: number = 0;\n\n private _charsets: (ICharset | undefined)[] = [];\n\n public reset(): void {\n this.charset = undefined;\n this._charsets = [];\n this.glevel = 0;\n }\n\n public setgLevel(g: number): void {\n this.glevel = g;\n this.charset = this._charsets[g];\n }\n\n public setgCharset(g: number, charset: ICharset | undefined): void {\n this._charsets[g] = charset;\n if (this.glevel === g) {\n this.charset = charset;\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IBufferService, ICoreService, ICoreMouseService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { ICoreMouseProtocol, ICoreMouseEvent, CoreMouseEncoding, CoreMouseEventType, CoreMouseButton, CoreMouseAction } from 'common/Types';\n\n/**\n * Supported default protocols.\n */\nconst DEFAULT_PROTOCOLS: {[key: string]: ICoreMouseProtocol} = {\n /**\n * NONE\n * Events: none\n * Modifiers: none\n */\n NONE: {\n events: CoreMouseEventType.NONE,\n restrict: () => false\n },\n /**\n * X10\n * Events: mousedown\n * Modifiers: none\n */\n X10: {\n events: CoreMouseEventType.DOWN,\n restrict: (e: ICoreMouseEvent) => {\n // no wheel, no move, no up\n if (e.button === CoreMouseButton.WHEEL || e.action !== CoreMouseAction.DOWN) {\n return false;\n }\n // no modifiers\n e.ctrl = false;\n e.alt = false;\n e.shift = false;\n return true;\n }\n },\n /**\n * VT200\n * Events: mousedown / mouseup / wheel\n * Modifiers: all\n */\n VT200: {\n events: CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL,\n restrict: (e: ICoreMouseEvent) => {\n // no move\n if (e.action === CoreMouseAction.MOVE) {\n return false;\n }\n return true;\n }\n },\n /**\n * DRAG\n * Events: mousedown / mouseup / wheel / mousedrag\n * Modifiers: all\n */\n DRAG: {\n events: CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL | CoreMouseEventType.DRAG,\n restrict: (e: ICoreMouseEvent) => {\n // no move without button\n if (e.action === CoreMouseAction.MOVE && e.button === CoreMouseButton.NONE) {\n return false;\n }\n return true;\n }\n },\n /**\n * ANY\n * Events: all mouse related events\n * Modifiers: all\n */\n ANY: {\n events:\n CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL\n | CoreMouseEventType.DRAG | CoreMouseEventType.MOVE,\n restrict: (e: ICoreMouseEvent) => true\n }\n};\n\nconst enum Modifiers {\n SHIFT = 4,\n ALT = 8,\n CTRL = 16\n}\n\n// helper for default encoders to generate the event code.\nfunction eventCode(e: ICoreMouseEvent, isSGR: boolean): number {\n let code = (e.ctrl ? Modifiers.CTRL : 0) | (e.shift ? Modifiers.SHIFT : 0) | (e.alt ? Modifiers.ALT : 0);\n if (e.button === CoreMouseButton.WHEEL) {\n code |= 64;\n code |= e.action;\n } else {\n code |= e.button & 3;\n if (e.button & 4) {\n code |= 64;\n }\n if (e.button & 8) {\n code |= 128;\n }\n if (e.action === CoreMouseAction.MOVE) {\n code |= CoreMouseAction.MOVE;\n } else if (e.action === CoreMouseAction.UP && !isSGR) {\n // special case - only SGR can report button on release\n // all others have to go with NONE\n code |= CoreMouseButton.NONE;\n }\n }\n return code;\n}\n\nconst S = String.fromCharCode;\n\n/**\n * Supported default encodings.\n */\nconst DEFAULT_ENCODINGS: {[key: string]: CoreMouseEncoding} = {\n /**\n * DEFAULT - CSI M Pb Px Py\n * Single byte encoding for coords and event code.\n * Can encode values up to 223 (1-based).\n */\n DEFAULT: (e: ICoreMouseEvent) => {\n const params = [eventCode(e, false) + 32, e.col + 32, e.row + 32];\n // supress mouse report if we exceed addressible range\n // Note this is handled differently by emulators\n // - xterm: sends 0;0 coords instead\n // - vte, konsole: no report\n if (params[0] > 255 || params[1] > 255 || params[2] > 255) {\n return '';\n }\n return `\\x1b[M${S(params[0])}${S(params[1])}${S(params[2])}`;\n },\n /**\n * SGR - CSI < Pb ; Px ; Py M|m\n * No encoding limitation.\n * Can report button on release and works with a well formed sequence.\n */\n SGR: (e: ICoreMouseEvent) => {\n const final = (e.action === CoreMouseAction.UP && e.button !== CoreMouseButton.WHEEL) ? 'm' : 'M';\n return `\\x1b[<${eventCode(e, true)};${e.col};${e.row}${final}`;\n }\n};\n\n/**\n * CoreMouseService\n *\n * Provides mouse tracking reports with different protocols and encodings.\n * - protocols: NONE (default), X10, VT200, DRAG, ANY\n * - encodings: DEFAULT, SGR (UTF8, URXVT removed in #2507)\n *\n * Custom protocols/encodings can be added by `addProtocol` / `addEncoding`.\n * To activate a protocol/encoding, set `activeProtocol` / `activeEncoding`.\n * Switching a protocol will send a notification event `onProtocolChange`\n * with a list of needed events to track.\n *\n * The service handles the mouse tracking state and decides whether to send\n * a tracking report to the backend based on protocol and encoding limitations.\n * To send a mouse event call `triggerMouseEvent`.\n */\nexport class CoreMouseService implements ICoreMouseService {\n private _protocols: {[name: string]: ICoreMouseProtocol} = {};\n private _encodings: {[name: string]: CoreMouseEncoding} = {};\n private _activeProtocol: string = '';\n private _activeEncoding: string = '';\n private _onProtocolChange = new EventEmitter();\n private _lastEvent: ICoreMouseEvent | null = null;\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService,\n @ICoreService private readonly _coreService: ICoreService\n ) {\n // register default protocols and encodings\n for (const name of Object.keys(DEFAULT_PROTOCOLS)) this.addProtocol(name, DEFAULT_PROTOCOLS[name]);\n for (const name of Object.keys(DEFAULT_ENCODINGS)) this.addEncoding(name, DEFAULT_ENCODINGS[name]);\n // call reset to set defaults\n this.reset();\n }\n\n public addProtocol(name: string, protocol: ICoreMouseProtocol): void {\n this._protocols[name] = protocol;\n }\n\n public addEncoding(name: string, encoding: CoreMouseEncoding): void {\n this._encodings[name] = encoding;\n }\n\n public get activeProtocol(): string {\n return this._activeProtocol;\n }\n\n public get areMouseEventsActive(): boolean {\n return this._protocols[this._activeProtocol].events !== 0;\n }\n\n public set activeProtocol(name: string) {\n if (!this._protocols[name]) {\n throw new Error(`unknown protocol \"${name}\"`);\n }\n this._activeProtocol = name;\n this._onProtocolChange.fire(this._protocols[name].events);\n }\n\n public get activeEncoding(): string {\n return this._activeEncoding;\n }\n\n public set activeEncoding(name: string) {\n if (!this._encodings[name]) {\n throw new Error(`unknown encoding \"${name}\"`);\n }\n this._activeEncoding = name;\n }\n\n public reset(): void {\n this.activeProtocol = 'NONE';\n this.activeEncoding = 'DEFAULT';\n this._lastEvent = null;\n }\n\n /**\n * Event to announce changes in mouse tracking.\n */\n public get onProtocolChange(): IEvent {\n return this._onProtocolChange.event;\n }\n\n /**\n * Triggers a mouse event to be sent.\n *\n * Returns true if the event passed all protocol restrictions and a report\n * was sent, otherwise false. The return value may be used to decide whether\n * the default event action in the bowser component should be omitted.\n *\n * Note: The method will change values of the given event object\n * to fullfill protocol and encoding restrictions.\n */\n public triggerMouseEvent(e: ICoreMouseEvent): boolean {\n // range check for col/row\n if (e.col < 0 || e.col >= this._bufferService.cols\n || e.row < 0 || e.row >= this._bufferService.rows) {\n return false;\n }\n\n // filter nonsense combinations of button + action\n if (e.button === CoreMouseButton.WHEEL && e.action === CoreMouseAction.MOVE) {\n return false;\n }\n if (e.button === CoreMouseButton.NONE && e.action !== CoreMouseAction.MOVE) {\n return false;\n }\n if (e.button !== CoreMouseButton.WHEEL && (e.action === CoreMouseAction.LEFT || e.action === CoreMouseAction.RIGHT)) {\n return false;\n }\n\n // report 1-based coords\n e.col++;\n e.row++;\n\n // debounce move at grid level\n if (e.action === CoreMouseAction.MOVE && this._lastEvent && this._compareEvents(this._lastEvent, e)) {\n return false;\n }\n\n // apply protocol restrictions\n if (!this._protocols[this._activeProtocol].restrict(e)) {\n return false;\n }\n\n // encode report and send\n const report = this._encodings[this._activeEncoding](e);\n if (report) {\n // always send DEFAULT as binary data\n if (this._activeEncoding === 'DEFAULT') {\n this._coreService.triggerBinaryEvent(report);\n } else {\n this._coreService.triggerDataEvent(report, true);\n }\n }\n\n this._lastEvent = e;\n\n return true;\n }\n\n public explainEvents(events: CoreMouseEventType): {[event: string]: boolean} {\n return {\n down: !!(events & CoreMouseEventType.DOWN),\n up: !!(events & CoreMouseEventType.UP),\n drag: !!(events & CoreMouseEventType.DRAG),\n move: !!(events & CoreMouseEventType.MOVE),\n wheel: !!(events & CoreMouseEventType.WHEEL)\n };\n }\n\n private _compareEvents(e1: ICoreMouseEvent, e2: ICoreMouseEvent): boolean {\n if (e1.col !== e2.col) return false;\n if (e1.row !== e2.row) return false;\n if (e1.button !== e2.button) return false;\n if (e1.action !== e2.action) return false;\n if (e1.ctrl !== e2.ctrl) return false;\n if (e1.alt !== e2.alt) return false;\n if (e1.shift !== e2.shift) return false;\n return true;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreService, ILogService, IOptionsService, IBufferService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IDecPrivateModes, IModes } from 'common/Types';\nimport { clone } from 'common/Clone';\nimport { Disposable } from 'common/Lifecycle';\n\nconst DEFAULT_MODES: IModes = Object.freeze({\n insertMode: false\n});\n\nconst DEFAULT_DEC_PRIVATE_MODES: IDecPrivateModes = Object.freeze({\n applicationCursorKeys: false,\n applicationKeypad: false,\n bracketedPasteMode: false,\n origin: false,\n reverseWraparound: false,\n sendFocus: false,\n wraparound: true // defaults: xterm - true, vt100 - false\n});\n\nexport class CoreService extends Disposable implements ICoreService {\n public serviceBrand: any;\n\n public isCursorInitialized: boolean = false;\n public isCursorHidden: boolean = false;\n public modes: IModes;\n public decPrivateModes: IDecPrivateModes;\n\n // Circular dependency, this must be unset or memory will leak after Terminal.dispose\n private _scrollToBottom: (() => void) | undefined;\n\n private _onData = this.register(new EventEmitter());\n public get onData(): IEvent { return this._onData.event; }\n private _onUserInput = this.register(new EventEmitter());\n public get onUserInput(): IEvent { return this._onUserInput.event; }\n private _onBinary = this.register(new EventEmitter());\n public get onBinary(): IEvent { return this._onBinary.event; }\n\n constructor(\n // TODO: Move this into a service\n scrollToBottom: () => void,\n @IBufferService private readonly _bufferService: IBufferService,\n @ILogService private readonly _logService: ILogService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n this._scrollToBottom = scrollToBottom;\n this.register({ dispose: () => this._scrollToBottom = undefined });\n this.modes = clone(DEFAULT_MODES);\n this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);\n }\n\n public reset(): void {\n this.modes = clone(DEFAULT_MODES);\n this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);\n }\n\n public triggerDataEvent(data: string, wasUserInput: boolean = false): void {\n // Prevents all events to pty process if stdin is disabled\n if (this._optionsService.rawOptions.disableStdin) {\n return;\n }\n\n // Input is being sent to the terminal, the terminal should focus the prompt.\n const buffer = this._bufferService.buffer;\n if (buffer.ybase !== buffer.ydisp) {\n this._scrollToBottom!();\n }\n\n // Fire onUserInput so listeners can react as well (eg. clear selection)\n if (wasUserInput) {\n this._onUserInput.fire();\n }\n\n // Fire onData API\n this._logService.debug(`sending data \"${data}\"`, () => data.split('').map(e => e.charCodeAt(0)));\n this._onData.fire(data);\n }\n\n public triggerBinaryEvent(data: string): void {\n if (this._optionsService.rawOptions.disableStdin) {\n return;\n }\n this._logService.debug(`sending binary \"${data}\"`, () => data.split('').map(e => e.charCodeAt(0)));\n this._onBinary.fire(data);\n }\n}\n", "/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { css } from 'common/Color';\nimport { EventEmitter } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { IDecorationService, IInternalDecoration } from 'common/services/Services';\nimport { SortedList } from 'common/SortedList';\nimport { IColor } from 'common/Types';\nimport { IDecorationOptions, IDecoration, IMarker, IEvent } from 'xterm';\n\nexport class DecorationService extends Disposable implements IDecorationService {\n public serviceBrand: any;\n\n /**\n * A list of all decorations, sorted by the marker's line value. This relies on the fact that\n * while marker line values do change, they should all change by the same amount so this should\n * never become out of order.\n */\n private readonly _decorations: SortedList = new SortedList(e => e.marker.line);\n\n private _onDecorationRegistered = this.register(new EventEmitter());\n public get onDecorationRegistered(): IEvent { return this._onDecorationRegistered.event; }\n private _onDecorationRemoved = this.register(new EventEmitter());\n public get onDecorationRemoved(): IEvent { return this._onDecorationRemoved.event; }\n\n public get decorations(): IterableIterator { return this._decorations.values(); }\n\n constructor() {\n super();\n }\n\n public registerDecoration(options: IDecorationOptions): IDecoration | undefined {\n if (options.marker.isDisposed) {\n return undefined;\n }\n const decoration = new Decoration(options);\n if (decoration) {\n const markerDispose = decoration.marker.onDispose(() => decoration.dispose());\n decoration.onDispose(() => {\n if (decoration) {\n if (this._decorations.delete(decoration)) {\n this._onDecorationRemoved.fire(decoration);\n }\n markerDispose.dispose();\n }\n });\n this._decorations.insert(decoration);\n this._onDecorationRegistered.fire(decoration);\n }\n return decoration;\n }\n\n public reset(): void {\n for (const d of this._decorations.values()) {\n d.dispose();\n }\n this._decorations.clear();\n }\n\n public *getDecorationsAtLine(line: number): IterableIterator {\n return this._decorations.getKeyIterator(line);\n }\n\n public *getDecorationsAtCell(x: number, line: number, layer?: 'bottom' | 'top'): IterableIterator {\n let xmin = 0;\n let xmax = 0;\n for (const d of this._decorations.getKeyIterator(line)) {\n xmin = d.options.x ?? 0;\n xmax = xmin + (d.options.width ?? 1);\n if (x >= xmin && x < xmax && (!layer || (d.options.layer ?? 'bottom') === layer)) {\n yield d;\n }\n }\n }\n\n public dispose(): void {\n for (const d of this._decorations.values()) {\n this._onDecorationRemoved.fire(d);\n }\n this.reset();\n }\n}\n\nclass Decoration extends Disposable implements IInternalDecoration {\n public readonly marker: IMarker;\n public element: HTMLElement | undefined;\n public isDisposed: boolean = false;\n\n public readonly onRenderEmitter = this.register(new EventEmitter());\n public readonly onRender = this.onRenderEmitter.event;\n private _onDispose = this.register(new EventEmitter());\n public readonly onDispose = this._onDispose.event;\n\n private _cachedBg: IColor | undefined | null = null;\n public get backgroundColorRGB(): IColor | undefined {\n if (this._cachedBg === null) {\n if (this.options.backgroundColor) {\n this._cachedBg = css.toColor(this.options.backgroundColor);\n } else {\n this._cachedBg = undefined;\n }\n }\n return this._cachedBg;\n }\n\n private _cachedFg: IColor | undefined | null = null;\n public get foregroundColorRGB(): IColor | undefined {\n if (this._cachedFg === null) {\n if (this.options.foregroundColor) {\n this._cachedFg = css.toColor(this.options.foregroundColor);\n } else {\n this._cachedFg = undefined;\n }\n }\n return this._cachedFg;\n }\n\n constructor(\n public readonly options: IDecorationOptions\n ) {\n super();\n this.marker = options.marker;\n if (this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position) {\n this.options.overviewRulerOptions.position = 'full';\n }\n }\n\n public override dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n this._onDispose.fire();\n super.dispose();\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferService, IDirtyRowService } from 'common/services/Services';\n\nexport class DirtyRowService implements IDirtyRowService {\n public serviceBrand: any;\n\n private _start!: number;\n private _end!: number;\n\n public get start(): number { return this._start; }\n public get end(): number { return this._end; }\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n this.clearRange();\n }\n\n public clearRange(): void {\n this._start = this._bufferService.buffer.y;\n this._end = this._bufferService.buffer.y;\n }\n\n public markDirty(y: number): void {\n if (y < this._start) {\n this._start = y;\n } else if (y > this._end) {\n this._end = y;\n }\n }\n\n public markRangeDirty(y1: number, y2: number): void {\n if (y1 > y2) {\n const temp = y1;\n y1 = y2;\n y2 = temp;\n }\n if (y1 < this._start) {\n this._start = y1;\n }\n if (y2 > this._end) {\n this._end = y2;\n }\n }\n\n public markAllDirty(): void {\n this.markRangeDirty(0, this._bufferService.rows - 1);\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * This was heavily inspired from microsoft/vscode's dependency injection system (MIT).\n */\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IInstantiationService, IServiceIdentifier } from 'common/services/Services';\nimport { getServiceDependencies } from 'common/services/ServiceRegistry';\n\nexport class ServiceCollection {\n\n private _entries = new Map, any>();\n\n constructor(...entries: [IServiceIdentifier, any][]) {\n for (const [id, service] of entries) {\n this.set(id, service);\n }\n }\n\n public set(id: IServiceIdentifier, instance: T): T {\n const result = this._entries.get(id);\n this._entries.set(id, instance);\n return result;\n }\n\n public forEach(callback: (id: IServiceIdentifier, instance: any) => any): void {\n this._entries.forEach((value, key) => callback(key, value));\n }\n\n public has(id: IServiceIdentifier): boolean {\n return this._entries.has(id);\n }\n\n public get(id: IServiceIdentifier): T | undefined {\n return this._entries.get(id);\n }\n}\n\nexport class InstantiationService implements IInstantiationService {\n public serviceBrand: undefined;\n\n private readonly _services: ServiceCollection = new ServiceCollection();\n\n constructor() {\n this._services.set(IInstantiationService, this);\n }\n\n public setService(id: IServiceIdentifier, instance: T): void {\n this._services.set(id, instance);\n }\n\n public getService(id: IServiceIdentifier): T | undefined {\n return this._services.get(id);\n }\n\n public createInstance(ctor: any, ...args: any[]): T {\n const serviceDependencies = getServiceDependencies(ctor).sort((a, b) => a.index - b.index);\n\n const serviceArgs: any[] = [];\n for (const dependency of serviceDependencies) {\n const service = this._services.get(dependency.id);\n if (!service) {\n throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`);\n }\n serviceArgs.push(service);\n }\n\n const firstServiceArgPos = serviceDependencies.length > 0 ? serviceDependencies[0].index : args.length;\n\n // check for argument mismatches, adjust static args if needed\n if (args.length !== firstServiceArgPos) {\n throw new Error(`[createInstance] First service dependency of ${ctor.name} at position ${firstServiceArgPos + 1} conflicts with ${args.length} static arguments`);\n }\n\n // now create the instance\n return new ctor(...[...args, ...serviceArgs]);\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILogService, IOptionsService, LogLevelEnum } from 'common/services/Services';\n\ntype LogType = (message?: any, ...optionalParams: any[]) => void;\n\ninterface IConsole {\n log: LogType;\n error: LogType;\n info: LogType;\n trace: LogType;\n warn: LogType;\n}\n\n// console is available on both node.js and browser contexts but the common\n// module doesn't depend on them so we need to explicitly declare it.\ndeclare const console: IConsole;\n\nconst optionsKeyToLogLevel: { [key: string]: LogLevelEnum } = {\n debug: LogLevelEnum.DEBUG,\n info: LogLevelEnum.INFO,\n warn: LogLevelEnum.WARN,\n error: LogLevelEnum.ERROR,\n off: LogLevelEnum.OFF\n};\n\nconst LOG_PREFIX = 'xterm.js: ';\n\nexport class LogService implements ILogService {\n public serviceBrand: any;\n\n public logLevel: LogLevelEnum = LogLevelEnum.OFF;\n\n constructor(\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n this._updateLogLevel();\n this._optionsService.onOptionChange(key => {\n if (key === 'logLevel') {\n this._updateLogLevel();\n }\n });\n }\n\n private _updateLogLevel(): void {\n this.logLevel = optionsKeyToLogLevel[this._optionsService.rawOptions.logLevel];\n }\n\n private _evalLazyOptionalParams(optionalParams: any[]): void {\n for (let i = 0; i < optionalParams.length; i++) {\n if (typeof optionalParams[i] === 'function') {\n optionalParams[i] = optionalParams[i]();\n }\n }\n }\n\n private _log(type: LogType, message: string, optionalParams: any[]): void {\n this._evalLazyOptionalParams(optionalParams);\n type.call(console, LOG_PREFIX + message, ...optionalParams);\n }\n\n public debug(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.DEBUG) {\n this._log(console.log, message, optionalParams);\n }\n }\n\n public info(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.INFO) {\n this._log(console.info, message, optionalParams);\n }\n }\n\n public warn(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.WARN) {\n this._log(console.warn, message, optionalParams);\n }\n }\n\n public error(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.ERROR) {\n this._log(console.error, message, optionalParams);\n }\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOptionsService, ITerminalOptions, FontWeight } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { isMac } from 'common/Platform';\n\n// Source: https://freesound.org/people/altemark/sounds/45759/\n// This sound is released under the Creative Commons Attribution 3.0 Unported\n// (CC BY 3.0) license. It was created by 'altemark'. No modifications have been\n// made, apart from the conversion to base64.\nexport const DEFAULT_BELL_SOUND = 'data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq';\n\nexport const DEFAULT_OPTIONS: Readonly = {\n cols: 80,\n rows: 24,\n cursorBlink: false,\n cursorStyle: 'block',\n cursorWidth: 1,\n customGlyphs: true,\n bellSound: DEFAULT_BELL_SOUND,\n bellStyle: 'none',\n drawBoldTextInBrightColors: true,\n fastScrollModifier: 'alt',\n fastScrollSensitivity: 5,\n fontFamily: 'courier-new, courier, monospace',\n fontSize: 15,\n fontWeight: 'normal',\n fontWeightBold: 'bold',\n lineHeight: 1.0,\n linkTooltipHoverDuration: 500,\n letterSpacing: 0,\n logLevel: 'info',\n scrollback: 1000,\n scrollSensitivity: 1,\n screenReaderMode: false,\n macOptionIsMeta: false,\n macOptionClickForcesSelection: false,\n minimumContrastRatio: 1,\n disableStdin: false,\n allowProposedApi: true,\n allowTransparency: false,\n tabStopWidth: 8,\n theme: {},\n rightClickSelectsWord: isMac,\n rendererType: 'canvas',\n windowOptions: {},\n windowsMode: false,\n wordSeparator: ' ()[]{}\\',\"`',\n altClickMovesCursor: true,\n convertEol: false,\n termName: 'xterm',\n cancelEvents: false,\n overviewRulerWidth: undefined\n};\n\nconst FONT_WEIGHT_OPTIONS: Extract[] = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];\n\nexport class OptionsService implements IOptionsService {\n public serviceBrand: any;\n\n public readonly rawOptions: ITerminalOptions;\n public options: ITerminalOptions;\n\n private _onOptionChange = new EventEmitter();\n public get onOptionChange(): IEvent { return this._onOptionChange.event; }\n\n constructor(options: Partial) {\n // set the default value of each option\n const defaultOptions = { ...DEFAULT_OPTIONS };\n for (const key in options) {\n if (key in defaultOptions) {\n try {\n const newValue = options[key];\n defaultOptions[key] = this._sanitizeAndValidateOption(key, newValue);\n } catch (e) {\n console.error(e);\n }\n }\n }\n\n // set up getters and setters for each option\n this.rawOptions = defaultOptions;\n this.options = { ... defaultOptions };\n this._setupOptions();\n }\n\n private _setupOptions(): void {\n const getter = (propName: string): any => {\n if (!(propName in DEFAULT_OPTIONS)) {\n throw new Error(`No option with key \"${propName}\"`);\n }\n return this.rawOptions[propName];\n };\n\n const setter = (propName: string, value: any): void => {\n if (!(propName in DEFAULT_OPTIONS)) {\n throw new Error(`No option with key \"${propName}\"`);\n }\n\n value = this._sanitizeAndValidateOption(propName, value);\n // Don't fire an option change event if they didn't change\n if (this.rawOptions[propName] !== value) {\n this.rawOptions[propName] = value;\n this._onOptionChange.fire(propName);\n }\n };\n\n for (const propName in this.rawOptions) {\n const desc = {\n get: getter.bind(this, propName),\n set: setter.bind(this, propName)\n };\n Object.defineProperty(this.options, propName, desc);\n }\n }\n\n public setOption(key: string, value: any): void {\n this.options[key] = value;\n }\n\n private _sanitizeAndValidateOption(key: string, value: any): any {\n switch (key) {\n case 'bellStyle':\n case 'cursorStyle':\n case 'rendererType':\n case 'wordSeparator':\n if (!value) {\n value = DEFAULT_OPTIONS[key];\n }\n break;\n case 'fontWeight':\n case 'fontWeightBold':\n if (typeof value === 'number' && 1 <= value && value <= 1000) {\n // already valid numeric value\n break;\n }\n value = FONT_WEIGHT_OPTIONS.includes(value) ? value : DEFAULT_OPTIONS[key];\n break;\n case 'cursorWidth':\n value = Math.floor(value);\n // Fall through for bounds check\n case 'lineHeight':\n case 'tabStopWidth':\n if (value < 1) {\n throw new Error(`${key} cannot be less than 1, value: ${value}`);\n }\n break;\n case 'minimumContrastRatio':\n value = Math.max(1, Math.min(21, Math.round(value * 10) / 10));\n break;\n case 'scrollback':\n value = Math.min(value, 4294967295);\n if (value < 0) {\n throw new Error(`${key} cannot be less than 0, value: ${value}`);\n }\n break;\n case 'fastScrollSensitivity':\n case 'scrollSensitivity':\n if (value <= 0) {\n throw new Error(`${key} cannot be less than or equal to 0, value: ${value}`);\n }\n case 'rows':\n case 'cols':\n if (!value && value !== 0) {\n throw new Error(`${key} must be numeric, value: ${value}`);\n }\n break;\n }\n return value;\n }\n\n public getOption(key: string): any {\n return this.options[key];\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * This was heavily inspired from microsoft/vscode's dependency injection system (MIT).\n */\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IServiceIdentifier } from 'common/services/Services';\n\nconst DI_TARGET = 'di$target';\nconst DI_DEPENDENCIES = 'di$dependencies';\n\nexport const serviceRegistry: Map> = new Map();\n\nexport function getServiceDependencies(ctor: any): { id: IServiceIdentifier, index: number, optional: boolean }[] {\n return ctor[DI_DEPENDENCIES] || [];\n}\n\nexport function createDecorator(id: string): IServiceIdentifier {\n if (serviceRegistry.has(id)) {\n return serviceRegistry.get(id)!;\n }\n\n const decorator: any = function (target: Function, key: string, index: number): any {\n if (arguments.length !== 3) {\n throw new Error('@IServiceName-decorator can only be used to decorate a parameter');\n }\n\n storeServiceDependency(decorator, target, index);\n };\n\n decorator.toString = () => id;\n\n serviceRegistry.set(id, decorator);\n return decorator;\n}\n\nfunction storeServiceDependency(id: Function, target: Function, index: number): void {\n if ((target as any)[DI_TARGET] === target) {\n (target as any)[DI_DEPENDENCIES].push({ id, index });\n } else {\n (target as any)[DI_DEPENDENCIES] = [{ id, index }];\n (target as any)[DI_TARGET] = target;\n }\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IEvent, IEventEmitter } from 'common/EventEmitter';\nimport { IBuffer, IBufferSet } from 'common/buffer/Types';\nimport { IDecPrivateModes, ICoreMouseEvent, CoreMouseEncoding, ICoreMouseProtocol, CoreMouseEventType, ICharset, IWindowOptions, IModes, IAttributeData, ScrollSource, IDisposable, IColorRGB, IColor } from 'common/Types';\nimport { createDecorator } from 'common/services/ServiceRegistry';\nimport { IDecorationOptions, IDecoration } from 'xterm';\n\nexport const IBufferService = createDecorator('BufferService');\nexport interface IBufferService {\n serviceBrand: undefined;\n\n readonly cols: number;\n readonly rows: number;\n readonly buffer: IBuffer;\n readonly buffers: IBufferSet;\n isUserScrolling: boolean;\n onResize: IEvent<{ cols: number, rows: number }>;\n onScroll: IEvent;\n scroll(eraseAttr: IAttributeData, isWrapped?: boolean): void;\n scrollToBottom(): void;\n scrollToTop(): void;\n scrollToLine(line: number): void;\n scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void;\n scrollPages(pageCount: number): void;\n resize(cols: number, rows: number): void;\n reset(): void;\n}\n\nexport const ICoreMouseService = createDecorator('CoreMouseService');\nexport interface ICoreMouseService {\n activeProtocol: string;\n activeEncoding: string;\n areMouseEventsActive: boolean;\n addProtocol(name: string, protocol: ICoreMouseProtocol): void;\n addEncoding(name: string, encoding: CoreMouseEncoding): void;\n reset(): void;\n\n /**\n * Triggers a mouse event to be sent.\n *\n * Returns true if the event passed all protocol restrictions and a report\n * was sent, otherwise false. The return value may be used to decide whether\n * the default event action in the bowser component should be omitted.\n *\n * Note: The method will change values of the given event object\n * to fullfill protocol and encoding restrictions.\n */\n triggerMouseEvent(event: ICoreMouseEvent): boolean;\n\n /**\n * Event to announce changes in mouse tracking.\n */\n onProtocolChange: IEvent;\n\n /**\n * Human readable version of mouse events.\n */\n explainEvents(events: CoreMouseEventType): { [event: string]: boolean };\n}\n\nexport const ICoreService = createDecorator('CoreService');\nexport interface ICoreService {\n serviceBrand: undefined;\n\n /**\n * Initially the cursor will not be visible until the first time the terminal\n * is focused.\n */\n isCursorInitialized: boolean;\n isCursorHidden: boolean;\n\n readonly modes: IModes;\n readonly decPrivateModes: IDecPrivateModes;\n\n readonly onData: IEvent;\n readonly onUserInput: IEvent;\n readonly onBinary: IEvent;\n\n reset(): void;\n\n /**\n * Triggers the onData event in the public API.\n * @param data The data that is being emitted.\n * @param wasFromUser Whether the data originated from the user (as opposed to\n * resulting from parsing incoming data). When true this will also:\n * - Scroll to the bottom of the buffer.s\n * - Fire the `onUserInput` event (so selection can be cleared).\n */\n triggerDataEvent(data: string, wasUserInput?: boolean): void;\n\n /**\n * Triggers the onBinary event in the public API.\n * @param data The data that is being emitted.\n */\n triggerBinaryEvent(data: string): void;\n}\n\nexport const ICharsetService = createDecorator('CharsetService');\nexport interface ICharsetService {\n serviceBrand: undefined;\n\n charset: ICharset | undefined;\n readonly glevel: number;\n\n reset(): void;\n\n /**\n * Set the G level of the terminal.\n * @param g\n */\n setgLevel(g: number): void;\n\n /**\n * Set the charset for the given G level of the terminal.\n * @param g\n * @param charset\n */\n setgCharset(g: number, charset: ICharset | undefined): void;\n}\n\nexport const IDirtyRowService = createDecorator('DirtyRowService');\nexport interface IDirtyRowService {\n serviceBrand: undefined;\n\n readonly start: number;\n readonly end: number;\n\n clearRange(): void;\n markDirty(y: number): void;\n markRangeDirty(y1: number, y2: number): void;\n markAllDirty(): void;\n}\n\nexport interface IServiceIdentifier {\n (...args: any[]): void;\n type: T;\n}\n\nexport interface IBrandedService {\n serviceBrand: undefined;\n}\n\ntype GetLeadingNonServiceArgs =\n Args extends [...IBrandedService[]] ? []\n : Args extends [infer A1, ...IBrandedService[]] ? [A1]\n : Args extends [infer A1, infer A2, ...IBrandedService[]] ? [A1, A2]\n : Args extends [infer A1, infer A2, infer A3, ...IBrandedService[]] ? [A1, A2, A3]\n : Args extends [infer A1, infer A2, infer A3, infer A4, ...IBrandedService[]] ? [A1, A2, A3, A4]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, ...IBrandedService[]] ? [A1, A2, A3, A4, A5]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6, A7]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6, A7, A8]\n : never;\n\nexport const IInstantiationService = createDecorator('InstantiationService');\nexport interface IInstantiationService {\n serviceBrand: undefined;\n\n setService(id: IServiceIdentifier, instance: T): void;\n getService(id: IServiceIdentifier): T | undefined;\n createInstance any, R extends InstanceType>(t: Ctor, ...args: GetLeadingNonServiceArgs>): R;\n}\n\nexport enum LogLevelEnum {\n DEBUG = 0,\n INFO = 1,\n WARN = 2,\n ERROR = 3,\n OFF = 4\n}\n\nexport const ILogService = createDecorator('LogService');\nexport interface ILogService {\n serviceBrand: undefined;\n\n logLevel: LogLevelEnum;\n\n debug(message: any, ...optionalParams: any[]): void;\n info(message: any, ...optionalParams: any[]): void;\n warn(message: any, ...optionalParams: any[]): void;\n error(message: any, ...optionalParams: any[]): void;\n}\n\nexport const IOptionsService = createDecorator('OptionsService');\nexport interface IOptionsService {\n serviceBrand: undefined;\n\n /**\n * Read only access to the raw options object, this is an internal-only fast path for accessing\n * single options without any validation as we trust TypeScript to enforce correct usage\n * internally.\n */\n readonly rawOptions: Readonly;\n readonly options: ITerminalOptions;\n\n readonly onOptionChange: IEvent;\n\n setOption(key: string, value: T): void;\n getOption(key: string): T | undefined;\n}\n\nexport type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number;\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';\n\nexport type RendererType = 'dom' | 'canvas';\n\nexport interface ITerminalOptions {\n allowProposedApi: boolean;\n allowTransparency: boolean;\n altClickMovesCursor: boolean;\n bellSound: string;\n bellStyle: 'none' | 'sound' /* | 'visual' | 'both' */;\n cols: number;\n convertEol: boolean;\n cursorBlink: boolean;\n cursorStyle: 'block' | 'underline' | 'bar';\n cursorWidth: number;\n customGlyphs: boolean;\n disableStdin: boolean;\n drawBoldTextInBrightColors: boolean;\n fastScrollModifier: 'alt' | 'ctrl' | 'shift' | undefined;\n fastScrollSensitivity: number;\n fontSize: number;\n fontFamily: string;\n fontWeight: FontWeight;\n fontWeightBold: FontWeight;\n letterSpacing: number;\n lineHeight: number;\n linkTooltipHoverDuration: number;\n logLevel: LogLevel;\n macOptionIsMeta: boolean;\n macOptionClickForcesSelection: boolean;\n minimumContrastRatio: number;\n rendererType: RendererType;\n rightClickSelectsWord: boolean;\n rows: number;\n screenReaderMode: boolean;\n scrollback: number;\n scrollSensitivity: number;\n tabStopWidth: number;\n theme: ITheme;\n windowsMode: boolean;\n windowOptions: IWindowOptions;\n wordSeparator: string;\n overviewRulerWidth?: number;\n\n [key: string]: any;\n cancelEvents: boolean;\n termName: string;\n}\n\nexport interface ITheme {\n foreground?: string;\n background?: string;\n cursor?: string;\n cursorAccent?: string;\n selection?: string;\n selectionForeground?: string;\n black?: string;\n red?: string;\n green?: string;\n yellow?: string;\n blue?: string;\n magenta?: string;\n cyan?: string;\n white?: string;\n brightBlack?: string;\n brightRed?: string;\n brightGreen?: string;\n brightYellow?: string;\n brightBlue?: string;\n brightMagenta?: string;\n brightCyan?: string;\n brightWhite?: string;\n}\n\nexport const IUnicodeService = createDecorator('UnicodeService');\nexport interface IUnicodeService {\n serviceBrand: undefined;\n /** Register an Unicode version provider. */\n register(provider: IUnicodeVersionProvider): void;\n /** Registered Unicode versions. */\n readonly versions: string[];\n /** Currently active version. */\n activeVersion: string;\n /** Event triggered, when activate version changed. */\n readonly onChange: IEvent;\n\n /**\n * Unicode version dependent\n */\n wcwidth(codepoint: number): number;\n getStringCellWidth(s: string): number;\n}\n\nexport interface IUnicodeVersionProvider {\n readonly version: string;\n wcwidth(ucs: number): 0 | 1 | 2;\n}\n\nexport const IDecorationService = createDecorator('DecorationService');\nexport interface IDecorationService extends IDisposable {\n serviceBrand: undefined;\n readonly decorations: IterableIterator;\n readonly onDecorationRegistered: IEvent;\n readonly onDecorationRemoved: IEvent;\n registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined;\n reset(): void;\n /** Iterates over the decorations at a line (in no particular order). */\n getDecorationsAtLine(line: number): IterableIterator;\n /** Iterates over the decorations at a cell (in no particular order). */\n getDecorationsAtCell(x: number, line: number, layer?: 'bottom' | 'top'): IterableIterator;\n}\nexport interface IInternalDecoration extends IDecoration {\n readonly options: IDecorationOptions;\n readonly backgroundColorRGB: IColor | undefined;\n readonly foregroundColorRGB: IColor | undefined;\n readonly onRenderEmitter: IEventEmitter;\n}\n", "/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IUnicodeService, IUnicodeVersionProvider } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { UnicodeV6 } from 'common/input/UnicodeV6';\n\n\nexport class UnicodeService implements IUnicodeService {\n public serviceBrand: any;\n\n private _providers: {[key: string]: IUnicodeVersionProvider} = Object.create(null);\n private _active: string = '';\n private _activeProvider: IUnicodeVersionProvider;\n private _onChange = new EventEmitter();\n public get onChange(): IEvent { return this._onChange.event; }\n\n constructor() {\n const defaultProvider = new UnicodeV6();\n this.register(defaultProvider);\n this._active = defaultProvider.version;\n this._activeProvider = defaultProvider;\n }\n\n public get versions(): string[] {\n return Object.keys(this._providers);\n }\n\n public get activeVersion(): string {\n return this._active;\n }\n\n public set activeVersion(version: string) {\n if (!this._providers[version]) {\n throw new Error(`unknown Unicode version \"${version}\"`);\n }\n this._active = version;\n this._activeProvider = this._providers[version];\n this._onChange.fire(version);\n }\n\n public register(provider: IUnicodeVersionProvider): void {\n this._providers[provider.version] = provider;\n }\n\n /**\n * Unicode version dependent interface.\n */\n public wcwidth(num: number): number {\n return this._activeProvider.wcwidth(num);\n }\n\n public getStringCellWidth(s: string): number {\n let result = 0;\n const length = s.length;\n for (let i = 0; i < length; ++i) {\n let code = s.charCodeAt(i);\n // surrogate pair first\n if (0xD800 <= code && code <= 0xDBFF) {\n if (++i >= length) {\n // this should not happen with strings retrieved from\n // Buffer.translateToString as it converts from UTF-32\n // and therefore always should contain the second part\n // for any other string we still have to handle it somehow:\n // simply treat the lonely surrogate first as a single char (UCS-2 behavior)\n return result + this.wcwidth(code);\n }\n const second = s.charCodeAt(i);\n // convert surrogate pair to high codepoint only for valid second part (UTF-16)\n // otherwise treat them independently (UCS-2 behavior)\n if (0xDC00 <= second && second <= 0xDFFF) {\n code = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n result += this.wcwidth(second);\n }\n }\n result += this.wcwidth(code);\n }\n return result;\n }\n}\n", "// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n", "// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(4389);\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var noOptions = {};\n var nonWS = /[^\\s\\u00a0]/;\n var Pos = CodeMirror.Pos, cmp = CodeMirror.cmpPos;\n\n function firstNonWS(str) {\n var found = str.search(nonWS);\n return found == -1 ? 0 : found;\n }\n\n CodeMirror.commands.toggleComment = function(cm) {\n cm.toggleComment();\n };\n\n CodeMirror.defineExtension(\"toggleComment\", function(options) {\n if (!options) options = noOptions;\n var cm = this;\n var minLine = Infinity, ranges = this.listSelections(), mode = null;\n for (var i = ranges.length - 1; i >= 0; i--) {\n var from = ranges[i].from(), to = ranges[i].to();\n if (from.line >= minLine) continue;\n if (to.line >= minLine) to = Pos(minLine, 0);\n minLine = from.line;\n if (mode == null) {\n if (cm.uncomment(from, to, options)) mode = \"un\";\n else { cm.lineComment(from, to, options); mode = \"line\"; }\n } else if (mode == \"un\") {\n cm.uncomment(from, to, options);\n } else {\n cm.lineComment(from, to, options);\n }\n }\n });\n\n // Rough heuristic to try and detect lines that are part of multi-line string\n function probablyInsideString(cm, pos, line) {\n return /\\bstring\\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\\'\\\"\\`]/.test(line)\n }\n\n function getMode(cm, pos) {\n var mode = cm.getMode()\n return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos)\n }\n\n CodeMirror.defineExtension(\"lineComment\", function(from, to, options) {\n if (!options) options = noOptions;\n var self = this, mode = getMode(self, from);\n var firstLine = self.getLine(from.line);\n if (firstLine == null || probablyInsideString(self, from, firstLine)) return;\n\n var commentString = options.lineComment || mode.lineComment;\n if (!commentString) {\n if (options.blockCommentStart || mode.blockCommentStart) {\n options.fullLines = true;\n self.blockComment(from, to, options);\n }\n return;\n }\n\n var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);\n var pad = options.padding == null ? \" \" : options.padding;\n var blankLines = options.commentBlankLines || from.line == to.line;\n\n self.operation(function() {\n if (options.indent) {\n var baseString = null;\n for (var i = from.line; i < end; ++i) {\n var line = self.getLine(i);\n var whitespace = line.search(nonWS) === -1 ? line : line.slice(0, firstNonWS(line));\n if (baseString == null || baseString.length > whitespace.length) {\n baseString = whitespace;\n }\n }\n for (var i = from.line; i < end; ++i) {\n var line = self.getLine(i), cut = baseString.length;\n if (!blankLines && !nonWS.test(line)) continue;\n if (line.slice(0, cut) != baseString) cut = firstNonWS(line);\n self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));\n }\n } else {\n for (var i = from.line; i < end; ++i) {\n if (blankLines || nonWS.test(self.getLine(i)))\n self.replaceRange(commentString + pad, Pos(i, 0));\n }\n }\n });\n });\n\n CodeMirror.defineExtension(\"blockComment\", function(from, to, options) {\n if (!options) options = noOptions;\n var self = this, mode = getMode(self, from);\n var startString = options.blockCommentStart || mode.blockCommentStart;\n var endString = options.blockCommentEnd || mode.blockCommentEnd;\n if (!startString || !endString) {\n if ((options.lineComment || mode.lineComment) && options.fullLines != false)\n self.lineComment(from, to, options);\n return;\n }\n if (/\\bcomment\\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return\n\n var end = Math.min(to.line, self.lastLine());\n if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;\n\n var pad = options.padding == null ? \" \" : options.padding;\n if (from.line > end) return;\n\n self.operation(function() {\n if (options.fullLines != false) {\n var lastLineHasText = nonWS.test(self.getLine(end));\n self.replaceRange(pad + endString, Pos(end));\n self.replaceRange(startString + pad, Pos(from.line, 0));\n var lead = options.blockCommentLead || mode.blockCommentLead;\n if (lead != null) for (var i = from.line + 1; i <= end; ++i)\n if (i != end || lastLineHasText)\n self.replaceRange(lead + pad, Pos(i, 0));\n } else {\n var atCursor = cmp(self.getCursor(\"to\"), to) == 0, empty = !self.somethingSelected()\n self.replaceRange(endString, to);\n if (atCursor) self.setSelection(empty ? to : self.getCursor(\"from\"), to)\n self.replaceRange(startString, from);\n }\n });\n });\n\n CodeMirror.defineExtension(\"uncomment\", function(from, to, options) {\n if (!options) options = noOptions;\n var self = this, mode = getMode(self, from);\n var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);\n\n // Try finding line comments\n var lineString = options.lineComment || mode.lineComment, lines = [];\n var pad = options.padding == null ? \" \" : options.padding, didSomething;\n lineComment: {\n if (!lineString) break lineComment;\n for (var i = start; i <= end; ++i) {\n var line = self.getLine(i);\n var found = line.indexOf(lineString);\n if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;\n if (found == -1 && nonWS.test(line)) break lineComment;\n if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;\n lines.push(line);\n }\n self.operation(function() {\n for (var i = start; i <= end; ++i) {\n var line = lines[i - start];\n var pos = line.indexOf(lineString), endPos = pos + lineString.length;\n if (pos < 0) continue;\n if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;\n didSomething = true;\n self.replaceRange(\"\", Pos(i, pos), Pos(i, endPos));\n }\n });\n if (didSomething) return true;\n }\n\n // Try block comments\n var startString = options.blockCommentStart || mode.blockCommentStart;\n var endString = options.blockCommentEnd || mode.blockCommentEnd;\n if (!startString || !endString) return false;\n var lead = options.blockCommentLead || mode.blockCommentLead;\n var startLine = self.getLine(start), open = startLine.indexOf(startString)\n if (open == -1) return false\n var endLine = end == start ? startLine : self.getLine(end)\n var close = endLine.indexOf(endString, end == start ? open + startString.length : 0);\n var insideStart = Pos(start, open + 1), insideEnd = Pos(end, close + 1)\n if (close == -1 ||\n !/comment/.test(self.getTokenTypeAt(insideStart)) ||\n !/comment/.test(self.getTokenTypeAt(insideEnd)) ||\n self.getRange(insideStart, insideEnd, \"\\n\").indexOf(endString) > -1)\n return false;\n\n // Avoid killing block comments completely outside the selection.\n // Positions of the last startString before the start of the selection, and the first endString after it.\n var lastStart = startLine.lastIndexOf(startString, from.ch);\n var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length);\n if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false;\n // Positions of the first endString after the end of the selection, and the last startString before it.\n firstEnd = endLine.indexOf(endString, to.ch);\n var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch);\n lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart;\n if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false;\n\n self.operation(function() {\n self.replaceRange(\"\", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),\n Pos(end, close + endString.length));\n var openEnd = open + startString.length;\n if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;\n self.replaceRange(\"\", Pos(start, open), Pos(start, openEnd));\n if (lead) for (var i = start + 1; i <= end; ++i) {\n var line = self.getLine(i), found = line.indexOf(lead);\n if (found == -1 || nonWS.test(line.slice(0, found))) continue;\n var foundEnd = found + lead.length;\n if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;\n self.replaceRange(\"\", Pos(i, found), Pos(i, foundEnd));\n }\n });\n return true;\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var nonspace = /\\S/g;\n var repeat = String.prototype.repeat || function (n) { return Array(n + 1).join(this); };\n function continueComment(cm) {\n if (cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n var ranges = cm.listSelections(), mode, inserts = [];\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].head\n if (!/\\bcomment\\b/.test(cm.getTokenTypeAt(pos))) return CodeMirror.Pass;\n var modeHere = cm.getModeAt(pos)\n if (!mode) mode = modeHere;\n else if (mode != modeHere) return CodeMirror.Pass;\n\n var insert = null, line, found;\n var blockStart = mode.blockCommentStart, lineCmt = mode.lineComment;\n if (blockStart && mode.blockCommentContinue) {\n line = cm.getLine(pos.line);\n var end = line.lastIndexOf(mode.blockCommentEnd, pos.ch - mode.blockCommentEnd.length);\n // 1. if this block comment ended\n // 2. if this is actually inside a line comment\n if (end != -1 && end == pos.ch - mode.blockCommentEnd.length ||\n lineCmt && (found = line.lastIndexOf(lineCmt, pos.ch - 1)) > -1 &&\n /\\bcomment\\b/.test(cm.getTokenTypeAt({line: pos.line, ch: found + 1}))) {\n // ...then don't continue it\n } else if (pos.ch >= blockStart.length &&\n (found = line.lastIndexOf(blockStart, pos.ch - blockStart.length)) > -1 &&\n found > end) {\n // reuse the existing leading spaces/tabs/mixed\n // or build the correct indent using CM's tab/indent options\n if (nonspaceAfter(0, line) >= found) {\n insert = line.slice(0, found);\n } else {\n var tabSize = cm.options.tabSize, numTabs;\n found = CodeMirror.countColumn(line, found, tabSize);\n insert = !cm.options.indentWithTabs ? repeat.call(\" \", found) :\n repeat.call(\"\\t\", (numTabs = Math.floor(found / tabSize))) +\n repeat.call(\" \", found - tabSize * numTabs);\n }\n } else if ((found = line.indexOf(mode.blockCommentContinue)) > -1 &&\n found <= pos.ch &&\n found <= nonspaceAfter(0, line)) {\n insert = line.slice(0, found);\n }\n if (insert != null) insert += mode.blockCommentContinue\n }\n if (insert == null && lineCmt && continueLineCommentEnabled(cm)) {\n if (line == null) line = cm.getLine(pos.line);\n found = line.indexOf(lineCmt);\n // cursor at pos 0, line comment also at pos 0 => shift it down, don't continue\n if (!pos.ch && !found) insert = \"\";\n // continue only if the line starts with an optional space + line comment\n else if (found > -1 && nonspaceAfter(0, line) >= found) {\n // don't continue if there's only space(s) after cursor or the end of the line\n insert = nonspaceAfter(pos.ch, line) > -1;\n // but always continue if the next line starts with a line comment too\n if (!insert) {\n var next = cm.getLine(pos.line + 1) || '',\n nextFound = next.indexOf(lineCmt);\n insert = nextFound > -1 && nonspaceAfter(0, next) >= nextFound || null;\n }\n if (insert) {\n insert = line.slice(0, found) + lineCmt +\n line.slice(found + lineCmt.length).match(/^\\s*/)[0];\n }\n }\n }\n if (insert == null) return CodeMirror.Pass;\n inserts[i] = \"\\n\" + insert;\n }\n\n cm.operation(function() {\n for (var i = ranges.length - 1; i >= 0; i--)\n cm.replaceRange(inserts[i], ranges[i].from(), ranges[i].to(), \"+insert\");\n });\n }\n\n function nonspaceAfter(ch, str) {\n nonspace.lastIndex = ch;\n var m = nonspace.exec(str);\n return m ? m.index : -1;\n }\n\n function continueLineCommentEnabled(cm) {\n var opt = cm.getOption(\"continueComments\");\n if (opt && typeof opt == \"object\")\n return opt.continueLineComment !== false;\n return true;\n }\n\n CodeMirror.defineOption(\"continueComments\", null, function(cm, val, prev) {\n if (prev && prev != CodeMirror.Init)\n cm.removeKeyMap(\"continueComment\");\n if (val) {\n var key = \"Enter\";\n if (typeof val == \"string\")\n key = val;\n else if (typeof val == \"object\" && val.key)\n key = val.key;\n var map = {name: \"continueComment\"};\n map[key] = continueComment;\n cm.addKeyMap(map);\n }\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n CodeMirror.defineOption(\"placeholder\", \"\", function(cm, val, old) {\n var prev = old && old != CodeMirror.Init;\n if (val && !prev) {\n cm.on(\"blur\", onBlur);\n cm.on(\"change\", onChange);\n cm.on(\"swapDoc\", onChange);\n CodeMirror.on(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose = function() { onComposition(cm) })\n onChange(cm);\n } else if (!val && prev) {\n cm.off(\"blur\", onBlur);\n cm.off(\"change\", onChange);\n cm.off(\"swapDoc\", onChange);\n CodeMirror.off(cm.getInputField(), \"compositionupdate\", cm.state.placeholderCompose)\n clearPlaceholder(cm);\n var wrapper = cm.getWrapperElement();\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\");\n }\n\n if (val && !cm.hasFocus()) onBlur(cm);\n });\n\n function clearPlaceholder(cm) {\n if (cm.state.placeholder) {\n cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);\n cm.state.placeholder = null;\n }\n }\n function setPlaceholder(cm) {\n clearPlaceholder(cm);\n var elt = cm.state.placeholder = document.createElement(\"pre\");\n elt.style.cssText = \"height: 0; overflow: visible\";\n elt.style.direction = cm.getOption(\"direction\");\n elt.className = \"CodeMirror-placeholder CodeMirror-line-like\";\n var placeHolder = cm.getOption(\"placeholder\")\n if (typeof placeHolder == \"string\") placeHolder = document.createTextNode(placeHolder)\n elt.appendChild(placeHolder)\n cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);\n }\n\n function onComposition(cm) {\n setTimeout(function() {\n var empty = false\n if (cm.lineCount() == 1) {\n var input = cm.getInputField()\n empty = input.nodeName == \"TEXTAREA\" ? !cm.getLine(0).length\n : !/[^\\u200b]/.test(input.querySelector(\".CodeMirror-line\").textContent)\n }\n if (empty) setPlaceholder(cm)\n else clearPlaceholder(cm)\n }, 20)\n }\n\n function onBlur(cm) {\n if (isEmpty(cm)) setPlaceholder(cm);\n }\n function onChange(cm) {\n var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);\n wrapper.className = wrapper.className.replace(\" CodeMirror-empty\", \"\") + (empty ? \" CodeMirror-empty\" : \"\");\n\n if (empty) setPlaceholder(cm);\n else clearPlaceholder(cm);\n }\n\n function isEmpty(cm) {\n return (cm.lineCount() === 1) && (cm.getLine(0) === \"\");\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var defaults = {\n pairs: \"()[]{}''\\\"\\\"\",\n closeBefore: \")]}'\\\":;>\",\n triples: \"\",\n explode: \"[]{}\"\n };\n\n var Pos = CodeMirror.Pos;\n\n CodeMirror.defineOption(\"autoCloseBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.removeKeyMap(keyMap);\n cm.state.closeBrackets = null;\n }\n if (val) {\n ensureBound(getOption(val, \"pairs\"))\n cm.state.closeBrackets = val;\n cm.addKeyMap(keyMap);\n }\n });\n\n function getOption(conf, name) {\n if (name == \"pairs\" && typeof conf == \"string\") return conf;\n if (typeof conf == \"object\" && conf[name] != null) return conf[name];\n return defaults[name];\n }\n\n var keyMap = {Backspace: handleBackspace, Enter: handleEnter};\n function ensureBound(chars) {\n for (var i = 0; i < chars.length; i++) {\n var ch = chars.charAt(i), key = \"'\" + ch + \"'\"\n if (!keyMap[key]) keyMap[key] = handler(ch)\n }\n }\n ensureBound(defaults.pairs + \"`\")\n\n function handler(ch) {\n return function(cm) { return handleChar(cm, ch); };\n }\n\n function getConfig(cm) {\n var deflt = cm.state.closeBrackets;\n if (!deflt || deflt.override) return deflt;\n var mode = cm.getModeAt(cm.getCursor());\n return mode.closeBrackets || deflt;\n }\n\n function handleBackspace(cm) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n for (var i = ranges.length - 1; i >= 0; i--) {\n var cur = ranges[i].head;\n cm.replaceRange(\"\", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), \"+delete\");\n }\n }\n\n function handleEnter(cm) {\n var conf = getConfig(cm);\n var explode = conf && getOption(conf, \"explode\");\n if (!explode || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) return CodeMirror.Pass;\n var around = charsAround(cm, ranges[i].head);\n if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;\n }\n cm.operation(function() {\n var linesep = cm.lineSeparator() || \"\\n\";\n cm.replaceSelection(linesep + linesep, null);\n moveSel(cm, -1)\n ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var line = ranges[i].head.line;\n cm.indentLine(line, null, true);\n cm.indentLine(line + 1, null, true);\n }\n });\n }\n\n function moveSel(cm, dir) {\n var newRanges = [], ranges = cm.listSelections(), primary = 0\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i]\n if (range.head == cm.getCursor()) primary = i\n var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1}\n newRanges.push({anchor: pos, head: pos})\n }\n cm.setSelections(newRanges, primary)\n }\n\n function contractSelection(sel) {\n var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;\n return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),\n head: new Pos(sel.head.line, sel.head.ch + (inverted ? 1 : -1))};\n }\n\n function handleChar(cm, ch) {\n var conf = getConfig(cm);\n if (!conf || cm.getOption(\"disableInput\")) return CodeMirror.Pass;\n\n var pairs = getOption(conf, \"pairs\");\n var pos = pairs.indexOf(ch);\n if (pos == -1) return CodeMirror.Pass;\n\n var closeBefore = getOption(conf,\"closeBefore\");\n\n var triples = getOption(conf, \"triples\");\n\n var identical = pairs.charAt(pos + 1) == ch;\n var ranges = cm.listSelections();\n var opening = pos % 2 == 0;\n\n var type;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], cur = range.head, curType;\n var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));\n if (opening && !range.empty()) {\n curType = \"surround\";\n } else if ((identical || !opening) && next == ch) {\n if (identical && stringStartsAfter(cm, cur))\n curType = \"both\";\n else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)\n curType = \"skipThree\";\n else\n curType = \"skip\";\n } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&\n cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {\n if (cur.ch > 2 && /\\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;\n curType = \"addFour\";\n } else if (identical) {\n var prev = cur.ch == 0 ? \" \" : cm.getRange(Pos(cur.line, cur.ch - 1), cur)\n if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = \"both\";\n else return CodeMirror.Pass;\n } else if (opening && (next.length === 0 || /\\s/.test(next) || closeBefore.indexOf(next) > -1)) {\n curType = \"both\";\n } else {\n return CodeMirror.Pass;\n }\n if (!type) type = curType;\n else if (type != curType) return CodeMirror.Pass;\n }\n\n var left = pos % 2 ? pairs.charAt(pos - 1) : ch;\n var right = pos % 2 ? ch : pairs.charAt(pos + 1);\n cm.operation(function() {\n if (type == \"skip\") {\n moveSel(cm, 1)\n } else if (type == \"skipThree\") {\n moveSel(cm, 3)\n } else if (type == \"surround\") {\n var sels = cm.getSelections();\n for (var i = 0; i < sels.length; i++)\n sels[i] = left + sels[i] + right;\n cm.replaceSelections(sels, \"around\");\n sels = cm.listSelections().slice();\n for (var i = 0; i < sels.length; i++)\n sels[i] = contractSelection(sels[i]);\n cm.setSelections(sels);\n } else if (type == \"both\") {\n cm.replaceSelection(left + right, null);\n cm.triggerElectric(left + right);\n moveSel(cm, -1)\n } else if (type == \"addFour\") {\n cm.replaceSelection(left + left + left + left, \"before\");\n moveSel(cm, 1)\n }\n });\n }\n\n function charsAround(cm, pos) {\n var str = cm.getRange(Pos(pos.line, pos.ch - 1),\n Pos(pos.line, pos.ch + 1));\n return str.length == 2 ? str : null;\n }\n\n function stringStartsAfter(cm, pos) {\n var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))\n return /\\bstring/.test(token.type) && token.start == pos.ch &&\n (pos.ch == 0 || !/\\bstring/.test(cm.getTokenTypeAt(pos)))\n }\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n var ie_lt8 = /MSIE \\d/.test(navigator.userAgent) &&\n (document.documentMode == null || document.documentMode < 8);\n\n var Pos = CodeMirror.Pos;\n\n var matching = {\"(\": \")>\", \")\": \"(<\", \"[\": \"]>\", \"]\": \"[<\", \"{\": \"}>\", \"}\": \"{<\", \"<\": \">>\", \">\": \"<<\"};\n\n function bracketRegex(config) {\n return config && config.bracketRegex || /[(){}[\\]]/\n }\n\n function findMatchingBracket(cm, where, config) {\n var line = cm.getLineHandle(where.line), pos = where.ch - 1;\n var afterCursor = config && config.afterCursor\n if (afterCursor == null)\n afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)\n var re = bracketRegex(config)\n\n // A cursor is defined as between two characters, but in in vim command mode\n // (i.e. not insert mode), the cursor is visually represented as a\n // highlighted box on top of the 2nd character. Otherwise, we allow matches\n // from before or after the cursor.\n var match = (!afterCursor && pos >= 0 && re.test(line.text.charAt(pos)) && matching[line.text.charAt(pos)]) ||\n re.test(line.text.charAt(pos + 1)) && matching[line.text.charAt(++pos)];\n if (!match) return null;\n var dir = match.charAt(1) == \">\" ? 1 : -1;\n if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;\n var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));\n\n var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config);\n if (found == null) return null;\n return {from: Pos(where.line, pos), to: found && found.pos,\n match: found && found.ch == match.charAt(0), forward: dir > 0};\n }\n\n // bracketRegex is used to specify which type of bracket to scan\n // should be a regexp, e.g. /[[\\]]/\n //\n // Note: If \"where\" is on an open bracket, then this bracket is ignored.\n //\n // Returns false when no bracket was found, null when it reached\n // maxScanLines and gave up\n function scanForBracket(cm, where, dir, style, config) {\n var maxScanLen = (config && config.maxScanLineLength) || 10000;\n var maxScanLines = (config && config.maxScanLines) || 1000;\n\n var stack = [];\n var re = bracketRegex(config)\n var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)\n : Math.max(cm.firstLine() - 1, where.line - maxScanLines);\n for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {\n var line = cm.getLine(lineNo);\n if (!line) continue;\n var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;\n if (line.length > maxScanLen) continue;\n if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);\n for (; pos != end; pos += dir) {\n var ch = line.charAt(pos);\n if (re.test(ch) && (style === undefined ||\n (cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || \"\") == (style || \"\"))) {\n var match = matching[ch];\n if (match && (match.charAt(1) == \">\") == (dir > 0)) stack.push(ch);\n else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};\n else stack.pop();\n }\n }\n }\n return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;\n }\n\n function matchBrackets(cm, autoclear, config) {\n // Disable brace matching in long lines, since it'll cause hugely slow updates\n var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000,\n highlightNonMatching = config && config.highlightNonMatching;\n var marks = [], ranges = cm.listSelections();\n for (var i = 0; i < ranges.length; i++) {\n var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);\n if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) {\n var style = match.match ? \"CodeMirror-matchingbracket\" : \"CodeMirror-nonmatchingbracket\";\n marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));\n if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)\n marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));\n }\n }\n\n if (marks.length) {\n // Kludge to work around the IE bug from issue #1193, where text\n // input stops going to the textarea whenever this fires.\n if (ie_lt8 && cm.state.focused) cm.focus();\n\n var clear = function() {\n cm.operation(function() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n });\n };\n if (autoclear) setTimeout(clear, 800);\n else return clear;\n }\n }\n\n function doMatchBrackets(cm) {\n cm.operation(function() {\n if (cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);\n });\n }\n\n function clearHighlighted(cm) {\n if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {\n cm.state.matchBrackets.currentlyHighlighted();\n cm.state.matchBrackets.currentlyHighlighted = null;\n }\n }\n\n CodeMirror.defineOption(\"matchBrackets\", false, function(cm, val, old) {\n if (old && old != CodeMirror.Init) {\n cm.off(\"cursorActivity\", doMatchBrackets);\n cm.off(\"focus\", doMatchBrackets)\n cm.off(\"blur\", clearHighlighted)\n clearHighlighted(cm);\n }\n if (val) {\n cm.state.matchBrackets = typeof val == \"object\" ? val : {};\n cm.on(\"cursorActivity\", doMatchBrackets);\n cm.on(\"focus\", doMatchBrackets)\n cm.on(\"blur\", clearHighlighted)\n }\n });\n\n CodeMirror.defineExtension(\"matchBrackets\", function() {matchBrackets(this, true);});\n CodeMirror.defineExtension(\"findMatchingBracket\", function(pos, config, oldConfig){\n // Backwards-compatibility kludge\n if (oldConfig || typeof config == \"boolean\") {\n if (!oldConfig) {\n config = config ? {strict: true} : null\n } else {\n oldConfig.strict = config\n config = oldConfig\n }\n }\n return findMatchingBracket(this, pos, config)\n });\n CodeMirror.defineExtension(\"scanForBracket\", function(pos, dir, style, config){\n return scanForBracket(this, pos, dir, style, config);\n });\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"))\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod)\n else // Plain browser env\n mod(CodeMirror)\n})(function(CodeMirror) {\n \"use strict\"\n var Pos = CodeMirror.Pos\n\n function regexpFlags(regexp) {\n var flags = regexp.flags\n return flags != null ? flags : (regexp.ignoreCase ? \"i\" : \"\")\n + (regexp.global ? \"g\" : \"\")\n + (regexp.multiline ? \"m\" : \"\")\n }\n\n function ensureFlags(regexp, flags) {\n var current = regexpFlags(regexp), target = current\n for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)\n target += flags.charAt(i)\n return current == target ? regexp : new RegExp(regexp.source, target)\n }\n\n function maybeMultiline(regexp) {\n return /\\\\s|\\\\n|\\n|\\\\W|\\\\D|\\[\\^/.test(regexp.source)\n }\n\n function searchRegexpForward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {\n regexp.lastIndex = ch\n var string = doc.getLine(line), match = regexp.exec(string)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpForwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)\n\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunk = 1\n for (var line = start.line, last = doc.lastLine(); line <= last;) {\n // This grows the search buffer in exponentially-sized chunks\n // between matches, so that nearby matches are fast and don't\n // require concatenating the whole document (in case we're\n // searching for something that has tons of matches), but at the\n // same time, the amount of retries is limited.\n for (var i = 0; i < chunk; i++) {\n if (line > last) break\n var curLine = doc.getLine(line++)\n string = string == null ? curLine : string + \"\\n\" + curLine\n }\n chunk = chunk * 2\n regexp.lastIndex = start.ch\n var match = regexp.exec(string)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n function lastMatchIn(string, regexp, endMargin) {\n var match, from = 0\n while (from <= string.length) {\n regexp.lastIndex = from\n var newMatch = regexp.exec(string)\n if (!newMatch) break\n var end = newMatch.index + newMatch[0].length\n if (end > string.length - endMargin) break\n if (!match || end > match.index + match[0].length)\n match = newMatch\n from = newMatch.index + 1\n }\n return match\n }\n\n function searchRegexpBackward(doc, regexp, start) {\n regexp = ensureFlags(regexp, \"g\")\n for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {\n var string = doc.getLine(line)\n var match = lastMatchIn(string, regexp, ch < 0 ? 0 : string.length - ch)\n if (match)\n return {from: Pos(line, match.index),\n to: Pos(line, match.index + match[0].length),\n match: match}\n }\n }\n\n function searchRegexpBackwardMultiline(doc, regexp, start) {\n if (!maybeMultiline(regexp)) return searchRegexpBackward(doc, regexp, start)\n regexp = ensureFlags(regexp, \"gm\")\n var string, chunkSize = 1, endMargin = doc.getLine(start.line).length - start.ch\n for (var line = start.line, first = doc.firstLine(); line >= first;) {\n for (var i = 0; i < chunkSize && line >= first; i++) {\n var curLine = doc.getLine(line--)\n string = string == null ? curLine : curLine + \"\\n\" + string\n }\n chunkSize *= 2\n\n var match = lastMatchIn(string, regexp, endMargin)\n if (match) {\n var before = string.slice(0, match.index).split(\"\\n\"), inside = match[0].split(\"\\n\")\n var startLine = line + before.length, startCh = before[before.length - 1].length\n return {from: Pos(startLine, startCh),\n to: Pos(startLine + inside.length - 1,\n inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),\n match: match}\n }\n }\n }\n\n var doFold, noFold\n if (String.prototype.normalize) {\n doFold = function(str) { return str.normalize(\"NFD\").toLowerCase() }\n noFold = function(str) { return str.normalize(\"NFD\") }\n } else {\n doFold = function(str) { return str.toLowerCase() }\n noFold = function(str) { return str }\n }\n\n // Maps a position in a case-folded line back to a position in the original line\n // (compensating for codepoints increasing in number during folding)\n function adjustPos(orig, folded, pos, foldFunc) {\n if (orig.length == folded.length) return pos\n for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {\n if (min == max) return min\n var mid = (min + max) >> 1\n var len = foldFunc(orig.slice(0, mid)).length\n if (len == pos) return mid\n else if (len > pos) max = mid\n else min = mid + 1\n }\n }\n\n function searchStringForward(doc, query, start, caseFold) {\n // Empty string would match anything and never progress, so we\n // define it to match nothing instead.\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) {\n var orig = doc.getLine(line).slice(ch), string = fold(orig)\n if (lines.length == 1) {\n var found = string.indexOf(lines[0])\n if (found == -1) continue search\n var start = adjustPos(orig, string, found, fold) + ch\n return {from: Pos(line, adjustPos(orig, string, found, fold) + ch),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)}\n } else {\n var cutFrom = string.length - lines[0].length\n if (string.slice(cutFrom) != lines[0]) continue search\n for (var i = 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(line + i)) != lines[i]) continue search\n var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1]\n if (endString.slice(0, lastLine.length) != lastLine) continue search\n return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch),\n to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))}\n }\n }\n }\n\n function searchStringBackward(doc, query, start, caseFold) {\n if (!query.length) return null\n var fold = caseFold ? doFold : noFold\n var lines = fold(query).split(/\\r|\\n\\r?/)\n\n search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) {\n var orig = doc.getLine(line)\n if (ch > -1) orig = orig.slice(0, ch)\n var string = fold(orig)\n if (lines.length == 1) {\n var found = string.lastIndexOf(lines[0])\n if (found == -1) continue search\n return {from: Pos(line, adjustPos(orig, string, found, fold)),\n to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))}\n } else {\n var lastLine = lines[lines.length - 1]\n if (string.slice(0, lastLine.length) != lastLine) continue search\n for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++)\n if (fold(doc.getLine(start + i)) != lines[i]) continue search\n var top = doc.getLine(line + 1 - lines.length), topString = fold(top)\n if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search\n return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)),\n to: Pos(line, adjustPos(orig, string, lastLine.length, fold))}\n }\n }\n }\n\n function SearchCursor(doc, query, pos, options) {\n this.atOccurrence = false\n this.afterEmptyMatch = false\n this.doc = doc\n pos = pos ? doc.clipPos(pos) : Pos(0, 0)\n this.pos = {from: pos, to: pos}\n\n var caseFold\n if (typeof options == \"object\") {\n caseFold = options.caseFold\n } else { // Backwards compat for when caseFold was the 4th argument\n caseFold = options\n options = null\n }\n\n if (typeof query == \"string\") {\n if (caseFold == null) caseFold = false\n this.matches = function(reverse, pos) {\n return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)\n }\n } else {\n query = ensureFlags(query, \"gm\")\n if (!options || options.multiline !== false)\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)\n }\n else\n this.matches = function(reverse, pos) {\n return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos)\n }\n }\n }\n\n SearchCursor.prototype = {\n findNext: function() {return this.find(false)},\n findPrevious: function() {return this.find(true)},\n\n find: function(reverse) {\n var head = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);\n if (this.afterEmptyMatch && this.atOccurrence) {\n // do not return the same 0 width match twice\n head = Pos(head.line, head.ch)\n if (reverse) {\n head.ch--;\n if (head.ch < 0) {\n head.line--;\n head.ch = (this.doc.getLine(head.line) || \"\").length;\n }\n } else {\n head.ch++;\n if (head.ch > (this.doc.getLine(head.line) || \"\").length) {\n head.ch = 0;\n head.line++;\n }\n }\n if (CodeMirror.cmpPos(head, this.doc.clipPos(head)) != 0) {\n return this.atOccurrence = false\n }\n }\n var result = this.matches(reverse, head)\n this.afterEmptyMatch = result && CodeMirror.cmpPos(result.from, result.to) == 0\n\n if (result) {\n this.pos = result\n this.atOccurrence = true\n return this.pos.match || true\n } else {\n var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0)\n this.pos = {from: end, to: end}\n return this.atOccurrence = false\n }\n },\n\n from: function() {if (this.atOccurrence) return this.pos.from},\n to: function() {if (this.atOccurrence) return this.pos.to},\n\n replace: function(newText, origin) {\n if (!this.atOccurrence) return\n var lines = CodeMirror.splitLines(newText)\n this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin)\n this.pos.to = Pos(this.pos.from.line + lines.length - 1,\n lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0))\n }\n }\n\n CodeMirror.defineExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this.doc, query, pos, caseFold)\n })\n CodeMirror.defineDocExtension(\"getSearchCursor\", function(query, pos, caseFold) {\n return new SearchCursor(this, query, pos, caseFold)\n })\n\n CodeMirror.defineExtension(\"selectMatches\", function(query, caseFold) {\n var ranges = []\n var cur = this.getSearchCursor(query, this.getCursor(\"from\"), caseFold)\n while (cur.findNext()) {\n if (CodeMirror.cmpPos(cur.to(), this.getCursor(\"to\")) > 0) break\n ranges.push({anchor: cur.from(), head: cur.to()})\n }\n if (ranges.length)\n this.setSelections(ranges, 0)\n })\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// A rough approximation of Sublime Text's keybindings\n// Depends on addon/search/searchcursor.js and optionally addon/dialog/dialogs.js\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../lib/codemirror\"), require(\"../addon/search/searchcursor\"), require(\"../addon/edit/matchbrackets\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../lib/codemirror\", \"../addon/search/searchcursor\", \"../addon/edit/matchbrackets\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var cmds = CodeMirror.commands;\n var Pos = CodeMirror.Pos;\n\n // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that.\n function findPosSubword(doc, start, dir) {\n if (dir < 0 && start.ch == 0) return doc.clipPos(Pos(start.line - 1));\n var line = doc.getLine(start.line);\n if (dir > 0 && start.ch >= line.length) return doc.clipPos(Pos(start.line + 1, 0));\n var state = \"start\", type, startPos = start.ch;\n for (var pos = startPos, e = dir < 0 ? 0 : line.length, i = 0; pos != e; pos += dir, i++) {\n var next = line.charAt(dir < 0 ? pos - 1 : pos);\n var cat = next != \"_\" && CodeMirror.isWordChar(next) ? \"w\" : \"o\";\n if (cat == \"w\" && next.toUpperCase() == next) cat = \"W\";\n if (state == \"start\") {\n if (cat != \"o\") { state = \"in\"; type = cat; }\n else startPos = pos + dir\n } else if (state == \"in\") {\n if (type != cat) {\n if (type == \"w\" && cat == \"W\" && dir < 0) pos--;\n if (type == \"W\" && cat == \"w\" && dir > 0) { // From uppercase to lowercase\n if (pos == startPos + 1) { type = \"w\"; continue; }\n else pos--;\n }\n break;\n }\n }\n }\n return Pos(start.line, pos);\n }\n\n function moveSubword(cm, dir) {\n cm.extendSelectionsBy(function(range) {\n if (cm.display.shift || cm.doc.extend || range.empty())\n return findPosSubword(cm.doc, range.head, dir);\n else\n return dir < 0 ? range.from() : range.to();\n });\n }\n\n cmds.goSubwordLeft = function(cm) { moveSubword(cm, -1); };\n cmds.goSubwordRight = function(cm) { moveSubword(cm, 1); };\n\n cmds.scrollLineUp = function(cm) {\n var info = cm.getScrollInfo();\n if (!cm.somethingSelected()) {\n var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, \"local\");\n if (cm.getCursor().line >= visibleBottomLine)\n cm.execCommand(\"goLineUp\");\n }\n cm.scrollTo(null, info.top - cm.defaultTextHeight());\n };\n cmds.scrollLineDown = function(cm) {\n var info = cm.getScrollInfo();\n if (!cm.somethingSelected()) {\n var visibleTopLine = cm.lineAtHeight(info.top, \"local\")+1;\n if (cm.getCursor().line <= visibleTopLine)\n cm.execCommand(\"goLineDown\");\n }\n cm.scrollTo(null, info.top + cm.defaultTextHeight());\n };\n\n cmds.splitSelectionByLine = function(cm) {\n var ranges = cm.listSelections(), lineRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var from = ranges[i].from(), to = ranges[i].to();\n for (var line = from.line; line <= to.line; ++line)\n if (!(to.line > from.line && line == to.line && to.ch == 0))\n lineRanges.push({anchor: line == from.line ? from : Pos(line, 0),\n head: line == to.line ? to : Pos(line)});\n }\n cm.setSelections(lineRanges, 0);\n };\n\n cmds.singleSelectionTop = function(cm) {\n var range = cm.listSelections()[0];\n cm.setSelection(range.anchor, range.head, {scroll: false});\n };\n\n cmds.selectLine = function(cm) {\n var ranges = cm.listSelections(), extended = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n extended.push({anchor: Pos(range.from().line, 0),\n head: Pos(range.to().line + 1, 0)});\n }\n cm.setSelections(extended);\n };\n\n function insertLine(cm, above) {\n if (cm.isReadOnly()) return CodeMirror.Pass\n cm.operation(function() {\n var len = cm.listSelections().length, newSelection = [], last = -1;\n for (var i = 0; i < len; i++) {\n var head = cm.listSelections()[i].head;\n if (head.line <= last) continue;\n var at = Pos(head.line + (above ? 0 : 1), 0);\n cm.replaceRange(\"\\n\", at, null, \"+insertLine\");\n cm.indentLine(at.line, null, true);\n newSelection.push({head: at, anchor: at});\n last = head.line + 1;\n }\n cm.setSelections(newSelection);\n });\n cm.execCommand(\"indentAuto\");\n }\n\n cmds.insertLineAfter = function(cm) { return insertLine(cm, false); };\n\n cmds.insertLineBefore = function(cm) { return insertLine(cm, true); };\n\n function wordAt(cm, pos) {\n var start = pos.ch, end = start, line = cm.getLine(pos.line);\n while (start && CodeMirror.isWordChar(line.charAt(start - 1))) --start;\n while (end < line.length && CodeMirror.isWordChar(line.charAt(end))) ++end;\n return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)};\n }\n\n cmds.selectNextOccurrence = function(cm) {\n var from = cm.getCursor(\"from\"), to = cm.getCursor(\"to\");\n var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel;\n if (CodeMirror.cmpPos(from, to) == 0) {\n var word = wordAt(cm, from);\n if (!word.word) return;\n cm.setSelection(word.from, word.to);\n fullWord = true;\n } else {\n var text = cm.getRange(from, to);\n var query = fullWord ? new RegExp(\"\\\\b\" + text + \"\\\\b\") : text;\n var cur = cm.getSearchCursor(query, to);\n var found = cur.findNext();\n if (!found) {\n cur = cm.getSearchCursor(query, Pos(cm.firstLine(), 0));\n found = cur.findNext();\n }\n if (!found || isSelectedRange(cm.listSelections(), cur.from(), cur.to())) return\n cm.addSelection(cur.from(), cur.to());\n }\n if (fullWord)\n cm.state.sublimeFindFullWord = cm.doc.sel;\n };\n\n cmds.skipAndSelectNextOccurrence = function(cm) {\n var prevAnchor = cm.getCursor(\"anchor\"), prevHead = cm.getCursor(\"head\");\n cmds.selectNextOccurrence(cm);\n if (CodeMirror.cmpPos(prevAnchor, prevHead) != 0) {\n cm.doc.setSelections(cm.doc.listSelections()\n .filter(function (sel) {\n return sel.anchor != prevAnchor || sel.head != prevHead;\n }));\n }\n }\n\n function addCursorToSelection(cm, dir) {\n var ranges = cm.listSelections(), newRanges = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var newAnchor = cm.findPosV(\n range.anchor, dir, \"line\", range.anchor.goalColumn);\n var newHead = cm.findPosV(\n range.head, dir, \"line\", range.head.goalColumn);\n newAnchor.goalColumn = range.anchor.goalColumn != null ?\n range.anchor.goalColumn : cm.cursorCoords(range.anchor, \"div\").left;\n newHead.goalColumn = range.head.goalColumn != null ?\n range.head.goalColumn : cm.cursorCoords(range.head, \"div\").left;\n var newRange = {anchor: newAnchor, head: newHead};\n newRanges.push(range);\n newRanges.push(newRange);\n }\n cm.setSelections(newRanges);\n }\n cmds.addCursorToPrevLine = function(cm) { addCursorToSelection(cm, -1); };\n cmds.addCursorToNextLine = function(cm) { addCursorToSelection(cm, 1); };\n\n function isSelectedRange(ranges, from, to) {\n for (var i = 0; i < ranges.length; i++)\n if (CodeMirror.cmpPos(ranges[i].from(), from) == 0 &&\n CodeMirror.cmpPos(ranges[i].to(), to) == 0) return true\n return false\n }\n\n var mirror = \"(){}[]\";\n function selectBetweenBrackets(cm) {\n var ranges = cm.listSelections(), newRanges = []\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], pos = range.head, opening = cm.scanForBracket(pos, -1);\n if (!opening) return false;\n for (;;) {\n var closing = cm.scanForBracket(pos, 1);\n if (!closing) return false;\n if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {\n var startPos = Pos(opening.pos.line, opening.pos.ch + 1);\n if (CodeMirror.cmpPos(startPos, range.from()) == 0 &&\n CodeMirror.cmpPos(closing.pos, range.to()) == 0) {\n opening = cm.scanForBracket(opening.pos, -1);\n if (!opening) return false;\n } else {\n newRanges.push({anchor: startPos, head: closing.pos});\n break;\n }\n }\n pos = Pos(closing.pos.line, closing.pos.ch + 1);\n }\n }\n cm.setSelections(newRanges);\n return true;\n }\n\n cmds.selectScope = function(cm) {\n selectBetweenBrackets(cm) || cm.execCommand(\"selectAll\");\n };\n cmds.selectBetweenBrackets = function(cm) {\n if (!selectBetweenBrackets(cm)) return CodeMirror.Pass;\n };\n\n function puncType(type) {\n return !type ? null : /\\bpunctuation\\b/.test(type) ? type : undefined\n }\n\n cmds.goToBracket = function(cm) {\n cm.extendSelectionsBy(function(range) {\n var next = cm.scanForBracket(range.head, 1, puncType(cm.getTokenTypeAt(range.head)));\n if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos;\n var prev = cm.scanForBracket(range.head, -1, puncType(cm.getTokenTypeAt(Pos(range.head.line, range.head.ch + 1))));\n return prev && Pos(prev.pos.line, prev.pos.ch + 1) || range.head;\n });\n };\n\n cmds.swapLineUp = function(cm) {\n if (cm.isReadOnly()) return CodeMirror.Pass\n var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], from = range.from().line - 1, to = range.to().line;\n newSels.push({anchor: Pos(range.anchor.line - 1, range.anchor.ch),\n head: Pos(range.head.line - 1, range.head.ch)});\n if (range.to().ch == 0 && !range.empty()) --to;\n if (from > at) linesToMove.push(from, to);\n else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;\n at = to;\n }\n cm.operation(function() {\n for (var i = 0; i < linesToMove.length; i += 2) {\n var from = linesToMove[i], to = linesToMove[i + 1];\n var line = cm.getLine(from);\n cm.replaceRange(\"\", Pos(from, 0), Pos(from + 1, 0), \"+swapLine\");\n if (to > cm.lastLine())\n cm.replaceRange(\"\\n\" + line, Pos(cm.lastLine()), null, \"+swapLine\");\n else\n cm.replaceRange(line + \"\\n\", Pos(to, 0), null, \"+swapLine\");\n }\n cm.setSelections(newSels);\n cm.scrollIntoView();\n });\n };\n\n cmds.swapLineDown = function(cm) {\n if (cm.isReadOnly()) return CodeMirror.Pass\n var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1;\n for (var i = ranges.length - 1; i >= 0; i--) {\n var range = ranges[i], from = range.to().line + 1, to = range.from().line;\n if (range.to().ch == 0 && !range.empty()) from--;\n if (from < at) linesToMove.push(from, to);\n else if (linesToMove.length) linesToMove[linesToMove.length - 1] = to;\n at = to;\n }\n cm.operation(function() {\n for (var i = linesToMove.length - 2; i >= 0; i -= 2) {\n var from = linesToMove[i], to = linesToMove[i + 1];\n var line = cm.getLine(from);\n if (from == cm.lastLine())\n cm.replaceRange(\"\", Pos(from - 1), Pos(from), \"+swapLine\");\n else\n cm.replaceRange(\"\", Pos(from, 0), Pos(from + 1, 0), \"+swapLine\");\n cm.replaceRange(line + \"\\n\", Pos(to, 0), null, \"+swapLine\");\n }\n cm.scrollIntoView();\n });\n };\n\n cmds.toggleCommentIndented = function(cm) {\n cm.toggleComment({ indent: true });\n }\n\n cmds.joinLines = function(cm) {\n var ranges = cm.listSelections(), joined = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i], from = range.from();\n var start = from.line, end = range.to().line;\n while (i < ranges.length - 1 && ranges[i + 1].from().line == end)\n end = ranges[++i].to().line;\n joined.push({start: start, end: end, anchor: !range.empty() && from});\n }\n cm.operation(function() {\n var offset = 0, ranges = [];\n for (var i = 0; i < joined.length; i++) {\n var obj = joined[i];\n var anchor = obj.anchor && Pos(obj.anchor.line - offset, obj.anchor.ch), head;\n for (var line = obj.start; line <= obj.end; line++) {\n var actual = line - offset;\n if (line == obj.end) head = Pos(actual, cm.getLine(actual).length + 1);\n if (actual < cm.lastLine()) {\n cm.replaceRange(\" \", Pos(actual), Pos(actual + 1, /^\\s*/.exec(cm.getLine(actual + 1))[0].length));\n ++offset;\n }\n }\n ranges.push({anchor: anchor || head, head: head});\n }\n cm.setSelections(ranges, 0);\n });\n };\n\n cmds.duplicateLine = function(cm) {\n cm.operation(function() {\n var rangeCount = cm.listSelections().length;\n for (var i = 0; i < rangeCount; i++) {\n var range = cm.listSelections()[i];\n if (range.empty())\n cm.replaceRange(cm.getLine(range.head.line) + \"\\n\", Pos(range.head.line, 0));\n else\n cm.replaceRange(cm.getRange(range.from(), range.to()), range.from());\n }\n cm.scrollIntoView();\n });\n };\n\n\n function sortLines(cm, caseSensitive, direction) {\n if (cm.isReadOnly()) return CodeMirror.Pass\n var ranges = cm.listSelections(), toSort = [], selected;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.empty()) continue;\n var from = range.from().line, to = range.to().line;\n while (i < ranges.length - 1 && ranges[i + 1].from().line == to)\n to = ranges[++i].to().line;\n if (!ranges[i].to().ch) to--;\n toSort.push(from, to);\n }\n if (toSort.length) selected = true;\n else toSort.push(cm.firstLine(), cm.lastLine());\n\n cm.operation(function() {\n var ranges = [];\n for (var i = 0; i < toSort.length; i += 2) {\n var from = toSort[i], to = toSort[i + 1];\n var start = Pos(from, 0), end = Pos(to);\n var lines = cm.getRange(start, end, false);\n if (caseSensitive)\n lines.sort(function(a, b) { return a < b ? -direction : a == b ? 0 : direction; });\n else\n lines.sort(function(a, b) {\n var au = a.toUpperCase(), bu = b.toUpperCase();\n if (au != bu) { a = au; b = bu; }\n return a < b ? -direction : a == b ? 0 : direction;\n });\n cm.replaceRange(lines, start, end);\n if (selected) ranges.push({anchor: start, head: Pos(to + 1, 0)});\n }\n if (selected) cm.setSelections(ranges, 0);\n });\n }\n\n cmds.sortLines = function(cm) { sortLines(cm, true, 1); };\n cmds.reverseSortLines = function(cm) { sortLines(cm, true, -1); };\n cmds.sortLinesInsensitive = function(cm) { sortLines(cm, false, 1); };\n cmds.reverseSortLinesInsensitive = function(cm) { sortLines(cm, false, -1); };\n\n cmds.nextBookmark = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) while (marks.length) {\n var current = marks.shift();\n var found = current.find();\n if (found) {\n marks.push(current);\n return cm.setSelection(found.from, found.to);\n }\n }\n };\n\n cmds.prevBookmark = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) while (marks.length) {\n marks.unshift(marks.pop());\n var found = marks[marks.length - 1].find();\n if (!found)\n marks.pop();\n else\n return cm.setSelection(found.from, found.to);\n }\n };\n\n cmds.toggleBookmark = function(cm) {\n var ranges = cm.listSelections();\n var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);\n for (var i = 0; i < ranges.length; i++) {\n var from = ranges[i].from(), to = ranges[i].to();\n var found = ranges[i].empty() ? cm.findMarksAt(from) : cm.findMarks(from, to);\n for (var j = 0; j < found.length; j++) {\n if (found[j].sublimeBookmark) {\n found[j].clear();\n for (var k = 0; k < marks.length; k++)\n if (marks[k] == found[j])\n marks.splice(k--, 1);\n break;\n }\n }\n if (j == found.length)\n marks.push(cm.markText(from, to, {sublimeBookmark: true, clearWhenEmpty: false}));\n }\n };\n\n cmds.clearBookmarks = function(cm) {\n var marks = cm.state.sublimeBookmarks;\n if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();\n marks.length = 0;\n };\n\n cmds.selectBookmarks = function(cm) {\n var marks = cm.state.sublimeBookmarks, ranges = [];\n if (marks) for (var i = 0; i < marks.length; i++) {\n var found = marks[i].find();\n if (!found)\n marks.splice(i--, 0);\n else\n ranges.push({anchor: found.from, head: found.to});\n }\n if (ranges.length)\n cm.setSelections(ranges, 0);\n };\n\n function modifyWordOrSelection(cm, mod) {\n cm.operation(function() {\n var ranges = cm.listSelections(), indices = [], replacements = [];\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.empty()) { indices.push(i); replacements.push(\"\"); }\n else replacements.push(mod(cm.getRange(range.from(), range.to())));\n }\n cm.replaceSelections(replacements, \"around\", \"case\");\n for (var i = indices.length - 1, at; i >= 0; i--) {\n var range = ranges[indices[i]];\n if (at && CodeMirror.cmpPos(range.head, at) > 0) continue;\n var word = wordAt(cm, range.head);\n at = word.from;\n cm.replaceRange(mod(word.word), word.from, word.to);\n }\n });\n }\n\n cmds.smartBackspace = function(cm) {\n if (cm.somethingSelected()) return CodeMirror.Pass;\n\n cm.operation(function() {\n var cursors = cm.listSelections();\n var indentUnit = cm.getOption(\"indentUnit\");\n\n for (var i = cursors.length - 1; i >= 0; i--) {\n var cursor = cursors[i].head;\n var toStartOfLine = cm.getRange({line: cursor.line, ch: 0}, cursor);\n var column = CodeMirror.countColumn(toStartOfLine, null, cm.getOption(\"tabSize\"));\n\n // Delete by one character by default\n var deletePos = cm.findPosH(cursor, -1, \"char\", false);\n\n if (toStartOfLine && !/\\S/.test(toStartOfLine) && column % indentUnit == 0) {\n var prevIndent = new Pos(cursor.line,\n CodeMirror.findColumn(toStartOfLine, column - indentUnit, indentUnit));\n\n // Smart delete only if we found a valid prevIndent location\n if (prevIndent.ch != cursor.ch) deletePos = prevIndent;\n }\n\n cm.replaceRange(\"\", deletePos, cursor, \"+delete\");\n }\n });\n };\n\n cmds.delLineRight = function(cm) {\n cm.operation(function() {\n var ranges = cm.listSelections();\n for (var i = ranges.length - 1; i >= 0; i--)\n cm.replaceRange(\"\", ranges[i].anchor, Pos(ranges[i].to().line), \"+delete\");\n cm.scrollIntoView();\n });\n };\n\n cmds.upcaseAtCursor = function(cm) {\n modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); });\n };\n cmds.downcaseAtCursor = function(cm) {\n modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); });\n };\n\n cmds.setSublimeMark = function(cm) {\n if (cm.state.sublimeMark) cm.state.sublimeMark.clear();\n cm.state.sublimeMark = cm.setBookmark(cm.getCursor());\n };\n cmds.selectToSublimeMark = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) cm.setSelection(cm.getCursor(), found);\n };\n cmds.deleteToSublimeMark = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) {\n var from = cm.getCursor(), to = found;\n if (CodeMirror.cmpPos(from, to) > 0) { var tmp = to; to = from; from = tmp; }\n cm.state.sublimeKilled = cm.getRange(from, to);\n cm.replaceRange(\"\", from, to);\n }\n };\n cmds.swapWithSublimeMark = function(cm) {\n var found = cm.state.sublimeMark && cm.state.sublimeMark.find();\n if (found) {\n cm.state.sublimeMark.clear();\n cm.state.sublimeMark = cm.setBookmark(cm.getCursor());\n cm.setCursor(found);\n }\n };\n cmds.sublimeYank = function(cm) {\n if (cm.state.sublimeKilled != null)\n cm.replaceSelection(cm.state.sublimeKilled, null, \"paste\");\n };\n\n cmds.showInCenter = function(cm) {\n var pos = cm.cursorCoords(null, \"local\");\n cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);\n };\n\n function getTarget(cm) {\n var from = cm.getCursor(\"from\"), to = cm.getCursor(\"to\");\n if (CodeMirror.cmpPos(from, to) == 0) {\n var word = wordAt(cm, from);\n if (!word.word) return;\n from = word.from;\n to = word.to;\n }\n return {from: from, to: to, query: cm.getRange(from, to), word: word};\n }\n\n function findAndGoTo(cm, forward) {\n var target = getTarget(cm);\n if (!target) return;\n var query = target.query;\n var cur = cm.getSearchCursor(query, forward ? target.to : target.from);\n\n if (forward ? cur.findNext() : cur.findPrevious()) {\n cm.setSelection(cur.from(), cur.to());\n } else {\n cur = cm.getSearchCursor(query, forward ? Pos(cm.firstLine(), 0)\n : cm.clipPos(Pos(cm.lastLine())));\n if (forward ? cur.findNext() : cur.findPrevious())\n cm.setSelection(cur.from(), cur.to());\n else if (target.word)\n cm.setSelection(target.from, target.to);\n }\n };\n cmds.findUnder = function(cm) { findAndGoTo(cm, true); };\n cmds.findUnderPrevious = function(cm) { findAndGoTo(cm,false); };\n cmds.findAllUnder = function(cm) {\n var target = getTarget(cm);\n if (!target) return;\n var cur = cm.getSearchCursor(target.query);\n var matches = [];\n var primaryIndex = -1;\n while (cur.findNext()) {\n matches.push({anchor: cur.from(), head: cur.to()});\n if (cur.from().line <= target.from.line && cur.from().ch <= target.from.ch)\n primaryIndex++;\n }\n cm.setSelections(matches, primaryIndex);\n };\n\n\n var keyMap = CodeMirror.keyMap;\n keyMap.macSublime = {\n \"Cmd-Left\": \"goLineStartSmart\",\n \"Shift-Tab\": \"indentLess\",\n \"Shift-Ctrl-K\": \"deleteLine\",\n \"Alt-Q\": \"wrapLines\",\n \"Ctrl-Left\": \"goSubwordLeft\",\n \"Ctrl-Right\": \"goSubwordRight\",\n \"Ctrl-Alt-Up\": \"scrollLineUp\",\n \"Ctrl-Alt-Down\": \"scrollLineDown\",\n \"Cmd-L\": \"selectLine\",\n \"Shift-Cmd-L\": \"splitSelectionByLine\",\n \"Esc\": \"singleSelectionTop\",\n \"Cmd-Enter\": \"insertLineAfter\",\n \"Shift-Cmd-Enter\": \"insertLineBefore\",\n \"Cmd-D\": \"selectNextOccurrence\",\n \"Shift-Cmd-Space\": \"selectScope\",\n \"Shift-Cmd-M\": \"selectBetweenBrackets\",\n \"Cmd-M\": \"goToBracket\",\n \"Cmd-Ctrl-Up\": \"swapLineUp\",\n \"Cmd-Ctrl-Down\": \"swapLineDown\",\n \"Cmd-/\": \"toggleCommentIndented\",\n \"Cmd-J\": \"joinLines\",\n \"Shift-Cmd-D\": \"duplicateLine\",\n \"F5\": \"sortLines\",\n \"Shift-F5\": \"reverseSortLines\",\n \"Cmd-F5\": \"sortLinesInsensitive\",\n \"Shift-Cmd-F5\": \"reverseSortLinesInsensitive\",\n \"F2\": \"nextBookmark\",\n \"Shift-F2\": \"prevBookmark\",\n \"Cmd-F2\": \"toggleBookmark\",\n \"Shift-Cmd-F2\": \"clearBookmarks\",\n \"Alt-F2\": \"selectBookmarks\",\n \"Backspace\": \"smartBackspace\",\n \"Cmd-K Cmd-D\": \"skipAndSelectNextOccurrence\",\n \"Cmd-K Cmd-K\": \"delLineRight\",\n \"Cmd-K Cmd-U\": \"upcaseAtCursor\",\n \"Cmd-K Cmd-L\": \"downcaseAtCursor\",\n \"Cmd-K Cmd-Space\": \"setSublimeMark\",\n \"Cmd-K Cmd-A\": \"selectToSublimeMark\",\n \"Cmd-K Cmd-W\": \"deleteToSublimeMark\",\n \"Cmd-K Cmd-X\": \"swapWithSublimeMark\",\n \"Cmd-K Cmd-Y\": \"sublimeYank\",\n \"Cmd-K Cmd-C\": \"showInCenter\",\n \"Cmd-K Cmd-G\": \"clearBookmarks\",\n \"Cmd-K Cmd-Backspace\": \"delLineLeft\",\n \"Cmd-K Cmd-1\": \"foldAll\",\n \"Cmd-K Cmd-0\": \"unfoldAll\",\n \"Cmd-K Cmd-J\": \"unfoldAll\",\n \"Ctrl-Shift-Up\": \"addCursorToPrevLine\",\n \"Ctrl-Shift-Down\": \"addCursorToNextLine\",\n \"Cmd-F3\": \"findUnder\",\n \"Shift-Cmd-F3\": \"findUnderPrevious\",\n \"Alt-F3\": \"findAllUnder\",\n \"Shift-Cmd-[\": \"fold\",\n \"Shift-Cmd-]\": \"unfold\",\n \"Cmd-I\": \"findIncremental\",\n \"Shift-Cmd-I\": \"findIncrementalReverse\",\n \"Cmd-H\": \"replace\",\n \"F3\": \"findNext\",\n \"Shift-F3\": \"findPrev\",\n \"fallthrough\": \"macDefault\"\n };\n CodeMirror.normalizeKeyMap(keyMap.macSublime);\n\n keyMap.pcSublime = {\n \"Shift-Tab\": \"indentLess\",\n \"Shift-Ctrl-K\": \"deleteLine\",\n \"Alt-Q\": \"wrapLines\",\n \"Ctrl-T\": \"transposeChars\",\n \"Alt-Left\": \"goSubwordLeft\",\n \"Alt-Right\": \"goSubwordRight\",\n \"Ctrl-Up\": \"scrollLineUp\",\n \"Ctrl-Down\": \"scrollLineDown\",\n \"Ctrl-L\": \"selectLine\",\n \"Shift-Ctrl-L\": \"splitSelectionByLine\",\n \"Esc\": \"singleSelectionTop\",\n \"Ctrl-Enter\": \"insertLineAfter\",\n \"Shift-Ctrl-Enter\": \"insertLineBefore\",\n \"Ctrl-D\": \"selectNextOccurrence\",\n \"Shift-Ctrl-Space\": \"selectScope\",\n \"Shift-Ctrl-M\": \"selectBetweenBrackets\",\n \"Ctrl-M\": \"goToBracket\",\n \"Shift-Ctrl-Up\": \"swapLineUp\",\n \"Shift-Ctrl-Down\": \"swapLineDown\",\n \"Ctrl-/\": \"toggleCommentIndented\",\n \"Ctrl-J\": \"joinLines\",\n \"Shift-Ctrl-D\": \"duplicateLine\",\n \"F9\": \"sortLines\",\n \"Shift-F9\": \"reverseSortLines\",\n \"Ctrl-F9\": \"sortLinesInsensitive\",\n \"Shift-Ctrl-F9\": \"reverseSortLinesInsensitive\",\n \"F2\": \"nextBookmark\",\n \"Shift-F2\": \"prevBookmark\",\n \"Ctrl-F2\": \"toggleBookmark\",\n \"Shift-Ctrl-F2\": \"clearBookmarks\",\n \"Alt-F2\": \"selectBookmarks\",\n \"Backspace\": \"smartBackspace\",\n \"Ctrl-K Ctrl-D\": \"skipAndSelectNextOccurrence\",\n \"Ctrl-K Ctrl-K\": \"delLineRight\",\n \"Ctrl-K Ctrl-U\": \"upcaseAtCursor\",\n \"Ctrl-K Ctrl-L\": \"downcaseAtCursor\",\n \"Ctrl-K Ctrl-Space\": \"setSublimeMark\",\n \"Ctrl-K Ctrl-A\": \"selectToSublimeMark\",\n \"Ctrl-K Ctrl-W\": \"deleteToSublimeMark\",\n \"Ctrl-K Ctrl-X\": \"swapWithSublimeMark\",\n \"Ctrl-K Ctrl-Y\": \"sublimeYank\",\n \"Ctrl-K Ctrl-C\": \"showInCenter\",\n \"Ctrl-K Ctrl-G\": \"clearBookmarks\",\n \"Ctrl-K Ctrl-Backspace\": \"delLineLeft\",\n \"Ctrl-K Ctrl-1\": \"foldAll\",\n \"Ctrl-K Ctrl-0\": \"unfoldAll\",\n \"Ctrl-K Ctrl-J\": \"unfoldAll\",\n \"Ctrl-Alt-Up\": \"addCursorToPrevLine\",\n \"Ctrl-Alt-Down\": \"addCursorToNextLine\",\n \"Ctrl-F3\": \"findUnder\",\n \"Shift-Ctrl-F3\": \"findUnderPrevious\",\n \"Alt-F3\": \"findAllUnder\",\n \"Shift-Ctrl-[\": \"fold\",\n \"Shift-Ctrl-]\": \"unfold\",\n \"Ctrl-I\": \"findIncremental\",\n \"Shift-Ctrl-I\": \"findIncrementalReverse\",\n \"Ctrl-H\": \"replace\",\n \"F3\": \"findNext\",\n \"Shift-F3\": \"findPrev\",\n \"fallthrough\": \"pcDefault\"\n };\n CodeMirror.normalizeKeyMap(keyMap.pcSublime);\n\n var mac = keyMap.default == keyMap.macDefault;\n keyMap.sublime = mac ? keyMap.macSublime : keyMap.pcSublime;\n});\n", "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n }\n\n var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n \"for\", \"from\", \"global\", \"if\", \"import\",\n \"lambda\", \"pass\", \"raise\", \"return\",\n \"try\", \"while\", \"with\", \"yield\", \"in\", \"False\", \"True\"];\n var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n \"Ellipsis\", \"__debug__\"];\n CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins).concat([\"exec\", \"print\"]));\n\n function top(state) {\n return state.scopes[state.scopes.length - 1];\n }\n\n CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n var ERRORCLASS = \"error\";\n\n var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.\\\\]/;\n // (Backwards-compatibility with old, cumbersome config system)\n var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,\n parserConf.operators || /^([-+*/%\\/&|^]=?|[<>=]+|\\/\\/=?|\\*\\*=?|!=|[~!@]|\\.\\.\\.)/]\n for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)\n\n var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n if (parserConf.extra_keywords != undefined)\n myKeywords = myKeywords.concat(parserConf.extra_keywords);\n\n if (parserConf.extra_builtins != undefined)\n myBuiltins = myBuiltins.concat(parserConf.extra_builtins);\n\n var py3 = !(parserConf.version && Number(parserConf.version) < 3)\n if (py3) {\n // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n myKeywords = myKeywords.concat([\"nonlocal\", \"None\", \"aiter\", \"anext\", \"async\", \"await\", \"breakpoint\", \"match\", \"case\"]);\n myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n var stringPrefixes = new RegExp(\"^(([rbuf]|(br)|(rb)|(fr)|(rf))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n } else {\n var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n \"unichr\", \"unicode\", \"xrange\", \"None\"]);\n var stringPrefixes = new RegExp(\"^(([rubf]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n }\n var keywords = wordRegexp(myKeywords);\n var builtins = wordRegexp(myBuiltins);\n\n // tokenizers\n function tokenBase(stream, state) {\n var sol = stream.sol() && state.lastToken != \"\\\\\"\n if (sol) state.indent = stream.indentation()\n // Handle scope changes\n if (sol && top(state).type == \"py\") {\n var scopeOffset = top(state).offset;\n if (stream.eatSpace()) {\n var lineOffset = stream.indentation();\n if (lineOffset > scopeOffset)\n pushPyScope(state);\n else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != \"#\")\n state.errorToken = true;\n return null;\n } else {\n var style = tokenBaseInner(stream, state);\n if (scopeOffset > 0 && dedent(stream, state))\n style += \" \" + ERRORCLASS;\n return style;\n }\n }\n return tokenBaseInner(stream, state);\n }\n\n function tokenBaseInner(stream, state, inFormat) {\n if (stream.eatSpace()) return null;\n\n // Handle Comments\n if (!inFormat && stream.match(/^#.*/)) return \"comment\";\n\n // Handle Number Literals\n if (stream.match(/^[0-9\\.]/, false)) {\n var floatLiteral = false;\n // Floats\n if (stream.match(/^[\\d_]*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n if (stream.match(/^[\\d_]+\\.\\d*/)) { floatLiteral = true; }\n if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n if (floatLiteral) {\n // Float literals may be \"imaginary\"\n stream.eat(/J/i);\n return \"number\";\n }\n // Integers\n var intLiteral = false;\n // Hex\n if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;\n // Binary\n if (stream.match(/^0b[01_]+/i)) intLiteral = true;\n // Octal\n if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;\n // Decimal\n if (stream.match(/^[1-9][\\d_]*(e[\\+\\-]?[\\d_]+)?/)) {\n // Decimal literals may be \"imaginary\"\n stream.eat(/J/i);\n // TODO - Can you have imaginary longs?\n intLiteral = true;\n }\n // Zero by itself with no other piece of number.\n if (stream.match(/^0(?![\\dx])/i)) intLiteral = true;\n if (intLiteral) {\n // Integer literals may be \"long\"\n stream.eat(/L/i);\n return \"number\";\n }\n }\n\n // Handle Strings\n if (stream.match(stringPrefixes)) {\n var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;\n if (!isFmtString) {\n state.tokenize = tokenStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n } else {\n state.tokenize = formatStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n }\n }\n\n for (var i = 0; i < operators.length; i++)\n if (stream.match(operators[i])) return \"operator\"\n\n if (stream.match(delimiters)) return \"punctuation\";\n\n if (state.lastToken == \".\" && stream.match(identifiers))\n return \"property\";\n\n if (stream.match(keywords) || stream.match(wordOperators))\n return \"keyword\";\n\n if (stream.match(builtins))\n return \"builtin\";\n\n if (stream.match(/^(self|cls)\\b/))\n return \"variable-2\";\n\n if (stream.match(identifiers)) {\n if (state.lastToken == \"def\" || state.lastToken == \"class\")\n return \"def\";\n return \"variable\";\n }\n\n // Handle non-detected items\n stream.next();\n return inFormat ? null :ERRORCLASS;\n }\n\n function formatStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenNestedExpr(depth) {\n return function(stream, state) {\n var inner = tokenBaseInner(stream, state, true)\n if (inner == \"punctuation\") {\n if (stream.current() == \"{\") {\n state.tokenize = tokenNestedExpr(depth + 1)\n } else if (stream.current() == \"}\") {\n if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1)\n else state.tokenize = tokenString\n }\n }\n return inner\n }\n }\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\{\\}\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else if (stream.match('{{')) {\n // ignore {{ in f-str\n return OUTCLASS;\n } else if (stream.match('{', false)) {\n // switch to nested mode\n state.tokenize = tokenNestedExpr(0)\n if (stream.current()) return OUTCLASS;\n else return state.tokenize(stream, state)\n } else if (stream.match('}}')) {\n return OUTCLASS;\n } else if (stream.match('}')) {\n // single } in f-string is an error\n return ERRORCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function tokenStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function pushPyScope(state) {\n while (top(state).type != \"py\") state.scopes.pop()\n state.scopes.push({offset: top(state).offset + conf.indentUnit,\n type: \"py\",\n align: null})\n }\n\n function pushBracketScope(stream, state, type) {\n var align = stream.match(/^[\\s\\[\\{\\(]*(?:#|$)/, false) ? null : stream.column() + 1\n state.scopes.push({offset: state.indent + hangingIndent,\n type: type,\n align: align})\n }\n\n function dedent(stream, state) {\n var indented = stream.indentation();\n while (state.scopes.length > 1 && top(state).offset > indented) {\n if (top(state).type != \"py\") return true;\n state.scopes.pop();\n }\n return top(state).offset != indented;\n }\n\n function tokenLexer(stream, state) {\n if (stream.sol()) {\n state.beginningOfLine = true;\n state.dedent = false;\n }\n\n var style = state.tokenize(stream, state);\n var current = stream.current();\n\n // Handle decorators\n if (state.beginningOfLine && current == \"@\")\n return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;\n\n if (/\\S/.test(current)) state.beginningOfLine = false;\n\n if ((style == \"variable\" || style == \"builtin\")\n && state.lastToken == \"meta\")\n style = \"meta\";\n\n // Handle scope changes.\n if (current == \"pass\" || current == \"return\")\n state.dedent = true;\n\n if (current == \"lambda\") state.lambda = true;\n if (current == \":\" && !state.lambda && top(state).type == \"py\" && stream.match(/^\\s*(?:#|$)/, false))\n pushPyScope(state);\n\n if (current.length == 1 && !/string|comment/.test(style)) {\n var delimiter_index = \"[({\".indexOf(current);\n if (delimiter_index != -1)\n pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));\n\n delimiter_index = \"])}\".indexOf(current);\n if (delimiter_index != -1) {\n if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent\n else return ERRORCLASS;\n }\n }\n if (state.dedent && stream.eol() && top(state).type == \"py\" && state.scopes.length > 1)\n state.scopes.pop();\n\n return style;\n }\n\n var external = {\n startState: function(basecolumn) {\n return {\n tokenize: tokenBase,\n scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n indent: basecolumn || 0,\n lastToken: null,\n lambda: false,\n dedent: 0\n };\n },\n\n token: function(stream, state) {\n var addErr = state.errorToken;\n if (addErr) state.errorToken = false;\n var style = tokenLexer(stream, state);\n\n if (style && style != \"comment\")\n state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;\n if (style == \"punctuation\") style = null;\n\n if (stream.eol() && state.lambda)\n state.lambda = false;\n return addErr ? style + \" \" + ERRORCLASS : style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase)\n return state.tokenize.isString ? CodeMirror.Pass : 0;\n\n var scope = top(state)\n var closing = scope.type == textAfter.charAt(0) ||\n scope.type == \"py\" && !state.dedent && /^(else:|elif |except |finally:)/.test(textAfter)\n if (scope.align != null)\n return scope.align - (closing ? 1 : 0)\n else\n return scope.offset - (closing ? hangingIndent : 0)\n },\n\n electricInput: /^\\s*([\\}\\]\\)]|else:|elif |except |finally:)$/,\n closeBrackets: {triples: \"'\\\"\"},\n lineComment: \"#\",\n fold: \"indent\"\n };\n return external;\n });\n\n CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n var words = function(str) { return str.split(\" \"); };\n\n CodeMirror.defineMIME(\"text/x-cython\", {\n name: \"python\",\n extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except \"+\n \"extern gil include nogil property public \"+\n \"readonly struct union DEF IF ELIF ELSE\")\n });\n\n});\n", "export const codePointsToString = (code: number[]): string =>\n code.reduce((code, ord) => code + String.fromCharCode(ord), '');\n\nexport default codePointsToString;\n", "export const stringToCodePoints = (code: string): number[] =>\n code.split('').map((c: string): number => c.charCodeAt(0));\n\nexport default stringToCodePoints;\n", "import { Decoder } from '../Decoders';\nimport codePointsToString from '../codePointsToString';\nimport stringToCodePoints from '../stringToCodePoints';\n\nexport class Default implements Decoder {\n public name(): string {\n return 'default';\n }\n\n protected codePointsToString(code: number[]): string {\n return codePointsToString(code);\n }\n\n protected stringToCodePoints(code: string): number[] {\n return stringToCodePoints(code);\n }\n\n public matches(code: number[]): boolean {\n return this.matchesAsString(this.codePointsToString(code));\n }\n\n public matchesAsString(code: string): boolean {\n return true;\n }\n\n public decode(code: number[]): number[] {\n return this.decodeAsString(this.codePointsToString(code));\n }\n\n public decodeAsString(code: string): number[] {\n return this.stringToCodePoints(code);\n }\n}\n\nexport default Default;\n", "import { Decoder } from '../Decoders';\nimport Default from './Default';\n\nexport class Base64 extends Default implements Decoder {\n public name(): string {\n return 'base64';\n }\n\n public matchesAsString(code: string): boolean {\n // base64 input is at least 4 chars, pick 8 as `prin` is valid\n if (code.length < 8 || /[^A-Za-z0-9+/=]/.test(code)) {\n return false;\n }\n\n try {\n atob(code);\n\n return true;\n } catch (e) {\n return false;\n }\n }\n\n public decodeAsString(code: string): number[] {\n return Array.from(atob(code)).map((c: string): number => c.charCodeAt(0));\n }\n}\nexport default Base64;\n", "import Runner from './Runner';\n\nexport type RunnerProvider = (code: number[], input: string, args: string) => Promise;\n\nexport class Lang {\n constructor(\n private id: string,\n private name: string,\n private runner: RunnerProvider,\n private url: string = null,\n private args: string[] | null = null,\n private highlighterRef: string = id\n ) {}\n\n getId(): string {\n return this.id;\n }\n\n getName(): string {\n return this.name;\n }\n\n getURL(): string {\n return this.url;\n }\n\n getArgs(): string[] | null {\n return this.args;\n }\n\n getHighlighterRef(): string {\n return this.highlighterRef;\n }\n\n run(code: number[], input: string, args: string): Promise {\n return this.runner(code, input, args);\n }\n}\n\nexport default Lang;\n", "import EventEmitter from './index.js'\n\nexport { EventEmitter }\nexport default EventEmitter\n", "import { EventEmitter } from 'eventemitter3';\nimport { MelbaType } from 'melba-toast';\n\nexport type RunnerMessage = {\n type: 'run';\n code: number[];\n args: string;\n input: string;\n } | {\n type: 'output';\n output: string | undefined;\n error: string | undefined;\n } | {\n type: 'done';\n exitCode: number;\n };\n\nexport type RunnerError = {\n 'error': Error\n};\n\nexport type RunnerEventHandler = (message: RunnerMessage | RunnerError) => unknown;\n\nexport abstract class Runner extends EventEmitter<{\n error: RunnerError;\n message: RunnerMessage;\n done: {\n exitCode: number | undefined;\n };\n output: {\n output: string | undefined;\n error: string | undefined;\n };\n toast: {\n message: string;\n type: MelbaType | undefined;\n }\n}> {\n protected constructor() {\n super();\n\n this.on('message', (message: RunnerMessage) => {\n if (message.type === 'run') {\n return this.init(message.code, message.input, message.args);\n }\n\n if (message.type === 'output') {\n return this.emit('output', {\n output: message.output,\n error: message.error,\n });\n }\n\n if (message.type === 'done') {\n this.emit('done', {\n exitCode: message.exitCode,\n });\n\n return this.terminate();\n }\n\n console.warn('Unhandled message', message);\n });\n }\n\n abstract init(code: number[], input: string, args: string): Promise;\n abstract terminate(): void;\n}\n\nexport default Runner;\n", "import Runner, { RunnerEventHandler, RunnerMessage } from '../Runner';\n\nexport class WorkerRunner extends Runner {\n worker: Worker;\n\n constructor(workerURL: string | URL) {\n super();\n\n this.worker = new Worker(workerURL);\n\n this.worker.addEventListener('error', (error) =>\n this.emit('error', error),\n );\n\n this.worker.addEventListener('message', ({ data }) =>\n this.emit('message', data),\n );\n }\n\n async init(code: number[], input: string, args: string) {\n this.postMessage({\n type: 'run',\n code,\n args,\n input,\n });\n }\n\n postMessage(message: any, options?: StructuredSerializeOptions): void {\n return this.worker.postMessage(message, options);\n }\n\n terminate(): void {\n return this.worker.terminate();\n }\n}\n\nexport default WorkerRunner;\n", "import Runner from '../Runner';\nimport { SpawnOptions } from '@wasmer/sdk/dist/pkg/wasmer_js';\nimport codePointsToString from '../codePointsToString';\n// @ts-ignore\nimport { init, Instance, Wasmer as WasmerSDK } from \"https://unpkg.com/@wasmer/sdk@latest?module\";\n\nexport class Wasmer extends Runner {\n #package: WasmerSDK;\n #instance: Instance;\n\n constructor(private packageName: string, private filename: false | string = 'script', private spawnOptions?: SpawnOptions) {\n super();\n }\n\n /**\n * @param code\n * @param input STDIN\n * @param args The literal string `$filename` will be replaced with the path\n * to the code (e.g. `/app/script`) and is appended to the arguments\n * unless the `filename` parameter to the constructor is `false`.\n * `$code` will be replaced with a string representation of the code to\n * execute.\n */\n async init(code: number[], input: string, args: string) {\n await init();\n\n // Show an alert after a second as that probably means we're having to download the package\n const preparingMessageTimeout = window.setTimeout(() =>\n this.emit('toast', {\n message: 'Downloading package from wasmer.io. This might take some time...',\n type: 'info',\n })\n , 1000);\n\n this.#package = await WasmerSDK.fromRegistry(this.packageName);\n\n if (this.filename) {\n if (!args.includes('$filename')) {\n args += (args.length > 0 ? '\\n' : '') + '$filename';\n }\n\n args = args.replace('$filename', `/app/${this.filename}`)\n }\n\n const entrypointArgs = {\n args: args.split('\\n')\n .map((arg) => {\n if (arg !== '$code') {\n return arg;\n }\n\n return codePointsToString(code);\n }),\n stdin: input,\n ...this.spawnOptions,\n mount: {\n ...this.spawnOptions?.mount,\n '/app': {\n ...(this.spawnOptions?.mount && ( '/app' in this.spawnOptions?.mount) ? this.spawnOptions?.mount['/app'] : {}),\n ...(this.filename ? { [this.filename]: new Uint8Array(code) } : {}),\n },\n },\n };\n\n window.clearTimeout(preparingMessageTimeout);\n\n this.#instance = await this.#package.entrypoint.run(entrypointArgs);\n\n const { code: exitCode, stderr, stdout } = await this.#instance.wait();\n\n stdout.split('')\n .forEach((char) =>\n this.emit('output', {\n output: char,\n })\n );\n\n stderr.split('')\n .forEach((char) =>\n this.emit('output', {\n error: char,\n })\n );\n\n this.emit('done', {\n code: exitCode,\n });\n }\n\n terminate(): void {\n // TODO\n // return this.#instance.free();\n }\n}\n\nexport default Wasmer;\n", "import Lang from './Lang';\nimport WorkerRunner from './Runners/Worker';\nimport Runner from './Runner';\nimport Wasmer from './Runners/Wasmer';\nimport { SpawnOptions } from '@wasmer/sdk/dist/pkg/wasmer_js';\n\nexport class Langs {\n private data: { [key: string]: Lang } = {};\n\n public register(...langs: Lang[]): void {\n langs.forEach((lang: Lang): void => {\n this.data[lang.getId()] = lang;\n });\n }\n\n public get(lang: string): Lang {\n return this.data[lang];\n }\n\n public all(): string[] {\n return Object.keys(this.data);\n }\n\n public async run(\n langId: string,\n code: number[],\n args: string,\n input: string\n ): Promise {\n return await this.data[langId].run(code, input, args);\n }\n}\n\nexport const workerRunner =\n (workerURL: string | URL) =>\n async (code: number[], input: string, args: string): Promise => {\n const runner = new WorkerRunner(workerURL);\n\n runner.init(code, input, args);\n\n return runner;\n };\n\nexport const wasmerRunner =\n (packageName: string, filename: false | string = 'script', spawnOptions?: SpawnOptions) =>\n async (code: number[], input: string, args: string): Promise => {\n const runner = new Wasmer(packageName, filename, spawnOptions);\n\n runner.init(code, input, args);\n\n return runner;\n };\n\nexport const langs = new Langs();\n\nexport default langs;\n", "import { Lang } from '../../Lang';\nimport { wasmerRunner } from '../../Langs';\nimport 'codemirror/mode/shell/shell';\n\nexport class Bash extends Lang {\n constructor() {\n super(\n 'bash-wasmer',\n 'Bash (wasmer)',\n wasmerRunner('sharrattj/bash', 'script.sh'),\n 'https://www.gnu.org/software/bash/',\n [],\n 'shell'\n );\n }\n}\n\nexport default Bash;\n", "import { Decoder } from '../Decoders';\nimport Default from './Default';\n\nexport class Hexdump extends Default implements Decoder {\n public name(): string {\n return 'hexdump';\n }\n\n public matchesAsString(code: string): boolean {\n // TODO: could use the length to check that it's actually valid...\n return /^([0-9a-f]{7}(( ([0-9a-f]{4})){1,8}) *\\n)+[0-9a-f]{7}\\n?$/.test(\n code\n );\n }\n\n public decodeAsString(code: string): number[] {\n return code\n .trim()\n .replace(/\\n[0-9a-f]{7}\\n?$/, '')\n .replace(/(?<=^|\\n)[0-9a-f]{7}(( ([0-9a-f]{4})){1,8}) */g, '$1')\n .replace(/\\s+/g, '')\n .replace(/(..)(..)/g, '$2$1')\n .replace(/00$/, '')\n .match(/../g)\n .map((c: string): number => parseInt(c, 16));\n }\n}\n\nexport default Hexdump;\n", "import { Lang } from '../../Lang';\nimport { workerRunner } from '../../Langs';\nimport 'codemirror/mode/javascript/javascript';\n\nexport class JavaScript extends Lang {\n constructor() {\n super(\n 'javascript-browser',\n 'JavaScript (Browser)',\n workerRunner('dist/js/langs/javascript-browser/worker.js'),\n 'https://www.ecma-international.org/publications-and-standards/standards/ecma-262/',\n null,\n 'javascript'\n );\n }\n}\n\nexport default JavaScript;\n", "import { Lang } from '../../Lang';\nimport { wasmerRunner } from '../../Langs';\nimport 'codemirror/mode/ruby/ruby';\n\nexport class Ruby extends Lang {\n constructor() {\n super(\n 'ruby-wasmer',\n 'Ruby (wasmer)',\n wasmerRunner('katei/ruby', 'script.rb'),\n // wasmerRunner('madao/ruby-wasm', 'script.rb'),\n 'https://www.ruby-lang.org/',\n [],\n 'ruby'\n );\n }\n}\n\nexport default Ruby;\n", "import { Lang } from '../../Lang';\nimport { workerRunner } from '../../Langs';\nimport 'codemirror/mode/perl/perl';\n\nexport class Perl extends Lang {\n constructor() {\n super(\n 'webperl-5.28.1',\n 'Perl 5.28.1 (webperl)',\n workerRunner('dist/js/langs/webperl-5.28.1/worker.js'),\n 'https://www.perl.org/',\n ['-M5.10.0', '-F', '-l', '-p'],\n 'perl'\n );\n }\n}\n\nexport default Perl;\n", "import { Editor, EditorConfiguration, fromTextArea } from 'codemirror';\nimport { Melba, MelbaConstructorOptions, MelbaType } from 'melba-toast';\nimport { Renderers, createDevice } from './Renderers';\nimport CodeInput from './Inputs/Code';\nimport CodeRenderer from './Renderers/Code';\nimport IFrame from './Renderers/IFrame';\nimport IO from './IO';\nimport Image from './Renderers/Image';\nimport Inputs from './Inputs';\nimport PBMImage from './Renderers/PBMImage';\nimport TTY from './Renderers/TTY';\nimport codePointsToString from './codePointsToString';\nimport { decoders } from './Decoders';\nimport { langs } from './Langs';\nimport { options } from './Options';\nimport replaceBinaryBytes from './replaceBinaryBytes';\n\nimport 'codemirror/addon/comment/comment';\nimport 'codemirror/addon/comment/continuecomment';\nimport 'codemirror/addon/display/placeholder';\nimport 'codemirror/addon/edit/closebrackets';\nimport 'codemirror/addon/edit/matchbrackets';\nimport 'codemirror/keymap/sublime';\n\ntype Message = {\n name: 'setOption';\n value: {\n name: string;\n value: unknown;\n };\n};\n\nexport type IHashData = {\n lang: string;\n header?: string;\n code: string;\n footer?: string;\n args?: string;\n input?: string;\n type?: 'tty' | 'resource';\n mime?: string;\n options?: { [key: string]: unknown };\n};\n\nexport class UI {\n private addArg: HTMLHeadingElement;\n private args: Editor;\n private argsWrapper: HTMLDivElement;\n private bytesCount: HTMLSpanElement;\n private bytesPlural: HTMLSpanElement;\n private code: Inputs;\n private codeFooter: Inputs;\n private codeHeader: Inputs;\n private copyLinkButton: HTMLButtonElement;\n private encoded: HTMLSpanElement;\n private expanders: NodeListOf;\n private format: HTMLSpanElement;\n private io: IO;\n private langSelector: HTMLSelectElement;\n private markdownButton: HTMLButtonElement;\n private mimeType: string = 'text/plain';\n private mimeTypeInput: HTMLInputElement;\n private runButton: HTMLButtonElement;\n private stderr: Renderers;\n private stdin: Editor;\n private stdout: Renderers;\n private stopButton: HTMLButtonElement;\n\n constructor() {\n this.langSelector = document.querySelector(\n 'select[name=\"lang\"]'\n ) as HTMLSelectElement;\n\n this.addRegisteredLangs();\n\n const stdoutContainer = document.querySelector(\n 'div.stdout'\n ) as HTMLDivElement;\n\n this.codeHeader = new Inputs(\n new CodeInput(document.querySelector('div.header') as HTMLDivElement, {\n autoCloseBrackets: true,\n matchBrackets: true,\n placeholder: 'Header...',\n })\n );\n this.codeHeader.activate(CodeInput);\n\n this.code = new Inputs(\n new CodeInput(document.querySelector('div.code') as HTMLDivElement, {\n autoCloseBrackets: true,\n autofocus: true,\n matchBrackets: true,\n placeholder: 'Code...',\n })\n );\n this.code.activate(CodeInput);\n this.code.setType(this.langSelector.value);\n\n this.langSelector.addEventListener('change', () =>\n this.code.setType(this.langSelector.value)\n );\n\n this.codeFooter = new Inputs(\n new CodeInput(document.querySelector('div.footer') as HTMLDivElement, {\n autoCloseBrackets: true,\n autofocus: true,\n matchBrackets: true,\n placeholder: 'Footer...',\n })\n );\n this.codeFooter.activate(CodeInput);\n\n this.stdout = createDevice(\n new CodeRenderer(stdoutContainer),\n new PBMImage(stdoutContainer),\n new Image(stdoutContainer),\n new IFrame(stdoutContainer),\n new TTY(stdoutContainer)\n );\n this.stdout.activate('text/plain');\n\n this.stderr = createDevice(\n new TTY(document.querySelector('div.stderr') as HTMLDivElement)\n );\n this.stderr.setPrepend('\\x1b[31m');\n this.stderr.activate('text/plain');\n this.stdin = UI.createEditor(\n document.querySelector('textarea[name=\"input\"]') as HTMLTextAreaElement\n );\n this.args = UI.createEditor(\n document.querySelector('textarea[name=\"args\"]') as HTMLTextAreaElement\n );\n\n this.io = new IO(this.stdin, this.args);\n\n this.expanders = document.querySelectorAll(\n 'button[name=\"expand\"]'\n ) as NodeListOf;\n this.argsWrapper = document.querySelector(\n '.args-wrapper'\n ) as HTMLDivElement;\n this.addArg = document.querySelector(\n '.args-wrapper .actions'\n ) as HTMLHeadingElement;\n this.runButton = document.querySelector(\n 'button[name=\"run\"]'\n ) as HTMLButtonElement;\n this.stopButton = document.querySelector(\n 'button[name=\"stop\"]'\n ) as HTMLButtonElement;\n this.bytesCount = document.querySelector(\n '.bytes .byte-count'\n ) as HTMLSpanElement;\n this.bytesPlural = document.querySelector(\n '.bytes .plural'\n ) as HTMLSpanElement;\n this.encoded = document.querySelector('.encoded') as HTMLSpanElement;\n this.format = document.querySelector('.format') as HTMLSpanElement;\n this.copyLinkButton = document.querySelector(\n 'button[name=\"copy\"]'\n ) as HTMLButtonElement;\n this.markdownButton = document.querySelector(\n 'button[name=\"markdown\"]'\n ) as HTMLButtonElement;\n this.mimeTypeInput = document.querySelector('.stdout-header input');\n this.connectExpanders();\n\n // bind events\n this.code.on('change', () => this.codeOnChange());\n\n this.runButton.addEventListener('click', () => this.runCode());\n this.langSelector.addEventListener('change', () => this.populateArgs());\n this.copyLinkButton.addEventListener('click', () => {\n const link = this.buildLink();\n\n if (location.href !== link) {\n history.pushState(this.buildHashData(), document.title, link);\n }\n\n navigator.clipboard.writeText(link);\n\n UI.copied(this.copyLinkButton);\n });\n this.markdownButton.addEventListener('click', () => {\n navigator.clipboard.writeText(this.buildMarkdown());\n\n UI.copied(this.markdownButton);\n });\n this.mimeTypeInput.addEventListener('change', () =>\n this.setMimeType(this.mimeTypeInput.value || 'text/plain', false)\n );\n this.mimeTypeInput.addEventListener('keypress', ({ key }) => {\n if (key === 'Enter' && this.mimeType !== this.mimeTypeInput.value) {\n this.setMimeType(this.mimeTypeInput.value || 'text/plain', false);\n }\n });\n\n addEventListener('keydown', (event) => {\n if (event.key === 's' && (event.ctrlKey || event.metaKey)) {\n const link = this.buildLink();\n\n history.pushState(this.buildHashData(), document.title, link);\n navigator.clipboard.writeText(link);\n\n this.toast('Saved!', 'success', {\n hide: 2,\n });\n\n event.preventDefault();\n }\n });\n\n addEventListener('hashchange', () => {\n this.parseHashData(location.hash);\n\n if (this.code.read().length) {\n this.runCode();\n }\n });\n addEventListener('resize', () => this.resize());\n addEventListener(\n 'message',\n ({ data: { name, value } }: { data: Message }) => {\n if (name === 'setOption') {\n options.set(value.name, value.value);\n }\n }\n );\n\n // onload\n const previousLang = window.localStorage.getItem('lastUsedLanguage');\n if (previousLang) {\n this.setLang(previousLang);\n }\n\n this.parseHashData(location.hash);\n try {\n this.populateArgs();\n } catch (e) {\n this.toast(e.message, 'error');\n }\n this.codeOnChange();\n\n if (this.code.read().length) {\n this.runCode();\n }\n\n this.resize();\n\n document\n .querySelector('button.fullscreen-toggle')\n .addEventListener('click', () => this.enterFullscreen());\n\n document.addEventListener('fullscreenchange', () => this.exitFullscreen());\n }\n\n private addRegisteredLangs(): void {\n langs.all().forEach((langKey) => {\n const lang = langs.get(langKey),\n option = document.createElement('option');\n\n option.setAttribute('value', lang.getId());\n option.append(document.createTextNode(lang.getName()));\n\n this.langSelector.append(option);\n });\n }\n\n private setLang(lang: string): void {\n const availableLangs = langs.all();\n\n if (!availableLangs.includes(lang)) {\n throw new TypeError(`Unknown lang: ${lang}.`);\n }\n\n this.langSelector.value = lang;\n\n this.setCodeHighlight();\n }\n\n private getLangId(): string {\n return this.langSelector.value;\n }\n\n private setCodeHighlight(): void {\n const lang = langs.get(this.getLangId());\n\n [this.codeHeader, this.code, this.codeFooter].forEach((inputs) => {\n const decoder = decoders.decoderAsString(inputs.readAsString(null));\n\n if (decoder.name() !== 'default') {\n inputs.setType(null);\n\n return;\n }\n\n inputs.setType(lang.getHighlighterRef());\n });\n }\n\n public static createEditor(\n element: HTMLTextAreaElement,\n options: EditorConfiguration = {}\n ): Editor {\n return fromTextArea(element, {\n mode: null,\n theme: 'monokai',\n viewportMargin: Infinity,\n ...options,\n extraKeys: {\n 'Ctrl-D': 'duplicateLine',\n 'Ctrl-/': 'toggleComment',\n 'Shift-Tab': false,\n Tab: false,\n // @ts-ignore\n ...(options.extraKeys || {}),\n },\n });\n }\n\n private resize(): void {\n this.stdout.resize();\n this.stderr.resize();\n }\n\n private codeOnChange(): void {\n const code = this.code.read();\n\n this.encoded.setAttribute('hidden', '');\n\n this.setCodeHighlight();\n\n const decoder = decoders.decoder(code);\n\n if (decoder.name() !== 'default') {\n this.encoded.removeAttribute('hidden');\n\n this.format.innerText = decoder.name();\n }\n\n const decodedCode = decoder.decode(code);\n\n this.showBytes(decodedCode.length);\n }\n\n private runCode(): void {\n const started = Date.now();\n\n this.stdout.reset();\n this.stderr.reset();\n\n this.runButton.setAttribute('disabled', '');\n this.stopButton.removeAttribute('disabled');\n\n langs.run(\n this.getLangId(),\n [].concat(\n [\n this.codeHeader.read(),\n this.code.read(),\n this.codeFooter.read(),\n ].flatMap((code) => decoders.decode(code))\n ),\n this.io.getArgs(),\n this.io.getStdin()\n )\n .then((runner) => {\n const stopHandler = () => {\n runner.terminate();\n\n this.stderr.write(`Aborted execution after ${Date.now() - started}ms`);\n\n this.runButton.removeAttribute('disabled');\n this.stopButton.setAttribute('disabled', '');\n\n this.stopButton.removeEventListener('click', stopHandler);\n };\n\n this.stopButton.addEventListener('click', stopHandler);\n\n runner.on('output', ({ output, error }) => {\n this.stdout.write(output ?? '');\n this.stderr.write(error ?? '');\n });\n\n runner.on('done', ({ exitCode }) => {\n this.stderr.write(\n `Execution finished with status code ${exitCode} after ${Date.now() - started}ms`\n );\n\n this.runButton.removeAttribute('disabled');\n this.stopButton.setAttribute('disabled', '');\n\n this.stopButton.removeEventListener('click', stopHandler);\n\n // Make sure the process is stopped\n runner.terminate();\n });\n\n runner.on('toast', ({ message, type = 'info' }) =>\n this.toast(message, type)\n );\n\n runner.on('error', (e) => {\n this.toast(`Worker error: ${e.message}`, 'error');\n\n this.runButton.removeAttribute('disabled');\n this.stopButton.setAttribute('disabled', '');\n });\n });\n }\n\n private populateArgs(): void {\n while (this.addArg.firstElementChild) {\n this.addArg.firstElementChild.remove();\n }\n\n const lang = langs.get(this.getLangId());\n\n if (!lang) {\n throw new TypeError('Unregistered lang: ' + this.getLangId());\n }\n\n window.localStorage.setItem('lastUsedLanguage', lang.getId());\n\n const args = lang.getArgs();\n\n if (args !== null) {\n this.argsWrapper.removeAttribute('hidden');\n\n args.forEach((arg) => {\n const argButton = document.createElement('button');\n\n argButton.append(document.createTextNode(arg));\n\n argButton.addEventListener('click', () => {\n const currentValue = this.io.getArgs() ?? '',\n match = new RegExp('(\\\\n|^)' + arg + '(\\\\n|$)');\n\n if (match.test(currentValue)) {\n return;\n }\n\n this.io.setArgs((currentValue + '\\n' + arg).trim());\n });\n\n this.addArg.append(argButton);\n });\n } else {\n this.argsWrapper.setAttribute('hidden', '');\n }\n\n this.io.argsRefresh();\n }\n\n private static expand(expander: HTMLButtonElement): void {\n const collapser = expander.nextElementSibling as HTMLButtonElement,\n target = document.querySelector(expander.dataset.target);\n\n if (!target) {\n console.debug('No collapser or target for expander: ', expander);\n\n return;\n }\n\n expander.setAttribute('hidden', '');\n target.removeAttribute('hidden');\n collapser.removeAttribute('hidden');\n collapser.focus();\n }\n\n private static collapse(expander: HTMLButtonElement): void {\n const collapser = expander.nextElementSibling,\n target = document.querySelector(expander.dataset.target);\n\n if (!target) {\n console.debug('No collapser or target for expander: ', expander);\n\n return;\n }\n\n expander.removeAttribute('hidden');\n target.setAttribute('hidden', '');\n collapser.setAttribute('hidden', '');\n expander.focus();\n }\n\n private connectExpanders(): void {\n this.expanders.forEach((expander) => {\n const collapser = expander.nextElementSibling;\n\n if (!collapser || !collapser.matches('button[name=\"collapse\"]')) {\n console.debug('No collapser or target for expander: ', expander);\n\n return;\n }\n\n expander.addEventListener('click', () => UI.expand(expander));\n collapser.addEventListener('click', () => UI.collapse(expander));\n });\n }\n\n private setMimeType(mimeType: string, setInput: boolean = true): void {\n this.mimeType = mimeType;\n\n if (setInput) {\n this.mimeTypeInput.value = mimeType;\n }\n\n this.stdout.activate(mimeType);\n this.stdout.resize();\n }\n\n private static copied(button: HTMLButtonElement | HTMLInputElement): void {\n button.setAttribute('disabled', '');\n button.style.width = button.offsetWidth + 'px';\n button.classList.toggle('copied');\n\n setTimeout(() => {\n button.removeAttribute('disabled');\n button.style.width = null;\n button.classList.toggle('copied');\n }, 1000);\n }\n\n private parseHashData(hash): void {\n if (!hash || hash.length < 2) {\n return;\n }\n\n let data;\n\n try {\n const jsonData = atob(hash.slice(1));\n\n data = JSON.parse(jsonData);\n } catch (e) {\n if (e instanceof DOMException) {\n this.toast('Unable to decode URL data. Aborting.', 'error');\n\n return;\n }\n\n if (e instanceof SyntaxError) {\n this.toast('Unable to decode JSON data. Aborting.', 'error');\n\n return;\n }\n\n throw e;\n }\n\n const [headerExpander] = Array.from(this.expanders).filter((expander) =>\n expander.parentElement.matches('.code-header')\n ),\n [footerExpander] = Array.from(this.expanders).filter((expander) =>\n expander.parentElement.matches('.code-footer')\n );\n\n if (data.header) {\n UI.expand(headerExpander);\n }\n\n if (data.footer) {\n UI.expand(footerExpander);\n }\n\n if (data.options) {\n Object.entries(data.options).forEach(([key, value]) =>\n options.set(key, value)\n );\n }\n\n this.setLang(data.lang ?? this.getLangId());\n this.codeHeader.write(decodeURIComponent(escape(data.header ?? '')));\n this.code.write(decodeURIComponent(escape(data.code ?? '')));\n this.codeFooter.write(decodeURIComponent(escape(data.footer ?? '')));\n this.io.setArgs(data.args ?? '');\n this.io.setStdin(decodeURIComponent(escape(data.input ?? '')));\n\n if (data.mime) {\n this.setMimeType(data.mime);\n }\n }\n\n private buildHashData() {\n const data: IHashData = {\n lang: this.getLangId(),\n code: this.code.readAsString(null),\n },\n header = this.codeHeader.readAsString(null),\n footer = this.codeFooter.readAsString(null),\n args = this.io.getArgs(),\n input = this.io.getStdin(),\n mime = this.mimeType,\n optionValues = options.options;\n\n Object.entries({\n header,\n footer,\n args,\n input,\n }).forEach(([key, value]) => {\n if (value) {\n data[key] = value;\n }\n });\n\n if (JSON.stringify(optionValues) !== '{}') {\n data.options = optionValues;\n }\n\n if (mime !== 'text/plain') {\n data.mime = mime;\n }\n\n return btoa(JSON.stringify(data));\n }\n\n private buildLink(): string {\n const hash = this.buildHashData();\n\n return (\n location.protocol + '//' + location.host + location.pathname + '#' + hash\n );\n }\n\n private buildMarkdown(): string {\n const args = this.io.getArgs().trim().split(/\\n/).join(' '),\n lang = langs.get(this.getLangId()),\n key = Math.random().toString(36).slice(2, 10),\n rawCode = decoders.decode(this.code.read()),\n code = replaceBinaryBytes(codePointsToString(rawCode)),\n bytes = code.length;\n\n return `# [${lang.getName()}]${\n args ? ` + \\`${args}\\`` : ''\n }, ${bytes} byte${bytes === 1 ? '' : 's'}\n\n\n\n
${code.replace(/[&<>]/g, (char) =>\n      char === '<'\n        ? '<'\n        : char === '>'\n        ? '>'\n        : char === '&'\n        ? '&'\n        : char\n    )}
\n\n[Try it online!][TIO-${key}]\n\n[${lang.getName()}]: ${lang.getURL()}\n[TIO-${key}]: ${this.buildLink()}`;\n }\n\n private showBytes(byteCount: number): void {\n this.bytesCount.innerText = byteCount.toString();\n\n if (byteCount === 1) {\n this.bytesPlural.setAttribute('hidden', '');\n\n return;\n }\n\n this.bytesPlural.removeAttribute('hidden');\n }\n\n private enterFullscreen(): void {\n document.body.requestFullscreen().then(() => {\n document.body.classList.add('fullscreen');\n this.resize();\n });\n }\n\n private exitFullscreen(): void {\n document.body.classList.remove('fullscreen');\n this.resize();\n }\n\n public toast(\n content: string,\n type: MelbaType,\n options: Omit = {}\n ): Melba {\n if (!options.events) {\n options.events = {};\n }\n\n if (!options.events.click) {\n options.events.click = [];\n }\n\n options.events.click.push((toast) => toast.hide());\n\n return new Melba({\n ...options,\n content,\n type,\n });\n }\n}\n\nexport default UI;\n", "export interface Renderer {\n activate(mimeType: string): void;\n deactivate(): void;\n isActive(): boolean;\n matches(mimeType: string): boolean;\n reset(): void;\n resize(): void;\n write(char: number | string): void;\n}\n\nexport class Renderers {\n private buffer: string = '';\n private prepend: string = '';\n private registered: Renderer[] = [];\n\n public constructor(...renderers: Renderer[]) {\n this.register(...renderers);\n }\n\n public activate(mimeType: string): void {\n this.registered.reduce((value, renderer): boolean => {\n // Activate the first Renderer that matches\n if (renderer.matches(mimeType) && !value) {\n if (!renderer.isActive()) {\n renderer.activate(mimeType);\n renderer.reset();\n renderer.write(this.prepend + this.buffer);\n }\n\n return true;\n }\n\n renderer.deactivate();\n renderer.reset();\n\n return value;\n }, false);\n\n this.resize();\n }\n\n public refresh(): void {\n this.registered.forEach((renderer) => {\n this.registered\n .filter((renderer) => renderer.isActive())\n .forEach((renderer) => {\n renderer.reset();\n renderer.write(this.prepend + this.buffer);\n });\n });\n }\n\n public register(...renderers: Renderer[]): void {\n this.registered.push(...renderers);\n }\n\n public reset(): void {\n this.buffer = '';\n this.registered.forEach((renderer) => {\n renderer.reset();\n\n if (this.prepend) {\n renderer.write(this.prepend);\n }\n });\n }\n\n public resize(): void {\n this.registered.forEach((renderer) => {\n if (renderer.isActive()) {\n renderer.resize();\n }\n });\n }\n\n public setPrepend(prepend: string): void {\n this.prepend = prepend;\n\n this.refresh();\n }\n\n public write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.buffer += char;\n this.registered\n .filter((renderer) => renderer.isActive())\n .forEach((renderer) => renderer.write(char));\n }\n}\n\nexport default Renderers;\n\nexport const createDevice = (...renderers: Renderer[]): Renderers =>\n new Renderers(...renderers);\n", "import {\n Editor,\n EditorConfiguration,\n KeyMap,\n fromTextArea,\n EditorEventMap,\n} from 'codemirror';\nimport Abstract from './Abstract';\nimport { Input } from '../Inputs';\nimport replaceBinaryBytes from '../replaceBinaryBytes';\n\nexport class Code extends Abstract implements Input {\n private editor: Editor;\n\n public constructor(parent: HTMLElement, options: EditorConfiguration = {}) {\n super();\n\n const element = this.createElement('div'),\n textarea = document.createElement('textarea') as HTMLTextAreaElement;\n\n parent.append(element);\n element.append(textarea);\n\n this.editor = fromTextArea(textarea, {\n mode: null,\n theme: 'monokai',\n viewportMargin: Infinity,\n ...options,\n extraKeys: {\n 'Ctrl-D': 'duplicateLine',\n 'Ctrl-/': 'toggleComment',\n 'Shift-Tab': false,\n Tab: false,\n ...(Object.keys(options.extraKeys || {}).length\n ? (options.extraKeys as KeyMap)\n : {}),\n },\n });\n\n this.editor.on('change', () => {\n if (this.inputs === null) {\n return;\n }\n\n // Could be smarter about this...\n this.inputs.setBuffer(\n this.editor\n .getValue()\n .split('')\n .map((char) => char.charCodeAt(0))\n );\n });\n }\n\n public matches(data: string): boolean {\n return /^[\\t\\n -~]*$/.test(data);\n }\n\n public on(eventName: string, handler: (...args: any[]) => void): void {\n this.editor.on(eventName as keyof EditorEventMap, (...args: any[]) =>\n handler(...args)\n );\n }\n\n public readAsString(binaryReplacementChar: string | null = '.'): string {\n const code = unescape(encodeURIComponent(this.editor.getValue()));\n\n if (binaryReplacementChar === null) {\n return code;\n }\n\n return replaceBinaryBytes(code, binaryReplacementChar);\n }\n\n public reset(): void {\n this.editor.setValue('');\n }\n\n public setOption(\n key: keyof EditorConfiguration,\n value: EditorConfiguration[keyof EditorConfiguration]\n ): void {\n this.editor.setOption(key, value);\n }\n\n public setType(type: string | null): void {\n if (this.editor.getOption('mode') !== type) {\n this.editor.setOption('mode', type);\n\n // This triggers the code to be highlighted in the newly selected language\n this.editor.setValue(this.editor.getValue());\n }\n }\n\n public write(data: string | number[]): void {\n if (Array.isArray(data)) {\n // String.fromCharCode(...data) causes an error with really long input!\n data = data.map((c) => String.fromCharCode(c)).join('');\n }\n\n this.editor.setValue(data);\n }\n}\n\nexport default Code;\n", "import { Input, Inputs } from '../Inputs';\n\nexport abstract class Abstract implements Input {\n protected active: boolean = false;\n private container: HTMLElement;\n protected inputs: Inputs | null = null;\n\n public activate(inputs: Inputs): void {\n this.container.removeAttribute('hidden');\n this.active = true;\n this.inputs = inputs;\n\n this.resize();\n }\n\n protected createElement(tag: string = 'div'): HTMLElement {\n this.container = document.createElement(tag);\n\n this.container.setAttribute('hidden', '');\n\n return this.container;\n }\n\n public deactivate(): void {\n this.container.setAttribute('hidden', '');\n this.active = false;\n }\n\n public isActive(): boolean {\n return this.active;\n }\n\n abstract matches(data: string): boolean;\n\n abstract on(eventName: string, handler: (...args: any[]) => void): void;\n\n public read(): number[] {\n return this.readAsString(null)\n .split('')\n .map((c) => c.charCodeAt(0));\n }\n\n abstract readAsString(replaceBinaryBytes: string | null): string;\n\n abstract setType(type: string | null): void;\n\n abstract write(data: string | number[]): void;\n\n abstract reset(): void;\n\n public resize(): void {}\n}\n\nexport default Abstract;\n", "// Don't replace newlines\nexport const replaceBinaryBytes = (code: string, replacement: string = '.') =>\n code.replace(/[^\\x09\\x0a\\x20-\\x7e]/g, replacement);\n\nexport default replaceBinaryBytes;\n", "import { Renderer } from '../Renderers';\n\nexport abstract class Abstract implements Renderer {\n protected active: boolean = false;\n protected container: HTMLElement;\n protected mimeType: string = 'text/plain';\n\n public activate(mimeType: string): void {\n this.container.removeAttribute('hidden');\n this.active = true;\n this.mimeType = mimeType;\n\n this.resize();\n }\n\n protected createElement(tag: 'div', hidden?: boolean): HTMLDivElement;\n protected createElement(tag: 'iframe', hidden?: boolean): HTMLIFrameElement;\n protected createElement(\n tag: string = 'div',\n hidden: boolean = true\n ): HTMLElement {\n const element = document.createElement(tag);\n\n if (hidden) {\n element.setAttribute('hidden', '');\n }\n\n return element;\n }\n\n public deactivate(): void {\n this.container.setAttribute('hidden', '');\n this.active = false;\n }\n\n public isActive(): boolean {\n return this.active;\n }\n\n public matches(mimeType: string): boolean {\n return true;\n }\n\n abstract write(char: number): void;\n abstract write(data: string): void;\n\n abstract reset(): void;\n\n public resize(): void {}\n}\n\nexport default Abstract;\n", "import { Editor, EditorConfiguration } from 'codemirror';\nimport Abstract from './Abstract';\nimport { Renderer } from '../Renderers';\nimport UI from '../UI';\n\nimport 'codemirror/mode/javascript/javascript';\nimport 'codemirror/mode/perl/perl';\n\nexport class Code extends Abstract implements Renderer {\n private editor: Editor;\n\n constructor(parent: HTMLElement, options: EditorConfiguration = {}) {\n super();\n\n const textarea = document.createElement('textarea');\n\n this.container = this.createElement('div');\n\n this.container.append(textarea);\n parent.append(this.container);\n\n this.editor = UI.createEditor(textarea, {\n ...options,\n readOnly: true,\n });\n\n parent.append(this.container);\n }\n\n activate(mimeType: string) {\n super.activate(mimeType);\n\n this.editor.setOption('mode', mimeType);\n }\n\n deactivate() {\n super.deactivate();\n }\n\n matches(mimeType: string): boolean {\n return [\n 'application/ecmascript',\n 'application/javascript',\n 'application/json',\n 'application/x-perl',\n 'text/ecmascript',\n 'text/javascript',\n 'text/json',\n 'text/x-perl',\n ].includes(mimeType);\n }\n\n reset(): void {\n this.editor.setValue('');\n }\n\n write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.editor.setValue(this.editor.getValue() + char);\n }\n}\n\nexport default Code;\n", "import Abstract from './Abstract';\nimport { Renderer } from '../Renderers';\n\nexport class IFrame extends Abstract implements Renderer {\n protected buffer: string = '';\n protected container: HTMLIFrameElement;\n protected mimeType: string = 'text/html';\n\n public constructor(parent: HTMLElement) {\n super();\n\n this.container = this.createElement('iframe');\n\n parent.append(this.container);\n\n this.update();\n }\n\n public activate(mimeType: string) {\n super.activate(mimeType);\n\n this.update();\n }\n\n public matches(mimeType: string): boolean {\n return ['text/html'].includes(mimeType);\n }\n\n public reset(): void {\n this.buffer = '';\n this.update();\n }\n\n public write(char: number): void;\n public write(data: string): void;\n public write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.buffer += char;\n this.update();\n }\n\n private update(): void {\n // We need to destroy and recreate the IFrame so that we don't clobber the back button.\n const container = this.createElement(\n 'iframe',\n this.container.hasAttribute('hidden')\n );\n\n container.src = `data:${this.mimeType};base64,${btoa(this.buffer)}`;\n\n this.container.replaceWith(container);\n\n this.container = container;\n }\n}\n\nexport default IFrame;\n", "export interface Decoder {\n name(): string;\n matches(code: number[]): boolean;\n matchesAsString(code: string): boolean;\n decode(code: number[]): number[];\n decodeAsString(code: string): number[];\n}\n\nexport class Decoders {\n private registered: Decoder[] = [];\n\n public register(...decoders: Decoder[]): void {\n this.registered.push(...decoders);\n }\n\n public decode(code: number[]): number[] {\n return this.decoder(code).decode(code);\n }\n\n public decodeAsString(code: string): number[] {\n return this.decoderAsString(code).decodeAsString(code);\n }\n\n public decoder(code: number[]): Decoder {\n const [decoder] = this.registered.filter((decoder): boolean =>\n decoder.matches(code)\n );\n\n return decoder;\n }\n\n public decoderAsString(code: string): Decoder {\n const [decoder] = this.registered.filter((decoder): boolean =>\n decoder.matchesAsString(code)\n );\n\n return decoder;\n }\n}\n\nexport default Decoders;\n\nexport const decoders = new Decoders();\n", "import { Editor } from 'codemirror';\nimport { decoders } from './Decoders';\n\nexport class IO {\n constructor(private stdin: Editor, private args: Editor) {}\n\n public getArgs(): string {\n return this.args.getValue();\n }\n\n public setArgs(value: string): void {\n this.args.setValue(value);\n }\n\n public argsRefresh(): void {\n this.args.refresh();\n }\n\n public getStdin(): string {\n return decoders\n .decodeAsString(this.stdin.getValue())\n .reduce((value, char) => value + String.fromCharCode(char), '');\n }\n\n public setStdin(value: string): void {\n this.stdin.setValue(value);\n }\n}\n\nexport default IO;\n", "export class Options {\n public options: {\n [key: string]: any;\n } = {};\n\n get(name: string, defaultValue: T = null): T {\n return (this.options[name] as T) ?? defaultValue;\n }\n\n set(name: string, value: any): void {\n this.options[name] = value;\n }\n}\n\nexport const options = new Options();\n\nexport default Options;\n", "import IFrame from './IFrame';\nimport { options } from '../Options';\n\n/**\n * Uses the following icons:\n * https://iconmonstr.com/magnifier-7-svg/\n * https://iconmonstr.com/magnifier-8-svg/\n */\nexport class Image extends IFrame {\n private imageBuffer: string = '';\n private imageMimeType: string = 'image/png';\n private zoomLevel: number = 1;\n\n public activate(mimeType: string) {\n this.zoomLevel = options.get('zoomLevel', 1);\n\n super.activate('text/html');\n\n this.imageMimeType = mimeType;\n }\n\n // TODO: this whole renderer should be a separate package with the contents parsed into a minified file\n private css(): string {\n return `\nhtml, body {\n margin: 0;\n padding: 0;\n}\n\nbody > img {\n --z: ${this.zoomLevel};\n image-rendering: pixelated;\n transform: scale(var(--z));\n transform-origin: 0 0;\n}\n\n.checked {\n background-image: linear-gradient(to right, rgba(192, 192, 192, 0.75), rgba(192, 192, 192, 0.75)),\n linear-gradient(to right, black 50%, white 50%),\n linear-gradient(to bottom, black 50%, white 50%);\n background-blend-mode: normal, difference, normal;\n background-size: 2em 2em;\n}\n\n.controls {\n background: rgba(255, 255, 255, .2);\n border: solid rgba(255, 255, 255, .6);\n border-radius: .3em 0 0 .3em;\n border-width: 1px 0 1px 1px;\n padding: .2em .2em .5em;\n position: fixed;\n right: 0;\n top: 1em;\n}\n\n.controls button {\n appearance: none;\n background: transparent;\n border: 0;\n cursor: pointer;\n}\n\n.controls button.toggle:after {\n content: '\\\\27f5';\n}\n\n.controls.left {\n border-radius: 0 .3em .3em 0;\n border-width: 1px 1px 1px 0;\n left: 0;\n right: auto;\n}\n\n.controls.left header {\n text-align: right;\n}\n\n.controls.left button.toggle:after {\n content: '\\\\27f6';\n}\n\n.controls .zoom-level {\n font-family: sans-serif;\n text-align: center;\n}\n`\n .replace(/\\s*,\\s*/g, ',')\n .replace(/\\s*>\\s*/g, '>')\n .replace(/\\s*;\\s*}\\s*/g, '}')\n .replace(/\\s*{\\s*/g, '{')\n .replace(/\\s*:\\s*/g, ':')\n .replace(/\\s*;\\s*/g, ';');\n }\n\n private data(): string {\n return `\n\n('transparencyCheckerboard', false) ? 'checked' : ''\n }\">\n
\n
\n \n
\n
\n \n \n
${this.zoomLevel * 100}%
\n
\n
\n \n
\n
\n\n`;\n }\n\n // TODO: this whole renderer should be a separate package with the contents parsed into a minified file\n private js(): string {\n return `\n const image = document.querySelector('img'),\n controls = document.querySelector('.controls'),\n zoomLevel = controls.querySelector('.zoom-level'),\n storeOption = (name, value) => {\n if (!parent) {\n return;\n }\n \n parent.postMessage({name:\"setOption\",value:{name,value}}, '${\n location.protocol + '//' + location.host\n }');\n };\n\n document.addEventListener('click', (event) => {\n const target = event.target,\n currentZoom = getComputedStyle(image).getPropertyValue('--z');\n\n if (target.matches('.zoom-in,.zoom-in *')) {\n const newZoom = currentZoom * 2;\n\n image.style.setProperty('--z', newZoom);\n zoomLevel.innerText = (newZoom * 100) + '%';\n \n storeOption('zoomLevel', newZoom);\n }\n\n if (target.matches('.zoom-out,.zoom-out *')) {\n const newZoom = currentZoom / 2;\n\n image.style.setProperty('--z', newZoom);\n zoomLevel.innerText = (newZoom * 100) + '%';\n\n storeOption('zoomLevel', newZoom);\n }\n\n if (target.matches('.toggle,.toggle *')) {\n controls.classList.toggle('left');\n }\n\n if (target.matches('button.checked')) {\n image.classList.toggle('checked');\n\n storeOption('transparencyCheckerboard', image.classList.contains('checked'));\n }\n });\n `;\n }\n\n public matches(mimeType: string): boolean {\n // Using data from: https://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support\n // and: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n return [\n 'image/apng',\n 'image/avif',\n 'image/bmp',\n 'image/gif',\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/vnd.microsoft.icon',\n 'image/webp',\n ].includes(mimeType);\n }\n\n public reset(): void {\n super.reset();\n\n this.imageBuffer = '';\n }\n\n public write(char: number): void;\n public write(data: string): void;\n public write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.imageBuffer += char;\n this.buffer = '';\n\n super.write(this.data());\n }\n}\n\nexport default Image;\n", "export interface Input {\n activate(device: Inputs): void;\n deactivate(): void;\n isActive(): boolean;\n matches(data: string): boolean;\n on(eventName: string, handler: (...args: any[]) => void): void;\n read(): number[];\n readAsString(replaceBinaryBytes: string | null): string;\n reset(): void;\n resize(): void;\n setType(type: string | null): void;\n write(data: string | number[]): void;\n}\n\nexport type InputConstructor = new (\n parent: HTMLElement,\n ...args: any[]\n) => Input;\n\nexport class Inputs {\n private buffer: number[] = [];\n private registered: Input[] = [];\n private type: string;\n\n public constructor(...inputs: Input[]) {\n this.register(...inputs);\n }\n\n private active(): Input {\n const [input] = this.registered.filter((input) => input.isActive());\n\n return input;\n }\n\n public activate(toActivate: InputConstructor | Input): void {\n this.registered.reduce((value, input): boolean => {\n // Activate the required input\n if (\n !value &&\n ((typeof toActivate === 'function' && input instanceof toActivate) ||\n input === toActivate)\n ) {\n if (!input.isActive()) {\n input.activate(this);\n input.reset();\n input.write(this.buffer);\n }\n\n return true;\n }\n\n input.deactivate();\n input.reset();\n\n return value;\n }, false);\n\n this.resize();\n }\n\n public on(eventName: string, handler: (event: Event) => void): void {\n this.registered.forEach((input) => input.on(eventName, handler));\n }\n\n public read(): number[] {\n return this.active().read();\n }\n\n public readAsString(replaceBinaryBytes: string | null = '.'): string {\n return this.active().readAsString(replaceBinaryBytes);\n }\n\n public register(...inputs: Input[]): void {\n this.registered.push(...inputs);\n }\n\n public reset(): void {\n this.buffer.splice(0);\n this.registered.forEach((input) => input.reset());\n }\n\n public resize(): void {\n this.registered.forEach((input) => {\n if (input.isActive()) {\n input.resize();\n }\n });\n }\n\n public setBuffer(buffer: number[]): void {\n this.buffer.push(...buffer);\n }\n\n public setType(type: string | null): void {\n this.type = type;\n\n this.registered.forEach((input) => input.setType(type));\n }\n\n public write(char: number | number[] | string): void {\n const writeBuffer = [];\n\n if (typeof char === 'number') {\n writeBuffer.push(char);\n }\n\n if (Array.isArray(char)) {\n char.forEach((char) => writeBuffer.push(char));\n }\n\n if (typeof char === 'string') {\n char.split('').forEach((char) => writeBuffer.push(char.charCodeAt(0)));\n }\n\n this.registered.filter((input) => {\n if (input.isActive()) {\n input.write(writeBuffer);\n }\n });\n\n writeBuffer.forEach((char) => this.buffer.push(char));\n }\n}\n\nexport default Inputs;\n", "export class InvalidFormat extends TypeError {}\n\nexport default InvalidFormat;\n", "import Image from './Image';\nimport InvalidFormat from './Error/InvalidFormat';\nimport { Renderer } from '../Renderers';\n\nexport type PBMHeader =\n | [string, number, number, number] // P1: type, width, height, offset\n | [string, number, number, number, number]; // P3: type, width, height, maxValue, offset\n\n/**\n * @see https://en.wikipedia.org/wiki/Netpbm\n */\nexport class PBMImage extends Image implements Renderer {\n ppmBuffer: string = '';\n superTimeout: number | null = null;\n\n public activate(mimeType: string) {\n super.activate('image/png');\n }\n\n public matches(mimeType: string): boolean {\n return [\n 'image/x-portable-bitmap',\n 'image/x-portable-graymap',\n 'image/x-portable-pixmap',\n 'image/x-portable-anymap',\n ].includes(mimeType);\n }\n\n public reset() {\n super.reset();\n\n this.ppmBuffer = '';\n }\n\n public write(char: string | number): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.ppmBuffer += char;\n\n if (this.ppmBuffer.length < 10) {\n return;\n }\n\n // Wait for data to stop streaming\n if (this.superTimeout) {\n clearTimeout(this.superTimeout);\n }\n\n this.superTimeout = window.setTimeout(() => {\n try {\n super.reset();\n\n super.write(this.convertToPNG());\n } catch (e) {\n console.error(e);\n }\n }, 50);\n }\n\n private convertToPNG(): string {\n if (!/^P[1-7]/.test(this.ppmBuffer)) {\n throw new InvalidFormat();\n }\n\n const header = this.extractPBMHeader();\n\n if (!header) {\n throw new InvalidFormat();\n }\n\n const [format] = header;\n\n if (!format) {\n throw new InvalidFormat();\n }\n\n if (format === 'P1') {\n const [, width, height, offset] = header;\n\n return this.parseP1(width, height, offset);\n }\n\n if (format === 'P2') {\n const [, width, height, maxValue, offset] = header;\n\n return this.parseP2(width, height, maxValue, offset);\n }\n\n if (format === 'P3') {\n const [, width, height, maxValue, offset] = header;\n\n return this.parseP3(width, height, maxValue, offset);\n }\n\n if (format === 'P4') {\n const [, width, height, offset] = header;\n\n return this.parseP4(width, height, offset);\n }\n\n if (format === 'P5') {\n const [, width, height, maxValue, offset] = header;\n\n return this.parseP2(width, height, maxValue, offset, true);\n }\n\n if (format === 'P6') {\n const [, width, height, maxValue, offset] = header;\n\n return this.parseP3(width, height, maxValue, offset, true);\n }\n\n throw new InvalidFormat('Currently unsupported.');\n }\n\n private createCanvas(\n width: number,\n height: number\n ): [HTMLCanvasElement, CanvasRenderingContext2D, ImageData] {\n const canvas = document.createElement('canvas'),\n context = canvas.getContext('2d'),\n imageData = new ImageData(width, height);\n\n canvas.width = width;\n canvas.height = height;\n\n return [canvas, context, imageData];\n }\n\n private canvasToRawPNG(canvas: HTMLCanvasElement): string {\n // Convert back to raw data from a data: URI\n return atob(\n canvas.toDataURL('image/png').replace(/^data:image\\/png;base64,/, '')\n );\n }\n\n private parseP1(width: number, height: number, offset: number): string {\n const [canvas, context, imageData] = this.createCanvas(width, height),\n data = this.asciiDataGenerator(offset, false);\n\n for (let index = 0; index < width * height * 4; ) {\n const value = data.next().value === 1 ? 0 : 255;\n\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = 255;\n }\n\n context.putImageData(imageData, 0, 0, 0, 0, width, height);\n\n return this.canvasToRawPNG(canvas);\n }\n\n private parseP2(\n width: number,\n height: number,\n maxValue: number,\n offset: number,\n binary: boolean = false\n ): string {\n const [canvas, context, imageData] = this.createCanvas(width, height),\n data = binary\n ? this.binaryDataGenerator(offset)\n : this.asciiDataGenerator(offset);\n\n for (let index = 0; index < width * height * 4; ) {\n const value = Math.floor((data.next().value / maxValue) * 255);\n\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = 255;\n }\n\n context.putImageData(imageData, 0, 0, 0, 0, width, height);\n\n return this.canvasToRawPNG(canvas);\n }\n\n private parseP3(\n width: number,\n height: number,\n maxValue: number,\n offset: number,\n binary: boolean = false\n ): string {\n const [canvas, context, imageData] = this.createCanvas(width, height),\n data = binary\n ? this.binaryDataGenerator(offset)\n : this.asciiDataGenerator(offset);\n\n for (let index = 0; index < width * height * 4; ) {\n imageData.data[index++] = Math.floor(\n ((data.next().value || 0) / maxValue) * 255\n );\n imageData.data[index++] = Math.floor(\n ((data.next().value || 0) / maxValue) * 255\n );\n imageData.data[index++] = Math.floor(\n ((data.next().value || 0) / maxValue) * 255\n );\n imageData.data[index++] = 255;\n }\n\n context.putImageData(imageData, 0, 0, 0, 0, width, height);\n\n return this.canvasToRawPNG(canvas);\n }\n\n private parseP4(width: number, height: number, offset: number): string {\n const [canvas, context, imageData] = this.createCanvas(width, height),\n data = this.binaryBitDataGenerator(offset);\n\n for (let index = 0; index < width * height * 4; ) {\n const value = data.next().value === 1 ? 0 : 255;\n\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = value;\n imageData.data[index++] = 255;\n }\n\n context.putImageData(imageData, 0, 0, 0, 0, width, height);\n\n return this.canvasToRawPNG(canvas);\n }\n\n private extractPBMHeader(): PBMHeader | null {\n const type = this.ppmBuffer.slice(0, 2),\n withoutMaxValue =\n /^(P[14])\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s*(?:#[^\\n]*\\s*)*/,\n withMaxValue =\n /^(P[2356])\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s+(?:#[^\\n]*\\s*)*(\\d+)\\s*(?:#[^\\n]*\\s*)*/;\n\n if (type === 'P1' || type === 'P4') {\n const match = this.ppmBuffer.match(withoutMaxValue);\n\n if (!match) {\n throw new InvalidFormat();\n }\n\n return [\n match[1], // format\n parseInt(match[2], 10), // width\n parseInt(match[3], 10), // height\n match[0].length, // offset\n ];\n }\n\n if (type === 'P2' || type === 'P3' || type === 'P5' || type === 'P6') {\n const match = this.ppmBuffer.match(withMaxValue);\n\n if (!match) {\n throw new InvalidFormat();\n }\n\n return [\n match[1], // format\n parseInt(match[2], 10), // width\n parseInt(match[3], 10), // height\n parseInt(match[4], 10), // max value\n match[0].length, // offset\n ];\n }\n }\n\n private *asciiDataGenerator(\n offset: number,\n separator: boolean = true\n ): Generator {\n let block = '';\n\n for (\n let currentPosition = offset, comment = false;\n currentPosition < this.ppmBuffer.length;\n currentPosition++\n ) {\n const currentChar = this.ppmBuffer[currentPosition];\n\n if (/#/.test(currentChar)) {\n if (block) {\n yield parseInt(block, 10);\n\n block = '';\n }\n\n comment = true;\n }\n\n if (/\\n/.test(currentChar) && comment) {\n comment = false;\n }\n\n if (comment) {\n continue;\n }\n\n if (/\\s/.test(currentChar) && block.length > 0) {\n yield parseInt(block, 10);\n\n block = '';\n }\n\n if (/\\d/.test(currentChar)) {\n block += currentChar;\n }\n\n if (separator === false && block) {\n yield parseInt(block, 10);\n\n block = '';\n }\n }\n\n yield parseInt(block, 10);\n }\n\n private *binaryDataGenerator(offset: number): Generator {\n let block = '';\n\n for (\n let currentPosition = offset;\n currentPosition < this.ppmBuffer.length;\n currentPosition++\n ) {\n const currentChar = this.ppmBuffer[currentPosition];\n\n yield currentChar.charCodeAt(0);\n }\n\n yield parseInt(block, 10);\n }\n\n private *binaryBitDataGenerator(offset: number): Generator {\n let block = '';\n\n for (\n let currentPosition = offset;\n currentPosition < this.ppmBuffer.length;\n currentPosition++\n ) {\n const currentChar = this.ppmBuffer[currentPosition],\n bitMask = ('0000000' + currentChar.charCodeAt(0).toString(2)).slice(-8);\n\n for (let rowPosition = 0; rowPosition < 8; rowPosition++) {\n yield parseInt(bitMask[rowPosition], 10);\n }\n }\n\n yield parseInt(block, 10);\n }\n}\n\nexport default PBMImage;\n", "import { ITerminalOptions, Terminal } from 'xterm';\nimport Abstract from './Abstract';\nimport { FitAddon } from 'xterm-addon-fit/src/FitAddon';\nimport { Renderer } from '../Renderers';\n\nexport class TTY extends Abstract implements Renderer {\n private buffer: string = '';\n private escapeInput: string = '';\n private fit: FitAddon;\n private maxX: number = 0;\n private maxY: number = 0;\n private options: ITerminalOptions;\n private terminal: Terminal;\n private x: number = 0;\n private y: number = 0;\n\n constructor(parent: HTMLElement, options: ITerminalOptions = {}) {\n super();\n\n this.container = this.createElement('div');\n this.container.classList.add('tty');\n\n parent.append(this.container);\n\n this.fit = new FitAddon();\n\n this.terminal = TTY.createTerminal(options);\n this.terminal.loadAddon(this.fit);\n this.terminal.open(this.container);\n\n this.options = options;\n }\n\n private static cleanText(text: string): string {\n // patch for xterm.js - this allows VT and FF but patches \\n, vs. convertEol option\n return text.replace(/(? parseInt(value || '1', 10))\n : [parseInt(value, 10), 1];\n break;\n }\n\n if (x >= cols) {\n x = cols;\n }\n\n maxX = Math.max(x, maxX);\n maxY = Math.max(y, maxY);\n\n return [x, y, maxX, maxY];\n }\n\n switch (input) {\n case '\\n':\n y++;\n x = 0;\n break;\n\n case '\\f':\n case '\\r':\n case '\\v':\n y++;\n break;\n\n case '\\t':\n x += x % 8 || 8;\n break;\n\n // backspace\n case '\\x08':\n x--;\n break;\n\n default:\n x++;\n }\n\n if (x >= cols) {\n y++;\n x = 0;\n }\n\n maxX = Math.max(x, maxX);\n maxY = Math.max(y, maxY);\n\n return [x, y, maxX, maxY];\n }\n\n private reprocessBufferForSize(): number[] {\n let maxX = 0,\n maxY = 0,\n x = 0,\n y = 0,\n escapeInput = '';\n\n const results = this.buffer.match(/\\x1b\\[(.*?)([\\x40-\\x7e])|(.)/g);\n\n if (!results) {\n return [1, 1];\n }\n\n results.forEach((input) => {\n [input, escapeInput] = this.processInputForEscape(input, escapeInput);\n\n if (input) {\n [x, y, maxX, maxY] = this.processInputForSize(x, y, maxX, maxY, input);\n }\n });\n\n return [maxX + 1, maxY + 1];\n }\n\n public reset(): void {\n this.buffer = '';\n this.escapeInput = '';\n this.maxX = 0;\n this.maxY = 0;\n this.x = 0;\n this.y = 0;\n\n this.terminal.reset();\n }\n\n public resize(): void {\n if (\n this.container.hasAttribute('hidden') ||\n (this.options.cols && this.options.rows)\n ) {\n return;\n }\n\n const [, visibleLines] = this.reprocessBufferForSize(),\n dimensions = this.fit.proposeDimensions();\n\n this.terminal.resize(\n this.options.cols ?? dimensions?.cols ?? this.terminal.cols,\n this.options.rows ?? visibleLines\n );\n }\n\n public write(char: number): void;\n public write(data: string): void;\n public write(char: number | string): void {\n if (typeof char === 'number') {\n char = String.fromCharCode(char);\n }\n\n this.buffer += char;\n\n this.handleInputForSize(char);\n\n const rows = this.maxY + 1;\n\n if (rows !== this.terminal.rows) {\n this.terminal.resize(this.terminal.cols, rows);\n }\n\n this.terminal.write(TTY.cleanText(char));\n }\n}\n\nexport default TTY;\n", "/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Terminal, ITerminalAddon } from 'xterm';\n\ninterface ITerminalDimensions {\n /**\n * The number of rows in the terminal.\n */\n rows: number;\n\n /**\n * The number of columns in the terminal.\n */\n cols: number;\n}\n\nconst MINIMUM_COLS = 2;\nconst MINIMUM_ROWS = 1;\n\nexport class FitAddon implements ITerminalAddon {\n private _terminal: Terminal | undefined;\n\n constructor() {}\n\n public activate(terminal: Terminal): void {\n this._terminal = terminal;\n }\n\n public dispose(): void {}\n\n public fit(): void {\n const dims = this.proposeDimensions();\n if (!dims || !this._terminal) {\n return;\n }\n\n // TODO: Remove reliance on private API\n const core = (this._terminal as any)._core;\n\n // Force a full render\n if (this._terminal.rows !== dims.rows || this._terminal.cols !== dims.cols) {\n core._renderService.clear();\n this._terminal.resize(dims.cols, dims.rows);\n }\n }\n\n public proposeDimensions(): ITerminalDimensions | undefined {\n if (!this._terminal) {\n return undefined;\n }\n\n if (!this._terminal.element || !this._terminal.element.parentElement) {\n return undefined;\n }\n\n // TODO: Remove reliance on private API\n const core = (this._terminal as any)._core;\n\n if (core._renderService.dimensions.actualCellWidth === 0 || core._renderService.dimensions.actualCellHeight === 0) {\n return undefined;\n }\n\n const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement);\n const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));\n const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width')));\n const elementStyle = window.getComputedStyle(this._terminal.element);\n const elementPadding = {\n top: parseInt(elementStyle.getPropertyValue('padding-top')),\n bottom: parseInt(elementStyle.getPropertyValue('padding-bottom')),\n right: parseInt(elementStyle.getPropertyValue('padding-right')),\n left: parseInt(elementStyle.getPropertyValue('padding-left'))\n };\n const elementPaddingVer = elementPadding.top + elementPadding.bottom;\n const elementPaddingHor = elementPadding.right + elementPadding.left;\n const availableHeight = parentElementHeight - elementPaddingVer;\n const availableWidth = parentElementWidth - elementPaddingHor - core.viewport.scrollBarWidth;\n const geometry = {\n cols: Math.max(MINIMUM_COLS, Math.floor(availableWidth / core._renderService.dimensions.actualCellWidth)),\n rows: Math.max(MINIMUM_ROWS, Math.floor(availableHeight / core._renderService.dimensions.actualCellHeight))\n };\n return geometry;\n }\n}\n", "import { Decoder } from '../Decoders';\nimport Default from './Default';\n\nexport class Xxd extends Default implements Decoder {\n public name(): string {\n return 'xxd';\n }\n\n public matchesAsString(code: string): boolean {\n return /^([\\da-f]{7,8}: (((.{2}){1,2} ){1,8}) .+(\\n|$))+$/.test(code);\n }\n\n public decodeAsString(code: string): number[] {\n return code\n .trim()\n .replace(/(?<=^|\\n)[\\da-f]{7,8}: (((.{2}){1,2} ){1,8}).+/g, '$1')\n .replace(/\\s+/g, '')\n .match(/../g)\n .map((c: string): number => parseInt(c, 16));\n }\n}\nexport default Xxd;\n", "import { Lang } from '../../Lang';\nimport { wasmerRunner } from '../../Langs';\nimport 'codemirror/mode/python/python';\nimport Runner from '../../Runner';\nimport Wasmer from '../../Runners/Wasmer';\n\nexport class jq extends Lang {\n constructor() {\n super(\n 'jq-wasmer',\n 'jq (wasmer)',\n async (code: number[], input: string, args: string): Promise => {\n const runner = new Wasmer('syrusakbary/jq', false, {\n mount: {\n \"/app\": {\n \"input.json\": input\n }\n }\n });\n\n runner.init(\n code,\n '',\n (args.length ? (args + '\\n') : '') +\n '$code\\n' +\n '/app/input.json'\n );\n\n return runner;\n },\n 'https://jqlang.github.io/jq/',\n [],\n 'jq'\n );\n }\n}\n\nexport default jq;\n", "import Base64 from './Decoders/Base64';\nimport Bash from './langs/bash-wasmer/Bash';\nimport Default from './Decoders/Default';\nimport Hexdump from './Decoders/Hexdump';\nimport JavaScript from './langs/javascript-browser/JavaScript';\nimport Ruby from './langs/ruby-wasmer/Ruby';\nimport Perl from './langs/webperl-5.28.1/Perl';\n// import Python from './langs/python-wasmer/Python';\nimport UI from './UI';\nimport Xxd from './Decoders/Xxd';\nimport jq from './langs/jq-wasmer/jq';\nimport { decoders } from './Decoders';\nimport { langs } from './Langs';\n\ndecoders.register(new Xxd(), new Hexdump(), new Base64(), new Default());\nlangs.register(\n new Bash(),\n new JavaScript(),\n new Ruby(),\n new Perl(),\n // TODO: This is 120MiB which can't currently be cached by the browser by default, making it kinda useless :(\n // Need a smaller image from Wasmer, or could download the data manually on first use and store in IndexedDB:\n // https://stackoverflow.com/a/71581910/3145856\n // new Python(),\n new jq()\n);\n\nconst ui = new UI();\n"], + "mappings": "0hBAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,cAEA,IAAIC,GAAM,OAAO,UAAU,eACvBC,GAAS,IASb,SAASC,IAAS,CAAC,CASf,OAAO,SACTA,GAAO,UAAY,OAAO,OAAO,IAAI,EAMhC,IAAIA,GAAO,EAAE,YAAWD,GAAS,KAYxC,SAASE,GAAGC,EAAIC,EAASC,EAAM,CAC7B,KAAK,GAAKF,EACV,KAAK,QAAUC,EACf,KAAK,KAAOC,GAAQ,EACtB,CAaA,SAASC,GAAYC,EAASC,EAAOL,EAAIC,EAASC,EAAM,CACtD,GAAI,OAAOF,GAAO,WAChB,MAAM,IAAI,UAAU,iCAAiC,EAGvD,IAAIM,EAAW,IAAIP,GAAGC,EAAIC,GAAWG,EAASF,CAAI,EAC9CK,EAAMV,GAASA,GAASQ,EAAQA,EAEpC,OAAKD,EAAQ,QAAQG,CAAG,EACdH,EAAQ,QAAQG,CAAG,EAAE,GAC1BH,EAAQ,QAAQG,CAAG,EAAI,CAACH,EAAQ,QAAQG,CAAG,EAAGD,CAAQ,EAD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CACZ,MACE,YACA,cACA,MAAOC,EAAgBC,EAAeC,IAAkC,CACtE,IAAMC,EAAS,IAAIC,GAAO,iBAAkB,GAAO,CACjD,MAAO,CACL,OAAQ,CACN,aAAcH,CAChB,CACF,CACF,CAAC,EAED,OAAAE,EAAO,KACLH,EACA,IACCE,EAAK,OAAUA,EAAO;AAAA,EAAQ,IAC/B;AAAA,gBAEF,EAEOC,CACT,EACA,+BACA,CAAC,EACD,IACF,CACF,CACF,EAEOE,GAAQP,GCvBfQ,GAAS,SAAS,IAAIC,GAAO,IAAIC,GAAW,IAAIC,GAAU,IAAIC,EAAS,EACvEC,GAAM,SACJ,IAAIC,GACJ,IAAIC,GACJ,IAAIC,GACJ,IAAIC,GAKJ,IAAIC,EACN,EAEA,IAAMC,GAAK,IAAIC", + "names": ["require_eventemitter3", "__commonJSMin", "exports", "module", "has", "prefix", "Events", "EE", "fn", "context", "once", "addListener", "emitter", "event", "listener", "evt", "clearEvent", "EventEmitter", "names", "events", "name", "handlers", "i", "l", "ee", "listeners", "a1", "a2", "a3", "a4", "a5", "len", "args", "length", "j", "require_codemirror", "__commonJSMin", "exports", "module", "global", "factory", "userAgent", "platform", "gecko", "ie_upto10", "ie_11up", "edge", "ie", "ie_version", "webkit", "qtwebkit", "chrome", "chrome_version", "presto", "safari", "mac_geMountainLion", "phantom", "ios", "android", "mobile", "mac", "chromeOS", "windows", "presto_version", "flipCtrlCmd", "captureRightClick", "classTest", "cls", "rmClass", "node", "current", "match", "after", "removeChildren", "count", "removeChildrenAndAdd", "parent", "e", "elt", "tag", "content", "className", "style", "i", "eltP", "range", "start", "end", "endNode", "r", "contains", "child", "activeElt", "rootNode", "doc", "activeElement", "addClass", "joinClasses", "a", "b", "as", "selectInput", "cm", "root", "element", "win", "bind", "f", "args", "copyObj", "obj", "target", "overwrite", "prop", "countColumn", "string", "tabSize", "startIndex", "startValue", "n", "nextTab", "Delayed", "self", "ms", "time", "indexOf", "array", "scrollerGap", "Pass", "sel_dontScroll", "sel_mouse", "sel_move", "findColumn", "goal", "pos", "col", "skipped", "spaceStrs", "spaceStr", "lst", "arr", "map", "out", "insertSorted", "value", "score", "priority", "nothing", "createObj", "base", "props", "inst", "nonASCIISingleCaseWordChar", "isWordCharBasic", "ch", "isWordChar", "helper", "isEmpty", "extendingChars", "isExtendingChar", "skipExtendingChars", "str", "dir", "findFirst", "pred", "from", "to", "midF", "mid", "iterateBidiSections", "order", "found", "part", "bidiOther", "getBidiPartAt", "sticky", "cur", "bidiOrdering", "lowTypes", "arabicTypes", "charType", "code", "bidiRE", "isNeutral", "isStrong", "countsAsLeft", "countsAsNum", "BidiSpan", "level", "direction", "outerType", "len", "types", "i$1", "prev", "type", "i$2", "type$1", "i$3", "prev$1", "type$2", "i$4", "type$3", "replace", "j", "i$5", "cur$1", "type$4", "i$6", "end$1", "before", "replace$1", "j$1", "m", "i$7", "at", "isRTL", "j$2", "nstart", "getOrder", "line", "noHandlers", "on", "emitter", "getHandlers", "off", "index", "signal", "handlers", "signalDOMEvent", "override", "e_defaultPrevented", "signalCursorActivity", "set", "hasHandler", "eventMixin", "ctor", "e_preventDefault", "e_stopPropagation", "e_stop", "e_target", "e_button", "dragAndDrop", "div", "zwspSupported", "zeroWidthElement", "measure", "test", "badBidiRects", "hasBadBidiRects", "txt", "r0", "r1", "splitLinesAuto", "result", "l", "nl", "rt", "hasSelection", "te", "hasCopyEvent", "badZoomedRects", "hasBadZoomedRects", "normal", "fromRange", "modes", "mimeModes", "defineMode", "name", "mode", "defineMIME", "mime", "spec", "resolveMode", "getMode", "options", "mfactory", "modeObj", "modeExtensions", "exts", "prop$1", "extendMode", "properties", "copyState", "state", "nstate", "val", "innerMode", "info", "startState", "a1", "a2", "StringStream", "lineOracle", "ok", "pattern", "consume", "caseInsensitive", "cased", "substr", "inner", "oracle", "getLine", "chunk", "sz", "getBetween", "text", "getLines", "updateLineHeight", "height", "diff", "lineNo", "no", "lineAtHeight", "h", "outer", "lh", "isLine", "lineNumberFor", "Pos", "cmp", "equalCursorPos", "copyPos", "x", "maxPos", "minPos", "clipLine", "clipPos", "last", "clipToLen", "linelen", "clipPosArray", "SavedContext", "lookAhead", "Context", "saved", "copy", "highlightLine", "context", "forceToEnd", "st", "lineClasses", "runMode", "loop", "o", "overlay", "i_end", "getLineStyles", "updateFrontier", "getContextBefore", "resetState", "precise", "display", "findStartLine", "processLine", "startAt", "stream", "callBlankLine", "readToken", "Token", "takeToken", "asArray", "tokens", "extractLineClasses", "output", "lineClass", "flattenSpans", "curStart", "curStyle", "mName", "minindent", "minline", "lim", "search", "indented", "retreatFrontier", "sawReadOnlySpans", "sawCollapsedSpans", "seeReadOnlySpans", "seeCollapsedSpans", "MarkedSpan", "marker", "getMarkedSpanFor", "spans", "span", "removeMarkedSpan", "addMarkedSpan", "op", "inThisOp", "markedSpansBefore", "old", "startCh", "isInsert", "nw", "startsBefore", "endsAfter", "markedSpansAfter", "endCh", "stretchSpansOverChange", "change", "oldFirst", "oldLast", "first", "sameLine", "offset", "span$1", "found$1", "clearEmptySpans", "newMarkers", "gap", "gapMarkers", "removeReadOnlyRanges", "markers", "mark", "parts", "mk", "p", "newParts", "dfrom", "dto", "detachMarkedSpans", "attachMarkedSpans", "extraLeft", "extraRight", "compareCollapsedMarkers", "lenDiff", "aPos", "bPos", "fromCmp", "toCmp", "collapsedSpanAtSide", "sps", "sp", "collapsedSpanAtStart", "collapsedSpanAtEnd", "collapsedSpanAround", "conflictingCollapsedRange", "visualLine", "merged", "visualLineEnd", "visualLineContinued", "lines", "visualLineNo", "lineN", "vis", "visualLineEndNo", "lineIsHidden", "lineIsHiddenInner", "heightAtLine", "lineObj", "lineLength", "findMaxLine", "d", "Line", "markedSpans", "estimateHeight", "updateLine", "estHeight", "cleanUpLine", "styleToClassCache", "styleToClassCacheWithMode", "interpretTokenStyle", "cache", "buildLineContent", "lineView", "builder", "buildToken", "buildTokenBadBidi", "allowFrontierUpdate", "insertLineContent", "defaultSpecialCharPlaceholder", "token", "startStyle", "endStyle", "css", "attributes", "displayText", "splitSpaces", "special", "mustWrap", "txt$1", "tabWidth", "fullStyle", "attr", "trailingBefore", "spaceBefore", "buildCollapsedSpan", "size", "ignoreWidget", "widget", "styles", "allText", "nextChange", "spanStyle", "spanEndStyle", "spanStartStyle", "collapsed", "foundBookmarks", "endStyles", "upto", "tokenText", "LineView", "buildViewArray", "nextPos", "view", "operationGroup", "pushOperation", "fireCallbacksForOps", "group", "callbacks", "finishOperation", "endCb", "orphanDelayedCallbacks", "signalLater", "list", "fireOrphanDelayed", "delayed", "updateLineForChanges", "dims", "updateLineText", "updateLineGutter", "updateLineClasses", "updateLineWidgets", "ensureLineWrapped", "updateLineBackground", "wrap", "getLineContent", "ext", "built", "textClass", "wrap$1", "gutterWrap", "k", "id", "isWidget", "next", "insertLineWidgets", "buildLineElement", "insertLineWidgetsFor", "allowAbove", "ws", "positionLineWidget", "width", "widgetHeight", "parentStyle", "eventInWidget", "paddingTop", "paddingVert", "paddingH", "data", "scrollGap", "displayWidth", "displayHeight", "ensureLineHeights", "rect", "wrapping", "curWidth", "heights", "rects", "mapFromLineView", "updateExternalMeasurement", "measureChar", "bias", "measureCharPrepared", "prepareMeasureForLine", "findViewForLine", "findViewIndex", "getDimensions", "prepared", "varHeight", "key", "measureCharInner", "nullRect", "nodeAndOffsetInLineMap", "collapse", "mStart", "mEnd", "getUsefulRect", "place", "maybeUpdateRectForZooming", "rSpan", "charWidth", "rtop", "rbot", "top", "bot", "scaleX", "scaleY", "clearLineMeasurementCacheFor", "clearLineMeasurementCache", "clearCaches", "pageScrollX", "pageScrollY", "widgetTopHeight", "ref", "widgets", "intoCoordSystem", "includeWidgets", "yOff", "lOff", "xOff", "fromCoordSystem", "coords", "left", "localBox", "lineSpaceBox", "charCoords", "cursorCoords", "preparedMeasure", "get", "right", "getBidi", "partPos", "invert", "other", "estimateCoords", "PosWithInfo", "outside", "xRel", "coordsChar", "y", "coordsCharInner", "rangeEnd", "wrappedLineExtent", "begin", "wrappedLineExtentChar", "targetTop", "boxIsAfter", "box", "ltr", "coordsBidiPartWrapped", "coordsBidiPart", "chAround", "boxAround", "baseX", "atLeft", "atStart", "_lineNo", "closestDist", "endX", "dist", "measureText", "textHeight", "anchor", "pre", "gutterLeft", "compensateForHScroll", "th", "perLine", "widgetsHeight", "estimateLineHeights", "est", "posFromMouse", "liberal", "forRect", "space", "colDiff", "regChange", "lendiff", "resetView", "cut", "viewCuttingPoint", "cut$1", "cutTop", "cutBot", "regLineChange", "oldN", "newN", "adjustView", "countDirtyView", "dirty", "updateSelection", "prepareSelection", "primary", "curFragment", "selFragment", "customCursor", "head", "drawSelectionCursor", "drawSelectionRange", "cursor", "charPos", "otherCursor", "cmpCoords", "fragment", "padding", "leftSide", "rightSide", "docLTR", "add", "bottom", "drawForLine", "fromArg", "toArg", "lineLen", "wrapX", "side", "extent", "fromPos", "toPos", "openStart", "openEnd", "openLeft", "openRight", "topLeft", "topRight", "botLeft", "botRight", "sFrom", "sTo", "fromLine", "toLine", "singleVLine", "leftEnd", "rightStart", "restartBlink", "onBlur", "ensureFocus", "onFocus", "delayBlurEvent", "updateHeightsInViewport", "prevBottom", "viewTop", "oldHeight", "mustScroll", "updateWidgetHeight", "chWidth", "w", "visibleLines", "viewport", "ensureFrom", "ensureTo", "maybeScrollWindow", "doScroll", "scrollNode", "scrollPosIntoView", "margin", "limit", "changed", "endCoords", "scrollPos", "calculateScrollPos", "startTop", "startLeft", "updateScrollTop", "setScrollLeft", "scrollIntoView", "snapMargin", "screentop", "screen", "docBottom", "atTop", "atBottom", "newTop", "gutterSpace", "screenleft", "screenw", "tooWide", "addToScrollTop", "resolveScrollToPos", "ensureCursorVisible", "scrollToCoords", "scrollToRange", "scrollToCoordsRange", "sPos", "updateDisplaySimple", "setScrollTop", "startWorker", "forceScroll", "isScroller", "alignHorizontally", "measureForScrollbars", "gutterW", "docH", "NativeScrollbars", "scroll", "vert", "horiz", "needsH", "needsV", "sWidth", "totalHeight", "totalWidth", "bar", "delay", "maybeDisable", "NullScrollbars", "updateScrollbars", "startWidth", "startHeight", "updateScrollbarsInner", "sizes", "scrollbarModel", "initScrollbars", "axis", "nextOpId", "startOperation", "endOperation", "endOperations", "ops", "endOperation_R1", "endOperation_W1", "endOperation_R2", "endOperation_W2", "endOperation_finish", "maybeClipScrollbars", "DisplayUpdate", "updateDisplayIfNeeded", "takeFocus", "setDocumentHeight", "postUpdateDisplay", "hidden", "unhidden", "runInOp", "operation", "methodOp", "docMethodOp", "highlightWorker", "changedLines", "oldStyles", "highlighted", "oldCls", "newCls", "ischange", "force", "selectionSnapshot", "active", "sel", "restoreSelection", "snapshot", "update", "maybeUpdateLineNumberWidth", "different", "toUpdate", "selSnapshot", "patchDisplay", "barMeasure", "updateNumbersFrom", "lineNumbers", "container", "rm", "updateNumber", "updateGutterSpace", "comp", "align", "innerW", "getGutters", "gutters", "sawLineNumbers", "renderGutters", "specs", "gElt", "updateGutters", "Display", "input", "wheelSamples", "wheelPixelsPerUnit", "wheelEventDelta", "dx", "dy", "wheelEventPixels", "delta", "onScrollWheel", "pixelsPerUnit", "canScrollX", "canScrollY", "pixels", "movedX", "movedY", "sample", "Selection", "ranges", "primIndex", "here", "there", "Range", "normalizeSelection", "mayTouch", "prim", "inv", "simpleSelection", "changeEnd", "adjustForChange", "computeSelAfterChange", "offsetPos", "computeReplacedSel", "changes", "hint", "oldPrev", "newPrev", "loadMode", "resetModeState", "isWholeLineUpdate", "updateDoc", "spansFor", "linesFor", "firstLine", "lastLine", "lastText", "lastSpans", "nlines", "added", "added$1", "added$2", "linkedDocs", "sharedHistOnly", "propagate", "skip", "sharedHist", "rel", "shared", "attachDoc", "setDirectionClass", "directionChanged", "History", "historyChangeFromChange", "histChange", "attachLocalSpans", "clearSelectionEvents", "lastChangeEvent", "hist", "addChangeToHistory", "selAfter", "opId", "pushSelectionToHistory", "selectionEventCanBeMerged", "origin", "addSelectionToHistory", "dest", "existing", "removeClearedSpans", "getOldSpans", "mergeOldSpans", "stretched", "oldCur", "stretchCur", "copyHistoryArray", "events", "newGroup", "instantiateSel", "event", "newChanges", "extendRange", "extend", "posBefore", "extendSelection", "setSelection", "extendSelections", "heads", "newSel", "replaceOneSelection", "setSimpleSelection", "filterSelectionChange", "setSelectionReplaceHistory", "done", "setSelectionNoUndo", "setSelectionInner", "skipAtomicInSelection", "reCheckSelection", "mayClear", "newAnchor", "skipAtomic", "newHead", "skipAtomicInner", "oldPos", "preventCursorLeft", "preventCursorRight", "near", "movePos", "far", "selectAll", "filterChange", "makeChange", "ignoreReadOnly", "split", "makeChangeInner", "makeChangeSingleDoc", "rebased", "rebaseHist", "makeChangeFromHistory", "allowSelectionOnly", "suppress", "source", "antiChanges", "filter", "returned", "shiftDoc", "distance", "shift", "makeChangeSingleDocInEditor", "recomputeMaxLength", "checkWidthStart", "changesHandler", "changeHandler", "replaceRange", "assign", "rebaseHistSelSingle", "rebaseHistArray", "sub", "changeLine", "handle", "changeType", "LeafChunk", "BranchChunk", "children", "remaining", "leaf", "me", "spilled", "sibling", "myIndex", "used", "LineWidget", "opt", "adjustScrollWhenAboveVisible", "this$1", "oldH", "addLineWidget", "aboveVisible", "nextMarkerId", "TextMarker", "withOp", "min", "max", "visual", "dHeight", "markText", "markTextShared", "curLine", "updateMaxLine", "SharedTextMarker", "findSharedMarkers", "copySharedMarkers", "mFrom", "mTo", "subMark", "detachSharedMarkers", "linked", "subMarker", "nextDocId", "Doc", "lineSep", "dup", "undone", "forceSplit", "gen", "histData", "gutterID", "where", "realOpts", "sepSize", "copyHistory", "CodeMirror", "link", "splitIds", "lastDrop", "onDrop", "clearDragCursor", "files", "read", "markAsReadAndPasteIfAllFilesAreRead", "t", "readTextFromFile", "file", "reader", "text$1", "selected", "onDragStart", "img", "onDragOver", "frag", "forEachCodeMirror", "byClass", "editors", "globalsRegistered", "ensureGlobalHandlers", "registerGlobalHandlers", "resizeTimer", "onResize", "keyNames", "keyMap", "normalizeKeyName", "alt", "ctrl", "cmd", "mod", "normalizeKeyMap", "keymap", "keyname", "keys", "lookupKey", "getKeyMap", "isModifierKey", "addModifierNames", "noShift", "keyName", "deleteNearSelection", "compute", "kill", "toKill", "replaced", "moveCharLogically", "moveLogically", "endOfLine", "visually", "moveInStorageOrder", "prep", "moveVisually", "bidi", "mv", "getWrappedLineExtent", "searchInVisualLine", "getRes", "res", "nextCh", "commands", "leftPos", "rightPos", "lineStart", "lineStartSmart", "lineEnd", "spaces", "sels", "firstNonWS", "inWS", "doHandleBinding", "bound", "dropShift", "prevShift", "lookupKeyForEditor", "stopSeq", "dispatchKey", "seq", "dispatchKeyInner", "handleKeyBinding", "handleCharBinding", "lastStoppedKey", "onKeyDown", "handled", "showCrossHair", "lineDiv", "up", "onKeyUp", "onKeyPress", "keyCode", "charCode", "DOUBLECLICK_DELAY", "PastClick", "button", "lastClick", "lastDoubleClick", "clickRepeat", "now", "onMouseDown", "clickInGutter", "repeat", "handleMappedButton", "leftButtonDown", "configureMouse", "option", "behavior", "contained", "leftButtonStartDrag", "leftButtonSelect", "moved", "dragEnd", "mouseMove", "dragStart", "e2", "rangeForUnit", "unit", "ourRange", "ourIndex", "startSel", "lastPos", "extendTo", "startCol", "posCol", "oldRange", "ranges$1", "bidiSimplify", "editorSize", "counter", "curCount", "visible", "move", "anchorLine", "boundary", "headIndex", "usePart", "gutterEvent", "prevent", "mX", "mY", "lineBox", "g", "gutter", "onContextMenu", "contextMenuInGutter", "themeChanged", "Init", "defaults", "optionHandlers", "defineOptions", "deflt", "notOnInit", "newBreaks", "wrappingChanged", "integer", "dragDropChanged", "wasOn", "funcs", "toggle", "registerEventHandlers", "initHooks", "word", "touchFinished", "prevTouch", "finishTouch", "isMouseLikeTouchEvent", "touch", "farAway", "inp", "indentLine", "how", "aggressive", "curSpace", "curSpaceString", "indentation", "indentString", "pos$1", "lastCopied", "setLastCopied", "newLastCopied", "applyTextInput", "inserted", "deleted", "recent", "paste", "textLines", "multiPaste", "updateInput", "changeEvent", "triggerElectric", "handlePaste", "pasted", "copyableRanges", "lineRange", "disableBrowserMagic", "field", "spellcheck", "autocorrect", "autocapitalize", "hiddenTextarea", "addEditorMethods", "helpers", "maps", "overlays", "newRanges", "help", "vspace", "hspace", "amount", "findPosH", "goalColumn", "findPosV", "goals", "headPos", "startChar", "check", "scroller", "interpret", "phraseText", "phrases", "predicate", "origDir", "lineDir", "findNextLine", "moveOnce", "boundToLine", "astral", "sawType", "pageSize", "moveAmount", "ContentEditableInput", "belongsToInput", "onCopyCut", "kludge", "hadFocus", "label", "curAnchor", "domToPos", "curFocus", "posToDOM", "rng", "poll", "isInGutter", "fromIndex", "fromNode", "toIndex", "toNode", "newText", "domTextBetween", "oldText", "cutFront", "cutEnd", "oldTop", "maxCutFront", "newBot", "oldBot", "maxCutEnd", "chFrom", "chTo", "scan", "badPos", "bad", "closing", "extraLinebreak", "recognizeMarker", "close", "addText", "walk", "cmText", "markerID", "isBlock", "lineNode", "locateNodeInLineView", "wrapper", "textNode", "topNode", "find", "curNode", "dist$1", "TextareaInput", "prepareCopyCut", "_display", "opts", "wrapOff", "lineOff", "drawn", "typing", "missed", "prevInput", "same", "reset", "oldCSS", "oldWrapperCSS", "wrapperBox", "oldScrollY", "rehide", "prepareSelectAllHack", "extval", "mouseup", "fromTextArea", "textarea", "hasFocus", "save", "realSubmit", "form", "wrappedSubmit", "addLegacyProps", "dontDelegate", "method", "func", "require_shell", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "words", "define", "style", "dict", "i", "commonAtoms", "commonKeywords", "commonCommands", "tokenBase", "stream", "state", "sol", "ch", "tokenString", "tokenize", "tokenDollar", "heredoc", "tokenHeredoc", "cur", "quote", "close", "next", "escaped", "tokenStringStart", "delim", "require_javascript", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "config", "parserConfig", "indentUnit", "statementIndent", "jsonldMode", "jsonMode", "trackScope", "isTS", "wordRE", "keywords", "kw", "type", "A", "B", "C", "D", "operator", "atom", "isOperatorChar", "isJsonldKeyword", "readRegexp", "stream", "escaped", "next", "inSet", "content", "ret", "tp", "style", "cont", "tokenBase", "state", "ch", "tokenString", "tokenComment", "expressionAllowed", "tokenQuasi", "word", "quote", "maybeEnd", "brackets", "findFatArrow", "arrow", "m", "depth", "sawSomething", "pos", "bracket", "atomicTypes", "JSLexical", "indented", "column", "align", "prev", "info", "inScope", "varname", "v", "cx", "parseJS", "cc", "combinator", "expression", "statement", "pass", "i", "inList", "name", "list", "register", "newContext", "registerVarScoped", "Var", "context", "inner", "Context", "isModifier", "vars", "block", "defaultVars", "pushcontext", "pushblockcontext", "popcontext", "pushlex", "result", "indent", "outer", "poplex", "expect", "wanted", "exp", "value", "vardef", "parenExpr", "maybeexpression", "maybeelse", "functiondef", "forspec", "className", "enumdef", "typename", "typeexpr", "pattern", "maybelabel", "maybeCatchBinding", "afterExport", "afterImport", "funarg", "expressionInner", "expressionNoComma", "noComma", "body", "arrowBodyNoComma", "arrowBody", "commasep", "maybeop", "maybeoperatorNoComma", "maybeoperatorComma", "classExpression", "arrayLiteral", "contCommasep", "objprop", "quasi", "maybeTarget", "me", "expr", "property", "continueQuasi", "targetNoComma", "target", "maybeTypeArgs", "_", "getterSetter", "afterprop", "maybetype", "what", "end", "sep", "proceed", "lex", "maybetypeOrIn", "mayberettype", "isKW", "afterType", "typeprops", "typearg", "maybeReturnType", "quasiType", "typeprop", "functiondecl", "continueQuasiType", "typeparam", "maybeTypeDefault", "maybeAssign", "vardefCont", "eltpattern", "proppattern", "_type", "forspec1", "forspec2", "classNameAfter", "classBody", "classfield", "isInterface", "maybeFrom", "exportField", "importSpec", "maybeMoreImports", "maybeAs", "enummember", "isContinuedStatement", "textAfter", "backUp", "basecolumn", "firstChar", "lexical", "top", "c", "closing", "require_ruby", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "wordObj", "words", "o", "i", "e", "keywordList", "keywords", "indentWords", "dedentWords", "opening", "closing", "config", "curPunc", "chain", "newtok", "stream", "state", "tokenBase", "readBlockComment", "ch", "m", "readQuoted", "regexpAhead", "style", "embed", "delim", "readHereDoc", "more", "start", "depth", "next", "found", "escaped", "tokenBaseUntilBrace", "tokenBaseOnce", "alreadyCalled", "quote", "unescaped", "phrase", "mayIndent", "kwtype", "thisTok", "word", "textAfter", "firstChar", "ct", "closed", "require_perl", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "PERL", "RXstyle", "RXmodifiers", "tokenChain", "stream", "state", "chain", "style", "tail", "e", "c", "i", "tokenPerl", "tokenSOMETHING", "string", "ch", "prefix", "p", "n", "look", "eatSuffix", "suffix", "x", "y", "require_Melba", "__commonJSMin", "exports", "__assign", "t", "s", "i", "n", "p", "__spreadArray", "to", "from", "pack", "l", "ar", "matchesFunction", "element", "property", "focusedSelector", "Melba", "_a", "_this", "_b", "animation", "_c", "animationDuration", "_d", "closeLabel", "_e", "container", "_f", "containerClass", "_g", "containerElement", "content", "_h", "events", "_j", "hide", "_k", "root", "_l", "toastClass", "_m", "toastElement", "_o", "toastEvents", "_p", "toastHideClass", "_q", "toastShowClass", "_r", "type", "event", "eventName", "force", "transitionEndHandler_1", "transitionStartHandler_1", "bound_1", "mouseOverHandler_1", "closeButton", "existingContainer", "callable", "hasEvent", "args", "_i", "settings", "root", "factory", "exports", "module", "define", "amd", "a", "i", "self", "e", "t", "r", "n", "o", "s", "c", "l", "h", "u", "f", "_terminal", "_renderService", "_liveRegionLineCount", "_charsToConsume", "_charsToAnnounce", "_accessibilityTreeRoot", "document", "createElement", "classList", "add", "tabIndex", "_rowContainer", "setAttribute", "_rowElements", "rows", "_createAccessibilityTreeNode", "appendChild", "_topBoundaryFocusListener", "_onBoundaryFocus", "_bottomBoundaryFocusListener", "addEventListener", "length", "_refreshRowsDimensions", "_renderRowsDebouncer", "TimeBasedDebouncer", "_renderRows", "bind", "_refreshRows", "_liveRegion", "element", "Error", "insertAdjacentElement", "register", "onResize", "_onResize", "onRender", "start", "end", "onScroll", "onA11yChar", "char", "_onChar", "onLineFeed", "onA11yTab", "spaceCount", "_onTab", "onKey", "_onKey", "key", "onBlur", "_clearLiveRegion", "onDimensionsChange", "_screenDprMonitor", "ScreenDprMonitor", "setListener", "addDisposableDomListener", "window", "dispose", "removeElementFromParent", "this", "position", "boundaryElement", "target", "beforeBoundaryElement", "getAttribute", "buffer", "lines", "relatedTarget", "topBoundaryElement", "bottomBoundaryElement", "pop", "removeChild", "shift", "removeEventListener", "newElement", "unshift", "push", "scrollLines", "focus", "preventDefault", "stopImmediatePropagation", "children", "_refreshRowDimensions", "MAX_ROWS_TO_READ", "textContent", "Strings", "tooMuchOutput", "isMac", "parentNode", "setTimeout", "keyChar", "refresh", "setSize", "toString", "lineData", "translateBufferLineToString", "ydisp", "posInSet", "innerText", "_announceCharacters", "dimensions", "actualCellHeight", "style", "height", "Disposable", "AccessibilityManager", "prepareTextForTerminal", "text", "replace", "bracketTextForPaste", "bracketedPasteMode", "paste", "textarea", "coreService", "decPrivateModes", "triggerDataEvent", "value", "moveTextAreaUnderMouseCursor", "ev", "screenElement", "pos", "getBoundingClientRect", "left", "clientX", "top", "clientY", "width", "zIndex", "selectionService", "clipboardData", "setData", "selectionText", "stopPropagation", "getData", "shouldSelectWord", "rightClickSelect", "select", "_color", "_rgba", "clear", "setCss", "bg", "fg", "getCss", "undefined", "setColor", "getColor", "ColorContrastCache", "DEFAULT_FOREGROUND", "css", "toColor", "DEFAULT_BACKGROUND", "DEFAULT_CURSOR", "DEFAULT_CURSOR_ACCENT", "DEFAULT_SELECTION", "rgba", "DEFAULT_ANSI_COLORS", "Object", "freeze", "colors", "v", "g", "b", "channels", "toCss", "toRgba", "allowTransparency", "canvas", "ctx", "getContext", "_ctx", "globalCompositeOperation", "_litmusColor", "createLinearGradient", "_contrastCache", "foreground", "background", "cursor", "cursorAccent", "selectionTransparent", "selectionOpaque", "color", "blend", "selectionForeground", "ansi", "slice", "contrastCache", "_updateRestoreColors", "onOptionsChange", "setTheme", "theme", "_parseColor", "selection", "nullColor", "isOpaque", "opacity", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "brightBlack", "brightRed", "brightGreen", "brightYellow", "brightBlue", "brightMagenta", "brightCyan", "brightWhite", "restoreColor", "slot", "_restoreColors", "fallback", "fillStyle", "console", "warn", "fillRect", "data", "getImageData", "substring", "split", "map", "component", "Number", "alpha", "Math", "round", "ColorManager", "elements", "parentElement", "node", "type", "handler", "options", "disposed", "_bufferService", "_logService", "_unicodeService", "_linkMatchers", "_nextLinkMatcherId", "_onShowLinkUnderline", "EventEmitter", "_onHideLinkUnderline", "_onLinkTooltip", "_rowsToLinkify", "event", "attachToDom", "mouseZoneManager", "_element", "_mouseZoneManager", "linkifyRows", "min", "max", "clearAll", "_rowsTimeoutId", "clearTimeout", "_linkifyRows", "Linkifier", "_timeBeforeLatency", "absoluteRowIndexStart", "absoluteRowIndexEnd", "overscanLineLimit", "ceil", "cols", "iterator", "hasNext", "next", "_doLinkifyRow", "range", "first", "content", "debug", "registerLinkMatcher", "regex", "matcher", "id", "matchIndex", "validationCallback", "hoverTooltipCallback", "tooltipCallback", "hoverLeaveCallback", "leaveCallback", "willLinkActivate", "priority", "_addLinkMatcherToList", "splice", "deregisterLinkMatcher", "matcherId", "rowIndex", "match", "rex", "RegExp", "source", "flags", "stringIndex", "uri", "indexOf", "lastIndex", "bufferIndex", "stringIndexToBufferIndex", "line", "get", "attr", "getFg", "isValid", "_addLink", "exec", "x", "y", "getStringCellWidth", "x1", "y1", "floor", "x2", "y2", "MouseZone", "newWindow", "open", "opener", "location", "href", "fire", "_createLinkHoverEvent", "remove", "IBufferService", "ILogService", "IUnicodeService", "clickCallback", "hoverCallback", "_", "_linkProviders", "_linkCacheDisposables", "_isMouseOut", "_activeLine", "getDisposeArrayDisposable", "_currentLink", "registerLinkProvider", "linkProvider", "providerIndex", "mouseService", "renderService", "_mouseService", "_clearCurrentLink", "_onMouseMove", "_handleMouseDown", "_handleMouseUp", "_lastMouseEvent", "_positionFromMouseEvent", "composedPath", "contains", "_lastBufferCell", "_onHover", "_askForLink", "_linkAtPosition", "link", "useLineCache", "_activeProviderReplies", "forEach", "reply", "linkWithState", "Map", "linkProvided", "_checkLinkProviderResult", "provideLinks", "links", "linksWithState", "set", "size", "_removeIntersectingLinks", "entries", "d", "replies", "occupiedCells", "Set", "providerReply", "startX", "endX", "has", "index", "hasLinkBefore", "j", "linkAtPosition", "find", "_handleNewLink", "currentLink", "_mouseDownLink", "activate", "startRow", "endRow", "_linkLeave", "disposeArray", "state", "decorations", "underline", "pointerCursor", "isHovered", "_linkHover", "defineProperties", "toggle", "_fireUnderlineEvent", "onRenderedViewportChange", "hover", "showEvent", "scrollOffset", "_createLinkUnderlineEvent", "leave", "sameLine", "wrappedFromLeft", "wrappedToRight", "coords", "getCoords", "Linkifier2", "promptLabel", "_screenElement", "_selectionService", "_optionsService", "_zones", "_areZonesActive", "_lastHoverCoords", "_initialSelectionLength", "_onMouseDown", "_mouseMoveListener", "_mouseLeaveListener", "_onMouseLeave", "_clickListener", "_onClick", "_deactivate", "zone", "_activate", "_currentZone", "pageX", "pageY", "_findZoneEventAt", "_tooltipTimeout", "_onTooltip", "rawOptions", "linkTooltipHoverDuration", "_getSelectionLength", "currentSelectionLength", "IMouseService", "ISelectionService", "IOptionsService", "MouseZoneManager", "_renderCallback", "_refreshCallbacks", "_animationFrame", "cancelAnimationFrame", "addRefreshCallback", "callback", "requestAnimationFrame", "_innerRefresh", "rowStart", "rowEnd", "rowCount", "_rowCount", "_rowStart", "_rowEnd", "_runRefreshCallbacks", "RenderDebouncer", "_currentDevicePixelRatio", "devicePixelRatio", "listener", "_listener", "clearListener", "_outerListener", "_updateDpr", "_resolutionMediaMatchList", "removeListener", "matchMedia", "addListener", "p", "m", "S", "C", "w", "L", "E", "R", "k", "M", "A", "O", "D", "T", "B", "P", "I", "H", "F", "W", "q", "browser", "Browser", "_keyDownHandled", "_keyDownSeen", "_keyPressHandled", "_unprocessedDeadKey", "_onCursorMove", "_onRender", "_onSelectionChange", "_onTitleChange", "_onBell", "_onFocus", "_onBlur", "_onA11yCharEmitter", "_onA11yTabEmitter", "_setup", "linkifier", "_instantiationService", "createInstance", "linkifier2", "_decorationService", "DecorationService", "setService", "IDecorationService", "_inputHandler", "onRequestBell", "bell", "onRequestRefreshRows", "onRequestSendFocus", "_reportFocus", "onRequestReset", "reset", "onRequestWindowsOptionsReport", "_reportWindowsOptions", "onColor", "_handleColorEvent", "forwardEvent", "onCursorMove", "onTitleChange", "_afterResize", "_colorManager", "req", "acc", "ident", "toColorRGB", "C0", "ESC", "toRgbString", "C1_ESCAPED", "ST", "setColors", "viewport", "onThemeChange", "_isDisposed", "_customKeyEventHandler", "write", "buffers", "active", "preventScroll", "_updateOptions", "_charSizeService", "measure", "setRenderer", "_createRenderer", "syncScrollArea", "optionsService", "screenReaderMode", "_accessibilityManager", "setupTabStops", "_setTheme", "_onTextAreaFocus", "sendFocus", "updateCursorStyle", "_showCursor", "blur", "_onTextAreaBlur", "_syncTextArea", "isCursorInViewport", "_compositionHelper", "isComposing", "cursorY", "ybase", "bufferLine", "cursorX", "cellHeight", "getWidth", "cellWidth", "actualCellWidth", "cursorTop", "cursorLeft", "lineHeight", "_initGlobal", "_bindKeys", "hasSelection", "copyHandler", "pasteHandlerWrapper", "handlePasteEvent", "isFirefox", "button", "rightClickHandler", "rightClickSelectsWord", "isLinux", "_keyUp", "_keyDown", "_keyPress", "compositionstart", "compositionupdate", "compositionend", "_inputEvent", "updateCompositionElements", "_queueLinkification", "parent", "isConnected", "_document", "ownerDocument", "dir", "fragment", "createDocumentFragment", "_viewportElement", "_viewportScrollArea", "_helperContainer", "coreBrowserService", "CoreBrowserService", "ICoreBrowserService", "CharSizeService", "ICharSizeService", "_theme", "onOptionChange", "_characterJoinerService", "CharacterJoinerService", "ICharacterJoinerService", "renderer", "RenderService", "IRenderService", "resize", "_compositionView", "CompositionHelper", "_soundService", "SoundService", "ISoundService", "MouseService", "Viewport", "amount", "onRequestSyncScrollBar", "onFocus", "SelectionService", "onRequestScrollLines", "suppressScrollEvent", "onSelectionChange", "onRequestRedraw", "onSelectionChanged", "columnSelectMode", "onLinuxMouseSelection", "_onScroll", "BufferDecorationRenderer", "onMouseDown", "coreMouseService", "areMouseEventsActive", "disable", "enable", "overviewRulerWidth", "_overviewRulerRenderer", "OverviewRulerRenderer", "bindMouse", "rendererType", "Renderer", "DomRenderer", "el", "sendEvent", "but", "action", "getRawByteCoords", "overrideType", "buttons", "getLinesScrolled", "deltaY", "triggerMouseEvent", "col", "row", "ctrl", "ctrlKey", "alt", "altKey", "shiftKey", "requestedEvents", "mouseup", "wheel", "mousedrag", "mousemove", "eventListeners", "cancel", "onProtocolChange", "events", "logLevel", "explainEvents", "passive", "activeProtocol", "shouldForceSelection", "hasScrollback", "sequence", "applicationCursorKeys", "abs", "onWheel", "onTouchStart", "onTouchMove", "refreshRows", "shouldColumnSelect", "isCursorInitialized", "disp", "attachCustomKeyEventHandler", "customKeyEventHandler", "registerCharacterJoiner", "joinerId", "deregisterCharacterJoiner", "deregister", "markers", "addMarker", "cursorYOffset", "normal", "registerDecoration", "decorationOptions", "column", "setSelection", "getSelection", "getSelectionPosition", "startColumn", "selectionStart", "endColumn", "selectionEnd", "clearSelection", "selectAll", "selectLines", "shouldIgnoreComposition", "macOptionIsMeta", "keydown", "scrollToBottom", "result", "evaluateKeyboardEvent", "scrollCount", "_isThirdLevelShift", "metaKey", "charCodeAt", "ETX", "CR", "domEvent", "thirdLevelKey", "isWindows", "getModifierState", "keyCode", "charCode", "which", "String", "fromCharCode", "inputType", "composed", "_soundBell", "playBellSound", "hasValidSize", "clearAllMarkers", "getBlankLine", "DEFAULT_ATTR_DATA", "clearTextureAtlas", "WindowsOptionsReportType", "GET_WIN_SIZE_PIXELS", "canvasWidth", "scaledCanvasWidth", "toFixed", "canvasHeight", "scaledCanvasHeight", "GET_CELL_SIZE_PIXELS", "scaledCellWidth", "scaledCellHeight", "force", "cancelEvents", "_visualBell", "bellStyle", "CoreTerminal", "Terminal", "_debounceThresholdMS", "_lastRefreshMs", "_additionalRefreshRequested", "_refreshTimeoutID", "refreshRequestTime", "Date", "now", "elapsed", "waitPeriodBeforeTrailingRefresh", "_scrollLines", "_scrollArea", "scrollBarWidth", "_currentRowHeight", "_currentScaledCellHeight", "_lastRecordedBufferLength", "_lastRecordedViewportHeight", "_lastRecordedBufferHeight", "_lastTouchY", "_lastScrollTop", "_wheelPartialScroll", "_refreshAnimationFrame", "_ignoreNextScrollEvent", "offsetWidth", "_activeBuffer", "onBufferActivate", "activeBuffer", "_renderDimensions", "backgroundColor", "_refresh", "immediate", "offsetHeight", "newBufferHeight", "scrollTop", "offsetParent", "diff", "_bubbleScroll", "scrollPosFromTop", "cancelable", "_getPixelsScrolled", "_applyScrollModifier", "deltaMode", "WheelEvent", "DOM_DELTA_LINE", "DOM_DELTA_PAGE", "DOM_DELTA_PIXEL", "modifier", "fastScrollModifier", "fastScrollSensitivity", "scrollSensitivity", "touches", "_decorationElements", "_altBufferIsActive", "_dimensionsChanged", "_container", "_queueRefresh", "onDecorationRegistered", "onDecorationRemoved", "decoration", "_removeDecoration", "refreshDecorations", "_renderDecoration", "_refreshStyle", "_refreshXPosition", "_createElement", "marker", "display", "onRenderEmitter", "onDispose", "anchor", "right", "delete", "_zonePool", "_zonePoolIndex", "_linePadding", "full", "center", "addDecoration", "overviewRulerOptions", "z", "_lineIntersectsZone", "_lineAdjacentToZone", "_addLineToZone", "startBufferLine", "endBufferLine", "setPadding", "padding", "ColorZoneStore", "drawHeight", "drawWidth", "drawX", "_colorZoneStore", "_shouldUpdateDimensions", "_shouldUpdateAnchor", "_lastKnownBufferLength", "_canvas", "_refreshCanvasDimensions", "insertBefore", "_registerDecorationListeners", "_registerBufferChangeListeners", "_registerDimensionChangeListeners", "_refreshDrawHeightConstants", "_refreshColorZonePadding", "_containerHeight", "clientHeight", "_refreshDrawConstants", "outerWidth", "innerWidth", "pixelsPerLine", "nonFullHeight", "_width", "_refreshDecorations", "clearRect", "lineWidth", "zones", "_renderColorZone", "updateCanvasDimensions", "updateAnchor", "_textarea", "_coreService", "_isComposing", "_isSendingComposition", "_compositionPosition", "_dataAlreadySent", "_finalizeComposition", "_handleAnyTextareaChanges", "waitForPropagation", "input", "oldValue", "dontRecurse", "fontFamily", "fontSize", "compositionViewBounds", "ICoreService", "getCoordsRelativeToElement", "rect", "elementStyle", "getComputedStyle", "leftPadding", "parseInt", "getPropertyValue", "topPadding", "colCount", "hasValidCharSize", "isSelection", "moveToRequestedRow", "startY", "targetY", "bufferService", "applicationCursor", "wrappedRowsForRow", "rowsToMove", "wrappedRows", "direction", "verticalDirection", "isWrapped", "repeat", "currentRow", "lineWraps", "startCol", "endCol", "forward", "currentCol", "bufferStr", "mod", "count", "str", "rpt", "targetX", "rowDifference", "currX", "CONSTRUCTOR_ONLY_OPTIONS", "_core", "_addonManager", "AddonManager", "_publicOptions", "getter", "propName", "setter", "_checkReadonlyOptions", "desc", "defineProperty", "includes", "_checkProposedApi", "allowProposedApi", "onBell", "onBinary", "onData", "onWriteParsed", "_parser", "ParserApi", "UnicodeApi", "_buffer", "BufferNamespaceApi", "mouseTrackingMode", "applicationCursorKeysMode", "applicationKeypadMode", "applicationKeypad", "insertMode", "modes", "originMode", "origin", "reverseWraparoundMode", "reverseWraparound", "sendFocusMode", "wraparoundMode", "wraparound", "columns", "_verifyIntegers", "registerMarker", "_verifyPositiveIntegers", "scrollPages", "pageCount", "scrollToTop", "scrollToLine", "writeUtf8", "writeln", "getOption", "setOption", "loadAddon", "addon", "values", "Infinity", "isNaN", "_alpha", "_colors", "_rendererId", "_scaledCharWidth", "_scaledCharHeight", "_scaledCellWidth", "_scaledCellHeight", "_scaledCharLeft", "_scaledCharTop", "_columnSelectMode", "_currentGlyphIdentifier", "chars", "code", "bold", "dim", "italic", "_initCanvas", "_charAtlas", "throwIfFalsy", "_clearAll", "onOptionsChanged", "onGridChanged", "_selectionStart", "_selectionEnd", "colorSet", "_refreshCharAtlas", "_setTransparency", "oldCanvas", "cloneNode", "replaceChild", "acquireCharAtlas", "warmUp", "scaledCharWidth", "scaledCharHeight", "scaledCharLeft", "scaledCharTop", "_fillCells", "_fillMiddleLineAtCells", "cellOffset", "_fillBottomLineAtCells", "_fillLeftLineAtCell", "_strokeRectAtCell", "strokeRect", "_clearCells", "_fillCharTrueColor", "cell", "font", "_getFont", "textBaseline", "TEXT_BASELINE", "_clipRow", "drawSuccess", "customGlyphs", "tryDrawCustomChar", "getChars", "fillText", "_drawChars", "contrastColor", "_getContrastColor", "isFgRGB", "isBgRGB", "_drawUncachedChars", "isInverse", "isBgDefault", "INVERTED_DEFAULT_COLOR", "getBgColor", "isFgDefault", "getFgColor", "DEFAULT_COLOR", "drawBoldTextInBrightColors", "isBold", "WHITESPACE_CELL_CHAR", "getCode", "WHITESPACE_CELL_CODE", "isDim", "isItalic", "hasOverrides", "getDecorationsAtCell", "backgroundColorRGB", "foregroundColorRGB", "draw", "fgOverride", "save", "opaque", "AttributeData", "join", "globalAlpha", "DIM_OPACITY", "restore", "beginPath", "clip", "fontWeightBold", "fontWeight", "bgOverride", "isTop", "layer", "_isCellInSelection", "minimumContrastRatio", "excludeFromContrastRatioDemands", "adjustedColor", "fgColor", "fgColorMode", "getFgColorMode", "bgColor", "bgColorMode", "getBgColorMode", "temp", "temp2", "bgRgba", "_resolveBackgroundRgba", "fgRgba", "_resolveForegroundRgba", "ensureContrastRatio", "inverse", "BaseRenderLayer", "BLINK_INTERVAL", "container", "rendererId", "_onRequestRedraw", "_coreBrowserService", "decorationService", "_cell", "CellData", "_state", "isFocused", "_cursorRenderers", "_renderBarCursor", "_renderBlockCursor", "_renderUnderlineCursor", "_cursorBlinkStateManager", "_clearCursor", "restartBlinkAnimation", "pause", "resume", "cursorBlink", "CursorBlinkStateManager", "_render", "isPaused", "triggeredByAnimationFrame", "isCursorHidden", "viewportRelativeCursorY", "loadCell", "cursorStyle", "_renderBlurCursor", "isCursorVisible", "cursorWidth", "strokeStyle", "CursorRenderLayer", "_restartInterval", "_blinkStartTimeout", "_blinkInterval", "clearInterval", "_animationTimeRestarted", "timeToStart", "time", "setInterval", "U", "N", "K", "G", "V", "X", "Z", "Y", "J", "$", "Q", "ee", "te", "re", "ie", "ne", "oe", "se", "ae", "ce", "le", "he", "ue", "fe", "_e", "de", "pe", "ve", "ye", "ge", "me", "be", "Se", "Ce", "we", "Le", "Ee", "xe", "Re", "ke", "Me", "Ae", "Oe", "De", "Te", "Be", "Pe", "Ie", "He", "je", "Fe", "We", "Ue", "qe", "Ne", "ze", "Ke", "Ge", "Ve", "Xe", "Ze", "Ye", "Je", "$e", "Qe", "et", "tt", "rt", "it", "nt", "ot", "st", "at", "ct", "lt", "ht", "ut", "ft", "_t", "dt", "pt", "vt", "yt", "gt", "mt", "bt", "St", "Ct", "wt", "Lt", "Et", "blockElementDefinitions", "patternCharacterDefinitions", "boxDrawingDefinitions", "xp", "yp", "powerlineDefinitions", "horizontalPadding", "xOffset", "yOffset", "blockElementDefinition", "charDefinition", "box", "xEighth", "yEighth", "patternDefinition", "patternSet", "cachedPatterns", "pattern", "tmpCanvas", "tmpCtx", "imageData", "ImageData", "startsWith", "parseFloat", "putImageData", "createPattern", "boxDrawingDefinition", "instructions", "actualInstructions", "instruction", "svgToCanvasInstructionMap", "args", "translateArgs", "error", "stroke", "closePath", "powerlineDefinition", "fill", "clamp", "bezierCurveTo", "lineTo", "moveTo", "cache", "GridCache", "onShowLinkUnderline", "onHideLinkUnderline", "middleRowCount", "is256Color", "LinkRenderLayer", "nextRendererId", "instantiationService", "_id", "_renderLayers", "TextRenderLayer", "SelectionRenderLayer", "_devicePixelRatio", "_updateDimensions", "removeTerminalFromCache", "onDevicePixelRatioChange", "onCharSizeChanged", "_runOperation", "operation", "renderRows", "letterSpacing", "IInstantiationService", "isPowerlineGlyph", "codepoint", "_clearState", "_didStateChange", "viewportStartRow", "viewportEndRow", "viewportCappedStartRow", "viewportCappedEndRow", "startRowEndCol", "middleRowsCount", "_areCoordinatesEqual", "coord1", "coord2", "_characterWidth", "_characterFont", "_characterOverlapCache", "_workCell", "terminalFont", "_forEachCell", "firstRow", "lastRow", "joinedRanges", "getJoinedCharacters", "isJoined", "lastCharX", "JoinedCellData", "translateToString", "_isOverlapping", "getCodePoint", "NULL_CELL_CODE", "_drawBackground", "prevFillStyle", "nextFillStyle", "isBgPalette", "_drawForeground", "isInvisible", "isUnderline", "isStrikethrough", "beginFrame", "hasOwnProperty", "overlaps", "measureText", "_didWarmUp", "_doWarmUp", "BaseCharAtlas", "charAtlasCache", "newConfig", "generateConfig", "ownedByIndex", "entry", "ownedBy", "configEquals", "config", "atlas", "newEntry", "DynamicCharAtlas", "clonedColors", "colorCode", "isLegacyEdge", "CHAR_ATLAS_CELL_SPACING", "TEXTURE_WIDTH", "TEXTURE_HEIGHT", "TRANSPARENT_COLOR", "getGlyphCacheKey", "glyph", "_config", "_drawToCacheCount", "_glyphsWaitingOnBitmap", "_bitmapCommitTimeout", "_bitmap", "_cacheCanvas", "_cacheCtx", "_tmpCtx", "_height", "capacity", "_cacheMap", "LRUMap", "prealloc", "_canCache", "glyphKey", "cacheValue", "_drawFromCache", "peek", "_drawToCache", "_toCoordinateX", "_toCoordinateY", "isEmpty", "cacheX", "cacheY", "drawImage", "inBitmap", "_getColorFromAnsiIndex", "idx", "_getBackgroundColor", "_getForegroundColor", "fontStyle", "clearColor", "offset", "_addGlyphToBitmap", "isSafari", "_generateBitmap", "glyphsMovingToBitmap", "createImageBitmap", "then", "bitmap", "NoneCharAtlas", "_map", "_head", "_tail", "_nodePool", "_unlinkNode", "prev", "_appendNode", "tail", "nodePool", "peekValue", "head", "TERMINAL_CLASS_PREFIX", "FG_CLASS_PREFIX", "BG_CLASS_PREFIX", "FOCUS_CLASS", "nextTerminalId", "_linkifier", "_linkifier2", "_terminalClass", "_refreshRowElements", "_selectionContainer", "_injectCss", "_rowFactory", "DomRendererRowFactory", "_onLinkHover", "_onLinkLeave", "_themeStyleElement", "_dimensionsStyleElement", "overflow", "styles", "_terminalSelector", "BOLD_CLASS", "ITALIC_CLASS", "CURSOR_CLASS", "CURSOR_STYLE_BLOCK_CLASS", "CURSOR_BLINK_CLASS", "CURSOR_STYLE_BAR_CLASS", "CURSOR_STYLE_UNDERLINE_CLASS", "documentFragment", "isXFlipped", "_createSelectionElement", "colStart", "colEnd", "cursorAbsoluteY", "rowElement", "createRow", "_setCellUnderline", "enabled", "span", "textDecoration", "DIM_CLASS", "UNDERLINE_CLASS", "STRIKETHROUGH_CLASS", "isCursorRow", "lineLength", "charElement", "isInSelection", "resolvedBg", "_addStyle", "padStart", "_applyMinimumContrast", "padChar", "isSelectAllActive", "selectionStartLength", "areSelectionValuesReversed", "startPlusLength", "onTrim", "SelectionModel", "_onCharSizeChange", "_measureStrategy", "DomMeasureStrategy", "_parentElement", "_result", "_measureElement", "geometry", "firstCell", "combinedData", "isCombined", "setFromCharData", "getAsCharData", "_characterJoiners", "_nextCharacterJoinerId", "joiner", "ranges", "lineStr", "rangeStartColumn", "currentStringIndex", "rangeStartStringIndex", "rangeAttrFG", "rangeAttrBG", "getBg", "getTrimmedLength", "_getJoinedRanges", "startIndex", "endIndex", "allJoinedRanges", "joinerRanges", "_mergeRanges", "_stringRangesToCellRanges", "currentRangeIndex", "currentRangeStarted", "currentRange", "getString", "newRange", "inRange", "getRootNode", "activeElement", "hasFocus", "_renderer", "_isPaused", "_needsFullRefresh", "_isNextRenderRedrawOnly", "_needsSelectionRefresh", "_canvasWidth", "_canvasHeight", "_selectionState", "_onDimensionsChange", "_onRenderedViewportChange", "_onRefreshRequest", "_renderDebouncer", "_fullRefresh", "_handleOptionsChanged", "onCharSizeChange", "IntersectionObserver", "_onIntersectionChange", "threshold", "observe", "disconnect", "isIntersecting", "intersectionRatio", "isRedrawOnly", "_fireOnCanvasResize", "NON_BREAKING_SPACE_CHAR", "ALL_NON_BREAKING_SPACE_REGEX", "_dragScrollAmount", "_enabled", "_mouseDownTimeStamp", "_oldHasSelection", "_oldSelectionStart", "_oldSelectionEnd", "_onLinuxMouseSelection", "_onRedrawRequest", "_onRequestScrollLines", "_mouseUpListener", "_onMouseUp", "onUserInput", "_trimListener", "_onTrim", "_onBufferActivate", "_model", "_activeSelectionMode", "_removeMouseDownListeners", "finalSelectionStart", "finalSelectionEnd", "lineText", "isLinuxMouseSelection", "_isClickInSelection", "_getMouseBufferCoords", "_areCoordsInSelection", "isCellInSelection", "_selectWordAtCursor", "allowWhitespaceOnlySelection", "getRangeLength", "_selectWordAt", "_getMouseEventScrollAmount", "terminalHeight", "macOptionClickForcesSelection", "timeStamp", "_onIncrementalClick", "detail", "_onSingleClick", "_onDoubleClick", "_onTripleClick", "_addMouseDownListeners", "_dragScrollIntervalTimer", "_dragScroll", "hasWidth", "_selectLineAt", "previousSelectionEnd", "_selectToWordAt", "timeElapsed", "coordinates", "moveToCellSequence", "_fireEventIfSelectionChanged", "_fireOnSelectionChange", "_convertViewportColToCharacterIndex", "charIndex", "_getWordAt", "followWrappedLinesAbove", "followWrappedLinesBelow", "charOffset", "leftWideCharCount", "rightWideCharCount", "leftLongCharOffset", "rightLongCharOffset", "charAt", "_isCharWordSeparator", "trim", "previousBufferLine", "previousLineWordPosition", "nextBufferLine", "nextLineWordPosition", "wordPosition", "wordSeparator", "wrappedRange", "getWrappedRangeForLine", "last", "createDecorator", "_audioContext", "audioContextCtor", "AudioContext", "webkitAudioContext", "audioContext", "bellAudioSource", "createBufferSource", "decodeAudioData", "_base64ToArrayBuffer", "_removeMimeType", "bellSound", "connect", "destination", "base64", "binaryString", "atob", "len", "bytes", "Uint8Array", "dataURI", "_maxLength", "onDeleteEmitter", "onInsertEmitter", "onTrimEmitter", "_array", "Array", "_startIndex", "_length", "newMaxLength", "newArray", "_getCyclicIndex", "newLength", "recycle", "deleteCount", "items", "countToTrim", "trimStart", "shiftElements", "expandListBy", "CircularList", "clone", "val", "depth", "clonedObject", "isArray", "rgb", "toPaddedHex", "contrastRatio", "l1", "l2", "fgR", "fgG", "fgB", "bgR", "bgG", "bgB", "ratio", "rgbaColor", "toChannels", "rgbaMatch", "relativeLuminance2", "rs", "gs", "bs", "pow", "relativeLuminance", "reduceLuminance", "cr", "increaseLuminance", "bgL", "fgL", "resultB", "resultA", "resultARatio", "hasWriteSyncWarnHappened", "_onBinary", "_onData", "_onLineFeed", "_onWriteParsed", "InstantiationService", "OptionsService", "BufferService", "LogService", "CoreService", "CoreMouseService", "ICoreMouseService", "_dirtyRowService", "DirtyRowService", "IDirtyRowService", "unicodeService", "UnicodeService", "_charsetService", "CharsetService", "ICharsetService", "InputHandler", "markRangeDirty", "scrollBottom", "_writeBuffer", "WriteBuffer", "promiseResult", "parse", "_onScrollApi", "_windowsMode", "writeSync", "maxSubsequentCalls", "LogLevelEnum", "WARN", "MINIMUM_COLS", "MINIMUM_ROWS", "scroll", "eraseAttr", "registerEscHandler", "registerDcsHandler", "registerCsiHandler", "registerOscHandler", "windowsMode", "_enableWindowsMode", "updateWindowsModeWrappedState", "final", "_listeners", "_disposed", "_event", "arg1", "arg2", "queue", "call", "from", "to", "GLEVEL", "MAX_PARSEBUFFER_LENGTH", "paramToWindowOption", "opts", "setWinLines", "restoreWin", "minimizeWin", "setWinPosition", "setWinSizePixels", "raiseWin", "lowerWin", "refreshWin", "setWinSizeChars", "maximizeWin", "fullscreenWin", "getWinState", "getWinPosition", "getWinSizePixels", "getScreenSizePixels", "getCellSizePixels", "getWinSizeChars", "getScreenSizeChars", "getIconTitle", "getWinTitle", "pushTitle", "popTitle", "_data", "Uint32Array", "hook", "params", "put", "concat", "subarray", "unhook", "success", "utf32ToString", "_coreMouseService", "EscapeSequenceParser", "_parseBuffer", "_stringDecoder", "StringToUtf32", "_utf8Decoder", "Utf8ToUtf32", "_windowTitle", "_iconName", "_windowTitleStack", "_iconNameStack", "_curAttrData", "_eraseAttrDataInternal", "_onRequestBell", "_onRequestRefreshRows", "_onRequestReset", "_onRequestSendFocus", "_onRequestSyncScrollBar", "_onRequestWindowsOptionsReport", "_onA11yChar", "_onA11yTab", "_onColor", "_parseStack", "paused", "cursorStartX", "cursorStartY", "decodedLength", "_specialColors", "setCsiHandlerFallback", "identifier", "identToString", "toArray", "setEscHandlerFallback", "setExecuteHandlerFallback", "setOscHandlerFallback", "setDcsHandlerFallback", "payload", "setPrintHandler", "print", "insertChars", "intermediates", "scrollLeft", "cursorUp", "scrollRight", "cursorDown", "cursorForward", "cursorBackward", "cursorNextLine", "cursorPrecedingLine", "cursorCharAbsolute", "cursorPosition", "cursorForwardTab", "eraseInDisplay", "prefix", "eraseInLine", "insertLines", "deleteLines", "deleteChars", "scrollUp", "scrollDown", "eraseChars", "cursorBackwardTab", "charPosAbsolute", "hPositionRelative", "repeatPrecedingCharacter", "sendDeviceAttributesPrimary", "sendDeviceAttributesSecondary", "linePosAbsolute", "vPositionRelative", "hVPosition", "tabClear", "setMode", "setModePrivate", "resetMode", "resetModePrivate", "charAttributes", "deviceStatus", "deviceStatusPrivate", "softReset", "setCursorStyle", "setScrollRegion", "saveCursor", "windowOptions", "restoreCursor", "insertColumns", "deleteColumns", "setExecuteHandler", "BEL", "LF", "lineFeed", "VT", "FF", "carriageReturn", "BS", "backspace", "HT", "tab", "SO", "shiftOut", "SI", "shiftIn", "C1", "IND", "NEL", "nextLine", "HTS", "tabSet", "OscHandler", "setTitle", "setIconName", "setOrReportIndexedColor", "setOrReportFgColor", "setOrReportBgColor", "setOrReportCursorColor", "restoreIndexedColor", "restoreFgColor", "restoreBgColor", "restoreCursorColor", "reverseIndex", "keypadApplicationMode", "keypadNumericMode", "fullReset", "setgLevel", "selectDefaultCharset", "flag", "selectCharset", "CHARSETS", "screenAlignmentPattern", "setErrorHandler", "DECRQSS", "_preserveStack", "_logSlowResolvingAsync", "Promise", "race", "res", "rej", "catch", "err", "wasPaused", "DEBUG", "prototype", "clearRange", "decode", "chWidth", "charset", "curAttr", "bufferRow", "markDirty", "setCellFromCodePoint", "extended", "wcwidth", "ch", "stringFromCodePoint", "_eraseAttrData", "insertCells", "getNullCell", "NULL_CELL_WIDTH", "addCodepointToCell", "precedingCodepoint", "hasContent", "DcsHandler", "convertEol", "_restrictCursor", "originalX", "nextStop", "maxCol", "_setCursor", "_moveCursor", "diffToTop", "diffToBottom", "param", "tabs", "prevStop", "_eraseInBufferLine", "clearWrap", "replaceCells", "_resetBufferLine", "clearMarkers", "scrollBackSize", "scrollBottomRowsOffset", "scrollBottomAbsolute", "deleteCells", "_is", "term", "termName", "setgCharset", "DEFAULT_CHARSET", "activeEncoding", "activateAltBuffer", "activateNormalBuffer", "_updateAttrColor", "mode", "c1", "c2", "c3", "fromColorRGB", "_extractColor", "accu", "cSpace", "advance", "hasSubParams", "subparams", "getSubParams", "underlineColor", "_processUnderline", "underlineStyle", "updateExtended", "savedX", "savedY", "savedCurAttrData", "savedCharset", "isBlinking", "bottom", "second", "_savedCharset", "slots", "spec", "parseColor", "_setOrReportSpecialColor", "collectAndFlag", "scrollRegionHeight", "level", "markAllDirty", "_disposables", "unregister", "disposables", "array", "isNode", "navigator", "userAgent", "platform", "test", "isIpad", "isIphone", "_getKey", "insert", "_search", "getKeyIterator", "mid", "SortedList", "fillFallback", "constructor", "lastChar", "CHAR_DATA_CODE_INDEX", "ExtendedAttrs", "newObj", "isBlink", "isFgPalette", "isAttributeDefault", "hasExtendedAttrs", "getUnderlineColor", "getUnderlineColorMode", "isUnderlineColorRGB", "isUnderlineColorPalette", "isUnderlineColorDefault", "getUnderlineStyle", "MAX_BUFFER_SIZE", "_hasScrollback", "_nullCell", "fromCharData", "NULL_CELL_CHAR", "_whitespaceCell", "WHITESPACE_CELL_WIDTH", "_isClearing", "_cols", "_rows", "_getCorrectBufferLength", "getWhitespaceCell", "BufferLine", "maxLength", "relativeY", "correctBufferLength", "scrollback", "fillViewportRows", "fillAttr", "newCols", "newRows", "nullCell", "addToY", "amountToTrim", "_isReflowEnabled", "_reflow", "_reflowLarger", "_reflowSmaller", "toRemove", "reflowLargerGetLinesToRemove", "newLayoutResult", "reflowLargerCreateNewLayout", "reflowLargerApplyNewLayout", "layout", "_reflowLargerAdjustViewport", "countRemoved", "viewportAdjustments", "toInsert", "countToInsert", "wrappedLines", "absoluteY", "trimmedLines", "lastLineLength", "destLineLengths", "reflowSmallerGetNewLineLengths", "linesToAdd", "newLines", "newLine", "destLineIndex", "destCol", "srcLineIndex", "srcCol", "cellsToCopy", "copyCellsFrom", "wrappedLinesIndex", "getWrappedLineTrimmedLength", "setCell", "insertEvents", "originalLines", "originalLinesLength", "originalLineIndex", "nextToInsertIndex", "nextToInsert", "countInsertedSoFar", "nextI", "insertCountEmitted", "lineIndex", "trimRight", "CHAR_DATA_WIDTH_INDEX", "CHAR_DATA_CHAR_INDEX", "tabStopWidth", "Marker", "onInsert", "onDelete", "_removeMarker", "startOverscan", "endOverscan", "BufferStringIterator", "Buffer", "_trimRight", "_endIndex", "_startOverscan", "_endOverscan", "_current", "fillCellData", "_combined", "_extendedAttrs", "cp", "CHAR_DATA_ATTR_INDEX", "codePoint", "eAttrs", "keys", "copyFrom", "src", "applyInReverse", "srcData", "srcCombinedKeys", "bufferCols", "endsInNull", "followingLineStartsWithWide", "oldCols", "bufferAbsoluteY", "srcTrimmedTineLength", "srcRemainingCells", "destRemainingCells", "countToRemove", "nextToRemoveIndex", "nextToRemoveStart", "countRemovedSoFar", "newLayout", "newLayoutLines", "newLineLengths", "cellsNeeded", "reduce", "srcLine", "cellsAvailable", "oldTrimmedLength", "endsWithWide", "_normal", "_alt", "inactiveBuffer", "BufferSet", "obj", "combined", "DEFAULT_ATTR", "_nextId", "isDisposed", "_onDispose", "NUL", "SOH", "STX", "EOT", "ENQ", "ACK", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "FS", "GS", "RS", "US", "SP", "DEL", "PAD", "HOP", "BPH", "NBH", "SSA", "ESA", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3", "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA", "SOS", "SGCI", "SCI", "CSI", "OSC", "PM", "APC", "KEYCODE_KEY_MAPPINGS", "applicationCursorMode", "modifiers", "keyMapping", "keyString", "toUpperCase", "toLowerCase", "_interim", "startPos", "interim", "byte1", "byte2", "byte3", "byte4", "discardInterim", "tmp", "missing", "fourStop", "table", "BMP_COMBINING", "HIGH_COMBINING", "version", "num", "ucs", "UnicodeV6", "qmt", "queueMicrotask", "cb", "resolve", "_action", "_callbacks", "_pendingData", "_bufferOffset", "_isSyncWriting", "_syncCalls", "chunk", "_innerWrite", "lastTime", "startTime", "RGB_REX", "HASH_REX", "pad", "bits", "s2", "low", "base", "adv", "PAYLOAD_LIMIT", "EMPTY_HANDLERS", "_handlers", "create", "_active", "_ident", "_handlerFb", "_stack", "loopPosition", "fallThrough", "registerHandler", "handlerList", "handlerIndex", "clearHandler", "setHandlerFallback", "handlerResult", "DcsParser", "EMPTY_PARAMS", "Params", "addParam", "_handler", "_params", "_hitLimit", "ret", "setDefault", "addMany", "codes", "TransitionTable", "NON_ASCII_PRINTABLE", "VT500_TRANSITION_TABLE", "blueprint", "apply", "unused", "PRINTABLES", "EXECUTABLES", "states", "_transitions", "handlers", "handlerPos", "transition", "chunkPos", "initialState", "currentState", "_collect", "_printHandlerFb", "_executeHandlerFb", "_csiHandlerFb", "_escHandlerFb", "_errorHandlerFb", "_printHandler", "_executeHandlers", "_csiHandlers", "_escHandlers", "_oscParser", "OscParser", "_dcsParser", "_errorHandler", "_identifier", "finalRange", "intermediate", "finalCode", "reverse", "clearPrintHandler", "clearEscHandler", "clearExecuteHandler", "clearCsiHandler", "clearDcsHandler", "clearOscHandler", "clearErrorHandler", "collect", "abort", "addSubParam", "addDigit", "handlersEsc", "jj", "_start", "_put", "MAX_VALUE", "maxSubParamsLength", "Int32Array", "_subParams", "_subParamsLength", "_subParamsIdx", "Uint16Array", "_rejectDigits", "_rejectSubDigits", "_digitIsSub", "fromArray", "newParams", "getSubParamsAll", "store", "cur", "_addons", "instance", "terminal", "loadedAddon", "_wrappedAddonDispose", "init", "getLine", "BufferLineApiView", "BufferApiView", "_line", "getCell", "_onBufferChange", "_alternate", "alternate", "addCsiHandler", "addDcsHandler", "addEscHandler", "addOscHandler", "provider", "versions", "activeVersion", "isUserScrolling", "_cachedBlankLine", "topRow", "bottomRow", "willBufferBeTrimmed", "isFull", "oldYdisp", "scrollAmount", "glevel", "_charsets", "DEFAULT_PROTOCOLS", "NONE", "restrict", "X10", "VT200", "DRAG", "ANY", "eventCode", "isSGR", "DEFAULT_ENCODINGS", "DEFAULT", "SGR", "_protocols", "_encodings", "_activeProtocol", "_activeEncoding", "_onProtocolChange", "_lastEvent", "addProtocol", "addEncoding", "name", "protocol", "encoding", "_compareEvents", "report", "triggerBinaryEvent", "down", "up", "drag", "move", "e1", "e2", "DEFAULT_MODES", "DEFAULT_DEC_PRIVATE_MODES", "_onUserInput", "_scrollToBottom", "wasUserInput", "disableStdin", "_decorations", "_onDecorationRegistered", "_onDecorationRemoved", "Decoration", "getDecorationsAtLine", "xmin", "xmax", "_cachedBg", "_cachedFg", "foregroundColor", "_end", "_entries", "service", "ServiceCollection", "_services", "getService", "ctor", "serviceDependencies", "getServiceDependencies", "sort", "serviceArgs", "dependency", "firstServiceArgPos", "optionsKeyToLogLevel", "info", "INFO", "ERROR", "off", "OFF", "_updateLogLevel", "_evalLazyOptionalParams", "optionalParams", "_log", "message", "log", "DEFAULT_BELL_SOUND", "DEFAULT_OPTIONS", "altClickMovesCursor", "FONT_WEIGHT_OPTIONS", "_onOptionChange", "defaultOptions", "newValue", "_sanitizeAndValidateOption", "_setupOptions", "storeServiceDependency", "serviceRegistry", "decorator", "arguments", "_providers", "_onChange", "defaultProvider", "_activeProvider", "__webpack_module_cache__", "__webpack_require__", "moduleId", "cachedModule", "__webpack_modules__", "require_comment", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "noOptions", "nonWS", "Pos", "cmp", "firstNonWS", "str", "found", "cm", "options", "minLine", "ranges", "mode", "i", "from", "to", "probablyInsideString", "pos", "line", "getMode", "self", "firstLine", "commentString", "end", "pad", "blankLines", "baseString", "whitespace", "cut", "startString", "endString", "lastLineHasText", "lead", "atCursor", "empty", "start", "lineString", "lines", "didSomething", "lineComment", "endPos", "startLine", "open", "endLine", "close", "insideStart", "insideEnd", "lastStart", "firstEnd", "almostLastStart", "openEnd", "foundEnd", "require_continuecomment", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "nonspace", "repeat", "n", "continueComment", "cm", "ranges", "mode", "inserts", "i", "pos", "modeHere", "insert", "line", "found", "blockStart", "lineCmt", "end", "nonspaceAfter", "tabSize", "numTabs", "continueLineCommentEnabled", "next", "nextFound", "ch", "str", "m", "opt", "val", "prev", "key", "map", "require_placeholder", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "cm", "val", "old", "prev", "onBlur", "onChange", "onComposition", "clearPlaceholder", "wrapper", "setPlaceholder", "elt", "placeHolder", "empty", "input", "isEmpty", "require_closebrackets", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "defaults", "Pos", "cm", "val", "old", "keyMap", "ensureBound", "getOption", "conf", "name", "handleBackspace", "handleEnter", "chars", "i", "ch", "key", "handler", "handleChar", "getConfig", "deflt", "mode", "pairs", "ranges", "around", "charsAround", "cur", "explode", "linesep", "moveSel", "line", "dir", "newRanges", "primary", "range", "pos", "contractSelection", "sel", "inverted", "closeBefore", "triples", "identical", "opening", "type", "curType", "next", "stringStartsAfter", "prev", "left", "right", "sels", "str", "token", "require_matchbrackets", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "ie_lt8", "Pos", "matching", "bracketRegex", "config", "findMatchingBracket", "cm", "where", "line", "pos", "afterCursor", "re", "match", "dir", "style", "found", "scanForBracket", "maxScanLen", "maxScanLines", "stack", "lineEnd", "lineNo", "end", "ch", "matchBrackets", "autoclear", "maxHighlightLen", "highlightNonMatching", "marks", "ranges", "i", "clear", "doMatchBrackets", "clearHighlighted", "val", "old", "oldConfig", "require_searchcursor", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "Pos", "regexpFlags", "regexp", "flags", "ensureFlags", "current", "target", "i", "maybeMultiline", "searchRegexpForward", "doc", "start", "line", "ch", "last", "string", "match", "searchRegexpForwardMultiline", "chunk", "curLine", "before", "inside", "startLine", "startCh", "lastMatchIn", "endMargin", "from", "newMatch", "end", "searchRegexpBackward", "first", "searchRegexpBackwardMultiline", "chunkSize", "doFold", "noFold", "str", "adjustPos", "orig", "folded", "pos", "foldFunc", "min", "max", "mid", "len", "searchStringForward", "query", "caseFold", "fold", "lines", "search", "found", "cutFrom", "endString", "lastLine", "searchStringBackward", "top", "topString", "SearchCursor", "options", "reverse", "head", "result", "newText", "origin", "ranges", "cur", "require_sublime", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "cmds", "Pos", "findPosSubword", "doc", "start", "dir", "line", "state", "type", "startPos", "pos", "e", "i", "next", "cat", "moveSubword", "cm", "range", "info", "visibleBottomLine", "visibleTopLine", "ranges", "lineRanges", "from", "to", "extended", "insertLine", "above", "len", "newSelection", "last", "head", "at", "wordAt", "end", "fullWord", "word", "text", "query", "cur", "found", "isSelectedRange", "prevAnchor", "prevHead", "sel", "addCursorToSelection", "newRanges", "newAnchor", "newHead", "newRange", "mirror", "selectBetweenBrackets", "opening", "closing", "puncType", "prev", "linesToMove", "newSels", "joined", "offset", "obj", "anchor", "actual", "rangeCount", "sortLines", "caseSensitive", "direction", "toSort", "selected", "lines", "a", "b", "au", "bu", "marks", "current", "j", "k", "modifyWordOrSelection", "indices", "replacements", "cursors", "indentUnit", "cursor", "toStartOfLine", "column", "deletePos", "prevIndent", "str", "tmp", "getTarget", "findAndGoTo", "forward", "target", "matches", "primaryIndex", "keyMap", "mac", "require_python", "__commonJSMin", "exports", "module", "mod", "CodeMirror", "wordRegexp", "words", "wordOperators", "commonKeywords", "commonBuiltins", "top", "state", "conf", "parserConf", "ERRORCLASS", "delimiters", "operators", "i", "hangingIndent", "myKeywords", "myBuiltins", "py3", "identifiers", "stringPrefixes", "keywords", "builtins", "tokenBase", "stream", "sol", "scopeOffset", "lineOffset", "pushPyScope", "dedent", "style", "tokenBaseInner", "inFormat", "floatLiteral", "intLiteral", "isFmtString", "formatStringFactory", "tokenStringFactory", "delimiter", "tokenOuter", "singleline", "OUTCLASS", "tokenNestedExpr", "depth", "inner", "tokenString", "pushBracketScope", "type", "align", "indented", "tokenLexer", "current", "delimiter_index", "external", "basecolumn", "addErr", "textAfter", "scope", "closing", "str", "codePointsToString", "code", "ord", "codePointsToString_default", "stringToCodePoints", "code", "c", "stringToCodePoints_default", "Default", "code", "codePointsToString_default", "stringToCodePoints_default", "Default_default", "Base64", "Default_default", "code", "c", "Base64_default", "Lang", "id", "name", "runner", "url", "args", "highlighterRef", "code", "input", "import_index", "Runner", "EventEmitter", "message", "Runner_default", "WorkerRunner", "Runner_default", "workerURL", "error", "data", "code", "input", "args", "message", "options", "Worker_default", "init", "WasmerSDK", "Wasmer", "Runner_default", "packageName", "filename", "spawnOptions", "#package", "#instance", "code", "input", "args", "preparingMessageTimeout", "entrypointArgs", "arg", "codePointsToString_default", "exitCode", "stderr", "stdout", "char", "Wasmer_default", "Langs", "langs", "lang", "langId", "code", "args", "input", "workerRunner", "workerURL", "runner", "Worker_default", "wasmerRunner", "packageName", "filename", "spawnOptions", "Wasmer_default", "import_shell", "Bash", "Lang", "wasmerRunner", "Bash_default", "Hexdump", "Default_default", "code", "c", "Hexdump_default", "import_javascript", "JavaScript", "Lang", "workerRunner", "JavaScript_default", "import_ruby", "Ruby", "Lang", "wasmerRunner", "Ruby_default", "import_perl", "Perl", "Lang", "workerRunner", "Perl_default", "import_codemirror", "import_melba_toast", "Renderers", "renderers", "mimeType", "value", "renderer", "prepend", "char", "createDevice", "renderers", "Renderers", "import_codemirror", "Abstract", "inputs", "tag", "c", "Abstract_default", "replaceBinaryBytes", "code", "replacement", "replaceBinaryBytes_default", "Code", "Abstract_default", "parent", "options", "element", "textarea", "char", "data", "eventName", "handler", "args", "binaryReplacementChar", "code", "replaceBinaryBytes_default", "key", "value", "type", "c", "Code_default", "Abstract", "mimeType", "tag", "hidden", "element", "Abstract_default", "import_javascript", "import_perl", "Code", "Abstract_default", "parent", "options", "textarea", "UI_default", "mimeType", "char", "Code_default", "IFrame", "Abstract_default", "parent", "mimeType", "char", "container", "IFrame_default", "Decoders", "decoders", "code", "decoder", "decoders", "Decoders", "IO", "stdin", "args", "value", "decoders", "char", "IO_default", "Options", "name", "defaultValue", "value", "options", "Image", "IFrame_default", "mimeType", "options", "char", "Image_default", "Inputs", "inputs", "input", "toActivate", "value", "eventName", "handler", "replaceBinaryBytes", "buffer", "type", "char", "writeBuffer", "Inputs_default", "InvalidFormat", "InvalidFormat_default", "PBMImage", "Image_default", "mimeType", "char", "e", "InvalidFormat_default", "header", "format", "width", "height", "offset", "maxValue", "canvas", "context", "imageData", "data", "index", "value", "binary", "type", "withoutMaxValue", "withMaxValue", "match", "separator", "block", "currentPosition", "comment", "currentChar", "bitMask", "rowPosition", "PBMImage_default", "import_xterm", "MINIMUM_COLS", "MINIMUM_ROWS", "FitAddon", "terminal", "dims", "core", "parentElementStyle", "parentElementHeight", "parentElementWidth", "elementStyle", "elementPadding", "elementPaddingVer", "elementPaddingHor", "availableHeight", "availableWidth", "TTY", "_TTY", "Abstract_default", "parent", "options", "FitAddon", "text", "input", "escapeInput", "x", "y", "maxX", "maxY", "cols", "value", "type", "results", "visibleLines", "dimensions", "char", "rows", "TTY_default", "import_comment", "import_continuecomment", "import_placeholder", "import_closebrackets", "import_matchbrackets", "import_sublime", "UI", "_UI", "stdoutContainer", "Inputs_default", "Code_default", "createDevice", "PBMImage_default", "Image_default", "IFrame_default", "TTY_default", "IO_default", "link", "key", "event", "name", "value", "options", "previousLang", "e", "langs", "langKey", "lang", "option", "inputs", "decoders", "element", "code", "decoder", "decodedCode", "started", "runner", "stopHandler", "output", "error", "exitCode", "message", "type", "args", "arg", "argButton", "currentValue", "expander", "collapser", "target", "mimeType", "setInput", "button", "hash", "data", "jsonData", "headerExpander", "footerExpander", "header", "footer", "input", "mime", "optionValues", "rawCode", "replaceBinaryBytes_default", "codePointsToString_default", "bytes", "char", "byteCount", "content", "toast", "UI_default", "Xxd", "Default_default", "code", "c", "Xxd_default", "import_python", "jq", "Lang", "code", "input", "args", "runner", "Wasmer_default", "jq_default", "decoders", "Xxd_default", "Hexdump_default", "Base64_default", "Default_default", "langs", "Bash_default", "JavaScript_default", "Ruby_default", "Perl_default", "jq_default", "ui", "UI_default"] } diff --git a/dist/js/langs/javascript-browser/worker.js b/dist/js/langs/javascript-browser/worker.js index e0ad385..6248b9a 100644 --- a/dist/js/langs/javascript-browser/worker.js +++ b/dist/js/langs/javascript-browser/worker.js @@ -1,4 +1,4 @@ -(()=>{var o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var s=o((exports,module)=>{addEventListener("message",({data})=>{let{code,input}=data;prompt=()=>input,console.log=(...e)=>{postMessage({type:"output",output:e.join("")+` +var o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var s=o((exports,module)=>{addEventListener("message",({data})=>{let{code,input}=data;prompt=()=>input,console.log=(...e)=>{postMessage({type:"output",output:e.join("")+` `})},console.warn=console.error=console.debug=(...e)=>{postMessage({type:"output",error:e.join("")+` -`})};let result;try{result=eval(code.map(e=>String.fromCharCode(e)).join("")),result instanceof Function&&(result=result(input))}catch(e){postMessage({type:"output",error:e.message}),result=null}postMessage({type:"done",output:result})})});s();})(); +`})};let result;try{result=eval(code.map(e=>String.fromCharCode(e)).join("")),result instanceof Function&&(result=result(input))}catch(e){postMessage({type:"output",error:e.message}),result=null}postMessage({type:"done",output:result})})});export default s(); //# sourceMappingURL=worker.js.map diff --git a/dist/js/langs/javascript-browser/worker.js.map b/dist/js/langs/javascript-browser/worker.js.map index c089eaf..e28eb6b 100644 --- a/dist/js/langs/javascript-browser/worker.js.map +++ b/dist/js/langs/javascript-browser/worker.js.map @@ -2,6 +2,6 @@ "version": 3, "sources": ["../../../../js/langs/javascript-browser/worker.js"], "sourcesContent": ["addEventListener('message', ({ data }) => {\n const { code, input } = data;\n\n // overwrite builtins to support this approach\n // stdin\n prompt = () => input;\n\n // stdout\n console.log = (...data) => {\n postMessage({\n type: 'output',\n output: data.join('') + '\\n',\n });\n };\n\n // stderr\n console.warn =\n console.error =\n console.debug =\n (...data) => {\n postMessage({\n type: 'output',\n error: data.join('') + '\\n',\n });\n };\n\n let result;\n\n try {\n result = eval(code.map((char) => String.fromCharCode(char)).join(''));\n\n if (result instanceof Function) {\n result = result(input);\n }\n } catch (e) {\n postMessage({\n type: 'output',\n error: e.message,\n });\n\n // if we don't do this, we could end up with a function object that \"could not be cloned\":\n // https://stackoverflow.com/a/42376465/3145856\n result = null;\n }\n\n postMessage({\n type: 'done',\n output: result,\n });\n});\n"], - "mappings": "oEAAA,IAAAA,EAAAC,EAAA,oCAAiB,UAAW,CAAC,CAAE,IAAK,IAAM,CACxC,GAAM,CAAE,KAAM,KAAM,EAAI,KAIxB,OAAS,IAAM,MAGf,QAAQ,IAAM,IAAIC,IAAS,CACzB,YAAY,CACV,KAAM,SACN,OAAQA,EAAK,KAAK,EAAE,EAAI;AAAA,CAC1B,CAAC,CACH,EAGA,QAAQ,KACN,QAAQ,MACR,QAAQ,MACN,IAAIA,IAAS,CACX,YAAY,CACV,KAAM,SACN,MAAOA,EAAK,KAAK,EAAE,EAAI;AAAA,CACzB,CAAC,CACH,EAEJ,IAAI,OAEJ,GAAI,CACF,OAAS,KAAK,KAAK,IAAKC,GAAS,OAAO,aAAaA,CAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAEhE,kBAAkB,WACpB,OAAS,OAAO,KAAK,EAEzB,OAAS,EAAG,CACV,YAAY,CACV,KAAM,SACN,MAAO,EAAE,OACX,CAAC,EAID,OAAS,IACX,CAEA,YAAY,CACV,KAAM,OACN,OAAQ,MACV,CAAC,CACH,CAAC", + "mappings": "8DAAA,IAAAA,EAAAC,EAAA,oCAAiB,UAAW,CAAC,CAAE,IAAK,IAAM,CACxC,GAAM,CAAE,KAAM,KAAM,EAAI,KAIxB,OAAS,IAAM,MAGf,QAAQ,IAAM,IAAIC,IAAS,CACzB,YAAY,CACV,KAAM,SACN,OAAQA,EAAK,KAAK,EAAE,EAAI;AAAA,CAC1B,CAAC,CACH,EAGA,QAAQ,KACN,QAAQ,MACR,QAAQ,MACN,IAAIA,IAAS,CACX,YAAY,CACV,KAAM,SACN,MAAOA,EAAK,KAAK,EAAE,EAAI;AAAA,CACzB,CAAC,CACH,EAEJ,IAAI,OAEJ,GAAI,CACF,OAAS,KAAK,KAAK,IAAKC,GAAS,OAAO,aAAaA,CAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAEhE,kBAAkB,WACpB,OAAS,OAAO,KAAK,EAEzB,OAAS,EAAG,CACV,YAAY,CACV,KAAM,SACN,MAAO,EAAE,OACX,CAAC,EAID,OAAS,IACX,CAEA,YAAY,CACV,KAAM,OACN,OAAQ,MACV,CAAC,CACH,CAAC", "names": ["require_worker", "__commonJSMin", "data", "char"] } diff --git a/dist/js/langs/php-wasm/worker.js b/dist/js/langs/php-wasm/worker.js deleted file mode 100644 index e0faf9b..0000000 --- a/dist/js/langs/php-wasm/worker.js +++ /dev/null @@ -1,24 +0,0 @@ -(()=>{var J={};function Q(t,n,e,r){return new(e||(e=Promise))(function(i,b){function u(h){try{p(r.next(h))}catch(y){b(y)}}function w(h){try{p(r.throw(h))}catch(y){b(y)}}function p(h){var y;h.done?i(h.value):(y=h.value,y instanceof e?y:new e(function(O){O(y)})).then(u,w)}p((r=r.apply(t,n||[])).next())})}var c;var X=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&X.decode();var k=null;function j(){return k!==null&&k.buffer===c.memory.buffer||(k=new Uint8Array(c.memory.buffer)),k}function m(t,n){return t>>>=0,X.decode(j().slice(t,t+n))}var v=new Array(128).fill(void 0);v.push(void 0,null,!0,!1);var T=v.length;function o(t){T===v.length&&v.push(v.length+1);let n=T;return T=v[n],v[n]=t,n}function _(t){return v[t]}var f=0,Y=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},nn=function(t,n){let e=Y.encode(t);return n.set(e),{read:t.length,written:e.length}};function l(t,n,e){if(e===void 0){let w=Y.encode(t),p=n(w.length,1)>>>0;return j().subarray(p,p+w.length).set(w),f=w.length,p}let r=t.length,i=n(r,1)>>>0,b=j(),u=0;for(;u127)break;b[i+u]=w}if(u!==r){u!==0&&(t=t.slice(u)),i=e(i,r,r=u+3*t.length,1)>>>0;let w=j().subarray(i+u,i+r);u+=nn(t,w).written}return f=u,i}function d(t){return t==null}var A=null;function g(){return A!==null&&A.buffer===c.memory.buffer||(A=new Int32Array(c.memory.buffer)),A}function s(t){let n=_(t);return function(e){e<132||(v[e]=T,T=e)}(t),n}var R=null;function I(t){let n=typeof t;if(n=="number"||n=="boolean"||t==null)return`${t}`;if(n=="string")return`"${t}"`;if(n=="symbol"){let i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(n=="function"){let i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){let i=t.length,b="[";i>0&&(b+=I(t[0]));for(let u=1;u1))return toString.call(t);if(r=e[1],r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} -${t.stack}`:r}var W=null;function q(){return W!==null&&W.buffer===c.memory.buffer||(W=new Float64Array(c.memory.buffer)),W}var M=new FinalizationRegistry(t=>{c.__wbindgen_export_3.get(t.dtor)(t.a,t.b)});function E(t,n,e,r){let i={a:t,b:n,cnt:1,dtor:e},b=(...u)=>{i.cnt++;let w=i.a;i.a=0;try{return r(w,i.b,...u)}finally{--i.cnt==0?(c.__wbindgen_export_3.get(i.dtor)(w,i.b),M.unregister(i)):i.a=w}};return b.original=i,M.register(b,i,i),b}function F(t,n,e){c._ZN12wasm_bindgen7convert8closures11invoke1_mut17h39693afad0d92ad2E(t,n,o(e))}function P(t,n,e,r){let i={a:t,b:n,cnt:1,dtor:e},b=(...u)=>{i.cnt++;try{return r(i.a,i.b,...u)}finally{--i.cnt==0&&(c.__wbindgen_export_3.get(i.dtor)(i.a,i.b),i.a=0,M.unregister(i))}};return b.original=i,M.register(b,i,i),b}function en(t,n){return s(c._ZN129__LT_dyn_u20_core__ops__function__Fn_LT__LP__RP__GT__u2b_Output_u20__u3d__u20_R_u20_as_u20_wasm_bindgen__closure__WasmClosure_GT_8describe6invoke17h613009e110396e8aE(t,n))}function tn(t,n,e){return c._ZN12wasm_bindgen7convert8closures7invoke117h27cd5385e9d886a8E(t,n,o(e))}function a(t,n){try{return t.apply(this,n)}catch(e){c.__wbindgen_exn_store(o(e))}}var N=new FinalizationRegistry(t=>c.__wbg_command_free(t>>>0)),S=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,N.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),n}free(){let n=this.__destroy_into_raw();c.__wbg_command_free(n)}get name(){return s(c.__wbg_get_command_name(this.__wbg_ptr))}set name(n){c.__wbg_set_command_name(this.__wbg_ptr,o(n))}run(n){return s(c.command_run(this.__wbg_ptr,d(n)?0:o(n)))}binary(){return s(c.command_binary(this.__wbg_ptr))}},bn=new FinalizationRegistry(t=>c.__wbg_directory_free(t>>>0));var G=new FinalizationRegistry(t=>c.__wbg_instance_free(t>>>0)),B=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,G.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),n}free(){let n=this.__destroy_into_raw();c.__wbg_instance_free(n)}get stdin(){return s(c.__wbg_get_instance_stdin(this.__wbg_ptr))}get stdout(){return s(c.__wbg_get_instance_stdout(this.__wbg_ptr))}get stderr(){return s(c.__wbg_get_instance_stderr(this.__wbg_ptr))}wait(){let n=this.__destroy_into_raw();return s(c.instance_wait(n))}},Z=new FinalizationRegistry(t=>c.__wbg_readablestreamsource_free(t>>>0)),L=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),n}free(){let n=this.__destroy_into_raw();c.__wbg_readablestreamsource_free(n)}pull(n){return s(c.readablestreamsource_pull(this.__wbg_ptr,o(n)))}cancel(){c.readablestreamsource_cancel(this.__wbg_ptr)}get type(){return s(c.readablestreamsource_type(this.__wbg_ptr))}},un=new FinalizationRegistry(t=>c.__wbg_runtime_free(t>>>0));var _n=new FinalizationRegistry(t=>c.__wbg_threadpoolworker_free(t>>>0)),U=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,_n.unregister(this),n}free(){let n=this.__destroy_into_raw();c.__wbg_threadpoolworker_free(n)}constructor(n){let e=c.threadpoolworker_new(n);return this.__wbg_ptr=e>>>0,this}handle(n){return s(c.threadpoolworker_handle(this.__wbg_ptr,o(n)))}},V=new FinalizationRegistry(t=>c.__wbg_trap_free(t>>>0)),D=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,V.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),n}free(){let n=this.__destroy_into_raw();c.__wbg_trap_free(n)}static __wbg_wasmer_trap(){c.trap___wbg_wasmer_trap()}},K=new FinalizationRegistry(t=>c.__wbg_wasmer_free(t>>>0)),x=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,K.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),n}free(){let n=this.__destroy_into_raw();c.__wbg_wasmer_free(n)}get entrypoint(){let n=c.__wbg_get_wasmer_entrypoint(this.__wbg_ptr);return n===0?void 0:S.__wrap(n)}set entrypoint(n){let e=0;d(n)||(function(r,i){if(!(r instanceof i))throw new Error(`expected instance of ${i.name}`);r.ptr}(n,S),e=n.__destroy_into_raw()),c.__wbg_set_wasmer_entrypoint(this.__wbg_ptr,e)}get commands(){return s(c.__wbg_get_instance_stdout(this.__wbg_ptr))}set commands(n){c.__wbg_set_wasmer_commands(this.__wbg_ptr,o(n))}static fromRegistry(n,e){let r=l(n,c.__wbindgen_malloc,c.__wbindgen_realloc),i=f;return s(c.wasmer_fromRegistry(r,i,d(e)?0:o(e)))}static fromFile(n,e){return s(c.wasmer_fromFile(o(n),d(e)?0:o(e)))}},H=new FinalizationRegistry(t=>c.__wbg_writablestreamsink_free(t>>>0)),$=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),n}free(){let n=this.__destroy_into_raw();c.__wbg_writablestreamsink_free(n)}close(){return s(c.writablestreamsink_close(this.__wbg_ptr))}abort(n){c.writablestreamsink_abort(this.__wbg_ptr,o(n))}write(n){return s(c.writablestreamsink_write(this.__wbg_ptr,o(n)))}};function rn(){let t={wbg:{}};return t.wbg.__wbg_new_08236689f0afb357=function(){return o(new Array)},t.wbg.__wbindgen_string_new=function(n,e){return o(m(n,e))},t.wbg.__wbg_new_c728d68b8b34487e=function(){return o(new Object)},t.wbg.__wbg_push_fd3233d09cf81821=function(n,e){return _(n).push(_(e))},t.wbg.__wbindgen_string_get=function(n,e){let r=_(e),i=typeof r=="string"?r:void 0;var b=d(i)?0:l(i,c.__wbindgen_malloc,c.__wbindgen_realloc),u=f;g()[n/4+1]=u,g()[n/4+0]=b},t.wbg.__wbindgen_object_clone_ref=function(n){return o(_(n))},t.wbg.__wbg_uses_87ee8532bf7067c2=function(n){let e=_(n).uses;return d(e)?0:o(e)},t.wbg.__wbg_navigator_7078da62d92ff5ad=function(n){return o(_(n).navigator)},t.wbg.__wbg_userAgent_2c548c522dca04cc=function(){return a(function(n,e){let r=l(_(e).userAgent,c.__wbindgen_malloc,c.__wbindgen_realloc),i=f;g()[n/4+1]=i,g()[n/4+0]=r},arguments)},t.wbg.__wbg_navigator_471948d3d6e10344=function(n){return o(_(n).navigator)},t.wbg.__wbg_userAgent_ec264c118b1e619c=function(){return a(function(n,e){let r=l(_(e).userAgent,c.__wbindgen_malloc,c.__wbindgen_realloc),i=f;g()[n/4+1]=i,g()[n/4+0]=r},arguments)},t.wbg.__wbg_new_d8a000788389a31e=function(n){return o(new Uint8Array(_(n)))},t.wbg.__wbg_desiredSize_800f00fde6830467=function(n,e){let r=_(e).desiredSize;q()[n/8+1]=d(r)?0:r,g()[n/4+0]=!d(r)},t.wbg.__wbg_close_3217bacea9625e8a=function(){return a(function(n){_(n).close()},arguments)},t.wbg.__wbg_enqueue_fe34f134be0ca1bd=function(){return a(function(n,e){_(n).enqueue(_(e))},arguments)},t.wbg.__wbg_error_32bdd65121e5c58d=function(n,e){_(n).error(_(e))},t.wbg.__wbindgen_number_new=function(n){return o(n)},t.wbg.__wbg_defineProperty_acb855411a6a5b7c=function(n,e,r){return o(Object.defineProperty(_(n),_(e),_(r)))},t.wbg.__wbg_crypto_58f13aa23ffcb166=function(n){return o(_(n).crypto)},t.wbg.__wbg_process_5b786e71d465a513=function(n){return o(_(n).process)},t.wbg.__wbg_versions_c2ab80650590b6a2=function(n){return o(_(n).versions)},t.wbg.__wbg_node_523d7bd03ef69fba=function(n){return o(_(n).node)},t.wbg.__wbindgen_is_string=function(n){return typeof _(n)=="string"},t.wbg.__wbg_require_2784e593a4674877=function(){return a(function(){return o(module.require)},arguments)},t.wbg.__wbg_msCrypto_abcb1295e768d1f2=function(n){return o(_(n).msCrypto)},t.wbg.__wbg_newwithlength_13b5319ab422dcf6=function(n){return o(new Uint8Array(n>>>0))},t.wbg.__wbindgen_is_object=function(n){let e=_(n);return typeof e=="object"&&e!==null},t.wbg.__wbindgen_memory=function(){return o(c.memory)},t.wbg.__wbg_buffer_344d9b41efe96da7=function(n){return o(_(n).buffer)},t.wbg.__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3=function(n,e,r){return o(new Uint8Array(_(n),e>>>0,r>>>0))},t.wbg.__wbg_randomFillSync_a0d98aa11c81fe89=function(){return a(function(n,e){_(n).randomFillSync(s(e))},arguments)},t.wbg.__wbg_getRandomValues_504510b5564925af=function(){return a(function(n,e){_(n).getRandomValues(_(e))},arguments)},t.wbg.__wbg_get_4a9aa5157afeb382=function(n,e){return o(_(n)[e>>>0])},t.wbg.__wbg_length_cace2e0b3ddc0502=function(n){return _(n).length},t.wbg.__wbg_call_669127b9d730c650=function(){return a(function(n,e){return o(_(n).call(_(e)))},arguments)},t.wbg.__wbg_newwithlength_045c9df8a7cc3543=function(n){return o(new Array(n>>>0))},t.wbg.__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d=function(n){let e;try{e=_(n)instanceof ArrayBuffer}catch{e=!1}return e},t.wbg.__wbg_toString_1a5250f284c09c9e=function(n,e,r){let i=l(_(e).toString(r),c.__wbindgen_malloc,c.__wbindgen_realloc),b=f;g()[n/4+1]=b,g()[n/4+0]=i},t.wbg.__wbg_message_35f9b952e1b922e2=function(n){return o(_(n).message)},t.wbg.__wbg_instanceof_Function_208feb37dc430eb3=function(n){let e;try{e=_(n)instanceof Function}catch{e=!1}return e},t.wbg.__wbg_apply_1c259fc7880fb101=function(){return a(function(n,e,r){return o(_(n).apply(_(e),_(r)))},arguments)},t.wbg.__wbg_call_53fc3abd42e24ec8=function(){return a(function(n,e,r){return o(_(n).call(_(e),_(r)))},arguments)},t.wbg.__wbg_toString_2c5d5b612e8bdd61=function(n){return o(_(n).toString())},t.wbg.__wbg_then_89e1c559530b85cf=function(n,e){return o(_(n).then(_(e)))},t.wbg.__wbg_set_dcfd613a3420f908=function(n,e,r){_(n).set(_(e),r>>>0)},t.wbg.__wbg_length_a5587d6cd79ab197=function(n){return _(n).length},t.wbg.__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1=function(n){let e;try{e=_(n)instanceof Uint8Array}catch{e=!1}return e},t.wbg.__wbg_subarray_6ca5cfa7fbb9abbe=function(n,e,r){return o(_(n).subarray(e>>>0,r>>>0))},t.wbg.__wbindgen_is_function=function(n){return typeof _(n)=="function"},t.wbg.__wbindgen_object_drop_ref=function(n){s(n)},t.wbg.__wbg_new_659d4bfe4e53c8ae=function(){return a(function(n,e){return o(new WebAssembly.Instance(_(n),_(e)))},arguments)},t.wbg.__wbg_new_756a04b324cd462c=function(){return a(function(n){return o(new WebAssembly.Module(_(n)))},arguments)},t.wbg.__wbg_get_3a1de47b76f3642e=function(){return a(function(n,e){return o(_(n).get(e>>>0))},arguments)},t.wbg.__wbg_new_61bdcb895f1f9b01=function(){return a(function(n){return o(new WebAssembly.Memory(_(n)))},arguments)},t.wbg.__wbg_self_3fad056edded10bd=function(){return a(function(){return o(self.self)},arguments)},t.wbg.__wbg_window_a4f46c98a61d4089=function(){return a(function(){return o(window.window)},arguments)},t.wbg.__wbg_globalThis_17eff828815f7d84=function(){return a(function(){return o(globalThis.globalThis)},arguments)},t.wbg.__wbg_global_46f939f6541643c5=function(){return a(function(){return o(global.global)},arguments)},t.wbg.__wbindgen_is_undefined=function(n){return _(n)===void 0},t.wbg.__wbg_newnoargs_ccdcae30fd002262=function(n,e){return o(new Function(m(n,e)))},t.wbg.__wbg_apply_2fa612c136e53eed=function(){return a(function(n,e,r){return o(Reflect.apply(_(n),_(e),_(r)))},arguments)},t.wbg.__wbg_get_2aff440840bb6202=function(){return a(function(n,e){return o(Reflect.get(_(n),_(e)))},arguments)},t.wbg.__wbg_set_40f7786a25a9cc7e=function(){return a(function(n,e,r){return Reflect.set(_(n),_(e),_(r))},arguments)},t.wbg.__wbindgen_error_new=function(n,e){return o(new Error(m(n,e)))},t.wbg.__wbindgen_bigint_get_as_i64=function(n,e){let r=_(e),i=typeof r=="bigint"?r:void 0;(R!==null&&R.buffer===c.memory.buffer||(R=new BigInt64Array(c.memory.buffer)),R)[n/8+1]=d(i)?BigInt(0):i,g()[n/4+0]=!d(i)},t.wbg.__wbindgen_debug_string=function(n,e){let r=l(I(_(e)),c.__wbindgen_malloc,c.__wbindgen_realloc),i=f;g()[n/4+1]=i,g()[n/4+0]=r},t.wbg.__wbindgen_throw=function(n,e){throw new Error(m(n,e))},t.wbg.__wbindgen_rethrow=function(n){throw s(n)},t.wbg.__wbg_data_624fd2b6a4a5ac9e=function(n){return o(_(n).data)},t.wbg.__wbg_queueMicrotask_e5949c35d772a669=function(n){queueMicrotask(_(n))},t.wbg.__wbg_waitAsync_97f529b0dd0d7452=function(){return o(Atomics.waitAsync)},t.wbg.__wbg_new_66e5e8bd4064378e=function(n){return o(new Int32Array(_(n)))},t.wbg.__wbg_waitAsync_ace259c87ea1cfde=function(n,e,r){return o(Atomics.waitAsync(_(n),e,r))},t.wbg.__wbg_async_3cebb9c3c0a8b6e9=function(n){return _(n).async},t.wbg.__wbg_value_9b4d17e7284427cc=function(n){return o(_(n).value)},t.wbg.__wbg_new_feb65b865d980ae2=function(n,e){try{var r={a:n,b:e};let i=new Promise((b,u)=>{let w=r.a;r.a=0;try{return function(p,h,y,O){c._ZN12wasm_bindgen7convert8closures11invoke2_mut17h0ec8afacbccd07f3E(p,h,o(y),o(O))}(w,r.b,b,u)}finally{r.a=w}});return o(i)}finally{r.a=r.b=0}},t.wbg.__wbindgen_link_cb9dda2f0af60c4f=function(n){let e=l("data:application/javascript,"+encodeURIComponent(`onmessage = function (ev) { - let [ia, index, value] = ev.data; - ia = new Int32Array(ia.buffer); - let result = Atomics.wait(ia, index, value); - postMessage(result); - }; - `),c.__wbindgen_malloc,c.__wbindgen_realloc),r=f;g()[n/4+1]=r,g()[n/4+0]=e},t.wbg.__wbg_new_db2f8178fe56090a=function(){return a(function(n,e){return o(new Worker(m(n,e)))},arguments)},t.wbg.__wbg_setonmessage_30ed48e1f5d26fee=function(n,e){_(n).onmessage=_(e)},t.wbg.__wbg_of_5b11b7255a230e4e=function(n,e,r){return o(Array.of(_(n),_(e),_(r)))},t.wbg.__wbg_queueMicrotask_2be8b97a81fe4d00=function(n){return o(_(n).queueMicrotask)},t.wbg.__wbg_resolve_a3252b2860f0a09e=function(n){return o(Promise.resolve(_(n)))},t.wbg.__wbg_then_1bbc9edafd859b06=function(n,e,r){return o(_(n).then(_(e),_(r)))},t.wbg.__wbindgen_cb_drop=function(n){let e=s(n).original;return e.cnt--==1?(e.a=0,!0):!1},t.wbg.__wbg_byteLength_8903f453a3a8a1df=function(n){return _(n).byteLength},t.wbg.__wbg_exports_287124f54574699c=function(n){return o(WebAssembly.Module.exports(_(n)))},t.wbg.__wbg_for_fe237e14961c3b46=function(n,e){return o(Symbol.for(m(n,e)))},t.wbg.__wbindgen_number_get=function(n,e){let r=_(e),i=typeof r=="number"?r:void 0;q()[n/8+1]=d(i)?0:i,g()[n/4+0]=!d(i)},t.wbg.__wbg_getPrototypeOf_efd9ac7664cb1602=function(){return a(function(n){return o(Reflect.getPrototypeOf(_(n)))},arguments)},t.wbg.__wbg_constructor_3f5002261d14fb30=function(n){return o(_(n).constructor)},t.wbg.__wbg_trap_new=function(n){return o(D.__wrap(n))},t.wbg.__wbg_value_442d6ccca6c89da5=function(n){return o(_(n).value)},t.wbg.__wbg_setvalue_d01c3234a2663552=function(n,e){_(n).value=_(e)},t.wbg.__wbg_instanceof_Error_9f5881c3c4149389=function(n){let e;try{e=_(n)instanceof Error}catch{e=!1}return e},t.wbg.__wbg_imports_849227f7280907ef=function(n){return o(WebAssembly.Module.imports(_(n)))},t.wbg.__wbg_instanceof_Object_3c95bd459efa5c3c=function(n){let e;try{e=_(n)instanceof Object}catch{e=!1}return e},t.wbg.__wbg_grow_51233537037b47cc=function(){return a(function(n,e){return _(n).grow(e>>>0)},arguments)},t.wbg.__wbg_instanceof_RangeError_dd0fad3a217d8897=function(n){let e;try{e=_(n)instanceof RangeError}catch{e=!1}return e},t.wbg.__wbg_buffer_b334b57bee6f611b=function(n){return o(_(n).buffer)},t.wbg.__wbg_send_a4612d3a60b1dbb4=function(){return a(function(n,e){_(n).send(_(e))},arguments)},t.wbg.__wbg_new_b9b318679315404f=function(){return a(function(n,e){return o(new WebSocket(m(n,e)))},arguments)},t.wbg.__wbg_setonopen_b2a170d59c1abe88=function(n,e){_(n).onopen=_(e)},t.wbg.__wbg_setonclose_4527668a5c065333=function(n,e){_(n).onclose=_(e)},t.wbg.__wbg_new_b71bf93085f9d631=function(){return a(function(){return o(new FileReader)},arguments)},t.wbg.__wbg_setonloadend_88fd301cd09da25d=function(n,e){_(n).onloadend=_(e)},t.wbg.__wbg_setbinaryType_dcb62e0f2b346301=function(n,e){_(n).binaryType=s(e)},t.wbg.__wbg_setonmessage_eb44f51ef6e7e0e8=function(n,e){_(n).onmessage=_(e)},t.wbg.__wbg_grow_f711696a8328da3c=function(n,e){return _(n).grow(e>>>0)},t.wbg.__wbg_hardwareConcurrency_b858ff012f3ad0fb=function(n){return _(n).hardwareConcurrency},t.wbg.__wbg_hardwareConcurrency_67b658b8df300eb5=function(n){return _(n).hardwareConcurrency},t.wbg.__wbg_isSafeInteger_c38b0a16d0c7cef7=function(n){return Number.isSafeInteger(_(n))},t.wbg.__wbindgen_jsval_loose_eq=function(n,e){return _(n)==_(e)},t.wbg.__wbindgen_boolean_get=function(n){let e=_(n);return typeof e=="boolean"?e?1:0:2},t.wbg.__wbindgen_is_bigint=function(n){return typeof _(n)=="bigint"},t.wbg.__wbindgen_bigint_from_u64=function(n){return o(BigInt.asUintN(64,n))},t.wbg.__wbindgen_jsval_eq=function(n,e){return _(n)===_(e)},t.wbg.__wbg_BigInt_9cc4d66dcbf0216e=function(n){return o(BigInt(_(n)))},t.wbg.__wbindgen_ge=function(n,e){return _(n)>=_(e)},t.wbg.__wbg_newwithu8arraysequenceandoptions_f520ece5c28a5211=function(){return a(function(n,e){return o(new Blob(_(n),_(e)))},arguments)},t.wbg.__wbg_createObjectURL_86955f30bbed45eb=function(){return a(function(n,e){let r=l(URL.createObjectURL(_(e)),c.__wbindgen_malloc,c.__wbindgen_realloc),i=f;g()[n/4+1]=i,g()[n/4+0]=r},arguments)},t.wbg.__wbg_terminate_159911c61944a361=function(n){_(n).terminate()},t.wbg.__wbg_lineno_4506d18a0b25cca2=function(n){return _(n).lineno},t.wbg.__wbg_colno_19ebfec79bfd789d=function(n){return _(n).colno},t.wbg.__wbg_assert_aa771cfef9582df7=function(n,e){console.assert(n!==0,_(e))},t.wbg.__wbg_new_abda76e883ba8a5f=function(){return o(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(n,e){let r=l(_(e).stack,c.__wbindgen_malloc,c.__wbindgen_realloc),i=f;g()[n/4+1]=i,g()[n/4+0]=r},t.wbg.__wbg_error_f851667af71bcfc6=function(n,e){let r,i;try{r=n,i=e,console.error(m(n,e))}finally{c.canonical_abi_free(r,i,1)}},t.wbg.__wbg_instanceof_TypeError_9282fd7df97806a0=function(n){let e;try{e=_(n)instanceof TypeError}catch{e=!1}return e},t.wbg.__wbg_wasmer_new=function(n){return o(x.__wrap(n))},t.wbg.__wbg_new_ab87fd305ed9004b=function(n,e){return o(new Error(m(n,e)))},t.wbg.__wbg_instance_new=function(n){return o(B.__wrap(n))},t.wbg.__wbg_read_55c1f4e3f3729816=function(n){return o(_(n).read())},t.wbg.__wbindgen_is_falsy=function(n){return!_(n)},t.wbg.__wbg_instanceof_Blob_bd674d851f2d730d=function(n){let e;try{e=_(n)instanceof Blob}catch{e=!1}return e},t.wbg.__wbg_readAsArrayBuffer_55965fe069b748b7=function(){return a(function(n,e){_(n).readAsArrayBuffer(_(e))},arguments)},t.wbg.__wbg_result_5e08da49132b9af2=function(){return a(function(n){return o(_(n).result)},arguments)},t.wbg.__wbg_instanceof_Module_7b9e1eae1becb87c=function(n){let e;try{e=_(n)instanceof WebAssembly.Module}catch{e=!1}return e},t.wbg.__wbg_static_accessor_IMPORT_META_URL_3be0dba93f76ed43=function(n){let e=l(J.url,c.__wbindgen_malloc,c.__wbindgen_realloc),r=f;g()[n/4+1]=r,g()[n/4+0]=e},t.wbg.__wbg_log_7811587c4c6d2844=function(n){console.log(_(n))},t.wbg.__wbg_byteLength_206a04415dea52a7=function(n){return _(n).byteLength},t.wbg.__wbg_instanceof_DedicatedWorkerGlobalScope_4cabe735c12f6f62=function(n){let e;try{e=_(n)instanceof DedicatedWorkerGlobalScope}catch{e=!1}return e},t.wbg.__wbg_postMessage_08d9966515d3437e=function(){return a(function(n,e){_(n).postMessage(_(e))},arguments)},t.wbg.__wbg_args_4d15d7afb42e284d=function(n){let e=_(n).args;return d(e)?0:o(e)},t.wbg.__wbg_env_ad8595f2986ecc88=function(n){return o(_(n).env)},t.wbg.__wbg_new_a8d206e6b5c455e8=function(n,e){return o(new TypeError(m(n,e)))},t.wbg.__wbg_mount_6bbd20e7e89111c6=function(n){return o(_(n).mount)},t.wbg.__wbg_stdin_00c789dbac01e87a=function(n){let e=_(n).stdin;return d(e)?0:o(e)},t.wbg.__wbg_command_new=function(n){return o(S.__wrap(n))},t.wbg.__wbg_registry_3c50a218bff1b9c2=function(n){let e=_(n).registry;return d(e)?0:o(e)},t.wbg.__wbindgen_is_null=function(n){return _(n)===null},t.wbg.__wbg_apiKey_45d9470ec7a59981=function(n,e){let r=_(e).apiKey;var i=d(r)?0:l(r,c.__wbindgen_malloc,c.__wbindgen_realloc),b=f;g()[n/4+1]=b,g()[n/4+0]=i},t.wbg.__wbg_networkGateway_19db657660e81113=function(n,e){let r=_(e).networkGateway;var i=d(r)?0:l(r,c.__wbindgen_malloc,c.__wbindgen_realloc),b=f;g()[n/4+1]=b,g()[n/4+0]=i},t.wbg.__wbg_program_86b0cb49d1fef987=function(n){return o(_(n).program)},t.wbg.__wbg_runtime_0041006d6e1bcee1=function(n){return o(_(n).runtime)},t.wbg.__wbg_instanceof_Window_cde2416cf5126a72=function(n){let e;try{e=_(n)instanceof Window}catch{e=!1}return e},t.wbg.__wbg_setTimeout_07866af1a1842093=function(){return a(function(n,e,r){return _(n).setTimeout(_(e),r)},arguments)},t.wbg.__wbg_setTimeout_a7009fb086494628=function(){return a(function(n,e,r){return _(n).setTimeout(_(e),r)},arguments)},t.wbg.__wbg_keys_1af6085b03973487=function(n){return o(Object.keys(_(n)))},t.wbg.__wbg_is_c74aa9bb973d6109=function(n,e){return Object.is(_(n),_(e))},t.wbg.__wbindgen_lt=function(n,e){return _(n)<_(e)},t.wbg.__wbg_writablestreamsink_new=function(n){return o($.__wrap(n))},t.wbg.__wbg_newwithunderlyingsinkandstrategy_58a8dd5a077a053a=function(){return a(function(n,e){return o(new WritableStream(_(n),_(e)))},arguments)},t.wbg.__wbg_readablestreamsource_new=function(n){return o(L.__wrap(n))},t.wbg.__wbg_newwithunderlyingsourceandstrategy_8918d0ac449d9312=function(){return a(function(n,e){return o(new ReadableStream(_(n),_(e)))},arguments)},t.wbg.__wbg_new_5db6ceb8aeeaf01c=function(){return a(function(n){return o(new ReadableStreamDefaultReader(_(n)))},arguments)},t.wbg.__wbg_releaseLock_9b69600b4df9a3e5=function(n){_(n).releaseLock()},t.wbg.__wbg_newwithoptions_648df56fc5ca57ca=function(){return a(function(n,e,r){return o(new Worker(m(n,e),_(r)))},arguments)},t.wbg.__wbg_setonerror_589ac13960a72e2a=function(n,e){_(n).onerror=_(e)},t.wbg.__wbindgen_module=function(){return o(C.__wbindgen_wasm_module)},t.wbg.__wbindgen_function_table=function(){return o(c.__wbindgen_export_3)},t.wbg.__wbg_bind_d7487121c7db1440=function(n,e,r,i){return o(_(n).bind(_(e),_(r),_(i)))},t.wbg.__wbg_exports_1ea13b1dd33137f1=function(n){return o(_(n).exports)},t.wbg.__wbg_instanceof_Global_1c3b64df1a5c886c=function(n){let e;try{e=_(n)instanceof WebAssembly.Global}catch{e=!1}return e},t.wbg.__wbg_instanceof_Table_f9bb0e6df370756a=function(n){let e;try{e=_(n)instanceof WebAssembly.Table}catch{e=!1}return e},t.wbg.__wbindgen_shr=function(n,e){return o(_(n)>>_(e))},t.wbg.__wbindgen_bigint_from_i64=function(n){return o(n)},t.wbg.__wbindgen_bigint_from_u128=function(n,e){return o(BigInt.asUintN(64,n)<Q(void 0,void 0,void 0,function*(){if(!t){let e="https://unpkg.com/@wasmer/sdk@0.6.0/dist/wasmer_js_bg.wasm";e&&(t=new URL(e))}return C(t,n)});globalThis.__WASMER_INTERNALS__={ThreadPoolWorker:U,init:z},globalThis.$RefreshReg$=globalThis.$RefreshReg$||function(){},globalThis.$RefreshSig$=globalThis.$RefreshSig$||function(){return function(){}};var an=({data:t})=>{let{code:n,args:e,input:r}=t;z(),x.fromRegistry("php/php").then(i=>{console.log(i.entrypoint),i.entrypoint.run({args:e.split(` -`).map(b=>b.trim())}).then(b=>{console.log(b),b.stdin.getWriter().write(r).then(()=>{b.wait().then(u=>{console.log(u),postMessage({type:"output",output:u.stdout}),postMessage({type:"output",error:u.stderr}),postMessage({type:"done"})})})})})};addEventListener("message",an);})(); -/*! Bundled license information: - -@wasmer/sdk/dist/WasmerSDK.js: - (*! - * @wasmer/sdk - * Isomorphic Javascript library for interacting with WASI Modules in Node.js and the Browser. - * - * @version v0.6.0 - * @author Wasmer Engineering Team - * @homepage https://github.com/wasmerio/wasmer-js - * @repository git+https://github.com/wasmerio/wasmer-js.git - * @license MIT - *) -*/ -//# sourceMappingURL=worker.js.map diff --git a/dist/js/langs/php-wasm/worker.js.map b/dist/js/langs/php-wasm/worker.js.map deleted file mode 100644 index 744cd57..0000000 --- a/dist/js/langs/php-wasm/worker.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../node_modules/@wasmer/sdk/dist/WasmerSDK.js", "../../../../js/langs/php-wasm/worker.ts"], - "sourcesContent": ["/*!\n * @wasmer/sdk\n * Isomorphic Javascript library for interacting with WASI Modules in Node.js and the Browser.\n *\n * @version v0.6.0\n * @author Wasmer Engineering Team \n * @homepage https://github.com/wasmerio/wasmer-js\n * @repository git+https://github.com/wasmerio/wasmer-js.git\n * @license MIT\n */\nfunction n(n,e,t,_){return new(t||(t=Promise))((function(r,o){function i(n){try{b(_.next(n))}catch(n){o(n)}}function c(n){try{b(_.throw(n))}catch(n){o(n)}}function b(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(i,c)}b((_=_.apply(n,e||[])).next())}))}let e;\"function\"==typeof SuppressedError&&SuppressedError;const t=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf-8\",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(\"TextDecoder not available\")}};\"undefined\"!=typeof TextDecoder&&t.decode();let _=null;function r(){return null!==_&&_.buffer===e.memory.buffer||(_=new Uint8Array(e.memory.buffer)),_}function o(n,e){return n>>>=0,t.decode(r().slice(n,n+e))}const i=new Array(128).fill(void 0);i.push(void 0,null,!0,!1);let c=i.length;function b(n){c===i.length&&i.push(i.length+1);const e=c;return c=i[e],i[e]=n,e}function a(n){return i[n]}let w=0;const u=\"undefined\"!=typeof TextEncoder?new TextEncoder(\"utf-8\"):{encode:()=>{throw Error(\"TextEncoder not available\")}},g=function(n,e){const t=u.encode(n);return e.set(t),{read:n.length,written:t.length}};function s(n,e,t){if(void 0===t){const t=u.encode(n),_=e(t.length,1)>>>0;return r().subarray(_,_+t.length).set(t),w=t.length,_}let _=n.length,o=e(_,1)>>>0;const i=r();let c=0;for(;c<_;c++){const e=n.charCodeAt(c);if(e>127)break;i[o+c]=e}if(c!==_){0!==c&&(n=n.slice(c)),o=t(o,_,_=c+3*n.length,1)>>>0;const e=r().subarray(o+c,o+_);c+=g(n,e).written}return w=c,o}function f(n){return null==n}let d=null;function l(){return null!==d&&d.buffer===e.memory.buffer||(d=new Int32Array(e.memory.buffer)),d}function y(n){const e=a(n);return function(n){n<132||(i[n]=c,c=n)}(n),e}let p=null;function m(n){const e=typeof n;if(\"number\"==e||\"boolean\"==e||null==n)return`${n}`;if(\"string\"==e)return`\"${n}\"`;if(\"symbol\"==e){const e=n.description;return null==e?\"Symbol\":`Symbol(${e})`}if(\"function\"==e){const e=n.name;return\"string\"==typeof e&&e.length>0?`Function(${e})`:\"Function\"}if(Array.isArray(n)){const e=n.length;let t=\"[\";e>0&&(t+=m(n[0]));for(let _=1;_1))return toString.call(n);if(_=t[1],\"Object\"==_)try{return\"Object(\"+JSON.stringify(n)+\")\"}catch(n){return\"Object\"}return n instanceof Error?`${n.name}: ${n.message}\\n${n.stack}`:_}let h=null;function v(){return null!==h&&h.buffer===e.memory.buffer||(h=new Float64Array(e.memory.buffer)),h}const A=new FinalizationRegistry((n=>{e.__wbindgen_export_3.get(n.dtor)(n.a,n.b)}));function k(n,t,_,r){const o={a:n,b:t,cnt:1,dtor:_},i=(...n)=>{o.cnt++;const t=o.a;o.a=0;try{return r(t,o.b,...n)}finally{0==--o.cnt?(e.__wbindgen_export_3.get(o.dtor)(t,o.b),A.unregister(o)):o.a=t}};return i.original=o,A.register(i,o,o),i}function R(n,t,_){e._ZN12wasm_bindgen7convert8closures11invoke1_mut17h39693afad0d92ad2E(n,t,b(_))}function T(n,t,_,r){const o={a:n,b:t,cnt:1,dtor:_},i=(...n)=>{o.cnt++;try{return r(o.a,o.b,...n)}finally{0==--o.cnt&&(e.__wbindgen_export_3.get(o.dtor)(o.a,o.b),o.a=0,A.unregister(o))}};return i.original=o,A.register(i,o,o),i}function W(n,t){return y(e._ZN129__LT_dyn_u20_core__ops__function__Fn_LT__LP__RP__GT__u2b_Output_u20__u3d__u20_R_u20_as_u20_wasm_bindgen__closure__WasmClosure_GT_8describe6invoke17h613009e110396e8aE(n,t))}function S(n,t,_){return e._ZN12wasm_bindgen7convert8closures7invoke117h27cd5385e9d886a8E(n,t,b(_))}function x(n,t){try{return n.apply(this,t)}catch(n){e.__wbindgen_exn_store(b(n))}}function F(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16),o=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),i=w;e.wat2wasm(r,o,i);var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return y(t)}finally{e.__wbindgen_add_to_stack_pointer(16)}}function E(){e.on_start()}function j(n){e.setWorkerUrl(b(n))}function O(n,t){return y(e.runWasix(b(n),b(t)))}function M(n){try{const o=e.__wbindgen_add_to_stack_pointer(-16);var t=f(n)?0:s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;e.initializeLogger(o,t,_);var r=l()[o/4+0];if(l()[o/4+1])throw y(r)}finally{e.__wbindgen_add_to_stack_pointer(16)}}const I=new FinalizationRegistry((n=>e.__wbg_command_free(n>>>0)));class U{static __wrap(n){n>>>=0;const e=Object.create(U.prototype);return e.__wbg_ptr=n,I.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,I.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_command_free(n)}get name(){return y(e.__wbg_get_command_name(this.__wbg_ptr))}set name(n){e.__wbg_set_command_name(this.__wbg_ptr,b(n))}run(n){return y(e.command_run(this.__wbg_ptr,f(n)?0:b(n)))}binary(){return y(e.command_binary(this.__wbg_ptr))}}const B=new FinalizationRegistry((n=>e.__wbg_directory_free(n>>>0)));class L{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,B.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_directory_free(n)}__getClassname(){let n,t;try{const i=e.__wbindgen_add_to_stack_pointer(-16);e.directory___getClassname(i,this.__wbg_ptr);var _=l()[i/4+0],r=l()[i/4+1];return n=_,t=r,o(_,r)}finally{e.__wbindgen_add_to_stack_pointer(16),e.canonical_abi_free(n,t,1)}}constructor(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.directory_new(r,f(n)?0:b(n));var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return this.__wbg_ptr=t>>>0,this}finally{e.__wbindgen_add_to_stack_pointer(16)}}readDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readDir(this.__wbg_ptr,t,_))}writeFile(n,t){const _=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;return y(e.directory_writeFile(this.__wbg_ptr,_,r,b(t)))}readFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readFile(this.__wbg_ptr,t,_))}readTextFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readTextFile(this.__wbg_ptr,t,_))}createDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_createDir(this.__wbg_ptr,t,_))}removeDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_removeDir(this.__wbg_ptr,t,_))}removeFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_removeFile(this.__wbg_ptr,t,_))}}const $=new FinalizationRegistry((n=>e.__wbg_instance_free(n>>>0)));class z{static __wrap(n){n>>>=0;const e=Object.create(z.prototype);return e.__wbg_ptr=n,$.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_instance_free(n)}get stdin(){return y(e.__wbg_get_instance_stdin(this.__wbg_ptr))}get stdout(){return y(e.__wbg_get_instance_stdout(this.__wbg_ptr))}get stderr(){return y(e.__wbg_get_instance_stderr(this.__wbg_ptr))}wait(){const n=this.__destroy_into_raw();return y(e.instance_wait(n))}}const D=new FinalizationRegistry((n=>e.__wbg_readablestreamsource_free(n>>>0)));class q{static __wrap(n){n>>>=0;const e=Object.create(q.prototype);return e.__wbg_ptr=n,D.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_readablestreamsource_free(n)}pull(n){return y(e.readablestreamsource_pull(this.__wbg_ptr,b(n)))}cancel(){e.readablestreamsource_cancel(this.__wbg_ptr)}get type(){return y(e.readablestreamsource_type(this.__wbg_ptr))}}const C=new FinalizationRegistry((n=>e.__wbg_runtime_free(n>>>0)));class N{static __wrap(n){n>>>=0;const e=Object.create(N.prototype);return e.__wbg_ptr=n,C.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,C.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_runtime_free(n)}__getClassname(){let n,t;try{const i=e.__wbindgen_add_to_stack_pointer(-16);e.runtime___getClassname(i,this.__wbg_ptr);var _=l()[i/4+0],r=l()[i/4+1];return n=_,t=r,o(_,r)}finally{e.__wbindgen_add_to_stack_pointer(16),e.canonical_abi_free(n,t,1)}}constructor(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.runtime_js_new(r,f(n)?0:b(n));var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return this.__wbg_ptr=t>>>0,this}finally{e.__wbindgen_add_to_stack_pointer(16)}}static global(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.runtime_global(r,f(n)?16777215:n?1:0);var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return 0===t?void 0:N.__wrap(t)}finally{e.__wbindgen_add_to_stack_pointer(16)}}}const P=new FinalizationRegistry((n=>e.__wbg_threadpoolworker_free(n>>>0)));class G{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_threadpoolworker_free(n)}constructor(n){const t=e.threadpoolworker_new(n);return this.__wbg_ptr=t>>>0,this}handle(n){return y(e.threadpoolworker_handle(this.__wbg_ptr,b(n)))}}const Z=new FinalizationRegistry((n=>e.__wbg_trap_free(n>>>0)));class K{static __wrap(n){n>>>=0;const e=Object.create(K.prototype);return e.__wbg_ptr=n,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_trap_free(n)}static __wbg_wasmer_trap(){e.trap___wbg_wasmer_trap()}}const V=new FinalizationRegistry((n=>e.__wbg_wasmer_free(n>>>0)));class J{static __wrap(n){n>>>=0;const e=Object.create(J.prototype);return e.__wbg_ptr=n,V.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_wasmer_free(n)}get entrypoint(){const n=e.__wbg_get_wasmer_entrypoint(this.__wbg_ptr);return 0===n?void 0:U.__wrap(n)}set entrypoint(n){let t=0;f(n)||(!function(n,e){if(!(n instanceof e))throw new Error(`expected instance of ${e.name}`);n.ptr}(n,U),t=n.__destroy_into_raw()),e.__wbg_set_wasmer_entrypoint(this.__wbg_ptr,t)}get commands(){return y(e.__wbg_get_instance_stdout(this.__wbg_ptr))}set commands(n){e.__wbg_set_wasmer_commands(this.__wbg_ptr,b(n))}static fromRegistry(n,t){const _=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;return y(e.wasmer_fromRegistry(_,r,f(t)?0:b(t)))}static fromFile(n,t){return y(e.wasmer_fromFile(b(n),f(t)?0:b(t)))}}const H=new FinalizationRegistry((n=>e.__wbg_writablestreamsink_free(n>>>0)));class Q{static __wrap(n){n>>>=0;const e=Object.create(Q.prototype);return e.__wbg_ptr=n,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_writablestreamsink_free(n)}close(){return y(e.writablestreamsink_close(this.__wbg_ptr))}abort(n){e.writablestreamsink_abort(this.__wbg_ptr,b(n))}write(n){return y(e.writablestreamsink_write(this.__wbg_ptr,b(n)))}}function X(){const n={wbg:{}};return n.wbg.__wbg_new_08236689f0afb357=function(){return b(new Array)},n.wbg.__wbindgen_string_new=function(n,e){return b(o(n,e))},n.wbg.__wbg_new_c728d68b8b34487e=function(){return b(new Object)},n.wbg.__wbg_push_fd3233d09cf81821=function(n,e){return a(n).push(a(e))},n.wbg.__wbindgen_string_get=function(n,t){const _=a(t),r=\"string\"==typeof _?_:void 0;var o=f(r)?0:s(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=w;l()[n/4+1]=i,l()[n/4+0]=o},n.wbg.__wbindgen_object_clone_ref=function(n){return b(a(n))},n.wbg.__wbg_uses_87ee8532bf7067c2=function(n){const e=a(n).uses;return f(e)?0:b(e)},n.wbg.__wbg_navigator_7078da62d92ff5ad=function(n){return b(a(n).navigator)},n.wbg.__wbg_userAgent_2c548c522dca04cc=function(){return x((function(n,t){const _=s(a(t).userAgent,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_navigator_471948d3d6e10344=function(n){return b(a(n).navigator)},n.wbg.__wbg_userAgent_ec264c118b1e619c=function(){return x((function(n,t){const _=s(a(t).userAgent,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_new_d8a000788389a31e=function(n){return b(new Uint8Array(a(n)))},n.wbg.__wbg_desiredSize_800f00fde6830467=function(n,e){const t=a(e).desiredSize;v()[n/8+1]=f(t)?0:t,l()[n/4+0]=!f(t)},n.wbg.__wbg_close_3217bacea9625e8a=function(){return x((function(n){a(n).close()}),arguments)},n.wbg.__wbg_enqueue_fe34f134be0ca1bd=function(){return x((function(n,e){a(n).enqueue(a(e))}),arguments)},n.wbg.__wbg_error_32bdd65121e5c58d=function(n,e){a(n).error(a(e))},n.wbg.__wbindgen_number_new=function(n){return b(n)},n.wbg.__wbg_defineProperty_acb855411a6a5b7c=function(n,e,t){return b(Object.defineProperty(a(n),a(e),a(t)))},n.wbg.__wbg_crypto_58f13aa23ffcb166=function(n){return b(a(n).crypto)},n.wbg.__wbg_process_5b786e71d465a513=function(n){return b(a(n).process)},n.wbg.__wbg_versions_c2ab80650590b6a2=function(n){return b(a(n).versions)},n.wbg.__wbg_node_523d7bd03ef69fba=function(n){return b(a(n).node)},n.wbg.__wbindgen_is_string=function(n){return\"string\"==typeof a(n)},n.wbg.__wbg_require_2784e593a4674877=function(){return x((function(){return b(module.require)}),arguments)},n.wbg.__wbg_msCrypto_abcb1295e768d1f2=function(n){return b(a(n).msCrypto)},n.wbg.__wbg_newwithlength_13b5319ab422dcf6=function(n){return b(new Uint8Array(n>>>0))},n.wbg.__wbindgen_is_object=function(n){const e=a(n);return\"object\"==typeof e&&null!==e},n.wbg.__wbindgen_memory=function(){return b(e.memory)},n.wbg.__wbg_buffer_344d9b41efe96da7=function(n){return b(a(n).buffer)},n.wbg.__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3=function(n,e,t){return b(new Uint8Array(a(n),e>>>0,t>>>0))},n.wbg.__wbg_randomFillSync_a0d98aa11c81fe89=function(){return x((function(n,e){a(n).randomFillSync(y(e))}),arguments)},n.wbg.__wbg_getRandomValues_504510b5564925af=function(){return x((function(n,e){a(n).getRandomValues(a(e))}),arguments)},n.wbg.__wbg_get_4a9aa5157afeb382=function(n,e){return b(a(n)[e>>>0])},n.wbg.__wbg_length_cace2e0b3ddc0502=function(n){return a(n).length},n.wbg.__wbg_call_669127b9d730c650=function(){return x((function(n,e){return b(a(n).call(a(e)))}),arguments)},n.wbg.__wbg_newwithlength_045c9df8a7cc3543=function(n){return b(new Array(n>>>0))},n.wbg.__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d=function(n){let e;try{e=a(n)instanceof ArrayBuffer}catch(n){e=!1}return e},n.wbg.__wbg_toString_1a5250f284c09c9e=function(n,t,_){const r=s(a(t).toString(_),e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_message_35f9b952e1b922e2=function(n){return b(a(n).message)},n.wbg.__wbg_instanceof_Function_208feb37dc430eb3=function(n){let e;try{e=a(n)instanceof Function}catch(n){e=!1}return e},n.wbg.__wbg_apply_1c259fc7880fb101=function(){return x((function(n,e,t){return b(a(n).apply(a(e),a(t)))}),arguments)},n.wbg.__wbg_call_53fc3abd42e24ec8=function(){return x((function(n,e,t){return b(a(n).call(a(e),a(t)))}),arguments)},n.wbg.__wbg_toString_2c5d5b612e8bdd61=function(n){return b(a(n).toString())},n.wbg.__wbg_then_89e1c559530b85cf=function(n,e){return b(a(n).then(a(e)))},n.wbg.__wbg_set_dcfd613a3420f908=function(n,e,t){a(n).set(a(e),t>>>0)},n.wbg.__wbg_length_a5587d6cd79ab197=function(n){return a(n).length},n.wbg.__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1=function(n){let e;try{e=a(n)instanceof Uint8Array}catch(n){e=!1}return e},n.wbg.__wbg_subarray_6ca5cfa7fbb9abbe=function(n,e,t){return b(a(n).subarray(e>>>0,t>>>0))},n.wbg.__wbindgen_is_function=function(n){return\"function\"==typeof a(n)},n.wbg.__wbindgen_object_drop_ref=function(n){y(n)},n.wbg.__wbg_new_659d4bfe4e53c8ae=function(){return x((function(n,e){return b(new WebAssembly.Instance(a(n),a(e)))}),arguments)},n.wbg.__wbg_new_756a04b324cd462c=function(){return x((function(n){return b(new WebAssembly.Module(a(n)))}),arguments)},n.wbg.__wbg_get_3a1de47b76f3642e=function(){return x((function(n,e){return b(a(n).get(e>>>0))}),arguments)},n.wbg.__wbg_new_61bdcb895f1f9b01=function(){return x((function(n){return b(new WebAssembly.Memory(a(n)))}),arguments)},n.wbg.__wbg_self_3fad056edded10bd=function(){return x((function(){return b(self.self)}),arguments)},n.wbg.__wbg_window_a4f46c98a61d4089=function(){return x((function(){return b(window.window)}),arguments)},n.wbg.__wbg_globalThis_17eff828815f7d84=function(){return x((function(){return b(globalThis.globalThis)}),arguments)},n.wbg.__wbg_global_46f939f6541643c5=function(){return x((function(){return b(global.global)}),arguments)},n.wbg.__wbindgen_is_undefined=function(n){return void 0===a(n)},n.wbg.__wbg_newnoargs_ccdcae30fd002262=function(n,e){return b(new Function(o(n,e)))},n.wbg.__wbg_apply_2fa612c136e53eed=function(){return x((function(n,e,t){return b(Reflect.apply(a(n),a(e),a(t)))}),arguments)},n.wbg.__wbg_get_2aff440840bb6202=function(){return x((function(n,e){return b(Reflect.get(a(n),a(e)))}),arguments)},n.wbg.__wbg_set_40f7786a25a9cc7e=function(){return x((function(n,e,t){return Reflect.set(a(n),a(e),a(t))}),arguments)},n.wbg.__wbindgen_error_new=function(n,e){return b(new Error(o(n,e)))},n.wbg.__wbindgen_bigint_get_as_i64=function(n,t){const _=a(t),r=\"bigint\"==typeof _?_:void 0;(null!==p&&p.buffer===e.memory.buffer||(p=new BigInt64Array(e.memory.buffer)),p)[n/8+1]=f(r)?BigInt(0):r,l()[n/4+0]=!f(r)},n.wbg.__wbindgen_debug_string=function(n,t){const _=s(m(a(t)),e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_},n.wbg.__wbindgen_throw=function(n,e){throw new Error(o(n,e))},n.wbg.__wbindgen_rethrow=function(n){throw y(n)},n.wbg.__wbg_data_624fd2b6a4a5ac9e=function(n){return b(a(n).data)},n.wbg.__wbg_queueMicrotask_e5949c35d772a669=function(n){queueMicrotask(a(n))},n.wbg.__wbg_waitAsync_97f529b0dd0d7452=function(){return b(Atomics.waitAsync)},n.wbg.__wbg_new_66e5e8bd4064378e=function(n){return b(new Int32Array(a(n)))},n.wbg.__wbg_waitAsync_ace259c87ea1cfde=function(n,e,t){return b(Atomics.waitAsync(a(n),e,t))},n.wbg.__wbg_async_3cebb9c3c0a8b6e9=function(n){return a(n).async},n.wbg.__wbg_value_9b4d17e7284427cc=function(n){return b(a(n).value)},n.wbg.__wbg_new_feb65b865d980ae2=function(n,t){try{var _={a:n,b:t};const r=new Promise(((n,t)=>{const r=_.a;_.a=0;try{return function(n,t,_,r){e._ZN12wasm_bindgen7convert8closures11invoke2_mut17h0ec8afacbccd07f3E(n,t,b(_),b(r))}(r,_.b,n,t)}finally{_.a=r}}));return b(r)}finally{_.a=_.b=0}},n.wbg.__wbindgen_link_cb9dda2f0af60c4f=function(n){const t=s(\"data:application/javascript,\"+encodeURIComponent(\"onmessage = function (ev) {\\n let [ia, index, value] = ev.data;\\n ia = new Int32Array(ia.buffer);\\n let result = Atomics.wait(ia, index, value);\\n postMessage(result);\\n };\\n \"),e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;l()[n/4+1]=_,l()[n/4+0]=t},n.wbg.__wbg_new_db2f8178fe56090a=function(){return x((function(n,e){return b(new Worker(o(n,e)))}),arguments)},n.wbg.__wbg_setonmessage_30ed48e1f5d26fee=function(n,e){a(n).onmessage=a(e)},n.wbg.__wbg_of_5b11b7255a230e4e=function(n,e,t){return b(Array.of(a(n),a(e),a(t)))},n.wbg.__wbg_queueMicrotask_2be8b97a81fe4d00=function(n){return b(a(n).queueMicrotask)},n.wbg.__wbg_resolve_a3252b2860f0a09e=function(n){return b(Promise.resolve(a(n)))},n.wbg.__wbg_then_1bbc9edafd859b06=function(n,e,t){return b(a(n).then(a(e),a(t)))},n.wbg.__wbindgen_cb_drop=function(n){const e=y(n).original;if(1==e.cnt--)return e.a=0,!0;return!1},n.wbg.__wbg_byteLength_8903f453a3a8a1df=function(n){return a(n).byteLength},n.wbg.__wbg_exports_287124f54574699c=function(n){return b(WebAssembly.Module.exports(a(n)))},n.wbg.__wbg_for_fe237e14961c3b46=function(n,e){return b(Symbol.for(o(n,e)))},n.wbg.__wbindgen_number_get=function(n,e){const t=a(e),_=\"number\"==typeof t?t:void 0;v()[n/8+1]=f(_)?0:_,l()[n/4+0]=!f(_)},n.wbg.__wbg_getPrototypeOf_efd9ac7664cb1602=function(){return x((function(n){return b(Reflect.getPrototypeOf(a(n)))}),arguments)},n.wbg.__wbg_constructor_3f5002261d14fb30=function(n){return b(a(n).constructor)},n.wbg.__wbg_trap_new=function(n){return b(K.__wrap(n))},n.wbg.__wbg_value_442d6ccca6c89da5=function(n){return b(a(n).value)},n.wbg.__wbg_setvalue_d01c3234a2663552=function(n,e){a(n).value=a(e)},n.wbg.__wbg_instanceof_Error_9f5881c3c4149389=function(n){let e;try{e=a(n)instanceof Error}catch(n){e=!1}return e},n.wbg.__wbg_imports_849227f7280907ef=function(n){return b(WebAssembly.Module.imports(a(n)))},n.wbg.__wbg_instanceof_Object_3c95bd459efa5c3c=function(n){let e;try{e=a(n)instanceof Object}catch(n){e=!1}return e},n.wbg.__wbg_grow_51233537037b47cc=function(){return x((function(n,e){return a(n).grow(e>>>0)}),arguments)},n.wbg.__wbg_instanceof_RangeError_dd0fad3a217d8897=function(n){let e;try{e=a(n)instanceof RangeError}catch(n){e=!1}return e},n.wbg.__wbg_buffer_b334b57bee6f611b=function(n){return b(a(n).buffer)},n.wbg.__wbg_send_a4612d3a60b1dbb4=function(){return x((function(n,e){a(n).send(a(e))}),arguments)},n.wbg.__wbg_new_b9b318679315404f=function(){return x((function(n,e){return b(new WebSocket(o(n,e)))}),arguments)},n.wbg.__wbg_setonopen_b2a170d59c1abe88=function(n,e){a(n).onopen=a(e)},n.wbg.__wbg_setonclose_4527668a5c065333=function(n,e){a(n).onclose=a(e)},n.wbg.__wbg_new_b71bf93085f9d631=function(){return x((function(){return b(new FileReader)}),arguments)},n.wbg.__wbg_setonloadend_88fd301cd09da25d=function(n,e){a(n).onloadend=a(e)},n.wbg.__wbg_setbinaryType_dcb62e0f2b346301=function(n,e){a(n).binaryType=y(e)},n.wbg.__wbg_setonmessage_eb44f51ef6e7e0e8=function(n,e){a(n).onmessage=a(e)},n.wbg.__wbg_grow_f711696a8328da3c=function(n,e){return a(n).grow(e>>>0)},n.wbg.__wbg_hardwareConcurrency_b858ff012f3ad0fb=function(n){return a(n).hardwareConcurrency},n.wbg.__wbg_hardwareConcurrency_67b658b8df300eb5=function(n){return a(n).hardwareConcurrency},n.wbg.__wbg_isSafeInteger_c38b0a16d0c7cef7=function(n){return Number.isSafeInteger(a(n))},n.wbg.__wbindgen_jsval_loose_eq=function(n,e){return a(n)==a(e)},n.wbg.__wbindgen_boolean_get=function(n){const e=a(n);return\"boolean\"==typeof e?e?1:0:2},n.wbg.__wbindgen_is_bigint=function(n){return\"bigint\"==typeof a(n)},n.wbg.__wbindgen_bigint_from_u64=function(n){return b(BigInt.asUintN(64,n))},n.wbg.__wbindgen_jsval_eq=function(n,e){return a(n)===a(e)},n.wbg.__wbg_BigInt_9cc4d66dcbf0216e=function(n){return b(BigInt(a(n)))},n.wbg.__wbindgen_ge=function(n,e){return a(n)>=a(e)},n.wbg.__wbg_newwithu8arraysequenceandoptions_f520ece5c28a5211=function(){return x((function(n,e){return b(new Blob(a(n),a(e)))}),arguments)},n.wbg.__wbg_createObjectURL_86955f30bbed45eb=function(){return x((function(n,t){const _=s(URL.createObjectURL(a(t)),e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_terminate_159911c61944a361=function(n){a(n).terminate()},n.wbg.__wbg_lineno_4506d18a0b25cca2=function(n){return a(n).lineno},n.wbg.__wbg_colno_19ebfec79bfd789d=function(n){return a(n).colno},n.wbg.__wbg_assert_aa771cfef9582df7=function(n,e){console.assert(0!==n,a(e))},n.wbg.__wbg_new_abda76e883ba8a5f=function(){return b(new Error)},n.wbg.__wbg_stack_658279fe44541cf6=function(n,t){const _=s(a(t).stack,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_},n.wbg.__wbg_error_f851667af71bcfc6=function(n,t){let _,r;try{_=n,r=t,console.error(o(n,t))}finally{e.canonical_abi_free(_,r,1)}},n.wbg.__wbg_instanceof_TypeError_9282fd7df97806a0=function(n){let e;try{e=a(n)instanceof TypeError}catch(n){e=!1}return e},n.wbg.__wbg_wasmer_new=function(n){return b(J.__wrap(n))},n.wbg.__wbg_new_ab87fd305ed9004b=function(n,e){return b(new Error(o(n,e)))},n.wbg.__wbg_instance_new=function(n){return b(z.__wrap(n))},n.wbg.__wbg_read_55c1f4e3f3729816=function(n){return b(a(n).read())},n.wbg.__wbindgen_is_falsy=function(n){return!a(n)},n.wbg.__wbg_instanceof_Blob_bd674d851f2d730d=function(n){let e;try{e=a(n)instanceof Blob}catch(n){e=!1}return e},n.wbg.__wbg_readAsArrayBuffer_55965fe069b748b7=function(){return x((function(n,e){a(n).readAsArrayBuffer(a(e))}),arguments)},n.wbg.__wbg_result_5e08da49132b9af2=function(){return x((function(n){return b(a(n).result)}),arguments)},n.wbg.__wbg_instanceof_Module_7b9e1eae1becb87c=function(n){let e;try{e=a(n)instanceof WebAssembly.Module}catch(n){e=!1}return e},n.wbg.__wbg_static_accessor_IMPORT_META_URL_3be0dba93f76ed43=function(n){const t=s(import.meta.url,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;l()[n/4+1]=_,l()[n/4+0]=t},n.wbg.__wbg_log_7811587c4c6d2844=function(n){console.log(a(n))},n.wbg.__wbg_byteLength_206a04415dea52a7=function(n){return a(n).byteLength},n.wbg.__wbg_instanceof_DedicatedWorkerGlobalScope_4cabe735c12f6f62=function(n){let e;try{e=a(n)instanceof DedicatedWorkerGlobalScope}catch(n){e=!1}return e},n.wbg.__wbg_postMessage_08d9966515d3437e=function(){return x((function(n,e){a(n).postMessage(a(e))}),arguments)},n.wbg.__wbg_args_4d15d7afb42e284d=function(n){const e=a(n).args;return f(e)?0:b(e)},n.wbg.__wbg_env_ad8595f2986ecc88=function(n){return b(a(n).env)},n.wbg.__wbg_new_a8d206e6b5c455e8=function(n,e){return b(new TypeError(o(n,e)))},n.wbg.__wbg_mount_6bbd20e7e89111c6=function(n){return b(a(n).mount)},n.wbg.__wbg_stdin_00c789dbac01e87a=function(n){const e=a(n).stdin;return f(e)?0:b(e)},n.wbg.__wbg_command_new=function(n){return b(U.__wrap(n))},n.wbg.__wbg_registry_3c50a218bff1b9c2=function(n){const e=a(n).registry;return f(e)?0:b(e)},n.wbg.__wbindgen_is_null=function(n){return null===a(n)},n.wbg.__wbg_apiKey_45d9470ec7a59981=function(n,t){const _=a(t).apiKey;var r=f(_)?0:s(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_networkGateway_19db657660e81113=function(n,t){const _=a(t).networkGateway;var r=f(_)?0:s(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_program_86b0cb49d1fef987=function(n){return b(a(n).program)},n.wbg.__wbg_runtime_0041006d6e1bcee1=function(n){return b(a(n).runtime)},n.wbg.__wbg_instanceof_Window_cde2416cf5126a72=function(n){let e;try{e=a(n)instanceof Window}catch(n){e=!1}return e},n.wbg.__wbg_setTimeout_07866af1a1842093=function(){return x((function(n,e,t){return a(n).setTimeout(a(e),t)}),arguments)},n.wbg.__wbg_setTimeout_a7009fb086494628=function(){return x((function(n,e,t){return a(n).setTimeout(a(e),t)}),arguments)},n.wbg.__wbg_keys_1af6085b03973487=function(n){return b(Object.keys(a(n)))},n.wbg.__wbg_is_c74aa9bb973d6109=function(n,e){return Object.is(a(n),a(e))},n.wbg.__wbindgen_lt=function(n,e){return a(n)>a(e))},n.wbg.__wbindgen_bigint_from_i64=function(n){return b(n)},n.wbg.__wbindgen_bigint_from_u128=function(n,e){return b(BigInt.asUintN(64,n)<n(void 0,void 0,void 0,(function*(){if(!e){let n=\"https://unpkg.com/@wasmer/sdk@0.6.0/dist/wasmer_js_bg.wasm\";n&&(e=new URL(n))}return tn(e,t)})),rn=()=>{let n=\"https://unpkg.com/@wasmer/sdk@0.6.0/dist/WasmerSDK.js\";n&&j(n)};globalThis.__WASMER_INTERNALS__={ThreadPoolWorker:G,init:_n},globalThis.$RefreshReg$=globalThis.$RefreshReg$||function(){},globalThis.$RefreshSig$=globalThis.$RefreshSig$||function(){return function(){}};export{U as Command,L as Directory,z as Instance,q as ReadableStreamSource,N as Runtime,G as ThreadPoolWorker,K as Trap,J as Wasmer,Q as WritableStreamSink,_n as init,en as initSync,M as initializeLogger,E as on_start,O as runWasix,rn as setDefaultWorkerUrl,j as setWorkerUrl,F as wat2wasm};\n", "import { init, Wasmer } from '@wasmer/sdk';\n\n// let PhpWeb = null,\n// attempt = 0;\n//\n\nconst handler = ({\n data,\n}: {\n data: { code: number[]; args: string; input: string };\n}) => {\n const { code, args, input } = data;\n\n init(); //.then(() =>\n Wasmer.fromRegistry('php/php').then((php) => {\n console.log(php.entrypoint);\n\n php.entrypoint\n .run({\n args: args.split('\\n').map((arg) => arg.trim()),\n })\n .then((instance) => {\n console.log(instance);\n\n instance.stdin\n .getWriter()\n .write(input)\n .then(() => {\n instance.wait().then((output) => {\n console.log(output);\n\n postMessage({\n type: 'output',\n output: output.stdout,\n });\n\n postMessage({\n type: 'output',\n error: output.stderr,\n });\n\n postMessage({\n type: 'done',\n });\n });\n });\n });\n });\n // );\n\n // if (PhpWeb === null) {\n // if (attempt++ > 99) {\n // throw new Error('PhpWeb not available, retried 100 times.');\n // }\n //\n // setTimeout(() => handler({ data }), 50);\n //\n // return;\n // }\n //\n // // TODO: check 'type' param too...\n // const { code, args, input } = data;\n //\n // attempt = 0;\n //\n // const php = new PhpWeb({\n // arguments: args,\n // // stdout: (...args) => {\n // // console.log(args);\n // //\n // // const [byte] = args;\n // //\n // // postMessage({\n // // type: 'output',\n // // output: String.fromCharCode(byte),\n // // });\n // // },\n // // stderr: (byte) =>\n // // postMessage({\n // // type: 'output',\n // // error: String.fromCharCode(byte),\n // // }),\n // });\n //\n // php.addEventListener('output', (event) => {\n // const { detail } = event;\n //\n // console.log(event);\n //\n // postMessage({\n // type: 'output',\n // content: detail,\n // });\n // });\n //\n // php.addEventListener('error', ({ detail }) => {\n // postMessage({\n // type: 'output',\n // error: detail,\n // });\n // });\n //\n // php.input(input.split('\\n'));\n //\n // php.addEventListener('ready', () => {\n // let codeAsString = code.reduce(\n // (s, char) => s + String.fromCharCode(char),\n // ''\n // );\n //\n // if (args.includes('-R')) {\n // codeAsString = ` {\n // console.log(result);\n // postMessage({\n // type: 'done',\n // });\n // });\n // });\n};\n\naddEventListener('message', handler);\n"], - "mappings": "MAAA,IAAAA,EAAA,GAUA,SAASC,EAAEA,EAAEC,EAAEC,EAAEC,EAAE,CAAC,OAAO,IAAID,IAAIA,EAAE,UAAW,SAASE,EAAEC,EAAE,CAAC,SAASC,EAAEN,EAAE,CAAC,GAAG,CAACO,EAAEJ,EAAE,KAAKH,CAAC,CAAC,CAAC,OAAOA,EAAE,CAACK,EAAEL,CAAC,CAAC,CAAC,CAAC,SAASQ,EAAER,EAAE,CAAC,GAAG,CAACO,EAAEJ,EAAE,MAAMH,CAAC,CAAC,CAAC,OAAOA,EAAE,CAACK,EAAEL,CAAC,CAAC,CAAC,CAAC,SAASO,EAAEP,EAAE,CAAC,IAAIC,EAAED,EAAE,KAAKI,EAAEJ,EAAE,KAAK,GAAGC,EAAED,EAAE,MAAMC,aAAaC,EAAED,EAAE,IAAIC,EAAG,SAASF,EAAE,CAACA,EAAEC,CAAC,CAAC,CAAE,GAAG,KAAKK,EAAEE,CAAC,CAAC,CAACD,GAAGJ,EAAEA,EAAE,MAAMH,EAAEC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,IAAIA,EAAsD,IAAMQ,EAAe,OAAO,YAApB,IAAgC,IAAI,YAAY,QAAQ,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,MAAM,MAAM,2BAA2B,CAAC,CAAC,EAAe,OAAO,YAApB,KAAiCA,EAAE,OAAO,EAAE,IAAIC,EAAE,KAAK,SAASC,GAAG,CAAC,OAAcD,IAAP,MAAUA,EAAE,SAASE,EAAE,OAAO,SAASF,EAAE,IAAI,WAAWE,EAAE,OAAO,MAAM,GAAGF,CAAC,CAAC,SAASG,EAAEC,EAAEF,EAAE,CAAC,OAAOE,KAAK,EAAEL,EAAE,OAAOE,EAAE,EAAE,MAAMG,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E,KAAKC,CAAE,EAAE,WAAW,aAAa,WAAW,cAAc,UAAU,CAAC,EAAE,WAAW,aAAa,WAAW,cAAc,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,ECJ9sgC,IAAMC,GAAU,CAAC,CACf,KAAAC,CACF,IAEM,CACJ,GAAM,CAAE,KAAAC,EAAM,KAAAC,EAAM,MAAAC,CAAM,EAAIH,EAE9BI,EAAK,EACLC,EAAO,aAAa,SAAS,EAAE,KAAMC,GAAQ,CAC3C,QAAQ,IAAIA,EAAI,UAAU,EAE1BA,EAAI,WACD,IAAI,CACH,KAAMJ,EAAK,MAAM;AAAA,CAAI,EAAE,IAAKK,GAAQA,EAAI,KAAK,CAAC,CAChD,CAAC,EACA,KAAMC,GAAa,CAClB,QAAQ,IAAIA,CAAQ,EAEpBA,EAAS,MACN,UAAU,EACV,MAAML,CAAK,EACX,KAAK,IAAM,CACVK,EAAS,KAAK,EAAE,KAAMC,GAAW,CAC/B,QAAQ,IAAIA,CAAM,EAElB,YAAY,CACV,KAAM,SACN,OAAQA,EAAO,MACjB,CAAC,EAED,YAAY,CACV,KAAM,SACN,MAAOA,EAAO,MAChB,CAAC,EAED,YAAY,CACV,KAAM,MACR,CAAC,CACH,CAAC,CACH,CAAC,CACL,CAAC,CACL,CAAC,CA4EH,EAEA,iBAAiB,UAAWV,EAAO", - "names": ["import_meta", "n", "e", "t", "_", "r", "o", "i", "b", "c", "t", "_", "r", "e", "o", "n", "i", "c", "b", "a", "w", "u", "g", "s", "f", "d", "l", "y", "p", "m", "h", "v", "A", "k", "R", "T", "W", "S", "x", "I", "n", "e", "U", "_U", "y", "b", "f", "B", "$", "n", "e", "z", "_z", "y", "D", "q", "_q", "b", "C", "P", "n", "e", "G", "t", "y", "b", "Z", "K", "_K", "V", "J", "_J", "U", "f", "_", "s", "r", "w", "Q", "_Q", "X", "o", "a", "i", "l", "x", "v", "p", "m", "z", "import_meta", "q", "tn", "k", "R", "T", "W", "S", "Y", "nn", "h", "d", "tn", "n", "t", "e", "import_meta", "_", "X", "Y", "o", "nn", "_n", "G", "_n", "handler", "data", "code", "args", "input", "_n", "J", "php", "arg", "instance", "output"] -} diff --git a/dist/js/langs/python-wasmer/worker.js b/dist/js/langs/python-wasmer/worker.js index ff258b6..bd6dd5e 100644 --- a/dist/js/langs/python-wasmer/worker.js +++ b/dist/js/langs/python-wasmer/worker.js @@ -1,12 +1,12 @@ -(()=>{var tn={};function _n(t,n,e,r){return new(e||(e=Promise))(function(c,b){function g(p){try{y(r.next(p))}catch(h){b(h)}}function s(p){try{y(r.throw(p))}catch(h){b(h)}}function y(p){var h;p.done?c(p.value):(h=p.value,h instanceof e?h:new e(function(I){I(h)})).then(g,s)}y((r=r.apply(t,n||[])).next())})}var i;var X=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&X.decode();var k=null;function j(){return k!==null&&k.buffer===i.memory.buffer||(k=new Uint8Array(i.memory.buffer)),k}function m(t,n){return t>>>=0,X.decode(j().slice(t,t+n))}var v=new Array(128).fill(void 0);v.push(void 0,null,!0,!1);var W=v.length;function o(t){W===v.length&&v.push(v.length+1);let n=W;return W=v[n],v[n]=t,n}function _(t){return v[t]}var f=0,Y=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},rn=function(t,n){let e=Y.encode(t);return n.set(e),{read:t.length,written:e.length}};function d(t,n,e){if(e===void 0){let s=Y.encode(t),y=n(s.length,1)>>>0;return j().subarray(y,y+s.length).set(s),f=s.length,y}let r=t.length,c=n(r,1)>>>0,b=j(),g=0;for(;g127)break;b[c+g]=s}if(g!==r){g!==0&&(t=t.slice(g)),c=e(c,r,r=g+3*t.length,1)>>>0;let s=j().subarray(c+g,c+r);g+=rn(t,s).written}return f=g,c}function l(t){return t==null}var A=null;function u(){return A!==null&&A.buffer===i.memory.buffer||(A=new Int32Array(i.memory.buffer)),A}function w(t){let n=_(t);return function(e){e<132||(v[e]=W,W=e)}(t),n}var R=null;function U(t){let n=typeof t;if(n=="number"||n=="boolean"||t==null)return`${t}`;if(n=="string")return`"${t}"`;if(n=="symbol"){let c=t.description;return c==null?"Symbol":`Symbol(${c})`}if(n=="function"){let c=t.name;return typeof c=="string"&&c.length>0?`Function(${c})`:"Function"}if(Array.isArray(t)){let c=t.length,b="[";c>0&&(b+=U(t[0]));for(let g=1;g1))return toString.call(t);if(r=e[1],r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} -${t.stack}`:r}var T=null;function P(){return T!==null&&T.buffer===i.memory.buffer||(T=new Float64Array(i.memory.buffer)),T}var M=new FinalizationRegistry(t=>{i.__wbindgen_export_3.get(t.dtor)(t.a,t.b)});function E(t,n,e,r){let c={a:t,b:n,cnt:1,dtor:e},b=(...g)=>{c.cnt++;let s=c.a;c.a=0;try{return r(s,c.b,...g)}finally{--c.cnt==0?(i.__wbindgen_export_3.get(c.dtor)(s,c.b),M.unregister(c)):c.a=s}};return b.original=c,M.register(b,c,c),b}function F(t,n,e){i._ZN12wasm_bindgen7convert8closures11invoke1_mut17h39693afad0d92ad2E(t,n,o(e))}function q(t,n,e,r){let c={a:t,b:n,cnt:1,dtor:e},b=(...g)=>{c.cnt++;try{return r(c.a,c.b,...g)}finally{--c.cnt==0&&(i.__wbindgen_export_3.get(c.dtor)(c.a,c.b),c.a=0,M.unregister(c))}};return b.original=c,M.register(b,c,c),b}function on(t,n){return w(i._ZN129__LT_dyn_u20_core__ops__function__Fn_LT__LP__RP__GT__u2b_Output_u20__u3d__u20_R_u20_as_u20_wasm_bindgen__closure__WasmClosure_GT_8describe6invoke17h613009e110396e8aE(t,n))}function cn(t,n,e){return i._ZN12wasm_bindgen7convert8closures7invoke117h27cd5385e9d886a8E(t,n,o(e))}function a(t,n){try{return t.apply(this,n)}catch(e){i.__wbindgen_exn_store(o(e))}}var N=new FinalizationRegistry(t=>i.__wbg_command_free(t>>>0)),S=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,N.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_command_free(n)}get name(){return w(i.__wbg_get_command_name(this.__wbg_ptr))}set name(n){i.__wbg_set_command_name(this.__wbg_ptr,o(n))}run(n){return w(i.command_run(this.__wbg_ptr,l(n)?0:o(n)))}binary(){return w(i.command_binary(this.__wbg_ptr))}},an=new FinalizationRegistry(t=>i.__wbg_directory_free(t>>>0)),O=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,an.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_directory_free(n)}__getClassname(){let n,e;try{let b=i.__wbindgen_add_to_stack_pointer(-16);i.directory___getClassname(b,this.__wbg_ptr);var r=u()[b/4+0],c=u()[b/4+1];return n=r,e=c,m(r,c)}finally{i.__wbindgen_add_to_stack_pointer(16),i.canonical_abi_free(n,e,1)}}constructor(n){try{let c=i.__wbindgen_add_to_stack_pointer(-16);i.directory_new(c,l(n)?0:o(n));var e=u()[c/4+0],r=u()[c/4+1];if(u()[c/4+2])throw w(r);return this.__wbg_ptr=e>>>0,this}finally{i.__wbindgen_add_to_stack_pointer(16)}}readDir(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_readDir(this.__wbg_ptr,e,r))}writeFile(n,e){let r=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;return w(i.directory_writeFile(this.__wbg_ptr,r,c,o(e)))}readFile(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_readFile(this.__wbg_ptr,e,r))}readTextFile(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_readTextFile(this.__wbg_ptr,e,r))}createDir(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_createDir(this.__wbg_ptr,e,r))}removeDir(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_removeDir(this.__wbg_ptr,e,r))}removeFile(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_removeFile(this.__wbg_ptr,e,r))}},G=new FinalizationRegistry(t=>i.__wbg_instance_free(t>>>0)),B=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,G.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_instance_free(n)}get stdin(){return w(i.__wbg_get_instance_stdin(this.__wbg_ptr))}get stdout(){return w(i.__wbg_get_instance_stdout(this.__wbg_ptr))}get stderr(){return w(i.__wbg_get_instance_stderr(this.__wbg_ptr))}wait(){let n=this.__destroy_into_raw();return w(i.instance_wait(n))}},Z=new FinalizationRegistry(t=>i.__wbg_readablestreamsource_free(t>>>0)),D=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_readablestreamsource_free(n)}pull(n){return w(i.readablestreamsource_pull(this.__wbg_ptr,o(n)))}cancel(){i.readablestreamsource_cancel(this.__wbg_ptr)}get type(){return w(i.readablestreamsource_type(this.__wbg_ptr))}},wn=new FinalizationRegistry(t=>i.__wbg_runtime_free(t>>>0));var bn=new FinalizationRegistry(t=>i.__wbg_threadpoolworker_free(t>>>0)),L=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,bn.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_threadpoolworker_free(n)}constructor(n){let e=i.threadpoolworker_new(n);return this.__wbg_ptr=e>>>0,this}handle(n){return w(i.threadpoolworker_handle(this.__wbg_ptr,o(n)))}},V=new FinalizationRegistry(t=>i.__wbg_trap_free(t>>>0)),$=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,V.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_trap_free(n)}static __wbg_wasmer_trap(){i.trap___wbg_wasmer_trap()}},K=new FinalizationRegistry(t=>i.__wbg_wasmer_free(t>>>0)),x=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,K.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_wasmer_free(n)}get entrypoint(){let n=i.__wbg_get_wasmer_entrypoint(this.__wbg_ptr);return n===0?void 0:S.__wrap(n)}set entrypoint(n){let e=0;l(n)||(function(r,c){if(!(r instanceof c))throw new Error(`expected instance of ${c.name}`);r.ptr}(n,S),e=n.__destroy_into_raw()),i.__wbg_set_wasmer_entrypoint(this.__wbg_ptr,e)}get commands(){return w(i.__wbg_get_instance_stdout(this.__wbg_ptr))}set commands(n){i.__wbg_set_wasmer_commands(this.__wbg_ptr,o(n))}static fromRegistry(n,e){let r=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;return w(i.wasmer_fromRegistry(r,c,l(e)?0:o(e)))}static fromFile(n,e){return w(i.wasmer_fromFile(o(n),l(e)?0:o(e)))}},H=new FinalizationRegistry(t=>i.__wbg_writablestreamsink_free(t>>>0)),C=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_writablestreamsink_free(n)}close(){return w(i.writablestreamsink_close(this.__wbg_ptr))}abort(n){i.writablestreamsink_abort(this.__wbg_ptr,o(n))}write(n){return w(i.writablestreamsink_write(this.__wbg_ptr,o(n)))}};function J(){let t={wbg:{}};return t.wbg.__wbg_new_08236689f0afb357=function(){return o(new Array)},t.wbg.__wbindgen_string_new=function(n,e){return o(m(n,e))},t.wbg.__wbg_new_c728d68b8b34487e=function(){return o(new Object)},t.wbg.__wbg_push_fd3233d09cf81821=function(n,e){return _(n).push(_(e))},t.wbg.__wbindgen_string_get=function(n,e){let r=_(e),c=typeof r=="string"?r:void 0;var b=l(c)?0:d(c,i.__wbindgen_malloc,i.__wbindgen_realloc),g=f;u()[n/4+1]=g,u()[n/4+0]=b},t.wbg.__wbindgen_object_clone_ref=function(n){return o(_(n))},t.wbg.__wbg_uses_87ee8532bf7067c2=function(n){let e=_(n).uses;return l(e)?0:o(e)},t.wbg.__wbg_navigator_7078da62d92ff5ad=function(n){return o(_(n).navigator)},t.wbg.__wbg_userAgent_2c548c522dca04cc=function(){return a(function(n,e){let r=d(_(e).userAgent,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},arguments)},t.wbg.__wbg_navigator_471948d3d6e10344=function(n){return o(_(n).navigator)},t.wbg.__wbg_userAgent_ec264c118b1e619c=function(){return a(function(n,e){let r=d(_(e).userAgent,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},arguments)},t.wbg.__wbg_new_d8a000788389a31e=function(n){return o(new Uint8Array(_(n)))},t.wbg.__wbg_desiredSize_800f00fde6830467=function(n,e){let r=_(e).desiredSize;P()[n/8+1]=l(r)?0:r,u()[n/4+0]=!l(r)},t.wbg.__wbg_close_3217bacea9625e8a=function(){return a(function(n){_(n).close()},arguments)},t.wbg.__wbg_enqueue_fe34f134be0ca1bd=function(){return a(function(n,e){_(n).enqueue(_(e))},arguments)},t.wbg.__wbg_error_32bdd65121e5c58d=function(n,e){_(n).error(_(e))},t.wbg.__wbindgen_number_new=function(n){return o(n)},t.wbg.__wbg_defineProperty_acb855411a6a5b7c=function(n,e,r){return o(Object.defineProperty(_(n),_(e),_(r)))},t.wbg.__wbg_crypto_58f13aa23ffcb166=function(n){return o(_(n).crypto)},t.wbg.__wbg_process_5b786e71d465a513=function(n){return o(_(n).process)},t.wbg.__wbg_versions_c2ab80650590b6a2=function(n){return o(_(n).versions)},t.wbg.__wbg_node_523d7bd03ef69fba=function(n){return o(_(n).node)},t.wbg.__wbindgen_is_string=function(n){return typeof _(n)=="string"},t.wbg.__wbg_require_2784e593a4674877=function(){return a(function(){return o(module.require)},arguments)},t.wbg.__wbg_msCrypto_abcb1295e768d1f2=function(n){return o(_(n).msCrypto)},t.wbg.__wbg_newwithlength_13b5319ab422dcf6=function(n){return o(new Uint8Array(n>>>0))},t.wbg.__wbindgen_is_object=function(n){let e=_(n);return typeof e=="object"&&e!==null},t.wbg.__wbindgen_memory=function(){return o(i.memory)},t.wbg.__wbg_buffer_344d9b41efe96da7=function(n){return o(_(n).buffer)},t.wbg.__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3=function(n,e,r){return o(new Uint8Array(_(n),e>>>0,r>>>0))},t.wbg.__wbg_randomFillSync_a0d98aa11c81fe89=function(){return a(function(n,e){_(n).randomFillSync(w(e))},arguments)},t.wbg.__wbg_getRandomValues_504510b5564925af=function(){return a(function(n,e){_(n).getRandomValues(_(e))},arguments)},t.wbg.__wbg_get_4a9aa5157afeb382=function(n,e){return o(_(n)[e>>>0])},t.wbg.__wbg_length_cace2e0b3ddc0502=function(n){return _(n).length},t.wbg.__wbg_call_669127b9d730c650=function(){return a(function(n,e){return o(_(n).call(_(e)))},arguments)},t.wbg.__wbg_newwithlength_045c9df8a7cc3543=function(n){return o(new Array(n>>>0))},t.wbg.__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d=function(n){let e;try{e=_(n)instanceof ArrayBuffer}catch{e=!1}return e},t.wbg.__wbg_toString_1a5250f284c09c9e=function(n,e,r){let c=d(_(e).toString(r),i.__wbindgen_malloc,i.__wbindgen_realloc),b=f;u()[n/4+1]=b,u()[n/4+0]=c},t.wbg.__wbg_message_35f9b952e1b922e2=function(n){return o(_(n).message)},t.wbg.__wbg_instanceof_Function_208feb37dc430eb3=function(n){let e;try{e=_(n)instanceof Function}catch{e=!1}return e},t.wbg.__wbg_apply_1c259fc7880fb101=function(){return a(function(n,e,r){return o(_(n).apply(_(e),_(r)))},arguments)},t.wbg.__wbg_call_53fc3abd42e24ec8=function(){return a(function(n,e,r){return o(_(n).call(_(e),_(r)))},arguments)},t.wbg.__wbg_toString_2c5d5b612e8bdd61=function(n){return o(_(n).toString())},t.wbg.__wbg_then_89e1c559530b85cf=function(n,e){return o(_(n).then(_(e)))},t.wbg.__wbg_set_dcfd613a3420f908=function(n,e,r){_(n).set(_(e),r>>>0)},t.wbg.__wbg_length_a5587d6cd79ab197=function(n){return _(n).length},t.wbg.__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1=function(n){let e;try{e=_(n)instanceof Uint8Array}catch{e=!1}return e},t.wbg.__wbg_subarray_6ca5cfa7fbb9abbe=function(n,e,r){return o(_(n).subarray(e>>>0,r>>>0))},t.wbg.__wbindgen_is_function=function(n){return typeof _(n)=="function"},t.wbg.__wbindgen_object_drop_ref=function(n){w(n)},t.wbg.__wbg_new_659d4bfe4e53c8ae=function(){return a(function(n,e){return o(new WebAssembly.Instance(_(n),_(e)))},arguments)},t.wbg.__wbg_new_756a04b324cd462c=function(){return a(function(n){return o(new WebAssembly.Module(_(n)))},arguments)},t.wbg.__wbg_get_3a1de47b76f3642e=function(){return a(function(n,e){return o(_(n).get(e>>>0))},arguments)},t.wbg.__wbg_new_61bdcb895f1f9b01=function(){return a(function(n){return o(new WebAssembly.Memory(_(n)))},arguments)},t.wbg.__wbg_self_3fad056edded10bd=function(){return a(function(){return o(self.self)},arguments)},t.wbg.__wbg_window_a4f46c98a61d4089=function(){return a(function(){return o(window.window)},arguments)},t.wbg.__wbg_globalThis_17eff828815f7d84=function(){return a(function(){return o(globalThis.globalThis)},arguments)},t.wbg.__wbg_global_46f939f6541643c5=function(){return a(function(){return o(global.global)},arguments)},t.wbg.__wbindgen_is_undefined=function(n){return _(n)===void 0},t.wbg.__wbg_newnoargs_ccdcae30fd002262=function(n,e){return o(new Function(m(n,e)))},t.wbg.__wbg_apply_2fa612c136e53eed=function(){return a(function(n,e,r){return o(Reflect.apply(_(n),_(e),_(r)))},arguments)},t.wbg.__wbg_get_2aff440840bb6202=function(){return a(function(n,e){return o(Reflect.get(_(n),_(e)))},arguments)},t.wbg.__wbg_set_40f7786a25a9cc7e=function(){return a(function(n,e,r){return Reflect.set(_(n),_(e),_(r))},arguments)},t.wbg.__wbindgen_error_new=function(n,e){return o(new Error(m(n,e)))},t.wbg.__wbindgen_bigint_get_as_i64=function(n,e){let r=_(e),c=typeof r=="bigint"?r:void 0;(R!==null&&R.buffer===i.memory.buffer||(R=new BigInt64Array(i.memory.buffer)),R)[n/8+1]=l(c)?BigInt(0):c,u()[n/4+0]=!l(c)},t.wbg.__wbindgen_debug_string=function(n,e){let r=d(U(_(e)),i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},t.wbg.__wbindgen_throw=function(n,e){throw new Error(m(n,e))},t.wbg.__wbindgen_rethrow=function(n){throw w(n)},t.wbg.__wbg_data_624fd2b6a4a5ac9e=function(n){return o(_(n).data)},t.wbg.__wbg_queueMicrotask_e5949c35d772a669=function(n){queueMicrotask(_(n))},t.wbg.__wbg_waitAsync_97f529b0dd0d7452=function(){return o(Atomics.waitAsync)},t.wbg.__wbg_new_66e5e8bd4064378e=function(n){return o(new Int32Array(_(n)))},t.wbg.__wbg_waitAsync_ace259c87ea1cfde=function(n,e,r){return o(Atomics.waitAsync(_(n),e,r))},t.wbg.__wbg_async_3cebb9c3c0a8b6e9=function(n){return _(n).async},t.wbg.__wbg_value_9b4d17e7284427cc=function(n){return o(_(n).value)},t.wbg.__wbg_new_feb65b865d980ae2=function(n,e){try{var r={a:n,b:e};let c=new Promise((b,g)=>{let s=r.a;r.a=0;try{return function(y,p,h,I){i._ZN12wasm_bindgen7convert8closures11invoke2_mut17h0ec8afacbccd07f3E(y,p,o(h),o(I))}(s,r.b,b,g)}finally{r.a=s}});return o(c)}finally{r.a=r.b=0}},t.wbg.__wbindgen_link_cb9dda2f0af60c4f=function(n){let e=d("data:application/javascript,"+encodeURIComponent(`onmessage = function (ev) { +(()=>{var Q={};function nn(t,n,e,r){return new(e||(e=Promise))(function(c,b){function g(p){try{y(r.next(p))}catch(h){b(h)}}function s(p){try{y(r.throw(p))}catch(h){b(h)}}function y(p){var h;p.done?c(p.value):(h=p.value,h instanceof e?h:new e(function(I){I(h)})).then(g,s)}y((r=r.apply(t,n||[])).next())})}var i;var Y=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Y.decode();var k=null;function j(){return k!==null&&k.buffer===i.memory.buffer||(k=new Uint8Array(i.memory.buffer)),k}function m(t,n){return t>>>=0,Y.decode(j().slice(t,t+n))}var v=new Array(128).fill(void 0);v.push(void 0,null,!0,!1);var W=v.length;function o(t){W===v.length&&v.push(v.length+1);let n=W;return W=v[n],v[n]=t,n}function _(t){return v[t]}var f=0,J=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},en=function(t,n){let e=J.encode(t);return n.set(e),{read:t.length,written:e.length}};function d(t,n,e){if(e===void 0){let s=J.encode(t),y=n(s.length,1)>>>0;return j().subarray(y,y+s.length).set(s),f=s.length,y}let r=t.length,c=n(r,1)>>>0,b=j(),g=0;for(;g127)break;b[c+g]=s}if(g!==r){g!==0&&(t=t.slice(g)),c=e(c,r,r=g+3*t.length,1)>>>0;let s=j().subarray(c+g,c+r);g+=en(t,s).written}return f=g,c}function l(t){return t==null}var A=null;function u(){return A!==null&&A.buffer===i.memory.buffer||(A=new Int32Array(i.memory.buffer)),A}function w(t){let n=_(t);return function(e){e<132||(v[e]=W,W=e)}(t),n}var R=null;function U(t){let n=typeof t;if(n=="number"||n=="boolean"||t==null)return`${t}`;if(n=="string")return`"${t}"`;if(n=="symbol"){let c=t.description;return c==null?"Symbol":`Symbol(${c})`}if(n=="function"){let c=t.name;return typeof c=="string"&&c.length>0?`Function(${c})`:"Function"}if(Array.isArray(t)){let c=t.length,b="[";c>0&&(b+=U(t[0]));for(let g=1;g1))return toString.call(t);if(r=e[1],r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message} +${t.stack}`:r}var T=null;function q(){return T!==null&&T.buffer===i.memory.buffer||(T=new Float64Array(i.memory.buffer)),T}var M=new FinalizationRegistry(t=>{i.__wbindgen_export_3.get(t.dtor)(t.a,t.b)});function E(t,n,e,r){let c={a:t,b:n,cnt:1,dtor:e},b=(...g)=>{c.cnt++;let s=c.a;c.a=0;try{return r(s,c.b,...g)}finally{--c.cnt==0?(i.__wbindgen_export_3.get(c.dtor)(s,c.b),M.unregister(c)):c.a=s}};return b.original=c,M.register(b,c,c),b}function F(t,n,e){i._ZN12wasm_bindgen7convert8closures11invoke1_mut17h39693afad0d92ad2E(t,n,o(e))}function N(t,n,e,r){let c={a:t,b:n,cnt:1,dtor:e},b=(...g)=>{c.cnt++;try{return r(c.a,c.b,...g)}finally{--c.cnt==0&&(i.__wbindgen_export_3.get(c.dtor)(c.a,c.b),c.a=0,M.unregister(c))}};return b.original=c,M.register(b,c,c),b}function tn(t,n){return w(i._ZN129__LT_dyn_u20_core__ops__function__Fn_LT__LP__RP__GT__u2b_Output_u20__u3d__u20_R_u20_as_u20_wasm_bindgen__closure__WasmClosure_GT_8describe6invoke17h613009e110396e8aE(t,n))}function _n(t,n,e){return i._ZN12wasm_bindgen7convert8closures7invoke117h27cd5385e9d886a8E(t,n,o(e))}function a(t,n){try{return t.apply(this,n)}catch(e){i.__wbindgen_exn_store(o(e))}}var G=new FinalizationRegistry(t=>i.__wbg_command_free(t>>>0)),S=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,G.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_command_free(n)}get name(){return w(i.__wbg_get_command_name(this.__wbg_ptr))}set name(n){i.__wbg_set_command_name(this.__wbg_ptr,o(n))}run(n){return w(i.command_run(this.__wbg_ptr,l(n)?0:o(n)))}binary(){return w(i.command_binary(this.__wbg_ptr))}},rn=new FinalizationRegistry(t=>i.__wbg_directory_free(t>>>0)),O=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,rn.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_directory_free(n)}__getClassname(){let n,e;try{let b=i.__wbindgen_add_to_stack_pointer(-16);i.directory___getClassname(b,this.__wbg_ptr);var r=u()[b/4+0],c=u()[b/4+1];return n=r,e=c,m(r,c)}finally{i.__wbindgen_add_to_stack_pointer(16),i.canonical_abi_free(n,e,1)}}constructor(n){try{let c=i.__wbindgen_add_to_stack_pointer(-16);i.directory_new(c,l(n)?0:o(n));var e=u()[c/4+0],r=u()[c/4+1];if(u()[c/4+2])throw w(r);return this.__wbg_ptr=e>>>0,this}finally{i.__wbindgen_add_to_stack_pointer(16)}}readDir(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_readDir(this.__wbg_ptr,e,r))}writeFile(n,e){let r=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;return w(i.directory_writeFile(this.__wbg_ptr,r,c,o(e)))}readFile(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_readFile(this.__wbg_ptr,e,r))}readTextFile(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_readTextFile(this.__wbg_ptr,e,r))}createDir(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_createDir(this.__wbg_ptr,e,r))}removeDir(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_removeDir(this.__wbg_ptr,e,r))}removeFile(n){let e=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;return w(i.directory_removeFile(this.__wbg_ptr,e,r))}},Z=new FinalizationRegistry(t=>i.__wbg_instance_free(t>>>0)),B=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_instance_free(n)}get stdin(){return w(i.__wbg_get_instance_stdin(this.__wbg_ptr))}get stdout(){return w(i.__wbg_get_instance_stdout(this.__wbg_ptr))}get stderr(){return w(i.__wbg_get_instance_stderr(this.__wbg_ptr))}wait(){let n=this.__destroy_into_raw();return w(i.instance_wait(n))}},V=new FinalizationRegistry(t=>i.__wbg_readablestreamsource_free(t>>>0)),D=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,V.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_readablestreamsource_free(n)}pull(n){return w(i.readablestreamsource_pull(this.__wbg_ptr,o(n)))}cancel(){i.readablestreamsource_cancel(this.__wbg_ptr)}get type(){return w(i.readablestreamsource_type(this.__wbg_ptr))}},gn=new FinalizationRegistry(t=>i.__wbg_runtime_free(t>>>0));var on=new FinalizationRegistry(t=>i.__wbg_threadpoolworker_free(t>>>0)),L=class{__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,on.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_threadpoolworker_free(n)}constructor(n){let e=i.threadpoolworker_new(n);return this.__wbg_ptr=e>>>0,this}handle(n){return w(i.threadpoolworker_handle(this.__wbg_ptr,o(n)))}},K=new FinalizationRegistry(t=>i.__wbg_trap_free(t>>>0)),$=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,K.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_trap_free(n)}static __wbg_wasmer_trap(){i.trap___wbg_wasmer_trap()}},H=new FinalizationRegistry(t=>i.__wbg_wasmer_free(t>>>0)),x=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_wasmer_free(n)}get entrypoint(){let n=i.__wbg_get_wasmer_entrypoint(this.__wbg_ptr);return n===0?void 0:S.__wrap(n)}set entrypoint(n){let e=0;l(n)||(function(r,c){if(!(r instanceof c))throw new Error(`expected instance of ${c.name}`);r.ptr}(n,S),e=n.__destroy_into_raw()),i.__wbg_set_wasmer_entrypoint(this.__wbg_ptr,e)}get commands(){return w(i.__wbg_get_instance_stdout(this.__wbg_ptr))}set commands(n){i.__wbg_set_wasmer_commands(this.__wbg_ptr,o(n))}static fromRegistry(n,e){let r=d(n,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;return w(i.wasmer_fromRegistry(r,c,l(e)?0:o(e)))}static fromFile(n,e){return w(i.wasmer_fromFile(o(n),l(e)?0:o(e)))}},X=new FinalizationRegistry(t=>i.__wbg_writablestreamsink_free(t>>>0)),C=class t{static __wrap(n){n>>>=0;let e=Object.create(t.prototype);return e.__wbg_ptr=n,X.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){let n=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),n}free(){let n=this.__destroy_into_raw();i.__wbg_writablestreamsink_free(n)}close(){return w(i.writablestreamsink_close(this.__wbg_ptr))}abort(n){i.writablestreamsink_abort(this.__wbg_ptr,o(n))}write(n){return w(i.writablestreamsink_write(this.__wbg_ptr,o(n)))}};function cn(){let t={wbg:{}};return t.wbg.__wbg_new_08236689f0afb357=function(){return o(new Array)},t.wbg.__wbindgen_string_new=function(n,e){return o(m(n,e))},t.wbg.__wbg_new_c728d68b8b34487e=function(){return o(new Object)},t.wbg.__wbg_push_fd3233d09cf81821=function(n,e){return _(n).push(_(e))},t.wbg.__wbindgen_string_get=function(n,e){let r=_(e),c=typeof r=="string"?r:void 0;var b=l(c)?0:d(c,i.__wbindgen_malloc,i.__wbindgen_realloc),g=f;u()[n/4+1]=g,u()[n/4+0]=b},t.wbg.__wbindgen_object_clone_ref=function(n){return o(_(n))},t.wbg.__wbg_uses_87ee8532bf7067c2=function(n){let e=_(n).uses;return l(e)?0:o(e)},t.wbg.__wbg_navigator_7078da62d92ff5ad=function(n){return o(_(n).navigator)},t.wbg.__wbg_userAgent_2c548c522dca04cc=function(){return a(function(n,e){let r=d(_(e).userAgent,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},arguments)},t.wbg.__wbg_navigator_471948d3d6e10344=function(n){return o(_(n).navigator)},t.wbg.__wbg_userAgent_ec264c118b1e619c=function(){return a(function(n,e){let r=d(_(e).userAgent,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},arguments)},t.wbg.__wbg_new_d8a000788389a31e=function(n){return o(new Uint8Array(_(n)))},t.wbg.__wbg_desiredSize_800f00fde6830467=function(n,e){let r=_(e).desiredSize;q()[n/8+1]=l(r)?0:r,u()[n/4+0]=!l(r)},t.wbg.__wbg_close_3217bacea9625e8a=function(){return a(function(n){_(n).close()},arguments)},t.wbg.__wbg_enqueue_fe34f134be0ca1bd=function(){return a(function(n,e){_(n).enqueue(_(e))},arguments)},t.wbg.__wbg_error_32bdd65121e5c58d=function(n,e){_(n).error(_(e))},t.wbg.__wbindgen_number_new=function(n){return o(n)},t.wbg.__wbg_defineProperty_acb855411a6a5b7c=function(n,e,r){return o(Object.defineProperty(_(n),_(e),_(r)))},t.wbg.__wbg_crypto_58f13aa23ffcb166=function(n){return o(_(n).crypto)},t.wbg.__wbg_process_5b786e71d465a513=function(n){return o(_(n).process)},t.wbg.__wbg_versions_c2ab80650590b6a2=function(n){return o(_(n).versions)},t.wbg.__wbg_node_523d7bd03ef69fba=function(n){return o(_(n).node)},t.wbg.__wbindgen_is_string=function(n){return typeof _(n)=="string"},t.wbg.__wbg_require_2784e593a4674877=function(){return a(function(){return o(module.require)},arguments)},t.wbg.__wbg_msCrypto_abcb1295e768d1f2=function(n){return o(_(n).msCrypto)},t.wbg.__wbg_newwithlength_13b5319ab422dcf6=function(n){return o(new Uint8Array(n>>>0))},t.wbg.__wbindgen_is_object=function(n){let e=_(n);return typeof e=="object"&&e!==null},t.wbg.__wbindgen_memory=function(){return o(i.memory)},t.wbg.__wbg_buffer_344d9b41efe96da7=function(n){return o(_(n).buffer)},t.wbg.__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3=function(n,e,r){return o(new Uint8Array(_(n),e>>>0,r>>>0))},t.wbg.__wbg_randomFillSync_a0d98aa11c81fe89=function(){return a(function(n,e){_(n).randomFillSync(w(e))},arguments)},t.wbg.__wbg_getRandomValues_504510b5564925af=function(){return a(function(n,e){_(n).getRandomValues(_(e))},arguments)},t.wbg.__wbg_get_4a9aa5157afeb382=function(n,e){return o(_(n)[e>>>0])},t.wbg.__wbg_length_cace2e0b3ddc0502=function(n){return _(n).length},t.wbg.__wbg_call_669127b9d730c650=function(){return a(function(n,e){return o(_(n).call(_(e)))},arguments)},t.wbg.__wbg_newwithlength_045c9df8a7cc3543=function(n){return o(new Array(n>>>0))},t.wbg.__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d=function(n){let e;try{e=_(n)instanceof ArrayBuffer}catch{e=!1}return e},t.wbg.__wbg_toString_1a5250f284c09c9e=function(n,e,r){let c=d(_(e).toString(r),i.__wbindgen_malloc,i.__wbindgen_realloc),b=f;u()[n/4+1]=b,u()[n/4+0]=c},t.wbg.__wbg_message_35f9b952e1b922e2=function(n){return o(_(n).message)},t.wbg.__wbg_instanceof_Function_208feb37dc430eb3=function(n){let e;try{e=_(n)instanceof Function}catch{e=!1}return e},t.wbg.__wbg_apply_1c259fc7880fb101=function(){return a(function(n,e,r){return o(_(n).apply(_(e),_(r)))},arguments)},t.wbg.__wbg_call_53fc3abd42e24ec8=function(){return a(function(n,e,r){return o(_(n).call(_(e),_(r)))},arguments)},t.wbg.__wbg_toString_2c5d5b612e8bdd61=function(n){return o(_(n).toString())},t.wbg.__wbg_then_89e1c559530b85cf=function(n,e){return o(_(n).then(_(e)))},t.wbg.__wbg_set_dcfd613a3420f908=function(n,e,r){_(n).set(_(e),r>>>0)},t.wbg.__wbg_length_a5587d6cd79ab197=function(n){return _(n).length},t.wbg.__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1=function(n){let e;try{e=_(n)instanceof Uint8Array}catch{e=!1}return e},t.wbg.__wbg_subarray_6ca5cfa7fbb9abbe=function(n,e,r){return o(_(n).subarray(e>>>0,r>>>0))},t.wbg.__wbindgen_is_function=function(n){return typeof _(n)=="function"},t.wbg.__wbindgen_object_drop_ref=function(n){w(n)},t.wbg.__wbg_new_659d4bfe4e53c8ae=function(){return a(function(n,e){return o(new WebAssembly.Instance(_(n),_(e)))},arguments)},t.wbg.__wbg_new_756a04b324cd462c=function(){return a(function(n){return o(new WebAssembly.Module(_(n)))},arguments)},t.wbg.__wbg_get_3a1de47b76f3642e=function(){return a(function(n,e){return o(_(n).get(e>>>0))},arguments)},t.wbg.__wbg_new_61bdcb895f1f9b01=function(){return a(function(n){return o(new WebAssembly.Memory(_(n)))},arguments)},t.wbg.__wbg_self_3fad056edded10bd=function(){return a(function(){return o(self.self)},arguments)},t.wbg.__wbg_window_a4f46c98a61d4089=function(){return a(function(){return o(window.window)},arguments)},t.wbg.__wbg_globalThis_17eff828815f7d84=function(){return a(function(){return o(globalThis.globalThis)},arguments)},t.wbg.__wbg_global_46f939f6541643c5=function(){return a(function(){return o(global.global)},arguments)},t.wbg.__wbindgen_is_undefined=function(n){return _(n)===void 0},t.wbg.__wbg_newnoargs_ccdcae30fd002262=function(n,e){return o(new Function(m(n,e)))},t.wbg.__wbg_apply_2fa612c136e53eed=function(){return a(function(n,e,r){return o(Reflect.apply(_(n),_(e),_(r)))},arguments)},t.wbg.__wbg_get_2aff440840bb6202=function(){return a(function(n,e){return o(Reflect.get(_(n),_(e)))},arguments)},t.wbg.__wbg_set_40f7786a25a9cc7e=function(){return a(function(n,e,r){return Reflect.set(_(n),_(e),_(r))},arguments)},t.wbg.__wbindgen_error_new=function(n,e){return o(new Error(m(n,e)))},t.wbg.__wbindgen_bigint_get_as_i64=function(n,e){let r=_(e),c=typeof r=="bigint"?r:void 0;(R!==null&&R.buffer===i.memory.buffer||(R=new BigInt64Array(i.memory.buffer)),R)[n/8+1]=l(c)?BigInt(0):c,u()[n/4+0]=!l(c)},t.wbg.__wbindgen_debug_string=function(n,e){let r=d(U(_(e)),i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},t.wbg.__wbindgen_throw=function(n,e){throw new Error(m(n,e))},t.wbg.__wbindgen_rethrow=function(n){throw w(n)},t.wbg.__wbg_data_624fd2b6a4a5ac9e=function(n){return o(_(n).data)},t.wbg.__wbg_queueMicrotask_e5949c35d772a669=function(n){queueMicrotask(_(n))},t.wbg.__wbg_waitAsync_97f529b0dd0d7452=function(){return o(Atomics.waitAsync)},t.wbg.__wbg_new_66e5e8bd4064378e=function(n){return o(new Int32Array(_(n)))},t.wbg.__wbg_waitAsync_ace259c87ea1cfde=function(n,e,r){return o(Atomics.waitAsync(_(n),e,r))},t.wbg.__wbg_async_3cebb9c3c0a8b6e9=function(n){return _(n).async},t.wbg.__wbg_value_9b4d17e7284427cc=function(n){return o(_(n).value)},t.wbg.__wbg_new_feb65b865d980ae2=function(n,e){try{var r={a:n,b:e};let c=new Promise((b,g)=>{let s=r.a;r.a=0;try{return function(y,p,h,I){i._ZN12wasm_bindgen7convert8closures11invoke2_mut17h0ec8afacbccd07f3E(y,p,o(h),o(I))}(s,r.b,b,g)}finally{r.a=s}});return o(c)}finally{r.a=r.b=0}},t.wbg.__wbindgen_link_cb9dda2f0af60c4f=function(n){let e=d("data:application/javascript,"+encodeURIComponent(`onmessage = function (ev) { let [ia, index, value] = ev.data; ia = new Int32Array(ia.buffer); let result = Atomics.wait(ia, index, value); postMessage(result); }; - `),i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;u()[n/4+1]=r,u()[n/4+0]=e},t.wbg.__wbg_new_db2f8178fe56090a=function(){return a(function(n,e){return o(new Worker(m(n,e)))},arguments)},t.wbg.__wbg_setonmessage_30ed48e1f5d26fee=function(n,e){_(n).onmessage=_(e)},t.wbg.__wbg_of_5b11b7255a230e4e=function(n,e,r){return o(Array.of(_(n),_(e),_(r)))},t.wbg.__wbg_queueMicrotask_2be8b97a81fe4d00=function(n){return o(_(n).queueMicrotask)},t.wbg.__wbg_resolve_a3252b2860f0a09e=function(n){return o(Promise.resolve(_(n)))},t.wbg.__wbg_then_1bbc9edafd859b06=function(n,e,r){return o(_(n).then(_(e),_(r)))},t.wbg.__wbindgen_cb_drop=function(n){let e=w(n).original;return e.cnt--==1?(e.a=0,!0):!1},t.wbg.__wbg_byteLength_8903f453a3a8a1df=function(n){return _(n).byteLength},t.wbg.__wbg_exports_287124f54574699c=function(n){return o(WebAssembly.Module.exports(_(n)))},t.wbg.__wbg_for_fe237e14961c3b46=function(n,e){return o(Symbol.for(m(n,e)))},t.wbg.__wbindgen_number_get=function(n,e){let r=_(e),c=typeof r=="number"?r:void 0;P()[n/8+1]=l(c)?0:c,u()[n/4+0]=!l(c)},t.wbg.__wbg_getPrototypeOf_efd9ac7664cb1602=function(){return a(function(n){return o(Reflect.getPrototypeOf(_(n)))},arguments)},t.wbg.__wbg_constructor_3f5002261d14fb30=function(n){return o(_(n).constructor)},t.wbg.__wbg_trap_new=function(n){return o($.__wrap(n))},t.wbg.__wbg_value_442d6ccca6c89da5=function(n){return o(_(n).value)},t.wbg.__wbg_setvalue_d01c3234a2663552=function(n,e){_(n).value=_(e)},t.wbg.__wbg_instanceof_Error_9f5881c3c4149389=function(n){let e;try{e=_(n)instanceof Error}catch{e=!1}return e},t.wbg.__wbg_imports_849227f7280907ef=function(n){return o(WebAssembly.Module.imports(_(n)))},t.wbg.__wbg_instanceof_Object_3c95bd459efa5c3c=function(n){let e;try{e=_(n)instanceof Object}catch{e=!1}return e},t.wbg.__wbg_grow_51233537037b47cc=function(){return a(function(n,e){return _(n).grow(e>>>0)},arguments)},t.wbg.__wbg_instanceof_RangeError_dd0fad3a217d8897=function(n){let e;try{e=_(n)instanceof RangeError}catch{e=!1}return e},t.wbg.__wbg_buffer_b334b57bee6f611b=function(n){return o(_(n).buffer)},t.wbg.__wbg_send_a4612d3a60b1dbb4=function(){return a(function(n,e){_(n).send(_(e))},arguments)},t.wbg.__wbg_new_b9b318679315404f=function(){return a(function(n,e){return o(new WebSocket(m(n,e)))},arguments)},t.wbg.__wbg_setonopen_b2a170d59c1abe88=function(n,e){_(n).onopen=_(e)},t.wbg.__wbg_setonclose_4527668a5c065333=function(n,e){_(n).onclose=_(e)},t.wbg.__wbg_new_b71bf93085f9d631=function(){return a(function(){return o(new FileReader)},arguments)},t.wbg.__wbg_setonloadend_88fd301cd09da25d=function(n,e){_(n).onloadend=_(e)},t.wbg.__wbg_setbinaryType_dcb62e0f2b346301=function(n,e){_(n).binaryType=w(e)},t.wbg.__wbg_setonmessage_eb44f51ef6e7e0e8=function(n,e){_(n).onmessage=_(e)},t.wbg.__wbg_grow_f711696a8328da3c=function(n,e){return _(n).grow(e>>>0)},t.wbg.__wbg_hardwareConcurrency_b858ff012f3ad0fb=function(n){return _(n).hardwareConcurrency},t.wbg.__wbg_hardwareConcurrency_67b658b8df300eb5=function(n){return _(n).hardwareConcurrency},t.wbg.__wbg_isSafeInteger_c38b0a16d0c7cef7=function(n){return Number.isSafeInteger(_(n))},t.wbg.__wbindgen_jsval_loose_eq=function(n,e){return _(n)==_(e)},t.wbg.__wbindgen_boolean_get=function(n){let e=_(n);return typeof e=="boolean"?e?1:0:2},t.wbg.__wbindgen_is_bigint=function(n){return typeof _(n)=="bigint"},t.wbg.__wbindgen_bigint_from_u64=function(n){return o(BigInt.asUintN(64,n))},t.wbg.__wbindgen_jsval_eq=function(n,e){return _(n)===_(e)},t.wbg.__wbg_BigInt_9cc4d66dcbf0216e=function(n){return o(BigInt(_(n)))},t.wbg.__wbindgen_ge=function(n,e){return _(n)>=_(e)},t.wbg.__wbg_newwithu8arraysequenceandoptions_f520ece5c28a5211=function(){return a(function(n,e){return o(new Blob(_(n),_(e)))},arguments)},t.wbg.__wbg_createObjectURL_86955f30bbed45eb=function(){return a(function(n,e){let r=d(URL.createObjectURL(_(e)),i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},arguments)},t.wbg.__wbg_terminate_159911c61944a361=function(n){_(n).terminate()},t.wbg.__wbg_lineno_4506d18a0b25cca2=function(n){return _(n).lineno},t.wbg.__wbg_colno_19ebfec79bfd789d=function(n){return _(n).colno},t.wbg.__wbg_assert_aa771cfef9582df7=function(n,e){console.assert(n!==0,_(e))},t.wbg.__wbg_new_abda76e883ba8a5f=function(){return o(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(n,e){let r=d(_(e).stack,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},t.wbg.__wbg_error_f851667af71bcfc6=function(n,e){let r,c;try{r=n,c=e,console.error(m(n,e))}finally{i.canonical_abi_free(r,c,1)}},t.wbg.__wbg_instanceof_TypeError_9282fd7df97806a0=function(n){let e;try{e=_(n)instanceof TypeError}catch{e=!1}return e},t.wbg.__wbg_wasmer_new=function(n){return o(x.__wrap(n))},t.wbg.__wbg_new_ab87fd305ed9004b=function(n,e){return o(new Error(m(n,e)))},t.wbg.__wbg_instance_new=function(n){return o(B.__wrap(n))},t.wbg.__wbg_read_55c1f4e3f3729816=function(n){return o(_(n).read())},t.wbg.__wbindgen_is_falsy=function(n){return!_(n)},t.wbg.__wbg_instanceof_Blob_bd674d851f2d730d=function(n){let e;try{e=_(n)instanceof Blob}catch{e=!1}return e},t.wbg.__wbg_readAsArrayBuffer_55965fe069b748b7=function(){return a(function(n,e){_(n).readAsArrayBuffer(_(e))},arguments)},t.wbg.__wbg_result_5e08da49132b9af2=function(){return a(function(n){return o(_(n).result)},arguments)},t.wbg.__wbg_instanceof_Module_7b9e1eae1becb87c=function(n){let e;try{e=_(n)instanceof WebAssembly.Module}catch{e=!1}return e},t.wbg.__wbg_static_accessor_IMPORT_META_URL_3be0dba93f76ed43=function(n){let e=d(tn.url,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;u()[n/4+1]=r,u()[n/4+0]=e},t.wbg.__wbg_log_7811587c4c6d2844=function(n){console.log(_(n))},t.wbg.__wbg_byteLength_206a04415dea52a7=function(n){return _(n).byteLength},t.wbg.__wbg_instanceof_DedicatedWorkerGlobalScope_4cabe735c12f6f62=function(n){let e;try{e=_(n)instanceof DedicatedWorkerGlobalScope}catch{e=!1}return e},t.wbg.__wbg_postMessage_08d9966515d3437e=function(){return a(function(n,e){_(n).postMessage(_(e))},arguments)},t.wbg.__wbg_args_4d15d7afb42e284d=function(n){let e=_(n).args;return l(e)?0:o(e)},t.wbg.__wbg_env_ad8595f2986ecc88=function(n){return o(_(n).env)},t.wbg.__wbg_new_a8d206e6b5c455e8=function(n,e){return o(new TypeError(m(n,e)))},t.wbg.__wbg_mount_6bbd20e7e89111c6=function(n){return o(_(n).mount)},t.wbg.__wbg_stdin_00c789dbac01e87a=function(n){let e=_(n).stdin;return l(e)?0:o(e)},t.wbg.__wbg_command_new=function(n){return o(S.__wrap(n))},t.wbg.__wbg_registry_3c50a218bff1b9c2=function(n){let e=_(n).registry;return l(e)?0:o(e)},t.wbg.__wbindgen_is_null=function(n){return _(n)===null},t.wbg.__wbg_apiKey_45d9470ec7a59981=function(n,e){let r=_(e).apiKey;var c=l(r)?0:d(r,i.__wbindgen_malloc,i.__wbindgen_realloc),b=f;u()[n/4+1]=b,u()[n/4+0]=c},t.wbg.__wbg_networkGateway_19db657660e81113=function(n,e){let r=_(e).networkGateway;var c=l(r)?0:d(r,i.__wbindgen_malloc,i.__wbindgen_realloc),b=f;u()[n/4+1]=b,u()[n/4+0]=c},t.wbg.__wbg_program_86b0cb49d1fef987=function(n){return o(_(n).program)},t.wbg.__wbg_runtime_0041006d6e1bcee1=function(n){return o(_(n).runtime)},t.wbg.__wbg_instanceof_Window_cde2416cf5126a72=function(n){let e;try{e=_(n)instanceof Window}catch{e=!1}return e},t.wbg.__wbg_setTimeout_07866af1a1842093=function(){return a(function(n,e,r){return _(n).setTimeout(_(e),r)},arguments)},t.wbg.__wbg_setTimeout_a7009fb086494628=function(){return a(function(n,e,r){return _(n).setTimeout(_(e),r)},arguments)},t.wbg.__wbg_keys_1af6085b03973487=function(n){return o(Object.keys(_(n)))},t.wbg.__wbg_is_c74aa9bb973d6109=function(n,e){return Object.is(_(n),_(e))},t.wbg.__wbindgen_lt=function(n,e){return _(n)<_(e)},t.wbg.__wbg_writablestreamsink_new=function(n){return o(C.__wrap(n))},t.wbg.__wbg_newwithunderlyingsinkandstrategy_58a8dd5a077a053a=function(){return a(function(n,e){return o(new WritableStream(_(n),_(e)))},arguments)},t.wbg.__wbg_readablestreamsource_new=function(n){return o(D.__wrap(n))},t.wbg.__wbg_newwithunderlyingsourceandstrategy_8918d0ac449d9312=function(){return a(function(n,e){return o(new ReadableStream(_(n),_(e)))},arguments)},t.wbg.__wbg_new_5db6ceb8aeeaf01c=function(){return a(function(n){return o(new ReadableStreamDefaultReader(_(n)))},arguments)},t.wbg.__wbg_releaseLock_9b69600b4df9a3e5=function(n){_(n).releaseLock()},t.wbg.__wbg_newwithoptions_648df56fc5ca57ca=function(){return a(function(n,e,r){return o(new Worker(m(n,e),_(r)))},arguments)},t.wbg.__wbg_setonerror_589ac13960a72e2a=function(n,e){_(n).onerror=_(e)},t.wbg.__wbindgen_module=function(){return o(z.__wbindgen_wasm_module)},t.wbg.__wbindgen_function_table=function(){return o(i.__wbindgen_export_3)},t.wbg.__wbg_bind_d7487121c7db1440=function(n,e,r,c){return o(_(n).bind(_(e),_(r),_(c)))},t.wbg.__wbg_exports_1ea13b1dd33137f1=function(n){return o(_(n).exports)},t.wbg.__wbg_instanceof_Global_1c3b64df1a5c886c=function(n){let e;try{e=_(n)instanceof WebAssembly.Global}catch{e=!1}return e},t.wbg.__wbg_instanceof_Table_f9bb0e6df370756a=function(n){let e;try{e=_(n)instanceof WebAssembly.Table}catch{e=!1}return e},t.wbg.__wbindgen_shr=function(n,e){return o(_(n)>>_(e))},t.wbg.__wbindgen_bigint_from_i64=function(n){return o(n)},t.wbg.__wbindgen_bigint_from_u128=function(n,e){return o(BigInt.asUintN(64,n)<_n(void 0,void 0,void 0,function*(){if(!t){let e="https://unpkg.com/@wasmer/sdk@0.6.0/dist/wasmer_js_bg.wasm";e&&(t=new URL(e))}return z(t,n)});globalThis.__WASMER_INTERNALS__={ThreadPoolWorker:L,init:un},globalThis.$RefreshReg$=globalThis.$RefreshReg$||function(){},globalThis.$RefreshSig$=globalThis.$RefreshSig$||function(){return function(){}};var gn=async({data:t})=>{let{code:n,args:e,input:r}=t;en(wasmUrl);let b=await(await x.fromRegistry("python/python")).entrypoint.run({args:e.split(` -`),stdin:Uint8Array.from(r.split("").map(p=>p.charCodeAt(0))),mount:{"/out":new O,"/src":{"main.py":new Uint8Array(n)}}}),{code:g,stdout:s,stderr:y}=await b.wait();postMessage({type:"output",output:s}),postMessage({type:"output",error:y}),console.log(`Python exited with ${g}: ${s}`)};addEventListener("message",t=>gn(t).then(()=>postMessage({type:"done"})));})(); + `),i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;u()[n/4+1]=r,u()[n/4+0]=e},t.wbg.__wbg_new_db2f8178fe56090a=function(){return a(function(n,e){return o(new Worker(m(n,e)))},arguments)},t.wbg.__wbg_setonmessage_30ed48e1f5d26fee=function(n,e){_(n).onmessage=_(e)},t.wbg.__wbg_of_5b11b7255a230e4e=function(n,e,r){return o(Array.of(_(n),_(e),_(r)))},t.wbg.__wbg_queueMicrotask_2be8b97a81fe4d00=function(n){return o(_(n).queueMicrotask)},t.wbg.__wbg_resolve_a3252b2860f0a09e=function(n){return o(Promise.resolve(_(n)))},t.wbg.__wbg_then_1bbc9edafd859b06=function(n,e,r){return o(_(n).then(_(e),_(r)))},t.wbg.__wbindgen_cb_drop=function(n){let e=w(n).original;return e.cnt--==1?(e.a=0,!0):!1},t.wbg.__wbg_byteLength_8903f453a3a8a1df=function(n){return _(n).byteLength},t.wbg.__wbg_exports_287124f54574699c=function(n){return o(WebAssembly.Module.exports(_(n)))},t.wbg.__wbg_for_fe237e14961c3b46=function(n,e){return o(Symbol.for(m(n,e)))},t.wbg.__wbindgen_number_get=function(n,e){let r=_(e),c=typeof r=="number"?r:void 0;q()[n/8+1]=l(c)?0:c,u()[n/4+0]=!l(c)},t.wbg.__wbg_getPrototypeOf_efd9ac7664cb1602=function(){return a(function(n){return o(Reflect.getPrototypeOf(_(n)))},arguments)},t.wbg.__wbg_constructor_3f5002261d14fb30=function(n){return o(_(n).constructor)},t.wbg.__wbg_trap_new=function(n){return o($.__wrap(n))},t.wbg.__wbg_value_442d6ccca6c89da5=function(n){return o(_(n).value)},t.wbg.__wbg_setvalue_d01c3234a2663552=function(n,e){_(n).value=_(e)},t.wbg.__wbg_instanceof_Error_9f5881c3c4149389=function(n){let e;try{e=_(n)instanceof Error}catch{e=!1}return e},t.wbg.__wbg_imports_849227f7280907ef=function(n){return o(WebAssembly.Module.imports(_(n)))},t.wbg.__wbg_instanceof_Object_3c95bd459efa5c3c=function(n){let e;try{e=_(n)instanceof Object}catch{e=!1}return e},t.wbg.__wbg_grow_51233537037b47cc=function(){return a(function(n,e){return _(n).grow(e>>>0)},arguments)},t.wbg.__wbg_instanceof_RangeError_dd0fad3a217d8897=function(n){let e;try{e=_(n)instanceof RangeError}catch{e=!1}return e},t.wbg.__wbg_buffer_b334b57bee6f611b=function(n){return o(_(n).buffer)},t.wbg.__wbg_send_a4612d3a60b1dbb4=function(){return a(function(n,e){_(n).send(_(e))},arguments)},t.wbg.__wbg_new_b9b318679315404f=function(){return a(function(n,e){return o(new WebSocket(m(n,e)))},arguments)},t.wbg.__wbg_setonopen_b2a170d59c1abe88=function(n,e){_(n).onopen=_(e)},t.wbg.__wbg_setonclose_4527668a5c065333=function(n,e){_(n).onclose=_(e)},t.wbg.__wbg_new_b71bf93085f9d631=function(){return a(function(){return o(new FileReader)},arguments)},t.wbg.__wbg_setonloadend_88fd301cd09da25d=function(n,e){_(n).onloadend=_(e)},t.wbg.__wbg_setbinaryType_dcb62e0f2b346301=function(n,e){_(n).binaryType=w(e)},t.wbg.__wbg_setonmessage_eb44f51ef6e7e0e8=function(n,e){_(n).onmessage=_(e)},t.wbg.__wbg_grow_f711696a8328da3c=function(n,e){return _(n).grow(e>>>0)},t.wbg.__wbg_hardwareConcurrency_b858ff012f3ad0fb=function(n){return _(n).hardwareConcurrency},t.wbg.__wbg_hardwareConcurrency_67b658b8df300eb5=function(n){return _(n).hardwareConcurrency},t.wbg.__wbg_isSafeInteger_c38b0a16d0c7cef7=function(n){return Number.isSafeInteger(_(n))},t.wbg.__wbindgen_jsval_loose_eq=function(n,e){return _(n)==_(e)},t.wbg.__wbindgen_boolean_get=function(n){let e=_(n);return typeof e=="boolean"?e?1:0:2},t.wbg.__wbindgen_is_bigint=function(n){return typeof _(n)=="bigint"},t.wbg.__wbindgen_bigint_from_u64=function(n){return o(BigInt.asUintN(64,n))},t.wbg.__wbindgen_jsval_eq=function(n,e){return _(n)===_(e)},t.wbg.__wbg_BigInt_9cc4d66dcbf0216e=function(n){return o(BigInt(_(n)))},t.wbg.__wbindgen_ge=function(n,e){return _(n)>=_(e)},t.wbg.__wbg_newwithu8arraysequenceandoptions_f520ece5c28a5211=function(){return a(function(n,e){return o(new Blob(_(n),_(e)))},arguments)},t.wbg.__wbg_createObjectURL_86955f30bbed45eb=function(){return a(function(n,e){let r=d(URL.createObjectURL(_(e)),i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},arguments)},t.wbg.__wbg_terminate_159911c61944a361=function(n){_(n).terminate()},t.wbg.__wbg_lineno_4506d18a0b25cca2=function(n){return _(n).lineno},t.wbg.__wbg_colno_19ebfec79bfd789d=function(n){return _(n).colno},t.wbg.__wbg_assert_aa771cfef9582df7=function(n,e){console.assert(n!==0,_(e))},t.wbg.__wbg_new_abda76e883ba8a5f=function(){return o(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(n,e){let r=d(_(e).stack,i.__wbindgen_malloc,i.__wbindgen_realloc),c=f;u()[n/4+1]=c,u()[n/4+0]=r},t.wbg.__wbg_error_f851667af71bcfc6=function(n,e){let r,c;try{r=n,c=e,console.error(m(n,e))}finally{i.canonical_abi_free(r,c,1)}},t.wbg.__wbg_instanceof_TypeError_9282fd7df97806a0=function(n){let e;try{e=_(n)instanceof TypeError}catch{e=!1}return e},t.wbg.__wbg_wasmer_new=function(n){return o(x.__wrap(n))},t.wbg.__wbg_new_ab87fd305ed9004b=function(n,e){return o(new Error(m(n,e)))},t.wbg.__wbg_instance_new=function(n){return o(B.__wrap(n))},t.wbg.__wbg_read_55c1f4e3f3729816=function(n){return o(_(n).read())},t.wbg.__wbindgen_is_falsy=function(n){return!_(n)},t.wbg.__wbg_instanceof_Blob_bd674d851f2d730d=function(n){let e;try{e=_(n)instanceof Blob}catch{e=!1}return e},t.wbg.__wbg_readAsArrayBuffer_55965fe069b748b7=function(){return a(function(n,e){_(n).readAsArrayBuffer(_(e))},arguments)},t.wbg.__wbg_result_5e08da49132b9af2=function(){return a(function(n){return o(_(n).result)},arguments)},t.wbg.__wbg_instanceof_Module_7b9e1eae1becb87c=function(n){let e;try{e=_(n)instanceof WebAssembly.Module}catch{e=!1}return e},t.wbg.__wbg_static_accessor_IMPORT_META_URL_3be0dba93f76ed43=function(n){let e=d(Q.url,i.__wbindgen_malloc,i.__wbindgen_realloc),r=f;u()[n/4+1]=r,u()[n/4+0]=e},t.wbg.__wbg_log_7811587c4c6d2844=function(n){console.log(_(n))},t.wbg.__wbg_byteLength_206a04415dea52a7=function(n){return _(n).byteLength},t.wbg.__wbg_instanceof_DedicatedWorkerGlobalScope_4cabe735c12f6f62=function(n){let e;try{e=_(n)instanceof DedicatedWorkerGlobalScope}catch{e=!1}return e},t.wbg.__wbg_postMessage_08d9966515d3437e=function(){return a(function(n,e){_(n).postMessage(_(e))},arguments)},t.wbg.__wbg_args_4d15d7afb42e284d=function(n){let e=_(n).args;return l(e)?0:o(e)},t.wbg.__wbg_env_ad8595f2986ecc88=function(n){return o(_(n).env)},t.wbg.__wbg_new_a8d206e6b5c455e8=function(n,e){return o(new TypeError(m(n,e)))},t.wbg.__wbg_mount_6bbd20e7e89111c6=function(n){return o(_(n).mount)},t.wbg.__wbg_stdin_00c789dbac01e87a=function(n){let e=_(n).stdin;return l(e)?0:o(e)},t.wbg.__wbg_command_new=function(n){return o(S.__wrap(n))},t.wbg.__wbg_registry_3c50a218bff1b9c2=function(n){let e=_(n).registry;return l(e)?0:o(e)},t.wbg.__wbindgen_is_null=function(n){return _(n)===null},t.wbg.__wbg_apiKey_45d9470ec7a59981=function(n,e){let r=_(e).apiKey;var c=l(r)?0:d(r,i.__wbindgen_malloc,i.__wbindgen_realloc),b=f;u()[n/4+1]=b,u()[n/4+0]=c},t.wbg.__wbg_networkGateway_19db657660e81113=function(n,e){let r=_(e).networkGateway;var c=l(r)?0:d(r,i.__wbindgen_malloc,i.__wbindgen_realloc),b=f;u()[n/4+1]=b,u()[n/4+0]=c},t.wbg.__wbg_program_86b0cb49d1fef987=function(n){return o(_(n).program)},t.wbg.__wbg_runtime_0041006d6e1bcee1=function(n){return o(_(n).runtime)},t.wbg.__wbg_instanceof_Window_cde2416cf5126a72=function(n){let e;try{e=_(n)instanceof Window}catch{e=!1}return e},t.wbg.__wbg_setTimeout_07866af1a1842093=function(){return a(function(n,e,r){return _(n).setTimeout(_(e),r)},arguments)},t.wbg.__wbg_setTimeout_a7009fb086494628=function(){return a(function(n,e,r){return _(n).setTimeout(_(e),r)},arguments)},t.wbg.__wbg_keys_1af6085b03973487=function(n){return o(Object.keys(_(n)))},t.wbg.__wbg_is_c74aa9bb973d6109=function(n,e){return Object.is(_(n),_(e))},t.wbg.__wbindgen_lt=function(n,e){return _(n)<_(e)},t.wbg.__wbg_writablestreamsink_new=function(n){return o(C.__wrap(n))},t.wbg.__wbg_newwithunderlyingsinkandstrategy_58a8dd5a077a053a=function(){return a(function(n,e){return o(new WritableStream(_(n),_(e)))},arguments)},t.wbg.__wbg_readablestreamsource_new=function(n){return o(D.__wrap(n))},t.wbg.__wbg_newwithunderlyingsourceandstrategy_8918d0ac449d9312=function(){return a(function(n,e){return o(new ReadableStream(_(n),_(e)))},arguments)},t.wbg.__wbg_new_5db6ceb8aeeaf01c=function(){return a(function(n){return o(new ReadableStreamDefaultReader(_(n)))},arguments)},t.wbg.__wbg_releaseLock_9b69600b4df9a3e5=function(n){_(n).releaseLock()},t.wbg.__wbg_newwithoptions_648df56fc5ca57ca=function(){return a(function(n,e,r){return o(new Worker(m(n,e),_(r)))},arguments)},t.wbg.__wbg_setonerror_589ac13960a72e2a=function(n,e){_(n).onerror=_(e)},t.wbg.__wbindgen_module=function(){return o(z.__wbindgen_wasm_module)},t.wbg.__wbindgen_function_table=function(){return o(i.__wbindgen_export_3)},t.wbg.__wbg_bind_d7487121c7db1440=function(n,e,r,c){return o(_(n).bind(_(e),_(r),_(c)))},t.wbg.__wbg_exports_1ea13b1dd33137f1=function(n){return o(_(n).exports)},t.wbg.__wbg_instanceof_Global_1c3b64df1a5c886c=function(n){let e;try{e=_(n)instanceof WebAssembly.Global}catch{e=!1}return e},t.wbg.__wbg_instanceof_Table_f9bb0e6df370756a=function(n){let e;try{e=_(n)instanceof WebAssembly.Table}catch{e=!1}return e},t.wbg.__wbindgen_shr=function(n,e){return o(_(n)>>_(e))},t.wbg.__wbindgen_bigint_from_i64=function(n){return o(n)},t.wbg.__wbindgen_bigint_from_u128=function(n,e){return o(BigInt.asUintN(64,n)<nn(void 0,void 0,void 0,function*(){if(!t){let e="https://unpkg.com/@wasmer/sdk@0.6.0/dist/wasmer_js_bg.wasm";e&&(t=new URL(e))}return z(t,n)});globalThis.__WASMER_INTERNALS__={ThreadPoolWorker:L,init:P},globalThis.$RefreshReg$=globalThis.$RefreshReg$||function(){},globalThis.$RefreshSig$=globalThis.$RefreshSig$||function(){return function(){}};var un=async({data:t})=>{let{code:n,args:e,input:r}=t;await P();let b=await(await x.fromRegistry("python/python")).entrypoint.run({args:e.split(` +`),stdin:Uint8Array.from(r.split("").map(p=>p.charCodeAt(0))),mount:{"/out":new O,"/src":{"main.py":new Uint8Array(n)}}}),{code:g,stdout:s,stderr:y}=await b.wait();postMessage({type:"output",output:s}),postMessage({type:"output",error:y}),console.log(`Python exited with ${g}: ${s}`)};addEventListener("message",t=>un(t).then(()=>postMessage({type:"done"})));})(); /*! Bundled license information: @wasmer/sdk/dist/WasmerSDK.js: diff --git a/dist/js/langs/python-wasmer/worker.js.map b/dist/js/langs/python-wasmer/worker.js.map index 2c11f63..31b8ea5 100644 --- a/dist/js/langs/python-wasmer/worker.js.map +++ b/dist/js/langs/python-wasmer/worker.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../../node_modules/@wasmer/sdk/dist/WasmerSDK.js", "../../../../js/langs/python-wasmer/worker.ts"], - "sourcesContent": ["/*!\n * @wasmer/sdk\n * Isomorphic Javascript library for interacting with WASI Modules in Node.js and the Browser.\n *\n * @version v0.6.0\n * @author Wasmer Engineering Team \n * @homepage https://github.com/wasmerio/wasmer-js\n * @repository git+https://github.com/wasmerio/wasmer-js.git\n * @license MIT\n */\nfunction n(n,e,t,_){return new(t||(t=Promise))((function(r,o){function i(n){try{b(_.next(n))}catch(n){o(n)}}function c(n){try{b(_.throw(n))}catch(n){o(n)}}function b(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(i,c)}b((_=_.apply(n,e||[])).next())}))}let e;\"function\"==typeof SuppressedError&&SuppressedError;const t=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf-8\",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(\"TextDecoder not available\")}};\"undefined\"!=typeof TextDecoder&&t.decode();let _=null;function r(){return null!==_&&_.buffer===e.memory.buffer||(_=new Uint8Array(e.memory.buffer)),_}function o(n,e){return n>>>=0,t.decode(r().slice(n,n+e))}const i=new Array(128).fill(void 0);i.push(void 0,null,!0,!1);let c=i.length;function b(n){c===i.length&&i.push(i.length+1);const e=c;return c=i[e],i[e]=n,e}function a(n){return i[n]}let w=0;const u=\"undefined\"!=typeof TextEncoder?new TextEncoder(\"utf-8\"):{encode:()=>{throw Error(\"TextEncoder not available\")}},g=function(n,e){const t=u.encode(n);return e.set(t),{read:n.length,written:t.length}};function s(n,e,t){if(void 0===t){const t=u.encode(n),_=e(t.length,1)>>>0;return r().subarray(_,_+t.length).set(t),w=t.length,_}let _=n.length,o=e(_,1)>>>0;const i=r();let c=0;for(;c<_;c++){const e=n.charCodeAt(c);if(e>127)break;i[o+c]=e}if(c!==_){0!==c&&(n=n.slice(c)),o=t(o,_,_=c+3*n.length,1)>>>0;const e=r().subarray(o+c,o+_);c+=g(n,e).written}return w=c,o}function f(n){return null==n}let d=null;function l(){return null!==d&&d.buffer===e.memory.buffer||(d=new Int32Array(e.memory.buffer)),d}function y(n){const e=a(n);return function(n){n<132||(i[n]=c,c=n)}(n),e}let p=null;function m(n){const e=typeof n;if(\"number\"==e||\"boolean\"==e||null==n)return`${n}`;if(\"string\"==e)return`\"${n}\"`;if(\"symbol\"==e){const e=n.description;return null==e?\"Symbol\":`Symbol(${e})`}if(\"function\"==e){const e=n.name;return\"string\"==typeof e&&e.length>0?`Function(${e})`:\"Function\"}if(Array.isArray(n)){const e=n.length;let t=\"[\";e>0&&(t+=m(n[0]));for(let _=1;_1))return toString.call(n);if(_=t[1],\"Object\"==_)try{return\"Object(\"+JSON.stringify(n)+\")\"}catch(n){return\"Object\"}return n instanceof Error?`${n.name}: ${n.message}\\n${n.stack}`:_}let h=null;function v(){return null!==h&&h.buffer===e.memory.buffer||(h=new Float64Array(e.memory.buffer)),h}const A=new FinalizationRegistry((n=>{e.__wbindgen_export_3.get(n.dtor)(n.a,n.b)}));function k(n,t,_,r){const o={a:n,b:t,cnt:1,dtor:_},i=(...n)=>{o.cnt++;const t=o.a;o.a=0;try{return r(t,o.b,...n)}finally{0==--o.cnt?(e.__wbindgen_export_3.get(o.dtor)(t,o.b),A.unregister(o)):o.a=t}};return i.original=o,A.register(i,o,o),i}function R(n,t,_){e._ZN12wasm_bindgen7convert8closures11invoke1_mut17h39693afad0d92ad2E(n,t,b(_))}function T(n,t,_,r){const o={a:n,b:t,cnt:1,dtor:_},i=(...n)=>{o.cnt++;try{return r(o.a,o.b,...n)}finally{0==--o.cnt&&(e.__wbindgen_export_3.get(o.dtor)(o.a,o.b),o.a=0,A.unregister(o))}};return i.original=o,A.register(i,o,o),i}function W(n,t){return y(e._ZN129__LT_dyn_u20_core__ops__function__Fn_LT__LP__RP__GT__u2b_Output_u20__u3d__u20_R_u20_as_u20_wasm_bindgen__closure__WasmClosure_GT_8describe6invoke17h613009e110396e8aE(n,t))}function S(n,t,_){return e._ZN12wasm_bindgen7convert8closures7invoke117h27cd5385e9d886a8E(n,t,b(_))}function x(n,t){try{return n.apply(this,t)}catch(n){e.__wbindgen_exn_store(b(n))}}function F(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16),o=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),i=w;e.wat2wasm(r,o,i);var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return y(t)}finally{e.__wbindgen_add_to_stack_pointer(16)}}function E(){e.on_start()}function j(n){e.setWorkerUrl(b(n))}function O(n,t){return y(e.runWasix(b(n),b(t)))}function M(n){try{const o=e.__wbindgen_add_to_stack_pointer(-16);var t=f(n)?0:s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;e.initializeLogger(o,t,_);var r=l()[o/4+0];if(l()[o/4+1])throw y(r)}finally{e.__wbindgen_add_to_stack_pointer(16)}}const I=new FinalizationRegistry((n=>e.__wbg_command_free(n>>>0)));class U{static __wrap(n){n>>>=0;const e=Object.create(U.prototype);return e.__wbg_ptr=n,I.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,I.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_command_free(n)}get name(){return y(e.__wbg_get_command_name(this.__wbg_ptr))}set name(n){e.__wbg_set_command_name(this.__wbg_ptr,b(n))}run(n){return y(e.command_run(this.__wbg_ptr,f(n)?0:b(n)))}binary(){return y(e.command_binary(this.__wbg_ptr))}}const B=new FinalizationRegistry((n=>e.__wbg_directory_free(n>>>0)));class L{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,B.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_directory_free(n)}__getClassname(){let n,t;try{const i=e.__wbindgen_add_to_stack_pointer(-16);e.directory___getClassname(i,this.__wbg_ptr);var _=l()[i/4+0],r=l()[i/4+1];return n=_,t=r,o(_,r)}finally{e.__wbindgen_add_to_stack_pointer(16),e.canonical_abi_free(n,t,1)}}constructor(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.directory_new(r,f(n)?0:b(n));var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return this.__wbg_ptr=t>>>0,this}finally{e.__wbindgen_add_to_stack_pointer(16)}}readDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readDir(this.__wbg_ptr,t,_))}writeFile(n,t){const _=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;return y(e.directory_writeFile(this.__wbg_ptr,_,r,b(t)))}readFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readFile(this.__wbg_ptr,t,_))}readTextFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readTextFile(this.__wbg_ptr,t,_))}createDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_createDir(this.__wbg_ptr,t,_))}removeDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_removeDir(this.__wbg_ptr,t,_))}removeFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_removeFile(this.__wbg_ptr,t,_))}}const $=new FinalizationRegistry((n=>e.__wbg_instance_free(n>>>0)));class z{static __wrap(n){n>>>=0;const e=Object.create(z.prototype);return e.__wbg_ptr=n,$.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_instance_free(n)}get stdin(){return y(e.__wbg_get_instance_stdin(this.__wbg_ptr))}get stdout(){return y(e.__wbg_get_instance_stdout(this.__wbg_ptr))}get stderr(){return y(e.__wbg_get_instance_stderr(this.__wbg_ptr))}wait(){const n=this.__destroy_into_raw();return y(e.instance_wait(n))}}const D=new FinalizationRegistry((n=>e.__wbg_readablestreamsource_free(n>>>0)));class q{static __wrap(n){n>>>=0;const e=Object.create(q.prototype);return e.__wbg_ptr=n,D.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_readablestreamsource_free(n)}pull(n){return y(e.readablestreamsource_pull(this.__wbg_ptr,b(n)))}cancel(){e.readablestreamsource_cancel(this.__wbg_ptr)}get type(){return y(e.readablestreamsource_type(this.__wbg_ptr))}}const C=new FinalizationRegistry((n=>e.__wbg_runtime_free(n>>>0)));class N{static __wrap(n){n>>>=0;const e=Object.create(N.prototype);return e.__wbg_ptr=n,C.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,C.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_runtime_free(n)}__getClassname(){let n,t;try{const i=e.__wbindgen_add_to_stack_pointer(-16);e.runtime___getClassname(i,this.__wbg_ptr);var _=l()[i/4+0],r=l()[i/4+1];return n=_,t=r,o(_,r)}finally{e.__wbindgen_add_to_stack_pointer(16),e.canonical_abi_free(n,t,1)}}constructor(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.runtime_js_new(r,f(n)?0:b(n));var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return this.__wbg_ptr=t>>>0,this}finally{e.__wbindgen_add_to_stack_pointer(16)}}static global(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.runtime_global(r,f(n)?16777215:n?1:0);var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return 0===t?void 0:N.__wrap(t)}finally{e.__wbindgen_add_to_stack_pointer(16)}}}const P=new FinalizationRegistry((n=>e.__wbg_threadpoolworker_free(n>>>0)));class G{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_threadpoolworker_free(n)}constructor(n){const t=e.threadpoolworker_new(n);return this.__wbg_ptr=t>>>0,this}handle(n){return y(e.threadpoolworker_handle(this.__wbg_ptr,b(n)))}}const Z=new FinalizationRegistry((n=>e.__wbg_trap_free(n>>>0)));class K{static __wrap(n){n>>>=0;const e=Object.create(K.prototype);return e.__wbg_ptr=n,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_trap_free(n)}static __wbg_wasmer_trap(){e.trap___wbg_wasmer_trap()}}const V=new FinalizationRegistry((n=>e.__wbg_wasmer_free(n>>>0)));class J{static __wrap(n){n>>>=0;const e=Object.create(J.prototype);return e.__wbg_ptr=n,V.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_wasmer_free(n)}get entrypoint(){const n=e.__wbg_get_wasmer_entrypoint(this.__wbg_ptr);return 0===n?void 0:U.__wrap(n)}set entrypoint(n){let t=0;f(n)||(!function(n,e){if(!(n instanceof e))throw new Error(`expected instance of ${e.name}`);n.ptr}(n,U),t=n.__destroy_into_raw()),e.__wbg_set_wasmer_entrypoint(this.__wbg_ptr,t)}get commands(){return y(e.__wbg_get_instance_stdout(this.__wbg_ptr))}set commands(n){e.__wbg_set_wasmer_commands(this.__wbg_ptr,b(n))}static fromRegistry(n,t){const _=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;return y(e.wasmer_fromRegistry(_,r,f(t)?0:b(t)))}static fromFile(n,t){return y(e.wasmer_fromFile(b(n),f(t)?0:b(t)))}}const H=new FinalizationRegistry((n=>e.__wbg_writablestreamsink_free(n>>>0)));class Q{static __wrap(n){n>>>=0;const e=Object.create(Q.prototype);return e.__wbg_ptr=n,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_writablestreamsink_free(n)}close(){return y(e.writablestreamsink_close(this.__wbg_ptr))}abort(n){e.writablestreamsink_abort(this.__wbg_ptr,b(n))}write(n){return y(e.writablestreamsink_write(this.__wbg_ptr,b(n)))}}function X(){const n={wbg:{}};return n.wbg.__wbg_new_08236689f0afb357=function(){return b(new Array)},n.wbg.__wbindgen_string_new=function(n,e){return b(o(n,e))},n.wbg.__wbg_new_c728d68b8b34487e=function(){return b(new Object)},n.wbg.__wbg_push_fd3233d09cf81821=function(n,e){return a(n).push(a(e))},n.wbg.__wbindgen_string_get=function(n,t){const _=a(t),r=\"string\"==typeof _?_:void 0;var o=f(r)?0:s(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=w;l()[n/4+1]=i,l()[n/4+0]=o},n.wbg.__wbindgen_object_clone_ref=function(n){return b(a(n))},n.wbg.__wbg_uses_87ee8532bf7067c2=function(n){const e=a(n).uses;return f(e)?0:b(e)},n.wbg.__wbg_navigator_7078da62d92ff5ad=function(n){return b(a(n).navigator)},n.wbg.__wbg_userAgent_2c548c522dca04cc=function(){return x((function(n,t){const _=s(a(t).userAgent,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_navigator_471948d3d6e10344=function(n){return b(a(n).navigator)},n.wbg.__wbg_userAgent_ec264c118b1e619c=function(){return x((function(n,t){const _=s(a(t).userAgent,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_new_d8a000788389a31e=function(n){return b(new Uint8Array(a(n)))},n.wbg.__wbg_desiredSize_800f00fde6830467=function(n,e){const t=a(e).desiredSize;v()[n/8+1]=f(t)?0:t,l()[n/4+0]=!f(t)},n.wbg.__wbg_close_3217bacea9625e8a=function(){return x((function(n){a(n).close()}),arguments)},n.wbg.__wbg_enqueue_fe34f134be0ca1bd=function(){return x((function(n,e){a(n).enqueue(a(e))}),arguments)},n.wbg.__wbg_error_32bdd65121e5c58d=function(n,e){a(n).error(a(e))},n.wbg.__wbindgen_number_new=function(n){return b(n)},n.wbg.__wbg_defineProperty_acb855411a6a5b7c=function(n,e,t){return b(Object.defineProperty(a(n),a(e),a(t)))},n.wbg.__wbg_crypto_58f13aa23ffcb166=function(n){return b(a(n).crypto)},n.wbg.__wbg_process_5b786e71d465a513=function(n){return b(a(n).process)},n.wbg.__wbg_versions_c2ab80650590b6a2=function(n){return b(a(n).versions)},n.wbg.__wbg_node_523d7bd03ef69fba=function(n){return b(a(n).node)},n.wbg.__wbindgen_is_string=function(n){return\"string\"==typeof a(n)},n.wbg.__wbg_require_2784e593a4674877=function(){return x((function(){return b(module.require)}),arguments)},n.wbg.__wbg_msCrypto_abcb1295e768d1f2=function(n){return b(a(n).msCrypto)},n.wbg.__wbg_newwithlength_13b5319ab422dcf6=function(n){return b(new Uint8Array(n>>>0))},n.wbg.__wbindgen_is_object=function(n){const e=a(n);return\"object\"==typeof e&&null!==e},n.wbg.__wbindgen_memory=function(){return b(e.memory)},n.wbg.__wbg_buffer_344d9b41efe96da7=function(n){return b(a(n).buffer)},n.wbg.__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3=function(n,e,t){return b(new Uint8Array(a(n),e>>>0,t>>>0))},n.wbg.__wbg_randomFillSync_a0d98aa11c81fe89=function(){return x((function(n,e){a(n).randomFillSync(y(e))}),arguments)},n.wbg.__wbg_getRandomValues_504510b5564925af=function(){return x((function(n,e){a(n).getRandomValues(a(e))}),arguments)},n.wbg.__wbg_get_4a9aa5157afeb382=function(n,e){return b(a(n)[e>>>0])},n.wbg.__wbg_length_cace2e0b3ddc0502=function(n){return a(n).length},n.wbg.__wbg_call_669127b9d730c650=function(){return x((function(n,e){return b(a(n).call(a(e)))}),arguments)},n.wbg.__wbg_newwithlength_045c9df8a7cc3543=function(n){return b(new Array(n>>>0))},n.wbg.__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d=function(n){let e;try{e=a(n)instanceof ArrayBuffer}catch(n){e=!1}return e},n.wbg.__wbg_toString_1a5250f284c09c9e=function(n,t,_){const r=s(a(t).toString(_),e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_message_35f9b952e1b922e2=function(n){return b(a(n).message)},n.wbg.__wbg_instanceof_Function_208feb37dc430eb3=function(n){let e;try{e=a(n)instanceof Function}catch(n){e=!1}return e},n.wbg.__wbg_apply_1c259fc7880fb101=function(){return x((function(n,e,t){return b(a(n).apply(a(e),a(t)))}),arguments)},n.wbg.__wbg_call_53fc3abd42e24ec8=function(){return x((function(n,e,t){return b(a(n).call(a(e),a(t)))}),arguments)},n.wbg.__wbg_toString_2c5d5b612e8bdd61=function(n){return b(a(n).toString())},n.wbg.__wbg_then_89e1c559530b85cf=function(n,e){return b(a(n).then(a(e)))},n.wbg.__wbg_set_dcfd613a3420f908=function(n,e,t){a(n).set(a(e),t>>>0)},n.wbg.__wbg_length_a5587d6cd79ab197=function(n){return a(n).length},n.wbg.__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1=function(n){let e;try{e=a(n)instanceof Uint8Array}catch(n){e=!1}return e},n.wbg.__wbg_subarray_6ca5cfa7fbb9abbe=function(n,e,t){return b(a(n).subarray(e>>>0,t>>>0))},n.wbg.__wbindgen_is_function=function(n){return\"function\"==typeof a(n)},n.wbg.__wbindgen_object_drop_ref=function(n){y(n)},n.wbg.__wbg_new_659d4bfe4e53c8ae=function(){return x((function(n,e){return b(new WebAssembly.Instance(a(n),a(e)))}),arguments)},n.wbg.__wbg_new_756a04b324cd462c=function(){return x((function(n){return b(new WebAssembly.Module(a(n)))}),arguments)},n.wbg.__wbg_get_3a1de47b76f3642e=function(){return x((function(n,e){return b(a(n).get(e>>>0))}),arguments)},n.wbg.__wbg_new_61bdcb895f1f9b01=function(){return x((function(n){return b(new WebAssembly.Memory(a(n)))}),arguments)},n.wbg.__wbg_self_3fad056edded10bd=function(){return x((function(){return b(self.self)}),arguments)},n.wbg.__wbg_window_a4f46c98a61d4089=function(){return x((function(){return b(window.window)}),arguments)},n.wbg.__wbg_globalThis_17eff828815f7d84=function(){return x((function(){return b(globalThis.globalThis)}),arguments)},n.wbg.__wbg_global_46f939f6541643c5=function(){return x((function(){return b(global.global)}),arguments)},n.wbg.__wbindgen_is_undefined=function(n){return void 0===a(n)},n.wbg.__wbg_newnoargs_ccdcae30fd002262=function(n,e){return b(new Function(o(n,e)))},n.wbg.__wbg_apply_2fa612c136e53eed=function(){return x((function(n,e,t){return b(Reflect.apply(a(n),a(e),a(t)))}),arguments)},n.wbg.__wbg_get_2aff440840bb6202=function(){return x((function(n,e){return b(Reflect.get(a(n),a(e)))}),arguments)},n.wbg.__wbg_set_40f7786a25a9cc7e=function(){return x((function(n,e,t){return Reflect.set(a(n),a(e),a(t))}),arguments)},n.wbg.__wbindgen_error_new=function(n,e){return b(new Error(o(n,e)))},n.wbg.__wbindgen_bigint_get_as_i64=function(n,t){const _=a(t),r=\"bigint\"==typeof _?_:void 0;(null!==p&&p.buffer===e.memory.buffer||(p=new BigInt64Array(e.memory.buffer)),p)[n/8+1]=f(r)?BigInt(0):r,l()[n/4+0]=!f(r)},n.wbg.__wbindgen_debug_string=function(n,t){const _=s(m(a(t)),e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_},n.wbg.__wbindgen_throw=function(n,e){throw new Error(o(n,e))},n.wbg.__wbindgen_rethrow=function(n){throw y(n)},n.wbg.__wbg_data_624fd2b6a4a5ac9e=function(n){return b(a(n).data)},n.wbg.__wbg_queueMicrotask_e5949c35d772a669=function(n){queueMicrotask(a(n))},n.wbg.__wbg_waitAsync_97f529b0dd0d7452=function(){return b(Atomics.waitAsync)},n.wbg.__wbg_new_66e5e8bd4064378e=function(n){return b(new Int32Array(a(n)))},n.wbg.__wbg_waitAsync_ace259c87ea1cfde=function(n,e,t){return b(Atomics.waitAsync(a(n),e,t))},n.wbg.__wbg_async_3cebb9c3c0a8b6e9=function(n){return a(n).async},n.wbg.__wbg_value_9b4d17e7284427cc=function(n){return b(a(n).value)},n.wbg.__wbg_new_feb65b865d980ae2=function(n,t){try{var _={a:n,b:t};const r=new Promise(((n,t)=>{const r=_.a;_.a=0;try{return function(n,t,_,r){e._ZN12wasm_bindgen7convert8closures11invoke2_mut17h0ec8afacbccd07f3E(n,t,b(_),b(r))}(r,_.b,n,t)}finally{_.a=r}}));return b(r)}finally{_.a=_.b=0}},n.wbg.__wbindgen_link_cb9dda2f0af60c4f=function(n){const t=s(\"data:application/javascript,\"+encodeURIComponent(\"onmessage = function (ev) {\\n let [ia, index, value] = ev.data;\\n ia = new Int32Array(ia.buffer);\\n let result = Atomics.wait(ia, index, value);\\n postMessage(result);\\n };\\n \"),e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;l()[n/4+1]=_,l()[n/4+0]=t},n.wbg.__wbg_new_db2f8178fe56090a=function(){return x((function(n,e){return b(new Worker(o(n,e)))}),arguments)},n.wbg.__wbg_setonmessage_30ed48e1f5d26fee=function(n,e){a(n).onmessage=a(e)},n.wbg.__wbg_of_5b11b7255a230e4e=function(n,e,t){return b(Array.of(a(n),a(e),a(t)))},n.wbg.__wbg_queueMicrotask_2be8b97a81fe4d00=function(n){return b(a(n).queueMicrotask)},n.wbg.__wbg_resolve_a3252b2860f0a09e=function(n){return b(Promise.resolve(a(n)))},n.wbg.__wbg_then_1bbc9edafd859b06=function(n,e,t){return b(a(n).then(a(e),a(t)))},n.wbg.__wbindgen_cb_drop=function(n){const e=y(n).original;if(1==e.cnt--)return e.a=0,!0;return!1},n.wbg.__wbg_byteLength_8903f453a3a8a1df=function(n){return a(n).byteLength},n.wbg.__wbg_exports_287124f54574699c=function(n){return b(WebAssembly.Module.exports(a(n)))},n.wbg.__wbg_for_fe237e14961c3b46=function(n,e){return b(Symbol.for(o(n,e)))},n.wbg.__wbindgen_number_get=function(n,e){const t=a(e),_=\"number\"==typeof t?t:void 0;v()[n/8+1]=f(_)?0:_,l()[n/4+0]=!f(_)},n.wbg.__wbg_getPrototypeOf_efd9ac7664cb1602=function(){return x((function(n){return b(Reflect.getPrototypeOf(a(n)))}),arguments)},n.wbg.__wbg_constructor_3f5002261d14fb30=function(n){return b(a(n).constructor)},n.wbg.__wbg_trap_new=function(n){return b(K.__wrap(n))},n.wbg.__wbg_value_442d6ccca6c89da5=function(n){return b(a(n).value)},n.wbg.__wbg_setvalue_d01c3234a2663552=function(n,e){a(n).value=a(e)},n.wbg.__wbg_instanceof_Error_9f5881c3c4149389=function(n){let e;try{e=a(n)instanceof Error}catch(n){e=!1}return e},n.wbg.__wbg_imports_849227f7280907ef=function(n){return b(WebAssembly.Module.imports(a(n)))},n.wbg.__wbg_instanceof_Object_3c95bd459efa5c3c=function(n){let e;try{e=a(n)instanceof Object}catch(n){e=!1}return e},n.wbg.__wbg_grow_51233537037b47cc=function(){return x((function(n,e){return a(n).grow(e>>>0)}),arguments)},n.wbg.__wbg_instanceof_RangeError_dd0fad3a217d8897=function(n){let e;try{e=a(n)instanceof RangeError}catch(n){e=!1}return e},n.wbg.__wbg_buffer_b334b57bee6f611b=function(n){return b(a(n).buffer)},n.wbg.__wbg_send_a4612d3a60b1dbb4=function(){return x((function(n,e){a(n).send(a(e))}),arguments)},n.wbg.__wbg_new_b9b318679315404f=function(){return x((function(n,e){return b(new WebSocket(o(n,e)))}),arguments)},n.wbg.__wbg_setonopen_b2a170d59c1abe88=function(n,e){a(n).onopen=a(e)},n.wbg.__wbg_setonclose_4527668a5c065333=function(n,e){a(n).onclose=a(e)},n.wbg.__wbg_new_b71bf93085f9d631=function(){return x((function(){return b(new FileReader)}),arguments)},n.wbg.__wbg_setonloadend_88fd301cd09da25d=function(n,e){a(n).onloadend=a(e)},n.wbg.__wbg_setbinaryType_dcb62e0f2b346301=function(n,e){a(n).binaryType=y(e)},n.wbg.__wbg_setonmessage_eb44f51ef6e7e0e8=function(n,e){a(n).onmessage=a(e)},n.wbg.__wbg_grow_f711696a8328da3c=function(n,e){return a(n).grow(e>>>0)},n.wbg.__wbg_hardwareConcurrency_b858ff012f3ad0fb=function(n){return a(n).hardwareConcurrency},n.wbg.__wbg_hardwareConcurrency_67b658b8df300eb5=function(n){return a(n).hardwareConcurrency},n.wbg.__wbg_isSafeInteger_c38b0a16d0c7cef7=function(n){return Number.isSafeInteger(a(n))},n.wbg.__wbindgen_jsval_loose_eq=function(n,e){return a(n)==a(e)},n.wbg.__wbindgen_boolean_get=function(n){const e=a(n);return\"boolean\"==typeof e?e?1:0:2},n.wbg.__wbindgen_is_bigint=function(n){return\"bigint\"==typeof a(n)},n.wbg.__wbindgen_bigint_from_u64=function(n){return b(BigInt.asUintN(64,n))},n.wbg.__wbindgen_jsval_eq=function(n,e){return a(n)===a(e)},n.wbg.__wbg_BigInt_9cc4d66dcbf0216e=function(n){return b(BigInt(a(n)))},n.wbg.__wbindgen_ge=function(n,e){return a(n)>=a(e)},n.wbg.__wbg_newwithu8arraysequenceandoptions_f520ece5c28a5211=function(){return x((function(n,e){return b(new Blob(a(n),a(e)))}),arguments)},n.wbg.__wbg_createObjectURL_86955f30bbed45eb=function(){return x((function(n,t){const _=s(URL.createObjectURL(a(t)),e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_terminate_159911c61944a361=function(n){a(n).terminate()},n.wbg.__wbg_lineno_4506d18a0b25cca2=function(n){return a(n).lineno},n.wbg.__wbg_colno_19ebfec79bfd789d=function(n){return a(n).colno},n.wbg.__wbg_assert_aa771cfef9582df7=function(n,e){console.assert(0!==n,a(e))},n.wbg.__wbg_new_abda76e883ba8a5f=function(){return b(new Error)},n.wbg.__wbg_stack_658279fe44541cf6=function(n,t){const _=s(a(t).stack,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_},n.wbg.__wbg_error_f851667af71bcfc6=function(n,t){let _,r;try{_=n,r=t,console.error(o(n,t))}finally{e.canonical_abi_free(_,r,1)}},n.wbg.__wbg_instanceof_TypeError_9282fd7df97806a0=function(n){let e;try{e=a(n)instanceof TypeError}catch(n){e=!1}return e},n.wbg.__wbg_wasmer_new=function(n){return b(J.__wrap(n))},n.wbg.__wbg_new_ab87fd305ed9004b=function(n,e){return b(new Error(o(n,e)))},n.wbg.__wbg_instance_new=function(n){return b(z.__wrap(n))},n.wbg.__wbg_read_55c1f4e3f3729816=function(n){return b(a(n).read())},n.wbg.__wbindgen_is_falsy=function(n){return!a(n)},n.wbg.__wbg_instanceof_Blob_bd674d851f2d730d=function(n){let e;try{e=a(n)instanceof Blob}catch(n){e=!1}return e},n.wbg.__wbg_readAsArrayBuffer_55965fe069b748b7=function(){return x((function(n,e){a(n).readAsArrayBuffer(a(e))}),arguments)},n.wbg.__wbg_result_5e08da49132b9af2=function(){return x((function(n){return b(a(n).result)}),arguments)},n.wbg.__wbg_instanceof_Module_7b9e1eae1becb87c=function(n){let e;try{e=a(n)instanceof WebAssembly.Module}catch(n){e=!1}return e},n.wbg.__wbg_static_accessor_IMPORT_META_URL_3be0dba93f76ed43=function(n){const t=s(import.meta.url,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;l()[n/4+1]=_,l()[n/4+0]=t},n.wbg.__wbg_log_7811587c4c6d2844=function(n){console.log(a(n))},n.wbg.__wbg_byteLength_206a04415dea52a7=function(n){return a(n).byteLength},n.wbg.__wbg_instanceof_DedicatedWorkerGlobalScope_4cabe735c12f6f62=function(n){let e;try{e=a(n)instanceof DedicatedWorkerGlobalScope}catch(n){e=!1}return e},n.wbg.__wbg_postMessage_08d9966515d3437e=function(){return x((function(n,e){a(n).postMessage(a(e))}),arguments)},n.wbg.__wbg_args_4d15d7afb42e284d=function(n){const e=a(n).args;return f(e)?0:b(e)},n.wbg.__wbg_env_ad8595f2986ecc88=function(n){return b(a(n).env)},n.wbg.__wbg_new_a8d206e6b5c455e8=function(n,e){return b(new TypeError(o(n,e)))},n.wbg.__wbg_mount_6bbd20e7e89111c6=function(n){return b(a(n).mount)},n.wbg.__wbg_stdin_00c789dbac01e87a=function(n){const e=a(n).stdin;return f(e)?0:b(e)},n.wbg.__wbg_command_new=function(n){return b(U.__wrap(n))},n.wbg.__wbg_registry_3c50a218bff1b9c2=function(n){const e=a(n).registry;return f(e)?0:b(e)},n.wbg.__wbindgen_is_null=function(n){return null===a(n)},n.wbg.__wbg_apiKey_45d9470ec7a59981=function(n,t){const _=a(t).apiKey;var r=f(_)?0:s(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_networkGateway_19db657660e81113=function(n,t){const _=a(t).networkGateway;var r=f(_)?0:s(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_program_86b0cb49d1fef987=function(n){return b(a(n).program)},n.wbg.__wbg_runtime_0041006d6e1bcee1=function(n){return b(a(n).runtime)},n.wbg.__wbg_instanceof_Window_cde2416cf5126a72=function(n){let e;try{e=a(n)instanceof Window}catch(n){e=!1}return e},n.wbg.__wbg_setTimeout_07866af1a1842093=function(){return x((function(n,e,t){return a(n).setTimeout(a(e),t)}),arguments)},n.wbg.__wbg_setTimeout_a7009fb086494628=function(){return x((function(n,e,t){return a(n).setTimeout(a(e),t)}),arguments)},n.wbg.__wbg_keys_1af6085b03973487=function(n){return b(Object.keys(a(n)))},n.wbg.__wbg_is_c74aa9bb973d6109=function(n,e){return Object.is(a(n),a(e))},n.wbg.__wbindgen_lt=function(n,e){return a(n)>a(e))},n.wbg.__wbindgen_bigint_from_i64=function(n){return b(n)},n.wbg.__wbindgen_bigint_from_u128=function(n,e){return b(BigInt.asUintN(64,n)<n(void 0,void 0,void 0,(function*(){if(!e){let n=\"https://unpkg.com/@wasmer/sdk@0.6.0/dist/wasmer_js_bg.wasm\";n&&(e=new URL(n))}return tn(e,t)})),rn=()=>{let n=\"https://unpkg.com/@wasmer/sdk@0.6.0/dist/WasmerSDK.js\";n&&j(n)};globalThis.__WASMER_INTERNALS__={ThreadPoolWorker:G,init:_n},globalThis.$RefreshReg$=globalThis.$RefreshReg$||function(){},globalThis.$RefreshSig$=globalThis.$RefreshSig$||function(){return function(){}};export{U as Command,L as Directory,z as Instance,q as ReadableStreamSource,N as Runtime,G as ThreadPoolWorker,K as Trap,J as Wasmer,Q as WritableStreamSink,_n as init,en as initSync,M as initializeLogger,E as on_start,O as runWasix,rn as setDefaultWorkerUrl,j as setWorkerUrl,F as wat2wasm};\n", "import { Directory, init, initSync, Wasmer } from '@wasmer/sdk';\n\nconst main = async ({\n data,\n}: {\n data: { code: number[]; args: string; input: string };\n}) => {\n const { code, args, input } = data;\n\n // await init();\n initSync(wasmUrl);\n\n const pkg = await Wasmer.fromRegistry('python/python');\n\n const instance = await pkg.entrypoint.run({\n args: args.split('\\n'),\n stdin: Uint8Array.from(input.split('').map((c) => c.charCodeAt(0))),\n mount: {\n '/out': new Directory(),\n '/src': {\n 'main.py': new Uint8Array(code),\n },\n },\n });\n\n const { code: exitCode, stdout, stderr } = await instance.wait();\n\n postMessage({\n type: 'output',\n output: stdout,\n });\n\n postMessage({\n type: 'output',\n error: stderr,\n });\n\n console.log(`Python exited with ${exitCode}: ${stdout}`);\n};\n\naddEventListener('message', (data) =>\n main(data).then(() =>\n postMessage({\n type: 'done',\n })\n )\n);\n"], - "mappings": "MAAA,IAAAA,GAAA,GAUA,SAASC,GAAEA,EAAEC,EAAEC,EAAEC,EAAE,CAAC,OAAO,IAAID,IAAIA,EAAE,UAAW,SAASE,EAAEC,EAAE,CAAC,SAASC,EAAEN,EAAE,CAAC,GAAG,CAACO,EAAEJ,EAAE,KAAKH,CAAC,CAAC,CAAC,OAAOA,EAAE,CAACK,EAAEL,CAAC,CAAC,CAAC,CAAC,SAASQ,EAAER,EAAE,CAAC,GAAG,CAACO,EAAEJ,EAAE,MAAMH,CAAC,CAAC,CAAC,OAAOA,EAAE,CAACK,EAAEL,CAAC,CAAC,CAAC,CAAC,SAASO,EAAEP,EAA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ACZ,OAAQ,CACN,UAAW,IAAI,WAAWN,CAAI,CAChC,CACF,CACF,CAAC,EAEK,CAAE,KAAMO,EAAU,OAAAC,EAAQ,OAAAC,CAAO,EAAI,MAAMN,EAAS,KAAK,EAE/D,YAAY,CACV,KAAM,SACN,OAAQK,CACV,CAAC,EAED,YAAY,CACV,KAAM,SACN,MAAOC,CACT,CAAC,EAED,QAAQ,IAAI,sBAAsBF,CAAQ,KAAKC,CAAM,EAAE,CACzD,EAEA,iBAAiB,UAAYT,GAC3BD,GAAKC,CAAI,EAAE,KAAK,IACd,YAAY,CACV,KAAM,MACR,CAAC,CACH,CACF", - "names": ["import_meta", "n", "e", "t", "_", "r", "o", "i", "b", "c", "t", "_", "r", "e", "o", "n", "i", "c", "b", "a", "w", "u", "g", "s", "f", "d", "l", "y", "p", "m", "h", "v", "A", "k", "R", "T", "W", "S", "x", "I", "n", "e", "U", "_U", "y", "b", "f", "B", "L", "t", "i", "_", "l", "r", "o", "s", "w", "$", "z", "_z", "D", "q", "_q", "C", "P", "n", "e", "G", "t", "y", "b", "Z", "K", "_K", "V", "J", "_J", "U", "f", "_", "s", "r", "w", "Q", "_Q", "X", "o", "a", "i", "l", "x", "v", "p", "m", "z", "import_meta", "q", "tn", "k", "R", "T", "W", "S", "Y", "h", "d", "_n", "G", "_n", "main", "data", "code", "args", "input", "instance", "J", "c", "L", "exitCode", "stdout", "stderr"] + "sourcesContent": ["/*!\n * @wasmer/sdk\n * Isomorphic Javascript library for interacting with WASI Modules in Node.js and the Browser.\n *\n * @version v0.6.0\n * @author Wasmer Engineering Team \n * @homepage https://github.com/wasmerio/wasmer-js\n * @repository git+https://github.com/wasmerio/wasmer-js.git\n * @license MIT\n */\nfunction n(n,e,t,_){return new(t||(t=Promise))((function(r,o){function i(n){try{b(_.next(n))}catch(n){o(n)}}function c(n){try{b(_.throw(n))}catch(n){o(n)}}function b(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(i,c)}b((_=_.apply(n,e||[])).next())}))}let e;\"function\"==typeof SuppressedError&&SuppressedError;const t=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf-8\",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error(\"TextDecoder not available\")}};\"undefined\"!=typeof TextDecoder&&t.decode();let _=null;function r(){return null!==_&&_.buffer===e.memory.buffer||(_=new Uint8Array(e.memory.buffer)),_}function o(n,e){return n>>>=0,t.decode(r().slice(n,n+e))}const i=new Array(128).fill(void 0);i.push(void 0,null,!0,!1);let c=i.length;function b(n){c===i.length&&i.push(i.length+1);const e=c;return c=i[e],i[e]=n,e}function a(n){return i[n]}let w=0;const u=\"undefined\"!=typeof TextEncoder?new TextEncoder(\"utf-8\"):{encode:()=>{throw Error(\"TextEncoder not available\")}},g=function(n,e){const t=u.encode(n);return e.set(t),{read:n.length,written:t.length}};function s(n,e,t){if(void 0===t){const t=u.encode(n),_=e(t.length,1)>>>0;return r().subarray(_,_+t.length).set(t),w=t.length,_}let _=n.length,o=e(_,1)>>>0;const i=r();let c=0;for(;c<_;c++){const e=n.charCodeAt(c);if(e>127)break;i[o+c]=e}if(c!==_){0!==c&&(n=n.slice(c)),o=t(o,_,_=c+3*n.length,1)>>>0;const e=r().subarray(o+c,o+_);c+=g(n,e).written}return w=c,o}function f(n){return null==n}let d=null;function l(){return null!==d&&d.buffer===e.memory.buffer||(d=new Int32Array(e.memory.buffer)),d}function y(n){const e=a(n);return function(n){n<132||(i[n]=c,c=n)}(n),e}let p=null;function m(n){const e=typeof n;if(\"number\"==e||\"boolean\"==e||null==n)return`${n}`;if(\"string\"==e)return`\"${n}\"`;if(\"symbol\"==e){const e=n.description;return null==e?\"Symbol\":`Symbol(${e})`}if(\"function\"==e){const e=n.name;return\"string\"==typeof e&&e.length>0?`Function(${e})`:\"Function\"}if(Array.isArray(n)){const e=n.length;let t=\"[\";e>0&&(t+=m(n[0]));for(let _=1;_1))return toString.call(n);if(_=t[1],\"Object\"==_)try{return\"Object(\"+JSON.stringify(n)+\")\"}catch(n){return\"Object\"}return n instanceof Error?`${n.name}: ${n.message}\\n${n.stack}`:_}let h=null;function v(){return null!==h&&h.buffer===e.memory.buffer||(h=new Float64Array(e.memory.buffer)),h}const A=new FinalizationRegistry((n=>{e.__wbindgen_export_3.get(n.dtor)(n.a,n.b)}));function k(n,t,_,r){const o={a:n,b:t,cnt:1,dtor:_},i=(...n)=>{o.cnt++;const t=o.a;o.a=0;try{return r(t,o.b,...n)}finally{0==--o.cnt?(e.__wbindgen_export_3.get(o.dtor)(t,o.b),A.unregister(o)):o.a=t}};return i.original=o,A.register(i,o,o),i}function R(n,t,_){e._ZN12wasm_bindgen7convert8closures11invoke1_mut17h39693afad0d92ad2E(n,t,b(_))}function T(n,t,_,r){const o={a:n,b:t,cnt:1,dtor:_},i=(...n)=>{o.cnt++;try{return r(o.a,o.b,...n)}finally{0==--o.cnt&&(e.__wbindgen_export_3.get(o.dtor)(o.a,o.b),o.a=0,A.unregister(o))}};return i.original=o,A.register(i,o,o),i}function W(n,t){return y(e._ZN129__LT_dyn_u20_core__ops__function__Fn_LT__LP__RP__GT__u2b_Output_u20__u3d__u20_R_u20_as_u20_wasm_bindgen__closure__WasmClosure_GT_8describe6invoke17h613009e110396e8aE(n,t))}function S(n,t,_){return e._ZN12wasm_bindgen7convert8closures7invoke117h27cd5385e9d886a8E(n,t,b(_))}function x(n,t){try{return n.apply(this,t)}catch(n){e.__wbindgen_exn_store(b(n))}}function F(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16),o=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),i=w;e.wat2wasm(r,o,i);var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return y(t)}finally{e.__wbindgen_add_to_stack_pointer(16)}}function E(){e.on_start()}function j(n){e.setWorkerUrl(b(n))}function O(n,t){return y(e.runWasix(b(n),b(t)))}function M(n){try{const o=e.__wbindgen_add_to_stack_pointer(-16);var t=f(n)?0:s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;e.initializeLogger(o,t,_);var r=l()[o/4+0];if(l()[o/4+1])throw y(r)}finally{e.__wbindgen_add_to_stack_pointer(16)}}const I=new FinalizationRegistry((n=>e.__wbg_command_free(n>>>0)));class U{static __wrap(n){n>>>=0;const e=Object.create(U.prototype);return e.__wbg_ptr=n,I.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,I.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_command_free(n)}get name(){return y(e.__wbg_get_command_name(this.__wbg_ptr))}set name(n){e.__wbg_set_command_name(this.__wbg_ptr,b(n))}run(n){return y(e.command_run(this.__wbg_ptr,f(n)?0:b(n)))}binary(){return y(e.command_binary(this.__wbg_ptr))}}const B=new FinalizationRegistry((n=>e.__wbg_directory_free(n>>>0)));class L{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,B.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_directory_free(n)}__getClassname(){let n,t;try{const i=e.__wbindgen_add_to_stack_pointer(-16);e.directory___getClassname(i,this.__wbg_ptr);var _=l()[i/4+0],r=l()[i/4+1];return n=_,t=r,o(_,r)}finally{e.__wbindgen_add_to_stack_pointer(16),e.canonical_abi_free(n,t,1)}}constructor(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.directory_new(r,f(n)?0:b(n));var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return this.__wbg_ptr=t>>>0,this}finally{e.__wbindgen_add_to_stack_pointer(16)}}readDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readDir(this.__wbg_ptr,t,_))}writeFile(n,t){const _=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;return y(e.directory_writeFile(this.__wbg_ptr,_,r,b(t)))}readFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readFile(this.__wbg_ptr,t,_))}readTextFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_readTextFile(this.__wbg_ptr,t,_))}createDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_createDir(this.__wbg_ptr,t,_))}removeDir(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_removeDir(this.__wbg_ptr,t,_))}removeFile(n){const t=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;return y(e.directory_removeFile(this.__wbg_ptr,t,_))}}const $=new FinalizationRegistry((n=>e.__wbg_instance_free(n>>>0)));class z{static __wrap(n){n>>>=0;const e=Object.create(z.prototype);return e.__wbg_ptr=n,$.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_instance_free(n)}get stdin(){return y(e.__wbg_get_instance_stdin(this.__wbg_ptr))}get stdout(){return y(e.__wbg_get_instance_stdout(this.__wbg_ptr))}get stderr(){return y(e.__wbg_get_instance_stderr(this.__wbg_ptr))}wait(){const n=this.__destroy_into_raw();return y(e.instance_wait(n))}}const D=new FinalizationRegistry((n=>e.__wbg_readablestreamsource_free(n>>>0)));class q{static __wrap(n){n>>>=0;const e=Object.create(q.prototype);return e.__wbg_ptr=n,D.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_readablestreamsource_free(n)}pull(n){return y(e.readablestreamsource_pull(this.__wbg_ptr,b(n)))}cancel(){e.readablestreamsource_cancel(this.__wbg_ptr)}get type(){return y(e.readablestreamsource_type(this.__wbg_ptr))}}const C=new FinalizationRegistry((n=>e.__wbg_runtime_free(n>>>0)));class N{static __wrap(n){n>>>=0;const e=Object.create(N.prototype);return e.__wbg_ptr=n,C.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,C.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_runtime_free(n)}__getClassname(){let n,t;try{const i=e.__wbindgen_add_to_stack_pointer(-16);e.runtime___getClassname(i,this.__wbg_ptr);var _=l()[i/4+0],r=l()[i/4+1];return n=_,t=r,o(_,r)}finally{e.__wbindgen_add_to_stack_pointer(16),e.canonical_abi_free(n,t,1)}}constructor(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.runtime_js_new(r,f(n)?0:b(n));var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return this.__wbg_ptr=t>>>0,this}finally{e.__wbindgen_add_to_stack_pointer(16)}}static global(n){try{const r=e.__wbindgen_add_to_stack_pointer(-16);e.runtime_global(r,f(n)?16777215:n?1:0);var t=l()[r/4+0],_=l()[r/4+1];if(l()[r/4+2])throw y(_);return 0===t?void 0:N.__wrap(t)}finally{e.__wbindgen_add_to_stack_pointer(16)}}}const P=new FinalizationRegistry((n=>e.__wbg_threadpoolworker_free(n>>>0)));class G{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_threadpoolworker_free(n)}constructor(n){const t=e.threadpoolworker_new(n);return this.__wbg_ptr=t>>>0,this}handle(n){return y(e.threadpoolworker_handle(this.__wbg_ptr,b(n)))}}const Z=new FinalizationRegistry((n=>e.__wbg_trap_free(n>>>0)));class K{static __wrap(n){n>>>=0;const e=Object.create(K.prototype);return e.__wbg_ptr=n,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_trap_free(n)}static __wbg_wasmer_trap(){e.trap___wbg_wasmer_trap()}}const V=new FinalizationRegistry((n=>e.__wbg_wasmer_free(n>>>0)));class J{static __wrap(n){n>>>=0;const e=Object.create(J.prototype);return e.__wbg_ptr=n,V.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_wasmer_free(n)}get entrypoint(){const n=e.__wbg_get_wasmer_entrypoint(this.__wbg_ptr);return 0===n?void 0:U.__wrap(n)}set entrypoint(n){let t=0;f(n)||(!function(n,e){if(!(n instanceof e))throw new Error(`expected instance of ${e.name}`);n.ptr}(n,U),t=n.__destroy_into_raw()),e.__wbg_set_wasmer_entrypoint(this.__wbg_ptr,t)}get commands(){return y(e.__wbg_get_instance_stdout(this.__wbg_ptr))}set commands(n){e.__wbg_set_wasmer_commands(this.__wbg_ptr,b(n))}static fromRegistry(n,t){const _=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;return y(e.wasmer_fromRegistry(_,r,f(t)?0:b(t)))}static fromFile(n,t){return y(e.wasmer_fromFile(b(n),f(t)?0:b(t)))}}const H=new FinalizationRegistry((n=>e.__wbg_writablestreamsink_free(n>>>0)));class Q{static __wrap(n){n>>>=0;const e=Object.create(Q.prototype);return e.__wbg_ptr=n,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),n}free(){const n=this.__destroy_into_raw();e.__wbg_writablestreamsink_free(n)}close(){return y(e.writablestreamsink_close(this.__wbg_ptr))}abort(n){e.writablestreamsink_abort(this.__wbg_ptr,b(n))}write(n){return y(e.writablestreamsink_write(this.__wbg_ptr,b(n)))}}function X(){const n={wbg:{}};return n.wbg.__wbg_new_08236689f0afb357=function(){return b(new Array)},n.wbg.__wbindgen_string_new=function(n,e){return b(o(n,e))},n.wbg.__wbg_new_c728d68b8b34487e=function(){return b(new Object)},n.wbg.__wbg_push_fd3233d09cf81821=function(n,e){return a(n).push(a(e))},n.wbg.__wbindgen_string_get=function(n,t){const _=a(t),r=\"string\"==typeof _?_:void 0;var o=f(r)?0:s(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=w;l()[n/4+1]=i,l()[n/4+0]=o},n.wbg.__wbindgen_object_clone_ref=function(n){return b(a(n))},n.wbg.__wbg_uses_87ee8532bf7067c2=function(n){const e=a(n).uses;return f(e)?0:b(e)},n.wbg.__wbg_navigator_7078da62d92ff5ad=function(n){return b(a(n).navigator)},n.wbg.__wbg_userAgent_2c548c522dca04cc=function(){return x((function(n,t){const _=s(a(t).userAgent,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_navigator_471948d3d6e10344=function(n){return b(a(n).navigator)},n.wbg.__wbg_userAgent_ec264c118b1e619c=function(){return x((function(n,t){const _=s(a(t).userAgent,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_new_d8a000788389a31e=function(n){return b(new Uint8Array(a(n)))},n.wbg.__wbg_desiredSize_800f00fde6830467=function(n,e){const t=a(e).desiredSize;v()[n/8+1]=f(t)?0:t,l()[n/4+0]=!f(t)},n.wbg.__wbg_close_3217bacea9625e8a=function(){return x((function(n){a(n).close()}),arguments)},n.wbg.__wbg_enqueue_fe34f134be0ca1bd=function(){return x((function(n,e){a(n).enqueue(a(e))}),arguments)},n.wbg.__wbg_error_32bdd65121e5c58d=function(n,e){a(n).error(a(e))},n.wbg.__wbindgen_number_new=function(n){return b(n)},n.wbg.__wbg_defineProperty_acb855411a6a5b7c=function(n,e,t){return b(Object.defineProperty(a(n),a(e),a(t)))},n.wbg.__wbg_crypto_58f13aa23ffcb166=function(n){return b(a(n).crypto)},n.wbg.__wbg_process_5b786e71d465a513=function(n){return b(a(n).process)},n.wbg.__wbg_versions_c2ab80650590b6a2=function(n){return b(a(n).versions)},n.wbg.__wbg_node_523d7bd03ef69fba=function(n){return b(a(n).node)},n.wbg.__wbindgen_is_string=function(n){return\"string\"==typeof a(n)},n.wbg.__wbg_require_2784e593a4674877=function(){return x((function(){return b(module.require)}),arguments)},n.wbg.__wbg_msCrypto_abcb1295e768d1f2=function(n){return b(a(n).msCrypto)},n.wbg.__wbg_newwithlength_13b5319ab422dcf6=function(n){return b(new Uint8Array(n>>>0))},n.wbg.__wbindgen_is_object=function(n){const e=a(n);return\"object\"==typeof e&&null!==e},n.wbg.__wbindgen_memory=function(){return b(e.memory)},n.wbg.__wbg_buffer_344d9b41efe96da7=function(n){return b(a(n).buffer)},n.wbg.__wbg_newwithbyteoffsetandlength_2dc04d99088b15e3=function(n,e,t){return b(new Uint8Array(a(n),e>>>0,t>>>0))},n.wbg.__wbg_randomFillSync_a0d98aa11c81fe89=function(){return x((function(n,e){a(n).randomFillSync(y(e))}),arguments)},n.wbg.__wbg_getRandomValues_504510b5564925af=function(){return x((function(n,e){a(n).getRandomValues(a(e))}),arguments)},n.wbg.__wbg_get_4a9aa5157afeb382=function(n,e){return b(a(n)[e>>>0])},n.wbg.__wbg_length_cace2e0b3ddc0502=function(n){return a(n).length},n.wbg.__wbg_call_669127b9d730c650=function(){return x((function(n,e){return b(a(n).call(a(e)))}),arguments)},n.wbg.__wbg_newwithlength_045c9df8a7cc3543=function(n){return b(new Array(n>>>0))},n.wbg.__wbg_instanceof_ArrayBuffer_c7cc317e5c29cc0d=function(n){let e;try{e=a(n)instanceof ArrayBuffer}catch(n){e=!1}return e},n.wbg.__wbg_toString_1a5250f284c09c9e=function(n,t,_){const r=s(a(t).toString(_),e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_message_35f9b952e1b922e2=function(n){return b(a(n).message)},n.wbg.__wbg_instanceof_Function_208feb37dc430eb3=function(n){let e;try{e=a(n)instanceof Function}catch(n){e=!1}return e},n.wbg.__wbg_apply_1c259fc7880fb101=function(){return x((function(n,e,t){return b(a(n).apply(a(e),a(t)))}),arguments)},n.wbg.__wbg_call_53fc3abd42e24ec8=function(){return x((function(n,e,t){return b(a(n).call(a(e),a(t)))}),arguments)},n.wbg.__wbg_toString_2c5d5b612e8bdd61=function(n){return b(a(n).toString())},n.wbg.__wbg_then_89e1c559530b85cf=function(n,e){return b(a(n).then(a(e)))},n.wbg.__wbg_set_dcfd613a3420f908=function(n,e,t){a(n).set(a(e),t>>>0)},n.wbg.__wbg_length_a5587d6cd79ab197=function(n){return a(n).length},n.wbg.__wbg_instanceof_Uint8Array_19e6f142a5e7e1e1=function(n){let e;try{e=a(n)instanceof Uint8Array}catch(n){e=!1}return e},n.wbg.__wbg_subarray_6ca5cfa7fbb9abbe=function(n,e,t){return b(a(n).subarray(e>>>0,t>>>0))},n.wbg.__wbindgen_is_function=function(n){return\"function\"==typeof a(n)},n.wbg.__wbindgen_object_drop_ref=function(n){y(n)},n.wbg.__wbg_new_659d4bfe4e53c8ae=function(){return x((function(n,e){return b(new WebAssembly.Instance(a(n),a(e)))}),arguments)},n.wbg.__wbg_new_756a04b324cd462c=function(){return x((function(n){return b(new WebAssembly.Module(a(n)))}),arguments)},n.wbg.__wbg_get_3a1de47b76f3642e=function(){return x((function(n,e){return b(a(n).get(e>>>0))}),arguments)},n.wbg.__wbg_new_61bdcb895f1f9b01=function(){return x((function(n){return b(new WebAssembly.Memory(a(n)))}),arguments)},n.wbg.__wbg_self_3fad056edded10bd=function(){return x((function(){return b(self.self)}),arguments)},n.wbg.__wbg_window_a4f46c98a61d4089=function(){return x((function(){return b(window.window)}),arguments)},n.wbg.__wbg_globalThis_17eff828815f7d84=function(){return x((function(){return b(globalThis.globalThis)}),arguments)},n.wbg.__wbg_global_46f939f6541643c5=function(){return x((function(){return b(global.global)}),arguments)},n.wbg.__wbindgen_is_undefined=function(n){return void 0===a(n)},n.wbg.__wbg_newnoargs_ccdcae30fd002262=function(n,e){return b(new Function(o(n,e)))},n.wbg.__wbg_apply_2fa612c136e53eed=function(){return x((function(n,e,t){return b(Reflect.apply(a(n),a(e),a(t)))}),arguments)},n.wbg.__wbg_get_2aff440840bb6202=function(){return x((function(n,e){return b(Reflect.get(a(n),a(e)))}),arguments)},n.wbg.__wbg_set_40f7786a25a9cc7e=function(){return x((function(n,e,t){return Reflect.set(a(n),a(e),a(t))}),arguments)},n.wbg.__wbindgen_error_new=function(n,e){return b(new Error(o(n,e)))},n.wbg.__wbindgen_bigint_get_as_i64=function(n,t){const _=a(t),r=\"bigint\"==typeof _?_:void 0;(null!==p&&p.buffer===e.memory.buffer||(p=new BigInt64Array(e.memory.buffer)),p)[n/8+1]=f(r)?BigInt(0):r,l()[n/4+0]=!f(r)},n.wbg.__wbindgen_debug_string=function(n,t){const _=s(m(a(t)),e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_},n.wbg.__wbindgen_throw=function(n,e){throw new Error(o(n,e))},n.wbg.__wbindgen_rethrow=function(n){throw y(n)},n.wbg.__wbg_data_624fd2b6a4a5ac9e=function(n){return b(a(n).data)},n.wbg.__wbg_queueMicrotask_e5949c35d772a669=function(n){queueMicrotask(a(n))},n.wbg.__wbg_waitAsync_97f529b0dd0d7452=function(){return b(Atomics.waitAsync)},n.wbg.__wbg_new_66e5e8bd4064378e=function(n){return b(new Int32Array(a(n)))},n.wbg.__wbg_waitAsync_ace259c87ea1cfde=function(n,e,t){return b(Atomics.waitAsync(a(n),e,t))},n.wbg.__wbg_async_3cebb9c3c0a8b6e9=function(n){return a(n).async},n.wbg.__wbg_value_9b4d17e7284427cc=function(n){return b(a(n).value)},n.wbg.__wbg_new_feb65b865d980ae2=function(n,t){try{var _={a:n,b:t};const r=new Promise(((n,t)=>{const r=_.a;_.a=0;try{return function(n,t,_,r){e._ZN12wasm_bindgen7convert8closures11invoke2_mut17h0ec8afacbccd07f3E(n,t,b(_),b(r))}(r,_.b,n,t)}finally{_.a=r}}));return b(r)}finally{_.a=_.b=0}},n.wbg.__wbindgen_link_cb9dda2f0af60c4f=function(n){const t=s(\"data:application/javascript,\"+encodeURIComponent(\"onmessage = function (ev) {\\n let [ia, index, value] = ev.data;\\n ia = new Int32Array(ia.buffer);\\n let result = Atomics.wait(ia, index, value);\\n postMessage(result);\\n };\\n \"),e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;l()[n/4+1]=_,l()[n/4+0]=t},n.wbg.__wbg_new_db2f8178fe56090a=function(){return x((function(n,e){return b(new Worker(o(n,e)))}),arguments)},n.wbg.__wbg_setonmessage_30ed48e1f5d26fee=function(n,e){a(n).onmessage=a(e)},n.wbg.__wbg_of_5b11b7255a230e4e=function(n,e,t){return b(Array.of(a(n),a(e),a(t)))},n.wbg.__wbg_queueMicrotask_2be8b97a81fe4d00=function(n){return b(a(n).queueMicrotask)},n.wbg.__wbg_resolve_a3252b2860f0a09e=function(n){return b(Promise.resolve(a(n)))},n.wbg.__wbg_then_1bbc9edafd859b06=function(n,e,t){return b(a(n).then(a(e),a(t)))},n.wbg.__wbindgen_cb_drop=function(n){const e=y(n).original;if(1==e.cnt--)return e.a=0,!0;return!1},n.wbg.__wbg_byteLength_8903f453a3a8a1df=function(n){return a(n).byteLength},n.wbg.__wbg_exports_287124f54574699c=function(n){return b(WebAssembly.Module.exports(a(n)))},n.wbg.__wbg_for_fe237e14961c3b46=function(n,e){return b(Symbol.for(o(n,e)))},n.wbg.__wbindgen_number_get=function(n,e){const t=a(e),_=\"number\"==typeof t?t:void 0;v()[n/8+1]=f(_)?0:_,l()[n/4+0]=!f(_)},n.wbg.__wbg_getPrototypeOf_efd9ac7664cb1602=function(){return x((function(n){return b(Reflect.getPrototypeOf(a(n)))}),arguments)},n.wbg.__wbg_constructor_3f5002261d14fb30=function(n){return b(a(n).constructor)},n.wbg.__wbg_trap_new=function(n){return b(K.__wrap(n))},n.wbg.__wbg_value_442d6ccca6c89da5=function(n){return b(a(n).value)},n.wbg.__wbg_setvalue_d01c3234a2663552=function(n,e){a(n).value=a(e)},n.wbg.__wbg_instanceof_Error_9f5881c3c4149389=function(n){let e;try{e=a(n)instanceof Error}catch(n){e=!1}return e},n.wbg.__wbg_imports_849227f7280907ef=function(n){return b(WebAssembly.Module.imports(a(n)))},n.wbg.__wbg_instanceof_Object_3c95bd459efa5c3c=function(n){let e;try{e=a(n)instanceof Object}catch(n){e=!1}return e},n.wbg.__wbg_grow_51233537037b47cc=function(){return x((function(n,e){return a(n).grow(e>>>0)}),arguments)},n.wbg.__wbg_instanceof_RangeError_dd0fad3a217d8897=function(n){let e;try{e=a(n)instanceof RangeError}catch(n){e=!1}return e},n.wbg.__wbg_buffer_b334b57bee6f611b=function(n){return b(a(n).buffer)},n.wbg.__wbg_send_a4612d3a60b1dbb4=function(){return x((function(n,e){a(n).send(a(e))}),arguments)},n.wbg.__wbg_new_b9b318679315404f=function(){return x((function(n,e){return b(new WebSocket(o(n,e)))}),arguments)},n.wbg.__wbg_setonopen_b2a170d59c1abe88=function(n,e){a(n).onopen=a(e)},n.wbg.__wbg_setonclose_4527668a5c065333=function(n,e){a(n).onclose=a(e)},n.wbg.__wbg_new_b71bf93085f9d631=function(){return x((function(){return b(new FileReader)}),arguments)},n.wbg.__wbg_setonloadend_88fd301cd09da25d=function(n,e){a(n).onloadend=a(e)},n.wbg.__wbg_setbinaryType_dcb62e0f2b346301=function(n,e){a(n).binaryType=y(e)},n.wbg.__wbg_setonmessage_eb44f51ef6e7e0e8=function(n,e){a(n).onmessage=a(e)},n.wbg.__wbg_grow_f711696a8328da3c=function(n,e){return a(n).grow(e>>>0)},n.wbg.__wbg_hardwareConcurrency_b858ff012f3ad0fb=function(n){return a(n).hardwareConcurrency},n.wbg.__wbg_hardwareConcurrency_67b658b8df300eb5=function(n){return a(n).hardwareConcurrency},n.wbg.__wbg_isSafeInteger_c38b0a16d0c7cef7=function(n){return Number.isSafeInteger(a(n))},n.wbg.__wbindgen_jsval_loose_eq=function(n,e){return a(n)==a(e)},n.wbg.__wbindgen_boolean_get=function(n){const e=a(n);return\"boolean\"==typeof e?e?1:0:2},n.wbg.__wbindgen_is_bigint=function(n){return\"bigint\"==typeof a(n)},n.wbg.__wbindgen_bigint_from_u64=function(n){return b(BigInt.asUintN(64,n))},n.wbg.__wbindgen_jsval_eq=function(n,e){return a(n)===a(e)},n.wbg.__wbg_BigInt_9cc4d66dcbf0216e=function(n){return b(BigInt(a(n)))},n.wbg.__wbindgen_ge=function(n,e){return a(n)>=a(e)},n.wbg.__wbg_newwithu8arraysequenceandoptions_f520ece5c28a5211=function(){return x((function(n,e){return b(new Blob(a(n),a(e)))}),arguments)},n.wbg.__wbg_createObjectURL_86955f30bbed45eb=function(){return x((function(n,t){const _=s(URL.createObjectURL(a(t)),e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_}),arguments)},n.wbg.__wbg_terminate_159911c61944a361=function(n){a(n).terminate()},n.wbg.__wbg_lineno_4506d18a0b25cca2=function(n){return a(n).lineno},n.wbg.__wbg_colno_19ebfec79bfd789d=function(n){return a(n).colno},n.wbg.__wbg_assert_aa771cfef9582df7=function(n,e){console.assert(0!==n,a(e))},n.wbg.__wbg_new_abda76e883ba8a5f=function(){return b(new Error)},n.wbg.__wbg_stack_658279fe44541cf6=function(n,t){const _=s(a(t).stack,e.__wbindgen_malloc,e.__wbindgen_realloc),r=w;l()[n/4+1]=r,l()[n/4+0]=_},n.wbg.__wbg_error_f851667af71bcfc6=function(n,t){let _,r;try{_=n,r=t,console.error(o(n,t))}finally{e.canonical_abi_free(_,r,1)}},n.wbg.__wbg_instanceof_TypeError_9282fd7df97806a0=function(n){let e;try{e=a(n)instanceof TypeError}catch(n){e=!1}return e},n.wbg.__wbg_wasmer_new=function(n){return b(J.__wrap(n))},n.wbg.__wbg_new_ab87fd305ed9004b=function(n,e){return b(new Error(o(n,e)))},n.wbg.__wbg_instance_new=function(n){return b(z.__wrap(n))},n.wbg.__wbg_read_55c1f4e3f3729816=function(n){return b(a(n).read())},n.wbg.__wbindgen_is_falsy=function(n){return!a(n)},n.wbg.__wbg_instanceof_Blob_bd674d851f2d730d=function(n){let e;try{e=a(n)instanceof Blob}catch(n){e=!1}return e},n.wbg.__wbg_readAsArrayBuffer_55965fe069b748b7=function(){return x((function(n,e){a(n).readAsArrayBuffer(a(e))}),arguments)},n.wbg.__wbg_result_5e08da49132b9af2=function(){return x((function(n){return b(a(n).result)}),arguments)},n.wbg.__wbg_instanceof_Module_7b9e1eae1becb87c=function(n){let e;try{e=a(n)instanceof WebAssembly.Module}catch(n){e=!1}return e},n.wbg.__wbg_static_accessor_IMPORT_META_URL_3be0dba93f76ed43=function(n){const t=s(import.meta.url,e.__wbindgen_malloc,e.__wbindgen_realloc),_=w;l()[n/4+1]=_,l()[n/4+0]=t},n.wbg.__wbg_log_7811587c4c6d2844=function(n){console.log(a(n))},n.wbg.__wbg_byteLength_206a04415dea52a7=function(n){return a(n).byteLength},n.wbg.__wbg_instanceof_DedicatedWorkerGlobalScope_4cabe735c12f6f62=function(n){let e;try{e=a(n)instanceof DedicatedWorkerGlobalScope}catch(n){e=!1}return e},n.wbg.__wbg_postMessage_08d9966515d3437e=function(){return x((function(n,e){a(n).postMessage(a(e))}),arguments)},n.wbg.__wbg_args_4d15d7afb42e284d=function(n){const e=a(n).args;return f(e)?0:b(e)},n.wbg.__wbg_env_ad8595f2986ecc88=function(n){return b(a(n).env)},n.wbg.__wbg_new_a8d206e6b5c455e8=function(n,e){return b(new TypeError(o(n,e)))},n.wbg.__wbg_mount_6bbd20e7e89111c6=function(n){return b(a(n).mount)},n.wbg.__wbg_stdin_00c789dbac01e87a=function(n){const e=a(n).stdin;return f(e)?0:b(e)},n.wbg.__wbg_command_new=function(n){return b(U.__wrap(n))},n.wbg.__wbg_registry_3c50a218bff1b9c2=function(n){const e=a(n).registry;return f(e)?0:b(e)},n.wbg.__wbindgen_is_null=function(n){return null===a(n)},n.wbg.__wbg_apiKey_45d9470ec7a59981=function(n,t){const _=a(t).apiKey;var r=f(_)?0:s(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_networkGateway_19db657660e81113=function(n,t){const _=a(t).networkGateway;var r=f(_)?0:s(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=w;l()[n/4+1]=o,l()[n/4+0]=r},n.wbg.__wbg_program_86b0cb49d1fef987=function(n){return b(a(n).program)},n.wbg.__wbg_runtime_0041006d6e1bcee1=function(n){return b(a(n).runtime)},n.wbg.__wbg_instanceof_Window_cde2416cf5126a72=function(n){let e;try{e=a(n)instanceof Window}catch(n){e=!1}return e},n.wbg.__wbg_setTimeout_07866af1a1842093=function(){return x((function(n,e,t){return a(n).setTimeout(a(e),t)}),arguments)},n.wbg.__wbg_setTimeout_a7009fb086494628=function(){return x((function(n,e,t){return a(n).setTimeout(a(e),t)}),arguments)},n.wbg.__wbg_keys_1af6085b03973487=function(n){return b(Object.keys(a(n)))},n.wbg.__wbg_is_c74aa9bb973d6109=function(n,e){return Object.is(a(n),a(e))},n.wbg.__wbindgen_lt=function(n,e){return a(n)>a(e))},n.wbg.__wbindgen_bigint_from_i64=function(n){return b(n)},n.wbg.__wbindgen_bigint_from_u128=function(n,e){return b(BigInt.asUintN(64,n)<n(void 0,void 0,void 0,(function*(){if(!e){let n=\"https://unpkg.com/@wasmer/sdk@0.6.0/dist/wasmer_js_bg.wasm\";n&&(e=new URL(n))}return tn(e,t)})),rn=()=>{let n=\"https://unpkg.com/@wasmer/sdk@0.6.0/dist/WasmerSDK.js\";n&&j(n)};globalThis.__WASMER_INTERNALS__={ThreadPoolWorker:G,init:_n},globalThis.$RefreshReg$=globalThis.$RefreshReg$||function(){},globalThis.$RefreshSig$=globalThis.$RefreshSig$||function(){return function(){}};export{U as Command,L as Directory,z as Instance,q as ReadableStreamSource,N as Runtime,G as ThreadPoolWorker,K as Trap,J as Wasmer,Q as WritableStreamSink,_n as init,en as initSync,M as initializeLogger,E as on_start,O as runWasix,rn as setDefaultWorkerUrl,j as setWorkerUrl,F as wat2wasm};\n", "import { Directory, init, initSync, Wasmer } from '@wasmer/sdk';\n\nconst main = async ({\n data,\n}: {\n data: { code: number[]; args: string; input: string };\n}) => {\n const { code, args, input } = data;\n\n await init();\n // initSync(wasmUrl);\n\n const pkg = await Wasmer.fromRegistry('python/python');\n\n const instance = await pkg.entrypoint.run({\n args: args.split('\\n'),\n stdin: Uint8Array.from(input.split('').map((c) => c.charCodeAt(0))),\n mount: {\n '/out': new Directory(),\n '/src': {\n 'main.py': new Uint8Array(code),\n },\n },\n });\n\n const { code: exitCode, stdout, stderr } = await instance.wait();\n\n postMessage({\n type: 'output',\n output: stdout,\n });\n\n postMessage({\n type: 'output',\n error: stderr,\n });\n\n console.log(`Python exited with ${exitCode}: ${stdout}`);\n};\n\naddEventListener('message', (data) =>\n main(data).then(() =>\n postMessage({\n type: 'done',\n })\n )\n);\n"], + "mappings": "MAAA,IAAAA,EAAA,GAUA,SAASC,GAAEA,EAAEC,EAAEC,EAAEC,EAAE,CAAC,OAAO,IAAID,IAAIA,EAAE,UAAW,SAASE,EAAEC,EAAE,CAAC,SAASC,EAAEN,EAAE,CAAC,GAAG,CAACO,EAAEJ,EAAE,KAAKH,CAAC,CAAC,CAAC,OAAOA,EAAE,CAACK,EAAEL,CAAC,CAAC,CAAC,CAAC,SAASQ,EAAER,EAAE,CAAC,GAAG,CAACO,EAAEJ,EAAE,MAAMH,CAAC,CAAC,CAAC,OAAOA,EAAE,CAACK,EAAEL,CAAC,CAAC,CAAC,CAAC,SAASO,EAAEP,EAAE,CAAC,IAAIC,EAAED,EAAE,KAAKI,EAAEJ,EAAE,KAAK,GAAGC,EAAED,EAAE,MAAMC,aAAaC,EAAED,EAAE,IAAIC,EAAG,SAASF,EAAE,CAACA,EAAEC,CAAC,CAAC,CAAE,GAAG,KAAKK,EAAEE,CAAC,CAAC,CAACD,GAAGJ,EAAEA,EAAE,MAAMH,EAAEC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,IAAIA,EAAsD,IAAMQ,EAAe,OAAO,YAApB,IAAgC,IAAI,YAAY,QAA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C,IAAIF,EAAE,6DAA6DA,IAAIE,EAAE,IAAI,IAAIF,CAAC,EAAE,CAAC,OAAOD,EAAGG,EAAED,CAAC,CAAC,CAAE,EAAiF,WAAW,qBAAqB,CAAC,iBAAiBS,EAAE,KAAKC,CAAE,EAAE,WAAW,aAAa,WAAW,cAAc,UAAU,CAAC,EAAE,WAAW,aAAa,WAAW,cAAc,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,ECR9sgC,IAAMC,GAAO,MAAO,CAClB,KAAAC,CACF,IAEM,CACJ,GAAM,CAAE,KAAAC,EAAM,KAAAC,EAAM,MAAAC,CAAM,EAAIH,EAE9B,MAAMI,EAAK,EAKX,IAAMC,EAAW,MAFL,MAAMC,EAAO,aAAa,eAAe,GAE1B,WAAW,IAAI,CACxC,KAAMJ,EAAK,MAAM;AAAA,CAAI,EACrB,MAAO,WAAW,KAAKC,EAAM,MAAM,EAAE,EAAE,IAAKI,GAAMA,EAAE,WAAW,CAAC,CAAC,CAAC,EAClE,MAAO,CACL,OAAQ,IAAIC,EACZ,OAAQ,CACN,UAAW,IAAI,WAAWP,CAAI,CAChC,CACF,CACF,CAAC,EAEK,CAAE,KAAMQ,EAAU,OAAAC,EAAQ,OAAAC,CAAO,EAAI,MAAMN,EAAS,KAAK,EAE/D,YAAY,CACV,KAAM,SACN,OAAQK,CACV,CAAC,EAED,YAAY,CACV,KAAM,SACN,MAAOC,CACT,CAAC,EAED,QAAQ,IAAI,sBAAsBF,CAAQ,KAAKC,CAAM,EAAE,CACzD,EAEA,iBAAiB,UAAYV,GAC3BD,GAAKC,CAAI,EAAE,KAAK,IACd,YAAY,CACV,KAAM,MACR,CAAC,CACH,CACF", + "names": ["import_meta", "n", "e", "t", "_", "r", "o", "i", "b", "c", "t", "_", "r", "e", "o", "n", "i", "c", "b", "a", "w", "u", "g", "s", "f", "d", "l", "y", "p", "m", "h", "v", "A", "k", "R", "T", "W", "S", "x", "I", "n", "e", "U", "_U", "y", "b", "f", "B", "L", "t", "i", "_", "l", "r", "o", "s", "w", "$", "z", "_z", "D", "q", "_q", "C", "P", "n", "e", "G", "t", "y", "b", "Z", "K", "_K", "V", "J", "_J", "U", "f", "_", "s", "r", "w", "H", "Q", "_Q", "X", "o", "a", "i", "l", "x", "v", "p", "m", "z", "import_meta", "q", "tn", "k", "R", "T", "W", "S", "Y", "nn", "h", "d", "tn", "n", "t", "e", "import_meta", "_", "X", "Y", "o", "nn", "_n", "G", "_n", "main", "data", "code", "args", "input", "_n", "instance", "J", "c", "L", "exitCode", "stdout", "stderr"] } diff --git a/dist/js/langs/webperl-5.28.1/worker.js b/dist/js/langs/webperl-5.28.1/worker.js index 3ca5486..68535a8 100644 --- a/dist/js/langs/webperl-5.28.1/worker.js +++ b/dist/js/langs/webperl-5.28.1/worker.js @@ -1,2 +1,2 @@ -(()=>{importScripts("../../../../js/lib/webperl-5.28.1/webperl.js");addEventListener("message",({data:s})=>{let{code:p,args:r,input:i}=s;Perl.output=(e,t)=>{if(t===2){postMessage({type:"output",error:e});return}postMessage({type:"output",output:e})},Perl.endAfterMain=!0,Perl.addStateChangeListener((e,t)=>{t==="Ended"&&postMessage({type:"done"})}),Perl.init(()=>{Perl.stdin_buf+=i,Perl.run(p,r.trim()?r.trim().split(/\n/):[])})});})(); +importScripts("../../../../js/lib/webperl-5.28.1/webperl.js");addEventListener("message",({data:s})=>{let{code:i,input:p,args:r}=s;Perl.output=(e,t)=>{if(t===2){postMessage({type:"output",error:e});return}postMessage({type:"output",output:e})},Perl.endAfterMain=!0,Perl.addStateChangeListener((e,t)=>{t==="Ended"&&postMessage({type:"done",exitCode:Perl.exitStatus??0})}),Perl.init(()=>{Perl.stdin_buf+=p,Perl.run(i,r.trim()?r.trim().split(/\n/):[])})}); //# sourceMappingURL=worker.js.map diff --git a/dist/js/langs/webperl-5.28.1/worker.js.map b/dist/js/langs/webperl-5.28.1/worker.js.map index f0e69ef..328fe10 100644 --- a/dist/js/langs/webperl-5.28.1/worker.js.map +++ b/dist/js/langs/webperl-5.28.1/worker.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../../../js/langs/webperl-5.28.1/worker.js"], - "sourcesContent": ["importScripts('../../../../js/lib/webperl-5.28.1/webperl.js');\n\naddEventListener('message', ({ data }) => {\n // TODO: check 'type' param too...\n const { code, args, input } = data;\n\n Perl.output = (content, channel) => {\n if (channel === 2) {\n postMessage({\n type: 'output',\n error: content,\n });\n\n return;\n }\n\n postMessage({\n type: 'output',\n output: content,\n });\n };\n\n Perl.endAfterMain = true;\n\n Perl.addStateChangeListener((from, to) => {\n if (to === 'Ended') {\n postMessage({\n type: 'done',\n });\n }\n });\n\n Perl.init(() => {\n Perl.stdin_buf += input;\n\n Perl.run(code, args.trim() ? args.trim().split(/\\n/) : []);\n });\n});\n"], - "mappings": "MAAA,cAAc,8CAA8C,EAE5D,iBAAiB,UAAW,CAAC,CAAE,KAAAA,CAAK,IAAM,CAExC,GAAM,CAAE,KAAAC,EAAM,KAAAC,EAAM,MAAAC,CAAM,EAAIH,EAE9B,KAAK,OAAS,CAACI,EAASC,IAAY,CAClC,GAAIA,IAAY,EAAG,CACjB,YAAY,CACV,KAAM,SACN,MAAOD,CACT,CAAC,EAED,MACF,CAEA,YAAY,CACV,KAAM,SACN,OAAQA,CACV,CAAC,CACH,EAEA,KAAK,aAAe,GAEpB,KAAK,uBAAuB,CAACE,EAAMC,IAAO,CACpCA,IAAO,SACT,YAAY,CACV,KAAM,MACR,CAAC,CAEL,CAAC,EAED,KAAK,KAAK,IAAM,CACd,KAAK,WAAaJ,EAElB,KAAK,IAAIF,EAAMC,EAAK,KAAK,EAAIA,EAAK,KAAK,EAAE,MAAM,IAAI,EAAI,CAAC,CAAC,CAC3D,CAAC,CACH,CAAC", - "names": ["data", "code", "args", "input", "content", "channel", "from", "to"] + "sourcesContent": ["importScripts('../../../../js/lib/webperl-5.28.1/webperl.js');\n\naddEventListener('message', ({ data }) => {\n // TODO: check 'type' param too...\n const { code, input, args } = data;\n\n Perl.output = (content, channel) => {\n if (channel === 2) {\n postMessage({\n type: 'output',\n error: content,\n });\n\n return;\n }\n\n postMessage({\n type: 'output',\n output: content,\n });\n };\n\n Perl.endAfterMain = true;\n\n Perl.addStateChangeListener((from, to) => {\n if (to === 'Ended') {\n postMessage({\n type: 'done',\n exitCode: Perl.exitStatus ?? 0,\n });\n }\n });\n\n Perl.init(() => {\n Perl.stdin_buf += input;\n\n Perl.run(code, args.trim() ? args.trim().split(/\\n/) : []);\n });\n});\n"], + "mappings": "AAAA,cAAc,8CAA8C,EAE5D,iBAAiB,UAAW,CAAC,CAAE,KAAAA,CAAK,IAAM,CAExC,GAAM,CAAE,KAAAC,EAAM,MAAAC,EAAO,KAAAC,CAAK,EAAIH,EAE9B,KAAK,OAAS,CAACI,EAASC,IAAY,CAClC,GAAIA,IAAY,EAAG,CACjB,YAAY,CACV,KAAM,SACN,MAAOD,CACT,CAAC,EAED,MACF,CAEA,YAAY,CACV,KAAM,SACN,OAAQA,CACV,CAAC,CACH,EAEA,KAAK,aAAe,GAEpB,KAAK,uBAAuB,CAACE,EAAMC,IAAO,CACpCA,IAAO,SACT,YAAY,CACV,KAAM,OACN,SAAU,KAAK,YAAc,CAC/B,CAAC,CAEL,CAAC,EAED,KAAK,KAAK,IAAM,CACd,KAAK,WAAaL,EAElB,KAAK,IAAID,EAAME,EAAK,KAAK,EAAIA,EAAK,KAAK,EAAE,MAAM,IAAI,EAAI,CAAC,CAAC,CAC3D,CAAC,CACH,CAAC", + "names": ["data", "code", "input", "args", "content", "channel", "from", "to"] } diff --git a/esbuild.mjs b/esbuild.mjs index 4e92504..be0100d 100644 --- a/esbuild.mjs +++ b/esbuild.mjs @@ -4,17 +4,18 @@ import { sassPlugin } from 'esbuild-sass-plugin'; const watching = process.argv.includes('watch'), buildOptions = { entryPoints: [ - 'js/app.ts', - 'css/app.scss', - 'js/langs/javascript-browser/worker.js', - 'js/langs/php-wasm/worker.ts', - 'js/langs/python-wasmer/worker.ts', - 'js/langs/webperl-5.28.1/worker.js', + { in: 'js/app.ts', out: 'dist/js/app' }, + { in: 'js/coi-serviceworker.ts', out: 'coi-serviceworker' }, + { in: 'css/app.scss', out: 'dist/css/app' }, + { in: 'js/langs/javascript-browser/worker.js', out: 'dist/js/langs/javascript-browser/worker' }, + { in: 'js/langs/webperl-5.28.1/worker.js', out: 'dist/js/langs/webperl-5.28.1/worker' } ], bundle: true, minify: true, sourcemap: true, - outdir: 'dist', + external: ["https://unpkg.com/@wasmer/sdk@latest?module"], + outdir: '.', + format: 'esm', plugins: [sassPlugin(), { name: 'on-end', setup(build) { diff --git a/index.html b/index.html index c2f0af8..ef35c82 100644 --- a/index.html +++ b/index.html @@ -180,8 +180,9 @@

STDERR

-
Copyright © 2022 Dom Hastings
+
Copyright © 2022-2024 Dom Hastings
- + + diff --git a/js/Decoders/Base64.ts b/js/Decoders/Base64.ts index 80348c7..44058a0 100644 --- a/js/Decoders/Base64.ts +++ b/js/Decoders/Base64.ts @@ -7,8 +7,8 @@ export class Base64 extends Default implements Decoder { } public matchesAsString(code: string): boolean { - // base64 input is at least 4 chars - if (code.length < 4) { + // base64 input is at least 4 chars, pick 8 as `prin` is valid + if (code.length < 8 || /[^A-Za-z0-9+/=]/.test(code)) { return false; } diff --git a/js/Inputs/Code.ts b/js/Inputs/Code.ts index 6063013..38020b4 100644 --- a/js/Inputs/Code.ts +++ b/js/Inputs/Code.ts @@ -86,6 +86,9 @@ export class Code extends Abstract implements Input { public setType(type: string | null): void { if (this.editor.getOption('mode') !== type) { this.editor.setOption('mode', type); + + // This triggers the code to be highlighted in the newly selected language + this.editor.setValue(this.editor.getValue()); } } diff --git a/js/Lang.ts b/js/Lang.ts index 8c52d4c..168f324 100644 --- a/js/Lang.ts +++ b/js/Lang.ts @@ -1,10 +1,12 @@ -export type Runner = (code: number[], input: string, args: string) => Worker; +import Runner from './Runner'; + +export type RunnerProvider = (code: number[], input: string, args: string) => Promise; export class Lang { constructor( private id: string, private name: string, - private runner: Runner, + private runner: RunnerProvider, private url: string = null, private args: string[] | null = null, private highlighterRef: string = id @@ -30,7 +32,7 @@ export class Lang { return this.highlighterRef; } - run(code: number[], args: string, input: string): Worker { + run(code: number[], input: string, args: string): Promise { return this.runner(code, input, args); } } diff --git a/js/Langs.ts b/js/Langs.ts index ff5ab79..723ea81 100644 --- a/js/Langs.ts +++ b/js/Langs.ts @@ -1,4 +1,8 @@ -import Lang, { Runner } from './Lang'; +import Lang from './Lang'; +import WorkerRunner from './Runners/Worker'; +import Runner from './Runner'; +import Wasmer from './Runners/Wasmer'; +import { SpawnOptions } from '@wasmer/sdk/dist/pkg/wasmer_js'; export class Langs { private data: { [key: string]: Lang } = {}; @@ -17,29 +21,34 @@ export class Langs { return Object.keys(this.data); } - public run( + public async run( langId: string, code: number[], args: string, input: string - ): Worker { - return this.data[langId].run(code, args, input); + ): Promise { + return await this.data[langId].run(code, input, args); } } -export const defaultRunner = - (workerURL): Runner => - (code: number[], input: string, args: string) => { - const worker = new Worker(workerURL); +export const workerRunner = + (workerURL: string | URL) => + async (code: number[], input: string, args: string): Promise => { + const runner = new WorkerRunner(workerURL); - worker.postMessage({ - type: 'run', - code, - args, - input, - }); + runner.init(code, input, args); + + return runner; + }; + +export const wasmerRunner = + (packageName: string, filename: false | string = 'script', spawnOptions?: SpawnOptions) => + async (code: number[], input: string, args: string): Promise => { + const runner = new Wasmer(packageName, filename, spawnOptions); + + runner.init(code, input, args); - return worker; + return runner; }; export const langs = new Langs(); diff --git a/js/Runner.ts b/js/Runner.ts new file mode 100644 index 0000000..e739158 --- /dev/null +++ b/js/Runner.ts @@ -0,0 +1,70 @@ +import { EventEmitter } from 'eventemitter3'; +import { MelbaType } from 'melba-toast'; + +export type RunnerMessage = { + type: 'run'; + code: number[]; + args: string; + input: string; + } | { + type: 'output'; + output: string | undefined; + error: string | undefined; + } | { + type: 'done'; + exitCode: number; + }; + +export type RunnerError = { + 'error': Error +}; + +export type RunnerEventHandler = (message: RunnerMessage | RunnerError) => unknown; + +export abstract class Runner extends EventEmitter<{ + error: RunnerError; + message: RunnerMessage; + done: { + exitCode: number | undefined; + }; + output: { + output: string | undefined; + error: string | undefined; + }; + toast: { + message: string; + type: MelbaType | undefined; + } +}> { + protected constructor() { + super(); + + this.on('message', (message: RunnerMessage) => { + if (message.type === 'run') { + return this.init(message.code, message.input, message.args); + } + + if (message.type === 'output') { + return this.emit('output', { + output: message.output, + error: message.error, + }); + } + + if (message.type === 'done') { + this.emit('done', { + exitCode: message.exitCode, + }); + + return this.terminate(); + } + + console.warn('Unhandled message', message); + }); + } + + abstract init(code: number[], input: string, args: string): Promise; + abstract terminate(): void; +} + +export default Runner; diff --git a/js/Runners/Wasmer.ts b/js/Runners/Wasmer.ts new file mode 100644 index 0000000..74b2e1d --- /dev/null +++ b/js/Runners/Wasmer.ts @@ -0,0 +1,96 @@ +import Runner from '../Runner'; +import { SpawnOptions } from '@wasmer/sdk/dist/pkg/wasmer_js'; +import codePointsToString from '../codePointsToString'; +// @ts-ignore +import { init, Instance, Wasmer as WasmerSDK } from "https://unpkg.com/@wasmer/sdk@latest?module"; + +export class Wasmer extends Runner { + #package: WasmerSDK; + #instance: Instance; + + constructor(private packageName: string, private filename: false | string = 'script', private spawnOptions?: SpawnOptions) { + super(); + } + + /** + * @param code + * @param input STDIN + * @param args The literal string `$filename` will be replaced with the path + * to the code (e.g. `/app/script`) and is appended to the arguments + * unless the `filename` parameter to the constructor is `false`. + * `$code` will be replaced with a string representation of the code to + * execute. + */ + async init(code: number[], input: string, args: string) { + await init(); + + // Show an alert after a second as that probably means we're having to download the package + const preparingMessageTimeout = window.setTimeout(() => + this.emit('toast', { + message: 'Downloading package from wasmer.io. This might take some time...', + type: 'info', + }) + , 1000); + + this.#package = await WasmerSDK.fromRegistry(this.packageName); + + if (this.filename) { + if (!args.includes('$filename')) { + args += (args.length > 0 ? '\n' : '') + '$filename'; + } + + args = args.replace('$filename', `/app/${this.filename}`) + } + + const entrypointArgs = { + args: args.split('\n') + .map((arg) => { + if (arg !== '$code') { + return arg; + } + + return codePointsToString(code); + }), + stdin: input, + ...this.spawnOptions, + mount: { + ...this.spawnOptions?.mount, + '/app': { + ...(this.spawnOptions?.mount && ( '/app' in this.spawnOptions?.mount) ? this.spawnOptions?.mount['/app'] : {}), + ...(this.filename ? { [this.filename]: new Uint8Array(code) } : {}), + }, + }, + }; + + window.clearTimeout(preparingMessageTimeout); + + this.#instance = await this.#package.entrypoint.run(entrypointArgs); + + const { code: exitCode, stderr, stdout } = await this.#instance.wait(); + + stdout.split('') + .forEach((char) => + this.emit('output', { + output: char, + }) + ); + + stderr.split('') + .forEach((char) => + this.emit('output', { + error: char, + }) + ); + + this.emit('done', { + code: exitCode, + }); + } + + terminate(): void { + // TODO + // return this.#instance.free(); + } +} + +export default Wasmer; diff --git a/js/Runners/Worker.ts b/js/Runners/Worker.ts new file mode 100644 index 0000000..0934081 --- /dev/null +++ b/js/Runners/Worker.ts @@ -0,0 +1,38 @@ +import Runner, { RunnerEventHandler, RunnerMessage } from '../Runner'; + +export class WorkerRunner extends Runner { + worker: Worker; + + constructor(workerURL: string | URL) { + super(); + + this.worker = new Worker(workerURL); + + this.worker.addEventListener('error', (error) => + this.emit('error', error), + ); + + this.worker.addEventListener('message', ({ data }) => + this.emit('message', data), + ); + } + + async init(code: number[], input: string, args: string) { + this.postMessage({ + type: 'run', + code, + args, + input, + }); + } + + postMessage(message: any, options?: StructuredSerializeOptions): void { + return this.worker.postMessage(message, options); + } + + terminate(): void { + return this.worker.terminate(); + } +} + +export default WorkerRunner; diff --git a/js/UI.ts b/js/UI.ts index ce556f1..26e5545 100644 --- a/js/UI.ts +++ b/js/UI.ts @@ -121,9 +121,7 @@ export class UI { this.stdout.activate('text/plain'); this.stderr = createDevice( - new TTY(document.querySelector('div.stderr') as HTMLDivElement, { - rows: 8, - }) + new TTY(document.querySelector('div.stderr') as HTMLDivElement) ); this.stderr.setPrepend('\x1b[31m'); this.stderr.activate('text/plain'); @@ -347,17 +345,7 @@ export class UI { } private runCode(): void { - const started = Date.now(), - stopHandler = () => { - worker.terminate(); - - this.stderr.write(`Aborted execution after ${Date.now() - started}ms`); - - this.runButton.removeAttribute('disabled'); - this.stopButton.setAttribute('disabled', ''); - - this.stopButton.removeEventListener('click', stopHandler); - }; + const started = Date.now(); this.stdout.reset(); this.stderr.reset(); @@ -365,7 +353,7 @@ export class UI { this.runButton.setAttribute('disabled', ''); this.stopButton.removeAttribute('disabled'); - const worker = langs.run( + langs.run( this.getLangId(), [].concat( [ @@ -376,42 +364,51 @@ export class UI { ), this.io.getArgs(), this.io.getStdin() - ); + ) + .then((runner) => { + const stopHandler = () => { + runner.terminate(); - this.stopButton.addEventListener('click', stopHandler); + this.stderr.write(`Aborted execution after ${Date.now() - started}ms`); - worker.onmessage = ({ data }) => { - const { type, output, error } = data; + this.runButton.removeAttribute('disabled'); + this.stopButton.setAttribute('disabled', ''); - if (output) { - this.stdout.write(output); - } + this.stopButton.removeEventListener('click', stopHandler); + }; - if (error) { - this.stderr.write(error ?? ''); - } + this.stopButton.addEventListener('click', stopHandler); - if (type === 'done') { - this.stderr.write( - `Completed execution after ${Date.now() - started}ms` - ); + runner.on('output', ({ output, error }) => { + this.stdout.write(output ?? ''); + this.stderr.write(error ?? ''); + }); - this.runButton.removeAttribute('disabled'); - this.stopButton.setAttribute('disabled', ''); + runner.on('done', ({ exitCode }) => { + this.stderr.write( + `Execution finished with status code ${exitCode} after ${Date.now() - started}ms` + ); - this.stopButton.removeEventListener('click', stopHandler); + this.runButton.removeAttribute('disabled'); + this.stopButton.setAttribute('disabled', ''); - // Make sure the process is stopped - worker.terminate(); - } - }; + this.stopButton.removeEventListener('click', stopHandler); + + // Make sure the process is stopped + runner.terminate(); + }); - worker.onerror = (e) => { - this.toast(`Worker error: ${e.message}`, 'error'); + runner.on('toast', ({ message, type = 'info' }) => + this.toast(message, type) + ); + + runner.on('error', (e) => { + this.toast(`Worker error: ${e.message}`, 'error'); - this.runButton.removeAttribute('disabled'); - this.stopButton.setAttribute('disabled', ''); - }; + this.runButton.removeAttribute('disabled'); + this.stopButton.setAttribute('disabled', ''); + }); + }); } private populateArgs(): void { diff --git a/js/app.ts b/js/app.ts index 6f267a0..aec9dd1 100644 --- a/js/app.ts +++ b/js/app.ts @@ -1,14 +1,28 @@ import Base64 from './Decoders/Base64'; +import Bash from './langs/bash-wasmer/Bash'; import Default from './Decoders/Default'; import Hexdump from './Decoders/Hexdump'; import JavaScript from './langs/javascript-browser/JavaScript'; +import Ruby from './langs/ruby-wasmer/Ruby'; import Perl from './langs/webperl-5.28.1/Perl'; +// import Python from './langs/python-wasmer/Python'; import UI from './UI'; import Xxd from './Decoders/Xxd'; +import jq from './langs/jq-wasmer/jq'; import { decoders } from './Decoders'; import { langs } from './Langs'; decoders.register(new Xxd(), new Hexdump(), new Base64(), new Default()); -langs.register(new JavaScript(), new Perl()); +langs.register( + new Bash(), + new JavaScript(), + new Ruby(), + new Perl(), + // TODO: This is 120MiB which can't currently be cached by the browser by default, making it kinda useless :( + // Need a smaller image from Wasmer, or could download the data manually on first use and store in IndexedDB: + // https://stackoverflow.com/a/71581910/3145856 + // new Python(), + new jq() +); const ui = new UI(); diff --git a/js/coi-serviceworker.ts b/js/coi-serviceworker.ts new file mode 100644 index 0000000..5dfdb4a --- /dev/null +++ b/js/coi-serviceworker.ts @@ -0,0 +1 @@ +import 'coi-serviceworker'; \ No newline at end of file diff --git a/js/langs/bash-wasmer/Bash.ts b/js/langs/bash-wasmer/Bash.ts new file mode 100644 index 0000000..077120f --- /dev/null +++ b/js/langs/bash-wasmer/Bash.ts @@ -0,0 +1,18 @@ +import { Lang } from '../../Lang'; +import { wasmerRunner } from '../../Langs'; +import 'codemirror/mode/shell/shell'; + +export class Bash extends Lang { + constructor() { + super( + 'bash-wasmer', + 'Bash (wasmer)', + wasmerRunner('sharrattj/bash', 'script.sh'), + 'https://www.gnu.org/software/bash/', + [], + 'shell' + ); + } +} + +export default Bash; diff --git a/js/langs/javascript-browser/JavaScript.ts b/js/langs/javascript-browser/JavaScript.ts index 0648102..a595007 100644 --- a/js/langs/javascript-browser/JavaScript.ts +++ b/js/langs/javascript-browser/JavaScript.ts @@ -1,5 +1,5 @@ import { Lang } from '../../Lang'; -import { defaultRunner } from '../../Langs'; +import { workerRunner } from '../../Langs'; import 'codemirror/mode/javascript/javascript'; export class JavaScript extends Lang { @@ -7,7 +7,7 @@ export class JavaScript extends Lang { super( 'javascript-browser', 'JavaScript (Browser)', - defaultRunner('dist/js/langs/javascript-browser/worker.js'), + workerRunner('dist/js/langs/javascript-browser/worker.js'), 'https://www.ecma-international.org/publications-and-standards/standards/ecma-262/', null, 'javascript' diff --git a/js/langs/jq-wasmer/jq.ts b/js/langs/jq-wasmer/jq.ts new file mode 100644 index 0000000..dfc1960 --- /dev/null +++ b/js/langs/jq-wasmer/jq.ts @@ -0,0 +1,38 @@ +import { Lang } from '../../Lang'; +import { wasmerRunner } from '../../Langs'; +import 'codemirror/mode/python/python'; +import Runner from '../../Runner'; +import Wasmer from '../../Runners/Wasmer'; + +export class jq extends Lang { + constructor() { + super( + 'jq-wasmer', + 'jq (wasmer)', + async (code: number[], input: string, args: string): Promise => { + const runner = new Wasmer('syrusakbary/jq', false, { + mount: { + "/app": { + "input.json": input + } + } + }); + + runner.init( + code, + '', + (args.length ? (args + '\n') : '') + + '$code\n' + + '/app/input.json' + ); + + return runner; + }, + 'https://jqlang.github.io/jq/', + [], + 'jq' + ); + } +} + +export default jq; diff --git a/js/langs/python-wasmer/Python.ts b/js/langs/python-wasmer/Python.ts new file mode 100644 index 0000000..764d8d8 --- /dev/null +++ b/js/langs/python-wasmer/Python.ts @@ -0,0 +1,18 @@ +import { Lang } from '../../Lang'; +import { wasmerRunner } from '../../Langs'; +import 'codemirror/mode/python/python'; + +export class Python extends Lang { + constructor() { + super( + 'python-wasmer', + 'Python (wasmer)', + wasmerRunner('python/python', 'script.py'), + 'https://www.python.org/', + [], + 'python' + ); + } +} + +export default Python; diff --git a/js/langs/ruby-wasmer/Ruby.ts b/js/langs/ruby-wasmer/Ruby.ts new file mode 100644 index 0000000..46f7f25 --- /dev/null +++ b/js/langs/ruby-wasmer/Ruby.ts @@ -0,0 +1,19 @@ +import { Lang } from '../../Lang'; +import { wasmerRunner } from '../../Langs'; +import 'codemirror/mode/ruby/ruby'; + +export class Ruby extends Lang { + constructor() { + super( + 'ruby-wasmer', + 'Ruby (wasmer)', + wasmerRunner('katei/ruby', 'script.rb'), + // wasmerRunner('madao/ruby-wasm', 'script.rb'), + 'https://www.ruby-lang.org/', + [], + 'ruby' + ); + } +} + +export default Ruby; diff --git a/js/langs/webperl-5.28.1/Perl.ts b/js/langs/webperl-5.28.1/Perl.ts index 47eef86..80ef3c6 100644 --- a/js/langs/webperl-5.28.1/Perl.ts +++ b/js/langs/webperl-5.28.1/Perl.ts @@ -1,5 +1,5 @@ import { Lang } from '../../Lang'; -import { defaultRunner } from '../../Langs'; +import { workerRunner } from '../../Langs'; import 'codemirror/mode/perl/perl'; export class Perl extends Lang { @@ -7,7 +7,7 @@ export class Perl extends Lang { super( 'webperl-5.28.1', 'Perl 5.28.1 (webperl)', - defaultRunner('dist/js/langs/webperl-5.28.1/worker.js'), + workerRunner('dist/js/langs/webperl-5.28.1/worker.js'), 'https://www.perl.org/', ['-M5.10.0', '-F', '-l', '-p'], 'perl' diff --git a/js/langs/webperl-5.28.1/worker.js b/js/langs/webperl-5.28.1/worker.js index 248bdd8..39c7b82 100644 --- a/js/langs/webperl-5.28.1/worker.js +++ b/js/langs/webperl-5.28.1/worker.js @@ -2,7 +2,7 @@ importScripts('../../../../js/lib/webperl-5.28.1/webperl.js'); addEventListener('message', ({ data }) => { // TODO: check 'type' param too... - const { code, args, input } = data; + const { code, input, args } = data; Perl.output = (content, channel) => { if (channel === 2) { @@ -26,6 +26,7 @@ addEventListener('message', ({ data }) => { if (to === 'Ended') { postMessage({ type: 'done', + exitCode: Perl.exitStatus ?? 0, }); } }); diff --git a/package-lock.json b/package-lock.json index 44f0c0b..85383f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,11 @@ "version": "0.1.6", "license": "UNLICENSED", "dependencies": { + "@bjorn3/browser_wasi_shim": "^0.3.0", "@wasmer/sdk": "^0.6.0", "codemirror": "^5.65.0", + "coi-serviceworker": "^0.1.7", + "eventemitter3": "^5.0.1", "melba-toast": "^2.0.0", "xterm": "^4.16.0", "xterm-addon-fit": "^0.5.0" @@ -586,6 +589,11 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@bjorn3/browser_wasi_shim": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@bjorn3/browser_wasi_shim/-/browser_wasi_shim-0.3.0.tgz", + "integrity": "sha512-FlRBYttPRLcWORzBe6g8nmYTafBkOEFeOqMYM4tAHJzFsQy4+xJA94z85a9BCs8S+Uzfh9LrkpII7DXr2iUVFg==" + }, "node_modules/@bufbuild/protobuf": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.9.0.tgz", @@ -2344,6 +2352,11 @@ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.16.tgz", "integrity": "sha512-br21LjYmSlVL0vFCPWPfhzUCT34FM/pAdK7rRIZwa0rrtrIdotvP4Oh4GUHsu2E3IrQMCfRkL/fN3ytMNxVQvg==" }, + "node_modules/coi-serviceworker": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/coi-serviceworker/-/coi-serviceworker-0.1.7.tgz", + "integrity": "sha512-bjSUqEngCPOkErY2vbyWsaIGCNRODYzlNycaREVw5s12/C8SM+RnRUUeX6pZbTtov6C52ZLY/+tvHK+BDxuUuA==" + }, "node_modules/collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", @@ -2822,6 +2835,11 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -7285,6 +7303,11 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@bjorn3/browser_wasi_shim": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@bjorn3/browser_wasi_shim/-/browser_wasi_shim-0.3.0.tgz", + "integrity": "sha512-FlRBYttPRLcWORzBe6g8nmYTafBkOEFeOqMYM4tAHJzFsQy4+xJA94z85a9BCs8S+Uzfh9LrkpII7DXr2iUVFg==" + }, "@bufbuild/protobuf": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.9.0.tgz", @@ -8562,6 +8585,11 @@ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.16.tgz", "integrity": "sha512-br21LjYmSlVL0vFCPWPfhzUCT34FM/pAdK7rRIZwa0rrtrIdotvP4Oh4GUHsu2E3IrQMCfRkL/fN3ytMNxVQvg==" }, + "coi-serviceworker": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/coi-serviceworker/-/coi-serviceworker-0.1.7.tgz", + "integrity": "sha512-bjSUqEngCPOkErY2vbyWsaIGCNRODYzlNycaREVw5s12/C8SM+RnRUUeX6pZbTtov6C52ZLY/+tvHK+BDxuUuA==" + }, "collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", @@ -8924,6 +8952,11 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + }, "execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", diff --git a/package.json b/package.json index 6b1713a..2e50b29 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,11 @@ }, "homepage": "https://github.com/dom111/code-sandbox#readme", "dependencies": { + "@bjorn3/browser_wasi_shim": "^0.3.0", "@wasmer/sdk": "^0.6.0", "codemirror": "^5.65.0", + "coi-serviceworker": "^0.1.7", + "eventemitter3": "^5.0.1", "melba-toast": "^2.0.0", "xterm": "^4.16.0", "xterm-addon-fit": "^0.5.0" diff --git a/tests/functional/01-basic-functionality.ts b/tests/functional/01-basic-functionality.ts index 42feb7c..37230ec 100644 --- a/tests/functional/01-basic-functionality.ts +++ b/tests/functional/01-basic-functionality.ts @@ -2,6 +2,7 @@ import {getRawProperties, getRawProperty} from '../lib/getProperties'; import {getStderrText, getStdoutText} from "../lib/getTerminalText"; import {getCodeFooterText, getCodeHeaderText, getCodeText, getStdinText} from "../lib/getCodemirrorText"; import {grantClipboardPermissions} from "../lib/grantClipboardPermissions"; +import { ElementHandle } from 'puppeteer'; const baseUrl = process.env.BASE_URL ?? 'http://localhost:8000/'; @@ -15,97 +16,97 @@ describe('Code Sandbox', () => { it(`should be possible to expand and collapse the various sections (${buttonSelector}, ${elementSelector})`, async () => { await page.goto(baseUrl); - const [expand, collapse] = await page.$$(buttonSelector), - element = await page.$(elementSelector); + const [expand, collapse] = await page.$$(buttonSelector) as ElementHandle[], + element = await page.$(elementSelector) as ElementHandle; await Promise.all([expand, collapse, element] .map(async (handle) => expect(handle).not.toBeUndefined())); - await expect(await getRawProperty(expand, 'hidden')).toBe(false); - await expect(await getRawProperty(collapse, 'hidden')).toBe(true); - await expect(await getRawProperty(element, 'hidden')).toBe(true); + expect(await getRawProperty(expand, 'hidden')).toBe(false); + expect(await getRawProperty(collapse, 'hidden')).toBe(true); + expect(await getRawProperty(element, 'hidden')).toBe(true); await expand.click(); - await expect(await getRawProperty(expand, 'hidden')).toBe(true); - await expect(await getRawProperty(collapse, 'hidden')).toBe(false); - await expect(await getRawProperty(element, 'hidden')).toBe(false); + expect(await getRawProperty(expand, 'hidden')).toBe(true); + expect(await getRawProperty(collapse, 'hidden')).toBe(false); + expect(await getRawProperty(element, 'hidden')).toBe(false); await collapse.click(); - await expect(await getRawProperty(expand, 'hidden')).toBe(false); - await expect(await getRawProperty(collapse, 'hidden')).toBe(true); - await expect(await getRawProperty(element, 'hidden')).toBe(true); + expect(await getRawProperty(expand, 'hidden')).toBe(false); + expect(await getRawProperty(collapse, 'hidden')).toBe(true); + expect(await getRawProperty(element, 'hidden')).toBe(true); }) ); it('should be possible to change the language', async () => { await page.goto(baseUrl); - const languageSelector = await page.$( + const languageSelector = await page.$( 'select[name="lang"]' - ); + ) as ElementHandle; - await expect(languageSelector).not.toBeNull(); + expect(languageSelector).not.toBeNull(); const options = await getRawProperties( - languageSelector.$$('option'), + languageSelector.$$('option'), 'value' ); - await expect(await getRawProperty( + expect(await getRawProperty( languageSelector, 'selectedIndex' )).toBe(0); - await expect(options).toMatchObject([ + expect(options).toMatchObject([ 'javascript-browser', 'webperl-5.28.1', ]); await languageSelector.select('webperl-5.28.1'); const argsText = await getRawProperties( - page.$$('.args-wrapper .actions button'), + page.$$('.args-wrapper .actions button') as Promise[]>, 'innerText' ); - await expect(argsText).toMatchObject([ '-M5.10.0', '-F', '-l', '-p' ]); + expect(argsText).toMatchObject([ '-M5.10.0', '-F', '-l', '-p' ]); }); it('should correctly handle permalinks, running the code and displaying the output', async () => { await page.goto(baseUrl + '#eyJsYW5nIjoid2VicGVybC01LjI4LjEiLCJjb2RlIjoiJF89XCJIZWxsbywgJF8hXCIiLCJhcmdzIjoiLXAiLCJpbnB1dCI6IldvcmxkIn0='); - const languageSelector = await page.$( + const languageSelector = await page.$( 'select[name="lang"]' - ), - runButton = await page.$( + ) as ElementHandle, + runButton = await page.$( 'button[name="run"]' - ), - stopButton = await page.$( + ) as ElementHandle, + stopButton = await page.$( 'button[name="stop"]' - ); + ) as ElementHandle; - await expect(languageSelector).not.toBeNull(); - await expect(runButton).not.toBeNull(); - await expect(stopButton).not.toBeNull(); - await expect(await getRawProperty( + expect(languageSelector).not.toBeNull(); + expect(runButton).not.toBeNull(); + expect(stopButton).not.toBeNull(); + expect(await getRawProperty( languageSelector, 'selectedIndex' )).toBe(1); - await expect(await getRawProperty(runButton, 'disabled')).toBe(true); - await expect(await getRawProperty(stopButton, 'disabled')).toBe(false); + expect(await getRawProperty(runButton, 'disabled')).toBe(true); + expect(await getRawProperty(stopButton, 'disabled')).toBe(false); // wait for the run to finish await page.waitForFunction(() => document.querySelector('button[name="run"]:not([disabled])'), { polling: 'mutation', }); - await expect(await getRawProperty(runButton, 'disabled')).toBe(false); - await expect(await getRawProperty(stopButton, 'disabled')).toBe(true); - await expect(await getRawProperty(page.$('.header'), 'hidden')).toBe(true); - await expect(await getCodeHeaderText(page)).toBe(''); - await expect(await getCodeText(page)).toBe('$_="Hello, $_!"'); - await expect(await getRawProperty(page.$('.footer'), 'hidden')).toBe(true); - await expect(await getCodeFooterText(page)).toBe(''); - await expect(await getStdinText(page)).toBe('World'); + expect(await getRawProperty(runButton, 'disabled')).toBe(false); + expect(await getRawProperty(stopButton, 'disabled')).toBe(true); + expect(await getRawProperty(page.$('.header') as Promise>, 'hidden')).toBe(true); + expect(await getCodeHeaderText(page)).toBe(''); + expect(await getCodeText(page)).toBe('$_="Hello, $_!"'); + expect(await getRawProperty(page.$('.footer') as Promise>, 'hidden')).toBe(true); + expect(await getCodeFooterText(page)).toBe(''); + expect(await getStdinText(page)).toBe('World'); await page.waitForFunction(() => document.querySelector('.stdout .tty .xterm .xterm-accessibility .live-region').innerHTML !== '', { polling: 'mutation', }); @@ -119,18 +120,18 @@ describe('Code Sandbox', () => { it('should correctly handle permalinks, showing header and footer when used', async () => { await page.goto(baseUrl + '#eyJsYW5nIjoid2VicGVybC01LjI4LjEiLCJjb2RlIjoiIiwiaGVhZGVyIjoiIyBub3RoaW5nIHRvIHNlZSBoZXJlIiwiZm9vdGVyIjoiIyBvciBoZXJlIn0='); - const [headerExpand, headerCollapse] = await page.$$('.code-header > button'), - [footerExpand, footerCollapse] = await page.$$('.code-footer > button'); - - await expect(await getRawProperty(headerExpand, 'hidden')).toBe(true); - await expect(await getRawProperty(headerCollapse, 'hidden')).toBe(false); - await expect(await getRawProperty(page.$('.header'), 'hidden')).toBe(false); - await expect(await getCodeHeaderText(page)).toBe('# nothing to see here'); - await expect(await getCodeText(page)).toBe(''); - await expect(await getRawProperty(footerExpand, 'hidden')).toBe(true); - await expect(await getRawProperty(footerCollapse, 'hidden')).toBe(false); - await expect(await getRawProperty(page.$('.footer'), 'hidden')).toBe(false); - await expect(await getCodeFooterText(page)).toBe('# or here'); + const [headerExpand, headerCollapse] = await page.$$('.code-header > button') as ElementHandle[], + [footerExpand, footerCollapse] = await page.$$('.code-footer > button') as ElementHandle[]; + + expect(await getRawProperty(headerExpand, 'hidden')).toBe(true); + expect(await getRawProperty(headerCollapse, 'hidden')).toBe(false); + expect(await getRawProperty(page.$('.header') as Promise>, 'hidden')).toBe(false); + expect(await getCodeHeaderText(page)).toBe('# nothing to see here'); + expect(await getCodeText(page)).toBe(''); + expect(await getRawProperty(footerExpand, 'hidden')).toBe(true); + expect(await getRawProperty(footerCollapse, 'hidden')).toBe(false); + expect(await getRawProperty(page.$('.footer') as Promise>, 'hidden')).toBe(false); + expect(await getCodeFooterText(page)).toBe('# or here'); }); it('should correctly copy links and markdown when the relevant buttons are pressed', async () => { @@ -139,24 +140,24 @@ describe('Code Sandbox', () => { await page.goto(url); await grantClipboardPermissions(page); - const copyButton = await page.$( + const copyButton = await page.$( 'button[name="copy"]' - ), - markdownButton = await page.$( + ) as ElementHandle, + markdownButton = await page.$( 'button[name="markdown"]' - ); + ) as ElementHandle; await copyButton.click(); - await expect(await getRawProperty(copyButton, 'className')).toBe('copied'); - await expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(url); - await page.waitForTimeout(1000); - await expect(await getRawProperty(copyButton, 'className')).toBe(''); + expect(await getRawProperty(copyButton, 'className')).toBe('copied'); + expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(url); + await new Promise((resolve) => setTimeout(resolve, 1000)); // Yes, yes, I know... + expect(await getRawProperty(copyButton, 'className')).toBe(''); await markdownButton.click(); - await expect(await getRawProperty(markdownButton, 'className')).toBe('copied'); + expect(await getRawProperty(markdownButton, 'className')).toBe('copied'); await expect(await page.evaluate(() => navigator.clipboard.readText())).toMatch(/^# \[Perl 5\.28\.1 \(webperl\)] \+ `-p`, 15 bytes\n\n\n\n
\$_="Hello, \$_!"<\/code><\/pre>\n\n\[Try it online!\]\[TIO-\w+]\n\n\[Perl 5\.28\.1 \(webperl\)]: https:\/\/www\.perl\.org\/\n\[TIO-\w+]: https?:\/\/[a-z0-9.]+(:\d+)?\/#eyJsYW5nIjoid2VicGVybC01LjI4LjEiLCJjb2RlIjoiJF89XCJIZWxsbywgJF8hXCIiLCJhcmdzIjoiLXAiLCJpbnB1dCI6IldvcmxkIn0=$/);
-      await page.waitForTimeout(1000);
-      await expect(await getRawProperty(markdownButton, 'className')).toBe('');
+      await new Promise((resolve) => setTimeout(resolve, 1000)); // Yes, yes, I know...
+      expect(await getRawProperty(markdownButton, 'className')).toBe('');
     });
   });
 });
diff --git a/tests/functional/02-decoders.ts b/tests/functional/02-decoders.ts
index e375c15..dfe598c 100644
--- a/tests/functional/02-decoders.ts
+++ b/tests/functional/02-decoders.ts
@@ -1,5 +1,6 @@
 import {getRawProperty} from "../lib/getProperties";
 import {grantClipboardPermissions} from "../lib/grantClipboardPermissions";
+import { ElementHandle } from 'puppeteer';
 
 const baseUrl = process.env.BASE_URL ?? 'http://localhost:8000/';
 
@@ -9,16 +10,16 @@ describe('Code Sandbox', () => {
       await page.goto(baseUrl);
       await grantClipboardPermissions(page);
 
-      const codeInput = await page.$('.code .CodeMirror textarea'),
-        byteCount = await page.$('.byte-count'),
-        encoded = await page.$('.encoded'),
-        markdown = await page.$('button[name="markdown"]'),
-        languageSelector = await page.$(
+      const codeInput = await page.$('.code .CodeMirror textarea') as ElementHandle,
+        byteCount = await page.$('.byte-count') as ElementHandle,
+        encoded = await page.$('.encoded') as ElementHandle,
+        markdown = await page.$('button[name="markdown"]') as ElementHandle,
+        languageSelector = await page.$(
           'select[name="lang"]'
-        );
+        ) as ElementHandle;
 
       await languageSelector.select('webperl-5.28.1');
-      await expect(await getRawProperty(encoded, 'hidden')).toBe(true);
+      expect(await getRawProperty(encoded, 'hidden')).toBe(true);
       await page.evaluate((data) => navigator.clipboard.writeText(data), `00000000: 7072 696e 7422 4865 6c6c 6f2c 2057 6f72  print"Hello, Wor
 00000010: 6c64 2122                                ld!"`)
       await codeInput.focus();
@@ -26,9 +27,9 @@ describe('Code Sandbox', () => {
       await page.keyboard.down('v');
       await page.keyboard.up('v');
       await page.keyboard.up('Control');
-      await expect(await getRawProperty(byteCount, 'innerText')).toBe('20');
-      await expect(await getRawProperty(encoded, 'hidden')).toBe(false);
-      await expect(await getRawProperty(encoded, 'innerText')).toBe('(xxd)');
+      expect(await getRawProperty(byteCount, 'innerText')).toBe('20');
+      expect(await getRawProperty(encoded, 'hidden')).toBe(false);
+      expect(await getRawProperty(encoded, 'innerText')).toBe('(xxd)');
       await markdown.click();
       await expect(await page.evaluate(() => navigator.clipboard.readText())).toMatch(/# \[Perl 5\.28\.1 \(webperl\)], 20 bytes\n\n\n\n
print"Hello, World!"<\/code><\/pre>\n\n\[Try it online!]\[TIO-\w+]\n\n\[Perl 5\.28\.1 \(webperl\)]: https:\/\/www\.perl\.org\/\n\[TIO-\w+]: https?:\/\/[a-z0-9.]+(:\d+)?\/#eyJsYW5nIjoid2VicGVybC01LjI4LjEiLCJjb2RlIjoiMDAwMDAwMDA6IDcwNzIgNjk2ZSA3NDIyIDQ4NjUgNmM2YyA2ZjJjIDIwNTcgNmY3MiAgcHJpbnRcIkhlbGxvLCBXb3JcbjAwMDAwMDEwOiA2YzY0IDIxMjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxkIVwiIn0=/)
     });
diff --git a/tests/lib/getCodemirrorText.ts b/tests/lib/getCodemirrorText.ts
index 4e94d2a..16cad30 100644
--- a/tests/lib/getCodemirrorText.ts
+++ b/tests/lib/getCodemirrorText.ts
@@ -1,8 +1,8 @@
-import {Page} from "puppeteer";
+import { ElementHandle, Page } from 'puppeteer';
 import {getRawProperty} from "./getProperties";
 
 export const getCodemirrorText = async (page: Page, selector: string): Promise => (await getRawProperty(
-  page.$(selector + ' .CodeMirror-code'),
+  page.$(selector + ' .CodeMirror-code') as Promise>,
   'innerText'
 ) as string)
   .replace(/\u200b/g, '');
diff --git a/tests/lib/getProperties.ts b/tests/lib/getProperties.ts
index e2c70ba..6dc8c4c 100644
--- a/tests/lib/getProperties.ts
+++ b/tests/lib/getProperties.ts
@@ -1,4 +1,4 @@
-import { ElementHandle, EvaluateFn } from 'puppeteer';
+import { ElementHandle, EvaluateFunc, EvaluateFuncWith } from 'puppeteer';
 
 export const getRawProperty = async <
   T extends HTMLElement = HTMLElement,
@@ -7,7 +7,7 @@ export const getRawProperty = async <
   element: Promise> | ElementHandle,
   property: K
 ): Promise =>
-  await (await (await element)?.getProperty(property as string))?.jsonValue();
+  await (await (await element)?.getProperty(property as string))?.jsonValue() as T[K];
 
 export const getRawProperties = async <
   T extends HTMLElement = HTMLElement,
@@ -19,12 +19,12 @@ export const getRawProperties = async <
   Promise.all(
     (await elements).map(async (element) =>
       ['innerText', 'innerHTML'].includes(property as string)
-        ? await element?.evaluate(
+        ? await element?.evaluate<[], EvaluateFuncWith>(
           new Function(
             'element',
-            `return element.${property};`
-          ) as EvaluateFn
-        )
+            `return element.${String(property)};`
+          ) as EvaluateFuncWith
+        ) as T[K]
         : getRawProperty(element, property)
     )
   );
diff --git a/tests/lib/getTerminalText.ts b/tests/lib/getTerminalText.ts
index 725e873..c291372 100644
--- a/tests/lib/getTerminalText.ts
+++ b/tests/lib/getTerminalText.ts
@@ -1,8 +1,8 @@
-import {Page} from "puppeteer";
+import { ElementHandle, Page } from 'puppeteer';
 import {getRawProperty} from "./getProperties";
 
 export const getTerminalText = async (page: Page, selector: string): Promise => (await getRawProperty(
-  page.$(selector + ' .tty .xterm .xterm-accessibility .live-region'),
+  page.$(selector + ' .tty .xterm .xterm-accessibility .live-region') as Promise>,
   'innerText'
 ) as string)
   .replace(/\u200b/g, '');