An editor for Microsoft Adaptive Cards that supports the new templating language and DOESN'T use JavaScript, because JavaScript isn't a real programming language.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
690 KiB

{"version":3,"sources":["fake","vs/loader.js","file:///Users/penlv/code/vscode/src/vs/base/common/diff/diffChange.ts","file:///Users/penlv/code/vscode/src/vs/base/common/diff/diff.ts","file:///Users/penlv/code/vscode/src/vs/base/common/functional.ts","file:///Users/penlv/code/vscode/src/vs/base/common/keyCodes.ts","file:///Users/penlv/code/vscode/src/vs/base/common/lifecycle.ts","file:///Users/penlv/code/vscode/src/vs/base/common/linkedList.ts","file:///Users/penlv/code/vscode/src/vs/base/common/platform.ts","file:///Users/penlv/code/vscode/src/vs/base/common/uri.ts","file:///Users/penlv/code/vscode/src/vs/base/common/map.ts","file:///Users/penlv/code/vscode/src/vs/base/common/strings.ts","vs/base/common/winjs.base.js","file:///Users/penlv/code/vscode/src/vs/base/common/errors.ts","file:///Users/penlv/code/vscode/src/vs/base/common/event.ts","file:///Users/penlv/code/vscode/src/vs/base/common/cancellation.ts","file:///Users/penlv/code/vscode/src/vs/base/common/async.ts","file:///Users/penlv/code/vscode/src/vs/base/common/worker/simpleWorker.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/core/position.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/core/range.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/core/selection.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/core/token.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/core/uint.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/core/characterClassifier.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/diff/diffComputer.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/model/wordHelper.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/modes/linkComputer.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/modes/supports/inplaceReplaceSupport.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/standalone/standaloneBase.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/viewModel/prefixSumComputer.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/model/mirrorTextModel.ts","file:///Users/penlv/code/vscode/src/vs/editor/common/services/editorSimpleWorker.ts","file:///Users/penlv/code/vscode/src/vs/base/worker/workerMain.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IClqDA;;;oGAGgG;IAChG,YAAY,CAAC;;IAEb;;OAEG;IACH;QA0BC;;;WAGG;QACH,oBAAY,aAAqB,EAAE,cAAsB,EAAE,aAAqB,EAAE,cAAsB;YACvG,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AQ,EAAE;YACxB,IAAI,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;YACjE,IAAI,OAAO,GAAG,CAAC,EAAE;gBAChB,OAAO,KAAK,CAAC;aACb;YAED,WAAW,GAAG,OAAO,CAAC;YAEtB,KAAK,EAAE,CAAC;SACR;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IA1BD,sCA0BC;IAED,oCAA2C,MAAc,EAAE,kBAA0B;QAA1B,mCAAA,EAAA,0BAA0B;QACpF,IAAI,CAAC,MAAM,EAAE;YACZ,OAAO,KAAK,CAAC;SACb;QAED,IAAI,kBAAkB,EAAE;YACvB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACpC;QAED,OAAO,MAAM,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC;IACxC,CAAC;IAVD,gEAUC;;;ACztBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IC1iEA;;;oGAGgG;IAChG,YAAY,CAAC;;IAKb,yDAAyD;IAEzD,IAAI,wBAAwB,GAA2C,EAAE,CAAC;IAC1E,6BAA6B,CAAgB;QAE5C,EAAE;QACF,0EAA0E;QAC1E,EAAE;QACF,IAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;QACzB,IAAM,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QAEtB,4EAA4E;QAC5E,2EAA2E;QAC3E,4DAA4D;QAC5D,EAAE;QACF,IAAI,OAAO,CAAC,MAAM,EAAE;YACnB,IAAI,OAAO,CAAC,OAAO,IAAI,wBAAwB,EAAE;gBAChD,OAAO,wBAAwB,CAA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ED,OAAO,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,aAAa;QACtB,UAAU,EAAE,IAAI;KAChB,CAAC,CAAC;IAEH,IAAI,QAAQ,GAAG,UAAU,QAAgB;QACxC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE;YAC/B,UAAU,CAAC;gBACV,IAAI,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC,UAAC,GAAQ;oBACjC,IAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;gBAC9B,CAAC,EAAE,IAAI,CAAC,CAAC;gBAET,IAAI,CAAC,SAAS,GAAG,UAAC,CAAC,IAAK,OAAA,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAhC,CAAgC,CAAC;gBACzD,OAAO,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;oBACtC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAAC;iBAC5C;YACF,CAAC,EAAE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,cAAc,GAAG,IAAI,CAAC;IAC1B,IAAI,mBAAmB,GAAmB,EAAE,CAAC;IAC7C,IAAI,CAAC,SAAS,GAAG,UAAC,OAAO;QACxB,IAAI,CAAC,cAAc,EAAE;YACpB,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,OAAO;SACP;QAED,cAAc,GAAG,KAAK,CAAC;QACvB,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;;AhC9CL","file":"workerMain.js","sourcesContent":["}).call(this);","/*---------------------------------------------------------------------------------------------\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'use strict';\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/*---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n * Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *---------------------------------------------------------------------------------------------\n *--------------------------------------------------------------------------------------------*/\nvar _amdLoaderGlobal = this;\nvar AMDLoader;\n(function (AMDLoader) {\n AMDLoader.global = _amdLoaderGlobal;\n var Environment = /** @class */ (function () {\n function Environment() {\n this._detected = false;\n this._isWindows = false;\n this._isNode = false;\n this._isElectronRenderer = false;\n this._isWebWorker = false;\n }\n Object.defineProperty(Environment.prototype, \"isWindows\", {\n get: function () {\n this._detect();\n return this._isWindows;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Environment.prototype, \"isNode\", {\n get: function () {\n this._detect();\n return this._isNode;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Environment.prototype, \"isElectronRenderer\", {\n get: function () {\n this._detect();\n return this._isElectronRenderer;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Environment.prototype, \"isWebWorker\", {\n get: function () {\n this._detect();\n return this._isWebWorker;\n },\n enumerable: true,\n configurable: true\n });\n Environment.prototype._detect = function () {\n if (this._detected) {\n return;\n }\n this._detected = true;\n this._isWindows = Environment._isWindows();\n this._isNode = (typeof module !== 'undefined' && !!module.exports);\n this._isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');\n this._isWebWorker = (typeof AMDLoader.global.importScripts === 'function');\n };\n Environment._isWindows = function () {\n if (typeof navigator !== 'undefined') {\n if (navigator.userAgent && navigator.userAgent.indexOf('Windows') >= 0) {\n return true;\n }\n }\n if (typeof process !== 'undefined') {\n return (process.platform === 'win32');\n }\n return false;\n };\n return Environment;\n }());\n AMDLoader.Environment = Environment;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n var LoaderEvent = /** @class */ (function () {\n function LoaderEvent(type, detail, timestamp) {\n this.type = type;\n this.detail = detail;\n this.timestamp = timestamp;\n }\n return LoaderEvent;\n }());\n AMDLoader.LoaderEvent = LoaderEvent;\n var LoaderEventRecorder = /** @class */ (function () {\n function LoaderEventRecorder(loaderAvailableTimestamp) {\n this._events = [new LoaderEvent(1 /* LoaderAvailable */, '', loaderAvailableTimestamp)];\n }\n LoaderEventRecorder.prototype.record = function (type, detail) {\n this._events.push(new LoaderEvent(type, detail, AMDLoader.Utilities.getHighPerformanceTimestamp()));\n };\n LoaderEventRecorder.prototype.getEvents = function () {\n return this._events;\n };\n return LoaderEventRecorder;\n }());\n AMDLoader.LoaderEventRecorder = LoaderEventRecorder;\n var NullLoaderEventRecorder = /** @class */ (function () {\n function NullLoaderEventRecorder() {\n }\n NullLoaderEventRecorder.prototype.record = function (type, detail) {\n // Nothing to do\n };\n NullLoaderEventRecorder.prototype.getEvents = function () {\n return [];\n };\n NullLoaderEventRecorder.INSTANCE = new NullLoaderEventRecorder();\n return NullLoaderEventRecorder;\n }());\n AMDLoader.NullLoaderEventRecorder = NullLoaderEventRecorder;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n var Utilities = /** @class */ (function () {\n function Utilities() {\n }\n /**\n * This method does not take care of / vs \\\n */\n Utilities.fileUriToFilePath = function (isWindows, uri) {\n uri = decodeURI(uri);\n if (isWindows) {\n if (/^file:\\/\\/\\//.test(uri)) {\n // This is a URI without a hostname => return only the path segment\n return uri.substr(8);\n }\n if (/^file:\\/\\//.test(uri)) {\n return uri.substr(5);\n }\n }\n else {\n if (/^file:\\/\\//.test(uri)) {\n return uri.substr(7);\n }\n }\n // Not sure...\n return uri;\n };\n Utilities.startsWith = function (haystack, needle) {\n return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;\n };\n Utilities.endsWith = function (haystack, needle) {\n return haystack.length >= needle.length && haystack.substr(haystack.length - needle.length) === needle;\n };\n // only check for \"?\" before \"#\" to ensure that there is a real Query-String\n Utilities.containsQueryString = function (url) {\n return /^[^\\#]*\\?/gi.test(url);\n };\n /**\n * Does `url` start with http:// or https:// or file:// or / ?\n */\n Utilities.isAbsolutePath = function (url) {\n return /^((http:\\/\\/)|(https:\\/\\/)|(file:\\/\\/)|(\\/))/.test(url);\n };\n Utilities.forEachProperty = function (obj, callback) {\n if (obj) {\n var key = void 0;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n callback(key, obj[key]);\n }\n }\n }\n };\n Utilities.isEmpty = function (obj) {\n var isEmpty = true;\n Utilities.forEachProperty(obj, function () {\n isEmpty = false;\n });\n return isEmpty;\n };\n Utilities.recursiveClone = function (obj) {\n if (!obj || typeof obj !== 'object') {\n return obj;\n }\n var result = Array.isArray(obj) ? [] : {};\n Utilities.forEachProperty(obj, function (key, value) {\n if (value && typeof value === 'object') {\n result[key] = Utilities.recursiveClone(value);\n }\n else {\n result[key] = value;\n }\n });\n return result;\n };\n Utilities.generateAnonymousModule = function () {\n return '===anonymous' + (Utilities.NEXT_ANONYMOUS_ID++) + '===';\n };\n Utilities.isAnonymousModule = function (id) {\n return /^===anonymous/.test(id);\n };\n Utilities.getHighPerformanceTimestamp = function () {\n if (!this.PERFORMANCE_NOW_PROBED) {\n this.PERFORMANCE_NOW_PROBED = true;\n this.HAS_PERFORMANCE_NOW = (AMDLoader.global.performance && typeof AMDLoader.global.performance.now === 'function');\n }\n return (this.HAS_PERFORMANCE_NOW ? AMDLoader.global.performance.now() : Date.now());\n };\n Utilities.NEXT_ANONYMOUS_ID = 1;\n Utilities.PERFORMANCE_NOW_PROBED = false;\n Utilities.HAS_PERFORMANCE_NOW = false;\n return Utilities;\n }());\n AMDLoader.Utilities = Utilities;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n var ConfigurationOptionsUtil = /** @class */ (function () {\n function ConfigurationOptionsUtil() {\n }\n /**\n * Ensure configuration options make sense\n */\n ConfigurationOptionsUtil.validateConfigurationOptions = function (options) {\n function defaultOnError(err) {\n if (err.errorCode === 'load') {\n console.error('Loading \"' + err.moduleId + '\" failed');\n console.error('Detail: ', err.detail);\n if (err.detail && err.detail.stack) {\n console.error(err.detail.stack);\n }\n console.error('Here are the modules that depend on it:');\n console.error(err.neededBy);\n return;\n }\n if (err.errorCode === 'factory') {\n console.error('The factory method of \"' + err.moduleId + '\" has thrown an exception');\n console.error(err.detail);\n if (err.detail && err.detail.stack) {\n console.error(err.detail.stack);\n }\n return;\n }\n }\n options = options || {};\n if (typeof options.baseUrl !== 'string') {\n options.baseUrl = '';\n }\n if (typeof options.isBuild !== 'boolean') {\n options.isBuild = false;\n }\n if (typeof options.paths !== 'object') {\n options.paths = {};\n }\n if (typeof options.config !== 'object') {\n options.config = {};\n }\n if (typeof options.catchError === 'undefined') {\n options.catchError = false;\n }\n if (typeof options.urlArgs !== 'string') {\n options.urlArgs = '';\n }\n if (typeof options.onError !== 'function') {\n options.onError = defaultOnError;\n }\n if (typeof options.ignoreDuplicateModules !== 'object' || !Array.isArray(options.ignoreDuplicateModules)) {\n options.ignoreDuplicateModules = [];\n }\n if (options.baseUrl.length > 0) {\n if (!AMDLoader.Utilities.endsWith(options.baseUrl, '/')) {\n options.baseUrl += '/';\n }\n }\n if (!Array.isArray(options.nodeModules)) {\n options.nodeModules = [];\n }\n if (typeof options.nodeCachedDataWriteDelay !== 'number' || options.nodeCachedDataWriteDelay < 0) {\n options.nodeCachedDataWriteDelay = 1000 * 7;\n }\n if (typeof options.onNodeCachedData !== 'function') {\n options.onNodeCachedData = function (err, data) {\n if (!err) {\n // ignore\n }\n else if (err.errorCode === 'cachedDataRejected') {\n console.warn('Rejected cached data from file: ' + err.path);\n }\n else if (err.errorCode === 'unlink' || err.errorCode === 'writeFile') {\n console.error('Problems writing cached data file: ' + err.path);\n console.error(err.detail);\n }\n else {\n console.error(err);\n }\n };\n }\n return options;\n };\n ConfigurationOptionsUtil.mergeConfigurationOptions = function (overwrite, base) {\n if (overwrite === void 0) { overwrite = null; }\n if (base === void 0) { base = null; }\n var result = AMDLoader.Utilities.recursiveClone(base || {});\n // Merge known properties and overwrite the unknown ones\n AMDLoader.Utilities.forEachProperty(overwrite, function (key, value) {\n if (key === 'ignoreDuplicateModules' && typeof result.ignoreDuplicateModules !== 'undefined') {\n result.ignoreDuplicateModules = result.ignoreDuplicateModules.concat(value);\n }\n else if (key === 'paths' && typeof result.paths !== 'undefined') {\n AMDLoader.Utilities.forEachProperty(value, function (key2, value2) { return result.paths[key2] = value2; });\n }\n else if (key === 'config' && typeof result.config !== 'undefined') {\n AMDLoader.Utilities.forEachProperty(value, function (key2, value2) { return result.config[key2] = value2; });\n }\n else {\n result[key] = AMDLoader.Utilities.recursiveClone(value);\n }\n });\n return ConfigurationOptionsUtil.validateConfigurationOptions(result);\n };\n return ConfigurationOptionsUtil;\n }());\n AMDLoader.ConfigurationOptionsUtil = ConfigurationOptionsUtil;\n var Configuration = /** @class */ (function () {\n function Configuration(env, options) {\n this._env = env;\n this.options = ConfigurationOptionsUtil.mergeConfigurationOptions(options);\n this._createIgnoreDuplicateModulesMap();\n this._createNodeModulesMap();\n this._createSortedPathsRules();\n if (this.options.baseUrl === '') {\n if (this.options.nodeRequire && this.options.nodeRequire.main && this.options.nodeRequire.main.filename && this._env.isNode) {\n var nodeMain = this.options.nodeRequire.main.filename;\n var dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\\\'));\n this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1);\n }\n if (this.options.nodeMain && this._env.isNode) {\n var nodeMain = this.options.nodeMain;\n var dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\\\'));\n this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1);\n }\n }\n }\n Configuration.prototype._createIgnoreDuplicateModulesMap = function () {\n // Build a map out of the ignoreDuplicateModules array\n this.ignoreDuplicateModulesMap = {};\n for (var i = 0; i < this.options.ignoreDuplicateModules.length; i++) {\n this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[i]] = true;\n }\n };\n Configuration.prototype._createNodeModulesMap = function () {\n // Build a map out of nodeModules array\n this.nodeModulesMap = Object.create(null);\n for (var _i = 0, _a = this.options.nodeModules; _i < _a.length; _i++) {\n var nodeModule = _a[_i];\n this.nodeModulesMap[nodeModule] = true;\n }\n };\n Configuration.prototype._createSortedPathsRules = function () {\n var _this = this;\n // Create an array our of the paths rules, sorted descending by length to\n // result in a more specific -> less specific order\n this.sortedPathsRules = [];\n AMDLoader.Utilities.forEachProperty(this.options.paths, function (from, to) {\n if (!Array.isArray(to)) {\n _this.sortedPathsRules.push({\n from: from,\n to: [to]\n });\n }\n else {\n _this.sortedPathsRules.push({\n from: from,\n to: to\n });\n }\n });\n this.sortedPathsRules.sort(function (a, b) {\n return b.from.length - a.from.length;\n });\n };\n /**\n * Clone current configuration and overwrite options selectively.\n * @param options The selective options to overwrite with.\n * @result A new configuration\n */\n Configuration.prototype.cloneAndMerge = function (options) {\n return new Configuration(this._env, ConfigurationOptionsUtil.mergeConfigurationOptions(options, this.options));\n };\n /**\n * Get current options bag. Useful for passing it forward to plugins.\n */\n Configuration.prototype.getOptionsLiteral = function () {\n return this.options;\n };\n Configuration.prototype._applyPaths = function (moduleId) {\n var pathRule;\n for (var i = 0, len = this.sortedPathsRules.length; i < len; i++) {\n pathRule = this.sortedPathsRules[i];\n if (AMDLoader.Utilities.startsWith(moduleId, pathRule.from)) {\n var result = [];\n for (var j = 0, lenJ = pathRule.to.length; j < lenJ; j++) {\n result.push(pathRule.to[j] + moduleId.substr(pathRule.from.length));\n }\n return result;\n }\n }\n return [moduleId];\n };\n Configuration.prototype._addUrlArgsToUrl = function (url) {\n if (AMDLoader.Utilities.containsQueryString(url)) {\n return url + '&' + this.options.urlArgs;\n }\n else {\n return url + '?' + this.options.urlArgs;\n }\n };\n Configuration.prototype._addUrlArgsIfNecessaryToUrl = function (url) {\n if (this.options.urlArgs) {\n return this._addUrlArgsToUrl(url);\n }\n return url;\n };\n Configuration.prototype._addUrlArgsIfNecessaryToUrls = function (urls) {\n if (this.options.urlArgs) {\n for (var i = 0, len = urls.length; i < len; i++) {\n urls[i] = this._addUrlArgsToUrl(urls[i]);\n }\n }\n return urls;\n };\n /**\n * Transform a module id to a location. Appends .js to module ids\n */\n Configuration.prototype.moduleIdToPaths = function (moduleId) {\n if (this.nodeModulesMap[moduleId] === true) {\n // This is a node module...\n if (this.isBuild()) {\n // ...and we are at build time, drop it\n return ['empty:'];\n }\n else {\n // ...and at runtime we create a `shortcut`-path\n return ['node|' + moduleId];\n }\n }\n var result = moduleId;\n var results;\n if (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.isAbsolutePath(result)) {\n results = this._applyPaths(result);\n for (var i = 0, len = results.length; i < len; i++) {\n if (this.isBuild() && results[i] === 'empty:') {\n continue;\n }\n if (!AMDLoader.Utilities.isAbsolutePath(results[i])) {\n results[i] = this.options.baseUrl + results[i];\n }\n if (!AMDLoader.Utilities.endsWith(results[i], '.js') && !AMDLoader.Utilities.containsQueryString(results[i])) {\n results[i] = results[i] + '.js';\n }\n }\n }\n else {\n if (!AMDLoader.Utilities.endsWith(result, '.js') && !AMDLoader.Utilities.containsQueryString(result)) {\n result = result + '.js';\n }\n results = [result];\n }\n return this._addUrlArgsIfNecessaryToUrls(results);\n };\n /**\n * Transform a module id or url to a location.\n */\n Configuration.prototype.requireToUrl = function (url) {\n var result = url;\n if (!AMDLoader.Utilities.isAbsolutePath(result)) {\n result = this._applyPaths(result)[0];\n if (!AMDLoader.Utilities.isAbsolutePath(result)) {\n result = this.options.baseUrl + result;\n }\n }\n return this._addUrlArgsIfNecessaryToUrl(result);\n };\n /**\n * Flag to indicate if current execution is as part of a build.\n */\n Configuration.prototype.isBuild = function () {\n return this.options.isBuild;\n };\n /**\n * Test if module `moduleId` is expected to be defined multiple times\n */\n Configuration.prototype.isDuplicateMessageIgnoredFor = function (moduleId) {\n return this.ignoreDuplicateModulesMap.hasOwnProperty(moduleId);\n };\n /**\n * Get the configuration settings for the provided module id\n */\n Configuration.prototype.getConfigForModule = function (moduleId) {\n if (this.options.config) {\n return this.options.config[moduleId];\n }\n };\n /**\n * Should errors be caught when executing module factories?\n */\n Configuration.prototype.shouldCatchError = function () {\n return this.options.catchError;\n };\n /**\n * Should statistics be recorded?\n */\n Configuration.prototype.shouldRecordStats = function () {\n return this.options.recordStats;\n };\n /**\n * Forward an error to the error handler.\n */\n Configuration.prototype.onError = function (err) {\n this.options.onError(err);\n };\n return Configuration;\n }());\n AMDLoader.Configuration = Configuration;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n /**\n * Load `scriptSrc` only once (avoid multiple <script> tags)\n */\n var OnlyOnceScriptLoader = /** @class */ (function () {\n function OnlyOnceScriptLoader(env) {\n this._env = env;\n this._scriptLoader = null;\n this._callbackMap = {};\n }\n OnlyOnceScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {\n var _this = this;\n if (!this._scriptLoader) {\n this._scriptLoader = (this._env.isWebWorker\n ? new WorkerScriptLoader()\n : this._env.isNode\n ? new NodeScriptLoader(this._env)\n : new BrowserScriptLoader());\n }\n var scriptCallbacks = {\n callback: callback,\n errorback: errorback\n };\n if (this._callbackMap.hasOwnProperty(scriptSrc)) {\n this._callbackMap[scriptSrc].push(scriptCallbacks);\n return;\n }\n this._callbackMap[scriptSrc] = [scriptCallbacks];\n this._scriptLoader.load(moduleManager, scriptSrc, function () { return _this.triggerCallback(scriptSrc); }, function (err) { return _this.triggerErrorback(scriptSrc, err); });\n };\n OnlyOnceScriptLoader.prototype.triggerCallback = function (scriptSrc) {\n var scriptCallbacks = this._callbackMap[scriptSrc];\n delete this._callbackMap[scriptSrc];\n for (var i = 0; i < scriptCallbacks.length; i++) {\n scriptCallbacks[i].callback();\n }\n };\n OnlyOnceScriptLoader.prototype.triggerErrorback = function (scriptSrc, err) {\n var scriptCallbacks = this._callbackMap[scriptSrc];\n delete this._callbackMap[scriptSrc];\n for (var i = 0; i < scriptCallbacks.length; i++) {\n scriptCallbacks[i].errorback(err);\n }\n };\n return OnlyOnceScriptLoader;\n }());\n var BrowserScriptLoader = /** @class */ (function () {\n function BrowserScriptLoader() {\n }\n /**\n * Attach load / error listeners to a script element and remove them when either one has fired.\n * Implemented for browssers supporting HTML5 standard 'load' and 'error' events.\n */\n BrowserScriptLoader.prototype.attachListeners = function (script, callback, errorback) {\n var unbind = function () {\n script.removeEventListener('load', loadEventListener);\n script.removeEventListener('error', errorEventListener);\n };\n var loadEventListener = function (e) {\n unbind();\n callback();\n };\n var errorEventListener = function (e) {\n unbind();\n errorback(e);\n };\n script.addEventListener('load', loadEventListener);\n script.addEventListener('error', errorEventListener);\n };\n BrowserScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {\n var script = document.createElement('script');\n script.setAttribute('async', 'async');\n script.setAttribute('type', 'text/javascript');\n this.attachListeners(script, callback, errorback);\n script.setAttribute('src', scriptSrc);\n document.getElementsByTagName('head')[0].appendChild(script);\n };\n return BrowserScriptLoader;\n }());\n var WorkerScriptLoader = /** @class */ (function () {\n function WorkerScriptLoader() {\n }\n WorkerScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {\n try {\n importScripts(scriptSrc);\n callback();\n }\n catch (e) {\n errorback(e);\n }\n };\n return WorkerScriptLoader;\n }());\n var NodeScriptLoader = /** @class */ (function () {\n function NodeScriptLoader(env) {\n this._env = env;\n this._didInitialize = false;\n this._didPatchNodeRequire = false;\n }\n NodeScriptLoader.prototype._init = function (nodeRequire) {\n if (this._didInitialize) {\n return;\n }\n this._didInitialize = true;\n // capture node modules\n this._fs = nodeRequire('fs');\n this._vm = nodeRequire('vm');\n this._path = nodeRequire('path');\n this._crypto = nodeRequire('crypto');\n // js-flags have an impact on cached data\n this._jsflags = '';\n for (var _i = 0, _a = process.argv; _i < _a.length; _i++) {\n var arg = _a[_i];\n if (arg.indexOf('--js-flags=') === 0) {\n this._jsflags = arg;\n break;\n }\n }\n };\n // patch require-function of nodejs such that we can manually create a script\n // from cached data. this is done by overriding the `Module._compile` function\n NodeScriptLoader.prototype._initNodeRequire = function (nodeRequire, moduleManager) {\n var nodeCachedDataDir = moduleManager.getConfig().getOptionsLiteral().nodeCachedDataDir;\n if (!nodeCachedDataDir || this._didPatchNodeRequire) {\n return;\n }\n this._didPatchNodeRequire = true;\n var that = this;\n var Module = nodeRequire('module');\n function makeRequireFunction(mod) {\n var Module = mod.constructor;\n var require = function require(path) {\n try {\n return mod.require(path);\n }\n finally {\n // nothing\n }\n };\n require.resolve = function resolve(request) {\n return Module._resolveFilename(request, mod);\n };\n require.main = process.mainModule;\n require.extensions = Module._extensions;\n require.cache = Module._cache;\n return require;\n }\n Module.prototype._compile = function (content, filename) {\n // remove shebang\n content = content.replace(/^#!.*/, '');\n // create wrapper function\n var wrapper = Module.wrap(content);\n var cachedDataPath = that._getCachedDataPath(nodeCachedDataDir, filename);\n var options = { filename: filename };\n try {\n options.cachedData = that._fs.readFileSync(cachedDataPath);\n }\n catch (e) {\n options.produceCachedData = true;\n }\n var script = new that._vm.Script(wrapper, options);\n var compileWrapper = script.runInThisContext(options);\n var dirname = that._path.dirname(filename);\n var require = makeRequireFunction(this);\n var args = [this.exports, require, this, filename, dirname, process, AMDLoader.global, Buffer];\n var result = compileWrapper.apply(this.exports, args);\n that._processCachedData(moduleManager, script, cachedDataPath);\n return result;\n };\n };\n NodeScriptLoader.prototype.load = function (moduleManager, scriptSrc, callback, errorback) {\n var _this = this;\n var opts = moduleManager.getConfig().getOptionsLiteral();\n var nodeRequire = (opts.nodeRequire || AMDLoader.global.nodeRequire);\n var nodeInstrumenter = (opts.nodeInstrumenter || function (c) { return c; });\n this._init(nodeRequire);\n this._initNodeRequire(nodeRequire, moduleManager);\n var recorder = moduleManager.getRecorder();\n if (/^node\\|/.test(scriptSrc)) {\n var pieces = scriptSrc.split('|');\n var moduleExports_1 = null;\n try {\n moduleExports_1 = nodeRequire(pieces[1]);\n }\n catch (err) {\n errorback(err);\n return;\n }\n moduleManager.enqueueDefineAnonymousModule([], function () { return moduleExports_1; });\n callback();\n }\n else {\n scriptSrc = AMDLoader.Utilities.fileUriToFilePath(this._env.isWindows, scriptSrc);\n this._fs.readFile(scriptSrc, { encoding: 'utf8' }, function (err, data) {\n if (err) {\n errorback(err);\n return;\n }\n var normalizedScriptSrc = _this._path.normalize(scriptSrc);\n var vmScriptSrc = normalizedScriptSrc;\n // Make the script src friendly towards electron\n if (_this._env.isElectronRenderer) {\n var driveLetterMatch = vmScriptSrc.match(/^([a-z])\\:(.*)/i);\n if (driveLetterMatch) {\n // windows\n vmScriptSrc = \"file:///\" + (driveLetterMatch[1].toUpperCase() + ':' + driveLetterMatch[2]).replace(/\\\\/g, '/');\n }\n else {\n // nix\n vmScriptSrc = \"file://\" + vmScriptSrc;\n }\n }\n var contents, prefix = '(function (require, define, __filename, __dirname) { ', suffix = '\\n});';\n if (data.charCodeAt(0) === NodeScriptLoader._BOM) {\n contents = prefix + data.substring(1) + suffix;\n }\n else {\n contents = prefix + data + suffix;\n }\n contents = nodeInstrumenter(contents, normalizedScriptSrc);\n if (!opts.nodeCachedDataDir) {\n _this._loadAndEvalScript(moduleManager, scriptSrc, vmScriptSrc, contents, { filename: vmScriptSrc }, recorder);\n callback();\n }\n else {\n var cachedDataPath_1 = _this._getCachedDataPath(opts.nodeCachedDataDir, scriptSrc);\n _this._fs.readFile(cachedDataPath_1, function (err, cachedData) {\n // create script options\n var options = {\n filename: vmScriptSrc,\n produceCachedData: typeof cachedData === 'undefined',\n cachedData: cachedData\n };\n var script = _this._loadAndEvalScript(moduleManager, scriptSrc, vmScriptSrc, contents, options, recorder);\n callback();\n _this._processCachedData(moduleManager, script, cachedDataPath_1);\n });\n }\n });\n }\n };\n NodeScriptLoader.prototype._loadAndEvalScript = function (moduleManager, scriptSrc, vmScriptSrc, contents, options, recorder) {\n // create script, run script\n recorder.record(31 /* NodeBeginEvaluatingScript */, scriptSrc);\n var script = new this._vm.Script(contents, options);\n var r = script.runInThisContext(options);\n r.call(AMDLoader.global, moduleManager.getGlobalAMDRequireFunc(), moduleManager.getGlobalAMDDefineFunc(), vmScriptSrc, this._path.dirname(scriptSrc));\n // signal done\n recorder.record(32 /* NodeEndEvaluatingScript */, scriptSrc);\n return script;\n };\n NodeScriptLoader.prototype._getCachedDataPath = function (basedir, filename) {\n var hash = this._crypto.createHash('md5').update(filename, 'utf8').update(this._jsflags, 'utf8').digest('hex');\n var basename = this._path.basename(filename).replace(/\\.js$/, '');\n return this._path.join(basedir, basename + \"-\" + hash + \".code\");\n };\n NodeScriptLoader.prototype._processCachedData = function (moduleManager, script, cachedDataPath) {\n var _this = this;\n if (script.cachedDataRejected) {\n // data rejected => delete cache file\n moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({\n errorCode: 'cachedDataRejected',\n path: cachedDataPath\n });\n NodeScriptLoader._runSoon(function () { return _this._fs.unlink(cachedDataPath, function (err) {\n if (err) {\n moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({\n errorCode: 'unlink',\n path: cachedDataPath,\n detail: err\n });\n }\n }); }, moduleManager.getConfig().getOptionsLiteral().nodeCachedDataWriteDelay);\n }\n else if (script.cachedDataProduced) {\n // data produced => tell outside world\n moduleManager.getConfig().getOptionsLiteral().onNodeCachedData(undefined, {\n path: cachedDataPath,\n length: script.cachedData.length\n });\n // data produced => write cache file\n NodeScriptLoader._runSoon(function () { return _this._fs.writeFile(cachedDataPath, script.cachedData, function (err) {\n if (err) {\n moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({\n errorCode: 'writeFile',\n path: cachedDataPath,\n detail: err\n });\n }\n }); }, moduleManager.getConfig().getOptionsLiteral().nodeCachedDataWriteDelay);\n }\n };\n NodeScriptLoader._runSoon = function (callback, minTimeout) {\n var timeout = minTimeout + Math.ceil(Math.random() * minTimeout);\n setTimeout(callback, timeout);\n };\n NodeScriptLoader._BOM = 0xFEFF;\n return NodeScriptLoader;\n }());\n function createScriptLoader(env) {\n return new OnlyOnceScriptLoader(env);\n }\n AMDLoader.createScriptLoader = createScriptLoader;\n})(AMDLoader || (AMDLoader = {}));\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 *--------------------------------------------------------------------------------------------*/\nvar AMDLoader;\n(function (AMDLoader) {\n // ------------------------------------------------------------------------\n // ModuleIdResolver\n var ModuleIdResolver = /** @class */ (function () {\n function ModuleIdResolver(fromModuleId) {\n var lastSlash = fromModuleId.lastIndexOf('/');\n if (lastSlash !== -1) {\n this.fromModulePath = fromModuleId.substr(0, lastSlash + 1);\n }\n else {\n this.fromModulePath = '';\n }\n }\n /**\n * Normalize 'a/../name' to 'name', etc.\n */\n ModuleIdResolver._normalizeModuleId = function (moduleId) {\n var r = moduleId, pattern;\n // replace /./ => /\n pattern = /\\/\\.\\//;\n while (pattern.test(r)) {\n r = r.replace(pattern, '/');\n }\n // replace ^./ => nothing\n r = r.replace(/^\\.\\//g, '');\n // replace /aa/../ => / (BUT IGNORE /../../)\n pattern = /\\/(([^\\/])|([^\\/][^\\/\\.])|([^\\/\\.][^\\/])|([^\\/][^\\/][^\\/]+))\\/\\.\\.\\//;\n while (pattern.test(r)) {\n r = r.replace(pattern, '/');\n }\n // replace ^aa/../ => nothing (BUT IGNORE ../../)\n r = r.replace(/^(([^\\/])|([^\\/][^\\/\\.])|([^\\/\\.][^\\/])|([^\\/][^\\/][^\\/]+))\\/\\.\\.\\//, '');\n return r;\n };\n /**\n * Resolve relative module ids\n */\n ModuleIdResolver.prototype.resolveModule = function (moduleId) {\n var result = moduleId;\n if (!AMDLoader.Utilities.isAbsolutePath(result)) {\n if (AMDLoader.Utilities.startsWith(result, './') || AMDLoader.Utilities.startsWith(result, '../')) {\n result = ModuleIdResolver._normalizeModuleId(this.fromModulePath + result);\n }\n }\n return result;\n };\n ModuleIdResolver.ROOT = new ModuleIdResolver('');\n return ModuleIdResolver;\n }());\n AMDLoader.ModuleIdResolver = ModuleIdResolver;\n // ------------------------------------------------------------------------\n // Module\n var Module = /** @class */ (function () {\n function Module(id, strId, dependencies, callback, errorback, moduleIdResolver) {\n this.id = id;\n this.strId = strId;\n this.dependencies = dependencies;\n this._callback = callback;\n this._errorback = errorback;\n this.moduleIdResolver = moduleIdResolver;\n this.exports = {};\n this.exportsPassedIn = false;\n this.unresolvedDependenciesCount = this.dependencies.length;\n this._isComplete = false;\n }\n Module._safeInvokeFunction = function (callback, args) {\n try {\n return {\n returnedValue: callback.apply(AMDLoader.global, args),\n producedError: null\n };\n }\n catch (e) {\n return {\n returnedValue: null,\n producedError: e\n };\n }\n };\n Module._invokeFactory = function (config, strModuleId, callback, dependenciesValues) {\n if (config.isBuild() && !AMDLoader.Utilities.isAnonymousModule(strModuleId)) {\n return {\n returnedValue: null,\n producedError: null\n };\n }\n if (config.shouldCatchError()) {\n return this._safeInvokeFunction(callback, dependenciesValues);\n }\n return {\n returnedValue: callback.apply(AMDLoader.global, dependenciesValues),\n producedError: null\n };\n };\n Module.prototype.complete = function (recorder, config, dependenciesValues) {\n this._isComplete = true;\n var producedError = null;\n if (this._callback) {\n if (typeof this._callback === 'function') {\n recorder.record(21 /* BeginInvokeFactory */, this.strId);\n var r = Module._invokeFactory(config, this.strId, this._callback, dependenciesValues);\n producedError = r.producedError;\n recorder.record(22 /* EndInvokeFactory */, this.strId);\n if (!producedError && typeof r.returnedValue !== 'undefined' && (!this.exportsPassedIn || AMDLoader.Utilities.isEmpty(this.exports))) {\n this.exports = r.returnedValue;\n }\n }\n else {\n this.exports = this._callback;\n }\n }\n if (producedError) {\n config.onError({\n errorCode: 'factory',\n moduleId: this.strId,\n detail: producedError\n });\n }\n this.dependencies = null;\n this._callback = null;\n this._errorback = null;\n this.moduleIdResolver = null;\n };\n /**\n * One of the direct dependencies or a transitive dependency has failed to load.\n */\n Module.prototype.onDependencyError = function (err) {\n if (this._errorback) {\n this._errorback(err);\n return true;\n }\n return false;\n };\n /**\n * Is the current module complete?\n */\n Module.prototype.isComplete = function () {\n return this._isComplete;\n };\n return Module;\n }());\n AMDLoader.Module = Module;\n var ModuleIdProvider = /** @class */ (function () {\n function ModuleIdProvider() {\n this._nextId = 0;\n this._strModuleIdToIntModuleId = new Map();\n this._intModuleIdToStrModuleId = [];\n // Ensure values 0, 1, 2 are assigned accordingly with ModuleId\n this.getModuleId('exports');\n this.getModuleId('module');\n this.getModuleId('require');\n }\n ModuleIdProvider.prototype.getMaxModuleId = function () {\n return this._nextId;\n };\n ModuleIdProvider.prototype.getModuleId = function (strModuleId) {\n var id = this._strModuleIdToIntModuleId.get(strModuleId);\n if (typeof id === 'undefined') {\n id = this._nextId++;\n this._strModuleIdToIntModuleId.set(strModuleId, id);\n this._intModuleIdToStrModuleId[id] = strModuleId;\n }\n return id;\n };\n ModuleIdProvider.prototype.getStrModuleId = function (moduleId) {\n return this._intModuleIdToStrModuleId[moduleId];\n };\n return ModuleIdProvider;\n }());\n var RegularDependency = /** @class */ (function () {\n function RegularDependency(id) {\n this.id = id;\n }\n RegularDependency.EXPORTS = new RegularDependency(0 /* EXPORTS */);\n RegularDependency.MODULE = new RegularDependency(1 /* MODULE */);\n RegularDependency.REQUIRE = new RegularDependency(2 /* REQUIRE */);\n return RegularDependency;\n }());\n AMDLoader.RegularDependency = RegularDependency;\n var PluginDependency = /** @class */ (function () {\n function PluginDependency(id, pluginId, pluginParam) {\n this.id = id;\n this.pluginId = pluginId;\n this.pluginParam = pluginParam;\n }\n return PluginDependency;\n }());\n AMDLoader.PluginDependency = PluginDependency;\n var ModuleManager = /** @class */ (function () {\n function ModuleManager(env, scriptLoader, defineFunc, requireFunc, loaderAvailableTimestamp) {\n if (loaderAvailableTimestamp === void 0) { loaderAvailableTimestamp = 0; }\n this._env = env;\n this._scriptLoader = scriptLoader;\n this._loaderAvailableTimestamp = loaderAvailableTimestamp;\n this._defineFunc = defineFunc;\n this._requireFunc = requireFunc;\n this._moduleIdProvider = new ModuleIdProvider();\n this._config = new AMDLoader.Configuration(this._env);\n this._modules2 = [];\n this._knownModules2 = [];\n this._inverseDependencies2 = [];\n this._inversePluginDependencies2 = new Map();\n this._currentAnnonymousDefineCall = null;\n this._recorder = null;\n this._buildInfoPath = [];\n this._buildInfoDefineStack = [];\n this._buildInfoDependencies = [];\n }\n ModuleManager.prototype.reset = function () {\n return new ModuleManager(this._env, this._scriptLoader, this._defineFunc, this._requireFunc, this._loaderAvailableTimestamp);\n };\n ModuleManager.prototype.getGlobalAMDDefineFunc = function () {\n return this._defineFunc;\n };\n ModuleManager.prototype.getGlobalAMDRequireFunc = function () {\n return this._requireFunc;\n };\n ModuleManager._findRelevantLocationInStack = function (needle, stack) {\n var normalize = function (str) { return str.replace(/\\\\/g, '/'); };\n var normalizedPath = normalize(needle);\n var stackPieces = stack.split(/\\n/);\n for (var i = 0; i < stackPieces.length; i++) {\n var m = stackPieces[i].match(/(.*):(\\d+):(\\d+)\\)?$/);\n if (m) {\n var stackPath = m[1];\n var stackLine = m[2];\n var stackColumn = m[3];\n var trimPathOffset = Math.max(stackPath.lastIndexOf(' ') + 1, stackPath.lastIndexOf('(') + 1);\n stackPath = stackPath.substr(trimPathOffset);\n stackPath = normalize(stackPath);\n if (stackPath === normalizedPath) {\n var r = {\n line: parseInt(stackLine, 10),\n col: parseInt(stackColumn, 10)\n };\n if (r.line === 1) {\n r.col -= '(function (require, define, __filename, __dirname) { '.length;\n }\n return r;\n }\n }\n }\n throw new Error('Could not correlate define call site for needle ' + needle);\n };\n ModuleManager.prototype.getBuildInfo = function () {\n if (!this._config.isBuild()) {\n return null;\n }\n var result = [], resultLen = 0;\n for (var i = 0, len = this._modules2.length; i < len; i++) {\n var m = this._modules2[i];\n if (!m) {\n continue;\n }\n var location_1 = this._buildInfoPath[m.id] || null;\n var defineStack = this._buildInfoDefineStack[m.id] || null;\n var dependencies = this._buildInfoDependencies[m.id];\n result[resultLen++] = {\n id: m.strId,\n path: location_1,\n defineLocation: (location_1 && defineStack ? ModuleManager._findRelevantLocationInStack(location_1, defineStack) : null),\n dependencies: dependencies,\n shim: null,\n exports: m.exports\n };\n }\n return result;\n };\n ModuleManager.prototype.getRecorder = function () {\n if (!this._recorder) {\n if (this._config.shouldRecordStats()) {\n this._recorder = new AMDLoader.LoaderEventRecorder(this._loaderAvailableTimestamp);\n }\n else {\n this._recorder = AMDLoader.NullLoaderEventRecorder.INSTANCE;\n }\n }\n return this._recorder;\n };\n ModuleManager.prototype.getLoaderEvents = function () {\n return this.getRecorder().getEvents();\n };\n /**\n * Defines an anonymous module (without an id). Its name will be resolved as we receive a callback from the scriptLoader.\n * @param dependecies @see defineModule\n * @param callback @see defineModule\n */\n ModuleManager.prototype.enqueueDefineAnonymousModule = function (dependencies, callback) {\n if (this._currentAnnonymousDefineCall !== null) {\n throw new Error('Can only have one anonymous define call per script file');\n }\n var stack = null;\n if (this._config.isBuild()) {\n stack = new Error('StackLocation').stack;\n }\n this._currentAnnonymousDefineCall = {\n stack: stack,\n dependencies: dependencies,\n callback: callback\n };\n };\n /**\n * Creates a module and stores it in _modules. The manager will immediately begin resolving its dependencies.\n * @param strModuleId An unique and absolute id of the module. This must not collide with another module's id\n * @param dependencies An array with the dependencies of the module. Special keys are: \"require\", \"exports\" and \"module\"\n * @param callback if callback is a function, it will be called with the resolved dependencies. if callback is an object, it will be considered as the exports of the module.\n */\n ModuleManager.prototype.defineModule = function (strModuleId, dependencies, callback, errorback, stack, moduleIdResolver) {\n var _this = this;\n if (moduleIdResolver === void 0) { moduleIdResolver = new ModuleIdResolver(strModuleId); }\n var moduleId = this._moduleIdProvider.getModuleId(strModuleId);\n if (this._modules2[moduleId]) {\n if (!this._config.isDuplicateMessageIgnoredFor(strModuleId)) {\n console.warn('Duplicate definition of module \\'' + strModuleId + '\\'');\n }\n // Super important! Completely ignore duplicate module definition\n return;\n }\n var m = new Module(moduleId, strModuleId, this._normalizeDependencies(dependencies, moduleIdResolver), callback, errorback, moduleIdResolver);\n this._modules2[moduleId] = m;\n if (this._config.isBuild()) {\n this._buildInfoDefineStack[moduleId] = stack;\n this._buildInfoDependencies[moduleId] = m.dependencies.map(function (dep) { return _this._moduleIdProvider.getStrModuleId(dep.id); });\n }\n // Resolving of dependencies is immediate (not in a timeout). If there's a need to support a packer that concatenates in an\n // unordered manner, in order to finish processing the file, execute the following method in a timeout\n this._resolve(m);\n };\n ModuleManager.prototype._normalizeDependency = function (dependency, moduleIdResolver) {\n if (dependency === 'exports') {\n return RegularDependency.EXPORTS;\n }\n if (dependency === 'module') {\n return RegularDependency.MODULE;\n }\n if (dependency === 'require') {\n return RegularDependency.REQUIRE;\n }\n // Normalize dependency and then request it from the manager\n var bangIndex = dependency.indexOf('!');\n if (bangIndex >= 0) {\n var strPluginId = moduleIdResolver.resolveModule(dependency.substr(0, bangIndex));\n var pluginParam = moduleIdResolver.resolveModule(dependency.substr(bangIndex + 1));\n var dependencyId = this._moduleIdProvider.getModuleId(strPluginId + '!' + pluginParam);\n var pluginId = this._moduleIdProvider.getModuleId(strPluginId);\n return new PluginDependency(dependencyId, pluginId, pluginParam);\n }\n return new RegularDependency(this._moduleIdProvider.getModuleId(moduleIdResolver.resolveModule(dependency)));\n };\n ModuleManager.prototype._normalizeDependencies = function (dependencies, moduleIdResolver) {\n var result = [], resultLen = 0;\n for (var i = 0, len = dependencies.length; i < len; i++) {\n result[resultLen++] = this._normalizeDependency(dependencies[i], moduleIdResolver);\n }\n return result;\n };\n ModuleManager.prototype._relativeRequire = function (moduleIdResolver, dependencies, callback, errorback) {\n if (typeof dependencies === 'string') {\n return this.synchronousRequire(dependencies, moduleIdResolver);\n }\n this.defineModule(AMDLoader.Utilities.generateAnonymousModule(), dependencies, callback, errorback, null, moduleIdResolver);\n };\n /**\n * Require synchronously a module by its absolute id. If the module is not loaded, an exception will be thrown.\n * @param id The unique and absolute id of the required module\n * @return The exports of module 'id'\n */\n ModuleManager.prototype.synchronousRequire = function (_strModuleId, moduleIdResolver) {\n if (moduleIdResolver === void 0) { moduleIdResolver = new ModuleIdResolver(_strModuleId); }\n var dependency = this._normalizeDependency(_strModuleId, moduleIdResolver);\n var m = this._modules2[dependency.id];\n if (!m) {\n throw new Error('Check dependency list! Synchronous require cannot resolve module \\'' + _strModuleId + '\\'. This is the first mention of this module!');\n }\n if (!m.isComplete()) {\n throw new Error('Check dependency list! Synchronous require cannot resolve module \\'' + _strModuleId + '\\'. This module has not been resolved completely yet.');\n }\n return m.exports;\n };\n ModuleManager.prototype.configure = function (params, shouldOverwrite) {\n var oldShouldRecordStats = this._config.shouldRecordStats();\n if (shouldOverwrite) {\n this._config = new AMDLoader.Configuration(this._env, params);\n }\n else {\n this._config = this._config.cloneAndMerge(params);\n }\n if (this._config.shouldRecordStats() && !oldShouldRecordStats) {\n this._recorder = null;\n }\n };\n ModuleManager.prototype.getConfig = function () {\n return this._config;\n };\n /**\n * Callback from the scriptLoader when a module has been loaded.\n * This means its code is available and has been executed.\n */\n ModuleManager.prototype._onLoad = function (moduleId) {\n if (this._currentAnnonymousDefineCall !== null) {\n var defineCall = this._currentAnnonymousDefineCall;\n this._currentAnnonymousDefineCall = null;\n // Hit an anonymous define call\n this.defineModule(this._moduleIdProvider.getStrModuleId(moduleId), defineCall.dependencies, defineCall.callback, null, defineCall.stack);\n }\n };\n ModuleManager.prototype._createLoadError = function (moduleId, err) {\n var _this = this;\n var strModuleId = this._moduleIdProvider.getStrModuleId(moduleId);\n var neededBy = (this._inverseDependencies2[moduleId] || []).map(function (intModuleId) { return _this._moduleIdProvider.getStrModuleId(intModuleId); });\n return {\n errorCode: 'load',\n moduleId: strModuleId,\n neededBy: neededBy,\n detail: err\n };\n };\n /**\n * Callback from the scriptLoader when a module hasn't been loaded.\n * This means that the script was not found (e.g. 404) or there was an error in the script.\n */\n ModuleManager.prototype._onLoadError = function (moduleId, err) {\n var error = this._createLoadError(moduleId, err);\n // Find any 'local' error handlers, walk the entire chain of inverse dependencies if necessary.\n var seenModuleId = [];\n for (var i = 0, len = this._moduleIdProvider.getMaxModuleId(); i < len; i++) {\n seenModuleId[i] = false;\n }\n var someoneNotified = false;\n var queue = [];\n queue.push(moduleId);\n seenModuleId[moduleId] = true;\n while (queue.length > 0) {\n var queueElement = queue.shift();\n var m = this._modules2[queueElement];\n if (m) {\n someoneNotified = m.onDependencyError(error) || someoneNotified;\n }\n var inverseDeps = this._inverseDependencies2[queueElement];\n if (inverseDeps) {\n for (var i = 0, len = inverseDeps.length; i < len; i++) {\n var inverseDep = inverseDeps[i];\n if (!seenModuleId[inverseDep]) {\n queue.push(inverseDep);\n seenModuleId[inverseDep] = true;\n }\n }\n }\n }\n if (!someoneNotified) {\n this._config.onError(error);\n }\n };\n /**\n * Walks (recursively) the dependencies of 'from' in search of 'to'.\n * Returns true if there is such a path or false otherwise.\n * @param from Module id to start at\n * @param to Module id to look for\n */\n ModuleManager.prototype._hasDependencyPath = function (fromId, toId) {\n var from = this._modules2[fromId];\n if (!from) {\n return false;\n }\n var inQueue = [];\n for (var i = 0, len = this._moduleIdProvider.getMaxModuleId(); i < len; i++) {\n inQueue[i] = false;\n }\n var queue = [];\n // Insert 'from' in queue\n queue.push(from);\n inQueue[fromId] = true;\n while (queue.length > 0) {\n // Pop first inserted element of queue\n var element = queue.shift();\n var dependencies = element.dependencies;\n if (dependencies) {\n // Walk the element's dependencies\n for (var i = 0, len = dependencies.length; i < len; i++) {\n var dependency = dependencies[i];\n if (dependency.id === toId) {\n // There is a path to 'to'\n return true;\n }\n var dependencyModule = this._modules2[dependency.id];\n if (dependencyModule && !inQueue[dependency.id]) {\n // Insert 'dependency' in queue\n inQueue[dependency.id] = true;\n queue.push(dependencyModule);\n }\n }\n }\n }\n // There is no path to 'to'\n return false;\n };\n /**\n * Walks (recursively) the dependencies of 'from' in search of 'to'.\n * Returns cycle as array.\n * @param from Module id to start at\n * @param to Module id to look for\n */\n ModuleManager.prototype._findCyclePath = function (fromId, toId, depth) {\n if (fromId === toId || depth === 50) {\n return [fromId];\n }\n var from = this._modules2[fromId];\n if (!from) {\n return null;\n }\n // Walk the element's dependencies\n var dependencies = from.dependencies;\n for (var i = 0, len = dependencies.length; i < len; i++) {\n var path = this._findCyclePath(dependencies[i].id, toId, depth + 1);\n if (path !== null) {\n path.push(fromId);\n return path;\n }\n }\n return null;\n };\n /**\n * Create the local 'require' that is passed into modules\n */\n ModuleManager.prototype._createRequire = function (moduleIdResolver) {\n var _this = this;\n var result = (function (dependencies, callback, errorback) {\n return _this._relativeRequire(moduleIdResolver, dependencies, callback, errorback);\n });\n result.toUrl = function (id) {\n return _this._config.requireToUrl(moduleIdResolver.resolveModule(id));\n };\n result.getStats = function () {\n return _this.getLoaderEvents();\n };\n result.__$__nodeRequire = AMDLoader.global.nodeRequire;\n return result;\n };\n ModuleManager.prototype._loadModule = function (moduleId) {\n var _this = this;\n if (this._modules2[moduleId] || this._knownModules2[moduleId]) {\n // known module\n return;\n }\n this._knownModules2[moduleId] = true;\n var strModuleId = this._moduleIdProvider.getStrModuleId(moduleId);\n var paths = this._config.moduleIdToPaths(strModuleId);\n if (this._env.isNode && strModuleId.indexOf('/') === -1) {\n paths.push('node|' + strModuleId);\n }\n var lastPathIndex = -1;\n var loadNextPath = function (err) {\n lastPathIndex++;\n if (lastPathIndex >= paths.length) {\n // No more paths to try\n _this._onLoadError(moduleId, err);\n }\n else {\n var currentPath_1 = paths[lastPathIndex];\n var recorder_1 = _this.getRecorder();\n if (_this._config.isBuild() && currentPath_1 === 'empty:') {\n _this._buildInfoPath[moduleId] = currentPath_1;\n _this.defineModule(_this._moduleIdProvider.getStrModuleId(moduleId), [], null, null, null);\n _this._onLoad(moduleId);\n return;\n }\n recorder_1.record(10 /* BeginLoadingScript */, currentPath_1);\n _this._scriptLoader.load(_this, currentPath_1, function () {\n if (_this._config.isBuild()) {\n _this._buildInfoPath[moduleId] = currentPath_1;\n }\n recorder_1.record(11 /* EndLoadingScriptOK */, currentPath_1);\n _this._onLoad(moduleId);\n }, function (err) {\n recorder_1.record(12 /* EndLoadingScriptError */, currentPath_1);\n loadNextPath(err);\n });\n }\n };\n loadNextPath(null);\n };\n /**\n * Resolve a plugin dependency with the plugin loaded & complete\n * @param module The module that has this dependency\n * @param pluginDependency The semi-normalized dependency that appears in the module. e.g. 'vs/css!./mycssfile'. Only the plugin part (before !) is normalized\n * @param plugin The plugin (what the plugin exports)\n */\n ModuleManager.prototype._loadPluginDependency = function (plugin, pluginDependency) {\n var _this = this;\n if (this._modules2[pluginDependency.id] || this._knownModules2[pluginDependency.id]) {\n // known module\n return;\n }\n this._knownModules2[pluginDependency.id] = true;\n // Delegate the loading of the resource to the plugin\n var load = (function (value) {\n _this.defineModule(_this._moduleIdProvider.getStrModuleId(pluginDependency.id), [], value, null, null);\n });\n load.error = function (err) {\n _this._config.onError(_this._createLoadError(pluginDependency.id, err));\n };\n plugin.load(pluginDependency.pluginParam, this._createRequire(ModuleIdResolver.ROOT), load, this._config.getOptionsLiteral());\n };\n /**\n * Examine the dependencies of module 'module' and resolve them as needed.\n */\n ModuleManager.prototype._resolve = function (module) {\n var _this = this;\n var dependencies = module.dependencies;\n for (var i = 0, len = dependencies.length; i < len; i++) {\n var dependency = dependencies[i];\n if (dependency === RegularDependency.EXPORTS) {\n module.exportsPassedIn = true;\n module.unresolvedDependenciesCount--;\n continue;\n }\n if (dependency === RegularDependency.MODULE) {\n module.unresolvedDependenciesCount--;\n continue;\n }\n if (dependency === RegularDependency.REQUIRE) {\n module.unresolvedDependenciesCount--;\n continue;\n }\n var dependencyModule = this._modules2[dependency.id];\n if (dependencyModule && dependencyModule.isComplete()) {\n module.unresolvedDependenciesCount--;\n continue;\n }\n if (this._hasDependencyPath(dependency.id, module.id)) {\n console.warn('There is a dependency cycle between \\'' + this._moduleIdProvider.getStrModuleId(dependency.id) + '\\' and \\'' + this._moduleIdProvider.getStrModuleId(module.id) + '\\'. The cyclic path follows:');\n var cyclePath = this._findCyclePath(dependency.id, module.id, 0);\n cyclePath.reverse();\n cyclePath.push(dependency.id);\n console.warn(cyclePath.map(function (id) { return _this._moduleIdProvider.getStrModuleId(id); }).join(' => \\n'));\n // Break the cycle\n module.unresolvedDependenciesCount--;\n continue;\n }\n // record inverse dependency\n this._inverseDependencies2[dependency.id] = this._inverseDependencies2[dependency.id] || [];\n this._inverseDependencies2[dependency.id].push(module.id);\n if (dependency instanceof PluginDependency) {\n var plugin = this._modules2[dependency.pluginId];\n if (plugin && plugin.isComplete()) {\n this._loadPluginDependency(plugin.exports, dependency);\n continue;\n }\n // Record dependency for when the plugin gets loaded\n var inversePluginDeps = this._inversePluginDependencies2.get(dependency.pluginId);\n if (!inversePluginDeps) {\n inversePluginDeps = [];\n this._inversePluginDependencies2.set(dependency.pluginId, inversePluginDeps);\n }\n inversePluginDeps.push(dependency);\n this._loadModule(dependency.pluginId);\n continue;\n }\n this._loadModule(dependency.id);\n }\n if (module.unresolvedDependenciesCount === 0) {\n this._onModuleComplete(module);\n }\n };\n ModuleManager.prototype._onModuleComplete = function (module) {\n var _this = this;\n var recorder = this.getRecorder();\n if (module.isComplete()) {\n // already done\n return;\n }\n var dependencies = module.dependencies;\n var dependenciesValues = [];\n for (var i = 0, len = dependencies.length; i < len; i++) {\n var dependency = dependencies[i];\n if (dependency === RegularDependency.EXPORTS) {\n dependenciesValues[i] = module.exports;\n continue;\n }\n if (dependency === RegularDependency.MODULE) {\n dependenciesValues[i] = {\n id: module.strId,\n config: function () {\n return _this._config.getConfigForModule(module.strId);\n }\n };\n continue;\n }\n if (dependency === RegularDependency.REQUIRE) {\n dependenciesValues[i] = this._createRequire(module.moduleIdResolver);\n continue;\n }\n var dependencyModule = this._modules2[dependency.id];\n if (dependencyModule) {\n dependenciesValues[i] = dependencyModule.exports;\n continue;\n }\n dependenciesValues[i] = null;\n }\n module.complete(recorder, this._config, dependenciesValues);\n // Fetch and clear inverse dependencies\n var inverseDeps = this._inverseDependencies2[module.id];\n this._inverseDependencies2[module.id] = null;\n if (inverseDeps) {\n // Resolve one inverse dependency at a time, always\n // on the lookout for a completed module.\n for (var i = 0, len = inverseDeps.length; i < len; i++) {\n var inverseDependencyId = inverseDeps[i];\n var inverseDependency = this._modules2[inverseDependencyId];\n inverseDependency.unresolvedDependenciesCount--;\n if (inverseDependency.unresolvedDependenciesCount === 0) {\n this._onModuleComplete(inverseDependency);\n }\n }\n }\n var inversePluginDeps = this._inversePluginDependencies2.get(module.id);\n if (inversePluginDeps) {\n // This module is used as a plugin at least once\n // Fetch and clear these inverse plugin dependencies\n this._inversePluginDependencies2.delete(module.id);\n // Resolve plugin dependencies one at a time\n for (var i = 0, len = inversePluginDeps.length; i < len; i++) {\n this._loadPluginDependency(module.exports, inversePluginDeps[i]);\n }\n }\n };\n return ModuleManager;\n }());\n AMDLoader.ModuleManager = ModuleManager;\n})(AMDLoader || (AMDLoader = {}));\nvar define;\nvar AMDLoader;\n(function (AMDLoader) {\n var env = new AMDLoader.Environment();\n var moduleManager = null;\n var DefineFunc = function (id, dependencies, callback) {\n if (typeof id !== 'string') {\n callback = dependencies;\n dependencies = id;\n id = null;\n }\n if (typeof dependencies !== 'object' || !Array.isArray(dependencies)) {\n callback = dependencies;\n dependencies = null;\n }\n if (!dependencies) {\n dependencies = ['require', 'exports', 'module'];\n }\n if (id) {\n moduleManager.defineModule(id, dependencies, callback, null, null);\n }\n else {\n moduleManager.enqueueDefineAnonymousModule(dependencies, callback);\n }\n };\n DefineFunc.amd = {\n jQuery: true\n };\n var _requireFunc_config = function (params, shouldOverwrite) {\n if (shouldOverwrite === void 0) { shouldOverwrite = false; }\n moduleManager.configure(params, shouldOverwrite);\n };\n var RequireFunc = function () {\n if (arguments.length === 1) {\n if ((arguments[0] instanceof Object) && !Array.isArray(arguments[0])) {\n _requireFunc_config(arguments[0]);\n return;\n }\n if (typeof arguments[0] === 'string') {\n return moduleManager.synchronousRequire(arguments[0]);\n }\n }\n if (arguments.length === 2 || arguments.length === 3) {\n if (Array.isArray(arguments[0])) {\n moduleManager.defineModule(AMDLoader.Utilities.generateAnonymousModule(), arguments[0], arguments[1], arguments[2], null);\n return;\n }\n }\n throw new Error('Unrecognized require call');\n };\n RequireFunc.config = _requireFunc_config;\n RequireFunc.getConfig = function () {\n return moduleManager.getConfig().getOptionsLiteral();\n };\n RequireFunc.reset = function () {\n moduleManager = moduleManager.reset();\n };\n RequireFunc.getBuildInfo = function () {\n return moduleManager.getBuildInfo();\n };\n RequireFunc.getStats = function () {\n return moduleManager.getLoaderEvents();\n };\n function init() {\n if (typeof AMDLoader.global.require !== 'undefined' || typeof require !== 'undefined') {\n var _nodeRequire_1 = (AMDLoader.global.require || require);\n if (typeof _nodeRequire_1 === 'function' && typeof _nodeRequire_1.resolve === 'function') {\n // re-expose node's require function\n var nodeRequire = function (what) {\n moduleManager.getRecorder().record(33 /* NodeBeginNativeRequire */, what);\n try {\n return _nodeRequire_1(what);\n }\n finally {\n moduleManager.getRecorder().record(34 /* NodeEndNativeRequire */, what);\n }\n };\n AMDLoader.global.nodeRequire = nodeRequire;\n RequireFunc.nodeRequire = nodeRequire;\n RequireFunc.__$__nodeRequire = nodeRequire;\n }\n }\n if (env.isNode && !env.isElectronRenderer) {\n module.exports = RequireFunc;\n require = RequireFunc;\n }\n else {\n if (!env.isElectronRenderer) {\n AMDLoader.global.define = DefineFunc;\n }\n AMDLoader.global.require = RequireFunc;\n }\n }\n AMDLoader.init = init;\n if (typeof AMDLoader.global.define !== 'function' || !AMDLoader.global.define.amd) {\n moduleManager = new AMDLoader.ModuleManager(env, AMDLoader.createScriptLoader(env), DefineFunc, RequireFunc, AMDLoader.Utilities.getHighPerformanceTimestamp());\n // The global variable require can configure the loader\n if (typeof AMDLoader.global.require !== 'undefined' && typeof AMDLoader.global.require !== 'function') {\n RequireFunc.config(AMDLoader.global.require);\n }\n // This define is for the local closure defined in node in the case that the loader is concatenated\n define = function () {\n return DefineFunc.apply(null, arguments);\n };\n define.amd = DefineFunc.amd;\n if (typeof doNotInitLoader === 'undefined') {\n init();\n }\n }\n})(AMDLoader || (AMDLoader = {}));\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'use strict';\n\n/**\n * Represents information about a specific difference between two sequences.\n */\nexport class DiffChange {\n\n\t/**\n\t * The position of the first element in the original sequence which\n\t * this change affects.\n\t */\n\tpublic originalStart: number;\n\n\t/**\n\t * The number of elements from the original sequence which were\n\t * affected.\n\t */\n\tpublic originalLength: number;\n\n\t/**\n\t * The position of the first element in the modified sequence which\n\t * this change affects.\n\t */\n\tpublic modifiedStart: number;\n\n\t/**\n\t * The number of elements from the modified sequence which were\n\t * affected (added).\n\t */\n\tpublic modifiedLength: number;\n\n\t/**\n\t * Constructs a new DiffChange with the given sequence information\n\t * and content.\n\t */\n\tconstructor(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number) {\n\t\t//Debug.Assert(originalLength > 0 || modifiedLength > 0, \"originalLength and modifiedLength cannot both be <= 0\");\n\t\tthis.originalStart = originalStart;\n\t\tthis.originalLength = originalLength;\n\t\tthis.modifiedStart = modifiedStart;\n\t\tthis.modifiedLength = modifiedLength;\n\t}\n\n\t/**\n\t * The end point (exclusive) of the change in the original sequence.\n\t */\n\tpublic getOriginalEnd() {\n\t\treturn this.originalStart + this.originalLength;\n\t}\n\n\t/**\n\t * The end point (exclusive) of the change in the modified sequence.\n\t */\n\tpublic getModifiedEnd() {\n\t\treturn this.modifiedStart + this.modifiedLength;\n\t}\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'use strict';\n\nimport { DiffChange } from 'vs/base/common/diff/diffChange';\n\n\nfunction createStringSequence(a: string): ISequence {\n\n\treturn {\n\t\tgetLength() { return a.length; },\n\t\tgetElementHash(pos: number) { return a[pos]; }\n\t};\n}\n\nexport function stringDiff(original: string, modified: string, pretty: boolean): IDiffChange[] {\n\treturn new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty);\n}\n\n\nexport interface ISequence {\n\tgetLength(): number;\n\tgetElementHash(index: number): string;\n}\n\nexport interface IDiffChange {\n\t/**\n\t * The position of the first element in the original sequence which\n\t * this change affects.\n\t */\n\toriginalStart: number;\n\n\t/**\n\t * The number of elements from the original sequence which were\n\t * affected.\n\t */\n\toriginalLength: number;\n\n\t/**\n\t * The position of the first element in the modified sequence which\n\t * this change affects.\n\t */\n\tmodifiedStart: number;\n\n\t/**\n\t * The number of elements from the modified sequence which were\n\t * affected (added).\n\t */\n\tmodifiedLength: number;\n}\n\nexport interface IContinueProcessingPredicate {\n\t(furthestOriginalIndex: number, originalSequence: ISequence, matchLengthOfLongest: number): boolean;\n}\n\n//\n// The code below has been ported from a C# implementation in VS\n//\n\nexport class Debug {\n\n\tpublic static Assert(condition: boolean, message: string): void {\n\t\tif (!condition) {\n\t\t\tthrow new Error(message);\n\t\t}\n\t}\n}\n\nexport class MyArray {\n\t/**\n\t * Copies a range of elements from an Array starting at the specified source index and pastes\n\t * them to another Array starting at the specified destination index. The length and the indexes\n\t * are specified as 64-bit integers.\n\t * sourceArray:\n\t *\t\tThe Array that contains the data to copy.\n\t * sourceIndex:\n\t *\t\tA 64-bit integer that represents the index in the sourceArray at which copying begins.\n\t * destinationArray:\n\t *\t\tThe Array that receives the data.\n\t * destinationIndex:\n\t *\t\tA 64-bit integer that represents the index in the destinationArray at which storing begins.\n\t * length:\n\t *\t\tA 64-bit integer that represents the number of elements to copy.\n\t */\n\tpublic static Copy(sourceArray: any[], sourceIndex: number, destinationArray: any[], destinationIndex: number, length: number) {\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdestinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];\n\t\t}\n\t}\n}\n\n//*****************************************************************************\n// LcsDiff.cs\n//\n// An implementation of the difference algorithm described in\n// \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\n//\n// Copyright (C) 2008 Microsoft Corporation @minifier_do_not_preserve\n//*****************************************************************************\n\n// Our total memory usage for storing history is (worst-case):\n// 2 * [(MaxDifferencesHistory + 1) * (MaxDifferencesHistory + 1) - 1] * sizeof(int)\n// 2 * [1448*1448 - 1] * 4 = 16773624 = 16MB\nlet MaxDifferencesHistory = 1447;\n//let MaxDifferencesHistory = 100;\n\n\n\n\n/**\n * A utility class which helps to create the set of DiffChanges from\n * a difference operation. This class accepts original DiffElements and\n * modified DiffElements that are involved in a particular change. The\n * MarktNextChange() method can be called to mark the separation between\n * distinct changes. At the end, the Changes property can be called to retrieve\n * the constructed changes.\n */\nclass DiffChangeHelper {\n\n\tprivate m_changes: DiffChange[];\n\tprivate m_originalStart: number;\n\tprivate m_modifiedStart: number;\n\tprivate m_originalCount: number;\n\tprivate m_modifiedCount: number;\n\n\t/**\n\t * Constructs a new DiffChangeHelper for the given DiffSequences.\n\t */\n\tconstructor() {\n\t\tthis.m_changes = [];\n\t\tthis.m_originalStart = Number.MAX_VALUE;\n\t\tthis.m_modifiedStart = Number.MAX_VALUE;\n\t\tthis.m_originalCount = 0;\n\t\tthis.m_modifiedCount = 0;\n\t}\n\n\t/**\n\t * Marks the beginning of the next change in the set of differences.\n\t */\n\tpublic MarkNextChange(): void {\n\t\t// Only add to the list if there is something to add\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n\t\t\t// Add the new change to our list\n\t\t\tthis.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount,\n\t\t\t\tthis.m_modifiedStart, this.m_modifiedCount));\n\t\t}\n\n\t\t// Reset for the next change\n\t\tthis.m_originalCount = 0;\n\t\tthis.m_modifiedCount = 0;\n\t\tthis.m_originalStart = Number.MAX_VALUE;\n\t\tthis.m_modifiedStart = Number.MAX_VALUE;\n\t}\n\n\t/**\n\t * Adds the original element at the given position to the elements\n\t * affected by the current change. The modified index gives context\n\t * to the change position with respect to the original sequence.\n\t * @param originalIndex The index of the original element to add.\n\t * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.\n\t */\n\tpublic AddOriginalElement(originalIndex: number, modifiedIndex: number) {\n\t\t// The 'true' start index is the smallest of the ones we've seen\n\t\tthis.m_originalStart = Math.min(this.m_originalStart, originalIndex);\n\t\tthis.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\n\n\t\tthis.m_originalCount++;\n\t}\n\n\t/**\n\t * Adds the modified element at the given position to the elements\n\t * affected by the current change. The original index gives context\n\t * to the change position with respect to the modified sequence.\n\t * @param originalIndex The index of the original element that provides corresponding position in the original sequence.\n\t * @param modifiedIndex The index of the modified element to add.\n\t */\n\tpublic AddModifiedElement(originalIndex: number, modifiedIndex: number): void {\n\t\t// The 'true' start index is the smallest of the ones we've seen\n\t\tthis.m_originalStart = Math.min(this.m_originalStart, originalIndex);\n\t\tthis.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);\n\n\t\tthis.m_modifiedCount++;\n\t}\n\n\t/**\n\t * Retrieves all of the changes marked by the class.\n\t */\n\tpublic getChanges(): DiffChange[] {\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n\t\t\t// Finish up on whatever is left\n\t\t\tthis.MarkNextChange();\n\t\t}\n\n\t\treturn this.m_changes;\n\t}\n\n\t/**\n\t * Retrieves all of the changes marked by the class in the reverse order\n\t */\n\tpublic getReverseChanges(): DiffChange[] {\n\t\tif (this.m_originalCount > 0 || this.m_modifiedCount > 0) {\n\t\t\t// Finish up on whatever is left\n\t\t\tthis.MarkNextChange();\n\t\t}\n\n\t\tthis.m_changes.reverse();\n\t\treturn this.m_changes;\n\t}\n\n}\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * An implementation of the difference algorithm described in\n * \"An O(ND) Difference Algorithm and its variations\" by Eugene W. Myers\n */\nexport class LcsDiff {\n\n\tprivate OriginalSequence: ISequence;\n\tprivate ModifiedSequence: ISequence;\n\tprivate ContinueProcessingPredicate: IContinueProcessingPredicate;\n\n\tprivate m_originalIds: number[];\n\tprivate m_modifiedIds: number[];\n\tprivate m_forwardHistory: number[][];\n\tprivate m_reverseHistory: number[][];\n\n\t/**\n\t * Constructs the DiffFinder\n\t */\n\tconstructor(originalSequence: ISequence, newSequence: ISequence, continueProcessingPredicate: IContinueProcessingPredicate = null) {\n\t\tthis.OriginalSequence = originalSequence;\n\t\tthis.ModifiedSequence = newSequence;\n\t\tthis.ContinueProcessingPredicate = continueProcessingPredicate;\n\t\tthis.m_originalIds = [];\n\t\tthis.m_modifiedIds = [];\n\n\t\tthis.m_forwardHistory = [];\n\t\tthis.m_reverseHistory = [];\n\n\t\tthis.ComputeUniqueIdentifiers();\n\t}\n\n\tprivate ComputeUniqueIdentifiers(): void {\n\t\tlet originalSequenceLength = this.OriginalSequence.getLength();\n\t\tlet modifiedSequenceLength = this.ModifiedSequence.getLength();\n\t\tthis.m_originalIds = new Array<number>(originalSequenceLength);\n\t\tthis.m_modifiedIds = new Array<number>(modifiedSequenceLength);\n\n\t\t// Create a new hash table for unique elements from the original\n\t\t// sequence.\n\t\tlet hashTable: { [key: string]: number; } = {};\n\t\tlet currentUniqueId = 1;\n\t\tlet i: number;\n\n\t\t// Fill up the hash table for unique elements\n\t\tfor (i = 0; i < originalSequenceLength; i++) {\n\t\t\tlet originalElementHash = this.OriginalSequence.getElementHash(i);\n\t\t\tif (!hasOwnProperty.call(hashTable, originalElementHash)) {\n\t\t\t\t// No entry in the hashtable so this is a new unique element.\n\t\t\t\t// Assign the element a new unique identifier and add it to the\n\t\t\t\t// hash table\n\t\t\t\tthis.m_originalIds[i] = currentUniqueId++;\n\t\t\t\thashTable[originalElementHash] = this.m_originalIds[i];\n\t\t\t} else {\n\t\t\t\tthis.m_originalIds[i] = hashTable[originalElementHash];\n\t\t\t}\n\t\t}\n\n\t\t// Now match up modified elements\n\t\tfor (i = 0; i < modifiedSequenceLength; i++) {\n\t\t\tlet modifiedElementHash = this.ModifiedSequence.getElementHash(i);\n\t\t\tif (!hasOwnProperty.call(hashTable, modifiedElementHash)) {\n\t\t\t\tthis.m_modifiedIds[i] = currentUniqueId++;\n\t\t\t\thashTable[modifiedElementHash] = this.m_modifiedIds[i];\n\t\t\t} else {\n\t\t\t\tthis.m_modifiedIds[i] = hashTable[modifiedElementHash];\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate ElementsAreEqual(originalIndex: number, newIndex: number): boolean {\n\t\treturn this.m_originalIds[originalIndex] === this.m_modifiedIds[newIndex];\n\t}\n\n\tprivate OriginalElementsAreEqual(index1: number, index2: number): boolean {\n\t\treturn this.m_originalIds[index1] === this.m_originalIds[index2];\n\t}\n\n\tprivate ModifiedElementsAreEqual(index1: number, index2: number): boolean {\n\t\treturn this.m_modifiedIds[index1] === this.m_modifiedIds[index2];\n\t}\n\n\tpublic ComputeDiff(pretty: boolean): IDiffChange[] {\n\t\treturn this._ComputeDiff(0, this.OriginalSequence.getLength() - 1, 0, this.ModifiedSequence.getLength() - 1, pretty);\n\t}\n\n\t/**\n\t * Computes the differences between the original and modified input\n\t * sequences on the bounded range.\n\t * @returns An array of the differences between the two input sequences.\n\t */\n\tprivate _ComputeDiff(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, pretty: boolean): DiffChange[] {\n\t\tlet quitEarlyArr = [false];\n\t\tlet changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);\n\n\t\tif (pretty) {\n\t\t\t// We have to clean up the computed diff to be more intuitive\n\t\t\t// but it turns out this cannot be done correctly until the entire set\n\t\t\t// of diffs have been computed\n\t\t\treturn this.ShiftChanges(changes);\n\t\t}\n\n\t\treturn changes;\n\t}\n\n\t/**\n\t * Private helper method which computes the differences on the bounded range\n\t * recursively.\n\t * @returns An array of the differences between the two input sequences.\n\t */\n\tprivate ComputeDiffRecursive(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, quitEarlyArr: boolean[]): DiffChange[] {\n\t\tquitEarlyArr[0] = false;\n\n\t\t// Find the start of the differences\n\t\twhile (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {\n\t\t\toriginalStart++;\n\t\t\tmodifiedStart++;\n\t\t}\n\n\t\t// Find the end of the differences\n\t\twhile (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {\n\t\t\toriginalEnd--;\n\t\t\tmodifiedEnd--;\n\t\t}\n\n\t\t// In the special case where we either have all insertions or all deletions or the sequences are identical\n\t\tif (originalStart > originalEnd || modifiedStart > modifiedEnd) {\n\t\t\tlet changes: DiffChange[];\n\n\t\t\tif (modifiedStart <= modifiedEnd) {\n\t\t\t\tDebug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\n\n\t\t\t\t// All insertions\n\t\t\t\tchanges = [\n\t\t\t\t\tnew DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)\n\t\t\t\t];\n\t\t\t} else if (originalStart <= originalEnd) {\n\t\t\t\tDebug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\n\n\t\t\t\t// All deletions\n\t\t\t\tchanges = [\n\t\t\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)\n\t\t\t\t];\n\t\t\t} else {\n\t\t\t\tDebug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');\n\t\t\t\tDebug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');\n\n\t\t\t\t// Identical sequences - No differences\n\t\t\t\tchanges = [];\n\t\t\t}\n\n\t\t\treturn changes;\n\t\t}\n\n\t\t// This problem can be solved using the Divide-And-Conquer technique.\n\t\tlet midOriginalArr = [0], midModifiedArr = [0];\n\t\tlet result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);\n\n\t\tlet midOriginal = midOriginalArr[0];\n\t\tlet midModified = midModifiedArr[0];\n\n\t\tif (result !== null) {\n\t\t\t// Result is not-null when there was enough memory to compute the changes while\n\t\t\t// searching for the recursion point\n\t\t\treturn result;\n\t\t} else if (!quitEarlyArr[0]) {\n\t\t\t// We can break the problem down recursively by finding the changes in the\n\t\t\t// First Half: (originalStart, modifiedStart) to (midOriginal, midModified)\n\t\t\t// Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd)\n\t\t\t// NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point\n\n\t\t\tlet leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);\n\t\t\tlet rightChanges: DiffChange[] = [];\n\n\t\t\tif (!quitEarlyArr[0]) {\n\t\t\t\trightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);\n\t\t\t} else {\n\t\t\t\t// We did't have time to finish the first half, so we don't have time to compute this half.\n\t\t\t\t// Consider the entire rest of the sequence different.\n\t\t\t\trightChanges = [\n\t\t\t\t\tnew DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)\n\t\t\t\t];\n\t\t\t}\n\n\t\t\treturn this.ConcatenateChanges(leftChanges, rightChanges);\n\t\t}\n\n\t\t// If we hit here, we quit early, and so can't return anything meaningful\n\t\treturn [\n\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)\n\t\t];\n\t}\n\n\tprivate WALKTRACE(diagonalForwardBase: number, diagonalForwardStart: number, diagonalForwardEnd: number, diagonalForwardOffset: number,\n\t\tdiagonalReverseBase: number, diagonalReverseStart: number, diagonalReverseEnd: number, diagonalReverseOffset: number,\n\t\tforwardPoints: number[], reversePoints: number[],\n\t\toriginalIndex: number, originalEnd: number, midOriginalArr: number[],\n\t\tmodifiedIndex: number, modifiedEnd: number, midModifiedArr: number[],\n\t\tdeltaIsEven: boolean, quitEarlyArr: boolean[]): DiffChange[] {\n\t\tlet forwardChanges: DiffChange[] = null, reverseChanges: DiffChange[] = null;\n\n\t\t// First, walk backward through the forward diagonals history\n\t\tlet changeHelper = new DiffChangeHelper();\n\t\tlet diagonalMin = diagonalForwardStart;\n\t\tlet diagonalMax = diagonalForwardEnd;\n\t\tlet diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset;\n\t\tlet lastOriginalIndex = Number.MIN_VALUE;\n\t\tlet historyIndex = this.m_forwardHistory.length - 1;\n\t\tlet diagonal: number;\n\n\t\tdo {\n\t\t\t// Get the diagonal index from the relative diagonal number\n\t\t\tdiagonal = diagonalRelative + diagonalForwardBase;\n\n\t\t\t// Figure out where we came from\n\t\t\tif (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\n\t\t\t\t// Vertical line (the element is an insert)\n\t\t\t\toriginalIndex = forwardPoints[diagonal + 1];\n\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\n\t\t\t\tif (originalIndex < lastOriginalIndex) {\n\t\t\t\t\tchangeHelper.MarkNextChange();\n\t\t\t\t}\n\t\t\t\tlastOriginalIndex = originalIndex;\n\t\t\t\tchangeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);\n\t\t\t\tdiagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration\n\t\t\t} else {\n\t\t\t\t// Horizontal line (the element is a deletion)\n\t\t\t\toriginalIndex = forwardPoints[diagonal - 1] + 1;\n\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;\n\t\t\t\tif (originalIndex < lastOriginalIndex) {\n\t\t\t\t\tchangeHelper.MarkNextChange();\n\t\t\t\t}\n\t\t\t\tlastOriginalIndex = originalIndex - 1;\n\t\t\t\tchangeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);\n\t\t\t\tdiagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration\n\t\t\t}\n\n\t\t\tif (historyIndex >= 0) {\n\t\t\t\tforwardPoints = this.m_forwardHistory[historyIndex];\n\t\t\t\tdiagonalForwardBase = forwardPoints[0]; //We stored this in the first spot\n\t\t\t\tdiagonalMin = 1;\n\t\t\t\tdiagonalMax = forwardPoints.length - 1;\n\t\t\t}\n\t\t} while (--historyIndex >= -1);\n\n\t\t// Ironically, we get the forward changes as the reverse of the\n\t\t// order we added them since we technically added them backwards\n\t\tforwardChanges = changeHelper.getReverseChanges();\n\n\t\tif (quitEarlyArr[0]) {\n\t\t\t// TODO: Calculate a partial from the reverse diagonals.\n\t\t\t// For now, just assume everything after the midOriginal/midModified point is a diff\n\n\t\t\tlet originalStartPoint = midOriginalArr[0] + 1;\n\t\t\tlet modifiedStartPoint = midModifiedArr[0] + 1;\n\n\t\t\tif (forwardChanges !== null && forwardChanges.length > 0) {\n\t\t\t\tlet lastForwardChange = forwardChanges[forwardChanges.length - 1];\n\t\t\t\toriginalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());\n\t\t\t\tmodifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());\n\t\t\t}\n\n\t\t\treverseChanges = [\n\t\t\t\tnew DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1,\n\t\t\t\t\tmodifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)\n\t\t\t];\n\t\t} else {\n\t\t\t// Now walk backward through the reverse diagonals history\n\t\t\tchangeHelper = new DiffChangeHelper();\n\t\t\tdiagonalMin = diagonalReverseStart;\n\t\t\tdiagonalMax = diagonalReverseEnd;\n\t\t\tdiagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset;\n\t\t\tlastOriginalIndex = Number.MAX_VALUE;\n\t\t\thistoryIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;\n\n\t\t\tdo {\n\t\t\t\t// Get the diagonal index from the relative diagonal number\n\t\t\t\tdiagonal = diagonalRelative + diagonalReverseBase;\n\n\t\t\t\t// Figure out where we came from\n\t\t\t\tif (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\n\t\t\t\t\t// Horizontal line (the element is a deletion))\n\t\t\t\t\toriginalIndex = reversePoints[diagonal + 1] - 1;\n\t\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\n\t\t\t\t\tif (originalIndex > lastOriginalIndex) {\n\t\t\t\t\t\tchangeHelper.MarkNextChange();\n\t\t\t\t\t}\n\t\t\t\t\tlastOriginalIndex = originalIndex + 1;\n\t\t\t\t\tchangeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);\n\t\t\t\t\tdiagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration\n\t\t\t\t} else {\n\t\t\t\t\t// Vertical line (the element is an insertion)\n\t\t\t\t\toriginalIndex = reversePoints[diagonal - 1];\n\t\t\t\t\tmodifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;\n\t\t\t\t\tif (originalIndex > lastOriginalIndex) {\n\t\t\t\t\t\tchangeHelper.MarkNextChange();\n\t\t\t\t\t}\n\t\t\t\t\tlastOriginalIndex = originalIndex;\n\t\t\t\t\tchangeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);\n\t\t\t\t\tdiagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration\n\t\t\t\t}\n\n\t\t\t\tif (historyIndex >= 0) {\n\t\t\t\t\treversePoints = this.m_reverseHistory[historyIndex];\n\t\t\t\t\tdiagonalReverseBase = reversePoints[0]; //We stored this in the first spot\n\t\t\t\t\tdiagonalMin = 1;\n\t\t\t\t\tdiagonalMax = reversePoints.length - 1;\n\t\t\t\t}\n\t\t\t} while (--historyIndex >= -1);\n\n\t\t\t// There are cases where the reverse history will find diffs that\n\t\t\t// are correct, but not intuitive, so we need shift them.\n\t\t\treverseChanges = changeHelper.getChanges();\n\t\t}\n\n\t\treturn this.ConcatenateChanges(forwardChanges, reverseChanges);\n\t}\n\n\t/**\n\t * Given the range to compute the diff on, this method finds the point:\n\t * (midOriginal, midModified)\n\t * that exists in the middle of the LCS of the two sequences and\n\t * is the point at which the LCS problem may be broken down recursively.\n\t * This method will try to keep the LCS trace in memory. If the LCS recursion\n\t * point is calculated and the full trace is available in memory, then this method\n\t * will return the change list.\n\t * @param originalStart The start bound of the original sequence range\n\t * @param originalEnd The end bound of the original sequence range\n\t * @param modifiedStart The start bound of the modified sequence range\n\t * @param modifiedEnd The end bound of the modified sequence range\n\t * @param midOriginal The middle point of the original sequence range\n\t * @param midModified The middle point of the modified sequence range\n\t * @returns The diff changes, if available, otherwise null\n\t */\n\tprivate ComputeRecursionPoint(originalStart: number, originalEnd: number, modifiedStart: number, modifiedEnd: number, midOriginalArr: number[], midModifiedArr: number[], quitEarlyArr: boolean[]) {\n\t\tlet originalIndex: number, modifiedIndex: number;\n\t\tlet diagonalForwardStart = 0, diagonalForwardEnd = 0;\n\t\tlet diagonalReverseStart = 0, diagonalReverseEnd = 0;\n\t\tlet numDifferences: number;\n\n\t\t// To traverse the edit graph and produce the proper LCS, our actual\n\t\t// start position is just outside the given boundary\n\t\toriginalStart--;\n\t\tmodifiedStart--;\n\n\t\t// We set these up to make the compiler happy, but they will\n\t\t// be replaced before we return with the actual recursion point\n\t\tmidOriginalArr[0] = 0;\n\t\tmidModifiedArr[0] = 0;\n\n\t\t// Clear out the history\n\t\tthis.m_forwardHistory = [];\n\t\tthis.m_reverseHistory = [];\n\n\t\t// Each cell in the two arrays corresponds to a diagonal in the edit graph.\n\t\t// The integer value in the cell represents the originalIndex of the furthest\n\t\t// reaching point found so far that ends in that diagonal.\n\t\t// The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number.\n\t\tlet maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart);\n\t\tlet numDiagonals = maxDifferences + 1;\n\t\tlet forwardPoints: number[] = new Array<number>(numDiagonals);\n\t\tlet reversePoints: number[] = new Array<number>(numDiagonals);\n\t\t// diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart)\n\t\t// diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd)\n\t\tlet diagonalForwardBase = (modifiedEnd - modifiedStart);\n\t\tlet diagonalReverseBase = (originalEnd - originalStart);\n\t\t// diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\n\t\t// diagonal number (relative to diagonalForwardBase)\n\t\t// diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the\n\t\t// diagonal number (relative to diagonalReverseBase)\n\t\tlet diagonalForwardOffset = (originalStart - modifiedStart);\n\t\tlet diagonalReverseOffset = (originalEnd - modifiedEnd);\n\n\t\t// delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers\n\t\t// relative to the start diagonal with diagonal numbers relative to the end diagonal.\n\t\t// The Even/Oddn-ness of this delta is important for determining when we should check for overlap\n\t\tlet delta = diagonalReverseBase - diagonalForwardBase;\n\t\tlet deltaIsEven = (delta % 2 === 0);\n\n\t\t// Here we set up the start and end points as the furthest points found so far\n\t\t// in both the forward and reverse directions, respectively\n\t\tforwardPoints[diagonalForwardBase] = originalStart;\n\t\treversePoints[diagonalReverseBase] = originalEnd;\n\n\t\t// Remember if we quit early, and thus need to do a best-effort result instead of a real result.\n\t\tquitEarlyArr[0] = false;\n\n\n\n\t\t// A couple of points:\n\t\t// --With this method, we iterate on the number of differences between the two sequences.\n\t\t// The more differences there actually are, the longer this will take.\n\t\t// --Also, as the number of differences increases, we have to search on diagonals further\n\t\t// away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse).\n\t\t// --We extend on even diagonals (relative to the reference diagonal) only when numDifferences\n\t\t// is even and odd diagonals only when numDifferences is odd.\n\t\tlet diagonal: number, tempOriginalIndex: number;\n\t\tfor (numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) {\n\t\t\tlet furthestOriginalIndex = 0;\n\t\t\tlet furthestModifiedIndex = 0;\n\n\t\t\t// Run the algorithm in the forward direction\n\t\t\tdiagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\n\t\t\tdiagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);\n\t\t\tfor (diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {\n\t\t\t\t// STEP 1: We extend the furthest reaching point in the present diagonal\n\t\t\t\t// by looking at the diagonals above and below and picking the one whose point\n\t\t\t\t// is further away from the start point (originalStart, modifiedStart)\n\t\t\t\tif (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {\n\t\t\t\t\toriginalIndex = forwardPoints[diagonal + 1];\n\t\t\t\t} else {\n\t\t\t\t\toriginalIndex = forwardPoints[diagonal - 1] + 1;\n\t\t\t\t}\n\t\t\t\tmodifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;\n\n\t\t\t\t// Save the current originalIndex so we can test for false overlap in step 3\n\t\t\t\ttempOriginalIndex = originalIndex;\n\n\t\t\t\t// STEP 2: We can continue to extend the furthest reaching point in the present diagonal\n\t\t\t\t// so long as the elements are equal.\n\t\t\t\twhile (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {\n\t\t\t\t\toriginalIndex++;\n\t\t\t\t\tmodifiedIndex++;\n\t\t\t\t}\n\t\t\t\tforwardPoints[diagonal] = originalIndex;\n\n\t\t\t\tif (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {\n\t\t\t\t\tfurthestOriginalIndex = originalIndex;\n\t\t\t\t\tfurthestModifiedIndex = modifiedIndex;\n\t\t\t\t}\n\n\t\t\t\t// STEP 3: If delta is odd (overlap first happens on forward when delta is odd)\n\t\t\t\t// and diagonal is in the range of reverse diagonals computed for numDifferences-1\n\t\t\t\t// (the previous iteration; we haven't computed reverse diagonals for numDifferences yet)\n\t\t\t\t// then check for overlap.\n\t\t\t\tif (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) {\n\t\t\t\t\tif (originalIndex >= reversePoints[diagonal]) {\n\t\t\t\t\t\tmidOriginalArr[0] = originalIndex;\n\t\t\t\t\t\tmidModifiedArr[0] = modifiedIndex;\n\n\t\t\t\t\t\tif (tempOriginalIndex <= reversePoints[diagonal] && MaxDifferencesHistory > 0 && numDifferences <= (MaxDifferencesHistory + 1)) {\n\t\t\t\t\t\t\t// BINGO! We overlapped, and we have the full trace in memory!\n\t\t\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\n\t\t\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\n\t\t\t\t\t\t\t\tforwardPoints, reversePoints,\n\t\t\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\n\t\t\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\n\t\t\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Either false overlap, or we didn't have enough memory for the full trace\n\t\t\t\t\t\t\t// Just return the recursion point\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check to see if we should be quitting early, before moving on to the next iteration.\n\t\t\tlet matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;\n\n\t\t\tif (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, this.OriginalSequence, matchLengthOfLongest)) {\n\t\t\t\t// We can't finish, so skip ahead to generating a result from what we have.\n\t\t\t\tquitEarlyArr[0] = true;\n\n\t\t\t\t// Use the furthest distance we got in the forward direction.\n\t\t\t\tmidOriginalArr[0] = furthestOriginalIndex;\n\t\t\t\tmidModifiedArr[0] = furthestModifiedIndex;\n\n\t\t\t\tif (matchLengthOfLongest > 0 && MaxDifferencesHistory > 0 && numDifferences <= (MaxDifferencesHistory + 1)) {\n\t\t\t\t\t// Enough of the history is in memory to walk it backwards\n\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\n\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\n\t\t\t\t\t\tforwardPoints, reversePoints,\n\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\n\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\n\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t// We didn't actually remember enough of the history.\n\n\t\t\t\t\t//Since we are quiting the diff early, we need to shift back the originalStart and modified start\n\t\t\t\t\t//back into the boundary limits since we decremented their value above beyond the boundary limit.\n\t\t\t\t\toriginalStart++;\n\t\t\t\t\tmodifiedStart++;\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\tnew DiffChange(originalStart, originalEnd - originalStart + 1,\n\t\t\t\t\t\t\tmodifiedStart, modifiedEnd - modifiedStart + 1)\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Run the algorithm in the reverse direction\n\t\t\tdiagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\n\t\t\tdiagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);\n\t\t\tfor (diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {\n\t\t\t\t// STEP 1: We extend the furthest reaching point in the present diagonal\n\t\t\t\t// by looking at the diagonals above and below and picking the one whose point\n\t\t\t\t// is further away from the start point (originalEnd, modifiedEnd)\n\t\t\t\tif (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {\n\t\t\t\t\toriginalIndex = reversePoints[diagonal + 1] - 1;\n\t\t\t\t} else {\n\t\t\t\t\toriginalIndex = reversePoints[diagonal - 1];\n\t\t\t\t}\n\t\t\t\tmodifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;\n\n\t\t\t\t// Save the current originalIndex so we can test for false overlap\n\t\t\t\ttempOriginalIndex = originalIndex;\n\n\t\t\t\t// STEP 2: We can continue to extend the furthest reaching point in the present diagonal\n\t\t\t\t// as long as the elements are equal.\n\t\t\t\twhile (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {\n\t\t\t\t\toriginalIndex--;\n\t\t\t\t\tmodifiedIndex--;\n\t\t\t\t}\n\t\t\t\treversePoints[diagonal] = originalIndex;\n\n\t\t\t\t// STEP 4: If delta is even (overlap first happens on reverse when delta is even)\n\t\t\t\t// and diagonal is in the range of forward diagonals computed for numDifferences\n\t\t\t\t// then check for overlap.\n\t\t\t\tif (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {\n\t\t\t\t\tif (originalIndex <= forwardPoints[diagonal]) {\n\t\t\t\t\t\tmidOriginalArr[0] = originalIndex;\n\t\t\t\t\t\tmidModifiedArr[0] = modifiedIndex;\n\n\t\t\t\t\t\tif (tempOriginalIndex >= forwardPoints[diagonal] && MaxDifferencesHistory > 0 && numDifferences <= (MaxDifferencesHistory + 1)) {\n\t\t\t\t\t\t\t// BINGO! We overlapped, and we have the full trace in memory!\n\t\t\t\t\t\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\n\t\t\t\t\t\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\n\t\t\t\t\t\t\t\tforwardPoints, reversePoints,\n\t\t\t\t\t\t\t\toriginalIndex, originalEnd, midOriginalArr,\n\t\t\t\t\t\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\n\t\t\t\t\t\t\t\tdeltaIsEven, quitEarlyArr\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Either false overlap, or we didn't have enough memory for the full trace\n\t\t\t\t\t\t\t// Just return the recursion point\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Save current vectors to history before the next iteration\n\t\t\tif (numDifferences <= MaxDifferencesHistory) {\n\t\t\t\t// We are allocating space for one extra int, which we fill with\n\t\t\t\t// the index of the diagonal base index\n\t\t\t\tlet temp: number[] = new Array<number>(diagonalForwardEnd - diagonalForwardStart + 2);\n\t\t\t\ttemp[0] = diagonalForwardBase - diagonalForwardStart + 1;\n\t\t\t\tMyArray.Copy(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);\n\t\t\t\tthis.m_forwardHistory.push(temp);\n\n\t\t\t\ttemp = new Array<number>(diagonalReverseEnd - diagonalReverseStart + 2);\n\t\t\t\ttemp[0] = diagonalReverseBase - diagonalReverseStart + 1;\n\t\t\t\tMyArray.Copy(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);\n\t\t\t\tthis.m_reverseHistory.push(temp);\n\t\t\t}\n\n\t\t}\n\n\n\n\t\t// If we got here, then we have the full trace in history. We just have to convert it to a change list\n\t\t// NOTE: This part is a bit messy\n\t\treturn this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset,\n\t\t\tdiagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset,\n\t\t\tforwardPoints, reversePoints,\n\t\t\toriginalIndex, originalEnd, midOriginalArr,\n\t\t\tmodifiedIndex, modifiedEnd, midModifiedArr,\n\t\t\tdeltaIsEven, quitEarlyArr\n\t\t);\n\t}\n\n\t/**\n\t * Shifts the given changes to provide a more intuitive diff.\n\t * While the first element in a diff matches the first element after the diff,\n\t * we shift the diff down.\n\t *\n\t * @param changes The list of changes to shift\n\t * @returns The shifted changes\n\t */\n\tprivate ShiftChanges(changes: DiffChange[]): DiffChange[] {\n\t\tlet mergedDiffs: boolean;\n\t\tdo {\n\t\t\tmergedDiffs = false;\n\n\t\t\t// Shift all the changes down first\n\t\t\tfor (let i = 0; i < changes.length; i++) {\n\t\t\t\tconst change = changes[i];\n\t\t\t\tconst originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this.OriginalSequence.getLength();\n\t\t\t\tconst modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this.ModifiedSequence.getLength();\n\t\t\t\tconst checkOriginal = change.originalLength > 0;\n\t\t\t\tconst checkModified = change.modifiedLength > 0;\n\n\t\t\t\twhile (change.originalStart + change.originalLength < originalStop &&\n\t\t\t\t\tchange.modifiedStart + change.modifiedLength < modifiedStop &&\n\t\t\t\t\t(!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) &&\n\t\t\t\t\t(!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {\n\t\t\t\t\tchange.originalStart++;\n\t\t\t\t\tchange.modifiedStart++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Build up the new list (we have to build a new list because we\n\t\t\t// might have changes we can merge together now)\n\t\t\tlet result = new Array<DiffChange>();\n\t\t\tlet mergedChangeArr: DiffChange[] = [null];\n\t\t\tfor (let i = 0; i < changes.length; i++) {\n\t\t\t\tif (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {\n\t\t\t\t\tmergedDiffs = true;\n\t\t\t\t\tresult.push(mergedChangeArr[0]);\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tresult.push(changes[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchanges = result;\n\t\t} while (mergedDiffs);\n\n\t\t// Shift changes back up until we hit empty or whitespace-only lines\n\t\tfor (let i = changes.length - 1; i >= 0; i--) {\n\t\t\tconst change = changes[i];\n\n\t\t\tlet originalStop = 0;\n\t\t\tlet modifiedStop = 0;\n\t\t\tif (i > 0) {\n\t\t\t\tconst prevChange = changes[i - 1];\n\t\t\t\tif (prevChange.originalLength > 0) {\n\t\t\t\t\toriginalStop = prevChange.originalStart + prevChange.originalLength;\n\t\t\t\t}\n\t\t\t\tif (prevChange.modifiedLength > 0) {\n\t\t\t\t\tmodifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst checkOriginal = change.originalLength > 0;\n\t\t\tconst checkModified = change.modifiedLength > 0;\n\n\t\t\tlet bestDelta = 0;\n\t\t\tlet bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);\n\n\t\t\tfor (let delta = 1; ; delta++) {\n\t\t\t\tlet originalStart = change.originalStart - delta;\n\t\t\t\tlet modifiedStart = change.modifiedStart - delta;\n\n\t\t\t\tif (originalStart < originalStop || modifiedStart < modifiedStop) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tlet score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);\n\n\t\t\t\tif (score > bestScore) {\n\t\t\t\t\tbestScore = score;\n\t\t\t\t\tbestDelta = delta;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchange.originalStart -= bestDelta;\n\t\t\tchange.modifiedStart -= bestDelta;\n\t\t}\n\n\t\treturn changes;\n\t}\n\n\tprivate _OriginalIsBoundary(index: number): boolean {\n\t\tif (index <= 0 || index >= this.OriginalSequence.getLength() - 1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn /^\\s*$/.test(this.OriginalSequence.getElementHash(index));\n\t}\n\n\tprivate _OriginalRegionIsBoundary(originalStart: number, originalLength: number): boolean {\n\t\tif (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (originalLength > 0) {\n\t\t\tlet originalEnd = originalStart + originalLength;\n\t\t\tif (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _ModifiedIsBoundary(index: number): boolean {\n\t\tif (index <= 0 || index >= this.ModifiedSequence.getLength() - 1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn /^\\s*$/.test(this.ModifiedSequence.getElementHash(index));\n\t}\n\n\tprivate _ModifiedRegionIsBoundary(modifiedStart: number, modifiedLength: number): boolean {\n\t\tif (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (modifiedLength > 0) {\n\t\t\tlet modifiedEnd = modifiedStart + modifiedLength;\n\t\t\tif (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate _boundaryScore(originalStart: number, originalLength: number, modifiedStart: number, modifiedLength: number): number {\n\t\tlet originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0);\n\t\tlet modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0);\n\t\treturn (originalScore + modifiedScore);\n\t}\n\n\t/**\n\t * Concatenates the two input DiffChange lists and returns the resulting\n\t * list.\n\t * @param The left changes\n\t * @param The right changes\n\t * @returns The concatenated list\n\t */\n\tprivate ConcatenateChanges(left: DiffChange[], right: DiffChange[]): DiffChange[] {\n\t\tlet mergedChangeArr: DiffChange[] = [];\n\t\tlet result: DiffChange[] = null;\n\n\t\tif (left.length === 0 || right.length === 0) {\n\t\t\treturn (right.length > 0) ? right : left;\n\t\t} else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {\n\t\t\t// Since we break the problem down recursively, it is possible that we\n\t\t\t// might recurse in the middle of a change thereby splitting it into\n\t\t\t// two changes. Here in the combining stage, we detect and fuse those\n\t\t\t// changes back together\n\t\t\tresult = new Array<DiffChange>(left.length + right.length - 1);\n\t\t\tMyArray.Copy(left, 0, result, 0, left.length - 1);\n\t\t\tresult[left.length - 1] = mergedChangeArr[0];\n\t\t\tMyArray.Copy(right, 1, result, left.length, right.length - 1);\n\n\t\t\treturn result;\n\t\t} else {\n\t\t\tresult = new Array<DiffChange>(left.length + right.length);\n\t\t\tMyArray.Copy(left, 0, result, 0, left.length);\n\t\t\tMyArray.Copy(right, 0, result, left.length, right.length);\n\n\t\t\treturn result;\n\t\t}\n\t}\n\n\t/**\n\t * Returns true if the two changes overlap and can be merged into a single\n\t * change\n\t * @param left The left change\n\t * @param right The right change\n\t * @param mergedChange The merged change if the two overlap, null otherwise\n\t * @returns True if the two changes overlap\n\t */\n\tprivate ChangesOverlap(left: DiffChange, right: DiffChange, mergedChangeArr: DiffChange[]): boolean {\n\t\tDebug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change');\n\t\tDebug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change');\n\n\t\tif (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\n\t\t\tlet originalStart = left.originalStart;\n\t\t\tlet originalLength = left.originalLength;\n\t\t\tlet modifiedStart = left.modifiedStart;\n\t\t\tlet modifiedLength = left.modifiedLength;\n\n\t\t\tif (left.originalStart + left.originalLength >= right.originalStart) {\n\t\t\t\toriginalLength = right.originalStart + right.originalLength - left.originalStart;\n\t\t\t}\n\t\t\tif (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {\n\t\t\t\tmodifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;\n\t\t\t}\n\n\t\t\tmergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);\n\t\t\treturn true;\n\t\t} else {\n\t\t\tmergedChangeArr[0] = null;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Helper method used to clip a diagonal index to the range of valid\n\t * diagonals. This also decides whether or not the diagonal index,\n\t * if it exceeds the boundary, should be clipped to the boundary or clipped\n\t * one inside the boundary depending on the Even/Odd status of the boundary\n\t * and numDifferences.\n\t * @param diagonal The index of the diagonal to clip.\n\t * @param numDifferences The current number of differences being iterated upon.\n\t * @param diagonalBaseIndex The base reference diagonal.\n\t * @param numDiagonals The total number of diagonals.\n\t * @returns The clipped diagonal index.\n\t */\n\tprivate ClipDiagonalBound(diagonal: number, numDifferences: number, diagonalBaseIndex: number, numDiagonals: number): number {\n\t\tif (diagonal >= 0 && diagonal < numDiagonals) {\n\t\t\t// Nothing to clip, its in range\n\t\t\treturn diagonal;\n\t\t}\n\n\t\t// diagonalsBelow: The number of diagonals below the reference diagonal\n\t\t// diagonalsAbove: The number of diagonals above the reference diagonal\n\t\tlet diagonalsBelow = diagonalBaseIndex;\n\t\tlet diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;\n\t\tlet diffEven = (numDifferences % 2 === 0);\n\n\t\tif (diagonal < 0) {\n\t\t\tlet lowerBoundEven = (diagonalsBelow % 2 === 0);\n\t\t\treturn (diffEven === lowerBoundEven) ? 0 : 1;\n\t\t} else {\n\t\t\tlet upperBoundEven = (diagonalsAbove % 2 === 0);\n\t\t\treturn (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2;\n\t\t}\n\t}\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\n'use strict';\n\nexport function once<T extends Function>(this: any, fn: T): T {\n\tconst _this = this;\n\tlet didCall = false;\n\tlet result: any;\n\n\treturn function () {\n\t\tif (didCall) {\n\t\t\treturn result;\n\t\t}\n\n\t\tdidCall = true;\n\t\tresult = fn.apply(_this, arguments);\n\n\t\treturn result;\n\t} as any as T;\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\n'use strict';\n\nimport { OperatingSystem } from 'vs/base/common/platform';\n\n/**\n * Virtual Key Codes, the value does not hold any inherent meaning.\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n * But these are \"more general\", as they should work across browsers & OS`s.\n */\nexport const enum KeyCode {\n\t/**\n\t * Placed first to cover the 0 value of the enum.\n\t */\n\tUnknown = 0,\n\n\tBackspace = 1,\n\tTab = 2,\n\tEnter = 3,\n\tShift = 4,\n\tCtrl = 5,\n\tAlt = 6,\n\tPauseBreak = 7,\n\tCapsLock = 8,\n\tEscape = 9,\n\tSpace = 10,\n\tPageUp = 11,\n\tPageDown = 12,\n\tEnd = 13,\n\tHome = 14,\n\tLeftArrow = 15,\n\tUpArrow = 16,\n\tRightArrow = 17,\n\tDownArrow = 18,\n\tInsert = 19,\n\tDelete = 20,\n\n\tKEY_0 = 21,\n\tKEY_1 = 22,\n\tKEY_2 = 23,\n\tKEY_3 = 24,\n\tKEY_4 = 25,\n\tKEY_5 = 26,\n\tKEY_6 = 27,\n\tKEY_7 = 28,\n\tKEY_8 = 29,\n\tKEY_9 = 30,\n\n\tKEY_A = 31,\n\tKEY_B = 32,\n\tKEY_C = 33,\n\tKEY_D = 34,\n\tKEY_E = 35,\n\tKEY_F = 36,\n\tKEY_G = 37,\n\tKEY_H = 38,\n\tKEY_I = 39,\n\tKEY_J = 40,\n\tKEY_K = 41,\n\tKEY_L = 42,\n\tKEY_M = 43,\n\tKEY_N = 44,\n\tKEY_O = 45,\n\tKEY_P = 46,\n\tKEY_Q = 47,\n\tKEY_R = 48,\n\tKEY_S = 49,\n\tKEY_T = 50,\n\tKEY_U = 51,\n\tKEY_V = 52,\n\tKEY_W = 53,\n\tKEY_X = 54,\n\tKEY_Y = 55,\n\tKEY_Z = 56,\n\n\tMeta = 57,\n\tContextMenu = 58,\n\n\tF1 = 59,\n\tF2 = 60,\n\tF3 = 61,\n\tF4 = 62,\n\tF5 = 63,\n\tF6 = 64,\n\tF7 = 65,\n\tF8 = 66,\n\tF9 = 67,\n\tF10 = 68,\n\tF11 = 69,\n\tF12 = 70,\n\tF13 = 71,\n\tF14 = 72,\n\tF15 = 73,\n\tF16 = 74,\n\tF17 = 75,\n\tF18 = 76,\n\tF19 = 77,\n\n\tNumLock = 78,\n\tScrollLock = 79,\n\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ';:' key\n\t */\n\tUS_SEMICOLON = 80,\n\t/**\n\t * For any country/region, the '+' key\n\t * For the US standard keyboard, the '=+' key\n\t */\n\tUS_EQUAL = 81,\n\t/**\n\t * For any country/region, the ',' key\n\t * For the US standard keyboard, the ',<' key\n\t */\n\tUS_COMMA = 82,\n\t/**\n\t * For any country/region, the '-' key\n\t * For the US standard keyboard, the '-_' key\n\t */\n\tUS_MINUS = 83,\n\t/**\n\t * For any country/region, the '.' key\n\t * For the US standard keyboard, the '.>' key\n\t */\n\tUS_DOT = 84,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '/?' key\n\t */\n\tUS_SLASH = 85,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '`~' key\n\t */\n\tUS_BACKTICK = 86,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '[{' key\n\t */\n\tUS_OPEN_SQUARE_BRACKET = 87,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '\\|' key\n\t */\n\tUS_BACKSLASH = 88,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ']}' key\n\t */\n\tUS_CLOSE_SQUARE_BRACKET = 89,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ''\"' key\n\t */\n\tUS_QUOTE = 90,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t */\n\tOEM_8 = 91,\n\t/**\n\t * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\n\t */\n\tOEM_102 = 92,\n\n\tNUMPAD_0 = 93, // VK_NUMPAD0, 0x60, Numeric keypad 0 key\n\tNUMPAD_1 = 94, // VK_NUMPAD1, 0x61, Numeric keypad 1 key\n\tNUMPAD_2 = 95, // VK_NUMPAD2, 0x62, Numeric keypad 2 key\n\tNUMPAD_3 = 96, // VK_NUMPAD3, 0x63, Numeric keypad 3 key\n\tNUMPAD_4 = 97, // VK_NUMPAD4, 0x64, Numeric keypad 4 key\n\tNUMPAD_5 = 98, // VK_NUMPAD5, 0x65, Numeric keypad 5 key\n\tNUMPAD_6 = 99, // VK_NUMPAD6, 0x66, Numeric keypad 6 key\n\tNUMPAD_7 = 100, // VK_NUMPAD7, 0x67, Numeric keypad 7 key\n\tNUMPAD_8 = 101, // VK_NUMPAD8, 0x68, Numeric keypad 8 key\n\tNUMPAD_9 = 102, // VK_NUMPAD9, 0x69, Numeric keypad 9 key\n\n\tNUMPAD_MULTIPLY = 103,\t// VK_MULTIPLY, 0x6A, Multiply key\n\tNUMPAD_ADD = 104,\t\t// VK_ADD, 0x6B, Add key\n\tNUMPAD_SEPARATOR = 105,\t// VK_SEPARATOR, 0x6C, Separator key\n\tNUMPAD_SUBTRACT = 106,\t// VK_SUBTRACT, 0x6D, Subtract key\n\tNUMPAD_DECIMAL = 107,\t// VK_DECIMAL, 0x6E, Decimal key\n\tNUMPAD_DIVIDE = 108,\t// VK_DIVIDE, 0x6F,\n\n\t/**\n\t * Cover all key codes when IME is processing input.\n\t */\n\tKEY_IN_COMPOSITION = 109,\n\n\tABNT_C1 = 110, // Brazilian (ABNT) Keyboard\n\tABNT_C2 = 111, // Brazilian (ABNT) Keyboard\n\n\t/**\n\t * Placed last to cover the length of the enum.\n\t * Please do not depend on this value!\n\t */\n\tMAX_VALUE\n}\n\nclass KeyCodeStrMap {\n\n\tprivate _keyCodeToStr: string[];\n\tprivate _strToKeyCode: { [str: string]: KeyCode; };\n\n\tconstructor() {\n\t\tthis._keyCodeToStr = [];\n\t\tthis._strToKeyCode = Object.create(null);\n\t}\n\n\tdefine(keyCode: KeyCode, str: string): void {\n\t\tthis._keyCodeToStr[keyCode] = str;\n\t\tthis._strToKeyCode[str.toLowerCase()] = keyCode;\n\t}\n\n\tkeyCodeToStr(keyCode: KeyCode): string {\n\t\treturn this._keyCodeToStr[keyCode];\n\t}\n\n\tstrToKeyCode(str: string): KeyCode {\n\t\treturn this._strToKeyCode[str.toLowerCase()] || KeyCode.Unknown;\n\t}\n}\n\nconst uiMap = new KeyCodeStrMap();\nconst userSettingsUSMap = new KeyCodeStrMap();\nconst userSettingsGeneralMap = new KeyCodeStrMap();\n\n(function () {\n\n\tfunction define(keyCode: KeyCode, uiLabel: string, usUserSettingsLabel: string = uiLabel, generalUserSettingsLabel: string = usUserSettingsLabel): void {\n\t\tuiMap.define(keyCode, uiLabel);\n\t\tuserSettingsUSMap.define(keyCode, usUserSettingsLabel);\n\t\tuserSettingsGeneralMap.define(keyCode, generalUserSettingsLabel);\n\t}\n\n\tdefine(KeyCode.Unknown, 'unknown');\n\n\tdefine(KeyCode.Backspace, 'Backspace');\n\tdefine(KeyCode.Tab, 'Tab');\n\tdefine(KeyCode.Enter, 'Enter');\n\tdefine(KeyCode.Shift, 'Shift');\n\tdefine(KeyCode.Ctrl, 'Ctrl');\n\tdefine(KeyCode.Alt, 'Alt');\n\tdefine(KeyCode.PauseBreak, 'PauseBreak');\n\tdefine(KeyCode.CapsLock, 'CapsLock');\n\tdefine(KeyCode.Escape, 'Escape');\n\tdefine(KeyCode.Space, 'Space');\n\tdefine(KeyCode.PageUp, 'PageUp');\n\tdefine(KeyCode.PageDown, 'PageDown');\n\tdefine(KeyCode.End, 'End');\n\tdefine(KeyCode.Home, 'Home');\n\n\tdefine(KeyCode.LeftArrow, 'LeftArrow', 'Left');\n\tdefine(KeyCode.UpArrow, 'UpArrow', 'Up');\n\tdefine(KeyCode.RightArrow, 'RightArrow', 'Right');\n\tdefine(KeyCode.DownArrow, 'DownArrow', 'Down');\n\tdefine(KeyCode.Insert, 'Insert');\n\tdefine(KeyCode.Delete, 'Delete');\n\n\tdefine(KeyCode.KEY_0, '0');\n\tdefine(KeyCode.KEY_1, '1');\n\tdefine(KeyCode.KEY_2, '2');\n\tdefine(KeyCode.KEY_3, '3');\n\tdefine(KeyCode.KEY_4, '4');\n\tdefine(KeyCode.KEY_5, '5');\n\tdefine(KeyCode.KEY_6, '6');\n\tdefine(KeyCode.KEY_7, '7');\n\tdefine(KeyCode.KEY_8, '8');\n\tdefine(KeyCode.KEY_9, '9');\n\n\tdefine(KeyCode.KEY_A, 'A');\n\tdefine(KeyCode.KEY_B, 'B');\n\tdefine(KeyCode.KEY_C, 'C');\n\tdefine(KeyCode.KEY_D, 'D');\n\tdefine(KeyCode.KEY_E, 'E');\n\tdefine(KeyCode.KEY_F, 'F');\n\tdefine(KeyCode.KEY_G, 'G');\n\tdefine(KeyCode.KEY_H, 'H');\n\tdefine(KeyCode.KEY_I, 'I');\n\tdefine(KeyCode.KEY_J, 'J');\n\tdefine(KeyCode.KEY_K, 'K');\n\tdefine(KeyCode.KEY_L, 'L');\n\tdefine(KeyCode.KEY_M, 'M');\n\tdefine(KeyCode.KEY_N, 'N');\n\tdefine(KeyCode.KEY_O, 'O');\n\tdefine(KeyCode.KEY_P, 'P');\n\tdefine(KeyCode.KEY_Q, 'Q');\n\tdefine(KeyCode.KEY_R, 'R');\n\tdefine(KeyCode.KEY_S, 'S');\n\tdefine(KeyCode.KEY_T, 'T');\n\tdefine(KeyCode.KEY_U, 'U');\n\tdefine(KeyCode.KEY_V, 'V');\n\tdefine(KeyCode.KEY_W, 'W');\n\tdefine(KeyCode.KEY_X, 'X');\n\tdefine(KeyCode.KEY_Y, 'Y');\n\tdefine(KeyCode.KEY_Z, 'Z');\n\n\tdefine(KeyCode.Meta, 'Meta');\n\tdefine(KeyCode.ContextMenu, 'ContextMenu');\n\n\tdefine(KeyCode.F1, 'F1');\n\tdefine(KeyCode.F2, 'F2');\n\tdefine(KeyCode.F3, 'F3');\n\tdefine(KeyCode.F4, 'F4');\n\tdefine(KeyCode.F5, 'F5');\n\tdefine(KeyCode.F6, 'F6');\n\tdefine(KeyCode.F7, 'F7');\n\tdefine(KeyCode.F8, 'F8');\n\tdefine(KeyCode.F9, 'F9');\n\tdefine(KeyCode.F10, 'F10');\n\tdefine(KeyCode.F11, 'F11');\n\tdefine(KeyCode.F12, 'F12');\n\tdefine(KeyCode.F13, 'F13');\n\tdefine(KeyCode.F14, 'F14');\n\tdefine(KeyCode.F15, 'F15');\n\tdefine(KeyCode.F16, 'F16');\n\tdefine(KeyCode.F17, 'F17');\n\tdefine(KeyCode.F18, 'F18');\n\tdefine(KeyCode.F19, 'F19');\n\n\tdefine(KeyCode.NumLock, 'NumLock');\n\tdefine(KeyCode.ScrollLock, 'ScrollLock');\n\n\tdefine(KeyCode.US_SEMICOLON, ';', ';', 'OEM_1');\n\tdefine(KeyCode.US_EQUAL, '=', '=', 'OEM_PLUS');\n\tdefine(KeyCode.US_COMMA, ',', ',', 'OEM_COMMA');\n\tdefine(KeyCode.US_MINUS, '-', '-', 'OEM_MINUS');\n\tdefine(KeyCode.US_DOT, '.', '.', 'OEM_PERIOD');\n\tdefine(KeyCode.US_SLASH, '/', '/', 'OEM_2');\n\tdefine(KeyCode.US_BACKTICK, '`', '`', 'OEM_3');\n\tdefine(KeyCode.ABNT_C1, 'ABNT_C1');\n\tdefine(KeyCode.ABNT_C2, 'ABNT_C2');\n\tdefine(KeyCode.US_OPEN_SQUARE_BRACKET, '[', '[', 'OEM_4');\n\tdefine(KeyCode.US_BACKSLASH, '\\\\', '\\\\', 'OEM_5');\n\tdefine(KeyCode.US_CLOSE_SQUARE_BRACKET, ']', ']', 'OEM_6');\n\tdefine(KeyCode.US_QUOTE, '\\'', '\\'', 'OEM_7');\n\tdefine(KeyCode.OEM_8, 'OEM_8');\n\tdefine(KeyCode.OEM_102, 'OEM_102');\n\n\tdefine(KeyCode.NUMPAD_0, 'NumPad0');\n\tdefine(KeyCode.NUMPAD_1, 'NumPad1');\n\tdefine(KeyCode.NUMPAD_2, 'NumPad2');\n\tdefine(KeyCode.NUMPAD_3, 'NumPad3');\n\tdefine(KeyCode.NUMPAD_4, 'NumPad4');\n\tdefine(KeyCode.NUMPAD_5, 'NumPad5');\n\tdefine(KeyCode.NUMPAD_6, 'NumPad6');\n\tdefine(KeyCode.NUMPAD_7, 'NumPad7');\n\tdefine(KeyCode.NUMPAD_8, 'NumPad8');\n\tdefine(KeyCode.NUMPAD_9, 'NumPad9');\n\n\tdefine(KeyCode.NUMPAD_MULTIPLY, 'NumPad_Multiply');\n\tdefine(KeyCode.NUMPAD_ADD, 'NumPad_Add');\n\tdefine(KeyCode.NUMPAD_SEPARATOR, 'NumPad_Separator');\n\tdefine(KeyCode.NUMPAD_SUBTRACT, 'NumPad_Subtract');\n\tdefine(KeyCode.NUMPAD_DECIMAL, 'NumPad_Decimal');\n\tdefine(KeyCode.NUMPAD_DIVIDE, 'NumPad_Divide');\n\n})();\n\nexport namespace KeyCodeUtils {\n\texport function toString(keyCode: KeyCode): string {\n\t\treturn uiMap.keyCodeToStr(keyCode);\n\t}\n\texport function fromString(key: string): KeyCode {\n\t\treturn uiMap.strToKeyCode(key);\n\t}\n\n\texport function toUserSettingsUS(keyCode: KeyCode): string {\n\t\treturn userSettingsUSMap.keyCodeToStr(keyCode);\n\t}\n\texport function toUserSettingsGeneral(keyCode: KeyCode): string {\n\t\treturn userSettingsGeneralMap.keyCodeToStr(keyCode);\n\t}\n\texport function fromUserSettings(key: string): KeyCode {\n\t\treturn userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);\n\t}\n}\n\n/**\n * Binary encoding strategy:\n * ```\n * 1111 11\n * 5432 1098 7654 3210\n * ---- CSAW KKKK KKKK\n * C = bit 11 = ctrlCmd flag\n * S = bit 10 = shift flag\n * A = bit 9 = alt flag\n * W = bit 8 = winCtrl flag\n * K = bits 0-7 = key code\n * ```\n */\nconst enum BinaryKeybindingsMask {\n\tCtrlCmd = (1 << 11) >>> 0,\n\tShift = (1 << 10) >>> 0,\n\tAlt = (1 << 9) >>> 0,\n\tWinCtrl = (1 << 8) >>> 0,\n\tKeyCode = 0x000000ff\n}\n\nexport const enum KeyMod {\n\tCtrlCmd = (1 << 11) >>> 0,\n\tShift = (1 << 10) >>> 0,\n\tAlt = (1 << 9) >>> 0,\n\tWinCtrl = (1 << 8) >>> 0,\n}\n\nexport function KeyChord(firstPart: number, secondPart: number): number {\n\tlet chordPart = ((secondPart & 0x0000ffff) << 16) >>> 0;\n\treturn (firstPart | chordPart) >>> 0;\n}\n\nexport function createKeybinding(keybinding: number, OS: OperatingSystem): Keybinding {\n\tif (keybinding === 0) {\n\t\treturn null;\n\t}\n\tconst firstPart = (keybinding & 0x0000ffff) >>> 0;\n\tconst chordPart = (keybinding & 0xffff0000) >>> 16;\n\tif (chordPart !== 0) {\n\t\treturn new ChordKeybinding(\n\t\t\tcreateSimpleKeybinding(firstPart, OS),\n\t\t\tcreateSimpleKeybinding(chordPart, OS),\n\t\t);\n\t}\n\treturn createSimpleKeybinding(firstPart, OS);\n}\n\nexport function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): SimpleKeybinding {\n\n\tconst ctrlCmd = (keybinding & BinaryKeybindingsMask.CtrlCmd ? true : false);\n\tconst winCtrl = (keybinding & BinaryKeybindingsMask.WinCtrl ? true : false);\n\n\tconst ctrlKey = (OS === OperatingSystem.Macintosh ? winCtrl : ctrlCmd);\n\tconst shiftKey = (keybinding & BinaryKeybindingsMask.Shift ? true : false);\n\tconst altKey = (keybinding & BinaryKeybindingsMask.Alt ? true : false);\n\tconst metaKey = (OS === OperatingSystem.Macintosh ? ctrlCmd : winCtrl);\n\tconst keyCode = (keybinding & BinaryKeybindingsMask.KeyCode);\n\n\treturn new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode);\n}\n\nexport const enum KeybindingType {\n\tSimple = 1,\n\tChord = 2\n}\n\nexport class SimpleKeybinding {\n\tpublic readonly type = KeybindingType.Simple;\n\n\tpublic readonly ctrlKey: boolean;\n\tpublic readonly shiftKey: boolean;\n\tpublic readonly altKey: boolean;\n\tpublic readonly metaKey: boolean;\n\tpublic readonly keyCode: KeyCode;\n\n\tconstructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, keyCode: KeyCode) {\n\t\tthis.ctrlKey = ctrlKey;\n\t\tthis.shiftKey = shiftKey;\n\t\tthis.altKey = altKey;\n\t\tthis.metaKey = metaKey;\n\t\tthis.keyCode = keyCode;\n\t}\n\n\tpublic equals(other: Keybinding): boolean {\n\t\tif (other.type !== KeybindingType.Simple) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (\n\t\t\tthis.ctrlKey === other.ctrlKey\n\t\t\t&& this.shiftKey === other.shiftKey\n\t\t\t&& this.altKey === other.altKey\n\t\t\t&& this.metaKey === other.metaKey\n\t\t\t&& this.keyCode === other.keyCode\n\t\t);\n\t}\n\n\tpublic getHashCode(): string {\n\t\tlet ctrl = this.ctrlKey ? '1' : '0';\n\t\tlet shift = this.shiftKey ? '1' : '0';\n\t\tlet alt = this.altKey ? '1' : '0';\n\t\tlet meta = this.metaKey ? '1' : '0';\n\t\treturn `${ctrl}${shift}${alt}${meta}${this.keyCode}`;\n\t}\n\n\tpublic isModifierKey(): boolean {\n\t\treturn (\n\t\t\tthis.keyCode === KeyCode.Unknown\n\t\t\t|| this.keyCode === KeyCode.Ctrl\n\t\t\t|| this.keyCode === KeyCode.Meta\n\t\t\t|| this.keyCode === KeyCode.Alt\n\t\t\t|| this.keyCode === KeyCode.Shift\n\t\t);\n\t}\n\n\t/**\n\t * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?\n\t */\n\tpublic isDuplicateModifierCase(): boolean {\n\t\treturn (\n\t\t\t(this.ctrlKey && this.keyCode === KeyCode.Ctrl)\n\t\t\t|| (this.shiftKey && this.keyCode === KeyCode.Shift)\n\t\t\t|| (this.altKey && this.keyCode === KeyCode.Alt)\n\t\t\t|| (this.metaKey && this.keyCode === KeyCode.Meta)\n\t\t);\n\t}\n}\n\nexport class ChordKeybinding {\n\tpublic readonly type = KeybindingType.Chord;\n\n\tpublic readonly firstPart: SimpleKeybinding;\n\tpublic readonly chordPart: SimpleKeybinding;\n\n\tconstructor(firstPart: SimpleKeybinding, chordPart: SimpleKeybinding) {\n\t\tthis.firstPart = firstPart;\n\t\tthis.chordPart = chordPart;\n\t}\n\n\tpublic getHashCode(): string {\n\t\treturn `${this.firstPart.getHashCode()};${this.chordPart.getHashCode()}`;\n\t}\n}\n\nexport type Keybinding = SimpleKeybinding | ChordKeybinding;\n\nexport class ResolvedKeybindingPart {\n\treadonly ctrlKey: boolean;\n\treadonly shiftKey: boolean;\n\treadonly altKey: boolean;\n\treadonly metaKey: boolean;\n\n\treadonly keyLabel: string;\n\treadonly keyAriaLabel: string;\n\n\tconstructor(ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean, kbLabel: string, kbAriaLabel: string) {\n\t\tthis.ctrlKey = ctrlKey;\n\t\tthis.shiftKey = shiftKey;\n\t\tthis.altKey = altKey;\n\t\tthis.metaKey = metaKey;\n\t\tthis.keyLabel = kbLabel;\n\t\tthis.keyAriaLabel = kbAriaLabel;\n\t}\n}\n\n/**\n * A resolved keybinding. Can be a simple keybinding or a chord keybinding.\n */\nexport abstract class ResolvedKeybinding {\n\t/**\n\t * This prints the binding in a format suitable for displaying in the UI.\n\t */\n\tpublic abstract getLabel(): string;\n\t/**\n\t * This prints the binding in a format suitable for ARIA.\n\t */\n\tpublic abstract getAriaLabel(): string;\n\t/**\n\t * This prints the binding in a format suitable for electron's accelerators.\n\t * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md\n\t */\n\tpublic abstract getElectronAccelerator(): string;\n\t/**\n\t * This prints the binding in a format suitable for user settings.\n\t */\n\tpublic abstract getUserSettingsLabel(): string;\n\t/**\n\t * Is the user settings label reflecting the label?\n\t */\n\tpublic abstract isWYSIWYG(): boolean;\n\n\t/**\n\t * Is the binding a chord?\n\t */\n\tpublic abstract isChord(): boolean;\n\n\t/**\n\t * Returns the firstPart, chordPart that should be used for dispatching.\n\t */\n\tpublic abstract getDispatchParts(): [string, string];\n\t/**\n\t * Returns the firstPart, chordPart of the keybinding.\n\t * For simple keybindings, the second element will be null.\n\t */\n\tpublic abstract getParts(): [ResolvedKeybindingPart, ResolvedKeybindingPart];\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\n'use strict';\n\nimport { once } from 'vs/base/common/functional';\n\nexport const empty: IDisposable = Object.freeze<IDisposable>({\n\tdispose() { }\n});\n\nexport interface IDisposable {\n\tdispose(): void;\n}\n\nexport function isDisposable<E extends object>(thing: E): thing is E & IDisposable {\n\treturn typeof (<IDisposable><any>thing).dispose === 'function'\n\t\t&& (<IDisposable><any>thing).dispose.length === 0;\n}\n\nexport function dispose<T extends IDisposable>(disposable: T): T;\nexport function dispose<T extends IDisposable>(...disposables: T[]): T[];\nexport function dispose<T extends IDisposable>(disposables: T[]): T[];\nexport function dispose<T extends IDisposable>(first: T | T[], ...rest: T[]): T | T[] {\n\n\tif (Array.isArray(first)) {\n\t\tfirst.forEach(d => d && d.dispose());\n\t\treturn [];\n\t} else if (rest.length === 0) {\n\t\tif (first) {\n\t\t\tfirst.dispose();\n\t\t\treturn first;\n\t\t}\n\t\treturn undefined;\n\t} else {\n\t\tdispose(first);\n\t\tdispose(rest);\n\t\treturn [];\n\t}\n}\n\nexport function combinedDisposable(disposables: IDisposable[]): IDisposable {\n\treturn { dispose: () => dispose(disposables) };\n}\n\nexport function toDisposable(...fns: (() => void)[]): IDisposable {\n\treturn {\n\t\tdispose() {\n\t\t\tfor (const fn of fns) {\n\t\t\t\tfn();\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport abstract class Disposable implements IDisposable {\n\n\tprivate _toDispose: IDisposable[];\n\n\tconstructor() {\n\t\tthis._toDispose = [];\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._toDispose = dispose(this._toDispose);\n\t}\n\n\tprotected _register<T extends IDisposable>(t: T): T {\n\t\tthis._toDispose.push(t);\n\t\treturn t;\n\t}\n}\n\nexport interface IReference<T> extends IDisposable {\n\treadonly object: T;\n}\n\nexport abstract class ReferenceCollection<T> {\n\n\tprivate references: { [key: string]: { readonly object: T; counter: number; } } = Object.create(null);\n\n\tconstructor() { }\n\n\tacquire(key: string): IReference<T> {\n\t\tlet reference = this.references[key];\n\n\t\tif (!reference) {\n\t\t\treference = this.references[key] = { counter: 0, object: this.createReferencedObject(key) };\n\t\t}\n\n\t\tconst { object } = reference;\n\t\tconst dispose = once(() => {\n\t\t\tif (--reference.counter === 0) {\n\t\t\t\tthis.destroyReferencedObject(reference.object);\n\t\t\t\tdelete this.references[key];\n\t\t\t}\n\t\t});\n\n\t\treference.counter++;\n\n\t\treturn { object, dispose };\n\t}\n\n\tprotected abstract createReferencedObject(key: string): T;\n\tprotected abstract destroyReferencedObject(object: T): void;\n}\n\nexport class ImmortalReference<T> implements IReference<T> {\n\tconstructor(public object: T) { }\n\tdispose(): void { /* noop */ }\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\n'use strict';\n\nimport { IIterator } from 'vs/base/common/iterator';\n\nclass Node<E> {\n\telement: E;\n\tnext: Node<E>;\n\tprev: Node<E>;\n\n\tconstructor(element: E) {\n\t\tthis.element = element;\n\t}\n}\n\nexport class LinkedList<E> {\n\n\tprivate _first: Node<E>;\n\tprivate _last: Node<E>;\n\n\tisEmpty(): boolean {\n\t\treturn !this._first;\n\t}\n\n\tclear(): void {\n\t\tthis._first = undefined;\n\t\tthis._last = undefined;\n\t}\n\n\tunshift(element: E) {\n\t\treturn this.insert(element, false);\n\t}\n\n\tpush(element: E) {\n\t\treturn this.insert(element, true);\n\t}\n\n\tprivate insert(element: E, atTheEnd: boolean) {\n\t\tconst newNode = new Node(element);\n\t\tif (!this._first) {\n\t\t\tthis._first = newNode;\n\t\t\tthis._last = newNode;\n\n\t\t} else if (atTheEnd) {\n\t\t\t// push\n\t\t\tconst oldLast = this._last;\n\t\t\tthis._last = newNode;\n\t\t\tnewNode.prev = oldLast;\n\t\t\toldLast.next = newNode;\n\n\t\t} else {\n\t\t\t// unshift\n\t\t\tconst oldFirst = this._first;\n\t\t\tthis._first = newNode;\n\t\t\tnewNode.next = oldFirst;\n\t\t\toldFirst.prev = newNode;\n\t\t}\n\n\t\treturn () => {\n\n\t\t\tfor (let candidate = this._first; candidate instanceof Node; candidate = candidate.next) {\n\t\t\t\tif (candidate !== newNode) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (candidate.prev && candidate.next) {\n\t\t\t\t\t// middle\n\t\t\t\t\tlet anchor = candidate.prev;\n\t\t\t\t\tanchor.next = candidate.next;\n\t\t\t\t\tcandidate.next.prev = anchor;\n\n\t\t\t\t} else if (!candidate.prev && !candidate.next) {\n\t\t\t\t\t// only node\n\t\t\t\t\tthis._first = undefined;\n\t\t\t\t\tthis._last = undefined;\n\n\t\t\t\t} else if (!candidate.next) {\n\t\t\t\t\t// last\n\t\t\t\t\tthis._last = this._last.prev;\n\t\t\t\t\tthis._last.next = undefined;\n\n\t\t\t\t} else if (!candidate.prev) {\n\t\t\t\t\t// first\n\t\t\t\t\tthis._first = this._first.next;\n\t\t\t\t\tthis._first.prev = undefined;\n\t\t\t\t}\n\n\t\t\t\t// done\n\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t}\n\n\titerator(): IIterator<E> {\n\t\tlet element = {\n\t\t\tdone: undefined,\n\t\t\tvalue: undefined,\n\t\t};\n\t\tlet node = this._first;\n\t\treturn {\n\t\t\tnext(): { done: boolean; value: E } {\n\t\t\t\tif (!node) {\n\t\t\t\t\telement.done = true;\n\t\t\t\t\telement.value = undefined;\n\t\t\t\t} else {\n\t\t\t\t\telement.done = false;\n\t\t\t\t\telement.value = node.element;\n\t\t\t\t\tnode = node.next;\n\t\t\t\t}\n\t\t\t\treturn element;\n\t\t\t}\n\t\t};\n\t}\n\n\ttoArray(): E[] {\n\t\tlet result: E[] = [];\n\t\tfor (let node = this._first; node instanceof Node; node = node.next) {\n\t\t\tresult.push(node.element);\n\t\t}\n\t\treturn result;\n\t}\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'use strict';\n\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _locale: string = undefined;\nlet _language: string = undefined;\nlet _translationsConfigFile: string = undefined;\n\ninterface NLSConfig {\n\tlocale: string;\n\tavailableLanguages: { [key: string]: string; };\n\t_translationsConfigFile: string;\n}\n\nexport interface IProcessEnvironment {\n\t[key: string]: string;\n}\n\ninterface INodeProcess {\n\tplatform: string;\n\tenv: IProcessEnvironment;\n\tgetuid(): number;\n\tnextTick: Function;\n}\ndeclare let process: INodeProcess;\ndeclare let global: any;\n\ninterface INavigator {\n\tuserAgent: string;\n\tlanguage: string;\n}\ndeclare let navigator: INavigator;\ndeclare let self: any;\n\nexport const LANGUAGE_DEFAULT = 'en';\n\n// OS detection\nif (typeof process === 'object' && typeof process.nextTick === 'function' && typeof process.platform === 'string') {\n\t_isWindows = (process.platform === 'win32');\n\t_isMacintosh = (process.platform === 'darwin');\n\t_isLinux = (process.platform === 'linux');\n\tconst rawNlsConfig = process.env['VSCODE_NLS_CONFIG'];\n\tif (rawNlsConfig) {\n\t\ttry {\n\t\t\tconst nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);\n\t\t\tconst resolved = nlsConfig.availableLanguages['*'];\n\t\t\t_locale = nlsConfig.locale;\n\t\t\t// VSCode's default language is 'en'\n\t\t\t_language = resolved ? resolved : LANGUAGE_DEFAULT;\n\t\t\t_translationsConfigFile = nlsConfig._translationsConfigFile;\n\t\t} catch (e) {\n\t\t}\n\t}\n\t_isNative = true;\n} else if (typeof navigator === 'object') {\n\tconst userAgent = navigator.userAgent;\n\t_isWindows = userAgent.indexOf('Windows') >= 0;\n\t_isMacintosh = userAgent.indexOf('Macintosh') >= 0;\n\t_isLinux = userAgent.indexOf('Linux') >= 0;\n\t_isWeb = true;\n\t_locale = navigator.language;\n\t_language = _locale;\n}\n\nexport enum Platform {\n\tWeb,\n\tMac,\n\tLinux,\n\tWindows\n}\n\nlet _platform: Platform = Platform.Web;\nif (_isNative) {\n\tif (_isMacintosh) {\n\t\t_platform = Platform.Mac;\n\t} else if (_isWindows) {\n\t\t_platform = Platform.Windows;\n\t} else if (_isLinux) {\n\t\t_platform = Platform.Linux;\n\t}\n}\n\nexport const isWindows = _isWindows;\nexport const isMacintosh = _isMacintosh;\nexport const isLinux = _isLinux;\nexport const isNative = _isNative;\nexport const isWeb = _isWeb;\nexport const platform = _platform;\n\nexport function isRootUser(): boolean {\n\treturn _isNative && !_isWindows && (process.getuid() === 0);\n}\n\n/**\n * The language used for the user interface. The format of\n * the string is all lower case (e.g. zh-tw for Traditional\n * Chinese)\n */\nexport const language = _language;\n\n/**\n * The OS locale or the locale specified by --locale. The format of\n * the string is all lower case (e.g. zh-tw for Traditional\n * Chinese). The UI is not necessarily shown in the provided locale.\n */\nexport const locale = _locale;\n\n/**\n * The translatios that are available through language packs.\n */\nexport const translationsConfigFile = _translationsConfigFile;\n\nconst _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {} as any);\nexport const globals: any = _globals;\n\nlet _setImmediate: (callback: (...args: any[]) => void) => number = null;\nexport function setImmediate(callback: (...args: any[]) => void): number {\n\tif (_setImmediate === null) {\n\t\tif (globals.setImmediate) {\n\t\t\t_setImmediate = globals.setImmediate.bind(globals);\n\t\t} else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') {\n\t\t\t_setImmediate = process.nextTick.bind(process);\n\t\t} else {\n\t\t\t_setImmediate = globals.setTimeout.bind(globals);\n\t\t}\n\t}\n\treturn _setImmediate(callback);\n}\n\nexport const enum OperatingSystem {\n\tWindows = 1,\n\tMacintosh = 2,\n\tLinux = 3\n}\nexport const OS = (_isMacintosh ? OperatingSystem.Macintosh : (_isWindows ? OperatingSystem.Windows : OperatingSystem.Linux));\n\nexport const enum AccessibilitySupport {\n\t/**\n\t * This should be the browser case where it is not known if a screen reader is attached or no.\n\t */\n\tUnknown = 0,\n\n\tDisabled = 1,\n\n\tEnabled = 2\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'use strict';\n\nimport * as platform from 'vs/base/common/platform';\n\n\nfunction _encode(ch: string): string {\n\treturn '%' + ch.charCodeAt(0).toString(16).toUpperCase();\n}\n\n// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent\nfunction encodeURIComponent2(str: string): string {\n\treturn encodeURIComponent(str).replace(/[!'()*]/g, _encode);\n}\n\nfunction encodeNoop(str: string): string {\n\treturn str.replace(/[#?]/, _encode);\n}\n\n\nconst _schemePattern = /^\\w[\\w\\d+.-]*$/;\nconst _singleSlashStart = /^\\//;\nconst _doubleSlashStart = /^\\/\\//;\n\nfunction _validateUri(ret: URI): void {\n\t// scheme, https://tools.ietf.org/html/rfc3986#section-3.1\n\t// ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n\tif (ret.scheme && !_schemePattern.test(ret.scheme)) {\n\t\tthrow new Error('[UriError]: Scheme contains illegal characters.');\n\t}\n\n\t// path, http://tools.ietf.org/html/rfc3986#section-3.3\n\t// If a URI contains an authority component, then the path component\n\t// must either be empty or begin with a slash (\"/\") character. If a URI\n\t// does not contain an authority component, then the path cannot begin\n\t// with two slash characters (\"//\").\n\tif (ret.path) {\n\t\tif (ret.authority) {\n\t\t\tif (!_singleSlashStart.test(ret.path)) {\n\t\t\t\tthrow new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\n\t\t\t}\n\t\t} else {\n\t\t\tif (_doubleSlashStart.test(ret.path)) {\n\t\t\t\tthrow new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst _empty = '';\nconst _slash = '/';\nconst _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\nconst _driveLetterPath = /^\\/[a-zA-Z]:/;\nconst _upperCaseDrive = /^(\\/)?([A-Z]:)/;\nconst _driveLetter = /^[a-zA-Z]:/;\n\n/**\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\n * This class is a simple parser which creates the basic component paths\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\n * and encoding.\n *\n * foo://example.com:8042/over/there?name=ferret#nose\n * \\_/ \\______________/\\_________/ \\_________/ \\__/\n * | | | | |\n * scheme authority path query fragment\n * | _____________________|__\n * / \\ / \\\n * urn:example:animal:ferret:nose\n *\n *\n */\nexport default class URI implements UriComponents {\n\n\tstatic isUri(thing: any): thing is URI {\n\t\tif (thing instanceof URI) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!thing) {\n\t\t\treturn false;\n\t\t}\n\t\treturn typeof (<URI>thing).authority === 'string'\n\t\t\t&& typeof (<URI>thing).fragment === 'string'\n\t\t\t&& typeof (<URI>thing).path === 'string'\n\t\t\t&& typeof (<URI>thing).query === 'string'\n\t\t\t&& typeof (<URI>thing).scheme === 'string';\n\t}\n\n\t/**\n\t * scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.\n\t * The part before the first colon.\n\t */\n\treadonly scheme: string;\n\n\t/**\n\t * authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.\n\t * The part between the first double slashes and the next slash.\n\t */\n\treadonly authority: string;\n\n\t/**\n\t * path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.\n\t */\n\treadonly path: string;\n\n\t/**\n\t * query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.\n\t */\n\treadonly query: string;\n\n\t/**\n\t * fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.\n\t */\n\treadonly fragment: string;\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(scheme: string, authority: string, path: string, query: string, fragment: string);\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(components: UriComponents);\n\n\t/**\n\t * @internal\n\t */\n\tprotected constructor(schemeOrData: string | UriComponents, authority?: string, path?: string, query?: string, fragment?: string) {\n\n\t\tif (typeof schemeOrData === 'object') {\n\t\t\tthis.scheme = schemeOrData.scheme || _empty;\n\t\t\tthis.authority = schemeOrData.authority || _empty;\n\t\t\tthis.path = schemeOrData.path || _empty;\n\t\t\tthis.query = schemeOrData.query || _empty;\n\t\t\tthis.fragment = schemeOrData.fragment || _empty;\n\t\t\t// no validation because it's this URI\n\t\t\t// that creates uri components.\n\t\t\t// _validateUri(this);\n\t\t} else {\n\t\t\tthis.scheme = schemeOrData || _empty;\n\t\t\tthis.authority = authority || _empty;\n\t\t\tthis.path = path || _empty;\n\t\t\tthis.query = query || _empty;\n\t\t\tthis.fragment = fragment || _empty;\n\t\t\t_validateUri(this);\n\t\t}\n\t}\n\n\t// ---- filesystem path -----------------------\n\n\t/**\n\t * Returns a string representing the corresponding file system path of this URI.\n\t * Will handle UNC paths and normalize windows drive letters to lower-case. Also\n\t * uses the platform specific path separator. Will *not* validate the path for\n\t * invalid characters and semantics. Will *not* look at the scheme of this URI.\n\t */\n\tget fsPath(): string {\n\t\treturn _makeFsPath(this);\n\t}\n\n\t// ---- modify to new -------------------------\n\n\tpublic with(change: { scheme?: string; authority?: string; path?: string; query?: string; fragment?: string }): URI {\n\n\t\tif (!change) {\n\t\t\treturn this;\n\t\t}\n\n\t\tlet { scheme, authority, path, query, fragment } = change;\n\t\tif (scheme === void 0) {\n\t\t\tscheme = this.scheme;\n\t\t} else if (scheme === null) {\n\t\t\tscheme = _empty;\n\t\t}\n\t\tif (authority === void 0) {\n\t\t\tauthority = this.authority;\n\t\t} else if (authority === null) {\n\t\t\tauthority = _empty;\n\t\t}\n\t\tif (path === void 0) {\n\t\t\tpath = this.path;\n\t\t} else if (path === null) {\n\t\t\tpath = _empty;\n\t\t}\n\t\tif (query === void 0) {\n\t\t\tquery = this.query;\n\t\t} else if (query === null) {\n\t\t\tquery = _empty;\n\t\t}\n\t\tif (fragment === void 0) {\n\t\t\tfragment = this.fragment;\n\t\t} else if (fragment === null) {\n\t\t\tfragment = _empty;\n\t\t}\n\n\t\tif (scheme === this.scheme\n\t\t\t&& authority === this.authority\n\t\t\t&& path === this.path\n\t\t\t&& query === this.query\n\t\t\t&& fragment === this.fragment) {\n\n\t\t\treturn this;\n\t\t}\n\n\t\treturn new _URI(scheme, authority, path, query, fragment);\n\t}\n\n\t// ---- parse & validate ------------------------\n\n\tpublic static parse(value: string): URI {\n\t\tconst match = _regexp.exec(value);\n\t\tif (!match) {\n\t\t\treturn new _URI(_empty, _empty, _empty, _empty, _empty);\n\t\t}\n\t\treturn new _URI(\n\t\t\tmatch[2] || _empty,\n\t\t\tdecodeURIComponent(match[4] || _empty),\n\t\t\tdecodeURIComponent(match[5] || _empty),\n\t\t\tdecodeURIComponent(match[7] || _empty),\n\t\t\tdecodeURIComponent(match[9] || _empty),\n\t\t);\n\t}\n\n\tpublic static file(path: string): URI {\n\n\t\tlet authority = _empty;\n\n\t\t// normalize to fwd-slashes on windows,\n\t\t// on other systems bwd-slashes are valid\n\t\t// filename character, eg /f\\oo/ba\\r.txt\n\t\tif (platform.isWindows) {\n\t\t\tpath = path.replace(/\\\\/g, _slash);\n\t\t}\n\n\t\t// check for authority as used in UNC shares\n\t\t// or use the path as given\n\t\tif (path[0] === _slash && path[1] === _slash) {\n\t\t\tlet idx = path.indexOf(_slash, 2);\n\t\t\tif (idx === -1) {\n\t\t\t\tauthority = path.substring(2);\n\t\t\t\tpath = _slash;\n\t\t\t} else {\n\t\t\t\tauthority = path.substring(2, idx);\n\t\t\t\tpath = path.substring(idx) || _slash;\n\t\t\t}\n\t\t}\n\n\t\t// Ensure that path starts with a slash\n\t\t// or that it is at least a slash\n\t\tif (_driveLetter.test(path)) {\n\t\t\tpath = _slash + path;\n\n\t\t} else if (path[0] !== _slash) {\n\t\t\t// tricky -> makes invalid paths\n\t\t\t// but otherwise we have to stop\n\t\t\t// allowing relative paths...\n\t\t\tpath = _slash + path;\n\t\t}\n\n\t\treturn new _URI('file', authority, path, _empty, _empty);\n\t}\n\n\tpublic static from(components: { scheme?: string; authority?: string; path?: string; query?: string; fragment?: string }): URI {\n\t\treturn new _URI(\n\t\t\tcomponents.scheme,\n\t\t\tcomponents.authority,\n\t\t\tcomponents.path,\n\t\t\tcomponents.query,\n\t\t\tcomponents.fragment,\n\t\t);\n\t}\n\n\t// ---- printing/externalize ---------------------------\n\n\t/**\n\t *\n\t * @param skipEncoding Do not encode the result, default is `false`\n\t */\n\tpublic toString(skipEncoding: boolean = false): string {\n\t\treturn _asFormatted(this, skipEncoding);\n\t}\n\n\tpublic toJSON(): object {\n\t\tconst res = <UriState>{\n\t\t\t$mid: 1,\n\t\t\tfsPath: this.fsPath,\n\t\t\texternal: this.toString(),\n\t\t};\n\n\t\tif (this.path) {\n\t\t\tres.path = this.path;\n\t\t}\n\n\t\tif (this.scheme) {\n\t\t\tres.scheme = this.scheme;\n\t\t}\n\n\t\tif (this.authority) {\n\t\t\tres.authority = this.authority;\n\t\t}\n\n\t\tif (this.query) {\n\t\t\tres.query = this.query;\n\t\t}\n\n\t\tif (this.fragment) {\n\t\t\tres.fragment = this.fragment;\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tstatic revive(data: UriComponents | any): URI {\n\t\tif (!data) {\n\t\t\treturn data;\n\t\t} else if (data instanceof URI) {\n\t\t\treturn data;\n\t\t} else {\n\t\t\tlet result = new _URI(data);\n\t\t\tresult._fsPath = (<UriState>data).fsPath;\n\t\t\tresult._formatted = (<UriState>data).external;\n\t\t\treturn result;\n\t\t}\n\t}\n}\n\nexport interface UriComponents {\n\tscheme: string;\n\tauthority: string;\n\tpath: string;\n\tquery: string;\n\tfragment: string;\n}\n\ninterface UriState extends UriComponents {\n\t$mid: number;\n\tfsPath: string;\n\texternal: string;\n}\n\n\n// tslint:disable-next-line:class-name\nclass _URI extends URI {\n\n\t_formatted: string = null;\n\t_fsPath: string = null;\n\n\tget fsPath(): string {\n\t\tif (!this._fsPath) {\n\t\t\tthis._fsPath = _makeFsPath(this);\n\t\t}\n\t\treturn this._fsPath;\n\t}\n\n\tpublic toString(skipEncoding: boolean = false): string {\n\t\tif (!skipEncoding) {\n\t\t\tif (!this._formatted) {\n\t\t\t\tthis._formatted = _asFormatted(this, false);\n\t\t\t}\n\t\t\treturn this._formatted;\n\t\t} else {\n\t\t\t// we don't cache that\n\t\t\treturn _asFormatted(this, true);\n\t\t}\n\t}\n}\n\n\n/**\n * Compute `fsPath` for the given uri\n * @param uri\n */\nfunction _makeFsPath(uri: URI): string {\n\n\tlet value: string;\n\tif (uri.authority && uri.path && uri.scheme === 'file') {\n\t\t// unc path: file://shares/c$/far/boo\n\t\tvalue = `//${uri.authority}${uri.path}`;\n\t} else if (_driveLetterPath.test(uri.path)) {\n\t\t// windows drive letter: file:///c:/far/boo\n\t\tvalue = uri.path[1].toLowerCase() + uri.path.substr(2);\n\t} else {\n\t\t// other path\n\t\tvalue = uri.path;\n\t}\n\tif (platform.isWindows) {\n\t\tvalue = value.replace(/\\//g, '\\\\');\n\t}\n\treturn value;\n}\n\n/**\n * Create the external version of a uri\n */\nfunction _asFormatted(uri: URI, skipEncoding: boolean): string {\n\n\tconst encoder = !skipEncoding\n\t\t? encodeURIComponent2\n\t\t: encodeNoop;\n\n\tconst parts: string[] = [];\n\n\tlet { scheme, authority, path, query, fragment } = uri;\n\tif (scheme) {\n\t\tparts.push(scheme, ':');\n\t}\n\tif (authority || scheme === 'file') {\n\t\tparts.push('//');\n\t}\n\tif (authority) {\n\t\tlet idx = authority.indexOf('@');\n\t\tif (idx !== -1) {\n\t\t\tconst userinfo = authority.substr(0, idx);\n\t\t\tauthority = authority.substr(idx + 1);\n\t\t\tidx = userinfo.indexOf(':');\n\t\t\tif (idx === -1) {\n\t\t\t\tparts.push(encoder(userinfo));\n\t\t\t} else {\n\t\t\t\tparts.push(encoder(userinfo.substr(0, idx)), ':', encoder(userinfo.substr(idx + 1)));\n\t\t\t}\n\t\t\tparts.push('@');\n\t\t}\n\t\tauthority = authority.toLowerCase();\n\t\tidx = authority.indexOf(':');\n\t\tif (idx === -1) {\n\t\t\tparts.push(encoder(authority));\n\t\t} else {\n\t\t\tparts.push(encoder(authority.substr(0, idx)), authority.substr(idx));\n\t\t}\n\t}\n\tif (path) {\n\t\t// lower-case windows drive letters in /C:/fff or C:/fff\n\t\tconst m = _upperCaseDrive.exec(path);\n\t\tif (m) {\n\t\t\tif (m[1]) {\n\t\t\t\tpath = '/' + m[2].toLowerCase() + path.substr(3); // \"/c:\".length === 3\n\t\t\t} else {\n\t\t\t\tpath = m[2].toLowerCase() + path.substr(2); // // \"c:\".length === 2\n\t\t\t}\n\t\t}\n\n\t\t// encode every segement but not slashes\n\t\t// make sure that # and ? are always encoded\n\t\t// when occurring in paths - otherwise the result\n\t\t// cannot be parsed back again\n\t\tlet lastIdx = 0;\n\t\twhile (true) {\n\t\t\tlet idx = path.indexOf(_slash, lastIdx);\n\t\t\tif (idx === -1) {\n\t\t\t\tparts.push(encoder(path.substring(lastIdx)));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tparts.push(encoder(path.substring(lastIdx, idx)), _slash);\n\t\t\tlastIdx = idx + 1;\n\t\t}\n\t}\n\tif (query) {\n\t\tparts.push('?', encoder(query));\n\t}\n\tif (fragment) {\n\t\tparts.push('#', encoder(fragment));\n\t}\n\n\treturn parts.join(_empty);\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\n'use strict';\n\nimport URI from 'vs/base/common/uri';\n\nexport function values<V = any>(set: Set<V>): V[];\nexport function values<K = any, V = any>(map: Map<K, V>): V[];\nexport function values<V>(forEachable: { forEach(callback: (value: V, ...more: any[]) => any) }): V[] {\n\tconst result: V[] = [];\n\tforEachable.forEach(value => result.push(value));\n\treturn result;\n}\n\nexport function keys<K, V>(map: Map<K, V>): K[] {\n\tconst result: K[] = [];\n\tmap.forEach((value, key) => result.push(key));\n\n\treturn result;\n}\n\nexport function getOrSet<K, V>(map: Map<K, V>, key: K, value: V): V {\n\tlet result = map.get(key);\n\tif (result === void 0) {\n\t\tresult = value;\n\t\tmap.set(key, result);\n\t}\n\n\treturn result;\n}\n\nexport interface IKeyIterator {\n\treset(key: string): this;\n\tnext(): this;\n\tjoin(parts: string[]): string;\n\n\thasNext(): boolean;\n\tcmp(a: string): number;\n\tvalue(): string;\n}\n\nexport class StringIterator implements IKeyIterator {\n\n\tprivate _value: string = '';\n\tprivate _pos: number = 0;\n\n\treset(key: string): this {\n\t\tthis._value = key;\n\t\tthis._pos = 0;\n\t\treturn this;\n\t}\n\n\tnext(): this {\n\t\tthis._pos += 1;\n\t\treturn this;\n\t}\n\n\tjoin(parts: string[]): string {\n\t\treturn parts.join('');\n\t}\n\n\thasNext(): boolean {\n\t\treturn this._pos < this._value.length - 1;\n\t}\n\n\tcmp(a: string): number {\n\t\tlet aCode = a.charCodeAt(0);\n\t\tlet thisCode = this._value.charCodeAt(this._pos);\n\t\treturn aCode - thisCode;\n\t}\n\n\tvalue(): string {\n\t\treturn this._value[this._pos];\n\t}\n}\n\nexport class PathIterator implements IKeyIterator {\n\n\tprivate static readonly _fwd = '/'.charCodeAt(0);\n\tprivate static readonly _bwd = '\\\\'.charCodeAt(0);\n\n\tprivate _value: string;\n\tprivate _from: number;\n\tprivate _to: number;\n\n\treset(key: string): this {\n\t\tthis._value = key.replace(/\\\\$|\\/$/, '');\n\t\tthis._from = 0;\n\t\tthis._to = 0;\n\t\treturn this.next();\n\t}\n\n\thasNext(): boolean {\n\t\treturn this._to < this._value.length;\n\t}\n\n\tjoin(parts: string[]): string {\n\t\treturn parts.join('/');\n\t}\n\n\tnext(): this {\n\t\t// this._data = key.split(/[\\\\/]/).filter(s => !!s);\n\t\tthis._from = this._to;\n\t\tlet justSeps = true;\n\t\tfor (; this._to < this._value.length; this._to++) {\n\t\t\tconst ch = this._value.charCodeAt(this._to);\n\t\t\tif (ch === PathIterator._fwd || ch === PathIterator._bwd) {\n\t\t\t\tif (justSeps) {\n\t\t\t\t\tthis._from++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjustSeps = false;\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tcmp(a: string): number {\n\n\t\tlet aPos = 0;\n\t\tlet aLen = a.length;\n\t\tlet thisPos = this._from;\n\n\t\twhile (aPos < aLen && thisPos < this._to) {\n\t\t\tlet cmp = a.charCodeAt(aPos) - this._value.charCodeAt(thisPos);\n\t\t\tif (cmp !== 0) {\n\t\t\t\treturn cmp;\n\t\t\t}\n\t\t\taPos += 1;\n\t\t\tthisPos += 1;\n\t\t}\n\n\t\tif (aLen === this._to - this._from) {\n\t\t\treturn 0;\n\t\t} else if (aPos < aLen) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tvalue(): string {\n\t\treturn this._value.substring(this._from, this._to);\n\t}\n}\n\nclass TernarySearchTreeNode<E> {\n\tstr: string;\n\telement: E;\n\tleft: TernarySearchTreeNode<E>;\n\tmid: TernarySearchTreeNode<E>;\n\tright: TernarySearchTreeNode<E>;\n\n\tisEmpty(): boolean {\n\t\treturn !this.left && !this.mid && !this.right && !this.element;\n\t}\n}\n\nexport class TernarySearchTree<E> {\n\n\tstatic forPaths<E>(): TernarySearchTree<E> {\n\t\treturn new TernarySearchTree<E>(new PathIterator());\n\t}\n\n\tstatic forStrings<E>(): TernarySearchTree<E> {\n\t\treturn new TernarySearchTree<E>(new StringIterator());\n\t}\n\n\tprivate _iter: IKeyIterator;\n\tprivate _root: TernarySearchTreeNode<E>;\n\n\tconstructor(segments: IKeyIterator) {\n\t\tthis._iter = segments;\n\t}\n\n\tclear(): void {\n\t\tthis._root = undefined;\n\t}\n\n\tset(key: string, element: E): E {\n\t\tlet iter = this._iter.reset(key);\n\t\tlet node: TernarySearchTreeNode<E>;\n\n\t\tif (!this._root) {\n\t\t\tthis._root = new TernarySearchTreeNode<E>();\n\t\t\tthis._root.str = iter.value();\n\t\t}\n\n\t\tnode = this._root;\n\t\twhile (true) {\n\t\t\tlet val = iter.cmp(node.str);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tif (!node.left) {\n\t\t\t\t\tnode.left = new TernarySearchTreeNode<E>();\n\t\t\t\t\tnode.left.str = iter.value();\n\t\t\t\t}\n\t\t\t\tnode = node.left;\n\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tif (!node.right) {\n\t\t\t\t\tnode.right = new TernarySearchTreeNode<E>();\n\t\t\t\t\tnode.right.str = iter.value();\n\t\t\t\t}\n\t\t\t\tnode = node.right;\n\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tif (!node.mid) {\n\t\t\t\t\tnode.mid = new TernarySearchTreeNode<E>();\n\t\t\t\t\tnode.mid.str = iter.value();\n\t\t\t\t}\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst oldElement = node.element;\n\t\tnode.element = element;\n\t\treturn oldElement;\n\t}\n\n\tget(key: string): E {\n\t\tlet iter = this._iter.reset(key);\n\t\tlet node = this._root;\n\t\twhile (node) {\n\t\t\tlet val = iter.cmp(node.str);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tnode = node.left;\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tnode = node.right;\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn node ? node.element : undefined;\n\t}\n\n\tdelete(key: string): void {\n\n\t\tlet iter = this._iter.reset(key);\n\t\tlet stack: [-1 | 0 | 1, TernarySearchTreeNode<E>][] = [];\n\t\tlet node = this._root;\n\n\t\t// find and unset node\n\t\twhile (node) {\n\t\t\tlet val = iter.cmp(node.str);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tstack.push([1, node]);\n\t\t\t\tnode = node.left;\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tstack.push([-1, node]);\n\t\t\t\tnode = node.right;\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tstack.push([0, node]);\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\t// remove element\n\t\t\t\tnode.element = undefined;\n\n\t\t\t\t// clean up empty nodes\n\t\t\t\twhile (stack.length > 0 && node.isEmpty()) {\n\t\t\t\t\tlet [dir, parent] = stack.pop();\n\t\t\t\t\tswitch (dir) {\n\t\t\t\t\t\tcase 1: parent.left = undefined; break;\n\t\t\t\t\t\tcase 0: parent.mid = undefined; break;\n\t\t\t\t\t\tcase -1: parent.right = undefined; break;\n\t\t\t\t\t}\n\t\t\t\t\tnode = parent;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tfindSubstr(key: string): E {\n\t\tlet iter = this._iter.reset(key);\n\t\tlet node = this._root;\n\t\tlet candidate: E;\n\t\twhile (node) {\n\t\t\tlet val = iter.cmp(node.str);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tnode = node.left;\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tnode = node.right;\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tcandidate = node.element || candidate;\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn node && node.element || candidate;\n\t}\n\n\tfindSuperstr(key: string): TernarySearchTree<E> {\n\t\tlet iter = this._iter.reset(key);\n\t\tlet node = this._root;\n\t\twhile (node) {\n\t\t\tlet val = iter.cmp(node.str);\n\t\t\tif (val > 0) {\n\t\t\t\t// left\n\t\t\t\tnode = node.left;\n\t\t\t} else if (val < 0) {\n\t\t\t\t// right\n\t\t\t\tnode = node.right;\n\t\t\t} else if (iter.hasNext()) {\n\t\t\t\t// mid\n\t\t\t\titer.next();\n\t\t\t\tnode = node.mid;\n\t\t\t} else {\n\t\t\t\t// collect\n\t\t\t\tif (!node.mid) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tlet ret = new TernarySearchTree<E>(this._iter);\n\t\t\t\tret._root = node.mid;\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tforEach(callback: (value: E, index: string) => any) {\n\t\tthis._forEach(this._root, [], callback);\n\t}\n\n\tprivate _forEach(node: TernarySearchTreeNode<E>, parts: string[], callback: (value: E, index: string) => any) {\n\t\tif (node) {\n\t\t\t// left\n\t\t\tthis._forEach(node.left, parts, callback);\n\n\t\t\t// node\n\t\t\tparts.push(node.str);\n\t\t\tif (node.element) {\n\t\t\t\tcallback(node.element, this._iter.join(parts));\n\t\t\t}\n\t\t\t// mid\n\t\t\tthis._forEach(node.mid, parts, callback);\n\t\t\tparts.pop();\n\n\t\t\t// right\n\t\t\tthis._forEach(node.right, parts, callback);\n\t\t}\n\t}\n}\n\nexport class ResourceMap<T> {\n\n\tprotected readonly map: Map<string, T>;\n\tprotected readonly ignoreCase?: boolean;\n\n\tconstructor() {\n\t\tthis.map = new Map<string, T>();\n\t\tthis.ignoreCase = false; // in the future this should be an uri-comparator\n\t}\n\n\tpublic set(resource: URI, value: T): void {\n\t\tthis.map.set(this.toKey(resource), value);\n\t}\n\n\tpublic get(resource: URI): T {\n\t\treturn this.map.get(this.toKey(resource));\n\t}\n\n\tpublic has(resource: URI): boolean {\n\t\treturn this.map.has(this.toKey(resource));\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.map.size;\n\t}\n\n\tpublic clear(): void {\n\t\tthis.map.clear();\n\t}\n\n\tpublic delete(resource: URI): boolean {\n\t\treturn this.map.delete(this.toKey(resource));\n\t}\n\n\tpublic forEach(clb: (value: T) => void): void {\n\t\tthis.map.forEach(clb);\n\t}\n\n\tpublic values(): T[] {\n\t\treturn values(this.map);\n\t}\n\n\tprivate toKey(resource: URI): string {\n\t\tlet key = resource.toString();\n\t\tif (this.ignoreCase) {\n\t\t\tkey = key.toLowerCase();\n\t\t}\n\n\t\treturn key;\n\t}\n\n\tpublic keys(): URI[] {\n\t\treturn keys(this.map).map(URI.parse);\n\t}\n}\n\n// We should fold BoundedMap and LinkedMap. See https://github.com/Microsoft/vscode/issues/28496\n\ninterface Item<K, V> {\n\tprevious: Item<K, V> | undefined;\n\tnext: Item<K, V> | undefined;\n\tkey: K;\n\tvalue: V;\n}\n\nexport enum Touch {\n\tNone = 0,\n\tAsOld = 1,\n\tAsNew = 2\n}\n\nexport class LinkedMap<K, V> {\n\n\tprivate _map: Map<K, Item<K, V>>;\n\tprivate _head: Item<K, V> | undefined;\n\tprivate _tail: Item<K, V> | undefined;\n\tprivate _size: number;\n\n\tconstructor() {\n\t\tthis._map = new Map<K, Item<K, V>>();\n\t\tthis._head = undefined;\n\t\tthis._tail = undefined;\n\t\tthis._size = 0;\n\t}\n\n\tpublic clear(): void {\n\t\tthis._map.clear();\n\t\tthis._head = undefined;\n\t\tthis._tail = undefined;\n\t\tthis._size = 0;\n\t}\n\n\tpublic isEmpty(): boolean {\n\t\treturn !this._head && !this._tail;\n\t}\n\n\tpublic get size(): number {\n\t\treturn this._size;\n\t}\n\n\tpublic has(key: K): boolean {\n\t\treturn this._map.has(key);\n\t}\n\n\tpublic get(key: K, touch: Touch = Touch.None): V | undefined {\n\t\tconst item = this._map.get(key);\n\t\tif (!item) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (touch !== Touch.None) {\n\t\t\tthis.touch(item, touch);\n\t\t}\n\t\treturn item.value;\n\t}\n\n\tpublic set(key: K, value: V, touch: Touch = Touch.None): void {\n\t\tlet item = this._map.get(key);\n\t\tif (item) {\n\t\t\titem.value = value;\n\t\t\tif (touch !== Touch.None) {\n\t\t\t\tthis.touch(item, touch);\n\t\t\t}\n\t\t} else {\n\t\t\titem = { key, value, next: undefined, previous: undefined };\n\t\t\tswitch (touch) {\n\t\t\t\tcase Touch.None:\n\t\t\t\t\tthis.addItemLast(item);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Touch.AsOld:\n\t\t\t\t\tthis.addItemFirst(item);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Touch.AsNew:\n\t\t\t\t\tthis.addItemLast(item);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthis.addItemLast(item);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis._map.set(key, item);\n\t\t\tthis._size++;\n\t\t}\n\t}\n\n\tpublic delete(key: K): boolean {\n\t\treturn !!this.remove(key);\n\t}\n\n\tpublic remove(key: K): V | undefined {\n\t\tconst item = this._map.get(key);\n\t\tif (!item) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._map.delete(key);\n\t\tthis.removeItem(item);\n\t\tthis._size--;\n\t\treturn item.value;\n\t}\n\n\tpublic shift(): V | undefined {\n\t\tif (!this._head && !this._tail) {\n\t\t\treturn undefined;\n\t\t}\n\t\tif (!this._head || !this._tail) {\n\t\t\tthrow new Error('Invalid list');\n\t\t}\n\t\tconst item = this._head;\n\t\tthis._map.delete(item.key);\n\t\tthis.removeItem(item);\n\t\tthis._size--;\n\t\treturn item.value;\n\t}\n\n\tpublic forEach(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void {\n\t\tlet current = this._head;\n\t\twhile (current) {\n\t\t\tif (thisArg) {\n\t\t\t\tcallbackfn.bind(thisArg)(current.value, current.key, this);\n\t\t\t} else {\n\t\t\t\tcallbackfn(current.value, current.key, this);\n\t\t\t}\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n\n\tpublic values(): V[] {\n\t\tlet result: V[] = [];\n\t\tlet current = this._head;\n\t\twhile (current) {\n\t\t\tresult.push(current.value);\n\t\t\tcurrent = current.next;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic keys(): K[] {\n\t\tlet result: K[] = [];\n\t\tlet current = this._head;\n\t\twhile (current) {\n\t\t\tresult.push(current.key);\n\t\t\tcurrent = current.next;\n\t\t}\n\t\treturn result;\n\t}\n\n\t/* VS Code / Monaco editor runs on es5 which has no Symbol.iterator\n\tpublic keys(): IterableIterator<K> {\n\t\tlet current = this._head;\n\t\tlet iterator: IterableIterator<K> = {\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn iterator;\n\t\t\t},\n\t\t\tnext():IteratorResult<K> {\n\t\t\t\tif (current) {\n\t\t\t\t\tlet result = { value: current.key, done: false };\n\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\treturn { value: undefined, done: true };\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn iterator;\n\t}\n\n\tpublic values(): IterableIterator<V> {\n\t\tlet current = this._head;\n\t\tlet iterator: IterableIterator<V> = {\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn iterator;\n\t\t\t},\n\t\t\tnext():IteratorResult<V> {\n\t\t\t\tif (current) {\n\t\t\t\t\tlet result = { value: current.value, done: false };\n\t\t\t\t\tcurrent = current.next;\n\t\t\t\t\treturn result;\n\t\t\t\t} else {\n\t\t\t\t\treturn { value: undefined, done: true };\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn iterator;\n\t}\n\t*/\n\n\tprotected trimOld(newSize: number) {\n\t\tif (newSize >= this.size) {\n\t\t\treturn;\n\t\t}\n\t\tif (newSize === 0) {\n\t\t\tthis.clear();\n\t\t\treturn;\n\t\t}\n\t\tlet current = this._head;\n\t\tlet currentSize = this.size;\n\t\twhile (current && currentSize > newSize) {\n\t\t\tthis._map.delete(current.key);\n\t\t\tcurrent = current.next;\n\t\t\tcurrentSize--;\n\t\t}\n\t\tthis._head = current;\n\t\tthis._size = currentSize;\n\t\tcurrent.previous = void 0;\n\t}\n\n\tprivate addItemFirst(item: Item<K, V>): void {\n\t\t// First time Insert\n\t\tif (!this._head && !this._tail) {\n\t\t\tthis._tail = item;\n\t\t} else if (!this._head) {\n\t\t\tthrow new Error('Invalid list');\n\t\t} else {\n\t\t\titem.next = this._head;\n\t\t\tthis._head.previous = item;\n\t\t}\n\t\tthis._head = item;\n\t}\n\n\tprivate addItemLast(item: Item<K, V>): void {\n\t\t// First time Insert\n\t\tif (!this._head && !this._tail) {\n\t\t\tthis._head = item;\n\t\t} else if (!this._tail) {\n\t\t\tthrow new Error('Invalid list');\n\t\t} else {\n\t\t\titem.previous = this._tail;\n\t\t\tthis._tail.next = item;\n\t\t}\n\t\tthis._tail = item;\n\t}\n\n\tprivate removeItem(item: Item<K, V>): void {\n\t\tif (item === this._head && item === this._tail) {\n\t\t\tthis._head = void 0;\n\t\t\tthis._tail = void 0;\n\t\t}\n\t\telse if (item === this._head) {\n\t\t\tthis._head = item.next;\n\t\t}\n\t\telse if (item === this._tail) {\n\t\t\tthis._tail = item.previous;\n\t\t}\n\t\telse {\n\t\t\tconst next = item.next;\n\t\t\tconst previous = item.previous;\n\t\t\tif (!next || !previous) {\n\t\t\t\tthrow new Error('Invalid list');\n\t\t\t}\n\t\t\tnext.previous = previous;\n\t\t\tprevious.next = next;\n\t\t}\n\t}\n\n\tprivate touch(item: Item<K, V>, touch: Touch): void {\n\t\tif (!this._head || !this._tail) {\n\t\t\tthrow new Error('Invalid list');\n\t\t}\n\t\tif ((touch !== Touch.AsOld && touch !== Touch.AsNew)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (touch === Touch.AsOld) {\n\t\t\tif (item === this._head) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = item.next;\n\t\t\tconst previous = item.previous;\n\n\t\t\t// Unlink the item\n\t\t\tif (item === this._tail) {\n\t\t\t\t// previous must be defined since item was not head but is tail\n\t\t\t\t// So there are more than on item in the map\n\t\t\t\tprevious!.next = void 0;\n\t\t\t\tthis._tail = previous;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Both next and previous are not undefined since item was neither head nor tail.\n\t\t\t\tnext!.previous = previous;\n\t\t\t\tprevious!.next = next;\n\t\t\t}\n\n\t\t\t// Insert the node at head\n\t\t\titem.previous = void 0;\n\t\t\titem.next = this._head;\n\t\t\tthis._head.previous = item;\n\t\t\tthis._head = item;\n\t\t} else if (touch === Touch.AsNew) {\n\t\t\tif (item === this._tail) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = item.next;\n\t\t\tconst previous = item.previous;\n\n\t\t\t// Unlink the item.\n\t\t\tif (item === this._head) {\n\t\t\t\t// next must be defined since item was not tail but is head\n\t\t\t\t// So there are more than on item in the map\n\t\t\t\tnext!.previous = void 0;\n\t\t\t\tthis._head = next;\n\t\t\t} else {\n\t\t\t\t// Both next and previous are not undefined since item was neither head nor tail.\n\t\t\t\tnext!.previous = previous;\n\t\t\t\tprevious!.next = next;\n\t\t\t}\n\t\t\titem.next = void 0;\n\t\t\titem.previous = this._tail;\n\t\t\tthis._tail.next = item;\n\t\t\tthis._tail = item;\n\t\t}\n\t}\n\n\tpublic toJSON(): [K, V][] {\n\t\tconst data: [K, V][] = [];\n\n\t\tthis.forEach((value, key) => {\n\t\t\tdata.push([key, value]);\n\t\t});\n\n\t\treturn data;\n\t}\n\n\tpublic fromJSON(data: [K, V][]): void {\n\t\tthis.clear();\n\n\t\tfor (const [key, value] of data) {\n\t\t\tthis.set(key, value);\n\t\t}\n\t}\n}\n\nexport class LRUCache<K, V> extends LinkedMap<K, V> {\n\n\tprivate _limit: number;\n\tprivate _ratio: number;\n\n\tconstructor(limit: number, ratio: number = 1) {\n\t\tsuper();\n\t\tthis._limit = limit;\n\t\tthis._ratio = Math.min(Math.max(0, ratio), 1);\n\t}\n\n\tpublic get limit(): number {\n\t\treturn this._limit;\n\t}\n\n\tpublic set limit(limit: number) {\n\t\tthis._limit = limit;\n\t\tthis.checkTrim();\n\t}\n\n\tpublic get ratio(): number {\n\t\treturn this._ratio;\n\t}\n\n\tpublic set ratio(ratio: number) {\n\t\tthis._ratio = Math.min(Math.max(0, ratio), 1);\n\t\tthis.checkTrim();\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\treturn super.get(key, Touch.AsNew);\n\t}\n\n\tpublic peek(key: K): V | undefined {\n\t\treturn super.get(key, Touch.None);\n\t}\n\n\tpublic set(key: K, value: V): void {\n\t\tsuper.set(key, value, Touch.AsNew);\n\t\tthis.checkTrim();\n\t}\n\n\tprivate checkTrim() {\n\t\tif (this.size > this._limit) {\n\t\t\tthis.trimOld(Math.round(this._limit * this._ratio));\n\t\t}\n\t}\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'use strict';\n\nimport { LRUCache } from 'vs/base/common/map';\nimport { CharCode } from 'vs/base/common/charCode';\n\n/**\n * The empty string.\n */\nexport const empty = '';\n\nexport function isFalsyOrWhitespace(str: string): boolean {\n\tif (!str || typeof str !== 'string') {\n\t\treturn true;\n\t}\n\treturn str.trim().length === 0;\n}\n\n/**\n * @returns the provided number with the given number of preceding zeros.\n */\nexport function pad(n: number, l: number, char: string = '0'): string {\n\tlet str = '' + n;\n\tlet r = [str];\n\n\tfor (let i = str.length; i < l; i++) {\n\t\tr.push(char);\n\t}\n\n\treturn r.reverse().join('');\n}\n\nconst _formatRegexp = /{(\\d+)}/g;\n\n/**\n * Helper to produce a string with a variable number of arguments. Insert variable segments\n * into the string using the {n} notation where N is the index of the argument following the string.\n * @param value string to which formatting is applied\n * @param args replacements for {n}-entries\n */\nexport function format(value: string, ...args: any[]): string {\n\tif (args.length === 0) {\n\t\treturn value;\n\t}\n\treturn value.replace(_formatRegexp, function (match, group) {\n\t\tlet idx = parseInt(group, 10);\n\t\treturn isNaN(idx) || idx < 0 || idx >= args.length ?\n\t\t\tmatch :\n\t\t\targs[idx];\n\t});\n}\n\n/**\n * Converts HTML characters inside the string to use entities instead. Makes the string safe from\n * being used e.g. in HTMLElement.innerHTML.\n */\nexport function escape(html: string): string {\n\treturn html.replace(/[<|>|&]/g, function (match) {\n\t\tswitch (match) {\n\t\t\tcase '<': return '&lt;';\n\t\t\tcase '>': return '&gt;';\n\t\t\tcase '&': return '&amp;';\n\t\t\tdefault: return match;\n\t\t}\n\t});\n}\n\n/**\n * Escapes regular expression characters in a given string\n */\nexport function escapeRegExpCharacters(value: string): string {\n\treturn value.replace(/[\\-\\\\\\{\\}\\*\\+\\?\\|\\^\\$\\.\\[\\]\\(\\)\\#]/g, '\\\\$&');\n}\n\n/**\n * Removes all occurrences of needle from the beginning and end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim (default is a blank)\n */\nexport function trim(haystack: string, needle: string = ' '): string {\n\tlet trimmed = ltrim(haystack, needle);\n\treturn rtrim(trimmed, needle);\n}\n\n/**\n * Removes all occurrences of needle from the beginning of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nexport function ltrim(haystack?: string, needle?: string): string {\n\tif (!haystack || !needle) {\n\t\treturn haystack;\n\t}\n\n\tlet needleLen = needle.length;\n\tif (needleLen === 0 || haystack.length === 0) {\n\t\treturn haystack;\n\t}\n\n\tlet offset = 0,\n\t\tidx = -1;\n\n\twhile ((idx = haystack.indexOf(needle, offset)) === offset) {\n\t\toffset = offset + needleLen;\n\t}\n\treturn haystack.substring(offset);\n}\n\n/**\n * Removes all occurrences of needle from the end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nexport function rtrim(haystack?: string, needle?: string): string {\n\tif (!haystack || !needle) {\n\t\treturn haystack;\n\t}\n\n\tlet needleLen = needle.length,\n\t\thaystackLen = haystack.length;\n\n\tif (needleLen === 0 || haystackLen === 0) {\n\t\treturn haystack;\n\t}\n\n\tlet offset = haystackLen,\n\t\tidx = -1;\n\n\twhile (true) {\n\t\tidx = haystack.lastIndexOf(needle, offset - 1);\n\t\tif (idx === -1 || idx + needleLen !== offset) {\n\t\t\tbreak;\n\t\t}\n\t\tif (idx === 0) {\n\t\t\treturn '';\n\t\t}\n\t\toffset = idx;\n\t}\n\n\treturn haystack.substring(0, offset);\n}\n\nexport function convertSimple2RegExpPattern(pattern: string): string {\n\treturn pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\n}\n\nexport function stripWildcards(pattern: string): string {\n\treturn pattern.replace(/\\*/g, '');\n}\n\n/**\n * Determines if haystack starts with needle.\n */\nexport function startsWith(haystack: string, needle: string): boolean {\n\tif (haystack.length < needle.length) {\n\t\treturn false;\n\t}\n\n\tif (haystack === needle) {\n\t\treturn true;\n\t}\n\n\tfor (let i = 0; i < needle.length; i++) {\n\t\tif (haystack[i] !== needle[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Determines if haystack ends with needle.\n */\nexport function endsWith(haystack: string, needle: string): boolean {\n\tlet diff = haystack.length - needle.length;\n\tif (diff > 0) {\n\t\treturn haystack.indexOf(needle, diff) === diff;\n\t} else if (diff === 0) {\n\t\treturn haystack === needle;\n\t} else {\n\t\treturn false;\n\t}\n}\n\nexport interface RegExpOptions {\n\tmatchCase?: boolean;\n\twholeWord?: boolean;\n\tmultiline?: boolean;\n\tglobal?: boolean;\n}\n\nexport function createRegExp(searchString: string, isRegex: boolean, options: RegExpOptions = {}): RegExp {\n\tif (!searchString) {\n\t\tthrow new Error('Cannot create regex from empty string');\n\t}\n\tif (!isRegex) {\n\t\tsearchString = escapeRegExpCharacters(searchString);\n\t}\n\tif (options.wholeWord) {\n\t\tif (!/\\B/.test(searchString.charAt(0))) {\n\t\t\tsearchString = '\\\\b' + searchString;\n\t\t}\n\t\tif (!/\\B/.test(searchString.charAt(searchString.length - 1))) {\n\t\t\tsearchString = searchString + '\\\\b';\n\t\t}\n\t}\n\tlet modifiers = '';\n\tif (options.global) {\n\t\tmodifiers += 'g';\n\t}\n\tif (!options.matchCase) {\n\t\tmodifiers += 'i';\n\t}\n\tif (options.multiline) {\n\t\tmodifiers += 'm';\n\t}\n\n\treturn new RegExp(searchString, modifiers);\n}\n\nexport function regExpLeadsToEndlessLoop(regexp: RegExp): boolean {\n\t// Exit early if it's one of these special cases which are meant to match\n\t// against an empty string\n\tif (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\\\s*$') {\n\t\treturn false;\n\t}\n\n\t// We check against an empty string. If the regular expression doesn't advance\n\t// (e.g. ends in an endless loop) it will match an empty string.\n\tlet match = regexp.exec('');\n\treturn (match && <any>regexp.lastIndex === 0);\n}\n\nexport function regExpContainsBackreference(regexpValue: string): boolean {\n\treturn !!regexpValue.match(/([^\\\\]|^)(\\\\\\\\)*\\\\\\d+/);\n}\n\n/**\n * The normalize() method returns the Unicode Normalization Form of a given string. The form will be\n * the Normalization Form Canonical Composition.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize}\n */\nexport const canNormalize = typeof ((<any>'').normalize) === 'function';\n\nconst nfcCache = new LRUCache<string, string>(10000); // bounded to 10000 elements\nexport function normalizeNFC(str: string): string {\n\treturn normalize(str, 'NFC', nfcCache);\n}\n\nconst nfdCache = new LRUCache<string, string>(10000); // bounded to 10000 elements\nexport function normalizeNFD(str: string): string {\n\treturn normalize(str, 'NFD', nfdCache);\n}\n\nconst nonAsciiCharactersPattern = /[^\\u0000-\\u0080]/;\nfunction normalize(str: string, form: string, normalizedCache: LRUCache<string, string>): string {\n\tif (!canNormalize || !str) {\n\t\treturn str;\n\t}\n\n\tconst cached = normalizedCache.get(str);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tlet res: string;\n\tif (nonAsciiCharactersPattern.test(str)) {\n\t\tres = (<any>str).normalize(form);\n\t} else {\n\t\tres = str;\n\t}\n\n\t// Use the cache for fast lookup\n\tnormalizedCache.set(str, res);\n\n\treturn res;\n}\n\n/**\n * Returns first index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nexport function firstNonWhitespaceIndex(str: string): number {\n\tfor (let i = 0, len = str.length; i < len; i++) {\n\t\tlet chCode = str.charCodeAt(i);\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * Returns the leading whitespace of the string.\n * If the string contains only whitespaces, returns entire string\n */\nexport function getLeadingWhitespace(str: string, start: number = 0, end: number = str.length): string {\n\tfor (let i = start; i < end; i++) {\n\t\tlet chCode = str.charCodeAt(i);\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\n\t\t\treturn str.substring(start, i);\n\t\t}\n\t}\n\treturn str.substring(start, end);\n}\n\n/**\n * Returns last index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nexport function lastNonWhitespaceIndex(str: string, startIndex: number = str.length - 1): number {\n\tfor (let i = startIndex; i >= 0; i--) {\n\t\tlet chCode = str.charCodeAt(i);\n\t\tif (chCode !== CharCode.Space && chCode !== CharCode.Tab) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nexport function compare(a: string, b: string): number {\n\tif (a < b) {\n\t\treturn -1;\n\t} else if (a > b) {\n\t\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\n}\n\nexport function compareIgnoreCase(a: string, b: string): number {\n\tconst len = Math.min(a.length, b.length);\n\tfor (let i = 0; i < len; i++) {\n\t\tlet codeA = a.charCodeAt(i);\n\t\tlet codeB = b.charCodeAt(i);\n\n\t\tif (codeA === codeB) {\n\t\t\t// equal\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isUpperAsciiLetter(codeA)) {\n\t\t\tcodeA += 32;\n\t\t}\n\n\t\tif (isUpperAsciiLetter(codeB)) {\n\t\t\tcodeB += 32;\n\t\t}\n\n\t\tconst diff = codeA - codeB;\n\n\t\tif (diff === 0) {\n\t\t\t// equal -> ignoreCase\n\t\t\tcontinue;\n\n\t\t} else if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) {\n\t\t\t//\n\t\t\treturn diff;\n\n\t\t} else {\n\t\t\treturn compare(a.toLowerCase(), b.toLowerCase());\n\t\t}\n\t}\n\n\tif (a.length < b.length) {\n\t\treturn -1;\n\t} else if (a.length > b.length) {\n\t\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\n}\n\nfunction isLowerAsciiLetter(code: number): boolean {\n\treturn code >= CharCode.a && code <= CharCode.z;\n}\n\nfunction isUpperAsciiLetter(code: number): boolean {\n\treturn code >= CharCode.A && code <= CharCode.Z;\n}\n\nfunction isAsciiLetter(code: number): boolean {\n\treturn isLowerAsciiLetter(code) || isUpperAsciiLetter(code);\n}\n\nexport function equalsIgnoreCase(a: string, b: string): boolean {\n\tconst len1 = a ? a.length : 0;\n\tconst len2 = b ? b.length : 0;\n\n\tif (len1 !== len2) {\n\t\treturn false;\n\t}\n\n\treturn doEqualsIgnoreCase(a, b);\n}\n\nfunction doEqualsIgnoreCase(a: string, b: string, stopAt = a.length): boolean {\n\tif (typeof a !== 'string' || typeof b !== 'string') {\n\t\treturn false;\n\t}\n\n\tfor (let i = 0; i < stopAt; i++) {\n\t\tconst codeA = a.charCodeAt(i);\n\t\tconst codeB = b.charCodeAt(i);\n\n\t\tif (codeA === codeB) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// a-z A-Z\n\t\tif (isAsciiLetter(codeA) && isAsciiLetter(codeB)) {\n\t\t\tlet diff = Math.abs(codeA - codeB);\n\t\t\tif (diff !== 0 && diff !== 32) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Any other charcode\n\t\telse {\n\t\t\tif (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n\nexport function startsWithIgnoreCase(str: string, candidate: string): boolean {\n\tconst candidateLength = candidate.length;\n\tif (candidate.length > str.length) {\n\t\treturn false;\n\t}\n\n\treturn doEqualsIgnoreCase(str, candidate, candidateLength);\n}\n\n/**\n * @returns the length of the common prefix of the two strings.\n */\nexport function commonPrefixLength(a: string, b: string): number {\n\n\tlet i: number,\n\t\tlen = Math.min(a.length, b.length);\n\n\tfor (i = 0; i < len; i++) {\n\t\tif (a.charCodeAt(i) !== b.charCodeAt(i)) {\n\t\t\treturn i;\n\t\t}\n\t}\n\n\treturn len;\n}\n\n/**\n * @returns the length of the common suffix of the two strings.\n */\nexport function commonSuffixLength(a: string, b: string): number {\n\n\tlet i: number,\n\t\tlen = Math.min(a.length, b.length);\n\n\tlet aLastIndex = a.length - 1;\n\tlet bLastIndex = b.length - 1;\n\n\tfor (i = 0; i < len; i++) {\n\t\tif (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {\n\t\t\treturn i;\n\t\t}\n\t}\n\n\treturn len;\n}\n\nfunction substrEquals(a: string, aStart: number, aEnd: number, b: string, bStart: number, bEnd: number): boolean {\n\twhile (aStart < aEnd && bStart < bEnd) {\n\t\tif (a[aStart] !== b[bStart]) {\n\t\t\treturn false;\n\t\t}\n\t\taStart += 1;\n\t\tbStart += 1;\n\t}\n\treturn true;\n}\n\n/**\n * Return the overlap between the suffix of `a` and the prefix of `b`.\n * For instance `overlap(\"foobar\", \"arr, I'm a pirate\") === 2`.\n */\nexport function overlap(a: string, b: string): number {\n\tlet aEnd = a.length;\n\tlet bEnd = b.length;\n\tlet aStart = aEnd - bEnd;\n\n\tif (aStart === 0) {\n\t\treturn a === b ? aEnd : 0;\n\t} else if (aStart < 0) {\n\t\tbEnd += aStart;\n\t\taStart = 0;\n\t}\n\n\twhile (aStart < aEnd && bEnd > 0) {\n\t\tif (substrEquals(a, aStart, aEnd, b, 0, bEnd)) {\n\t\t\treturn bEnd;\n\t\t}\n\t\tbEnd -= 1;\n\t\taStart += 1;\n\t}\n\treturn 0;\n}\n\n// --- unicode\n// http://en.wikipedia.org/wiki/Surrogate_pair\n// Returns the code point starting at a specified index in a string\n// Code points U+0000 to U+D7FF and U+E000 to U+FFFF are represented on a single character\n// Code points U+10000 to U+10FFFF are represented on two consecutive characters\n//export function getUnicodePoint(str:string, index:number, len:number):number {\n//\tlet chrCode = str.charCodeAt(index);\n//\tif (0xD800 <= chrCode && chrCode <= 0xDBFF && index + 1 < len) {\n//\t\tlet nextChrCode = str.charCodeAt(index + 1);\n//\t\tif (0xDC00 <= nextChrCode && nextChrCode <= 0xDFFF) {\n//\t\t\treturn (chrCode - 0xD800) << 10 + (nextChrCode - 0xDC00) + 0x10000;\n//\t\t}\n//\t}\n//\treturn chrCode;\n//}\nexport function isHighSurrogate(charCode: number): boolean {\n\treturn (0xD800 <= charCode && charCode <= 0xDBFF);\n}\n\nexport function isLowSurrogate(charCode: number): boolean {\n\treturn (0xDC00 <= charCode && charCode <= 0xDFFF);\n}\n\n/**\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-rtl-test.js\n */\nconst CONTAINS_RTL = /(?:[\\u05BE\\u05C0\\u05C3\\u05C6\\u05D0-\\u05F4\\u0608\\u060B\\u060D\\u061B-\\u064A\\u066D-\\u066F\\u0671-\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1-\\u07EA\\u07F4\\u07F5\\u07FA-\\u0815\\u081A\\u0824\\u0828\\u0830-\\u0858\\u085E-\\u08BD\\u200F\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFD3D\\uFD50-\\uFDFC\\uFE70-\\uFEFC]|\\uD802[\\uDC00-\\uDD1B\\uDD20-\\uDE00\\uDE10-\\uDE33\\uDE40-\\uDEE4\\uDEEB-\\uDF35\\uDF40-\\uDFFF]|\\uD803[\\uDC00-\\uDCFF]|\\uD83A[\\uDC00-\\uDCCF\\uDD00-\\uDD43\\uDD50-\\uDFFF]|\\uD83B[\\uDC00-\\uDEBB])/;\n\n/**\n * Returns true if `str` contains any Unicode character that is classified as \"R\" or \"AL\".\n */\nexport function containsRTL(str: string): boolean {\n\treturn CONTAINS_RTL.test(str);\n}\n\n/**\n * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js\n */\nconst CONTAINS_EMOJI = /(?:[\\u231A\\u231B\\u23F0\\u23F3\\u2600-\\u27BF\\u2B50\\u2B55]|\\uD83C[\\uDDE6-\\uDDFF\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDE4F\\uDE80-\\uDEF8]|\\uD83E[\\uDD00-\\uDDE6])/;\n\nexport function containsEmoji(str: string): boolean {\n\treturn CONTAINS_EMOJI.test(str);\n}\n\nconst IS_BASIC_ASCII = /^[\\t\\n\\r\\x20-\\x7E]*$/;\n/**\n * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \\n, \\r, \\t\n */\nexport function isBasicASCII(str: string): boolean {\n\treturn IS_BASIC_ASCII.test(str);\n}\n\nexport function containsFullWidthCharacter(str: string): boolean {\n\tfor (let i = 0, len = str.length; i < len; i++) {\n\t\tif (isFullWidthCharacter(str.charCodeAt(i))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nexport function isFullWidthCharacter(charCode: number): boolean {\n\t// Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns\n\t// http://jrgraphix.net/research/unicode_blocks.php\n\t// 2E80 — 2EFF CJK Radicals Supplement\n\t// 2F00 — 2FDF Kangxi Radicals\n\t// 2FF0 — 2FFF Ideographic Description Characters\n\t// 3000 — 303F CJK Symbols and Punctuation\n\t// 3040 — 309F Hiragana\n\t// 30A0 — 30FF Katakana\n\t// 3100 — 312F Bopomofo\n\t// 3130 — 318F Hangul Compatibility Jamo\n\t// 3190 — 319F Kanbun\n\t// 31A0 — 31BF Bopomofo Extended\n\t// 31F0 — 31FF Katakana Phonetic Extensions\n\t// 3200 — 32FF Enclosed CJK Letters and Months\n\t// 3300 — 33FF CJK Compatibility\n\t// 3400 — 4DBF CJK Unified Ideographs Extension A\n\t// 4DC0 — 4DFF Yijing Hexagram Symbols\n\t// 4E00 — 9FFF CJK Unified Ideographs\n\t// A000 — A48F Yi Syllables\n\t// A490 — A4CF Yi Radicals\n\t// AC00 — D7AF Hangul Syllables\n\t// [IGNORE] D800 — DB7F High Surrogates\n\t// [IGNORE] DB80 — DBFF High Private Use Surrogates\n\t// [IGNORE] DC00 — DFFF Low Surrogates\n\t// [IGNORE] E000 — F8FF Private Use Area\n\t// F900 — FAFF CJK Compatibility Ideographs\n\t// [IGNORE] FB00 — FB4F Alphabetic Presentation Forms\n\t// [IGNORE] FB50 — FDFF Arabic Presentation Forms-A\n\t// [IGNORE] FE00 — FE0F Variation Selectors\n\t// [IGNORE] FE20 — FE2F Combining Half Marks\n\t// [IGNORE] FE30 — FE4F CJK Compatibility Forms\n\t// [IGNORE] FE50 — FE6F Small Form Variants\n\t// [IGNORE] FE70 — FEFF Arabic Presentation Forms-B\n\t// FF00 — FFEF Halfwidth and Fullwidth Forms\n\t// [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]\n\t// of which FF01 - FF5E fullwidth ASCII of 21 to 7E\n\t// [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul\n\t// [IGNORE] FFF0 — FFFF Specials\n\tcharCode = +charCode; // @perf\n\treturn (\n\t\t(charCode >= 0x2E80 && charCode <= 0xD7AF)\n\t\t|| (charCode >= 0xF900 && charCode <= 0xFAFF)\n\t\t|| (charCode >= 0xFF01 && charCode <= 0xFF5E)\n\t);\n}\n\n/**\n * Given a string and a max length returns a shorted version. Shorting\n * happens at favorable positions - such as whitespace or punctuation characters.\n */\nexport function lcut(text: string, n: number) {\n\tif (text.length < n) {\n\t\treturn text;\n\t}\n\n\tconst re = /\\b/g;\n\tlet i = 0;\n\twhile (re.test(text)) {\n\t\tif (text.length - re.lastIndex < n) {\n\t\t\tbreak;\n\t\t}\n\n\t\ti = re.lastIndex;\n\t\tre.lastIndex += 1;\n\t}\n\n\treturn text.substring(i).replace(/^\\s/, empty);\n}\n\n// Escape codes\n// http://en.wikipedia.org/wiki/ANSI_escape_code\nconst EL = /\\x1B\\x5B[12]?K/g; // Erase in line\nconst COLOR_START = /\\x1b\\[\\d+m/g; // Color\nconst COLOR_END = /\\x1b\\[0?m/g; // Color\n\nexport function removeAnsiEscapeCodes(str: string): string {\n\tif (str) {\n\t\tstr = str.replace(EL, '');\n\t\tstr = str.replace(COLOR_START, '');\n\t\tstr = str.replace(COLOR_END, '');\n\t}\n\n\treturn str;\n}\n\n// -- UTF-8 BOM\n\nexport const UTF8_BOM_CHARACTER = String.fromCharCode(CharCode.UTF8_BOM);\n\nexport function startsWithUTF8BOM(str: string): boolean {\n\treturn (str && str.length > 0 && str.charCodeAt(0) === CharCode.UTF8_BOM);\n}\n\nexport function stripUTF8BOM(str: string): string {\n\treturn startsWithUTF8BOM(str) ? str.substr(1) : str;\n}\n\nexport function safeBtoa(str: string): string {\n\treturn btoa(encodeURIComponent(str)); // we use encodeURIComponent because btoa fails for non Latin 1 values\n}\n\nexport function repeat(s: string, count: number): string {\n\tlet result = '';\n\tfor (let i = 0; i < count; i++) {\n\t\tresult += s;\n\t}\n\treturn result;\n}\n\n/**\n * Checks if the characters of the provided query string are included in the\n * target string. The characters do not have to be contiguous within the string.\n */\nexport function fuzzyContains(target: string, query: string): boolean {\n\tif (!target || !query) {\n\t\treturn false; // return early if target or query are undefined\n\t}\n\n\tif (target.length < query.length) {\n\t\treturn false; // impossible for query to be contained in target\n\t}\n\n\tconst queryLen = query.length;\n\tconst targetLower = target.toLowerCase();\n\n\tlet index = 0;\n\tlet lastIndexOf = -1;\n\twhile (index < queryLen) {\n\t\tlet indexOf = targetLower.indexOf(query[index], lastIndexOf + 1);\n\t\tif (indexOf < 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlastIndexOf = indexOf;\n\n\t\tindex++;\n\t}\n\n\treturn true;\n}\n\nexport function containsUppercaseCharacter(target: string, ignoreEscapedChars = false): boolean {\n\tif (!target) {\n\t\treturn false;\n\t}\n\n\tif (ignoreEscapedChars) {\n\t\ttarget = target.replace(/\\\\./g, '');\n\t}\n\n\treturn target.toLowerCase() !== target;\n}\n","/**\n * Extracted from https://github.com/winjs/winjs\n * Version: 4.4.0(ec3258a9f3a36805a187848984e3bb938044178d)\n * Copyright (c) Microsoft Corporation.\n * All Rights Reserved.\n * Licensed under the MIT License.\n */\nvar __winjs_exports;\n\n(function() {\n\nvar _modules = Object.create(null);//{};\n_modules[\"WinJS/Core/_WinJS\"] = {};\n\nvar _winjs = function(moduleId, deps, factory) {\n var exports = {};\n var exportsPassedIn = false;\n\n var depsValues = deps.map(function(dep) {\n if (dep === 'exports') {\n exportsPassedIn = true;\n return exports;\n }\n return _modules[dep];\n });\n\n var result = factory.apply({}, depsValues);\n\n _modules[moduleId] = exportsPassedIn ? exports : result;\n};\n\n\n_winjs(\"WinJS/Core/_Global\", [], function () {\n \"use strict\";\n\n // Appease jshint\n /* global window, self, global */\n\n var globalObject =\n typeof window !== 'undefined' ? window :\n typeof self !== 'undefined' ? self :\n typeof global !== 'undefined' ? global :\n {};\n return globalObject;\n});\n\n_winjs(\"WinJS/Core/_BaseCoreUtils\", [\"WinJS/Core/_Global\"], function baseCoreUtilsInit(_Global) {\n \"use strict\";\n\n var hasWinRT = !!_Global.Windows;\n\n function markSupportedForProcessing(func) {\n /// <signature helpKeyword=\"WinJS.Utilities.markSupportedForProcessing\">\n /// <summary locid=\"WinJS.Utilities.markSupportedForProcessing\">\n /// Marks a function as being compatible with declarative processing, such as WinJS.UI.processAll\n /// or WinJS.Binding.processAll.\n /// </summary>\n /// <param name=\"func\" type=\"Function\" locid=\"WinJS.Utilities.markSupportedForProcessing_p:func\">\n /// The function to be marked as compatible with declarative processing.\n /// </param>\n /// <returns type=\"Function\" locid=\"WinJS.Utilities.markSupportedForProcessing_returnValue\">\n /// The input function.\n /// </returns>\n /// </signature>\n func.supportedForProcessing = true;\n return func;\n }\n\n var actualSetImmediate = null;\n\n return {\n hasWinRT: hasWinRT,\n markSupportedForProcessing: markSupportedForProcessing,\n _setImmediate: function (callback) {\n // BEGIN monaco change\n if (actualSetImmediate === null) {\n if (_Global.setImmediate) {\n actualSetImmediate = _Global.setImmediate.bind(_Global);\n } else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') {\n actualSetImmediate = process.nextTick.bind(process);\n } else {\n actualSetImmediate = _Global.setTimeout.bind(_Global);\n }\n }\n actualSetImmediate(callback);\n // END monaco change\n }\n };\n});\n_winjs(\"WinJS/Core/_WriteProfilerMark\", [\"WinJS/Core/_Global\"], function profilerInit(_Global) {\n \"use strict\";\n\n return _Global.msWriteProfilerMark || function () { };\n});\n_winjs(\"WinJS/Core/_Base\", [\"WinJS/Core/_WinJS\",\"WinJS/Core/_Global\",\"WinJS/Core/_BaseCoreUtils\",\"WinJS/Core/_WriteProfilerMark\"], function baseInit(_WinJS, _Global, _BaseCoreUtils, _WriteProfilerMark) {\n \"use strict\";\n\n function initializeProperties(target, members, prefix) {\n var keys = Object.keys(members);\n var isArray = Array.isArray(target);\n var properties;\n var i, len;\n for (i = 0, len = keys.length; i < len; i++) {\n var key = keys[i];\n var enumerable = key.charCodeAt(0) !== /*_*/95;\n var member = members[key];\n if (member && typeof member === 'object') {\n if (member.value !== undefined || typeof member.get === 'function' || typeof member.set === 'function') {\n if (member.enumerable === undefined) {\n member.enumerable = enumerable;\n }\n if (prefix && member.setName && typeof member.setName === 'function') {\n member.setName(prefix + \".\" + key);\n }\n properties = properties || {};\n properties[key] = member;\n continue;\n }\n }\n if (!enumerable) {\n properties = properties || {};\n properties[key] = { value: member, enumerable: enumerable, configurable: true, writable: true };\n continue;\n }\n if (isArray) {\n target.forEach(function (target) {\n target[key] = member;\n });\n } else {\n target[key] = member;\n }\n }\n if (properties) {\n if (isArray) {\n target.forEach(function (target) {\n Object.defineProperties(target, properties);\n });\n } else {\n Object.defineProperties(target, properties);\n }\n }\n }\n\n (function () {\n\n var _rootNamespace = _WinJS;\n if (!_rootNamespace.Namespace) {\n _rootNamespace.Namespace = Object.create(Object.prototype);\n }\n\n function createNamespace(parentNamespace, name) {\n var currentNamespace = parentNamespace || {};\n if (name) {\n var namespaceFragments = name.split(\".\");\n if (currentNamespace === _Global && namespaceFragments[0] === \"WinJS\") {\n currentNamespace = _WinJS;\n namespaceFragments.splice(0, 1);\n }\n for (var i = 0, len = namespaceFragments.length; i < len; i++) {\n var namespaceName = namespaceFragments[i];\n if (!currentNamespace[namespaceName]) {\n Object.defineProperty(currentNamespace, namespaceName,\n { value: {}, writable: false, enumerable: true, configurable: true }\n );\n }\n currentNamespace = currentNamespace[namespaceName];\n }\n }\n return currentNamespace;\n }\n\n function defineWithParent(parentNamespace, name, members) {\n /// <signature helpKeyword=\"WinJS.Namespace.defineWithParent\">\n /// <summary locid=\"WinJS.Namespace.defineWithParent\">\n /// Defines a new namespace with the specified name under the specified parent namespace.\n /// </summary>\n /// <param name=\"parentNamespace\" type=\"Object\" locid=\"WinJS.Namespace.defineWithParent_p:parentNamespace\">\n /// The parent namespace.\n /// </param>\n /// <param name=\"name\" type=\"String\" locid=\"WinJS.Namespace.defineWithParent_p:name\">\n /// The name of the new namespace.\n /// </param>\n /// <param name=\"members\" type=\"Object\" locid=\"WinJS.Namespace.defineWithParent_p:members\">\n /// The members of the new namespace.\n /// </param>\n /// <returns type=\"Object\" locid=\"WinJS.Namespace.defineWithParent_returnValue\">\n /// The newly-defined namespace.\n /// </returns>\n /// </signature>\n var currentNamespace = createNamespace(parentNamespace, name);\n\n if (members) {\n initializeProperties(currentNamespace, members, name || \"<ANONYMOUS>\");\n }\n\n return currentNamespace;\n }\n\n function define(name, members) {\n /// <signature helpKeyword=\"WinJS.Namespace.define\">\n /// <summary locid=\"WinJS.Namespace.define\">\n /// Defines a new namespace with the specified name.\n /// </summary>\n /// <param name=\"name\" type=\"String\" locid=\"WinJS.Namespace.define_p:name\">\n /// The name of the namespace. This could be a dot-separated name for nested namespaces.\n /// </param>\n /// <param name=\"members\" type=\"Object\" locid=\"WinJS.Namespace.define_p:members\">\n /// The members of the new namespace.\n /// </param>\n /// <returns type=\"Object\" locid=\"WinJS.Namespace.define_returnValue\">\n /// The newly-defined namespace.\n /// </returns>\n /// </signature>\n return defineWithParent(_Global, name, members);\n }\n\n var LazyStates = {\n uninitialized: 1,\n working: 2,\n initialized: 3,\n };\n\n function lazy(f) {\n var name;\n var state = LazyStates.uninitialized;\n var result;\n return {\n setName: function (value) {\n name = value;\n },\n get: function () {\n switch (state) {\n case LazyStates.initialized:\n return result;\n\n case LazyStates.uninitialized:\n state = LazyStates.working;\n try {\n _WriteProfilerMark(\"WinJS.Namespace._lazy:\" + name + \",StartTM\");\n result = f();\n } finally {\n _WriteProfilerMark(\"WinJS.Namespace._lazy:\" + name + \",StopTM\");\n state = LazyStates.uninitialized;\n }\n f = null;\n state = LazyStates.initialized;\n return result;\n\n case LazyStates.working:\n throw \"Illegal: reentrancy on initialization\";\n\n default:\n throw \"Illegal\";\n }\n },\n set: function (value) {\n switch (state) {\n case LazyStates.working:\n throw \"Illegal: reentrancy on initialization\";\n\n default:\n state = LazyStates.initialized;\n result = value;\n break;\n }\n },\n enumerable: true,\n configurable: true,\n };\n }\n\n // helper for defining AMD module members\n function moduleDefine(exports, name, members) {\n var target = [exports];\n var publicNS = null;\n if (name) {\n publicNS = createNamespace(_Global, name);\n target.push(publicNS);\n }\n initializeProperties(target, members, name || \"<ANONYMOUS>\");\n return publicNS;\n }\n\n // Establish members of the \"WinJS.Namespace\" namespace\n Object.defineProperties(_rootNamespace.Namespace, {\n\n defineWithParent: { value: defineWithParent, writable: true, enumerable: true, configurable: true },\n\n define: { value: define, writable: true, enumerable: true, configurable: true },\n\n _lazy: { value: lazy, writable: true, enumerable: true, configurable: true },\n\n _moduleDefine: { value: moduleDefine, writable: true, enumerable: true, configurable: true }\n\n });\n\n })();\n\n (function () {\n\n function define(constructor, instanceMembers, staticMembers) {\n /// <signature helpKeyword=\"WinJS.Class.define\">\n /// <summary locid=\"WinJS.Class.define\">\n /// Defines a class using the given constructor and the specified instance members.\n /// </summary>\n /// <param name=\"constructor\" type=\"Function\" locid=\"WinJS.Class.define_p:constructor\">\n /// A constructor function that is used to instantiate this class.\n /// </param>\n /// <param name=\"instanceMembers\" type=\"Object\" locid=\"WinJS.Class.define_p:instanceMembers\">\n /// The set of instance fields, properties, and methods made available on the class.\n /// </param>\n /// <param name=\"staticMembers\" type=\"Object\" locid=\"WinJS.Class.define_p:staticMembers\">\n /// The set of static fields, properties, and methods made available on the class.\n /// </param>\n /// <returns type=\"Function\" locid=\"WinJS.Class.define_returnValue\">\n /// The newly-defined class.\n /// </returns>\n /// </signature>\n constructor = constructor || function () { };\n _BaseCoreUtils.markSupportedForProcessing(constructor);\n if (instanceMembers) {\n initializeProperties(constructor.prototype, instanceMembers);\n }\n if (staticMembers) {\n initializeProperties(constructor, staticMembers);\n }\n return constructor;\n }\n\n function derive(baseClass, constructor, instanceMembers, staticMembers) {\n /// <signature helpKeyword=\"WinJS.Class.derive\">\n /// <summary locid=\"WinJS.Class.derive\">\n /// Creates a sub-class based on the supplied baseClass parameter, using prototypal inheritance.\n /// </summary>\n /// <param name=\"baseClass\" type=\"Function\" locid=\"WinJS.Class.derive_p:baseClass\">\n /// The class to inherit from.\n /// </param>\n /// <param name=\"constructor\" type=\"Function\" locid=\"WinJS.Class.derive_p:constructor\">\n /// A constructor function that is used to instantiate this class.\n /// </param>\n /// <param name=\"instanceMembers\" type=\"Object\" locid=\"WinJS.Class.derive_p:instanceMembers\">\n /// The set of instance fields, properties, and methods to be made available on the class.\n /// </param>\n /// <param name=\"staticMembers\" type=\"Object\" locid=\"WinJS.Class.derive_p:staticMembers\">\n /// The set of static fields, properties, and methods to be made available on the class.\n /// </param>\n /// <returns type=\"Function\" locid=\"WinJS.Class.derive_returnValue\">\n /// The newly-defined class.\n /// </returns>\n /// </signature>\n if (baseClass) {\n constructor = constructor || function () { };\n var basePrototype = baseClass.prototype;\n constructor.prototype = Object.create(basePrototype);\n _BaseCoreUtils.markSupportedForProcessing(constructor);\n Object.defineProperty(constructor.prototype, \"constructor\", { value: constructor, writable: true, configurable: true, enumerable: true });\n if (instanceMembers) {\n initializeProperties(constructor.prototype, instanceMembers);\n }\n if (staticMembers) {\n initializeProperties(constructor, staticMembers);\n }\n return constructor;\n } else {\n return define(constructor, instanceMembers, staticMembers);\n }\n }\n\n function mix(constructor) {\n /// <signature helpKeyword=\"WinJS.Class.mix\">\n /// <summary locid=\"WinJS.Class.mix\">\n /// Defines a class using the given constructor and the union of the set of instance members\n /// specified by all the mixin objects. The mixin parameter list is of variable length.\n /// </summary>\n /// <param name=\"constructor\" locid=\"WinJS.Class.mix_p:constructor\">\n /// A constructor function that is used to instantiate this class.\n /// </param>\n /// <returns type=\"Function\" locid=\"WinJS.Class.mix_returnValue\">\n /// The newly-defined class.\n /// </returns>\n /// </signature>\n constructor = constructor || function () { };\n var i, len;\n for (i = 1, len = arguments.length; i < len; i++) {\n initializeProperties(constructor.prototype, arguments[i]);\n }\n return constructor;\n }\n\n // Establish members of \"WinJS.Class\" namespace\n _WinJS.Namespace.define(\"WinJS.Class\", {\n define: define,\n derive: derive,\n mix: mix\n });\n\n })();\n\n return {\n Namespace: _WinJS.Namespace,\n Class: _WinJS.Class\n };\n\n});\n_winjs(\"WinJS/Core/_ErrorFromName\", [\"WinJS/Core/_Base\"], function errorsInit(_Base) {\n \"use strict\";\n\n var ErrorFromName = _Base.Class.derive(Error, function (name, message) {\n /// <signature helpKeyword=\"WinJS.ErrorFromName\">\n /// <summary locid=\"WinJS.ErrorFromName\">\n /// Creates an Error object with the specified name and message properties.\n /// </summary>\n /// <param name=\"name\" type=\"String\" locid=\"WinJS.ErrorFromName_p:name\">The name of this error. The name is meant to be consumed programmatically and should not be localized.</param>\n /// <param name=\"message\" type=\"String\" optional=\"true\" locid=\"WinJS.ErrorFromName_p:message\">The message for this error. The message is meant to be consumed by humans and should be localized.</param>\n /// <returns type=\"Error\" locid=\"WinJS.ErrorFromName_returnValue\">Error instance with .name and .message properties populated</returns>\n /// </signature>\n this.name = name;\n this.message = message || name;\n }, {\n /* empty */\n }, {\n supportedForProcessing: false,\n });\n\n _Base.Namespace.define(\"WinJS\", {\n // ErrorFromName establishes a simple pattern for returning error codes.\n //\n ErrorFromName: ErrorFromName\n });\n\n return ErrorFromName;\n\n});\n\n\n_winjs(\"WinJS/Core/_Events\", [\"exports\",\"WinJS/Core/_Base\"], function eventsInit(exports, _Base) {\n \"use strict\";\n\n\n function createEventProperty(name) {\n var eventPropStateName = \"_on\" + name + \"state\";\n\n return {\n get: function () {\n var state = this[eventPropStateName];\n return state && state.userHandler;\n },\n set: function (handler) {\n var state = this[eventPropStateName];\n if (handler) {\n if (!state) {\n state = { wrapper: function (evt) { return state.userHandler(evt); }, userHandler: handler };\n Object.defineProperty(this, eventPropStateName, { value: state, enumerable: false, writable:true, configurable: true });\n this.addEventListener(name, state.wrapper, false);\n }\n state.userHandler = handler;\n } else if (state) {\n this.removeEventListener(name, state.wrapper, false);\n this[eventPropStateName] = null;\n }\n },\n enumerable: true\n };\n }\n\n function createEventProperties() {\n /// <signature helpKeyword=\"WinJS.Utilities.createEventProperties\">\n /// <summary locid=\"WinJS.Utilities.createEventProperties\">\n /// Creates an object that has one property for each name passed to the function.\n /// </summary>\n /// <param name=\"events\" locid=\"WinJS.Utilities.createEventProperties_p:events\">\n /// A variable list of property names.\n /// </param>\n /// <returns type=\"Object\" locid=\"WinJS.Utilities.createEventProperties_returnValue\">\n /// The object with the specified properties. The names of the properties are prefixed with 'on'.\n /// </returns>\n /// </signature>\n var props = {};\n for (var i = 0, len = arguments.length; i < len; i++) {\n var name = arguments[i];\n props[\"on\" + name] = createEventProperty(name);\n }\n return props;\n }\n\n var EventMixinEvent = _Base.Class.define(\n function EventMixinEvent_ctor(type, detail, target) {\n this.detail = detail;\n this.target = target;\n this.timeStamp = Date.now();\n this.type = type;\n },\n {\n bubbles: { value: false, writable: false },\n cancelable: { value: false, writable: false },\n currentTarget: {\n get: function () { return this.target; }\n },\n defaultPrevented: {\n get: function () { return this._preventDefaultCalled; }\n },\n trusted: { value: false, writable: false },\n eventPhase: { value: 0, writable: false },\n target: null,\n timeStamp: null,\n type: null,\n\n preventDefault: function () {\n this._preventDefaultCalled = true;\n },\n stopImmediatePropagation: function () {\n this._stopImmediatePropagationCalled = true;\n },\n stopPropagation: function () {\n }\n }, {\n supportedForProcessing: false,\n }\n );\n\n var eventMixin = {\n _listeners: null,\n\n addEventListener: function (type, listener, useCapture) {\n /// <signature helpKeyword=\"WinJS.Utilities.eventMixin.addEventListener\">\n /// <summary locid=\"WinJS.Utilities.eventMixin.addEventListener\">\n /// Adds an event listener to the control.\n /// </summary>\n /// <param name=\"type\" locid=\"WinJS.Utilities.eventMixin.addEventListener_p:type\">\n /// The type (name) of the event.\n /// </param>\n /// <param name=\"listener\" locid=\"WinJS.Utilities.eventMixin.addEventListener_p:listener\">\n /// The listener to invoke when the event is raised.\n /// </param>\n /// <param name=\"useCapture\" locid=\"WinJS.Utilities.eventMixin.addEventListener_p:useCapture\">\n /// if true initiates capture, otherwise false.\n /// </param>\n /// </signature>\n useCapture = useCapture || false;\n this._listeners = this._listeners || {};\n var eventListeners = (this._listeners[type] = this._listeners[type] || []);\n for (var i = 0, len = eventListeners.length; i < len; i++) {\n var l = eventListeners[i];\n if (l.useCapture === useCapture && l.listener === listener) {\n return;\n }\n }\n eventListeners.push({ listener: listener, useCapture: useCapture });\n },\n dispatchEvent: function (type, details) {\n /// <signature helpKeyword=\"WinJS.Utilities.eventMixin.dispatchEvent\">\n /// <summary locid=\"WinJS.Utilities.eventMixin.dispatchEvent\">\n /// Raises an event of the specified type and with the specified additional properties.\n /// </summary>\n /// <param name=\"type\" locid=\"WinJS.Utilities.eventMixin.dispatchEvent_p:type\">\n /// The type (name) of the event.\n /// </param>\n /// <param name=\"details\" locid=\"WinJS.Utilities.eventMixin.dispatchEvent_p:details\">\n /// The set of additional properties to be attached to the event object when the event is raised.\n /// </param>\n /// <returns type=\"Boolean\" locid=\"WinJS.Utilities.eventMixin.dispatchEvent_returnValue\">\n /// true if preventDefault was called on the event.\n /// </returns>\n /// </signature>\n var listeners = this._listeners && this._listeners[type];\n if (listeners) {\n var eventValue = new EventMixinEvent(type, details, this);\n // Need to copy the array to protect against people unregistering while we are dispatching\n listeners = listeners.slice(0, listeners.length);\n for (var i = 0, len = listeners.length; i < len && !eventValue._stopImmediatePropagationCalled; i++) {\n listeners[i].listener(eventValue);\n }\n return eventValue.defaultPrevented || false;\n }\n return false;\n },\n removeEventListener: function (type, listener, useCapture) {\n /// <signature helpKeyword=\"WinJS.Utilities.eventMixin.removeEventListener\">\n /// <summary locid=\"WinJS.Utilities.eventMixin.removeEventListener\">\n /// Removes an event listener from the control.\n /// </summary>\n /// <param name=\"type\" locid=\"WinJS.Utilities.eventMixin.removeEventListener_p:type\">\n /// The type (name) of the event.\n /// </param>\n /// <param name=\"listener\" locid=\"WinJS.Utilities.eventMixin.removeEventListener_p:listener\">\n /// The listener to remove.\n /// </param>\n /// <param name=\"useCapture\" locid=\"WinJS.Utilities.eventMixin.removeEventListener_p:useCapture\">\n /// Specifies whether to initiate capture.\n /// </param>\n /// </signature>\n useCapture = useCapture || false;\n var listeners = this._listeners && this._listeners[type];\n if (listeners) {\n for (var i = 0, len = listeners.length; i < len; i++) {\n var l = listeners[i];\n if (l.listener === listener && l.useCapture === useCapture) {\n listeners.splice(i, 1);\n if (listeners.length === 0) {\n delete this._listeners[type];\n }\n // Only want to remove one element for each call to removeEventListener\n break;\n }\n }\n }\n }\n };\n\n _Base.Namespace._moduleDefine(exports, \"WinJS.Utilities\", {\n _createEventProperty: createEventProperty,\n createEventProperties: createEventProperties,\n eventMixin: eventMixin\n });\n\n});\n\n\n_winjs(\"WinJS/Core/_Trace\", [\"WinJS/Core/_Global\"], function traceInit(_Global) {\n \"use strict\";\n\n function nop(v) {\n return v;\n }\n\n return {\n _traceAsyncOperationStarting: (_Global.Debug && _Global.Debug.msTraceAsyncOperationStarting && _Global.Debug.msTraceAsyncOperationStarting.bind(_Global.Debug)) || nop,\n _traceAsyncOperationCompleted: (_Global.Debug && _Global.Debug.msTraceAsyncOperationCompleted && _Global.Debug.msTraceAsyncOperationCompleted.bind(_Global.Debug)) || nop,\n _traceAsyncCallbackStarting: (_Global.Debug && _Global.Debug.msTraceAsyncCallbackStarting && _Global.Debug.msTraceAsyncCallbackStarting.bind(_Global.Debug)) || nop,\n _traceAsyncCallbackCompleted: (_Global.Debug && _Global.Debug.msTraceAsyncCallbackCompleted && _Global.Debug.msTraceAsyncCallbackCompleted.bind(_Global.Debug)) || nop\n };\n});\n_winjs(\"WinJS/Promise/_StateMachine\", [\"WinJS/Core/_Global\",\"WinJS/Core/_BaseCoreUtils\",\"WinJS/Core/_Base\",\"WinJS/Core/_ErrorFromName\",\"WinJS/Core/_Events\",\"WinJS/Core/_Trace\"], function promiseStateMachineInit(_Global, _BaseCoreUtils, _Base, _ErrorFromName, _Events, _Trace) {\n \"use strict\";\n\n _Global.Debug && (_Global.Debug.setNonUserCodeExceptions = true);\n\n var ListenerType = _Base.Class.mix(_Base.Class.define(null, { /*empty*/ }, { supportedForProcessing: false }), _Events.eventMixin);\n var promiseEventListeners = new ListenerType();\n // make sure there is a listeners collection so that we can do a more trivial check below\n promiseEventListeners._listeners = {};\n var errorET = \"error\";\n var canceledName = \"Canceled\";\n var tagWithStack = false;\n var tag = {\n promise: 0x01,\n thenPromise: 0x02,\n errorPromise: 0x04,\n exceptionPromise: 0x08,\n completePromise: 0x10,\n };\n tag.all = tag.promise | tag.thenPromise | tag.errorPromise | tag.exceptionPromise | tag.completePromise;\n\n //\n // Global error counter, for each error which enters the system we increment this once and then\n // the error number travels with the error as it traverses the tree of potential handlers.\n //\n // When someone has registered to be told about errors (WinJS.Promise.callonerror) promises\n // which are in error will get tagged with a ._errorId field. This tagged field is the\n // contract by which nested promises with errors will be identified as chaining for the\n // purposes of the callonerror semantics. If a nested promise in error is encountered without\n // a ._errorId it will be assumed to be foreign and treated as an interop boundary and\n // a new error id will be minted.\n //\n var error_number = 1;\n\n //\n // The state machine has a interesting hiccup in it with regards to notification, in order\n // to flatten out notification and avoid recursion for synchronous completion we have an\n // explicit set of *_notify states which are responsible for notifying their entire tree\n // of children. They can do this because they know that immediate children are always\n // ThenPromise instances and we can therefore reach into their state to access the\n // _listeners collection.\n //\n // So, what happens is that a Promise will be fulfilled through the _completed or _error\n // messages at which point it will enter a *_notify state and be responsible for to move\n // its children into an (as appropriate) success or error state and also notify that child's\n // listeners of the state transition, until leaf notes are reached.\n //\n\n var state_created, // -> working\n state_working, // -> error | error_notify | success | success_notify | canceled | waiting\n state_waiting, // -> error | error_notify | success | success_notify | waiting_canceled\n state_waiting_canceled, // -> error | error_notify | success | success_notify | canceling\n state_canceled, // -> error | error_notify | success | success_notify | canceling\n state_canceling, // -> error_notify\n state_success_notify, // -> success\n state_success, // -> .\n state_error_notify, // -> error\n state_error; // -> .\n\n // Noop function, used in the various states to indicate that they don't support a given\n // message. Named with the somewhat cute name '_' because it reads really well in the states.\n\n function _() { }\n\n // Initial state\n //\n state_created = {\n name: \"created\",\n enter: function (promise) {\n promise._setState(state_working);\n },\n cancel: _,\n done: _,\n then: _,\n _completed: _,\n _error: _,\n _notify: _,\n _progress: _,\n _setCompleteValue: _,\n _setErrorValue: _\n };\n\n // Ready state, waiting for a message (completed/error/progress), able to be canceled\n //\n state_working = {\n name: \"working\",\n enter: _,\n cancel: function (promise) {\n promise._setState(state_canceled);\n },\n done: done,\n then: then,\n _completed: completed,\n _error: error,\n _notify: _,\n _progress: progress,\n _setCompleteValue: setCompleteValue,\n _setErrorValue: setErrorValue\n };\n\n // Waiting state, if a promise is completed with a value which is itself a promise\n // (has a then() method) it signs up to be informed when that child promise is\n // fulfilled at which point it will be fulfilled with that value.\n //\n state_waiting = {\n name: \"waiting\",\n enter: function (promise) {\n var waitedUpon = promise._value;\n // We can special case our own intermediate promises which are not in a\n // terminal state by just pushing this promise as a listener without\n // having to create new indirection functions\n if (waitedUpon instanceof ThenPromise &&\n waitedUpon._state !== state_error &&\n waitedUpon._state !== state_success) {\n pushListener(waitedUpon, { promise: promise });\n } else {\n var error = function (value) {\n if (waitedUpon._errorId) {\n promise._chainedError(value, waitedUpon);\n } else {\n // Because this is an interop boundary we want to indicate that this\n // error has been handled by the promise infrastructure before we\n // begin a new handling chain.\n //\n callonerror(promise, value, detailsForHandledError, waitedUpon, error);\n promise._error(value);\n }\n };\n error.handlesOnError = true;\n waitedUpon.then(\n promise._completed.bind(promise),\n error,\n promise._progress.bind(promise)\n );\n }\n },\n cancel: function (promise) {\n promise._setState(state_waiting_canceled);\n },\n done: done,\n then: then,\n _completed: completed,\n _error: error,\n _notify: _,\n _progress: progress,\n _setCompleteValue: setCompleteValue,\n _setErrorValue: setErrorValue\n };\n\n // Waiting canceled state, when a promise has been in a waiting state and receives a\n // request to cancel its pending work it will forward that request to the child promise\n // and then waits to be informed of the result. This promise moves itself into the\n // canceling state but understands that the child promise may instead push it to a\n // different state.\n //\n state_waiting_canceled = {\n name: \"waiting_canceled\",\n enter: function (promise) {\n // Initiate a transition to canceling. Triggering a cancel on the promise\n // that we are waiting upon may result in a different state transition\n // before the state machine pump runs again.\n promise._setState(state_canceling);\n var waitedUpon = promise._value;\n if (waitedUpon.cancel) {\n waitedUpon.cancel();\n }\n },\n cancel: _,\n done: done,\n then: then,\n _completed: completed,\n _error: error,\n _notify: _,\n _progress: progress,\n _setCompleteValue: setCompleteValue,\n _setErrorValue: setErrorValue\n };\n\n // Canceled state, moves to the canceling state and then tells the promise to do\n // whatever it might need to do on cancelation.\n //\n state_canceled = {\n name: \"canceled\",\n enter: function (promise) {\n // Initiate a transition to canceling. The _cancelAction may change the state\n // before the state machine pump runs again.\n promise._setState(state_canceling);\n promise._cancelAction();\n },\n cancel: _,\n done: done,\n then: then,\n _completed: completed,\n _error: error,\n _notify: _,\n _progress: progress,\n _setCompleteValue: setCompleteValue,\n _setErrorValue: setErrorValue\n };\n\n // Canceling state, commits to the promise moving to an error state with an error\n // object whose 'name' and 'message' properties contain the string \"Canceled\"\n //\n state_canceling = {\n name: \"canceling\",\n enter: function (promise) {\n var error = new Error(canceledName);\n error.name = error.message;\n promise._value = error;\n promise._setState(state_error_notify);\n },\n cancel: _,\n done: _,\n then: _,\n _completed: _,\n _error: _,\n _notify: _,\n _progress: _,\n _setCompleteValue: _,\n _setErrorValue: _\n };\n\n // Success notify state, moves a promise to the success state and notifies all children\n //\n state_success_notify = {\n name: \"complete_notify\",\n enter: function (promise) {\n promise.done = CompletePromise.prototype.done;\n promise.then = CompletePromise.prototype.then;\n if (promise._listeners) {\n var queue = [promise];\n var p;\n while (queue.length) {\n p = queue.shift();\n p._state._notify(p, queue);\n }\n }\n promise._setState(state_success);\n },\n cancel: _,\n done: null, /*error to get here */\n then: null, /*error to get here */\n _completed: _,\n _error: _,\n _notify: notifySuccess,\n _progress: _,\n _setCompleteValue: _,\n _setErrorValue: _\n };\n\n // Success state, moves a promise to the success state and does NOT notify any children.\n // Some upstream promise is owning the notification pass.\n //\n state_success = {\n name: \"success\",\n enter: function (promise) {\n promise.done = CompletePromise.prototype.done;\n promise.then = CompletePromise.prototype.then;\n promise._cleanupAction();\n },\n cancel: _,\n done: null, /*error to get here */\n then: null, /*error to get here */\n _completed: _,\n _error: _,\n _notify: notifySuccess,\n _progress: _,\n _setCompleteValue: _,\n _setErrorValue: _\n };\n\n // Error notify state, moves a promise to the error state and notifies all children\n //\n state_error_notify = {\n name: \"error_notify\",\n enter: function (promise) {\n promise.done = ErrorPromise.prototype.done;\n promise.then = ErrorPromise.prototype.then;\n if (promise._listeners) {\n var queue = [promise];\n var p;\n while (queue.length) {\n p = queue.shift();\n p._state._notify(p, queue);\n }\n }\n promise._setState(state_error);\n },\n cancel: _,\n done: null, /*error to get here*/\n then: null, /*error to get here*/\n _completed: _,\n _error: _,\n _notify: notifyError,\n _progress: _,\n _setCompleteValue: _,\n _setErrorValue: _\n };\n\n // Error state, moves a promise to the error state and does NOT notify any children.\n // Some upstream promise is owning the notification pass.\n //\n state_error = {\n name: \"error\",\n enter: function (promise) {\n promise.done = ErrorPromise.prototype.done;\n promise.then = ErrorPromise.prototype.then;\n promise._cleanupAction();\n },\n cancel: _,\n done: null, /*error to get here*/\n then: null, /*error to get here*/\n _completed: _,\n _error: _,\n _notify: notifyError,\n _progress: _,\n _setCompleteValue: _,\n _setErrorValue: _\n };\n\n //\n // The statemachine implementation follows a very particular pattern, the states are specified\n // as static stateless bags of functions which are then indirected through the state machine\n // instance (a Promise). As such all of the functions on each state have the promise instance\n // passed to them explicitly as a parameter and the Promise instance members do a little\n // dance where they indirect through the state and insert themselves in the argument list.\n //\n // We could instead call directly through the promise states however then every caller\n // would have to remember to do things like pumping the state machine to catch state transitions.\n //\n\n var PromiseStateMachine = _Base.Class.define(null, {\n _listeners: null,\n _nextState: null,\n _state: null,\n _value: null,\n\n cancel: function () {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.cancel\">\n /// <summary locid=\"WinJS.PromiseStateMachine.cancel\">\n /// Attempts to cancel the fulfillment of a promised value. If the promise hasn't\n /// already been fulfilled and cancellation is supported, the promise enters\n /// the error state with a value of Error(\"Canceled\").\n /// </summary>\n /// </signature>\n this._state.cancel(this);\n this._run();\n },\n done: function Promise_done(onComplete, onError, onProgress) {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.done\">\n /// <summary locid=\"WinJS.PromiseStateMachine.done\">\n /// Allows you to specify the work to be done on the fulfillment of the promised value,\n /// the error handling to be performed if the promise fails to fulfill\n /// a value, and the handling of progress notifications along the way.\n ///\n /// After the handlers have finished executing, this function throws any error that would have been returned\n /// from then() as a promise in the error state.\n /// </summary>\n /// <param name='onComplete' type='Function' locid=\"WinJS.PromiseStateMachine.done_p:onComplete\">\n /// The function to be called if the promise is fulfilled successfully with a value.\n /// The fulfilled value is passed as the single argument. If the value is null,\n /// the fulfilled value is returned. The value returned\n /// from the function becomes the fulfilled value of the promise returned by\n /// then(). If an exception is thrown while executing the function, the promise returned\n /// by then() moves into the error state.\n /// </param>\n /// <param name='onError' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.done_p:onError\">\n /// The function to be called if the promise is fulfilled with an error. The error\n /// is passed as the single argument. If it is null, the error is forwarded.\n /// The value returned from the function is the fulfilled value of the promise returned by then().\n /// </param>\n /// <param name='onProgress' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.done_p:onProgress\">\n /// the function to be called if the promise reports progress. Data about the progress\n /// is passed as the single argument. Promises are not required to support\n /// progress.\n /// </param>\n /// </signature>\n this._state.done(this, onComplete, onError, onProgress);\n },\n then: function Promise_then(onComplete, onError, onProgress) {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.then\">\n /// <summary locid=\"WinJS.PromiseStateMachine.then\">\n /// Allows you to specify the work to be done on the fulfillment of the promised value,\n /// the error handling to be performed if the promise fails to fulfill\n /// a value, and the handling of progress notifications along the way.\n /// </summary>\n /// <param name='onComplete' type='Function' locid=\"WinJS.PromiseStateMachine.then_p:onComplete\">\n /// The function to be called if the promise is fulfilled successfully with a value.\n /// The value is passed as the single argument. If the value is null, the value is returned.\n /// The value returned from the function becomes the fulfilled value of the promise returned by\n /// then(). If an exception is thrown while this function is being executed, the promise returned\n /// by then() moves into the error state.\n /// </param>\n /// <param name='onError' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.then_p:onError\">\n /// The function to be called if the promise is fulfilled with an error. The error\n /// is passed as the single argument. If it is null, the error is forwarded.\n /// The value returned from the function becomes the fulfilled value of the promise returned by then().\n /// </param>\n /// <param name='onProgress' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.then_p:onProgress\">\n /// The function to be called if the promise reports progress. Data about the progress\n /// is passed as the single argument. Promises are not required to support\n /// progress.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.PromiseStateMachine.then_returnValue\">\n /// The promise whose value is the result of executing the complete or\n /// error function.\n /// </returns>\n /// </signature>\n return this._state.then(this, onComplete, onError, onProgress);\n },\n\n _chainedError: function (value, context) {\n var result = this._state._error(this, value, detailsForChainedError, context);\n this._run();\n return result;\n },\n _completed: function (value) {\n var result = this._state._completed(this, value);\n this._run();\n return result;\n },\n _error: function (value) {\n var result = this._state._error(this, value, detailsForError);\n this._run();\n return result;\n },\n _progress: function (value) {\n this._state._progress(this, value);\n },\n _setState: function (state) {\n this._nextState = state;\n },\n _setCompleteValue: function (value) {\n this._state._setCompleteValue(this, value);\n this._run();\n },\n _setChainedErrorValue: function (value, context) {\n var result = this._state._setErrorValue(this, value, detailsForChainedError, context);\n this._run();\n return result;\n },\n _setExceptionValue: function (value) {\n var result = this._state._setErrorValue(this, value, detailsForException);\n this._run();\n return result;\n },\n _run: function () {\n while (this._nextState) {\n this._state = this._nextState;\n this._nextState = null;\n this._state.enter(this);\n }\n }\n }, {\n supportedForProcessing: false\n });\n\n //\n // Implementations of shared state machine code.\n //\n\n function completed(promise, value) {\n var targetState;\n if (value && typeof value === \"object\" && typeof value.then === \"function\") {\n targetState = state_waiting;\n } else {\n targetState = state_success_notify;\n }\n promise._value = value;\n promise._setState(targetState);\n }\n function createErrorDetails(exception, error, promise, id, parent, handler) {\n return {\n exception: exception,\n error: error,\n promise: promise,\n handler: handler,\n id: id,\n parent: parent\n };\n }\n function detailsForHandledError(promise, errorValue, context, handler) {\n var exception = context._isException;\n var errorId = context._errorId;\n return createErrorDetails(\n exception ? errorValue : null,\n exception ? null : errorValue,\n promise,\n errorId,\n context,\n handler\n );\n }\n function detailsForChainedError(promise, errorValue, context) {\n var exception = context._isException;\n var errorId = context._errorId;\n setErrorInfo(promise, errorId, exception);\n return createErrorDetails(\n exception ? errorValue : null,\n exception ? null : errorValue,\n promise,\n errorId,\n context\n );\n }\n function detailsForError(promise, errorValue) {\n var errorId = ++error_number;\n setErrorInfo(promise, errorId);\n return createErrorDetails(\n null,\n errorValue,\n promise,\n errorId\n );\n }\n function detailsForException(promise, exceptionValue) {\n var errorId = ++error_number;\n setErrorInfo(promise, errorId, true);\n return createErrorDetails(\n exceptionValue,\n null,\n promise,\n errorId\n );\n }\n function done(promise, onComplete, onError, onProgress) {\n var asyncOpID = _Trace._traceAsyncOperationStarting(\"WinJS.Promise.done\");\n pushListener(promise, { c: onComplete, e: onError, p: onProgress, asyncOpID: asyncOpID });\n }\n function error(promise, value, onerrorDetails, context) {\n promise._value = value;\n callonerror(promise, value, onerrorDetails, context);\n promise._setState(state_error_notify);\n }\n function notifySuccess(promise, queue) {\n var value = promise._value;\n var listeners = promise._listeners;\n if (!listeners) {\n return;\n }\n promise._listeners = null;\n var i, len;\n for (i = 0, len = Array.isArray(listeners) ? listeners.length : 1; i < len; i++) {\n var listener = len === 1 ? listeners : listeners[i];\n var onComplete = listener.c;\n var target = listener.promise;\n\n _Trace._traceAsyncOperationCompleted(listener.asyncOpID, _Global.Debug && _Global.Debug.MS_ASYNC_OP_STATUS_SUCCESS);\n\n if (target) {\n _Trace._traceAsyncCallbackStarting(listener.asyncOpID);\n try {\n target._setCompleteValue(onComplete ? onComplete(value) : value);\n } catch (ex) {\n target._setExceptionValue(ex);\n } finally {\n _Trace._traceAsyncCallbackCompleted();\n }\n if (target._state !== state_waiting && target._listeners) {\n queue.push(target);\n }\n } else {\n CompletePromise.prototype.done.call(promise, onComplete);\n }\n }\n }\n function notifyError(promise, queue) {\n var value = promise._value;\n var listeners = promise._listeners;\n if (!listeners) {\n return;\n }\n promise._listeners = null;\n var i, len;\n for (i = 0, len = Array.isArray(listeners) ? listeners.length : 1; i < len; i++) {\n var listener = len === 1 ? listeners : listeners[i];\n var onError = listener.e;\n var target = listener.promise;\n\n var errorID = _Global.Debug && (value && value.name === canceledName ? _Global.Debug.MS_ASYNC_OP_STATUS_CANCELED : _Global.Debug.MS_ASYNC_OP_STATUS_ERROR);\n _Trace._traceAsyncOperationCompleted(listener.asyncOpID, errorID);\n\n if (target) {\n var asyncCallbackStarted = false;\n try {\n if (onError) {\n _Trace._traceAsyncCallbackStarting(listener.asyncOpID);\n asyncCallbackStarted = true;\n if (!onError.handlesOnError) {\n callonerror(target, value, detailsForHandledError, promise, onError);\n }\n target._setCompleteValue(onError(value));\n } else {\n target._setChainedErrorValue(value, promise);\n }\n } catch (ex) {\n target._setExceptionValue(ex);\n } finally {\n if (asyncCallbackStarted) {\n _Trace._traceAsyncCallbackCompleted();\n }\n }\n if (target._state !== state_waiting && target._listeners) {\n queue.push(target);\n }\n } else {\n ErrorPromise.prototype.done.call(promise, null, onError);\n }\n }\n }\n function callonerror(promise, value, onerrorDetailsGenerator, context, handler) {\n if (promiseEventListeners._listeners[errorET]) {\n if (value instanceof Error && value.message === canceledName) {\n return;\n }\n promiseEventListeners.dispatchEvent(errorET, onerrorDetailsGenerator(promise, value, context, handler));\n }\n }\n function progress(promise, value) {\n var listeners = promise._listeners;\n if (listeners) {\n var i, len;\n for (i = 0, len = Array.isArray(listeners) ? listeners.length : 1; i < len; i++) {\n var listener = len === 1 ? listeners : listeners[i];\n var onProgress = listener.p;\n if (onProgress) {\n try { onProgress(value); } catch (ex) { }\n }\n if (!(listener.c || listener.e) && listener.promise) {\n listener.promise._progress(value);\n }\n }\n }\n }\n function pushListener(promise, listener) {\n var listeners = promise._listeners;\n if (listeners) {\n // We may have either a single listener (which will never be wrapped in an array)\n // or 2+ listeners (which will be wrapped). Since we are now adding one more listener\n // we may have to wrap the single listener before adding the second.\n listeners = Array.isArray(listeners) ? listeners : [listeners];\n listeners.push(listener);\n } else {\n listeners = listener;\n }\n promise._listeners = listeners;\n }\n // The difference beween setCompleteValue()/setErrorValue() and complete()/error() is that setXXXValue() moves\n // a promise directly to the success/error state without starting another notification pass (because one\n // is already ongoing).\n function setErrorInfo(promise, errorId, isException) {\n promise._isException = isException || false;\n promise._errorId = errorId;\n }\n function setErrorValue(promise, value, onerrorDetails, context) {\n promise._value = value;\n callonerror(promise, value, onerrorDetails, context);\n promise._setState(state_error);\n }\n function setCompleteValue(promise, value) {\n var targetState;\n if (value && typeof value === \"object\" && typeof value.then === \"function\") {\n targetState = state_waiting;\n } else {\n targetState = state_success;\n }\n promise._value = value;\n promise._setState(targetState);\n }\n function then(promise, onComplete, onError, onProgress) {\n var result = new ThenPromise(promise);\n var asyncOpID = _Trace._traceAsyncOperationStarting(\"WinJS.Promise.then\");\n pushListener(promise, { promise: result, c: onComplete, e: onError, p: onProgress, asyncOpID: asyncOpID });\n return result;\n }\n\n //\n // Internal implementation detail promise, ThenPromise is created when a promise needs\n // to be returned from a then() method.\n //\n var ThenPromise = _Base.Class.derive(PromiseStateMachine,\n function (creator) {\n\n if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.thenPromise))) {\n this._stack = Promise._getStack();\n }\n\n this._creator = creator;\n this._setState(state_created);\n this._run();\n }, {\n _creator: null,\n\n _cancelAction: function () { if (this._creator) { this._creator.cancel(); } },\n _cleanupAction: function () { this._creator = null; }\n }, {\n supportedForProcessing: false\n }\n );\n\n //\n // Slim promise implementations for already completed promises, these are created\n // under the hood on synchronous completion paths as well as by WinJS.Promise.wrap\n // and WinJS.Promise.wrapError.\n //\n\n var ErrorPromise = _Base.Class.define(\n function ErrorPromise_ctor(value) {\n\n if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.errorPromise))) {\n this._stack = Promise._getStack();\n }\n\n this._value = value;\n callonerror(this, value, detailsForError);\n }, {\n cancel: function () {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.cancel\">\n /// <summary locid=\"WinJS.PromiseStateMachine.cancel\">\n /// Attempts to cancel the fulfillment of a promised value. If the promise hasn't\n /// already been fulfilled and cancellation is supported, the promise enters\n /// the error state with a value of Error(\"Canceled\").\n /// </summary>\n /// </signature>\n },\n done: function ErrorPromise_done(unused, onError) {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.done\">\n /// <summary locid=\"WinJS.PromiseStateMachine.done\">\n /// Allows you to specify the work to be done on the fulfillment of the promised value,\n /// the error handling to be performed if the promise fails to fulfill\n /// a value, and the handling of progress notifications along the way.\n ///\n /// After the handlers have finished executing, this function throws any error that would have been returned\n /// from then() as a promise in the error state.\n /// </summary>\n /// <param name='onComplete' type='Function' locid=\"WinJS.PromiseStateMachine.done_p:onComplete\">\n /// The function to be called if the promise is fulfilled successfully with a value.\n /// The fulfilled value is passed as the single argument. If the value is null,\n /// the fulfilled value is returned. The value returned\n /// from the function becomes the fulfilled value of the promise returned by\n /// then(). If an exception is thrown while executing the function, the promise returned\n /// by then() moves into the error state.\n /// </param>\n /// <param name='onError' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.done_p:onError\">\n /// The function to be called if the promise is fulfilled with an error. The error\n /// is passed as the single argument. If it is null, the error is forwarded.\n /// The value returned from the function is the fulfilled value of the promise returned by then().\n /// </param>\n /// <param name='onProgress' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.done_p:onProgress\">\n /// the function to be called if the promise reports progress. Data about the progress\n /// is passed as the single argument. Promises are not required to support\n /// progress.\n /// </param>\n /// </signature>\n var value = this._value;\n if (onError) {\n try {\n if (!onError.handlesOnError) {\n callonerror(null, value, detailsForHandledError, this, onError);\n }\n var result = onError(value);\n if (result && typeof result === \"object\" && typeof result.done === \"function\") {\n // If a promise is returned we need to wait on it.\n result.done();\n }\n return;\n } catch (ex) {\n value = ex;\n }\n }\n if (value instanceof Error && value.message === canceledName) {\n // suppress cancel\n return;\n }\n // force the exception to be thrown asyncronously to avoid any try/catch blocks\n //\n Promise._doneHandler(value);\n },\n then: function ErrorPromise_then(unused, onError) {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.then\">\n /// <summary locid=\"WinJS.PromiseStateMachine.then\">\n /// Allows you to specify the work to be done on the fulfillment of the promised value,\n /// the error handling to be performed if the promise fails to fulfill\n /// a value, and the handling of progress notifications along the way.\n /// </summary>\n /// <param name='onComplete' type='Function' locid=\"WinJS.PromiseStateMachine.then_p:onComplete\">\n /// The function to be called if the promise is fulfilled successfully with a value.\n /// The value is passed as the single argument. If the value is null, the value is returned.\n /// The value returned from the function becomes the fulfilled value of the promise returned by\n /// then(). If an exception is thrown while this function is being executed, the promise returned\n /// by then() moves into the error state.\n /// </param>\n /// <param name='onError' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.then_p:onError\">\n /// The function to be called if the promise is fulfilled with an error. The error\n /// is passed as the single argument. If it is null, the error is forwarded.\n /// The value returned from the function becomes the fulfilled value of the promise returned by then().\n /// </param>\n /// <param name='onProgress' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.then_p:onProgress\">\n /// The function to be called if the promise reports progress. Data about the progress\n /// is passed as the single argument. Promises are not required to support\n /// progress.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.PromiseStateMachine.then_returnValue\">\n /// The promise whose value is the result of executing the complete or\n /// error function.\n /// </returns>\n /// </signature>\n\n // If the promise is already in a error state and no error handler is provided\n // we optimize by simply returning the promise instead of creating a new one.\n //\n if (!onError) { return this; }\n var result;\n var value = this._value;\n try {\n if (!onError.handlesOnError) {\n callonerror(null, value, detailsForHandledError, this, onError);\n }\n result = new CompletePromise(onError(value));\n } catch (ex) {\n // If the value throw from the error handler is the same as the value\n // provided to the error handler then there is no need for a new promise.\n //\n if (ex === value) {\n result = this;\n } else {\n result = new ExceptionPromise(ex);\n }\n }\n return result;\n }\n }, {\n supportedForProcessing: false\n }\n );\n\n var ExceptionPromise = _Base.Class.derive(ErrorPromise,\n function ExceptionPromise_ctor(value) {\n\n if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.exceptionPromise))) {\n this._stack = Promise._getStack();\n }\n\n this._value = value;\n callonerror(this, value, detailsForException);\n }, {\n /* empty */\n }, {\n supportedForProcessing: false\n }\n );\n\n var CompletePromise = _Base.Class.define(\n function CompletePromise_ctor(value) {\n\n if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.completePromise))) {\n this._stack = Promise._getStack();\n }\n\n if (value && typeof value === \"object\" && typeof value.then === \"function\") {\n var result = new ThenPromise(null);\n result._setCompleteValue(value);\n return result;\n }\n this._value = value;\n }, {\n cancel: function () {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.cancel\">\n /// <summary locid=\"WinJS.PromiseStateMachine.cancel\">\n /// Attempts to cancel the fulfillment of a promised value. If the promise hasn't\n /// already been fulfilled and cancellation is supported, the promise enters\n /// the error state with a value of Error(\"Canceled\").\n /// </summary>\n /// </signature>\n },\n done: function CompletePromise_done(onComplete) {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.done\">\n /// <summary locid=\"WinJS.PromiseStateMachine.done\">\n /// Allows you to specify the work to be done on the fulfillment of the promised value,\n /// the error handling to be performed if the promise fails to fulfill\n /// a value, and the handling of progress notifications along the way.\n ///\n /// After the handlers have finished executing, this function throws any error that would have been returned\n /// from then() as a promise in the error state.\n /// </summary>\n /// <param name='onComplete' type='Function' locid=\"WinJS.PromiseStateMachine.done_p:onComplete\">\n /// The function to be called if the promise is fulfilled successfully with a value.\n /// The fulfilled value is passed as the single argument. If the value is null,\n /// the fulfilled value is returned. The value returned\n /// from the function becomes the fulfilled value of the promise returned by\n /// then(). If an exception is thrown while executing the function, the promise returned\n /// by then() moves into the error state.\n /// </param>\n /// <param name='onError' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.done_p:onError\">\n /// The function to be called if the promise is fulfilled with an error. The error\n /// is passed as the single argument. If it is null, the error is forwarded.\n /// The value returned from the function is the fulfilled value of the promise returned by then().\n /// </param>\n /// <param name='onProgress' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.done_p:onProgress\">\n /// the function to be called if the promise reports progress. Data about the progress\n /// is passed as the single argument. Promises are not required to support\n /// progress.\n /// </param>\n /// </signature>\n if (!onComplete) { return; }\n try {\n var result = onComplete(this._value);\n if (result && typeof result === \"object\" && typeof result.done === \"function\") {\n result.done();\n }\n } catch (ex) {\n // force the exception to be thrown asynchronously to avoid any try/catch blocks\n Promise._doneHandler(ex);\n }\n },\n then: function CompletePromise_then(onComplete) {\n /// <signature helpKeyword=\"WinJS.PromiseStateMachine.then\">\n /// <summary locid=\"WinJS.PromiseStateMachine.then\">\n /// Allows you to specify the work to be done on the fulfillment of the promised value,\n /// the error handling to be performed if the promise fails to fulfill\n /// a value, and the handling of progress notifications along the way.\n /// </summary>\n /// <param name='onComplete' type='Function' locid=\"WinJS.PromiseStateMachine.then_p:onComplete\">\n /// The function to be called if the promise is fulfilled successfully with a value.\n /// The value is passed as the single argument. If the value is null, the value is returned.\n /// The value returned from the function becomes the fulfilled value of the promise returned by\n /// then(). If an exception is thrown while this function is being executed, the promise returned\n /// by then() moves into the error state.\n /// </param>\n /// <param name='onError' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.then_p:onError\">\n /// The function to be called if the promise is fulfilled with an error. The error\n /// is passed as the single argument. If it is null, the error is forwarded.\n /// The value returned from the function becomes the fulfilled value of the promise returned by then().\n /// </param>\n /// <param name='onProgress' type='Function' optional='true' locid=\"WinJS.PromiseStateMachine.then_p:onProgress\">\n /// The function to be called if the promise reports progress. Data about the progress\n /// is passed as the single argument. Promises are not required to support\n /// progress.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.PromiseStateMachine.then_returnValue\">\n /// The promise whose value is the result of executing the complete or\n /// error function.\n /// </returns>\n /// </signature>\n try {\n // If the value returned from the completion handler is the same as the value\n // provided to the completion handler then there is no need for a new promise.\n //\n var newValue = onComplete ? onComplete(this._value) : this._value;\n return newValue === this._value ? this : new CompletePromise(newValue);\n } catch (ex) {\n return new ExceptionPromise(ex);\n }\n }\n }, {\n supportedForProcessing: false\n }\n );\n\n //\n // Promise is the user-creatable WinJS.Promise object.\n //\n\n function timeout(timeoutMS) {\n var id;\n return new Promise(\n function (c) {\n if (timeoutMS) {\n id = _Global.setTimeout(c, timeoutMS);\n } else {\n _BaseCoreUtils._setImmediate(c);\n }\n },\n function () {\n if (id) {\n _Global.clearTimeout(id);\n }\n }\n );\n }\n\n function timeoutWithPromise(timeout, promise) {\n var cancelPromise = function () { promise.cancel(); };\n var cancelTimeout = function () { timeout.cancel(); };\n timeout.then(cancelPromise);\n promise.then(cancelTimeout, cancelTimeout);\n return promise;\n }\n\n var staticCanceledPromise;\n\n var Promise = _Base.Class.derive(PromiseStateMachine,\n function Promise_ctor(init, oncancel) {\n /// <signature helpKeyword=\"WinJS.Promise\">\n /// <summary locid=\"WinJS.Promise\">\n /// A promise provides a mechanism to schedule work to be done on a value that\n /// has not yet been computed. It is a convenient abstraction for managing\n /// interactions with asynchronous APIs.\n /// </summary>\n /// <param name=\"init\" type=\"Function\" locid=\"WinJS.Promise_p:init\">\n /// The function that is called during construction of the promise. The function\n /// is given three arguments (complete, error, progress). Inside this function\n /// you should add event listeners for the notifications supported by this value.\n /// </param>\n /// <param name=\"oncancel\" optional=\"true\" locid=\"WinJS.Promise_p:oncancel\">\n /// The function to call if a consumer of this promise wants\n /// to cancel its undone work. Promises are not required to\n /// support cancellation.\n /// </param>\n /// </signature>\n\n if (tagWithStack && (tagWithStack === true || (tagWithStack & tag.promise))) {\n this._stack = Promise._getStack();\n }\n\n this._oncancel = oncancel;\n this._setState(state_created);\n this._run();\n\n try {\n var complete = this._completed.bind(this);\n var error = this._error.bind(this);\n var progress = this._progress.bind(this);\n init(complete, error, progress);\n } catch (ex) {\n this._setExceptionValue(ex);\n }\n }, {\n _oncancel: null,\n\n _cancelAction: function () {\n // BEGIN monaco change\n try {\n if (this._oncancel) {\n this._oncancel();\n } else {\n throw new Error('Promise did not implement oncancel');\n }\n } catch (ex) {\n // Access fields to get them created\n var msg = ex.message;\n var stack = ex.stack;\n promiseEventListeners.dispatchEvent('error', ex);\n }\n // END monaco change\n },\n _cleanupAction: function () { this._oncancel = null; }\n }, {\n\n addEventListener: function Promise_addEventListener(eventType, listener, capture) {\n /// <signature helpKeyword=\"WinJS.Promise.addEventListener\">\n /// <summary locid=\"WinJS.Promise.addEventListener\">\n /// Adds an event listener to the control.\n /// </summary>\n /// <param name=\"eventType\" locid=\"WinJS.Promise.addEventListener_p:eventType\">\n /// The type (name) of the event.\n /// </param>\n /// <param name=\"listener\" locid=\"WinJS.Promise.addEventListener_p:listener\">\n /// The listener to invoke when the event is raised.\n /// </param>\n /// <param name=\"capture\" locid=\"WinJS.Promise.addEventListener_p:capture\">\n /// Specifies whether or not to initiate capture.\n /// </param>\n /// </signature>\n promiseEventListeners.addEventListener(eventType, listener, capture);\n },\n any: function Promise_any(values) {\n /// <signature helpKeyword=\"WinJS.Promise.any\">\n /// <summary locid=\"WinJS.Promise.any\">\n /// Returns a promise that is fulfilled when one of the input promises\n /// has been fulfilled.\n /// </summary>\n /// <param name=\"values\" type=\"Array\" locid=\"WinJS.Promise.any_p:values\">\n /// An array that contains promise objects or objects whose property\n /// values include promise objects.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.Promise.any_returnValue\">\n /// A promise that on fulfillment yields the value of the input (complete or error).\n /// </returns>\n /// </signature>\n return new Promise(\n function (complete, error) {\n var keys = Object.keys(values);\n if (keys.length === 0) {\n complete();\n }\n var canceled = 0;\n keys.forEach(function (key) {\n Promise.as(values[key]).then(\n function () { complete({ key: key, value: values[key] }); },\n function (e) {\n if (e instanceof Error && e.name === canceledName) {\n if ((++canceled) === keys.length) {\n complete(Promise.cancel);\n }\n return;\n }\n error({ key: key, value: values[key] });\n }\n );\n });\n },\n function () {\n var keys = Object.keys(values);\n keys.forEach(function (key) {\n var promise = Promise.as(values[key]);\n if (typeof promise.cancel === \"function\") {\n promise.cancel();\n }\n });\n }\n );\n },\n as: function Promise_as(value) {\n /// <signature helpKeyword=\"WinJS.Promise.as\">\n /// <summary locid=\"WinJS.Promise.as\">\n /// Returns a promise. If the object is already a promise it is returned;\n /// otherwise the object is wrapped in a promise.\n /// </summary>\n /// <param name=\"value\" locid=\"WinJS.Promise.as_p:value\">\n /// The value to be treated as a promise.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.Promise.as_returnValue\">\n /// A promise.\n /// </returns>\n /// </signature>\n if (value && typeof value === \"object\" && typeof value.then === \"function\") {\n return value;\n }\n return new CompletePromise(value);\n },\n /// <field type=\"WinJS.Promise\" helpKeyword=\"WinJS.Promise.cancel\" locid=\"WinJS.Promise.cancel\">\n /// Canceled promise value, can be returned from a promise completion handler\n /// to indicate cancelation of the promise chain.\n /// </field>\n cancel: {\n get: function () {\n return (staticCanceledPromise = staticCanceledPromise || new ErrorPromise(new _ErrorFromName(canceledName)));\n }\n },\n dispatchEvent: function Promise_dispatchEvent(eventType, details) {\n /// <signature helpKeyword=\"WinJS.Promise.dispatchEvent\">\n /// <summary locid=\"WinJS.Promise.dispatchEvent\">\n /// Raises an event of the specified type and properties.\n /// </summary>\n /// <param name=\"eventType\" locid=\"WinJS.Promise.dispatchEvent_p:eventType\">\n /// The type (name) of the event.\n /// </param>\n /// <param name=\"details\" locid=\"WinJS.Promise.dispatchEvent_p:details\">\n /// The set of additional properties to be attached to the event object.\n /// </param>\n /// <returns type=\"Boolean\" locid=\"WinJS.Promise.dispatchEvent_returnValue\">\n /// Specifies whether preventDefault was called on the event.\n /// </returns>\n /// </signature>\n return promiseEventListeners.dispatchEvent(eventType, details);\n },\n is: function Promise_is(value) {\n /// <signature helpKeyword=\"WinJS.Promise.is\">\n /// <summary locid=\"WinJS.Promise.is\">\n /// Determines whether a value fulfills the promise contract.\n /// </summary>\n /// <param name=\"value\" locid=\"WinJS.Promise.is_p:value\">\n /// A value that may be a promise.\n /// </param>\n /// <returns type=\"Boolean\" locid=\"WinJS.Promise.is_returnValue\">\n /// true if the specified value is a promise, otherwise false.\n /// </returns>\n /// </signature>\n return value && typeof value === \"object\" && typeof value.then === \"function\";\n },\n join: function Promise_join(values) {\n /// <signature helpKeyword=\"WinJS.Promise.join\">\n /// <summary locid=\"WinJS.Promise.join\">\n /// Creates a promise that is fulfilled when all the values are fulfilled.\n /// </summary>\n /// <param name=\"values\" type=\"Object\" locid=\"WinJS.Promise.join_p:values\">\n /// An object whose fields contain values, some of which may be promises.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.Promise.join_returnValue\">\n /// A promise whose value is an object with the same field names as those of the object in the values parameter, where\n /// each field value is the fulfilled value of a promise.\n /// </returns>\n /// </signature>\n return new Promise(\n function (complete, error, progress) {\n var keys = Object.keys(values);\n var errors = Array.isArray(values) ? [] : {};\n var results = Array.isArray(values) ? [] : {};\n var undefineds = 0;\n var pending = keys.length;\n var argDone = function (key) {\n if ((--pending) === 0) {\n var errorCount = Object.keys(errors).length;\n if (errorCount === 0) {\n complete(results);\n } else {\n var canceledCount = 0;\n keys.forEach(function (key) {\n var e = errors[key];\n if (e instanceof Error && e.name === canceledName) {\n canceledCount++;\n }\n });\n if (canceledCount === errorCount) {\n complete(Promise.cancel);\n } else {\n error(errors);\n }\n }\n } else {\n progress({ Key: key, Done: true });\n }\n };\n keys.forEach(function (key) {\n var value = values[key];\n if (value === undefined) {\n undefineds++;\n } else {\n Promise.then(value,\n function (value) { results[key] = value; argDone(key); },\n function (value) { errors[key] = value; argDone(key); }\n );\n }\n });\n pending -= undefineds;\n if (pending === 0) {\n complete(results);\n return;\n }\n },\n function () {\n Object.keys(values).forEach(function (key) {\n var promise = Promise.as(values[key]);\n if (typeof promise.cancel === \"function\") {\n promise.cancel();\n }\n });\n }\n );\n },\n removeEventListener: function Promise_removeEventListener(eventType, listener, capture) {\n /// <signature helpKeyword=\"WinJS.Promise.removeEventListener\">\n /// <summary locid=\"WinJS.Promise.removeEventListener\">\n /// Removes an event listener from the control.\n /// </summary>\n /// <param name='eventType' locid=\"WinJS.Promise.removeEventListener_eventType\">\n /// The type (name) of the event.\n /// </param>\n /// <param name='listener' locid=\"WinJS.Promise.removeEventListener_listener\">\n /// The listener to remove.\n /// </param>\n /// <param name='capture' locid=\"WinJS.Promise.removeEventListener_capture\">\n /// Specifies whether or not to initiate capture.\n /// </param>\n /// </signature>\n promiseEventListeners.removeEventListener(eventType, listener, capture);\n },\n supportedForProcessing: false,\n then: function Promise_then(value, onComplete, onError, onProgress) {\n /// <signature helpKeyword=\"WinJS.Promise.then\">\n /// <summary locid=\"WinJS.Promise.then\">\n /// A static version of the promise instance method then().\n /// </summary>\n /// <param name=\"value\" locid=\"WinJS.Promise.then_p:value\">\n /// the value to be treated as a promise.\n /// </param>\n /// <param name=\"onComplete\" type=\"Function\" locid=\"WinJS.Promise.then_p:complete\">\n /// The function to be called if the promise is fulfilled with a value.\n /// If it is null, the promise simply\n /// returns the value. The value is passed as the single argument.\n /// </param>\n /// <param name=\"onError\" type=\"Function\" optional=\"true\" locid=\"WinJS.Promise.then_p:error\">\n /// The function to be called if the promise is fulfilled with an error. The error\n /// is passed as the single argument.\n /// </param>\n /// <param name=\"onProgress\" type=\"Function\" optional=\"true\" locid=\"WinJS.Promise.then_p:progress\">\n /// The function to be called if the promise reports progress. Data about the progress\n /// is passed as the single argument. Promises are not required to support\n /// progress.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.Promise.then_returnValue\">\n /// A promise whose value is the result of executing the provided complete function.\n /// </returns>\n /// </signature>\n return Promise.as(value).then(onComplete, onError, onProgress);\n },\n thenEach: function Promise_thenEach(values, onComplete, onError, onProgress) {\n /// <signature helpKeyword=\"WinJS.Promise.thenEach\">\n /// <summary locid=\"WinJS.Promise.thenEach\">\n /// Performs an operation on all the input promises and returns a promise\n /// that has the shape of the input and contains the result of the operation\n /// that has been performed on each input.\n /// </summary>\n /// <param name=\"values\" locid=\"WinJS.Promise.thenEach_p:values\">\n /// A set of values (which could be either an array or an object) of which some or all are promises.\n /// </param>\n /// <param name=\"onComplete\" type=\"Function\" locid=\"WinJS.Promise.thenEach_p:complete\">\n /// The function to be called if the promise is fulfilled with a value.\n /// If the value is null, the promise returns the value.\n /// The value is passed as the single argument.\n /// </param>\n /// <param name=\"onError\" type=\"Function\" optional=\"true\" locid=\"WinJS.Promise.thenEach_p:error\">\n /// The function to be called if the promise is fulfilled with an error. The error\n /// is passed as the single argument.\n /// </param>\n /// <param name=\"onProgress\" type=\"Function\" optional=\"true\" locid=\"WinJS.Promise.thenEach_p:progress\">\n /// The function to be called if the promise reports progress. Data about the progress\n /// is passed as the single argument. Promises are not required to support\n /// progress.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.Promise.thenEach_returnValue\">\n /// A promise that is the result of calling Promise.join on the values parameter.\n /// </returns>\n /// </signature>\n var result = Array.isArray(values) ? [] : {};\n Object.keys(values).forEach(function (key) {\n result[key] = Promise.as(values[key]).then(onComplete, onError, onProgress);\n });\n return Promise.join(result);\n },\n timeout: function Promise_timeout(time, promise) {\n /// <signature helpKeyword=\"WinJS.Promise.timeout\">\n /// <summary locid=\"WinJS.Promise.timeout\">\n /// Creates a promise that is fulfilled after a timeout.\n /// </summary>\n /// <param name=\"timeout\" type=\"Number\" optional=\"true\" locid=\"WinJS.Promise.timeout_p:timeout\">\n /// The timeout period in milliseconds. If this value is zero or not specified\n /// setImmediate is called, otherwise setTimeout is called.\n /// </param>\n /// <param name=\"promise\" type=\"Promise\" optional=\"true\" locid=\"WinJS.Promise.timeout_p:promise\">\n /// A promise that will be canceled if it doesn't complete before the\n /// timeout has expired.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.Promise.timeout_returnValue\">\n /// A promise that is completed asynchronously after the specified timeout.\n /// </returns>\n /// </signature>\n var to = timeout(time);\n return promise ? timeoutWithPromise(to, promise) : to;\n },\n wrap: function Promise_wrap(value) {\n /// <signature helpKeyword=\"WinJS.Promise.wrap\">\n /// <summary locid=\"WinJS.Promise.wrap\">\n /// Wraps a non-promise value in a promise. You can use this function if you need\n /// to pass a value to a function that requires a promise.\n /// </summary>\n /// <param name=\"value\" locid=\"WinJS.Promise.wrap_p:value\">\n /// Some non-promise value to be wrapped in a promise.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.Promise.wrap_returnValue\">\n /// A promise that is successfully fulfilled with the specified value\n /// </returns>\n /// </signature>\n return new CompletePromise(value);\n },\n wrapError: function Promise_wrapError(error) {\n /// <signature helpKeyword=\"WinJS.Promise.wrapError\">\n /// <summary locid=\"WinJS.Promise.wrapError\">\n /// Wraps a non-promise error value in a promise. You can use this function if you need\n /// to pass an error to a function that requires a promise.\n /// </summary>\n /// <param name=\"error\" locid=\"WinJS.Promise.wrapError_p:error\">\n /// A non-promise error value to be wrapped in a promise.\n /// </param>\n /// <returns type=\"WinJS.Promise\" locid=\"WinJS.Promise.wrapError_returnValue\">\n /// A promise that is in an error state with the specified value.\n /// </returns>\n /// </signature>\n return new ErrorPromise(error);\n },\n\n _veryExpensiveTagWithStack: {\n get: function () { return tagWithStack; },\n set: function (value) { tagWithStack = value; }\n },\n _veryExpensiveTagWithStack_tag: tag,\n _getStack: function () {\n if (_Global.Debug && _Global.Debug.debuggerEnabled) {\n try { throw new Error(); } catch (e) { return e.stack; }\n }\n },\n\n _cancelBlocker: function Promise__cancelBlocker(input, oncancel) {\n //\n // Returns a promise which on cancelation will still result in downstream cancelation while\n // protecting the promise 'input' from being canceled which has the effect of allowing\n // 'input' to be shared amoung various consumers.\n //\n if (!Promise.is(input)) {\n return Promise.wrap(input);\n }\n var complete;\n var error;\n var output = new Promise(\n function (c, e) {\n complete = c;\n error = e;\n },\n function () {\n complete = null;\n error = null;\n oncancel && oncancel();\n }\n );\n input.then(\n function (v) { complete && complete(v); },\n function (e) { error && error(e); }\n );\n return output;\n },\n\n }\n );\n Object.defineProperties(Promise, _Events.createEventProperties(errorET));\n\n Promise._doneHandler = function (value) {\n _BaseCoreUtils._setImmediate(function Promise_done_rethrow() {\n throw value;\n });\n };\n\n return {\n PromiseStateMachine: PromiseStateMachine,\n Promise: Promise,\n state_created: state_created\n };\n});\n\n_winjs(\"WinJS/Promise\", [\"WinJS/Core/_Base\",\"WinJS/Promise/_StateMachine\"], function promiseInit( _Base, _StateMachine) {\n \"use strict\";\n\n _Base.Namespace.define(\"WinJS\", {\n Promise: _StateMachine.Promise\n });\n\n return _StateMachine.Promise;\n});\n\n__winjs_exports = _modules[\"WinJS/Core/_WinJS\"];\n__winjs_exports.TPromise = __winjs_exports.Promise;\n__winjs_exports.PPromise = __winjs_exports.Promise;\n\n// ESM-comment-begin\nif (typeof exports === 'undefined' && typeof define === 'function' && define.amd) {\n define(\"vs/base/common/winjs.base\", [], __winjs_exports);\n} else {\n module.exports = __winjs_exports;\n}\n// ESM-comment-end\n\n})();\n\n// ESM-uncomment-begin\n// export var Promise = __winjs_exports.Promise;\n// export var TPromise = __winjs_exports.TPromise;\n// export var PPromise = __winjs_exports.PPromise;\n// ESM-uncomment-end\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'use strict';\n\nimport { IAction } from 'vs/base/common/actions';\nimport { TPromise, IPromiseError, IPromiseErrorDetail } from 'vs/base/common/winjs.base';\n\n// ------ BEGIN Hook up error listeners to winjs promises\n\nlet outstandingPromiseErrors: { [id: string]: IPromiseErrorDetail; } = {};\nfunction promiseErrorHandler(e: IPromiseError): void {\n\n\t//\n\t// e.detail looks like: { exception, error, promise, handler, id, parent }\n\t//\n\tconst details = e.detail;\n\tconst id = details.id;\n\n\t// If the error has a parent promise then this is not the origination of the\n\t// error so we check if it has a handler, and if so we mark that the error\n\t// was handled by removing it from outstandingPromiseErrors\n\t//\n\tif (details.parent) {\n\t\tif (details.handler && outstandingPromiseErrors) {\n\t\t\tdelete outstandingPromiseErrors[id];\n\t\t}\n\t\treturn;\n\t}\n\n\t// Indicate that this error was originated and needs to be handled\n\toutstandingPromiseErrors[id] = details;\n\n\t// The first time the queue fills up this iteration, schedule a timeout to\n\t// check if any errors are still unhandled.\n\tif (Object.keys(outstandingPromiseErrors).length === 1) {\n\t\tsetTimeout(function () {\n\t\t\tconst errors = outstandingPromiseErrors;\n\t\t\toutstandingPromiseErrors = {};\n\t\t\tObject.keys(errors).forEach(function (errorId) {\n\t\t\t\tconst error = errors[errorId];\n\t\t\t\tif (error.exception) {\n\t\t\t\t\tonUnexpectedError(error.exception);\n\t\t\t\t} else if (error.error) {\n\t\t\t\t\tonUnexpectedError(error.error);\n\t\t\t\t}\n\t\t\t\tconsole.log('WARNING: Promise with no error callback:' + error.id);\n\t\t\t\tconsole.log(error);\n\t\t\t\tif (error.exception) {\n\t\t\t\t\tconsole.log(error.exception.stack);\n\t\t\t\t}\n\t\t\t});\n\t\t}, 0);\n\t}\n}\nTPromise.addEventListener('error', promiseErrorHandler);\n\n// ------ END Hook up error listeners to winjs promises\n\nexport interface ErrorListenerCallback {\n\t(error: any): void;\n}\n\nexport interface ErrorListenerUnbind {\n\t(): void;\n}\n\n// Avoid circular dependency on EventEmitter by implementing a subset of the interface.\nexport class ErrorHandler {\n\tprivate unexpectedErrorHandler: (e: any) => void;\n\tprivate listeners: ErrorListenerCallback[];\n\n\tconstructor() {\n\n\t\tthis.listeners = [];\n\n\t\tthis.unexpectedErrorHandler = function (e: any) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (e.stack) {\n\t\t\t\t\tthrow new Error(e.message + '\\n\\n' + e.stack);\n\t\t\t\t}\n\n\t\t\t\tthrow e;\n\t\t\t}, 0);\n\t\t};\n\t}\n\n\tpublic addListener(listener: ErrorListenerCallback): ErrorListenerUnbind {\n\t\tthis.listeners.push(listener);\n\n\t\treturn () => {\n\t\t\tthis._removeListener(listener);\n\t\t};\n\t}\n\n\tprivate emit(e: any): void {\n\t\tthis.listeners.forEach((listener) => {\n\t\t\tlistener(e);\n\t\t});\n\t}\n\n\tprivate _removeListener(listener: ErrorListenerCallback): void {\n\t\tthis.listeners.splice(this.listeners.indexOf(listener), 1);\n\t}\n\n\tpublic setUnexpectedErrorHandler(newUnexpectedErrorHandler: (e: any) => void): void {\n\t\tthis.unexpectedErrorHandler = newUnexpectedErrorHandler;\n\t}\n\n\tpublic getUnexpectedErrorHandler(): (e: any) => void {\n\t\treturn this.unexpectedErrorHandler;\n\t}\n\n\tpublic onUnexpectedError(e: any): void {\n\t\tthis.unexpectedErrorHandler(e);\n\t\tthis.emit(e);\n\t}\n\n\t// For external errors, we don't want the listeners to be called\n\tpublic onUnexpectedExternalError(e: any): void {\n\t\tthis.unexpectedErrorHandler(e);\n\t}\n}\n\nexport const errorHandler = new ErrorHandler();\n\nexport function setUnexpectedErrorHandler(newUnexpectedErrorHandler: (e: any) => void): void {\n\terrorHandler.setUnexpectedErrorHandler(newUnexpectedErrorHandler);\n}\n\nexport function onUnexpectedError(e: any): undefined {\n\t// ignore errors from cancelled promises\n\tif (!isPromiseCanceledError(e)) {\n\t\terrorHandler.onUnexpectedError(e);\n\t}\n\treturn undefined;\n}\n\nexport function onUnexpectedExternalError(e: any): undefined {\n\t// ignore errors from cancelled promises\n\tif (!isPromiseCanceledError(e)) {\n\t\terrorHandler.onUnexpectedExternalError(e);\n\t}\n\treturn undefined;\n}\n\nexport interface SerializedError {\n\treadonly $isError: true;\n\treadonly name: string;\n\treadonly message: string;\n\treadonly stack: string;\n}\n\nexport function transformErrorForSerialization(error: Error): SerializedError;\nexport function transformErrorForSerialization(error: any): any;\nexport function transformErrorForSerialization(error: any): any {\n\tif (error instanceof Error) {\n\t\tlet { name, message } = error;\n\t\tlet stack: string = (<any>error).stacktrace || (<any>error).stack;\n\t\treturn {\n\t\t\t$isError: true,\n\t\t\tname,\n\t\t\tmessage,\n\t\t\tstack\n\t\t};\n\t}\n\n\t// return as is\n\treturn error;\n}\n\n// see https://github.com/v8/v8/wiki/Stack%20Trace%20API#basic-stack-traces\nexport interface V8CallSite {\n\tgetThis(): any;\n\tgetTypeName(): string;\n\tgetFunction(): string;\n\tgetFunctionName(): string;\n\tgetMethodName(): string;\n\tgetFileName(): string;\n\tgetLineNumber(): number;\n\tgetColumnNumber(): number;\n\tgetEvalOrigin(): string;\n\tisToplevel(): boolean;\n\tisEval(): boolean;\n\tisNative(): boolean;\n\tisConstructor(): boolean;\n\ttoString(): string;\n}\n\nconst canceledName = 'Canceled';\n\n/**\n * Checks if the given error is a promise in canceled state\n */\nexport function isPromiseCanceledError(error: any): boolean {\n\treturn error instanceof Error && error.name === canceledName && error.message === canceledName;\n}\n\n/**\n * Returns an error that signals cancellation.\n */\nexport function canceled(): Error {\n\tlet error = new Error(canceledName);\n\terror.name = error.message;\n\treturn error;\n}\n\nexport function illegalArgument(name?: string): Error {\n\tif (name) {\n\t\treturn new Error(`Illegal argument: ${name}`);\n\t} else {\n\t\treturn new Error('Illegal argument');\n\t}\n}\n\nexport function illegalState(name?: string): Error {\n\tif (name) {\n\t\treturn new Error(`Illegal state: ${name}`);\n\t} else {\n\t\treturn new Error('Illegal state');\n\t}\n}\n\nexport function readonly(name?: string): Error {\n\treturn name\n\t\t? new Error(`readonly property '${name} cannot be changed'`)\n\t\t: new Error('readonly property cannot be changed');\n}\n\nexport function disposed(what: string): Error {\n\tconst result = new Error(`${what} has been disposed`);\n\tresult.name = 'DISPOSED';\n\treturn result;\n}\n\nexport interface IErrorOptions {\n\tactions?: IAction[];\n}\n\nexport interface IErrorWithActions {\n\tactions?: IAction[];\n}\n\nexport function isErrorWithActions(obj: any): obj is IErrorWithActions {\n\treturn obj instanceof Error && Array.isArray((obj as IErrorWithActions).actions);\n}\n\nexport function create(message: string, options: IErrorOptions = Object.create(null)): Error & IErrorWithActions {\n\tconst result = new Error(message);\n\n\tif (options.actions) {\n\t\t(<IErrorWithActions>result).actions = options.actions;\n\t}\n\n\treturn result;\n}\n\nexport function getErrorMessage(err: any): string {\n\tif (!err) {\n\t\treturn 'Error';\n\t}\n\n\tif (err.message) {\n\t\treturn err.message;\n\t}\n\n\tif (err.stack) {\n\t\treturn err.stack.split('\\n')[0];\n\t}\n\n\treturn String(err);\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'use strict';\n\nimport { IDisposable, toDisposable, combinedDisposable, empty as EmptyDisposable } from 'vs/base/common/lifecycle';\nimport { TPromise } from 'vs/base/common/winjs.base';\nimport { once as onceFn } from 'vs/base/common/functional';\nimport { onUnexpectedError } from 'vs/base/common/errors';\nimport { LinkedList } from 'vs/base/common/linkedList';\n\n/**\n * To an event a function with one or zero parameters\n * can be subscribed. The event is the subscriber function itself.\n */\nexport interface Event<T> {\n\t(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable;\n}\n\nexport namespace Event {\n\tconst _disposable = { dispose() { } };\n\texport const None: Event<any> = function () { return _disposable; };\n}\n\ntype Listener = [Function, any] | Function;\n\nexport interface EmitterOptions {\n\tonFirstListenerAdd?: Function;\n\tonFirstListenerDidAdd?: Function;\n\tonListenerDidAdd?: Function;\n\tonLastListenerRemove?: Function;\n}\n\n/**\n * The Emitter can be used to expose an Event to the public\n * to fire it from the insides.\n * Sample:\n\tclass Document {\n\n\t\tprivate _onDidChange = new Emitter<(value:string)=>any>();\n\n\t\tpublic onDidChange = this._onDidChange.event;\n\n\t\t// getter-style\n\t\t// get onDidChange(): Event<(value:string)=>any> {\n\t\t// \treturn this._onDidChange.event;\n\t\t// }\n\n\t\tprivate _doIt() {\n\t\t\t//...\n\t\t\tthis._onDidChange.fire(value);\n\t\t}\n\t}\n */\nexport class Emitter<T> {\n\n\tprivate static readonly _noop = function () { };\n\n\tprivate _event: Event<T>;\n\tprivate _listeners: LinkedList<Listener>;\n\tprivate _deliveryQueue: [Listener, T][];\n\tprivate _disposed: boolean;\n\n\tconstructor(private _options?: EmitterOptions) {\n\n\t}\n\n\t/**\n\t * For the public to allow to subscribe\n\t * to events from this Emitter\n\t */\n\tget event(): Event<T> {\n\t\tif (!this._event) {\n\t\t\tthis._event = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]) => {\n\t\t\t\tif (!this._listeners) {\n\t\t\t\t\tthis._listeners = new LinkedList();\n\t\t\t\t}\n\n\t\t\t\tconst firstListener = this._listeners.isEmpty();\n\n\t\t\t\tif (firstListener && this._options && this._options.onFirstListenerAdd) {\n\t\t\t\t\tthis._options.onFirstListenerAdd(this);\n\t\t\t\t}\n\n\t\t\t\tconst remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);\n\n\t\t\t\tif (firstListener && this._options && this._options.onFirstListenerDidAdd) {\n\t\t\t\t\tthis._options.onFirstListenerDidAdd(this);\n\t\t\t\t}\n\n\t\t\t\tif (this._options && this._options.onListenerDidAdd) {\n\t\t\t\t\tthis._options.onListenerDidAdd(this, listener, thisArgs);\n\t\t\t\t}\n\n\t\t\t\tlet result: IDisposable;\n\t\t\t\tresult = {\n\t\t\t\t\tdispose: () => {\n\t\t\t\t\t\tresult.dispose = Emitter._noop;\n\t\t\t\t\t\tif (!this._disposed) {\n\t\t\t\t\t\t\tremove();\n\t\t\t\t\t\t\tif (this._options && this._options.onLastListenerRemove && this._listeners.isEmpty()) {\n\t\t\t\t\t\t\t\tthis._options.onLastListenerRemove(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tif (Array.isArray(disposables)) {\n\t\t\t\t\tdisposables.push(result);\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t\treturn this._event;\n\t}\n\n\t/**\n\t * To be kept private to fire an event to\n\t * subscribers\n\t */\n\tfire(event?: T): any {\n\t\tif (this._listeners) {\n\t\t\t// put all [listener,event]-pairs into delivery queue\n\t\t\t// then emit all event. an inner/nested event might be\n\t\t\t// the driver of this\n\n\t\t\tif (!this._deliveryQueue) {\n\t\t\t\tthis._deliveryQueue = [];\n\t\t\t}\n\n\t\t\tfor (let iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {\n\t\t\t\tthis._deliveryQueue.push([e.value, event]);\n\t\t\t}\n\n\t\t\twhile (this._deliveryQueue.length > 0) {\n\t\t\t\tconst [listener, event] = this._deliveryQueue.shift();\n\t\t\t\ttry {\n\t\t\t\t\tif (typeof listener === 'function') {\n\t\t\t\t\t\tlistener.call(undefined, event);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlistener[0].call(listener[1], event);\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\tonUnexpectedError(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose() {\n\t\tif (this._listeners) {\n\t\t\tthis._listeners = undefined;\n\t\t}\n\t\tif (this._deliveryQueue) {\n\t\t\tthis._deliveryQueue.length = 0;\n\t\t}\n\t\tthis._disposed = true;\n\t}\n}\n\nexport class EventMultiplexer<T> implements IDisposable {\n\n\tprivate readonly emitter: Emitter<T>;\n\tprivate hasListeners = false;\n\tprivate events: { event: Event<T>; listener: IDisposable; }[] = [];\n\n\tconstructor() {\n\t\tthis.emitter = new Emitter<T>({\n\t\t\tonFirstListenerAdd: () => this.onFirstListenerAdd(),\n\t\t\tonLastListenerRemove: () => this.onLastListenerRemove()\n\t\t});\n\t}\n\n\tget event(): Event<T> {\n\t\treturn this.emitter.event;\n\t}\n\n\tadd(event: Event<T>): IDisposable {\n\t\tconst e = { event: event, listener: null };\n\t\tthis.events.push(e);\n\n\t\tif (this.hasListeners) {\n\t\t\tthis.hook(e);\n\t\t}\n\n\t\tconst dispose = () => {\n\t\t\tif (this.hasListeners) {\n\t\t\t\tthis.unhook(e);\n\t\t\t}\n\n\t\t\tconst idx = this.events.indexOf(e);\n\t\t\tthis.events.splice(idx, 1);\n\t\t};\n\n\t\treturn toDisposable(onceFn(dispose));\n\t}\n\n\tprivate onFirstListenerAdd(): void {\n\t\tthis.hasListeners = true;\n\t\tthis.events.forEach(e => this.hook(e));\n\t}\n\n\tprivate onLastListenerRemove(): void {\n\t\tthis.hasListeners = false;\n\t\tthis.events.forEach(e => this.unhook(e));\n\t}\n\n\tprivate hook(e: { event: Event<T>; listener: IDisposable; }): void {\n\t\te.listener = e.event(r => this.emitter.fire(r));\n\t}\n\n\tprivate unhook(e: { event: Event<T>; listener: IDisposable; }): void {\n\t\te.listener.dispose();\n\t\te.listener = null;\n\t}\n\n\tdispose(): void {\n\t\tthis.emitter.dispose();\n\t}\n}\n\nexport function fromCallback<T>(fn: (handler: (e: T) => void) => IDisposable): Event<T> {\n\tlet listener: IDisposable;\n\n\tconst emitter = new Emitter<T>({\n\t\tonFirstListenerAdd: () => listener = fn(e => emitter.fire(e)),\n\t\tonLastListenerRemove: () => listener.dispose()\n\t});\n\n\treturn emitter.event;\n}\n\nexport function fromPromise<T =any>(promise: TPromise<T>): Event<T> {\n\tconst emitter = new Emitter<T>();\n\tlet shouldEmit = false;\n\n\tpromise\n\t\t.then(null, () => null)\n\t\t.then(() => {\n\t\t\tif (!shouldEmit) {\n\t\t\t\tsetTimeout(() => emitter.fire(), 0);\n\t\t\t} else {\n\t\t\t\temitter.fire();\n\t\t\t}\n\t\t});\n\n\tshouldEmit = true;\n\treturn emitter.event;\n}\n\nexport function toPromise<T>(event: Event<T>): TPromise<T> {\n\treturn new TPromise(complete => {\n\t\tconst sub = event(e => {\n\t\t\tsub.dispose();\n\t\t\tcomplete(e);\n\t\t});\n\t});\n}\n\nexport function once<T>(event: Event<T>): Event<T> {\n\treturn (listener, thisArgs = null, disposables?) => {\n\t\tconst result = event(e => {\n\t\t\tresult.dispose();\n\t\t\treturn listener.call(thisArgs, e);\n\t\t}, null, disposables);\n\n\t\treturn result;\n\t};\n}\n\nexport function anyEvent<T>(...events: Event<T>[]): Event<T> {\n\treturn (listener, thisArgs = null, disposables?) => combinedDisposable(events.map(event => event(e => listener.call(thisArgs, e), null, disposables)));\n}\n\nexport function debounceEvent<T>(event: Event<T>, merger: (last: T, event: T) => T, delay?: number, leading?: boolean): Event<T>;\nexport function debounceEvent<I, O>(event: Event<I>, merger: (last: O, event: I) => O, delay?: number, leading?: boolean): Event<O>;\nexport function debounceEvent<I, O>(event: Event<I>, merger: (last: O, event: I) => O, delay: number = 100, leading = false): Event<O> {\n\n\tlet subscription: IDisposable;\n\tlet output: O = undefined;\n\tlet handle: any = undefined;\n\tlet numDebouncedCalls = 0;\n\n\tconst emitter = new Emitter<O>({\n\t\tonFirstListenerAdd() {\n\t\t\tsubscription = event(cur => {\n\t\t\t\tnumDebouncedCalls++;\n\t\t\t\toutput = merger(output, cur);\n\n\t\t\t\tif (leading && !handle) {\n\t\t\t\t\temitter.fire(output);\n\t\t\t\t}\n\n\t\t\t\tclearTimeout(handle);\n\t\t\t\thandle = setTimeout(() => {\n\t\t\t\t\tlet _output = output;\n\t\t\t\t\toutput = undefined;\n\t\t\t\t\thandle = undefined;\n\t\t\t\t\tif (!leading || numDebouncedCalls > 1) {\n\t\t\t\t\t\temitter.fire(_output);\n\t\t\t\t\t}\n\n\t\t\t\t\tnumDebouncedCalls = 0;\n\t\t\t\t}, delay);\n\t\t\t});\n\t\t},\n\t\tonLastListenerRemove() {\n\t\t\tsubscription.dispose();\n\t\t}\n\t});\n\n\treturn emitter.event;\n}\n\n/**\n * The EventDelayer is useful in situations in which you want\n * to delay firing your events during some code.\n * You can wrap that code and be sure that the event will not\n * be fired during that wrap.\n *\n * ```\n * const emitter: Emitter;\n * const delayer = new EventDelayer();\n * const delayedEvent = delayer.wrapEvent(emitter.event);\n *\n * delayedEvent(console.log);\n *\n * delayer.bufferEvents(() => {\n * emitter.fire(); // event will not be fired yet\n * });\n *\n * // event will only be fired at this point\n * ```\n */\nexport class EventBufferer {\n\n\tprivate buffers: Function[][] = [];\n\n\twrapEvent<T>(event: Event<T>): Event<T> {\n\t\treturn (listener, thisArgs?, disposables?) => {\n\t\t\treturn event(i => {\n\t\t\t\tconst buffer = this.buffers[this.buffers.length - 1];\n\n\t\t\t\tif (buffer) {\n\t\t\t\t\tbuffer.push(() => listener.call(thisArgs, i));\n\t\t\t\t} else {\n\t\t\t\t\tlistener.call(thisArgs, i);\n\t\t\t\t}\n\t\t\t}, void 0, disposables);\n\t\t};\n\t}\n\n\tbufferEvents(fn: () => void): void {\n\t\tconst buffer: Function[] = [];\n\t\tthis.buffers.push(buffer);\n\t\tfn();\n\t\tthis.buffers.pop();\n\t\tbuffer.forEach(flush => flush());\n\t}\n}\n\nexport interface IChainableEvent<T> {\n\tevent: Event<T>;\n\tmap<O>(fn: (i: T) => O): IChainableEvent<O>;\n\tforEach(fn: (i: T) => void): IChainableEvent<T>;\n\tfilter(fn: (e: T) => boolean): IChainableEvent<T>;\n\tlatch(): IChainableEvent<T>;\n\ton(listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable;\n}\n\nexport function mapEvent<I, O>(event: Event<I>, map: (i: I) => O): Event<O> {\n\treturn (listener, thisArgs = null, disposables?) => event(i => listener.call(thisArgs, map(i)), null, disposables);\n}\n\nexport function forEach<I>(event: Event<I>, each: (i: I) => void): Event<I> {\n\treturn (listener, thisArgs = null, disposables?) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables);\n}\n\nexport function filterEvent<T>(event: Event<T>, filter: (e: T) => boolean): Event<T> {\n\treturn (listener, thisArgs = null, disposables?) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables);\n}\n\nclass ChainableEvent<T> implements IChainableEvent<T> {\n\n\tget event(): Event<T> { return this._event; }\n\n\tconstructor(private _event: Event<T>) { }\n\n\tmap<O>(fn: (i: T) => O): IChainableEvent<O> {\n\t\treturn new ChainableEvent(mapEvent(this._event, fn));\n\t}\n\n\tforEach(fn: (i: T) => void): IChainableEvent<T> {\n\t\treturn new ChainableEvent(forEach(this._event, fn));\n\t}\n\n\tfilter(fn: (e: T) => boolean): IChainableEvent<T> {\n\t\treturn new ChainableEvent(filterEvent(this._event, fn));\n\t}\n\n\tlatch(): IChainableEvent<T> {\n\t\treturn new ChainableEvent(latch(this._event));\n\t}\n\n\ton(listener: (e: T) => any, thisArgs: any, disposables: IDisposable[]) {\n\t\treturn this._event(listener, thisArgs, disposables);\n\t}\n}\n\nexport function chain<T>(event: Event<T>): IChainableEvent<T> {\n\treturn new ChainableEvent(event);\n}\n\nexport function stopwatch<T>(event: Event<T>): Event<number> {\n\tconst start = new Date().getTime();\n\treturn mapEvent(once(event), _ => new Date().getTime() - start);\n}\n\n/**\n * Buffers the provided event until a first listener comes\n * along, at which point fire all the events at once and\n * pipe the event from then on.\n *\n * ```typescript\n * const emitter = new Emitter<number>();\n * const event = emitter.event;\n * const bufferedEvent = buffer(event);\n *\n * emitter.fire(1);\n * emitter.fire(2);\n * emitter.fire(3);\n * // nothing...\n *\n * const listener = bufferedEvent(num => console.log(num));\n * // 1, 2, 3\n *\n * emitter.fire(4);\n * // 4\n * ```\n */\nexport function buffer<T>(event: Event<T>, nextTick = false, buffer: T[] = []): Event<T> {\n\tbuffer = buffer.slice();\n\n\tlet listener = event(e => {\n\t\tif (buffer) {\n\t\t\tbuffer.push(e);\n\t\t} else {\n\t\t\temitter.fire(e);\n\t\t}\n\t});\n\n\tconst flush = () => {\n\t\tbuffer.forEach(e => emitter.fire(e));\n\t\tbuffer = null;\n\t};\n\n\tconst emitter = new Emitter<T>({\n\t\tonFirstListenerAdd() {\n\t\t\tif (!listener) {\n\t\t\t\tlistener = event(e => emitter.fire(e));\n\t\t\t}\n\t\t},\n\n\t\tonFirstListenerDidAdd() {\n\t\t\tif (buffer) {\n\t\t\t\tif (nextTick) {\n\t\t\t\t\tsetTimeout(flush);\n\t\t\t\t} else {\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tonLastListenerRemove() {\n\t\t\tlistener.dispose();\n\t\t\tlistener = null;\n\t\t}\n\t});\n\n\treturn emitter.event;\n}\n\n/**\n * Similar to `buffer` but it buffers indefinitely and repeats\n * the buffered events to every new listener.\n */\nexport function echo<T>(event: Event<T>, nextTick = false, buffer: T[] = []): Event<T> {\n\tbuffer = buffer.slice();\n\n\tevent(e => {\n\t\tbuffer.push(e);\n\t\temitter.fire(e);\n\t});\n\n\tconst flush = (listener: (e: T) => any, thisArgs?: any) => buffer.forEach(e => listener.call(thisArgs, e));\n\n\tconst emitter = new Emitter<T>({\n\t\tonListenerDidAdd(emitter, listener: (e: T) => any, thisArgs?: any) {\n\t\t\tif (nextTick) {\n\t\t\t\tsetTimeout(() => flush(listener, thisArgs));\n\t\t\t} else {\n\t\t\t\tflush(listener, thisArgs);\n\t\t\t}\n\t\t}\n\t});\n\n\treturn emitter.event;\n}\n\nexport class Relay<T> implements IDisposable {\n\n\tprivate emitter = new Emitter<T>();\n\treadonly event: Event<T> = this.emitter.event;\n\n\tprivate disposable: IDisposable = EmptyDisposable;\n\n\tset input(event: Event<T>) {\n\t\tthis.disposable.dispose();\n\t\tthis.disposable = event(this.emitter.fire, this.emitter);\n\t}\n\n\tdispose() {\n\t\tthis.disposable.dispose();\n\t\tthis.emitter.dispose();\n\t}\n}\n\nexport interface NodeEventEmitter {\n\ton(event: string | symbol, listener: Function): this;\n\tremoveListener(event: string | symbol, listener: Function): this;\n}\n\nexport function fromNodeEventEmitter<T>(emitter: NodeEventEmitter, eventName: string, map: (...args: any[]) => T = id => id): Event<T> {\n\tconst fn = (...args: any[]) => result.fire(map(...args));\n\tconst onFirstListenerAdd = () => emitter.on(eventName, fn);\n\tconst onLastListenerRemove = () => emitter.removeListener(eventName, fn);\n\tconst result = new Emitter<T>({ onFirstListenerAdd, onLastListenerRemove });\n\n\treturn result.event;\n}\n\nexport function latch<T>(event: Event<T>): Event<T> {\n\tlet firstCall = true;\n\tlet cache: T;\n\n\treturn filterEvent(event, value => {\n\t\tlet shouldEmit = firstCall || value !== cache;\n\t\tfirstCall = false;\n\t\tcache = value;\n\t\treturn shouldEmit;\n\t});\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\n'use strict';\n\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { IDisposable } from 'vs/base/common/lifecycle';\n\nexport interface CancellationToken {\n\treadonly isCancellationRequested: boolean;\n\t/**\n\t * An event emitted when cancellation is requested\n\t * @event\n\t */\n\treadonly onCancellationRequested: Event<any>;\n}\n\nconst shortcutEvent = Object.freeze(function (callback, context?): IDisposable {\n\tlet handle = setTimeout(callback.bind(context), 0);\n\treturn { dispose() { clearTimeout(handle); } };\n} as Event<any>);\n\nexport namespace CancellationToken {\n\n\texport const None: CancellationToken = Object.freeze({\n\t\tisCancellationRequested: false,\n\t\tonCancellationRequested: Event.None\n\t});\n\n\texport const Cancelled: CancellationToken = Object.freeze({\n\t\tisCancellationRequested: true,\n\t\tonCancellationRequested: shortcutEvent\n\t});\n}\n\nclass MutableToken implements CancellationToken {\n\n\tprivate _isCancelled: boolean = false;\n\tprivate _emitter: Emitter<any>;\n\n\tpublic cancel() {\n\t\tif (!this._isCancelled) {\n\t\t\tthis._isCancelled = true;\n\t\t\tif (this._emitter) {\n\t\t\t\tthis._emitter.fire(undefined);\n\t\t\t\tthis.dispose();\n\t\t\t}\n\t\t}\n\t}\n\n\tget isCancellationRequested(): boolean {\n\t\treturn this._isCancelled;\n\t}\n\n\tget onCancellationRequested(): Event<any> {\n\t\tif (this._isCancelled) {\n\t\t\treturn shortcutEvent;\n\t\t}\n\t\tif (!this._emitter) {\n\t\t\tthis._emitter = new Emitter<any>();\n\t\t}\n\t\treturn this._emitter.event;\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._emitter) {\n\t\t\tthis._emitter.dispose();\n\t\t\tthis._emitter = undefined;\n\t\t}\n\t}\n}\n\nexport class CancellationTokenSource {\n\n\tprivate _token: CancellationToken;\n\n\tget token(): CancellationToken {\n\t\tif (!this._token) {\n\t\t\t// be lazy and create the token only when\n\t\t\t// actually needed\n\t\t\tthis._token = new MutableToken();\n\t\t}\n\t\treturn this._token;\n\t}\n\n\tcancel(): void {\n\t\tif (!this._token) {\n\t\t\t// save an object by returning the default\n\t\t\t// cancelled token when cancellation happens\n\t\t\t// before someone asks for the token\n\t\t\tthis._token = CancellationToken.Cancelled;\n\n\t\t} else if (this._token instanceof MutableToken) {\n\t\t\t// actually cancel\n\t\t\tthis._token.cancel();\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tif (!this._token) {\n\t\t\t// ensure to initialize with an empty token if we had none\n\t\t\tthis._token = CancellationToken.None;\n\n\t\t} else if (this._token instanceof MutableToken) {\n\t\t\t// actually dispose\n\t\t\tthis._token.dispose();\n\t\t}\n\t}\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\n'use strict';\n\nimport * as errors from 'vs/base/common/errors';\nimport { Promise, TPromise, ValueCallback, ErrorCallback, ProgressCallback } from 'vs/base/common/winjs.base';\nimport { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { Disposable, IDisposable } from 'vs/base/common/lifecycle';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport URI from 'vs/base/common/uri';\n\nexport function isThenable<T>(obj: any): obj is Thenable<T> {\n\treturn obj && typeof (<Thenable<any>>obj).then === 'function';\n}\n\nexport function toThenable<T>(arg: T | Thenable<T>): Thenable<T> {\n\tif (isThenable(arg)) {\n\t\treturn arg;\n\t} else {\n\t\treturn TPromise.as(arg);\n\t}\n}\n\nexport function asWinJsPromise<T>(callback: (token: CancellationToken) => T | TPromise<T> | Thenable<T>): TPromise<T> {\n\tlet source = new CancellationTokenSource();\n\treturn new TPromise<T>((resolve, reject, progress) => {\n\t\tlet item = callback(source.token);\n\t\tif (item instanceof TPromise) {\n\t\t\titem.then(result => {\n\t\t\t\tsource.dispose();\n\t\t\t\tresolve(result);\n\t\t\t}, err => {\n\t\t\t\tsource.dispose();\n\t\t\t\treject(err);\n\t\t\t}, progress);\n\t\t} else if (isThenable<T>(item)) {\n\t\t\titem.then(result => {\n\t\t\t\tsource.dispose();\n\t\t\t\tresolve(result);\n\t\t\t}, err => {\n\t\t\t\tsource.dispose();\n\t\t\t\treject(err);\n\t\t\t});\n\t\t} else {\n\t\t\tsource.dispose();\n\t\t\tresolve(item);\n\t\t}\n\t}, () => {\n\t\tsource.cancel();\n\t});\n}\n\n/**\n * Hook a cancellation token to a WinJS Promise\n */\nexport function wireCancellationToken<T>(token: CancellationToken, promise: TPromise<T>, resolveAsUndefinedWhenCancelled?: boolean): Thenable<T> {\n\tconst subscription = token.onCancellationRequested(() => promise.cancel());\n\tif (resolveAsUndefinedWhenCancelled) {\n\t\tpromise = promise.then<T>(undefined, err => {\n\t\t\tif (!errors.isPromiseCanceledError(err)) {\n\t\t\t\treturn TPromise.wrapError(err);\n\t\t\t}\n\t\t\treturn undefined;\n\t\t});\n\t}\n\treturn always(promise, () => subscription.dispose());\n}\n\nexport interface ITask<T> {\n\t(): T;\n}\n\n/**\n * A helper to prevent accumulation of sequential async tasks.\n *\n * Imagine a mail man with the sole task of delivering letters. As soon as\n * a letter submitted for delivery, he drives to the destination, delivers it\n * and returns to his base. Imagine that during the trip, N more letters were submitted.\n * When the mail man returns, he picks those N letters and delivers them all in a\n * single trip. Even though N+1 submissions occurred, only 2 deliveries were made.\n *\n * The throttler implements this via the queue() method, by providing it a task\n * factory. Following the example:\n *\n * \t\tconst throttler = new Throttler();\n * \t\tconst letters = [];\n *\n * \t\tfunction deliver() {\n * \t\t\tconst lettersToDeliver = letters;\n * \t\t\tletters = [];\n * \t\t\treturn makeTheTrip(lettersToDeliver);\n * \t\t}\n *\n * \t\tfunction onLetterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tthrottler.queue(deliver);\n * \t\t}\n */\nexport class Throttler {\n\n\tprivate activePromise: Promise;\n\tprivate queuedPromise: Promise;\n\tprivate queuedPromiseFactory: ITask<Promise>;\n\n\tconstructor() {\n\t\tthis.activePromise = null;\n\t\tthis.queuedPromise = null;\n\t\tthis.queuedPromiseFactory = null;\n\t}\n\n\tqueue<T>(promiseFactory: ITask<TPromise<T>>): TPromise<T> {\n\t\tif (this.activePromise) {\n\t\t\tthis.queuedPromiseFactory = promiseFactory;\n\n\t\t\tif (!this.queuedPromise) {\n\t\t\t\tconst onComplete = () => {\n\t\t\t\t\tthis.queuedPromise = null;\n\n\t\t\t\t\tconst result = this.queue(this.queuedPromiseFactory);\n\t\t\t\t\tthis.queuedPromiseFactory = null;\n\n\t\t\t\t\treturn result;\n\t\t\t\t};\n\n\t\t\t\tthis.queuedPromise = new TPromise((c, e, p) => {\n\t\t\t\t\tthis.activePromise.then(onComplete, onComplete, p).done(c);\n\t\t\t\t}, () => {\n\t\t\t\t\tthis.activePromise.cancel();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn new TPromise((c, e, p) => {\n\t\t\t\tthis.queuedPromise.then(c, e, p);\n\t\t\t}, () => {\n\t\t\t\t// no-op\n\t\t\t});\n\t\t}\n\n\t\tthis.activePromise = promiseFactory();\n\n\t\treturn new TPromise((c, e, p) => {\n\t\t\tthis.activePromise.done((result: any) => {\n\t\t\t\tthis.activePromise = null;\n\t\t\t\tc(result);\n\t\t\t}, (err: any) => {\n\t\t\t\tthis.activePromise = null;\n\t\t\t\te(err);\n\t\t\t}, p);\n\t\t}, () => {\n\t\t\tthis.activePromise.cancel();\n\t\t});\n\t}\n}\n\n// TODO@Joao: can the previous throttler be replaced with this?\nexport class SimpleThrottler {\n\n\tprivate current = TPromise.wrap<any>(null);\n\n\tqueue<T>(promiseTask: ITask<TPromise<T>>): TPromise<T> {\n\t\treturn this.current = this.current.then(() => promiseTask());\n\t}\n}\n\n/**\n * A helper to delay execution of a task that is being requested often.\n *\n * Following the throttler, now imagine the mail man wants to optimize the number of\n * trips proactively. The trip itself can be long, so the he decides not to make the trip\n * as soon as a letter is submitted. Instead he waits a while, in case more\n * letters are submitted. After said waiting period, if no letters were submitted, he\n * decides to make the trip. Imagine that N more letters were submitted after the first\n * one, all within a short period of time between each other. Even though N+1\n * submissions occurred, only 1 delivery was made.\n *\n * The delayer offers this behavior via the trigger() method, into which both the task\n * to be executed and the waiting period (delay) must be passed in as arguments. Following\n * the example:\n *\n * \t\tconst delayer = new Delayer(WAITING_PERIOD);\n * \t\tconst letters = [];\n *\n * \t\tfunction letterReceived(l) {\n * \t\t\tletters.push(l);\n * \t\t\tdelayer.trigger(() => { return makeTheTrip(); });\n * \t\t}\n */\nexport class Delayer<T> {\n\n\tprivate timeout: number;\n\tprivate completionPromise: Promise;\n\tprivate onSuccess: ValueCallback;\n\tprivate task: ITask<T | TPromise<T>>;\n\n\tconstructor(public defaultDelay: number) {\n\t\tthis.timeout = null;\n\t\tthis.completionPromise = null;\n\t\tthis.onSuccess = null;\n\t\tthis.task = null;\n\t}\n\n\ttrigger(task: ITask<T | TPromise<T>>, delay: number = this.defaultDelay): TPromise<T> {\n\t\tthis.task = task;\n\t\tthis.cancelTimeout();\n\n\t\tif (!this.completionPromise) {\n\t\t\tthis.completionPromise = new TPromise((c) => {\n\t\t\t\tthis.onSuccess = c;\n\t\t\t}, () => {\n\t\t\t\t// no-op\n\t\t\t}).then(() => {\n\t\t\t\tthis.completionPromise = null;\n\t\t\t\tthis.onSuccess = null;\n\t\t\t\tconst task = this.task;\n\t\t\t\tthis.task = null;\n\n\t\t\t\treturn task();\n\t\t\t});\n\t\t}\n\n\t\tthis.timeout = setTimeout(() => {\n\t\t\tthis.timeout = null;\n\t\t\tthis.onSuccess(null);\n\t\t}, delay);\n\n\t\treturn this.completionPromise;\n\t}\n\n\tisTriggered(): boolean {\n\t\treturn this.timeout !== null;\n\t}\n\n\tcancel(): void {\n\t\tthis.cancelTimeout();\n\n\t\tif (this.completionPromise) {\n\t\t\tthis.completionPromise.cancel();\n\t\t\tthis.completionPromise = null;\n\t\t}\n\t}\n\n\tprivate cancelTimeout(): void {\n\t\tif (this.timeout !== null) {\n\t\t\tclearTimeout(this.timeout);\n\t\t\tthis.timeout = null;\n\t\t}\n\t}\n}\n\n/**\n * A helper to delay execution of a task that is being requested often, while\n * preventing accumulation of consecutive executions, while the task runs.\n *\n * Simply combine the two mail man strategies from the Throttler and Delayer\n * helpers, for an analogy.\n */\nexport class ThrottledDelayer<T> extends Delayer<TPromise<T>> {\n\n\tprivate throttler: Throttler;\n\n\tconstructor(defaultDelay: number) {\n\t\tsuper(defaultDelay);\n\n\t\tthis.throttler = new Throttler();\n\t}\n\n\ttrigger(promiseFactory: ITask<TPromise<T>>, delay?: number): TPromise {\n\t\treturn super.trigger(() => this.throttler.queue(promiseFactory), delay);\n\t}\n}\n\n/**\n * A barrier that is initially closed and then becomes opened permanently.\n */\nexport class Barrier {\n\n\tprivate _isOpen: boolean;\n\tprivate _promise: TPromise<boolean>;\n\tprivate _completePromise: (v: boolean) => void;\n\n\tconstructor() {\n\t\tthis._isOpen = false;\n\t\tthis._promise = new TPromise<boolean>((c, e, p) => {\n\t\t\tthis._completePromise = c;\n\t\t}, () => {\n\t\t\tconsole.warn('You should really not try to cancel this ready promise!');\n\t\t});\n\t}\n\n\tisOpen(): boolean {\n\t\treturn this._isOpen;\n\t}\n\n\topen(): void {\n\t\tthis._isOpen = true;\n\t\tthis._completePromise(true);\n\t}\n\n\twait(): TPromise<boolean> {\n\t\treturn this._promise;\n\t}\n}\n\nexport class ShallowCancelThenPromise<T> extends TPromise<T> {\n\n\tconstructor(outer: TPromise<T>) {\n\n\t\tlet completeCallback: ValueCallback,\n\t\t\terrorCallback: ErrorCallback,\n\t\t\tprogressCallback: ProgressCallback;\n\n\t\tsuper((c, e, p) => {\n\t\t\tcompleteCallback = c;\n\t\t\terrorCallback = e;\n\t\t\tprogressCallback = p;\n\t\t}, () => {\n\t\t\t// cancel this promise but not the\n\t\t\t// outer promise\n\t\t\terrorCallback(errors.canceled());\n\t\t});\n\n\t\touter.then(completeCallback, errorCallback, progressCallback);\n\t}\n}\n\n/**\n * Replacement for `WinJS.Promise.timeout`.\n */\nexport function timeout(n: number): Promise<void> {\n\treturn new Promise(resolve => setTimeout(resolve, n));\n}\n\nfunction isWinJSPromise(candidate: any): candidate is TPromise {\n\treturn TPromise.is(candidate) && typeof (<TPromise>candidate).done === 'function';\n}\n\n/**\n * Returns a new promise that joins the provided promise. Upon completion of\n * the provided promise the provided function will always be called. This\n * method is comparable to a try-finally code block.\n * @param promise a promise\n * @param f a function that will be call in the success and error case.\n */\nexport function always<T>(thenable: TPromise<T>, f: Function): TPromise<T>;\nexport function always<T>(promise: Thenable<T>, f: Function): Thenable<T>;\nexport function always<T>(winjsPromiseOrThenable: Thenable<T> | TPromise<T>, f: Function): TPromise<T> | Thenable<T> {\n\tif (isWinJSPromise(winjsPromiseOrThenable)) {\n\t\treturn new TPromise<T>((c, e, p) => {\n\t\t\twinjsPromiseOrThenable.done((result) => {\n\t\t\t\ttry {\n\t\t\t\t\tf(result);\n\t\t\t\t} catch (e1) {\n\t\t\t\t\terrors.onUnexpectedError(e1);\n\t\t\t\t}\n\t\t\t\tc(result);\n\t\t\t}, (err) => {\n\t\t\t\ttry {\n\t\t\t\t\tf(err);\n\t\t\t\t} catch (e1) {\n\t\t\t\t\terrors.onUnexpectedError(e1);\n\t\t\t\t}\n\t\t\t\te(err);\n\t\t\t}, (progress) => {\n\t\t\t\tp(progress);\n\t\t\t});\n\t\t}, () => {\n\t\t\twinjsPromiseOrThenable.cancel();\n\t\t});\n\n\t} else {\n\t\t// simple\n\t\twinjsPromiseOrThenable.then(_ => f(), _ => f());\n\t\treturn winjsPromiseOrThenable;\n\t}\n}\n\n/**\n * Runs the provided list of promise factories in sequential order. The returned\n * promise will complete to an array of results from each promise.\n */\n\nexport function sequence<T>(promiseFactories: ITask<Thenable<T>>[]): TPromise<T[]> {\n\tconst results: T[] = [];\n\n\t// reverse since we start with last element using pop()\n\tpromiseFactories = promiseFactories.reverse();\n\n\tfunction next(): Thenable<any> {\n\t\tif (promiseFactories.length) {\n\t\t\treturn promiseFactories.pop()();\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tfunction thenHandler(result: any): Thenable<any> {\n\t\tif (result !== undefined && result !== null) {\n\t\t\tresults.push(result);\n\t\t}\n\n\t\tconst n = next();\n\t\tif (n) {\n\t\t\treturn n.then(thenHandler);\n\t\t}\n\n\t\treturn TPromise.as(results);\n\t}\n\n\treturn TPromise.as(null).then(thenHandler);\n}\n\nexport function first<T>(promiseFactories: ITask<TPromise<T>>[], shouldStop: (t: T) => boolean = t => !!t): TPromise<T> {\n\tpromiseFactories = [...promiseFactories.reverse()];\n\n\tconst loop: () => TPromise<T> = () => {\n\t\tif (promiseFactories.length === 0) {\n\t\t\treturn TPromise.as(null);\n\t\t}\n\n\t\tconst factory = promiseFactories.pop();\n\t\tconst promise = factory();\n\n\t\treturn promise.then(result => {\n\t\t\tif (shouldStop(result)) {\n\t\t\t\treturn TPromise.as(result);\n\t\t\t}\n\n\t\t\treturn loop();\n\t\t});\n\t};\n\n\treturn loop();\n}\n\ninterface ILimitedTaskFactory {\n\tfactory: ITask<Promise>;\n\tc: ValueCallback;\n\te: ErrorCallback;\n\tp: ProgressCallback;\n}\n\n/**\n * A helper to queue N promises and run them all with a max degree of parallelism. The helper\n * ensures that at any time no more than M promises are running at the same time.\n */\nexport class Limiter<T> {\n\tprivate runningPromises: number;\n\tprivate maxDegreeOfParalellism: number;\n\tprivate outstandingPromises: ILimitedTaskFactory[];\n\tprivate readonly _onFinished: Emitter<void>;\n\n\tconstructor(maxDegreeOfParalellism: number) {\n\t\tthis.maxDegreeOfParalellism = maxDegreeOfParalellism;\n\t\tthis.outstandingPromises = [];\n\t\tthis.runningPromises = 0;\n\t\tthis._onFinished = new Emitter<void>();\n\t}\n\n\tpublic get onFinished(): Event<void> {\n\t\treturn this._onFinished.event;\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.runningPromises + this.outstandingPromises.length;\n\t}\n\n\tqueue(promiseFactory: ITask<Promise>): Promise;\n\tqueue(promiseFactory: ITask<TPromise<T>>): TPromise<T> {\n\t\treturn new TPromise<T>((c, e, p) => {\n\t\t\tthis.outstandingPromises.push({\n\t\t\t\tfactory: promiseFactory,\n\t\t\t\tc: c,\n\t\t\t\te: e,\n\t\t\t\tp: p\n\t\t\t});\n\n\t\t\tthis.consume();\n\t\t});\n\t}\n\n\tprivate consume(): void {\n\t\twhile (this.outstandingPromises.length && this.runningPromises < this.maxDegreeOfParalellism) {\n\t\t\tconst iLimitedTask = this.outstandingPromises.shift();\n\t\t\tthis.runningPromises++;\n\n\t\t\tconst promise = iLimitedTask.factory();\n\t\t\tpromise.done(iLimitedTask.c, iLimitedTask.e, iLimitedTask.p);\n\t\t\tpromise.done(() => this.consumed(), () => this.consumed());\n\t\t}\n\t}\n\n\tprivate consumed(): void {\n\t\tthis.runningPromises--;\n\n\t\tif (this.outstandingPromises.length > 0) {\n\t\t\tthis.consume();\n\t\t} else {\n\t\t\tthis._onFinished.fire();\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._onFinished.dispose();\n\t}\n}\n\n/**\n * A queue is handles one promise at a time and guarantees that at any time only one promise is executing.\n */\nexport class Queue<T> extends Limiter<T> {\n\n\tconstructor() {\n\t\tsuper(1);\n\t}\n}\n\n/**\n * A helper to organize queues per resource. The ResourceQueue makes sure to manage queues per resource\n * by disposing them once the queue is empty.\n */\nexport class ResourceQueue {\n\tprivate queues: { [path: string]: Queue<void> };\n\n\tconstructor() {\n\t\tthis.queues = Object.create(null);\n\t}\n\n\tpublic queueFor(resource: URI): Queue<void> {\n\t\tconst key = resource.toString();\n\t\tif (!this.queues[key]) {\n\t\t\tconst queue = new Queue<void>();\n\t\t\tqueue.onFinished(() => {\n\t\t\t\tqueue.dispose();\n\t\t\t\tdelete this.queues[key];\n\t\t\t});\n\n\t\t\tthis.queues[key] = queue;\n\t\t}\n\n\t\treturn this.queues[key];\n\t}\n}\n\nexport function setDisposableTimeout(handler: Function, timeout: number, ...args: any[]): IDisposable {\n\tconst handle = setTimeout(handler, timeout, ...args);\n\treturn { dispose() { clearTimeout(handle); } };\n}\n\nexport class TimeoutTimer extends Disposable {\n\tprivate _token: number;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._token = -1;\n\t}\n\n\tdispose(): void {\n\t\tthis.cancel();\n\t\tsuper.dispose();\n\t}\n\n\tcancel(): void {\n\t\tif (this._token !== -1) {\n\t\t\tclearTimeout(this._token);\n\t\t\tthis._token = -1;\n\t\t}\n\t}\n\n\tcancelAndSet(runner: () => void, timeout: number): void {\n\t\tthis.cancel();\n\t\tthis._token = setTimeout(() => {\n\t\t\tthis._token = -1;\n\t\t\trunner();\n\t\t}, timeout);\n\t}\n\n\tsetIfNotSet(runner: () => void, timeout: number): void {\n\t\tif (this._token !== -1) {\n\t\t\t// timer is already set\n\t\t\treturn;\n\t\t}\n\t\tthis._token = setTimeout(() => {\n\t\t\tthis._token = -1;\n\t\t\trunner();\n\t\t}, timeout);\n\t}\n}\n\nexport class IntervalTimer extends Disposable {\n\n\tprivate _token: number;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._token = -1;\n\t}\n\n\tdispose(): void {\n\t\tthis.cancel();\n\t\tsuper.dispose();\n\t}\n\n\tcancel(): void {\n\t\tif (this._token !== -1) {\n\t\t\tclearInterval(this._token);\n\t\t\tthis._token = -1;\n\t\t}\n\t}\n\n\tcancelAndSet(runner: () => void, interval: number): void {\n\t\tthis.cancel();\n\t\tthis._token = setInterval(() => {\n\t\t\trunner();\n\t\t}, interval);\n\t}\n}\n\nexport class RunOnceScheduler {\n\n\tprivate timeoutToken: number;\n\tprivate runner: () => void;\n\tprivate timeout: number;\n\tprivate timeoutHandler: () => void;\n\n\tconstructor(runner: () => void, timeout: number) {\n\t\tthis.timeoutToken = -1;\n\t\tthis.runner = runner;\n\t\tthis.timeout = timeout;\n\t\tthis.timeoutHandler = this.onTimeout.bind(this);\n\t}\n\n\t/**\n\t * Dispose RunOnceScheduler\n\t */\n\tdispose(): void {\n\t\tthis.cancel();\n\t\tthis.runner = null;\n\t}\n\n\t/**\n\t * Cancel current scheduled runner (if any).\n\t */\n\tcancel(): void {\n\t\tif (this.isScheduled()) {\n\t\t\tclearTimeout(this.timeoutToken);\n\t\t\tthis.timeoutToken = -1;\n\t\t}\n\t}\n\n\t/**\n\t * Cancel previous runner (if any) & schedule a new runner.\n\t */\n\tschedule(delay = this.timeout): void {\n\t\tthis.cancel();\n\t\tthis.timeoutToken = setTimeout(this.timeoutHandler, delay);\n\t}\n\n\t/**\n\t * Returns true if scheduled.\n\t */\n\tisScheduled(): boolean {\n\t\treturn this.timeoutToken !== -1;\n\t}\n\n\tprivate onTimeout() {\n\t\tthis.timeoutToken = -1;\n\t\tif (this.runner) {\n\t\t\tthis.runner();\n\t\t}\n\t}\n}\n\nexport function nfcall(fn: Function, ...args: any[]): Promise;\nexport function nfcall<T>(fn: Function, ...args: any[]): TPromise<T>;\nexport function nfcall(fn: Function, ...args: any[]): any {\n\treturn new TPromise((c, e) => fn(...args, (err: any, result: any) => err ? e(err) : c(result)), () => null);\n}\n\nexport function ninvoke(thisArg: any, fn: Function, ...args: any[]): Promise;\nexport function ninvoke<T>(thisArg: any, fn: Function, ...args: any[]): TPromise<T>;\nexport function ninvoke(thisArg: any, fn: Function, ...args: any[]): any {\n\treturn new TPromise((c, e) => fn.call(thisArg, ...args, (err: any, result: any) => err ? e(err) : c(result)), () => null);\n}\n\n/**\n * An emitter that will ignore any events that occur during a specific code\n * execution triggered via throttle() until the promise has finished (either\n * successfully or with an error). Only after the promise has finished, the\n * last event that was fired during the operation will get emitted.\n *\n */\nexport class ThrottledEmitter<T> extends Emitter<T> {\n\tprivate suspended: boolean;\n\n\tprivate lastEvent: T;\n\tprivate hasLastEvent: boolean;\n\n\tpublic throttle<C>(promise: TPromise<C>): TPromise<C> {\n\t\tthis.suspended = true;\n\n\t\treturn always(promise, () => this.resume());\n\t}\n\n\tpublic fire(event?: T): any {\n\t\tif (this.suspended) {\n\t\t\tthis.lastEvent = event;\n\t\t\tthis.hasLastEvent = true;\n\n\t\t\treturn;\n\t\t}\n\n\t\treturn super.fire(event);\n\t}\n\n\tprivate resume(): void {\n\t\tthis.suspended = false;\n\n\t\tif (this.hasLastEvent) {\n\t\t\tthis.fire(this.lastEvent);\n\t\t}\n\n\t\tthis.hasLastEvent = false;\n\t\tthis.lastEvent = void 0;\n\t}\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'use strict';\n\nimport { transformErrorForSerialization } from 'vs/base/common/errors';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { ErrorCallback, TPromise, ValueCallback } from 'vs/base/common/winjs.base';\nimport { ShallowCancelThenPromise } from 'vs/base/common/async';\nimport { isWeb } from 'vs/base/common/platform';\n\nconst INITIALIZE = '$initialize';\n\nexport interface IWorker {\n\tgetId(): number;\n\tpostMessage(message: string): void;\n\tdispose(): void;\n}\n\nexport interface IWorkerCallback {\n\t(message: string): void;\n}\n\nexport interface IWorkerFactory {\n\tcreate(moduleId: string, callback: IWorkerCallback, onErrorCallback: (err: any) => void): IWorker;\n}\n\nlet webWorkerWarningLogged = false;\nexport function logOnceWebWorkerWarning(err: any): void {\n\tif (!isWeb) {\n\t\t// running tests\n\t\treturn;\n\t}\n\tif (!webWorkerWarningLogged) {\n\t\twebWorkerWarningLogged = true;\n\t\tconsole.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq');\n\t}\n\tconsole.warn(err.message);\n}\n\ninterface IMessage {\n\tvsWorker: number;\n\treq?: string;\n\tseq?: string;\n}\n\ninterface IRequestMessage extends IMessage {\n\treq: string;\n\tmethod: string;\n\targs: any[];\n}\n\ninterface IReplyMessage extends IMessage {\n\tseq: string;\n\terr: any;\n\tres: any;\n}\n\ninterface IMessageReply {\n\tc: ValueCallback;\n\te: ErrorCallback;\n}\n\ninterface IMessageHandler {\n\tsendMessage(msg: string): void;\n\thandleMessage(method: string, args: any[]): TPromise<any>;\n}\n\nclass SimpleWorkerProtocol {\n\n\tprivate _workerId: number;\n\tprivate _lastSentReq: number;\n\tprivate _pendingReplies: { [req: string]: IMessageReply; };\n\tprivate _handler: IMessageHandler;\n\n\tconstructor(handler: IMessageHandler) {\n\t\tthis._workerId = -1;\n\t\tthis._handler = handler;\n\t\tthis._lastSentReq = 0;\n\t\tthis._pendingReplies = Object.create(null);\n\t}\n\n\tpublic setWorkerId(workerId: number): void {\n\t\tthis._workerId = workerId;\n\t}\n\n\tpublic sendMessage(method: string, args: any[]): TPromise<any> {\n\t\tlet req = String(++this._lastSentReq);\n\t\tlet reply: IMessageReply = {\n\t\t\tc: null,\n\t\t\te: null\n\t\t};\n\t\tlet result = new TPromise<any>((c, e, p) => {\n\t\t\treply.c = c;\n\t\t\treply.e = e;\n\t\t}, () => {\n\t\t\t// Cancel not supported\n\t\t});\n\t\tthis._pendingReplies[req] = reply;\n\n\t\tthis._send({\n\t\t\tvsWorker: this._workerId,\n\t\t\treq: req,\n\t\t\tmethod: method,\n\t\t\targs: args\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tpublic handleMessage(serializedMessage: string): void {\n\t\tlet message: IMessage;\n\t\ttry {\n\t\t\tmessage = JSON.parse(serializedMessage);\n\t\t} catch (e) {\n\t\t\t// nothing\n\t\t}\n\t\tif (!message || !message.vsWorker) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._workerId !== -1 && message.vsWorker !== this._workerId) {\n\t\t\treturn;\n\t\t}\n\t\tthis._handleMessage(message);\n\t}\n\n\tprivate _handleMessage(msg: IMessage): void {\n\t\tif (msg.seq) {\n\t\t\tlet replyMessage = <IReplyMessage>msg;\n\t\t\tif (!this._pendingReplies[replyMessage.seq]) {\n\t\t\t\tconsole.warn('Got reply to unknown seq');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet reply = this._pendingReplies[replyMessage.seq];\n\t\t\tdelete this._pendingReplies[replyMessage.seq];\n\n\t\t\tif (replyMessage.err) {\n\t\t\t\tlet err = replyMessage.err;\n\t\t\t\tif (replyMessage.err.$isError) {\n\t\t\t\t\terr = new Error();\n\t\t\t\t\terr.name = replyMessage.err.name;\n\t\t\t\t\terr.message = replyMessage.err.message;\n\t\t\t\t\terr.stack = replyMessage.err.stack;\n\t\t\t\t}\n\t\t\t\treply.e(err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treply.c(replyMessage.res);\n\t\t\treturn;\n\t\t}\n\n\t\tlet requestMessage = <IRequestMessage>msg;\n\t\tlet req = requestMessage.req;\n\t\tlet result = this._handler.handleMessage(requestMessage.method, requestMessage.args);\n\t\tresult.then((r) => {\n\t\t\tthis._send({\n\t\t\t\tvsWorker: this._workerId,\n\t\t\t\tseq: req,\n\t\t\t\tres: r,\n\t\t\t\terr: undefined\n\t\t\t});\n\t\t}, (e) => {\n\t\t\tif (e.detail instanceof Error) {\n\t\t\t\t// Loading errors have a detail property that points to the actual error\n\t\t\t\te.detail = transformErrorForSerialization(e.detail);\n\t\t\t}\n\t\t\tthis._send({\n\t\t\t\tvsWorker: this._workerId,\n\t\t\t\tseq: req,\n\t\t\t\tres: undefined,\n\t\t\t\terr: transformErrorForSerialization(e)\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate _send(msg: IRequestMessage | IReplyMessage): void {\n\t\tlet strMsg = JSON.stringify(msg);\n\t\t// console.log('SENDING: ' + strMsg);\n\t\tthis._handler.sendMessage(strMsg);\n\t}\n}\n\n/**\n * Main thread side\n */\nexport class SimpleWorkerClient<T> extends Disposable {\n\n\tprivate _worker: IWorker;\n\tprivate _onModuleLoaded: TPromise<string[]>;\n\tprivate _protocol: SimpleWorkerProtocol;\n\tprivate _lazyProxy: TPromise<T>;\n\n\tconstructor(workerFactory: IWorkerFactory, moduleId: string) {\n\t\tsuper();\n\n\t\tlet lazyProxyFulfill: (v: T) => void = null;\n\t\tlet lazyProxyReject: (err: any) => void = null;\n\n\t\tthis._worker = this._register(workerFactory.create(\n\t\t\t'vs/base/common/worker/simpleWorker',\n\t\t\t(msg: string) => {\n\t\t\t\tthis._protocol.handleMessage(msg);\n\t\t\t},\n\t\t\t(err: any) => {\n\t\t\t\t// in Firefox, web workers fail lazily :(\n\t\t\t\t// we will reject the proxy\n\t\t\t\tlazyProxyReject(err);\n\t\t\t}\n\t\t));\n\n\t\tthis._protocol = new SimpleWorkerProtocol({\n\t\t\tsendMessage: (msg: string): void => {\n\t\t\t\tthis._worker.postMessage(msg);\n\t\t\t},\n\t\t\thandleMessage: (method: string, args: any[]): TPromise<any> => {\n\t\t\t\t// Intentionally not supporting worker -> main requests\n\t\t\t\treturn TPromise.as(null);\n\t\t\t}\n\t\t});\n\t\tthis._protocol.setWorkerId(this._worker.getId());\n\n\t\t// Gather loader configuration\n\t\tlet loaderConfiguration: any = null;\n\t\tif (typeof (<any>self).require !== 'undefined' && typeof (<any>self).require.getConfig === 'function') {\n\t\t\t// Get the configuration from the Monaco AMD Loader\n\t\t\tloaderConfiguration = (<any>self).require.getConfig();\n\t\t} else if (typeof (<any>self).requirejs !== 'undefined') {\n\t\t\t// Get the configuration from requirejs\n\t\t\tloaderConfiguration = (<any>self).requirejs.s.contexts._.config;\n\t\t}\n\n\t\tthis._lazyProxy = new TPromise<T>((c, e, p) => {\n\t\t\tlazyProxyFulfill = c;\n\t\t\tlazyProxyReject = e;\n\t\t}, () => { /* no cancel */ });\n\n\t\t// Send initialize message\n\t\tthis._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [\n\t\t\tthis._worker.getId(),\n\t\t\tmoduleId,\n\t\t\tloaderConfiguration\n\t\t]);\n\t\tthis._onModuleLoaded.then((availableMethods: string[]) => {\n\t\t\tlet proxy = <T>{};\n\t\t\tfor (let i = 0; i < availableMethods.length; i++) {\n\t\t\t\t(proxy as any)[availableMethods[i]] = createProxyMethod(availableMethods[i], proxyMethodRequest);\n\t\t\t}\n\t\t\tlazyProxyFulfill(proxy);\n\t\t}, (e) => {\n\t\t\tlazyProxyReject(e);\n\t\t\tthis._onError('Worker failed to load ' + moduleId, e);\n\t\t});\n\n\t\t// Create proxy to loaded code\n\t\tlet proxyMethodRequest = (method: string, args: any[]): TPromise<any> => {\n\t\t\treturn this._request(method, args);\n\t\t};\n\n\t\tlet createProxyMethod = (method: string, proxyMethodRequest: (method: string, args: any[]) => TPromise<any>): Function => {\n\t\t\treturn function () {\n\t\t\t\tlet args = Array.prototype.slice.call(arguments, 0);\n\t\t\t\treturn proxyMethodRequest(method, args);\n\t\t\t};\n\t\t};\n\t}\n\n\tpublic getProxyObject(): TPromise<T> {\n\t\t// Do not allow chaining promises to cancel the proxy creation\n\t\treturn new ShallowCancelThenPromise(this._lazyProxy);\n\t}\n\n\tprivate _request(method: string, args: any[]): TPromise<any> {\n\t\treturn new TPromise<any>((c, e, p) => {\n\t\t\tthis._onModuleLoaded.then(() => {\n\t\t\t\tthis._protocol.sendMessage(method, args).then(c, e);\n\t\t\t}, e);\n\t\t}, () => {\n\t\t\t// Cancel intentionally not supported\n\t\t});\n\t}\n\n\tprivate _onError(message: string, error?: any): void {\n\t\tconsole.error(message);\n\t\tconsole.info(error);\n\t}\n}\n\nexport interface IRequestHandler {\n\t_requestHandlerBrand: any;\n}\n\n/**\n * Worker side\n */\nexport class SimpleWorkerServer {\n\n\tprivate _requestHandler: IRequestHandler;\n\tprivate _protocol: SimpleWorkerProtocol;\n\n\tconstructor(postSerializedMessage: (msg: string) => void, requestHandler: IRequestHandler) {\n\t\tthis._requestHandler = requestHandler;\n\t\tthis._protocol = new SimpleWorkerProtocol({\n\t\t\tsendMessage: (msg: string): void => {\n\t\t\t\tpostSerializedMessage(msg);\n\t\t\t},\n\t\t\thandleMessage: (method: string, args: any[]): TPromise<any> => this._handleMessage(method, args)\n\t\t});\n\t}\n\n\tpublic onmessage(msg: string): void {\n\t\tthis._protocol.handleMessage(msg);\n\t}\n\n\tprivate _handleMessage(method: string, args: any[]): TPromise<any> {\n\t\tif (method === INITIALIZE) {\n\t\t\treturn this.initialize(<number>args[0], <string>args[1], <any>args[2]);\n\t\t}\n\n\t\tif (!this._requestHandler || typeof this._requestHandler[method] !== 'function') {\n\t\t\treturn TPromise.wrapError(new Error('Missing requestHandler or method: ' + method));\n\t\t}\n\n\t\ttry {\n\t\t\treturn TPromise.as(this._requestHandler[method].apply(this._requestHandler, args));\n\t\t} catch (e) {\n\t\t\treturn TPromise.wrapError(e);\n\t\t}\n\t}\n\n\tprivate initialize(workerId: number, moduleId: string, loaderConfig: any): TPromise<any> {\n\t\tthis._protocol.setWorkerId(workerId);\n\n\t\tif (this._requestHandler) {\n\t\t\t// static request handler\n\t\t\tlet methods: string[] = [];\n\t\t\tfor (let prop in this._requestHandler) {\n\t\t\t\tif (typeof this._requestHandler[prop] === 'function') {\n\t\t\t\t\tmethods.push(prop);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn TPromise.as(methods);\n\t\t}\n\n\t\tif (loaderConfig) {\n\t\t\t// Remove 'baseUrl', handling it is beyond scope for now\n\t\t\tif (typeof loaderConfig.baseUrl !== 'undefined') {\n\t\t\t\tdelete loaderConfig['baseUrl'];\n\t\t\t}\n\t\t\tif (typeof loaderConfig.paths !== 'undefined') {\n\t\t\t\tif (typeof loaderConfig.paths.vs !== 'undefined') {\n\t\t\t\t\tdelete loaderConfig.paths['vs'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Since this is in a web worker, enable catching errors\n\t\t\tloaderConfig.catchError = true;\n\t\t\t(<any>self).require.config(loaderConfig);\n\t\t}\n\n\t\tlet cc: ValueCallback;\n\t\tlet ee: ErrorCallback;\n\t\tlet r = new TPromise<any>((c, e, p) => {\n\t\t\tcc = c;\n\t\t\tee = e;\n\t\t});\n\n\t\t// Use the global require to be sure to get the global config\n\t\t(<any>self).require([moduleId], (...result: any[]) => {\n\t\t\tlet handlerModule = result[0];\n\t\t\tthis._requestHandler = handlerModule.create();\n\n\t\t\tlet methods: string[] = [];\n\t\t\tfor (let prop in this._requestHandler) {\n\t\t\t\tif (typeof this._requestHandler[prop] === 'function') {\n\t\t\t\t\tmethods.push(prop);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcc(methods);\n\t\t}, ee);\n\n\t\treturn r;\n\t}\n}\n\n/**\n * Called on the worker side\n */\nexport function create(postMessage: (msg: string) => void): SimpleWorkerServer {\n\treturn new SimpleWorkerServer(postMessage, null);\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'use strict';\n\n/**\n * A position in the editor. This interface is suitable for serialization.\n */\nexport interface IPosition {\n\t/**\n\t * line number (starts at 1)\n\t */\n\treadonly lineNumber: number;\n\t/**\n\t * column (the first character in a line is between column 1 and column 2)\n\t */\n\treadonly column: number;\n}\n\n/**\n * A position in the editor.\n */\nexport class Position {\n\t/**\n\t * line number (starts at 1)\n\t */\n\tpublic readonly lineNumber: number;\n\t/**\n\t * column (the first character in a line is between column 1 and column 2)\n\t */\n\tpublic readonly column: number;\n\n\tconstructor(lineNumber: number, column: number) {\n\t\tthis.lineNumber = lineNumber;\n\t\tthis.column = column;\n\t}\n\n\t/**\n\t * Test if this position equals other position\n\t */\n\tpublic equals(other: IPosition): boolean {\n\t\treturn Position.equals(this, other);\n\t}\n\n\t/**\n\t * Test if position `a` equals position `b`\n\t */\n\tpublic static equals(a: IPosition, b: IPosition): boolean {\n\t\tif (!a && !b) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (\n\t\t\t!!a &&\n\t\t\t!!b &&\n\t\t\ta.lineNumber === b.lineNumber &&\n\t\t\ta.column === b.column\n\t\t);\n\t}\n\n\t/**\n\t * Test if this position is before other position.\n\t * If the two positions are equal, the result will be false.\n\t */\n\tpublic isBefore(other: IPosition): boolean {\n\t\treturn Position.isBefore(this, other);\n\t}\n\n\t/**\n\t * Test if position `a` is before position `b`.\n\t * If the two positions are equal, the result will be false.\n\t */\n\tpublic static isBefore(a: IPosition, b: IPosition): boolean {\n\t\tif (a.lineNumber < b.lineNumber) {\n\t\t\treturn true;\n\t\t}\n\t\tif (b.lineNumber < a.lineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\treturn a.column < b.column;\n\t}\n\n\t/**\n\t * Test if this position is before other position.\n\t * If the two positions are equal, the result will be true.\n\t */\n\tpublic isBeforeOrEqual(other: IPosition): boolean {\n\t\treturn Position.isBeforeOrEqual(this, other);\n\t}\n\n\t/**\n\t * Test if position `a` is before position `b`.\n\t * If the two positions are equal, the result will be true.\n\t */\n\tpublic static isBeforeOrEqual(a: IPosition, b: IPosition): boolean {\n\t\tif (a.lineNumber < b.lineNumber) {\n\t\t\treturn true;\n\t\t}\n\t\tif (b.lineNumber < a.lineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\treturn a.column <= b.column;\n\t}\n\n\t/**\n\t * A function that compares positions, useful for sorting\n\t */\n\tpublic static compare(a: IPosition, b: IPosition): number {\n\t\tlet aLineNumber = a.lineNumber | 0;\n\t\tlet bLineNumber = b.lineNumber | 0;\n\n\t\tif (aLineNumber === bLineNumber) {\n\t\t\tlet aColumn = a.column | 0;\n\t\t\tlet bColumn = b.column | 0;\n\t\t\treturn aColumn - bColumn;\n\t\t}\n\n\t\treturn aLineNumber - bLineNumber;\n\t}\n\n\t/**\n\t * Clone this position.\n\t */\n\tpublic clone(): Position {\n\t\treturn new Position(this.lineNumber, this.column);\n\t}\n\n\t/**\n\t * Convert to a human-readable representation.\n\t */\n\tpublic toString(): string {\n\t\treturn '(' + this.lineNumber + ',' + this.column + ')';\n\t}\n\n\t// ---\n\n\t/**\n\t * Create a `Position` from an `IPosition`.\n\t */\n\tpublic static lift(pos: IPosition): Position {\n\t\treturn new Position(pos.lineNumber, pos.column);\n\t}\n\n\t/**\n\t * Test if `obj` is an `IPosition`.\n\t */\n\tpublic static isIPosition(obj: any): obj is IPosition {\n\t\treturn (\n\t\t\tobj\n\t\t\t&& (typeof obj.lineNumber === 'number')\n\t\t\t&& (typeof obj.column === 'number')\n\t\t);\n\t}\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\n'use strict';\n\nimport { Position, IPosition } from 'vs/editor/common/core/position';\n\n/**\n * A range in the editor. This interface is suitable for serialization.\n */\nexport interface IRange {\n\t/**\n\t * Line number on which the range starts (starts at 1).\n\t */\n\treadonly startLineNumber: number;\n\t/**\n\t * Column on which the range starts in line `startLineNumber` (starts at 1).\n\t */\n\treadonly startColumn: number;\n\t/**\n\t * Line number on which the range ends.\n\t */\n\treadonly endLineNumber: number;\n\t/**\n\t * Column on which the range ends in line `endLineNumber`.\n\t */\n\treadonly endColumn: number;\n}\n\n/**\n * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)\n */\nexport class Range {\n\n\t/**\n\t * Line number on which the range starts (starts at 1).\n\t */\n\tpublic readonly startLineNumber: number;\n\t/**\n\t * Column on which the range starts in line `startLineNumber` (starts at 1).\n\t */\n\tpublic readonly startColumn: number;\n\t/**\n\t * Line number on which the range ends.\n\t */\n\tpublic readonly endLineNumber: number;\n\t/**\n\t * Column on which the range ends in line `endLineNumber`.\n\t */\n\tpublic readonly endColumn: number;\n\n\tconstructor(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number) {\n\t\tif ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) {\n\t\t\tthis.startLineNumber = endLineNumber;\n\t\t\tthis.startColumn = endColumn;\n\t\t\tthis.endLineNumber = startLineNumber;\n\t\t\tthis.endColumn = startColumn;\n\t\t} else {\n\t\t\tthis.startLineNumber = startLineNumber;\n\t\t\tthis.startColumn = startColumn;\n\t\t\tthis.endLineNumber = endLineNumber;\n\t\t\tthis.endColumn = endColumn;\n\t\t}\n\t}\n\n\t/**\n\t * Test if this range is empty.\n\t */\n\tpublic isEmpty(): boolean {\n\t\treturn Range.isEmpty(this);\n\t}\n\n\t/**\n\t * Test if `range` is empty.\n\t */\n\tpublic static isEmpty(range: IRange): boolean {\n\t\treturn (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn);\n\t}\n\n\t/**\n\t * Test if position is in this range. If the position is at the edges, will return true.\n\t */\n\tpublic containsPosition(position: IPosition): boolean {\n\t\treturn Range.containsPosition(this, position);\n\t}\n\n\t/**\n\t * Test if `position` is in `range`. If the position is at the edges, will return true.\n\t */\n\tpublic static containsPosition(range: IRange, position: IPosition): boolean {\n\t\tif (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {\n\t\t\treturn false;\n\t\t}\n\t\tif (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Test if range is in this range. If the range is equal to this range, will return true.\n\t */\n\tpublic containsRange(range: IRange): boolean {\n\t\treturn Range.containsRange(this, range);\n\t}\n\n\t/**\n\t * Test if `otherRange` is in `range`. If the ranges are equal, will return true.\n\t */\n\tpublic static containsRange(range: IRange, otherRange: IRange): boolean {\n\t\tif (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {\n\t\t\treturn false;\n\t\t}\n\t\tif (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * A reunion of the two ranges.\n\t * The smallest position will be used as the start point, and the largest one as the end point.\n\t */\n\tpublic plusRange(range: IRange): Range {\n\t\treturn Range.plusRange(this, range);\n\t}\n\n\t/**\n\t * A reunion of the two ranges.\n\t * The smallest position will be used as the start point, and the largest one as the end point.\n\t */\n\tpublic static plusRange(a: IRange, b: IRange): Range {\n\t\tlet startLineNumber: number;\n\t\tlet startColumn: number;\n\t\tlet endLineNumber: number;\n\t\tlet endColumn: number;\n\n\t\tif (b.startLineNumber < a.startLineNumber) {\n\t\t\tstartLineNumber = b.startLineNumber;\n\t\t\tstartColumn = b.startColumn;\n\t\t} else if (b.startLineNumber === a.startLineNumber) {\n\t\t\tstartLineNumber = b.startLineNumber;\n\t\t\tstartColumn = Math.min(b.startColumn, a.startColumn);\n\t\t} else {\n\t\t\tstartLineNumber = a.startLineNumber;\n\t\t\tstartColumn = a.startColumn;\n\t\t}\n\n\t\tif (b.endLineNumber > a.endLineNumber) {\n\t\t\tendLineNumber = b.endLineNumber;\n\t\t\tendColumn = b.endColumn;\n\t\t} else if (b.endLineNumber === a.endLineNumber) {\n\t\t\tendLineNumber = b.endLineNumber;\n\t\t\tendColumn = Math.max(b.endColumn, a.endColumn);\n\t\t} else {\n\t\t\tendLineNumber = a.endLineNumber;\n\t\t\tendColumn = a.endColumn;\n\t\t}\n\n\t\treturn new Range(startLineNumber, startColumn, endLineNumber, endColumn);\n\t}\n\n\t/**\n\t * A intersection of the two ranges.\n\t */\n\tpublic intersectRanges(range: IRange): Range {\n\t\treturn Range.intersectRanges(this, range);\n\t}\n\n\t/**\n\t * A intersection of the two ranges.\n\t */\n\tpublic static intersectRanges(a: IRange, b: IRange): Range {\n\t\tlet resultStartLineNumber = a.startLineNumber;\n\t\tlet resultStartColumn = a.startColumn;\n\t\tlet resultEndLineNumber = a.endLineNumber;\n\t\tlet resultEndColumn = a.endColumn;\n\t\tlet otherStartLineNumber = b.startLineNumber;\n\t\tlet otherStartColumn = b.startColumn;\n\t\tlet otherEndLineNumber = b.endLineNumber;\n\t\tlet otherEndColumn = b.endColumn;\n\n\t\tif (resultStartLineNumber < otherStartLineNumber) {\n\t\t\tresultStartLineNumber = otherStartLineNumber;\n\t\t\tresultStartColumn = otherStartColumn;\n\t\t} else if (resultStartLineNumber === otherStartLineNumber) {\n\t\t\tresultStartColumn = Math.max(resultStartColumn, otherStartColumn);\n\t\t}\n\n\t\tif (resultEndLineNumber > otherEndLineNumber) {\n\t\t\tresultEndLineNumber = otherEndLineNumber;\n\t\t\tresultEndColumn = otherEndColumn;\n\t\t} else if (resultEndLineNumber === otherEndLineNumber) {\n\t\t\tresultEndColumn = Math.min(resultEndColumn, otherEndColumn);\n\t\t}\n\n\t\t// Check if selection is now empty\n\t\tif (resultStartLineNumber > resultEndLineNumber) {\n\t\t\treturn null;\n\t\t}\n\t\tif (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);\n\t}\n\n\t/**\n\t * Test if this range equals other.\n\t */\n\tpublic equalsRange(other: IRange): boolean {\n\t\treturn Range.equalsRange(this, other);\n\t}\n\n\t/**\n\t * Test if range `a` equals `b`.\n\t */\n\tpublic static equalsRange(a: IRange, b: IRange): boolean {\n\t\treturn (\n\t\t\t!!a &&\n\t\t\t!!b &&\n\t\t\ta.startLineNumber === b.startLineNumber &&\n\t\t\ta.startColumn === b.startColumn &&\n\t\t\ta.endLineNumber === b.endLineNumber &&\n\t\t\ta.endColumn === b.endColumn\n\t\t);\n\t}\n\n\t/**\n\t * Return the end position (which will be after or equal to the start position)\n\t */\n\tpublic getEndPosition(): Position {\n\t\treturn new Position(this.endLineNumber, this.endColumn);\n\t}\n\n\t/**\n\t * Return the start position (which will be before or equal to the end position)\n\t */\n\tpublic getStartPosition(): Position {\n\t\treturn new Position(this.startLineNumber, this.startColumn);\n\t}\n\n\t/**\n\t * Transform to a user presentable string representation.\n\t */\n\tpublic toString(): string {\n\t\treturn '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']';\n\t}\n\n\t/**\n\t * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.\n\t */\n\tpublic setEndPosition(endLineNumber: number, endColumn: number): Range {\n\t\treturn new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\n\t}\n\n\t/**\n\t * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.\n\t */\n\tpublic setStartPosition(startLineNumber: number, startColumn: number): Range {\n\t\treturn new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\n\t}\n\n\t/**\n\t * Create a new empty range using this range's start position.\n\t */\n\tpublic collapseToStart(): Range {\n\t\treturn Range.collapseToStart(this);\n\t}\n\n\t/**\n\t * Create a new empty range using this range's start position.\n\t */\n\tpublic static collapseToStart(range: IRange): Range {\n\t\treturn new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);\n\t}\n\n\t// ---\n\n\tpublic static fromPositions(start: IPosition, end: IPosition = start): Range {\n\t\treturn new Range(start.lineNumber, start.column, end.lineNumber, end.column);\n\t}\n\n\t/**\n\t * Create a `Range` from an `IRange`.\n\t */\n\tpublic static lift(range: IRange): Range {\n\t\tif (!range) {\n\t\t\treturn null;\n\t\t}\n\t\treturn new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);\n\t}\n\n\t/**\n\t * Test if `obj` is an `IRange`.\n\t */\n\tpublic static isIRange(obj: any): obj is IRange {\n\t\treturn (\n\t\t\tobj\n\t\t\t&& (typeof obj.startLineNumber === 'number')\n\t\t\t&& (typeof obj.startColumn === 'number')\n\t\t\t&& (typeof obj.endLineNumber === 'number')\n\t\t\t&& (typeof obj.endColumn === 'number')\n\t\t);\n\t}\n\n\t/**\n\t * Test if the two ranges are touching in any way.\n\t */\n\tpublic static areIntersectingOrTouching(a: IRange, b: IRange): boolean {\n\t\t// Check if `a` is before `b`\n\t\tif (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if `b` is before `a`\n\t\tif (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// These ranges must intersect\n\t\treturn true;\n\t}\n\n\t/**\n\t * A function that compares ranges, useful for sorting ranges\n\t * It will first compare ranges on the startPosition and then on the endPosition\n\t */\n\tpublic static compareRangesUsingStarts(a: IRange, b: IRange): number {\n\t\tlet aStartLineNumber = a.startLineNumber | 0;\n\t\tlet bStartLineNumber = b.startLineNumber | 0;\n\n\t\tif (aStartLineNumber === bStartLineNumber) {\n\t\t\tlet aStartColumn = a.startColumn | 0;\n\t\t\tlet bStartColumn = b.startColumn | 0;\n\n\t\t\tif (aStartColumn === bStartColumn) {\n\t\t\t\tlet aEndLineNumber = a.endLineNumber | 0;\n\t\t\t\tlet bEndLineNumber = b.endLineNumber | 0;\n\n\t\t\t\tif (aEndLineNumber === bEndLineNumber) {\n\t\t\t\t\tlet aEndColumn = a.endColumn | 0;\n\t\t\t\t\tlet bEndColumn = b.endColumn | 0;\n\t\t\t\t\treturn aEndColumn - bEndColumn;\n\t\t\t\t}\n\t\t\t\treturn aEndLineNumber - bEndLineNumber;\n\t\t\t}\n\t\t\treturn aStartColumn - bStartColumn;\n\t\t}\n\t\treturn aStartLineNumber - bStartLineNumber;\n\t}\n\n\t/**\n\t * A function that compares ranges, useful for sorting ranges\n\t * It will first compare ranges on the endPosition and then on the startPosition\n\t */\n\tpublic static compareRangesUsingEnds(a: IRange, b: IRange): number {\n\t\tif (a.endLineNumber === b.endLineNumber) {\n\t\t\tif (a.endColumn === b.endColumn) {\n\t\t\t\tif (a.startLineNumber === b.startLineNumber) {\n\t\t\t\t\treturn a.startColumn - b.startColumn;\n\t\t\t\t}\n\t\t\t\treturn a.startLineNumber - b.startLineNumber;\n\t\t\t}\n\t\t\treturn a.endColumn - b.endColumn;\n\t\t}\n\t\treturn a.endLineNumber - b.endLineNumber;\n\t}\n\n\t/**\n\t * Test if the range spans multiple lines.\n\t */\n\tpublic static spansMultipleLines(range: IRange): boolean {\n\t\treturn range.endLineNumber > range.startLineNumber;\n\t}\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'use strict';\n\nimport { Range } from 'vs/editor/common/core/range';\nimport { Position, IPosition } from 'vs/editor/common/core/position';\n\n/**\n * A selection in the editor.\n * The selection is a range that has an orientation.\n */\nexport interface ISelection {\n\t/**\n\t * The line number on which the selection has started.\n\t */\n\treadonly selectionStartLineNumber: number;\n\t/**\n\t * The column on `selectionStartLineNumber` where the selection has started.\n\t */\n\treadonly selectionStartColumn: number;\n\t/**\n\t * The line number on which the selection has ended.\n\t */\n\treadonly positionLineNumber: number;\n\t/**\n\t * The column on `positionLineNumber` where the selection has ended.\n\t */\n\treadonly positionColumn: number;\n}\n\n/**\n * The direction of a selection.\n */\nexport enum SelectionDirection {\n\t/**\n\t * The selection starts above where it ends.\n\t */\n\tLTR,\n\t/**\n\t * The selection starts below where it ends.\n\t */\n\tRTL\n}\n\n/**\n * A selection in the editor.\n * The selection is a range that has an orientation.\n */\nexport class Selection extends Range {\n\t/**\n\t * The line number on which the selection has started.\n\t */\n\tpublic readonly selectionStartLineNumber: number;\n\t/**\n\t * The column on `selectionStartLineNumber` where the selection has started.\n\t */\n\tpublic readonly selectionStartColumn: number;\n\t/**\n\t * The line number on which the selection has ended.\n\t */\n\tpublic readonly positionLineNumber: number;\n\t/**\n\t * The column on `positionLineNumber` where the selection has ended.\n\t */\n\tpublic readonly positionColumn: number;\n\n\tconstructor(selectionStartLineNumber: number, selectionStartColumn: number, positionLineNumber: number, positionColumn: number) {\n\t\tsuper(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);\n\t\tthis.selectionStartLineNumber = selectionStartLineNumber;\n\t\tthis.selectionStartColumn = selectionStartColumn;\n\t\tthis.positionLineNumber = positionLineNumber;\n\t\tthis.positionColumn = positionColumn;\n\t}\n\n\t/**\n\t * Clone this selection.\n\t */\n\tpublic clone(): Selection {\n\t\treturn new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn);\n\t}\n\n\t/**\n\t * Transform to a human-readable representation.\n\t */\n\tpublic toString(): string {\n\t\treturn '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']';\n\t}\n\n\t/**\n\t * Test if equals other selection.\n\t */\n\tpublic equalsSelection(other: ISelection): boolean {\n\t\treturn (\n\t\t\tSelection.selectionsEqual(this, other)\n\t\t);\n\t}\n\n\t/**\n\t * Test if the two selections are equal.\n\t */\n\tpublic static selectionsEqual(a: ISelection, b: ISelection): boolean {\n\t\treturn (\n\t\t\ta.selectionStartLineNumber === b.selectionStartLineNumber &&\n\t\t\ta.selectionStartColumn === b.selectionStartColumn &&\n\t\t\ta.positionLineNumber === b.positionLineNumber &&\n\t\t\ta.positionColumn === b.positionColumn\n\t\t);\n\t}\n\n\t/**\n\t * Get directions (LTR or RTL).\n\t */\n\tpublic getDirection(): SelectionDirection {\n\t\tif (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {\n\t\t\treturn SelectionDirection.LTR;\n\t\t}\n\t\treturn SelectionDirection.RTL;\n\t}\n\n\t/**\n\t * Create a new selection with a different `positionLineNumber` and `positionColumn`.\n\t */\n\tpublic setEndPosition(endLineNumber: number, endColumn: number): Selection {\n\t\tif (this.getDirection() === SelectionDirection.LTR) {\n\t\t\treturn new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);\n\t\t}\n\t\treturn new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);\n\t}\n\n\t/**\n\t * Get the position at `positionLineNumber` and `positionColumn`.\n\t */\n\tpublic getPosition(): Position {\n\t\treturn new Position(this.positionLineNumber, this.positionColumn);\n\t}\n\n\t/**\n\t * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.\n\t */\n\tpublic setStartPosition(startLineNumber: number, startColumn: number): Selection {\n\t\tif (this.getDirection() === SelectionDirection.LTR) {\n\t\t\treturn new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);\n\t\t}\n\t\treturn new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);\n\t}\n\n\t// ----\n\n\t/**\n\t * Create a `Selection` from one or two positions\n\t */\n\tpublic static fromPositions(start: IPosition, end: IPosition = start): Selection {\n\t\treturn new Selection(start.lineNumber, start.column, end.lineNumber, end.column);\n\t}\n\n\t/**\n\t * Create a `Selection` from an `ISelection`.\n\t */\n\tpublic static liftSelection(sel: ISelection): Selection {\n\t\treturn new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);\n\t}\n\n\t/**\n\t * `a` equals `b`.\n\t */\n\tpublic static selectionsArrEqual(a: ISelection[], b: ISelection[]): boolean {\n\t\tif (a && !b || !a && b) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!a && !b) {\n\t\t\treturn true;\n\t\t}\n\t\tif (a.length !== b.length) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (let i = 0, len = a.length; i < len; i++) {\n\t\t\tif (!this.selectionsEqual(a[i], b[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Test if `obj` is an `ISelection`.\n\t */\n\tpublic static isISelection(obj: any): obj is ISelection {\n\t\treturn (\n\t\t\tobj\n\t\t\t&& (typeof obj.selectionStartLineNumber === 'number')\n\t\t\t&& (typeof obj.selectionStartColumn === 'number')\n\t\t\t&& (typeof obj.positionLineNumber === 'number')\n\t\t\t&& (typeof obj.positionColumn === 'number')\n\t\t);\n\t}\n\n\t/**\n\t * Create with a direction.\n\t */\n\tpublic static createWithDirection(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number, direction: SelectionDirection): Selection {\n\n\t\tif (direction === SelectionDirection.LTR) {\n\t\t\treturn new Selection(startLineNumber, startColumn, endLineNumber, endColumn);\n\t\t}\n\n\t\treturn new Selection(endLineNumber, endColumn, startLineNumber, startColumn);\n\t}\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'use strict';\n\nimport { IState } from 'vs/editor/common/modes';\n\nexport class Token {\n\t_tokenBrand: void;\n\n\tpublic readonly offset: number;\n\tpublic readonly type: string;\n\tpublic readonly language: string;\n\n\tconstructor(offset: number, type: string, language: string) {\n\t\tthis.offset = offset | 0;// @perf\n\t\tthis.type = type;\n\t\tthis.language = language;\n\t}\n\n\tpublic toString(): string {\n\t\treturn '(' + this.offset + ', ' + this.type + ')';\n\t}\n}\n\nexport class TokenizationResult {\n\t_tokenizationResultBrand: void;\n\n\tpublic readonly tokens: Token[];\n\tpublic readonly endState: IState;\n\n\tconstructor(tokens: Token[], endState: IState) {\n\t\tthis.tokens = tokens;\n\t\tthis.endState = endState;\n\t}\n}\n\nexport class TokenizationResult2 {\n\t_tokenizationResult2Brand: void;\n\n\t/**\n\t * The tokens in binary format. Each token occupies two array indices. For token i:\n\t * - at offset 2*i => startIndex\n\t * - at offset 2*i + 1 => metadata\n\t *\n\t */\n\tpublic readonly tokens: Uint32Array;\n\tpublic readonly endState: IState;\n\n\tconstructor(tokens: Uint32Array, endState: IState) {\n\t\tthis.tokens = tokens;\n\t\tthis.endState = endState;\n\t}\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'use strict';\n\nexport class Uint8Matrix {\n\n\tprivate _data: Uint8Array;\n\tpublic readonly rows: number;\n\tpublic readonly cols: number;\n\n\tconstructor(rows: number, cols: number, defaultValue: number) {\n\t\tlet data = new Uint8Array(rows * cols);\n\t\tfor (let i = 0, len = rows * cols; i < len; i++) {\n\t\t\tdata[i] = defaultValue;\n\t\t}\n\n\t\tthis._data = data;\n\t\tthis.rows = rows;\n\t\tthis.cols = cols;\n\t}\n\n\tpublic get(row: number, col: number): number {\n\t\treturn this._data[row * this.cols + col];\n\t}\n\n\tpublic set(row: number, col: number, value: number): void {\n\t\tthis._data[row * this.cols + col] = value;\n\t}\n}\n\nexport const enum Constants {\n\t/**\n\t * MAX SMI (SMall Integer) as defined in v8.\n\t * one bit is lost for boxing/unboxing flag.\n\t * one bit is lost for sign flag.\n\t * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values\n\t */\n\tMAX_SAFE_SMALL_INTEGER = 1 << 30,\n\n\t/**\n\t * MIN SMI (SMall Integer) as defined in v8.\n\t * one bit is lost for boxing/unboxing flag.\n\t * one bit is lost for sign flag.\n\t * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values\n\t */\n\tMIN_SAFE_SMALL_INTEGER = -(1 << 30),\n\n\t/**\n\t * Max unsigned integer that fits on 8 bits.\n\t */\n\tMAX_UINT_8 = 255, // 2^8 - 1\n\n\t/**\n\t * Max unsigned integer that fits on 16 bits.\n\t */\n\tMAX_UINT_16 = 65535, // 2^16 - 1\n\n\t/**\n\t * Max unsigned integer that fits on 32 bits.\n\t */\n\tMAX_UINT_32 = 4294967295, // 2^32 - 1\n\n\n}\n\nexport function toUint8(v: number): number {\n\tif (v < 0) {\n\t\treturn 0;\n\t}\n\tif (v > Constants.MAX_UINT_8) {\n\t\treturn Constants.MAX_UINT_8;\n\t}\n\treturn v | 0;\n}\n\nexport function toUint32(v: number): number {\n\tif (v < 0) {\n\t\treturn 0;\n\t}\n\tif (v > Constants.MAX_UINT_32) {\n\t\treturn Constants.MAX_UINT_32;\n\t}\n\treturn v | 0;\n}\n\nexport function toUint32Array(arr: number[]): Uint32Array {\n\tlet len = arr.length;\n\tlet r = new Uint32Array(len);\n\tfor (let i = 0; i < len; i++) {\n\t\tr[i] = toUint32(arr[i]);\n\t}\n\treturn r;\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'use strict';\n\nimport { toUint8 } from 'vs/editor/common/core/uint';\n\n/**\n * A fast character classifier that uses a compact array for ASCII values.\n */\nexport class CharacterClassifier<T extends number> {\n\t/**\n\t * Maintain a compact (fully initialized ASCII map for quickly classifying ASCII characters - used more often in code).\n\t */\n\tprivate _asciiMap: Uint8Array;\n\n\t/**\n\t * The entire map (sparse array).\n\t */\n\tprivate _map: Map<number, number>;\n\n\tprivate _defaultValue: number;\n\n\tconstructor(_defaultValue: T) {\n\t\tlet defaultValue = toUint8(_defaultValue);\n\n\t\tthis._defaultValue = defaultValue;\n\t\tthis._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);\n\t\tthis._map = new Map<number, number>();\n\t}\n\n\tprivate static _createAsciiMap(defaultValue: number): Uint8Array {\n\t\tlet asciiMap: Uint8Array = new Uint8Array(256);\n\t\tfor (let i = 0; i < 256; i++) {\n\t\t\tasciiMap[i] = defaultValue;\n\t\t}\n\t\treturn asciiMap;\n\t}\n\n\tpublic set(charCode: number, _value: T): void {\n\t\tlet value = toUint8(_value);\n\n\t\tif (charCode >= 0 && charCode < 256) {\n\t\t\tthis._asciiMap[charCode] = value;\n\t\t} else {\n\t\t\tthis._map.set(charCode, value);\n\t\t}\n\t}\n\n\tpublic get(charCode: number): T {\n\t\tif (charCode >= 0 && charCode < 256) {\n\t\t\treturn <T>this._asciiMap[charCode];\n\t\t} else {\n\t\t\treturn <T>(this._map.get(charCode) || this._defaultValue);\n\t\t}\n\t}\n}\n\nconst enum Boolean {\n\tFalse = 0,\n\tTrue = 1\n}\n\nexport class CharacterSet {\n\n\tprivate _actual: CharacterClassifier<Boolean>;\n\n\tconstructor() {\n\t\tthis._actual = new CharacterClassifier<Boolean>(Boolean.False);\n\t}\n\n\tpublic add(charCode: number): void {\n\t\tthis._actual.set(charCode, Boolean.True);\n\t}\n\n\tpublic has(charCode: number): boolean {\n\t\treturn (this._actual.get(charCode) === Boolean.True);\n\t}\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'use strict';\n\nimport { IDiffChange, ISequence, LcsDiff } from 'vs/base/common/diff/diff';\nimport * as strings from 'vs/base/common/strings';\nimport { ICharChange, ILineChange } from 'vs/editor/common/editorCommon';\n\nconst MAXIMUM_RUN_TIME = 5000; // 5 seconds\nconst MINIMUM_MATCHING_CHARACTER_LENGTH = 3;\n\ninterface IMarker {\n\tlineNumber: number;\n\tcolumn: number;\n\toffset: number;\n}\n\nfunction computeDiff(originalSequence: ISequence, modifiedSequence: ISequence, continueProcessingPredicate: () => boolean, pretty: boolean): IDiffChange[] {\n\tconst diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);\n\treturn diffAlgo.ComputeDiff(pretty);\n}\n\nclass MarkerSequence implements ISequence {\n\n\tpublic buffer: string;\n\tpublic startMarkers: IMarker[];\n\tpublic endMarkers: IMarker[];\n\n\tconstructor(buffer: string, startMarkers: IMarker[], endMarkers: IMarker[]) {\n\t\tthis.buffer = buffer;\n\t\tthis.startMarkers = startMarkers;\n\t\tthis.endMarkers = endMarkers;\n\t}\n\n\tpublic getLength(): number {\n\t\treturn this.startMarkers.length;\n\t}\n\n\tpublic getElementHash(i: number): string {\n\t\treturn this.buffer.substring(this.startMarkers[i].offset, this.endMarkers[i].offset);\n\t}\n\n\tpublic getStartLineNumber(i: number): number {\n\t\tif (i === this.startMarkers.length) {\n\t\t\t// This is the special case where a change happened after the last marker\n\t\t\treturn this.startMarkers[i - 1].lineNumber + 1;\n\t\t}\n\t\treturn this.startMarkers[i].lineNumber;\n\t}\n\n\tpublic getStartColumn(i: number): number {\n\t\treturn this.startMarkers[i].column;\n\t}\n\n\tpublic getEndLineNumber(i: number): number {\n\t\treturn this.endMarkers[i].lineNumber;\n\t}\n\n\tpublic getEndColumn(i: number): number {\n\t\treturn this.endMarkers[i].column;\n\t}\n\n}\n\nclass LineMarkerSequence extends MarkerSequence {\n\n\tconstructor(lines: string[]) {\n\t\tlet buffer = '';\n\t\tlet startMarkers: IMarker[] = [];\n\t\tlet endMarkers: IMarker[] = [];\n\n\t\tfor (let pos = 0, i = 0, length = lines.length; i < length; i++) {\n\t\t\tbuffer += lines[i];\n\t\t\tconst startColumn = LineMarkerSequence._getFirstNonBlankColumn(lines[i], 1);\n\t\t\tconst endColumn = LineMarkerSequence._getLastNonBlankColumn(lines[i], 1);\n\n\t\t\tstartMarkers.push({\n\t\t\t\toffset: pos + startColumn - 1,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tcolumn: startColumn\n\t\t\t});\n\n\t\t\tendMarkers.push({\n\t\t\t\toffset: pos + endColumn - 1,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tcolumn: endColumn\n\t\t\t});\n\n\t\t\tpos += lines[i].length;\n\t\t}\n\n\t\tsuper(buffer, startMarkers, endMarkers);\n\t}\n\n\tpublic static _getFirstNonBlankColumn(txt: string, defaultValue: number): number {\n\t\tconst r = strings.firstNonWhitespaceIndex(txt);\n\t\tif (r === -1) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn r + 1;\n\t}\n\n\tpublic static _getLastNonBlankColumn(txt: string, defaultValue: number): number {\n\t\tconst r = strings.lastNonWhitespaceIndex(txt);\n\t\tif (r === -1) {\n\t\t\treturn defaultValue;\n\t\t}\n\t\treturn r + 2;\n\t}\n\n\tpublic getCharSequence(startIndex: number, endIndex: number): MarkerSequence {\n\t\tlet startMarkers: IMarker[] = [];\n\t\tlet endMarkers: IMarker[] = [];\n\t\tfor (let index = startIndex; index <= endIndex; index++) {\n\t\t\tconst startMarker = this.startMarkers[index];\n\t\t\tconst endMarker = this.endMarkers[index];\n\t\t\tfor (let i = startMarker.offset; i < endMarker.offset; i++) {\n\t\t\t\tstartMarkers.push({\n\t\t\t\t\toffset: i,\n\t\t\t\t\tlineNumber: startMarker.lineNumber,\n\t\t\t\t\tcolumn: startMarker.column + (i - startMarker.offset)\n\t\t\t\t});\n\t\t\t\tendMarkers.push({\n\t\t\t\t\toffset: i + 1,\n\t\t\t\t\tlineNumber: startMarker.lineNumber,\n\t\t\t\t\tcolumn: startMarker.column + (i - startMarker.offset) + 1\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn new MarkerSequence(this.buffer, startMarkers, endMarkers);\n\t}\n}\n\nclass CharChange implements ICharChange {\n\n\tpublic originalStartLineNumber: number;\n\tpublic originalStartColumn: number;\n\tpublic originalEndLineNumber: number;\n\tpublic originalEndColumn: number;\n\n\tpublic modifiedStartLineNumber: number;\n\tpublic modifiedStartColumn: number;\n\tpublic modifiedEndLineNumber: number;\n\tpublic modifiedEndColumn: number;\n\n\tconstructor(\n\t\toriginalStartLineNumber: number,\n\t\toriginalStartColumn: number,\n\t\toriginalEndLineNumber: number,\n\t\toriginalEndColumn: number,\n\t\tmodifiedStartLineNumber: number,\n\t\tmodifiedStartColumn: number,\n\t\tmodifiedEndLineNumber: number,\n\t\tmodifiedEndColumn: number\n\t) {\n\t\tthis.originalStartLineNumber = originalStartLineNumber;\n\t\tthis.originalStartColumn = originalStartColumn;\n\t\tthis.originalEndLineNumber = originalEndLineNumber;\n\t\tthis.originalEndColumn = originalEndColumn;\n\t\tthis.modifiedStartLineNumber = modifiedStartLineNumber;\n\t\tthis.modifiedStartColumn = modifiedStartColumn;\n\t\tthis.modifiedEndLineNumber = modifiedEndLineNumber;\n\t\tthis.modifiedEndColumn = modifiedEndColumn;\n\t}\n\n\tpublic static createFromDiffChange(diffChange: IDiffChange, originalCharSequence: MarkerSequence, modifiedCharSequence: MarkerSequence): CharChange {\n\t\tlet originalStartLineNumber: number;\n\t\tlet originalStartColumn: number;\n\t\tlet originalEndLineNumber: number;\n\t\tlet originalEndColumn: number;\n\t\tlet modifiedStartLineNumber: number;\n\t\tlet modifiedStartColumn: number;\n\t\tlet modifiedEndLineNumber: number;\n\t\tlet modifiedEndColumn: number;\n\n\t\tif (diffChange.originalLength === 0) {\n\t\t\toriginalStartLineNumber = 0;\n\t\t\toriginalStartColumn = 0;\n\t\t\toriginalEndLineNumber = 0;\n\t\t\toriginalEndColumn = 0;\n\t\t} else {\n\t\t\toriginalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);\n\t\t\toriginalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);\n\t\t\toriginalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\n\t\t\toriginalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);\n\t\t}\n\n\t\tif (diffChange.modifiedLength === 0) {\n\t\t\tmodifiedStartLineNumber = 0;\n\t\t\tmodifiedStartColumn = 0;\n\t\t\tmodifiedEndLineNumber = 0;\n\t\t\tmodifiedEndColumn = 0;\n\t\t} else {\n\t\t\tmodifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);\n\t\t\tmodifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);\n\t\t\tmodifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\t\t\tmodifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\t\t}\n\n\t\treturn new CharChange(\n\t\t\toriginalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn,\n\t\t\tmodifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn,\n\t\t);\n\t}\n}\n\nfunction postProcessCharChanges(rawChanges: IDiffChange[]): IDiffChange[] {\n\tif (rawChanges.length <= 1) {\n\t\treturn rawChanges;\n\t}\n\n\tlet result = [rawChanges[0]];\n\tlet prevChange = result[0];\n\n\tfor (let i = 1, len = rawChanges.length; i < len; i++) {\n\t\tconst currChange = rawChanges[i];\n\n\t\tconst originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);\n\t\tconst modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);\n\t\t// Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true\n\t\tconst matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);\n\n\t\tif (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {\n\t\t\t// Merge the current change into the previous one\n\t\t\tprevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart;\n\t\t\tprevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart;\n\t\t} else {\n\t\t\t// Add the current change\n\t\t\tresult.push(currChange);\n\t\t\tprevChange = currChange;\n\t\t}\n\t}\n\n\treturn result;\n}\n\nclass LineChange implements ILineChange {\n\tpublic originalStartLineNumber: number;\n\tpublic originalEndLineNumber: number;\n\tpublic modifiedStartLineNumber: number;\n\tpublic modifiedEndLineNumber: number;\n\tpublic charChanges: CharChange[];\n\n\tconstructor(\n\t\toriginalStartLineNumber: number,\n\t\toriginalEndLineNumber: number,\n\t\tmodifiedStartLineNumber: number,\n\t\tmodifiedEndLineNumber: number,\n\t\tcharChanges: CharChange[]\n\t) {\n\t\tthis.originalStartLineNumber = originalStartLineNumber;\n\t\tthis.originalEndLineNumber = originalEndLineNumber;\n\t\tthis.modifiedStartLineNumber = modifiedStartLineNumber;\n\t\tthis.modifiedEndLineNumber = modifiedEndLineNumber;\n\t\tthis.charChanges = charChanges;\n\t}\n\n\tpublic static createFromDiffResult(diffChange: IDiffChange, originalLineSequence: LineMarkerSequence, modifiedLineSequence: LineMarkerSequence, continueProcessingPredicate: () => boolean, shouldPostProcessCharChanges: boolean): LineChange {\n\t\tlet originalStartLineNumber: number;\n\t\tlet originalEndLineNumber: number;\n\t\tlet modifiedStartLineNumber: number;\n\t\tlet modifiedEndLineNumber: number;\n\t\tlet charChanges: CharChange[];\n\n\t\tif (diffChange.originalLength === 0) {\n\t\t\toriginalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;\n\t\t\toriginalEndLineNumber = 0;\n\t\t} else {\n\t\t\toriginalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);\n\t\t\toriginalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);\n\t\t}\n\n\t\tif (diffChange.modifiedLength === 0) {\n\t\t\tmodifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;\n\t\t\tmodifiedEndLineNumber = 0;\n\t\t} else {\n\t\t\tmodifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);\n\t\t\tmodifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\t\t}\n\n\t\tif (diffChange.originalLength !== 0 && diffChange.modifiedLength !== 0 && continueProcessingPredicate()) {\n\t\t\tconst originalCharSequence = originalLineSequence.getCharSequence(diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);\n\t\t\tconst modifiedCharSequence = modifiedLineSequence.getCharSequence(diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);\n\n\t\t\tlet rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueProcessingPredicate, true);\n\n\t\t\tif (shouldPostProcessCharChanges) {\n\t\t\t\trawChanges = postProcessCharChanges(rawChanges);\n\t\t\t}\n\n\t\t\tcharChanges = [];\n\t\t\tfor (let i = 0, length = rawChanges.length; i < length; i++) {\n\t\t\t\tcharChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));\n\t\t\t}\n\t\t}\n\n\t\treturn new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);\n\t}\n}\n\nexport interface IDiffComputerOpts {\n\tshouldPostProcessCharChanges: boolean;\n\tshouldIgnoreTrimWhitespace: boolean;\n\tshouldMakePrettyDiff: boolean;\n}\n\nexport class DiffComputer {\n\n\tprivate readonly shouldPostProcessCharChanges: boolean;\n\tprivate readonly shouldIgnoreTrimWhitespace: boolean;\n\tprivate readonly shouldMakePrettyDiff: boolean;\n\tprivate readonly maximumRunTimeMs: number;\n\tprivate readonly originalLines: string[];\n\tprivate readonly modifiedLines: string[];\n\tprivate readonly original: LineMarkerSequence;\n\tprivate readonly modified: LineMarkerSequence;\n\n\tprivate computationStartTime: number;\n\n\tconstructor(originalLines: string[], modifiedLines: string[], opts: IDiffComputerOpts) {\n\t\tthis.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;\n\t\tthis.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;\n\t\tthis.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;\n\t\tthis.maximumRunTimeMs = MAXIMUM_RUN_TIME;\n\t\tthis.originalLines = originalLines;\n\t\tthis.modifiedLines = modifiedLines;\n\t\tthis.original = new LineMarkerSequence(originalLines);\n\t\tthis.modified = new LineMarkerSequence(modifiedLines);\n\t}\n\n\tpublic computeDiff(): ILineChange[] {\n\n\t\tif (this.original.getLength() === 1 && this.original.getElementHash(0).length === 0) {\n\t\t\t// empty original => fast path\n\t\t\treturn [{\n\t\t\t\toriginalStartLineNumber: 1,\n\t\t\t\toriginalEndLineNumber: 1,\n\t\t\t\tmodifiedStartLineNumber: 1,\n\t\t\t\tmodifiedEndLineNumber: this.modified.getLength(),\n\t\t\t\tcharChanges: [{\n\t\t\t\t\tmodifiedEndColumn: 0,\n\t\t\t\t\tmodifiedEndLineNumber: 0,\n\t\t\t\t\tmodifiedStartColumn: 0,\n\t\t\t\t\tmodifiedStartLineNumber: 0,\n\t\t\t\t\toriginalEndColumn: 0,\n\t\t\t\t\toriginalEndLineNumber: 0,\n\t\t\t\t\toriginalStartColumn: 0,\n\t\t\t\t\toriginalStartLineNumber: 0\n\t\t\t\t}]\n\t\t\t}];\n\t\t}\n\n\t\tif (this.modified.getLength() === 1 && this.modified.getElementHash(0).length === 0) {\n\t\t\t// empty modified => fast path\n\t\t\treturn [{\n\t\t\t\toriginalStartLineNumber: 1,\n\t\t\t\toriginalEndLineNumber: this.original.getLength(),\n\t\t\t\tmodifiedStartLineNumber: 1,\n\t\t\t\tmodifiedEndLineNumber: 1,\n\t\t\t\tcharChanges: [{\n\t\t\t\t\tmodifiedEndColumn: 0,\n\t\t\t\t\tmodifiedEndLineNumber: 0,\n\t\t\t\t\tmodifiedStartColumn: 0,\n\t\t\t\t\tmodifiedStartLineNumber: 0,\n\t\t\t\t\toriginalEndColumn: 0,\n\t\t\t\t\toriginalEndLineNumber: 0,\n\t\t\t\t\toriginalStartColumn: 0,\n\t\t\t\t\toriginalStartLineNumber: 0\n\t\t\t\t}]\n\t\t\t}];\n\t\t}\n\n\t\tthis.computationStartTime = (new Date()).getTime();\n\n\t\tlet rawChanges = computeDiff(this.original, this.modified, this._continueProcessingPredicate.bind(this), this.shouldMakePrettyDiff);\n\n\t\t// The diff is always computed with ignoring trim whitespace\n\t\t// This ensures we get the prettiest diff\n\n\t\tif (this.shouldIgnoreTrimWhitespace) {\n\t\t\tlet lineChanges: LineChange[] = [];\n\t\t\tfor (let i = 0, length = rawChanges.length; i < length; i++) {\n\t\t\t\tlineChanges.push(LineChange.createFromDiffResult(rawChanges[i], this.original, this.modified, this._continueProcessingPredicate.bind(this), this.shouldPostProcessCharChanges));\n\t\t\t}\n\t\t\treturn lineChanges;\n\t\t}\n\n\t\t// Need to post-process and introduce changes where the trim whitespace is different\n\t\t// Note that we are looping starting at -1 to also cover the lines before the first change\n\t\tlet result: LineChange[] = [];\n\n\t\tlet originalLineIndex = 0;\n\t\tlet modifiedLineIndex = 0;\n\t\tfor (let i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {\n\t\t\tconst nextChange = (i + 1 < len ? rawChanges[i + 1] : null);\n\t\t\tconst originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);\n\t\t\tconst modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);\n\n\t\t\twhile (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {\n\t\t\t\tconst originalLine = this.originalLines[originalLineIndex];\n\t\t\t\tconst modifiedLine = this.modifiedLines[modifiedLineIndex];\n\n\t\t\t\tif (originalLine !== modifiedLine) {\n\t\t\t\t\t// These lines differ only in trim whitespace\n\n\t\t\t\t\t// Check the leading whitespace\n\t\t\t\t\t{\n\t\t\t\t\t\tlet originalStartColumn = LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1);\n\t\t\t\t\t\tlet modifiedStartColumn = LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1);\n\t\t\t\t\t\twhile (originalStartColumn > 1 && modifiedStartColumn > 1) {\n\t\t\t\t\t\t\tconst originalChar = originalLine.charCodeAt(originalStartColumn - 2);\n\t\t\t\t\t\t\tconst modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);\n\t\t\t\t\t\t\tif (originalChar !== modifiedChar) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toriginalStartColumn--;\n\t\t\t\t\t\t\tmodifiedStartColumn--;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (originalStartColumn > 1 || modifiedStartColumn > 1) {\n\t\t\t\t\t\t\tthis._pushTrimWhitespaceCharChange(result,\n\t\t\t\t\t\t\t\toriginalLineIndex + 1, 1, originalStartColumn,\n\t\t\t\t\t\t\t\tmodifiedLineIndex + 1, 1, modifiedStartColumn\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check the trailing whitespace\n\t\t\t\t\t{\n\t\t\t\t\t\tlet originalEndColumn = LineMarkerSequence._getLastNonBlankColumn(originalLine, 1);\n\t\t\t\t\t\tlet modifiedEndColumn = LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1);\n\t\t\t\t\t\tconst originalMaxColumn = originalLine.length + 1;\n\t\t\t\t\t\tconst modifiedMaxColumn = modifiedLine.length + 1;\n\t\t\t\t\t\twhile (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {\n\t\t\t\t\t\t\tconst originalChar = originalLine.charCodeAt(originalEndColumn - 1);\n\t\t\t\t\t\t\tconst modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);\n\t\t\t\t\t\t\tif (originalChar !== modifiedChar) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\toriginalEndColumn++;\n\t\t\t\t\t\t\tmodifiedEndColumn++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {\n\t\t\t\t\t\t\tthis._pushTrimWhitespaceCharChange(result,\n\t\t\t\t\t\t\t\toriginalLineIndex + 1, originalEndColumn, originalMaxColumn,\n\t\t\t\t\t\t\t\tmodifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toriginalLineIndex++;\n\t\t\t\tmodifiedLineIndex++;\n\t\t\t}\n\n\t\t\tif (nextChange) {\n\t\t\t\t// Emit the actual change\n\t\t\t\tresult.push(LineChange.createFromDiffResult(nextChange, this.original, this.modified, this._continueProcessingPredicate.bind(this), this.shouldPostProcessCharChanges));\n\n\t\t\t\toriginalLineIndex += nextChange.originalLength;\n\t\t\t\tmodifiedLineIndex += nextChange.modifiedLength;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate _pushTrimWhitespaceCharChange(\n\t\tresult: LineChange[],\n\t\toriginalLineNumber: number, originalStartColumn: number, originalEndColumn: number,\n\t\tmodifiedLineNumber: number, modifiedStartColumn: number, modifiedEndColumn: number\n\t): void {\n\t\tif (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {\n\t\t\t// Merged into previous\n\t\t\treturn;\n\t\t}\n\n\t\tresult.push(new LineChange(\n\t\t\toriginalLineNumber, originalLineNumber,\n\t\t\tmodifiedLineNumber, modifiedLineNumber,\n\t\t\t[\n\t\t\t\tnew CharChange(\n\t\t\t\t\toriginalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,\n\t\t\t\t\tmodifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn\n\t\t\t\t)\n\t\t\t]\n\t\t));\n\t}\n\n\tprivate _mergeTrimWhitespaceCharChange(\n\t\tresult: LineChange[],\n\t\toriginalLineNumber: number, originalStartColumn: number, originalEndColumn: number,\n\t\tmodifiedLineNumber: number, modifiedStartColumn: number, modifiedEndColumn: number\n\t): boolean {\n\t\tconst len = result.length;\n\t\tif (len === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst prevChange = result[len - 1];\n\n\t\tif (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {\n\t\t\t// Don't merge with inserts/deletes\n\t\t\treturn false;\n\t\t}\n\n\t\tif (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {\n\t\t\tprevChange.originalEndLineNumber = originalLineNumber;\n\t\t\tprevChange.modifiedEndLineNumber = modifiedLineNumber;\n\t\t\tprevChange.charChanges.push(new CharChange(\n\t\t\t\toriginalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn,\n\t\t\t\tmodifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn\n\t\t\t));\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate _continueProcessingPredicate(): boolean {\n\t\tif (this.maximumRunTimeMs === 0) {\n\t\t\treturn true;\n\t\t}\n\t\tconst now = (new Date()).getTime();\n\t\treturn now - this.computationStartTime < this.maximumRunTimeMs;\n\t}\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'use strict';\n\nimport { IWordAtPosition } from 'vs/editor/common/model';\n\nexport const USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?';\n\n/**\n * Create a word definition regular expression based on default word separators.\n * Optionally provide allowed separators that should be included in words.\n *\n * The default would look like this:\n * /(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)/g\n */\nfunction createWordRegExp(allowInWords: string = ''): RegExp {\n\tlet source = '(-?\\\\d*\\\\.\\\\d\\\\w*)|([^';\n\tfor (let i = 0; i < USUAL_WORD_SEPARATORS.length; i++) {\n\t\tif (allowInWords.indexOf(USUAL_WORD_SEPARATORS[i]) >= 0) {\n\t\t\tcontinue;\n\t\t}\n\t\tsource += '\\\\' + USUAL_WORD_SEPARATORS[i];\n\t}\n\tsource += '\\\\s]+)';\n\treturn new RegExp(source, 'g');\n}\n\n// catches numbers (including floating numbers) in the first group, and alphanum in the second\nexport const DEFAULT_WORD_REGEXP = createWordRegExp();\n\nexport function ensureValidWordDefinition(wordDefinition?: RegExp): RegExp {\n\tlet result: RegExp = DEFAULT_WORD_REGEXP;\n\n\tif (wordDefinition && (wordDefinition instanceof RegExp)) {\n\t\tif (!wordDefinition.global) {\n\t\t\tlet flags = 'g';\n\t\t\tif (wordDefinition.ignoreCase) {\n\t\t\t\tflags += 'i';\n\t\t\t}\n\t\t\tif (wordDefinition.multiline) {\n\t\t\t\tflags += 'm';\n\t\t\t}\n\t\t\tresult = new RegExp(wordDefinition.source, flags);\n\t\t} else {\n\t\t\tresult = wordDefinition;\n\t\t}\n\t}\n\n\tresult.lastIndex = 0;\n\n\treturn result;\n}\n\nfunction getWordAtPosFast(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition {\n\t// find whitespace enclosed text around column and match from there\n\n\tlet pos = column - 1 - textOffset;\n\tlet start = text.lastIndexOf(' ', pos - 1) + 1;\n\tlet end = text.indexOf(' ', pos);\n\tif (end === -1) {\n\t\tend = text.length;\n\t}\n\n\twordDefinition.lastIndex = start;\n\tlet match: RegExpMatchArray;\n\twhile (match = wordDefinition.exec(text)) {\n\t\tif (match.index <= pos && wordDefinition.lastIndex >= pos) {\n\t\t\treturn {\n\t\t\t\tword: match[0],\n\t\t\t\tstartColumn: textOffset + 1 + match.index,\n\t\t\t\tendColumn: textOffset + 1 + wordDefinition.lastIndex\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n}\n\n\nfunction getWordAtPosSlow(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition {\n\t// matches all words starting at the beginning\n\t// of the input until it finds a match that encloses\n\t// the desired column. slow but correct\n\n\tlet pos = column - 1 - textOffset;\n\twordDefinition.lastIndex = 0;\n\n\tlet match: RegExpMatchArray;\n\twhile (match = wordDefinition.exec(text)) {\n\n\t\tif (match.index > pos) {\n\t\t\t// |nW -> matched only after the pos\n\t\t\treturn null;\n\n\t\t} else if (wordDefinition.lastIndex >= pos) {\n\t\t\t// W|W -> match encloses pos\n\t\t\treturn {\n\t\t\t\tword: match[0],\n\t\t\t\tstartColumn: textOffset + 1 + match.index,\n\t\t\t\tendColumn: textOffset + 1 + wordDefinition.lastIndex\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function getWordAtText(column: number, wordDefinition: RegExp, text: string, textOffset: number): IWordAtPosition {\n\n\t// if `words` can contain whitespace character we have to use the slow variant\n\t// otherwise we use the fast variant of finding a word\n\twordDefinition.lastIndex = 0;\n\tlet match = wordDefinition.exec(text);\n\tif (!match) {\n\t\treturn null;\n\t}\n\t// todo@joh the `match` could already be the (first) word\n\tconst ret = match[0].indexOf(' ') >= 0\n\t\t// did match a word which contains a space character -> use slow word find\n\t\t? getWordAtPosSlow(column, wordDefinition, text, textOffset)\n\t\t// sane word definition -> use fast word find\n\t\t: getWordAtPosFast(column, wordDefinition, text, textOffset);\n\n\t// both (getWordAtPosFast and getWordAtPosSlow) leave the wordDefinition-RegExp\n\t// in an undefined state and to not confuse other users of the wordDefinition\n\t// we reset the lastIndex\n\twordDefinition.lastIndex = 0;\n\n\treturn ret;\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'use strict';\n\nimport { ILink } from 'vs/editor/common/modes';\nimport { CharCode } from 'vs/base/common/charCode';\nimport { CharacterClassifier } from 'vs/editor/common/core/characterClassifier';\nimport { Uint8Matrix } from 'vs/editor/common/core/uint';\n\nexport interface ILinkComputerTarget {\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n}\n\nconst enum State {\n\tInvalid = 0,\n\tStart = 1,\n\tH = 2,\n\tHT = 3,\n\tHTT = 4,\n\tHTTP = 5,\n\tF = 6,\n\tFI = 7,\n\tFIL = 8,\n\tBeforeColon = 9,\n\tAfterColon = 10,\n\tAlmostThere = 11,\n\tEnd = 12,\n\tAccept = 13\n}\n\ntype Edge = [State, number, State];\n\nclass StateMachine {\n\n\tprivate _states: Uint8Matrix;\n\tprivate _maxCharCode: number;\n\n\tconstructor(edges: Edge[]) {\n\t\tlet maxCharCode = 0;\n\t\tlet maxState = State.Invalid;\n\t\tfor (let i = 0, len = edges.length; i < len; i++) {\n\t\t\tlet [from, chCode, to] = edges[i];\n\t\t\tif (chCode > maxCharCode) {\n\t\t\t\tmaxCharCode = chCode;\n\t\t\t}\n\t\t\tif (from > maxState) {\n\t\t\t\tmaxState = from;\n\t\t\t}\n\t\t\tif (to > maxState) {\n\t\t\t\tmaxState = to;\n\t\t\t}\n\t\t}\n\n\t\tmaxCharCode++;\n\t\tmaxState++;\n\n\t\tlet states = new Uint8Matrix(maxState, maxCharCode, State.Invalid);\n\t\tfor (let i = 0, len = edges.length; i < len; i++) {\n\t\t\tlet [from, chCode, to] = edges[i];\n\t\t\tstates.set(from, chCode, to);\n\t\t}\n\n\t\tthis._states = states;\n\t\tthis._maxCharCode = maxCharCode;\n\t}\n\n\tpublic nextState(currentState: State, chCode: number): State {\n\t\tif (chCode < 0 || chCode >= this._maxCharCode) {\n\t\t\treturn State.Invalid;\n\t\t}\n\t\treturn this._states.get(currentState, chCode);\n\t}\n}\n\n// State machine for http:// or https:// or file://\nlet _stateMachine: StateMachine = null;\nfunction getStateMachine(): StateMachine {\n\tif (_stateMachine === null) {\n\t\t_stateMachine = new StateMachine([\n\t\t\t[State.Start, CharCode.h, State.H],\n\t\t\t[State.Start, CharCode.H, State.H],\n\t\t\t[State.Start, CharCode.f, State.F],\n\t\t\t[State.Start, CharCode.F, State.F],\n\n\t\t\t[State.H, CharCode.t, State.HT],\n\t\t\t[State.H, CharCode.T, State.HT],\n\n\t\t\t[State.HT, CharCode.t, State.HTT],\n\t\t\t[State.HT, CharCode.T, State.HTT],\n\n\t\t\t[State.HTT, CharCode.p, State.HTTP],\n\t\t\t[State.HTT, CharCode.P, State.HTTP],\n\n\t\t\t[State.HTTP, CharCode.s, State.BeforeColon],\n\t\t\t[State.HTTP, CharCode.S, State.BeforeColon],\n\t\t\t[State.HTTP, CharCode.Colon, State.AfterColon],\n\n\t\t\t[State.F, CharCode.i, State.FI],\n\t\t\t[State.F, CharCode.I, State.FI],\n\n\t\t\t[State.FI, CharCode.l, State.FIL],\n\t\t\t[State.FI, CharCode.L, State.FIL],\n\n\t\t\t[State.FIL, CharCode.e, State.BeforeColon],\n\t\t\t[State.FIL, CharCode.E, State.BeforeColon],\n\n\t\t\t[State.BeforeColon, CharCode.Colon, State.AfterColon],\n\n\t\t\t[State.AfterColon, CharCode.Slash, State.AlmostThere],\n\n\t\t\t[State.AlmostThere, CharCode.Slash, State.End],\n\t\t]);\n\t}\n\treturn _stateMachine;\n}\n\n\nconst enum CharacterClass {\n\tNone = 0,\n\tForceTermination = 1,\n\tCannotEndIn = 2\n}\n\nlet _classifier: CharacterClassifier<CharacterClass> = null;\nfunction getClassifier(): CharacterClassifier<CharacterClass> {\n\tif (_classifier === null) {\n\t\t_classifier = new CharacterClassifier<CharacterClass>(CharacterClass.None);\n\n\t\tconst FORCE_TERMINATION_CHARACTERS = ' \\t<>\\'\\\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…';\n\t\tfor (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {\n\t\t\t_classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), CharacterClass.ForceTermination);\n\t\t}\n\n\t\tconst CANNOT_END_WITH_CHARACTERS = '.,;';\n\t\tfor (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {\n\t\t\t_classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), CharacterClass.CannotEndIn);\n\t\t}\n\t}\n\treturn _classifier;\n}\n\nclass LinkComputer {\n\n\tprivate static _createLink(classifier: CharacterClassifier<CharacterClass>, line: string, lineNumber: number, linkBeginIndex: number, linkEndIndex: number): ILink {\n\t\t// Do not allow to end link in certain characters...\n\t\tlet lastIncludedCharIndex = linkEndIndex - 1;\n\t\tdo {\n\t\t\tconst chCode = line.charCodeAt(lastIncludedCharIndex);\n\t\t\tconst chClass = classifier.get(chCode);\n\t\t\tif (chClass !== CharacterClass.CannotEndIn) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlastIncludedCharIndex--;\n\t\t} while (lastIncludedCharIndex > linkBeginIndex);\n\n\t\t// Handle links enclosed in parens, square brackets and curlys.\n\t\tif (linkBeginIndex > 0) {\n\t\t\tconst charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);\n\t\t\tconst lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);\n\n\t\t\tif (\n\t\t\t\t(charCodeBeforeLink === CharCode.OpenParen && lastCharCodeInLink === CharCode.CloseParen)\n\t\t\t\t|| (charCodeBeforeLink === CharCode.OpenSquareBracket && lastCharCodeInLink === CharCode.CloseSquareBracket)\n\t\t\t\t|| (charCodeBeforeLink === CharCode.OpenCurlyBrace && lastCharCodeInLink === CharCode.CloseCurlyBrace)\n\t\t\t) {\n\t\t\t\t// Do not end in ) if ( is before the link start\n\t\t\t\t// Do not end in ] if [ is before the link start\n\t\t\t\t// Do not end in } if { is before the link start\n\t\t\t\tlastIncludedCharIndex--;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trange: {\n\t\t\t\tstartLineNumber: lineNumber,\n\t\t\t\tstartColumn: linkBeginIndex + 1,\n\t\t\t\tendLineNumber: lineNumber,\n\t\t\t\tendColumn: lastIncludedCharIndex + 2\n\t\t\t},\n\t\t\turl: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)\n\t\t};\n\t}\n\n\tpublic static computeLinks(model: ILinkComputerTarget): ILink[] {\n\t\tconst stateMachine = getStateMachine();\n\t\tconst classifier = getClassifier();\n\n\t\tlet result: ILink[] = [];\n\t\tfor (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {\n\t\t\tconst line = model.getLineContent(i);\n\t\t\tconst len = line.length;\n\n\t\t\tlet j = 0;\n\t\t\tlet linkBeginIndex = 0;\n\t\t\tlet linkBeginChCode = 0;\n\t\t\tlet state = State.Start;\n\t\t\tlet hasOpenParens = false;\n\t\t\tlet hasOpenSquareBracket = false;\n\t\t\tlet hasOpenCurlyBracket = false;\n\n\t\t\twhile (j < len) {\n\n\t\t\t\tlet resetStateMachine = false;\n\t\t\t\tconst chCode = line.charCodeAt(j);\n\n\t\t\t\tif (state === State.Accept) {\n\t\t\t\t\tlet chClass: CharacterClass;\n\t\t\t\t\tswitch (chCode) {\n\t\t\t\t\t\tcase CharCode.OpenParen:\n\t\t\t\t\t\t\thasOpenParens = true;\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.CloseParen:\n\t\t\t\t\t\t\tchClass = (hasOpenParens ? CharacterClass.None : CharacterClass.ForceTermination);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.OpenSquareBracket:\n\t\t\t\t\t\t\thasOpenSquareBracket = true;\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.CloseSquareBracket:\n\t\t\t\t\t\t\tchClass = (hasOpenSquareBracket ? CharacterClass.None : CharacterClass.ForceTermination);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.OpenCurlyBrace:\n\t\t\t\t\t\t\thasOpenCurlyBracket = true;\n\t\t\t\t\t\t\tchClass = CharacterClass.None;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.CloseCurlyBrace:\n\t\t\t\t\t\t\tchClass = (hasOpenCurlyBracket ? CharacterClass.None : CharacterClass.ForceTermination);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t/* The following three rules make it that ' or \" or ` are allowed inside links if the link began with a different one */\n\t\t\t\t\t\tcase CharCode.SingleQuote:\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.DoubleQuote || linkBeginChCode === CharCode.BackTick) ? CharacterClass.None : CharacterClass.ForceTermination;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.DoubleQuote:\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.SingleQuote || linkBeginChCode === CharCode.BackTick) ? CharacterClass.None : CharacterClass.ForceTermination;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase CharCode.BackTick:\n\t\t\t\t\t\t\tchClass = (linkBeginChCode === CharCode.SingleQuote || linkBeginChCode === CharCode.DoubleQuote) ? CharacterClass.None : CharacterClass.ForceTermination;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tchClass = classifier.get(chCode);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if character terminates link\n\t\t\t\t\tif (chClass === CharacterClass.ForceTermination) {\n\t\t\t\t\t\tresult.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));\n\t\t\t\t\t\tresetStateMachine = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (state === State.End) {\n\t\t\t\t\tconst chClass = classifier.get(chCode);\n\n\t\t\t\t\t// Check if character terminates link\n\t\t\t\t\tif (chClass === CharacterClass.ForceTermination) {\n\t\t\t\t\t\tresetStateMachine = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate = State.Accept;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstate = stateMachine.nextState(state, chCode);\n\t\t\t\t\tif (state === State.Invalid) {\n\t\t\t\t\t\tresetStateMachine = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (resetStateMachine) {\n\t\t\t\t\tstate = State.Start;\n\t\t\t\t\thasOpenParens = false;\n\t\t\t\t\thasOpenSquareBracket = false;\n\t\t\t\t\thasOpenCurlyBracket = false;\n\n\t\t\t\t\t// Record where the link started\n\t\t\t\t\tlinkBeginIndex = j + 1;\n\t\t\t\t\tlinkBeginChCode = chCode;\n\t\t\t\t}\n\n\t\t\t\tj++;\n\t\t\t}\n\n\t\t\tif (state === State.Accept) {\n\t\t\t\tresult.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));\n\t\t\t}\n\n\t\t}\n\n\t\treturn result;\n\t}\n}\n\n/**\n * Returns an array of all links contains in the provided\n * document. *Note* that this operation is computational\n * expensive and should not run in the UI thread.\n */\nexport function computeLinks(model: ILinkComputerTarget): ILink[] {\n\tif (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') {\n\t\t// Unknown caller!\n\t\treturn [];\n\t}\n\treturn LinkComputer.computeLinks(model);\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'use strict';\n\nimport { IInplaceReplaceSupportResult } from 'vs/editor/common/modes';\nimport { IRange } from 'vs/editor/common/core/range';\n\nexport class BasicInplaceReplace {\n\n\tpublic static readonly INSTANCE = new BasicInplaceReplace();\n\n\tpublic navigateValueSet(range1: IRange, text1: string, range2: IRange, text2: string, up: boolean): IInplaceReplaceSupportResult {\n\n\t\tif (range1 && text1) {\n\t\t\tlet result = this.doNavigateValueSet(text1, up);\n\t\t\tif (result) {\n\t\t\t\treturn {\n\t\t\t\t\trange: range1,\n\t\t\t\t\tvalue: result\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif (range2 && text2) {\n\t\t\tlet result = this.doNavigateValueSet(text2, up);\n\t\t\tif (result) {\n\t\t\t\treturn {\n\t\t\t\t\trange: range2,\n\t\t\t\t\tvalue: result\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate doNavigateValueSet(text: string, up: boolean): string {\n\t\tlet numberResult = this.numberReplace(text, up);\n\t\tif (numberResult !== null) {\n\t\t\treturn numberResult;\n\t\t}\n\t\treturn this.textReplace(text, up);\n\t}\n\n\tprivate numberReplace(value: string, up: boolean): string {\n\t\tlet precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1));\n\t\tlet n1 = Number(value);\n\t\tlet n2 = parseFloat(value);\n\n\t\tif (!isNaN(n1) && !isNaN(n2) && n1 === n2) {\n\n\t\t\tif (n1 === 0 && !up) {\n\t\t\t\treturn null; // don't do negative\n\t\t\t\t//\t\t\t} else if(n1 === 9 && up) {\n\t\t\t\t//\t\t\t\treturn null; // don't insert 10 into a number\n\t\t\t} else {\n\t\t\t\tn1 = Math.floor(n1 * precision);\n\t\t\t\tn1 += up ? precision : -precision;\n\t\t\t\treturn String(n1 / precision);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _defaultValueSet: string[][] = [\n\t\t['true', 'false'],\n\t\t['True', 'False'],\n\t\t['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'],\n\t\t['public', 'protected', 'private'],\n\t];\n\n\tprivate textReplace(value: string, up: boolean): string {\n\t\treturn this.valueSetsReplace(this._defaultValueSet, value, up);\n\t}\n\n\tprivate valueSetsReplace(valueSets: string[][], value: string, up: boolean): string {\n\t\tlet result: string = null;\n\t\tfor (let i = 0, len = valueSets.length; result === null && i < len; i++) {\n\t\t\tresult = this.valueSetReplace(valueSets[i], value, up);\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate valueSetReplace(valueSet: string[], value: string, up: boolean): string {\n\t\tlet idx = valueSet.indexOf(value);\n\t\tif (idx >= 0) {\n\t\t\tidx += up ? +1 : -1;\n\t\t\tif (idx < 0) {\n\t\t\t\tidx = valueSet.length - 1;\n\t\t\t} else {\n\t\t\t\tidx %= valueSet.length;\n\t\t\t}\n\t\t\treturn valueSet[idx];\n\t\t}\n\t\treturn null;\n\t}\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'use strict';\n\nimport { Emitter } from 'vs/base/common/event';\nimport { KeyMod as ConstKeyMod, KeyChord } from 'vs/base/common/keyCodes';\nimport { Position } from 'vs/editor/common/core/position';\nimport { Range } from 'vs/editor/common/core/range';\nimport { Selection, SelectionDirection } from 'vs/editor/common/core/selection';\nimport { TPromise } from 'vs/base/common/winjs.base';\nimport { CancellationTokenSource } from 'vs/base/common/cancellation';\nimport { Token } from 'vs/editor/common/core/token';\nimport URI from 'vs/base/common/uri';\n\n// --------------------------------------------\n// This is repeated here so it can be exported\n// because TS inlines const enums\n// --------------------------------------------\nexport enum Severity {\n\tIgnore = 0,\n\tInfo = 1,\n\tWarning = 2,\n\tError = 3,\n}\n\nexport enum MarkerSeverity {\n\tHint = 1,\n\tInfo = 2,\n\tWarning = 4,\n\tError = 8,\n}\n\n// --------------------------------------------\n// This is repeated here so it can be exported\n// because TS inlines const enums\n// --------------------------------------------\nexport class KeyMod {\n\tpublic static readonly CtrlCmd: number = ConstKeyMod.CtrlCmd;\n\tpublic static readonly Shift: number = ConstKeyMod.Shift;\n\tpublic static readonly Alt: number = ConstKeyMod.Alt;\n\tpublic static readonly WinCtrl: number = ConstKeyMod.WinCtrl;\n\n\tpublic static chord(firstPart: number, secondPart: number): number {\n\t\treturn KeyChord(firstPart, secondPart);\n\t}\n}\n\n// --------------------------------------------\n// This is repeated here so it can be exported\n// because TS inlines const enums\n// --------------------------------------------\n/**\n * Virtual Key Codes, the value does not hold any inherent meaning.\n * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx\n * But these are \"more general\", as they should work across browsers & OS`s.\n */\nexport enum KeyCode {\n\t/**\n\t * Placed first to cover the 0 value of the enum.\n\t */\n\tUnknown = 0,\n\tBackspace = 1,\n\tTab = 2,\n\tEnter = 3,\n\tShift = 4,\n\tCtrl = 5,\n\tAlt = 6,\n\tPauseBreak = 7,\n\tCapsLock = 8,\n\tEscape = 9,\n\tSpace = 10,\n\tPageUp = 11,\n\tPageDown = 12,\n\tEnd = 13,\n\tHome = 14,\n\tLeftArrow = 15,\n\tUpArrow = 16,\n\tRightArrow = 17,\n\tDownArrow = 18,\n\tInsert = 19,\n\tDelete = 20,\n\tKEY_0 = 21,\n\tKEY_1 = 22,\n\tKEY_2 = 23,\n\tKEY_3 = 24,\n\tKEY_4 = 25,\n\tKEY_5 = 26,\n\tKEY_6 = 27,\n\tKEY_7 = 28,\n\tKEY_8 = 29,\n\tKEY_9 = 30,\n\tKEY_A = 31,\n\tKEY_B = 32,\n\tKEY_C = 33,\n\tKEY_D = 34,\n\tKEY_E = 35,\n\tKEY_F = 36,\n\tKEY_G = 37,\n\tKEY_H = 38,\n\tKEY_I = 39,\n\tKEY_J = 40,\n\tKEY_K = 41,\n\tKEY_L = 42,\n\tKEY_M = 43,\n\tKEY_N = 44,\n\tKEY_O = 45,\n\tKEY_P = 46,\n\tKEY_Q = 47,\n\tKEY_R = 48,\n\tKEY_S = 49,\n\tKEY_T = 50,\n\tKEY_U = 51,\n\tKEY_V = 52,\n\tKEY_W = 53,\n\tKEY_X = 54,\n\tKEY_Y = 55,\n\tKEY_Z = 56,\n\tMeta = 57,\n\tContextMenu = 58,\n\tF1 = 59,\n\tF2 = 60,\n\tF3 = 61,\n\tF4 = 62,\n\tF5 = 63,\n\tF6 = 64,\n\tF7 = 65,\n\tF8 = 66,\n\tF9 = 67,\n\tF10 = 68,\n\tF11 = 69,\n\tF12 = 70,\n\tF13 = 71,\n\tF14 = 72,\n\tF15 = 73,\n\tF16 = 74,\n\tF17 = 75,\n\tF18 = 76,\n\tF19 = 77,\n\tNumLock = 78,\n\tScrollLock = 79,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ';:' key\n\t */\n\tUS_SEMICOLON = 80,\n\t/**\n\t * For any country/region, the '+' key\n\t * For the US standard keyboard, the '=+' key\n\t */\n\tUS_EQUAL = 81,\n\t/**\n\t * For any country/region, the ',' key\n\t * For the US standard keyboard, the ',<' key\n\t */\n\tUS_COMMA = 82,\n\t/**\n\t * For any country/region, the '-' key\n\t * For the US standard keyboard, the '-_' key\n\t */\n\tUS_MINUS = 83,\n\t/**\n\t * For any country/region, the '.' key\n\t * For the US standard keyboard, the '.>' key\n\t */\n\tUS_DOT = 84,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '/?' key\n\t */\n\tUS_SLASH = 85,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '`~' key\n\t */\n\tUS_BACKTICK = 86,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '[{' key\n\t */\n\tUS_OPEN_SQUARE_BRACKET = 87,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the '\\|' key\n\t */\n\tUS_BACKSLASH = 88,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ']}' key\n\t */\n\tUS_CLOSE_SQUARE_BRACKET = 89,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t * For the US standard keyboard, the ''\"' key\n\t */\n\tUS_QUOTE = 90,\n\t/**\n\t * Used for miscellaneous characters; it can vary by keyboard.\n\t */\n\tOEM_8 = 91,\n\t/**\n\t * Either the angle bracket key or the backslash key on the RT 102-key keyboard.\n\t */\n\tOEM_102 = 92,\n\tNUMPAD_0 = 93,\n\tNUMPAD_1 = 94,\n\tNUMPAD_2 = 95,\n\tNUMPAD_3 = 96,\n\tNUMPAD_4 = 97,\n\tNUMPAD_5 = 98,\n\tNUMPAD_6 = 99,\n\tNUMPAD_7 = 100,\n\tNUMPAD_8 = 101,\n\tNUMPAD_9 = 102,\n\tNUMPAD_MULTIPLY = 103,\n\tNUMPAD_ADD = 104,\n\tNUMPAD_SEPARATOR = 105,\n\tNUMPAD_SUBTRACT = 106,\n\tNUMPAD_DECIMAL = 107,\n\tNUMPAD_DIVIDE = 108,\n\t/**\n\t * Cover all key codes when IME is processing input.\n\t */\n\tKEY_IN_COMPOSITION = 109,\n\tABNT_C1 = 110,\n\tABNT_C2 = 111,\n\t/**\n\t * Placed last to cover the length of the enum.\n\t * Please do not depend on this value!\n\t */\n\tMAX_VALUE\n}\n\nexport function createMonacoBaseAPI(): typeof monaco {\n\treturn {\n\t\teditor: undefined,\n\t\tlanguages: undefined,\n\t\tCancellationTokenSource: CancellationTokenSource,\n\t\tEmitter: Emitter,\n\t\tKeyCode: KeyCode,\n\t\tKeyMod: KeyMod,\n\t\tPosition: Position,\n\t\tRange: Range,\n\t\tSelection: Selection,\n\t\tSelectionDirection: SelectionDirection,\n\t\tSeverity: Severity,\n\t\tMarkerSeverity: MarkerSeverity,\n\t\tPromise: TPromise,\n\t\tUri: <any>URI,\n\t\tToken: Token\n\t};\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'use strict';\n\nimport { toUint32 } from 'vs/editor/common/core/uint';\n\nexport class PrefixSumIndexOfResult {\n\t_prefixSumIndexOfResultBrand: void;\n\n\tindex: number;\n\tremainder: number;\n\n\tconstructor(index: number, remainder: number) {\n\t\tthis.index = index;\n\t\tthis.remainder = remainder;\n\t}\n}\n\nexport class PrefixSumComputer {\n\n\t/**\n\t * values[i] is the value at index i\n\t */\n\tprivate values: Uint32Array;\n\n\t/**\n\t * prefixSum[i] = SUM(heights[j]), 0 <= j <= i\n\t */\n\tprivate prefixSum: Uint32Array;\n\n\t/**\n\t * prefixSum[i], 0 <= i <= prefixSumValidIndex can be trusted\n\t */\n\tprivate prefixSumValidIndex: Int32Array;\n\n\tconstructor(values: Uint32Array) {\n\t\tthis.values = values;\n\t\tthis.prefixSum = new Uint32Array(values.length);\n\t\tthis.prefixSumValidIndex = new Int32Array(1);\n\t\tthis.prefixSumValidIndex[0] = -1;\n\t}\n\n\tpublic getCount(): number {\n\t\treturn this.values.length;\n\t}\n\n\tpublic insertValues(insertIndex: number, insertValues: Uint32Array): boolean {\n\t\tinsertIndex = toUint32(insertIndex);\n\t\tconst oldValues = this.values;\n\t\tconst oldPrefixSum = this.prefixSum;\n\t\tconst insertValuesLen = insertValues.length;\n\n\t\tif (insertValuesLen === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.values = new Uint32Array(oldValues.length + insertValuesLen);\n\t\tthis.values.set(oldValues.subarray(0, insertIndex), 0);\n\t\tthis.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);\n\t\tthis.values.set(insertValues, insertIndex);\n\n\t\tif (insertIndex - 1 < this.prefixSumValidIndex[0]) {\n\t\t\tthis.prefixSumValidIndex[0] = insertIndex - 1;\n\t\t}\n\n\t\tthis.prefixSum = new Uint32Array(this.values.length);\n\t\tif (this.prefixSumValidIndex[0] >= 0) {\n\t\t\tthis.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic changeValue(index: number, value: number): boolean {\n\t\tindex = toUint32(index);\n\t\tvalue = toUint32(value);\n\n\t\tif (this.values[index] === value) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.values[index] = value;\n\t\tif (index - 1 < this.prefixSumValidIndex[0]) {\n\t\t\tthis.prefixSumValidIndex[0] = index - 1;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic removeValues(startIndex: number, cnt: number): boolean {\n\t\tstartIndex = toUint32(startIndex);\n\t\tcnt = toUint32(cnt);\n\n\t\tconst oldValues = this.values;\n\t\tconst oldPrefixSum = this.prefixSum;\n\n\t\tif (startIndex >= oldValues.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlet maxCnt = oldValues.length - startIndex;\n\t\tif (cnt >= maxCnt) {\n\t\t\tcnt = maxCnt;\n\t\t}\n\n\t\tif (cnt === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.values = new Uint32Array(oldValues.length - cnt);\n\t\tthis.values.set(oldValues.subarray(0, startIndex), 0);\n\t\tthis.values.set(oldValues.subarray(startIndex + cnt), startIndex);\n\n\t\tthis.prefixSum = new Uint32Array(this.values.length);\n\t\tif (startIndex - 1 < this.prefixSumValidIndex[0]) {\n\t\t\tthis.prefixSumValidIndex[0] = startIndex - 1;\n\t\t}\n\t\tif (this.prefixSumValidIndex[0] >= 0) {\n\t\t\tthis.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic getTotalValue(): number {\n\t\tif (this.values.length === 0) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn this._getAccumulatedValue(this.values.length - 1);\n\t}\n\n\tpublic getAccumulatedValue(index: number): number {\n\t\tif (index < 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tindex = toUint32(index);\n\t\treturn this._getAccumulatedValue(index);\n\t}\n\n\tprivate _getAccumulatedValue(index: number): number {\n\t\tif (index <= this.prefixSumValidIndex[0]) {\n\t\t\treturn this.prefixSum[index];\n\t\t}\n\n\t\tlet startIndex = this.prefixSumValidIndex[0] + 1;\n\t\tif (startIndex === 0) {\n\t\t\tthis.prefixSum[0] = this.values[0];\n\t\t\tstartIndex++;\n\t\t}\n\n\t\tif (index >= this.values.length) {\n\t\t\tindex = this.values.length - 1;\n\t\t}\n\n\t\tfor (let i = startIndex; i <= index; i++) {\n\t\t\tthis.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];\n\t\t}\n\t\tthis.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);\n\t\treturn this.prefixSum[index];\n\t}\n\n\tpublic getIndexOf(accumulatedValue: number): PrefixSumIndexOfResult {\n\t\taccumulatedValue = Math.floor(accumulatedValue); //@perf\n\n\t\t// Compute all sums (to get a fully valid prefixSum)\n\t\tthis.getTotalValue();\n\n\t\tlet low = 0;\n\t\tlet high = this.values.length - 1;\n\t\tlet mid: number;\n\t\tlet midStop: number;\n\t\tlet midStart: number;\n\n\t\twhile (low <= high) {\n\t\t\tmid = low + ((high - low) / 2) | 0;\n\n\t\t\tmidStop = this.prefixSum[mid];\n\t\t\tmidStart = midStop - this.values[mid];\n\n\t\t\tif (accumulatedValue < midStart) {\n\t\t\t\thigh = mid - 1;\n\t\t\t} else if (accumulatedValue >= midStop) {\n\t\t\t\tlow = mid + 1;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn new PrefixSumIndexOfResult(mid, accumulatedValue - midStart);\n\t}\n}\n\nexport class PrefixSumComputerWithCache {\n\n\tprivate readonly _actual: PrefixSumComputer;\n\tprivate _cacheAccumulatedValueStart: number = 0;\n\tprivate _cache: PrefixSumIndexOfResult[] = null;\n\n\tconstructor(values: Uint32Array) {\n\t\tthis._actual = new PrefixSumComputer(values);\n\t\tthis._bustCache();\n\t}\n\n\tprivate _bustCache(): void {\n\t\tthis._cacheAccumulatedValueStart = 0;\n\t\tthis._cache = null;\n\t}\n\n\tpublic insertValues(insertIndex: number, insertValues: Uint32Array): void {\n\t\tif (this._actual.insertValues(insertIndex, insertValues)) {\n\t\t\tthis._bustCache();\n\t\t}\n\t}\n\n\tpublic changeValue(index: number, value: number): void {\n\t\tif (this._actual.changeValue(index, value)) {\n\t\t\tthis._bustCache();\n\t\t}\n\t}\n\n\tpublic removeValues(startIndex: number, cnt: number): void {\n\t\tif (this._actual.removeValues(startIndex, cnt)) {\n\t\t\tthis._bustCache();\n\t\t}\n\t}\n\n\tpublic getTotalValue(): number {\n\t\treturn this._actual.getTotalValue();\n\t}\n\n\tpublic getAccumulatedValue(index: number): number {\n\t\treturn this._actual.getAccumulatedValue(index);\n\t}\n\n\tpublic getIndexOf(accumulatedValue: number): PrefixSumIndexOfResult {\n\t\taccumulatedValue = Math.floor(accumulatedValue); //@perf\n\n\t\tif (this._cache !== null) {\n\t\t\tlet cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart;\n\t\t\tif (cacheIndex >= 0 && cacheIndex < this._cache.length) {\n\t\t\t\t// Cache hit!\n\t\t\t\treturn this._cache[cacheIndex];\n\t\t\t}\n\t\t}\n\n\t\t// Cache miss!\n\t\treturn this._actual.getIndexOf(accumulatedValue);\n\t}\n\n\t/**\n\t * Gives a hint that a lot of requests are about to come in for these accumulated values.\n\t */\n\tpublic warmUpCache(accumulatedValueStart: number, accumulatedValueEnd: number): void {\n\t\tlet newCache: PrefixSumIndexOfResult[] = [];\n\t\tfor (let accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) {\n\t\t\tnewCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue);\n\t\t}\n\t\tthis._cache = newCache;\n\t\tthis._cacheAccumulatedValueStart = accumulatedValueStart;\n\t}\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'use strict';\n\nimport URI from 'vs/base/common/uri';\nimport { IRange } from 'vs/editor/common/core/range';\nimport { PrefixSumComputer } from 'vs/editor/common/viewModel/prefixSumComputer';\nimport { IModelContentChange } from 'vs/editor/common/model/textModelEvents';\nimport { Position } from 'vs/editor/common/core/position';\n\nexport interface IModelChangedEvent {\n\t/**\n\t * The actual changes.\n\t */\n\treadonly changes: IModelContentChange[];\n\t/**\n\t * The (new) end-of-line character.\n\t */\n\treadonly eol: string;\n\t/**\n\t * The new version id the model has transitioned to.\n\t */\n\treadonly versionId: number;\n}\n\nexport class MirrorTextModel {\n\n\tprotected _uri: URI;\n\tprotected _lines: string[];\n\tprotected _eol: string;\n\tprotected _versionId: number;\n\tprotected _lineStarts: PrefixSumComputer;\n\n\tconstructor(uri: URI, lines: string[], eol: string, versionId: number) {\n\t\tthis._uri = uri;\n\t\tthis._lines = lines;\n\t\tthis._eol = eol;\n\t\tthis._versionId = versionId;\n\t}\n\n\tdispose(): void {\n\t\tthis._lines.length = 0;\n\t}\n\n\tget version(): number {\n\t\treturn this._versionId;\n\t}\n\n\tgetText(): string {\n\t\treturn this._lines.join(this._eol);\n\t}\n\n\tonEvents(e: IModelChangedEvent): void {\n\t\tif (e.eol && e.eol !== this._eol) {\n\t\t\tthis._eol = e.eol;\n\t\t\tthis._lineStarts = null;\n\t\t}\n\n\t\t// Update my lines\n\t\tconst changes = e.changes;\n\t\tfor (let i = 0, len = changes.length; i < len; i++) {\n\t\t\tconst change = changes[i];\n\t\t\tthis._acceptDeleteRange(change.range);\n\t\t\tthis._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text);\n\t\t}\n\n\t\tthis._versionId = e.versionId;\n\t}\n\n\tprotected _ensureLineStarts(): void {\n\t\tif (!this._lineStarts) {\n\t\t\tconst eolLength = this._eol.length;\n\t\t\tconst linesLength = this._lines.length;\n\t\t\tconst lineStartValues = new Uint32Array(linesLength);\n\t\t\tfor (let i = 0; i < linesLength; i++) {\n\t\t\t\tlineStartValues[i] = this._lines[i].length + eolLength;\n\t\t\t}\n\t\t\tthis._lineStarts = new PrefixSumComputer(lineStartValues);\n\t\t}\n\t}\n\n\t/**\n\t * All changes to a line's text go through this method\n\t */\n\tprivate _setLineText(lineIndex: number, newValue: string): void {\n\t\tthis._lines[lineIndex] = newValue;\n\t\tif (this._lineStarts) {\n\t\t\t// update prefix sum\n\t\t\tthis._lineStarts.changeValue(lineIndex, this._lines[lineIndex].length + this._eol.length);\n\t\t}\n\t}\n\n\tprivate _acceptDeleteRange(range: IRange): void {\n\n\t\tif (range.startLineNumber === range.endLineNumber) {\n\t\t\tif (range.startColumn === range.endColumn) {\n\t\t\t\t// Nothing to delete\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Delete text on the affected line\n\t\t\tthis._setLineText(range.startLineNumber - 1,\n\t\t\t\tthis._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\n\t\t\t\t+ this._lines[range.startLineNumber - 1].substring(range.endColumn - 1)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Take remaining text on last line and append it to remaining text on first line\n\t\tthis._setLineText(range.startLineNumber - 1,\n\t\t\tthis._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)\n\t\t\t+ this._lines[range.endLineNumber - 1].substring(range.endColumn - 1)\n\t\t);\n\n\t\t// Delete middle lines\n\t\tthis._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n\t\tif (this._lineStarts) {\n\t\t\t// update prefix sum\n\t\t\tthis._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);\n\t\t}\n\t}\n\n\tprivate _acceptInsertText(position: Position, insertText: string): void {\n\t\tif (insertText.length === 0) {\n\t\t\t// Nothing to insert\n\t\t\treturn;\n\t\t}\n\t\tlet insertLines = insertText.split(/\\r\\n|\\r|\\n/);\n\t\tif (insertLines.length === 1) {\n\t\t\t// Inserting text on one line\n\t\t\tthis._setLineText(position.lineNumber - 1,\n\t\t\t\tthis._lines[position.lineNumber - 1].substring(0, position.column - 1)\n\t\t\t\t+ insertLines[0]\n\t\t\t\t+ this._lines[position.lineNumber - 1].substring(position.column - 1)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Append overflowing text from first line to the end of text to insert\n\t\tinsertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);\n\n\t\t// Delete overflowing text from first line and insert text on first line\n\t\tthis._setLineText(position.lineNumber - 1,\n\t\t\tthis._lines[position.lineNumber - 1].substring(0, position.column - 1)\n\t\t\t+ insertLines[0]\n\t\t);\n\n\t\t// Insert new lines & store lengths\n\t\tlet newLengths = new Uint32Array(insertLines.length - 1);\n\t\tfor (let i = 1; i < insertLines.length; i++) {\n\t\t\tthis._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);\n\t\t\tnewLengths[i - 1] = insertLines[i].length + this._eol.length;\n\t\t}\n\n\t\tif (this._lineStarts) {\n\t\t\t// update prefix sum\n\t\t\tthis._lineStarts.insertValues(position.lineNumber, newLengths);\n\t\t}\n\t}\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\n'use strict';\n\nimport URI from 'vs/base/common/uri';\nimport { TPromise } from 'vs/base/common/winjs.base';\nimport { IDisposable } from 'vs/base/common/lifecycle';\nimport { IRequestHandler } from 'vs/base/common/worker/simpleWorker';\nimport { Range, IRange } from 'vs/editor/common/core/range';\nimport { DiffComputer } from 'vs/editor/common/diff/diffComputer';\nimport { stringDiff } from 'vs/base/common/diff/diff';\nimport * as editorCommon from 'vs/editor/common/editorCommon';\nimport { Position, IPosition } from 'vs/editor/common/core/position';\nimport { MirrorTextModel as BaseMirrorModel, IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel';\nimport { IInplaceReplaceSupportResult, ILink, ISuggestResult, ISuggestion, TextEdit } from 'vs/editor/common/modes';\nimport { computeLinks } from 'vs/editor/common/modes/linkComputer';\nimport { BasicInplaceReplace } from 'vs/editor/common/modes/supports/inplaceReplaceSupport';\nimport { getWordAtText, ensureValidWordDefinition } from 'vs/editor/common/model/wordHelper';\nimport { createMonacoBaseAPI } from 'vs/editor/common/standalone/standaloneBase';\nimport { IWordAtPosition, EndOfLineSequence } from 'vs/editor/common/model';\nimport { globals } from 'vs/base/common/platform';\nimport { IIterator } from 'vs/base/common/iterator';\n\nexport interface IMirrorModel {\n\treadonly uri: URI;\n\treadonly version: number;\n\tgetValue(): string;\n}\n\nexport interface IWorkerContext {\n\t/**\n\t * Get all available mirror models in this worker.\n\t */\n\tgetMirrorModels(): IMirrorModel[];\n}\n\n/**\n * @internal\n */\nexport interface IRawModelData {\n\turl: string;\n\tversionId: number;\n\tlines: string[];\n\tEOL: string;\n}\n\n/**\n * @internal\n */\nexport interface ICommonModel {\n\turi: URI;\n\tversion: number;\n\teol: string;\n\tgetValue(): string;\n\n\tgetLinesContent(): string[];\n\tgetLineCount(): number;\n\tgetLineContent(lineNumber: number): string;\n\tcreateWordIterator(wordDefinition: RegExp): IIterator<string>;\n\tgetWordUntilPosition(position: IPosition, wordDefinition: RegExp): IWordAtPosition;\n\tgetValueInRange(range: IRange): string;\n\tgetWordAtPosition(position: IPosition, wordDefinition: RegExp): Range;\n\toffsetAt(position: IPosition): number;\n\tpositionAt(offset: number): IPosition;\n}\n\n/**\n * Range of a word inside a model.\n * @internal\n */\ninterface IWordRange {\n\t/**\n\t * The index where the word starts.\n\t */\n\treadonly start: number;\n\t/**\n\t * The index where the word ends.\n\t */\n\treadonly end: number;\n}\n\n/**\n * @internal\n */\nclass MirrorModel extends BaseMirrorModel implements ICommonModel {\n\n\tpublic get uri(): URI {\n\t\treturn this._uri;\n\t}\n\n\tpublic get version(): number {\n\t\treturn this._versionId;\n\t}\n\n\tpublic get eol(): string {\n\t\treturn this._eol;\n\t}\n\n\tpublic getValue(): string {\n\t\treturn this.getText();\n\t}\n\n\tpublic getLinesContent(): string[] {\n\t\treturn this._lines.slice(0);\n\t}\n\n\tpublic getLineCount(): number {\n\t\treturn this._lines.length;\n\t}\n\n\tpublic getLineContent(lineNumber: number): string {\n\t\treturn this._lines[lineNumber - 1];\n\t}\n\n\tpublic getWordAtPosition(position: IPosition, wordDefinition: RegExp): Range {\n\n\t\tlet wordAtText = getWordAtText(\n\t\t\tposition.column,\n\t\t\tensureValidWordDefinition(wordDefinition),\n\t\t\tthis._lines[position.lineNumber - 1],\n\t\t\t0\n\t\t);\n\n\t\tif (wordAtText) {\n\t\t\treturn new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic getWordUntilPosition(position: IPosition, wordDefinition: RegExp): IWordAtPosition {\n\t\tconst wordAtPosition = this.getWordAtPosition(position, wordDefinition);\n\t\tif (!wordAtPosition) {\n\t\t\treturn {\n\t\t\t\tword: '',\n\t\t\t\tstartColumn: position.column,\n\t\t\t\tendColumn: position.column\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tword: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1),\n\t\t\tstartColumn: wordAtPosition.startColumn,\n\t\t\tendColumn: position.column\n\t\t};\n\t}\n\n\tpublic createWordIterator(wordDefinition: RegExp): IIterator<string> {\n\t\tlet obj = {\n\t\t\tdone: false,\n\t\t\tvalue: ''\n\t\t};\n\t\tlet lineNumber = 0;\n\t\tlet lineText: string;\n\t\tlet wordRangesIdx = 0;\n\t\tlet wordRanges: IWordRange[] = [];\n\t\tlet next = () => {\n\n\t\t\tif (wordRangesIdx < wordRanges.length) {\n\t\t\t\tobj.done = false;\n\t\t\t\tobj.value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);\n\t\t\t\twordRangesIdx += 1;\n\n\t\t\t} else if (lineNumber >= this._lines.length) {\n\t\t\t\tobj.done = true;\n\t\t\t\tobj.value = undefined;\n\n\t\t\t} else {\n\t\t\t\tlineText = this._lines[lineNumber];\n\t\t\t\twordRanges = this._wordenize(lineText, wordDefinition);\n\t\t\t\twordRangesIdx = 0;\n\t\t\t\tlineNumber += 1;\n\t\t\t\treturn next();\n\t\t\t}\n\n\t\t\treturn obj;\n\t\t};\n\t\treturn { next };\n\t}\n\n\tprivate _wordenize(content: string, wordDefinition: RegExp): IWordRange[] {\n\t\tconst result: IWordRange[] = [];\n\t\tlet match: RegExpExecArray;\n\n\t\twordDefinition.lastIndex = 0; // reset lastIndex just to be sure\n\n\t\twhile (match = wordDefinition.exec(content)) {\n\t\t\tif (match[0].length === 0) {\n\t\t\t\t// it did match the empty string\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tresult.push({ start: match.index, end: match.index + match[0].length });\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic getValueInRange(range: IRange): string {\n\t\trange = this._validateRange(range);\n\n\t\tif (range.startLineNumber === range.endLineNumber) {\n\t\t\treturn this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);\n\t\t}\n\n\t\tlet lineEnding = this._eol;\n\t\tlet startLineIndex = range.startLineNumber - 1;\n\t\tlet endLineIndex = range.endLineNumber - 1;\n\t\tlet resultLines: string[] = [];\n\n\t\tresultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));\n\t\tfor (let i = startLineIndex + 1; i < endLineIndex; i++) {\n\t\t\tresultLines.push(this._lines[i]);\n\t\t}\n\t\tresultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));\n\n\t\treturn resultLines.join(lineEnding);\n\t}\n\n\tpublic offsetAt(position: IPosition): number {\n\t\tposition = this._validatePosition(position);\n\t\tthis._ensureLineStarts();\n\t\treturn this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1);\n\t}\n\n\tpublic positionAt(offset: number): IPosition {\n\t\toffset = Math.floor(offset);\n\t\toffset = Math.max(0, offset);\n\n\t\tthis._ensureLineStarts();\n\t\tlet out = this._lineStarts.getIndexOf(offset);\n\t\tlet lineLength = this._lines[out.index].length;\n\n\t\t// Ensure we return a valid position\n\t\treturn {\n\t\t\tlineNumber: 1 + out.index,\n\t\t\tcolumn: 1 + Math.min(out.remainder, lineLength)\n\t\t};\n\t}\n\n\tprivate _validateRange(range: IRange): IRange {\n\n\t\tconst start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });\n\t\tconst end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });\n\n\t\tif (start.lineNumber !== range.startLineNumber\n\t\t\t|| start.column !== range.startColumn\n\t\t\t|| end.lineNumber !== range.endLineNumber\n\t\t\t|| end.column !== range.endColumn) {\n\n\t\t\treturn {\n\t\t\t\tstartLineNumber: start.lineNumber,\n\t\t\t\tstartColumn: start.column,\n\t\t\t\tendLineNumber: end.lineNumber,\n\t\t\t\tendColumn: end.column\n\t\t\t};\n\t\t}\n\n\t\treturn range;\n\t}\n\n\tprivate _validatePosition(position: IPosition): IPosition {\n\t\tif (!Position.isIPosition(position)) {\n\t\t\tthrow new Error('bad position');\n\t\t}\n\t\tlet { lineNumber, column } = position;\n\t\tlet hasChanged = false;\n\n\t\tif (lineNumber < 1) {\n\t\t\tlineNumber = 1;\n\t\t\tcolumn = 1;\n\t\t\thasChanged = true;\n\n\t\t} else if (lineNumber > this._lines.length) {\n\t\t\tlineNumber = this._lines.length;\n\t\t\tcolumn = this._lines[lineNumber - 1].length + 1;\n\t\t\thasChanged = true;\n\n\t\t} else {\n\t\t\tlet maxCharacter = this._lines[lineNumber - 1].length + 1;\n\t\t\tif (column < 1) {\n\t\t\t\tcolumn = 1;\n\t\t\t\thasChanged = true;\n\t\t\t}\n\t\t\telse if (column > maxCharacter) {\n\t\t\t\tcolumn = maxCharacter;\n\t\t\t\thasChanged = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!hasChanged) {\n\t\t\treturn position;\n\t\t} else {\n\t\t\treturn { lineNumber, column };\n\t\t}\n\t}\n}\n\n/**\n * @internal\n */\nexport interface IForeignModuleFactory {\n\t(ctx: IWorkerContext, createData: any): any;\n}\n\ndeclare var require;\n\n/**\n * @internal\n */\nexport abstract class BaseEditorSimpleWorker {\n\tprivate _foreignModuleFactory: IForeignModuleFactory;\n\tprivate _foreignModule: any;\n\n\tconstructor(foreignModuleFactory: IForeignModuleFactory) {\n\t\tthis._foreignModuleFactory = foreignModuleFactory;\n\t\tthis._foreignModule = null;\n\t}\n\n\tprotected abstract _getModel(uri: string): ICommonModel;\n\tprotected abstract _getModels(): ICommonModel[];\n\n\t// ---- BEGIN diff --------------------------------------------------------------------------\n\n\tpublic computeDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean): TPromise<editorCommon.ILineChange[]> {\n\t\tlet original = this._getModel(originalUrl);\n\t\tlet modified = this._getModel(modifiedUrl);\n\t\tif (!original || !modified) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet originalLines = original.getLinesContent();\n\t\tlet modifiedLines = modified.getLinesContent();\n\t\tlet diffComputer = new DiffComputer(originalLines, modifiedLines, {\n\t\t\tshouldPostProcessCharChanges: true,\n\t\t\tshouldIgnoreTrimWhitespace: ignoreTrimWhitespace,\n\t\t\tshouldMakePrettyDiff: true\n\t\t});\n\t\treturn TPromise.as(diffComputer.computeDiff());\n\t}\n\n\tpublic computeDirtyDiff(originalUrl: string, modifiedUrl: string, ignoreTrimWhitespace: boolean): TPromise<editorCommon.IChange[]> {\n\t\tlet original = this._getModel(originalUrl);\n\t\tlet modified = this._getModel(modifiedUrl);\n\t\tif (!original || !modified) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet originalLines = original.getLinesContent();\n\t\tlet modifiedLines = modified.getLinesContent();\n\t\tlet diffComputer = new DiffComputer(originalLines, modifiedLines, {\n\t\t\tshouldPostProcessCharChanges: false,\n\t\t\tshouldIgnoreTrimWhitespace: ignoreTrimWhitespace,\n\t\t\tshouldMakePrettyDiff: true\n\t\t});\n\t\treturn TPromise.as(diffComputer.computeDiff());\n\t}\n\n\t// ---- END diff --------------------------------------------------------------------------\n\n\n\t// ---- BEGIN minimal edits ---------------------------------------------------------------\n\n\tprivate static readonly _diffLimit = 10000;\n\n\tpublic computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[]): TPromise<TextEdit[]> {\n\t\tconst model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn TPromise.as(edits);\n\t\t}\n\n\t\tconst result: TextEdit[] = [];\n\t\tlet lastEol: EndOfLineSequence;\n\n\t\tfor (let { range, text, eol } of edits) {\n\n\t\t\tif (typeof eol === 'number') {\n\t\t\t\tlastEol = eol;\n\t\t\t}\n\n\t\t\tif (!range) {\n\t\t\t\t// eol-change only\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst original = model.getValueInRange(range);\n\t\t\ttext = text.replace(/\\r\\n|\\n|\\r/g, model.eol);\n\n\t\t\tif (original === text) {\n\t\t\t\t// noop\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// make sure diff won't take too long\n\t\t\tif (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) {\n\t\t\t\tresult.push({ range, text });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// compute diff between original and edit.text\n\t\t\tconst changes = stringDiff(original, text, false);\n\t\t\tconst editOffset = model.offsetAt(Range.lift(range).getStartPosition());\n\n\t\t\tfor (const change of changes) {\n\t\t\t\tconst start = model.positionAt(editOffset + change.originalStart);\n\t\t\t\tconst end = model.positionAt(editOffset + change.originalStart + change.originalLength);\n\t\t\t\tconst newEdit: TextEdit = {\n\t\t\t\t\ttext: text.substr(change.modifiedStart, change.modifiedLength),\n\t\t\t\t\trange: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }\n\t\t\t\t};\n\n\t\t\t\tif (model.getValueInRange(newEdit.range) !== newEdit.text) {\n\t\t\t\t\tresult.push(newEdit);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof lastEol === 'number') {\n\t\t\tresult.push({ eol: lastEol, text: undefined, range: undefined });\n\t\t}\n\n\t\treturn TPromise.as(result);\n\t}\n\n\t// ---- END minimal edits ---------------------------------------------------------------\n\n\tpublic computeLinks(modelUrl: string): TPromise<ILink[]> {\n\t\tlet model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn TPromise.as(computeLinks(model));\n\t}\n\n\t// ---- BEGIN suggest --------------------------------------------------------------------------\n\n\tprivate static readonly _suggestionsLimit = 10000;\n\n\tpublic textualSuggest(modelUrl: string, position: IPosition, wordDef: string, wordDefFlags: string): TPromise<ISuggestResult> {\n\t\tconst model = this._getModel(modelUrl);\n\t\tif (model) {\n\t\t\tconst suggestions: ISuggestion[] = [];\n\t\t\tconst wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n\t\t\tconst currentWord = model.getWordUntilPosition(position, wordDefRegExp).word;\n\n\t\t\tconst seen: Record<string, boolean> = Object.create(null);\n\t\t\tseen[currentWord] = true;\n\n\t\t\tfor (\n\t\t\t\tlet iter = model.createWordIterator(wordDefRegExp), e = iter.next();\n\t\t\t\t!e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit;\n\t\t\t\te = iter.next()\n\t\t\t) {\n\t\t\t\tconst word = e.value;\n\t\t\t\tif (seen[word]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tseen[word] = true;\n\t\t\t\tif (!isNaN(Number(word))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tsuggestions.push({\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\tlabel: word,\n\t\t\t\t\tinsertText: word,\n\t\t\t\t\tnoAutoAccept: true,\n\t\t\t\t\toverwriteBefore: currentWord.length\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn TPromise.as({ suggestions });\n\t\t}\n\t\treturn undefined;\n\t}\n\n\n\t// ---- END suggest --------------------------------------------------------------------------\n\n\tpublic navigateValueSet(modelUrl: string, range: IRange, up: boolean, wordDef: string, wordDefFlags: string): TPromise<IInplaceReplaceSupportResult> {\n\t\tlet model = this._getModel(modelUrl);\n\t\tif (!model) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet wordDefRegExp = new RegExp(wordDef, wordDefFlags);\n\n\t\tif (range.startColumn === range.endColumn) {\n\t\t\trange = {\n\t\t\t\tstartLineNumber: range.startLineNumber,\n\t\t\t\tstartColumn: range.startColumn,\n\t\t\t\tendLineNumber: range.endLineNumber,\n\t\t\t\tendColumn: range.endColumn + 1\n\t\t\t};\n\t\t}\n\n\t\tlet selectionText = model.getValueInRange(range);\n\n\t\tlet wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);\n\t\tlet word: string = null;\n\t\tif (wordRange !== null) {\n\t\t\tword = model.getValueInRange(wordRange);\n\t\t}\n\n\t\tlet result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);\n\t\treturn TPromise.as(result);\n\t}\n\n\t// ---- BEGIN foreign module support --------------------------------------------------------------------------\n\n\tpublic loadForeignModule(moduleId: string, createData: any): TPromise<string[]> {\n\t\tlet ctx: IWorkerContext = {\n\t\t\tgetMirrorModels: (): IMirrorModel[] => {\n\t\t\t\treturn this._getModels();\n\t\t\t}\n\t\t};\n\n\t\tif (this._foreignModuleFactory) {\n\t\t\tthis._foreignModule = this._foreignModuleFactory(ctx, createData);\n\t\t\t// static foreing module\n\t\t\tlet methods: string[] = [];\n\t\t\tfor (let prop in this._foreignModule) {\n\t\t\t\tif (typeof this._foreignModule[prop] === 'function') {\n\t\t\t\t\tmethods.push(prop);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn TPromise.as(methods);\n\t\t}\n\t\treturn new TPromise<any>((c, e) => {\n\t\t\trequire([moduleId], (foreignModule: { create: IForeignModuleFactory }) => {\n\t\t\t\tthis._foreignModule = foreignModule.create(ctx, createData);\n\n\t\t\t\tlet methods: string[] = [];\n\t\t\t\tfor (let prop in this._foreignModule) {\n\t\t\t\t\tif (typeof this._foreignModule[prop] === 'function') {\n\t\t\t\t\t\tmethods.push(prop);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tc(methods);\n\n\t\t\t}, e);\n\t\t});\n\t}\n\n\t// foreign method request\n\tpublic fmr(method: string, args: any[]): TPromise<any> {\n\t\tif (!this._foreignModule || typeof this._foreignModule[method] !== 'function') {\n\t\t\treturn TPromise.wrapError(new Error('Missing requestHandler or method: ' + method));\n\t\t}\n\n\t\ttry {\n\t\t\treturn TPromise.as(this._foreignModule[method].apply(this._foreignModule, args));\n\t\t} catch (e) {\n\t\t\treturn TPromise.wrapError(e);\n\t\t}\n\t}\n\n\t// ---- END foreign module support --------------------------------------------------------------------------\n}\n\n/**\n * @internal\n */\nexport class EditorSimpleWorkerImpl extends BaseEditorSimpleWorker implements IRequestHandler, IDisposable {\n\t_requestHandlerBrand: any;\n\n\tprivate _models: { [uri: string]: MirrorModel; };\n\n\tconstructor(foreignModuleFactory: IForeignModuleFactory) {\n\t\tsuper(foreignModuleFactory);\n\t\tthis._models = Object.create(null);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis._models = Object.create(null);\n\t}\n\n\tprotected _getModel(uri: string): ICommonModel {\n\t\treturn this._models[uri];\n\t}\n\n\tprotected _getModels(): ICommonModel[] {\n\t\tlet all: MirrorModel[] = [];\n\t\tObject.keys(this._models).forEach((key) => all.push(this._models[key]));\n\t\treturn all;\n\t}\n\n\tpublic acceptNewModel(data: IRawModelData): void {\n\t\tthis._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId);\n\t}\n\n\tpublic acceptModelChanged(strURL: string, e: IModelChangedEvent): void {\n\t\tif (!this._models[strURL]) {\n\t\t\treturn;\n\t\t}\n\t\tlet model = this._models[strURL];\n\t\tmodel.onEvents(e);\n\t}\n\n\tpublic acceptRemovedModel(strURL: string): void {\n\t\tif (!this._models[strURL]) {\n\t\t\treturn;\n\t\t}\n\t\tdelete this._models[strURL];\n\t}\n}\n\n/**\n * Called on the worker side\n * @internal\n */\nexport function create(): IRequestHandler {\n\treturn new EditorSimpleWorkerImpl(null);\n}\n\n// This is only available in a Web Worker\ndeclare function importScripts(...urls: string[]): void;\n\nif (typeof importScripts === 'function') {\n\t// Running in a web worker\n\tglobals.monaco = createMonacoBaseAPI();\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\n(function () {\n\t'use strict';\n\n\tlet MonacoEnvironment = (<any>self).MonacoEnvironment;\n\tlet monacoBaseUrl = MonacoEnvironment && MonacoEnvironment.baseUrl ? MonacoEnvironment.baseUrl : '../../../';\n\n\tif (typeof (<any>self).define !== 'function' || !(<any>self).define.amd) {\n\t\timportScripts(monacoBaseUrl + 'vs/loader.js');\n\t}\n\n\trequire.config({\n\t\tbaseUrl: monacoBaseUrl,\n\t\tcatchError: true\n\t});\n\n\tlet loadCode = function (moduleId: string) {\n\t\trequire([moduleId], function (ws) {\n\t\t\tsetTimeout(function () {\n\t\t\t\tlet messageHandler = ws.create((msg: any) => {\n\t\t\t\t\t(<any>self).postMessage(msg);\n\t\t\t\t}, null);\n\n\t\t\t\tself.onmessage = (e) => messageHandler.onmessage(e.data);\n\t\t\t\twhile (beforeReadyMessages.length > 0) {\n\t\t\t\t\tself.onmessage(beforeReadyMessages.shift());\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t});\n\t};\n\n\tlet isFirstMessage = true;\n\tlet beforeReadyMessages: MessageEvent[] = [];\n\tself.onmessage = (message) => {\n\t\tif (!isFirstMessage) {\n\t\t\tbeforeReadyMessages.push(message);\n\t\t\treturn;\n\t\t}\n\n\t\tisFirstMessage = false;\n\t\tloadCode(message.data);\n\t};\n})();\n"]}