1{"version":3,"sources":["webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDefinition.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-textdocument/lib/esm/main.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/jsonMode.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/languageFeatures.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/tokenization.js","webpack:///./node_modules/monaco-editor/esm/vs/language/json/workerManager.js"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AAC+B;AACgB;AACrD;AACP;AACA;AACO;AACP;AACA;AACA;AACA,eAAe,4DAAS;AACxB;AACA;AACA;AACA;AACA,iBAAiB,qEAAkB;AACnC;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,qCAAqC,iGAAiG;AACtI;AACA;AACA,uBAAuB,qEAAkB;AACzC;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,oEAAoE;AACjH;AACA;AACA;AACA,6CAA6C,mFAAmF;AAChI;AACA;AACA;AACA,mCAAmC;AACnC,0BAA0B;AAC1B;AACA;AACA,gHAAgH,4BAA4B,EAAE;AAC9I;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,6BAA6B,wDAAK;AAClC;AACA;AACA,wCAAwC,wDAAK;AAC7C;AACA;AACA;AACA,gBAAgB,yDAAM,WAAW,qCAAqC;AACtE;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,4EAA4E;AACzF;AACO;AACP;AACA;AACO;AACP;AACA;;;;;;;;;;;;;ACzLA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACgC;AACtC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iEAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,sEAAsE;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;ACjMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACgC;AAC7C;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACO;AACP,sBAAsB;AACtB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2CAA2C;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,4BAA4B,aAAa;AACzC,6BAA6B,gCAAgC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,yBAAyB,+CAA+C;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,4BAA4B,aAAa;AACzC,6BAA6B,gCAAgC;AAC7D,yBAAyB,0EAA0E;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kFAAkF;AACvH,SAAS;AACT;AACA,qCAAqC,oFAAoF;AACzH,yCAAyC,qFAAqF;AAC9H,SAAS;AACT;AACA,oDAAoD;AACpD;AACA;AACA;AACA,SAAS;AACT;AACA,qCAAqC,iFAAiF;AACtH,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,qBAAqB,gGAAgG;AACrH;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,yBAAyB,+CAA+C;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mCAAmC,oBAAoB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,gBAAgB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gDAAgD,gBAAgB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,uCAAuC,2BAA2B;AAClE;AACA;AACA;AACA;AACA;AACO;AACP,uCAAuC,2BAA2B;AAClE;AACA;AACA;AACA,2BAA2B,qDAAqD;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,6BAA6B,gCAAgC;AAC7D,mBAAmB,iEAAa;AAChC;AACA,4CAA4C,6IAA6I,EAAE,gBAAgB,aAAa;AACxN;AACA;AACA,+CAA+C,kJAAkJ,EAAE,gBAAgB,aAAa;AAChO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,qBAAqB;AAC7D,mCAAmC,gBAAgB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,mBAAmB,iEAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjnBA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACb;AACA;AACA;AACA;AACO;AACP,kCAAkC,sBAAsB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kCAAkC,YAAY,EAAE;AAChD;AACA,+BAA+B,cAAc,EAAE;AAC/C,oCAAoC,cAAc,EAAE;AACpD,qCAAqC,oBAAoB,EAAE;AAC3D,qCAAqC,0BAA0B,EAAE;AACjE,wCAAwC,wBAAwB,EAAE;AAClE,6CAA6C,+CAA+C,EAAE;AAC9F,oCAAoC,kBAAkB,EAAE;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1WA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACiC;AACP;AACM;AACF;AAC3C;AACA;AACA;AACA;AACO,oBAAoB,8DAAqB;AAChD;AACA;AACA;AACO,kBAAkB,2DAAkB;AAC3C;AACA;AACA;AACA;AACO,YAAY,qDAAY;AAC/B;AACA;AACA;AACO,gBAAgB,yDAAgB;AACvC;AACA;AACA;AACO,yBAAyB,kEAAyB;AACzD;AACA;AACA;AACO,uBAAuB,gEAAuB;AACrD;AACA;AACA;AACO,kBAAkB,2DAAkB;AAC3C;AACA;AACA;AACO,mBAAmB,4DAAmB;AAC7C;AACA;AACA;AACO,YAAY,qDAAY;AAC/B;AACA;AACA;AACA;AACA;AACO,oBAAoB,6DAAoB;AACxC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,sDAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,yDAAgB;AAC3B;AACA;AACA;AACA;AACO;AACP,kCAAkC,QAAQ;AAC1C,eAAe,uDAAc;AAC7B;AACA;AACA;;;;;;;;;;;;;ACnHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC8D;AACV;AACU;AACU;AACK;AACX;AACE;AACP;AACU;AACR;AACN;AACK;AACvB;AAChC;AACP;AACA,gCAAgC,gFAAiB;AACjD,6CAA6C,8EAAmB;AAChE,6BAA6B,0EAAc;AAC3C,wBAAwB,gEAAS;AACjC,kCAAkC,oFAAmB;AACrD,6BAA6B,0EAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT,qCAAqC,gDAAgD,EAAE;AACvF;AACA,gDAAgD,QAAQ,mEAAS,YAAY,wBAAwB,EAAE,EAAE;AACzG,uDAAuD,QAAQ,6EAAe,oBAAoB,EAAE;AACpG;AACA;AACA;AACA;AACA;AACA,2CAA2C,wEAAwE,4BAA4B,gBAAgB,EAAE,EAAE,EAAE,EAAE,EAAE;AACzK;AACA;AACA;AACA,0BAA0B,yEAAgB;AAC1C,4BAA4B,mFAAkB;AAC9C,wBAAwB,2EAAc;AACtC;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,2BAA2B;AAC3B,mBAAmB,oEAAU;AAC7B,uBAAuB,+DAAQ,SAAS,4DAAK;AAC7C,aAAa;AACb;AACA;AACA;;;;;;;;;;;;;AChEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACiZ;AAC5T;AAC4R;AACjX;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AACxB;AACP;AACA;AACA;AACA;AACA;AACA,0CAA0C,+EAAU,WAAW,+EAAU;AACzE;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;;;;;;;;;;;;;AC3CjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,uDAAuD;AACpF;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACkD;AACoC;AACI;AACrC;AACtD,eAAe,wEAAqB;AACpC;AACA,kBAAkB,2IAA2I,IAAI,cAAc,EAAE,EAAE,IAAI,KAAK;AAC5L,kBAAkB,uGAAuG,EAAE,mJAAmJ;AAC9Q,aAAa,8FAA8F,EAAE,+CAA+C;AAC5J,aAAa,kMAAkM;AAC/M,cAAc,+GAA+G,yBAAyB,6BAA6B,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,gCAAgC,GAAG;AAC9P;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,+GAA+G,+BAA+B;AAC9I;AACA;AACA,CAAC;AACsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC6B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AAC2B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC4B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AAC8B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AAC4B;AACtB;AACP,QAAQ,mEAAS;AACjB,0BAA0B,IAAI,UAAU;AACxC;AACA;AACA;AACO;AACP;AACA;AACA;AACA,CAAC,8BAA8B;AAC/B;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B,WAAW,EAAE;AACvC;AACA;AACA,KAAK;AACL,2DAA2D;AAC3D,4DAA4D;AAC5D,6DAA6D,aAAa;AAC1E,wDAAwD,aAAa;AACrE;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,iCAAiC;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,gBAAgB;AAChE;AACA,mCAAmC,+DAAS;AAC5C,mGAAmG,EAAE,sCAAsC,0BAA0B,EAAE;AACvK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC2B;AACrB;AACP,iCAAiC,kBAAkB;AACnD;AACA;AACO;AACP,WAAW,kEAAiB;AAC5B;AACO;AACP,WAAW,iEAAgB;AAC3B;AACO;AACP,uCAAuC,2BAA2B;AAClE;AACA;AACA;AACA;AACA,sCAAsC,mBAAmB;AACzD,kCAAkC,eAAe;AACjD;AACA;AACA;AACA;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA,mBAAmB,sEAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4BAA4B;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2DAAK;AACjC,uBAAuB,gEAAU;AACjC,aAAa;AACb;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACuB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,6BAA6B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,2HAA2H,EAAE;AAC7H,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,gHAAgH,EAAE;AAClH,iBAAiB;AACjB;AACA;AACA;AACA,+CAA+C,gBAAgB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD;AACA,iBAAiB;AACjB;AACA,6DAA6D,gBAAgB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,4BAA4B;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iCAAiC;AAChE,8BAA8B,wEAAkB;AAChD;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA,oBAAoB,gEAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,0BAA0B,+DAAS;AACnC,mHAAmH,EAAE,kCAAkC,0BAA0B,EAAE;AACnL,iBAAiB;AACjB;AACA;AACA,YAAY,mEAAS;AACrB;AACA,iBAAiB,gEAAM;AACvB;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,0BAA0B,+DAAS;AACnC,6FAA6F,EAAE;AAC/F,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yDAAyD;AACpF,0BAA0B,wEAAkB;AAC5C;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kEAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,uFAAuF,EAAE;AACzF,iBAAiB;AACjB;AACA;AACA;AACA,gBAAgB,kEAAQ;AACxB;AACA;AACA,gBAAgB,mEAAS;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB,mEAAS;AAC1B;AACA;AACA;AACA;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,uGAAuG,EAAE;AACzG,aAAa;AACb;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,uGAAuG,EAAE;AACzG,aAAa;AACb;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,oFAAoF,EAAE;AACtF,aAAa;AACb;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,oFAAoF,EAAE;AACtF,aAAa;AACb;AACA;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,qGAAqG,EAAE;AACvG,aAAa;AACb;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,oGAAoG,EAAE;AACtG,aAAa;AACb;AACA,YAAY,kEAAQ;AACpB;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,qJAAqJ,EAAE;AACvJ,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2CAA2C;AACtF,0CAA0C,wEAAkB;AAC5D,kJAAkJ,EAAE;AACpJ,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,2CAA2C;AAClF,sCAAsC,wEAAkB;AACxD;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2BAA2B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uBAAuB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,2CAA2C;AAC9E,kCAAkC,wEAAkB;AACpD,6HAA6H,EAAE;AAC/H,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD;AACA,iBAAiB;AACjB;AACA;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,yFAAyF,EAAE;AAC3F,aAAa;AACb;AACA,YAAY,kEAAQ;AACpB;AACA,2BAA2B,2CAA2C;AACtE,0BAA0B,wEAAkB;AAC5C,0FAA0F,EAAE;AAC5F,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA;AACA,8CAA8C,iDAAiD,IAAI;AACnG;AACA;AACA,kCAAkC,wEAAkB;AACpD,4FAA4F,EAAE;AAC9F,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,gBAAgB;AACjF;AACA;AACA;AACA;AACA;AACA,wBAAwB,mEAAS;AACjC;AACA;AACA;AACA,2CAA2C,2EAA2E;AACtH,0CAA0C,wEAAkB;AAC5D,kHAAkH,EAAE;AACpH,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,gBAAgB;AACxF;AACA;AACA,qEAAqE,gBAAgB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mEAAS;AACzC;AACA;AACA;AACA,mDAAmD,2EAA2E;AAC9H,kDAAkD,wEAAkB;AACpE,0HAA0H,EAAE;AAC5H,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,qCAAqC;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,qCAAqC;AACtH;AACA;AACA;AACA;AACA;AACA,uCAAuC,2EAA2E;AAClH,sCAAsC,wEAAkB;AACxD,8GAA8G,EAAE;AAChH,yBAAyB;AACzB;AACA;AACA;AACA;AACA,YAAY,kEAAQ;AACpB;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,mGAAmG,EAAE;AACrG,iBAAiB;AACjB;AACA;AACA,YAAY,kEAAQ;AACpB;AACA;AACA,+BAA+B,2CAA2C;AAC1E,8BAA8B,wEAAkB;AAChD,kHAAkH,EAAE;AACpH,iBAAiB;AACjB;AACA;AACA;AACA,mEAAmE,gBAAgB;AACnF;AACA;AACA;AACA;AACA;AACA,qEAAqE,2BAA2B;AAChG;AACA;AACA;AACA,+CAA+C,2CAA2C;AAC1F,8CAA8C,wEAAkB;AAChE,mHAAmH,EAAE,uBAAuB,EAAE;AAC9I,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,kBAAkB,mEAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2DAAK;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,YAAY,wEAAkB,OAAO;AACvE;AACA,wBAAwB,2DAAK;AAC7B,0BAA0B,gEAAU;AACpC;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD,wCAAwC,qBAAqB;AAC7D,mCAAmC,gBAAgB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,+DAAS;AACnG;AACA;AACA,kGAAkG,+DAAS;AAC3G;AACA;AACA,uFAAuF,+DAAS;AAChG;AACA;AACA,yFAAyF,+DAAS;AAClG;AACA;AACA,uFAAuF,+DAAS;AAChG;AACA;AACA,0HAA0H,+DAAS;AACnI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,wEAAwE,+DAAS;AACjF;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,mFAAmF,+DAAS;AAC5F;AACA;AACA;AACA;AACA;AACA,oEAAoE,+DAAS;AAC7E;AACA;AACA;AACA,uEAAuE,+DAAS;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG,+DAAS;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,+DAAS;AACxG;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,+DAAS,+EAA+E,wEAAkB;AAC7L;AACA,uFAAuF,+DAAS,+EAA+E,wEAAkB;AACjM;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,gEAAgE,+DAAS;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,+DAAS;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,8EAA8E,+DAAS;AACvF;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,mFAAmF,+DAAS;AAC5F;AACA;AACA;AACA;AACA;AACA,oEAAoE,+DAAS;AAC7E;AACA;AACA;AACA,0EAA0E,+DAAS;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F,+DAAS;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kEAAQ;AAC7B,6FAA6F,+DAAS;AACtG;AACA;AACA;AACA;AACA,yFAAyF,+DAAS;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,+DAAS;AACrG;AACA;AACA,8EAA8E,+DAAS;AACvF;AACA;AACA;AACA;;;;;;;;;;;;;ACjtCA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACsD;AACtD,eAAe,wEAAqB;AAC7B;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,yBAAyB,6CAA6C;AACtE,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,8BAA8B,6CAA6C;AAC3E,8BAA8B,qDAAqD;AACnF;AACA;AACA;AACA,iBAAiB;AACjB,oCAAoC,cAAc;AAClD;AACA;AACA,yBAAyB,cAAc;AACvC,yBAAyB;AACzB;AACA;AACA,iBAAiB;AACjB,6BAA6B,6CAA6C;AAC1E,6BAA6B,qDAAqD;AAClF;AACA;AACA;AACA,iBAAiB;AACjB,6BAA6B,cAAc;AAC3C,kCAAkC,6CAA6C;AAC/E,kCAAkC,qDAAqD;AACvF,6BAA6B,sCAAsC;AACnE,yCAAyC,cAAc;AACvD;AACA;AACA,6CAA6C,cAAc;AAC3D;AACA,iBAAiB;AACjB;AACA;AACA,6CAA6C,cAAc;AAC3D;AACA,iBAAiB;AACjB;AACA;AACA,6CAA6C,cAAc;AAC3D,sCAAsC,oBAAoB;AAC1D;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C,6BAA6B;AAC7B;AACA;AACA,iBAAiB;AACjB,kCAAkC,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,yBAAyB,sCAAsC;AAC/D;AACA;AACA,sCAAsC,sCAAsC;AAC5E;AACA;AACA;AACA;AACA,iBAAiB;AACjB,2BAA2B,mBAAmB;AAC9C,qCAAqC,mBAAmB;AACxD,oCAAoC,mBAAmB;AACvD,uBAAuB,cAAc;AACrC,yBAAyB,cAAc;AACvC,yBAAyB,cAAc;AACvC,0BAA0B,sCAAsC;AAChE,0BAA0B,sCAAsC;AAChE,0BAA0B,sCAAsC;AAChE,wBAAwB;AACxB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjhBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACkD;AACC;AACA;AACJ;AACC;AAC4E;AACtE;AACtD,eAAe,wEAAqB;AACpC,oCAAoC;AACpC;AACA;AACA;AACA,uCAAuC,oBAAoB;AAC3D,4CAA4C,8BAA8B;AAC1E,4CAA4C,yBAAyB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2DAAK;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2DAAK;AAClC;AACA,6CAA6C,uCAAuC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,8DAAQ;AACtD;AACA;AACA,0EAA0E,wEAAkB;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,oEAAc;AAClE;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iEAAkB;AACnD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8BAA8B,wEAAkB;AAChD;AACA;AACA,0CAA0C,sEAAgB;AAC1D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wEAAkB;AACxD;AACA;AACA,kDAAkD,sEAAgB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,kEAAQ;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B;AACtF;AACA,kCAAkC,wEAAkB;AACpD;AACA;AACA,8CAA8C,sEAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kEAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,uCAAuC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,wEAAkB;AAC5C;AACA;AACA,sCAAsC,sEAAgB;AACtD;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,sBAAsB,wEAAkB;AACxC;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iCAAiC,8DAAe;AAChD;AACA;AACA;AACA;AACA,sCAAsC,sEAAgB;AACtD,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,+BAA+B;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,gBAAgB;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,iEAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,6EAA6E,EAAE;AAClI;AACA;AACA,mDAAmD,6EAA6E,EAAE;AAClI;AACA;AACA,mDAAmD,6EAA6E,EAAE;AAClI;AACA;AACA;AACA;AACA;AACA,oCAAoC,gBAAgB;AACpD;AACA,YAAY,mEAAS;AACrB;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sEAAgB;AACtD,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mEAAS;AAC7B;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sEAAgB;AACtD;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mEAAS;AACrB;AACA;AACA;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA,aAAa;AACb;AACA;AACA,wDAAwD,YAAY;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sEAAgB;AACtD;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,0CAA0C,mEAAS;AACnD;AACA;AACA;AACA;AACA,uCAAuC,wBAAwB,EAAE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,gEAAgE;AAChE,kCAAkC,sEAAgB;AAClD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sEAAgB;AAClD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sEAAgB;AAC9C;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sEAAgB;AAC9C;AACA,SAAS;AACT;AACA;AACA;AACA,qFAAqF,gDAAgD,EAAE;AACvI,+CAA+C;AAC/C,kBAAkB,wEAAkB;AACpC;AACA;AACA;AACA,8BAA8B,sEAAgB;AAC9C,SAAS,EAAE,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,QAAQ,KAAK;AAC/D;AACA;AACA;AACA,kCAAkC,QAAQ,KAAK;AAC/C;AACA;AACA,oCAAoC,aAAa,qB;AACjD;AACA;AACA;AACA,wBAAwB;AACxB,qBAAqB,GAAG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAAe;AAC9B;AACA;AACA;AACA;AACA;AACA,8BAA8B,OAAO;AACrC;AACA;AACA;AACA;AACA,+EAA+E;AAC/E,4EAA4E;AAC5E,2BAA2B,uBAAuB;AAClD;AACA;AACA,0BAA0B,gCAAgC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wEAAkB;AACrC;AACA;AACA,kCAAkC,wEAAkB;AACpD,kCAAkC,wEAAkB;AACpD,oCAAoC,wEAAkB;AACtD,4BAA4B,wEAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mEAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mEAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,GAAG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,IAAI;AACvC;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,IAAI;AAC1C;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAkB;AACxC;AACA,yCAAyC,QAAQ;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mEAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,gEAAU;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,mEAAS;AACtB;AACA,qMAAqM,gEAAU;AAC/M;AACA;AACA;AACA;AACA,aAAa,mEAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACyB;;;;;;;;;;;;;ACh6B1B;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACgD;AACzC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2DAAK;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,6CAA6C,EAAE;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACkD;AACH;AACG;AAC8B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY,iCAAiC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,0DAAgB;AAChG;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA;AACA,8DAA8D,gBAAgB;AAC9E;AACA;AACA,+CAA+C,8DAAQ;AACvD,+CAA+C,OAAO,kEAAmB,4BAA4B,gEAAU,+BAA+B;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,2CAA2C;AACjF;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,8DAAQ;AACnD;AACA,yCAAyC,iIAAiI;AAC1K,0CAA0C,qDAAqD;AAC/F;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY,iCAAiC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,0DAAgB;AAChG;AACA;AACA,iDAAiD,gBAAgB;AACjE;AACA;AACA,8DAA8D,gBAAgB;AAC9E;AACA;AACA;AACA;AACA,+CAA+C,OAAO,kEAAmB,4BAA4B,gEAAU,yDAAyD;AACxK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA,0CAA0C,sCAAsC;AAChF;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA,0CAA0C,2CAA2C;AACrF;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA,uBAAuB,gEAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,+BAA+B;AACpG;AACA;AACA;AACA;AACA,wCAAwC,qEAAY,CAAC,kEAAmB;AACxE;AACA;AACA,6CAA6C,6BAA6B;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,yBAAyB,8DAAQ,wCAAwC;AAC9F;AACA;AACA;AACA,CAAC;AAC8B;AAC/B;AACA,WAAW,2DAAK;AAChB;;;;;;;;;;;;;ACnQA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC2D;AACU;AAC9D;AACP;AACA;AACA;AACA;AACA,kBAAkB,2EAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,8DAAQ;AAClE;AACA;AACA;AACA,kCAAkC,+CAA+C,sEAAgB,UAAU;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,qCAAqC,uCAAuC,sEAAgB;AAC5F;AACA;AACA;AACA;AACA,2DAA2D,sEAAgB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,6BAA6B;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxHA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACkD;AACF;AAChD;AACA;AACA,uCAAuC,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,2DAAK;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,iEAAkB;AACzC,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA,4DAA4D,iCAAiC,EAAE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kEAAmB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACoB;AACrB;AACA;AACA,2EAA2E;AAC3E,oCAAoC,wBAAwB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/GA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACmD;AACH;AACD;AACG;AACI;AACtD,eAAe,wEAAqB;AACpC;AACA;AACA;AACA;AACA;AACA,iDAAiD,uBAAuB;AACxE;AACA;AACA;AACA;AACA;AACA,oDAAoD,6EAAmC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gCAAgC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA;AACA,CAAC;AAC2B;AAC5B;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,8DAAe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,gBAAgB;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACyB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,wDAAG;AAC5B;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,+BAA+B,EAAE;AACrG;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,kCAAkC;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,gBAAgB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG,EAAE;AACzG,+DAA+D;AAC/D;AACA;AACA;AACA,oGAAoG,EAAE;AACtG,8CAA8C;AAC9C;AACA;AACA;AACA,4BAA4B,2DAAU;AACtC,qHAAqH,EAAE,2BAA2B,EAAE;AACpJ;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0DAAgB;AAChC;AACA;AACA,0CAA0C,oEAAoE,EAAE,KAAK,EAAE;AACvH,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,EAAE,SAAS,EAAE;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gHAAgH,EAAE,KAAK,EAAE;AACzH;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,qDAAqD,uBAAuB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,+CAA+C,oBAAoB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD;AACA;AACA,mDAAmD,sBAAsB;AACzE;AACA;AACA,yDAAyD,qBAAqB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,kDAAkD,EAAE;AAC3I;AACA;AACA;AACA;AACA,iFAAiF,wFAAwF,EAAE;AAC3K;AACA;AACA;AACA,mCAAmC,kEAAmB;AACtD,oCAAoC,4DAAkB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,gBAAgB;AAC3E;AACA;AACA,sDAAsD,gBAAgB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,UAAU,iBAAiB,EAAE,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF;AACjF,mGAAmG,oBAAoB,EAAE;AACzH,aAAa;AACb;AACA;AACA;AACA,2FAA2F,oBAAoB,EAAE;AACjH;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AAC4B;AAC7B;AACA;AACA;AACA;AACA,eAAe,wDAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,wDAAG;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjgBA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACgE;AACL;AACpD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,YAAY;AACvD,sBAAsB,oEAAc;AACpC;AACA;AACA,sBAAsB,oEAAc,QAAQ,2DAAK;AACjD;AACA;AACA;AACA;AACA,eAAe,2DAAK;AACpB;AACA,kBAAkB,2EAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5DA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAC0D;AACiC;AACrC;AACN;AAChD,eAAe,wEAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,wEAAkB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH,wEAAkB;AACrI;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,2DAAK;AACzC,mCAAmC,gEAAU,iCAAiC,wEAAkB,UAAU,+DAAS;AACnH;AACA;AACA,oCAAoC,2DAAK;AACzC,mCAAmC,gEAAU,iCAAiC,wEAAkB,UAAU,+DAAS;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,gBAAgB;AAC5E;AACA,+BAA+B,+DAAS;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gEAAU,uCAAuC,+DAAS;AACzF,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,mEAAmE,sEAAgB,gBAAgB;AACnG;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACyB;AAC1B;AACA;AACA;AACA,YAAY,mEAAS;AACrB;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA,oBAAoB,mEAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mEAAS;AACrB;AACA;AACA;AACA,YAAY,mEAAS,0CAA0C;AAC/D;AACA;AACA;AACA,kDAAkD,gBAAgB;AAClE;AACA;AACA,oBAAoB,mEAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wEAAkB;AAC/C,+BAA+B,wEAAkB;AACjD;AACA;AACA;AACA;;;;;;;;;;;;;AC/IA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,2BAA2B,aAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpEA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,2BAA2B;AAC3B,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;;;;;;;;;;;;;AChEA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,mCAAmC,EAAE;AACrC;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3CA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,uBAAuB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,SAAS;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,mGAAmG,SAAS;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACM;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qDAAqD,2BAA2B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;;;;;;;;;;;;;AC5QA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACb;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oEAAoE;AACrE;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0BAA0B;AAC3B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS,iCAAiC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AACtC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;AAC3B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wDAAwD;AACzD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0EAA0E;AAC3E;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,CAAC,wCAAwC;AACzC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,wBAAwB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AAC9B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6CAA6C,IAAI;AACjF;AACA;AACA,CAAC,oDAAoD;AACrD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oDAAoD;AACrD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AACvD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AACxB;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AACxC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AACzC;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AACzC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AACxC;AACP;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AAC/C;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gBAAgB;;;;;;;;;;;;;ACt/CjB;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACa;AACb,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,uDAAuD;AACpF;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,iJAAiJ;AAC1M;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iBAAiB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,YAAY;AAClF;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iBAAiB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sBAAsB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACc;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,sCAAsC,sBAAsB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA;AACA;AACA,6EAA6E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,0CAA0C,EAAE;AACrG;;;;;;;;;;;;;;ACloBA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACmD;AACO;AACI;AACF;AACrD;AACP;AACA;AACA,qBAAqB,+DAAa;AAClC;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wEAAS,wDAAwD,mFAA+C;AAC3I;AACA;AACA,2BAA2B,wEAAS,6DAA6D,wFAAoD;AACrJ;AACA;AACA,2BAA2B,wEAAS,gDAAgD,sEAAkC;AACtH;AACA;AACA,2BAA2B,wEAAS,uCAAuC,iEAA6B;AACxG;AACA;AACA,2BAA2B,wEAAS,gDAAgD,0EAAsC;AAC1H;AACA;AACA,2BAA2B,wEAAS,+BAA+B,kFAAyB;AAC5F;AACA;AACA,2BAA2B,wEAAS,uCAAuC,yEAAqC;AAChH;AACA;AACA,2BAA2B,wEAAS,8CAA8C,wEAAoC;AACtH;AACA;AACA,+BAA+B,uEAAmC;AAClE;AACA;AACA,2BAA2B,wEAAS,gDAAgD,0EAAsC;AAC1H;AACA;AACA;AACA,qBAAqB,wEAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,YAAY,uBAAuB,gCAAgC,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,IAAI;AAC5C;AACA;AACA;AACA,KAAK;AACL;AACA,WAAW,KAAK;AAChB;AACA;AACA;AACA,SAAS,SAAS,YAAY,sBAAsB;AACpD,SAAS,2CAA2C;AACpD,SAAS;AACT;AACA;;;;;;;;;;;;;ACzFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACgG;AACN;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6CAA6C,EAAE;AAChG,aAAa;AACb;AACA;AACA;AACA,YAAY,qEAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,qEAAM;AACrC,+BAA+B,qEAAM;AACrC;AACA;AACA,SAAS;AACT,+BAA+B,qEAAM;AACrC;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY,qEAAM;AAClB;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,gBAAgB,qEAAM;AACtB;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ,qEAAM;AACd;AACA;AACA,gDAAgD,yBAAyB,EAAE;AAC3E;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,4DAA4D,mCAAmC,EAAE;AACjG,4BAA4B,qEAAM;AAClC;AACA,oBAAoB,qEAAM;AAC1B;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AAC6B;AAC9B;AACA;AACA,aAAa,2GAA8B;AAC3C,mBAAmB,6EAAc;AACjC,aAAa,2GAA8B;AAC3C,mBAAmB,6EAAc;AACjC,aAAa,2GAA8B;AAC3C,mBAAmB,6EAAc;AACjC,aAAa,2GAA8B;AAC3C,mBAAmB,6EAAc;AACjC;AACA,mBAAmB,6EAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oEAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAAS;AAC7B;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA,aAAa,2GAA8B;AAC3C;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAAS;AAC7B;AACA;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,mBAAmB,2GAA8B;AACjD;AACA,WAAW,2GAA8B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,gCAAgC,oEAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yGAA4B;AAC3E,2CAA2C,wEAAS;AACpD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AAC4B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACuB;AACxB;AACA;AACA;AACA,aAAa,kEAAG;AAChB;AACA;AACA;AACA;AACA;AACA,gBAAgB,wEAAS;AACzB;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA,aAAa,mGAAsB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,wDAAwD,EAAE;AAC/F;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,EAAE,EAAE;AACjB,SAAS;AACT;AACA;AACA,CAAC;AACgC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACyC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AAC8C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uDAAuD,EAAE;AAC9F;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA,aAAa,EAAE,EAAE;AACjB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AAC+B;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,8DAA8D,EAAE;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AAC8B;AAC/B;AACA;AACA,aAAa,yGAA4B;AACzC,mBAAmB,wEAAS;AAC5B,aAAa,yGAA4B;AACzC,mBAAmB,wEAAS;AAC5B,aAAa,yGAA4B;AACzC,mBAAmB,wEAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,oFAAoF,EAAE;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,uCAAuC;AACxE;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACgC;;;;;;;;;;;;;AC3kBjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACqD;AAC9C;AACP;AACA,sCAAsC,+CAA+C,EAAE;AACvF;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,iCAAiC,iBAAiB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,wEAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;;;;;;;;;;;ACpMA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACyD;AACzD,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA,2DAA2D,6BAA6B,EAAE;AAC1F;AACA,6EAA6E,4BAA4B,EAAE;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qEAAM;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,gCAAgC,gBAAgB,EAAE;AAClD;AACA;AACA,CAAC;AACwB","file":"4.4.js","sourcesContent":["/*---------------------------------------------------------------------------------------------\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';\nimport { format, isEOL } from './format.js';\nimport { parseTree, findNodeAtLocation } from './parser.js';\nexport function removeProperty(text, path, options) {\n    return setProperty(text, path, void 0, options);\n}\nexport function setProperty(text, originalPath, value, options) {\n    var _a;\n    var path = originalPath.slice();\n    var errors = [];\n    var root = parseTree(text, errors);\n    var parent = void 0;\n    var lastSegment = void 0;\n    while (path.length > 0) {\n        lastSegment = path.pop();\n        parent = findNodeAtLocation(root, path);\n        if (parent === void 0 && value !== void 0) {\n            if (typeof lastSegment === 'string') {\n                value = (_a = {}, _a[lastSegment] = value, _a);\n            }\n            else {\n                value = [value];\n            }\n        }\n        else {\n            break;\n        }\n    }\n    if (!parent) {\n        // empty document\n        if (value === void 0) { // delete\n            throw new Error('Can not delete in empty document');\n        }\n        return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, options);\n    }\n    else if (parent.type === 'object' && typeof lastSegment === 'string' && Array.isArray(parent.children)) {\n        var existing = findNodeAtLocation(parent, [lastSegment]);\n        if (existing !== void 0) {\n            if (value === void 0) { // delete\n                if (!existing.parent) {\n                    throw new Error('Malformed AST');\n                }\n                var propertyIndex = parent.children.indexOf(existing.parent);\n                var removeBegin = void 0;\n                var removeEnd = existing.parent.offset + existing.parent.length;\n                if (propertyIndex > 0) {\n                    // remove the comma of the previous node\n                    var previous = parent.children[propertyIndex - 1];\n                    removeBegin = previous.offset + previous.length;\n                }\n                else {\n                    removeBegin = parent.offset + 1;\n                    if (parent.children.length > 1) {\n                        // remove the comma of the next node\n                        var next = parent.children[1];\n                        removeEnd = next.offset;\n                    }\n                }\n                return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: '' }, options);\n            }\n            else {\n                // set value of existing property\n                return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options);\n            }\n        }\n        else {\n            if (value === void 0) { // delete\n                return []; // property does not exist, nothing to do\n            }\n            var newProperty = JSON.stringify(lastSegment) + \": \" + JSON.stringify(value);\n            var index = options.getInsertionIndex ? options.getInsertionIndex(parent.children.map(function (p) { return p.children[0].value; })) : parent.children.length;\n            var edit = void 0;\n            if (index > 0) {\n                var previous = parent.children[index - 1];\n                edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty };\n            }\n            else if (parent.children.length === 0) {\n                edit = { offset: parent.offset + 1, length: 0, content: newProperty };\n            }\n            else {\n                edit = { offset: parent.offset + 1, length: 0, content: newProperty + ',' };\n            }\n            return withFormatting(text, edit, options);\n        }\n    }\n    else if (parent.type === 'array' && typeof lastSegment === 'number' && Array.isArray(parent.children)) {\n        var insertIndex = lastSegment;\n        if (insertIndex === -1) {\n            // Insert\n            var newProperty = \"\" + JSON.stringify(value);\n            var edit = void 0;\n            if (parent.children.length === 0) {\n                edit = { offset: parent.offset + 1, length: 0, content: newProperty };\n            }\n            else {\n                var previous = parent.children[parent.children.length - 1];\n                edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty };\n            }\n            return withFormatting(text, edit, options);\n        }\n        else if (value === void 0 && parent.children.length >= 0) {\n            // Removal\n            var removalIndex = lastSegment;\n            var toRemove = parent.children[removalIndex];\n            var edit = void 0;\n            if (parent.children.length === 1) {\n                // only item\n                edit = { offset: parent.offset + 1, length: parent.length - 2, content: '' };\n            }\n            else if (parent.children.length - 1 === removalIndex) {\n                // last item\n                var previous = parent.children[removalIndex - 1];\n                var offset = previous.offset + previous.length;\n                var parentEndOffset = parent.offset + parent.length;\n                edit = { offset: offset, length: parentEndOffset - 2 - offset, content: '' };\n            }\n            else {\n                edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: '' };\n            }\n            return withFormatting(text, edit, options);\n        }\n        else if (value !== void 0) {\n            var edit = void 0;\n            var newProperty = \"\" + JSON.stringify(value);\n            if (!options.isArrayInsertion && parent.children.length > lastSegment) {\n                var toModify = parent.children[lastSegment];\n                edit = { offset: toModify.offset, length: toModify.length, content: newProperty };\n            }\n            else if (parent.children.length === 0 || lastSegment === 0) {\n                edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + ',' };\n            }\n            else {\n                var index = lastSegment > parent.children.length ? parent.children.length : lastSegment;\n                var previous = parent.children[index - 1];\n                edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty };\n            }\n            return withFormatting(text, edit, options);\n        }\n        else {\n            throw new Error(\"Can not \" + (value === void 0 ? 'remove' : (options.isArrayInsertion ? 'insert' : 'modify')) + \" Array index \" + insertIndex + \" as length is not sufficient\");\n        }\n    }\n    else {\n        throw new Error(\"Can not add \" + (typeof lastSegment !== 'number' ? 'index' : 'property') + \" to parent of type \" + parent.type);\n    }\n}\nfunction withFormatting(text, edit, options) {\n    if (!options.formattingOptions) {\n        return [edit];\n    }\n    // apply the edit\n    var newText = applyEdit(text, edit);\n    // format the new text\n    var begin = edit.offset;\n    var end = edit.offset + edit.content.length;\n    if (edit.length === 0 || edit.content.length === 0) { // insert or remove\n        while (begin > 0 && !isEOL(newText, begin - 1)) {\n            begin--;\n        }\n        while (end < newText.length && !isEOL(newText, end)) {\n            end++;\n        }\n    }\n    var edits = format(newText, { offset: begin, length: end - begin }, options.formattingOptions);\n    // apply the formatting edits and track the begin and end offsets of the changes\n    for (var i = edits.length - 1; i >= 0; i--) {\n        var edit_1 = edits[i];\n        newText = applyEdit(newText, edit_1);\n        begin = Math.min(begin, edit_1.offset);\n        end = Math.max(end, edit_1.offset + edit_1.length);\n        end += edit_1.content.length - edit_1.length;\n    }\n    // create a single edit with all changes\n    var editLength = text.length - (newText.length - end) - begin;\n    return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }];\n}\nexport function applyEdit(text, edit) {\n    return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length);\n}\nexport function isWS(text, offset) {\n    return '\\r\\n \\t'.indexOf(text.charAt(offset)) !== -1;\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';\nimport { createScanner } from './scanner.js';\nexport function format(documentText, range, options) {\n    var initialIndentLevel;\n    var formatText;\n    var formatTextStart;\n    var rangeStart;\n    var rangeEnd;\n    if (range) {\n        rangeStart = range.offset;\n        rangeEnd = rangeStart + range.length;\n        formatTextStart = rangeStart;\n        while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) {\n            formatTextStart--;\n        }\n        var endOffset = rangeEnd;\n        while (endOffset < documentText.length && !isEOL(documentText, endOffset)) {\n            endOffset++;\n        }\n        formatText = documentText.substring(formatTextStart, endOffset);\n        initialIndentLevel = computeIndentLevel(formatText, options);\n    }\n    else {\n        formatText = documentText;\n        initialIndentLevel = 0;\n        formatTextStart = 0;\n        rangeStart = 0;\n        rangeEnd = documentText.length;\n    }\n    var eol = getEOL(options, documentText);\n    var lineBreak = false;\n    var indentLevel = 0;\n    var indentValue;\n    if (options.insertSpaces) {\n        indentValue = repeat(' ', options.tabSize || 4);\n    }\n    else {\n        indentValue = '\\t';\n    }\n    var scanner = createScanner(formatText, false);\n    var hasError = false;\n    function newLineAndIndent() {\n        return eol + repeat(indentValue, initialIndentLevel + indentLevel);\n    }\n    function scanNext() {\n        var token = scanner.scan();\n        lineBreak = false;\n        while (token === 15 /* Trivia */ || token === 14 /* LineBreakTrivia */) {\n            lineBreak = lineBreak || (token === 14 /* LineBreakTrivia */);\n            token = scanner.scan();\n        }\n        hasError = token === 16 /* Unknown */ || scanner.getTokenError() !== 0 /* None */;\n        return token;\n    }\n    var editOperations = [];\n    function addEdit(text, startOffset, endOffset) {\n        if (!hasError && startOffset < rangeEnd && endOffset > rangeStart && documentText.substring(startOffset, endOffset) !== text) {\n            editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text });\n        }\n    }\n    var firstToken = scanNext();\n    if (firstToken !== 17 /* EOF */) {\n        var firstTokenStart = scanner.getTokenOffset() + formatTextStart;\n        var initialIndent = repeat(indentValue, initialIndentLevel);\n        addEdit(initialIndent, formatTextStart, firstTokenStart);\n    }\n    while (firstToken !== 17 /* EOF */) {\n        var firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;\n        var secondToken = scanNext();\n        var replaceContent = '';\n        while (!lineBreak && (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */)) {\n            // comments on the same line: keep them on the same line, but ignore them otherwise\n            var commentTokenStart = scanner.getTokenOffset() + formatTextStart;\n            addEdit(' ', firstTokenEnd, commentTokenStart);\n            firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;\n            replaceContent = secondToken === 12 /* LineCommentTrivia */ ? newLineAndIndent() : '';\n            secondToken = scanNext();\n        }\n        if (secondToken === 2 /* CloseBraceToken */) {\n            if (firstToken !== 1 /* OpenBraceToken */) {\n                indentLevel--;\n                replaceContent = newLineAndIndent();\n            }\n        }\n        else if (secondToken === 4 /* CloseBracketToken */) {\n            if (firstToken !== 3 /* OpenBracketToken */) {\n                indentLevel--;\n                replaceContent = newLineAndIndent();\n            }\n        }\n        else {\n            switch (firstToken) {\n                case 3 /* OpenBracketToken */:\n                case 1 /* OpenBraceToken */:\n                    indentLevel++;\n                    replaceContent = newLineAndIndent();\n                    break;\n                case 5 /* CommaToken */:\n                case 12 /* LineCommentTrivia */:\n                    replaceContent = newLineAndIndent();\n                    break;\n                case 13 /* BlockCommentTrivia */:\n                    if (lineBreak) {\n                        replaceContent = newLineAndIndent();\n                    }\n                    else {\n                        // symbol following comment on the same line: keep on same line, separate with ' '\n                        replaceContent = ' ';\n                    }\n                    break;\n                case 6 /* ColonToken */:\n                    replaceContent = ' ';\n                    break;\n                case 10 /* StringLiteral */:\n                    if (secondToken === 6 /* ColonToken */) {\n                        replaceContent = '';\n                        break;\n                    }\n                // fall through\n                case 7 /* NullKeyword */:\n                case 8 /* TrueKeyword */:\n                case 9 /* FalseKeyword */:\n                case 11 /* NumericLiteral */:\n                case 2 /* CloseBraceToken */:\n                case 4 /* CloseBracketToken */:\n                    if (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */) {\n                        replaceContent = ' ';\n                    }\n                    else if (secondToken !== 5 /* CommaToken */ && secondToken !== 17 /* EOF */) {\n                        hasError = true;\n                    }\n                    break;\n                case 16 /* Unknown */:\n                    hasError = true;\n                    break;\n            }\n            if (lineBreak && (secondToken === 12 /* LineCommentTrivia */ || secondToken === 13 /* BlockCommentTrivia */)) {\n                replaceContent = newLineAndIndent();\n            }\n        }\n        var secondTokenStart = scanner.getTokenOffset() + formatTextStart;\n        addEdit(replaceContent, firstTokenEnd, secondTokenStart);\n        firstToken = secondToken;\n    }\n    return editOperations;\n}\nfunction repeat(s, count) {\n    var result = '';\n    for (var i = 0; i < count; i++) {\n        result += s;\n    }\n    return result;\n}\nfunction computeIndentLevel(content, options) {\n    var i = 0;\n    var nChars = 0;\n    var tabSize = options.tabSize || 4;\n    while (i < content.length) {\n        var ch = content.charAt(i);\n        if (ch === ' ') {\n            nChars++;\n        }\n        else if (ch === '\\t') {\n            nChars += tabSize;\n        }\n        else {\n            break;\n        }\n        i++;\n    }\n    return Math.floor(nChars / tabSize);\n}\nfunction getEOL(options, text) {\n    for (var i = 0; i < text.length; i++) {\n        var ch = text.charAt(i);\n        if (ch === '\\r') {\n            if (i + 1 < text.length && text.charAt(i + 1) === '\\n') {\n                return '\\r\\n';\n            }\n            return '\\r';\n        }\n        else if (ch === '\\n') {\n            return '\\n';\n        }\n    }\n    return (options && options.eol) || '\\n';\n}\nexport function isEOL(text, offset) {\n    return '\\r\\n'.indexOf(text.charAt(offset)) !== -1;\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';\nimport { createScanner } from './scanner.js';\nvar ParseOptions;\n(function (ParseOptions) {\n    ParseOptions.DEFAULT = {\n        allowTrailingComma: false\n    };\n})(ParseOptions || (ParseOptions = {}));\n/**\n * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.\n */\nexport function getLocation(text, position) {\n    var segments = []; // strings or numbers\n    var earlyReturnException = new Object();\n    var previousNode = undefined;\n    var previousNodeInst = {\n        value: {},\n        offset: 0,\n        length: 0,\n        type: 'object',\n        parent: undefined\n    };\n    var isAtPropertyKey = false;\n    function setPreviousNode(value, offset, length, type) {\n        previousNodeInst.value = value;\n        previousNodeInst.offset = offset;\n        previousNodeInst.length = length;\n        previousNodeInst.type = type;\n        previousNodeInst.colonOffset = undefined;\n        previousNode = previousNodeInst;\n    }\n    try {\n        visit(text, {\n            onObjectBegin: function (offset, length) {\n                if (position <= offset) {\n                    throw earlyReturnException;\n                }\n                previousNode = undefined;\n                isAtPropertyKey = position > offset;\n                segments.push(''); // push a placeholder (will be replaced)\n            },\n            onObjectProperty: function (name, offset, length) {\n                if (position < offset) {\n                    throw earlyReturnException;\n                }\n                setPreviousNode(name, offset, length, 'property');\n                segments[segments.length - 1] = name;\n                if (position <= offset + length) {\n                    throw earlyReturnException;\n                }\n            },\n            onObjectEnd: function (offset, length) {\n                if (position <= offset) {\n                    throw earlyReturnException;\n                }\n                previousNode = undefined;\n                segments.pop();\n            },\n            onArrayBegin: function (offset, length) {\n                if (position <= offset) {\n                    throw earlyReturnException;\n                }\n                previousNode = undefined;\n                segments.push(0);\n            },\n            onArrayEnd: function (offset, length) {\n                if (position <= offset) {\n                    throw earlyReturnException;\n                }\n                previousNode = undefined;\n                segments.pop();\n            },\n            onLiteralValue: function (value, offset, length) {\n                if (position < offset) {\n                    throw earlyReturnException;\n                }\n                setPreviousNode(value, offset, length, getNodeType(value));\n                if (position <= offset + length) {\n                    throw earlyReturnException;\n                }\n            },\n            onSeparator: function (sep, offset, length) {\n                if (position <= offset) {\n                    throw earlyReturnException;\n                }\n                if (sep === ':' && previousNode && previousNode.type === 'property') {\n                    previousNode.colonOffset = offset;\n                    isAtPropertyKey = false;\n                    previousNode = undefined;\n                }\n                else if (sep === ',') {\n                    var last = segments[segments.length - 1];\n                    if (typeof last === 'number') {\n                        segments[segments.length - 1] = last + 1;\n                    }\n                    else {\n                        isAtPropertyKey = true;\n                        segments[segments.length - 1] = '';\n                    }\n                    previousNode = undefined;\n                }\n            }\n        });\n    }\n    catch (e) {\n        if (e !== earlyReturnException) {\n            throw e;\n        }\n    }\n    return {\n        path: segments,\n        previousNode: previousNode,\n        isAtPropertyKey: isAtPropertyKey,\n        matches: function (pattern) {\n            var k = 0;\n            for (var i = 0; k < pattern.length && i < segments.length; i++) {\n                if (pattern[k] === segments[i] || pattern[k] === '*') {\n                    k++;\n                }\n                else if (pattern[k] !== '**') {\n                    return false;\n                }\n            }\n            return k === pattern.length;\n        }\n    };\n}\n/**\n * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n * Therefore always check the errors list to find out if the input was valid.\n */\nexport function parse(text, errors, options) {\n    if (errors === void 0) { errors = []; }\n    if (options === void 0) { options = ParseOptions.DEFAULT; }\n    var currentProperty = null;\n    var currentParent = [];\n    var previousParents = [];\n    function onValue(value) {\n        if (Array.isArray(currentParent)) {\n            currentParent.push(value);\n        }\n        else if (currentProperty !== null) {\n            currentParent[currentProperty] = value;\n        }\n    }\n    var visitor = {\n        onObjectBegin: function () {\n            var object = {};\n            onValue(object);\n            previousParents.push(currentParent);\n            currentParent = object;\n            currentProperty = null;\n        },\n        onObjectProperty: function (name) {\n            currentProperty = name;\n        },\n        onObjectEnd: function () {\n            currentParent = previousParents.pop();\n        },\n        onArrayBegin: function () {\n            var array = [];\n            onValue(array);\n            previousParents.push(currentParent);\n            currentParent = array;\n            currentProperty = null;\n        },\n        onArrayEnd: function () {\n            currentParent = previousParents.pop();\n        },\n        onLiteralValue: onValue,\n        onError: function (error, offset, length) {\n            errors.push({ error: error, offset: offset, length: length });\n        }\n    };\n    visit(text, visitor, options);\n    return currentParent[0];\n}\n/**\n * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n */\nexport function parseTree(text, errors, options) {\n    if (errors === void 0) { errors = []; }\n    if (options === void 0) { options = ParseOptions.DEFAULT; }\n    var currentParent = { type: 'array', offset: -1, length: -1, children: [], parent: undefined }; // artificial root\n    function ensurePropertyComplete(endOffset) {\n        if (currentParent.type === 'property') {\n            currentParent.length = endOffset - currentParent.offset;\n            currentParent = currentParent.parent;\n        }\n    }\n    function onValue(valueNode) {\n        currentParent.children.push(valueNode);\n        return valueNode;\n    }\n    var visitor = {\n        onObjectBegin: function (offset) {\n            currentParent = onValue({ type: 'object', offset: offset, length: -1, parent: currentParent, children: [] });\n        },\n        onObjectProperty: function (name, offset, length) {\n            currentParent = onValue({ type: 'property', offset: offset, length: -1, parent: currentParent, children: [] });\n            currentParent.children.push({ type: 'string', value: name, offset: offset, length: length, parent: currentParent });\n        },\n        onObjectEnd: function (offset, length) {\n            ensurePropertyComplete(offset + length); // in case of a missing value for a property: make sure property is complete\n            currentParent.length = offset + length - currentParent.offset;\n            currentParent = currentParent.parent;\n            ensurePropertyComplete(offset + length);\n        },\n        onArrayBegin: function (offset, length) {\n            currentParent = onValue({ type: 'array', offset: offset, length: -1, parent: currentParent, children: [] });\n        },\n        onArrayEnd: function (offset, length) {\n            currentParent.length = offset + length - currentParent.offset;\n            currentParent = currentParent.parent;\n            ensurePropertyComplete(offset + length);\n        },\n        onLiteralValue: function (value, offset, length) {\n            onValue({ type: getNodeType(value), offset: offset, length: length, parent: currentParent, value: value });\n            ensurePropertyComplete(offset + length);\n        },\n        onSeparator: function (sep, offset, length) {\n            if (currentParent.type === 'property') {\n                if (sep === ':') {\n                    currentParent.colonOffset = offset;\n                }\n                else if (sep === ',') {\n                    ensurePropertyComplete(offset);\n                }\n            }\n        },\n        onError: function (error, offset, length) {\n            errors.push({ error: error, offset: offset, length: length });\n        }\n    };\n    visit(text, visitor, options);\n    var result = currentParent.children[0];\n    if (result) {\n        delete result.parent;\n    }\n    return result;\n}\n/**\n * Finds the node at the given path in a JSON DOM.\n */\nexport function findNodeAtLocation(root, path) {\n    if (!root) {\n        return undefined;\n    }\n    var node = root;\n    for (var _i = 0, path_1 = path; _i < path_1.length; _i++) {\n        var segment = path_1[_i];\n        if (typeof segment === 'string') {\n            if (node.type !== 'object' || !Array.isArray(node.children)) {\n                return undefined;\n            }\n            var found = false;\n            for (var _a = 0, _b = node.children; _a < _b.length; _a++) {\n                var propertyNode = _b[_a];\n                if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment) {\n                    node = propertyNode.children[1];\n                    found = true;\n                    break;\n                }\n            }\n            if (!found) {\n                return undefined;\n            }\n        }\n        else {\n            var index = segment;\n            if (node.type !== 'array' || index < 0 || !Array.isArray(node.children) || index >= node.children.length) {\n                return undefined;\n            }\n            node = node.children[index];\n        }\n    }\n    return node;\n}\n/**\n * Gets the JSON path of the given JSON DOM node\n */\nexport function getNodePath(node) {\n    if (!node.parent || !node.parent.children) {\n        return [];\n    }\n    var path = getNodePath(node.parent);\n    if (node.parent.type === 'property') {\n        var key = node.parent.children[0].value;\n        path.push(key);\n    }\n    else if (node.parent.type === 'array') {\n        var index = node.parent.children.indexOf(node);\n        if (index !== -1) {\n            path.push(index);\n        }\n    }\n    return path;\n}\n/**\n * Evaluates the JavaScript object of the given JSON DOM node\n */\nexport function getNodeValue(node) {\n    switch (node.type) {\n        case 'array':\n            return node.children.map(getNodeValue);\n        case 'object':\n            var obj = Object.create(null);\n            for (var _i = 0, _a = node.children; _i < _a.length; _i++) {\n                var prop = _a[_i];\n                var valueNode = prop.children[1];\n                if (valueNode) {\n                    obj[prop.children[0].value] = getNodeValue(valueNode);\n                }\n            }\n            return obj;\n        case 'null':\n        case 'string':\n        case 'number':\n        case 'boolean':\n            return node.value;\n        default:\n            return undefined;\n    }\n}\nexport function contains(node, offset, includeRightBound) {\n    if (includeRightBound === void 0) { includeRightBound = false; }\n    return (offset >= node.offset && offset < (node.offset + node.length)) || includeRightBound && (offset === (node.offset + node.length));\n}\n/**\n * Finds the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.\n */\nexport function findNodeAtOffset(node, offset, includeRightBound) {\n    if (includeRightBound === void 0) { includeRightBound = false; }\n    if (contains(node, offset, includeRightBound)) {\n        var children = node.children;\n        if (Array.isArray(children)) {\n            for (var i = 0; i < children.length && children[i].offset <= offset; i++) {\n                var item = findNodeAtOffset(children[i], offset, includeRightBound);\n                if (item) {\n                    return item;\n                }\n            }\n        }\n        return node;\n    }\n    return undefined;\n}\n/**\n * Parses the given text and invokes the visitor functions for each object, array and literal reached.\n */\nexport function visit(text, visitor, options) {\n    if (options === void 0) { options = ParseOptions.DEFAULT; }\n    var _scanner = createScanner(text, false);\n    function toNoArgVisit(visitFunction) {\n        return visitFunction ? function () { return visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; };\n    }\n    function toOneArgVisit(visitFunction) {\n        return visitFunction ? function (arg) { return visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; };\n    }\n    var onObjectBegin = toNoArgVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisit(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisit(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisit(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);\n    var disallowComments = options && options.disallowComments;\n    var allowTrailingComma = options && options.allowTrailingComma;\n    function scanNext() {\n        while (true) {\n            var token = _scanner.scan();\n            switch (_scanner.getTokenError()) {\n                case 4 /* InvalidUnicode */:\n                    handleError(14 /* InvalidUnicode */);\n                    break;\n                case 5 /* InvalidEscapeCharacter */:\n                    handleError(15 /* InvalidEscapeCharacter */);\n                    break;\n                case 3 /* UnexpectedEndOfNumber */:\n                    handleError(13 /* UnexpectedEndOfNumber */);\n                    break;\n                case 1 /* UnexpectedEndOfComment */:\n                    if (!disallowComments) {\n                        handleError(11 /* UnexpectedEndOfComment */);\n                    }\n                    break;\n                case 2 /* UnexpectedEndOfString */:\n                    handleError(12 /* UnexpectedEndOfString */);\n                    break;\n                case 6 /* InvalidCharacter */:\n                    handleError(16 /* InvalidCharacter */);\n                    break;\n            }\n            switch (token) {\n                case 12 /* LineCommentTrivia */:\n                case 13 /* BlockCommentTrivia */:\n                    if (disallowComments) {\n                        handleError(10 /* InvalidCommentToken */);\n                    }\n                    else {\n                        onComment();\n                    }\n                    break;\n                case 16 /* Unknown */:\n                    handleError(1 /* InvalidSymbol */);\n                    break;\n                case 15 /* Trivia */:\n                case 14 /* LineBreakTrivia */:\n                    break;\n                default:\n                    return token;\n            }\n        }\n    }\n    function handleError(error, skipUntilAfter, skipUntil) {\n        if (skipUntilAfter === void 0) { skipUntilAfter = []; }\n        if (skipUntil === void 0) { skipUntil = []; }\n        onError(error);\n        if (skipUntilAfter.length + skipUntil.length > 0) {\n            var token = _scanner.getToken();\n            while (token !== 17 /* EOF */) {\n                if (skipUntilAfter.indexOf(token) !== -1) {\n                    scanNext();\n                    break;\n                }\n                else if (skipUntil.indexOf(token) !== -1) {\n                    break;\n                }\n                token = scanNext();\n            }\n        }\n    }\n    function parseString(isValue) {\n        var value = _scanner.getTokenValue();\n        if (isValue) {\n            onLiteralValue(value);\n        }\n        else {\n            onObjectProperty(value);\n        }\n        scanNext();\n        return true;\n    }\n    function parseLiteral() {\n        switch (_scanner.getToken()) {\n            case 11 /* NumericLiteral */:\n                var value = 0;\n                try {\n                    value = JSON.parse(_scanner.getTokenValue());\n                    if (typeof value !== 'number') {\n                        handleError(2 /* InvalidNumberFormat */);\n                        value = 0;\n                    }\n                }\n                catch (e) {\n                    handleError(2 /* InvalidNumberFormat */);\n                }\n                onLiteralValue(value);\n                break;\n            case 7 /* NullKeyword */:\n                onLiteralValue(null);\n                break;\n            case 8 /* TrueKeyword */:\n                onLiteralValue(true);\n                break;\n            case 9 /* FalseKeyword */:\n                onLiteralValue(false);\n                break;\n            default:\n                return false;\n        }\n        scanNext();\n        return true;\n    }\n    function parseProperty() {\n        if (_scanner.getToken() !== 10 /* StringLiteral */) {\n            handleError(3 /* PropertyNameExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n            return false;\n        }\n        parseString(false);\n        if (_scanner.getToken() === 6 /* ColonToken */) {\n            onSeparator(':');\n            scanNext(); // consume colon\n            if (!parseValue()) {\n                handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n            }\n        }\n        else {\n            handleError(5 /* ColonExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n        }\n        return true;\n    }\n    function parseObject() {\n        onObjectBegin();\n        scanNext(); // consume open brace\n        var needsComma = false;\n        while (_scanner.getToken() !== 2 /* CloseBraceToken */ && _scanner.getToken() !== 17 /* EOF */) {\n            if (_scanner.getToken() === 5 /* CommaToken */) {\n                if (!needsComma) {\n                    handleError(4 /* ValueExpected */, [], []);\n                }\n                onSeparator(',');\n                scanNext(); // consume comma\n                if (_scanner.getToken() === 2 /* CloseBraceToken */ && allowTrailingComma) {\n                    break;\n                }\n            }\n            else if (needsComma) {\n                handleError(6 /* CommaExpected */, [], []);\n            }\n            if (!parseProperty()) {\n                handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n            }\n            needsComma = true;\n        }\n        onObjectEnd();\n        if (_scanner.getToken() !== 2 /* CloseBraceToken */) {\n            handleError(7 /* CloseBraceExpected */, [2 /* CloseBraceToken */], []);\n        }\n        else {\n            scanNext(); // consume close brace\n        }\n        return true;\n    }\n    function parseArray() {\n        onArrayBegin();\n        scanNext(); // consume open bracket\n        var needsComma = false;\n        while (_scanner.getToken() !== 4 /* CloseBracketToken */ && _scanner.getToken() !== 17 /* EOF */) {\n            if (_scanner.getToken() === 5 /* CommaToken */) {\n                if (!needsComma) {\n                    handleError(4 /* ValueExpected */, [], []);\n                }\n                onSeparator(',');\n                scanNext(); // consume comma\n                if (_scanner.getToken() === 4 /* CloseBracketToken */ && allowTrailingComma) {\n                    break;\n                }\n            }\n            else if (needsComma) {\n                handleError(6 /* CommaExpected */, [], []);\n            }\n            if (!parseValue()) {\n                handleError(4 /* ValueExpected */, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]);\n            }\n            needsComma = true;\n        }\n        onArrayEnd();\n        if (_scanner.getToken() !== 4 /* CloseBracketToken */) {\n            handleError(8 /* CloseBracketExpected */, [4 /* CloseBracketToken */], []);\n        }\n        else {\n            scanNext(); // consume close bracket\n        }\n        return true;\n    }\n    function parseValue() {\n        switch (_scanner.getToken()) {\n            case 3 /* OpenBracketToken */:\n                return parseArray();\n            case 1 /* OpenBraceToken */:\n                return parseObject();\n            case 10 /* StringLiteral */:\n                return parseString(true);\n            default:\n                return parseLiteral();\n        }\n    }\n    scanNext();\n    if (_scanner.getToken() === 17 /* EOF */) {\n        if (options.allowEmptyContent) {\n            return true;\n        }\n        handleError(4 /* ValueExpected */, [], []);\n        return false;\n    }\n    if (!parseValue()) {\n        handleError(4 /* ValueExpected */, [], []);\n        return false;\n    }\n    if (_scanner.getToken() !== 17 /* EOF */) {\n        handleError(9 /* EndOfFileExpected */, [], []);\n    }\n    return true;\n}\n/**\n * Takes JSON with JavaScript-style comments and remove\n * them. Optionally replaces every none-newline character\n * of comments with a replaceCharacter\n */\nexport function stripComments(text, replaceCh) {\n    var _scanner = createScanner(text), parts = [], kind, offset = 0, pos;\n    do {\n        pos = _scanner.getPosition();\n        kind = _scanner.scan();\n        switch (kind) {\n            case 12 /* LineCommentTrivia */:\n            case 13 /* BlockCommentTrivia */:\n            case 17 /* EOF */:\n                if (offset !== pos) {\n                    parts.push(text.substring(offset, pos));\n                }\n                if (replaceCh !== undefined) {\n                    parts.push(_scanner.getTokenValue().replace(/[^\\r\\n]/g, replaceCh));\n                }\n                offset = _scanner.getPosition();\n                break;\n        }\n    } while (kind !== 17 /* EOF */);\n    return parts.join('');\n}\nexport function getNodeType(value) {\n    switch (typeof value) {\n        case 'boolean': return 'boolean';\n        case 'number': return 'number';\n        case 'string': return 'string';\n        case 'object': {\n            if (!value) {\n                return 'null';\n            }\n            else if (Array.isArray(value)) {\n                return 'array';\n            }\n            return 'object';\n        }\n        default: return 'null';\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/**\n * Creates a JSON scanner on the given text.\n * If ignoreTrivia is set, whitespaces or comments are ignored.\n */\nexport function createScanner(text, ignoreTrivia) {\n    if (ignoreTrivia === void 0) { ignoreTrivia = false; }\n    var len = text.length;\n    var pos = 0, value = '', tokenOffset = 0, token = 16 /* Unknown */, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0 /* None */;\n    function scanHexDigits(count, exact) {\n        var digits = 0;\n        var value = 0;\n        while (digits < count || !exact) {\n            var ch = text.charCodeAt(pos);\n            if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) {\n                value = value * 16 + ch - 48 /* _0 */;\n            }\n            else if (ch >= 65 /* A */ && ch <= 70 /* F */) {\n                value = value * 16 + ch - 65 /* A */ + 10;\n            }\n            else if (ch >= 97 /* a */ && ch <= 102 /* f */) {\n                value = value * 16 + ch - 97 /* a */ + 10;\n            }\n            else {\n                break;\n            }\n            pos++;\n            digits++;\n        }\n        if (digits < count) {\n            value = -1;\n        }\n        return value;\n    }\n    function setPosition(newPosition) {\n        pos = newPosition;\n        value = '';\n        tokenOffset = 0;\n        token = 16 /* Unknown */;\n        scanError = 0 /* None */;\n    }\n    function scanNumber() {\n        var start = pos;\n        if (text.charCodeAt(pos) === 48 /* _0 */) {\n            pos++;\n        }\n        else {\n            pos++;\n            while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n                pos++;\n            }\n        }\n        if (pos < text.length && text.charCodeAt(pos) === 46 /* dot */) {\n            pos++;\n            if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n                pos++;\n                while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n                    pos++;\n                }\n            }\n            else {\n                scanError = 3 /* UnexpectedEndOfNumber */;\n                return text.substring(start, pos);\n            }\n        }\n        var end = pos;\n        if (pos < text.length && (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */)) {\n            pos++;\n            if (pos < text.length && text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) {\n                pos++;\n            }\n            if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n                pos++;\n                while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n                    pos++;\n                }\n                end = pos;\n            }\n            else {\n                scanError = 3 /* UnexpectedEndOfNumber */;\n            }\n        }\n        return text.substring(start, end);\n    }\n    function scanString() {\n        var result = '', start = pos;\n        while (true) {\n            if (pos >= len) {\n                result += text.substring(start, pos);\n                scanError = 2 /* UnexpectedEndOfString */;\n                break;\n            }\n            var ch = text.charCodeAt(pos);\n            if (ch === 34 /* doubleQuote */) {\n                result += text.substring(start, pos);\n                pos++;\n                break;\n            }\n            if (ch === 92 /* backslash */) {\n                result += text.substring(start, pos);\n                pos++;\n                if (pos >= len) {\n                    scanError = 2 /* UnexpectedEndOfString */;\n                    break;\n                }\n                var ch2 = text.charCodeAt(pos++);\n                switch (ch2) {\n                    case 34 /* doubleQuote */:\n                        result += '\\\"';\n                        break;\n                    case 92 /* backslash */:\n                        result += '\\\\';\n                        break;\n                    case 47 /* slash */:\n                        result += '/';\n                        break;\n                    case 98 /* b */:\n                        result += '\\b';\n                        break;\n                    case 102 /* f */:\n                        result += '\\f';\n                        break;\n                    case 110 /* n */:\n                        result += '\\n';\n                        break;\n                    case 114 /* r */:\n                        result += '\\r';\n                        break;\n                    case 116 /* t */:\n                        result += '\\t';\n                        break;\n                    case 117 /* u */:\n                        var ch3 = scanHexDigits(4, true);\n                        if (ch3 >= 0) {\n                            result += String.fromCharCode(ch3);\n                        }\n                        else {\n                            scanError = 4 /* InvalidUnicode */;\n                        }\n                        break;\n                    default:\n                        scanError = 5 /* InvalidEscapeCharacter */;\n                }\n                start = pos;\n                continue;\n            }\n            if (ch >= 0 && ch <= 0x1f) {\n                if (isLineBreak(ch)) {\n                    result += text.substring(start, pos);\n                    scanError = 2 /* UnexpectedEndOfString */;\n                    break;\n                }\n                else {\n                    scanError = 6 /* InvalidCharacter */;\n                    // mark as error but continue with string\n                }\n            }\n            pos++;\n        }\n        return result;\n    }\n    function scanNext() {\n        value = '';\n        scanError = 0 /* None */;\n        tokenOffset = pos;\n        lineStartOffset = lineNumber;\n        prevTokenLineStartOffset = tokenLineStartOffset;\n        if (pos >= len) {\n            // at the end\n            tokenOffset = len;\n            return token = 17 /* EOF */;\n        }\n        var code = text.charCodeAt(pos);\n        // trivia: whitespace\n        if (isWhiteSpace(code)) {\n            do {\n                pos++;\n                value += String.fromCharCode(code);\n                code = text.charCodeAt(pos);\n            } while (isWhiteSpace(code));\n            return token = 15 /* Trivia */;\n        }\n        // trivia: newlines\n        if (isLineBreak(code)) {\n            pos++;\n            value += String.fromCharCode(code);\n            if (code === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) {\n                pos++;\n                value += '\\n';\n            }\n            lineNumber++;\n            tokenLineStartOffset = pos;\n            return token = 14 /* LineBreakTrivia */;\n        }\n        switch (code) {\n            // tokens: []{}:,\n            case 123 /* openBrace */:\n                pos++;\n                return token = 1 /* OpenBraceToken */;\n            case 125 /* closeBrace */:\n                pos++;\n                return token = 2 /* CloseBraceToken */;\n            case 91 /* openBracket */:\n                pos++;\n                return token = 3 /* OpenBracketToken */;\n            case 93 /* closeBracket */:\n                pos++;\n                return token = 4 /* CloseBracketToken */;\n            case 58 /* colon */:\n                pos++;\n                return token = 6 /* ColonToken */;\n            case 44 /* comma */:\n                pos++;\n                return token = 5 /* CommaToken */;\n            // strings\n            case 34 /* doubleQuote */:\n                pos++;\n                value = scanString();\n                return token = 10 /* StringLiteral */;\n            // comments\n            case 47 /* slash */:\n                var start = pos - 1;\n                // Single-line comment\n                if (text.charCodeAt(pos + 1) === 47 /* slash */) {\n                    pos += 2;\n                    while (pos < len) {\n                        if (isLineBreak(text.charCodeAt(pos))) {\n                            break;\n                        }\n                        pos++;\n                    }\n                    value = text.substring(start, pos);\n                    return token = 12 /* LineCommentTrivia */;\n                }\n                // Multi-line comment\n                if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {\n                    pos += 2;\n                    var safeLength = len - 1; // For lookahead.\n                    var commentClosed = false;\n                    while (pos < safeLength) {\n                        var ch = text.charCodeAt(pos);\n                        if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {\n                            pos += 2;\n                            commentClosed = true;\n                            break;\n                        }\n                        pos++;\n                        if (isLineBreak(ch)) {\n                            if (ch === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) {\n                                pos++;\n                            }\n                            lineNumber++;\n                            tokenLineStartOffset = pos;\n                        }\n                    }\n                    if (!commentClosed) {\n                        pos++;\n                        scanError = 1 /* UnexpectedEndOfComment */;\n                    }\n                    value = text.substring(start, pos);\n                    return token = 13 /* BlockCommentTrivia */;\n                }\n                // just a single slash\n                value += String.fromCharCode(code);\n                pos++;\n                return token = 16 /* Unknown */;\n            // numbers\n            case 45 /* minus */:\n                value += String.fromCharCode(code);\n                pos++;\n                if (pos === len || !isDigit(text.charCodeAt(pos))) {\n                    return token = 16 /* Unknown */;\n                }\n            // found a minus, followed by a number so\n            // we fall through to proceed with scanning\n            // numbers\n            case 48 /* _0 */:\n            case 49 /* _1 */:\n            case 50 /* _2 */:\n            case 51 /* _3 */:\n            case 52 /* _4 */:\n            case 53 /* _5 */:\n            case 54 /* _6 */:\n            case 55 /* _7 */:\n            case 56 /* _8 */:\n            case 57 /* _9 */:\n                value += scanNumber();\n                return token = 11 /* NumericLiteral */;\n            // literals and unknown symbols\n            default:\n                // is a literal? Read the full word.\n                while (pos < len && isUnknownContentCharacter(code)) {\n                    pos++;\n                    code = text.charCodeAt(pos);\n                }\n                if (tokenOffset !== pos) {\n                    value = text.substring(tokenOffset, pos);\n                    // keywords: true, false, null\n                    switch (value) {\n                        case 'true': return token = 8 /* TrueKeyword */;\n                        case 'false': return token = 9 /* FalseKeyword */;\n                        case 'null': return token = 7 /* NullKeyword */;\n                    }\n                    return token = 16 /* Unknown */;\n                }\n                // some\n                value += String.fromCharCode(code);\n                pos++;\n                return token = 16 /* Unknown */;\n        }\n    }\n    function isUnknownContentCharacter(code) {\n        if (isWhiteSpace(code) || isLineBreak(code)) {\n            return false;\n        }\n        switch (code) {\n            case 125 /* closeBrace */:\n            case 93 /* closeBracket */:\n            case 123 /* openBrace */:\n            case 91 /* openBracket */:\n            case 34 /* doubleQuote */:\n            case 58 /* colon */:\n            case 44 /* comma */:\n            case 47 /* slash */:\n                return false;\n        }\n        return true;\n    }\n    function scanNextNonTrivia() {\n        var result;\n        do {\n            result = scanNext();\n        } while (result >= 12 /* LineCommentTrivia */ && result <= 15 /* Trivia */);\n        return result;\n    }\n    return {\n        setPosition: setPosition,\n        getPosition: function () { return pos; },\n        scan: ignoreTrivia ? scanNextNonTrivia : scanNext,\n        getToken: function () { return token; },\n        getTokenValue: function () { return value; },\n        getTokenOffset: function () { return tokenOffset; },\n        getTokenLength: function () { return pos - tokenOffset; },\n        getTokenStartLine: function () { return lineStartOffset; },\n        getTokenStartCharacter: function () { return tokenOffset - prevTokenLineStartOffset; },\n        getTokenError: function () { return scanError; },\n    };\n}\nfunction isWhiteSpace(ch) {\n    return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ ||\n        ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ ||\n        ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */;\n}\nfunction isLineBreak(ch) {\n    return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */;\n}\nfunction isDigit(ch) {\n    return ch >= 48 /* _0 */ && ch <= 57 /* _9 */;\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';\nimport * as formatter from './impl/format.js';\nimport * as edit from './impl/edit.js';\nimport * as scanner from './impl/scanner.js';\nimport * as parser from './impl/parser.js';\n/**\n * Creates a JSON scanner on the given text.\n * If ignoreTrivia is set, whitespaces or comments are ignored.\n */\nexport var createScanner = scanner.createScanner;\n/**\n * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.\n */\nexport var getLocation = parser.getLocation;\n/**\n * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n * Therefore, always check the errors list to find out if the input was valid.\n */\nexport var parse = parser.parse;\n/**\n * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.\n */\nexport var parseTree = parser.parseTree;\n/**\n * Finds the node at the given path in a JSON DOM.\n */\nexport var findNodeAtLocation = parser.findNodeAtLocation;\n/**\n * Finds the innermost node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.\n */\nexport var findNodeAtOffset = parser.findNodeAtOffset;\n/**\n * Gets the JSON path of the given JSON DOM node\n */\nexport var getNodePath = parser.getNodePath;\n/**\n * Evaluates the JavaScript object of the given JSON DOM node\n */\nexport var getNodeValue = parser.getNodeValue;\n/**\n * Parses the given text and invokes the visitor functions for each object, array and literal reached.\n */\nexport var visit = parser.visit;\n/**\n * Takes JSON with JavaScript-style comments and remove\n * them. Optionally replaces every none-newline character\n * of comments with a replaceCharacter\n */\nexport var stripComments = parser.stripComments;\nexport function printParseErrorCode(code) {\n    switch (code) {\n        case 1 /* InvalidSymbol */: return 'InvalidSymbol';\n        case 2 /* InvalidNumberFormat */: return 'InvalidNumberFormat';\n        case 3 /* PropertyNameExpected */: return 'PropertyNameExpected';\n        case 4 /* ValueExpected */: return 'ValueExpected';\n        case 5 /* ColonExpected */: return 'ColonExpected';\n        case 6 /* CommaExpected */: return 'CommaExpected';\n        case 7 /* CloseBraceExpected */: return 'CloseBraceExpected';\n        case 8 /* CloseBracketExpected */: return 'CloseBracketExpected';\n        case 9 /* EndOfFileExpected */: return 'EndOfFileExpected';\n        case 10 /* InvalidCommentToken */: return 'InvalidCommentToken';\n        case 11 /* UnexpectedEndOfComment */: return 'UnexpectedEndOfComment';\n        case 12 /* UnexpectedEndOfString */: return 'UnexpectedEndOfString';\n        case 13 /* UnexpectedEndOfNumber */: return 'UnexpectedEndOfNumber';\n        case 14 /* InvalidUnicode */: return 'InvalidUnicode';\n        case 15 /* InvalidEscapeCharacter */: return 'InvalidEscapeCharacter';\n        case 16 /* InvalidCharacter */: return 'InvalidCharacter';\n    }\n    return '<unknown ParseErrorCode>';\n}\n/**\n * Computes the edits needed to format a JSON document.\n *\n * @param documentText The input text\n * @param range The range to format or `undefined` to format the full content\n * @param options The formatting options\n * @returns A list of edit operations describing the formatting changes to the original document. Edits can be either inserts, replacements or\n * removals of text segments. All offsets refer to the original state of the document. No two edits must change or remove the same range of\n * text in the original document. However, multiple edits can have\n * the same offset, for example multiple inserts, or an insert followed by a remove or replace. The order in the array defines which edit is applied first.\n * To apply edits to an input, you can use `applyEdits`.\n */\nexport function format(documentText, range, options) {\n    return formatter.format(documentText, range, options);\n}\n/**\n * Computes the edits needed to modify a value in the JSON document.\n *\n * @param documentText The input text\n * @param path The path of the value to change. The path represents either to the document root, a property or an array item.\n * If the path points to an non-existing property or item, it will be created.\n * @param value The new value for the specified property or item. If the value is undefined,\n * the property or item will be removed.\n * @param options Options\n * @returns A list of edit operations describing the formatting changes to the original document. Edits can be either inserts, replacements or\n * removals of text segments. All offsets refer to the original state of the document. No two edits must change or remove the same range of\n * text in the original document. However, multiple edits can have\n * the same offset, for example multiple inserts, or an insert followed by a remove or replace. The order in the array defines which edit is applied first.\n * To apply edits to an input, you can use `applyEdits`.\n */\nexport function modify(text, path, value, options) {\n    return edit.setProperty(text, path, value, options);\n}\n/**\n * Applies edits to a input string.\n */\nexport function applyEdits(text, edits) {\n    for (var i = edits.length - 1; i >= 0; i--) {\n        text = edit.applyEdit(text, edits[i]);\n    }\n    return text;\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 *--------------------------------------------------------------------------------------------*/\nimport { JSONCompletion } from './services/jsonCompletion.js';\nimport { JSONHover } from './services/jsonHover.js';\nimport { JSONValidation } from './services/jsonValidation.js';\nimport { JSONDocumentSymbols } from './services/jsonDocumentSymbols.js';\nimport { parse as parseJSON, newJSONDocument } from './parser/jsonParser.js';\nimport { schemaContributions } from './services/configuration.js';\nimport { JSONSchemaService } from './services/jsonSchemaService.js';\nimport { getFoldingRanges } from './services/jsonFolding.js';\nimport { getSelectionRanges } from './services/jsonSelectionRanges.js';\nimport { format as formatJSON } from '../jsonc-parser/main.js';\nimport { Range, TextEdit } from './jsonLanguageTypes.js';\nimport { findDefinition } from './services/jsonDefinition.js';\nexport * from './jsonLanguageTypes.js';\nexport function getLanguageService(params) {\n    var promise = params.promiseConstructor || Promise;\n    var jsonSchemaService = new JSONSchemaService(params.schemaRequestService, params.workspaceContext, promise);\n    jsonSchemaService.setSchemaContributions(schemaContributions);\n    var jsonCompletion = new JSONCompletion(jsonSchemaService, params.contributions, promise, params.clientCapabilities);\n    var jsonHover = new JSONHover(jsonSchemaService, params.contributions, promise);\n    var jsonDocumentSymbols = new JSONDocumentSymbols(jsonSchemaService);\n    var jsonValidation = new JSONValidation(jsonSchemaService, promise);\n    return {\n        configure: function (settings) {\n            jsonSchemaService.clearExternalSchemas();\n            if (settings.schemas) {\n                settings.schemas.forEach(function (settings) {\n                    jsonSchemaService.registerExternalSchema(settings.uri, settings.fileMatch, settings.schema);\n                });\n            }\n            jsonValidation.configure(settings);\n        },\n        resetSchema: function (uri) { return jsonSchemaService.onResourceChange(uri); },\n        doValidation: jsonValidation.doValidation.bind(jsonValidation),\n        parseJSONDocument: function (document) { return parseJSON(document, { collectComments: true }); },\n        newJSONDocument: function (root, diagnostics) { return newJSONDocument(root, diagnostics); },\n        getMatchingSchemas: jsonSchemaService.getMatchingSchemas.bind(jsonSchemaService),\n        doResolve: jsonCompletion.doResolve.bind(jsonCompletion),\n        doComplete: jsonCompletion.doComplete.bind(jsonCompletion),\n        findDocumentSymbols: jsonDocumentSymbols.findDocumentSymbols.bind(jsonDocumentSymbols),\n        findDocumentSymbols2: jsonDocumentSymbols.findDocumentSymbols2.bind(jsonDocumentSymbols),\n        findColorSymbols: function (d, s) { return jsonDocumentSymbols.findDocumentColors(d, s).then(function (s) { return s.map(function (s) { return s.range; }); }); },\n        findDocumentColors: jsonDocumentSymbols.findDocumentColors.bind(jsonDocumentSymbols),\n        getColorPresentations: jsonDocumentSymbols.getColorPresentations.bind(jsonDocumentSymbols),\n        doHover: jsonHover.doHover.bind(jsonHover),\n        getFoldingRanges: getFoldingRanges,\n        getSelectionRanges: getSelectionRanges,\n        findDefinition: findDefinition,\n        format: function (d, r, o) {\n            var range = undefined;\n            if (r) {\n                var offset = d.offsetAt(r.start);\n                var length = d.offsetAt(r.end) - offset;\n                range = { offset: offset, length: length };\n            }\n            var options = { tabSize: o ? o.tabSize : 4, insertSpaces: o ? o.insertSpaces : true, eol: '\\n' };\n            return formatJSON(d.getText(), range, options).map(function (e) {\n                return TextEdit.replace(Range.create(d.positionAt(e.offset), d.positionAt(e.offset + e.length)), e.content);\n            });\n        }\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 *--------------------------------------------------------------------------------------------*/\nimport { Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, MarkupKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, Position, InsertTextFormat, MarkupContent, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, FormattingOptions } from '../vscode-languageserver-types/main.js';\nimport { TextDocument } from '../vscode-languageserver-textdocument/lib/esm/main.js';\nexport { TextDocument, Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRange, Diagnostic, DiagnosticSeverity, CompletionItem, CompletionItemKind, CompletionList, Position, InsertTextFormat, MarkupContent, MarkupKind, SymbolInformation, SymbolKind, DocumentSymbol, Location, Hover, MarkedString, FormattingOptions };\n/**\n * Error codes used by diagnostics\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n    ErrorCode[ErrorCode[\"Undefined\"] = 0] = \"Undefined\";\n    ErrorCode[ErrorCode[\"EnumValueMismatch\"] = 1] = \"EnumValueMismatch\";\n    ErrorCode[ErrorCode[\"UnexpectedEndOfComment\"] = 257] = \"UnexpectedEndOfComment\";\n    ErrorCode[ErrorCode[\"UnexpectedEndOfString\"] = 258] = \"UnexpectedEndOfString\";\n    ErrorCode[ErrorCode[\"UnexpectedEndOfNumber\"] = 259] = \"UnexpectedEndOfNumber\";\n    ErrorCode[ErrorCode[\"InvalidUnicode\"] = 260] = \"InvalidUnicode\";\n    ErrorCode[ErrorCode[\"InvalidEscapeCharacter\"] = 261] = \"InvalidEscapeCharacter\";\n    ErrorCode[ErrorCode[\"InvalidCharacter\"] = 262] = \"InvalidCharacter\";\n    ErrorCode[ErrorCode[\"PropertyExpected\"] = 513] = \"PropertyExpected\";\n    ErrorCode[ErrorCode[\"CommaExpected\"] = 514] = \"CommaExpected\";\n    ErrorCode[ErrorCode[\"ColonExpected\"] = 515] = \"ColonExpected\";\n    ErrorCode[ErrorCode[\"ValueExpected\"] = 516] = \"ValueExpected\";\n    ErrorCode[ErrorCode[\"CommaOrCloseBacketExpected\"] = 517] = \"CommaOrCloseBacketExpected\";\n    ErrorCode[ErrorCode[\"CommaOrCloseBraceExpected\"] = 518] = \"CommaOrCloseBraceExpected\";\n    ErrorCode[ErrorCode[\"TrailingComma\"] = 519] = \"TrailingComma\";\n    ErrorCode[ErrorCode[\"DuplicateKey\"] = 520] = \"DuplicateKey\";\n    ErrorCode[ErrorCode[\"CommentNotPermitted\"] = 521] = \"CommentNotPermitted\";\n    ErrorCode[ErrorCode[\"SchemaResolveError\"] = 768] = \"SchemaResolveError\";\n})(ErrorCode || (ErrorCode = {}));\nexport var ClientCapabilities;\n(function (ClientCapabilities) {\n    ClientCapabilities.LATEST = {\n        textDocument: {\n            completion: {\n                completionItem: {\n                    documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText],\n                    commitCharactersSupport: true\n                }\n            }\n        }\n    };\n})(ClientCapabilities || (ClientCapabilities = {}));\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 __extends = (this && this.__extends) || (function () {\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    return function (d, b) {\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nimport * as Json from '../../jsonc-parser/main.js';\nimport { isNumber, equals, isBoolean, isString, isDefined } from '../utils/objects.js';\nimport { ErrorCode, Diagnostic, DiagnosticSeverity, Range } from '../jsonLanguageTypes.js';\nimport * as nls from '../../../fillers/vscode-nls.js';\nvar localize = nls.loadMessageBundle();\nvar formats = {\n    'color-hex': { errorMessage: localize('colorHexFormatWarning', 'Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.'), pattern: /^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/ },\n    'date-time': { errorMessage: localize('dateTimeFormatWarning', 'String is not a RFC3339 date-time.'), pattern: /^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i },\n    'date': { errorMessage: localize('dateFormatWarning', 'String is not a RFC3339 date.'), pattern: /^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i },\n    'time': { errorMessage: localize('timeFormatWarning', 'String is not a RFC3339 time.'), pattern: /^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i },\n    'email': { errorMessage: localize('emailFormatWarning', 'String is not an e-mail address.'), pattern: /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/ }\n};\nvar ASTNodeImpl = /** @class */ (function () {\n    function ASTNodeImpl(parent, offset, length) {\n        if (length === void 0) { length = 0; }\n        this.offset = offset;\n        this.length = length;\n        this.parent = parent;\n    }\n    Object.defineProperty(ASTNodeImpl.prototype, \"children\", {\n        get: function () {\n            return [];\n        },\n        enumerable: false,\n        configurable: true\n    });\n    ASTNodeImpl.prototype.toString = function () {\n        return 'type: ' + this.type + ' (' + this.offset + '/' + this.length + ')' + (this.parent ? ' parent: {' + this.parent.toString() + '}' : '');\n    };\n    return ASTNodeImpl;\n}());\nexport { ASTNodeImpl };\nvar NullASTNodeImpl = /** @class */ (function (_super) {\n    __extends(NullASTNodeImpl, _super);\n    function NullASTNodeImpl(parent, offset) {\n        var _this = _super.call(this, parent, offset) || this;\n        _this.type = 'null';\n        _this.value = null;\n        return _this;\n    }\n    return NullASTNodeImpl;\n}(ASTNodeImpl));\nexport { NullASTNodeImpl };\nvar BooleanASTNodeImpl = /** @class */ (function (_super) {\n    __extends(BooleanASTNodeImpl, _super);\n    function BooleanASTNodeImpl(parent, boolValue, offset) {\n        var _this = _super.call(this, parent, offset) || this;\n        _this.type = 'boolean';\n        _this.value = boolValue;\n        return _this;\n    }\n    return BooleanASTNodeImpl;\n}(ASTNodeImpl));\nexport { BooleanASTNodeImpl };\nvar ArrayASTNodeImpl = /** @class */ (function (_super) {\n    __extends(ArrayASTNodeImpl, _super);\n    function ArrayASTNodeImpl(parent, offset) {\n        var _this = _super.call(this, parent, offset) || this;\n        _this.type = 'array';\n        _this.items = [];\n        return _this;\n    }\n    Object.defineProperty(ArrayASTNodeImpl.prototype, \"children\", {\n        get: function () {\n            return this.items;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    return ArrayASTNodeImpl;\n}(ASTNodeImpl));\nexport { ArrayASTNodeImpl };\nvar NumberASTNodeImpl = /** @class */ (function (_super) {\n    __extends(NumberASTNodeImpl, _super);\n    function NumberASTNodeImpl(parent, offset) {\n        var _this = _super.call(this, parent, offset) || this;\n        _this.type = 'number';\n        _this.isInteger = true;\n        _this.value = Number.NaN;\n        return _this;\n    }\n    return NumberASTNodeImpl;\n}(ASTNodeImpl));\nexport { NumberASTNodeImpl };\nvar StringASTNodeImpl = /** @class */ (function (_super) {\n    __extends(StringASTNodeImpl, _super);\n    function StringASTNodeImpl(parent, offset, length) {\n        var _this = _super.call(this, parent, offset, length) || this;\n        _this.type = 'string';\n        _this.value = '';\n        return _this;\n    }\n    return StringASTNodeImpl;\n}(ASTNodeImpl));\nexport { StringASTNodeImpl };\nvar PropertyASTNodeImpl = /** @class */ (function (_super) {\n    __extends(PropertyASTNodeImpl, _super);\n    function PropertyASTNodeImpl(parent, offset, keyNode) {\n        var _this = _super.call(this, parent, offset) || this;\n        _this.type = 'property';\n        _this.colonOffset = -1;\n        _this.keyNode = keyNode;\n        return _this;\n    }\n    Object.defineProperty(PropertyASTNodeImpl.prototype, \"children\", {\n        get: function () {\n            return this.valueNode ? [this.keyNode, this.valueNode] : [this.keyNode];\n        },\n        enumerable: false,\n        configurable: true\n    });\n    return PropertyASTNodeImpl;\n}(ASTNodeImpl));\nexport { PropertyASTNodeImpl };\nvar ObjectASTNodeImpl = /** @class */ (function (_super) {\n    __extends(ObjectASTNodeImpl, _super);\n    function ObjectASTNodeImpl(parent, offset) {\n        var _this = _super.call(this, parent, offset) || this;\n        _this.type = 'object';\n        _this.properties = [];\n        return _this;\n    }\n    Object.defineProperty(ObjectASTNodeImpl.prototype, \"children\", {\n        get: function () {\n            return this.properties;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    return ObjectASTNodeImpl;\n}(ASTNodeImpl));\nexport { ObjectASTNodeImpl };\nexport function asSchema(schema) {\n    if (isBoolean(schema)) {\n        return schema ? {} : { \"not\": {} };\n    }\n    return schema;\n}\nexport var EnumMatch;\n(function (EnumMatch) {\n    EnumMatch[EnumMatch[\"Key\"] = 0] = \"Key\";\n    EnumMatch[EnumMatch[\"Enum\"] = 1] = \"Enum\";\n})(EnumMatch || (EnumMatch = {}));\nvar SchemaCollector = /** @class */ (function () {\n    function SchemaCollector(focusOffset, exclude) {\n        if (focusOffset === void 0) { focusOffset = -1; }\n        this.focusOffset = focusOffset;\n        this.exclude = exclude;\n        this.schemas = [];\n    }\n    SchemaCollector.prototype.add = function (schema) {\n        this.schemas.push(schema);\n    };\n    SchemaCollector.prototype.merge = function (other) {\n        Array.prototype.push.apply(this.schemas, other.schemas);\n    };\n    SchemaCollector.prototype.include = function (node) {\n        return (this.focusOffset === -1 || contains(node, this.focusOffset)) && (node !== this.exclude);\n    };\n    SchemaCollector.prototype.newSub = function () {\n        return new SchemaCollector(-1, this.exclude);\n    };\n    return SchemaCollector;\n}());\nvar NoOpSchemaCollector = /** @class */ (function () {\n    function NoOpSchemaCollector() {\n    }\n    Object.defineProperty(NoOpSchemaCollector.prototype, \"schemas\", {\n        get: function () { return []; },\n        enumerable: false,\n        configurable: true\n    });\n    NoOpSchemaCollector.prototype.add = function (schema) { };\n    NoOpSchemaCollector.prototype.merge = function (other) { };\n    NoOpSchemaCollector.prototype.include = function (node) { return true; };\n    NoOpSchemaCollector.prototype.newSub = function () { return this; };\n    NoOpSchemaCollector.instance = new NoOpSchemaCollector();\n    return NoOpSchemaCollector;\n}());\nvar ValidationResult = /** @class */ (function () {\n    function ValidationResult() {\n        this.problems = [];\n        this.propertiesMatches = 0;\n        this.propertiesValueMatches = 0;\n        this.primaryValueMatches = 0;\n        this.enumValueMatch = false;\n        this.enumValues = undefined;\n    }\n    ValidationResult.prototype.hasProblems = function () {\n        return !!this.problems.length;\n    };\n    ValidationResult.prototype.mergeAll = function (validationResults) {\n        for (var _i = 0, validationResults_1 = validationResults; _i < validationResults_1.length; _i++) {\n            var validationResult = validationResults_1[_i];\n            this.merge(validationResult);\n        }\n    };\n    ValidationResult.prototype.merge = function (validationResult) {\n        this.problems = this.problems.concat(validationResult.problems);\n    };\n    ValidationResult.prototype.mergeEnumValues = function (validationResult) {\n        if (!this.enumValueMatch && !validationResult.enumValueMatch && this.enumValues && validationResult.enumValues) {\n            this.enumValues = this.enumValues.concat(validationResult.enumValues);\n            for (var _i = 0, _a = this.problems; _i < _a.length; _i++) {\n                var error = _a[_i];\n                if (error.code === ErrorCode.EnumValueMismatch) {\n                    error.message = localize('enumWarning', 'Value is not accepted. Valid values: {0}.', this.enumValues.map(function (v) { return JSON.stringify(v); }).join(', '));\n                }\n            }\n        }\n    };\n    ValidationResult.prototype.mergePropertyMatch = function (propertyValidationResult) {\n        this.merge(propertyValidationResult);\n        this.propertiesMatches++;\n        if (propertyValidationResult.enumValueMatch || !propertyValidationResult.hasProblems() && propertyValidationResult.propertiesMatches) {\n            this.propertiesValueMatches++;\n        }\n        if (propertyValidationResult.enumValueMatch && propertyValidationResult.enumValues && propertyValidationResult.enumValues.length === 1) {\n            this.primaryValueMatches++;\n        }\n    };\n    ValidationResult.prototype.compare = function (other) {\n        var hasProblems = this.hasProblems();\n        if (hasProblems !== other.hasProblems()) {\n            return hasProblems ? -1 : 1;\n        }\n        if (this.enumValueMatch !== other.enumValueMatch) {\n            return other.enumValueMatch ? -1 : 1;\n        }\n        if (this.primaryValueMatches !== other.primaryValueMatches) {\n            return this.primaryValueMatches - other.primaryValueMatches;\n        }\n        if (this.propertiesValueMatches !== other.propertiesValueMatches) {\n            return this.propertiesValueMatches - other.propertiesValueMatches;\n        }\n        return this.propertiesMatches - other.propertiesMatches;\n    };\n    return ValidationResult;\n}());\nexport { ValidationResult };\nexport function newJSONDocument(root, diagnostics) {\n    if (diagnostics === void 0) { diagnostics = []; }\n    return new JSONDocument(root, diagnostics, []);\n}\nexport function getNodeValue(node) {\n    return Json.getNodeValue(node);\n}\nexport function getNodePath(node) {\n    return Json.getNodePath(node);\n}\nexport function contains(node, offset, includeRightBound) {\n    if (includeRightBound === void 0) { includeRightBound = false; }\n    return offset >= node.offset && offset < (node.offset + node.length) || includeRightBound && offset === (node.offset + node.length);\n}\nvar JSONDocument = /** @class */ (function () {\n    function JSONDocument(root, syntaxErrors, comments) {\n        if (syntaxErrors === void 0) { syntaxErrors = []; }\n        if (comments === void 0) { comments = []; }\n        this.root = root;\n        this.syntaxErrors = syntaxErrors;\n        this.comments = comments;\n    }\n    JSONDocument.prototype.getNodeFromOffset = function (offset, includeRightBound) {\n        if (includeRightBound === void 0) { includeRightBound = false; }\n        if (this.root) {\n            return Json.findNodeAtOffset(this.root, offset, includeRightBound);\n        }\n        return undefined;\n    };\n    JSONDocument.prototype.visit = function (visitor) {\n        if (this.root) {\n            var doVisit_1 = function (node) {\n                var ctn = visitor(node);\n                var children = node.children;\n                if (Array.isArray(children)) {\n                    for (var i = 0; i < children.length && ctn; i++) {\n                        ctn = doVisit_1(children[i]);\n                    }\n                }\n                return ctn;\n            };\n            doVisit_1(this.root);\n        }\n    };\n    JSONDocument.prototype.validate = function (textDocument, schema) {\n        if (this.root && schema) {\n            var validationResult = new ValidationResult();\n            validate(this.root, schema, validationResult, NoOpSchemaCollector.instance);\n            return validationResult.problems.map(function (p) {\n                var range = Range.create(textDocument.positionAt(p.location.offset), textDocument.positionAt(p.location.offset + p.location.length));\n                return Diagnostic.create(range, p.message, p.severity, p.code);\n            });\n        }\n        return undefined;\n    };\n    JSONDocument.prototype.getMatchingSchemas = function (schema, focusOffset, exclude) {\n        if (focusOffset === void 0) { focusOffset = -1; }\n        var matchingSchemas = new SchemaCollector(focusOffset, exclude);\n        if (this.root && schema) {\n            validate(this.root, schema, new ValidationResult(), matchingSchemas);\n        }\n        return matchingSchemas.schemas;\n    };\n    return JSONDocument;\n}());\nexport { JSONDocument };\nfunction validate(n, schema, validationResult, matchingSchemas) {\n    if (!n || !matchingSchemas.include(n)) {\n        return;\n    }\n    var node = n;\n    switch (node.type) {\n        case 'object':\n            _validateObjectNode(node, schema, validationResult, matchingSchemas);\n            break;\n        case 'array':\n            _validateArrayNode(node, schema, validationResult, matchingSchemas);\n            break;\n        case 'string':\n            _validateStringNode(node, schema, validationResult, matchingSchemas);\n            break;\n        case 'number':\n            _validateNumberNode(node, schema, validationResult, matchingSchemas);\n            break;\n        case 'property':\n            return validate(node.valueNode, schema, validationResult, matchingSchemas);\n    }\n    _validateNode();\n    matchingSchemas.add({ node: node, schema: schema });\n    function _validateNode() {\n        function matchesType(type) {\n            return node.type === type || (type === 'integer' && node.type === 'number' && node.isInteger);\n        }\n        if (Array.isArray(schema.type)) {\n            if (!schema.type.some(matchesType)) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: schema.errorMessage || localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}.', schema.type.join(', '))\n                });\n            }\n        }\n        else if (schema.type) {\n            if (!matchesType(schema.type)) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: schema.errorMessage || localize('typeMismatchWarning', 'Incorrect type. Expected \"{0}\".', schema.type)\n                });\n            }\n        }\n        if (Array.isArray(schema.allOf)) {\n            for (var _i = 0, _a = schema.allOf; _i < _a.length; _i++) {\n                var subSchemaRef = _a[_i];\n                validate(node, asSchema(subSchemaRef), validationResult, matchingSchemas);\n            }\n        }\n        var notSchema = asSchema(schema.not);\n        if (notSchema) {\n            var subValidationResult = new ValidationResult();\n            var subMatchingSchemas = matchingSchemas.newSub();\n            validate(node, notSchema, subValidationResult, subMatchingSchemas);\n            if (!subValidationResult.hasProblems()) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: localize('notSchemaWarning', \"Matches a schema that is not allowed.\")\n                });\n            }\n            for (var _b = 0, _c = subMatchingSchemas.schemas; _b < _c.length; _b++) {\n                var ms = _c[_b];\n                ms.inverted = !ms.inverted;\n                matchingSchemas.add(ms);\n            }\n        }\n        var testAlternatives = function (alternatives, maxOneMatch) {\n            var matches = [];\n            // remember the best match that is used for error messages\n            var bestMatch = undefined;\n            for (var _i = 0, alternatives_1 = alternatives; _i < alternatives_1.length; _i++) {\n                var subSchemaRef = alternatives_1[_i];\n                var subSchema = asSchema(subSchemaRef);\n                var subValidationResult = new ValidationResult();\n                var subMatchingSchemas = matchingSchemas.newSub();\n                validate(node, subSchema, subValidationResult, subMatchingSchemas);\n                if (!subValidationResult.hasProblems()) {\n                    matches.push(subSchema);\n                }\n                if (!bestMatch) {\n                    bestMatch = { schema: subSchema, validationResult: subValidationResult, matchingSchemas: subMatchingSchemas };\n                }\n                else {\n                    if (!maxOneMatch && !subValidationResult.hasProblems() && !bestMatch.validationResult.hasProblems()) {\n                        // no errors, both are equally good matches\n                        bestMatch.matchingSchemas.merge(subMatchingSchemas);\n                        bestMatch.validationResult.propertiesMatches += subValidationResult.propertiesMatches;\n                        bestMatch.validationResult.propertiesValueMatches += subValidationResult.propertiesValueMatches;\n                    }\n                    else {\n                        var compareResult = subValidationResult.compare(bestMatch.validationResult);\n                        if (compareResult > 0) {\n                            // our node is the best matching so far\n                            bestMatch = { schema: subSchema, validationResult: subValidationResult, matchingSchemas: subMatchingSchemas };\n                        }\n                        else if (compareResult === 0) {\n                            // there's already a best matching but we are as good\n                            bestMatch.matchingSchemas.merge(subMatchingSchemas);\n                            bestMatch.validationResult.mergeEnumValues(subValidationResult);\n                        }\n                    }\n                }\n            }\n            if (matches.length > 1 && maxOneMatch) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: 1 },\n                    severity: DiagnosticSeverity.Warning,\n                    message: localize('oneOfWarning', \"Matches multiple schemas when only one must validate.\")\n                });\n            }\n            if (bestMatch) {\n                validationResult.merge(bestMatch.validationResult);\n                validationResult.propertiesMatches += bestMatch.validationResult.propertiesMatches;\n                validationResult.propertiesValueMatches += bestMatch.validationResult.propertiesValueMatches;\n                matchingSchemas.merge(bestMatch.matchingSchemas);\n            }\n            return matches.length;\n        };\n        if (Array.isArray(schema.anyOf)) {\n            testAlternatives(schema.anyOf, false);\n        }\n        if (Array.isArray(schema.oneOf)) {\n            testAlternatives(schema.oneOf, true);\n        }\n        var testBranch = function (schema) {\n            var subValidationResult = new ValidationResult();\n            var subMatchingSchemas = matchingSchemas.newSub();\n            validate(node, asSchema(schema), subValidationResult, subMatchingSchemas);\n            validationResult.merge(subValidationResult);\n            validationResult.propertiesMatches += subValidationResult.propertiesMatches;\n            validationResult.propertiesValueMatches += subValidationResult.propertiesValueMatches;\n            matchingSchemas.merge(subMatchingSchemas);\n        };\n        var testCondition = function (ifSchema, thenSchema, elseSchema) {\n            var subSchema = asSchema(ifSchema);\n            var subValidationResult = new ValidationResult();\n            var subMatchingSchemas = matchingSchemas.newSub();\n            validate(node, subSchema, subValidationResult, subMatchingSchemas);\n            matchingSchemas.merge(subMatchingSchemas);\n            if (!subValidationResult.hasProblems()) {\n                if (thenSchema) {\n                    testBranch(thenSchema);\n                }\n            }\n            else if (elseSchema) {\n                testBranch(elseSchema);\n            }\n        };\n        var ifSchema = asSchema(schema.if);\n        if (ifSchema) {\n            testCondition(ifSchema, asSchema(schema.then), asSchema(schema.else));\n        }\n        if (Array.isArray(schema.enum)) {\n            var val = getNodeValue(node);\n            var enumValueMatch = false;\n            for (var _d = 0, _e = schema.enum; _d < _e.length; _d++) {\n                var e = _e[_d];\n                if (equals(val, e)) {\n                    enumValueMatch = true;\n                    break;\n                }\n            }\n            validationResult.enumValues = schema.enum;\n            validationResult.enumValueMatch = enumValueMatch;\n            if (!enumValueMatch) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    code: ErrorCode.EnumValueMismatch,\n                    message: schema.errorMessage || localize('enumWarning', 'Value is not accepted. Valid values: {0}.', schema.enum.map(function (v) { return JSON.stringify(v); }).join(', '))\n                });\n            }\n        }\n        if (isDefined(schema.const)) {\n            var val = getNodeValue(node);\n            if (!equals(val, schema.const)) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    code: ErrorCode.EnumValueMismatch,\n                    message: schema.errorMessage || localize('constWarning', 'Value must be {0}.', JSON.stringify(schema.const))\n                });\n                validationResult.enumValueMatch = false;\n            }\n            else {\n                validationResult.enumValueMatch = true;\n            }\n            validationResult.enumValues = [schema.const];\n        }\n        if (schema.deprecationMessage && node.parent) {\n            validationResult.problems.push({\n                location: { offset: node.parent.offset, length: node.parent.length },\n                severity: DiagnosticSeverity.Warning,\n                message: schema.deprecationMessage\n            });\n        }\n    }\n    function _validateNumberNode(node, schema, validationResult, matchingSchemas) {\n        var val = node.value;\n        function normalizeFloats(float) {\n            var _a;\n            var parts = /^(-?\\d+)(?:\\.(\\d+))?(?:e([-+]\\d+))?$/.exec(float.toString());\n            return parts && {\n                value: Number(parts[1] + (parts[2] || '')),\n                multiplier: (((_a = parts[2]) === null || _a === void 0 ? void 0 : _a.length) || 0) - (parseInt(parts[3]) || 0)\n            };\n        }\n        ;\n        if (isNumber(schema.multipleOf)) {\n            var remainder = -1;\n            if (Number.isInteger(schema.multipleOf)) {\n                remainder = val % schema.multipleOf;\n            }\n            else {\n                var normMultipleOf = normalizeFloats(schema.multipleOf);\n                var normValue = normalizeFloats(val);\n                if (normMultipleOf && normValue) {\n                    var multiplier = Math.pow(10, Math.abs(normValue.multiplier - normMultipleOf.multiplier));\n                    if (normValue.multiplier < normMultipleOf.multiplier) {\n                        normValue.value *= multiplier;\n                    }\n                    else {\n                        normMultipleOf.value *= multiplier;\n                    }\n                    remainder = normValue.value % normMultipleOf.value;\n                }\n            }\n            if (remainder !== 0) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: localize('multipleOfWarning', 'Value is not divisible by {0}.', schema.multipleOf)\n                });\n            }\n        }\n        function getExclusiveLimit(limit, exclusive) {\n            if (isNumber(exclusive)) {\n                return exclusive;\n            }\n            if (isBoolean(exclusive) && exclusive) {\n                return limit;\n            }\n            return undefined;\n        }\n        function getLimit(limit, exclusive) {\n            if (!isBoolean(exclusive) || !exclusive) {\n                return limit;\n            }\n            return undefined;\n        }\n        var exclusiveMinimum = getExclusiveLimit(schema.minimum, schema.exclusiveMinimum);\n        if (isNumber(exclusiveMinimum) && val <= exclusiveMinimum) {\n            validationResult.problems.push({\n                location: { offset: node.offset, length: node.length },\n                severity: DiagnosticSeverity.Warning,\n                message: localize('exclusiveMinimumWarning', 'Value is below the exclusive minimum of {0}.', exclusiveMinimum)\n            });\n        }\n        var exclusiveMaximum = getExclusiveLimit(schema.maximum, schema.exclusiveMaximum);\n        if (isNumber(exclusiveMaximum) && val >= exclusiveMaximum) {\n            validationResult.problems.push({\n                location: { offset: node.offset, length: node.length },\n                severity: DiagnosticSeverity.Warning,\n                message: localize('exclusiveMaximumWarning', 'Value is above the exclusive maximum of {0}.', exclusiveMaximum)\n            });\n        }\n        var minimum = getLimit(schema.minimum, schema.exclusiveMinimum);\n        if (isNumber(minimum) && val < minimum) {\n            validationResult.problems.push({\n                location: { offset: node.offset, length: node.length },\n                severity: DiagnosticSeverity.Warning,\n                message: localize('minimumWarning', 'Value is below the minimum of {0}.', minimum)\n            });\n        }\n        var maximum = getLimit(schema.maximum, schema.exclusiveMaximum);\n        if (isNumber(maximum) && val > maximum) {\n            validationResult.problems.push({\n                location: { offset: node.offset, length: node.length },\n                severity: DiagnosticSeverity.Warning,\n                message: localize('maximumWarning', 'Value is above the maximum of {0}.', maximum)\n            });\n        }\n    }\n    function _validateStringNode(node, schema, validationResult, matchingSchemas) {\n        if (isNumber(schema.minLength) && node.value.length < schema.minLength) {\n            validationResult.problems.push({\n                location: { offset: node.offset, length: node.length },\n                severity: DiagnosticSeverity.Warning,\n                message: localize('minLengthWarning', 'String is shorter than the minimum length of {0}.', schema.minLength)\n            });\n        }\n        if (isNumber(schema.maxLength) && node.value.length > schema.maxLength) {\n            validationResult.problems.push({\n                location: { offset: node.offset, length: node.length },\n                severity: DiagnosticSeverity.Warning,\n                message: localize('maxLengthWarning', 'String is longer than the maximum length of {0}.', schema.maxLength)\n            });\n        }\n        if (isString(schema.pattern)) {\n            var regex = new RegExp(schema.pattern);\n            if (!regex.test(node.value)) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: schema.patternErrorMessage || schema.errorMessage || localize('patternWarning', 'String does not match the pattern of \"{0}\".', schema.pattern)\n                });\n            }\n        }\n        if (schema.format) {\n            switch (schema.format) {\n                case 'uri':\n                case 'uri-reference':\n                    {\n                        var errorMessage = void 0;\n                        if (!node.value) {\n                            errorMessage = localize('uriEmpty', 'URI expected.');\n                        }\n                        else {\n                            var match = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/.exec(node.value);\n                            if (!match) {\n                                errorMessage = localize('uriMissing', 'URI is expected.');\n                            }\n                            else if (!match[2] && schema.format === 'uri') {\n                                errorMessage = localize('uriSchemeMissing', 'URI with a scheme is expected.');\n                            }\n                        }\n                        if (errorMessage) {\n                            validationResult.problems.push({\n                                location: { offset: node.offset, length: node.length },\n                                severity: DiagnosticSeverity.Warning,\n                                message: schema.patternErrorMessage || schema.errorMessage || localize('uriFormatWarning', 'String is not a URI: {0}', errorMessage)\n                            });\n                        }\n                    }\n                    break;\n                case 'color-hex':\n                case 'date-time':\n                case 'date':\n                case 'time':\n                case 'email':\n                    var format = formats[schema.format];\n                    if (!node.value || !format.pattern.exec(node.value)) {\n                        validationResult.problems.push({\n                            location: { offset: node.offset, length: node.length },\n                            severity: DiagnosticSeverity.Warning,\n                            message: schema.patternErrorMessage || schema.errorMessage || format.errorMessage\n                        });\n                    }\n                default:\n            }\n        }\n    }\n    function _validateArrayNode(node, schema, validationResult, matchingSchemas) {\n        if (Array.isArray(schema.items)) {\n            var subSchemas = schema.items;\n            for (var index = 0; index < subSchemas.length; index++) {\n                var subSchemaRef = subSchemas[index];\n                var subSchema = asSchema(subSchemaRef);\n                var itemValidationResult = new ValidationResult();\n                var item = node.items[index];\n                if (item) {\n                    validate(item, subSchema, itemValidationResult, matchingSchemas);\n                    validationResult.mergePropertyMatch(itemValidationResult);\n                }\n                else if (node.items.length >= subSchemas.length) {\n                    validationResult.propertiesValueMatches++;\n                }\n            }\n            if (node.items.length > subSchemas.length) {\n                if (typeof schema.additionalItems === 'object') {\n                    for (var i = subSchemas.length; i < node.items.length; i++) {\n                        var itemValidationResult = new ValidationResult();\n                        validate(node.items[i], schema.additionalItems, itemValidationResult, matchingSchemas);\n                        validationResult.mergePropertyMatch(itemValidationResult);\n                    }\n                }\n                else if (schema.additionalItems === false) {\n                    validationResult.problems.push({\n                        location: { offset: node.offset, length: node.length },\n                        severity: DiagnosticSeverity.Warning,\n                        message: localize('additionalItemsWarning', 'Array has too many items according to schema. Expected {0} or fewer.', subSchemas.length)\n                    });\n                }\n            }\n        }\n        else {\n            var itemSchema = asSchema(schema.items);\n            if (itemSchema) {\n                for (var _i = 0, _a = node.items; _i < _a.length; _i++) {\n                    var item = _a[_i];\n                    var itemValidationResult = new ValidationResult();\n                    validate(item, itemSchema, itemValidationResult, matchingSchemas);\n                    validationResult.mergePropertyMatch(itemValidationResult);\n                }\n            }\n        }\n        var containsSchema = asSchema(schema.contains);\n        if (containsSchema) {\n            var doesContain = node.items.some(function (item) {\n                var itemValidationResult = new ValidationResult();\n                validate(item, containsSchema, itemValidationResult, NoOpSchemaCollector.instance);\n                return !itemValidationResult.hasProblems();\n            });\n            if (!doesContain) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: schema.errorMessage || localize('requiredItemMissingWarning', 'Array does not contain required item.')\n                });\n            }\n        }\n        if (isNumber(schema.minItems) && node.items.length < schema.minItems) {\n            validationResult.problems.push({\n                location: { offset: node.offset, length: node.length },\n                severity: DiagnosticSeverity.Warning,\n                message: localize('minItemsWarning', 'Array has too few items. Expected {0} or more.', schema.minItems)\n            });\n        }\n        if (isNumber(schema.maxItems) && node.items.length > schema.maxItems) {\n            validationResult.problems.push({\n                location: { offset: node.offset, length: node.length },\n                severity: DiagnosticSeverity.Warning,\n                message: localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.maxItems)\n            });\n        }\n        if (schema.uniqueItems === true) {\n            var values_1 = getNodeValue(node);\n            var duplicates = values_1.some(function (value, index) {\n                return index !== values_1.lastIndexOf(value);\n            });\n            if (duplicates) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: localize('uniqueItemsWarning', 'Array has duplicate items.')\n                });\n            }\n        }\n    }\n    function _validateObjectNode(node, schema, validationResult, matchingSchemas) {\n        var seenKeys = Object.create(null);\n        var unprocessedProperties = [];\n        for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {\n            var propertyNode = _a[_i];\n            var key = propertyNode.keyNode.value;\n            seenKeys[key] = propertyNode.valueNode;\n            unprocessedProperties.push(key);\n        }\n        if (Array.isArray(schema.required)) {\n            for (var _b = 0, _c = schema.required; _b < _c.length; _b++) {\n                var propertyName = _c[_b];\n                if (!seenKeys[propertyName]) {\n                    var keyNode = node.parent && node.parent.type === 'property' && node.parent.keyNode;\n                    var location = keyNode ? { offset: keyNode.offset, length: keyNode.length } : { offset: node.offset, length: 1 };\n                    validationResult.problems.push({\n                        location: location,\n                        severity: DiagnosticSeverity.Warning,\n                        message: localize('MissingRequiredPropWarning', 'Missing property \"{0}\".', propertyName)\n                    });\n                }\n            }\n        }\n        var propertyProcessed = function (prop) {\n            var index = unprocessedProperties.indexOf(prop);\n            while (index >= 0) {\n                unprocessedProperties.splice(index, 1);\n                index = unprocessedProperties.indexOf(prop);\n            }\n        };\n        if (schema.properties) {\n            for (var _d = 0, _e = Object.keys(schema.properties); _d < _e.length; _d++) {\n                var propertyName = _e[_d];\n                propertyProcessed(propertyName);\n                var propertySchema = schema.properties[propertyName];\n                var child = seenKeys[propertyName];\n                if (child) {\n                    if (isBoolean(propertySchema)) {\n                        if (!propertySchema) {\n                            var propertyNode = child.parent;\n                            validationResult.problems.push({\n                                location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },\n                                severity: DiagnosticSeverity.Warning,\n                                message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)\n                            });\n                        }\n                        else {\n                            validationResult.propertiesMatches++;\n                            validationResult.propertiesValueMatches++;\n                        }\n                    }\n                    else {\n                        var propertyValidationResult = new ValidationResult();\n                        validate(child, propertySchema, propertyValidationResult, matchingSchemas);\n                        validationResult.mergePropertyMatch(propertyValidationResult);\n                    }\n                }\n            }\n        }\n        if (schema.patternProperties) {\n            for (var _f = 0, _g = Object.keys(schema.patternProperties); _f < _g.length; _f++) {\n                var propertyPattern = _g[_f];\n                var regex = new RegExp(propertyPattern);\n                for (var _h = 0, _j = unprocessedProperties.slice(0); _h < _j.length; _h++) {\n                    var propertyName = _j[_h];\n                    if (regex.test(propertyName)) {\n                        propertyProcessed(propertyName);\n                        var child = seenKeys[propertyName];\n                        if (child) {\n                            var propertySchema = schema.patternProperties[propertyPattern];\n                            if (isBoolean(propertySchema)) {\n                                if (!propertySchema) {\n                                    var propertyNode = child.parent;\n                                    validationResult.problems.push({\n                                        location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },\n                                        severity: DiagnosticSeverity.Warning,\n                                        message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)\n                                    });\n                                }\n                                else {\n                                    validationResult.propertiesMatches++;\n                                    validationResult.propertiesValueMatches++;\n                                }\n                            }\n                            else {\n                                var propertyValidationResult = new ValidationResult();\n                                validate(child, propertySchema, propertyValidationResult, matchingSchemas);\n                                validationResult.mergePropertyMatch(propertyValidationResult);\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        if (typeof schema.additionalProperties === 'object') {\n            for (var _k = 0, unprocessedProperties_1 = unprocessedProperties; _k < unprocessedProperties_1.length; _k++) {\n                var propertyName = unprocessedProperties_1[_k];\n                var child = seenKeys[propertyName];\n                if (child) {\n                    var propertyValidationResult = new ValidationResult();\n                    validate(child, schema.additionalProperties, propertyValidationResult, matchingSchemas);\n                    validationResult.mergePropertyMatch(propertyValidationResult);\n                }\n            }\n        }\n        else if (schema.additionalProperties === false) {\n            if (unprocessedProperties.length > 0) {\n                for (var _l = 0, unprocessedProperties_2 = unprocessedProperties; _l < unprocessedProperties_2.length; _l++) {\n                    var propertyName = unprocessedProperties_2[_l];\n                    var child = seenKeys[propertyName];\n                    if (child) {\n                        var propertyNode = child.parent;\n                        validationResult.problems.push({\n                            location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },\n                            severity: DiagnosticSeverity.Warning,\n                            message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)\n                        });\n                    }\n                }\n            }\n        }\n        if (isNumber(schema.maxProperties)) {\n            if (node.properties.length > schema.maxProperties) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: localize('MaxPropWarning', 'Object has more properties than limit of {0}.', schema.maxProperties)\n                });\n            }\n        }\n        if (isNumber(schema.minProperties)) {\n            if (node.properties.length < schema.minProperties) {\n                validationResult.problems.push({\n                    location: { offset: node.offset, length: node.length },\n                    severity: DiagnosticSeverity.Warning,\n                    message: localize('MinPropWarning', 'Object has fewer properties than the required number of {0}', schema.minProperties)\n                });\n            }\n        }\n        if (schema.dependencies) {\n            for (var _m = 0, _o = Object.keys(schema.dependencies); _m < _o.length; _m++) {\n                var key = _o[_m];\n                var prop = seenKeys[key];\n                if (prop) {\n                    var propertyDep = schema.dependencies[key];\n                    if (Array.isArray(propertyDep)) {\n                        for (var _p = 0, propertyDep_1 = propertyDep; _p < propertyDep_1.length; _p++) {\n                            var requiredProp = propertyDep_1[_p];\n                            if (!seenKeys[requiredProp]) {\n                                validationResult.problems.push({\n                                    location: { offset: node.offset, length: node.length },\n                                    severity: DiagnosticSeverity.Warning,\n                                    message: localize('RequiredDependentPropWarning', 'Object is missing property {0} required by property {1}.', requiredProp, key)\n                                });\n                            }\n                            else {\n                                validationResult.propertiesValueMatches++;\n                            }\n                        }\n                    }\n                    else {\n                        var propertySchema = asSchema(propertyDep);\n                        if (propertySchema) {\n                            var propertyValidationResult = new ValidationResult();\n                            validate(node, propertySchema, propertyValidationResult, matchingSchemas);\n                            validationResult.mergePropertyMatch(propertyValidationResult);\n                        }\n                    }\n                }\n            }\n        }\n        var propertyNames = asSchema(schema.propertyNames);\n        if (propertyNames) {\n            for (var _q = 0, _r = node.properties; _q < _r.length; _q++) {\n                var f = _r[_q];\n                var key = f.keyNode;\n                if (key) {\n                    validate(key, propertyNames, validationResult, NoOpSchemaCollector.instance);\n                }\n            }\n        }\n    }\n}\nexport function parse(textDocument, config) {\n    var problems = [];\n    var lastProblemOffset = -1;\n    var text = textDocument.getText();\n    var scanner = Json.createScanner(text, false);\n    var commentRanges = config && config.collectComments ? [] : undefined;\n    function _scanNext() {\n        while (true) {\n            var token_1 = scanner.scan();\n            _checkScanError();\n            switch (token_1) {\n                case 12 /* LineCommentTrivia */:\n                case 13 /* BlockCommentTrivia */:\n                    if (Array.isArray(commentRanges)) {\n                        commentRanges.push(Range.create(textDocument.positionAt(scanner.getTokenOffset()), textDocument.positionAt(scanner.getTokenOffset() + scanner.getTokenLength())));\n                    }\n                    break;\n                case 15 /* Trivia */:\n                case 14 /* LineBreakTrivia */:\n                    break;\n                default:\n                    return token_1;\n            }\n        }\n    }\n    function _accept(token) {\n        if (scanner.getToken() === token) {\n            _scanNext();\n            return true;\n        }\n        return false;\n    }\n    function _errorAtRange(message, code, startOffset, endOffset, severity) {\n        if (severity === void 0) { severity = DiagnosticSeverity.Error; }\n        if (problems.length === 0 || startOffset !== lastProblemOffset) {\n            var range = Range.create(textDocument.positionAt(startOffset), textDocument.positionAt(endOffset));\n            problems.push(Diagnostic.create(range, message, severity, code, textDocument.languageId));\n            lastProblemOffset = startOffset;\n        }\n    }\n    function _error(message, code, node, skipUntilAfter, skipUntil) {\n        if (node === void 0) { node = undefined; }\n        if (skipUntilAfter === void 0) { skipUntilAfter = []; }\n        if (skipUntil === void 0) { skipUntil = []; }\n        var start = scanner.getTokenOffset();\n        var end = scanner.getTokenOffset() + scanner.getTokenLength();\n        if (start === end && start > 0) {\n            start--;\n            while (start > 0 && /\\s/.test(text.charAt(start))) {\n                start--;\n            }\n            end = start + 1;\n        }\n        _errorAtRange(message, code, start, end);\n        if (node) {\n            _finalize(node, false);\n        }\n        if (skipUntilAfter.length + skipUntil.length > 0) {\n            var token_2 = scanner.getToken();\n            while (token_2 !== 17 /* EOF */) {\n                if (skipUntilAfter.indexOf(token_2) !== -1) {\n                    _scanNext();\n                    break;\n                }\n                else if (skipUntil.indexOf(token_2) !== -1) {\n                    break;\n                }\n                token_2 = _scanNext();\n            }\n        }\n        return node;\n    }\n    function _checkScanError() {\n        switch (scanner.getTokenError()) {\n            case 4 /* InvalidUnicode */:\n                _error(localize('InvalidUnicode', 'Invalid unicode sequence in string.'), ErrorCode.InvalidUnicode);\n                return true;\n            case 5 /* InvalidEscapeCharacter */:\n                _error(localize('InvalidEscapeCharacter', 'Invalid escape character in string.'), ErrorCode.InvalidEscapeCharacter);\n                return true;\n            case 3 /* UnexpectedEndOfNumber */:\n                _error(localize('UnexpectedEndOfNumber', 'Unexpected end of number.'), ErrorCode.UnexpectedEndOfNumber);\n                return true;\n            case 1 /* UnexpectedEndOfComment */:\n                _error(localize('UnexpectedEndOfComment', 'Unexpected end of comment.'), ErrorCode.UnexpectedEndOfComment);\n                return true;\n            case 2 /* UnexpectedEndOfString */:\n                _error(localize('UnexpectedEndOfString', 'Unexpected end of string.'), ErrorCode.UnexpectedEndOfString);\n                return true;\n            case 6 /* InvalidCharacter */:\n                _error(localize('InvalidCharacter', 'Invalid characters in string. Control characters must be escaped.'), ErrorCode.InvalidCharacter);\n                return true;\n        }\n        return false;\n    }\n    function _finalize(node, scanNext) {\n        node.length = scanner.getTokenOffset() + scanner.getTokenLength() - node.offset;\n        if (scanNext) {\n            _scanNext();\n        }\n        return node;\n    }\n    function _parseArray(parent) {\n        if (scanner.getToken() !== 3 /* OpenBracketToken */) {\n            return undefined;\n        }\n        var node = new ArrayASTNodeImpl(parent, scanner.getTokenOffset());\n        _scanNext(); // consume OpenBracketToken\n        var count = 0;\n        var needsComma = false;\n        while (scanner.getToken() !== 4 /* CloseBracketToken */ && scanner.getToken() !== 17 /* EOF */) {\n            if (scanner.getToken() === 5 /* CommaToken */) {\n                if (!needsComma) {\n                    _error(localize('ValueExpected', 'Value expected'), ErrorCode.ValueExpected);\n                }\n                var commaOffset = scanner.getTokenOffset();\n                _scanNext(); // consume comma\n                if (scanner.getToken() === 4 /* CloseBracketToken */) {\n                    if (needsComma) {\n                        _errorAtRange(localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, commaOffset, commaOffset + 1);\n                    }\n                    continue;\n                }\n            }\n            else if (needsComma) {\n                _error(localize('ExpectedComma', 'Expected comma'), ErrorCode.CommaExpected);\n            }\n            var item = _parseValue(node);\n            if (!item) {\n                _error(localize('PropertyExpected', 'Value expected'), ErrorCode.ValueExpected, undefined, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]);\n            }\n            else {\n                node.items.push(item);\n            }\n            needsComma = true;\n        }\n        if (scanner.getToken() !== 4 /* CloseBracketToken */) {\n            return _error(localize('ExpectedCloseBracket', 'Expected comma or closing bracket'), ErrorCode.CommaOrCloseBacketExpected, node);\n        }\n        return _finalize(node, true);\n    }\n    var keyPlaceholder = new StringASTNodeImpl(undefined, 0, 0);\n    function _parseProperty(parent, keysSeen) {\n        var node = new PropertyASTNodeImpl(parent, scanner.getTokenOffset(), keyPlaceholder);\n        var key = _parseString(node);\n        if (!key) {\n            if (scanner.getToken() === 16 /* Unknown */) {\n                // give a more helpful error message\n                _error(localize('DoubleQuotesExpected', 'Property keys must be doublequoted'), ErrorCode.Undefined);\n                var keyNode = new StringASTNodeImpl(node, scanner.getTokenOffset(), scanner.getTokenLength());\n                keyNode.value = scanner.getTokenValue();\n                key = keyNode;\n                _scanNext(); // consume Unknown\n            }\n            else {\n                return undefined;\n            }\n        }\n        node.keyNode = key;\n        var seen = keysSeen[key.value];\n        if (seen) {\n            _errorAtRange(localize('DuplicateKeyWarning', \"Duplicate object key\"), ErrorCode.DuplicateKey, node.keyNode.offset, node.keyNode.offset + node.keyNode.length, DiagnosticSeverity.Warning);\n            if (typeof seen === 'object') {\n                _errorAtRange(localize('DuplicateKeyWarning', \"Duplicate object key\"), ErrorCode.DuplicateKey, seen.keyNode.offset, seen.keyNode.offset + seen.keyNode.length, DiagnosticSeverity.Warning);\n            }\n            keysSeen[key.value] = true; // if the same key is duplicate again, avoid duplicate error reporting\n        }\n        else {\n            keysSeen[key.value] = node;\n        }\n        if (scanner.getToken() === 6 /* ColonToken */) {\n            node.colonOffset = scanner.getTokenOffset();\n            _scanNext(); // consume ColonToken\n        }\n        else {\n            _error(localize('ColonExpected', 'Colon expected'), ErrorCode.ColonExpected);\n            if (scanner.getToken() === 10 /* StringLiteral */ && textDocument.positionAt(key.offset + key.length).line < textDocument.positionAt(scanner.getTokenOffset()).line) {\n                node.length = key.length;\n                return node;\n            }\n        }\n        var value = _parseValue(node);\n        if (!value) {\n            return _error(localize('ValueExpected', 'Value expected'), ErrorCode.ValueExpected, node, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n        }\n        node.valueNode = value;\n        node.length = value.offset + value.length - node.offset;\n        return node;\n    }\n    function _parseObject(parent) {\n        if (scanner.getToken() !== 1 /* OpenBraceToken */) {\n            return undefined;\n        }\n        var node = new ObjectASTNodeImpl(parent, scanner.getTokenOffset());\n        var keysSeen = Object.create(null);\n        _scanNext(); // consume OpenBraceToken\n        var needsComma = false;\n        while (scanner.getToken() !== 2 /* CloseBraceToken */ && scanner.getToken() !== 17 /* EOF */) {\n            if (scanner.getToken() === 5 /* CommaToken */) {\n                if (!needsComma) {\n                    _error(localize('PropertyExpected', 'Property expected'), ErrorCode.PropertyExpected);\n                }\n                var commaOffset = scanner.getTokenOffset();\n                _scanNext(); // consume comma\n                if (scanner.getToken() === 2 /* CloseBraceToken */) {\n                    if (needsComma) {\n                        _errorAtRange(localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, commaOffset, commaOffset + 1);\n                    }\n                    continue;\n                }\n            }\n            else if (needsComma) {\n                _error(localize('ExpectedComma', 'Expected comma'), ErrorCode.CommaExpected);\n            }\n            var property = _parseProperty(node, keysSeen);\n            if (!property) {\n                _error(localize('PropertyExpected', 'Property expected'), ErrorCode.PropertyExpected, undefined, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);\n            }\n            else {\n                node.properties.push(property);\n            }\n            needsComma = true;\n        }\n        if (scanner.getToken() !== 2 /* CloseBraceToken */) {\n            return _error(localize('ExpectedCloseBrace', 'Expected comma or closing brace'), ErrorCode.CommaOrCloseBraceExpected, node);\n        }\n        return _finalize(node, true);\n    }\n    function _parseString(parent) {\n        if (scanner.getToken() !== 10 /* StringLiteral */) {\n            return undefined;\n        }\n        var node = new StringASTNodeImpl(parent, scanner.getTokenOffset());\n        node.value = scanner.getTokenValue();\n        return _finalize(node, true);\n    }\n    function _parseNumber(parent) {\n        if (scanner.getToken() !== 11 /* NumericLiteral */) {\n            return undefined;\n        }\n        var node = new NumberASTNodeImpl(parent, scanner.getTokenOffset());\n        if (scanner.getTokenError() === 0 /* None */) {\n            var tokenValue = scanner.getTokenValue();\n            try {\n                var numberValue = JSON.parse(tokenValue);\n                if (!isNumber(numberValue)) {\n                    return _error(localize('InvalidNumberFormat', 'Invalid number format.'), ErrorCode.Undefined, node);\n                }\n                node.value = numberValue;\n            }\n            catch (e) {\n                return _error(localize('InvalidNumberFormat', 'Invalid number format.'), ErrorCode.Undefined, node);\n            }\n            node.isInteger = tokenValue.indexOf('.') === -1;\n        }\n        return _finalize(node, true);\n    }\n    function _parseLiteral(parent) {\n        var node;\n        switch (scanner.getToken()) {\n            case 7 /* NullKeyword */:\n                return _finalize(new NullASTNodeImpl(parent, scanner.getTokenOffset()), true);\n            case 8 /* TrueKeyword */:\n                return _finalize(new BooleanASTNodeImpl(parent, true, scanner.getTokenOffset()), true);\n            case 9 /* FalseKeyword */:\n                return _finalize(new BooleanASTNodeImpl(parent, false, scanner.getTokenOffset()), true);\n            default:\n                return undefined;\n        }\n    }\n    function _parseValue(parent) {\n        return _parseArray(parent) || _parseObject(parent) || _parseString(parent) || _parseNumber(parent) || _parseLiteral(parent);\n    }\n    var _root = undefined;\n    var token = _scanNext();\n    if (token !== 17 /* EOF */) {\n        _root = _parseValue(_root);\n        if (!_root) {\n            _error(localize('Invalid symbol', 'Expected a JSON object, array or literal.'), ErrorCode.Undefined);\n        }\n        else if (scanner.getToken() !== 17 /* EOF */) {\n            _error(localize('End of file expected', 'End of file expected.'), ErrorCode.Undefined);\n        }\n    }\n    return new JSONDocument(_root, problems, commentRanges);\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 *--------------------------------------------------------------------------------------------*/\nimport * as nls from '../../../fillers/vscode-nls.js';\nvar localize = nls.loadMessageBundle();\nexport var schemaContributions = {\n    schemaAssociations: [],\n    schemas: {\n        // refer to the latest schema\n        'http://json-schema.org/schema#': {\n            $ref: 'http://json-schema.org/draft-07/schema#'\n        },\n        // bundle the schema-schema to include (localized) descriptions\n        'http://json-schema.org/draft-04/schema#': {\n            'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'),\n            '$schema': 'http://json-schema.org/draft-04/schema#',\n            'definitions': {\n                'schemaArray': {\n                    'type': 'array',\n                    'minItems': 1,\n                    'items': {\n                        '$ref': '#'\n                    }\n                },\n                'positiveInteger': {\n                    'type': 'integer',\n                    'minimum': 0\n                },\n                'positiveIntegerDefault0': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/positiveInteger'\n                        },\n                        {\n                            'default': 0\n                        }\n                    ]\n                },\n                'simpleTypes': {\n                    'type': 'string',\n                    'enum': [\n                        'array',\n                        'boolean',\n                        'integer',\n                        'null',\n                        'number',\n                        'object',\n                        'string'\n                    ]\n                },\n                'stringArray': {\n                    'type': 'array',\n                    'items': {\n                        'type': 'string'\n                    },\n                    'minItems': 1,\n                    'uniqueItems': true\n                }\n            },\n            'type': 'object',\n            'properties': {\n                'id': {\n                    'type': 'string',\n                    'format': 'uri'\n                },\n                '$schema': {\n                    'type': 'string',\n                    'format': 'uri'\n                },\n                'title': {\n                    'type': 'string'\n                },\n                'description': {\n                    'type': 'string'\n                },\n                'default': {},\n                'multipleOf': {\n                    'type': 'number',\n                    'minimum': 0,\n                    'exclusiveMinimum': true\n                },\n                'maximum': {\n                    'type': 'number'\n                },\n                'exclusiveMaximum': {\n                    'type': 'boolean',\n                    'default': false\n                },\n                'minimum': {\n                    'type': 'number'\n                },\n                'exclusiveMinimum': {\n                    'type': 'boolean',\n                    'default': false\n                },\n                'maxLength': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/positiveInteger'\n                        }\n                    ]\n                },\n                'minLength': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/positiveIntegerDefault0'\n                        }\n                    ]\n                },\n                'pattern': {\n                    'type': 'string',\n                    'format': 'regex'\n                },\n                'additionalItems': {\n                    'anyOf': [\n                        {\n                            'type': 'boolean'\n                        },\n                        {\n                            '$ref': '#'\n                        }\n                    ],\n                    'default': {}\n                },\n                'items': {\n                    'anyOf': [\n                        {\n                            '$ref': '#'\n                        },\n                        {\n                            '$ref': '#/definitions/schemaArray'\n                        }\n                    ],\n                    'default': {}\n                },\n                'maxItems': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/positiveInteger'\n                        }\n                    ]\n                },\n                'minItems': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/positiveIntegerDefault0'\n                        }\n                    ]\n                },\n                'uniqueItems': {\n                    'type': 'boolean',\n                    'default': false\n                },\n                'maxProperties': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/positiveInteger'\n                        }\n                    ]\n                },\n                'minProperties': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/positiveIntegerDefault0'\n                        }\n                    ]\n                },\n                'required': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/stringArray'\n                        }\n                    ]\n                },\n                'additionalProperties': {\n                    'anyOf': [\n                        {\n                            'type': 'boolean'\n                        },\n                        {\n                            '$ref': '#'\n                        }\n                    ],\n                    'default': {}\n                },\n                'definitions': {\n                    'type': 'object',\n                    'additionalProperties': {\n                        '$ref': '#'\n                    },\n                    'default': {}\n                },\n                'properties': {\n                    'type': 'object',\n                    'additionalProperties': {\n                        '$ref': '#'\n                    },\n                    'default': {}\n                },\n                'patternProperties': {\n                    'type': 'object',\n                    'additionalProperties': {\n                        '$ref': '#'\n                    },\n                    'default': {}\n                },\n                'dependencies': {\n                    'type': 'object',\n                    'additionalProperties': {\n                        'anyOf': [\n                            {\n                                '$ref': '#'\n                            },\n                            {\n                                '$ref': '#/definitions/stringArray'\n                            }\n                        ]\n                    }\n                },\n                'enum': {\n                    'type': 'array',\n                    'minItems': 1,\n                    'uniqueItems': true\n                },\n                'type': {\n                    'anyOf': [\n                        {\n                            '$ref': '#/definitions/simpleTypes'\n                        },\n                        {\n                            'type': 'array',\n                            'items': {\n                                '$ref': '#/definitions/simpleTypes'\n                            },\n                            'minItems': 1,\n                            'uniqueItems': true\n                        }\n                    ]\n                },\n                'format': {\n                    'anyOf': [\n                        {\n                            'type': 'string',\n                            'enum': [\n                                'date-time',\n                                'uri',\n                                'email',\n                                'hostname',\n                                'ipv4',\n                                'ipv6',\n                                'regex'\n                            ]\n                        },\n                        {\n                            'type': 'string'\n                        }\n                    ]\n                },\n                'allOf': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/schemaArray'\n                        }\n                    ]\n                },\n                'anyOf': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/schemaArray'\n                        }\n                    ]\n                },\n                'oneOf': {\n                    'allOf': [\n                        {\n                            '$ref': '#/definitions/schemaArray'\n                        }\n                    ]\n                },\n                'not': {\n                    'allOf': [\n                        {\n                            '$ref': '#'\n                        }\n                    ]\n                }\n            },\n            'dependencies': {\n                'exclusiveMaximum': [\n                    'maximum'\n                ],\n                'exclusiveMinimum': [\n                    'minimum'\n                ]\n            },\n            'default': {}\n        },\n        'http://json-schema.org/draft-07/schema#': {\n            'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'),\n            'definitions': {\n                'schemaArray': {\n                    'type': 'array',\n                    'minItems': 1,\n                    'items': { '$ref': '#' }\n                },\n                'nonNegativeInteger': {\n                    'type': 'integer',\n                    'minimum': 0\n                },\n                'nonNegativeIntegerDefault0': {\n                    'allOf': [\n                        { '$ref': '#/definitions/nonNegativeInteger' },\n                        { 'default': 0 }\n                    ]\n                },\n                'simpleTypes': {\n                    'enum': [\n                        'array',\n                        'boolean',\n                        'integer',\n                        'null',\n                        'number',\n                        'object',\n                        'string'\n                    ]\n                },\n                'stringArray': {\n                    'type': 'array',\n                    'items': { 'type': 'string' },\n                    'uniqueItems': true,\n                    'default': []\n                }\n            },\n            'type': ['object', 'boolean'],\n            'properties': {\n                '$id': {\n                    'type': 'string',\n                    'format': 'uri-reference'\n                },\n                '$schema': {\n                    'type': 'string',\n                    'format': 'uri'\n                },\n                '$ref': {\n                    'type': 'string',\n                    'format': 'uri-reference'\n                },\n                '$comment': {\n                    'type': 'string'\n                },\n                'title': {\n                    'type': 'string'\n                },\n                'description': {\n                    'type': 'string'\n                },\n                'default': true,\n                'readOnly': {\n                    'type': 'boolean',\n                    'default': false\n                },\n                'examples': {\n                    'type': 'array',\n                    'items': true\n                },\n                'multipleOf': {\n                    'type': 'number',\n                    'exclusiveMinimum': 0\n                },\n                'maximum': {\n                    'type': 'number'\n                },\n                'exclusiveMaximum': {\n                    'type': 'number'\n                },\n                'minimum': {\n                    'type': 'number'\n                },\n                'exclusiveMinimum': {\n                    'type': 'number'\n                },\n                'maxLength': { '$ref': '#/definitions/nonNegativeInteger' },\n                'minLength': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },\n                'pattern': {\n                    'type': 'string',\n                    'format': 'regex'\n                },\n                'additionalItems': { '$ref': '#' },\n                'items': {\n                    'anyOf': [\n                        { '$ref': '#' },\n                        { '$ref': '#/definitions/schemaArray' }\n                    ],\n                    'default': true\n                },\n                'maxItems': { '$ref': '#/definitions/nonNegativeInteger' },\n                'minItems': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },\n                'uniqueItems': {\n                    'type': 'boolean',\n                    'default': false\n                },\n                'contains': { '$ref': '#' },\n                'maxProperties': { '$ref': '#/definitions/nonNegativeInteger' },\n                'minProperties': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },\n                'required': { '$ref': '#/definitions/stringArray' },\n                'additionalProperties': { '$ref': '#' },\n                'definitions': {\n                    'type': 'object',\n                    'additionalProperties': { '$ref': '#' },\n                    'default': {}\n                },\n                'properties': {\n                    'type': 'object',\n                    'additionalProperties': { '$ref': '#' },\n                    'default': {}\n                },\n                'patternProperties': {\n                    'type': 'object',\n                    'additionalProperties': { '$ref': '#' },\n                    'propertyNames': { 'format': 'regex' },\n                    'default': {}\n                },\n                'dependencies': {\n                    'type': 'object',\n                    'additionalProperties': {\n                        'anyOf': [\n                            { '$ref': '#' },\n                            { '$ref': '#/definitions/stringArray' }\n                        ]\n                    }\n                },\n                'propertyNames': { '$ref': '#' },\n                'const': true,\n                'enum': {\n                    'type': 'array',\n                    'items': true,\n                    'minItems': 1,\n                    'uniqueItems': true\n                },\n                'type': {\n                    'anyOf': [\n                        { '$ref': '#/definitions/simpleTypes' },\n                        {\n                            'type': 'array',\n                            'items': { '$ref': '#/definitions/simpleTypes' },\n                            'minItems': 1,\n                            'uniqueItems': true\n                        }\n                    ]\n                },\n                'format': { 'type': 'string' },\n                'contentMediaType': { 'type': 'string' },\n                'contentEncoding': { 'type': 'string' },\n                'if': { '$ref': '#' },\n                'then': { '$ref': '#' },\n                'else': { '$ref': '#' },\n                'allOf': { '$ref': '#/definitions/schemaArray' },\n                'anyOf': { '$ref': '#/definitions/schemaArray' },\n                'oneOf': { '$ref': '#/definitions/schemaArray' },\n                'not': { '$ref': '#' }\n            },\n            'default': true\n        }\n    }\n};\nvar descriptions = {\n    id: localize('schema.json.id', \"A unique identifier for the schema.\"),\n    $schema: localize('schema.json.$schema', \"The schema to verify this document against.\"),\n    title: localize('schema.json.title', \"A descriptive title of the element.\"),\n    description: localize('schema.json.description', \"A long description of the element. Used in hover menus and suggestions.\"),\n    default: localize('schema.json.default', \"A default value. Used by suggestions.\"),\n    multipleOf: localize('schema.json.multipleOf', \"A number that should cleanly divide the current value (i.e. have no remainder).\"),\n    maximum: localize('schema.json.maximum', \"The maximum numerical value, inclusive by default.\"),\n    exclusiveMaximum: localize('schema.json.exclusiveMaximum', \"Makes the maximum property exclusive.\"),\n    minimum: localize('schema.json.minimum', \"The minimum numerical value, inclusive by default.\"),\n    exclusiveMinimum: localize('schema.json.exclusiveMininum', \"Makes the minimum property exclusive.\"),\n    maxLength: localize('schema.json.maxLength', \"The maximum length of a string.\"),\n    minLength: localize('schema.json.minLength', \"The minimum length of a string.\"),\n    pattern: localize('schema.json.pattern', \"A regular expression to match the string against. It is not implicitly anchored.\"),\n    additionalItems: localize('schema.json.additionalItems', \"For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail.\"),\n    items: localize('schema.json.items', \"For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on.\"),\n    maxItems: localize('schema.json.maxItems', \"The maximum number of items that can be inside an array. Inclusive.\"),\n    minItems: localize('schema.json.minItems', \"The minimum number of items that can be inside an array. Inclusive.\"),\n    uniqueItems: localize('schema.json.uniqueItems', \"If all of the items in the array must be unique. Defaults to false.\"),\n    maxProperties: localize('schema.json.maxProperties', \"The maximum number of properties an object can have. Inclusive.\"),\n    minProperties: localize('schema.json.minProperties', \"The minimum number of properties an object can have. Inclusive.\"),\n    required: localize('schema.json.required', \"An array of strings that lists the names of all properties required on this object.\"),\n    additionalProperties: localize('schema.json.additionalProperties', \"Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail.\"),\n    definitions: localize('schema.json.definitions', \"Not used for validation. Place subschemas here that you wish to reference inline with $ref.\"),\n    properties: localize('schema.json.properties', \"A map of property names to schemas for each property.\"),\n    patternProperties: localize('schema.json.patternProperties', \"A map of regular expressions on property names to schemas for matching properties.\"),\n    dependencies: localize('schema.json.dependencies', \"A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object.\"),\n    enum: localize('schema.json.enum', \"The set of literal values that are valid.\"),\n    type: localize('schema.json.type', \"Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types.\"),\n    format: localize('schema.json.format', \"Describes the format expected for the value.\"),\n    allOf: localize('schema.json.allOf', \"An array of schemas, all of which must match.\"),\n    anyOf: localize('schema.json.anyOf', \"An array of schemas, where at least one must match.\"),\n    oneOf: localize('schema.json.oneOf', \"An array of schemas, exactly one of which must match.\"),\n    not: localize('schema.json.not', \"A schema which must not match.\"),\n    $id: localize('schema.json.$id', \"A unique identifier for the schema.\"),\n    $ref: localize('schema.json.$ref', \"Reference a definition hosted on any location.\"),\n    $comment: localize('schema.json.$comment', \"Comments from schema authors to readers or maintainers of the schema.\"),\n    readOnly: localize('schema.json.readOnly', \"Indicates that the value of the instance is managed exclusively by the owning authority.\"),\n    examples: localize('schema.json.examples', \"Sample JSON values associated with a particular schema, for the purpose of illustrating usage.\"),\n    contains: localize('schema.json.contains', \"An array instance is valid against \\\"contains\\\" if at least one of its elements is valid against the given schema.\"),\n    propertyNames: localize('schema.json.propertyNames', \"If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema.\"),\n    const: localize('schema.json.const', \"An instance validates successfully against this keyword if its value is equal to the value of the keyword.\"),\n    contentMediaType: localize('schema.json.contentMediaType', \"Describes the media type of a string property.\"),\n    contentEncoding: localize('schema.json.contentEncoding', \"Describes the content encoding of a string property.\"),\n    if: localize('schema.json.if', \"The validation outcome of the \\\"if\\\" subschema controls which of the \\\"then\\\" or \\\"else\\\" keywords are evaluated.\"),\n    then: localize('schema.json.then', \"The \\\"if\\\" subschema is used for validation when the \\\"if\\\" subschema succeeds.\"),\n    else: localize('schema.json.else', \"The \\\"else\\\" subschema is used for validation when the \\\"if\\\" subschema fails.\")\n};\nfor (var schemaName in schemaContributions.schemas) {\n    var schema = schemaContributions.schemas[schemaName];\n    for (var property in schema.properties) {\n        var propertyObject = schema.properties[property];\n        if (typeof propertyObject === 'boolean') {\n            propertyObject = schema.properties[property] = {};\n        }\n        var description = descriptions[property];\n        if (description) {\n            propertyObject['description'] = description;\n        }\n        else {\n            console.log(property + \": localize('schema.json.\" + property + \"', \\\"\\\")\");\n        }\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 *--------------------------------------------------------------------------------------------*/\nimport * as Parser from '../parser/jsonParser.js';\nimport * as Json from '../../jsonc-parser/main.js';\nimport { stringifyObject } from '../utils/json.js';\nimport { endsWith } from '../utils/strings.js';\nimport { isDefined } from '../utils/objects.js';\nimport { CompletionItem, CompletionItemKind, Range, TextEdit, InsertTextFormat, MarkupKind } from '../jsonLanguageTypes.js';\nimport * as nls from '../../../fillers/vscode-nls.js';\nvar localize = nls.loadMessageBundle();\nvar valueCommitCharacters = [',', '}', ']'];\nvar propertyCommitCharacters = [':'];\nvar JSONCompletion = /** @class */ (function () {\n    function JSONCompletion(schemaService, contributions, promiseConstructor, clientCapabilities) {\n        if (contributions === void 0) { contributions = []; }\n        if (promiseConstructor === void 0) { promiseConstructor = Promise; }\n        if (clientCapabilities === void 0) { clientCapabilities = {}; }\n        this.schemaService = schemaService;\n        this.contributions = contributions;\n        this.promiseConstructor = promiseConstructor;\n        this.clientCapabilities = clientCapabilities;\n    }\n    JSONCompletion.prototype.doResolve = function (item) {\n        for (var i = this.contributions.length - 1; i >= 0; i--) {\n            var resolveCompletion = this.contributions[i].resolveCompletion;\n            if (resolveCompletion) {\n                var resolver = resolveCompletion(item);\n                if (resolver) {\n                    return resolver;\n                }\n            }\n        }\n        return this.promiseConstructor.resolve(item);\n    };\n    JSONCompletion.prototype.doComplete = function (document, position, doc) {\n        var _this = this;\n        var result = {\n            items: [],\n            isIncomplete: false\n        };\n        var text = document.getText();\n        var offset = document.offsetAt(position);\n        var node = doc.getNodeFromOffset(offset, true);\n        if (this.isInComment(document, node ? node.offset : 0, offset)) {\n            return Promise.resolve(result);\n        }\n        if (node && (offset === node.offset + node.length) && offset > 0) {\n            var ch = text[offset - 1];\n            if (node.type === 'object' && ch === '}' || node.type === 'array' && ch === ']') {\n                // after ] or }\n                node = node.parent;\n            }\n        }\n        var currentWord = this.getCurrentWord(document, offset);\n        var overwriteRange;\n        if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) {\n            overwriteRange = Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));\n        }\n        else {\n            var overwriteStart = offset - currentWord.length;\n            if (overwriteStart > 0 && text[overwriteStart - 1] === '\"') {\n                overwriteStart--;\n            }\n            overwriteRange = Range.create(document.positionAt(overwriteStart), position);\n        }\n        var supportsCommitCharacters = false; //this.doesSupportsCommitCharacters(); disabled for now, waiting for new API: https://github.com/microsoft/vscode/issues/42544\n        var proposed = {};\n        var collector = {\n            add: function (suggestion) {\n                var label = suggestion.label;\n                var existing = proposed[label];\n                if (!existing) {\n                    label = label.replace(/[\\n]/g, '↵');\n                    if (label.length > 60) {\n                        var shortendedLabel = label.substr(0, 57).trim() + '...';\n                        if (!proposed[shortendedLabel]) {\n                            label = shortendedLabel;\n                        }\n                    }\n                    if (overwriteRange && suggestion.insertText !== undefined) {\n                        suggestion.textEdit = TextEdit.replace(overwriteRange, suggestion.insertText);\n                    }\n                    if (supportsCommitCharacters) {\n                        suggestion.commitCharacters = suggestion.kind === CompletionItemKind.Property ? propertyCommitCharacters : valueCommitCharacters;\n                    }\n                    suggestion.label = label;\n                    proposed[label] = suggestion;\n                    result.items.push(suggestion);\n                }\n                else if (!existing.documentation) {\n                    existing.documentation = suggestion.documentation;\n                }\n            },\n            setAsIncomplete: function () {\n                result.isIncomplete = true;\n            },\n            error: function (message) {\n                console.error(message);\n            },\n            log: function (message) {\n                console.log(message);\n            },\n            getNumberOfProposals: function () {\n                return result.items.length;\n            }\n        };\n        return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) {\n            var collectionPromises = [];\n            var addValue = true;\n            var currentKey = '';\n            var currentProperty = undefined;\n            if (node) {\n                if (node.type === 'string') {\n                    var parent = node.parent;\n                    if (parent && parent.type === 'property' && parent.keyNode === node) {\n                        addValue = !parent.valueNode;\n                        currentProperty = parent;\n                        currentKey = text.substr(node.offset + 1, node.length - 2);\n                        if (parent) {\n                            node = parent.parent;\n                        }\n                    }\n                }\n            }\n            // proposals for properties\n            if (node && node.type === 'object') {\n                // don't suggest keys when the cursor is just before the opening curly brace\n                if (node.offset === offset) {\n                    return result;\n                }\n                // don't suggest properties that are already present\n                var properties = node.properties;\n                properties.forEach(function (p) {\n                    if (!currentProperty || currentProperty !== p) {\n                        proposed[p.keyNode.value] = CompletionItem.create('__');\n                    }\n                });\n                var separatorAfter_1 = '';\n                if (addValue) {\n                    separatorAfter_1 = _this.evaluateSeparatorAfter(document, document.offsetAt(overwriteRange.end));\n                }\n                if (schema) {\n                    // property proposals with schema\n                    _this.getPropertyCompletions(schema, doc, node, addValue, separatorAfter_1, collector);\n                }\n                else {\n                    // property proposals without schema\n                    _this.getSchemaLessPropertyCompletions(doc, node, currentKey, collector);\n                }\n                var location_1 = Parser.getNodePath(node);\n                _this.contributions.forEach(function (contribution) {\n                    var collectPromise = contribution.collectPropertyCompletions(document.uri, location_1, currentWord, addValue, separatorAfter_1 === '', collector);\n                    if (collectPromise) {\n                        collectionPromises.push(collectPromise);\n                    }\n                });\n                if ((!schema && currentWord.length > 0 && text.charAt(offset - currentWord.length - 1) !== '\"')) {\n                    collector.add({\n                        kind: CompletionItemKind.Property,\n                        label: _this.getLabelForValue(currentWord),\n                        insertText: _this.getInsertTextForProperty(currentWord, undefined, false, separatorAfter_1),\n                        insertTextFormat: InsertTextFormat.Snippet, documentation: '',\n                    });\n                    collector.setAsIncomplete();\n                }\n            }\n            // proposals for values\n            var types = {};\n            if (schema) {\n                // value proposals with schema\n                _this.getValueCompletions(schema, doc, node, offset, document, collector, types);\n            }\n            else {\n                // value proposals without schema\n                _this.getSchemaLessValueCompletions(doc, node, offset, document, collector);\n            }\n            if (_this.contributions.length > 0) {\n                _this.getContributedValueCompletions(doc, node, offset, document, collector, collectionPromises);\n            }\n            return _this.promiseConstructor.all(collectionPromises).then(function () {\n                if (collector.getNumberOfProposals() === 0) {\n                    var offsetForSeparator = offset;\n                    if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) {\n                        offsetForSeparator = node.offset + node.length;\n                    }\n                    var separatorAfter = _this.evaluateSeparatorAfter(document, offsetForSeparator);\n                    _this.addFillerValueCompletions(types, separatorAfter, collector);\n                }\n                return result;\n            });\n        });\n    };\n    JSONCompletion.prototype.getPropertyCompletions = function (schema, doc, node, addValue, separatorAfter, collector) {\n        var _this = this;\n        var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset);\n        matchingSchemas.forEach(function (s) {\n            if (s.node === node && !s.inverted) {\n                var schemaProperties_1 = s.schema.properties;\n                if (schemaProperties_1) {\n                    Object.keys(schemaProperties_1).forEach(function (key) {\n                        var propertySchema = schemaProperties_1[key];\n                        if (typeof propertySchema === 'object' && !propertySchema.deprecationMessage && !propertySchema.doNotSuggest) {\n                            var proposal = {\n                                kind: CompletionItemKind.Property,\n                                label: key,\n                                insertText: _this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter),\n                                insertTextFormat: InsertTextFormat.Snippet,\n                                filterText: _this.getFilterTextForValue(key),\n                                documentation: _this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || '',\n                            };\n                            if (propertySchema.suggestSortText !== undefined) {\n                                proposal.sortText = propertySchema.suggestSortText;\n                            }\n                            if (proposal.insertText && endsWith(proposal.insertText, \"$1\" + separatorAfter)) {\n                                proposal.command = {\n                                    title: 'Suggest',\n                                    command: 'editor.action.triggerSuggest'\n                                };\n                            }\n                            collector.add(proposal);\n                        }\n                    });\n                }\n                var schemaPropertyNames_1 = s.schema.propertyNames;\n                if (typeof schemaPropertyNames_1 === 'object' && !schemaPropertyNames_1.deprecationMessage && !schemaPropertyNames_1.doNotSuggest) {\n                    var propertyNameCompletionItem = function (name, enumDescription) {\n                        if (enumDescription === void 0) { enumDescription = undefined; }\n                        var proposal = {\n                            kind: CompletionItemKind.Property,\n                            label: name,\n                            insertText: _this.getInsertTextForProperty(name, undefined, addValue, separatorAfter),\n                            insertTextFormat: InsertTextFormat.Snippet,\n                            filterText: _this.getFilterTextForValue(name),\n                            documentation: enumDescription || _this.fromMarkup(schemaPropertyNames_1.markdownDescription) || schemaPropertyNames_1.description || '',\n                        };\n                        if (schemaPropertyNames_1.suggestSortText !== undefined) {\n                            proposal.sortText = schemaPropertyNames_1.suggestSortText;\n                        }\n                        if (proposal.insertText && endsWith(proposal.insertText, \"$1\" + separatorAfter)) {\n                            proposal.command = {\n                                title: 'Suggest',\n                                command: 'editor.action.triggerSuggest'\n                            };\n                        }\n                        collector.add(proposal);\n                    };\n                    if (schemaPropertyNames_1.enum) {\n                        for (var i = 0; i < schemaPropertyNames_1.enum.length; i++) {\n                            var enumDescription = undefined;\n                            if (schemaPropertyNames_1.markdownEnumDescriptions && i < schemaPropertyNames_1.markdownEnumDescriptions.length) {\n                                enumDescription = _this.fromMarkup(schemaPropertyNames_1.markdownEnumDescriptions[i]);\n                            }\n                            else if (schemaPropertyNames_1.enumDescriptions && i < schemaPropertyNames_1.enumDescriptions.length) {\n                                enumDescription = schemaPropertyNames_1.enumDescriptions[i];\n                            }\n                            propertyNameCompletionItem(schemaPropertyNames_1.enum[i], enumDescription);\n                        }\n                    }\n                    if (schemaPropertyNames_1.const) {\n                        propertyNameCompletionItem(schemaPropertyNames_1.const);\n                    }\n                }\n            }\n        });\n    };\n    JSONCompletion.prototype.getSchemaLessPropertyCompletions = function (doc, node, currentKey, collector) {\n        var _this = this;\n        var collectCompletionsForSimilarObject = function (obj) {\n            obj.properties.forEach(function (p) {\n                var key = p.keyNode.value;\n                collector.add({\n                    kind: CompletionItemKind.Property,\n                    label: key,\n                    insertText: _this.getInsertTextForValue(key, ''),\n                    insertTextFormat: InsertTextFormat.Snippet,\n                    filterText: _this.getFilterTextForValue(key),\n                    documentation: ''\n                });\n            });\n        };\n        if (node.parent) {\n            if (node.parent.type === 'property') {\n                // if the object is a property value, check the tree for other objects that hang under a property of the same name\n                var parentKey_1 = node.parent.keyNode.value;\n                doc.visit(function (n) {\n                    if (n.type === 'property' && n !== node.parent && n.keyNode.value === parentKey_1 && n.valueNode && n.valueNode.type === 'object') {\n                        collectCompletionsForSimilarObject(n.valueNode);\n                    }\n                    return true;\n                });\n            }\n            else if (node.parent.type === 'array') {\n                // if the object is in an array, use all other array elements as similar objects\n                node.parent.items.forEach(function (n) {\n                    if (n.type === 'object' && n !== node) {\n                        collectCompletionsForSimilarObject(n);\n                    }\n                });\n            }\n        }\n        else if (node.type === 'object') {\n            collector.add({\n                kind: CompletionItemKind.Property,\n                label: '$schema',\n                insertText: this.getInsertTextForProperty('$schema', undefined, true, ''),\n                insertTextFormat: InsertTextFormat.Snippet, documentation: '',\n                filterText: this.getFilterTextForValue(\"$schema\")\n            });\n        }\n    };\n    JSONCompletion.prototype.getSchemaLessValueCompletions = function (doc, node, offset, document, collector) {\n        var _this = this;\n        var offsetForSeparator = offset;\n        if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) {\n            offsetForSeparator = node.offset + node.length;\n            node = node.parent;\n        }\n        if (!node) {\n            collector.add({\n                kind: this.getSuggestionKind('object'),\n                label: 'Empty object',\n                insertText: this.getInsertTextForValue({}, ''),\n                insertTextFormat: InsertTextFormat.Snippet,\n                documentation: ''\n            });\n            collector.add({\n                kind: this.getSuggestionKind('array'),\n                label: 'Empty array',\n                insertText: this.getInsertTextForValue([], ''),\n                insertTextFormat: InsertTextFormat.Snippet,\n                documentation: ''\n            });\n            return;\n        }\n        var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator);\n        var collectSuggestionsForValues = function (value) {\n            if (value.parent && !Parser.contains(value.parent, offset, true)) {\n                collector.add({\n                    kind: _this.getSuggestionKind(value.type),\n                    label: _this.getLabelTextForMatchingNode(value, document),\n                    insertText: _this.getInsertTextForMatchingNode(value, document, separatorAfter),\n                    insertTextFormat: InsertTextFormat.Snippet, documentation: ''\n                });\n            }\n            if (value.type === 'boolean') {\n                _this.addBooleanValueCompletion(!value.value, separatorAfter, collector);\n            }\n        };\n        if (node.type === 'property') {\n            if (offset > (node.colonOffset || 0)) {\n                var valueNode = node.valueNode;\n                if (valueNode && (offset > (valueNode.offset + valueNode.length) || valueNode.type === 'object' || valueNode.type === 'array')) {\n                    return;\n                }\n                // suggest values at the same key\n                var parentKey_2 = node.keyNode.value;\n                doc.visit(function (n) {\n                    if (n.type === 'property' && n.keyNode.value === parentKey_2 && n.valueNode) {\n                        collectSuggestionsForValues(n.valueNode);\n                    }\n                    return true;\n                });\n                if (parentKey_2 === '$schema' && node.parent && !node.parent.parent) {\n                    this.addDollarSchemaCompletions(separatorAfter, collector);\n                }\n            }\n        }\n        if (node.type === 'array') {\n            if (node.parent && node.parent.type === 'property') {\n                // suggest items of an array at the same key\n                var parentKey_3 = node.parent.keyNode.value;\n                doc.visit(function (n) {\n                    if (n.type === 'property' && n.keyNode.value === parentKey_3 && n.valueNode && n.valueNode.type === 'array') {\n                        n.valueNode.items.forEach(collectSuggestionsForValues);\n                    }\n                    return true;\n                });\n            }\n            else {\n                // suggest items in the same array\n                node.items.forEach(collectSuggestionsForValues);\n            }\n        }\n    };\n    JSONCompletion.prototype.getValueCompletions = function (schema, doc, node, offset, document, collector, types) {\n        var offsetForSeparator = offset;\n        var parentKey = undefined;\n        var valueNode = undefined;\n        if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) {\n            offsetForSeparator = node.offset + node.length;\n            valueNode = node;\n            node = node.parent;\n        }\n        if (!node) {\n            this.addSchemaValueCompletions(schema.schema, '', collector, types);\n            return;\n        }\n        if ((node.type === 'property') && offset > (node.colonOffset || 0)) {\n            var valueNode_1 = node.valueNode;\n            if (valueNode_1 && offset > (valueNode_1.offset + valueNode_1.length)) {\n                return; // we are past the value node\n            }\n            parentKey = node.keyNode.value;\n            node = node.parent;\n        }\n        if (node && (parentKey !== undefined || node.type === 'array')) {\n            var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator);\n            var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset, valueNode);\n            for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) {\n                var s = matchingSchemas_1[_i];\n                if (s.node === node && !s.inverted && s.schema) {\n                    if (node.type === 'array' && s.schema.items) {\n                        if (Array.isArray(s.schema.items)) {\n                            var index = this.findItemAtOffset(node, document, offset);\n                            if (index < s.schema.items.length) {\n                                this.addSchemaValueCompletions(s.schema.items[index], separatorAfter, collector, types);\n                            }\n                        }\n                        else {\n                            this.addSchemaValueCompletions(s.schema.items, separatorAfter, collector, types);\n                        }\n                    }\n                    if (parentKey !== undefined) {\n                        var propertyMatched = false;\n                        if (s.schema.properties) {\n                            var propertySchema = s.schema.properties[parentKey];\n                            if (propertySchema) {\n                                propertyMatched = true;\n                                this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types);\n                            }\n                        }\n                        if (s.schema.patternProperties && !propertyMatched) {\n                            for (var _a = 0, _b = Object.keys(s.schema.patternProperties); _a < _b.length; _a++) {\n                                var pattern = _b[_a];\n                                var regex = new RegExp(pattern);\n                                if (regex.test(parentKey)) {\n                                    propertyMatched = true;\n                                    var propertySchema = s.schema.patternProperties[pattern];\n                                    this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types);\n                                }\n                            }\n                        }\n                        if (s.schema.additionalProperties && !propertyMatched) {\n                            var propertySchema = s.schema.additionalProperties;\n                            this.addSchemaValueCompletions(propertySchema, separatorAfter, collector, types);\n                        }\n                    }\n                }\n            }\n            if (parentKey === '$schema' && !node.parent) {\n                this.addDollarSchemaCompletions(separatorAfter, collector);\n            }\n            if (types['boolean']) {\n                this.addBooleanValueCompletion(true, separatorAfter, collector);\n                this.addBooleanValueCompletion(false, separatorAfter, collector);\n            }\n            if (types['null']) {\n                this.addNullValueCompletion(separatorAfter, collector);\n            }\n        }\n    };\n    JSONCompletion.prototype.getContributedValueCompletions = function (doc, node, offset, document, collector, collectionPromises) {\n        if (!node) {\n            this.contributions.forEach(function (contribution) {\n                var collectPromise = contribution.collectDefaultCompletions(document.uri, collector);\n                if (collectPromise) {\n                    collectionPromises.push(collectPromise);\n                }\n            });\n        }\n        else {\n            if (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null') {\n                node = node.parent;\n            }\n            if (node && (node.type === 'property') && offset > (node.colonOffset || 0)) {\n                var parentKey_4 = node.keyNode.value;\n                var valueNode = node.valueNode;\n                if ((!valueNode || offset <= (valueNode.offset + valueNode.length)) && node.parent) {\n                    var location_2 = Parser.getNodePath(node.parent);\n                    this.contributions.forEach(function (contribution) {\n                        var collectPromise = contribution.collectValueCompletions(document.uri, location_2, parentKey_4, collector);\n                        if (collectPromise) {\n                            collectionPromises.push(collectPromise);\n                        }\n                    });\n                }\n            }\n        }\n    };\n    JSONCompletion.prototype.addSchemaValueCompletions = function (schema, separatorAfter, collector, types) {\n        var _this = this;\n        if (typeof schema === 'object') {\n            this.addEnumValueCompletions(schema, separatorAfter, collector);\n            this.addDefaultValueCompletions(schema, separatorAfter, collector);\n            this.collectTypes(schema, types);\n            if (Array.isArray(schema.allOf)) {\n                schema.allOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); });\n            }\n            if (Array.isArray(schema.anyOf)) {\n                schema.anyOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); });\n            }\n            if (Array.isArray(schema.oneOf)) {\n                schema.oneOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); });\n            }\n        }\n    };\n    JSONCompletion.prototype.addDefaultValueCompletions = function (schema, separatorAfter, collector, arrayDepth) {\n        var _this = this;\n        if (arrayDepth === void 0) { arrayDepth = 0; }\n        var hasProposals = false;\n        if (isDefined(schema.default)) {\n            var type = schema.type;\n            var value = schema.default;\n            for (var i = arrayDepth; i > 0; i--) {\n                value = [value];\n                type = 'array';\n            }\n            collector.add({\n                kind: this.getSuggestionKind(type),\n                label: this.getLabelForValue(value),\n                insertText: this.getInsertTextForValue(value, separatorAfter),\n                insertTextFormat: InsertTextFormat.Snippet,\n                detail: localize('json.suggest.default', 'Default value')\n            });\n            hasProposals = true;\n        }\n        if (Array.isArray(schema.examples)) {\n            schema.examples.forEach(function (example) {\n                var type = schema.type;\n                var value = example;\n                for (var i = arrayDepth; i > 0; i--) {\n                    value = [value];\n                    type = 'array';\n                }\n                collector.add({\n                    kind: _this.getSuggestionKind(type),\n                    label: _this.getLabelForValue(value),\n                    insertText: _this.getInsertTextForValue(value, separatorAfter),\n                    insertTextFormat: InsertTextFormat.Snippet\n                });\n                hasProposals = true;\n            });\n        }\n        if (Array.isArray(schema.defaultSnippets)) {\n            schema.defaultSnippets.forEach(function (s) {\n                var type = schema.type;\n                var value = s.body;\n                var label = s.label;\n                var insertText;\n                var filterText;\n                if (isDefined(value)) {\n                    var type_1 = schema.type;\n                    for (var i = arrayDepth; i > 0; i--) {\n                        value = [value];\n                        type_1 = 'array';\n                    }\n                    insertText = _this.getInsertTextForSnippetValue(value, separatorAfter);\n                    filterText = _this.getFilterTextForSnippetValue(value);\n                    label = label || _this.getLabelForSnippetValue(value);\n                }\n                else if (typeof s.bodyText === 'string') {\n                    var prefix = '', suffix = '', indent = '';\n                    for (var i = arrayDepth; i > 0; i--) {\n                        prefix = prefix + indent + '[\\n';\n                        suffix = suffix + '\\n' + indent + ']';\n                        indent += '\\t';\n                        type = 'array';\n                    }\n                    insertText = prefix + indent + s.bodyText.split('\\n').join('\\n' + indent) + suffix + separatorAfter;\n                    label = label || insertText,\n                        filterText = insertText.replace(/[\\n]/g, ''); // remove new lines\n                }\n                else {\n                    return;\n                }\n                collector.add({\n                    kind: _this.getSuggestionKind(type),\n                    label: label,\n                    documentation: _this.fromMarkup(s.markdownDescription) || s.description,\n                    insertText: insertText,\n                    insertTextFormat: InsertTextFormat.Snippet,\n                    filterText: filterText\n                });\n                hasProposals = true;\n            });\n        }\n        if (!hasProposals && typeof schema.items === 'object' && !Array.isArray(schema.items) && arrayDepth < 5 /* beware of recursion */) {\n            this.addDefaultValueCompletions(schema.items, separatorAfter, collector, arrayDepth + 1);\n        }\n    };\n    JSONCompletion.prototype.addEnumValueCompletions = function (schema, separatorAfter, collector) {\n        if (isDefined(schema.const)) {\n            collector.add({\n                kind: this.getSuggestionKind(schema.type),\n                label: this.getLabelForValue(schema.const),\n                insertText: this.getInsertTextForValue(schema.const, separatorAfter),\n                insertTextFormat: InsertTextFormat.Snippet,\n                documentation: this.fromMarkup(schema.markdownDescription) || schema.description\n            });\n        }\n        if (Array.isArray(schema.enum)) {\n            for (var i = 0, length = schema.enum.length; i < length; i++) {\n                var enm = schema.enum[i];\n                var documentation = this.fromMarkup(schema.markdownDescription) || schema.description;\n                if (schema.markdownEnumDescriptions && i < schema.markdownEnumDescriptions.length && this.doesSupportMarkdown()) {\n                    documentation = this.fromMarkup(schema.markdownEnumDescriptions[i]);\n                }\n                else if (schema.enumDescriptions && i < schema.enumDescriptions.length) {\n                    documentation = schema.enumDescriptions[i];\n                }\n                collector.add({\n                    kind: this.getSuggestionKind(schema.type),\n                    label: this.getLabelForValue(enm),\n                    insertText: this.getInsertTextForValue(enm, separatorAfter),\n                    insertTextFormat: InsertTextFormat.Snippet,\n                    documentation: documentation\n                });\n            }\n        }\n    };\n    JSONCompletion.prototype.collectTypes = function (schema, types) {\n        if (Array.isArray(schema.enum) || isDefined(schema.const)) {\n            return;\n        }\n        var type = schema.type;\n        if (Array.isArray(type)) {\n            type.forEach(function (t) { return types[t] = true; });\n        }\n        else if (type) {\n            types[type] = true;\n        }\n    };\n    JSONCompletion.prototype.addFillerValueCompletions = function (types, separatorAfter, collector) {\n        if (types['object']) {\n            collector.add({\n                kind: this.getSuggestionKind('object'),\n                label: '{}',\n                insertText: this.getInsertTextForGuessedValue({}, separatorAfter),\n                insertTextFormat: InsertTextFormat.Snippet,\n                detail: localize('defaults.object', 'New object'),\n                documentation: ''\n            });\n        }\n        if (types['array']) {\n            collector.add({\n                kind: this.getSuggestionKind('array'),\n                label: '[]',\n                insertText: this.getInsertTextForGuessedValue([], separatorAfter),\n                insertTextFormat: InsertTextFormat.Snippet,\n                detail: localize('defaults.array', 'New array'),\n                documentation: ''\n            });\n        }\n    };\n    JSONCompletion.prototype.addBooleanValueCompletion = function (value, separatorAfter, collector) {\n        collector.add({\n            kind: this.getSuggestionKind('boolean'),\n            label: value ? 'true' : 'false',\n            insertText: this.getInsertTextForValue(value, separatorAfter),\n            insertTextFormat: InsertTextFormat.Snippet,\n            documentation: ''\n        });\n    };\n    JSONCompletion.prototype.addNullValueCompletion = function (separatorAfter, collector) {\n        collector.add({\n            kind: this.getSuggestionKind('null'),\n            label: 'null',\n            insertText: 'null' + separatorAfter,\n            insertTextFormat: InsertTextFormat.Snippet,\n            documentation: ''\n        });\n    };\n    JSONCompletion.prototype.addDollarSchemaCompletions = function (separatorAfter, collector) {\n        var _this = this;\n        var schemaIds = this.schemaService.getRegisteredSchemaIds(function (schema) { return schema === 'http' || schema === 'https'; });\n        schemaIds.forEach(function (schemaId) { return collector.add({\n            kind: CompletionItemKind.Module,\n            label: _this.getLabelForValue(schemaId),\n            filterText: _this.getFilterTextForValue(schemaId),\n            insertText: _this.getInsertTextForValue(schemaId, separatorAfter),\n            insertTextFormat: InsertTextFormat.Snippet, documentation: ''\n        }); });\n    };\n    JSONCompletion.prototype.getLabelForValue = function (value) {\n        return JSON.stringify(value);\n    };\n    JSONCompletion.prototype.getFilterTextForValue = function (value) {\n        return JSON.stringify(value);\n    };\n    JSONCompletion.prototype.getFilterTextForSnippetValue = function (value) {\n        return JSON.stringify(value).replace(/\\$\\{\\d+:([^}]+)\\}|\\$\\d+/g, '$1');\n    };\n    JSONCompletion.prototype.getLabelForSnippetValue = function (value) {\n        var label = JSON.stringify(value);\n        return label.replace(/\\$\\{\\d+:([^}]+)\\}|\\$\\d+/g, '$1');\n    };\n    JSONCompletion.prototype.getInsertTextForPlainText = function (text) {\n        return text.replace(/[\\\\\\$\\}]/g, '\\\\$&'); // escape $, \\ and } \n    };\n    JSONCompletion.prototype.getInsertTextForValue = function (value, separatorAfter) {\n        var text = JSON.stringify(value, null, '\\t');\n        if (text === '{}') {\n            return '{$1}' + separatorAfter;\n        }\n        else if (text === '[]') {\n            return '[$1]' + separatorAfter;\n        }\n        return this.getInsertTextForPlainText(text + separatorAfter);\n    };\n    JSONCompletion.prototype.getInsertTextForSnippetValue = function (value, separatorAfter) {\n        var replacer = function (value) {\n            if (typeof value === 'string') {\n                if (value[0] === '^') {\n                    return value.substr(1);\n                }\n            }\n            return JSON.stringify(value);\n        };\n        return stringifyObject(value, '', replacer) + separatorAfter;\n    };\n    JSONCompletion.prototype.getInsertTextForGuessedValue = function (value, separatorAfter) {\n        switch (typeof value) {\n            case 'object':\n                if (value === null) {\n                    return '${1:null}' + separatorAfter;\n                }\n                return this.getInsertTextForValue(value, separatorAfter);\n            case 'string':\n                var snippetValue = JSON.stringify(value);\n                snippetValue = snippetValue.substr(1, snippetValue.length - 2); // remove quotes\n                snippetValue = this.getInsertTextForPlainText(snippetValue); // escape \\ and }\n                return '\"${1:' + snippetValue + '}\"' + separatorAfter;\n            case 'number':\n            case 'boolean':\n                return '${1:' + JSON.stringify(value) + '}' + separatorAfter;\n        }\n        return this.getInsertTextForValue(value, separatorAfter);\n    };\n    JSONCompletion.prototype.getSuggestionKind = function (type) {\n        if (Array.isArray(type)) {\n            var array = type;\n            type = array.length > 0 ? array[0] : undefined;\n        }\n        if (!type) {\n            return CompletionItemKind.Value;\n        }\n        switch (type) {\n            case 'string': return CompletionItemKind.Value;\n            case 'object': return CompletionItemKind.Module;\n            case 'property': return CompletionItemKind.Property;\n            default: return CompletionItemKind.Value;\n        }\n    };\n    JSONCompletion.prototype.getLabelTextForMatchingNode = function (node, document) {\n        switch (node.type) {\n            case 'array':\n                return '[]';\n            case 'object':\n                return '{}';\n            default:\n                var content = document.getText().substr(node.offset, node.length);\n                return content;\n        }\n    };\n    JSONCompletion.prototype.getInsertTextForMatchingNode = function (node, document, separatorAfter) {\n        switch (node.type) {\n            case 'array':\n                return this.getInsertTextForValue([], separatorAfter);\n            case 'object':\n                return this.getInsertTextForValue({}, separatorAfter);\n            default:\n                var content = document.getText().substr(node.offset, node.length) + separatorAfter;\n                return this.getInsertTextForPlainText(content);\n        }\n    };\n    JSONCompletion.prototype.getInsertTextForProperty = function (key, propertySchema, addValue, separatorAfter) {\n        var propertyText = this.getInsertTextForValue(key, '');\n        if (!addValue) {\n            return propertyText;\n        }\n        var resultText = propertyText + ': ';\n        var value;\n        var nValueProposals = 0;\n        if (propertySchema) {\n            if (Array.isArray(propertySchema.defaultSnippets)) {\n                if (propertySchema.defaultSnippets.length === 1) {\n                    var body = propertySchema.defaultSnippets[0].body;\n                    if (isDefined(body)) {\n                        value = this.getInsertTextForSnippetValue(body, '');\n                    }\n                }\n                nValueProposals += propertySchema.defaultSnippets.length;\n            }\n            if (propertySchema.enum) {\n                if (!value && propertySchema.enum.length === 1) {\n                    value = this.getInsertTextForGuessedValue(propertySchema.enum[0], '');\n                }\n                nValueProposals += propertySchema.enum.length;\n            }\n            if (isDefined(propertySchema.default)) {\n                if (!value) {\n                    value = this.getInsertTextForGuessedValue(propertySchema.default, '');\n                }\n                nValueProposals++;\n            }\n            if (Array.isArray(propertySchema.examples) && propertySchema.examples.length) {\n                if (!value) {\n                    value = this.getInsertTextForGuessedValue(propertySchema.examples[0], '');\n                }\n                nValueProposals += propertySchema.examples.length;\n            }\n            if (nValueProposals === 0) {\n                var type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type;\n                if (!type) {\n                    if (propertySchema.properties) {\n                        type = 'object';\n                    }\n                    else if (propertySchema.items) {\n                        type = 'array';\n                    }\n                }\n                switch (type) {\n                    case 'boolean':\n                        value = '$1';\n                        break;\n                    case 'string':\n                        value = '\"$1\"';\n                        break;\n                    case 'object':\n                        value = '{$1}';\n                        break;\n                    case 'array':\n                        value = '[$1]';\n                        break;\n                    case 'number':\n                    case 'integer':\n                        value = '${1:0}';\n                        break;\n                    case 'null':\n                        value = '${1:null}';\n                        break;\n                    default:\n                        return propertyText;\n                }\n            }\n        }\n        if (!value || nValueProposals > 1) {\n            value = '$1';\n        }\n        return resultText + value + separatorAfter;\n    };\n    JSONCompletion.prototype.getCurrentWord = function (document, offset) {\n        var i = offset - 1;\n        var text = document.getText();\n        while (i >= 0 && ' \\t\\n\\r\\v\":{[,]}'.indexOf(text.charAt(i)) === -1) {\n            i--;\n        }\n        return text.substring(i + 1, offset);\n    };\n    JSONCompletion.prototype.evaluateSeparatorAfter = function (document, offset) {\n        var scanner = Json.createScanner(document.getText(), true);\n        scanner.setPosition(offset);\n        var token = scanner.scan();\n        switch (token) {\n            case 5 /* CommaToken */:\n            case 2 /* CloseBraceToken */:\n            case 4 /* CloseBracketToken */:\n            case 17 /* EOF */:\n                return '';\n            default:\n                return ',';\n        }\n    };\n    JSONCompletion.prototype.findItemAtOffset = function (node, document, offset) {\n        var scanner = Json.createScanner(document.getText(), true);\n        var children = node.items;\n        for (var i = children.length - 1; i >= 0; i--) {\n            var child = children[i];\n            if (offset > child.offset + child.length) {\n                scanner.setPosition(child.offset + child.length);\n                var token = scanner.scan();\n                if (token === 5 /* CommaToken */ && offset >= scanner.getTokenOffset() + scanner.getTokenLength()) {\n                    return i + 1;\n                }\n                return i;\n            }\n            else if (offset >= child.offset) {\n                return i;\n            }\n        }\n        return 0;\n    };\n    JSONCompletion.prototype.isInComment = function (document, start, offset) {\n        var scanner = Json.createScanner(document.getText(), false);\n        scanner.setPosition(start);\n        var token = scanner.scan();\n        while (token !== 17 /* EOF */ && (scanner.getTokenOffset() + scanner.getTokenLength() < offset)) {\n            token = scanner.scan();\n        }\n        return (token === 12 /* LineCommentTrivia */ || token === 13 /* BlockCommentTrivia */) && scanner.getTokenOffset() <= offset;\n    };\n    JSONCompletion.prototype.fromMarkup = function (markupString) {\n        if (markupString && this.doesSupportMarkdown()) {\n            return {\n                kind: MarkupKind.Markdown,\n                value: markupString\n            };\n        }\n        return undefined;\n    };\n    JSONCompletion.prototype.doesSupportMarkdown = function () {\n        if (!isDefined(this.supportsMarkdown)) {\n            var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion;\n            this.supportsMarkdown = completion && completion.completionItem && Array.isArray(completion.completionItem.documentationFormat) && completion.completionItem.documentationFormat.indexOf(MarkupKind.Markdown) !== -1;\n        }\n        return this.supportsMarkdown;\n    };\n    JSONCompletion.prototype.doesSupportsCommitCharacters = function () {\n        if (!isDefined(this.supportsCommitCharacters)) {\n            var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion;\n            this.supportsCommitCharacters = completion && completion.completionItem && !!completion.completionItem.commitCharactersSupport;\n        }\n        return this.supportsCommitCharacters;\n    };\n    return JSONCompletion;\n}());\nexport { JSONCompletion };\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 *--------------------------------------------------------------------------------------------*/\nimport { Range } from '../jsonLanguageTypes.js';\nexport function findDefinition(document, position, doc) {\n    var offset = document.offsetAt(position);\n    var node = doc.getNodeFromOffset(offset, true);\n    if (!node || !isRef(node)) {\n        return Promise.resolve([]);\n    }\n    var propertyNode = node.parent;\n    var valueNode = propertyNode.valueNode;\n    var path = valueNode.value;\n    var targetNode = findTargetNode(doc, path);\n    if (!targetNode) {\n        return Promise.resolve([]);\n    }\n    var definition = {\n        targetUri: document.uri,\n        originSelectionRange: createRange(document, valueNode),\n        targetRange: createRange(document, targetNode),\n        targetSelectionRange: createRange(document, targetNode)\n    };\n    return Promise.resolve([definition]);\n}\nfunction createRange(document, node) {\n    return Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));\n}\nfunction isRef(node) {\n    return node.type === 'string' &&\n        node.parent &&\n        node.parent.type === 'property' &&\n        node.parent.valueNode === node &&\n        node.parent.keyNode.value === \"$ref\" ||\n        false;\n}\nfunction findTargetNode(doc, path) {\n    var tokens = parseJSONPointer(path);\n    if (!tokens) {\n        return null;\n    }\n    return findNode(tokens, doc.root);\n}\nfunction findNode(pointer, node) {\n    if (!node) {\n        return null;\n    }\n    if (pointer.length === 0) {\n        return node;\n    }\n    var token = pointer.shift();\n    if (node && node.type === 'object') {\n        var propertyNode = node.properties.find(function (propertyNode) { return propertyNode.keyNode.value === token; });\n        if (!propertyNode) {\n            return null;\n        }\n        return findNode(pointer, propertyNode.valueNode);\n    }\n    else if (node && node.type === 'array') {\n        if (token.match(/^(0|[1-9][0-9]*)$/)) {\n            var index = Number.parseInt(token);\n            var arrayItem = node.items[index];\n            if (!arrayItem) {\n                return null;\n            }\n            return findNode(pointer, arrayItem);\n        }\n    }\n    return null;\n}\nfunction parseJSONPointer(path) {\n    if (path === \"#\") {\n        return [];\n    }\n    if (path[0] !== '#' || path[1] !== '/') {\n        return null;\n    }\n    return path.substring(2).split(/\\//).map(unescape);\n}\nfunction unescape(str) {\n    return str.replace(/~1/g, '/').replace(/~0/g, '~');\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 *--------------------------------------------------------------------------------------------*/\nimport * as Parser from '../parser/jsonParser.js';\nimport * as Strings from '../utils/strings.js';\nimport { colorFromHex } from '../utils/colors.js';\nimport { Range, TextEdit, SymbolKind, Location } from \"../jsonLanguageTypes.js\";\nvar JSONDocumentSymbols = /** @class */ (function () {\n    function JSONDocumentSymbols(schemaService) {\n        this.schemaService = schemaService;\n    }\n    JSONDocumentSymbols.prototype.findDocumentSymbols = function (document, doc, context) {\n        var _this = this;\n        if (context === void 0) { context = { resultLimit: Number.MAX_VALUE }; }\n        var root = doc.root;\n        if (!root) {\n            return [];\n        }\n        var limit = context.resultLimit || Number.MAX_VALUE;\n        // special handling for key bindings\n        var resourceString = document.uri;\n        if ((resourceString === 'vscode://defaultsettings/keybindings.json') || Strings.endsWith(resourceString.toLowerCase(), '/user/keybindings.json')) {\n            if (root.type === 'array') {\n                var result_1 = [];\n                for (var _i = 0, _a = root.items; _i < _a.length; _i++) {\n                    var item = _a[_i];\n                    if (item.type === 'object') {\n                        for (var _b = 0, _c = item.properties; _b < _c.length; _b++) {\n                            var property = _c[_b];\n                            if (property.keyNode.value === 'key' && property.valueNode) {\n                                var location = Location.create(document.uri, getRange(document, item));\n                                result_1.push({ name: Parser.getNodeValue(property.valueNode), kind: SymbolKind.Function, location: location });\n                                limit--;\n                                if (limit <= 0) {\n                                    if (context && context.onResultLimitExceeded) {\n                                        context.onResultLimitExceeded(resourceString);\n                                    }\n                                    return result_1;\n                                }\n                            }\n                        }\n                    }\n                }\n                return result_1;\n            }\n        }\n        var toVisit = [\n            { node: root, containerName: '' }\n        ];\n        var nextToVisit = 0;\n        var limitExceeded = false;\n        var result = [];\n        var collectOutlineEntries = function (node, containerName) {\n            if (node.type === 'array') {\n                node.items.forEach(function (node) {\n                    if (node) {\n                        toVisit.push({ node: node, containerName: containerName });\n                    }\n                });\n            }\n            else if (node.type === 'object') {\n                node.properties.forEach(function (property) {\n                    var valueNode = property.valueNode;\n                    if (valueNode) {\n                        if (limit > 0) {\n                            limit--;\n                            var location = Location.create(document.uri, getRange(document, property));\n                            var childContainerName = containerName ? containerName + '.' + property.keyNode.value : property.keyNode.value;\n                            result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), location: location, containerName: containerName });\n                            toVisit.push({ node: valueNode, containerName: childContainerName });\n                        }\n                        else {\n                            limitExceeded = true;\n                        }\n                    }\n                });\n            }\n        };\n        // breath first traversal\n        while (nextToVisit < toVisit.length) {\n            var next = toVisit[nextToVisit++];\n            collectOutlineEntries(next.node, next.containerName);\n        }\n        if (limitExceeded && context && context.onResultLimitExceeded) {\n            context.onResultLimitExceeded(resourceString);\n        }\n        return result;\n    };\n    JSONDocumentSymbols.prototype.findDocumentSymbols2 = function (document, doc, context) {\n        var _this = this;\n        if (context === void 0) { context = { resultLimit: Number.MAX_VALUE }; }\n        var root = doc.root;\n        if (!root) {\n            return [];\n        }\n        var limit = context.resultLimit || Number.MAX_VALUE;\n        // special handling for key bindings\n        var resourceString = document.uri;\n        if ((resourceString === 'vscode://defaultsettings/keybindings.json') || Strings.endsWith(resourceString.toLowerCase(), '/user/keybindings.json')) {\n            if (root.type === 'array') {\n                var result_2 = [];\n                for (var _i = 0, _a = root.items; _i < _a.length; _i++) {\n                    var item = _a[_i];\n                    if (item.type === 'object') {\n                        for (var _b = 0, _c = item.properties; _b < _c.length; _b++) {\n                            var property = _c[_b];\n                            if (property.keyNode.value === 'key' && property.valueNode) {\n                                var range = getRange(document, item);\n                                var selectionRange = getRange(document, property.keyNode);\n                                result_2.push({ name: Parser.getNodeValue(property.valueNode), kind: SymbolKind.Function, range: range, selectionRange: selectionRange });\n                                limit--;\n                                if (limit <= 0) {\n                                    if (context && context.onResultLimitExceeded) {\n                                        context.onResultLimitExceeded(resourceString);\n                                    }\n                                    return result_2;\n                                }\n                            }\n                        }\n                    }\n                }\n                return result_2;\n            }\n        }\n        var result = [];\n        var toVisit = [\n            { node: root, result: result }\n        ];\n        var nextToVisit = 0;\n        var limitExceeded = false;\n        var collectOutlineEntries = function (node, result) {\n            if (node.type === 'array') {\n                node.items.forEach(function (node, index) {\n                    if (node) {\n                        if (limit > 0) {\n                            limit--;\n                            var range = getRange(document, node);\n                            var selectionRange = range;\n                            var name = String(index);\n                            var symbol = { name: name, kind: _this.getSymbolKind(node.type), range: range, selectionRange: selectionRange, children: [] };\n                            result.push(symbol);\n                            toVisit.push({ result: symbol.children, node: node });\n                        }\n                        else {\n                            limitExceeded = true;\n                        }\n                    }\n                });\n            }\n            else if (node.type === 'object') {\n                node.properties.forEach(function (property) {\n                    var valueNode = property.valueNode;\n                    if (valueNode) {\n                        if (limit > 0) {\n                            limit--;\n                            var range = getRange(document, property);\n                            var selectionRange = getRange(document, property.keyNode);\n                            var symbol = { name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), range: range, selectionRange: selectionRange, children: [] };\n                            result.push(symbol);\n                            toVisit.push({ result: symbol.children, node: valueNode });\n                        }\n                        else {\n                            limitExceeded = true;\n                        }\n                    }\n                });\n            }\n        };\n        // breath first traversal\n        while (nextToVisit < toVisit.length) {\n            var next = toVisit[nextToVisit++];\n            collectOutlineEntries(next.node, next.result);\n        }\n        if (limitExceeded && context && context.onResultLimitExceeded) {\n            context.onResultLimitExceeded(resourceString);\n        }\n        return result;\n    };\n    JSONDocumentSymbols.prototype.getSymbolKind = function (nodeType) {\n        switch (nodeType) {\n            case 'object':\n                return SymbolKind.Module;\n            case 'string':\n                return SymbolKind.String;\n            case 'number':\n                return SymbolKind.Number;\n            case 'array':\n                return SymbolKind.Array;\n            case 'boolean':\n                return SymbolKind.Boolean;\n            default: // 'null'\n                return SymbolKind.Variable;\n        }\n    };\n    JSONDocumentSymbols.prototype.getKeyLabel = function (property) {\n        var name = property.keyNode.value;\n        if (name) {\n            name = name.replace(/[\\n]/g, '↵');\n        }\n        if (name && name.trim()) {\n            return name;\n        }\n        return \"\\\"\" + name + \"\\\"\";\n    };\n    JSONDocumentSymbols.prototype.findDocumentColors = function (document, doc, context) {\n        return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) {\n            var result = [];\n            if (schema) {\n                var limit = context && typeof context.resultLimit === 'number' ? context.resultLimit : Number.MAX_VALUE;\n                var matchingSchemas = doc.getMatchingSchemas(schema.schema);\n                var visitedNode = {};\n                for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) {\n                    var s = matchingSchemas_1[_i];\n                    if (!s.inverted && s.schema && (s.schema.format === 'color' || s.schema.format === 'color-hex') && s.node && s.node.type === 'string') {\n                        var nodeId = String(s.node.offset);\n                        if (!visitedNode[nodeId]) {\n                            var color = colorFromHex(Parser.getNodeValue(s.node));\n                            if (color) {\n                                var range = getRange(document, s.node);\n                                result.push({ color: color, range: range });\n                            }\n                            visitedNode[nodeId] = true;\n                            limit--;\n                            if (limit <= 0) {\n                                if (context && context.onResultLimitExceeded) {\n                                    context.onResultLimitExceeded(document.uri);\n                                }\n                                return result;\n                            }\n                        }\n                    }\n                }\n            }\n            return result;\n        });\n    };\n    JSONDocumentSymbols.prototype.getColorPresentations = function (document, doc, color, range) {\n        var result = [];\n        var red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255);\n        function toTwoDigitHex(n) {\n            var r = n.toString(16);\n            return r.length !== 2 ? '0' + r : r;\n        }\n        var label;\n        if (color.alpha === 1) {\n            label = \"#\" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256);\n        }\n        else {\n            label = \"#\" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256) + toTwoDigitHex(Math.round(color.alpha * 255));\n        }\n        result.push({ label: label, textEdit: TextEdit.replace(range, JSON.stringify(label)) });\n        return result;\n    };\n    return JSONDocumentSymbols;\n}());\nexport { JSONDocumentSymbols };\nfunction getRange(document, node) {\n    return Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length));\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 *--------------------------------------------------------------------------------------------*/\nimport { createScanner } from '../../jsonc-parser/main.js';\nimport { FoldingRangeKind, Position } from '../jsonLanguageTypes.js';\nexport function getFoldingRanges(document, context) {\n    var ranges = [];\n    var nestingLevels = [];\n    var stack = [];\n    var prevStart = -1;\n    var scanner = createScanner(document.getText(), false);\n    var token = scanner.scan();\n    function addRange(range) {\n        ranges.push(range);\n        nestingLevels.push(stack.length);\n    }\n    while (token !== 17 /* EOF */) {\n        switch (token) {\n            case 1 /* OpenBraceToken */:\n            case 3 /* OpenBracketToken */: {\n                var startLine = document.positionAt(scanner.getTokenOffset()).line;\n                var range = { startLine: startLine, endLine: startLine, kind: token === 1 /* OpenBraceToken */ ? 'object' : 'array' };\n                stack.push(range);\n                break;\n            }\n            case 2 /* CloseBraceToken */:\n            case 4 /* CloseBracketToken */: {\n                var kind = token === 2 /* CloseBraceToken */ ? 'object' : 'array';\n                if (stack.length > 0 && stack[stack.length - 1].kind === kind) {\n                    var range = stack.pop();\n                    var line = document.positionAt(scanner.getTokenOffset()).line;\n                    if (range && line > range.startLine + 1 && prevStart !== range.startLine) {\n                        range.endLine = line - 1;\n                        addRange(range);\n                        prevStart = range.startLine;\n                    }\n                }\n                break;\n            }\n            case 13 /* BlockCommentTrivia */: {\n                var startLine = document.positionAt(scanner.getTokenOffset()).line;\n                var endLine = document.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()).line;\n                if (scanner.getTokenError() === 1 /* UnexpectedEndOfComment */ && startLine + 1 < document.lineCount) {\n                    scanner.setPosition(document.offsetAt(Position.create(startLine + 1, 0)));\n                }\n                else {\n                    if (startLine < endLine) {\n                        addRange({ startLine: startLine, endLine: endLine, kind: FoldingRangeKind.Comment });\n                        prevStart = startLine;\n                    }\n                }\n                break;\n            }\n            case 12 /* LineCommentTrivia */: {\n                var text = document.getText().substr(scanner.getTokenOffset(), scanner.getTokenLength());\n                var m = text.match(/^\\/\\/\\s*#(region\\b)|(endregion\\b)/);\n                if (m) {\n                    var line = document.positionAt(scanner.getTokenOffset()).line;\n                    if (m[1]) { // start pattern match\n                        var range = { startLine: line, endLine: line, kind: FoldingRangeKind.Region };\n                        stack.push(range);\n                    }\n                    else {\n                        var i = stack.length - 1;\n                        while (i >= 0 && stack[i].kind !== FoldingRangeKind.Region) {\n                            i--;\n                        }\n                        if (i >= 0) {\n                            var range = stack[i];\n                            stack.length = i;\n                            if (line > range.startLine && prevStart !== range.startLine) {\n                                range.endLine = line;\n                                addRange(range);\n                                prevStart = range.startLine;\n                            }\n                        }\n                    }\n                }\n                break;\n            }\n        }\n        token = scanner.scan();\n    }\n    var rangeLimit = context && context.rangeLimit;\n    if (typeof rangeLimit !== 'number' || ranges.length <= rangeLimit) {\n        return ranges;\n    }\n    if (context && context.onRangeLimitExceeded) {\n        context.onRangeLimitExceeded(document.uri);\n    }\n    var counts = [];\n    for (var _i = 0, nestingLevels_1 = nestingLevels; _i < nestingLevels_1.length; _i++) {\n        var level = nestingLevels_1[_i];\n        if (level < 30) {\n            counts[level] = (counts[level] || 0) + 1;\n        }\n    }\n    var entries = 0;\n    var maxLevel = 0;\n    for (var i = 0; i < counts.length; i++) {\n        var n = counts[i];\n        if (n) {\n            if (n + entries > rangeLimit) {\n                maxLevel = i;\n                break;\n            }\n            entries += n;\n        }\n    }\n    var result = [];\n    for (var i = 0; i < ranges.length; i++) {\n        var level = nestingLevels[i];\n        if (typeof level === 'number') {\n            if (level < maxLevel || (level === maxLevel && entries++ < rangeLimit)) {\n                result.push(ranges[i]);\n            }\n        }\n    }\n    return result;\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 *--------------------------------------------------------------------------------------------*/\nimport * as Parser from '../parser/jsonParser.js';\nimport { Range } from '../jsonLanguageTypes.js';\nvar JSONHover = /** @class */ (function () {\n    function JSONHover(schemaService, contributions, promiseConstructor) {\n        if (contributions === void 0) { contributions = []; }\n        this.schemaService = schemaService;\n        this.contributions = contributions;\n        this.promise = promiseConstructor || Promise;\n    }\n    JSONHover.prototype.doHover = function (document, position, doc) {\n        var offset = document.offsetAt(position);\n        var node = doc.getNodeFromOffset(offset);\n        if (!node || (node.type === 'object' || node.type === 'array') && offset > node.offset + 1 && offset < node.offset + node.length - 1) {\n            return this.promise.resolve(null);\n        }\n        var hoverRangeNode = node;\n        // use the property description when hovering over an object key\n        if (node.type === 'string') {\n            var parent = node.parent;\n            if (parent && parent.type === 'property' && parent.keyNode === node) {\n                node = parent.valueNode;\n                if (!node) {\n                    return this.promise.resolve(null);\n                }\n            }\n        }\n        var hoverRange = Range.create(document.positionAt(hoverRangeNode.offset), document.positionAt(hoverRangeNode.offset + hoverRangeNode.length));\n        var createHover = function (contents) {\n            var result = {\n                contents: contents,\n                range: hoverRange\n            };\n            return result;\n        };\n        var location = Parser.getNodePath(node);\n        for (var i = this.contributions.length - 1; i >= 0; i--) {\n            var contribution = this.contributions[i];\n            var promise = contribution.getInfoContribution(document.uri, location);\n            if (promise) {\n                return promise.then(function (htmlContent) { return createHover(htmlContent); });\n            }\n        }\n        return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) {\n            if (schema && node) {\n                var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset);\n                var title_1 = undefined;\n                var markdownDescription_1 = undefined;\n                var markdownEnumValueDescription_1 = undefined, enumValue_1 = undefined;\n                matchingSchemas.every(function (s) {\n                    if (s.node === node && !s.inverted && s.schema) {\n                        title_1 = title_1 || s.schema.title;\n                        markdownDescription_1 = markdownDescription_1 || s.schema.markdownDescription || toMarkdown(s.schema.description);\n                        if (s.schema.enum) {\n                            var idx = s.schema.enum.indexOf(Parser.getNodeValue(node));\n                            if (s.schema.markdownEnumDescriptions) {\n                                markdownEnumValueDescription_1 = s.schema.markdownEnumDescriptions[idx];\n                            }\n                            else if (s.schema.enumDescriptions) {\n                                markdownEnumValueDescription_1 = toMarkdown(s.schema.enumDescriptions[idx]);\n                            }\n                            if (markdownEnumValueDescription_1) {\n                                enumValue_1 = s.schema.enum[idx];\n                                if (typeof enumValue_1 !== 'string') {\n                                    enumValue_1 = JSON.stringify(enumValue_1);\n                                }\n                            }\n                        }\n                    }\n                    return true;\n                });\n                var result = '';\n                if (title_1) {\n                    result = toMarkdown(title_1);\n                }\n                if (markdownDescription_1) {\n                    if (result.length > 0) {\n                        result += \"\\n\\n\";\n                    }\n                    result += markdownDescription_1;\n                }\n                if (markdownEnumValueDescription_1) {\n                    if (result.length > 0) {\n                        result += \"\\n\\n\";\n                    }\n                    result += \"`\" + toMarkdownCodeBlock(enumValue_1) + \"`: \" + markdownEnumValueDescription_1;\n                }\n                return createHover([result]);\n            }\n            return null;\n        });\n    };\n    return JSONHover;\n}());\nexport { JSONHover };\nfunction toMarkdown(plain) {\n    if (plain) {\n        var res = plain.replace(/([^\\n\\r])(\\r?\\n)([^\\n\\r])/gm, '$1\\n\\n$3'); // single new lines to \\n\\n (Markdown paragraph)\n        return res.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, \"\\\\$&\"); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n    }\n    return undefined;\n}\nfunction toMarkdownCodeBlock(content) {\n    // see https://daringfireball.net/projects/markdown/syntax#precode\n    if (content.indexOf('`') !== -1) {\n        return '`` ' + content + ' ``';\n    }\n    return content;\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 *--------------------------------------------------------------------------------------------*/\nimport * as Json from '../../jsonc-parser/main.js';\nimport { URI } from '../../vscode-uri/index.js';\nimport * as Strings from '../utils/strings.js';\nimport * as Parser from '../parser/jsonParser.js';\nimport * as nls from '../../../fillers/vscode-nls.js';\nvar localize = nls.loadMessageBundle();\nvar FilePatternAssociation = /** @class */ (function () {\n    function FilePatternAssociation(pattern, uris) {\n        this.patternRegExps = [];\n        this.isInclude = [];\n        try {\n            for (var _i = 0, pattern_1 = pattern; _i < pattern_1.length; _i++) {\n                var p = pattern_1[_i];\n                var include = p[0] !== '!';\n                if (!include) {\n                    p = p.substring(1);\n                }\n                this.patternRegExps.push(new RegExp(Strings.convertSimple2RegExpPattern(p) + '$'));\n                this.isInclude.push(include);\n            }\n            this.uris = uris;\n        }\n        catch (e) {\n            // invalid pattern\n            this.patternRegExps.length = 0;\n            this.isInclude.length = 0;\n            this.uris = [];\n        }\n    }\n    FilePatternAssociation.prototype.matchesPattern = function (fileName) {\n        var match = false;\n        for (var i = 0; i < this.patternRegExps.length; i++) {\n            var regExp = this.patternRegExps[i];\n            if (regExp.test(fileName)) {\n                match = this.isInclude[i];\n            }\n        }\n        return match;\n    };\n    FilePatternAssociation.prototype.getURIs = function () {\n        return this.uris;\n    };\n    return FilePatternAssociation;\n}());\nvar SchemaHandle = /** @class */ (function () {\n    function SchemaHandle(service, url, unresolvedSchemaContent) {\n        this.service = service;\n        this.url = url;\n        this.dependencies = {};\n        if (unresolvedSchemaContent) {\n            this.unresolvedSchema = this.service.promise.resolve(new UnresolvedSchema(unresolvedSchemaContent));\n        }\n    }\n    SchemaHandle.prototype.getUnresolvedSchema = function () {\n        if (!this.unresolvedSchema) {\n            this.unresolvedSchema = this.service.loadSchema(this.url);\n        }\n        return this.unresolvedSchema;\n    };\n    SchemaHandle.prototype.getResolvedSchema = function () {\n        var _this = this;\n        if (!this.resolvedSchema) {\n            this.resolvedSchema = this.getUnresolvedSchema().then(function (unresolved) {\n                return _this.service.resolveSchemaContent(unresolved, _this.url, _this.dependencies);\n            });\n        }\n        return this.resolvedSchema;\n    };\n    SchemaHandle.prototype.clearSchema = function () {\n        this.resolvedSchema = undefined;\n        this.unresolvedSchema = undefined;\n        this.dependencies = {};\n    };\n    return SchemaHandle;\n}());\nvar UnresolvedSchema = /** @class */ (function () {\n    function UnresolvedSchema(schema, errors) {\n        if (errors === void 0) { errors = []; }\n        this.schema = schema;\n        this.errors = errors;\n    }\n    return UnresolvedSchema;\n}());\nexport { UnresolvedSchema };\nvar ResolvedSchema = /** @class */ (function () {\n    function ResolvedSchema(schema, errors) {\n        if (errors === void 0) { errors = []; }\n        this.schema = schema;\n        this.errors = errors;\n    }\n    ResolvedSchema.prototype.getSection = function (path) {\n        var schemaRef = this.getSectionRecursive(path, this.schema);\n        if (schemaRef) {\n            return Parser.asSchema(schemaRef);\n        }\n        return undefined;\n    };\n    ResolvedSchema.prototype.getSectionRecursive = function (path, schema) {\n        if (!schema || typeof schema === 'boolean' || path.length === 0) {\n            return schema;\n        }\n        var next = path.shift();\n        if (schema.properties && typeof schema.properties[next]) {\n            return this.getSectionRecursive(path, schema.properties[next]);\n        }\n        else if (schema.patternProperties) {\n            for (var _i = 0, _a = Object.keys(schema.patternProperties); _i < _a.length; _i++) {\n                var pattern = _a[_i];\n                var regex = new RegExp(pattern);\n                if (regex.test(next)) {\n                    return this.getSectionRecursive(path, schema.patternProperties[pattern]);\n                }\n            }\n        }\n        else if (typeof schema.additionalProperties === 'object') {\n            return this.getSectionRecursive(path, schema.additionalProperties);\n        }\n        else if (next.match('[0-9]+')) {\n            if (Array.isArray(schema.items)) {\n                var index = parseInt(next, 10);\n                if (!isNaN(index) && schema.items[index]) {\n                    return this.getSectionRecursive(path, schema.items[index]);\n                }\n            }\n            else if (schema.items) {\n                return this.getSectionRecursive(path, schema.items);\n            }\n        }\n        return undefined;\n    };\n    return ResolvedSchema;\n}());\nexport { ResolvedSchema };\nvar JSONSchemaService = /** @class */ (function () {\n    function JSONSchemaService(requestService, contextService, promiseConstructor) {\n        this.contextService = contextService;\n        this.requestService = requestService;\n        this.promiseConstructor = promiseConstructor || Promise;\n        this.callOnDispose = [];\n        this.contributionSchemas = {};\n        this.contributionAssociations = [];\n        this.schemasById = {};\n        this.filePatternAssociations = [];\n        this.registeredSchemasIds = {};\n    }\n    JSONSchemaService.prototype.getRegisteredSchemaIds = function (filter) {\n        return Object.keys(this.registeredSchemasIds).filter(function (id) {\n            var scheme = URI.parse(id).scheme;\n            return scheme !== 'schemaservice' && (!filter || filter(scheme));\n        });\n    };\n    Object.defineProperty(JSONSchemaService.prototype, \"promise\", {\n        get: function () {\n            return this.promiseConstructor;\n        },\n        enumerable: false,\n        configurable: true\n    });\n    JSONSchemaService.prototype.dispose = function () {\n        while (this.callOnDispose.length > 0) {\n            this.callOnDispose.pop()();\n        }\n    };\n    JSONSchemaService.prototype.onResourceChange = function (uri) {\n        var _this = this;\n        var hasChanges = false;\n        uri = normalizeId(uri);\n        var toWalk = [uri];\n        var all = Object.keys(this.schemasById).map(function (key) { return _this.schemasById[key]; });\n        while (toWalk.length) {\n            var curr = toWalk.pop();\n            for (var i = 0; i < all.length; i++) {\n                var handle = all[i];\n                if (handle && (handle.url === curr || handle.dependencies[curr])) {\n                    if (handle.url !== curr) {\n                        toWalk.push(handle.url);\n                    }\n                    handle.clearSchema();\n                    all[i] = undefined;\n                    hasChanges = true;\n                }\n            }\n        }\n        return hasChanges;\n    };\n    JSONSchemaService.prototype.setSchemaContributions = function (schemaContributions) {\n        if (schemaContributions.schemas) {\n            var schemas = schemaContributions.schemas;\n            for (var id in schemas) {\n                var normalizedId = normalizeId(id);\n                this.contributionSchemas[normalizedId] = this.addSchemaHandle(normalizedId, schemas[id]);\n            }\n        }\n        if (Array.isArray(schemaContributions.schemaAssociations)) {\n            var schemaAssociations = schemaContributions.schemaAssociations;\n            for (var _i = 0, schemaAssociations_1 = schemaAssociations; _i < schemaAssociations_1.length; _i++) {\n                var schemaAssociation = schemaAssociations_1[_i];\n                var uris = schemaAssociation.uris.map(normalizeId);\n                var association = this.addFilePatternAssociation(schemaAssociation.pattern, uris);\n                this.contributionAssociations.push(association);\n            }\n        }\n    };\n    JSONSchemaService.prototype.addSchemaHandle = function (id, unresolvedSchemaContent) {\n        var schemaHandle = new SchemaHandle(this, id, unresolvedSchemaContent);\n        this.schemasById[id] = schemaHandle;\n        return schemaHandle;\n    };\n    JSONSchemaService.prototype.getOrAddSchemaHandle = function (id, unresolvedSchemaContent) {\n        return this.schemasById[id] || this.addSchemaHandle(id, unresolvedSchemaContent);\n    };\n    JSONSchemaService.prototype.addFilePatternAssociation = function (pattern, uris) {\n        var fpa = new FilePatternAssociation(pattern, uris);\n        this.filePatternAssociations.push(fpa);\n        return fpa;\n    };\n    JSONSchemaService.prototype.registerExternalSchema = function (uri, filePatterns, unresolvedSchemaContent) {\n        var id = normalizeId(uri);\n        this.registeredSchemasIds[id] = true;\n        this.cachedSchemaForResource = undefined;\n        if (filePatterns) {\n            this.addFilePatternAssociation(filePatterns, [uri]);\n        }\n        return unresolvedSchemaContent ? this.addSchemaHandle(id, unresolvedSchemaContent) : this.getOrAddSchemaHandle(id);\n    };\n    JSONSchemaService.prototype.clearExternalSchemas = function () {\n        this.schemasById = {};\n        this.filePatternAssociations = [];\n        this.registeredSchemasIds = {};\n        this.cachedSchemaForResource = undefined;\n        for (var id in this.contributionSchemas) {\n            this.schemasById[id] = this.contributionSchemas[id];\n            this.registeredSchemasIds[id] = true;\n        }\n        for (var _i = 0, _a = this.contributionAssociations; _i < _a.length; _i++) {\n            var contributionAssociation = _a[_i];\n            this.filePatternAssociations.push(contributionAssociation);\n        }\n    };\n    JSONSchemaService.prototype.getResolvedSchema = function (schemaId) {\n        var id = normalizeId(schemaId);\n        var schemaHandle = this.schemasById[id];\n        if (schemaHandle) {\n            return schemaHandle.getResolvedSchema();\n        }\n        return this.promise.resolve(undefined);\n    };\n    JSONSchemaService.prototype.loadSchema = function (url) {\n        if (!this.requestService) {\n            var errorMessage = localize('json.schema.norequestservice', 'Unable to load schema from \\'{0}\\'. No schema request service available', toDisplayString(url));\n            return this.promise.resolve(new UnresolvedSchema({}, [errorMessage]));\n        }\n        return this.requestService(url).then(function (content) {\n            if (!content) {\n                var errorMessage = localize('json.schema.nocontent', 'Unable to load schema from \\'{0}\\': No content.', toDisplayString(url));\n                return new UnresolvedSchema({}, [errorMessage]);\n            }\n            var schemaContent = {};\n            var jsonErrors = [];\n            schemaContent = Json.parse(content, jsonErrors);\n            var errors = jsonErrors.length ? [localize('json.schema.invalidFormat', 'Unable to parse content from \\'{0}\\': Parse error at offset {1}.', toDisplayString(url), jsonErrors[0].offset)] : [];\n            return new UnresolvedSchema(schemaContent, errors);\n        }, function (error) {\n            var errorMessage = error.toString();\n            var errorSplit = error.toString().split('Error: ');\n            if (errorSplit.length > 1) {\n                // more concise error message, URL and context are attached by caller anyways\n                errorMessage = errorSplit[1];\n            }\n            if (Strings.endsWith(errorMessage, '.')) {\n                errorMessage = errorMessage.substr(0, errorMessage.length - 1);\n            }\n            return new UnresolvedSchema({}, [localize('json.schema.nocontent', 'Unable to load schema from \\'{0}\\': {1}.', toDisplayString(url), errorMessage)]);\n        });\n    };\n    JSONSchemaService.prototype.resolveSchemaContent = function (schemaToResolve, schemaURL, dependencies) {\n        var _this = this;\n        var resolveErrors = schemaToResolve.errors.slice(0);\n        var schema = schemaToResolve.schema;\n        if (schema.$schema) {\n            var id = normalizeId(schema.$schema);\n            if (id === 'http://json-schema.org/draft-03/schema') {\n                return this.promise.resolve(new ResolvedSchema({}, [localize('json.schema.draft03.notsupported', \"Draft-03 schemas are not supported.\")]));\n            }\n            else if (id === 'https://json-schema.org/draft/2019-09/schema') {\n                resolveErrors.push(localize('json.schema.draft201909.notsupported', \"Draft 2019-09 schemas are not yet fully supported.\"));\n            }\n        }\n        var contextService = this.contextService;\n        var findSection = function (schema, path) {\n            if (!path) {\n                return schema;\n            }\n            var current = schema;\n            if (path[0] === '/') {\n                path = path.substr(1);\n            }\n            path.split('/').some(function (part) {\n                current = current[part];\n                return !current;\n            });\n            return current;\n        };\n        var merge = function (target, sourceRoot, sourceURI, refSegment) {\n            var path = refSegment ? decodeURIComponent(refSegment) : undefined;\n            var section = findSection(sourceRoot, path);\n            if (section) {\n                for (var key in section) {\n                    if (section.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n                        target[key] = section[key];\n                    }\n                }\n            }\n            else {\n                resolveErrors.push(localize('json.schema.invalidref', '$ref \\'{0}\\' in \\'{1}\\' can not be resolved.', path, sourceURI));\n            }\n        };\n        var resolveExternalLink = function (node, uri, refSegment, parentSchemaURL, parentSchemaDependencies) {\n            if (contextService && !/^\\w+:\\/\\/.*/.test(uri)) {\n                uri = contextService.resolveRelativePath(uri, parentSchemaURL);\n            }\n            uri = normalizeId(uri);\n            var referencedHandle = _this.getOrAddSchemaHandle(uri);\n            return referencedHandle.getUnresolvedSchema().then(function (unresolvedSchema) {\n                parentSchemaDependencies[uri] = true;\n                if (unresolvedSchema.errors.length) {\n                    var loc = refSegment ? uri + '#' + refSegment : uri;\n                    resolveErrors.push(localize('json.schema.problemloadingref', 'Problems loading reference \\'{0}\\': {1}', loc, unresolvedSchema.errors[0]));\n                }\n                merge(node, unresolvedSchema.schema, uri, refSegment);\n                return resolveRefs(node, unresolvedSchema.schema, uri, referencedHandle.dependencies);\n            });\n        };\n        var resolveRefs = function (node, parentSchema, parentSchemaURL, parentSchemaDependencies) {\n            if (!node || typeof node !== 'object') {\n                return Promise.resolve(null);\n            }\n            var toWalk = [node];\n            var seen = [];\n            var openPromises = [];\n            var collectEntries = function () {\n                var entries = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    entries[_i] = arguments[_i];\n                }\n                for (var _a = 0, entries_1 = entries; _a < entries_1.length; _a++) {\n                    var entry = entries_1[_a];\n                    if (typeof entry === 'object') {\n                        toWalk.push(entry);\n                    }\n                }\n            };\n            var collectMapEntries = function () {\n                var maps = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    maps[_i] = arguments[_i];\n                }\n                for (var _a = 0, maps_1 = maps; _a < maps_1.length; _a++) {\n                    var map = maps_1[_a];\n                    if (typeof map === 'object') {\n                        for (var k in map) {\n                            var key = k;\n                            var entry = map[key];\n                            if (typeof entry === 'object') {\n                                toWalk.push(entry);\n                            }\n                        }\n                    }\n                }\n            };\n            var collectArrayEntries = function () {\n                var arrays = [];\n                for (var _i = 0; _i < arguments.length; _i++) {\n                    arrays[_i] = arguments[_i];\n                }\n                for (var _a = 0, arrays_1 = arrays; _a < arrays_1.length; _a++) {\n                    var array = arrays_1[_a];\n                    if (Array.isArray(array)) {\n                        for (var _b = 0, array_1 = array; _b < array_1.length; _b++) {\n                            var entry = array_1[_b];\n                            if (typeof entry === 'object') {\n                                toWalk.push(entry);\n                            }\n                        }\n                    }\n                }\n            };\n            var handleRef = function (next) {\n                var seenRefs = [];\n                while (next.$ref) {\n                    var ref = next.$ref;\n                    var segments = ref.split('#', 2);\n                    delete next.$ref;\n                    if (segments[0].length > 0) {\n                        openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL, parentSchemaDependencies));\n                        return;\n                    }\n                    else {\n                        if (seenRefs.indexOf(ref) === -1) {\n                            merge(next, parentSchema, parentSchemaURL, segments[1]); // can set next.$ref again, use seenRefs to avoid circle\n                            seenRefs.push(ref);\n                        }\n                    }\n                }\n                collectEntries(next.items, next.additionalItems, next.additionalProperties, next.not, next.contains, next.propertyNames, next.if, next.then, next.else);\n                collectMapEntries(next.definitions, next.properties, next.patternProperties, next.dependencies);\n                collectArrayEntries(next.anyOf, next.allOf, next.oneOf, next.items);\n            };\n            while (toWalk.length) {\n                var next = toWalk.pop();\n                if (seen.indexOf(next) >= 0) {\n                    continue;\n                }\n                seen.push(next);\n                handleRef(next);\n            }\n            return _this.promise.all(openPromises);\n        };\n        return resolveRefs(schema, schema, schemaURL, dependencies).then(function (_) { return new ResolvedSchema(schema, resolveErrors); });\n    };\n    JSONSchemaService.prototype.getSchemaForResource = function (resource, document) {\n        // first use $schema if present\n        if (document && document.root && document.root.type === 'object') {\n            var schemaProperties = document.root.properties.filter(function (p) { return (p.keyNode.value === '$schema') && p.valueNode && p.valueNode.type === 'string'; });\n            if (schemaProperties.length > 0) {\n                var valueNode = schemaProperties[0].valueNode;\n                if (valueNode && valueNode.type === 'string') {\n                    var schemeId = Parser.getNodeValue(valueNode);\n                    if (schemeId && Strings.startsWith(schemeId, '.') && this.contextService) {\n                        schemeId = this.contextService.resolveRelativePath(schemeId, resource);\n                    }\n                    if (schemeId) {\n                        var id = normalizeId(schemeId);\n                        return this.getOrAddSchemaHandle(id).getResolvedSchema();\n                    }\n                }\n            }\n        }\n        if (this.cachedSchemaForResource && this.cachedSchemaForResource.resource === resource) {\n            return this.cachedSchemaForResource.resolvedSchema;\n        }\n        var seen = Object.create(null);\n        var schemas = [];\n        for (var _i = 0, _a = this.filePatternAssociations; _i < _a.length; _i++) {\n            var entry = _a[_i];\n            if (entry.matchesPattern(resource)) {\n                for (var _b = 0, _c = entry.getURIs(); _b < _c.length; _b++) {\n                    var schemaId = _c[_b];\n                    if (!seen[schemaId]) {\n                        schemas.push(schemaId);\n                        seen[schemaId] = true;\n                    }\n                }\n            }\n        }\n        var resolvedSchema = schemas.length > 0 ? this.createCombinedSchema(resource, schemas).getResolvedSchema() : this.promise.resolve(undefined);\n        this.cachedSchemaForResource = { resource: resource, resolvedSchema: resolvedSchema };\n        return resolvedSchema;\n    };\n    JSONSchemaService.prototype.createCombinedSchema = function (resource, schemaIds) {\n        if (schemaIds.length === 1) {\n            return this.getOrAddSchemaHandle(schemaIds[0]);\n        }\n        else {\n            var combinedSchemaId = 'schemaservice://combinedSchema/' + encodeURIComponent(resource);\n            var combinedSchema = {\n                allOf: schemaIds.map(function (schemaId) { return ({ $ref: schemaId }); })\n            };\n            return this.addSchemaHandle(combinedSchemaId, combinedSchema);\n        }\n    };\n    JSONSchemaService.prototype.getMatchingSchemas = function (document, jsonDocument, schema) {\n        if (schema) {\n            var id = schema.id || ('schemaservice://untitled/matchingSchemas/' + idCounter++);\n            return this.resolveSchemaContent(new UnresolvedSchema(schema), id, {}).then(function (resolvedSchema) {\n                return jsonDocument.getMatchingSchemas(resolvedSchema.schema).filter(function (s) { return !s.inverted; });\n            });\n        }\n        return this.getSchemaForResource(document.uri, jsonDocument).then(function (schema) {\n            if (schema) {\n                return jsonDocument.getMatchingSchemas(schema.schema).filter(function (s) { return !s.inverted; });\n            }\n            return [];\n        });\n    };\n    return JSONSchemaService;\n}());\nexport { JSONSchemaService };\nvar idCounter = 0;\nfunction normalizeId(id) {\n    // remove trailing '#', normalize drive capitalization\n    try {\n        return URI.parse(id).toString();\n    }\n    catch (e) {\n        return id;\n    }\n}\nfunction toDisplayString(url) {\n    try {\n        var uri = URI.parse(url);\n        if (uri.scheme === 'file') {\n            return uri.fsPath;\n        }\n    }\n    catch (e) {\n        // ignore\n    }\n    return url;\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 *--------------------------------------------------------------------------------------------*/\nimport { Range, SelectionRange } from '../jsonLanguageTypes.js';\nimport { createScanner } from '../../jsonc-parser/main.js';\nexport function getSelectionRanges(document, positions, doc) {\n    function getSelectionRange(position) {\n        var offset = document.offsetAt(position);\n        var node = doc.getNodeFromOffset(offset, true);\n        var result = [];\n        while (node) {\n            switch (node.type) {\n                case 'string':\n                case 'object':\n                case 'array':\n                    // range without \", [ or {\n                    var cStart = node.offset + 1, cEnd = node.offset + node.length - 1;\n                    if (cStart < cEnd && offset >= cStart && offset <= cEnd) {\n                        result.push(newRange(cStart, cEnd));\n                    }\n                    result.push(newRange(node.offset, node.offset + node.length));\n                    break;\n                case 'number':\n                case 'boolean':\n                case 'null':\n                case 'property':\n                    result.push(newRange(node.offset, node.offset + node.length));\n                    break;\n            }\n            if (node.type === 'property' || node.parent && node.parent.type === 'array') {\n                var afterCommaOffset = getOffsetAfterNextToken(node.offset + node.length, 5 /* CommaToken */);\n                if (afterCommaOffset !== -1) {\n                    result.push(newRange(node.offset, afterCommaOffset));\n                }\n            }\n            node = node.parent;\n        }\n        var current = undefined;\n        for (var index = result.length - 1; index >= 0; index--) {\n            current = SelectionRange.create(result[index], current);\n        }\n        if (!current) {\n            current = SelectionRange.create(Range.create(position, position));\n        }\n        return current;\n    }\n    function newRange(start, end) {\n        return Range.create(document.positionAt(start), document.positionAt(end));\n    }\n    var scanner = createScanner(document.getText(), true);\n    function getOffsetAfterNextToken(offset, expectedToken) {\n        scanner.setPosition(offset);\n        var token = scanner.scan();\n        if (token === expectedToken) {\n            return scanner.getTokenOffset() + scanner.getTokenLength();\n        }\n        return -1;\n    }\n    return positions.map(getSelectionRange);\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 *--------------------------------------------------------------------------------------------*/\nimport { UnresolvedSchema } from './jsonSchemaService.js';\nimport { ErrorCode, Diagnostic, DiagnosticSeverity, Range } from '../jsonLanguageTypes.js';\nimport * as nls from '../../../fillers/vscode-nls.js';\nimport { isBoolean } from '../utils/objects.js';\nvar localize = nls.loadMessageBundle();\nvar JSONValidation = /** @class */ (function () {\n    function JSONValidation(jsonSchemaService, promiseConstructor) {\n        this.jsonSchemaService = jsonSchemaService;\n        this.promise = promiseConstructor;\n        this.validationEnabled = true;\n    }\n    JSONValidation.prototype.configure = function (raw) {\n        if (raw) {\n            this.validationEnabled = raw.validate;\n            this.commentSeverity = raw.allowComments ? undefined : DiagnosticSeverity.Error;\n        }\n    };\n    JSONValidation.prototype.doValidation = function (textDocument, jsonDocument, documentSettings, schema) {\n        var _this = this;\n        if (!this.validationEnabled) {\n            return this.promise.resolve([]);\n        }\n        var diagnostics = [];\n        var added = {};\n        var addProblem = function (problem) {\n            // remove duplicated messages\n            var signature = problem.range.start.line + ' ' + problem.range.start.character + ' ' + problem.message;\n            if (!added[signature]) {\n                added[signature] = true;\n                diagnostics.push(problem);\n            }\n        };\n        var getDiagnostics = function (schema) {\n            var trailingCommaSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.trailingCommas) : DiagnosticSeverity.Error;\n            var commentSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.comments) : _this.commentSeverity;\n            if (schema) {\n                if (schema.errors.length && jsonDocument.root) {\n                    var astRoot = jsonDocument.root;\n                    var property = astRoot.type === 'object' ? astRoot.properties[0] : undefined;\n                    if (property && property.keyNode.value === '$schema') {\n                        var node = property.valueNode || property;\n                        var range = Range.create(textDocument.positionAt(node.offset), textDocument.positionAt(node.offset + node.length));\n                        addProblem(Diagnostic.create(range, schema.errors[0], DiagnosticSeverity.Warning, ErrorCode.SchemaResolveError));\n                    }\n                    else {\n                        var range = Range.create(textDocument.positionAt(astRoot.offset), textDocument.positionAt(astRoot.offset + 1));\n                        addProblem(Diagnostic.create(range, schema.errors[0], DiagnosticSeverity.Warning, ErrorCode.SchemaResolveError));\n                    }\n                }\n                else {\n                    var semanticErrors = jsonDocument.validate(textDocument, schema.schema);\n                    if (semanticErrors) {\n                        semanticErrors.forEach(addProblem);\n                    }\n                }\n                if (schemaAllowsComments(schema.schema)) {\n                    commentSeverity = undefined;\n                }\n                if (schemaAllowsTrailingCommas(schema.schema)) {\n                    trailingCommaSeverity = undefined;\n                }\n            }\n            for (var _i = 0, _a = jsonDocument.syntaxErrors; _i < _a.length; _i++) {\n                var p = _a[_i];\n                if (p.code === ErrorCode.TrailingComma) {\n                    if (typeof trailingCommaSeverity !== 'number') {\n                        continue;\n                    }\n                    p.severity = trailingCommaSeverity;\n                }\n                addProblem(p);\n            }\n            if (typeof commentSeverity === 'number') {\n                var message_1 = localize('InvalidCommentToken', 'Comments are not permitted in JSON.');\n                jsonDocument.comments.forEach(function (c) {\n                    addProblem(Diagnostic.create(c, message_1, commentSeverity, ErrorCode.CommentNotPermitted));\n                });\n            }\n            return diagnostics;\n        };\n        if (schema) {\n            var id = schema.id || ('schemaservice://untitled/' + idCounter++);\n            return this.jsonSchemaService.resolveSchemaContent(new UnresolvedSchema(schema), id, {}).then(function (resolvedSchema) {\n                return getDiagnostics(resolvedSchema);\n            });\n        }\n        return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(function (schema) {\n            return getDiagnostics(schema);\n        });\n    };\n    return JSONValidation;\n}());\nexport { JSONValidation };\nvar idCounter = 0;\nfunction schemaAllowsComments(schemaRef) {\n    if (schemaRef && typeof schemaRef === 'object') {\n        if (isBoolean(schemaRef.allowComments)) {\n            return schemaRef.allowComments;\n        }\n        if (schemaRef.allOf) {\n            for (var _i = 0, _a = schemaRef.allOf; _i < _a.length; _i++) {\n                var schema = _a[_i];\n                var allow = schemaAllowsComments(schema);\n                if (isBoolean(allow)) {\n                    return allow;\n                }\n            }\n        }\n    }\n    return undefined;\n}\nfunction schemaAllowsTrailingCommas(schemaRef) {\n    if (schemaRef && typeof schemaRef === 'object') {\n        if (isBoolean(schemaRef.allowTrailingCommas)) {\n            return schemaRef.allowTrailingCommas;\n        }\n        var deprSchemaRef = schemaRef;\n        if (isBoolean(deprSchemaRef['allowsTrailingCommas'])) { // deprecated\n            return deprSchemaRef['allowsTrailingCommas'];\n        }\n        if (schemaRef.allOf) {\n            for (var _i = 0, _a = schemaRef.allOf; _i < _a.length; _i++) {\n                var schema = _a[_i];\n                var allow = schemaAllowsTrailingCommas(schema);\n                if (isBoolean(allow)) {\n                    return allow;\n                }\n            }\n        }\n    }\n    return undefined;\n}\nfunction toDiagnosticSeverity(severityLevel) {\n    switch (severityLevel) {\n        case 'error': return DiagnosticSeverity.Error;\n        case 'warning': return DiagnosticSeverity.Warning;\n        case 'ignore': return undefined;\n    }\n    return undefined;\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 *--------------------------------------------------------------------------------------------*/\nvar Digit0 = 48;\nvar Digit9 = 57;\nvar A = 65;\nvar a = 97;\nvar f = 102;\nexport function hexDigit(charCode) {\n    if (charCode < Digit0) {\n        return 0;\n    }\n    if (charCode <= Digit9) {\n        return charCode - Digit0;\n    }\n    if (charCode < a) {\n        charCode += (a - A);\n    }\n    if (charCode >= a && charCode <= f) {\n        return charCode - a + 10;\n    }\n    return 0;\n}\nexport function colorFromHex(text) {\n    if (text[0] !== '#') {\n        return undefined;\n    }\n    switch (text.length) {\n        case 4:\n            return {\n                red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0,\n                green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0,\n                blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0,\n                alpha: 1\n            };\n        case 5:\n            return {\n                red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0,\n                green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0,\n                blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0,\n                alpha: (hexDigit(text.charCodeAt(4)) * 0x11) / 255.0,\n            };\n        case 7:\n            return {\n                red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0,\n                green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0,\n                blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0,\n                alpha: 1\n            };\n        case 9:\n            return {\n                red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0,\n                green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0,\n                blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0,\n                alpha: (hexDigit(text.charCodeAt(7)) * 0x10 + hexDigit(text.charCodeAt(8))) / 255.0\n            };\n    }\n    return undefined;\n}\nexport function colorFrom256RGB(red, green, blue, alpha) {\n    if (alpha === void 0) { alpha = 1.0; }\n    return {\n        red: red / 255.0,\n        green: green / 255.0,\n        blue: blue / 255.0,\n        alpha: alpha\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*--------------------------------------------------------------------------------------------*/\nexport function stringifyObject(obj, indent, stringifyLiteral) {\n    if (obj !== null && typeof obj === 'object') {\n        var newIndent = indent + '\\t';\n        if (Array.isArray(obj)) {\n            if (obj.length === 0) {\n                return '[]';\n            }\n            var result = '[\\n';\n            for (var i = 0; i < obj.length; i++) {\n                result += newIndent + stringifyObject(obj[i], newIndent, stringifyLiteral);\n                if (i < obj.length - 1) {\n                    result += ',';\n                }\n                result += '\\n';\n            }\n            result += indent + ']';\n            return result;\n        }\n        else {\n            var keys = Object.keys(obj);\n            if (keys.length === 0) {\n                return '{}';\n            }\n            var result = '{\\n';\n            for (var i = 0; i < keys.length; i++) {\n                var key = keys[i];\n                result += newIndent + JSON.stringify(key) + ': ' + stringifyObject(obj[key], newIndent, stringifyLiteral);\n                if (i < keys.length - 1) {\n                    result += ',';\n                }\n                result += '\\n';\n            }\n            result += indent + '}';\n            return result;\n        }\n    }\n    return stringifyLiteral(obj);\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*--------------------------------------------------------------------------------------------*/\nexport function equals(one, other) {\n    if (one === other) {\n        return true;\n    }\n    if (one === null || one === undefined || other === null || other === undefined) {\n        return false;\n    }\n    if (typeof one !== typeof other) {\n        return false;\n    }\n    if (typeof one !== 'object') {\n        return false;\n    }\n    if ((Array.isArray(one)) !== (Array.isArray(other))) {\n        return false;\n    }\n    var i, key;\n    if (Array.isArray(one)) {\n        if (one.length !== other.length) {\n            return false;\n        }\n        for (i = 0; i < one.length; i++) {\n            if (!equals(one[i], other[i])) {\n                return false;\n            }\n        }\n    }\n    else {\n        var oneKeys = [];\n        for (key in one) {\n            oneKeys.push(key);\n        }\n        oneKeys.sort();\n        var otherKeys = [];\n        for (key in other) {\n            otherKeys.push(key);\n        }\n        otherKeys.sort();\n        if (!equals(oneKeys, otherKeys)) {\n            return false;\n        }\n        for (i = 0; i < oneKeys.length; i++) {\n            if (!equals(one[oneKeys[i]], other[oneKeys[i]])) {\n                return false;\n            }\n        }\n    }\n    return true;\n}\nexport function isNumber(val) {\n    return typeof val === 'number';\n}\nexport function isDefined(val) {\n    return typeof val !== 'undefined';\n}\nexport function isBoolean(val) {\n    return typeof val === 'boolean';\n}\nexport function isString(val) {\n    return typeof val === 'string';\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*--------------------------------------------------------------------------------------------*/\nexport function startsWith(haystack, needle) {\n    if (haystack.length < needle.length) {\n        return false;\n    }\n    for (var i = 0; i < needle.length; i++) {\n        if (haystack[i] !== needle[i]) {\n            return false;\n        }\n    }\n    return true;\n}\n/**\n * Determines if haystack ends with needle.\n */\nexport function endsWith(haystack, needle) {\n    var diff = haystack.length - needle.length;\n    if (diff > 0) {\n        return haystack.lastIndexOf(needle) === diff;\n    }\n    else if (diff === 0) {\n        return haystack === needle;\n    }\n    else {\n        return false;\n    }\n}\nexport function convertSimple2RegExpPattern(pattern) {\n    return pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, '\\\\$&').replace(/[\\*]/g, '.*');\n}\nexport function repeat(value, count) {\n    var s = '';\n    while (count > 0) {\n        if ((count & 1) === 1) {\n            s += value;\n        }\n        value += value;\n        count = count >>> 1;\n    }\n    return s;\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';\nvar FullTextDocument = /** @class */ (function () {\n    function FullTextDocument(uri, languageId, version, content) {\n        this._uri = uri;\n        this._languageId = languageId;\n        this._version = version;\n        this._content = content;\n        this._lineOffsets = undefined;\n    }\n    Object.defineProperty(FullTextDocument.prototype, \"uri\", {\n        get: function () {\n            return this._uri;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\n        get: function () {\n            return this._languageId;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(FullTextDocument.prototype, \"version\", {\n        get: function () {\n            return this._version;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    FullTextDocument.prototype.getText = function (range) {\n        if (range) {\n            var start = this.offsetAt(range.start);\n            var end = this.offsetAt(range.end);\n            return this._content.substring(start, end);\n        }\n        return this._content;\n    };\n    FullTextDocument.prototype.update = function (changes, version) {\n        for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) {\n            var change = changes_1[_i];\n            if (FullTextDocument.isIncremental(change)) {\n                // makes sure start is before end\n                var range = getWellformedRange(change.range);\n                // update content\n                var startOffset = this.offsetAt(range.start);\n                var endOffset = this.offsetAt(range.end);\n                this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);\n                // update the offsets\n                var startLine = Math.max(range.start.line, 0);\n                var endLine = Math.max(range.end.line, 0);\n                var lineOffsets = this._lineOffsets;\n                var addedLineOffsets = computeLineOffsets(change.text, false, startOffset);\n                if (endLine - startLine === addedLineOffsets.length) {\n                    for (var i = 0, len = addedLineOffsets.length; i < len; i++) {\n                        lineOffsets[i + startLine + 1] = addedLineOffsets[i];\n                    }\n                }\n                else {\n                    if (addedLineOffsets.length < 10000) {\n                        lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets));\n                    }\n                    else { // avoid too many arguments for splice\n                        this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1));\n                    }\n                }\n                var diff = change.text.length - (endOffset - startOffset);\n                if (diff !== 0) {\n                    for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) {\n                        lineOffsets[i] = lineOffsets[i] + diff;\n                    }\n                }\n            }\n            else if (FullTextDocument.isFull(change)) {\n                this._content = change.text;\n                this._lineOffsets = undefined;\n            }\n            else {\n                throw new Error('Unknown change event received');\n            }\n        }\n        this._version = version;\n    };\n    FullTextDocument.prototype.getLineOffsets = function () {\n        if (this._lineOffsets === undefined) {\n            this._lineOffsets = computeLineOffsets(this._content, true);\n        }\n        return this._lineOffsets;\n    };\n    FullTextDocument.prototype.positionAt = function (offset) {\n        offset = Math.max(Math.min(offset, this._content.length), 0);\n        var lineOffsets = this.getLineOffsets();\n        var low = 0, high = lineOffsets.length;\n        if (high === 0) {\n            return { line: 0, character: offset };\n        }\n        while (low < high) {\n            var mid = Math.floor((low + high) / 2);\n            if (lineOffsets[mid] > offset) {\n                high = mid;\n            }\n            else {\n                low = mid + 1;\n            }\n        }\n        // low is the least x for which the line offset is larger than the current offset\n        // or array.length if no line offset is larger than the current offset\n        var line = low - 1;\n        return { line: line, character: offset - lineOffsets[line] };\n    };\n    FullTextDocument.prototype.offsetAt = function (position) {\n        var lineOffsets = this.getLineOffsets();\n        if (position.line >= lineOffsets.length) {\n            return this._content.length;\n        }\n        else if (position.line < 0) {\n            return 0;\n        }\n        var lineOffset = lineOffsets[position.line];\n        var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n        return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n    };\n    Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\n        get: function () {\n            return this.getLineOffsets().length;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    FullTextDocument.isIncremental = function (event) {\n        var candidate = event;\n        return candidate !== undefined && candidate !== null &&\n            typeof candidate.text === 'string' && candidate.range !== undefined &&\n            (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');\n    };\n    FullTextDocument.isFull = function (event) {\n        var candidate = event;\n        return candidate !== undefined && candidate !== null &&\n            typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n    };\n    return FullTextDocument;\n}());\nexport var TextDocument;\n(function (TextDocument) {\n    /**\n     * Creates a new text document.\n     *\n     * @param uri The document's uri.\n     * @param languageId  The document's language Id.\n     * @param version The document's initial version number.\n     * @param content The document's content.\n     */\n    function create(uri, languageId, version, content) {\n        return new FullTextDocument(uri, languageId, version, content);\n    }\n    TextDocument.create = create;\n    /**\n     * Updates a TextDocument by modifing its content.\n     *\n     * @param document the document to update. Only documents created by TextDocument.create are valid inputs.\n     * @param changes the changes to apply to the document.\n     * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter.\n     *\n     */\n    function update(document, changes, version) {\n        if (document instanceof FullTextDocument) {\n            document.update(changes, version);\n            return document;\n        }\n        else {\n            throw new Error('TextDocument.update: document must be created by TextDocument.create');\n        }\n    }\n    TextDocument.update = update;\n    function applyEdits(document, edits) {\n        var text = document.getText();\n        var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) {\n            var diff = a.range.start.line - b.range.start.line;\n            if (diff === 0) {\n                return a.range.start.character - b.range.start.character;\n            }\n            return diff;\n        });\n        var lastModifiedOffset = 0;\n        var spans = [];\n        for (var _i = 0, sortedEdits_1 = sortedEdits; _i < sortedEdits_1.length; _i++) {\n            var e = sortedEdits_1[_i];\n            var startOffset = document.offsetAt(e.range.start);\n            if (startOffset < lastModifiedOffset) {\n                throw new Error('Overlapping edit');\n            }\n            else if (startOffset > lastModifiedOffset) {\n                spans.push(text.substring(lastModifiedOffset, startOffset));\n            }\n            if (e.newText.length) {\n                spans.push(e.newText);\n            }\n            lastModifiedOffset = document.offsetAt(e.range.end);\n        }\n        spans.push(text.substr(lastModifiedOffset));\n        return spans.join('');\n    }\n    TextDocument.applyEdits = applyEdits;\n})(TextDocument || (TextDocument = {}));\nfunction mergeSort(data, compare) {\n    if (data.length <= 1) {\n        // sorted\n        return data;\n    }\n    var p = (data.length / 2) | 0;\n    var left = data.slice(0, p);\n    var right = data.slice(p);\n    mergeSort(left, compare);\n    mergeSort(right, compare);\n    var leftIdx = 0;\n    var rightIdx = 0;\n    var i = 0;\n    while (leftIdx < left.length && rightIdx < right.length) {\n        var ret = compare(left[leftIdx], right[rightIdx]);\n        if (ret <= 0) {\n            // smaller_equal -> take left to preserve order\n            data[i++] = left[leftIdx++];\n        }\n        else {\n            // greater -> take right\n            data[i++] = right[rightIdx++];\n        }\n    }\n    while (leftIdx < left.length) {\n        data[i++] = left[leftIdx++];\n    }\n    while (rightIdx < right.length) {\n        data[i++] = right[rightIdx++];\n    }\n    return data;\n}\nfunction computeLineOffsets(text, isAtLineStart, textOffset) {\n    if (textOffset === void 0) { textOffset = 0; }\n    var result = isAtLineStart ? [textOffset] : [];\n    for (var i = 0; i < text.length; i++) {\n        var ch = text.charCodeAt(i);\n        if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) {\n            if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) {\n                i++;\n            }\n            result.push(textOffset + i + 1);\n        }\n    }\n    return result;\n}\nfunction getWellformedRange(range) {\n    var start = range.start;\n    var end = range.end;\n    if (start.line > end.line || (start.line === end.line && start.character > end.character)) {\n        return { start: end, end: start };\n    }\n    return range;\n}\nfunction getWellformedEdit(textEdit) {\n    var range = getWellformedRange(textEdit.range);\n    if (range !== textEdit.range) {\n        return { newText: textEdit.newText, range: range };\n    }\n    return textEdit;\n}\n","/* --------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n * ------------------------------------------------------------------------------------------ */\r\n'use strict';\r\n/**\r\n * The Position namespace provides helper functions to work with\r\n * [Position](#Position) literals.\r\n */\r\nexport var Position;\r\n(function (Position) {\r\n    /**\r\n     * Creates a new Position literal from the given line and character.\r\n     * @param line The position's line.\r\n     * @param character The position's character.\r\n     */\r\n    function create(line, character) {\r\n        return { line: line, character: character };\r\n    }\r\n    Position.create = create;\r\n    /**\r\n     * Checks whether the given liternal conforms to the [Position](#Position) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);\r\n    }\r\n    Position.is = is;\r\n})(Position || (Position = {}));\r\n/**\r\n * The Range namespace provides helper functions to work with\r\n * [Range](#Range) literals.\r\n */\r\nexport var Range;\r\n(function (Range) {\r\n    function create(one, two, three, four) {\r\n        if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) {\r\n            return { start: Position.create(one, two), end: Position.create(three, four) };\r\n        }\r\n        else if (Position.is(one) && Position.is(two)) {\r\n            return { start: one, end: two };\r\n        }\r\n        else {\r\n            throw new Error(\"Range#create called with invalid arguments[\" + one + \", \" + two + \", \" + three + \", \" + four + \"]\");\r\n        }\r\n    }\r\n    Range.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [Range](#Range) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\r\n    }\r\n    Range.is = is;\r\n})(Range || (Range = {}));\r\n/**\r\n * The Location namespace provides helper functions to work with\r\n * [Location](#Location) literals.\r\n */\r\nexport var Location;\r\n(function (Location) {\r\n    /**\r\n     * Creates a Location literal.\r\n     * @param uri The location's uri.\r\n     * @param range The location's range.\r\n     */\r\n    function create(uri, range) {\r\n        return { uri: uri, range: range };\r\n    }\r\n    Location.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [Location](#Location) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\r\n    }\r\n    Location.is = is;\r\n})(Location || (Location = {}));\r\n/**\r\n * The LocationLink namespace provides helper functions to work with\r\n * [LocationLink](#LocationLink) literals.\r\n */\r\nexport var LocationLink;\r\n(function (LocationLink) {\r\n    /**\r\n     * Creates a LocationLink literal.\r\n     * @param targetUri The definition's uri.\r\n     * @param targetRange The full range of the definition.\r\n     * @param targetSelectionRange The span of the symbol definition at the target.\r\n     * @param originSelectionRange The span of the symbol being defined in the originating source file.\r\n     */\r\n    function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\r\n        return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\r\n    }\r\n    LocationLink.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\r\n            && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))\r\n            && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\r\n    }\r\n    LocationLink.is = is;\r\n})(LocationLink || (LocationLink = {}));\r\n/**\r\n * The Color namespace provides helper functions to work with\r\n * [Color](#Color) literals.\r\n */\r\nexport var Color;\r\n(function (Color) {\r\n    /**\r\n     * Creates a new Color literal.\r\n     */\r\n    function create(red, green, blue, alpha) {\r\n        return {\r\n            red: red,\r\n            green: green,\r\n            blue: blue,\r\n            alpha: alpha,\r\n        };\r\n    }\r\n    Color.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [Color](#Color) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.number(candidate.red)\r\n            && Is.number(candidate.green)\r\n            && Is.number(candidate.blue)\r\n            && Is.number(candidate.alpha);\r\n    }\r\n    Color.is = is;\r\n})(Color || (Color = {}));\r\n/**\r\n * The ColorInformation namespace provides helper functions to work with\r\n * [ColorInformation](#ColorInformation) literals.\r\n */\r\nexport var ColorInformation;\r\n(function (ColorInformation) {\r\n    /**\r\n     * Creates a new ColorInformation literal.\r\n     */\r\n    function create(range, color) {\r\n        return {\r\n            range: range,\r\n            color: color,\r\n        };\r\n    }\r\n    ColorInformation.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Range.is(candidate.range) && Color.is(candidate.color);\r\n    }\r\n    ColorInformation.is = is;\r\n})(ColorInformation || (ColorInformation = {}));\r\n/**\r\n * The Color namespace provides helper functions to work with\r\n * [ColorPresentation](#ColorPresentation) literals.\r\n */\r\nexport var ColorPresentation;\r\n(function (ColorPresentation) {\r\n    /**\r\n     * Creates a new ColorInformation literal.\r\n     */\r\n    function create(label, textEdit, additionalTextEdits) {\r\n        return {\r\n            label: label,\r\n            textEdit: textEdit,\r\n            additionalTextEdits: additionalTextEdits,\r\n        };\r\n    }\r\n    ColorPresentation.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.string(candidate.label)\r\n            && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\r\n            && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\r\n    }\r\n    ColorPresentation.is = is;\r\n})(ColorPresentation || (ColorPresentation = {}));\r\n/**\r\n * Enum of known range kinds\r\n */\r\nexport var FoldingRangeKind;\r\n(function (FoldingRangeKind) {\r\n    /**\r\n     * Folding range for a comment\r\n     */\r\n    FoldingRangeKind[\"Comment\"] = \"comment\";\r\n    /**\r\n     * Folding range for a imports or includes\r\n     */\r\n    FoldingRangeKind[\"Imports\"] = \"imports\";\r\n    /**\r\n     * Folding range for a region (e.g. `#region`)\r\n     */\r\n    FoldingRangeKind[\"Region\"] = \"region\";\r\n})(FoldingRangeKind || (FoldingRangeKind = {}));\r\n/**\r\n * The folding range namespace provides helper functions to work with\r\n * [FoldingRange](#FoldingRange) literals.\r\n */\r\nexport var FoldingRange;\r\n(function (FoldingRange) {\r\n    /**\r\n     * Creates a new FoldingRange literal.\r\n     */\r\n    function create(startLine, endLine, startCharacter, endCharacter, kind) {\r\n        var result = {\r\n            startLine: startLine,\r\n            endLine: endLine\r\n        };\r\n        if (Is.defined(startCharacter)) {\r\n            result.startCharacter = startCharacter;\r\n        }\r\n        if (Is.defined(endCharacter)) {\r\n            result.endCharacter = endCharacter;\r\n        }\r\n        if (Is.defined(kind)) {\r\n            result.kind = kind;\r\n        }\r\n        return result;\r\n    }\r\n    FoldingRange.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.number(candidate.startLine) && Is.number(candidate.startLine)\r\n            && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter))\r\n            && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter))\r\n            && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\r\n    }\r\n    FoldingRange.is = is;\r\n})(FoldingRange || (FoldingRange = {}));\r\n/**\r\n * The DiagnosticRelatedInformation namespace provides helper functions to work with\r\n * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.\r\n */\r\nexport var DiagnosticRelatedInformation;\r\n(function (DiagnosticRelatedInformation) {\r\n    /**\r\n     * Creates a new DiagnosticRelatedInformation literal.\r\n     */\r\n    function create(location, message) {\r\n        return {\r\n            location: location,\r\n            message: message\r\n        };\r\n    }\r\n    DiagnosticRelatedInformation.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\r\n    }\r\n    DiagnosticRelatedInformation.is = is;\r\n})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\r\n/**\r\n * The diagnostic's severity.\r\n */\r\nexport var DiagnosticSeverity;\r\n(function (DiagnosticSeverity) {\r\n    /**\r\n     * Reports an error.\r\n     */\r\n    DiagnosticSeverity.Error = 1;\r\n    /**\r\n     * Reports a warning.\r\n     */\r\n    DiagnosticSeverity.Warning = 2;\r\n    /**\r\n     * Reports an information.\r\n     */\r\n    DiagnosticSeverity.Information = 3;\r\n    /**\r\n     * Reports a hint.\r\n     */\r\n    DiagnosticSeverity.Hint = 4;\r\n})(DiagnosticSeverity || (DiagnosticSeverity = {}));\r\n/**\r\n * The diagnostic tags.\r\n *\r\n * @since 3.15.0\r\n */\r\nexport var DiagnosticTag;\r\n(function (DiagnosticTag) {\r\n    /**\r\n     * Unused or unnecessary code.\r\n     *\r\n     * Clients are allowed to render diagnostics with this tag faded out instead of having\r\n     * an error squiggle.\r\n     */\r\n    DiagnosticTag.Unnecessary = 1;\r\n    /**\r\n     * Deprecated or obsolete code.\r\n     *\r\n     * Clients are allowed to rendered diagnostics with this tag strike through.\r\n     */\r\n    DiagnosticTag.Deprecated = 2;\r\n})(DiagnosticTag || (DiagnosticTag = {}));\r\n/**\r\n * The Diagnostic namespace provides helper functions to work with\r\n * [Diagnostic](#Diagnostic) literals.\r\n */\r\nexport var Diagnostic;\r\n(function (Diagnostic) {\r\n    /**\r\n     * Creates a new Diagnostic literal.\r\n     */\r\n    function create(range, message, severity, code, source, relatedInformation) {\r\n        var result = { range: range, message: message };\r\n        if (Is.defined(severity)) {\r\n            result.severity = severity;\r\n        }\r\n        if (Is.defined(code)) {\r\n            result.code = code;\r\n        }\r\n        if (Is.defined(source)) {\r\n            result.source = source;\r\n        }\r\n        if (Is.defined(relatedInformation)) {\r\n            result.relatedInformation = relatedInformation;\r\n        }\r\n        return result;\r\n    }\r\n    Diagnostic.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate)\r\n            && Range.is(candidate.range)\r\n            && Is.string(candidate.message)\r\n            && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\r\n            && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\r\n            && (Is.string(candidate.source) || Is.undefined(candidate.source))\r\n            && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\r\n    }\r\n    Diagnostic.is = is;\r\n})(Diagnostic || (Diagnostic = {}));\r\n/**\r\n * The Command namespace provides helper functions to work with\r\n * [Command](#Command) literals.\r\n */\r\nexport var Command;\r\n(function (Command) {\r\n    /**\r\n     * Creates a new Command literal.\r\n     */\r\n    function create(title, command) {\r\n        var args = [];\r\n        for (var _i = 2; _i < arguments.length; _i++) {\r\n            args[_i - 2] = arguments[_i];\r\n        }\r\n        var result = { title: title, command: command };\r\n        if (Is.defined(args) && args.length > 0) {\r\n            result.arguments = args;\r\n        }\r\n        return result;\r\n    }\r\n    Command.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [Command](#Command) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\r\n    }\r\n    Command.is = is;\r\n})(Command || (Command = {}));\r\n/**\r\n * The TextEdit namespace provides helper function to create replace,\r\n * insert and delete edits more easily.\r\n */\r\nexport var TextEdit;\r\n(function (TextEdit) {\r\n    /**\r\n     * Creates a replace text edit.\r\n     * @param range The range of text to be replaced.\r\n     * @param newText The new text.\r\n     */\r\n    function replace(range, newText) {\r\n        return { range: range, newText: newText };\r\n    }\r\n    TextEdit.replace = replace;\r\n    /**\r\n     * Creates a insert text edit.\r\n     * @param position The position to insert the text at.\r\n     * @param newText The text to be inserted.\r\n     */\r\n    function insert(position, newText) {\r\n        return { range: { start: position, end: position }, newText: newText };\r\n    }\r\n    TextEdit.insert = insert;\r\n    /**\r\n     * Creates a delete text edit.\r\n     * @param range The range of text to be deleted.\r\n     */\r\n    function del(range) {\r\n        return { range: range, newText: '' };\r\n    }\r\n    TextEdit.del = del;\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.objectLiteral(candidate)\r\n            && Is.string(candidate.newText)\r\n            && Range.is(candidate.range);\r\n    }\r\n    TextEdit.is = is;\r\n})(TextEdit || (TextEdit = {}));\r\n/**\r\n * The TextDocumentEdit namespace provides helper function to create\r\n * an edit that manipulates a text document.\r\n */\r\nexport var TextDocumentEdit;\r\n(function (TextDocumentEdit) {\r\n    /**\r\n     * Creates a new `TextDocumentEdit`\r\n     */\r\n    function create(textDocument, edits) {\r\n        return { textDocument: textDocument, edits: edits };\r\n    }\r\n    TextDocumentEdit.create = create;\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate)\r\n            && VersionedTextDocumentIdentifier.is(candidate.textDocument)\r\n            && Array.isArray(candidate.edits);\r\n    }\r\n    TextDocumentEdit.is = is;\r\n})(TextDocumentEdit || (TextDocumentEdit = {}));\r\nexport var CreateFile;\r\n(function (CreateFile) {\r\n    function create(uri, options) {\r\n        var result = {\r\n            kind: 'create',\r\n            uri: uri\r\n        };\r\n        if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r\n            result.options = options;\r\n        }\r\n        return result;\r\n    }\r\n    CreateFile.create = create;\r\n    function is(value) {\r\n        var candidate = value;\r\n        return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&\r\n            (candidate.options === void 0 ||\r\n                ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r\n    }\r\n    CreateFile.is = is;\r\n})(CreateFile || (CreateFile = {}));\r\nexport var RenameFile;\r\n(function (RenameFile) {\r\n    function create(oldUri, newUri, options) {\r\n        var result = {\r\n            kind: 'rename',\r\n            oldUri: oldUri,\r\n            newUri: newUri\r\n        };\r\n        if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\r\n            result.options = options;\r\n        }\r\n        return result;\r\n    }\r\n    RenameFile.create = create;\r\n    function is(value) {\r\n        var candidate = value;\r\n        return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&\r\n            (candidate.options === void 0 ||\r\n                ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));\r\n    }\r\n    RenameFile.is = is;\r\n})(RenameFile || (RenameFile = {}));\r\nexport var DeleteFile;\r\n(function (DeleteFile) {\r\n    function create(uri, options) {\r\n        var result = {\r\n            kind: 'delete',\r\n            uri: uri\r\n        };\r\n        if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {\r\n            result.options = options;\r\n        }\r\n        return result;\r\n    }\r\n    DeleteFile.create = create;\r\n    function is(value) {\r\n        var candidate = value;\r\n        return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&\r\n            (candidate.options === void 0 ||\r\n                ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));\r\n    }\r\n    DeleteFile.is = is;\r\n})(DeleteFile || (DeleteFile = {}));\r\nexport var WorkspaceEdit;\r\n(function (WorkspaceEdit) {\r\n    function is(value) {\r\n        var candidate = value;\r\n        return candidate &&\r\n            (candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&\r\n            (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {\r\n                if (Is.string(change.kind)) {\r\n                    return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\r\n                }\r\n                else {\r\n                    return TextDocumentEdit.is(change);\r\n                }\r\n            }));\r\n    }\r\n    WorkspaceEdit.is = is;\r\n})(WorkspaceEdit || (WorkspaceEdit = {}));\r\nvar TextEditChangeImpl = /** @class */ (function () {\r\n    function TextEditChangeImpl(edits) {\r\n        this.edits = edits;\r\n    }\r\n    TextEditChangeImpl.prototype.insert = function (position, newText) {\r\n        this.edits.push(TextEdit.insert(position, newText));\r\n    };\r\n    TextEditChangeImpl.prototype.replace = function (range, newText) {\r\n        this.edits.push(TextEdit.replace(range, newText));\r\n    };\r\n    TextEditChangeImpl.prototype.delete = function (range) {\r\n        this.edits.push(TextEdit.del(range));\r\n    };\r\n    TextEditChangeImpl.prototype.add = function (edit) {\r\n        this.edits.push(edit);\r\n    };\r\n    TextEditChangeImpl.prototype.all = function () {\r\n        return this.edits;\r\n    };\r\n    TextEditChangeImpl.prototype.clear = function () {\r\n        this.edits.splice(0, this.edits.length);\r\n    };\r\n    return TextEditChangeImpl;\r\n}());\r\n/**\r\n * A workspace change helps constructing changes to a workspace.\r\n */\r\nvar WorkspaceChange = /** @class */ (function () {\r\n    function WorkspaceChange(workspaceEdit) {\r\n        var _this = this;\r\n        this._textEditChanges = Object.create(null);\r\n        if (workspaceEdit) {\r\n            this._workspaceEdit = workspaceEdit;\r\n            if (workspaceEdit.documentChanges) {\r\n                workspaceEdit.documentChanges.forEach(function (change) {\r\n                    if (TextDocumentEdit.is(change)) {\r\n                        var textEditChange = new TextEditChangeImpl(change.edits);\r\n                        _this._textEditChanges[change.textDocument.uri] = textEditChange;\r\n                    }\r\n                });\r\n            }\r\n            else if (workspaceEdit.changes) {\r\n                Object.keys(workspaceEdit.changes).forEach(function (key) {\r\n                    var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\r\n                    _this._textEditChanges[key] = textEditChange;\r\n                });\r\n            }\r\n        }\r\n    }\r\n    Object.defineProperty(WorkspaceChange.prototype, \"edit\", {\r\n        /**\r\n         * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal\r\n         * use to be returned from a workspace edit operation like rename.\r\n         */\r\n        get: function () {\r\n            return this._workspaceEdit;\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    WorkspaceChange.prototype.getTextEditChange = function (key) {\r\n        if (VersionedTextDocumentIdentifier.is(key)) {\r\n            if (!this._workspaceEdit) {\r\n                this._workspaceEdit = {\r\n                    documentChanges: []\r\n                };\r\n            }\r\n            if (!this._workspaceEdit.documentChanges) {\r\n                throw new Error('Workspace edit is not configured for document changes.');\r\n            }\r\n            var textDocument = key;\r\n            var result = this._textEditChanges[textDocument.uri];\r\n            if (!result) {\r\n                var edits = [];\r\n                var textDocumentEdit = {\r\n                    textDocument: textDocument,\r\n                    edits: edits\r\n                };\r\n                this._workspaceEdit.documentChanges.push(textDocumentEdit);\r\n                result = new TextEditChangeImpl(edits);\r\n                this._textEditChanges[textDocument.uri] = result;\r\n            }\r\n            return result;\r\n        }\r\n        else {\r\n            if (!this._workspaceEdit) {\r\n                this._workspaceEdit = {\r\n                    changes: Object.create(null)\r\n                };\r\n            }\r\n            if (!this._workspaceEdit.changes) {\r\n                throw new Error('Workspace edit is not configured for normal text edit changes.');\r\n            }\r\n            var result = this._textEditChanges[key];\r\n            if (!result) {\r\n                var edits = [];\r\n                this._workspaceEdit.changes[key] = edits;\r\n                result = new TextEditChangeImpl(edits);\r\n                this._textEditChanges[key] = result;\r\n            }\r\n            return result;\r\n        }\r\n    };\r\n    WorkspaceChange.prototype.createFile = function (uri, options) {\r\n        this.checkDocumentChanges();\r\n        this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));\r\n    };\r\n    WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {\r\n        this.checkDocumentChanges();\r\n        this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));\r\n    };\r\n    WorkspaceChange.prototype.deleteFile = function (uri, options) {\r\n        this.checkDocumentChanges();\r\n        this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));\r\n    };\r\n    WorkspaceChange.prototype.checkDocumentChanges = function () {\r\n        if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {\r\n            throw new Error('Workspace edit is not configured for document changes.');\r\n        }\r\n    };\r\n    return WorkspaceChange;\r\n}());\r\nexport { WorkspaceChange };\r\n/**\r\n * The TextDocumentIdentifier namespace provides helper functions to work with\r\n * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.\r\n */\r\nexport var TextDocumentIdentifier;\r\n(function (TextDocumentIdentifier) {\r\n    /**\r\n     * Creates a new TextDocumentIdentifier literal.\r\n     * @param uri The document's uri.\r\n     */\r\n    function create(uri) {\r\n        return { uri: uri };\r\n    }\r\n    TextDocumentIdentifier.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Is.string(candidate.uri);\r\n    }\r\n    TextDocumentIdentifier.is = is;\r\n})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\r\n/**\r\n * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\r\n * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.\r\n */\r\nexport var VersionedTextDocumentIdentifier;\r\n(function (VersionedTextDocumentIdentifier) {\r\n    /**\r\n     * Creates a new VersionedTextDocumentIdentifier literal.\r\n     * @param uri The document's uri.\r\n     * @param uri The document's text.\r\n     */\r\n    function create(uri, version) {\r\n        return { uri: uri, version: version };\r\n    }\r\n    VersionedTextDocumentIdentifier.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));\r\n    }\r\n    VersionedTextDocumentIdentifier.is = is;\r\n})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\r\n/**\r\n * The TextDocumentItem namespace provides helper functions to work with\r\n * [TextDocumentItem](#TextDocumentItem) literals.\r\n */\r\nexport var TextDocumentItem;\r\n(function (TextDocumentItem) {\r\n    /**\r\n     * Creates a new TextDocumentItem literal.\r\n     * @param uri The document's uri.\r\n     * @param languageId The document's language identifier.\r\n     * @param version The document's version number.\r\n     * @param text The document's text.\r\n     */\r\n    function create(uri, languageId, version, text) {\r\n        return { uri: uri, languageId: languageId, version: version, text: text };\r\n    }\r\n    TextDocumentItem.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text);\r\n    }\r\n    TextDocumentItem.is = is;\r\n})(TextDocumentItem || (TextDocumentItem = {}));\r\n/**\r\n * Describes the content type that a client supports in various\r\n * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\r\n *\r\n * Please note that `MarkupKinds` must not start with a `$`. This kinds\r\n * are reserved for internal usage.\r\n */\r\nexport var MarkupKind;\r\n(function (MarkupKind) {\r\n    /**\r\n     * Plain text is supported as a content format\r\n     */\r\n    MarkupKind.PlainText = 'plaintext';\r\n    /**\r\n     * Markdown is supported as a content format\r\n     */\r\n    MarkupKind.Markdown = 'markdown';\r\n})(MarkupKind || (MarkupKind = {}));\r\n(function (MarkupKind) {\r\n    /**\r\n     * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\r\n    }\r\n    MarkupKind.is = is;\r\n})(MarkupKind || (MarkupKind = {}));\r\nexport var MarkupContent;\r\n(function (MarkupContent) {\r\n    /**\r\n     * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n    }\r\n    MarkupContent.is = is;\r\n})(MarkupContent || (MarkupContent = {}));\r\n/**\r\n * The kind of a completion entry.\r\n */\r\nexport var CompletionItemKind;\r\n(function (CompletionItemKind) {\r\n    CompletionItemKind.Text = 1;\r\n    CompletionItemKind.Method = 2;\r\n    CompletionItemKind.Function = 3;\r\n    CompletionItemKind.Constructor = 4;\r\n    CompletionItemKind.Field = 5;\r\n    CompletionItemKind.Variable = 6;\r\n    CompletionItemKind.Class = 7;\r\n    CompletionItemKind.Interface = 8;\r\n    CompletionItemKind.Module = 9;\r\n    CompletionItemKind.Property = 10;\r\n    CompletionItemKind.Unit = 11;\r\n    CompletionItemKind.Value = 12;\r\n    CompletionItemKind.Enum = 13;\r\n    CompletionItemKind.Keyword = 14;\r\n    CompletionItemKind.Snippet = 15;\r\n    CompletionItemKind.Color = 16;\r\n    CompletionItemKind.File = 17;\r\n    CompletionItemKind.Reference = 18;\r\n    CompletionItemKind.Folder = 19;\r\n    CompletionItemKind.EnumMember = 20;\r\n    CompletionItemKind.Constant = 21;\r\n    CompletionItemKind.Struct = 22;\r\n    CompletionItemKind.Event = 23;\r\n    CompletionItemKind.Operator = 24;\r\n    CompletionItemKind.TypeParameter = 25;\r\n})(CompletionItemKind || (CompletionItemKind = {}));\r\n/**\r\n * Defines whether the insert text in a completion item should be interpreted as\r\n * plain text or a snippet.\r\n */\r\nexport var InsertTextFormat;\r\n(function (InsertTextFormat) {\r\n    /**\r\n     * The primary text to be inserted is treated as a plain string.\r\n     */\r\n    InsertTextFormat.PlainText = 1;\r\n    /**\r\n     * The primary text to be inserted is treated as a snippet.\r\n     *\r\n     * A snippet can define tab stops and placeholders with `$1`, `$2`\r\n     * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\r\n     * the end of the snippet. Placeholders with equal identifiers are linked,\r\n     * that is typing in one will update others too.\r\n     *\r\n     * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md\r\n     */\r\n    InsertTextFormat.Snippet = 2;\r\n})(InsertTextFormat || (InsertTextFormat = {}));\r\n/**\r\n * Completion item tags are extra annotations that tweak the rendering of a completion\r\n * item.\r\n *\r\n * @since 3.15.0\r\n */\r\nexport var CompletionItemTag;\r\n(function (CompletionItemTag) {\r\n    /**\r\n     * Render a completion as obsolete, usually using a strike-out.\r\n     */\r\n    CompletionItemTag.Deprecated = 1;\r\n})(CompletionItemTag || (CompletionItemTag = {}));\r\n/**\r\n * The CompletionItem namespace provides functions to deal with\r\n * completion items.\r\n */\r\nexport var CompletionItem;\r\n(function (CompletionItem) {\r\n    /**\r\n     * Create a completion item and seed it with a label.\r\n     * @param label The completion item's label\r\n     */\r\n    function create(label) {\r\n        return { label: label };\r\n    }\r\n    CompletionItem.create = create;\r\n})(CompletionItem || (CompletionItem = {}));\r\n/**\r\n * The CompletionList namespace provides functions to deal with\r\n * completion lists.\r\n */\r\nexport var CompletionList;\r\n(function (CompletionList) {\r\n    /**\r\n     * Creates a new completion list.\r\n     *\r\n     * @param items The completion items.\r\n     * @param isIncomplete The list is not complete.\r\n     */\r\n    function create(items, isIncomplete) {\r\n        return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n    }\r\n    CompletionList.create = create;\r\n})(CompletionList || (CompletionList = {}));\r\nexport var MarkedString;\r\n(function (MarkedString) {\r\n    /**\r\n     * Creates a marked string from plain text.\r\n     *\r\n     * @param plainText The plain text.\r\n     */\r\n    function fromPlainText(plainText) {\r\n        return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\r\n    }\r\n    MarkedString.fromPlainText = fromPlainText;\r\n    /**\r\n     * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r\n    }\r\n    MarkedString.is = is;\r\n})(MarkedString || (MarkedString = {}));\r\nexport var Hover;\r\n(function (Hover) {\r\n    /**\r\n     * Checks whether the given value conforms to the [Hover](#Hover) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\r\n            MarkedString.is(candidate.contents) ||\r\n            Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));\r\n    }\r\n    Hover.is = is;\r\n})(Hover || (Hover = {}));\r\n/**\r\n * The ParameterInformation namespace provides helper functions to work with\r\n * [ParameterInformation](#ParameterInformation) literals.\r\n */\r\nexport var ParameterInformation;\r\n(function (ParameterInformation) {\r\n    /**\r\n     * Creates a new parameter information literal.\r\n     *\r\n     * @param label A label string.\r\n     * @param documentation A doc string.\r\n     */\r\n    function create(label, documentation) {\r\n        return documentation ? { label: label, documentation: documentation } : { label: label };\r\n    }\r\n    ParameterInformation.create = create;\r\n})(ParameterInformation || (ParameterInformation = {}));\r\n/**\r\n * The SignatureInformation namespace provides helper functions to work with\r\n * [SignatureInformation](#SignatureInformation) literals.\r\n */\r\nexport var SignatureInformation;\r\n(function (SignatureInformation) {\r\n    function create(label, documentation) {\r\n        var parameters = [];\r\n        for (var _i = 2; _i < arguments.length; _i++) {\r\n            parameters[_i - 2] = arguments[_i];\r\n        }\r\n        var result = { label: label };\r\n        if (Is.defined(documentation)) {\r\n            result.documentation = documentation;\r\n        }\r\n        if (Is.defined(parameters)) {\r\n            result.parameters = parameters;\r\n        }\r\n        else {\r\n            result.parameters = [];\r\n        }\r\n        return result;\r\n    }\r\n    SignatureInformation.create = create;\r\n})(SignatureInformation || (SignatureInformation = {}));\r\n/**\r\n * A document highlight kind.\r\n */\r\nexport var DocumentHighlightKind;\r\n(function (DocumentHighlightKind) {\r\n    /**\r\n     * A textual occurrence.\r\n     */\r\n    DocumentHighlightKind.Text = 1;\r\n    /**\r\n     * Read-access of a symbol, like reading a variable.\r\n     */\r\n    DocumentHighlightKind.Read = 2;\r\n    /**\r\n     * Write-access of a symbol, like writing to a variable.\r\n     */\r\n    DocumentHighlightKind.Write = 3;\r\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\r\n/**\r\n * DocumentHighlight namespace to provide helper functions to work with\r\n * [DocumentHighlight](#DocumentHighlight) literals.\r\n */\r\nexport var DocumentHighlight;\r\n(function (DocumentHighlight) {\r\n    /**\r\n     * Create a DocumentHighlight object.\r\n     * @param range The range the highlight applies to.\r\n     */\r\n    function create(range, kind) {\r\n        var result = { range: range };\r\n        if (Is.number(kind)) {\r\n            result.kind = kind;\r\n        }\r\n        return result;\r\n    }\r\n    DocumentHighlight.create = create;\r\n})(DocumentHighlight || (DocumentHighlight = {}));\r\n/**\r\n * A symbol kind.\r\n */\r\nexport var SymbolKind;\r\n(function (SymbolKind) {\r\n    SymbolKind.File = 1;\r\n    SymbolKind.Module = 2;\r\n    SymbolKind.Namespace = 3;\r\n    SymbolKind.Package = 4;\r\n    SymbolKind.Class = 5;\r\n    SymbolKind.Method = 6;\r\n    SymbolKind.Property = 7;\r\n    SymbolKind.Field = 8;\r\n    SymbolKind.Constructor = 9;\r\n    SymbolKind.Enum = 10;\r\n    SymbolKind.Interface = 11;\r\n    SymbolKind.Function = 12;\r\n    SymbolKind.Variable = 13;\r\n    SymbolKind.Constant = 14;\r\n    SymbolKind.String = 15;\r\n    SymbolKind.Number = 16;\r\n    SymbolKind.Boolean = 17;\r\n    SymbolKind.Array = 18;\r\n    SymbolKind.Object = 19;\r\n    SymbolKind.Key = 20;\r\n    SymbolKind.Null = 21;\r\n    SymbolKind.EnumMember = 22;\r\n    SymbolKind.Struct = 23;\r\n    SymbolKind.Event = 24;\r\n    SymbolKind.Operator = 25;\r\n    SymbolKind.TypeParameter = 26;\r\n})(SymbolKind || (SymbolKind = {}));\r\n/**\r\n * Symbol tags are extra annotations that tweak the rendering of a symbol.\r\n * @since 3.15\r\n */\r\nexport var SymbolTag;\r\n(function (SymbolTag) {\r\n    /**\r\n     * Render a symbol as obsolete, usually using a strike-out.\r\n     */\r\n    SymbolTag.Deprecated = 1;\r\n})(SymbolTag || (SymbolTag = {}));\r\nexport var SymbolInformation;\r\n(function (SymbolInformation) {\r\n    /**\r\n     * Creates a new symbol information literal.\r\n     *\r\n     * @param name The name of the symbol.\r\n     * @param kind The kind of the symbol.\r\n     * @param range The range of the location of the symbol.\r\n     * @param uri The resource of the location of symbol, defaults to the current document.\r\n     * @param containerName The name of the symbol containing the symbol.\r\n     */\r\n    function create(name, kind, range, uri, containerName) {\r\n        var result = {\r\n            name: name,\r\n            kind: kind,\r\n            location: { uri: uri, range: range }\r\n        };\r\n        if (containerName) {\r\n            result.containerName = containerName;\r\n        }\r\n        return result;\r\n    }\r\n    SymbolInformation.create = create;\r\n})(SymbolInformation || (SymbolInformation = {}));\r\nexport var DocumentSymbol;\r\n(function (DocumentSymbol) {\r\n    /**\r\n     * Creates a new symbol information literal.\r\n     *\r\n     * @param name The name of the symbol.\r\n     * @param detail The detail of the symbol.\r\n     * @param kind The kind of the symbol.\r\n     * @param range The range of the symbol.\r\n     * @param selectionRange The selectionRange of the symbol.\r\n     * @param children Children of the symbol.\r\n     */\r\n    function create(name, detail, kind, range, selectionRange, children) {\r\n        var result = {\r\n            name: name,\r\n            detail: detail,\r\n            kind: kind,\r\n            range: range,\r\n            selectionRange: selectionRange\r\n        };\r\n        if (children !== void 0) {\r\n            result.children = children;\r\n        }\r\n        return result;\r\n    }\r\n    DocumentSymbol.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return candidate &&\r\n            Is.string(candidate.name) && Is.number(candidate.kind) &&\r\n            Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\r\n            (candidate.detail === void 0 || Is.string(candidate.detail)) &&\r\n            (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) &&\r\n            (candidate.children === void 0 || Array.isArray(candidate.children));\r\n    }\r\n    DocumentSymbol.is = is;\r\n})(DocumentSymbol || (DocumentSymbol = {}));\r\n/**\r\n * A set of predefined code action kinds\r\n */\r\nexport var CodeActionKind;\r\n(function (CodeActionKind) {\r\n    /**\r\n     * Empty kind.\r\n     */\r\n    CodeActionKind.Empty = '';\r\n    /**\r\n     * Base kind for quickfix actions: 'quickfix'\r\n     */\r\n    CodeActionKind.QuickFix = 'quickfix';\r\n    /**\r\n     * Base kind for refactoring actions: 'refactor'\r\n     */\r\n    CodeActionKind.Refactor = 'refactor';\r\n    /**\r\n     * Base kind for refactoring extraction actions: 'refactor.extract'\r\n     *\r\n     * Example extract actions:\r\n     *\r\n     * - Extract method\r\n     * - Extract function\r\n     * - Extract variable\r\n     * - Extract interface from class\r\n     * - ...\r\n     */\r\n    CodeActionKind.RefactorExtract = 'refactor.extract';\r\n    /**\r\n     * Base kind for refactoring inline actions: 'refactor.inline'\r\n     *\r\n     * Example inline actions:\r\n     *\r\n     * - Inline function\r\n     * - Inline variable\r\n     * - Inline constant\r\n     * - ...\r\n     */\r\n    CodeActionKind.RefactorInline = 'refactor.inline';\r\n    /**\r\n     * Base kind for refactoring rewrite actions: 'refactor.rewrite'\r\n     *\r\n     * Example rewrite actions:\r\n     *\r\n     * - Convert JavaScript function to class\r\n     * - Add or remove parameter\r\n     * - Encapsulate field\r\n     * - Make method static\r\n     * - Move method to base class\r\n     * - ...\r\n     */\r\n    CodeActionKind.RefactorRewrite = 'refactor.rewrite';\r\n    /**\r\n     * Base kind for source actions: `source`\r\n     *\r\n     * Source code actions apply to the entire file.\r\n     */\r\n    CodeActionKind.Source = 'source';\r\n    /**\r\n     * Base kind for an organize imports source action: `source.organizeImports`\r\n     */\r\n    CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\r\n    /**\r\n     * Base kind for auto-fix source actions: `source.fixAll`.\r\n     *\r\n     * Fix all actions automatically fix errors that have a clear fix that do not require user input.\r\n     * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\r\n     *\r\n     * @since 3.15.0\r\n     */\r\n    CodeActionKind.SourceFixAll = 'source.fixAll';\r\n})(CodeActionKind || (CodeActionKind = {}));\r\n/**\r\n * The CodeActionContext namespace provides helper functions to work with\r\n * [CodeActionContext](#CodeActionContext) literals.\r\n */\r\nexport var CodeActionContext;\r\n(function (CodeActionContext) {\r\n    /**\r\n     * Creates a new CodeActionContext literal.\r\n     */\r\n    function create(diagnostics, only) {\r\n        var result = { diagnostics: diagnostics };\r\n        if (only !== void 0 && only !== null) {\r\n            result.only = only;\r\n        }\r\n        return result;\r\n    }\r\n    CodeActionContext.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n    }\r\n    CodeActionContext.is = is;\r\n})(CodeActionContext || (CodeActionContext = {}));\r\nexport var CodeAction;\r\n(function (CodeAction) {\r\n    function create(title, commandOrEdit, kind) {\r\n        var result = { title: title };\r\n        if (Command.is(commandOrEdit)) {\r\n            result.command = commandOrEdit;\r\n        }\r\n        else {\r\n            result.edit = commandOrEdit;\r\n        }\r\n        if (kind !== void 0) {\r\n            result.kind = kind;\r\n        }\r\n        return result;\r\n    }\r\n    CodeAction.create = create;\r\n    function is(value) {\r\n        var candidate = value;\r\n        return candidate && Is.string(candidate.title) &&\r\n            (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\r\n            (candidate.kind === void 0 || Is.string(candidate.kind)) &&\r\n            (candidate.edit !== void 0 || candidate.command !== void 0) &&\r\n            (candidate.command === void 0 || Command.is(candidate.command)) &&\r\n            (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) &&\r\n            (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));\r\n    }\r\n    CodeAction.is = is;\r\n})(CodeAction || (CodeAction = {}));\r\n/**\r\n * The CodeLens namespace provides helper functions to work with\r\n * [CodeLens](#CodeLens) literals.\r\n */\r\nexport var CodeLens;\r\n(function (CodeLens) {\r\n    /**\r\n     * Creates a new CodeLens literal.\r\n     */\r\n    function create(range, data) {\r\n        var result = { range: range };\r\n        if (Is.defined(data)) {\r\n            result.data = data;\r\n        }\r\n        return result;\r\n    }\r\n    CodeLens.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\r\n    }\r\n    CodeLens.is = is;\r\n})(CodeLens || (CodeLens = {}));\r\n/**\r\n * The FormattingOptions namespace provides helper functions to work with\r\n * [FormattingOptions](#FormattingOptions) literals.\r\n */\r\nexport var FormattingOptions;\r\n(function (FormattingOptions) {\r\n    /**\r\n     * Creates a new FormattingOptions literal.\r\n     */\r\n    function create(tabSize, insertSpaces) {\r\n        return { tabSize: tabSize, insertSpaces: insertSpaces };\r\n    }\r\n    FormattingOptions.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\r\n    }\r\n    FormattingOptions.is = is;\r\n})(FormattingOptions || (FormattingOptions = {}));\r\n/**\r\n * The DocumentLink namespace provides helper functions to work with\r\n * [DocumentLink](#DocumentLink) literals.\r\n */\r\nexport var DocumentLink;\r\n(function (DocumentLink) {\r\n    /**\r\n     * Creates a new DocumentLink literal.\r\n     */\r\n    function create(range, target, data) {\r\n        return { range: range, target: target, data: data };\r\n    }\r\n    DocumentLink.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\r\n    }\r\n    DocumentLink.is = is;\r\n})(DocumentLink || (DocumentLink = {}));\r\n/**\r\n * The SelectionRange namespace provides helper function to work with\r\n * SelectionRange literals.\r\n */\r\nexport var SelectionRange;\r\n(function (SelectionRange) {\r\n    /**\r\n     * Creates a new SelectionRange\r\n     * @param range the range.\r\n     * @param parent an optional parent.\r\n     */\r\n    function create(range, parent) {\r\n        return { range: range, parent: parent };\r\n    }\r\n    SelectionRange.create = create;\r\n    function is(value) {\r\n        var candidate = value;\r\n        return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\r\n    }\r\n    SelectionRange.is = is;\r\n})(SelectionRange || (SelectionRange = {}));\r\nexport var EOL = ['\\n', '\\r\\n', '\\r'];\r\n/**\r\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\r\n */\r\nexport var TextDocument;\r\n(function (TextDocument) {\r\n    /**\r\n     * Creates a new ITextDocument literal from the given uri and content.\r\n     * @param uri The document's uri.\r\n     * @param languageId  The document's language Id.\r\n     * @param content The document's content.\r\n     */\r\n    function create(uri, languageId, version, content) {\r\n        return new FullTextDocument(uri, languageId, version, content);\r\n    }\r\n    TextDocument.create = create;\r\n    /**\r\n     * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.\r\n     */\r\n    function is(value) {\r\n        var candidate = value;\r\n        return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount)\r\n            && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\r\n    }\r\n    TextDocument.is = is;\r\n    function applyEdits(document, edits) {\r\n        var text = document.getText();\r\n        var sortedEdits = mergeSort(edits, function (a, b) {\r\n            var diff = a.range.start.line - b.range.start.line;\r\n            if (diff === 0) {\r\n                return a.range.start.character - b.range.start.character;\r\n            }\r\n            return diff;\r\n        });\r\n        var lastModifiedOffset = text.length;\r\n        for (var i = sortedEdits.length - 1; i >= 0; i--) {\r\n            var e = sortedEdits[i];\r\n            var startOffset = document.offsetAt(e.range.start);\r\n            var endOffset = document.offsetAt(e.range.end);\r\n            if (endOffset <= lastModifiedOffset) {\r\n                text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\r\n            }\r\n            else {\r\n                throw new Error('Overlapping edit');\r\n            }\r\n            lastModifiedOffset = startOffset;\r\n        }\r\n        return text;\r\n    }\r\n    TextDocument.applyEdits = applyEdits;\r\n    function mergeSort(data, compare) {\r\n        if (data.length <= 1) {\r\n            // sorted\r\n            return data;\r\n        }\r\n        var p = (data.length / 2) | 0;\r\n        var left = data.slice(0, p);\r\n        var right = data.slice(p);\r\n        mergeSort(left, compare);\r\n        mergeSort(right, compare);\r\n        var leftIdx = 0;\r\n        var rightIdx = 0;\r\n        var i = 0;\r\n        while (leftIdx < left.length && rightIdx < right.length) {\r\n            var ret = compare(left[leftIdx], right[rightIdx]);\r\n            if (ret <= 0) {\r\n                // smaller_equal -> take left to preserve order\r\n                data[i++] = left[leftIdx++];\r\n            }\r\n            else {\r\n                // greater -> take right\r\n                data[i++] = right[rightIdx++];\r\n            }\r\n        }\r\n        while (leftIdx < left.length) {\r\n            data[i++] = left[leftIdx++];\r\n        }\r\n        while (rightIdx < right.length) {\r\n            data[i++] = right[rightIdx++];\r\n        }\r\n        return data;\r\n    }\r\n})(TextDocument || (TextDocument = {}));\r\nvar FullTextDocument = /** @class */ (function () {\r\n    function FullTextDocument(uri, languageId, version, content) {\r\n        this._uri = uri;\r\n        this._languageId = languageId;\r\n        this._version = version;\r\n        this._content = content;\r\n        this._lineOffsets = undefined;\r\n    }\r\n    Object.defineProperty(FullTextDocument.prototype, \"uri\", {\r\n        get: function () {\r\n            return this._uri;\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\r\n        get: function () {\r\n            return this._languageId;\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    Object.defineProperty(FullTextDocument.prototype, \"version\", {\r\n        get: function () {\r\n            return this._version;\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    FullTextDocument.prototype.getText = function (range) {\r\n        if (range) {\r\n            var start = this.offsetAt(range.start);\r\n            var end = this.offsetAt(range.end);\r\n            return this._content.substring(start, end);\r\n        }\r\n        return this._content;\r\n    };\r\n    FullTextDocument.prototype.update = function (event, version) {\r\n        this._content = event.text;\r\n        this._version = version;\r\n        this._lineOffsets = undefined;\r\n    };\r\n    FullTextDocument.prototype.getLineOffsets = function () {\r\n        if (this._lineOffsets === undefined) {\r\n            var lineOffsets = [];\r\n            var text = this._content;\r\n            var isLineStart = true;\r\n            for (var i = 0; i < text.length; i++) {\r\n                if (isLineStart) {\r\n                    lineOffsets.push(i);\r\n                    isLineStart = false;\r\n                }\r\n                var ch = text.charAt(i);\r\n                isLineStart = (ch === '\\r' || ch === '\\n');\r\n                if (ch === '\\r' && i + 1 < text.length && text.charAt(i + 1) === '\\n') {\r\n                    i++;\r\n                }\r\n            }\r\n            if (isLineStart && text.length > 0) {\r\n                lineOffsets.push(text.length);\r\n            }\r\n            this._lineOffsets = lineOffsets;\r\n        }\r\n        return this._lineOffsets;\r\n    };\r\n    FullTextDocument.prototype.positionAt = function (offset) {\r\n        offset = Math.max(Math.min(offset, this._content.length), 0);\r\n        var lineOffsets = this.getLineOffsets();\r\n        var low = 0, high = lineOffsets.length;\r\n        if (high === 0) {\r\n            return Position.create(0, offset);\r\n        }\r\n        while (low < high) {\r\n            var mid = Math.floor((low + high) / 2);\r\n            if (lineOffsets[mid] > offset) {\r\n                high = mid;\r\n            }\r\n            else {\r\n                low = mid + 1;\r\n            }\r\n        }\r\n        // low is the least x for which the line offset is larger than the current offset\r\n        // or array.length if no line offset is larger than the current offset\r\n        var line = low - 1;\r\n        return Position.create(line, offset - lineOffsets[line]);\r\n    };\r\n    FullTextDocument.prototype.offsetAt = function (position) {\r\n        var lineOffsets = this.getLineOffsets();\r\n        if (position.line >= lineOffsets.length) {\r\n            return this._content.length;\r\n        }\r\n        else if (position.line < 0) {\r\n            return 0;\r\n        }\r\n        var lineOffset = lineOffsets[position.line];\r\n        var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\r\n        return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\r\n    };\r\n    Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\r\n        get: function () {\r\n            return this.getLineOffsets().length;\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    return FullTextDocument;\r\n}());\r\nvar Is;\r\n(function (Is) {\r\n    var toString = Object.prototype.toString;\r\n    function defined(value) {\r\n        return typeof value !== 'undefined';\r\n    }\r\n    Is.defined = defined;\r\n    function undefined(value) {\r\n        return typeof value === 'undefined';\r\n    }\r\n    Is.undefined = undefined;\r\n    function boolean(value) {\r\n        return value === true || value === false;\r\n    }\r\n    Is.boolean = boolean;\r\n    function string(value) {\r\n        return toString.call(value) === '[object String]';\r\n    }\r\n    Is.string = string;\r\n    function number(value) {\r\n        return toString.call(value) === '[object Number]';\r\n    }\r\n    Is.number = number;\r\n    function func(value) {\r\n        return toString.call(value) === '[object Function]';\r\n    }\r\n    Is.func = func;\r\n    function objectLiteral(value) {\r\n        // Strictly speaking class instances pass this check as well. Since the LSP\r\n        // doesn't use classes we ignore this for now. If we do we need to add something\r\n        // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\r\n        return value !== null && typeof value === 'object';\r\n    }\r\n    Is.objectLiteral = objectLiteral;\r\n    function typedArray(value, check) {\r\n        return Array.isArray(value) && value.every(check);\r\n    }\r\n    Is.typedArray = typedArray;\r\n})(Is || (Is = {}));\r\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';\nvar __extends = (this && this.__extends) || (function () {\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    return function (d, b) {\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nvar _a;\nvar isWindows;\nif (typeof process === 'object') {\n    isWindows = process.platform === 'win32';\n}\nelse if (typeof navigator === 'object') {\n    var userAgent = navigator.userAgent;\n    isWindows = userAgent.indexOf('Windows') >= 0;\n}\nfunction isHighSurrogate(charCode) {\n    return (0xD800 <= charCode && charCode <= 0xDBFF);\n}\nfunction isLowSurrogate(charCode) {\n    return (0xDC00 <= charCode && charCode <= 0xDFFF);\n}\nfunction isLowerAsciiHex(code) {\n    return code >= 97 /* a */ && code <= 102 /* f */;\n}\nfunction isLowerAsciiLetter(code) {\n    return code >= 97 /* a */ && code <= 122 /* z */;\n}\nfunction isUpperAsciiLetter(code) {\n    return code >= 65 /* A */ && code <= 90 /* Z */;\n}\nfunction isAsciiLetter(code) {\n    return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);\n}\n//#endregion\nvar _schemePattern = /^\\w[\\w\\d+.-]*$/;\nvar _singleSlashStart = /^\\//;\nvar _doubleSlashStart = /^\\/\\//;\nfunction _validateUri(ret, _strict) {\n    // scheme, must be set\n    if (!ret.scheme && _strict) {\n        throw new Error(\"[UriError]: Scheme is missing: {scheme: \\\"\\\", authority: \\\"\" + ret.authority + \"\\\", path: \\\"\" + ret.path + \"\\\", query: \\\"\" + ret.query + \"\\\", fragment: \\\"\" + ret.fragment + \"\\\"}\");\n    }\n    // scheme, https://tools.ietf.org/html/rfc3986#section-3.1\n    // ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n    if (ret.scheme && !_schemePattern.test(ret.scheme)) {\n        throw new Error('[UriError]: Scheme contains illegal characters.');\n    }\n    // path, http://tools.ietf.org/html/rfc3986#section-3.3\n    // If a URI contains an authority component, then the path component\n    // must either be empty or begin with a slash (\"/\") character.  If a URI\n    // does not contain an authority component, then the path cannot begin\n    // with two slash characters (\"//\").\n    if (ret.path) {\n        if (ret.authority) {\n            if (!_singleSlashStart.test(ret.path)) {\n                throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\n            }\n        }\n        else {\n            if (_doubleSlashStart.test(ret.path)) {\n                throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\n            }\n        }\n    }\n}\n// for a while we allowed uris *without* schemes and this is the migration\n// for them, e.g. an uri without scheme and without strict-mode warns and falls\n// back to the file-scheme. that should cause the least carnage and still be a\n// clear warning\nfunction _schemeFix(scheme, _strict) {\n    if (!scheme && !_strict) {\n        return 'file';\n    }\n    return scheme;\n}\n// implements a bit of https://tools.ietf.org/html/rfc3986#section-5\nfunction _referenceResolution(scheme, path) {\n    // the slash-character is our 'default base' as we don't\n    // support constructing URIs relative to other URIs. This\n    // also means that we alter and potentially break paths.\n    // see https://tools.ietf.org/html/rfc3986#section-5.1.4\n    switch (scheme) {\n        case 'https':\n        case 'http':\n        case 'file':\n            if (!path) {\n                path = _slash;\n            }\n            else if (path[0] !== _slash) {\n                path = _slash + path;\n            }\n            break;\n    }\n    return path;\n}\nvar _empty = '';\nvar _slash = '/';\nvar _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\n/**\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\n * This class is a simple parser which creates the basic component parts\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\n * and encoding.\n *\n * ```txt\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 */\nvar URI = /** @class */ (function () {\n    /**\n     * @internal\n     */\n    function URI(schemeOrData, authority, path, query, fragment, _strict) {\n        if (_strict === void 0) { _strict = false; }\n        if (typeof schemeOrData === 'object') {\n            this.scheme = schemeOrData.scheme || _empty;\n            this.authority = schemeOrData.authority || _empty;\n            this.path = schemeOrData.path || _empty;\n            this.query = schemeOrData.query || _empty;\n            this.fragment = schemeOrData.fragment || _empty;\n            // no validation because it's this URI\n            // that creates uri components.\n            // _validateUri(this);\n        }\n        else {\n            this.scheme = _schemeFix(schemeOrData, _strict);\n            this.authority = authority || _empty;\n            this.path = _referenceResolution(this.scheme, path || _empty);\n            this.query = query || _empty;\n            this.fragment = fragment || _empty;\n            _validateUri(this, _strict);\n        }\n    }\n    URI.isUri = function (thing) {\n        if (thing instanceof URI) {\n            return true;\n        }\n        if (!thing) {\n            return false;\n        }\n        return typeof thing.authority === 'string'\n            && typeof thing.fragment === 'string'\n            && typeof thing.path === 'string'\n            && typeof thing.query === 'string'\n            && typeof thing.scheme === 'string'\n            && typeof thing.fsPath === 'function'\n            && typeof thing.with === 'function'\n            && typeof thing.toString === 'function';\n    };\n    Object.defineProperty(URI.prototype, \"fsPath\", {\n        // ---- filesystem path -----------------------\n        /**\n         * Returns a string representing the corresponding file system path of this URI.\n         * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the\n         * platform specific path separator.\n         *\n         * * Will *not* validate the path for invalid characters and semantics.\n         * * Will *not* look at the scheme of this URI.\n         * * The result shall *not* be used for display purposes but for accessing a file on disk.\n         *\n         *\n         * The *difference* to `URI#path` is the use of the platform specific separator and the handling\n         * of UNC paths. See the below sample of a file-uri with an authority (UNC path).\n         *\n         * ```ts\n            const u = URI.parse('file://server/c$/folder/file.txt')\n            u.authority === 'server'\n            u.path === '/shares/c$/file.txt'\n            u.fsPath === '\\\\server\\c$\\folder\\file.txt'\n        ```\n         *\n         * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,\n         * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working\n         * with URIs that represent files on disk (`file` scheme).\n         */\n        get: function () {\n            // if (this.scheme !== 'file') {\n            // \tconsole.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);\n            // }\n            return uriToFsPath(this, false);\n        },\n        enumerable: true,\n        configurable: true\n    });\n    // ---- modify to new -------------------------\n    URI.prototype.with = function (change) {\n        if (!change) {\n            return this;\n        }\n        var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;\n        if (scheme === undefined) {\n            scheme = this.scheme;\n        }\n        else if (scheme === null) {\n            scheme = _empty;\n        }\n        if (authority === undefined) {\n            authority = this.authority;\n        }\n        else if (authority === null) {\n            authority = _empty;\n        }\n        if (path === undefined) {\n            path = this.path;\n        }\n        else if (path === null) {\n            path = _empty;\n        }\n        if (query === undefined) {\n            query = this.query;\n        }\n        else if (query === null) {\n            query = _empty;\n        }\n        if (fragment === undefined) {\n            fragment = this.fragment;\n        }\n        else if (fragment === null) {\n            fragment = _empty;\n        }\n        if (scheme === this.scheme\n            && authority === this.authority\n            && path === this.path\n            && query === this.query\n            && fragment === this.fragment) {\n            return this;\n        }\n        return new _URI(scheme, authority, path, query, fragment);\n    };\n    // ---- parse & validate ------------------------\n    /**\n     * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,\n     * `file:///usr/home`, or `scheme:with/path`.\n     *\n     * @param value A string which represents an URI (see `URI#toString`).\n     */\n    URI.parse = function (value, _strict) {\n        if (_strict === void 0) { _strict = false; }\n        var match = _regexp.exec(value);\n        if (!match) {\n            return new _URI(_empty, _empty, _empty, _empty, _empty);\n        }\n        return new _URI(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);\n    };\n    /**\n     * Creates a new URI from a file system path, e.g. `c:\\my\\files`,\n     * `/usr/home`, or `\\\\server\\share\\some\\path`.\n     *\n     * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument\n     * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**\n     * `URI.parse('file://' + path)` because the path might contain characters that are\n     * interpreted (# and ?). See the following sample:\n     * ```ts\n    const good = URI.file('/coding/c#/project1');\n    good.scheme === 'file';\n    good.path === '/coding/c#/project1';\n    good.fragment === '';\n    const bad = URI.parse('file://' + '/coding/c#/project1');\n    bad.scheme === 'file';\n    bad.path === '/coding/c'; // path is now broken\n    bad.fragment === '/project1';\n    ```\n     *\n     * @param path A file system path (see `URI#fsPath`)\n     */\n    URI.file = function (path) {\n        var authority = _empty;\n        // normalize to fwd-slashes on windows,\n        // on other systems bwd-slashes are valid\n        // filename character, eg /f\\oo/ba\\r.txt\n        if (isWindows) {\n            path = path.replace(/\\\\/g, _slash);\n        }\n        // check for authority as used in UNC shares\n        // or use the path as given\n        if (path[0] === _slash && path[1] === _slash) {\n            var idx = path.indexOf(_slash, 2);\n            if (idx === -1) {\n                authority = path.substring(2);\n                path = _slash;\n            }\n            else {\n                authority = path.substring(2, idx);\n                path = path.substring(idx) || _slash;\n            }\n        }\n        return new _URI('file', authority, path, _empty, _empty);\n    };\n    URI.from = function (components) {\n        return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);\n    };\n    // /**\n    //  * Join a URI path with path fragments and normalizes the resulting path.\n    //  *\n    //  * @param uri The input URI.\n    //  * @param pathFragment The path fragment to add to the URI path.\n    //  * @returns The resulting URI.\n    //  */\n    // static joinPath(uri: URI, ...pathFragment: string[]): URI {\n    // \tif (!uri.path) {\n    // \t\tthrow new Error(`[UriError]: cannot call joinPaths on URI without path`);\n    // \t}\n    // \tlet newPath: string;\n    // \tif (isWindows && uri.scheme === 'file') {\n    // \t\tnewPath = URI.file(paths.win32.join(uriToFsPath(uri, true), ...pathFragment)).path;\n    // \t} else {\n    // \t\tnewPath = paths.posix.join(uri.path, ...pathFragment);\n    // \t}\n    // \treturn uri.with({ path: newPath });\n    // }\n    // ---- printing/externalize ---------------------------\n    /**\n     * Creates a string representation for this URI. It's guaranteed that calling\n     * `URI.parse` with the result of this function creates an URI which is equal\n     * to this URI.\n     *\n     * * The result shall *not* be used for display purposes but for externalization or transport.\n     * * The result will be encoded using the percentage encoding and encoding happens mostly\n     * ignore the scheme-specific encoding rules.\n     *\n     * @param skipEncoding Do not encode the result, default is `false`\n     */\n    URI.prototype.toString = function (skipEncoding) {\n        if (skipEncoding === void 0) { skipEncoding = false; }\n        return _asFormatted(this, skipEncoding);\n    };\n    URI.prototype.toJSON = function () {\n        return this;\n    };\n    URI.revive = function (data) {\n        if (!data) {\n            return data;\n        }\n        else if (data instanceof URI) {\n            return data;\n        }\n        else {\n            var result = new _URI(data);\n            result._formatted = data.external;\n            result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;\n            return result;\n        }\n    };\n    return URI;\n}());\nexport { URI };\nvar _pathSepMarker = isWindows ? 1 : undefined;\n// eslint-disable-next-line @typescript-eslint/class-name-casing\nvar _URI = /** @class */ (function (_super) {\n    __extends(_URI, _super);\n    function _URI() {\n        var _this = _super !== null && _super.apply(this, arguments) || this;\n        _this._formatted = null;\n        _this._fsPath = null;\n        return _this;\n    }\n    Object.defineProperty(_URI.prototype, \"fsPath\", {\n        get: function () {\n            if (!this._fsPath) {\n                this._fsPath = uriToFsPath(this, false);\n            }\n            return this._fsPath;\n        },\n        enumerable: true,\n        configurable: true\n    });\n    _URI.prototype.toString = function (skipEncoding) {\n        if (skipEncoding === void 0) { skipEncoding = false; }\n        if (!skipEncoding) {\n            if (!this._formatted) {\n                this._formatted = _asFormatted(this, false);\n            }\n            return this._formatted;\n        }\n        else {\n            // we don't cache that\n            return _asFormatted(this, true);\n        }\n    };\n    _URI.prototype.toJSON = function () {\n        var res = {\n            $mid: 1\n        };\n        // cached state\n        if (this._fsPath) {\n            res.fsPath = this._fsPath;\n            res._sep = _pathSepMarker;\n        }\n        if (this._formatted) {\n            res.external = this._formatted;\n        }\n        // uri components\n        if (this.path) {\n            res.path = this.path;\n        }\n        if (this.scheme) {\n            res.scheme = this.scheme;\n        }\n        if (this.authority) {\n            res.authority = this.authority;\n        }\n        if (this.query) {\n            res.query = this.query;\n        }\n        if (this.fragment) {\n            res.fragment = this.fragment;\n        }\n        return res;\n    };\n    return _URI;\n}(URI));\n// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2\nvar encodeTable = (_a = {},\n    _a[58 /* Colon */] = '%3A',\n    _a[47 /* Slash */] = '%2F',\n    _a[63 /* QuestionMark */] = '%3F',\n    _a[35 /* Hash */] = '%23',\n    _a[91 /* OpenSquareBracket */] = '%5B',\n    _a[93 /* CloseSquareBracket */] = '%5D',\n    _a[64 /* AtSign */] = '%40',\n    _a[33 /* ExclamationMark */] = '%21',\n    _a[36 /* DollarSign */] = '%24',\n    _a[38 /* Ampersand */] = '%26',\n    _a[39 /* SingleQuote */] = '%27',\n    _a[40 /* OpenParen */] = '%28',\n    _a[41 /* CloseParen */] = '%29',\n    _a[42 /* Asterisk */] = '%2A',\n    _a[43 /* Plus */] = '%2B',\n    _a[44 /* Comma */] = '%2C',\n    _a[59 /* Semicolon */] = '%3B',\n    _a[61 /* Equals */] = '%3D',\n    _a[32 /* Space */] = '%20',\n    _a);\nfunction encodeURIComponentFast(uriComponent, allowSlash) {\n    var res = undefined;\n    var nativeEncodePos = -1;\n    for (var pos = 0; pos < uriComponent.length; pos++) {\n        var code = uriComponent.charCodeAt(pos);\n        // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3\n        if ((code >= 97 /* a */ && code <= 122 /* z */)\n            || (code >= 65 /* A */ && code <= 90 /* Z */)\n            || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */)\n            || code === 45 /* Dash */\n            || code === 46 /* Period */\n            || code === 95 /* Underline */\n            || code === 126 /* Tilde */\n            || (allowSlash && code === 47 /* Slash */)) {\n            // check if we are delaying native encode\n            if (nativeEncodePos !== -1) {\n                res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n                nativeEncodePos = -1;\n            }\n            // check if we write into a new string (by default we try to return the param)\n            if (res !== undefined) {\n                res += uriComponent.charAt(pos);\n            }\n        }\n        else {\n            // encoding needed, we need to allocate a new string\n            if (res === undefined) {\n                res = uriComponent.substr(0, pos);\n            }\n            // check with default table first\n            var escaped = encodeTable[code];\n            if (escaped !== undefined) {\n                // check if we are delaying native encode\n                if (nativeEncodePos !== -1) {\n                    res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n                    nativeEncodePos = -1;\n                }\n                // append escaped variant to result\n                res += escaped;\n            }\n            else if (nativeEncodePos === -1) {\n                // use native encode only when needed\n                nativeEncodePos = pos;\n            }\n        }\n    }\n    if (nativeEncodePos !== -1) {\n        res += encodeURIComponent(uriComponent.substring(nativeEncodePos));\n    }\n    return res !== undefined ? res : uriComponent;\n}\nfunction encodeURIComponentMinimal(path) {\n    var res = undefined;\n    for (var pos = 0; pos < path.length; pos++) {\n        var code = path.charCodeAt(pos);\n        if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) {\n            if (res === undefined) {\n                res = path.substr(0, pos);\n            }\n            res += encodeTable[code];\n        }\n        else {\n            if (res !== undefined) {\n                res += path[pos];\n            }\n        }\n    }\n    return res !== undefined ? res : path;\n}\n/**\n * Compute `fsPath` for the given uri\n */\nexport function uriToFsPath(uri, keepDriveLetterCasing) {\n    var value;\n    if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n        // unc path: file://shares/c$/far/boo\n        value = \"//\" + uri.authority + uri.path;\n    }\n    else if (uri.path.charCodeAt(0) === 47 /* Slash */\n        && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)\n        && uri.path.charCodeAt(2) === 58 /* Colon */) {\n        if (!keepDriveLetterCasing) {\n            // windows drive letter: file:///c:/far/boo\n            value = uri.path[1].toLowerCase() + uri.path.substr(2);\n        }\n        else {\n            value = uri.path.substr(1);\n        }\n    }\n    else {\n        // other path\n        value = uri.path;\n    }\n    if (isWindows) {\n        value = value.replace(/\\//g, '\\\\');\n    }\n    return value;\n}\n/**\n * Create the external version of a uri\n */\nfunction _asFormatted(uri, skipEncoding) {\n    var encoder = !skipEncoding\n        ? encodeURIComponentFast\n        : encodeURIComponentMinimal;\n    var res = '';\n    var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;\n    if (scheme) {\n        res += scheme;\n        res += ':';\n    }\n    if (authority || scheme === 'file') {\n        res += _slash;\n        res += _slash;\n    }\n    if (authority) {\n        var idx = authority.indexOf('@');\n        if (idx !== -1) {\n            // <user>@<auth>\n            var userinfo = authority.substr(0, idx);\n            authority = authority.substr(idx + 1);\n            idx = userinfo.indexOf(':');\n            if (idx === -1) {\n                res += encoder(userinfo, false);\n            }\n            else {\n                // <user>:<pass>@<auth>\n                res += encoder(userinfo.substr(0, idx), false);\n                res += ':';\n                res += encoder(userinfo.substr(idx + 1), false);\n            }\n            res += '@';\n        }\n        authority = authority.toLowerCase();\n        idx = authority.indexOf(':');\n        if (idx === -1) {\n            res += encoder(authority, false);\n        }\n        else {\n            // <auth>:<port>\n            res += encoder(authority.substr(0, idx), false);\n            res += authority.substr(idx);\n        }\n    }\n    if (path) {\n        // lower-case windows drive letters in /C:/fff or C:/fff\n        if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) {\n            var code = path.charCodeAt(1);\n            if (code >= 65 /* A */ && code <= 90 /* Z */) {\n                path = \"/\" + String.fromCharCode(code + 32) + \":\" + path.substr(3); // \"/c:\".length === 3\n            }\n        }\n        else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) {\n            var code = path.charCodeAt(0);\n            if (code >= 65 /* A */ && code <= 90 /* Z */) {\n                path = String.fromCharCode(code + 32) + \":\" + path.substr(2); // \"/c:\".length === 3\n            }\n        }\n        // encode the rest of the path\n        res += encoder(path, true);\n    }\n    if (query) {\n        res += '?';\n        res += encoder(query, false);\n    }\n    if (fragment) {\n        res += '#';\n        res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;\n    }\n    return res;\n}\n// --- decode\nfunction decodeURIComponentGraceful(str) {\n    try {\n        return decodeURIComponent(str);\n    }\n    catch (_a) {\n        if (str.length > 3) {\n            return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));\n        }\n        else {\n            return str;\n        }\n    }\n}\nvar _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;\nfunction percentDecode(str) {\n    if (!str.match(_rEncodedAsHex)) {\n        return str;\n    }\n    return str.replace(_rEncodedAsHex, function (match) { return decodeURIComponentGraceful(match); });\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 *--------------------------------------------------------------------------------------------*/\nfunction format(message, args) {\n    var result;\n    if (args.length === 0) {\n        result = message;\n    }\n    else {\n        result = message.replace(/\\{(\\d+)\\}/g, function (match, rest) {\n            var index = rest[0];\n            return typeof args[index] !== 'undefined' ? args[index] : match;\n        });\n    }\n    return result;\n}\nfunction localize(key, message) {\n    var args = [];\n    for (var _i = 2; _i < arguments.length; _i++) {\n        args[_i - 2] = arguments[_i];\n    }\n    return format(message, args);\n}\nexport function loadMessageBundle(file) {\n    return localize;\n}\nexport function config(opt) {\n    return loadMessageBundle;\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 *--------------------------------------------------------------------------------------------*/\nimport { WorkerManager } from './workerManager.js';\nimport * as languageFeatures from './languageFeatures.js';\nimport { createTokenizationSupport } from './tokenization.js';\nimport { languages } from './fillers/monaco-editor-core.js';\nexport function setupMode(defaults) {\n    var disposables = [];\n    var providers = [];\n    var client = new WorkerManager(defaults);\n    disposables.push(client);\n    var worker = function () {\n        var uris = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            uris[_i] = arguments[_i];\n        }\n        return client.getLanguageServiceWorker.apply(client, uris);\n    };\n    function registerProviders() {\n        var languageId = defaults.languageId, modeConfiguration = defaults.modeConfiguration;\n        disposeAll(providers);\n        if (modeConfiguration.documentFormattingEdits) {\n            providers.push(languages.registerDocumentFormattingEditProvider(languageId, new languageFeatures.DocumentFormattingEditProvider(worker)));\n        }\n        if (modeConfiguration.documentRangeFormattingEdits) {\n            providers.push(languages.registerDocumentRangeFormattingEditProvider(languageId, new languageFeatures.DocumentRangeFormattingEditProvider(worker)));\n        }\n        if (modeConfiguration.completionItems) {\n            providers.push(languages.registerCompletionItemProvider(languageId, new languageFeatures.CompletionAdapter(worker)));\n        }\n        if (modeConfiguration.hovers) {\n            providers.push(languages.registerHoverProvider(languageId, new languageFeatures.HoverAdapter(worker)));\n        }\n        if (modeConfiguration.documentSymbols) {\n            providers.push(languages.registerDocumentSymbolProvider(languageId, new languageFeatures.DocumentSymbolAdapter(worker)));\n        }\n        if (modeConfiguration.tokens) {\n            providers.push(languages.setTokensProvider(languageId, createTokenizationSupport(true)));\n        }\n        if (modeConfiguration.colors) {\n            providers.push(languages.registerColorProvider(languageId, new languageFeatures.DocumentColorAdapter(worker)));\n        }\n        if (modeConfiguration.foldingRanges) {\n            providers.push(languages.registerFoldingRangeProvider(languageId, new languageFeatures.FoldingRangeAdapter(worker)));\n        }\n        if (modeConfiguration.diagnostics) {\n            providers.push(new languageFeatures.DiagnosticsAdapter(languageId, worker, defaults));\n        }\n        if (modeConfiguration.selectionRanges) {\n            providers.push(languages.registerSelectionRangeProvider(languageId, new languageFeatures.SelectionRangeAdapter(worker)));\n        }\n    }\n    registerProviders();\n    disposables.push(languages.setLanguageConfiguration(defaults.languageId, richEditConfiguration));\n    var modeConfiguration = defaults.modeConfiguration;\n    defaults.onDidChange(function (newDefaults) {\n        if (newDefaults.modeConfiguration !== modeConfiguration) {\n            modeConfiguration = newDefaults.modeConfiguration;\n            registerProviders();\n        }\n    });\n    disposables.push(asDisposable(providers));\n    return asDisposable(disposables);\n}\nfunction asDisposable(disposables) {\n    return { dispose: function () { return disposeAll(disposables); } };\n}\nfunction disposeAll(disposables) {\n    while (disposables.length) {\n        disposables.pop().dispose();\n    }\n}\nvar richEditConfiguration = {\n    wordPattern: /(-?\\d*\\.\\d\\w*)|([^\\[\\{\\]\\}\\:\\\"\\,\\s]+)/g,\n    comments: {\n        lineComment: '//',\n        blockComment: ['/*', '*/']\n    },\n    brackets: [\n        ['{', '}'],\n        ['[', ']']\n    ],\n    autoClosingPairs: [\n        { open: '{', close: '}', notIn: ['string'] },\n        { open: '[', close: ']', notIn: ['string'] },\n        { open: '\"', close: '\"', notIn: ['string'] }\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 *--------------------------------------------------------------------------------------------*/\nimport { Uri, Range, editor, languages, MarkerSeverity } from './fillers/monaco-editor-core.js';\nimport * as jsonService from './_deps/vscode-json-languageservice/jsonLanguageService.js';\n// --- diagnostics --- ---\nvar DiagnosticsAdapter = /** @class */ (function () {\n    function DiagnosticsAdapter(_languageId, _worker, defaults) {\n        var _this = this;\n        this._languageId = _languageId;\n        this._worker = _worker;\n        this._disposables = [];\n        this._listener = Object.create(null);\n        var onModelAdd = function (model) {\n            var modeId = model.getModeId();\n            if (modeId !== _this._languageId) {\n                return;\n            }\n            var handle;\n            _this._listener[model.uri.toString()] = model.onDidChangeContent(function () {\n                clearTimeout(handle);\n                handle = setTimeout(function () { return _this._doValidate(model.uri, modeId); }, 500);\n            });\n            _this._doValidate(model.uri, modeId);\n        };\n        var onModelRemoved = function (model) {\n            editor.setModelMarkers(model, _this._languageId, []);\n            var uriStr = model.uri.toString();\n            var listener = _this._listener[uriStr];\n            if (listener) {\n                listener.dispose();\n                delete _this._listener[uriStr];\n            }\n        };\n        this._disposables.push(editor.onDidCreateModel(onModelAdd));\n        this._disposables.push(editor.onWillDisposeModel(function (model) {\n            onModelRemoved(model);\n            _this._resetSchema(model.uri);\n        }));\n        this._disposables.push(editor.onDidChangeModelLanguage(function (event) {\n            onModelRemoved(event.model);\n            onModelAdd(event.model);\n            _this._resetSchema(event.model.uri);\n        }));\n        this._disposables.push(defaults.onDidChange(function (_) {\n            editor.getModels().forEach(function (model) {\n                if (model.getModeId() === _this._languageId) {\n                    onModelRemoved(model);\n                    onModelAdd(model);\n                }\n            });\n        }));\n        this._disposables.push({\n            dispose: function () {\n                editor.getModels().forEach(onModelRemoved);\n                for (var key in _this._listener) {\n                    _this._listener[key].dispose();\n                }\n            }\n        });\n        editor.getModels().forEach(onModelAdd);\n    }\n    DiagnosticsAdapter.prototype.dispose = function () {\n        this._disposables.forEach(function (d) { return d && d.dispose(); });\n        this._disposables = [];\n    };\n    DiagnosticsAdapter.prototype._resetSchema = function (resource) {\n        this._worker().then(function (worker) {\n            worker.resetSchema(resource.toString());\n        });\n    };\n    DiagnosticsAdapter.prototype._doValidate = function (resource, languageId) {\n        this._worker(resource)\n            .then(function (worker) {\n            return worker.doValidation(resource.toString()).then(function (diagnostics) {\n                var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); });\n                var model = editor.getModel(resource);\n                if (model && model.getModeId() === languageId) {\n                    editor.setModelMarkers(model, languageId, markers);\n                }\n            });\n        })\n            .then(undefined, function (err) {\n            console.error(err);\n        });\n    };\n    return DiagnosticsAdapter;\n}());\nexport { DiagnosticsAdapter };\nfunction toSeverity(lsSeverity) {\n    switch (lsSeverity) {\n        case jsonService.DiagnosticSeverity.Error:\n            return MarkerSeverity.Error;\n        case jsonService.DiagnosticSeverity.Warning:\n            return MarkerSeverity.Warning;\n        case jsonService.DiagnosticSeverity.Information:\n            return MarkerSeverity.Info;\n        case jsonService.DiagnosticSeverity.Hint:\n            return MarkerSeverity.Hint;\n        default:\n            return MarkerSeverity.Info;\n    }\n}\nfunction toDiagnostics(resource, diag) {\n    var code = typeof diag.code === 'number' ? String(diag.code) : diag.code;\n    return {\n        severity: toSeverity(diag.severity),\n        startLineNumber: diag.range.start.line + 1,\n        startColumn: diag.range.start.character + 1,\n        endLineNumber: diag.range.end.line + 1,\n        endColumn: diag.range.end.character + 1,\n        message: diag.message,\n        code: code,\n        source: diag.source\n    };\n}\n// --- completion ------\nfunction fromPosition(position) {\n    if (!position) {\n        return void 0;\n    }\n    return { character: position.column - 1, line: position.lineNumber - 1 };\n}\nfunction fromRange(range) {\n    if (!range) {\n        return void 0;\n    }\n    return {\n        start: {\n            line: range.startLineNumber - 1,\n            character: range.startColumn - 1\n        },\n        end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }\n    };\n}\nfunction toRange(range) {\n    if (!range) {\n        return void 0;\n    }\n    return new Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);\n}\nfunction isInsertReplaceEdit(edit) {\n    return (typeof edit.insert !== 'undefined' &&\n        typeof edit.replace !== 'undefined');\n}\nfunction toCompletionItemKind(kind) {\n    var mItemKind = languages.CompletionItemKind;\n    switch (kind) {\n        case jsonService.CompletionItemKind.Text:\n            return mItemKind.Text;\n        case jsonService.CompletionItemKind.Method:\n            return mItemKind.Method;\n        case jsonService.CompletionItemKind.Function:\n            return mItemKind.Function;\n        case jsonService.CompletionItemKind.Constructor:\n            return mItemKind.Constructor;\n        case jsonService.CompletionItemKind.Field:\n            return mItemKind.Field;\n        case jsonService.CompletionItemKind.Variable:\n            return mItemKind.Variable;\n        case jsonService.CompletionItemKind.Class:\n            return mItemKind.Class;\n        case jsonService.CompletionItemKind.Interface:\n            return mItemKind.Interface;\n        case jsonService.CompletionItemKind.Module:\n            return mItemKind.Module;\n        case jsonService.CompletionItemKind.Property:\n            return mItemKind.Property;\n        case jsonService.CompletionItemKind.Unit:\n            return mItemKind.Unit;\n        case jsonService.CompletionItemKind.Value:\n            return mItemKind.Value;\n        case jsonService.CompletionItemKind.Enum:\n            return mItemKind.Enum;\n        case jsonService.CompletionItemKind.Keyword:\n            return mItemKind.Keyword;\n        case jsonService.CompletionItemKind.Snippet:\n            return mItemKind.Snippet;\n        case jsonService.CompletionItemKind.Color:\n            return mItemKind.Color;\n        case jsonService.CompletionItemKind.File:\n            return mItemKind.File;\n        case jsonService.CompletionItemKind.Reference:\n            return mItemKind.Reference;\n    }\n    return mItemKind.Property;\n}\nfunction fromCompletionItemKind(kind) {\n    var mItemKind = languages.CompletionItemKind;\n    switch (kind) {\n        case mItemKind.Text:\n            return jsonService.CompletionItemKind.Text;\n        case mItemKind.Method:\n            return jsonService.CompletionItemKind.Method;\n        case mItemKind.Function:\n            return jsonService.CompletionItemKind.Function;\n        case mItemKind.Constructor:\n            return jsonService.CompletionItemKind.Constructor;\n        case mItemKind.Field:\n            return jsonService.CompletionItemKind.Field;\n        case mItemKind.Variable:\n            return jsonService.CompletionItemKind.Variable;\n        case mItemKind.Class:\n            return jsonService.CompletionItemKind.Class;\n        case mItemKind.Interface:\n            return jsonService.CompletionItemKind.Interface;\n        case mItemKind.Module:\n            return jsonService.CompletionItemKind.Module;\n        case mItemKind.Property:\n            return jsonService.CompletionItemKind.Property;\n        case mItemKind.Unit:\n            return jsonService.CompletionItemKind.Unit;\n        case mItemKind.Value:\n            return jsonService.CompletionItemKind.Value;\n        case mItemKind.Enum:\n            return jsonService.CompletionItemKind.Enum;\n        case mItemKind.Keyword:\n            return jsonService.CompletionItemKind.Keyword;\n        case mItemKind.Snippet:\n            return jsonService.CompletionItemKind.Snippet;\n        case mItemKind.Color:\n            return jsonService.CompletionItemKind.Color;\n        case mItemKind.File:\n            return jsonService.CompletionItemKind.File;\n        case mItemKind.Reference:\n            return jsonService.CompletionItemKind.Reference;\n    }\n    return jsonService.CompletionItemKind.Property;\n}\nfunction toTextEdit(textEdit) {\n    if (!textEdit) {\n        return void 0;\n    }\n    return {\n        range: toRange(textEdit.range),\n        text: textEdit.newText\n    };\n}\nvar CompletionAdapter = /** @class */ (function () {\n    function CompletionAdapter(_worker) {\n        this._worker = _worker;\n    }\n    Object.defineProperty(CompletionAdapter.prototype, \"triggerCharacters\", {\n        get: function () {\n            return [' ', ':'];\n        },\n        enumerable: false,\n        configurable: true\n    });\n    CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) {\n        var resource = model.uri;\n        return this._worker(resource)\n            .then(function (worker) {\n            return worker.doComplete(resource.toString(), fromPosition(position));\n        })\n            .then(function (info) {\n            if (!info) {\n                return;\n            }\n            var wordInfo = model.getWordUntilPosition(position);\n            var wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);\n            var items = info.items.map(function (entry) {\n                var item = {\n                    label: entry.label,\n                    insertText: entry.insertText || entry.label,\n                    sortText: entry.sortText,\n                    filterText: entry.filterText,\n                    documentation: entry.documentation,\n                    detail: entry.detail,\n                    range: wordRange,\n                    kind: toCompletionItemKind(entry.kind)\n                };\n                if (entry.textEdit) {\n                    if (isInsertReplaceEdit(entry.textEdit)) {\n                        item.range = {\n                            insert: toRange(entry.textEdit.insert),\n                            replace: toRange(entry.textEdit.replace)\n                        };\n                    }\n                    else {\n                        item.range = toRange(entry.textEdit.range);\n                    }\n                    item.insertText = entry.textEdit.newText;\n                }\n                if (entry.additionalTextEdits) {\n                    item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);\n                }\n                if (entry.insertTextFormat === jsonService.InsertTextFormat.Snippet) {\n                    item.insertTextRules = languages.CompletionItemInsertTextRule.InsertAsSnippet;\n                }\n                return item;\n            });\n            return {\n                isIncomplete: info.isIncomplete,\n                suggestions: items\n            };\n        });\n    };\n    return CompletionAdapter;\n}());\nexport { CompletionAdapter };\nfunction isMarkupContent(thing) {\n    return (thing &&\n        typeof thing === 'object' &&\n        typeof thing.kind === 'string');\n}\nfunction toMarkdownString(entry) {\n    if (typeof entry === 'string') {\n        return {\n            value: entry\n        };\n    }\n    if (isMarkupContent(entry)) {\n        if (entry.kind === 'plaintext') {\n            return {\n                value: entry.value.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&')\n            };\n        }\n        return {\n            value: entry.value\n        };\n    }\n    return { value: '```' + entry.language + '\\n' + entry.value + '\\n```\\n' };\n}\nfunction toMarkedStringArray(contents) {\n    if (!contents) {\n        return void 0;\n    }\n    if (Array.isArray(contents)) {\n        return contents.map(toMarkdownString);\n    }\n    return [toMarkdownString(contents)];\n}\n// --- hover ------\nvar HoverAdapter = /** @class */ (function () {\n    function HoverAdapter(_worker) {\n        this._worker = _worker;\n    }\n    HoverAdapter.prototype.provideHover = function (model, position, token) {\n        var resource = model.uri;\n        return this._worker(resource)\n            .then(function (worker) {\n            return worker.doHover(resource.toString(), fromPosition(position));\n        })\n            .then(function (info) {\n            if (!info) {\n                return;\n            }\n            return {\n                range: toRange(info.range),\n                contents: toMarkedStringArray(info.contents)\n            };\n        });\n    };\n    return HoverAdapter;\n}());\nexport { HoverAdapter };\n// --- definition ------\nfunction toLocation(location) {\n    return {\n        uri: Uri.parse(location.uri),\n        range: toRange(location.range)\n    };\n}\n// --- document symbols ------\nfunction toSymbolKind(kind) {\n    var mKind = languages.SymbolKind;\n    switch (kind) {\n        case jsonService.SymbolKind.File:\n            return mKind.Array;\n        case jsonService.SymbolKind.Module:\n            return mKind.Module;\n        case jsonService.SymbolKind.Namespace:\n            return mKind.Namespace;\n        case jsonService.SymbolKind.Package:\n            return mKind.Package;\n        case jsonService.SymbolKind.Class:\n            return mKind.Class;\n        case jsonService.SymbolKind.Method:\n            return mKind.Method;\n        case jsonService.SymbolKind.Property:\n            return mKind.Property;\n        case jsonService.SymbolKind.Field:\n            return mKind.Field;\n        case jsonService.SymbolKind.Constructor:\n            return mKind.Constructor;\n        case jsonService.SymbolKind.Enum:\n            return mKind.Enum;\n        case jsonService.SymbolKind.Interface:\n            return mKind.Interface;\n        case jsonService.SymbolKind.Function:\n            return mKind.Function;\n        case jsonService.SymbolKind.Variable:\n            return mKind.Variable;\n        case jsonService.SymbolKind.Constant:\n            return mKind.Constant;\n        case jsonService.SymbolKind.String:\n            return mKind.String;\n        case jsonService.SymbolKind.Number:\n            return mKind.Number;\n        case jsonService.SymbolKind.Boolean:\n            return mKind.Boolean;\n        case jsonService.SymbolKind.Array:\n            return mKind.Array;\n    }\n    return mKind.Function;\n}\nvar DocumentSymbolAdapter = /** @class */ (function () {\n    function DocumentSymbolAdapter(_worker) {\n        this._worker = _worker;\n    }\n    DocumentSymbolAdapter.prototype.provideDocumentSymbols = function (model, token) {\n        var resource = model.uri;\n        return this._worker(resource)\n            .then(function (worker) { return worker.findDocumentSymbols(resource.toString()); })\n            .then(function (items) {\n            if (!items) {\n                return;\n            }\n            return items.map(function (item) { return ({\n                name: item.name,\n                detail: '',\n                containerName: item.containerName,\n                kind: toSymbolKind(item.kind),\n                range: toRange(item.location.range),\n                selectionRange: toRange(item.location.range),\n                tags: []\n            }); });\n        });\n    };\n    return DocumentSymbolAdapter;\n}());\nexport { DocumentSymbolAdapter };\nfunction fromFormattingOptions(options) {\n    return {\n        tabSize: options.tabSize,\n        insertSpaces: options.insertSpaces\n    };\n}\nvar DocumentFormattingEditProvider = /** @class */ (function () {\n    function DocumentFormattingEditProvider(_worker) {\n        this._worker = _worker;\n    }\n    DocumentFormattingEditProvider.prototype.provideDocumentFormattingEdits = function (model, options, token) {\n        var resource = model.uri;\n        return this._worker(resource).then(function (worker) {\n            return worker\n                .format(resource.toString(), null, fromFormattingOptions(options))\n                .then(function (edits) {\n                if (!edits || edits.length === 0) {\n                    return;\n                }\n                return edits.map(toTextEdit);\n            });\n        });\n    };\n    return DocumentFormattingEditProvider;\n}());\nexport { DocumentFormattingEditProvider };\nvar DocumentRangeFormattingEditProvider = /** @class */ (function () {\n    function DocumentRangeFormattingEditProvider(_worker) {\n        this._worker = _worker;\n    }\n    DocumentRangeFormattingEditProvider.prototype.provideDocumentRangeFormattingEdits = function (model, range, options, token) {\n        var resource = model.uri;\n        return this._worker(resource).then(function (worker) {\n            return worker\n                .format(resource.toString(), fromRange(range), fromFormattingOptions(options))\n                .then(function (edits) {\n                if (!edits || edits.length === 0) {\n                    return;\n                }\n                return edits.map(toTextEdit);\n            });\n        });\n    };\n    return DocumentRangeFormattingEditProvider;\n}());\nexport { DocumentRangeFormattingEditProvider };\nvar DocumentColorAdapter = /** @class */ (function () {\n    function DocumentColorAdapter(_worker) {\n        this._worker = _worker;\n    }\n    DocumentColorAdapter.prototype.provideDocumentColors = function (model, token) {\n        var resource = model.uri;\n        return this._worker(resource)\n            .then(function (worker) { return worker.findDocumentColors(resource.toString()); })\n            .then(function (infos) {\n            if (!infos) {\n                return;\n            }\n            return infos.map(function (item) { return ({\n                color: item.color,\n                range: toRange(item.range)\n            }); });\n        });\n    };\n    DocumentColorAdapter.prototype.provideColorPresentations = function (model, info, token) {\n        var resource = model.uri;\n        return this._worker(resource)\n            .then(function (worker) {\n            return worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range));\n        })\n            .then(function (presentations) {\n            if (!presentations) {\n                return;\n            }\n            return presentations.map(function (presentation) {\n                var item = {\n                    label: presentation.label\n                };\n                if (presentation.textEdit) {\n                    item.textEdit = toTextEdit(presentation.textEdit);\n                }\n                if (presentation.additionalTextEdits) {\n                    item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit);\n                }\n                return item;\n            });\n        });\n    };\n    return DocumentColorAdapter;\n}());\nexport { DocumentColorAdapter };\nvar FoldingRangeAdapter = /** @class */ (function () {\n    function FoldingRangeAdapter(_worker) {\n        this._worker = _worker;\n    }\n    FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) {\n        var resource = model.uri;\n        return this._worker(resource)\n            .then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); })\n            .then(function (ranges) {\n            if (!ranges) {\n                return;\n            }\n            return ranges.map(function (range) {\n                var result = {\n                    start: range.startLine + 1,\n                    end: range.endLine + 1\n                };\n                if (typeof range.kind !== 'undefined') {\n                    result.kind = toFoldingRangeKind(range.kind);\n                }\n                return result;\n            });\n        });\n    };\n    return FoldingRangeAdapter;\n}());\nexport { FoldingRangeAdapter };\nfunction toFoldingRangeKind(kind) {\n    switch (kind) {\n        case jsonService.FoldingRangeKind.Comment:\n            return languages.FoldingRangeKind.Comment;\n        case jsonService.FoldingRangeKind.Imports:\n            return languages.FoldingRangeKind.Imports;\n        case jsonService.FoldingRangeKind.Region:\n            return languages.FoldingRangeKind.Region;\n    }\n    return void 0;\n}\nvar SelectionRangeAdapter = /** @class */ (function () {\n    function SelectionRangeAdapter(_worker) {\n        this._worker = _worker;\n    }\n    SelectionRangeAdapter.prototype.provideSelectionRanges = function (model, positions, token) {\n        var resource = model.uri;\n        return this._worker(resource)\n            .then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); })\n            .then(function (selectionRanges) {\n            if (!selectionRanges) {\n                return;\n            }\n            return selectionRanges.map(function (selectionRange) {\n                var result = [];\n                while (selectionRange) {\n                    result.push({ range: toRange(selectionRange.range) });\n                    selectionRange = selectionRange.parent;\n                }\n                return result;\n            });\n        });\n    };\n    return SelectionRangeAdapter;\n}());\nexport { SelectionRangeAdapter };\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 *--------------------------------------------------------------------------------------------*/\nimport * as json from './_deps/jsonc-parser/main.js';\nexport function createTokenizationSupport(supportComments) {\n    return {\n        getInitialState: function () { return new JSONState(null, null, false, null); },\n        tokenize: function (line, state, offsetDelta, stopAtOffset) {\n            return tokenize(supportComments, line, state, offsetDelta, stopAtOffset);\n        }\n    };\n}\nexport var TOKEN_DELIM_OBJECT = 'delimiter.bracket.json';\nexport var TOKEN_DELIM_ARRAY = 'delimiter.array.json';\nexport var TOKEN_DELIM_COLON = 'delimiter.colon.json';\nexport var TOKEN_DELIM_COMMA = 'delimiter.comma.json';\nexport var TOKEN_VALUE_BOOLEAN = 'keyword.json';\nexport var TOKEN_VALUE_NULL = 'keyword.json';\nexport var TOKEN_VALUE_STRING = 'string.value.json';\nexport var TOKEN_VALUE_NUMBER = 'number.json';\nexport var TOKEN_PROPERTY_NAME = 'string.key.json';\nexport var TOKEN_COMMENT_BLOCK = 'comment.block.json';\nexport var TOKEN_COMMENT_LINE = 'comment.line.json';\nvar ParentsStack = /** @class */ (function () {\n    function ParentsStack(parent, type) {\n        this.parent = parent;\n        this.type = type;\n    }\n    ParentsStack.pop = function (parents) {\n        if (parents) {\n            return parents.parent;\n        }\n        return null;\n    };\n    ParentsStack.push = function (parents, type) {\n        return new ParentsStack(parents, type);\n    };\n    ParentsStack.equals = function (a, b) {\n        if (!a && !b) {\n            return true;\n        }\n        if (!a || !b) {\n            return false;\n        }\n        while (a && b) {\n            if (a === b) {\n                return true;\n            }\n            if (a.type !== b.type) {\n                return false;\n            }\n            a = a.parent;\n            b = b.parent;\n        }\n        return true;\n    };\n    return ParentsStack;\n}());\nvar JSONState = /** @class */ (function () {\n    function JSONState(state, scanError, lastWasColon, parents) {\n        this._state = state;\n        this.scanError = scanError;\n        this.lastWasColon = lastWasColon;\n        this.parents = parents;\n    }\n    JSONState.prototype.clone = function () {\n        return new JSONState(this._state, this.scanError, this.lastWasColon, this.parents);\n    };\n    JSONState.prototype.equals = function (other) {\n        if (other === this) {\n            return true;\n        }\n        if (!other || !(other instanceof JSONState)) {\n            return false;\n        }\n        return (this.scanError === other.scanError &&\n            this.lastWasColon === other.lastWasColon &&\n            ParentsStack.equals(this.parents, other.parents));\n    };\n    JSONState.prototype.getStateData = function () {\n        return this._state;\n    };\n    JSONState.prototype.setStateData = function (state) {\n        this._state = state;\n    };\n    return JSONState;\n}());\nfunction tokenize(comments, line, state, offsetDelta, stopAtOffset) {\n    if (offsetDelta === void 0) { offsetDelta = 0; }\n    // handle multiline strings and block comments\n    var numberOfInsertedCharacters = 0;\n    var adjustOffset = false;\n    switch (state.scanError) {\n        case 2 /* UnexpectedEndOfString */:\n            line = '\"' + line;\n            numberOfInsertedCharacters = 1;\n            break;\n        case 1 /* UnexpectedEndOfComment */:\n            line = '/*' + line;\n            numberOfInsertedCharacters = 2;\n            break;\n    }\n    var scanner = json.createScanner(line);\n    var lastWasColon = state.lastWasColon;\n    var parents = state.parents;\n    var ret = {\n        tokens: [],\n        endState: state.clone()\n    };\n    while (true) {\n        var offset = offsetDelta + scanner.getPosition();\n        var type = '';\n        var kind = scanner.scan();\n        if (kind === 17 /* EOF */) {\n            break;\n        }\n        // Check that the scanner has advanced\n        if (offset === offsetDelta + scanner.getPosition()) {\n            throw new Error('Scanner did not advance, next 3 characters are: ' + line.substr(scanner.getPosition(), 3));\n        }\n        // In case we inserted /* or \" character, we need to\n        // adjust the offset of all tokens (except the first)\n        if (adjustOffset) {\n            offset -= numberOfInsertedCharacters;\n        }\n        adjustOffset = numberOfInsertedCharacters > 0;\n        // brackets and type\n        switch (kind) {\n            case 1 /* OpenBraceToken */:\n                parents = ParentsStack.push(parents, 0 /* Object */);\n                type = TOKEN_DELIM_OBJECT;\n                lastWasColon = false;\n                break;\n            case 2 /* CloseBraceToken */:\n                parents = ParentsStack.pop(parents);\n                type = TOKEN_DELIM_OBJECT;\n                lastWasColon = false;\n                break;\n            case 3 /* OpenBracketToken */:\n                parents = ParentsStack.push(parents, 1 /* Array */);\n                type = TOKEN_DELIM_ARRAY;\n                lastWasColon = false;\n                break;\n            case 4 /* CloseBracketToken */:\n                parents = ParentsStack.pop(parents);\n                type = TOKEN_DELIM_ARRAY;\n                lastWasColon = false;\n                break;\n            case 6 /* ColonToken */:\n                type = TOKEN_DELIM_COLON;\n                lastWasColon = true;\n                break;\n            case 5 /* CommaToken */:\n                type = TOKEN_DELIM_COMMA;\n                lastWasColon = false;\n                break;\n            case 8 /* TrueKeyword */:\n            case 9 /* FalseKeyword */:\n                type = TOKEN_VALUE_BOOLEAN;\n                lastWasColon = false;\n                break;\n            case 7 /* NullKeyword */:\n                type = TOKEN_VALUE_NULL;\n                lastWasColon = false;\n                break;\n            case 10 /* StringLiteral */:\n                var currentParent = parents ? parents.type : 0 /* Object */;\n                var inArray = currentParent === 1 /* Array */;\n                type =\n                    lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME;\n                lastWasColon = false;\n                break;\n            case 11 /* NumericLiteral */:\n                type = TOKEN_VALUE_NUMBER;\n                lastWasColon = false;\n                break;\n        }\n        // comments, iff enabled\n        if (comments) {\n            switch (kind) {\n                case 12 /* LineCommentTrivia */:\n                    type = TOKEN_COMMENT_LINE;\n                    break;\n                case 13 /* BlockCommentTrivia */:\n                    type = TOKEN_COMMENT_BLOCK;\n                    break;\n            }\n        }\n        ret.endState = new JSONState(state.getStateData(), scanner.getTokenError(), lastWasColon, parents);\n        ret.tokens.push({\n            startIndex: offset,\n            scopes: type\n        });\n    }\n    return 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 *--------------------------------------------------------------------------------------------*/\nimport { editor } from './fillers/monaco-editor-core.js';\nvar STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min\nvar WorkerManager = /** @class */ (function () {\n    function WorkerManager(defaults) {\n        var _this = this;\n        this._defaults = defaults;\n        this._worker = null;\n        this._idleCheckInterval = setInterval(function () { return _this._checkIfIdle(); }, 30 * 1000);\n        this._lastUsedTime = 0;\n        this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); });\n    }\n    WorkerManager.prototype._stopWorker = function () {\n        if (this._worker) {\n            this._worker.dispose();\n            this._worker = null;\n        }\n        this._client = null;\n    };\n    WorkerManager.prototype.dispose = function () {\n        clearInterval(this._idleCheckInterval);\n        this._configChangeListener.dispose();\n        this._stopWorker();\n    };\n    WorkerManager.prototype._checkIfIdle = function () {\n        if (!this._worker) {\n            return;\n        }\n        var timePassedSinceLastUsed = Date.now() - this._lastUsedTime;\n        if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) {\n            this._stopWorker();\n        }\n    };\n    WorkerManager.prototype._getClient = function () {\n        this._lastUsedTime = Date.now();\n        if (!this._client) {\n            this._worker = editor.createWebWorker({\n                // module that exports the create() method and returns a `JSONWorker` instance\n                moduleId: 'vs/language/json/jsonWorker',\n                label: this._defaults.languageId,\n                // passed in to the create() method\n                createData: {\n                    languageSettings: this._defaults.diagnosticsOptions,\n                    languageId: this._defaults.languageId,\n                    enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest\n                }\n            });\n            this._client = this._worker.getProxy();\n        }\n        return this._client;\n    };\n    WorkerManager.prototype.getLanguageServiceWorker = function () {\n        var _this = this;\n        var resources = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            resources[_i] = arguments[_i];\n        }\n        var _client;\n        return this._getClient()\n            .then(function (client) {\n            _client = client;\n        })\n            .then(function (_) {\n            return _this._worker.withSyncedResources(resources);\n        })\n            .then(function (_) { return _client; });\n    };\n    return WorkerManager;\n}());\nexport { WorkerManager };\n"],"sourceRoot":""}