Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gwax/sql-formatter

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gwax/sql-formatter - npm Package Compare versions

Comparing version 3.0.0-alpha.1 to 3.0.0-alpha.2

dist/sql-formatter.min.js.map

3

dist/sql-formatter.min.js

@@ -1,1 +0,2 @@

!function(e,E){"object"==typeof exports&&"object"==typeof module?module.exports=E():"function"==typeof define&&define.amd?define([],E):"object"==typeof exports?exports.sqlFormatter=E():e.sqlFormatter=E()}(window,(function(){return function(e){var E={};function t(n){if(E[n])return E[n].exports;var T=E[n]={i:n,l:!1,exports:{}};return e[n].call(T.exports,T,T.exports,t),T.l=!0,T.exports}return t.m=e,t.c=E,t.d=function(e,E,n){t.o(e,E)||Object.defineProperty(e,E,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,E){if(1&E&&(e=t(e)),8&E)return e;if(4&E&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&E&&"string"!=typeof e)for(var T in e)t.d(n,T,function(E){return e[E]}.bind(null,T));return n},t.n=function(e){var E=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(E,"a",E),E},t.o=function(e,E){return Object.prototype.hasOwnProperty.call(e,E)},t.p="",t(t.s=0)}([function(e,E,t){"use strict";t.r(E),t.d(E,"format",(function(){return Oe}));var n={WHITESPACE:"whitespace",WORD:"word",STRING:"string",RESERVED:"reserved",RESERVED_TOP_LEVEL:"reserved-top-level",RESERVED_TOP_LEVEL_NO_INDENT:"reserved-top-level-no-indent",RESERVED_NEWLINE:"reserved-newline",OPERATOR:"operator",OPEN_PAREN:"open-paren",CLOSE_PAREN:"close-paren",LINE_COMMENT:"line-comment",BLOCK_COMMENT:"block-comment",NUMBER:"number",PLACEHOLDER:"placeholder"};function T(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var r=function(){function e(E){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.indent=E||" ",this.indentTypes=[]}var E,t,n;return E=e,(t=[{key:"getIndent",value:function(){return this.indent.repeat(this.indentTypes.length)}},{key:"increaseTopLevel",value:function(){this.indentTypes.push("top-level")}},{key:"increaseBlockLevel",value:function(){this.indentTypes.push("block-level")}},{key:"decreaseTopLevel",value:function(){this.indentTypes.length>0&&"top-level"===this.indentTypes[this.indentTypes.length-1]&&this.indentTypes.pop()}},{key:"decreaseBlockLevel",value:function(){for(;this.indentTypes.length>0&&"top-level"===this.indentTypes.pop(););}},{key:"resetIndentation",value:function(){this.indentTypes=[]}}])&&T(E.prototype,t),n&&T(E,n),e}();function R(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var N=function(){function e(){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.level=0}var E,t,T;return E=e,(t=[{key:"beginIfPossible",value:function(e,E){0===this.level&&this.isInlineBlock(e,E)?this.level=1:this.level>0?this.level++:this.level=0}},{key:"end",value:function(){this.level--}},{key:"isActive",value:function(){return this.level>0}},{key:"isInlineBlock",value:function(e,E){for(var t=0,T=0,r=E;r<e.length;r++){var R=e[r];if((t+=R.value.length)>50)return!1;if(R.type===n.OPEN_PAREN)T++;else if(R.type===n.CLOSE_PAREN&&0==--T)return!0;if(this.isForbiddenToken(R))return!1}return!1}},{key:"isForbiddenToken",value:function(e){var E=e.type,t=e.value;return E===n.RESERVED_TOP_LEVEL||E===n.RESERVED_NEWLINE||E===n.COMMENT||E===n.BLOCK_COMMENT||";"===t}}])&&R(E.prototype,t),T&&R(E,T),e}();function o(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var A=function(){function e(E){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.params=E,this.index=0}var E,t,n;return E=e,(t=[{key:"get",value:function(e){var E=e.key,t=e.value;return this.params?E?this.params[E]:this.params[this.index++]:t}}])&&o(E.prototype,t),n&&o(E,n),e}();function O(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function I(e){return e.replace(/[\$\(-\+\.\?\[-\^\{-\}]/g,"\\$&")}var S=function(){function e(E){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.WHITESPACE_REGEX=/^([\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+)/,this.NUMBER_REGEX=/^((\x2D[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*)?[0-9]+(\.[0-9]+)?([Ee]\x2D?[0-9]+(\.[0-9]+)?)?|0x[0-9A-Fa-f]+|0b[01]+)\b/,this.OPERATOR_REGEX=/^(!=|<<|>>|<>|==|<=|>=|!<|!>|\|\|\/|\|\/|\|\||::|\x2D>>|\x2D>|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|@|:=|(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/,this.BLOCK_COMMENT_REGEX=/^(\/\*(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:\*\/|$))/,this.LINE_COMMENT_REGEX=this.createLineCommentRegex(E.lineCommentTypes),this.RESERVED_TOP_LEVEL_REGEX=this.createReservedWordRegex(E.reservedTopLevelWords),this.RESERVED_TOP_LEVEL_NO_INDENT_REGEX=this.createReservedWordRegex(E.reservedTopLevelWordsNoIndent),this.RESERVED_NEWLINE_REGEX=this.createReservedWordRegex(E.reservedNewlineWords),this.RESERVED_PLAIN_REGEX=this.createReservedWordRegex(E.reservedWords),this.WORD_REGEX=this.createWordRegex(E.specialWordChars),this.STRING_REGEX=this.createStringRegex(E.stringTypes),this.OPEN_PAREN_REGEX=this.createParenRegex(E.openParens),this.CLOSE_PAREN_REGEX=this.createParenRegex(E.closeParens),this.INDEXED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(E.indexedPlaceholderTypes,"[0-9]*"),this.IDENT_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(E.namedPlaceholderTypes,"[a-zA-Z0-9._$]+"),this.STRING_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(E.namedPlaceholderTypes,this.createStringPattern(E.stringTypes))}var E,t,T;return E=e,(t=[{key:"createLineCommentRegex",value:function(e){return new RegExp("^((?:".concat(e.map((function(e){return I(e)})).join("|"),").*?(?:\r\n|\r|\n|$))"),"u")}},{key:"createReservedWordRegex",value:function(e){if(0===e.length)return new RegExp("^\b$","u");var E=(e=e.sort((function(e,E){return E.length-e.length||e.localeCompare(E)}))).join("|").replace(/ /g,"\\s+");return new RegExp("^(".concat(E,")\\b"),"iu")}},{key:"createWordRegex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new RegExp("^([\\p{Alphabetic}\\p{Mark}\\p{Decimal_Number}\\p{Connector_Punctuation}\\p{Join_Control}".concat(e.join(""),"]+)"),"u")}},{key:"createStringRegex",value:function(e){return new RegExp("^("+this.createStringPattern(e)+")","u")}},{key:"createStringPattern",value:function(e){var E={"``":"((`[^`]*($|`))+)","{}":"((\\{[^\\}]*($|\\}))+)","[]":"((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)",'""':'(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',"''":"(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)","N''":"((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)"};return e.map((function(e){return E[e]})).join("|")}},{key:"createParenRegex",value:function(e){var E=this;return new RegExp("^("+e.map((function(e){return E.escapeParen(e)})).join("|")+")","iu")}},{key:"escapeParen",value:function(e){return 1===e.length?I(e):"\\b"+e+"\\b"}},{key:"createPlaceholderRegex",value:function(e,E){if(t=e,!Array.isArray(t)||0===t.length)return!1;var t,n=e.map(I).join("|");return new RegExp("^((?:".concat(n,")(?:").concat(E,"))"),"u")}},{key:"tokenize",value:function(e){if(!e)return[];for(var E,t=[];e.length;)E=this.getNextToken(e,E),e=e.substring(E.value.length),t.push(E);return t}},{key:"getNextToken",value:function(e,E){return this.getWhitespaceToken(e)||this.getCommentToken(e)||this.getStringToken(e)||this.getOpenParenToken(e)||this.getCloseParenToken(e)||this.getPlaceholderToken(e)||this.getNumberToken(e)||this.getReservedWordToken(e,E)||this.getWordToken(e)||this.getOperatorToken(e)}},{key:"getWhitespaceToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.WHITESPACE,regex:this.WHITESPACE_REGEX})}},{key:"getCommentToken",value:function(e){return this.getLineCommentToken(e)||this.getBlockCommentToken(e)}},{key:"getLineCommentToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.LINE_COMMENT,regex:this.LINE_COMMENT_REGEX})}},{key:"getBlockCommentToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.BLOCK_COMMENT,regex:this.BLOCK_COMMENT_REGEX})}},{key:"getStringToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.STRING,regex:this.STRING_REGEX})}},{key:"getOpenParenToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.OPEN_PAREN,regex:this.OPEN_PAREN_REGEX})}},{key:"getCloseParenToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.CLOSE_PAREN,regex:this.CLOSE_PAREN_REGEX})}},{key:"getPlaceholderToken",value:function(e){return this.getIdentNamedPlaceholderToken(e)||this.getStringNamedPlaceholderToken(e)||this.getIndexedPlaceholderToken(e)}},{key:"getIdentNamedPlaceholderToken",value:function(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.IDENT_NAMED_PLACEHOLDER_REGEX,parseKey:function(e){return e.slice(1)}})}},{key:"getStringNamedPlaceholderToken",value:function(e){var E=this;return this.getPlaceholderTokenWithKey({input:e,regex:this.STRING_NAMED_PLACEHOLDER_REGEX,parseKey:function(e){return E.getEscapedPlaceholderKey({key:e.slice(2,-1),quoteChar:e.slice(-1)})}})}},{key:"getIndexedPlaceholderToken",value:function(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.INDEXED_PLACEHOLDER_REGEX,parseKey:function(e){return e.slice(1)}})}},{key:"getPlaceholderTokenWithKey",value:function(e){var E=e.input,t=e.regex,T=e.parseKey,r=this.getTokenOnFirstMatch({input:E,regex:t,type:n.PLACEHOLDER});return r&&(r.key=T(r.value)),r}},{key:"getEscapedPlaceholderKey",value:function(e){var E=e.key,t=e.quoteChar;return E.replace(new RegExp(I("\\"+t),"gu"),t)}},{key:"getNumberToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.NUMBER,regex:this.NUMBER_REGEX})}},{key:"getOperatorToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.OPERATOR,regex:this.OPERATOR_REGEX})}},{key:"getReservedWordToken",value:function(e,E){if(!E||!E.value||"."!==E.value)return this.getTopLevelReservedToken(e)||this.getNewlineReservedToken(e)||this.getTopLevelReservedTokenNoIndent(e)||this.getPlainReservedToken(e)}},{key:"getTopLevelReservedToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.RESERVED_TOP_LEVEL,regex:this.RESERVED_TOP_LEVEL_REGEX})}},{key:"getNewlineReservedToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.RESERVED_NEWLINE,regex:this.RESERVED_NEWLINE_REGEX})}},{key:"getTopLevelReservedTokenNoIndent",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.RESERVED_TOP_LEVEL_NO_INDENT,regex:this.RESERVED_TOP_LEVEL_NO_INDENT_REGEX})}},{key:"getPlainReservedToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.RESERVED,regex:this.RESERVED_PLAIN_REGEX})}},{key:"getWordToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.WORD,regex:this.WORD_REGEX})}},{key:"getTokenOnFirstMatch",value:function(e){var E=e.input,t=e.type,n=e.regex,T=E.match(n);if(T)return{type:t,value:T[1]}}}])&&O(E.prototype,t),T&&O(E,T),e}();function i(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function L(e,E,t){return E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t,e}var u=function(e){return e.replace(/[\t ]+$/,"")},C=function(){function e(E){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.cfg=E||{},this.indentation=new r(this.cfg.indent),this.inlineBlock=new N,this.params=new A(this.cfg.params),this.previousReservedToken={},this.tokens=[],this.index=0}var E,t,T;return E=e,(t=[{key:"tokenOverride",value:function(){}},{key:"format",value:function(e){return this.tokens=this.constructor.tokenizer.tokenize(e),this.getFormattedQueryFromTokens().trim()}},{key:"getFormattedQueryFromTokens",value:function(){var e=this,E="";return this.tokens.forEach((function(t,T){e.index=T,(t=e.tokenOverride(t)||t).type===n.WHITESPACE||(t.type===n.LINE_COMMENT?E=e.formatLineComment(t,E):t.type===n.BLOCK_COMMENT?E=e.formatBlockComment(t,E):t.type===n.RESERVED_TOP_LEVEL?(E=e.formatTopLevelReservedWord(t,E),e.previousReservedToken=t):t.type===n.RESERVED_TOP_LEVEL_NO_INDENT?(E=e.formatTopLevelReservedWordNoIndent(t,E),e.previousReservedToken=t):t.type===n.RESERVED_NEWLINE?(E=e.formatNewlineReservedWord(t,E),e.previousReservedToken=t):t.type===n.RESERVED?(E=e.formatWithSpaces(t,E),e.previousReservedToken=t):E=t.type===n.OPEN_PAREN?e.formatOpeningParentheses(t,E):t.type===n.CLOSE_PAREN?e.formatClosingParentheses(t,E):t.type===n.PLACEHOLDER?e.formatPlaceholder(t,E):","===t.value?e.formatComma(t,E):":"===t.value?e.formatWithSpaceAfter(t,E):"."===t.value?e.formatWithoutSpaces(t,E):";"===t.value?e.formatQuerySeparator(t,E):e.formatWithSpaces(t,E))})),E}},{key:"formatLineComment",value:function(e,E){return this.addNewline(E+e.value)}},{key:"formatBlockComment",value:function(e,E){return this.addNewline(this.addNewline(E)+this.indentComment(e.value))}},{key:"indentComment",value:function(e){return e.replace(/\n[\t ]*/g,"\n"+this.indentation.getIndent()+" ")}},{key:"formatTopLevelReservedWordNoIndent",value:function(e,E){return this.indentation.decreaseTopLevel(),E=this.addNewline(E)+this.equalizeWhitespace(this.formatReservedWord(e.value)),this.addNewline(E)}},{key:"formatTopLevelReservedWord",value:function(e,E){return this.indentation.decreaseTopLevel(),E=this.addNewline(E),this.indentation.increaseTopLevel(),E+=this.equalizeWhitespace(this.formatReservedWord(e.value)),this.addNewline(E)}},{key:"formatNewlineReservedWord",value:function(e,E){return this.addNewline(E)+this.equalizeWhitespace(this.formatReservedWord(e.value))+" "}},{key:"equalizeWhitespace",value:function(e){return e.replace(/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+/g," ")}},{key:"formatOpeningParentheses",value:function(e,E){var t;return(L(t={},n.WHITESPACE,!0),L(t,n.OPEN_PAREN,!0),L(t,n.LINE_COMMENT,!0),L(t,n.OPERATOR,!0),t)[this.previousToken().type]||(E=u(E)),E+=this.cfg.uppercase?e.value.toUpperCase():e.value,this.inlineBlock.beginIfPossible(this.tokens,this.index),this.inlineBlock.isActive()||(this.indentation.increaseBlockLevel(),E=this.addNewline(E)),E}},{key:"formatClosingParentheses",value:function(e,E){return e.value=this.cfg.uppercase?e.value.toUpperCase():e.value,this.inlineBlock.isActive()?(this.inlineBlock.end(),this.formatWithSpaceAfter(e,E)):(this.indentation.decreaseBlockLevel(),this.formatWithSpaces(e,this.addNewline(E)))}},{key:"formatPlaceholder",value:function(e,E){return E+this.params.get(e)+" "}},{key:"formatComma",value:function(e,E){return E=u(E)+e.value+" ",this.inlineBlock.isActive()||/^LIMIT$/i.test(this.previousReservedToken.value)?E:this.addNewline(E)}},{key:"formatWithSpaceAfter",value:function(e,E){return u(E)+e.value+" "}},{key:"formatWithoutSpaces",value:function(e,E){return u(E)+e.value}},{key:"formatWithSpaces",value:function(e,E){return E+("reserved"===e.type?this.formatReservedWord(e.value):e.value)+" "}},{key:"formatReservedWord",value:function(e){return this.cfg.uppercase?e.toUpperCase():e}},{key:"formatQuerySeparator",value:function(e,E){return this.indentation.resetIndentation(),u(E)+e.value+"\n".repeat(this.cfg.linesBetweenQueries||1)}},{key:"addNewline",value:function(e){return(e=u(e)).endsWith("\n")||(e+="\n"),e+this.indentation.getIndent()}},{key:"previousToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.tokens[this.index-e]||{}}},{key:"tokenLookBack",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,E=Math.max(0,this.index-e),t=this.index;return this.tokens.slice(E,t).reverse()}},{key:"tokenLookAhead",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,E=this.index+1,t=this.index+e+1;return this.tokens.slice(E,t)}}])&&i(E.prototype,t),T&&i(E,T),e}();function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function c(e,E){return(c=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function l(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f(e);if(E){var T=f(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return D(this,t)}}function D(e,E){return!E||"object"!==a(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}L(C,"tokenizer",new S({reservedWords:[],reservedTopLevelWords:[],reservedNewlineWords:[],reservedTopLevelWordsNoIndent:[],stringTypes:[],openParens:[],closeParens:[],indexedPlaceholderTypes:[],namedPlaceholderTypes:[],lineCommentTypes:[],specialWordChars:[]}));var P,U,p,M=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&c(e,E)}(t,e);var E=l(t);function t(){return s(this,t),E.apply(this,arguments)}return t}(C);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function _(e,E){return(_=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function d(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=F(e);if(E){var T=F(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return v(this,t)}}function v(e,E){return!E||"object"!==y(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}P=M,U="tokenizer",p=new S({reservedWords:["ABS","ACTIVATE","ALIAS","ALL","ALLOCATE","ALLOW","ALTER","ANY","ARE","ARRAY","AS","ASC","ASENSITIVE","ASSOCIATE","ASUTIME","ASYMMETRIC","AT","ATOMIC","ATTRIBUTES","AUDIT","AUTHORIZATION","AUX","AUXILIARY","AVG","BEFORE","BEGIN","BETWEEN","BIGINT","BINARY","BLOB","BOOLEAN","BOTH","BUFFERPOOL","BY","CACHE","CALL","CALLED","CAPTURE","CARDINALITY","CASCADED","CASE","CAST","CCSID","CEIL","CEILING","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CLOB","CLONE","CLOSE","CLUSTER","COALESCE","COLLATE","COLLECT","COLLECTION","COLLID","COLUMN","COMMENT","COMMIT","CONCAT","CONDITION","CONNECT","CONNECTION","CONSTRAINT","CONTAINS","CONTINUE","CONVERT","CORR","CORRESPONDING","COUNT","COUNT_BIG","COVAR_POP","COVAR_SAMP","CREATE","CROSS","CUBE","CUME_DIST","CURRENT","CURRENT_DATE","CURRENT_DEFAULT_TRANSFORM_GROUP","CURRENT_LC_CTYPE","CURRENT_PATH","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_SERVER","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_TIMEZONE","CURRENT_TRANSFORM_GROUP_FOR_TYPE","CURRENT_USER","CURSOR","CYCLE","DATA","DATABASE","DATAPARTITIONNAME","DATAPARTITIONNUM","DATE","DAY","DAYS","DB2GENERAL","DB2GENRL","DB2SQL","DBINFO","DBPARTITIONNAME","DBPARTITIONNUM","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFAULTS","DEFINITION","DELETE","DENSERANK","DENSE_RANK","DEREF","DESCRIBE","DESCRIPTOR","DETERMINISTIC","DIAGNOSTICS","DISABLE","DISALLOW","DISCONNECT","DISTINCT","DO","DOCUMENT","DOUBLE","DROP","DSSIZE","DYNAMIC","EACH","EDITPROC","ELEMENT","ELSE","ELSEIF","ENABLE","ENCODING","ENCRYPTION","END","END-EXEC","ENDING","ERASE","ESCAPE","EVERY","EXCEPTION","EXCLUDING","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXP","EXPLAIN","EXTENDED","EXTERNAL","EXTRACT","FALSE","FENCED","FETCH","FIELDPROC","FILE","FILTER","FINAL","FIRST","FLOAT","FLOOR","FOR","FOREIGN","FREE","FULL","FUNCTION","FUSION","GENERAL","GENERATED","GET","GLOBAL","GOTO","GRANT","GRAPHIC","GROUP","GROUPING","HANDLER","HASH","HASHED_VALUE","HINT","HOLD","HOUR","HOURS","IDENTITY","IF","IMMEDIATE","IN","INCLUDING","INCLUSIVE","INCREMENT","INDEX","INDICATOR","INDICATORS","INF","INFINITY","INHERIT","INNER","INOUT","INSENSITIVE","INSERT","INT","INTEGER","INTEGRITY","INTERSECTION","INTERVAL","INTO","IS","ISOBID","ISOLATION","ITERATE","JAR","JAVA","KEEP","KEY","LABEL","LANGUAGE","LARGE","LATERAL","LC_CTYPE","LEADING","LEAVE","LEFT","LIKE","LINKTYPE","LN","LOCAL","LOCALDATE","LOCALE","LOCALTIME","LOCALTIMESTAMP","LOCATOR","LOCATORS","LOCK","LOCKMAX","LOCKSIZE","LONG","LOOP","LOWER","MAINTAINED","MATCH","MATERIALIZED","MAX","MAXVALUE","MEMBER","MERGE","METHOD","MICROSECOND","MICROSECONDS","MIN","MINUTE","MINUTES","MINVALUE","MOD","MODE","MODIFIES","MODULE","MONTH","MONTHS","MULTISET","NAN","NATIONAL","NATURAL","NCHAR","NCLOB","NEW","NEW_TABLE","NEXTVAL","NO","NOCACHE","NOCYCLE","NODENAME","NODENUMBER","NOMAXVALUE","NOMINVALUE","NONE","NOORDER","NORMALIZE","NORMALIZED","NOT","NULL","NULLIF","NULLS","NUMERIC","NUMPARTS","OBID","OCTET_LENGTH","OF","OFFSET","OLD","OLD_TABLE","ON","ONLY","OPEN","OPTIMIZATION","OPTIMIZE","OPTION","ORDER","OUT","OUTER","OVER","OVERLAPS","OVERLAY","OVERRIDING","PACKAGE","PADDED","PAGESIZE","PARAMETER","PART","PARTITION","PARTITIONED","PARTITIONING","PARTITIONS","PASSWORD","PATH","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","PIECESIZE","PLAN","POSITION","POWER","PRECISION","PREPARE","PREVVAL","PRIMARY","PRIQTY","PRIVILEGES","PROCEDURE","PROGRAM","PSID","PUBLIC","QUERY","QUERYNO","RANGE","RANK","READ","READS","REAL","RECOVERY","RECURSIVE","REF","REFERENCES","REFERENCING","REFRESH","REGR_AVGX","REGR_AVGY","REGR_COUNT","REGR_INTERCEPT","REGR_R2","REGR_SLOPE","REGR_SXX","REGR_SXY","REGR_SYY","RELEASE","RENAME","REPEAT","RESET","RESIGNAL","RESTART","RESTRICT","RESULT","RESULT_SET_LOCATOR","RETURN","RETURNS","REVOKE","RIGHT","ROLE","ROLLBACK","ROLLUP","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_UP","ROUND_UP","ROUTINE","ROW","ROWNUMBER","ROWS","ROWSET","ROW_NUMBER","RRN","RUN","SAVEPOINT","SCHEMA","SCOPE","SCRATCHPAD","SCROLL","SEARCH","SECOND","SECONDS","SECQTY","SECURITY","SENSITIVE","SEQUENCE","SESSION","SESSION_USER","SIGNAL","SIMILAR","SIMPLE","SMALLINT","SNAN","SOME","SOURCE","SPECIFIC","SPECIFICTYPE","SQL","SQLEXCEPTION","SQLID","SQLSTATE","SQLWARNING","SQRT","STACKED","STANDARD","START","STARTING","STATEMENT","STATIC","STATMENT","STAY","STDDEV_POP","STDDEV_SAMP","STOGROUP","STORES","STYLE","SUBMULTISET","SUBSTRING","SUM","SUMMARY","SYMMETRIC","SYNONYM","SYSFUN","SYSIBM","SYSPROC","SYSTEM","SYSTEM_USER","TABLE","TABLESAMPLE","TABLESPACE","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRANSACTION","TRANSLATE","TRANSLATION","TREAT","TRIGGER","TRIM","TRUE","TRUNCATE","TYPE","UESCAPE","UNDO","UNIQUE","UNKNOWN","UNNEST","UNTIL","UPPER","USAGE","USER","USING","VALIDPROC","VALUE","VARCHAR","VARIABLE","VARIANT","VARYING","VAR_POP","VAR_SAMP","VCAT","VERSION","VIEW","VOLATILE","VOLUMES","WHEN","WHENEVER","WHILE","WIDTH_BUCKET","WINDOW","WITH","WITHIN","WITHOUT","WLM","WRITE","XMLELEMENT","XMLEXISTS","XMLNAMESPACES","YEAR","YEARS"],reservedTopLevelWords:["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INTERSECT","LIMIT","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UPDATE","VALUES","WHERE"],reservedNewlineWords:["AND","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN"],reservedTopLevelWordsNoIndent:["INTERSECT","INTERSECT ALL","MINUS","UNION","UNION ALL"],stringTypes:['""',"''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["#","@"]}),U in P?Object.defineProperty(P,U,{value:p,enumerable:!0,configurable:!0,writable:!0}):P[U]=p;var G=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&_(e,E)}(t,e);var E=d(t);function t(){return h(this,t),E.apply(this,arguments)}return t}(C);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function g(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function W(e,E){return(W=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function m(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=b(e);if(E){var T=b(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return Y(this,t)}}function Y(e,E){return!E||"object"!==B(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(G,"tokenizer",new S({reservedWords:["ALL","ALTER","ANALYZE","AND","ANY","ARRAY","AS","ASC","BEGIN","BETWEEN","BINARY","BOOLEAN","BREAK","BUCKET","BUILD","BY","CALL","CASE","CAST","CLUSTER","COLLATE","COLLECTION","COMMIT","CONNECT","CONTINUE","CORRELATE","COVER","CREATE","DATABASE","DATASET","DATASTORE","DECLARE","DECREMENT","DELETE","DERIVED","DESC","DESCRIBE","DISTINCT","DO","DROP","EACH","ELEMENT","ELSE","END","EVERY","EXCEPT","EXCLUDE","EXECUTE","EXISTS","EXPLAIN","FALSE","FETCH","FIRST","FLATTEN","FOR","FORCE","FROM","FUNCTION","GRANT","GROUP","GSI","HAVING","IF","IGNORE","ILIKE","IN","INCLUDE","INCREMENT","INDEX","INFER","INLINE","INNER","INSERT","INTERSECT","INTO","IS","JOIN","KEY","KEYS","KEYSPACE","KNOWN","LAST","LEFT","LET","LETTING","LIKE","LIMIT","LSM","MAP","MAPPING","MATCHED","MATERIALIZED","MERGE","MISSING","NAMESPACE","NEST","NOT","NULL","NUMBER","OBJECT","OFFSET","ON","OPTION","OR","ORDER","OUTER","OVER","PARSE","PARTITION","PASSWORD","PATH","POOL","PREPARE","PRIMARY","PRIVATE","PRIVILEGE","PROCEDURE","PUBLIC","RAW","REALM","REDUCE","RENAME","RETURN","RETURNING","REVOKE","RIGHT","ROLE","ROLLBACK","SATISFIES","SCHEMA","SELECT","SELF","SEMI","SET","SHOW","SOME","START","STATISTICS","STRING","SYSTEM","THEN","TO","TRANSACTION","TRIGGER","TRUE","TRUNCATE","UNDER","UNION","UNIQUE","UNKNOWN","UNNEST","UNSET","UPDATE","UPSERT","USE","USER","USING","VALIDATE","VALUE","VALUED","VALUES","VIA","VIEW","WHEN","WHERE","WHILE","WITH","WITHIN","WORK","XOR"],reservedTopLevelWords:["DELETE FROM","EXCEPT ALL","EXCEPT","EXPLAIN DELETE FROM","EXPLAIN UPDATE","EXPLAIN UPSERT","FROM","GROUP BY","HAVING","INFER","INSERT INTO","LET","LIMIT","MERGE","NEST","ORDER BY","PREPARE","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNNEST","UPDATE","UPSERT","USE KEYS","VALUES","WHERE"],reservedNewlineWords:["AND","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"],reservedTopLevelWordsNoIndent:["INTERSECT","INTERSECT ALL","MINUS","UNION","UNION ALL"],stringTypes:['""',"''","``"],openParens:["(","[","{"],closeParens:[")","]","}"],namedPlaceholderTypes:["$"],lineCommentTypes:["#","--"]}));var k=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&W(e,E)}(R,e);var E,t,T,r=m(R);function R(){return H(this,R),r.apply(this,arguments)}return E=R,(t=[{key:"tokenOverride",value:function(e){if(e.type===n.RESERVED_TOP_LEVEL&&"SET"===e.value.toUpperCase()&&"BY"===this.previousReservedToken.value.toUpperCase())return e.type=n.RESERVED,e}}])&&g(E.prototype,t),T&&g(E,T),R}(C);function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function w(e,E){return(w=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function K(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=J(e);if(E){var T=J(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return x(this,t)}}function x(e,E){return!E||"object"!==V(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function J(e){return(J=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(k,"tokenizer",new S({reservedWords:["A","ACCESSIBLE","AGENT","AGGREGATE","ALL","ALTER","ANY","ARRAY","AS","ASC","AT","ATTRIBUTE","AUTHID","AVG","BETWEEN","BFILE_BASE","BINARY_INTEGER","BINARY","BLOB_BASE","BLOCK","BODY","BOOLEAN","BOTH","BOUND","BREADTH","BULK","BY","BYTE","C","CALL","CALLING","CASCADE","CASE","CHAR_BASE","CHAR","CHARACTER","CHARSET","CHARSETFORM","CHARSETID","CHECK","CLOB_BASE","CLONE","CLOSE","CLUSTER","CLUSTERS","COALESCE","COLAUTH","COLLECT","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPILED","COMPRESS","CONNECT","CONSTANT","CONSTRUCTOR","CONTEXT","CONTINUE","CONVERT","COUNT","CRASH","CREATE","CREDENTIAL","CURRENT","CURRVAL","CURSOR","CUSTOMDATUM","DANGLING","DATA","DATE_BASE","DATE","DAY","DECIMAL","DEFAULT","DEFINE","DELETE","DEPTH","DESC","DETERMINISTIC","DIRECTORY","DISTINCT","DO","DOUBLE","DROP","DURATION","ELEMENT","ELSIF","EMPTY","END","ESCAPE","EXCEPTIONS","EXCLUSIVE","EXECUTE","EXISTS","EXIT","EXTENDS","EXTERNAL","EXTRACT","FALSE","FETCH","FINAL","FIRST","FIXED","FLOAT","FOR","FORALL","FORCE","FROM","FUNCTION","GENERAL","GOTO","GRANT","GROUP","HASH","HEAP","HIDDEN","HOUR","IDENTIFIED","IF","IMMEDIATE","IN","INCLUDING","INDEX","INDEXES","INDICATOR","INDICES","INFINITE","INSTANTIABLE","INT","INTEGER","INTERFACE","INTERVAL","INTO","INVALIDATE","IS","ISOLATION","JAVA","LANGUAGE","LARGE","LEADING","LENGTH","LEVEL","LIBRARY","LIKE","LIKE2","LIKE4","LIKEC","LIMITED","LOCAL","LOCK","LONG","MAP","MAX","MAXLEN","MEMBER","MERGE","MIN","MINUTE","MLSLABEL","MOD","MODE","MONTH","MULTISET","NAME","NAN","NATIONAL","NATIVE","NATURAL","NATURALN","NCHAR","NEW","NEXTVAL","NOCOMPRESS","NOCOPY","NOT","NOWAIT","NULL","NULLIF","NUMBER_BASE","NUMBER","OBJECT","OCICOLL","OCIDATE","OCIDATETIME","OCIDURATION","OCIINTERVAL","OCILOBLOCATOR","OCINUMBER","OCIRAW","OCIREF","OCIREFCURSOR","OCIROWID","OCISTRING","OCITYPE","OF","OLD","ON","ONLY","OPAQUE","OPEN","OPERATOR","OPTION","ORACLE","ORADATA","ORDER","ORGANIZATION","ORLANY","ORLVARY","OTHERS","OUT","OVERLAPS","OVERRIDING","PACKAGE","PARALLEL_ENABLE","PARAMETER","PARAMETERS","PARENT","PARTITION","PASCAL","PCTFREE","PIPE","PIPELINED","PLS_INTEGER","PLUGGABLE","POSITIVE","POSITIVEN","PRAGMA","PRECISION","PRIOR","PRIVATE","PROCEDURE","PUBLIC","RAISE","RANGE","RAW","READ","REAL","RECORD","REF","REFERENCE","RELEASE","RELIES_ON","REM","REMAINDER","RENAME","RESOURCE","RESULT_CACHE","RESULT","RETURN","RETURNING","REVERSE","REVOKE","ROLLBACK","ROW","ROWID","ROWNUM","ROWTYPE","SAMPLE","SAVE","SAVEPOINT","SB1","SB2","SB4","SEARCH","SECOND","SEGMENT","SELF","SEPARATE","SEQUENCE","SERIALIZABLE","SHARE","SHORT","SIZE_T","SIZE","SMALLINT","SOME","SPACE","SPARSE","SQL","SQLCODE","SQLDATA","SQLERRM","SQLNAME","SQLSTATE","STANDARD","START","STATIC","STDDEV","STORED","STRING","STRUCT","STYLE","SUBMULTISET","SUBPARTITION","SUBSTITUTABLE","SUBTYPE","SUCCESSFUL","SUM","SYNONYM","SYSDATE","TABAUTH","TABLE","TDO","THE","THEN","TIME","TIMESTAMP","TIMEZONE_ABBR","TIMEZONE_HOUR","TIMEZONE_MINUTE","TIMEZONE_REGION","TO","TRAILING","TRANSACTION","TRANSACTIONAL","TRIGGER","TRUE","TRUSTED","TYPE","UB1","UB2","UB4","UID","UNDER","UNIQUE","UNPLUG","UNSIGNED","UNTRUSTED","USE","USER","USING","VALIDATE","VALIST","VALUE","VARCHAR","VARCHAR2","VARIABLE","VARIANCE","VARRAY","VARYING","VIEW","VIEWS","VOID","WHENEVER","WHILE","WITH","WORK","WRAPPED","WRITE","YEAR","ZONE"],reservedTopLevelWords:["ADD","ALTER COLUMN","ALTER TABLE","BEGIN","CONNECT BY","DECLARE","DELETE FROM","DELETE","END","EXCEPT","EXCEPTION","FETCH FIRST","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","LIMIT","LOOP","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","START WITH","UPDATE","VALUES","WHERE"],reservedNewlineWords:["AND","CROSS APPLY","CROSS JOIN","ELSE","END","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"],reservedTopLevelWordsNoIndent:["INTERSECT","INTERSECT ALL","MINUS","UNION","UNION ALL"],stringTypes:['""',"N''","''","``"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["_","$","#",".","@"]}));var j=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&w(e,E)}(t,e);var E=K(t);function t(){return X(this,t),E.apply(this,arguments)}return t}(C);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function $(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function z(e,E){return(z=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function q(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=Ee(e);if(E){var T=Ee(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return ee(this,t)}}function ee(e,E){return!E||"object"!==Q(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(j,"tokenizer",new S({reservedWords:["AES128","AES256","ALLOWOVERWRITE","ANALYSE","ARRAY","AS","ASC","AUTHORIZATION","BACKUP","BINARY","BLANKSASNULL","BOTH","BYTEDICT","BZIP2","CAST","CHECK","COLLATE","COLUMN","CONSTRAINT","CREATE","CREDENTIALS","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURRENT_USER_ID","DEFAULT","DEFERRABLE","DEFLATE","DEFRAG","DELTA","DELTA32K","DESC","DISABLE","DISTINCT","DO","ELSE","EMPTYASNULL","ENABLE","ENCODE","ENCRYPT","ENCRYPTION","END","EXPLICIT","FALSE","FOR","FOREIGN","FREEZE","FULL","GLOBALDICT256","GLOBALDICT64K","GRANT","GZIP","IDENTITY","IGNORE","ILIKE","INITIALLY","INTO","LEADING","LOCALTIME","LOCALTIMESTAMP","LUN","LUNS","LZO","LZOP","MINUS","MOSTLY13","MOSTLY32","MOSTLY8","NATURAL","NEW","NULLS","OFF","OFFLINE","OFFSET","OLD","ON","ONLY","OPEN","ORDER","OVERLAPS","PARALLEL","PARTITION","PERCENT","PERMISSIONS","PLACING","PRIMARY","RAW","READRATIO","RECOVER","REFERENCES","REJECTLOG","RESORT","RESTORE","SESSION_USER","SIMILAR","SYSDATE","SYSTEM","TABLE","TAG","TDES","TEXT255","TEXT32K","THEN","TIMESTAMP","TO","TOP","TRAILING","TRUE","TRUNCATECOLUMNS","UNIQUE","USER","USING","VERBOSE","WALLET","WHEN","WITH","WITHOUT","PREDICATE","COLUMNS","COMPROWS","COMPRESSION","COPY","FORMAT","DELIMITER","FIXEDWIDTH","AVRO","JSON","ENCRYPTED","BZIP2","GZIP","LZOP","PARQUET","ORC","ACCEPTANYDATE","ACCEPTINVCHARS","BLANKSASNULL","DATEFORMAT","EMPTYASNULL","ENCODING","ESCAPE","EXPLICIT_IDS","FILLRECORD","IGNOREBLANKLINES","IGNOREHEADER","NULL AS","REMOVEQUOTES","ROUNDEC","TIMEFORMAT","TRIMBLANKS","TRUNCATECOLUMNS","COMPROWS","COMPUPDATE","MAXERROR","NOLOAD","STATUPDATE","MANIFEST","REGION","IAM_ROLE","MASTER_SYMMETRIC_KEY","SSH","ACCEPTANYDATE","ACCEPTINVCHARS","ACCESS_KEY_ID","SECRET_ACCESS_KEY","AVRO","BLANKSASNULL","BZIP2","COMPROWS","COMPUPDATE","CREDENTIALS","DATEFORMAT","DELIMITER","EMPTYASNULL","ENCODING","ENCRYPTED","ESCAPE","EXPLICIT_IDS","FILLRECORD","FIXEDWIDTH","FORMAT","IAM_ROLE","GZIP","IGNOREBLANKLINES","IGNOREHEADER","JSON","LZOP","MANIFEST","MASTER_SYMMETRIC_KEY","MAXERROR","NOLOAD","NULL AS","READRATIO","REGION","REMOVEQUOTES","ROUNDEC","SSH","STATUPDATE","TIMEFORMAT","SESSION_TOKEN","TRIMBLANKS","TRUNCATECOLUMNS","EXTERNAL","DATA CATALOG","HIVE METASTORE","CATALOG_ROLE","VACUUM","COPY","UNLOAD","EVEN","ALL"],reservedTopLevelWords:["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","INTERSECT","TOP","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UPDATE","VALUES","WHERE","VACUUM","COPY","UNLOAD","ANALYZE","ANALYSE","DISTKEY","SORTKEY","COMPOUND","INTERLEAVED","FORMAT","DELIMITER","FIXEDWIDTH","AVRO","JSON","ENCRYPTED","BZIP2","GZIP","LZOP","PARQUET","ORC","ACCEPTANYDATE","ACCEPTINVCHARS","BLANKSASNULL","DATEFORMAT","EMPTYASNULL","ENCODING","ESCAPE","EXPLICIT_IDS","FILLRECORD","IGNOREBLANKLINES","IGNOREHEADER","NULL AS","REMOVEQUOTES","ROUNDEC","TIMEFORMAT","TRIMBLANKS","TRUNCATECOLUMNS","COMPROWS","COMPUPDATE","MAXERROR","NOLOAD","STATUPDATE","MANIFEST","REGION","IAM_ROLE","MASTER_SYMMETRIC_KEY","SSH","ACCEPTANYDATE","ACCEPTINVCHARS","ACCESS_KEY_ID","SECRET_ACCESS_KEY","AVRO","BLANKSASNULL","BZIP2","COMPROWS","COMPUPDATE","CREDENTIALS","DATEFORMAT","DELIMITER","EMPTYASNULL","ENCODING","ENCRYPTED","ESCAPE","EXPLICIT_IDS","FILLRECORD","FIXEDWIDTH","FORMAT","IAM_ROLE","GZIP","IGNOREBLANKLINES","IGNOREHEADER","JSON","LZOP","MANIFEST","MASTER_SYMMETRIC_KEY","MAXERROR","NOLOAD","NULL AS","READRATIO","REGION","REMOVEQUOTES","ROUNDEC","SSH","STATUPDATE","TIMEFORMAT","SESSION_TOKEN","TRIMBLANKS","TRUNCATECOLUMNS","EXTERNAL","DATA CATALOG","HIVE METASTORE","CATALOG_ROLE"],reservedNewlineWords:["AND","CROSS JOIN","ELSE","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","VACUUM","COPY","UNLOAD","ANALYZE","ANALYSE","DISTKEY","SORTKEY","COMPOUND","INTERLEAVED"],reservedTopLevelWordsNoIndent:[],stringTypes:['""',"''","``"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@","#","$"],lineCommentTypes:["--"]}));var te=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&z(e,E)}(R,e);var E,t,T,r=q(R);function R(){return Z(this,R),r.apply(this,arguments)}return E=R,(t=[{key:"tokenOverride",value:function(e){if(e.type===n.RESERVED_TOP_LEVEL&&"WINDOW"===e.value.toUpperCase())for(var E=this.tokenLookAhead(),t=0;t<E.length;t++)return E[t].type===n.OPEN_PAREN&&(e.type=n.RESERVED),e;if(e.type===n.CLOSE_PAREN&&"END"===e.value.toUpperCase())for(var T=this.tokenLookBack(),r=0;r<T.length;r++){var R=T[r];return R.type===n.OPERATOR&&"."===R.value&&(e.type=n.WORD),e}}}])&&$(E.prototype,t),T&&$(E,T),R}(C);function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function re(e,E){return(re=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function Re(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=oe(e);if(E){var T=oe(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return Ne(this,t)}}function Ne(e,E){return!E||"object"!==ne(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function oe(e){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(te,"tokenizer",new S({reservedWords:["ALL","ALTER","ANALYSE","ANALYZE","ARRAY_ZIP","ARRAY","AS","ASC","AVG","BETWEEN","CASCADE","CASE","CAST","COALESCE","COLLECT_LIST","COLLECT_SET","COLUMN","COLUMNS","COMMENT","CONSTRAINT","CONTAINS","CONVERT","COUNT","CUME_DIST","CURRENT ROW","CURRENT_DATE","CURRENT_TIMESTAMP","DATABASE","DATABASES","DATE_ADD","DATE_SUB","DATE_TRUNC","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DAY","DAYS","DECODE","DEFAULT","DELETE","DENSE_RANK","DESC","DESCRIBE","DISTINCT","DISTINCTROW","DIV","DROP","ELSE","ENCODE","END","EXISTS","EXPLAIN","EXPLODE_OUTER","EXPLODE","FILTER","FIRST_VALUE","FIRST","FIXED","FLATTEN","FOLLOWING","FROM_UNIXTIME","FULL","GREATEST","GROUP_CONCAT","HOUR_MINUTE","HOUR_SECOND","HOUR","HOURS","IF","IFNULL","IN","INSERT","INTERVAL","INTO","IS","LAG","LAST_VALUE","LAST","LEAD","LEADING","LEAST","LEVEL","LIKE","MAX","MERGE","MIN","MINUTE_SECOND","MINUTE","MONTH","NATURAL","NOT","NOW()","NTILE","NULL","NULLIF","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPTIMIZE","OVER","PERCENT_RANK","PRECEDING","RANGE","RANK","REGEXP","RENAME","RLIKE","ROW","ROWS","SECOND","SEPARATOR","SEQUENCE","SIZE","STRING","STRUCT","SUM","TABLE","TABLES","TEMPORARY","THEN","TO_DATE","TO_JSON","TO","TRAILING","TRANSFORM","TRUE","TRUNCATE","TYPE","TYPES","UNBOUNDED","UNIQUE","UNIX_TIMESTAMP","UNLOCK","UNSIGNED","USING","VARIABLES","VIEW","WHEN","WITH","YEAR_MONTH"],reservedTopLevelWords:["ADD","AFTER","ALTER COLUMN","ALTER DATABASE","ALTER SCHEMA","ALTER TABLE","CLUSTER BY","CLUSTERED BY","DELETE FROM","DISTRIBUTE BY","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","LIMIT","OPTIONS","ORDER BY","PARTITION BY","PARTITIONED BY","RANGE","ROWS","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","TBLPROPERTIES","UPDATE","USING","VALUES","WHERE","WINDOW"],reservedNewlineWords:["AND","ANTI JOIN","CREATE OR","CREATE","CROSS JOIN","ELSE","FULL OUTER JOIN","INNER JOIN","JOIN","LATERAL VIEW","LEFT ANTI JOIN","LEFT JOIN","LEFT OUTER JOIN","LEFT SEMI JOIN","NATURAL ANTI JOIN","NATURAL FULL OUTER JOIN","NATURAL INNER JOIN","NATURAL JOIN","NATURAL LEFT ANTI JOIN","NATURAL LEFT OUTER JOIN","NATURAL LEFT SEMI JOIN","NATURAL OUTER JOIN","NATURAL RIGHT OUTER JOIN","NATURAL RIGHT SEMI JOIN","NATURAL SEMI JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","RIGHT SEMI JOIN","SEMI JOIN","WHEN","XOR"],reservedTopLevelWordsNoIndent:["EXCEPT ALL","EXCEPT","INTERSECT ALL","INTERSECT","UNION ALL","UNION"],stringTypes:['""',"''","``","{}"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["$"],lineCommentTypes:["--"]}));var Ae=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&re(e,E)}(t,e);var E=Re(t);function t(){return Te(this,t),E.apply(this,arguments)}return t}(C);!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(Ae,"tokenizer",new S({reservedWords:["ACCESSIBLE","ACTION","AGAINST","AGGREGATE","ALGORITHM","ALL","ALTER","ANALYSE","ANALYZE","AS","ASC","AUTOCOMMIT","AUTO_INCREMENT","BACKUP","BEGIN","BETWEEN","BINLOG","BOTH","CASCADE","CHANGE","CHANGED","CHARACTER SET","CHARSET","CHECK","CHECKSUM","COLLATE","COLLATION","COLUMN","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPRESSED","CONCURRENT","CONSTRAINT","CONTAINS","CONVERT","CREATE","CROSS","CURRENT_TIMESTAMP","DATABASE","DATABASES","DAY","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DEFAULT","DEFINER","DELAYED","DELETE","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DO","DROP","DUMPFILE","DUPLICATE","DYNAMIC","ELSE","ENCLOSED","ENGINE","ENGINES","ENGINE_TYPE","ESCAPE","ESCAPED","EVENTS","EXEC","EXECUTE","EXISTS","EXPLAIN","EXTENDED","FAST","FETCH","FIELDS","FILE","FIRST","FIXED","FLUSH","FOR","FORCE","FOREIGN","FULL","FULLTEXT","FUNCTION","GLOBAL","GRANT","GRANTS","GROUP_CONCAT","HEAP","HIGH_PRIORITY","HOSTS","HOUR","HOUR_MINUTE","HOUR_SECOND","IDENTIFIED","IF","IFNULL","IGNORE","IN","INDEX","INDEXES","INFILE","INSERT","INSERT_ID","INSERT_METHOD","INTERVAL","INTO","INVOKER","IS","ISOLATION","KEY","KEYS","KILL","LAST_INSERT_ID","LEADING","LEVEL","LIKE","LINEAR","LINES","LOAD","LOCAL","LOCK","LOCKS","LOGS","LOW_PRIORITY","MARIA","MASTER","MASTER_CONNECT_RETRY","MASTER_HOST","MASTER_LOG_FILE","MATCH","MAX_CONNECTIONS_PER_HOUR","MAX_QUERIES_PER_HOUR","MAX_ROWS","MAX_UPDATES_PER_HOUR","MAX_USER_CONNECTIONS","MEDIUM","MERGE","MINUTE","MINUTE_SECOND","MIN_ROWS","MODE","MODIFY","MONTH","MRG_MYISAM","MYISAM","NAMES","NATURAL","NOT","NOW()","NULL","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPEN","OPTIMIZE","OPTION","OPTIONALLY","OUTFILE","PACK_KEYS","PAGE","PARTIAL","PARTITION","PARTITIONS","PASSWORD","PRIMARY","PRIVILEGES","PROCEDURE","PROCESS","PROCESSLIST","PURGE","QUICK","RAID0","RAID_CHUNKS","RAID_CHUNKSIZE","RAID_TYPE","RANGE","READ","READ_ONLY","READ_WRITE","REFERENCES","REGEXP","RELOAD","RENAME","REPAIR","REPEATABLE","REPLACE","REPLICATION","RESET","RESTORE","RESTRICT","RETURN","RETURNS","REVOKE","RLIKE","ROLLBACK","ROW","ROWS","ROW_FORMAT","SECOND","SECURITY","SEPARATOR","SERIALIZABLE","SESSION","SHARE","SHOW","SHUTDOWN","SLAVE","SONAME","SOUNDS","SQL","SQL_AUTO_IS_NULL","SQL_BIG_RESULT","SQL_BIG_SELECTS","SQL_BIG_TABLES","SQL_BUFFER_RESULT","SQL_CACHE","SQL_CALC_FOUND_ROWS","SQL_LOG_BIN","SQL_LOG_OFF","SQL_LOG_UPDATE","SQL_LOW_PRIORITY_UPDATES","SQL_MAX_JOIN_SIZE","SQL_NO_CACHE","SQL_QUOTE_SHOW_CREATE","SQL_SAFE_UPDATES","SQL_SELECT_LIMIT","SQL_SLAVE_SKIP_COUNTER","SQL_SMALL_RESULT","SQL_WARNINGS","START","STARTING","STATUS","STOP","STORAGE","STRAIGHT_JOIN","STRING","STRIPED","SUPER","TABLE","TABLES","TEMPORARY","TERMINATED","THEN","TO","TRAILING","TRANSACTIONAL","TRUE","TRUNCATE","TYPE","TYPES","UNCOMMITTED","UNIQUE","UNLOCK","UNSIGNED","USAGE","USE","USING","VARIABLES","VIEW","WITH","WORK","WRITE","YEAR_MONTH"],reservedTopLevelWords:["ADD","AFTER","ALTER COLUMN","ALTER TABLE","CASE","DELETE FROM","END","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INSERT","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UPDATE","VALUES","WHERE"],reservedNewlineWords:["AND","CROSS APPLY","CROSS JOIN","ELSE","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"],reservedTopLevelWordsNoIndent:["INTERSECT","INTERSECT ALL","MINUS","UNION","UNION ALL"],stringTypes:['""',"N''","''","``","[]"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@",":"],lineCommentTypes:["#","--"]}));var Oe=function(e){var E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(E.language){case"db2":return new M(E).format(e);case"n1ql":return new G(E).format(e);case"pl/sql":return new k(E).format(e);case"redshift":return new j(E).format(e);case"spark":return new te(E).format(e);case"sql":case void 0:return new Ae(E).format(e);default:throw Error("Unsupported SQL dialect: ".concat(E.language))}};E.default={format:Oe}}])}));
!function(e,E){"object"==typeof exports&&"object"==typeof module?module.exports=E():"function"==typeof define&&define.amd?define([],E):"object"==typeof exports?exports.sqlFormatter=E():e.sqlFormatter=E()}(window,(function(){return function(e){var E={};function t(n){if(E[n])return E[n].exports;var T=E[n]={i:n,l:!1,exports:{}};return e[n].call(T.exports,T,T.exports,t),T.l=!0,T.exports}return t.m=e,t.c=E,t.d=function(e,E,n){t.o(e,E)||Object.defineProperty(e,E,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,E){if(1&E&&(e=t(e)),8&E)return e;if(4&E&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&E&&"string"!=typeof e)for(var T in e)t.d(n,T,function(E){return e[E]}.bind(null,T));return n},t.n=function(e){var E=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(E,"a",E),E},t.o=function(e,E){return Object.prototype.hasOwnProperty.call(e,E)},t.p="",t(t.s=0)}([function(e,E,t){"use strict";t.r(E),t.d(E,"format",(function(){return Oe}));var n={WHITESPACE:"whitespace",WORD:"word",STRING:"string",RESERVED:"reserved",RESERVED_TOP_LEVEL:"reserved-top-level",RESERVED_TOP_LEVEL_NO_INDENT:"reserved-top-level-no-indent",RESERVED_NEWLINE:"reserved-newline",OPERATOR:"operator",OPEN_PAREN:"open-paren",CLOSE_PAREN:"close-paren",LINE_COMMENT:"line-comment",BLOCK_COMMENT:"block-comment",NUMBER:"number",PLACEHOLDER:"placeholder"};function T(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var r=function(){function e(E){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.indent=E||" ",this.indentTypes=[]}var E,t,n;return E=e,(t=[{key:"getIndent",value:function(){return this.indent.repeat(this.indentTypes.length)}},{key:"increaseTopLevel",value:function(){this.indentTypes.push("top-level")}},{key:"increaseBlockLevel",value:function(){this.indentTypes.push("block-level")}},{key:"decreaseTopLevel",value:function(){this.indentTypes.length>0&&"top-level"===this.indentTypes[this.indentTypes.length-1]&&this.indentTypes.pop()}},{key:"decreaseBlockLevel",value:function(){for(;this.indentTypes.length>0&&"top-level"===this.indentTypes.pop(););}},{key:"resetIndentation",value:function(){this.indentTypes=[]}}])&&T(E.prototype,t),n&&T(E,n),e}();function R(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var N=function(){function e(){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.level=0}var E,t,T;return E=e,(t=[{key:"beginIfPossible",value:function(e,E){0===this.level&&this.isInlineBlock(e,E)?this.level=1:this.level>0?this.level++:this.level=0}},{key:"end",value:function(){this.level--}},{key:"isActive",value:function(){return this.level>0}},{key:"isInlineBlock",value:function(e,E){for(var t=0,T=0,r=E;r<e.length;r++){var R=e[r];if((t+=R.value.length)>50)return!1;if(R.type===n.OPEN_PAREN)T++;else if(R.type===n.CLOSE_PAREN&&0==--T)return!0;if(this.isForbiddenToken(R))return!1}return!1}},{key:"isForbiddenToken",value:function(e){var E=e.type,t=e.value;return E===n.RESERVED_TOP_LEVEL||E===n.RESERVED_NEWLINE||E===n.COMMENT||E===n.BLOCK_COMMENT||";"===t}}])&&R(E.prototype,t),T&&R(E,T),e}();function o(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var A=function(){function e(E){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.params=E,this.index=0}var E,t,n;return E=e,(t=[{key:"get",value:function(e){var E=e.key,t=e.value;return this.params?E?this.params[E]:this.params[this.index++]:t}}])&&o(E.prototype,t),n&&o(E,n),e}();function O(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function I(e){return e.replace(/[\$\(-\+\.\?\[-\^\{-\}]/g,"\\$&")}var S=function(){function e(E){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.WHITESPACE_REGEX=/^([\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+)/,this.NUMBER_REGEX=/^((\x2D[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*)?[0-9]+(\.[0-9]+)?([Ee]\x2D?[0-9]+(\.[0-9]+)?)?|0x[0-9A-Fa-f]+|0b[01]+)\b/,this.OPERATOR_REGEX=/^(!=|<<|>>|<>|==|<=|>=|!<|!>|\|\|\/|\|\/|\|\||::|\x2D>>|\x2D>|~~\*|~~|!~~\*|!~~|~\*|!~\*|!~|@|:=|(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/,this.BLOCK_COMMENT_REGEX=/^(\/\*(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:\*\/|$))/,this.LINE_COMMENT_REGEX=this.createLineCommentRegex(E.lineCommentTypes),this.RESERVED_TOP_LEVEL_REGEX=this.createReservedWordRegex(E.reservedTopLevelWords),this.RESERVED_TOP_LEVEL_NO_INDENT_REGEX=this.createReservedWordRegex(E.reservedTopLevelWordsNoIndent),this.RESERVED_NEWLINE_REGEX=this.createReservedWordRegex(E.reservedNewlineWords),this.RESERVED_PLAIN_REGEX=this.createReservedWordRegex(E.reservedWords),this.WORD_REGEX=this.createWordRegex(E.specialWordChars),this.STRING_REGEX=this.createStringRegex(E.stringTypes),this.OPEN_PAREN_REGEX=this.createParenRegex(E.openParens),this.CLOSE_PAREN_REGEX=this.createParenRegex(E.closeParens),this.INDEXED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(E.indexedPlaceholderTypes,"[0-9]*"),this.IDENT_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(E.namedPlaceholderTypes,"[a-zA-Z0-9._$]+"),this.STRING_NAMED_PLACEHOLDER_REGEX=this.createPlaceholderRegex(E.namedPlaceholderTypes,this.createStringPattern(E.stringTypes))}var E,t,T;return E=e,(t=[{key:"createLineCommentRegex",value:function(e){return new RegExp("^((?:".concat(e.map((function(e){return I(e)})).join("|"),").*?(?:\r\n|\r|\n|$))"),"u")}},{key:"createReservedWordRegex",value:function(e){if(0===e.length)return new RegExp("^\b$","u");var E=(e=e.sort((function(e,E){return E.length-e.length||e.localeCompare(E)}))).join("|").replace(/ /g,"\\s+");return new RegExp("^(".concat(E,")\\b"),"iu")}},{key:"createWordRegex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new RegExp("^([\\p{Alphabetic}\\p{Mark}\\p{Decimal_Number}\\p{Connector_Punctuation}\\p{Join_Control}".concat(e.join(""),"]+)"),"u")}},{key:"createStringRegex",value:function(e){return new RegExp("^("+this.createStringPattern(e)+")","u")}},{key:"createStringPattern",value:function(e){var E={"``":"((`[^`]*($|`))+)","{}":"((\\{[^\\}]*($|\\}))+)","[]":"((\\[[^\\]]*($|\\]))(\\][^\\]]*($|\\]))*)",'""':'(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',"''":"(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)","N''":"((N'[^N'\\\\]*(?:\\\\.[^N'\\\\]*)*('|$))+)"};return e.map((function(e){return E[e]})).join("|")}},{key:"createParenRegex",value:function(e){var E=this;return new RegExp("^("+e.map((function(e){return E.escapeParen(e)})).join("|")+")","iu")}},{key:"escapeParen",value:function(e){return 1===e.length?I(e):"\\b"+e+"\\b"}},{key:"createPlaceholderRegex",value:function(e,E){if(t=e,!Array.isArray(t)||0===t.length)return!1;var t,n=e.map(I).join("|");return new RegExp("^((?:".concat(n,")(?:").concat(E,"))"),"u")}},{key:"tokenize",value:function(e){if(!e)return[];for(var E,t=[];e.length;)E=this.getNextToken(e,E),e=e.substring(E.value.length),t.push(E);return t}},{key:"getNextToken",value:function(e,E){return this.getWhitespaceToken(e)||this.getCommentToken(e)||this.getStringToken(e)||this.getOpenParenToken(e)||this.getCloseParenToken(e)||this.getPlaceholderToken(e)||this.getNumberToken(e)||this.getReservedWordToken(e,E)||this.getWordToken(e)||this.getOperatorToken(e)}},{key:"getWhitespaceToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.WHITESPACE,regex:this.WHITESPACE_REGEX})}},{key:"getCommentToken",value:function(e){return this.getLineCommentToken(e)||this.getBlockCommentToken(e)}},{key:"getLineCommentToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.LINE_COMMENT,regex:this.LINE_COMMENT_REGEX})}},{key:"getBlockCommentToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.BLOCK_COMMENT,regex:this.BLOCK_COMMENT_REGEX})}},{key:"getStringToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.STRING,regex:this.STRING_REGEX})}},{key:"getOpenParenToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.OPEN_PAREN,regex:this.OPEN_PAREN_REGEX})}},{key:"getCloseParenToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.CLOSE_PAREN,regex:this.CLOSE_PAREN_REGEX})}},{key:"getPlaceholderToken",value:function(e){return this.getIdentNamedPlaceholderToken(e)||this.getStringNamedPlaceholderToken(e)||this.getIndexedPlaceholderToken(e)}},{key:"getIdentNamedPlaceholderToken",value:function(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.IDENT_NAMED_PLACEHOLDER_REGEX,parseKey:function(e){return e.slice(1)}})}},{key:"getStringNamedPlaceholderToken",value:function(e){var E=this;return this.getPlaceholderTokenWithKey({input:e,regex:this.STRING_NAMED_PLACEHOLDER_REGEX,parseKey:function(e){return E.getEscapedPlaceholderKey({key:e.slice(2,-1),quoteChar:e.slice(-1)})}})}},{key:"getIndexedPlaceholderToken",value:function(e){return this.getPlaceholderTokenWithKey({input:e,regex:this.INDEXED_PLACEHOLDER_REGEX,parseKey:function(e){return e.slice(1)}})}},{key:"getPlaceholderTokenWithKey",value:function(e){var E=e.input,t=e.regex,T=e.parseKey,r=this.getTokenOnFirstMatch({input:E,regex:t,type:n.PLACEHOLDER});return r&&(r.key=T(r.value)),r}},{key:"getEscapedPlaceholderKey",value:function(e){var E=e.key,t=e.quoteChar;return E.replace(new RegExp(I("\\"+t),"gu"),t)}},{key:"getNumberToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.NUMBER,regex:this.NUMBER_REGEX})}},{key:"getOperatorToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.OPERATOR,regex:this.OPERATOR_REGEX})}},{key:"getReservedWordToken",value:function(e,E){if(!E||!E.value||"."!==E.value)return this.getTopLevelReservedToken(e)||this.getNewlineReservedToken(e)||this.getTopLevelReservedTokenNoIndent(e)||this.getPlainReservedToken(e)}},{key:"getTopLevelReservedToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.RESERVED_TOP_LEVEL,regex:this.RESERVED_TOP_LEVEL_REGEX})}},{key:"getNewlineReservedToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.RESERVED_NEWLINE,regex:this.RESERVED_NEWLINE_REGEX})}},{key:"getTopLevelReservedTokenNoIndent",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.RESERVED_TOP_LEVEL_NO_INDENT,regex:this.RESERVED_TOP_LEVEL_NO_INDENT_REGEX})}},{key:"getPlainReservedToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.RESERVED,regex:this.RESERVED_PLAIN_REGEX})}},{key:"getWordToken",value:function(e){return this.getTokenOnFirstMatch({input:e,type:n.WORD,regex:this.WORD_REGEX})}},{key:"getTokenOnFirstMatch",value:function(e){var E=e.input,t=e.type,n=e.regex,T=E.match(n);if(T)return{type:t,value:T[1]}}}])&&O(E.prototype,t),T&&O(E,T),e}();function i(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function L(e,E,t){return E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t,e}var u=function(e){return e.replace(/[\t ]+$/,"")},C=function(){function e(E){!function(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}(this,e),this.cfg=E||{},this.indentation=new r(this.cfg.indent),this.inlineBlock=new N,this.params=new A(this.cfg.params),this.previousReservedToken={},this.tokens=[],this.index=0}var E,t,T;return E=e,(t=[{key:"tokenOverride",value:function(){}},{key:"format",value:function(e){return this.tokens=this.constructor.tokenizer.tokenize(e),this.getFormattedQueryFromTokens().trim()}},{key:"getFormattedQueryFromTokens",value:function(){var e=this,E="";return this.tokens.forEach((function(t,T){e.index=T,(t=e.tokenOverride(t)||t).type===n.WHITESPACE||(t.type===n.LINE_COMMENT?E=e.formatLineComment(t,E):t.type===n.BLOCK_COMMENT?E=e.formatBlockComment(t,E):t.type===n.RESERVED_TOP_LEVEL?(E=e.formatTopLevelReservedWord(t,E),e.previousReservedToken=t):t.type===n.RESERVED_TOP_LEVEL_NO_INDENT?(E=e.formatTopLevelReservedWordNoIndent(t,E),e.previousReservedToken=t):t.type===n.RESERVED_NEWLINE?(E=e.formatNewlineReservedWord(t,E),e.previousReservedToken=t):t.type===n.RESERVED?(E=e.formatWithSpaces(t,E),e.previousReservedToken=t):E=t.type===n.OPEN_PAREN?e.formatOpeningParentheses(t,E):t.type===n.CLOSE_PAREN?e.formatClosingParentheses(t,E):t.type===n.PLACEHOLDER?e.formatPlaceholder(t,E):","===t.value?e.formatComma(t,E):":"===t.value?e.formatWithSpaceAfter(t,E):"."===t.value?e.formatWithoutSpaces(t,E):";"===t.value?e.formatQuerySeparator(t,E):e.formatWithSpaces(t,E))})),E}},{key:"formatLineComment",value:function(e,E){return this.addNewline(E+e.value)}},{key:"formatBlockComment",value:function(e,E){return this.addNewline(this.addNewline(E)+this.indentComment(e.value))}},{key:"indentComment",value:function(e){return e.replace(/\n[\t ]*/g,"\n"+this.indentation.getIndent()+" ")}},{key:"formatTopLevelReservedWordNoIndent",value:function(e,E){return this.indentation.decreaseTopLevel(),E=this.addNewline(E)+this.equalizeWhitespace(this.formatReservedWord(e.value)),this.addNewline(E)}},{key:"formatTopLevelReservedWord",value:function(e,E){return this.indentation.decreaseTopLevel(),E=this.addNewline(E),this.indentation.increaseTopLevel(),E+=this.equalizeWhitespace(this.formatReservedWord(e.value)),this.addNewline(E)}},{key:"formatNewlineReservedWord",value:function(e,E){return this.addNewline(E)+this.equalizeWhitespace(this.formatReservedWord(e.value))+" "}},{key:"equalizeWhitespace",value:function(e){return e.replace(/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+/g," ")}},{key:"formatOpeningParentheses",value:function(e,E){var t;return(L(t={},n.WHITESPACE,!0),L(t,n.OPEN_PAREN,!0),L(t,n.LINE_COMMENT,!0),L(t,n.OPERATOR,!0),t)[this.previousToken().type]||(E=u(E)),E+=this.cfg.uppercase?e.value.toUpperCase():e.value,this.inlineBlock.beginIfPossible(this.tokens,this.index),this.inlineBlock.isActive()||(this.indentation.increaseBlockLevel(),E=this.addNewline(E)),E}},{key:"formatClosingParentheses",value:function(e,E){return e.value=this.cfg.uppercase?e.value.toUpperCase():e.value,this.inlineBlock.isActive()?(this.inlineBlock.end(),this.formatWithSpaceAfter(e,E)):(this.indentation.decreaseBlockLevel(),this.formatWithSpaces(e,this.addNewline(E)))}},{key:"formatPlaceholder",value:function(e,E){return E+this.params.get(e)+" "}},{key:"formatComma",value:function(e,E){return E=u(E)+e.value+" ",this.inlineBlock.isActive()||/^LIMIT$/i.test(this.previousReservedToken.value)?E:this.addNewline(E)}},{key:"formatWithSpaceAfter",value:function(e,E){return u(E)+e.value+" "}},{key:"formatWithoutSpaces",value:function(e,E){return u(E)+e.value}},{key:"formatWithSpaces",value:function(e,E){return E+("reserved"===e.type?this.formatReservedWord(e.value):e.value)+" "}},{key:"formatReservedWord",value:function(e){return this.cfg.uppercase?e.toUpperCase():e}},{key:"formatQuerySeparator",value:function(e,E){return this.indentation.resetIndentation(),u(E)+e.value+"\n".repeat(this.cfg.linesBetweenQueries||1)}},{key:"addNewline",value:function(e){return(e=u(e)).endsWith("\n")||(e+="\n"),e+this.indentation.getIndent()}},{key:"previousToken",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.tokens[this.index-e]||{}}},{key:"tokenLookBack",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,E=Math.max(0,this.index-e),t=this.index;return this.tokens.slice(E,t).reverse()}},{key:"tokenLookAhead",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,E=this.index+1,t=this.index+e+1;return this.tokens.slice(E,t)}}])&&i(E.prototype,t),T&&i(E,T),e}();function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function c(e,E){return(c=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function l(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f(e);if(E){var T=f(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return D(this,t)}}function D(e,E){return!E||"object"!==a(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}L(C,"tokenizer",new S({reservedWords:[],reservedTopLevelWords:[],reservedNewlineWords:[],reservedTopLevelWordsNoIndent:[],stringTypes:[],openParens:[],closeParens:[],indexedPlaceholderTypes:[],namedPlaceholderTypes:[],lineCommentTypes:[],specialWordChars:[]}));var P,U,p,M=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&c(e,E)}(t,e);var E=l(t);function t(){return s(this,t),E.apply(this,arguments)}return t}(C);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function _(e,E){return(_=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function d(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=F(e);if(E){var T=F(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return v(this,t)}}function v(e,E){return!E||"object"!==y(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function F(e){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}P=M,U="tokenizer",p=new S({reservedWords:["ABS","ACTIVATE","ALIAS","ALL","ALLOCATE","ALLOW","ALTER","ANY","ARE","ARRAY","AS","ASC","ASENSITIVE","ASSOCIATE","ASUTIME","ASYMMETRIC","AT","ATOMIC","ATTRIBUTES","AUDIT","AUTHORIZATION","AUX","AUXILIARY","AVG","BEFORE","BEGIN","BETWEEN","BIGINT","BINARY","BLOB","BOOLEAN","BOTH","BUFFERPOOL","BY","CACHE","CALL","CALLED","CAPTURE","CARDINALITY","CASCADED","CASE","CAST","CCSID","CEIL","CEILING","CHAR","CHARACTER","CHARACTER_LENGTH","CHAR_LENGTH","CHECK","CLOB","CLONE","CLOSE","CLUSTER","COALESCE","COLLATE","COLLECT","COLLECTION","COLLID","COLUMN","COMMENT","COMMIT","CONCAT","CONDITION","CONNECT","CONNECTION","CONSTRAINT","CONTAINS","CONTINUE","CONVERT","CORR","CORRESPONDING","COUNT","COUNT_BIG","COVAR_POP","COVAR_SAMP","CREATE","CROSS","CUBE","CUME_DIST","CURRENT","CURRENT_DATE","CURRENT_DEFAULT_TRANSFORM_GROUP","CURRENT_LC_CTYPE","CURRENT_PATH","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_SERVER","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_TIMEZONE","CURRENT_TRANSFORM_GROUP_FOR_TYPE","CURRENT_USER","CURSOR","CYCLE","DATA","DATABASE","DATAPARTITIONNAME","DATAPARTITIONNUM","DATE","DAY","DAYS","DB2GENERAL","DB2GENRL","DB2SQL","DBINFO","DBPARTITIONNAME","DBPARTITIONNUM","DEALLOCATE","DEC","DECIMAL","DECLARE","DEFAULT","DEFAULTS","DEFINITION","DELETE","DENSERANK","DENSE_RANK","DEREF","DESCRIBE","DESCRIPTOR","DETERMINISTIC","DIAGNOSTICS","DISABLE","DISALLOW","DISCONNECT","DISTINCT","DO","DOCUMENT","DOUBLE","DROP","DSSIZE","DYNAMIC","EACH","EDITPROC","ELEMENT","ELSE","ELSEIF","ENABLE","ENCODING","ENCRYPTION","END","END-EXEC","ENDING","ERASE","ESCAPE","EVERY","EXCEPTION","EXCLUDING","EXCLUSIVE","EXEC","EXECUTE","EXISTS","EXIT","EXP","EXPLAIN","EXTENDED","EXTERNAL","EXTRACT","FALSE","FENCED","FETCH","FIELDPROC","FILE","FILTER","FINAL","FIRST","FLOAT","FLOOR","FOR","FOREIGN","FREE","FULL","FUNCTION","FUSION","GENERAL","GENERATED","GET","GLOBAL","GOTO","GRANT","GRAPHIC","GROUP","GROUPING","HANDLER","HASH","HASHED_VALUE","HINT","HOLD","HOUR","HOURS","IDENTITY","IF","IMMEDIATE","IN","INCLUDING","INCLUSIVE","INCREMENT","INDEX","INDICATOR","INDICATORS","INF","INFINITY","INHERIT","INNER","INOUT","INSENSITIVE","INSERT","INT","INTEGER","INTEGRITY","INTERSECTION","INTERVAL","INTO","IS","ISOBID","ISOLATION","ITERATE","JAR","JAVA","KEEP","KEY","LABEL","LANGUAGE","LARGE","LATERAL","LC_CTYPE","LEADING","LEAVE","LEFT","LIKE","LINKTYPE","LN","LOCAL","LOCALDATE","LOCALE","LOCALTIME","LOCALTIMESTAMP","LOCATOR","LOCATORS","LOCK","LOCKMAX","LOCKSIZE","LONG","LOOP","LOWER","MAINTAINED","MATCH","MATERIALIZED","MAX","MAXVALUE","MEMBER","MERGE","METHOD","MICROSECOND","MICROSECONDS","MIN","MINUTE","MINUTES","MINVALUE","MOD","MODE","MODIFIES","MODULE","MONTH","MONTHS","MULTISET","NAN","NATIONAL","NATURAL","NCHAR","NCLOB","NEW","NEW_TABLE","NEXTVAL","NO","NOCACHE","NOCYCLE","NODENAME","NODENUMBER","NOMAXVALUE","NOMINVALUE","NONE","NOORDER","NORMALIZE","NORMALIZED","NOT","NULL","NULLIF","NULLS","NUMERIC","NUMPARTS","OBID","OCTET_LENGTH","OF","OFFSET","OLD","OLD_TABLE","ON","ONLY","OPEN","OPTIMIZATION","OPTIMIZE","OPTION","ORDER","OUT","OUTER","OVER","OVERLAPS","OVERLAY","OVERRIDING","PACKAGE","PADDED","PAGESIZE","PARAMETER","PART","PARTITION","PARTITIONED","PARTITIONING","PARTITIONS","PASSWORD","PATH","PERCENTILE_CONT","PERCENTILE_DISC","PERCENT_RANK","PIECESIZE","PLAN","POSITION","POWER","PRECISION","PREPARE","PREVVAL","PRIMARY","PRIQTY","PRIVILEGES","PROCEDURE","PROGRAM","PSID","PUBLIC","QUERY","QUERYNO","RANGE","RANK","READ","READS","REAL","RECOVERY","RECURSIVE","REF","REFERENCES","REFERENCING","REFRESH","REGR_AVGX","REGR_AVGY","REGR_COUNT","REGR_INTERCEPT","REGR_R2","REGR_SLOPE","REGR_SXX","REGR_SXY","REGR_SYY","RELEASE","RENAME","REPEAT","RESET","RESIGNAL","RESTART","RESTRICT","RESULT","RESULT_SET_LOCATOR","RETURN","RETURNS","REVOKE","RIGHT","ROLE","ROLLBACK","ROLLUP","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_HALF_UP","ROUND_UP","ROUTINE","ROW","ROWNUMBER","ROWS","ROWSET","ROW_NUMBER","RRN","RUN","SAVEPOINT","SCHEMA","SCOPE","SCRATCHPAD","SCROLL","SEARCH","SECOND","SECONDS","SECQTY","SECURITY","SENSITIVE","SEQUENCE","SESSION","SESSION_USER","SIGNAL","SIMILAR","SIMPLE","SMALLINT","SNAN","SOME","SOURCE","SPECIFIC","SPECIFICTYPE","SQL","SQLEXCEPTION","SQLID","SQLSTATE","SQLWARNING","SQRT","STACKED","STANDARD","START","STARTING","STATEMENT","STATIC","STATMENT","STAY","STDDEV_POP","STDDEV_SAMP","STOGROUP","STORES","STYLE","SUBMULTISET","SUBSTRING","SUM","SUMMARY","SYMMETRIC","SYNONYM","SYSFUN","SYSIBM","SYSPROC","SYSTEM","SYSTEM_USER","TABLE","TABLESAMPLE","TABLESPACE","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRANSACTION","TRANSLATE","TRANSLATION","TREAT","TRIGGER","TRIM","TRUE","TRUNCATE","TYPE","UESCAPE","UNDO","UNIQUE","UNKNOWN","UNNEST","UNTIL","UPPER","USAGE","USER","USING","VALIDPROC","VALUE","VARCHAR","VARIABLE","VARIANT","VARYING","VAR_POP","VAR_SAMP","VCAT","VERSION","VIEW","VOLATILE","VOLUMES","WHEN","WHENEVER","WHILE","WIDTH_BUCKET","WINDOW","WITH","WITHIN","WITHOUT","WLM","WRITE","XMLELEMENT","XMLEXISTS","XMLNAMESPACES","YEAR","YEARS"],reservedTopLevelWords:["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INTERSECT","LIMIT","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UPDATE","VALUES","WHERE"],reservedNewlineWords:["AND","CROSS JOIN","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN"],reservedTopLevelWordsNoIndent:["INTERSECT","INTERSECT ALL","MINUS","UNION","UNION ALL"],stringTypes:['""',"''","``","[]"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["#","@"]}),U in P?Object.defineProperty(P,U,{value:p,enumerable:!0,configurable:!0,writable:!0}):P[U]=p;var G=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&_(e,E)}(t,e);var E=d(t);function t(){return h(this,t),E.apply(this,arguments)}return t}(C);function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function H(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function g(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function W(e,E){return(W=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function m(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=b(e);if(E){var T=b(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return Y(this,t)}}function Y(e,E){return!E||"object"!==B(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(G,"tokenizer",new S({reservedWords:["ALL","ALTER","ANALYZE","AND","ANY","ARRAY","AS","ASC","BEGIN","BETWEEN","BINARY","BOOLEAN","BREAK","BUCKET","BUILD","BY","CALL","CASE","CAST","CLUSTER","COLLATE","COLLECTION","COMMIT","CONNECT","CONTINUE","CORRELATE","COVER","CREATE","DATABASE","DATASET","DATASTORE","DECLARE","DECREMENT","DELETE","DERIVED","DESC","DESCRIBE","DISTINCT","DO","DROP","EACH","ELEMENT","ELSE","END","EVERY","EXCEPT","EXCLUDE","EXECUTE","EXISTS","EXPLAIN","FALSE","FETCH","FIRST","FLATTEN","FOR","FORCE","FROM","FUNCTION","GRANT","GROUP","GSI","HAVING","IF","IGNORE","ILIKE","IN","INCLUDE","INCREMENT","INDEX","INFER","INLINE","INNER","INSERT","INTERSECT","INTO","IS","JOIN","KEY","KEYS","KEYSPACE","KNOWN","LAST","LEFT","LET","LETTING","LIKE","LIMIT","LSM","MAP","MAPPING","MATCHED","MATERIALIZED","MERGE","MISSING","NAMESPACE","NEST","NOT","NULL","NUMBER","OBJECT","OFFSET","ON","OPTION","OR","ORDER","OUTER","OVER","PARSE","PARTITION","PASSWORD","PATH","POOL","PREPARE","PRIMARY","PRIVATE","PRIVILEGE","PROCEDURE","PUBLIC","RAW","REALM","REDUCE","RENAME","RETURN","RETURNING","REVOKE","RIGHT","ROLE","ROLLBACK","SATISFIES","SCHEMA","SELECT","SELF","SEMI","SET","SHOW","SOME","START","STATISTICS","STRING","SYSTEM","THEN","TO","TRANSACTION","TRIGGER","TRUE","TRUNCATE","UNDER","UNION","UNIQUE","UNKNOWN","UNNEST","UNSET","UPDATE","UPSERT","USE","USER","USING","VALIDATE","VALUE","VALUED","VALUES","VIA","VIEW","WHEN","WHERE","WHILE","WITH","WITHIN","WORK","XOR"],reservedTopLevelWords:["DELETE FROM","EXCEPT ALL","EXCEPT","EXPLAIN DELETE FROM","EXPLAIN UPDATE","EXPLAIN UPSERT","FROM","GROUP BY","HAVING","INFER","INSERT INTO","LET","LIMIT","MERGE","NEST","ORDER BY","PREPARE","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNNEST","UPDATE","UPSERT","USE KEYS","VALUES","WHERE"],reservedNewlineWords:["AND","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","XOR"],reservedTopLevelWordsNoIndent:["INTERSECT","INTERSECT ALL","MINUS","UNION","UNION ALL"],stringTypes:['""',"''","``"],openParens:["(","[","{"],closeParens:[")","]","}"],namedPlaceholderTypes:["$"],lineCommentTypes:["#","--"]}));var k=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&W(e,E)}(R,e);var E,t,T,r=m(R);function R(){return H(this,R),r.apply(this,arguments)}return E=R,(t=[{key:"tokenOverride",value:function(e){if(e.type===n.RESERVED_TOP_LEVEL&&"SET"===e.value.toUpperCase()&&"BY"===this.previousReservedToken.value.toUpperCase())return e.type=n.RESERVED,e}}])&&g(E.prototype,t),T&&g(E,T),R}(C);function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function w(e,E){return(w=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function K(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=J(e);if(E){var T=J(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return x(this,t)}}function x(e,E){return!E||"object"!==V(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function J(e){return(J=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(k,"tokenizer",new S({reservedWords:["A","ACCESSIBLE","AGENT","AGGREGATE","ALL","ALTER","ANY","ARRAY","AS","ASC","AT","ATTRIBUTE","AUTHID","AVG","BETWEEN","BFILE_BASE","BINARY_INTEGER","BINARY","BLOB_BASE","BLOCK","BODY","BOOLEAN","BOTH","BOUND","BREADTH","BULK","BY","BYTE","C","CALL","CALLING","CASCADE","CASE","CHAR_BASE","CHAR","CHARACTER","CHARSET","CHARSETFORM","CHARSETID","CHECK","CLOB_BASE","CLONE","CLOSE","CLUSTER","CLUSTERS","COALESCE","COLAUTH","COLLECT","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPILED","COMPRESS","CONNECT","CONSTANT","CONSTRUCTOR","CONTEXT","CONTINUE","CONVERT","COUNT","CRASH","CREATE","CREDENTIAL","CURRENT","CURRVAL","CURSOR","CUSTOMDATUM","DANGLING","DATA","DATE_BASE","DATE","DAY","DECIMAL","DEFAULT","DEFINE","DELETE","DEPTH","DESC","DETERMINISTIC","DIRECTORY","DISTINCT","DO","DOUBLE","DROP","DURATION","ELEMENT","ELSIF","EMPTY","END","ESCAPE","EXCEPTIONS","EXCLUSIVE","EXECUTE","EXISTS","EXIT","EXTENDS","EXTERNAL","EXTRACT","FALSE","FETCH","FINAL","FIRST","FIXED","FLOAT","FOR","FORALL","FORCE","FROM","FUNCTION","GENERAL","GOTO","GRANT","GROUP","HASH","HEAP","HIDDEN","HOUR","IDENTIFIED","IF","IMMEDIATE","IN","INCLUDING","INDEX","INDEXES","INDICATOR","INDICES","INFINITE","INSTANTIABLE","INT","INTEGER","INTERFACE","INTERVAL","INTO","INVALIDATE","IS","ISOLATION","JAVA","LANGUAGE","LARGE","LEADING","LENGTH","LEVEL","LIBRARY","LIKE","LIKE2","LIKE4","LIKEC","LIMITED","LOCAL","LOCK","LONG","MAP","MAX","MAXLEN","MEMBER","MERGE","MIN","MINUTE","MLSLABEL","MOD","MODE","MONTH","MULTISET","NAME","NAN","NATIONAL","NATIVE","NATURAL","NATURALN","NCHAR","NEW","NEXTVAL","NOCOMPRESS","NOCOPY","NOT","NOWAIT","NULL","NULLIF","NUMBER_BASE","NUMBER","OBJECT","OCICOLL","OCIDATE","OCIDATETIME","OCIDURATION","OCIINTERVAL","OCILOBLOCATOR","OCINUMBER","OCIRAW","OCIREF","OCIREFCURSOR","OCIROWID","OCISTRING","OCITYPE","OF","OLD","ON","ONLY","OPAQUE","OPEN","OPERATOR","OPTION","ORACLE","ORADATA","ORDER","ORGANIZATION","ORLANY","ORLVARY","OTHERS","OUT","OVERLAPS","OVERRIDING","PACKAGE","PARALLEL_ENABLE","PARAMETER","PARAMETERS","PARENT","PARTITION","PASCAL","PCTFREE","PIPE","PIPELINED","PLS_INTEGER","PLUGGABLE","POSITIVE","POSITIVEN","PRAGMA","PRECISION","PRIOR","PRIVATE","PROCEDURE","PUBLIC","RAISE","RANGE","RAW","READ","REAL","RECORD","REF","REFERENCE","RELEASE","RELIES_ON","REM","REMAINDER","RENAME","RESOURCE","RESULT_CACHE","RESULT","RETURN","RETURNING","REVERSE","REVOKE","ROLLBACK","ROW","ROWID","ROWNUM","ROWTYPE","SAMPLE","SAVE","SAVEPOINT","SB1","SB2","SB4","SEARCH","SECOND","SEGMENT","SELF","SEPARATE","SEQUENCE","SERIALIZABLE","SHARE","SHORT","SIZE_T","SIZE","SMALLINT","SOME","SPACE","SPARSE","SQL","SQLCODE","SQLDATA","SQLERRM","SQLNAME","SQLSTATE","STANDARD","START","STATIC","STDDEV","STORED","STRING","STRUCT","STYLE","SUBMULTISET","SUBPARTITION","SUBSTITUTABLE","SUBTYPE","SUCCESSFUL","SUM","SYNONYM","SYSDATE","TABAUTH","TABLE","TDO","THE","THEN","TIME","TIMESTAMP","TIMEZONE_ABBR","TIMEZONE_HOUR","TIMEZONE_MINUTE","TIMEZONE_REGION","TO","TRAILING","TRANSACTION","TRANSACTIONAL","TRIGGER","TRUE","TRUSTED","TYPE","UB1","UB2","UB4","UID","UNDER","UNIQUE","UNPLUG","UNSIGNED","UNTRUSTED","USE","USER","USING","VALIDATE","VALIST","VALUE","VARCHAR","VARCHAR2","VARIABLE","VARIANCE","VARRAY","VARYING","VIEW","VIEWS","VOID","WHENEVER","WHILE","WITH","WORK","WRAPPED","WRITE","YEAR","ZONE"],reservedTopLevelWords:["ADD","ALTER COLUMN","ALTER TABLE","BEGIN","CONNECT BY","DECLARE","DELETE FROM","DELETE","END","EXCEPT","EXCEPTION","FETCH FIRST","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","LIMIT","LOOP","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","START WITH","UPDATE","VALUES","WHERE"],reservedNewlineWords:["AND","CROSS APPLY","CROSS JOIN","ELSE","END","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"],reservedTopLevelWordsNoIndent:["INTERSECT","INTERSECT ALL","MINUS","UNION","UNION ALL"],stringTypes:['""',"N''","''","``"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:[":"],lineCommentTypes:["--"],specialWordChars:["_","$","#",".","@"]}));var j=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&w(e,E)}(t,e);var E=K(t);function t(){return X(this,t),E.apply(this,arguments)}return t}(C);function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function $(e,E){for(var t=0;t<E.length;t++){var n=E[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function z(e,E){return(z=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function q(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=Ee(e);if(E){var T=Ee(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return ee(this,t)}}function ee(e,E){return!E||"object"!==Q(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(j,"tokenizer",new S({reservedWords:["AES128","AES256","ALLOWOVERWRITE","ANALYSE","ARRAY","AS","ASC","AUTHORIZATION","BACKUP","BINARY","BLANKSASNULL","BOTH","BYTEDICT","BZIP2","CAST","CHECK","COLLATE","COLUMN","CONSTRAINT","CREATE","CREDENTIALS","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURRENT_USER_ID","DEFAULT","DEFERRABLE","DEFLATE","DEFRAG","DELTA","DELTA32K","DESC","DISABLE","DISTINCT","DO","ELSE","EMPTYASNULL","ENABLE","ENCODE","ENCRYPT","ENCRYPTION","END","EXPLICIT","FALSE","FOR","FOREIGN","FREEZE","FULL","GLOBALDICT256","GLOBALDICT64K","GRANT","GZIP","IDENTITY","IGNORE","ILIKE","INITIALLY","INTO","LEADING","LOCALTIME","LOCALTIMESTAMP","LUN","LUNS","LZO","LZOP","MINUS","MOSTLY13","MOSTLY32","MOSTLY8","NATURAL","NEW","NULLS","OFF","OFFLINE","OFFSET","OLD","ON","ONLY","OPEN","ORDER","OVERLAPS","PARALLEL","PARTITION","PERCENT","PERMISSIONS","PLACING","PRIMARY","RAW","READRATIO","RECOVER","REFERENCES","REJECTLOG","RESORT","RESTORE","SESSION_USER","SIMILAR","SYSDATE","SYSTEM","TABLE","TAG","TDES","TEXT255","TEXT32K","THEN","TIMESTAMP","TO","TOP","TRAILING","TRUE","TRUNCATECOLUMNS","UNIQUE","USER","USING","VERBOSE","WALLET","WHEN","WITH","WITHOUT","PREDICATE","COLUMNS","COMPROWS","COMPRESSION","COPY","FORMAT","DELIMITER","FIXEDWIDTH","AVRO","JSON","ENCRYPTED","BZIP2","GZIP","LZOP","PARQUET","ORC","ACCEPTANYDATE","ACCEPTINVCHARS","BLANKSASNULL","DATEFORMAT","EMPTYASNULL","ENCODING","ESCAPE","EXPLICIT_IDS","FILLRECORD","IGNOREBLANKLINES","IGNOREHEADER","NULL AS","REMOVEQUOTES","ROUNDEC","TIMEFORMAT","TRIMBLANKS","TRUNCATECOLUMNS","COMPROWS","COMPUPDATE","MAXERROR","NOLOAD","STATUPDATE","MANIFEST","REGION","IAM_ROLE","MASTER_SYMMETRIC_KEY","SSH","ACCEPTANYDATE","ACCEPTINVCHARS","ACCESS_KEY_ID","SECRET_ACCESS_KEY","AVRO","BLANKSASNULL","BZIP2","COMPROWS","COMPUPDATE","CREDENTIALS","DATEFORMAT","DELIMITER","EMPTYASNULL","ENCODING","ENCRYPTED","ESCAPE","EXPLICIT_IDS","FILLRECORD","FIXEDWIDTH","FORMAT","IAM_ROLE","GZIP","IGNOREBLANKLINES","IGNOREHEADER","JSON","LZOP","MANIFEST","MASTER_SYMMETRIC_KEY","MAXERROR","NOLOAD","NULL AS","READRATIO","REGION","REMOVEQUOTES","ROUNDEC","SSH","STATUPDATE","TIMEFORMAT","SESSION_TOKEN","TRIMBLANKS","TRUNCATECOLUMNS","EXTERNAL","DATA CATALOG","HIVE METASTORE","CATALOG_ROLE","VACUUM","COPY","UNLOAD","EVEN","ALL"],reservedTopLevelWords:["ADD","AFTER","ALTER COLUMN","ALTER TABLE","DELETE FROM","EXCEPT","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","INTERSECT","TOP","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UNION ALL","UNION","UPDATE","VALUES","WHERE","VACUUM","COPY","UNLOAD","ANALYZE","ANALYSE","DISTKEY","SORTKEY","COMPOUND","INTERLEAVED","FORMAT","DELIMITER","FIXEDWIDTH","AVRO","JSON","ENCRYPTED","BZIP2","GZIP","LZOP","PARQUET","ORC","ACCEPTANYDATE","ACCEPTINVCHARS","BLANKSASNULL","DATEFORMAT","EMPTYASNULL","ENCODING","ESCAPE","EXPLICIT_IDS","FILLRECORD","IGNOREBLANKLINES","IGNOREHEADER","NULL AS","REMOVEQUOTES","ROUNDEC","TIMEFORMAT","TRIMBLANKS","TRUNCATECOLUMNS","COMPROWS","COMPUPDATE","MAXERROR","NOLOAD","STATUPDATE","MANIFEST","REGION","IAM_ROLE","MASTER_SYMMETRIC_KEY","SSH","ACCEPTANYDATE","ACCEPTINVCHARS","ACCESS_KEY_ID","SECRET_ACCESS_KEY","AVRO","BLANKSASNULL","BZIP2","COMPROWS","COMPUPDATE","CREDENTIALS","DATEFORMAT","DELIMITER","EMPTYASNULL","ENCODING","ENCRYPTED","ESCAPE","EXPLICIT_IDS","FILLRECORD","FIXEDWIDTH","FORMAT","IAM_ROLE","GZIP","IGNOREBLANKLINES","IGNOREHEADER","JSON","LZOP","MANIFEST","MASTER_SYMMETRIC_KEY","MAXERROR","NOLOAD","NULL AS","READRATIO","REGION","REMOVEQUOTES","ROUNDEC","SSH","STATUPDATE","TIMEFORMAT","SESSION_TOKEN","TRIMBLANKS","TRUNCATECOLUMNS","EXTERNAL","DATA CATALOG","HIVE METASTORE","CATALOG_ROLE"],reservedNewlineWords:["AND","CROSS JOIN","ELSE","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","VACUUM","COPY","UNLOAD","ANALYZE","ANALYSE","DISTKEY","SORTKEY","COMPOUND","INTERLEAVED"],reservedTopLevelWordsNoIndent:[],stringTypes:['""',"''","``"],openParens:["("],closeParens:[")"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@","#","$"],lineCommentTypes:["--"]}));var te=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&z(e,E)}(R,e);var E,t,T,r=q(R);function R(){return Z(this,R),r.apply(this,arguments)}return E=R,(t=[{key:"tokenOverride",value:function(e){if(e.type===n.RESERVED_TOP_LEVEL&&"WINDOW"===e.value.toUpperCase())for(var E=this.tokenLookAhead(),t=0;t<E.length;t++)return E[t].type===n.OPEN_PAREN&&(e.type=n.RESERVED),e;if(e.type===n.CLOSE_PAREN&&"END"===e.value.toUpperCase())for(var T=this.tokenLookBack(),r=0;r<T.length;r++){var R=T[r];return R.type===n.OPERATOR&&"."===R.value&&(e.type=n.WORD),e}}}])&&$(E.prototype,t),T&&$(E,T),R}(C);function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,E){if(!(e instanceof E))throw new TypeError("Cannot call a class as a function")}function re(e,E){return(re=Object.setPrototypeOf||function(e,E){return e.__proto__=E,e})(e,E)}function Re(e){var E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=oe(e);if(E){var T=oe(this).constructor;t=Reflect.construct(n,arguments,T)}else t=n.apply(this,arguments);return Ne(this,t)}}function Ne(e,E){return!E||"object"!==ne(E)&&"function"!=typeof E?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):E}function oe(e){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(te,"tokenizer",new S({reservedWords:["ALL","ALTER","ANALYSE","ANALYZE","ARRAY_ZIP","ARRAY","AS","ASC","AVG","BETWEEN","CASCADE","CASE","CAST","COALESCE","COLLECT_LIST","COLLECT_SET","COLUMN","COLUMNS","COMMENT","CONSTRAINT","CONTAINS","CONVERT","COUNT","CUME_DIST","CURRENT ROW","CURRENT_DATE","CURRENT_TIMESTAMP","DATABASE","DATABASES","DATE_ADD","DATE_SUB","DATE_TRUNC","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DAY","DAYS","DECODE","DEFAULT","DELETE","DENSE_RANK","DESC","DESCRIBE","DISTINCT","DISTINCTROW","DIV","DROP","ELSE","ENCODE","END","EXISTS","EXPLAIN","EXPLODE_OUTER","EXPLODE","FILTER","FIRST_VALUE","FIRST","FIXED","FLATTEN","FOLLOWING","FROM_UNIXTIME","FULL","GREATEST","GROUP_CONCAT","HOUR_MINUTE","HOUR_SECOND","HOUR","HOURS","IF","IFNULL","IN","INSERT","INTERVAL","INTO","IS","LAG","LAST_VALUE","LAST","LEAD","LEADING","LEAST","LEVEL","LIKE","MAX","MERGE","MIN","MINUTE_SECOND","MINUTE","MONTH","NATURAL","NOT","NOW()","NTILE","NULL","NULLIF","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPTIMIZE","OVER","PERCENT_RANK","PRECEDING","RANGE","RANK","REGEXP","RENAME","RLIKE","ROW","ROWS","SECOND","SEPARATOR","SEQUENCE","SIZE","STRING","STRUCT","SUM","TABLE","TABLES","TEMPORARY","THEN","TO_DATE","TO_JSON","TO","TRAILING","TRANSFORM","TRUE","TRUNCATE","TYPE","TYPES","UNBOUNDED","UNIQUE","UNIX_TIMESTAMP","UNLOCK","UNSIGNED","USING","VARIABLES","VIEW","WHEN","WITH","YEAR_MONTH"],reservedTopLevelWords:["ADD","AFTER","ALTER COLUMN","ALTER DATABASE","ALTER SCHEMA","ALTER TABLE","CLUSTER BY","CLUSTERED BY","DELETE FROM","DISTRIBUTE BY","FROM","GROUP BY","HAVING","INSERT INTO","INSERT","LIMIT","OPTIONS","ORDER BY","PARTITION BY","PARTITIONED BY","RANGE","ROWS","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","TBLPROPERTIES","UPDATE","USING","VALUES","WHERE","WINDOW"],reservedNewlineWords:["AND","ANTI JOIN","CREATE OR","CREATE","CROSS JOIN","ELSE","FULL OUTER JOIN","INNER JOIN","JOIN","LATERAL VIEW","LEFT ANTI JOIN","LEFT JOIN","LEFT OUTER JOIN","LEFT SEMI JOIN","NATURAL ANTI JOIN","NATURAL FULL OUTER JOIN","NATURAL INNER JOIN","NATURAL JOIN","NATURAL LEFT ANTI JOIN","NATURAL LEFT OUTER JOIN","NATURAL LEFT SEMI JOIN","NATURAL OUTER JOIN","NATURAL RIGHT OUTER JOIN","NATURAL RIGHT SEMI JOIN","NATURAL SEMI JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","RIGHT SEMI JOIN","SEMI JOIN","WHEN","XOR"],reservedTopLevelWordsNoIndent:["EXCEPT ALL","EXCEPT","INTERSECT ALL","INTERSECT","UNION ALL","UNION"],stringTypes:['""',"''","``","{}"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["$"],lineCommentTypes:["--"]}));var Ae=function(e){!function(e,E){if("function"!=typeof E&&null!==E)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(E&&E.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),E&&re(e,E)}(t,e);var E=Re(t);function t(){return Te(this,t),E.apply(this,arguments)}return t}(C);!function(e,E,t){E in e?Object.defineProperty(e,E,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[E]=t}(Ae,"tokenizer",new S({reservedWords:["ACCESSIBLE","ACTION","AGAINST","AGGREGATE","ALGORITHM","ALL","ALTER","ANALYSE","ANALYZE","AS","ASC","AUTOCOMMIT","AUTO_INCREMENT","BACKUP","BEGIN","BETWEEN","BINLOG","BOTH","CASCADE","CHANGE","CHANGED","CHARACTER SET","CHARSET","CHECK","CHECKSUM","COLLATE","COLLATION","COLUMN","COLUMNS","COMMENT","COMMIT","COMMITTED","COMPRESSED","CONCURRENT","CONSTRAINT","CONTAINS","CONVERT","CREATE","CROSS","CURRENT_TIMESTAMP","DATABASE","DATABASES","DAY","DAY_HOUR","DAY_MINUTE","DAY_SECOND","DEFAULT","DEFINER","DELAYED","DELETE","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DO","DROP","DUMPFILE","DUPLICATE","DYNAMIC","ELSE","ENCLOSED","ENGINE","ENGINES","ENGINE_TYPE","ESCAPE","ESCAPED","EVENTS","EXEC","EXECUTE","EXISTS","EXPLAIN","EXTENDED","FAST","FETCH","FIELDS","FILE","FIRST","FIXED","FLUSH","FOR","FORCE","FOREIGN","FULL","FULLTEXT","FUNCTION","GLOBAL","GRANT","GRANTS","GROUP_CONCAT","HEAP","HIGH_PRIORITY","HOSTS","HOUR","HOUR_MINUTE","HOUR_SECOND","IDENTIFIED","IF","IFNULL","IGNORE","IN","INDEX","INDEXES","INFILE","INSERT","INSERT_ID","INSERT_METHOD","INTERVAL","INTO","INVOKER","IS","ISOLATION","KEY","KEYS","KILL","LAST_INSERT_ID","LEADING","LEVEL","LIKE","LINEAR","LINES","LOAD","LOCAL","LOCK","LOCKS","LOGS","LOW_PRIORITY","MARIA","MASTER","MASTER_CONNECT_RETRY","MASTER_HOST","MASTER_LOG_FILE","MATCH","MAX_CONNECTIONS_PER_HOUR","MAX_QUERIES_PER_HOUR","MAX_ROWS","MAX_UPDATES_PER_HOUR","MAX_USER_CONNECTIONS","MEDIUM","MERGE","MINUTE","MINUTE_SECOND","MIN_ROWS","MODE","MODIFY","MONTH","MRG_MYISAM","MYISAM","NAMES","NATURAL","NOT","NOW()","NULL","OFFSET","ON DELETE","ON UPDATE","ON","ONLY","OPEN","OPTIMIZE","OPTION","OPTIONALLY","OUTFILE","PACK_KEYS","PAGE","PARTIAL","PARTITION","PARTITIONS","PASSWORD","PRIMARY","PRIVILEGES","PROCEDURE","PROCESS","PROCESSLIST","PURGE","QUICK","RAID0","RAID_CHUNKS","RAID_CHUNKSIZE","RAID_TYPE","RANGE","READ","READ_ONLY","READ_WRITE","REFERENCES","REGEXP","RELOAD","RENAME","REPAIR","REPEATABLE","REPLACE","REPLICATION","RESET","RESTORE","RESTRICT","RETURN","RETURNS","REVOKE","RLIKE","ROLLBACK","ROW","ROWS","ROW_FORMAT","SECOND","SECURITY","SEPARATOR","SERIALIZABLE","SESSION","SHARE","SHOW","SHUTDOWN","SLAVE","SONAME","SOUNDS","SQL","SQL_AUTO_IS_NULL","SQL_BIG_RESULT","SQL_BIG_SELECTS","SQL_BIG_TABLES","SQL_BUFFER_RESULT","SQL_CACHE","SQL_CALC_FOUND_ROWS","SQL_LOG_BIN","SQL_LOG_OFF","SQL_LOG_UPDATE","SQL_LOW_PRIORITY_UPDATES","SQL_MAX_JOIN_SIZE","SQL_NO_CACHE","SQL_QUOTE_SHOW_CREATE","SQL_SAFE_UPDATES","SQL_SELECT_LIMIT","SQL_SLAVE_SKIP_COUNTER","SQL_SMALL_RESULT","SQL_WARNINGS","START","STARTING","STATUS","STOP","STORAGE","STRAIGHT_JOIN","STRING","STRIPED","SUPER","TABLE","TABLES","TEMPORARY","TERMINATED","THEN","TO","TRAILING","TRANSACTIONAL","TRUE","TRUNCATE","TYPE","TYPES","UNCOMMITTED","UNIQUE","UNLOCK","UNSIGNED","USAGE","USE","USING","VARIABLES","VIEW","WITH","WORK","WRITE","YEAR_MONTH"],reservedTopLevelWords:["ADD","AFTER","ALTER COLUMN","ALTER TABLE","CASE","DELETE FROM","END","EXCEPT","FETCH FIRST","FROM","GROUP BY","GO","HAVING","INSERT INTO","INSERT","LIMIT","MODIFY","ORDER BY","SELECT","SET CURRENT SCHEMA","SET SCHEMA","SET","UPDATE","VALUES","WHERE"],reservedNewlineWords:["AND","CROSS APPLY","CROSS JOIN","ELSE","INNER JOIN","JOIN","LEFT JOIN","LEFT OUTER JOIN","OR","OUTER APPLY","OUTER JOIN","RIGHT JOIN","RIGHT OUTER JOIN","WHEN","XOR"],reservedTopLevelWordsNoIndent:["INTERSECT","INTERSECT ALL","MINUS","UNION","UNION ALL"],stringTypes:['""',"N''","''","``","[]"],openParens:["(","CASE"],closeParens:[")","END"],indexedPlaceholderTypes:["?"],namedPlaceholderTypes:["@",":"],lineCommentTypes:["#","--"]}));var Oe=function(e){var E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(E.language){case"db2":return new M(E).format(e);case"n1ql":return new G(E).format(e);case"pl/sql":return new k(E).format(e);case"redshift":return new j(E).format(e);case"spark":return new te(E).format(e);case"sql":case void 0:return new Ae(E).format(e);default:throw Error("Unsupported SQL dialect: ".concat(E.language))}};E.default={format:Oe}}])}));
//# sourceMappingURL=sql-formatter.min.js.map
{
"name": "@gwax/sql-formatter",
"version": "3.0.0-alpha.1",
"version": "3.0.0-alpha.2",
"description": "Format whitespace in a SQL query to make it more readable",

@@ -36,4 +36,4 @@ "license": "MIT",

"build:commonjs": "babel src --out-dir lib",
"build:umd": "webpack --mode=\"development\"",
"build:umd:min": "webpack --mode=\"production\"",
"build:umd": "webpack --config webpack.dev.js",
"build:umd:min": "webpack --config webpack.prod.js",
"prepare": "npm run clean && npm run check && npm run build"

@@ -67,3 +67,4 @@ },

"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
"webpack-cli": "^3.3.12",
"webpack-merge": "^5.0.8"
},

@@ -70,0 +71,0 @@ "jest": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc