@nocobase/plugin-collection-fdw 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +99 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/07d37b2045cf49ac.js +10 -0
  6. package/dist/client/19796e1ee00c3777.js +10 -0
  7. package/dist/client/545679e3c044a8fb.js +10 -0
  8. package/dist/client/components/CreateDatabaseServerAction.d.ts +10 -0
  9. package/dist/client/components/DatabaseServerSelect.d.ts +20 -0
  10. package/dist/client/components/EditDatabaseServerAction.d.ts +10 -0
  11. package/dist/client/components/PreviewFields.d.ts +10 -0
  12. package/dist/client/components/PreviewTable.d.ts +10 -0
  13. package/dist/client/components/RemoteTableSelect.d.ts +10 -0
  14. package/dist/client/components/SyncFieldsAction.d.ts +11 -0
  15. package/dist/client/components/UnSupportFields.d.ts +12 -0
  16. package/dist/client/components/schema.d.ts +19 -0
  17. package/dist/client/dccc3127ba4bb534.js +10 -0
  18. package/dist/client/ff008086e5ac8e5e.js +10 -0
  19. package/dist/client/hooks.d.ts +20 -0
  20. package/dist/client/index.d.ts +13 -0
  21. package/dist/client/index.js +10 -0
  22. package/dist/externalVersion.js +24 -0
  23. package/dist/index.d.ts +9 -0
  24. package/dist/index.js +42 -0
  25. package/dist/locale/de-DE.json +17 -0
  26. package/dist/locale/en-US.json +17 -0
  27. package/dist/locale/es-ES.json +17 -0
  28. package/dist/locale/fr-FR.json +17 -0
  29. package/dist/locale/hu-HU.json +17 -0
  30. package/dist/locale/id-ID.json +17 -0
  31. package/dist/locale/index.d.ts +10 -0
  32. package/dist/locale/index.js +42 -0
  33. package/dist/locale/it-IT.json +17 -0
  34. package/dist/locale/ja-JP.json +17 -0
  35. package/dist/locale/ko-KR.json +17 -0
  36. package/dist/locale/nl-NL.json +17 -0
  37. package/dist/locale/pt-BR.json +17 -0
  38. package/dist/locale/ru-RU.json +18 -0
  39. package/dist/locale/tr-TR.json +17 -0
  40. package/dist/locale/uk-UA.json +17 -0
  41. package/dist/locale/vi-VN.json +17 -0
  42. package/dist/locale/zh-CN.json +17 -0
  43. package/dist/locale/zh-TW.json +17 -0
  44. package/dist/node_modules/node-sql-parser/LICENSE +201 -0
  45. package/dist/node_modules/node-sql-parser/ast/postgresql.ts +1834 -0
  46. package/dist/node_modules/node-sql-parser/build/bigquery.d.ts +1 -0
  47. package/dist/node_modules/node-sql-parser/build/bigquery.js +2 -0
  48. package/dist/node_modules/node-sql-parser/build/db2.d.ts +1 -0
  49. package/dist/node_modules/node-sql-parser/build/db2.js +2 -0
  50. package/dist/node_modules/node-sql-parser/build/flinksql.d.ts +1 -0
  51. package/dist/node_modules/node-sql-parser/build/flinksql.js +2 -0
  52. package/dist/node_modules/node-sql-parser/build/hive.d.ts +1 -0
  53. package/dist/node_modules/node-sql-parser/build/hive.js +2 -0
  54. package/dist/node_modules/node-sql-parser/build/mariadb.d.ts +1 -0
  55. package/dist/node_modules/node-sql-parser/build/mariadb.js +2 -0
  56. package/dist/node_modules/node-sql-parser/build/mysql.d.ts +1 -0
  57. package/dist/node_modules/node-sql-parser/build/mysql.js +2 -0
  58. package/dist/node_modules/node-sql-parser/build/noql.d.ts +1 -0
  59. package/dist/node_modules/node-sql-parser/build/noql.js +2 -0
  60. package/dist/node_modules/node-sql-parser/build/postgresql.d.ts +1 -0
  61. package/dist/node_modules/node-sql-parser/build/postgresql.js +2 -0
  62. package/dist/node_modules/node-sql-parser/build/snowflake.d.ts +1 -0
  63. package/dist/node_modules/node-sql-parser/build/snowflake.js +2 -0
  64. package/dist/node_modules/node-sql-parser/build/sqlite.d.ts +1 -0
  65. package/dist/node_modules/node-sql-parser/build/sqlite.js +2 -0
  66. package/dist/node_modules/node-sql-parser/build/transactsql.d.ts +1 -0
  67. package/dist/node_modules/node-sql-parser/build/transactsql.js +2 -0
  68. package/dist/node_modules/node-sql-parser/index.d.ts +1 -0
  69. package/dist/node_modules/node-sql-parser/index.js +1 -0
  70. package/dist/node_modules/node-sql-parser/lib/aggregation.js +39 -0
  71. package/dist/node_modules/node-sql-parser/lib/alter.js +174 -0
  72. package/dist/node_modules/node-sql-parser/lib/analyze.js +40 -0
  73. package/dist/node_modules/node-sql-parser/lib/array-struct.js +60 -0
  74. package/dist/node_modules/node-sql-parser/lib/assign.js +33 -0
  75. package/dist/node_modules/node-sql-parser/lib/binary.js +46 -0
  76. package/dist/node_modules/node-sql-parser/lib/case.js +39 -0
  77. package/dist/node_modules/node-sql-parser/lib/column.js +221 -0
  78. package/dist/node_modules/node-sql-parser/lib/command.js +299 -0
  79. package/dist/node_modules/node-sql-parser/lib/constrain.js +45 -0
  80. package/dist/node_modules/node-sql-parser/lib/create.js +439 -0
  81. package/dist/node_modules/node-sql-parser/lib/delete.js +42 -0
  82. package/dist/node_modules/node-sql-parser/lib/exec.js +37 -0
  83. package/dist/node_modules/node-sql-parser/lib/expr.js +123 -0
  84. package/dist/node_modules/node-sql-parser/lib/func.js +152 -0
  85. package/dist/node_modules/node-sql-parser/lib/index-definition.js +106 -0
  86. package/dist/node_modules/node-sql-parser/lib/insert.js +111 -0
  87. package/dist/node_modules/node-sql-parser/lib/interval.js +28 -0
  88. package/dist/node_modules/node-sql-parser/lib/json.js +28 -0
  89. package/dist/node_modules/node-sql-parser/lib/limit.js +45 -0
  90. package/dist/node_modules/node-sql-parser/lib/over.js +39 -0
  91. package/dist/node_modules/node-sql-parser/lib/parser.all.js +33 -0
  92. package/dist/node_modules/node-sql-parser/lib/parser.js +82 -0
  93. package/dist/node_modules/node-sql-parser/lib/parser.single.js +23 -0
  94. package/dist/node_modules/node-sql-parser/lib/proc.js +39 -0
  95. package/dist/node_modules/node-sql-parser/lib/select.js +132 -0
  96. package/dist/node_modules/node-sql-parser/lib/show.js +88 -0
  97. package/dist/node_modules/node-sql-parser/lib/sql.js +43 -0
  98. package/dist/node_modules/node-sql-parser/lib/tables.js +211 -0
  99. package/dist/node_modules/node-sql-parser/lib/transaction.js +26 -0
  100. package/dist/node_modules/node-sql-parser/lib/union.js +81 -0
  101. package/dist/node_modules/node-sql-parser/lib/update.js +59 -0
  102. package/dist/node_modules/node-sql-parser/lib/util.js +444 -0
  103. package/dist/node_modules/node-sql-parser/lib/window.js +85 -0
  104. package/dist/node_modules/node-sql-parser/lib/with.js +37 -0
  105. package/dist/node_modules/node-sql-parser/package.json +1 -0
  106. package/dist/node_modules/node-sql-parser/types.d.ts +227 -0
  107. package/dist/node_modules/node-sql-parser/umd/bigquery.umd.d.ts +1 -0
  108. package/dist/node_modules/node-sql-parser/umd/bigquery.umd.js +2 -0
  109. package/dist/node_modules/node-sql-parser/umd/db2.umd.d.ts +1 -0
  110. package/dist/node_modules/node-sql-parser/umd/db2.umd.js +2 -0
  111. package/dist/node_modules/node-sql-parser/umd/flinksql.umd.d.ts +1 -0
  112. package/dist/node_modules/node-sql-parser/umd/flinksql.umd.js +2 -0
  113. package/dist/node_modules/node-sql-parser/umd/hive.umd.d.ts +1 -0
  114. package/dist/node_modules/node-sql-parser/umd/hive.umd.js +2 -0
  115. package/dist/node_modules/node-sql-parser/umd/index.umd.d.ts +1 -0
  116. package/dist/node_modules/node-sql-parser/umd/index.umd.js +2 -0
  117. package/dist/node_modules/node-sql-parser/umd/mariadb.umd.d.ts +1 -0
  118. package/dist/node_modules/node-sql-parser/umd/mariadb.umd.js +2 -0
  119. package/dist/node_modules/node-sql-parser/umd/mysql.umd.d.ts +1 -0
  120. package/dist/node_modules/node-sql-parser/umd/mysql.umd.js +2 -0
  121. package/dist/node_modules/node-sql-parser/umd/noql.umd.d.ts +1 -0
  122. package/dist/node_modules/node-sql-parser/umd/noql.umd.js +2 -0
  123. package/dist/node_modules/node-sql-parser/umd/postgresql.umd.d.ts +1 -0
  124. package/dist/node_modules/node-sql-parser/umd/postgresql.umd.js +2 -0
  125. package/dist/node_modules/node-sql-parser/umd/snowflake.umd.d.ts +1 -0
  126. package/dist/node_modules/node-sql-parser/umd/snowflake.umd.js +2 -0
  127. package/dist/node_modules/node-sql-parser/umd/sqlite.umd.d.ts +1 -0
  128. package/dist/node_modules/node-sql-parser/umd/sqlite.umd.js +2 -0
  129. package/dist/node_modules/node-sql-parser/umd/transactsql.umd.d.ts +1 -0
  130. package/dist/node_modules/node-sql-parser/umd/transactsql.umd.js +2 -0
  131. package/dist/server/bridges/mariadb-to-mariadb.d.ts +3 -0
  132. package/dist/server/bridges/mariadb-to-mariadb.js +38 -0
  133. package/dist/server/bridges/mysql-to-mysql.d.ts +13 -0
  134. package/dist/server/bridges/mysql-to-mysql.js +117 -0
  135. package/dist/server/bridges/mysql-to-pg.d.ts +8 -0
  136. package/dist/server/bridges/mysql-to-pg.js +9 -0
  137. package/dist/server/bridges/pg-to-pg.d.ts +21 -0
  138. package/dist/server/bridges/pg-to-pg.js +137 -0
  139. package/dist/server/bridges/remote-local-bridge.d.ts +57 -0
  140. package/dist/server/bridges/remote-local-bridge.js +73 -0
  141. package/dist/server/collections/database-server-collection.d.ts +10 -0
  142. package/dist/server/collections/database-server-collection.js +54 -0
  143. package/dist/server/foreign-data-collection.d.ts +22 -0
  144. package/dist/server/foreign-data-collection.js +118 -0
  145. package/dist/server/index.d.ts +9 -0
  146. package/dist/server/index.js +42 -0
  147. package/dist/server/models/database-server.d.ts +29 -0
  148. package/dist/server/models/database-server.js +226 -0
  149. package/dist/server/plugin.d.ts +14 -0
  150. package/dist/server/plugin.js +111 -0
  151. package/dist/server/resourcers/tables.d.ts +17 -0
  152. package/dist/server/resourcers/tables.js +181 -0
  153. package/package.json +43 -0
  154. package/server.d.ts +2 -0
  155. package/server.js +1 -0
@@ -0,0 +1,2 @@
1
+ !function(r,t){for(var e in t)r[e]=t[e]}(exports,function(r){var t={};function e(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=r,e.c=t,e.d=function(r,t,n){e.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:n})},e.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},e.t=function(r,t){if(1&t&&(r=e(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)e.d(n,o,function(t){return r[t]}.bind(null,o));return n},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,"a",t),t},e.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},e.p="",e(e.s=1)}([function(r,t,e){"use strict";var n=e(2);function o(r,t,e,n){this.message=r,this.expected=t,this.found=e,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,o)}!function(r,t){function e(){this.constructor=r}e.prototype=t.prototype,r.prototype=new e}(o,Error),o.buildMessage=function(r,t){var e={literal:function(r){return'"'+o(r.text)+'"'},class:function(r){var t,e="";for(t=0;t<r.parts.length;t++)e+=r.parts[t]instanceof Array?s(r.parts[t][0])+"-"+s(r.parts[t][1]):s(r.parts[t]);return"["+(r.inverted?"^":"")+e+"]"},any:function(r){return"any character"},end:function(r){return"end of input"},other:function(r){return r.description}};function n(r){return r.charCodeAt(0).toString(16).toUpperCase()}function o(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}function s(r){return r.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}return"Expected "+function(r){var t,n,o,s=new Array(r.length);for(t=0;t<r.length;t++)s[t]=(o=r[t],e[o.type](o));if(s.sort(),s.length>0){for(t=1,n=1;t<s.length;t++)s[t-1]!==s[t]&&(s[n]=s[t],n++);s.length=n}switch(s.length){case 1:return s[0];case 2:return s[0]+" or "+s[1];default:return s.slice(0,-1).join(", ")+", or "+s[s.length-1]}}(r)+" but "+function(r){return r?'"'+o(r)+'"':"end of input"}(t)+" found."},r.exports={SyntaxError:o,parse:function(r,t){t=void 0!==t?t:{};var e,s={},u={start:ii},a=ii,i=function(r,t){return Kb(r,t)},c=function(r,t){return{...r,order_by:t&&t.toLowerCase()}},l=function(r,t){return Kb(r,t,1)},f=ei("IF",!0),b="IDENTIFIED",p=ei("IDENTIFIED",!1),v=ei("WITH",!0),d=ei("BY",!0),y=ei("RANDOM",!0),w=ei("PASSWORD",!0),h=ei("AS",!0),L=function(r,t){return Kb(r,t)},C=ei("role",!0),m=ei("NONE",!0),E=ei("SSL",!0),A=ei("X509",!0),_=ei("CIPHER",!0),T=ei("ISSUER",!0),g=ei("SUBJECT",!0),S=function(r,t){return t.prefix=r.toLowerCase(),t},I=ei("REQUIRE",!0),N=ei("MAX_QUERIES_PER_HOUR",!0),R=ei("MAX_UPDATES_PER_HOUR",!0),O=ei("MAX_CONNECTIONS_PER_HOUR",!0),j=ei("MAX_USER_CONNECTIONS",!0),x=ei("EXPIRE",!0),k=ei("DEFAULT",!0),U=ei("NEVER",!0),M=ei("HISTORY",!0),D=ei("REUSE",!1),P=ei("CURRENT",!0),$=ei("OPTIONAL",!0),G=ei("FAILED_LOGIN_ATTEMPTS",!0),F=ei("PASSWORD_LOCK_TIME",!0),H=ei("UNBOUNDED",!0),Y=ei("ACCOUNT",!0),W=ei("LOCK",!0),B=ei("UNLOCK",!0),q=ei("ATTRIBUTE",!0),V=ei("CASCADED",!0),X=ei("LOCAL",!0),K=ei("CHECK",!0),Q=ei("OPTION",!1),z=ei("ALGORITHM",!0),Z=ei("UNDEFINED",!0),J=ei("MERGE",!0),rr=ei("TEMPTABLE",!0),tr=ei("SQL",!0),er=ei("SECURITY",!0),nr=ei("DEFINER",!0),or=ei("INVOKER",!0),sr=function(r,t){return Kb(r,t)},ur=ei("AUTO_INCREMENT",!0),ar=ei("UNIQUE",!0),ir=ei("KEY",!0),cr=ei("PRIMARY",!0),lr=ei("@",!1),fr=ei("BEFORE",!0),br=ei("AFTER",!0),pr=ei("FOR",!0),vr=ei("EACH",!0),dr=ei("ROW",!0),yr=ei("STATEMENT",!0),wr=ei("FOLLOWS",!0),hr=ei("PRECEDES",!0),Lr=ei("COLUMN_FORMAT",!0),Cr=ei("FIXED",!0),mr=ei("DYNAMIC",!0),Er=ei("STORAGE",!0),Ar=ei("DISK",!0),_r=ei("MEMORY",!0),Tr=ei("GENERATED",!0),gr=ei("ALWAYS",!0),Sr=ei("STORED",!0),Ir=ei("VIRTUAL",!0),Nr=ei("if",!0),Rr=ei("exists",!0),Or=ei("FOREIGN",!0),jr=ei("INSTANT",!0),xr=ei("INPLACE",!0),kr=ei("COPY",!0),Ur=ei("SHARED",!0),Mr=ei("EXCLUSIVE",!0),Dr=ei("CHANGE",!0),Pr=ei("FIRST",!0),$r=/^[0-9]/,Gr=ni([["0","9"]],!1,!1),Fr=ei("PRIMARY KEY",!0),Hr=ei("FOREIGN KEY",!0),Yr=ei("ENFORCED",!0),Wr=ei("MATCH FULL",!0),Br=ei("MATCH PARTIAL",!0),qr=ei("MATCH SIMPLE",!0),Vr=ei("RESTRICT",!0),Xr=ei("CASCADE",!0),Kr=ei("SET NULL",!0),Qr=ei("NO ACTION",!0),zr=ei("SET DEFAULT",!0),Zr=ei("CHARACTER",!0),Jr=ei("SET",!0),rt=ei("CHARSET",!0),tt=ei("COLLATE",!0),et=ei("AVG_ROW_LENGTH",!0),nt=ei("KEY_BLOCK_SIZE",!0),ot=ei("MAX_ROWS",!0),st=ei("MIN_ROWS",!0),ut=ei("STATS_SAMPLE_PAGES",!0),at=ei("CHECKSUM",!1),it=ei("DELAY_KEY_WRITE",!1),ct=/^[01]/,lt=ni(["0","1"],!1,!1),ft=ei("CONNECTION",!0),bt=ei("ENGINE_ATTRIBUTE",!0),pt=ei("SECONDARY_ENGINE_ATTRIBUTE",!0),vt=ei("DATA",!0),dt=ei("INDEX",!0),yt=ei("DIRECTORY",!0),wt=ei("COMPRESSION",!0),ht=ei("'",!1),Lt=ei("ZLIB",!0),Ct=ei("LZ4",!0),mt=ei("ENGINE",!0),Et=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:e.toUpperCase()}},At=ei("ROW_FORMAT",!0),_t=ei("COMPRESSED",!0),Tt=ei("REDUNDANT",!0),gt=ei("COMPACT",!0),St=ei("BINARY",!0),It=ei("MASTER",!0),Nt=ei("LOGS",!0),Rt=ei("TRIGGERS",!0),Ot=ei("STATUS",!0),jt=ei("PROCESSLIST",!0),xt=ei("PROCEDURE",!0),kt=ei("FUNCTION",!0),Ut=ei("BINLOG",!0),Mt=ei("EVENTS",!0),Dt=ei("COLLATION",!0),Pt=ei("DATABASES",!0),$t=ei("COLUMNS",!0),Gt=ei("INDEXES",!0),Ft=ei("EVENT",!0),Ht=ei("GRANTS",!0),Yt=function(r,t){return Kb(r,t)},Wt=ei("READ",!0),Bt=ei("LOW_PRIORITY",!0),qt=ei("WRITE",!0),Vt=ei("VIEW",!0),Xt=ei("GRANT",!0),Kt=ei("OPTION",!0),Qt=function(r){return{type:"origin",value:Array.isArray(r)?r[0]:r}},zt=ei("ROUTINE",!0),Zt=ei("EXECUTE",!0),Jt=ei("ADMIN",!0),re=ei("GRANT",!1),te=ei("PROXY",!1),ee=ei("(",!1),ne=ei(")",!1),oe=ei("IN",!0),se=ei("SHARE",!0),ue=ei("MODE",!0),ae=ei("WAIT",!0),ie=ei("NOWAIT",!0),ce=ei("SKIP",!0),le=ei("LOCKED",!0),fe=ei("NATURAL",!0),be=ei("LANGUAGE",!0),pe=ei("QUERY",!0),ve=ei("EXPANSION",!0),de=ei("BOOLEAN",!0),ye=ei("MATCH",!0),we=ei("AGAINST",!1),he=ei("OUTFILE",!0),Le=ei("DUMPFILE",!0),Ce=ei("BTREE",!0),me=ei("HASH",!0),Ee=ei("PARSER",!0),Ae=ei("VISIBLE",!0),_e=ei("INVISIBLE",!0),Te=function(r,t){return t.unshift(r),t.forEach(r=>{const{table:t,as:e}=r;ep[t]=t,e&&(ep[e]=t),function(r){const t=Zb(r);r.clear(),t.forEach(t=>r.add(t))}(tp)}),t},ge=/^[_0-9]/,Se=ni(["_",["0","9"]],!1,!1),Ie=ei("?",!1),Ne=ei("=",!1),Re=ei("DUPLICATE",!0),Oe=function(r,t){return Qb(r,t)},je=function(r){return r[0]+" "+r[2]},xe=ei(">=",!1),ke=ei(">",!1),Ue=ei("<=",!1),Me=ei("<>",!1),De=ei("<",!1),Pe=ei("!=",!1),$e=ei("ESCAPE",!0),Ge=ei("+",!1),Fe=ei("-",!1),He=ei("*",!1),Ye=ei("/",!1),We=ei("%",!1),Be=ei("||",!1),qe=ei("div",!0),Ve=ei("&",!1),Xe=ei(">>",!1),Ke=ei("<<",!1),Qe=ei("^",!1),ze=ei("|",!1),Ze=ei("!",!1),Je=ei("~",!1),rn=function(r){return!0===Wb[r.toUpperCase()]},tn=ei('"',!1),en=/^[^"]/,nn=ni(['"'],!0,!1),on=function(r){return r.join("")},sn=/^[^']/,un=ni(["'"],!0,!1),an=ei("`",!1),cn=/^[^`\\]/,ln=ni(["`","\\"],!0,!1),fn=function(r,t){return r+t.join("")},bn=/^[A-Za-z_]/,pn=ni([["A","Z"],["a","z"],"_"],!1,!1),vn=/^[A-Za-z0-9_$]/,dn=ni([["A","Z"],["a","z"],["0","9"],"_","$"],!1,!1),yn=/^[A-Za-z0-9_:]/,wn=ni([["A","Z"],["a","z"],["0","9"],"_",":"],!1,!1),hn=ei(":",!1),Ln=ei("NOW",!0),Cn=ei("OVER",!0),mn=ei("WINDOW",!0),En=ei("FOLLOWING",!0),An=ei("PRECEDING",!0),_n=ei("SEPARATOR",!0),Tn=ei("YEAR_MONTH",!0),gn=ei("DAY_HOUR",!0),Sn=ei("DAY_MINUTE",!0),In=ei("DAY_SECOND",!0),Nn=ei("DAY_MICROSECOND",!0),Rn=ei("HOUR_MINUTE",!0),On=ei("HOUR_SECOND",!0),jn=ei("HOUR_MICROSECOND",!0),xn=ei("MINUTE_SECOND",!0),kn=ei("MINUTE_MICROSECOND",!0),Un=ei("SECOND_MICROSECOND",!0),Mn=ei("TIMEZONE_HOUR",!0),Dn=ei("TIMEZONE_MINUTE",!0),Pn=ei("CENTURY",!0),$n=ei("DAY",!0),Gn=ei("DATE",!0),Fn=ei("DECADE",!0),Hn=ei("DOW",!0),Yn=ei("DOY",!0),Wn=ei("EPOCH",!0),Bn=ei("HOUR",!0),qn=ei("ISODOW",!0),Vn=ei("ISOWEEK",!0),Xn=ei("ISOYEAR",!0),Kn=ei("MICROSECONDS",!0),Qn=ei("MILLENNIUM",!0),zn=ei("MILLISECONDS",!0),Zn=ei("MINUTE",!0),Jn=ei("MONTH",!0),ro=ei("QUARTER",!0),to=ei("SECOND",!0),eo=ei("TIME",!0),no=ei("TIMEZONE",!0),oo=ei("WEEK",!0),so=ei("YEAR",!0),uo=ei("DATE_TRUNC",!0),ao=ei("BOTH",!0),io=ei("LEADING",!0),co=ei("TRAILING",!0),lo=ei("trim",!0),fo=ei("convert",!0),bo=ei("binary",!0),po=ei("_binary",!0),vo=ei("_latin1",!0),yo=ei("X",!0),wo=/^[0-9A-Fa-f]/,ho=ni([["0","9"],["A","F"],["a","f"]],!1,!1),Lo=ei("b",!0),Co=ei("0x",!0),mo=ei("N",!0),Eo=function(r,t){return{type:r.toLowerCase(),value:t[1].join("")}},Ao=/^[^"\\\0-\x1F\x7F]/,_o=ni(['"',"\\",["\0",""],""],!0,!1),To=/^[^'\\]/,go=ni(["'","\\"],!0,!1),So=ei("\\'",!1),Io=ei('\\"',!1),No=ei("\\\\",!1),Ro=ei("\\/",!1),Oo=ei("\\b",!1),jo=ei("\\f",!1),xo=ei("\\n",!1),ko=ei("\\r",!1),Uo=ei("\\t",!1),Mo=ei("\\u",!1),Do=ei("\\",!1),Po=ei("''",!1),$o=ei('""',!1),Go=ei("``",!1),Fo=/^[\n\r]/,Ho=ni(["\n","\r"],!1,!1),Yo=ei(".",!1),Wo=/^[0-9a-fA-F]/,Bo=ni([["0","9"],["a","f"],["A","F"]],!1,!1),qo=/^[eE]/,Vo=ni(["e","E"],!1,!1),Xo=/^[+\-]/,Ko=ni(["+","-"],!1,!1),Qo=ei("NULL",!0),zo=ei("NOT NULL",!0),Zo=ei("TRUE",!0),Jo=ei("TO",!0),rs=ei("FALSE",!0),ts=ei("SHOW",!0),es=ei("DROP",!0),ns=ei("USE",!0),os=ei("ALTER",!0),ss=ei("SELECT",!0),us=ei("UPDATE",!0),as=ei("CREATE",!0),is=ei("TEMPORARY",!0),cs=ei("DELETE",!0),ls=ei("INSERT",!0),fs=ei("RECURSIVE",!1),bs=ei("REPLACE",!0),ps=ei("RENAME",!0),vs=ei("IGNORE",!0),ds=(ei("EXPLAIN",!0),ei("PARTITION",!0)),ys=ei("INTO",!0),ws=ei("FROM",!0),hs=ei("TABLE",!0),Ls=ei("TRIGGER",!0),Cs=ei("TABLES",!0),ms=ei("DATABASE",!0),Es=ei("SCHEMA",!0),As=ei("ON",!0),_s=ei("LEFT",!0),Ts=ei("RIGHT",!0),gs=ei("FULL",!0),Ss=ei("INNER",!0),Is=ei("CROSS",!0),Ns=ei("JOIN",!0),Rs=ei("OUTER",!0),Os=ei("UNION",!0),js=ei("MINUS",!0),xs=ei("INTERSECT",!0),ks=ei("VALUES",!0),Us=ei("USING",!0),Ms=ei("WHERE",!0),Ds=ei("GROUP",!0),Ps=ei("ORDER",!0),$s=ei("HAVING",!0),Gs=ei("LIMIT",!0),Fs=ei("OFFSET",!0),Hs=ei("ASC",!0),Ys=ei("DESC",!0),Ws=ei("DESCRIBE",!0),Bs=ei("ALL",!0),qs=ei("DISTINCT",!0),Vs=ei("BETWEEN",!0),Xs=ei("IS",!0),Ks=ei("LIKE",!0),Qs=ei("RLIKE",!0),zs=ei("REGEXP",!0),Zs=ei("EXISTS",!0),Js=ei("NOT",!0),ru=ei("AND",!0),tu=ei("OR",!0),eu=ei("COUNT",!0),nu=ei("GROUP_CONCAT",!0),ou=ei("MAX",!0),su=ei("MIN",!0),uu=ei("SUM",!0),au=ei("AVG",!0),iu=ei("EXTRACT",!0),cu=ei("CALL",!0),lu=ei("CASE",!0),fu=ei("WHEN",!0),bu=ei("THEN",!0),pu=ei("ELSE",!0),vu=ei("END",!0),du=ei("CAST",!0),yu=ei("VARBINARY",!0),wu=ei("BIT",!0),hu=ei("CHAR",!0),Lu=ei("VARCHAR",!0),Cu=ei("NUMERIC",!0),mu=ei("DECIMAL",!0),Eu=ei("SIGNED",!0),Au=ei("UNSIGNED",!0),_u=ei("INT",!0),Tu=ei("ZEROFILL",!0),gu=ei("INTEGER",!0),Su=ei("JSON",!0),Iu=ei("SMALLINT",!0),Nu=ei("MEDIUMINT",!0),Ru=ei("TINYINT",!0),Ou=ei("TINYTEXT",!0),ju=ei("TEXT",!0),xu=ei("MEDIUMTEXT",!0),ku=ei("LONGTEXT",!0),Uu=ei("BIGINT",!0),Mu=ei("ENUM",!0),Du=ei("FLOAT",!0),Pu=ei("DOUBLE",!0),$u=ei("DATETIME",!0),Gu=ei("ROWS",!0),Fu=ei("TIMESTAMP",!0),Hu=ei("TRUNCATE",!0),Yu=ei("USER",!0),Wu=ei("CURRENT_DATE",!0),Bu=(ei("ADDDATE",!0),ei("INTERVAL",!0)),qu=ei("CURRENT_TIME",!0),Vu=ei("CURRENT_TIMESTAMP",!0),Xu=ei("CURRENT_USER",!0),Ku=ei("SESSION_USER",!0),Qu=ei("SYSTEM_USER",!0),zu=ei("GLOBAL",!0),Zu=ei("SESSION",!0),Ju=ei("PERSIST",!0),ra=ei("PERSIST_ONLY",!0),ta=ei("GEOMETRY",!0),ea=ei("POINT",!0),na=ei("LINESTRING",!0),oa=ei("POLYGON",!0),sa=ei("MULTIPOINT",!0),ua=ei("MULTILINESTRING",!0),aa=ei("MULTIPOLYGON",!0),ia=ei("GEOMETRYCOLLECTION",!0),ca=ei("@@",!1),la=ei("$",!1),fa=ei("return",!0),ba=ei(":=",!1),pa=ei("DUAL",!0),va=ei("ADD",!0),da=ei("COLUMN",!0),ya=ei("MODIFY",!0),wa=ei("FULLTEXT",!0),ha=ei("SPATIAL",!0),La=ei("COMMENT",!0),Ca=ei("CONSTRAINT",!0),ma=ei("REFERENCES",!0),Ea=ei("SQL_CALC_FOUND_ROWS",!0),Aa=ei("SQL_CACHE",!0),_a=ei("SQL_NO_CACHE",!0),Ta=ei("SQL_SMALL_RESULT",!0),ga=ei("SQL_BIG_RESULT",!0),Sa=ei("SQL_BUFFER_RESULT",!0),Ia=ei(",",!1),Na=ei("[",!1),Ra=ei("]",!1),Oa=ei(";",!1),ja=ei("&&",!1),xa=ei("XOR",!0),ka=ei("/*",!1),Ua=ei("*/",!1),Ma=ei("--",!1),Da=ei("#",!1),Pa={type:"any"},$a=/^[ \t\n\r]/,Ga=ni([" ","\t","\n","\r"],!1,!1),Fa=function(r,t,e){return{type:"assign",left:r,symbol:t,right:e}},Ha=ei("boolean",!0),Ya=ei("blob",!0),Wa=ei("tinyblob",!0),Ba=ei("mediumblob",!0),qa=ei("longblob",!0),Va=function(r){return{dataType:r}},Xa=/^[0-6]/,Ka=ni([["0","6"]],!1,!1),Qa=function(r){return{dataType:r}},za=0,Za=[{line:1,column:1}],Ja=0,ri=[],ti=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');a=u[t.startRule]}function ei(r,t){return{type:"literal",text:r,ignoreCase:t}}function ni(r,t,e){return{type:"class",parts:r,inverted:t,ignoreCase:e}}function oi(t){var e,n=Za[t];if(n)return n;for(e=t-1;!Za[e];)e--;for(n={line:(n=Za[e]).line,column:n.column};e<t;)10===r.charCodeAt(e)?(n.line++,n.column=1):n.column++,e++;return Za[t]=n,n}function si(r,t){var e=oi(r),n=oi(t);return{start:{offset:r,line:e.line,column:e.column},end:{offset:t,line:n.line,column:n.column}}}function ui(r){za<Ja||(za>Ja&&(Ja=za,ri=[]),ri.push(r))}function ai(r,t,e){return new o(o.buildMessage(r,t),r,t,e)}function ii(){var r,t;return r=za,Eb()!==s&&(t=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=li())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=Cb())!==s&&(a=Eb())!==s&&(i=li())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=Cb())!==s&&(a=Eb())!==s&&(i=li())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=function(r,t){const e=r&&r.ast||r,n=t&&t.length&&t[0].length>=4?[e]:e;for(let r=0;r<t.length;r++)t[r][3]&&0!==t[r][3].length&&n.push(t[r][3]&&t[r][3].ast||t[r][3]);return{tableList:Array.from(rp),columnList:Zb(tp),ast:n}}(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(r,r=t):(za=r,r=s),r}function ci(){var t;return(t=function(){var r,t,e,n,o,u,a;r=za,(t=Gl())!==s&&Eb()!==s&&(e=ef())!==s&&Eb()!==s?((n=_i())===s&&(n=null),n!==s&&Eb()!==s&&(o=ic())!==s?(r,i=t,c=e,f=n,(b=o)&&b.forEach(r=>rp.add(`${i}::${r.db}::${r.table}`)),t={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:i.toLowerCase(),keyword:c.toLowerCase(),prefix:f,name:b}},r=t):(za=r,r=s)):(za=r,r=s);var i,c,f,b;r===s&&(r=za,(t=Gl())!==s&&Eb()!==s&&(e=tb())!==s&&Eb()!==s?((n=_i())===s&&(n=null),n!==s&&Eb()!==s&&(o=ic())!==s&&Eb()!==s?((u=Ui())===s&&(u=null),u!==s?(r,t=function(r,t,e,n,o){return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:r.toLowerCase(),keyword:t.toLowerCase(),prefix:e,name:n,options:[{type:"origin",value:o}]}}}(t,e,n,o,u),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s),r===s&&(r=za,(t=Gl())!==s&&Eb()!==s&&(e=ib())!==s&&Eb()!==s&&(n=Zc())!==s&&Eb()!==s&&(o=af())!==s&&Eb()!==s&&(u=bc())!==s&&Eb()!==s?((a=function(){var r,t,e,n,o,u;r=za,(t=gi())===s&&(t=Si());if(t!==s){for(e=[],n=za,(o=Eb())!==s?((u=gi())===s&&(u=Si()),u!==s?n=o=[o,u]:(za=n,n=s)):(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s?((u=gi())===s&&(u=Si()),u!==s?n=o=[o,u]:(za=n,n=s)):(za=n,n=s);e!==s?(r,t=l(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())===s&&(a=null),a!==s&&Eb()!==s?(r,t=function(r,t,e,n,o){return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:r.toLowerCase(),keyword:t.toLowerCase(),name:e,table:n,options:o}}}(t,e,n,u,a),r=t):(za=r,r=s)):(za=r,r=s),r===s&&(r=za,(t=Gl())!==s&&Eb()!==s?((e=sf())===s&&(e=uf()),e!==s&&Eb()!==s?((n=_i())===s&&(n=null),n!==s&&Eb()!==s&&(o=ul())!==s?(r,t=function(r,t,e,n){return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:r.toLowerCase(),keyword:t.toLowerCase(),prefix:e,name:n}}}(t,e,n,o),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s),r===s&&(r=za,(t=Gl())!==s&&Eb()!==s&&(e=nf())!==s&&Eb()!==s?((n=_i())===s&&(n=null),n!==s&&Eb()!==s&&(o=lc())!==s?(r,t=function(r,t,e,n){return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:r.toLowerCase(),keyword:t.toLowerCase(),prefix:e,name:[{schema:n.db,trigger:n.table}]}}}(t,e,n,o),r=t):(za=r,r=s)):(za=r,r=s)))));return r}())===s&&(t=function(){var t;(t=function(){var r,t,e,n,o,u,a,c,l,f;r=za,(t=Wl())!==s&&Eb()!==s?((e=Bl())===s&&(e=null),e!==s&&Eb()!==s&&ef()!==s&&Eb()!==s?((n=vi())===s&&(n=null),n!==s&&Eb()!==s&&(o=ic())!==s&&Eb()!==s&&(u=function(){var r,t,e,n,o,u,a,i,c;if(r=za,(t=hb())!==s)if(Eb()!==s)if((e=Li())!==s){for(n=[],o=za,(u=Eb())!==s&&(a=yb())!==s&&(i=Eb())!==s&&(c=Li())!==s?o=u=[u,a,i,c]:(za=o,o=s);o!==s;)n.push(o),o=za,(u=Eb())!==s&&(a=yb())!==s&&(i=Eb())!==s&&(c=Li())!==s?o=u=[u,a,i,c]:(za=o,o=s);n!==s&&(o=Eb())!==s&&(u=Lb())!==s?(r,t=sr(e,n),r=t):(za=r,r=s)}else za=r,r=s;else za=r,r=s;else za=r,r=s;return r}())!==s&&Eb()!==s?((a=function(){var r,t,e,n,o,u,a,c;if(r=za,(t=Pi())!==s){for(e=[],n=za,(o=Eb())!==s?((u=yb())===s&&(u=null),u!==s&&(a=Eb())!==s&&(c=Pi())!==s?n=o=[o,u,a,c]:(za=n,n=s)):(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s?((u=yb())===s&&(u=null),u!==s&&(a=Eb())!==s&&(c=Pi())!==s?n=o=[o,u,a,c]:(za=n,n=s)):(za=n,n=s);e!==s?(r,t=i(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())===s&&(a=null),a!==s&&Eb()!==s?((c=Ql())===s&&(c=Xl()),c===s&&(c=null),c!==s&&Eb()!==s?((l=tf())===s&&(l=null),l!==s&&Eb()!==s?((f=bi())===s&&(f=null),f!==s?(r,b=t,p=e,v=n,y=u,w=a,h=c,L=l,C=f,(d=o)&&d.forEach(r=>rp.add(`create::${r.db}::${r.table}`)),t={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:b[0].toLowerCase(),keyword:"table",temporary:p&&p[0].toLowerCase(),if_not_exists:v,table:d,ignore_replace:h&&h[0].toLowerCase(),as:L&&L[0].toLowerCase(),query_expr:C&&C.ast,create_definitions:y,table_options:w}},r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);var b,p,v,d,y,w,h,L,C;r===s&&(r=za,(t=Wl())!==s&&Eb()!==s?((e=Bl())===s&&(e=null),e!==s&&Eb()!==s&&ef()!==s&&Eb()!==s?((n=vi())===s&&(n=null),n!==s&&Eb()!==s&&(o=ic())!==s&&Eb()!==s&&(u=function r(){var t,e;(t=function(){var r,t,e;r=za,(t=Ef())!==s&&Eb()!==s&&(e=ic())!==s?(r,t=function(r){return{type:"like",table:r}}(e),r=t):(za=r,r=s);return r}())===s&&(t=za,hb()!==s&&Eb()!==s&&(e=r())!==s&&Eb()!==s&&Lb()!==s?(t,(n=e).parentheses=!0,t=n):(za=t,t=s));var n;return t}())!==s?(r,t=function(r,t,e,n,o){return n&&n.forEach(r=>rp.add(`create::${r.db}::${r.table}`)),{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:r[0].toLowerCase(),keyword:"table",temporary:t&&t[0].toLowerCase(),if_not_exists:e,table:n,like:o}}}(t,e,n,o,u),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s));return r}())===s&&(t=function(){var t,e,n,o,u,a,i,c,l,f,b;t=za,(e=Wl())!==s&&Eb()!==s?((n=Ei())===s&&(n=null),n!==s&&Eb()!==s&&nf()!==s&&Eb()!==s?((o=vi())===s&&(o=null),o!==s&&Eb()!==s&&(u=bc())!==s&&Eb()!==s&&(a=function(){var t;"before"===r.substr(za,6).toLowerCase()?(t=r.substr(za,6),za+=6):(t=s,0===ti&&ui(fr));t===s&&("after"===r.substr(za,5).toLowerCase()?(t=r.substr(za,5),za+=5):(t=s,0===ti&&ui(br)));return t}())!==s&&Eb()!==s&&(i=function(){var r,t;r=za,(t=Vl())===s&&(t=Yl())===s&&(t=ql());t!==s&&(r,t={keyword:t[0].toLowerCase()});return r=t}())!==s&&Eb()!==s&&af()!==s&&Eb()!==s&&(c=bc())!==s&&Eb()!==s&&(l=function(){var t,e,n,o;t=za,"for"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(pr));e!==s&&Eb()!==s?("each"===r.substr(za,4).toLowerCase()?(n=r.substr(za,4),za+=4):(n=s,0===ti&&ui(vr)),n===s&&(n=null),n!==s&&Eb()!==s?("row"===r.substr(za,3).toLowerCase()?(o=r.substr(za,3),za+=3):(o=s,0===ti&&ui(dr)),o===s&&("statement"===r.substr(za,9).toLowerCase()?(o=r.substr(za,9),za+=9):(o=s,0===ti&&ui(yr))),o!==s?(t,u=e,i=o,e={keyword:(a=n)?`${u.toLowerCase()} ${a.toLowerCase()}`:u.toLowerCase(),args:i.toLowerCase()},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var u,a,i;return t}())!==s&&Eb()!==s?((f=function(){var t,e,n;t=za,"follows"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(wr));e===s&&("precedes"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(hr)));e!==s&&Eb()!==s&&(n=ul())!==s?(t,t=e={keyword:e,trigger:n}):(za=t,t=s);return t}())===s&&(f=null),f!==s&&Eb()!==s&&(b=function(){var r,t;r=za,rf()!==s&&Eb()!==s&&(t=mc())!==s?(r,r={type:"set",expr:t}):(za=r,r=s);return r}())!==s?(t,p=e,v=n,d=o,y=u,w=a,h=i,L=c,C=l,m=f,E=b,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:p[0].toLowerCase(),definer:v,keyword:"trigger",for_each:C,if_not_exists:d,trigger:y,time:w,events:[h],order:m,table:L,execute:E}},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var p,v,d,y,w,h,L,C,m,E;return t}())===s&&(t=function(){var r,t,e,n,o,u,a,c,l,f,b,p;r=za,(t=Wl())!==s&&Eb()!==s?((e=bb())===s&&(e=lb())===s&&(e=fb()),e===s&&(e=null),e!==s&&Eb()!==s&&(n=ib())!==s&&Eb()!==s&&(o=rl())!==s&&Eb()!==s?((u=sc())===s&&(u=null),u!==s&&Eb()!==s&&(a=af())!==s&&Eb()!==s&&(c=bc())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(l=function(){var r,t,e,n,o,u,a,c;if(r=za,(t=pi())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(c=pi())!==s?n=o=[o,u,a,c]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(c=pi())!==s?n=o=[o,u,a,c]:(za=n,n=s);e!==s?(r,t=i(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((f=uc())===s&&(f=null),f!==s&&Eb()!==s?((b=gi())===s&&(b=null),b!==s&&Eb()!==s?((p=Si())===s&&(p=null),p!==s&&Eb()!==s?(r,v=t,d=e,y=n,w=o,h=u,L=a,C=c,m=l,E=f,A=b,_=p,t={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:v[0].toLowerCase(),index_type:d&&d.toLowerCase(),keyword:y.toLowerCase(),index:w,on_kw:L[0].toLowerCase(),table:C,index_columns:m,index_using:h,index_options:E,algorithm_option:A,lock_option:_}},r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);var v,d,y,w,h,L,C,m,E,A,_;return r}())===s&&(t=function(){var r,t,e,n,o,u;r=za,(t=Wl())!==s&&Eb()!==s?((e=sf())===s&&(e=uf()),e!==s&&Eb()!==s?((n=vi())===s&&(n=null),n!==s&&Eb()!==s&&(o=ul())!==s&&Eb()!==s?((u=function(){var r,t,e,n,o,u;if(r=za,(t=Di())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=Di())!==s?n=o=[o,u]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=Di())!==s?n=o=[o,u]:(za=n,n=s);e!==s?(r,t=l(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())===s&&(u=null),u!==s?(r,a=t,i=n,c=o,f=u,t={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:a[0].toLowerCase(),keyword:"database",if_not_exists:i,database:c,create_definitions:f}},r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);var a,i,c,f;return r}())===s&&(t=function(){var t,e,n,o,u,a,i,c,l,f,b,p,v,d,y,w,h,L,C,m,E;t=za,(e=Wl())!==s&&Eb()!==s?(n=za,(o=gf())!==s&&(u=Eb())!==s&&(a=Xl())!==s?n=o=[o,u,a]:(za=n,n=s),n===s&&(n=null),n!==s&&(o=Eb())!==s?(u=za,"algorithm"===r.substr(za,9).toLowerCase()?(a=r.substr(za,9),za+=9):(a=s,0===ti&&ui(z)),a!==s&&(i=Eb())!==s&&(c=sb())!==s&&(l=Eb())!==s?("undefined"===r.substr(za,9).toLowerCase()?(f=r.substr(za,9),za+=9):(f=s,0===ti&&ui(Z)),f===s&&("merge"===r.substr(za,5).toLowerCase()?(f=r.substr(za,5),za+=5):(f=s,0===ti&&ui(J)),f===s&&("temptable"===r.substr(za,9).toLowerCase()?(f=r.substr(za,9),za+=9):(f=s,0===ti&&ui(rr)))),f!==s?u=a=[a,i,c,l,f]:(za=u,u=s)):(za=u,u=s),u===s&&(u=null),u!==s&&(a=Eb())!==s?((i=Ei())===s&&(i=null),i!==s&&(c=Eb())!==s?(l=za,"sql"===r.substr(za,3).toLowerCase()?(f=r.substr(za,3),za+=3):(f=s,0===ti&&ui(tr)),f!==s&&(b=Eb())!==s?("security"===r.substr(za,8).toLowerCase()?(p=r.substr(za,8),za+=8):(p=s,0===ti&&ui(er)),p!==s&&(v=Eb())!==s?("definer"===r.substr(za,7).toLowerCase()?(d=r.substr(za,7),za+=7):(d=s,0===ti&&ui(nr)),d===s&&("invoker"===r.substr(za,7).toLowerCase()?(d=r.substr(za,7),za+=7):(d=s,0===ti&&ui(or))),d!==s?l=f=[f,b,p,v,d]:(za=l,l=s)):(za=l,l=s)):(za=l,l=s),l===s&&(l=null),l!==s&&(f=Eb())!==s&&(b=tb())!==s&&(p=Eb())!==s&&(v=bc())!==s&&(d=Eb())!==s?(y=za,(w=hb())!==s&&(h=Eb())!==s&&(L=Jc())!==s&&(C=Eb())!==s&&(m=Lb())!==s?y=w=[w,h,L,C,m]:(za=y,y=s),y===s&&(y=null),y!==s&&(w=Eb())!==s&&(h=tf())!==s&&(L=Eb())!==s&&(C=Qi())!==s&&(m=Eb())!==s?((E=function(){var t,e,n,o,u;t=za,(e=pf())!==s&&Eb()!==s?("cascaded"===r.substr(za,8).toLowerCase()?(n=r.substr(za,8),za+=8):(n=s,0===ti&&ui(V)),n===s&&("local"===r.substr(za,5).toLowerCase()?(n=r.substr(za,5),za+=5):(n=s,0===ti&&ui(X))),n!==s&&Eb()!==s?("check"===r.substr(za,5).toLowerCase()?(o=r.substr(za,5),za+=5):(o=s,0===ti&&ui(K)),o!==s&&Eb()!==s?("OPTION"===r.substr(za,6)?(u="OPTION",za+=6):(u=s,0===ti&&ui(Q)),u!==s?(t,e=`with ${n.toLowerCase()} check option`,t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);t===s&&(t=za,(e=pf())!==s&&Eb()!==s?("check"===r.substr(za,5).toLowerCase()?(n=r.substr(za,5),za+=5):(n=s,0===ti&&ui(K)),n!==s&&Eb()!==s?("OPTION"===r.substr(za,6)?(o="OPTION",za+=6):(o=s,0===ti&&ui(Q)),o!==s?(t,t=e="with check option"):(za=t,t=s)):(za=t,t=s)):(za=t,t=s));return t}())===s&&(E=null),E!==s?(t,A=e,_=n,T=u,g=i,S=l,N=y,R=C,O=E,(I=v).view=I.table,delete I.table,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:A[0].toLowerCase(),keyword:"view",replace:_&&"or replace",algorithm:T&&T[4],definer:g,sql_security:S&&S[4],columns:N&&N[2],select:R,view:I,with:O}},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var A,_,T,g,S,I,N,R,O;return t}())===s&&(t=function(){var t,e,n,o,u,a,i,c,l,f,b;t=za,(e=Wl())!==s&&Eb()!==s&&zf()!==s&&Eb()!==s?((n=vi())===s&&(n=null),n!==s&&Eb()!==s&&(o=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=di())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=di())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=di())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=L(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s&&Eb()!==s?((u=function(){var t,e,n;t=za,Dl()!==s&&Eb()!==s?("role"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(C)),e!==s&&Eb()!==s&&(n=Yi())!==s?(t,t={keyword:"default role",value:n}):(za=t,t=s)):(za=t,t=s);return t}())===s&&(u=null),u!==s&&Eb()!==s?((a=function(){var t,e,n;t=za,"require"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(I));e!==s&&Eb()!==s&&(n=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=yi())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=Tf())!==s&&(a=Eb())!==s&&(i=yi())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=Tf())!==s&&(a=Eb())!==s&&(i=yi())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=Qb(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(t,t=e={keyword:"require",value:n}):(za=t,t=s);return t}())===s&&(a=null),a!==s&&Eb()!==s?((i=function(){var r,t,e,n,o,u,a;if(r=za,(t=pf())!==s)if(Eb()!==s)if((e=wi())!==s){for(n=[],o=za,(u=Eb())!==s&&(a=wi())!==s?o=u=[u,a]:(za=o,o=s);o!==s;)n.push(o),o=za,(u=Eb())!==s&&(a=wi())!==s?o=u=[u,a]:(za=o,o=s);n!==s?(r,t=function(r,t){const e=[r];if(t)for(const r of t)e.push(r[1]);return{keyword:"with",value:e}}(e,n),r=t):(za=r,r=s)}else za=r,r=s;else za=r,r=s;else za=r,r=s;return r}())===s&&(i=null),i!==s&&Eb()!==s?((c=function(){var r,t,e,n,o,u;if(r=za,(t=hi())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=hi())!==s?n=o=[o,u]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=hi())!==s?n=o=[o,u]:(za=n,n=s);e!==s?(r,t=Kb(t,e,1),r=t):(za=r,r=s)}else za=r,r=s;return r}())===s&&(c=null),c!==s&&Eb()!==s?((l=function(){var t,e,n;t=za,"account"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Y));e!==s&&Eb()!==s?("lock"===r.substr(za,4).toLowerCase()?(n=r.substr(za,4),za+=4):(n=s,0===ti&&ui(W)),n===s&&("unlock"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(B))),n!==s?(t,e=function(r){const t={type:"origin",value:r.toLowerCase(),prefix:"account"};return t}(n),t=e):(za=t,t=s)):(za=t,t=s);return t}())===s&&(l=null),l!==s&&Eb()!==s?((f=Tb())===s&&(f=null),f!==s&&Eb()!==s?((b=function(){var t,e,n;t=za,"attribute"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(q));e!==s&&Eb()!==s&&(n=gl())!==s?(t,(o=n).prefix="attribute",t=e=o):(za=t,t=s);var o;return t}())===s&&(b=null),b!==s?(t,p=e,v=n,d=o,y=u,w=a,h=i,m=c,E=l,A=f,_=b,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:p[0].toLowerCase(),keyword:"user",if_not_exists:v,user:d,default_role:y,require:w,resource_options:h,password_options:m,lock_option:E,comment:A,attribute:_}},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var p,v,d,y,w,h,m,E,A,_;return t}());return t}())===s&&(t=function(){var t,e,n,o;t=za,(e=function(){var t,e,n,o;t=za,"truncate"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Hu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TRUNCATE"):(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s?((n=ef())===s&&(n=null),n!==s&&Eb()!==s&&(o=ic())!==s?(t,u=e,a=n,(i=o)&&i.forEach(r=>rp.add(`${u}::${r.db}::${r.table}`)),e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:u.toLowerCase(),keyword:a&&a.toLowerCase()||"table",name:i}},t=e):(za=t,t=s)):(za=t,t=s);var u,a,i;return t}())===s&&(t=function(){var r,t,e;r=za,(t=Kl())!==s&&Eb()!==s&&ef()!==s&&Eb()!==s&&(e=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=oc())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=oc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=oc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=sr(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(r,(n=e).forEach(r=>r.forEach(r=>r.table&&rp.add(`rename::${r.db}::${r.table}`))),t={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"rename",table:n}},r=t):(za=r,r=s);var n;return r}())===s&&(t=function(){var t,e,n;t=za,(e=function(){var t,e,n,o;t=za,"call"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(cu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="CALL"):(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s&&(n=function(){var r;(r=Mb())===s&&(r=Db());return r}())!==s?(t,o=n,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"call",expr:o}},t=e):(za=t,t=s);var o;return t}())===s&&(t=function(){var t,e,n;t=za,(e=function(){var t,e,n,o;t=za,"use"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(ns));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s&&(n=rl())!==s?(t,o=n,rp.add(`use::${o}::null`),e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"use",db:o}},t=e):(za=t,t=s);var o;return t}())===s&&(t=function(){var r,t,e,n;r=za,(t=Fl())!==s&&Eb()!==s&&ef()!==s&&Eb()!==s&&(e=bc())!==s&&Eb()!==s&&(n=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=Ti())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Ti())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Ti())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=sr(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(r,o=e,u=n,rp.add(`alter::${o.db}::${o.table}`),t={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"alter",table:[o],expr:u}},r=t):(za=r,r=s);var o,u;return r}())===s&&(t=function(){var t,e,n,o;t=za,(e=rf())!==s&&Eb()!==s?((n=function(){var t,e,n,o;t=za,"global"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(zu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="GLOBAL"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(n=function(){var t,e,n,o;t=za,"session"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Zu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SESSION"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(n=function(){var t,e,n,o;t=za,"local"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(X));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="LOCAL"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(n=function(){var t,e,n,o;t=za,"persist"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Ju));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="PERSIST"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(n=function(){var t,e,n,o;t=za,"persist_only"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(ra));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="PERSIST_ONLY"):(za=t,t=s)):(za=t,t=s);return t}()),n===s&&(n=null),n!==s&&Eb()!==s&&(o=Rb())!==s?(t,u=n,(a=o).keyword=u,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"set",expr:a}},t=e):(za=t,t=s)):(za=t,t=s);var u,a;return t}())===s&&(t=function(){var t,e,n;t=za,(e=function(){var t,e,n,o;t=za,"lock"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(W));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s&&of()!==s&&Eb()!==s&&(n=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=$i())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=$i())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=$i())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=Yt(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(t,o=n,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"lock",keyword:"tables",tables:o}},t=e):(za=t,t=s);var o;return t}())===s&&(t=function(){var t,e;t=za,(e=function(){var t,e,n,o;t=za,"unlock"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(B));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s&&of()!==s?(t,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"unlock",keyword:"tables"}},t=e):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o,u,a,i,c,l;t=za,(e=$l())!==s&&Eb()!==s?("binary"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(St)),n===s&&("master"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(It))),n!==s&&(o=Eb())!==s?("logs"===r.substr(za,4).toLowerCase()?(u=r.substr(za,4),za+=4):(u=s,0===ti&&ui(Nt)),u!==s?(t,f=n,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",suffix:"logs",keyword:f.toLowerCase()}},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var f;t===s&&(t=za,(e=$l())!==s&&Eb()!==s&&(n=of())!==s?(t,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",keyword:"tables"}},t=e):(za=t,t=s),t===s&&(t=za,(e=$l())!==s&&Eb()!==s?("triggers"===r.substr(za,8).toLowerCase()?(n=r.substr(za,8),za+=8):(n=s,0===ti&&ui(Rt)),n===s&&("status"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(Ot)),n===s&&("processlist"===r.substr(za,11).toLowerCase()?(n=r.substr(za,11),za+=11):(n=s,0===ti&&ui(jt)))),n!==s?(t,d=n,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",keyword:d.toLowerCase()}},t=e):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=$l())!==s&&Eb()!==s?("procedure"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(xt)),n===s&&("function"===r.substr(za,8).toLowerCase()?(n=r.substr(za,8),za+=8):(n=s,0===ti&&ui(kt))),n!==s&&(o=Eb())!==s?("status"===r.substr(za,6).toLowerCase()?(u=r.substr(za,6),za+=6):(u=s,0===ti&&ui(Ot)),u!==s?(t,e=function(r){return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",keyword:r.toLowerCase(),suffix:"status"}}}(n),t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=$l())!==s&&Eb()!==s?("binlog"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(Ut)),n!==s&&(o=Eb())!==s?("events"===r.substr(za,6).toLowerCase()?(u=r.substr(za,6),za+=6):(u=s,0===ti&&ui(Mt)),u!==s&&(a=Eb())!==s?((i=Bc())===s&&(i=null),i!==s&&Eb()!==s?((c=nc())===s&&(c=null),c!==s&&Eb()!==s?((l=Cc())===s&&(l=null),l!==s?(t,b=i,p=c,v=l,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",suffix:"events",keyword:"binlog",in:b,from:p,limit:v}},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=$l())!==s&&Eb()!==s?(n=za,"character"===r.substr(za,9).toLowerCase()?(o=r.substr(za,9),za+=9):(o=s,0===ti&&ui(Zr)),o!==s&&(u=Eb())!==s?("set"===r.substr(za,3).toLowerCase()?(a=r.substr(za,3),za+=3):(a=s,0===ti&&ui(Jr)),a!==s?n=o=[o,u,a]:(za=n,n=s)):(za=n,n=s),n===s&&("collation"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(Dt)),n===s&&("databases"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(Pt)))),n!==s&&(o=Eb())!==s?((u=Wc())===s&&(u=vc()),u===s&&(u=null),u!==s?(t,e=function(r,t){let e=Array.isArray(r)&&r||[r];return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",suffix:e[2]&&e[2].toLowerCase(),keyword:e[0].toLowerCase(),expr:t}}}(n,u),t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=$l())!==s&&Eb()!==s?("columns"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui($t)),n===s&&("indexes"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui(Gt))),n!==s&&(o=Eb())!==s&&(u=nc())!==s?(t,e=function(r,t){return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",keyword:r.toLowerCase(),from:t}}}(n,u),t=e):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=$l())!==s&&Eb()!==s&&(n=Wl())!==s&&(o=Eb())!==s?((u=tb())===s&&(u=ef())===s&&("event"===r.substr(za,5).toLowerCase()?(u=r.substr(za,5),za+=5):(u=s,0===ti&&ui(Ft)),u===s&&(u=nf())===s&&("procedure"===r.substr(za,9).toLowerCase()?(u=r.substr(za,9),za+=9):(u=s,0===ti&&ui(xt)))),u!==s&&(a=Eb())!==s&&(i=bc())!==s?(t,e=function(r,t){const e=r.toLowerCase();return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",keyword:"create",suffix:e,[e]:t}}}(u,i),t=e):(za=t,t=s)):(za=t,t=s),t===s&&(t=function(){var t,e,n,o;t=za,(e=$l())!==s&&Eb()!==s?("grants"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(Ht)),n!==s&&Eb()!==s?((o=function(){var t,e,n,o,u,a,i;t=za,"for"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(pr));e!==s&&Eb()!==s&&(n=rl())!==s&&Eb()!==s?(o=za,(u=eb())!==s&&(a=Eb())!==s&&(i=rl())!==s?o=u=[u,a,i]:(za=o,o=s),o===s&&(o=null),o!==s&&(u=Eb())!==s?((a=function(){var r,t;r=za,bf()!==s&&Eb()!==s&&(t=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=rl())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=rl())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=rl())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=Yt(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(r,r=t):(za=r,r=s);return r}())===s&&(a=null),a!==s?(t,l=a,e={user:n,host:(c=o)&&c[2],role_list:l},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var c,l;return t}())===s&&(o=null),o!==s?(t,u=o,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"show",keyword:"grants",for:u}},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var u;return t}()))))))));var b,p,v;var d;return t}())===s&&(t=function(){var t,e,n;t=za,(e=yf())===s&&(e=function(){var t,e,n,o;t=za,"describe"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Ws));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DESCRIBE"):(za=t,t=s)):(za=t,t=s);return t}());e!==s&&Eb()!==s&&(n=rl())!==s?(t,o=n,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"desc",table:o}},t=e):(za=t,t=s);var o;return t}())===s&&(t=function(){var t,e,n,o,u,a,i,c,l;t=za,"grant"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Xt));e!==s&&Eb()!==s&&(n=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=Fi())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Fi())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Fi())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=L(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s&&Eb()!==s&&(o=af())!==s&&Eb()!==s?((u=function(){var t,e;t=za,(e=ef())===s&&("function"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(kt)),e===s&&("procedure"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(xt))));e!==s&&(t,e={type:"origin",value:e.toUpperCase()});return t=e}())===s&&(u=null),u!==s&&Eb()!==s&&(a=function(){var r,t,e,n,o;r=za,t=za,(e=rl())===s&&(e=wb());e!==s&&(n=Eb())!==s&&(o=db())!==s?t=e=[e,n,o]:(za=t,t=s);t===s&&(t=null);t!==s&&(e=Eb())!==s?((n=rl())===s&&(n=wb()),n!==s?(r,a=n,t={prefix:(u=t)&&u[0],name:a},r=t):(za=r,r=s)):(za=r,r=s);var u,a;return r}())!==s&&Eb()!==s&&(i=Pl())!==s&&Eb()!==s&&(c=Yi())!==s&&Eb()!==s?((l=function(){var t,e,n;t=za,pf()!==s&&Eb()!==s?("grant"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Xt)),e!==s&&Eb()!==s?("option"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(Kt)),n!==s?(t,t={type:"origin",value:"with grant option"}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);return t}())===s&&(l=null),l!==s?(t,f=n,b=u,p=a,v=i,d=c,y=l,e={tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"grant",keyword:"priv",objects:f,on:{object_type:b,priv_level:[p]},to_from:v[0],user_or_roles:d,with:y}},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var f,b,p,v,d,y;t===s&&(t=za,"GRANT"===r.substr(za,5)?(e="GRANT",za+=5):(e=s,0===ti&&ui(re)),e!==s&&Eb()!==s?("PROXY"===r.substr(za,5)?(n="PROXY",za+=5):(n=s,0===ti&&ui(te)),n!==s&&Eb()!==s&&(o=af())!==s&&Eb()!==s&&(u=Hi())!==s&&Eb()!==s&&(a=Pl())!==s&&Eb()!==s&&(i=Yi())!==s&&Eb()!==s?((c=Wi())===s&&(c=null),c!==s?(t,e=function(r,t,e,n){return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"grant",keyword:"proxy",objects:[{priv:{type:"origin",value:"proxy"}}],on:r,to_from:t[0],user_or_roles:e,with:n}}}(u,a,i,c),t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"GRANT"===r.substr(za,5)?(e="GRANT",za+=5):(e=s,0===ti&&ui(re)),e!==s&&Eb()!==s&&(n=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=rl())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=rl())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=rl())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=L(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s&&Eb()!==s&&(o=Pl())!==s&&Eb()!==s&&(u=Yi())!==s&&Eb()!==s?((a=Wi())===s&&(a=null),a!==s?(t,e=function(r,t,e,n){return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:"grant",keyword:"role",objects:r.map(r=>({priv:{type:"string",value:r}})),to_from:t[0],user_or_roles:e,with:n}}}(n,o,u,a),t=e):(za=t,t=s)):(za=t,t=s)));return t}()),t}function li(){var r;return(r=bi())===s&&(r=function(){var r,t,e,n,o,u;r=za,(t=Eb())!==s?((e=qi())===s&&(e=null),e!==s&&Eb()!==s&&Yl()!==s&&Eb()!==s&&(n=ic())!==s&&Eb()!==s&&rf()!==s&&Eb()!==s&&(o=mc())!==s&&Eb()!==s?((u=vc())===s&&(u=null),u!==s?(r,t=function(r,t,e,n){const o={};return t&&t.forEach(r=>{const{db:t,as:e,table:n,join:s}=r,u=s?"select":"update";t&&(o[n]=t),n&&rp.add(`${u}::${t}::${n}`)}),e&&e.forEach(r=>{if(r.table){const t=zb(r.table);rp.add(`update::${o[t]||null}::${t}`)}tp.add(`update::${r.table}::${r.column}`)}),{tableList:Array.from(rp),columnList:Zb(tp),ast:{with:r,type:"update",table:t,set:e,where:n}}}(e,n,o,u),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);return r}())===s&&(r=function(){var r,t,e,n,o,u,a,i,c;r=za,(t=gc())!==s&&Eb()!==s?((e=Ql())===s&&(e=null),e!==s&&Eb()!==s?((n=Zl())===s&&(n=null),n!==s&&Eb()!==s&&(o=bc())!==s&&Eb()!==s?((u=_c())===s&&(u=null),u!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(a=Jc())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s&&(i=Ac())!==s&&Eb()!==s?((c=Tc())===s&&(c=null),c!==s?(r,t=function(r,t,e,n,o,s,u,a){if(n&&(rp.add(`insert::${n.db}::${n.table}`),n.as=null),s){let r=n&&n.table||null;Array.isArray(u)&&u.forEach((r,t)=>{if(r.value.length!=s.length)throw new Error("Error: column count doesn't match value count at row "+(t+1))}),s.forEach(t=>tp.add(`insert::${r}::${t}`))}let i=[t,e].filter(r=>r).map(r=>r[0]&&r[0].toLowerCase()).join(" ");return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:r,table:[n],columns:s,values:u,partition:o,prefix:i,on_duplicate_update:a}}}(t,e,n,o,u,a,i,c),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);return r}())===s&&(r=function(){var r,t,e,n,o,u,a,i;r=za,(t=gc())!==s&&Eb()!==s?((e=Ql())===s&&(e=null),e!==s&&Eb()!==s?((n=Zl())===s&&(n=null),n!==s&&Eb()!==s&&(o=bc())!==s&&Eb()!==s?((u=_c())===s&&(u=null),u!==s&&Eb()!==s&&(a=Ac())!==s&&Eb()!==s?((i=Tc())===s&&(i=null),i!==s?(r,t=function(r,t,e,n,o,s,u){n&&(rp.add(`insert::${n.db}::${n.table}`),tp.add(`insert::${n.table}::(.*)`),n.as=null);const a=[t,e].filter(r=>r).map(r=>r[0]&&r[0].toLowerCase()).join(" ");return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:r,table:[n],columns:null,values:s,partition:o,prefix:a,on_duplicate_update:u}}}(t,e,n,o,u,a,i),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);return r}())===s&&(r=function(){var r,t,e,n,o,u,a,i;r=za,(t=gc())!==s&&Eb()!==s?((e=Ql())===s&&(e=null),e!==s&&Eb()!==s?((n=Zl())===s&&(n=null),n!==s&&Eb()!==s&&(o=bc())!==s&&Eb()!==s?((u=_c())===s&&(u=null),u!==s&&Eb()!==s&&rf()!==s&&Eb()!==s&&(a=mc())!==s&&Eb()!==s?((i=Tc())===s&&(i=null),i!==s?(r,t=function(r,t,e,n,o,s,u){n&&(rp.add(`insert::${n.db}::${n.table}`),tp.add(`insert::${n.table}::(.*)`),n.as=null);const a=[t,e].filter(r=>r).map(r=>r[0]&&r[0].toLowerCase()).join(" ");return{tableList:Array.from(rp),columnList:Zb(tp),ast:{type:r,table:[n],columns:null,partition:o,prefix:a,set:s,on_duplicate_update:u}}}(t,e,n,o,u,a,i),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);return r}())===s&&(r=function(){var r,t,e,n,o,u;r=za,(t=Eb())!==s?((e=qi())===s&&(e=null),e!==s&&Eb()!==s&&ql()!==s&&Eb()!==s?((n=ic())===s&&(n=null),n!==s&&Eb()!==s&&(o=nc())!==s&&Eb()!==s?((u=vc())===s&&(u=null),u!==s?(r,t=function(r,t,e,n){if(e&&e.forEach(r=>{const{db:t,as:e,table:n,join:o}=r,s=o?"select":"delete";n&&rp.add(`${s}::${t}::${n}`),o||tp.add(`delete::${n}::(.*)`)}),null===t&&1===e.length){const r=e[0];t=[{db:r.db,table:r.table,as:r.as,addition:!0}]}return{tableList:Array.from(rp),columnList:Zb(tp),ast:{with:r,type:"delete",table:t,from:e,where:n}}}(e,n,o,u),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);return r}())===s&&(r=ci())===s&&(r=function(){var r,t;r=[],t=Nb();for(;t!==s;)r.push(t),t=Nb();return r}()),r}function fi(){var t,e,n,o;return t=za,(e=function(){var t,e,n,o;t=za,"union"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Os));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s?((n=wf())===s&&(n=hf()),n===s&&(n=null),n!==s?(t,t=e=(o=n)?"union "+o.toLowerCase():"union"):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=function(){var t,e,n,o;t=za,"minus"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(js));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e="minus"),(t=e)===s&&(t=za,(e=function(){var t,e,n,o;t=za,"intersect"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(xs));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e="intersect"),t=e)),t}function bi(){var r,t,e,n,o,u,a,i;if(r=za,(t=Bi())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=fi())!==s&&(a=Eb())!==s&&(i=Bi())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=fi())!==s&&(a=Eb())!==s&&(i=Bi())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s&&(n=Eb())!==s?((o=wc())===s&&(o=null),o!==s&&(u=Eb())!==s?((a=Cc())===s&&(a=null),a!==s?(r,r=t=function(r,t,e,n){let o=r;for(let r=0;r<t.length;r++)o._next=t[r][3],o.set_op=t[r][1],o=o._next;return e&&(r._orderby=e),n&&(r._limit=n),{tableList:Array.from(rp),columnList:Zb(tp),ast:r}}(t,e,o,a)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)}else za=r,r=s;return r}function pi(){var r,t,e;return r=za,(t=Uc())!==s?((e=df())===s&&(e=yf()),e===s&&(e=null),e!==s?(r,r=t=c(t,e)):(za=r,r=s)):(za=r,r=s),r===s&&(r=function(){var r,t,e;r=za,(t=Zc())!==s&&Eb()!==s?((e=df())===s&&(e=yf()),e===s&&(e=null),e!==s?(r,t=c(t,e),r=t):(za=r,r=s)):(za=r,r=s);return r}()),r}function vi(){var t,e;return t=za,"if"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(f)),e!==s&&Eb()!==s&&_f()!==s&&Eb()!==s&&Af()!==s?(t,t=e="IF NOT EXISTS"):(za=t,t=s),t}function di(){var t,e,n;return t=za,(e=Hi())!==s&&Eb()!==s?((n=function(){var t,e,n,o,u,a,i,c,l;return t=za,r.substr(za,10)===b?(e=b,za+=10):(e=s,0===ti&&ui(p)),e!==s&&Eb()!==s?(n=za,"with"===r.substr(za,4).toLowerCase()?(o=r.substr(za,4),za+=4):(o=s,0===ti&&ui(v)),o!==s&&(u=Eb())!==s&&(a=rl())!==s?n=o=[o,u,a]:(za=n,n=s),n===s&&(n=null),n!==s&&(o=Eb())!==s?("by"===r.substr(za,2).toLowerCase()?(u=r.substr(za,2),za+=2):(u=s,0===ti&&ui(d)),u!==s&&(a=Eb())!==s?("random"===r.substr(za,6).toLowerCase()?(i=r.substr(za,6),za+=6):(i=s,0===ti&&ui(y)),i!==s&&Eb()!==s?("password"===r.substr(za,8).toLowerCase()?(c=r.substr(za,8),za+=8):(c=s,0===ti&&ui(w)),c!==s?(t,t=e={keyword:["identified",(l=n)&&l[0].toLowerCase()].filter(r=>r).join(" "),auth_plugin:l&&l[2],value:{prefix:"by",type:"origin",value:"random password"}}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,r.substr(za,10)===b?(e=b,za+=10):(e=s,0===ti&&ui(p)),e!==s&&Eb()!==s?(n=za,"with"===r.substr(za,4).toLowerCase()?(o=r.substr(za,4),za+=4):(o=s,0===ti&&ui(v)),o!==s&&(u=Eb())!==s&&(a=rl())!==s?n=o=[o,u,a]:(za=n,n=s),n===s&&(n=null),n!==s&&(o=Eb())!==s?("by"===r.substr(za,2).toLowerCase()?(u=r.substr(za,2),za+=2):(u=s,0===ti&&ui(d)),u!==s&&(a=Eb())!==s&&(i=gl())!==s?(t,t=e=function(r,t){return t.prefix="by",{keyword:["identified",r&&r[0].toLowerCase()].filter(r=>r).join(" "),auth_plugin:r&&r[2],value:t}}(n,i)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,r.substr(za,10)===b?(e=b,za+=10):(e=s,0===ti&&ui(p)),e!==s&&Eb()!==s?("with"===r.substr(za,4).toLowerCase()?(n=r.substr(za,4),za+=4):(n=s,0===ti&&ui(v)),n!==s&&(o=Eb())!==s&&(u=rl())!==s&&(a=Eb())!==s?("as"===r.substr(za,2).toLowerCase()?(i=r.substr(za,2),za+=2):(i=s,0===ti&&ui(h)),i!==s&&Eb()!==s&&(c=gl())!==s?(t,t=e=function(r,t){return t.prefix="as",{keyword:"identified with",auth_plugin:r&&r[2],value:t}}(u,c)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s))),t}())===s&&(n=null),n!==s?(t,t=e={user:e,auth_option:n}):(za=t,t=s)):(za=t,t=s),t}function yi(){var t,e,n;return t=za,"none"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(m)),e===s&&("ssl"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(E)),e===s&&("x509"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(A)))),e!==s&&(t,e={type:"origin",value:e}),(t=e)===s&&(t=za,"cipher"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(_)),e===s&&("issuer"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(T)),e===s&&("subject"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(g)))),e!==s&&Eb()!==s&&(n=gl())!==s?(t,t=e=S(e,n)):(za=t,t=s)),t}function wi(){var t,e,n;return t=za,"max_queries_per_hour"===r.substr(za,20).toLowerCase()?(e=r.substr(za,20),za+=20):(e=s,0===ti&&ui(N)),e===s&&("max_updates_per_hour"===r.substr(za,20).toLowerCase()?(e=r.substr(za,20),za+=20):(e=s,0===ti&&ui(R)),e===s&&("max_connections_per_hour"===r.substr(za,24).toLowerCase()?(e=r.substr(za,24),za+=24):(e=s,0===ti&&ui(O)),e===s&&("max_user_connections"===r.substr(za,20).toLowerCase()?(e=r.substr(za,20),za+=20):(e=s,0===ti&&ui(j))))),e!==s&&Eb()!==s&&(n=Rl())!==s?(t,t=e=S(e,n)):(za=t,t=s),t}function hi(){var t,e,n,o,u,a;return t=za,"password"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(w)),e!==s&&Eb()!==s?("expire"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(x)),n!==s&&Eb()!==s?("default"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(k)),o===s&&("never"===r.substr(za,5).toLowerCase()?(o=r.substr(za,5),za+=5):(o=s,0===ti&&ui(U)),o===s&&(o=Rc())),o!==s?(t,t=e={keyword:"password expire",value:"string"==typeof(a=o)?{type:"origin",value:a}:a}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"password"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(w)),e!==s&&Eb()!==s?("history"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui(M)),n!==s&&Eb()!==s?("default"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(k)),o===s&&(o=Rl()),o!==s?(t,t=e=function(r){return{keyword:"password history",value:"string"==typeof r?{type:"origin",value:r}:r}}(o)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"password"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(w)),e!==s&&Eb()!==s?("REUSE"===r.substr(za,5)?(n="REUSE",za+=5):(n=s,0===ti&&ui(D)),n!==s&&Eb()!==s&&(o=Rc())!==s?(t,t=e=function(r){return{keyword:"password reuse",value:r}}(o)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"password"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(w)),e!==s&&Eb()!==s?("require"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui(I)),n!==s&&Eb()!==s?("current"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(P)),o!==s&&Eb()!==s?("default"===r.substr(za,7).toLowerCase()?(u=r.substr(za,7),za+=7):(u=s,0===ti&&ui(k)),u===s&&("optional"===r.substr(za,8).toLowerCase()?(u=r.substr(za,8),za+=8):(u=s,0===ti&&ui($))),u!==s?(t,t=e=function(r){return{keyword:"password require current",value:{type:"origin",value:r}}}(u)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"failed_login_attempts"===r.substr(za,21).toLowerCase()?(e=r.substr(za,21),za+=21):(e=s,0===ti&&ui(G)),e!==s&&Eb()!==s&&(n=Rl())!==s?(t,t=e=function(r){return{keyword:"failed_login_attempts",value:r}}(n)):(za=t,t=s),t===s&&(t=za,"password_lock_time"===r.substr(za,18).toLowerCase()?(e=r.substr(za,18),za+=18):(e=s,0===ti&&ui(F)),e!==s&&Eb()!==s?((n=Rl())===s&&("unbounded"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(H))),n!==s?(t,t=e=function(r){return{keyword:"password_lock_time",value:"string"==typeof r?{type:"origin",value:r}:r}}(n)):(za=t,t=s)):(za=t,t=s)))))),t}function Li(){var t;return(t=mi())===s&&(t=Ri())===s&&(t=Oi())===s&&(t=function(){var t;(t=function(){var t,e,n,o,u,a;t=za,(e=ji())===s&&(e=null);e!==s&&Eb()!==s?("primary key"===r.substr(za,11).toLowerCase()?(n=r.substr(za,11),za+=11):(n=s,0===ti&&ui(Fr)),n!==s&&Eb()!==s?((o=sc())===s&&(o=null),o!==s&&Eb()!==s&&(u=Ni())!==s&&Eb()!==s?((a=uc())===s&&(a=null),a!==s?(t,c=n,l=o,f=u,b=a,e={constraint:(i=e)&&i.constraint,definition:f,constraint_type:c.toLowerCase(),keyword:i&&i.keyword,index_type:l,resource:"constraint",index_options:b},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var i,c,l,f,b;return t}())===s&&(t=function(){var r,t,e,n,o,u,a,i;r=za,(t=ji())===s&&(t=null);t!==s&&Eb()!==s&&(e=bb())!==s&&Eb()!==s?((n=ib())===s&&(n=cb()),n===s&&(n=null),n!==s&&Eb()!==s?((o=ol())===s&&(o=null),o!==s&&Eb()!==s?((u=sc())===s&&(u=null),u!==s&&Eb()!==s&&(a=Ni())!==s&&Eb()!==s?((i=uc())===s&&(i=null),i!==s?(r,l=e,f=n,b=o,p=u,v=a,d=i,t={constraint:(c=t)&&c.constraint,definition:v,constraint_type:f&&`${l.toLowerCase()} ${f.toLowerCase()}`||l.toLowerCase(),keyword:c&&c.keyword,index_type:p,index:b,resource:"constraint",index_options:d},r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);var c,l,f,b,p,v,d;return r}())===s&&(t=function(){var t,e,n,o,u,a;t=za,(e=ji())===s&&(e=null);e!==s&&Eb()!==s?("foreign key"===r.substr(za,11).toLowerCase()?(n=r.substr(za,11),za+=11):(n=s,0===ti&&ui(Hr)),n!==s&&Eb()!==s?((o=ol())===s&&(o=null),o!==s&&Eb()!==s&&(u=Xi())!==s&&Eb()!==s?((a=xi())===s&&(a=null),a!==s?(t,c=n,l=o,f=u,b=a,e={constraint:(i=e)&&i.constraint,definition:f,constraint_type:c,keyword:i&&i.keyword,index:l,resource:"constraint",reference_definition:b},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var i,c,l,f,b;return t}());return t}()),t}function Ci(){var t,e,n,o,u;return t=za,(e=function(){var t,e;t=za,(e=function(){var t,e,n,o;t=za,"not null"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(zo));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e={type:"not null",value:"not null"});return t=e}())===s&&(e=Tl()),e!==s&&(t,(u=e)&&!u.value&&(u.value="null"),e={nullable:u}),(t=e)===s&&(t=za,(e=function(){var r,t;r=za,Dl()!==s&&Eb()!==s?((t=_l())===s&&(t=Uc()),t!==s?(r,r={type:"default",value:t}):(za=r,r=s)):(za=r,r=s);return r}())!==s&&(t,e={default_val:e}),(t=e)===s&&(t=za,"auto_increment"===r.substr(za,14).toLowerCase()?(e=r.substr(za,14),za+=14):(e=s,0===ti&&ui(ur)),e!==s&&(t,e={auto_increment:e.toLowerCase()}),(t=e)===s&&(t=za,"unique"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(ar)),e!==s&&Eb()!==s?("key"===r.substr(za,3).toLowerCase()?(n=r.substr(za,3),za+=3):(n=s,0===ti&&ui(ir)),n===s&&(n=null),n!==s?(t,t=e=function(r){const t=["unique"];return r&&t.push(r),{unique:t.join(" ").toLowerCase("")}}(n)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"primary"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(cr)),e===s&&(e=null),e!==s&&Eb()!==s?("key"===r.substr(za,3).toLowerCase()?(n=r.substr(za,3),za+=3):(n=s,0===ti&&ui(ir)),n!==s?(t,t=e=function(r){const t=[];return r&&t.push("primary"),t.push("key"),{primary_key:t.join(" ").toLowerCase("")}}(e)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=Tb())!==s&&(t,e={comment:e}),(t=e)===s&&(t=za,(e=Ai())!==s&&(t,e={collate:e}),(t=e)===s&&(t=za,(e=function(){var t,e,n;t=za,"column_format"===r.substr(za,13).toLowerCase()?(e=r.substr(za,13),za+=13):(e=s,0===ti&&ui(Lr));e!==s&&Eb()!==s?("fixed"===r.substr(za,5).toLowerCase()?(n=r.substr(za,5),za+=5):(n=s,0===ti&&ui(Cr)),n===s&&("dynamic"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui(mr)),n===s&&("default"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui(k)))),n!==s?(t,e={type:"column_format",value:n.toLowerCase()},t=e):(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e={column_format:e}),(t=e)===s&&(t=za,(e=function(){var t,e,n;t=za,"storage"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Er));e!==s&&Eb()!==s?("disk"===r.substr(za,4).toLowerCase()?(n=r.substr(za,4),za+=4):(n=s,0===ti&&ui(Ar)),n===s&&("memory"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(_r))),n!==s?(t,e={type:"storage",value:n.toLowerCase()},t=e):(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e={storage:e}),(t=e)===s&&(t=za,(e=xi())!==s&&(t,e={reference_definition:e}),(t=e)===s&&(t=za,(e=function(){var t,e,n,o,u,a,i,c;t=za,(e=ji())===s&&(e=null);e!==s&&Eb()!==s?("check"===r.substr(za,5).toLowerCase()?(n=r.substr(za,5),za+=5):(n=s,0===ti&&ui(K)),n!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(o=Mc())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?(u=za,(a=_f())===s&&(a=null),a!==s&&(i=Eb())!==s?("enforced"===r.substr(za,8).toLowerCase()?(c=r.substr(za,8),za+=8):(c=s,0===ti&&ui(Yr)),c!==s?u=a=[a,i,c]:(za=u,u=s)):(za=u,u=s),u===s&&(u=null),u!==s?(t,e=function(r,t,e,n){const o=[];return n&&o.push(n[0],n[2]),{constraint_type:t.toLowerCase(),keyword:r&&r.keyword,constraint:r&&r.constraint,definition:[e],enforced:o.filter(r=>r).join(" ").toLowerCase(),resource:"constraint"}}(e,n,o,u),t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e={check:e}),(t=e)===s&&(t=za,(e=Mi())!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s&&(o=ul())!==s?(t,t=e=function(r,t,e){return{character_set:{type:r,value:e,symbol:t}}}(e,n,o)):(za=t,t=s)):(za=t,t=s)))))))))))),t}function mi(){var t,e,n,o,u,a,i,c,l;return t=za,(e=Zc())!==s&&Eb()!==s&&(n=Fb())!==s&&Eb()!==s?((o=function(){var t,e,n,o,u,a,i,c;t=za,e=za,(n=function(){var t,e,n,o,u;t=za,e=za,"generated"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(Tr));n!==s&&(o=Eb())!==s?("always"===r.substr(za,6).toLowerCase()?(u=r.substr(za,6),za+=6):(u=s,0===ti&&ui(gr)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s);e!==s&&(t,e=e.join("").toLowerCase());return t=e}())===s&&(n=null);n!==s&&(o=Eb())!==s?("as"===r.substr(za,2).toLowerCase()?(u=r.substr(za,2),za+=2):(u=s,0===ti&&ui(h)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s);if(e!==s)if((n=Eb())!==s)if((o=hb())!==s)if((u=Eb())!==s)if((a=_l())===s&&(a=Uc()),a!==s)if(Eb()!==s)if(Lb()!==s)if(Eb()!==s){for(i=[],"stored"===r.substr(za,6).toLowerCase()?(c=r.substr(za,6),za+=6):(c=s,0===ti&&ui(Sr)),c===s&&("virtual"===r.substr(za,7).toLowerCase()?(c=r.substr(za,7),za+=7):(c=s,0===ti&&ui(Ir)));c!==s;)i.push(c),"stored"===r.substr(za,6).toLowerCase()?(c=r.substr(za,6),za+=6):(c=s,0===ti&&ui(Sr)),c===s&&("virtual"===r.substr(za,7).toLowerCase()?(c=r.substr(za,7),za+=7):(c=s,0===ti&&ui(Ir)));i!==s?(t,l=i,e={type:"generated",expr:a,value:e.filter(r=>"string"==typeof r).join(" ").toLowerCase(),storage_type:l&&l[0]&&l[0].toLowerCase()},t=e):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;var l;return t}())===s&&(o=null),o!==s&&Eb()!==s?((u=function(){var r,t,e,n,o,u;if(r=za,(t=Ci())!==s)if(Eb()!==s){for(e=[],n=za,(o=Eb())!==s&&(u=Ci())!==s?n=o=[o,u]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=Ci())!==s?n=o=[o,u]:(za=n,n=s);e!==s?(r,r=t=function(r,t){let e=r;for(let r=0;r<t.length;r++)e={...e,...t[r][1]};return e}(t,e)):(za=r,r=s)}else za=r,r=s;else za=r,r=s;return r}())===s&&(u=null),u!==s?(t,a=e,i=n,c=o,l=u,tp.add(`create::${a.table}::${a.column}`),t=e={column:a,definition:i,generated:c,resource:"column",...l||{}}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t}function Ei(){var t,e,n,o,u;return t=za,"definer"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(nr)),e!==s&&Eb()!==s&&sb()!==s&&Eb()!==s&&(n=gl())!==s&&Eb()!==s?(64===r.charCodeAt(za)?(o="@",za++):(o=s,0===ti&&ui(lr)),o!==s&&Eb()!==s&&(u=gl())!==s?(t,t=e=function(r,t){const e="single_quote_string"===r.type?"'":'"',n="single_quote_string"===t.type?"'":'"';return`DEFINER = ${e}${r.value}${e}@${n}${t.value}${n}`}(n,u)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"definer"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(nr)),e!==s&&Eb()!==s&&sb()!==s&&Eb()!==s&&(n=rb())!==s&&Eb()!==s&&(o=hb())!==s&&Eb()!==s&&(u=Lb())!==s?(t,t=e="DEFINER = CURRENT_USER()"):(za=t,t=s),t===s&&(t=za,"definer"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(nr)),e!==s&&Eb()!==s&&sb()!==s&&Eb()!==s&&(n=rb())!==s?(t,t=e="DEFINER = CURRENT_USER"):(za=t,t=s))),t}function Ai(){var t,e,n;return t=za,function(){var t,e,n,o;t=za,"collate"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(tt));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="COLLATE"):(za=t,t=s)):(za=t,t=s);return t}()!==s&&Eb()!==s?((e=sb())===s&&(e=null),e!==s&&Eb()!==s&&(n=ul())!==s?(t,t={type:"collate",symbol:e,value:n}):(za=t,t=s)):(za=t,t=s),t}function _i(){var t,e,n;return t=za,"if"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(Nr)),e!==s&&Eb()!==s?("exists"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(Rr)),n!==s?(t,t=e="if exists"):(za=t,t=s)):(za=t,t=s),t}function Ti(){var t,e,n;return(t=function(){var r,t,e,n,o;r=za,(t=ub())!==s&&Eb()!==s?((e=ab())===s&&(e=null),e!==s&&Eb()!==s?((n=vi())===s&&(n=null),n!==s&&Eb()!==s&&(o=mi())!==s?(r,u=e,a=n,i=o,t={action:"add",...i,keyword:u,if_not_exists:a,resource:"column",type:"alter"},r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);var u,a,i;r===s&&(r=za,(t=ub())!==s&&Eb()!==s&&(e=mi())!==s?(r,t=function(r){return{action:"add",...r,resource:"column",type:"alter"}}(e),r=t):(za=r,r=s));return r}())===s&&(t=function(){var t,e,n,o,u,a;t=za,(e=Gl())!==s&&Eb()!==s?("primary"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui(cr)),n!==s&&(o=Eb())!==s&&(u=cb())!==s?(t,t=e={action:"drop",key:"",keyword:"primary key",resource:"key",type:"alter"}):(za=t,t=s)):(za=t,t=s);t===s&&(t=za,(e=Gl())!==s&&Eb()!==s?(n=za,"foreign"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(Or)),o===s&&(o=null),o!==s&&(u=Eb())!==s&&(a=cb())!==s?n=o=[o,u,a]:(za=n,n=s),n===s&&(n=ib()),n!==s&&(o=Eb())!==s&&(u=rl())!==s?(t,e=function(r,t){const e=Array.isArray(r)?"key":"index";return{action:"drop",[e]:t,keyword:Array.isArray(r)?""+[r[0],r[2]].filter(r=>r).join(" ").toLowerCase():r.toLowerCase(),resource:e,type:"alter"}}(n,u),t=e):(za=t,t=s)):(za=t,t=s));return t}())===s&&(t=function(){var r,t,e,n;r=za,(t=Gl())!==s&&Eb()!==s&&(e=ab())!==s&&Eb()!==s&&(n=Zc())!==s?(r,r=t={action:"drop",column:n,keyword:e,resource:"column",type:"alter"}):(za=r,r=s);r===s&&(r=za,(t=Gl())!==s&&Eb()!==s&&(e=Zc())!==s?(r,t=function(r){return{action:"drop",column:r,resource:"column",type:"alter"}}(e),r=t):(za=r,r=s));return r}())===s&&(t=function(){var t,e,n,o;t=za,(e=function(){var t,e,n,o;t=za,"modify"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(ya));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MODIFY"):(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s?((n=ab())===s&&(n=null),n!==s&&Eb()!==s&&(o=mi())!==s?(t,u=o,e={action:"modify",keyword:n,...u,resource:"column",type:"alter"},t=e):(za=t,t=s)):(za=t,t=s);var u;return t}())===s&&(t=function(){var r,t,e;r=za,(t=ub())!==s&&Eb()!==s&&(e=Ri())!==s?(r,n=e,t={action:"add",type:"alter",...n},r=t):(za=r,r=s);var n;return r}())===s&&(t=function(){var r,t,e;r=za,(t=ub())!==s&&Eb()!==s&&(e=Oi())!==s?(r,n=e,t={action:"add",type:"alter",...n},r=t):(za=r,r=s);var n;return r}())===s&&(t=function(){var r,t,e,n,o;r=za,(t=Kl())!==s&&Eb()!==s&&ab()!==s&&Eb()!==s&&(e=Zc())!==s&&Eb()!==s?((n=Pl())===s&&(n=tf()),n===s&&(n=null),n!==s&&Eb()!==s&&(o=Zc())!==s?(r,a=o,t={action:"rename",type:"alter",resource:"column",keyword:"column",old_column:e,prefix:(u=n)&&u[0].toLowerCase(),column:a},r=t):(za=r,r=s)):(za=r,r=s);var u,a;return r}())===s&&(t=function(){var r,t,e,n;r=za,(t=Kl())!==s&&Eb()!==s?((e=Pl())===s&&(e=tf()),e===s&&(e=null),e!==s&&Eb()!==s&&(n=rl())!==s?(r,u=n,t={action:"rename",type:"alter",resource:"table",keyword:(o=e)&&o[0].toLowerCase(),table:u},r=t):(za=r,r=s)):(za=r,r=s);var o,u;return r}())===s&&(t=gi())===s&&(t=Si())===s&&(t=function(){var t,e,n,o,u,a,i,c,l;t=za,"change"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Dr));e!==s&&Eb()!==s?((n=ab())===s&&(n=null),n!==s&&Eb()!==s&&(o=Zc())!==s&&Eb()!==s&&(u=mi())!==s&&Eb()!==s?(a=za,"first"===r.substr(za,5).toLowerCase()?(i=r.substr(za,5),za+=5):(i=s,0===ti&&ui(Pr)),i===s&&("after"===r.substr(za,5).toLowerCase()?(i=r.substr(za,5),za+=5):(i=s,0===ti&&ui(br))),i!==s&&(c=Eb())!==s&&(l=Zc())!==s?a=i=[i,c,l]:(za=a,a=s),a===s&&(a=null),a!==s?(t,f=n,b=u,p=a,e={action:"change",old_column:o,...b,keyword:f,resource:"column",type:"alter",first_after:p&&{keyword:p[0],column:p[2]}},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var f,b,p;return t}())===s&&(t=za,(e=Pi())!==s&&(t,(n=e).resource=n.keyword,n[n.keyword]=n.value,delete n.value,e={type:"alter",...n}),t=e),t}function gi(){var t,e,n,o;return t=za,"algorithm"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(z)),e!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s?("default"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(k)),o===s&&("instant"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(jr)),o===s&&("inplace"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(xr)),o===s&&("copy"===r.substr(za,4).toLowerCase()?(o=r.substr(za,4),za+=4):(o=s,0===ti&&ui(kr))))),o!==s?(t,t=e={type:"alter",keyword:"algorithm",resource:"algorithm",symbol:n,algorithm:o}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t}function Si(){var t,e,n,o;return t=za,"lock"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(W)),e!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s?("default"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(k)),o===s&&("none"===r.substr(za,4).toLowerCase()?(o=r.substr(za,4),za+=4):(o=s,0===ti&&ui(m)),o===s&&("shared"===r.substr(za,6).toLowerCase()?(o=r.substr(za,6),za+=6):(o=s,0===ti&&ui(Ur)),o===s&&("exclusive"===r.substr(za,9).toLowerCase()?(o=r.substr(za,9),za+=9):(o=s,0===ti&&ui(Mr))))),o!==s?(t,t=e={type:"alter",keyword:"lock",resource:"lock",symbol:n,lock:o}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t}function Ii(){var t,e,n,o,u,a,i;if(t=za,(e=nl())!==s)if(Eb()!==s)if((n=hb())!==s)if(Eb()!==s){if(o=[],$r.test(r.charAt(za))?(u=r.charAt(za),za++):(u=s,0===ti&&ui(Gr)),u!==s)for(;u!==s;)o.push(u),$r.test(r.charAt(za))?(u=r.charAt(za),za++):(u=s,0===ti&&ui(Gr));else o=s;o!==s&&(u=Eb())!==s&&Lb()!==s&&Eb()!==s?((a=df())===s&&(a=yf()),a===s&&(a=null),a!==s?(t,i=a,t=e={type:"column_ref",column:e,suffix:`(${parseInt(o.join(""),10)})`,order_by:i}):(za=t,t=s)):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;return t===s&&(t=za,(e=nl())!==s&&Eb()!==s?((n=df())===s&&(n=yf()),n===s&&(n=null),n!==s?(t,t=e=function(r,t){return{type:"column_ref",column:r,order_by:t}}(e,n)):(za=t,t=s)):(za=t,t=s)),t}function Ni(){var r,t;return r=za,hb()!==s&&Eb()!==s&&(t=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=Ii())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Ii())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Ii())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=sr(t,e)):(za=r,r=s)}else za=r,r=s;return r}())!==s&&Eb()!==s&&Lb()!==s?(r,r=t):(za=r,r=s),r}function Ri(){var r,t,e,n,o,u,a,i;return r=za,(t=ib())===s&&(t=cb()),t!==s&&Eb()!==s?((e=ol())===s&&(e=null),e!==s&&Eb()!==s?((n=sc())===s&&(n=null),n!==s&&Eb()!==s&&(o=Ni())!==s&&Eb()!==s?((u=uc())===s&&(u=null),u!==s&&Eb()!==s?(r,a=n,i=u,r=t={index:e,definition:o,keyword:t.toLowerCase(),index_type:a,resource:"index",index_options:i}):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s),r}function Oi(){var r,t,e,n,o,u,a,i,c;return r=za,(t=lb())===s&&(t=fb()),t!==s&&Eb()!==s?((e=ib())===s&&(e=cb()),e===s&&(e=null),e!==s&&Eb()!==s?((n=ol())===s&&(n=null),n!==s&&Eb()!==s&&(o=Xi())!==s&&Eb()!==s?((u=uc())===s&&(u=null),u!==s&&Eb()!==s?(r,a=t,c=u,r=t={index:n,definition:o,keyword:(i=e)&&`${a.toLowerCase()} ${i.toLowerCase()}`||a.toLowerCase(),index_options:c,resource:"index"}):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s),r}function ji(){var t,e,n,o;return t=za,(e=function(){var t,e,n,o;t=za,"constraint"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(Ca));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="CONSTRAINT"):(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s?((n=rl())===s&&(n=null),n!==s?(t,o=n,t=e={keyword:e.toLowerCase(),constraint:o}):(za=t,t=s)):(za=t,t=s),t}function xi(){var t,e,n,o,u,a,i,c,l,f;return t=za,(e=vb())!==s&&Eb()!==s&&(n=ic())!==s&&Eb()!==s&&(o=Xi())!==s&&Eb()!==s?("match full"===r.substr(za,10).toLowerCase()?(u=r.substr(za,10),za+=10):(u=s,0===ti&&ui(Wr)),u===s&&("match partial"===r.substr(za,13).toLowerCase()?(u=r.substr(za,13),za+=13):(u=s,0===ti&&ui(Br)),u===s&&("match simple"===r.substr(za,12).toLowerCase()?(u=r.substr(za,12),za+=12):(u=s,0===ti&&ui(qr)))),u===s&&(u=null),u!==s&&Eb()!==s?((a=ki())===s&&(a=null),a!==s&&Eb()!==s?((i=ki())===s&&(i=null),i!==s?(t,c=u,l=a,f=i,t=e={definition:o,table:n,keyword:e.toLowerCase(),match:c&&c.toLowerCase(),on_action:[l,f].filter(r=>r)}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=ki())!==s&&(t,e={on_action:[e]}),t=e),t}function ki(){var t,e,n,o;return t=za,af()!==s&&Eb()!==s?((e=ql())===s&&(e=Yl()),e!==s&&Eb()!==s&&(n=function(){var t,e,n;t=za,(e=Jf())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s?((n=Nc())===s&&(n=null),n!==s&&Eb()!==s&&Lb()!==s?(t,t=e={type:"function",name:e,args:n}):(za=t,t=s)):(za=t,t=s);t===s&&(t=za,(e=Ui())===s&&("set null"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Kr)),e===s&&("no action"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(Qr)),e===s&&("set default"===r.substr(za,11).toLowerCase()?(e=r.substr(za,11),za+=11):(e=s,0===ti&&ui(zr)),e===s&&(e=Jf())))),e!==s&&(t,e={type:"origin",value:e.toLowerCase()}),t=e);return t}())!==s?(t,o=n,t={type:"on "+e[0].toLowerCase(),value:o}):(za=t,t=s)):(za=t,t=s),t}function Ui(){var t,e;return t=za,"restrict"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Vr)),e===s&&("cascade"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Xr))),e!==s&&(t,e=e.toLowerCase()),t=e}function Mi(){var t,e,n;return t=za,"character"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(Zr)),e!==s&&Eb()!==s?("set"===r.substr(za,3).toLowerCase()?(n=r.substr(za,3),za+=3):(n=s,0===ti&&ui(Jr)),n!==s?(t,t=e="CHARACTER SET"):(za=t,t=s)):(za=t,t=s),t}function Di(){var t,e,n,o,u,a,i,c,l;return t=za,(e=Dl())===s&&(e=null),e!==s&&Eb()!==s?((n=Mi())===s&&("charset"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui(rt)),n===s&&("collate"===r.substr(za,7).toLowerCase()?(n=r.substr(za,7),za+=7):(n=s,0===ti&&ui(tt)))),n!==s&&Eb()!==s?((o=sb())===s&&(o=null),o!==s&&Eb()!==s&&(u=ul())!==s?(t,i=n,c=o,l=u,t=e={keyword:(a=e)&&`${a[0].toLowerCase()} ${i.toLowerCase()}`||i.toLowerCase(),symbol:c,value:l}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t}function Pi(){var t,e,n,o,u,a,i,c,l;return t=za,"auto_increment"===r.substr(za,14).toLowerCase()?(e=r.substr(za,14),za+=14):(e=s,0===ti&&ui(ur)),e===s&&("avg_row_length"===r.substr(za,14).toLowerCase()?(e=r.substr(za,14),za+=14):(e=s,0===ti&&ui(et)),e===s&&("key_block_size"===r.substr(za,14).toLowerCase()?(e=r.substr(za,14),za+=14):(e=s,0===ti&&ui(nt)),e===s&&("max_rows"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(ot)),e===s&&("min_rows"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(st)),e===s&&("stats_sample_pages"===r.substr(za,18).toLowerCase()?(e=r.substr(za,18),za+=18):(e=s,0===ti&&ui(ut))))))),e!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s&&(o=Rl())!==s?(t,c=n,l=o,t=e={keyword:e.toLowerCase(),symbol:c,value:l.value}):(za=t,t=s)):(za=t,t=s),t===s&&(t=Di())===s&&(t=za,"CHECKSUM"===r.substr(za,8)?(e="CHECKSUM",za+=8):(e=s,0===ti&&ui(at)),e===s&&("DELAY_KEY_WRITE"===r.substr(za,15)?(e="DELAY_KEY_WRITE",za+=15):(e=s,0===ti&&ui(it))),e!==s&&Eb()!==s&&(n=sb())!==s&&Eb()!==s?(ct.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(lt)),o!==s?(t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:e}}(e,n,o)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=pb())===s&&("connection"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(ft)),e===s&&("engine_attribute"===r.substr(za,16).toLowerCase()?(e=r.substr(za,16),za+=16):(e=s,0===ti&&ui(bt)),e===s&&("secondary_engine_attribute"===r.substr(za,26).toLowerCase()?(e=r.substr(za,26),za+=26):(e=s,0===ti&&ui(pt))))),e!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s&&(o=gl())!==s?(t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:`'${e.value}'`}}(e,n,o)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"data"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(vt)),e===s&&("index"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(dt))),e!==s&&Eb()!==s?("directory"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(yt)),n!==s&&Eb()!==s?((o=sb())===s&&(o=null),o!==s&&(u=Eb())!==s&&(a=gl())!==s?(t,t=e=function(r,t,e){return{keyword:r.toLowerCase()+" directory",symbol:t,value:`'${e.value}'`}}(e,o,a)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"compression"===r.substr(za,11).toLowerCase()?(e=r.substr(za,11),za+=11):(e=s,0===ti&&ui(wt)),e!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s?(o=za,39===r.charCodeAt(za)?(u="'",za++):(u=s,0===ti&&ui(ht)),u!==s?("zlib"===r.substr(za,4).toLowerCase()?(a=r.substr(za,4),za+=4):(a=s,0===ti&&ui(Lt)),a===s&&("lz4"===r.substr(za,3).toLowerCase()?(a=r.substr(za,3),za+=3):(a=s,0===ti&&ui(Ct)),a===s&&("none"===r.substr(za,4).toLowerCase()?(a=r.substr(za,4),za+=4):(a=s,0===ti&&ui(m)))),a!==s?(39===r.charCodeAt(za)?(i="'",za++):(i=s,0===ti&&ui(ht)),i!==s?o=u=[u,a,i]:(za=o,o=s)):(za=o,o=s)):(za=o,o=s),o!==s?(t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:e.join("").toUpperCase()}}(e,n,o)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"engine"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(mt)),e!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s&&(o=ul())!==s?(t,t=e=Et(e,n,o)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"row_format"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(At)),e!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s?((o=Dl())===s&&("dynamic"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(mr)),o===s&&("fixed"===r.substr(za,5).toLowerCase()?(o=r.substr(za,5),za+=5):(o=s,0===ti&&ui(Cr)),o===s&&("compressed"===r.substr(za,10).toLowerCase()?(o=r.substr(za,10),za+=10):(o=s,0===ti&&ui(_t)),o===s&&("redundant"===r.substr(za,9).toLowerCase()?(o=r.substr(za,9),za+=9):(o=s,0===ti&&ui(Tt)),o===s&&("compact"===r.substr(za,7).toLowerCase()?(o=r.substr(za,7),za+=7):(o=s,0===ti&&ui(gt))))))),o!==s?(t,t=e=Et(e,n,o)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s))))))),t}function $i(){var t,e,n,o,u;return t=za,(e=lc())!==s&&Eb()!==s&&(n=function(){var t,e,n;return t=za,"read"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Wt)),e!==s&&Eb()!==s?("local"===r.substr(za,5).toLowerCase()?(n=r.substr(za,5),za+=5):(n=s,0===ti&&ui(X)),n===s&&(n=null),n!==s?(t,t=e={type:"read",suffix:n&&"local"}):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"low_priority"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(Bt)),e===s&&(e=null),e!==s&&Eb()!==s?("write"===r.substr(za,5).toLowerCase()?(n=r.substr(za,5),za+=5):(n=s,0===ti&&ui(qt)),n!==s?(t,t=e={type:"write",prefix:e&&"low_priority"}):(za=t,t=s)):(za=t,t=s)),t}())!==s?(t,o=e,u=n,rp.add(`lock::${o.db}::${o.table}`),t=e={table:o,lock_type:u}):(za=t,t=s),t}function Gi(){var t;return(t=function(){var t,e,n,o,u;return t=za,(e=wf())===s&&(e=Fl())===s&&(e=za,(n=Wl())!==s&&(o=Eb())!==s?("view"===r.substr(za,4).toLowerCase()?(u=r.substr(za,4),za+=4):(u=s,0===ti&&ui(Vt)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s),e===s&&(e=Wl())===s&&(e=ql())===s&&(e=Gl())===s&&(e=za,"grant"===r.substr(za,5).toLowerCase()?(n=r.substr(za,5),za+=5):(n=s,0===ti&&ui(Xt)),n!==s&&(o=Eb())!==s?("option"===r.substr(za,6).toLowerCase()?(u=r.substr(za,6),za+=6):(u=s,0===ti&&ui(Kt)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s),e===s&&(e=ib())===s&&(e=Vl())===s&&(e=vb())===s&&(e=Hl())===s&&(e=za,(n=$l())!==s&&(o=Eb())!==s&&(u=tb())!==s?e=n=[n,o,u]:(za=e,e=s),e===s&&(e=nf())===s&&(e=Yl())))),e!==s&&(t,e=Qt(e)),t=e}())===s&&(t=function(){var t,e,n,o,u;return t=za,e=za,(n=Fl())!==s&&(o=Eb())!==s?("routine"===r.substr(za,7).toLowerCase()?(u=r.substr(za,7),za+=7):(u=s,0===ti&&ui(zt)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s),e===s&&("execute"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Zt)),e===s&&(e=za,"grant"===r.substr(za,5).toLowerCase()?(n=r.substr(za,5),za+=5):(n=s,0===ti&&ui(Xt)),n!==s&&(o=Eb())!==s?("option"===r.substr(za,6).toLowerCase()?(u=r.substr(za,6),za+=6):(u=s,0===ti&&ui(Kt)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s),e===s&&(e=za,(n=Wl())!==s&&(o=Eb())!==s?("routine"===r.substr(za,7).toLowerCase()?(u=r.substr(za,7),za+=7):(u=s,0===ti&&ui(zt)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s)))),e!==s&&(t,e=Qt(e)),t=e}()),t}function Fi(){var r,t,e,n,o,u,a,i,c;return r=za,(t=Gi())!==s&&Eb()!==s?(e=za,(n=hb())!==s&&(o=Eb())!==s&&(u=dc())!==s&&(a=Eb())!==s&&(i=Lb())!==s?e=n=[n,o,u,a,i]:(za=e,e=s),e===s&&(e=null),e!==s?(r,r=t={priv:t,columns:(c=e)&&c[2]}):(za=r,r=s)):(za=r,r=s),r}function Hi(){var t,e,n,o,u,a,i;return t=za,(e=rl())!==s&&Eb()!==s?(n=za,64===r.charCodeAt(za)?(o="@",za++):(o=s,0===ti&&ui(lr)),o!==s&&(u=Eb())!==s&&(a=rl())!==s?n=o=[o,u,a]:(za=n,n=s),n===s&&(n=null),n!==s?(t,t=e={name:{type:"single_quote_string",value:e},host:(i=n)?{type:"single_quote_string",value:i[2]}:null}):(za=t,t=s)):(za=t,t=s),t}function Yi(){var r,t,e,n,o,u,a,i;if(r=za,(t=Hi())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Hi())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Hi())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=L(t,e)):(za=r,r=s)}else za=r,r=s;return r}function Wi(){var t,e,n;return t=za,pf()!==s&&Eb()!==s?("admin"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Jt)),e!==s&&Eb()!==s?("option"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(Kt)),n!==s?(t,t={type:"origin",value:"with admin option"}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t}function Bi(){var t,e,n,o,u,a,i;return(t=Qi())===s&&(t=za,e=za,40===r.charCodeAt(za)?(n="(",za++):(n=s,0===ti&&ui(ee)),n!==s&&(o=Eb())!==s&&(u=Bi())!==s&&(a=Eb())!==s?(41===r.charCodeAt(za)?(i=")",za++):(i=s,0===ti&&ui(ne)),i!==s?e=n=[n,o,u,a,i]:(za=e,e=s)):(za=e,e=s),e!==s&&(t,e={...e[2],parentheses_symbol:!0}),t=e),t}function qi(){var t,e,n,o,u,a,i,c,l;if(t=za,pf()!==s)if(Eb()!==s)if((e=Vi())!==s){for(n=[],o=za,(u=Eb())!==s&&(a=yb())!==s&&(i=Eb())!==s&&(c=Vi())!==s?o=u=[u,a,i,c]:(za=o,o=s);o!==s;)n.push(o),o=za,(u=Eb())!==s&&(a=yb())!==s&&(i=Eb())!==s&&(c=Vi())!==s?o=u=[u,a,i,c]:(za=o,o=s);n!==s?(t,t=sr(e,n)):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;return t===s&&(t=za,Eb()!==s&&pf()!==s&&(e=Eb())!==s&&(n=function(){var t,e,n,o;t=za,"RECURSIVE"===r.substr(za,9)?(e="RECURSIVE",za+=9):(e=s,0===ti&&ui(fs));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(o=Eb())!==s&&(u=Vi())!==s?(t,(l=u).recursive=!0,t=[l]):(za=t,t=s)),t}function Vi(){var r,t,e,n,o,u,a;return r=za,(t=gl())===s&&(t=ul())===s&&(t=bc()),t!==s&&Eb()!==s?((e=Xi())===s&&(e=null),e!==s&&Eb()!==s&&tf()!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=bi())!==s&&Eb()!==s&&Lb()!==s?(r,u=e,a=n,"string"==typeof(o=t)&&(o={type:"default",value:o}),o.table&&(o={type:"default",value:o.table}),r=t={name:o,stmt:a,columns:u}):(za=r,r=s)):(za=r,r=s),r}function Xi(){var r,t;return r=za,hb()!==s&&Eb()!==s&&(t=function(){var r;(r=dc())===s&&(r=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=_l())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=_l())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=_l())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=sr(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}());return r}())!==s&&Eb()!==s&&Lb()!==s?(r,r=t):(za=r,r=s),r}function Ki(){var t,e,n,o;return t=za,(e=function(){var t,e,n,o,u,a;return t=za,e=za,"for"===r.substr(za,3).toLowerCase()?(n=r.substr(za,3),za+=3):(n=s,0===ti&&ui(pr)),n!==s&&(o=Eb())!==s&&(u=Yl())!==s?e=n=[n,o,u]:(za=e,e=s),e!==s&&(t,e=`${(a=e)[0]} ${a[2][0]}`),t=e}())===s&&(e=function(){var t,e,n,o,u,a,i,c,l,f;return t=za,e=za,"lock"===r.substr(za,4).toLowerCase()?(n=r.substr(za,4),za+=4):(n=s,0===ti&&ui(W)),n!==s&&(o=Eb())!==s?("in"===r.substr(za,2).toLowerCase()?(u=r.substr(za,2),za+=2):(u=s,0===ti&&ui(oe)),u!==s&&(a=Eb())!==s?("share"===r.substr(za,5).toLowerCase()?(i=r.substr(za,5),za+=5):(i=s,0===ti&&ui(se)),i!==s&&(c=Eb())!==s?("mode"===r.substr(za,4).toLowerCase()?(l=r.substr(za,4),za+=4):(l=s,0===ti&&ui(ue)),l!==s?e=n=[n,o,u,a,i,c,l]:(za=e,e=s)):(za=e,e=s)):(za=e,e=s)):(za=e,e=s),e!==s&&(t,e=`${(f=e)[0]} ${f[2]} ${f[4]} ${f[6]}`),t=e}()),e!==s&&Eb()!==s?((n=function(){var t,e,n,o,u,a,i;return t=za,e=za,"wait"===r.substr(za,4).toLowerCase()?(n=r.substr(za,4),za+=4):(n=s,0===ti&&ui(ae)),n!==s&&(o=Eb())!==s&&(u=Rl())!==s?e=n=[n,o,u]:(za=e,e=s),e!==s&&(t,e=`${(a=e)[0]} ${a[2].value}`),(t=e)===s&&("nowait"===r.substr(za,6).toLowerCase()?(t=r.substr(za,6),za+=6):(t=s,0===ti&&ui(ie)),t===s&&(t=za,e=za,"skip"===r.substr(za,4).toLowerCase()?(n=r.substr(za,4),za+=4):(n=s,0===ti&&ui(ce)),n!==s&&(o=Eb())!==s?("locked"===r.substr(za,6).toLowerCase()?(u=r.substr(za,6),za+=6):(u=s,0===ti&&ui(le)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s),e!==s&&(t,e=`${(i=e)[0]} ${i[2]}`),t=e)),t}())===s&&(n=null),n!==s?(t,t=e=e+((o=n)?" "+o:"")):(za=t,t=s)):(za=t,t=s),t}function Qi(){var t,e,n,o,u,a,i,c,l,f,b,p,v,d,y,w;return t=za,Eb()!==s?((e=qi())===s&&(e=null),e!==s&&Eb()!==s&&Hl()!==s&&Ab()!==s?((n=function(){var r,t,e,n,o,u;if(r=za,(t=zi())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=zi())!==s?n=o=[o,u]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=zi())!==s?n=o=[o,u]:(za=n,n=s);e!==s?(r,t=function(r,t){const e=[r];for(let r=0,n=t.length;r<n;++r)e.push(t[r][1]);return e}(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())===s&&(n=null),n!==s&&Eb()!==s?((o=hf())===s&&(o=null),o!==s&&Eb()!==s&&(u=Zi())!==s&&Eb()!==s?((a=ec())===s&&(a=null),a!==s&&Eb()!==s?((i=nc())===s&&(i=null),i!==s&&Eb()!==s?((c=ec())===s&&(c=null),c!==s&&Eb()!==s?((l=vc())===s&&(l=null),l!==s&&Eb()!==s?((f=function(){var t,e,n;t=za,(e=function(){var t,e,n,o;t=za,"group"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Ds));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s&&vf()!==s&&Eb()!==s&&(n=Nc())!==s?(t,e=n.value,t=e):(za=t,t=s);return t}())===s&&(f=null),f!==s&&Eb()!==s?((b=function(){var t,e;t=za,function(){var t,e,n,o;t=za,"having"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui($s));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}()!==s&&Eb()!==s&&(e=Dc())!==s?(t,t=e):(za=t,t=s);return t}())===s&&(b=null),b!==s&&Eb()!==s?((p=wc())===s&&(p=null),p!==s&&Eb()!==s?((v=Cc())===s&&(v=null),v!==s&&Eb()!==s?((d=Ki())===s&&(d=null),d!==s&&Eb()!==s?((y=function(){var t,e,n;t=za,"window"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(mn));e!==s&&Eb()!==s&&(n=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=pl())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=pl())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=pl())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=Kb(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(t,t=e={keyword:"window",type:"window",expr:n}):(za=t,t=s);return t}())===s&&(y=null),y!==s&&Eb()!==s?((w=ec())===s&&(w=null),w!==s?(t,t=function(r,t,e,n,o,s,u,a,i,c,l,f,b,p,v){if(o&&u||o&&v||u&&v||o&&u&&v)throw new Error("A given SQL statement can contain at most one INTO clause");return s&&s.forEach(r=>r.table&&rp.add(`select::${r.db}::${r.table}`)),{with:r,type:"select",options:t,distinct:e,columns:n,into:{...o||u||v||{},position:(o?"column":u&&"from")||v&&"end"},from:s,where:a,groupby:i,having:c,orderby:l,limit:f,locking_read:b&&b,window:p}}(e,n,o,u,a,i,c,l,f,b,p,v,d,y,w)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t}function zi(){var t,e;return t=za,(e=function(){var t;"sql_calc_found_rows"===r.substr(za,19).toLowerCase()?(t=r.substr(za,19),za+=19):(t=s,0===ti&&ui(Ea));return t}())===s&&((e=function(){var t;"sql_cache"===r.substr(za,9).toLowerCase()?(t=r.substr(za,9),za+=9):(t=s,0===ti&&ui(Aa));return t}())===s&&(e=function(){var t;"sql_no_cache"===r.substr(za,12).toLowerCase()?(t=r.substr(za,12),za+=12):(t=s,0===ti&&ui(_a));return t}()),e===s&&(e=function(){var t;"sql_big_result"===r.substr(za,14).toLowerCase()?(t=r.substr(za,14),za+=14):(t=s,0===ti&&ui(ga));return t}())===s&&(e=function(){var t;"sql_small_result"===r.substr(za,16).toLowerCase()?(t=r.substr(za,16),za+=16):(t=s,0===ti&&ui(Ta));return t}())===s&&(e=function(){var t;"sql_buffer_result"===r.substr(za,17).toLowerCase()?(t=r.substr(za,17),za+=17):(t=s,0===ti&&ui(Sa));return t}())),e!==s&&(t,e=e),t=e}function Zi(){var r,t,e,n,o,u,a,i;if(r=za,(t=wf())===s&&(t=za,(e=wb())!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t===s&&(t=wb())),t!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=rc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=rc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=function(r,t){tp.add("select::null::(.*)");const e={expr:{type:"column_ref",table:null,column:"*"},as:null};return t&&t.length>0?Kb(e,t):[e]}(0,e)):(za=r,r=s)}else za=r,r=s;if(r===s)if(r=za,(t=rc())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=rc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=rc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=sr(t,e)):(za=r,r=s)}else za=r,r=s;return r}function Ji(){var t,e,n,o,u,a,i;return t=za,"match"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(ye)),e!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=dc())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?("AGAINST"===r.substr(za,7)?(o="AGAINST",za+=7):(o=s,0===ti&&ui(we)),o!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(u=Uc())!==s&&Eb()!==s?((a=function(){var t,e,n,o,u,a,i;return t=za,Cf()!==s&&Eb()!==s?("natural"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(fe)),e!==s&&Eb()!==s?("language"===r.substr(za,8).toLowerCase()?(n=r.substr(za,8),za+=8):(n=s,0===ti&&ui(be)),n!==s&&Eb()!==s?("mode"===r.substr(za,4).toLowerCase()?(o=r.substr(za,4),za+=4):(o=s,0===ti&&ui(ue)),o!==s&&Eb()!==s?("with"===r.substr(za,4).toLowerCase()?(u=r.substr(za,4),za+=4):(u=s,0===ti&&ui(v)),u!==s&&Eb()!==s?("query"===r.substr(za,5).toLowerCase()?(a=r.substr(za,5),za+=5):(a=s,0===ti&&ui(pe)),a!==s&&Eb()!==s?("expansion"===r.substr(za,9).toLowerCase()?(i=r.substr(za,9),za+=9):(i=s,0===ti&&ui(ve)),i!==s?(t,t={type:"origin",value:"IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION"}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,Cf()!==s&&Eb()!==s?("natural"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(fe)),e!==s&&Eb()!==s?("language"===r.substr(za,8).toLowerCase()?(n=r.substr(za,8),za+=8):(n=s,0===ti&&ui(be)),n!==s&&Eb()!==s?("mode"===r.substr(za,4).toLowerCase()?(o=r.substr(za,4),za+=4):(o=s,0===ti&&ui(ue)),o!==s?(t,t={type:"origin",value:"IN NATURAL LANGUAGE MODE"}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,Cf()!==s&&Eb()!==s?("boolean"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(de)),e!==s&&Eb()!==s?("mode"===r.substr(za,4).toLowerCase()?(n=r.substr(za,4),za+=4):(n=s,0===ti&&ui(ue)),n!==s?(t,t={type:"origin",value:"IN BOOLEAN MODE"}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,pf()!==s&&Eb()!==s?("query"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(pe)),e!==s&&Eb()!==s?("expansion"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(ve)),n!==s?(t,t={type:"origin",value:"WITH QUERY EXPANSION"}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)))),t}())===s&&(a=null),a!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((i=tc())===s&&(i=null),i!==s?(t,t=e={against:"against",columns:n,expr:u,match:"match",mode:a,type:"fulltext_search",as:i}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t}function rc(){var r,t,e,n,o,u,a,i;return r=za,(t=Ji())!==s&&(r,t=function(r){const{as:t,...e}=r;return{expr:e,as:t}}(t)),(r=t)===s&&(r=za,(t=rl())!==s&&(e=Eb())!==s&&(n=db())!==s&&(o=Eb())!==s&&(u=rl())!==s&&Eb()!==s&&db()!==s&&Eb()!==s&&wb()!==s?(r,a=t,i=u,tp.add(`select::${a}::${i}::(.*)`),r=t={expr:{type:"column_ref",db:a,table:i,column:"*"},as:null}):(za=r,r=s),r===s&&(r=za,t=za,(e=rl())!==s&&(n=Eb())!==s&&(o=db())!==s?t=e=[e,n,o]:(za=t,t=s),t===s&&(t=null),t!==s&&(e=Eb())!==s&&(n=wb())!==s?(r,r=t=function(r){return tp.add(`select::${r}::(.*)`),{expr:{type:"column_ref",table:r&&r[0]||null,column:"*"},as:null}}(t)):(za=r,r=s),r===s&&(r=za,(t=function(){var r,t,e,n;r=za,(t=$b())===s&&(t=Gb());t!==s&&Eb()!==s&&(e=ob())!==s&&Eb()!==s&&(n=Ob())!==s?(r,t=Fa(t,e,n),r=t):(za=r,r=s);return r}())!==s&&(r,t={expr:t,as:null}),(r=t)===s&&(r=za,(t=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=Uc())!==s){for(e=[],n=za,(o=Eb())!==s?((u=Tf())===s&&(u=gf())===s&&(u=mb()),u!==s&&(a=Eb())!==s&&(i=Uc())!==s?n=o=[o,u,a,i]:(za=n,n=s)):(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s?((u=Tf())===s&&(u=gf())===s&&(u=mb()),u!==s&&(a=Eb())!==s&&(i=Uc())!==s?n=o=[o,u,a,i]:(za=n,n=s)):(za=n,n=s);e!==s?(r,t=function(r,t){const e=r.ast;if(e&&"select"===e.type&&(!(r.parentheses_symbol||r.parentheses||r.ast.parentheses||r.ast.parentheses_symbol)||1!==e.columns.length||"*"===e.columns[0].expr.column))throw new Error("invalid column clause with select statement");if(!t||0===t.length)return r;const n=t.length;let o=t[n-1][3];for(let e=n-1;e>=0;e--){const n=0===e?r:t[e-1][3];o=Vb(t[e][1],n,o)}return o}(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s&&(e=Eb())!==s?((n=tc())===s&&(n=null),n!==s?(r,r=t={expr:t,as:n}):(za=r,r=s)):(za=r,r=s))))),r}function tc(){var r,t,e;return r=za,(t=tf())!==s&&Eb()!==s&&(e=function(){var r,t;r=za,(t=ul())!==s?(za,(function(r){if(!0===Wb[r.toUpperCase()])throw new Error("Error: "+JSON.stringify(r)+" is a reserved word, can not as alias clause");return!1}(t)?s:void 0)!==s?(r,r=t=t):(za=r,r=s)):(za=r,r=s);r===s&&(r=tl());return r}())!==s?(r,r=t=e):(za=r,r=s),r===s&&(r=za,(t=tf())===s&&(t=null),t!==s&&Eb()!==s&&(e=rl())!==s?(r,r=t=e):(za=r,r=s)),r}function ec(){var t,e,n;return t=za,Zl()!==s&&Eb()!==s&&(e=function(){var r,t,e,n,o,u,a,c;if(r=za,(t=$b())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(c=$b())!==s?n=o=[o,u,a,c]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(c=$b())!==s?n=o=[o,u,a,c]:(za=n,n=s);e!==s?(r,t=i(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(t,t={keyword:"var",type:"into",expr:e}):(za=t,t=s),t===s&&(t=za,Zl()!==s&&Eb()!==s?("outfile"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(he)),e===s&&("dumpfile"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Le))),e===s&&(e=null),e!==s&&Eb()!==s?((n=gl())===s&&(n=rl()),n!==s?(t,t={keyword:e,type:"into",expr:n}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)),t}function nc(){var r,t;return r=za,Jl()!==s&&Eb()!==s&&(t=ic())!==s?(r,r=t):(za=r,r=s),r}function oc(){var r,t,e;return r=za,(t=bc())!==s&&Eb()!==s&&Pl()!==s&&Eb()!==s&&(e=bc())!==s?(r,r=t=[t,e]):(za=r,r=s),r}function sc(){var t,e;return t=za,bf()!==s&&Eb()!==s?("btree"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Ce)),e===s&&("hash"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(me))),e!==s?(t,t={keyword:"using",type:e.toLowerCase()}):(za=t,t=s)):(za=t,t=s),t}function uc(){var r,t,e,n,o,u;if(r=za,(t=ac())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=ac())!==s?n=o=[o,u]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=ac())!==s?n=o=[o,u]:(za=n,n=s);e!==s?(r,r=t=function(r,t){const e=[r];for(let r=0;r<t.length;r++)e.push(t[r][1]);return e}(t,e)):(za=r,r=s)}else za=r,r=s;return r}function ac(){var t,e,n,o,u,a;return t=za,(e=function(){var t,e,n,o;t=za,"key_block_size"===r.substr(za,14).toLowerCase()?(e=r.substr(za,14),za+=14):(e=s,0===ti&&ui(nt));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="KEY_BLOCK_SIZE"):(za=t,t=s)):(za=t,t=s);return t}())!==s&&Eb()!==s?((n=sb())===s&&(n=null),n!==s&&Eb()!==s&&(o=Rl())!==s?(t,u=n,a=o,t=e={type:e.toLowerCase(),symbol:u,expr:a}):(za=t,t=s)):(za=t,t=s),t===s&&(t=sc())===s&&(t=za,"with"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(v)),e!==s&&Eb()!==s?("parser"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(Ee)),n!==s&&Eb()!==s&&(o=ul())!==s?(t,t=e={type:"with parser",expr:o}):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,"visible"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Ae)),e===s&&("invisible"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(_e))),e!==s&&(t,e=function(r){return{type:r.toLowerCase(),expr:r.toLowerCase()}}(e)),(t=e)===s&&(t=Tb()))),t}function ic(){var r,t,e,n;if(r=za,(t=lc())!==s){for(e=[],n=cc();n!==s;)e.push(n),n=cc();e!==s?(r,r=t=Te(t,e)):(za=r,r=s)}else za=r,r=s;return r}function cc(){var r,t,e;return r=za,Eb()!==s&&(t=yb())!==s&&Eb()!==s&&(e=lc())!==s?(r,r=e):(za=r,r=s),r===s&&(r=za,Eb()!==s&&(t=function(){var r,t,e,n,o,u,a,i,c,l,f;if(r=za,(t=fc())!==s)if(Eb()!==s)if((e=lc())!==s)if(Eb()!==s)if((n=bf())!==s)if(Eb()!==s)if(hb()!==s)if(Eb()!==s)if((o=ul())!==s){for(u=[],a=za,(i=Eb())!==s&&(c=yb())!==s&&(l=Eb())!==s&&(f=ul())!==s?a=i=[i,c,l,f]:(za=a,a=s);a!==s;)u.push(a),a=za,(i=Eb())!==s&&(c=yb())!==s&&(l=Eb())!==s&&(f=ul())!==s?a=i=[i,c,l,f]:(za=a,a=s);u!==s&&(a=Eb())!==s&&(i=Lb())!==s?(r,b=t,v=o,d=u,(p=e).join=b,p.using=Kb(v,d),r=t=p):(za=r,r=s)}else za=r,r=s;else za=r,r=s;else za=r,r=s;else za=r,r=s;else za=r,r=s;else za=r,r=s;else za=r,r=s;else za=r,r=s;else za=r,r=s;var b,p,v,d;r===s&&(r=za,(t=fc())!==s&&Eb()!==s&&(e=lc())!==s&&Eb()!==s?((n=pc())===s&&(n=null),n!==s?(r,t=function(r,t,e){return t.join=r,t.on=e,t}(t,e,n),r=t):(za=r,r=s)):(za=r,r=s),r===s&&(r=za,(t=fc())!==s&&Eb()!==s&&(e=hb())!==s&&Eb()!==s&&(n=bi())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((o=tc())===s&&(o=null),o!==s&&(u=Eb())!==s?((a=pc())===s&&(a=null),a!==s?(r,t=function(r,t,e,n){return t.parentheses=!0,{expr:t,as:e,join:r,on:n}}(t,n,o,a),r=t):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)));return r}())!==s?(r,r=t):(za=r,r=s)),r}function lc(){var t,e,n,o,u,a;return t=za,(e=function(){var t;"dual"===r.substr(za,4).toLowerCase()?(t=r.substr(za,4),za+=4):(t=s,0===ti&&ui(pa));return t}())!==s&&(t,e={type:"dual"}),(t=e)===s&&(t=za,(e=bc())!==s&&Eb()!==s?((n=tc())===s&&(n=null),n!==s?(t,a=n,t=e="var"===(u=e).type?(u.as=a,u):{db:u.db,table:u.table,as:a}):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=hb())!==s&&Eb()!==s&&(n=bc())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((o=tc())===s&&(o=null),o!==s?(t,t=e=function(r,t,e){return"var"===r.type?(r.as=e,r.parentheses=!0,r):{db:r.db,table:r.table,as:e,parentheses:!0}}(n,0,o)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=Sc())!==s&&Eb()!==s?((n=tc())===s&&(n=null),n!==s?(t,t=e=function(r,t){return{expr:{type:"values",values:r,prefix:"row"},as:t}}(e,n)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=hb())!==s&&Eb()!==s?((n=bi())===s&&(n=Sc()),n!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((o=tc())===s&&(o=null),o!==s?(t,t=e=function(r,t){return Array.isArray(r)&&(r={type:"values",values:r,prefix:"row"}),r.parentheses=!0,{expr:r,as:t}}(n,o)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s))))),t}function fc(){var t,e,n,o;return t=za,(e=function(){var t,e,n,o;t=za,"left"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(_s));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(n=Eb())!==s?((o=lf())===s&&(o=null),o!==s&&Eb()!==s&&cf()!==s?(t,t=e="LEFT JOIN"):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=function(){var t,e,n,o;t=za,"right"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Ts));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(n=Eb())!==s?((o=lf())===s&&(o=null),o!==s&&Eb()!==s&&cf()!==s?(t,t=e="RIGHT JOIN"):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=function(){var t,e,n,o;t=za,"full"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(gs));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(n=Eb())!==s?((o=lf())===s&&(o=null),o!==s&&Eb()!==s&&cf()!==s?(t,t=e="FULL JOIN"):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=function(){var t,e,n,o;t=za,"cross"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Is));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(n=Eb())!==s&&(o=cf())!==s?(t,t=e="CROSS JOIN"):(za=t,t=s),t===s&&(t=za,e=za,(n=function(){var t,e,n,o;t=za,"inner"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Ss));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(o=Eb())!==s?e=n=[n,o]:(za=e,e=s),e===s&&(e=null),e!==s&&(n=cf())!==s?(t,t=e="INNER JOIN"):(za=t,t=s))))),t}function bc(){var t,e,n,o,u,a,i,c,l;for(t=za,e=[],ge.test(r.charAt(za))?(n=r.charAt(za),za++):(n=s,0===ti&&ui(Se));n!==s;)e.push(n),ge.test(r.charAt(za))?(n=r.charAt(za),za++):(n=s,0===ti&&ui(Se));return e!==s&&(n=rl())!==s?(o=za,(u=Eb())!==s&&(a=db())!==s&&(i=Eb())!==s&&(c=rl())!==s?o=u=[u,a,i,c]:(za=o,o=s),o===s&&(o=null),o!==s?(t,t=e=function(r,t,e){const n=r?`${r.join("")}${t}`:t,o={db:null,table:n};return null!==e&&(o.db=n,o.table=e[3]),o}(e,n,o)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=$b())!==s&&(t,(l=e).db=null,l.table=l.name,e=l),t=e),t}function pc(){var r,t;return r=za,af()!==s&&Eb()!==s&&(t=Mc())!==s?(r,r=t):(za=r,r=s),r}function vc(){var t,e;return t=za,function(){var t,e,n,o;t=za,"where"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Ms));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}()!==s&&Eb()!==s&&(e=Dc())!==s?(t,t=e):(za=t,t=s),t}function dc(){var r,t,e,n,o,u,a,i;if(r=za,(t=Zc())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Zc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Zc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=sr(t,e)):(za=r,r=s)}else za=r,r=s;return r}function yc(){var r,t;return r=za,zl()!==s&&Eb()!==s&&vf()!==s&&Eb()!==s&&(t=Zi())!==s?(r,r=t):(za=r,r=s),r}function wc(){var t,e;return t=za,function(){var t,e,n,o;t=za,"order"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Ps));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}()!==s&&Eb()!==s&&vf()!==s&&Eb()!==s&&(e=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=hc())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=hc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=hc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=sr(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(t,t=e):(za=t,t=s),t}function hc(){var r,t,e;return r=za,(t=Uc())!==s&&Eb()!==s?((e=yf())===s&&(e=df()),e===s&&(e=null),e!==s?(r,r=t={expr:t,type:e}):(za=r,r=s)):(za=r,r=s),r}function Lc(){var t,e;return(t=Rl())===s&&(t=ll())===s&&(t=za,63===r.charCodeAt(za)?(e="?",za++):(e=s,0===ti&&ui(Ie)),e!==s&&(t,e={type:"origin",value:"?"}),t=e),t}function Cc(){var t,e,n,o,u,a;return t=za,function(){var t,e,n,o;t=za,"limit"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Gs));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}()!==s&&Eb()!==s&&(e=Lc())!==s&&Eb()!==s?(n=za,(o=yb())===s&&(o=function(){var t,e,n,o;t=za,"offset"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Fs));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="OFFSET"):(za=t,t=s)):(za=t,t=s);return t}()),o!==s&&(u=Eb())!==s&&(a=Lc())!==s?n=o=[o,u,a]:(za=n,n=s),n===s&&(n=null),n!==s?(t,t=function(r,t){const e=[r];return t&&e.push(t[2]),{seperator:t&&t[0]&&t[0].toLowerCase()||"",value:e}}(e,n)):(za=t,t=s)):(za=t,t=s),t}function mc(){var r,t,e,n,o,u,a,i;if(r=za,(t=Ec())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Ec())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Ec())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=sr(t,e)):(za=r,r=s)}else za=r,r=s;return r}function Ec(){var t,e,n,o,u,a,i,c,l;return t=za,e=za,(n=rl())!==s&&(o=Eb())!==s&&(u=db())!==s?e=n=[n,o,u]:(za=e,e=s),e===s&&(e=null),e!==s&&(n=Eb())!==s&&(o=nl())!==s&&(u=Eb())!==s?(61===r.charCodeAt(za)?(a="=",za++):(a=s,0===ti&&ui(Ne)),a!==s&&Eb()!==s&&(i=qc())!==s?(t,t=e={column:o,value:i,table:(l=e)&&l[0]}):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,e=za,(n=rl())!==s&&(o=Eb())!==s&&(u=db())!==s?e=n=[n,o,u]:(za=e,e=s),e===s&&(e=null),e!==s&&(n=Eb())!==s&&(o=nl())!==s&&(u=Eb())!==s?(61===r.charCodeAt(za)?(a="=",za++):(a=s,0===ti&&ui(Ne)),a!==s&&Eb()!==s&&(i=ff())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(c=Zc())!==s&&Eb()!==s&&Lb()!==s?(t,t=e=function(r,t,e){return{column:t,value:e,table:r&&r[0],keyword:"values"}}(e,o,c)):(za=t,t=s)):(za=t,t=s)),t}function Ac(){var r;return(r=Sc())===s&&(r=Qi()),r}function _c(){var r,t,e,n,o,u,a,i,c;if(r=za,zl()!==s)if(Eb()!==s)if((t=hb())!==s)if(Eb()!==s)if((e=ul())!==s){for(n=[],o=za,(u=Eb())!==s&&(a=yb())!==s&&(i=Eb())!==s&&(c=ul())!==s?o=u=[u,a,i,c]:(za=o,o=s);o!==s;)n.push(o),o=za,(u=Eb())!==s&&(a=yb())!==s&&(i=Eb())!==s&&(c=ul())!==s?o=u=[u,a,i,c]:(za=o,o=s);n!==s&&(o=Eb())!==s&&(u=Lb())!==s?(r,r=L(e,n)):(za=r,r=s)}else za=r,r=s;else za=r,r=s;else za=r,r=s;else za=r,r=s;else za=r,r=s;return r===s&&(r=za,zl()!==s&&Eb()!==s&&(t=Ic())!==s?(r,r=t):(za=r,r=s)),r}function Tc(){var t,e,n;return t=za,af()!==s&&Eb()!==s?("duplicate"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(Re)),e!==s&&Eb()!==s&&cb()!==s&&Eb()!==s&&Yl()!==s&&Eb()!==s&&(n=mc())!==s?(t,t={keyword:"on duplicate key update",set:n}):(za=t,t=s)):(za=t,t=s),t}function gc(){var r,t;return r=za,(t=Vl())!==s&&(r,t="insert"),(r=t)===s&&(r=za,(t=Xl())!==s&&(r,t="replace"),r=t),r}function Sc(){var r,t;return r=za,ff()!==s&&Eb()!==s&&(t=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=Ic())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Ic())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Ic())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=sr(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}())!==s?(r,r=t):(za=r,r=s),r}function Ic(){var t,e,n;return t=za,"row"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(dr)),e===s&&(e=null),e!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Nc())!==s&&Eb()!==s&&Lb()!==s?(t,t=e=n):(za=t,t=s),t}function Nc(){var r,t,e,n,o,u,a,i;if(r=za,(t=Uc())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Uc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=Uc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=function(r,t){const e={type:"expr_list"};return e.value=Kb(r,t),e}(t,e)):(za=r,r=s)}else za=r,r=s;return r}function Rc(){var t,e,n;return t=za,Zf()!==s&&Eb()!==s&&(e=Uc())!==s&&Eb()!==s&&(n=function(){var t;(t=function(){var t,e,n,o;t=za,"year"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(so));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="YEAR"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"month"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Jn));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MONTH"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"week"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(oo));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="WEEK"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"day"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui($n));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DAY"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"hour"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Bn));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="HOUR"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"minute"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Zn));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MINUTE"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"second"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(to));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SECOND"):(za=t,t=s)):(za=t,t=s);return t}());return t}())!==s?(t,t={type:"interval",expr:e,unit:n.toLowerCase()}):(za=t,t=s),t}function Oc(){var r,t,e,n,o,u;if(r=za,(t=jc())!==s)if(Eb()!==s){for(e=[],n=za,(o=Eb())!==s&&(u=jc())!==s?n=o=[o,u]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=jc())!==s?n=o=[o,u]:(za=n,n=s);e!==s?(r,r=t=l(t,e)):(za=r,r=s)}else za=r,r=s;else za=r,r=s;return r}function jc(){var t,e,n;return t=za,function(){var t,e,n,o;t=za,"when"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(fu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}()!==s&&Eb()!==s&&(e=Dc())!==s&&Eb()!==s&&function(){var t,e,n,o;t=za,"then"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(bu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}()!==s&&Eb()!==s&&(n=Uc())!==s?(t,t={type:"when",cond:e,result:n}):(za=t,t=s),t}function xc(){var t,e;return t=za,function(){var t,e,n,o;t=za,"else"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(pu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}()!==s&&Eb()!==s&&(e=Uc())!==s?(t,t={type:"else",result:e}):(za=t,t=s),t}function kc(){var r;return(r=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=zc())!==s){if(e=[],n=za,(o=Eb())!==s&&(u=mb())!==s&&(a=Eb())!==s&&(i=zc())!==s?n=o=[o,u,a,i]:(za=n,n=s),n!==s)for(;n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=mb())!==s&&(a=Eb())!==s&&(i=zc())!==s?n=o=[o,u,a,i]:(za=n,n=s);else e=s;e!==s&&(n=Eb())!==s?((o=Fc())===s&&(o=null),o!==s?(r,t=function(r,t,e){const n=Qb(r,t);return null===e?n:"arithmetic"===e.type?Qb(n,e.tail):Vb(e.op,n,e.right)}(t,e,o),r=t):(za=r,r=s)):(za=r,r=s)}else za=r,r=s;return r}())===s&&(r=function(){var r,t,e,n,o,u,a,i;if(r=za,(t=Pc())!==s){for(e=[],n=za,(o=Ab())!==s&&(u=gf())!==s&&(a=Eb())!==s&&(i=Pc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Ab())!==s&&(u=gf())!==s&&(a=Eb())!==s&&(i=Pc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,t=Oe(t,e),r=t):(za=r,r=s)}else za=r,r=s;return r}()),r}function Uc(){var r;return(r=kc())===s&&(r=bi()),r}function Mc(){var r,t,e,n,o,u,a,i;if(r=za,(t=Uc())!==s){for(e=[],n=za,(o=Eb())!==s?((u=Tf())===s&&(u=gf()),u!==s&&(a=Eb())!==s&&(i=Uc())!==s?n=o=[o,u,a,i]:(za=n,n=s)):(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s?((u=Tf())===s&&(u=gf()),u!==s&&(a=Eb())!==s&&(i=Uc())!==s?n=o=[o,u,a,i]:(za=n,n=s)):(za=n,n=s);e!==s?(r,r=t=function(r,t){const e=t.length;let n=r;for(let r=0;r<e;++r)n=Vb(t[r][1],n,t[r][3]);return n}(t,e)):(za=r,r=s)}else za=r,r=s;return r}function Dc(){var r,t,e,n,o,u,a,i;if(r=za,(t=Uc())!==s){for(e=[],n=za,(o=Eb())!==s?((u=Tf())===s&&(u=gf())===s&&(u=yb()),u!==s&&(a=Eb())!==s&&(i=Uc())!==s?n=o=[o,u,a,i]:(za=n,n=s)):(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s?((u=Tf())===s&&(u=gf())===s&&(u=yb()),u!==s&&(a=Eb())!==s&&(i=Uc())!==s?n=o=[o,u,a,i]:(za=n,n=s)):(za=n,n=s);e!==s?(r,r=t=function(r,t){const e=t.length;let n=r,o="";for(let r=0;r<e;++r)","===t[r][1]?(o=",",Array.isArray(n)||(n=[n]),n.push(t[r][3])):n=Vb(t[r][1],n,t[r][3]);if(","===o){const r={type:"expr_list"};return r.value=n,r}return n}(t,e)):(za=r,r=s)}else za=r,r=s;return r}function Pc(){var r,t,e,n,o,u,a,i;if(r=za,(t=$c())!==s){for(e=[],n=za,(o=Ab())!==s&&(u=Tf())!==s&&(a=Eb())!==s&&(i=$c())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Ab())!==s&&(u=Tf())!==s&&(a=Eb())!==s&&(i=$c())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=Oe(t,e)):(za=r,r=s)}else za=r,r=s;return r}function $c(){var r,t;return(r=Gc())===s&&(r=function(){var r,t,e;r=za,(t=function(){var r,t,e,n,o;r=za,t=za,(e=_f())!==s&&(n=Eb())!==s&&(o=Af())!==s?t=e=[e,n,o]:(za=t,t=s);t!==s&&(r,t=je(t));(r=t)===s&&(r=Af());return r}())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(e=bi())!==s&&Eb()!==s&&Lb()!==s?(r,n=t,(o=e).parentheses=!0,t=qb(n,o),r=t):(za=r,r=s);var n,o;return r}())===s&&(r=za,_f()!==s&&Eb()!==s&&(t=$c())!==s?(r,r=qb("NOT",t)):(za=r,r=s)),r}function Gc(){var r,t,e,n,o;return r=za,(t=qc())!==s&&Eb()!==s?((e=Fc())===s&&(e=null),e!==s?(r,n=t,r=t=null===(o=e)?n:"arithmetic"===o.type?Qb(n,o.tail):Vb(o.op,n,o.right)):(za=r,r=s)):(za=r,r=s),r===s&&(r=gl())===s&&(r=Zc()),r}function Fc(){var t;return(t=function(){var r,t,e,n,o,u,a;r=za,t=[],e=za,(n=Eb())!==s&&(o=Hc())!==s&&(u=Eb())!==s&&(a=qc())!==s?e=n=[n,o,u,a]:(za=e,e=s);if(e!==s)for(;e!==s;)t.push(e),e=za,(n=Eb())!==s&&(o=Hc())!==s&&(u=Eb())!==s&&(a=qc())!==s?e=n=[n,o,u,a]:(za=e,e=s);else t=s;t!==s&&(r,t={type:"arithmetic",tail:t});return r=t}())===s&&(t=Bc())===s&&(t=function(){var r,t,e,n;r=za,(t=function(){var r,t,e,n,o;r=za,t=za,(e=_f())!==s&&(n=Eb())!==s&&(o=Lf())!==s?t=e=[e,n,o]:(za=t,t=s);t!==s&&(r,t=je(t));(r=t)===s&&(r=Lf());return r}())!==s&&Eb()!==s&&(e=qc())!==s&&Eb()!==s&&Tf()!==s&&Eb()!==s&&(n=qc())!==s?(r,r=t={op:t,right:{type:"expr_list",value:[e,n]}}):(za=r,r=s);return r}())===s&&(t=function(){var r,t,e,n,o;r=za,(t=mf())!==s&&(e=Eb())!==s&&(n=qc())!==s?(r,r=t={op:"IS",right:n}):(za=r,r=s);r===s&&(r=za,t=za,(e=mf())!==s&&(n=Eb())!==s&&(o=_f())!==s?t=e=[e,n,o]:(za=t,t=s),t!==s&&(e=Eb())!==s&&(n=qc())!==s?(r,t=function(r){return{op:"IS NOT",right:r}}(n),r=t):(za=r,r=s));return r}())===s&&(t=Wc())===s&&(t=function(){var t,e,n,o;t=za,(e=function(){var t,e,n;t=za,(e=_f())===s&&(e=null);e!==s&&Eb()!==s?((n=function(){var t,e,n,o;t=za,"regexp"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(zs));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="REGEXP"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(n=function(){var t,e,n,o;t=za,"rlike"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Qs));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="RLIKE"):(za=t,t=s)):(za=t,t=s);return t}()),n!==s?(t,u=n,t=e=(o=e)?`${o} ${u}`:u):(za=t,t=s)):(za=t,t=s);var o,u;return t}())!==s&&Eb()!==s?("binary"===r.substr(za,6).toLowerCase()?(n=r.substr(za,6),za+=6):(n=s,0===ti&&ui(St)),n===s&&(n=null),n!==s&&Eb()!==s?((o=El())===s&&(o=gl())===s&&(o=Zc()),o!==s?(t,u=e,t=e={op:(a=n)?`${u} ${a}`:u,right:o}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);var u,a;return t}()),t}function Hc(){var t;return">="===r.substr(za,2)?(t=">=",za+=2):(t=s,0===ti&&ui(xe)),t===s&&(62===r.charCodeAt(za)?(t=">",za++):(t=s,0===ti&&ui(ke)),t===s&&("<="===r.substr(za,2)?(t="<=",za+=2):(t=s,0===ti&&ui(Ue)),t===s&&("<>"===r.substr(za,2)?(t="<>",za+=2):(t=s,0===ti&&ui(Me)),t===s&&(60===r.charCodeAt(za)?(t="<",za++):(t=s,0===ti&&ui(De)),t===s&&(61===r.charCodeAt(za)?(t="=",za++):(t=s,0===ti&&ui(Ne)),t===s&&("!="===r.substr(za,2)?(t="!=",za+=2):(t=s,0===ti&&ui(Pe)))))))),t}function Yc(){var r,t,e,n,o;return r=za,t=za,(e=_f())!==s&&(n=Eb())!==s&&(o=Cf())!==s?t=e=[e,n,o]:(za=t,t=s),t!==s&&(r,t=je(t)),(r=t)===s&&(r=Cf()),r}function Wc(){var t,e,n,o,u,a,i,c,l,f;return t=za,(e=function(){var r,t,e,n,o;return r=za,t=za,(e=_f())!==s&&(n=Eb())!==s&&(o=Ef())!==s?t=e=[e,n,o]:(za=t,t=s),t!==s&&(r,t=je(t)),(r=t)===s&&(r=Ef()),r}())!==s&&Eb()!==s?((n=_l())===s&&(n=ll())===s&&(n=Gc()),n!==s&&Eb()!==s?(o=za,(u=Eb())!==s&&(a=Ai())!==s?o=u=[u,a]:(za=o,o=s),o===s&&(o=null),o!==s&&(u=Eb())!==s?((a=function(){var t,e,n;return t=za,"escape"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui($e)),e!==s&&Eb()!==s&&(n=gl())!==s?(t,t=e={type:"ESCAPE",value:n}):(za=t,t=s),t}())===s&&(a=null),a!==s?(t,i=e,c=n,l=o,(f=a)&&(c.escape=f),l&&(c.suffix={collate:l[1]}),t=e={op:i,right:c}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t}function Bc(){var r,t,e,n;return r=za,(t=Yc())!==s&&Eb()!==s&&(e=hb())!==s&&Eb()!==s&&(n=Nc())!==s&&Eb()!==s&&Lb()!==s?(r,r=t={op:t,right:n}):(za=r,r=s),r===s&&(r=za,(t=Yc())!==s&&Eb()!==s?((e=$b())===s&&(e=Zc())===s&&(e=gl()),e!==s?(r,r=t=function(r,t){return{op:r,right:t}}(t,e)):(za=r,r=s)):(za=r,r=s)),r}function qc(){var r,t,e,n,o,u,a,i;if(r=za,(t=Xc())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=Vc())!==s&&(a=Eb())!==s&&(i=Xc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=Vc())!==s&&(a=Eb())!==s&&(i=Xc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=Oe(t,e)):(za=r,r=s)}else za=r,r=s;return r}function Vc(){var t;return 43===r.charCodeAt(za)?(t="+",za++):(t=s,0===ti&&ui(Ge)),t===s&&(45===r.charCodeAt(za)?(t="-",za++):(t=s,0===ti&&ui(Fe))),t}function Xc(){var r,t,e,n,o,u,a,i;if(r=za,(t=Qc())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=Kc())!==s&&(a=Eb())!==s&&(i=Qc())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=Kc())!==s&&(a=Eb())!==s&&(i=Qc())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=Qb(t,e)):(za=r,r=s)}else za=r,r=s;return r}function Kc(){var t,e;return 42===r.charCodeAt(za)?(t="*",za++):(t=s,0===ti&&ui(He)),t===s&&(47===r.charCodeAt(za)?(t="/",za++):(t=s,0===ti&&ui(Ye)),t===s&&(37===r.charCodeAt(za)?(t="%",za++):(t=s,0===ti&&ui(We)),t===s&&("||"===r.substr(za,2)?(t="||",za+=2):(t=s,0===ti&&ui(Be)),t===s&&(t=za,"div"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(qe)),e!==s&&(t,e="DIV"),(t=e)===s&&(38===r.charCodeAt(za)?(t="&",za++):(t=s,0===ti&&ui(Ve)),t===s&&(">>"===r.substr(za,2)?(t=">>",za+=2):(t=s,0===ti&&ui(Xe)),t===s&&("<<"===r.substr(za,2)?(t="<<",za+=2):(t=s,0===ti&&ui(Ke)),t===s&&(94===r.charCodeAt(za)?(t="^",za++):(t=s,0===ti&&ui(Qe)),t===s&&(124===r.charCodeAt(za)?(t="|",za++):(t=s,0===ti&&ui(ze))))))))))),t}function Qc(){var t,e,n,o,u;return(t=zc())===s&&(t=za,(e=function(){var t;33===r.charCodeAt(za)?(t="!",za++):(t=s,0===ti&&ui(Ze));t===s&&(45===r.charCodeAt(za)?(t="-",za++):(t=s,0===ti&&ui(Fe)),t===s&&(43===r.charCodeAt(za)?(t="+",za++):(t=s,0===ti&&ui(Ge)),t===s&&(126===r.charCodeAt(za)?(t="~",za++):(t=s,0===ti&&ui(Je)))));return t}())!==s?(n=za,(o=Eb())!==s&&(u=Qc())!==s?n=o=[o,u]:(za=n,n=s),n!==s?(t,t=e=qb(e,n[1])):(za=t,t=s)):(za=t,t=s)),t}function zc(){var t,e,n,o;return(t=function(){var t,e,n,o,u,a,i;t=za,(e=Rf())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Uc())!==s&&Eb()!==s&&tf()!==s&&Eb()!==s&&(o=Hb())!==s&&Eb()!==s&&(u=Mi())!==s&&Eb()!==s&&(a=ul())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((i=Ai())===s&&(i=null),i!==s?(t,e=function(r,t,e,n,o,s){const{dataType:u,length:a}=e;let i=u;return void 0!==a&&(i=`${i}(${a})`),{type:"cast",keyword:r.toLowerCase(),expr:t,symbol:"as",target:{dataType:`${i} ${n} ${o.toUpperCase()}`},collate:s}}(e,n,o,u,a,i),t=e):(za=t,t=s)):(za=t,t=s);t===s&&(t=za,(e=Rf())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Uc())!==s&&Eb()!==s&&tf()!==s&&Eb()!==s&&(o=Fb())!==s&&Eb()!==s&&(u=Lb())!==s?(t,c=n,l=o,e={type:"cast",keyword:e.toLowerCase(),expr:c,target:l},t=e):(za=t,t=s),t===s&&(t=za,(e=Rf())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Uc())!==s&&Eb()!==s&&tf()!==s&&Eb()!==s&&(o=Uf())!==s&&Eb()!==s&&(u=hb())!==s&&Eb()!==s&&(a=Ol())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s&&(i=Lb())!==s?(t,e=function(r,t,e){return{type:"cast",keyword:r.toLowerCase(),expr:t,target:{dataType:"DECIMAL("+e+")"}}}(e,n,a),t=e):(za=t,t=s),t===s&&(t=za,(e=Rf())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Uc())!==s&&Eb()!==s&&tf()!==s&&Eb()!==s&&(o=Uf())!==s&&Eb()!==s&&(u=hb())!==s&&Eb()!==s&&(a=Ol())!==s&&Eb()!==s&&yb()!==s&&Eb()!==s&&(i=Ol())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s&&Lb()!==s?(t,e=function(r,t,e,n){return{type:"cast",keyword:r.toLowerCase(),expr:t,target:{dataType:"DECIMAL("+e+", "+n+")"}}}(e,n,a,i),t=e):(za=t,t=s),t===s&&(t=za,(e=Rf())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Uc())!==s&&Eb()!==s&&tf()!==s&&Eb()!==s&&(o=function(){var t;(t=function(){var t,e,n,o;t=za,"signed"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Eu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SIGNED"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=Mf());return t}())!==s&&Eb()!==s?((u=Pf())===s&&(u=null),u!==s&&Eb()!==s&&(a=Lb())!==s?(t,e=function(r,t,e,n){return{type:"cast",keyword:r.toLowerCase(),expr:t,target:{dataType:e+(n?" "+n:"")}}}(e,n,o,u),t=e):(za=t,t=s)):(za=t,t=s)))));var c,l;return t}())===s&&(t=_l())===s&&(t=Ji())===s&&(t=function(){var t;(t=function(){var t,e,n,o;t=za,(e=function(){var t,e,n,o;t=za,"count"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(eu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="COUNT"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(e=function(){var t,e,n,o;t=za,"group_concat"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(nu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="GROUP_CONCAT"):(za=t,t=s)):(za=t,t=s);return t}());e!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=function(){var t,e,n,o,u,a,i,c,l,f,b;t=za,(e=function(){var t,e;t=za,42===r.charCodeAt(za)?(e="*",za++):(e=s,0===ti&&ui(He));e!==s&&(t,e={type:"star",value:"*"});return t=e}())!==s&&(t,e={expr:e});if((t=e)===s){if(t=za,(e=hf())===s&&(e=null),e!==s)if(Eb()!==s)if((n=hb())!==s)if(Eb()!==s)if((o=Uc())!==s)if(Eb()!==s)if((u=Lb())!==s){for(a=[],i=za,(c=Eb())!==s?((l=Tf())===s&&(l=gf()),l!==s&&(f=Eb())!==s&&(b=Uc())!==s?i=c=[c,l,f,b]:(za=i,i=s)):(za=i,i=s);i!==s;)a.push(i),i=za,(c=Eb())!==s?((l=Tf())===s&&(l=gf()),l!==s&&(f=Eb())!==s&&(b=Uc())!==s?i=c=[c,l,f,b]:(za=i,i=s)):(za=i,i=s);a!==s&&(i=Eb())!==s?((c=wc())===s&&(c=null),c!==s&&(l=Eb())!==s?((f=Ll())===s&&(f=null),f!==s?(t,e=function(r,t,e,n,o){const s=e.length;let u=t;u.parentheses=!0;for(let r=0;r<s;++r)u=Vb(e[r][1],u,e[r][3]);return{distinct:r,expr:u,orderby:n,separator:o}}(e,o,a,c,f),t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;t===s&&(t=za,(e=hf())===s&&(e=null),e!==s&&Eb()!==s&&(n=Mc())!==s&&Eb()!==s?((o=wc())===s&&(o=null),o!==s&&Eb()!==s?((u=Ll())===s&&(u=null),u!==s?(t,t=e={distinct:e,expr:n,orderby:o,separator:u}):(za=t,t=s)):(za=t,t=s)):(za=t,t=s))}return t}())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((o=bl())===s&&(o=null),o!==s?(t,t=e={type:"aggr_func",name:e,args:n,over:o}):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,(e=function(){var t;(t=function(){var t,e,n,o;t=za,"sum"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(uu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SUM"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"max"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(ou));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MAX"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"min"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(su));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MIN"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"avg"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(au));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="AVG"):(za=t,t=s)):(za=t,t=s);return t}());return t}())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=qc())!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((o=bl())===s&&(o=null),o!==s?(t,t=e={type:"aggr_func",name:e,args:{expr:n},over:o}):(za=t,t=s)):(za=t,t=s);return t}());return t}())===s&&(t=El())===s&&(t=function(){var r,t,e,n,o,u,a,i;return r=za,If()!==s&&Eb()!==s&&(t=Oc())!==s&&Eb()!==s?((e=xc())===s&&(e=null),e!==s&&Eb()!==s&&(n=Nf())!==s&&Eb()!==s?((o=If())===s&&(o=null),o!==s?(r,a=t,(i=e)&&a.push(i),r={type:"case",expr:null,args:a}):(za=r,r=s)):(za=r,r=s)):(za=r,r=s),r===s&&(r=za,If()!==s&&Eb()!==s&&(t=Uc())!==s&&Eb()!==s&&(e=Oc())!==s&&Eb()!==s?((n=xc())===s&&(n=null),n!==s&&Eb()!==s&&(o=Nf())!==s&&Eb()!==s?((u=If())===s&&(u=null),u!==s?(r,r=function(r,t,e){return e&&t.push(e),{type:"case",expr:r,args:t}}(t,e,n)):(za=r,r=s)):(za=r,r=s)):(za=r,r=s)),r}())===s&&(t=Rc())===s&&(t=Zc())===s&&(t=ll())===s&&(t=za,hb()!==s&&(e=Eb())!==s&&(n=Dc())!==s&&Eb()!==s&&Lb()!==s?(t,(o=n).parentheses=!0,t=o):(za=t,t=s),t===s&&(t=$b())===s&&(t=za,Eb()!==s?(63===r.charCodeAt(za)?(e="?",za++):(e=s,0===ti&&ui(Ie)),e!==s?(t,t={type:"origin",value:e}):(za=t,t=s)):(za=t,t=s))),t}function Zc(){var r,t,e,n,o,u,a;return r=za,(t=ul())===s&&(t=el()),t!==s&&Eb()!==s&&db()!==s&&Eb()!==s?((e=ul())===s&&(e=el()),e!==s&&Eb()!==s&&db()!==s&&Eb()!==s&&(n=nl())!==s?(r,o=t,u=e,a=n,tp.add(`select::${o}::${u}::${a}`),r=t={type:"column_ref",db:o,table:u,column:a}):(za=r,r=s)):(za=r,r=s),r===s&&(r=za,(t=ul())===s&&(t=el()),t!==s&&Eb()!==s&&db()!==s&&Eb()!==s&&(e=nl())!==s?(r,r=t=function(r,t){return tp.add(`select::${r}::${t}`),{type:"column_ref",table:r,column:t}}(t,e)):(za=r,r=s),r===s&&(r=za,(t=ol())!==s&&(r,t=function(r){return tp.add("select::null::"+r),{type:"column_ref",table:null,column:r}}(t)),r=t)),r}function Jc(){var r,t,e,n,o,u,a,i;if(r=za,(t=ol())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=ol())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=ol())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=sr(t,e)):(za=r,r=s)}else za=r,r=s;return r}function rl(){var r,t;return r=za,(t=ul())!==s?(za,(rn(t)?s:void 0)!==s?(r,r=t=t):(za=r,r=s)):(za=r,r=s),r===s&&(r=tl()),r}function tl(){var t;return(t=function(){var t,e,n,o;t=za,34===r.charCodeAt(za)?(e='"',za++):(e=s,0===ti&&ui(tn));if(e!==s){if(n=[],en.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(nn)),o!==s)for(;o!==s;)n.push(o),en.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(nn));else n=s;n!==s?(34===r.charCodeAt(za)?(o='"',za++):(o=s,0===ti&&ui(tn)),o!==s?(t,e=on(n),t=e):(za=t,t=s)):(za=t,t=s)}else za=t,t=s;return t}())===s&&(t=function(){var t,e,n,o;t=za,39===r.charCodeAt(za)?(e="'",za++):(e=s,0===ti&&ui(ht));if(e!==s){if(n=[],sn.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(un)),o!==s)for(;o!==s;)n.push(o),sn.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(un));else n=s;n!==s?(39===r.charCodeAt(za)?(o="'",za++):(o=s,0===ti&&ui(ht)),o!==s?(t,e=on(n),t=e):(za=t,t=s)):(za=t,t=s)}else za=t,t=s;return t}())===s&&(t=el()),t}function el(){var t,e,n,o;if(t=za,96===r.charCodeAt(za)?(e="`",za++):(e=s,0===ti&&ui(an)),e!==s){if(n=[],cn.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(ln)),o===s&&(o=Nl()),o!==s)for(;o!==s;)n.push(o),cn.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(ln)),o===s&&(o=Nl());else n=s;n!==s?(96===r.charCodeAt(za)?(o="`",za++):(o=s,0===ti&&ui(an)),o!==s?(t,t=e=on(n)):(za=t,t=s)):(za=t,t=s)}else za=t,t=s;return t}function nl(){var r,t;return r=za,(t=sl())!==s&&(r,t=t),(r=t)===s&&(r=tl()),r}function ol(){var r,t;return r=za,(t=sl())!==s?(za,(rn(t)?s:void 0)!==s?(r,r=t=t):(za=r,r=s)):(za=r,r=s),r===s&&(r=el()),r}function sl(){var r,t,e,n;if(r=za,(t=al())!==s){for(e=[],n=cl();n!==s;)e.push(n),n=cl();e!==s?(r,r=t=fn(t,e)):(za=r,r=s)}else za=r,r=s;return r}function ul(){var r,t,e,n;if(r=za,(t=al())!==s){for(e=[],n=il();n!==s;)e.push(n),n=il();e!==s?(r,r=t=fn(t,e)):(za=r,r=s)}else za=r,r=s;return r}function al(){var t;return bn.test(r.charAt(za))?(t=r.charAt(za),za++):(t=s,0===ti&&ui(pn)),t}function il(){var t;return vn.test(r.charAt(za))?(t=r.charAt(za),za++):(t=s,0===ti&&ui(dn)),t}function cl(){var t;return yn.test(r.charAt(za))?(t=r.charAt(za),za++):(t=s,0===ti&&ui(wn)),t}function ll(){var t,e,n,o;return t=za,e=za,58===r.charCodeAt(za)?(n=":",za++):(n=s,0===ti&&ui(hn)),n!==s&&(o=ul())!==s?e=n=[n,o]:(za=e,e=s),e!==s&&(t,e={type:"param",value:e[1]}),t=e}function fl(){var t,e,n,o,u,a,i,c,l;return t=za,af()!==s&&Eb()!==s&&Yl()!==s&&Eb()!==s&&(e=Jf())!==s&&Eb()!==s?(n=za,(o=hb())!==s&&(u=Eb())!==s?((a=Nc())===s&&(a=null),a!==s&&(i=Eb())!==s&&(c=Lb())!==s?n=o=[o,u,a,i,c]:(za=n,n=s)):(za=n,n=s),n===s&&(n=null),n!==s?(t,t={type:"on update",keyword:e,parentheses:!!(l=n),expr:l?l[2]:null}):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,af()!==s&&Eb()!==s&&Yl()!==s&&Eb()!==s?("now"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(Ln)),e!==s&&Eb()!==s&&(n=hb())!==s&&(o=Eb())!==s&&(u=Lb())!==s?(t,t=function(r){return{type:"on update",keyword:r,parentheses:!0}}(e)):(za=t,t=s)):(za=t,t=s)),t}function bl(){var t,e,n;return t=za,"over"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Cn)),e!==s&&Eb()!==s&&(n=vl())!==s?(t,t=e={type:"window",as_window_specification:n}):(za=t,t=s),t===s&&(t=fl()),t}function pl(){var r,t,e;return r=za,(t=ul())!==s&&Eb()!==s&&tf()!==s&&Eb()!==s&&(e=vl())!==s?(r,r=t={name:t,as_window_specification:e}):(za=r,r=s),r}function vl(){var r,t;return(r=ul())===s&&(r=za,hb()!==s&&Eb()!==s?((t=function(){var r,t,e,n;r=za,(t=yc())===s&&(t=null);t!==s&&Eb()!==s?((e=wc())===s&&(e=null),e!==s&&Eb()!==s?((n=function(){var r,t,e,n,o;r=za,(t=Vf())!==s&&Eb()!==s?((e=dl())===s&&(e=yl()),e!==s?(r,t="rows "+e.value,r=t):(za=r,r=s)):(za=r,r=s);r===s&&(r=za,(t=Vf())!==s&&Eb()!==s&&(e=Lf())!==s&&Eb()!==s&&(n=yl())!==s&&Eb()!==s&&Tf()!==s&&Eb()!==s&&(o=dl())!==s?(r,u=o,t=`rows between ${n.value} and ${u.value}`,r=t):(za=r,r=s));var u;return r}())===s&&(n=null),n!==s?(r,r=t={name:null,partitionby:t,orderby:e,window_frame_clause:n}):(za=r,r=s)):(za=r,r=s)):(za=r,r=s);return r}())===s&&(t=null),t!==s&&Eb()!==s&&Lb()!==s?(r,r={window_specification:t||{},parentheses:!0}):(za=r,r=s)):(za=r,r=s)),r}function dl(){var t,e,n,o;return t=za,(e=hl())!==s&&Eb()!==s?("following"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(En)),n!==s?(t,(o=e).value+=" FOLLOWING",t=e=o):(za=t,t=s)):(za=t,t=s),t===s&&(t=wl()),t}function yl(){var t,e,n,o;return t=za,(e=hl())!==s&&Eb()!==s?("preceding"===r.substr(za,9).toLowerCase()?(n=r.substr(za,9),za+=9):(n=s,0===ti&&ui(An)),n!==s?(t,(o=e).value+=" PRECEDING",t=e=o):(za=t,t=s)):(za=t,t=s),t===s&&(t=wl()),t}function wl(){var t,e,n;return t=za,"current"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(P)),e!==s&&Eb()!==s?("row"===r.substr(za,3).toLowerCase()?(n=r.substr(za,3),za+=3):(n=s,0===ti&&ui(dr)),n!==s?(t,t=e={type:"single_quote_string",value:"current row"}):(za=t,t=s)):(za=t,t=s),t}function hl(){var t,e;return t=za,"unbounded"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(H)),e!==s&&(t,e={type:"single_quote_string",value:e.toUpperCase()}),(t=e)===s&&(t=Rl()),t}function Ll(){var t,e,n;return t=za,"separator"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(_n)),e===s&&(e=null),e!==s&&Eb()!==s&&(n=gl())!==s?(t,t=e={keyword:e,value:n}):(za=t,t=s),t}function Cl(){var t,e;return t=za,"year_month"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(Tn)),e===s&&("day_hour"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(gn)),e===s&&("day_minute"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(Sn)),e===s&&("day_second"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(In)),e===s&&("day_microsecond"===r.substr(za,15).toLowerCase()?(e=r.substr(za,15),za+=15):(e=s,0===ti&&ui(Nn)),e===s&&("hour_minute"===r.substr(za,11).toLowerCase()?(e=r.substr(za,11),za+=11):(e=s,0===ti&&ui(Rn)),e===s&&("hour_second"===r.substr(za,11).toLowerCase()?(e=r.substr(za,11),za+=11):(e=s,0===ti&&ui(On)),e===s&&("hour_microsecond"===r.substr(za,16).toLowerCase()?(e=r.substr(za,16),za+=16):(e=s,0===ti&&ui(jn)),e===s&&("minute_second"===r.substr(za,13).toLowerCase()?(e=r.substr(za,13),za+=13):(e=s,0===ti&&ui(xn)),e===s&&("minute_microsecond"===r.substr(za,18).toLowerCase()?(e=r.substr(za,18),za+=18):(e=s,0===ti&&ui(kn)),e===s&&("second_microsecond"===r.substr(za,18).toLowerCase()?(e=r.substr(za,18),za+=18):(e=s,0===ti&&ui(Un)),e===s&&("timezone_hour"===r.substr(za,13).toLowerCase()?(e=r.substr(za,13),za+=13):(e=s,0===ti&&ui(Mn)),e===s&&("timezone_minute"===r.substr(za,15).toLowerCase()?(e=r.substr(za,15),za+=15):(e=s,0===ti&&ui(Dn)),e===s&&("century"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Pn)),e===s&&("day"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui($n)),e===s&&("date"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Gn)),e===s&&("decade"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Fn)),e===s&&("dow"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(Hn)),e===s&&("doy"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(Yn)),e===s&&("epoch"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Wn)),e===s&&("hour"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Bn)),e===s&&("isodow"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(qn)),e===s&&("isoweek"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Vn)),e===s&&("isoyear"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Xn)),e===s&&("microseconds"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(Kn)),e===s&&("millennium"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(Qn)),e===s&&("milliseconds"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(zn)),e===s&&("minute"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Zn)),e===s&&("month"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Jn)),e===s&&("quarter"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(ro)),e===s&&("second"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(to)),e===s&&("time"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(eo)),e===s&&("timezone"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(no)),e===s&&("week"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(oo)),e===s&&("year"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(so)))))))))))))))))))))))))))))))))))),e!==s&&(t,e=e),t=e}function ml(){var t,e,n;return t=za,(e=function(){var t;return"both"===r.substr(za,4).toLowerCase()?(t=r.substr(za,4),za+=4):(t=s,0===ti&&ui(ao)),t===s&&("leading"===r.substr(za,7).toLowerCase()?(t=r.substr(za,7),za+=7):(t=s,0===ti&&ui(io)),t===s&&("trailing"===r.substr(za,8).toLowerCase()?(t=r.substr(za,8),za+=8):(t=s,0===ti&&ui(co)))),t}())===s&&(e=null),e!==s&&Eb()!==s?((n=gl())===s&&(n=null),n!==s&&Eb()!==s&&Jl()!==s?(t,t=e=function(r,t,e){let n=[];return r&&n.push({type:"origin",value:r}),t&&n.push(t),n.push({type:"origin",value:"from"}),{type:"expr_list",value:n}}(e,n)):(za=t,t=s)):(za=t,t=s),t}function El(){var t,e,n,o,u,a,i,c;return(t=function(){var t,e,n,o,u,a,i,c;return t=za,(e=Sf())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Cl())!==s&&Eb()!==s&&Jl()!==s&&Eb()!==s?((o=Kf())===s&&(o=Zf())===s&&(o=Xf())===s&&(o=Bf()),o!==s&&Eb()!==s&&(u=Uc())!==s&&Eb()!==s&&Lb()!==s?(t,a=n,i=o,c=u,t=e={type:e.toLowerCase(),args:{field:a,cast_type:i,source:c}}):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=Sf())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Cl())!==s&&Eb()!==s&&Jl()!==s&&Eb()!==s&&(o=Uc())!==s&&Eb()!==s&&(u=Lb())!==s?(t,t=e=function(r,t,e){return{type:r.toLowerCase(),args:{field:t,source:e}}}(e,n,o)):(za=t,t=s),t===s&&(t=za,"date_trunc"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(uo)),e!==s&&Eb()!==s&&hb()!==s&&Eb()!==s&&(n=Uc())!==s&&Eb()!==s&&yb()!==s&&Eb()!==s&&(o=Cl())!==s&&Eb()!==s&&(u=Lb())!==s?(t,t=e=function(r,t){return{type:"function",name:"DATE_TRUNC",args:{type:"expr_list",value:[r,{type:"origin",value:t}]},over:null}}(n,o)):(za=t,t=s))),t}())===s&&(t=function(){var t,e,n,o;return t=za,"trim"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(lo)),e!==s&&Eb()!==s&&hb()!==s&&Eb()!==s?((n=ml())===s&&(n=null),n!==s&&Eb()!==s&&(o=Uc())!==s&&Eb()!==s&&Lb()!==s?(t,t=e=function(r,t){let e=r||{type:"expr_list",value:[]};return e.value.push(t),{type:"function",name:"TRIM",args:e}}(n,o)):(za=t,t=s)):(za=t,t=s),t}())===s&&(t=za,"convert"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(fo)),e!==s&&Eb()!==s&&(n=hb())!==s&&Eb()!==s&&(o=function(){var r,t,e,n,o,u;return r=za,(t=kb())!==s&&Eb()!==s&&yb()!==s&&Eb()!==s&&(e=Hb())!==s&&Eb()!==s&&(n=Mi())!==s&&Eb()!==s&&(o=ul())!==s?(r,r=t=function(r,t,e,n){const{dataType:o,length:s}=t;let u=o;return void 0!==s&&(u=`${u}(${s})`),{type:"expr_list",value:[r,{type:"origin",value:`${u} ${e} ${n}`}]}}(t,e,n,o)):(za=r,r=s),r===s&&(r=za,(t=kb())!==s&&Eb()!==s&&yb()!==s&&Eb()!==s&&(e=Fb())!==s?(r,u=e,r=t={type:"expr_list",value:[t,{type:"datatype",...u}]}):(za=r,r=s),r===s&&(r=za,(t=Dc())!==s&&Eb()!==s&&bf()!==s&&Eb()!==s&&(e=ul())!==s?(r,r=t=function(r,t){return r.suffix="USING "+t.toUpperCase(),{type:"expr_list",value:[r]}}(t,e)):(za=r,r=s))),r}())!==s&&(u=Eb())!==s&&Lb()!==s&&Eb()!==s?((a=Ai())===s&&(a=null),a!==s?(t,t=e={type:"function",name:"CONVERT",args:o,collate:a}):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=function(){var t;(t=Al())===s&&(t=rb())===s&&(t=zf())===s&&(t=function(){var t,e,n,o;t=za,"session_user"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(Ku));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SESSION_USER"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"system_user"===r.substr(za,11).toLowerCase()?(e=r.substr(za,11),za+=11):(e=s,0===ti&&ui(Qu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SYSTEM_USER"):(za=t,t=s)):(za=t,t=s);return t}());return t}())!==s&&Eb()!==s&&(n=hb())!==s&&Eb()!==s?((o=Nc())===s&&(o=null),o!==s&&(u=Eb())!==s&&Lb()!==s&&Eb()!==s?((a=bl())===s&&(a=null),a!==s?(t,t=e=function(r,t,e){return{type:"function",name:r,args:t||{type:"expr_list",value:[]},over:e}}(e,o,a)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=Al())!==s&&Eb()!==s?((n=fl())===s&&(n=null),n!==s?(t,t=e={type:"function",name:e,over:n}):(za=t,t=s)):(za=t,t=s),t===s&&(t=za,(e=Ub())!==s?(za,("convert"!==(c=e).toLowerCase()&&!Bb[c.toLowerCase()]?void 0:s)!==s&&(n=Eb())!==s&&hb()!==s&&(o=Eb())!==s?((u=Dc())===s&&(u=null),u!==s&&Eb()!==s&&Lb()!==s&&(a=Eb())!==s?((i=bl())===s&&(i=null),i!==s?(t,t=e=function(r,t,e){return t&&"expr_list"!==t.type&&(t={type:"expr_list",value:[t]}),("TIMESTAMPDIFF"===r.toUpperCase()||"TIMESTAMPADD"===r.toUpperCase())&&t.value&&t.value[0]&&(t.value[0]={type:"origin",value:t.value[0].column}),{type:"function",name:r,args:t||{type:"expr_list",value:[]},over:e}}(e,u,i)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s)):(za=t,t=s))))),t}function Al(){var t;return(t=function(){var t,e,n,o;t=za,"current_date"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(Wu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="CURRENT_DATE"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=function(){var t,e,n,o;t=za,"current_time"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(qu));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="CURRENT_TIME"):(za=t,t=s)):(za=t,t=s);return t}())===s&&(t=Jf()),t}function _l(){var t,e,n,o,u,a,i,c,l;return t=za,"binary"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(bo)),e===s&&("_binary"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(po))),e===s&&(e=null),e!==s&&Eb()!==s&&(n=gl())!==s?(o=za,(u=Eb())!==s&&(a=Ai())!==s?o=u=[u,a]:(za=o,o=s),o===s&&(o=null),o!==s?(t,c=n,l=o,(i=e)&&(c.prefix=i.toLowerCase()),l&&(c.suffix={collate:l[1]}),t=e=c):(za=t,t=s)):(za=t,t=s),t===s&&(t=Rl())===s&&(t=function(){var t,e;t=za,(e=function(){var t,e,n,o;t=za,"true"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Zo));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e={type:"bool",value:!0});(t=e)===s&&(t=za,(e=function(){var t,e,n,o;t=za,"false"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(rs));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e={type:"bool",value:!1}),t=e);return t}())===s&&(t=Tl())===s&&(t=function(){var t,e,n,o,u,a;t=za,(e=Xf())===s&&(e=Bf())===s&&(e=Kf())===s&&(e=qf());if(e!==s)if(Eb()!==s){if(n=za,39===r.charCodeAt(za)?(o="'",za++):(o=s,0===ti&&ui(ht)),o!==s){for(u=[],a=Il();a!==s;)u.push(a),a=Il();u!==s?(39===r.charCodeAt(za)?(a="'",za++):(a=s,0===ti&&ui(ht)),a!==s?n=o=[o,u,a]:(za=n,n=s)):(za=n,n=s)}else za=n,n=s;n!==s?(t,e=Eo(e,n),t=e):(za=t,t=s)}else za=t,t=s;else za=t,t=s;if(t===s)if(t=za,(e=Xf())===s&&(e=Bf())===s&&(e=Kf())===s&&(e=qf()),e!==s)if(Eb()!==s){if(n=za,34===r.charCodeAt(za)?(o='"',za++):(o=s,0===ti&&ui(tn)),o!==s){for(u=[],a=Sl();a!==s;)u.push(a),a=Sl();u!==s?(34===r.charCodeAt(za)?(a='"',za++):(a=s,0===ti&&ui(tn)),a!==s?n=o=[o,u,a]:(za=n,n=s)):(za=n,n=s)}else za=n,n=s;n!==s?(t,e=Eo(e,n),t=e):(za=t,t=s)}else za=t,t=s;else za=t,t=s;return t}()),t}function Tl(){var t,e;return t=za,(e=function(){var t,e,n,o;t=za,"null"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Qo));e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s);return t}())!==s&&(t,e={type:"null",value:null}),t=e}function gl(){var t,e,n,o,u,a,i,c;if(t=za,"_binary"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(po)),e===s&&("_latin1"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(vo))),e===s&&(e=null),e!==s)if((n=Eb())!==s)if("x"===r.substr(za,1).toLowerCase()?(o=r.charAt(za),za++):(o=s,0===ti&&ui(yo)),o!==s){if(u=za,39===r.charCodeAt(za)?(a="'",za++):(a=s,0===ti&&ui(ht)),a!==s){for(i=[],wo.test(r.charAt(za))?(c=r.charAt(za),za++):(c=s,0===ti&&ui(ho));c!==s;)i.push(c),wo.test(r.charAt(za))?(c=r.charAt(za),za++):(c=s,0===ti&&ui(ho));i!==s?(39===r.charCodeAt(za)?(c="'",za++):(c=s,0===ti&&ui(ht)),c!==s?u=a=[a,i,c]:(za=u,u=s)):(za=u,u=s)}else za=u,u=s;u!==s?(t,t=e={type:"hex_string",prefix:e,value:u[1].join("")}):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;if(t===s){if(t=za,"_binary"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(po)),e===s&&("_latin1"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(vo))),e===s&&(e=null),e!==s)if((n=Eb())!==s)if("b"===r.substr(za,1).toLowerCase()?(o=r.charAt(za),za++):(o=s,0===ti&&ui(Lo)),o!==s){if(u=za,39===r.charCodeAt(za)?(a="'",za++):(a=s,0===ti&&ui(ht)),a!==s){for(i=[],wo.test(r.charAt(za))?(c=r.charAt(za),za++):(c=s,0===ti&&ui(ho));c!==s;)i.push(c),wo.test(r.charAt(za))?(c=r.charAt(za),za++):(c=s,0===ti&&ui(ho));i!==s?(39===r.charCodeAt(za)?(c="'",za++):(c=s,0===ti&&ui(ht)),c!==s?u=a=[a,i,c]:(za=u,u=s)):(za=u,u=s)}else za=u,u=s;u!==s?(t,t=e=function(r,t,e){return{type:"bit_string",prefix:r,value:e[1].join("")}}(e,0,u)):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;if(t===s){if(t=za,"_binary"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(po)),e===s&&("_latin1"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(vo))),e===s&&(e=null),e!==s)if((n=Eb())!==s)if("0x"===r.substr(za,2).toLowerCase()?(o=r.substr(za,2),za+=2):(o=s,0===ti&&ui(Co)),o!==s){for(u=[],wo.test(r.charAt(za))?(a=r.charAt(za),za++):(a=s,0===ti&&ui(ho));a!==s;)u.push(a),wo.test(r.charAt(za))?(a=r.charAt(za),za++):(a=s,0===ti&&ui(ho));u!==s?(t,t=e=function(r,t,e){return{type:"full_hex_string",prefix:r,value:e.join("")}}(e,0,u)):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;if(t===s){if(t=za,"n"===r.substr(za,1).toLowerCase()?(e=r.charAt(za),za++):(e=s,0===ti&&ui(mo)),e!==s){if(n=za,39===r.charCodeAt(za)?(o="'",za++):(o=s,0===ti&&ui(ht)),o!==s){for(u=[],a=Il();a!==s;)u.push(a),a=Il();u!==s?(39===r.charCodeAt(za)?(a="'",za++):(a=s,0===ti&&ui(ht)),a!==s?n=o=[o,u,a]:(za=n,n=s)):(za=n,n=s)}else za=n,n=s;n!==s?(t,t=e=function(r,t){return{type:"natural_string",value:t[1].join("")}}(0,n)):(za=t,t=s)}else za=t,t=s;if(t===s){if(t=za,e=za,39===r.charCodeAt(za)?(n="'",za++):(n=s,0===ti&&ui(ht)),n!==s){for(o=[],u=Il();u!==s;)o.push(u),u=Il();o!==s?(39===r.charCodeAt(za)?(u="'",za++):(u=s,0===ti&&ui(ht)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s)}else za=e,e=s;if(e!==s&&(t,e=function(r){return{type:"single_quote_string",value:r[1].join("")}}(e)),(t=e)===s){if(t=za,e=za,34===r.charCodeAt(za)?(n='"',za++):(n=s,0===ti&&ui(tn)),n!==s){for(o=[],u=Sl();u!==s;)o.push(u),u=Sl();o!==s?(34===r.charCodeAt(za)?(u='"',za++):(u=s,0===ti&&ui(tn)),u!==s?e=n=[n,o,u]:(za=e,e=s)):(za=e,e=s)}else za=e,e=s;e!==s&&(t,e=function(r){return{type:"double_quote_string",value:r[1].join("")}}(e)),t=e}}}}}return t}function Sl(){var t;return Ao.test(r.charAt(za))?(t=r.charAt(za),za++):(t=s,0===ti&&ui(_o)),t===s&&(t=Nl()),t}function Il(){var t;return To.test(r.charAt(za))?(t=r.charAt(za),za++):(t=s,0===ti&&ui(go)),t===s&&(t=Nl()),t}function Nl(){var t,e,n,o,u,a,i,c,l,f;return t=za,"\\'"===r.substr(za,2)?(e="\\'",za+=2):(e=s,0===ti&&ui(So)),e!==s&&(t,e="\\'"),(t=e)===s&&(t=za,'\\"'===r.substr(za,2)?(e='\\"',za+=2):(e=s,0===ti&&ui(Io)),e!==s&&(t,e='\\"'),(t=e)===s&&(t=za,"\\\\"===r.substr(za,2)?(e="\\\\",za+=2):(e=s,0===ti&&ui(No)),e!==s&&(t,e="\\\\"),(t=e)===s&&(t=za,"\\/"===r.substr(za,2)?(e="\\/",za+=2):(e=s,0===ti&&ui(Ro)),e!==s&&(t,e="\\/"),(t=e)===s&&(t=za,"\\b"===r.substr(za,2)?(e="\\b",za+=2):(e=s,0===ti&&ui(Oo)),e!==s&&(t,e="\b"),(t=e)===s&&(t=za,"\\f"===r.substr(za,2)?(e="\\f",za+=2):(e=s,0===ti&&ui(jo)),e!==s&&(t,e="\f"),(t=e)===s&&(t=za,"\\n"===r.substr(za,2)?(e="\\n",za+=2):(e=s,0===ti&&ui(xo)),e!==s&&(t,e="\n"),(t=e)===s&&(t=za,"\\r"===r.substr(za,2)?(e="\\r",za+=2):(e=s,0===ti&&ui(ko)),e!==s&&(t,e="\r"),(t=e)===s&&(t=za,"\\t"===r.substr(za,2)?(e="\\t",za+=2):(e=s,0===ti&&ui(Uo)),e!==s&&(t,e="\t"),(t=e)===s&&(t=za,"\\u"===r.substr(za,2)?(e="\\u",za+=2):(e=s,0===ti&&ui(Mo)),e!==s&&(n=Ml())!==s&&(o=Ml())!==s&&(u=Ml())!==s&&(a=Ml())!==s?(t,i=n,c=o,l=u,f=a,t=e=String.fromCharCode(parseInt("0x"+i+c+l+f))):(za=t,t=s),t===s&&(t=za,92===r.charCodeAt(za)?(e="\\",za++):(e=s,0===ti&&ui(Do)),e!==s&&(t,e="\\"),(t=e)===s&&(t=za,"''"===r.substr(za,2)?(e="''",za+=2):(e=s,0===ti&&ui(Po)),e!==s&&(t,e="''"),(t=e)===s&&(t=za,'""'===r.substr(za,2)?(e='""',za+=2):(e=s,0===ti&&ui($o)),e!==s&&(t,e='""'),(t=e)===s&&(t=za,"``"===r.substr(za,2)?(e="``",za+=2):(e=s,0===ti&&ui(Go)),e!==s&&(t,e="``"),t=e))))))))))))),t}function Rl(){var r,t,e;return r=za,(t=function(){var r,t,e,n;r=za,(t=Ol())!==s&&(e=jl())!==s&&(n=xl())!==s?(r,r=t={type:"bigint",value:t+e+n}):(za=r,r=s);r===s&&(r=za,(t=Ol())!==s&&(e=jl())!==s?(r,t=function(r,t){const e=r+t;return Xb(r)?{type:"bigint",value:e}:parseFloat(e)}(t,e),r=t):(za=r,r=s),r===s&&(r=za,(t=Ol())!==s&&(e=xl())!==s?(r,t=function(r,t){return{type:"bigint",value:r+t}}(t,e),r=t):(za=r,r=s),r===s&&(r=za,(t=Ol())!==s&&(r,t=function(r){return Xb(r)?{type:"bigint",value:r}:parseFloat(r)}(t)),r=t)));return r}())!==s&&(r,t=(e=t)&&"bigint"===e.type?e:{type:"number",value:e}),r=t}function Ol(){var t,e,n;return(t=kl())===s&&(t=Ul())===s&&(t=za,45===r.charCodeAt(za)?(e="-",za++):(e=s,0===ti&&ui(Fe)),e===s&&(43===r.charCodeAt(za)?(e="+",za++):(e=s,0===ti&&ui(Ge))),e!==s&&(n=kl())!==s?(t,t=e=e+n):(za=t,t=s),t===s&&(t=za,45===r.charCodeAt(za)?(e="-",za++):(e=s,0===ti&&ui(Fe)),e===s&&(43===r.charCodeAt(za)?(e="+",za++):(e=s,0===ti&&ui(Ge))),e!==s&&(n=Ul())!==s?(t,t=e=function(r,t){return r+t}(e,n)):(za=t,t=s))),t}function jl(){var t,e,n,o;return t=za,46===r.charCodeAt(za)?(e=".",za++):(e=s,0===ti&&ui(Yo)),e!==s?((n=kl())===s&&(n=null),n!==s?(t,t=e=(o=n)?"."+o:""):(za=t,t=s)):(za=t,t=s),t}function xl(){var t,e,n;return t=za,(e=function(){var t,e,n;t=za,qo.test(r.charAt(za))?(e=r.charAt(za),za++):(e=s,0===ti&&ui(Vo));e!==s?(Xo.test(r.charAt(za))?(n=r.charAt(za),za++):(n=s,0===ti&&ui(Ko)),n===s&&(n=null),n!==s?(t,t=e=e+(null!==(o=n)?o:"")):(za=t,t=s)):(za=t,t=s);var o;return t}())!==s&&(n=kl())!==s?(t,t=e=e+n):(za=t,t=s),t}function kl(){var r,t,e;if(r=za,t=[],(e=Ul())!==s)for(;e!==s;)t.push(e),e=Ul();else t=s;return t!==s&&(r,t=t.join("")),r=t}function Ul(){var t;return $r.test(r.charAt(za))?(t=r.charAt(za),za++):(t=s,0===ti&&ui(Gr)),t}function Ml(){var t;return Wo.test(r.charAt(za))?(t=r.charAt(za),za++):(t=s,0===ti&&ui(Bo)),t}function Dl(){var t,e,n,o;return t=za,"default"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(k)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Pl(){var t,e,n,o;return t=za,"to"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(Jo)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function $l(){var t,e,n,o;return t=za,"show"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(ts)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Gl(){var t,e,n,o;return t=za,"drop"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(es)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DROP"):(za=t,t=s)):(za=t,t=s),t}function Fl(){var t,e,n,o;return t=za,"alter"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(os)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Hl(){var t,e,n,o;return t=za,"select"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(ss)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Yl(){var t,e,n,o;return t=za,"update"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(us)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Wl(){var t,e,n,o;return t=za,"create"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(as)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Bl(){var t,e,n,o;return t=za,"temporary"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(is)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function ql(){var t,e,n,o;return t=za,"delete"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(cs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Vl(){var t,e,n,o;return t=za,"insert"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(ls)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Xl(){var t,e,n,o;return t=za,"replace"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(bs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Kl(){var t,e,n,o;return t=za,"rename"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(ps)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Ql(){var t,e,n,o;return t=za,"ignore"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(vs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function zl(){var t,e,n,o;return t=za,"partition"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(ds)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="PARTITION"):(za=t,t=s)):(za=t,t=s),t}function Zl(){var t,e,n,o;return t=za,"into"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(ys)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Jl(){var t,e,n,o;return t=za,"from"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(ws)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function rf(){var t,e,n,o;return t=za,"set"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(Jr)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SET"):(za=t,t=s)):(za=t,t=s),t}function tf(){var t,e,n,o;return t=za,"as"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(h)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function ef(){var t,e,n,o;return t=za,"table"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(hs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TABLE"):(za=t,t=s)):(za=t,t=s),t}function nf(){var t,e,n,o;return t=za,"trigger"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Ls)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TRIGGER"):(za=t,t=s)):(za=t,t=s),t}function of(){var t,e,n,o;return t=za,"tables"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Cs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TABLES"):(za=t,t=s)):(za=t,t=s),t}function sf(){var t,e,n,o;return t=za,"database"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(ms)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DATABASE"):(za=t,t=s)):(za=t,t=s),t}function uf(){var t,e,n,o;return t=za,"schema"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Es)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SCHEMA"):(za=t,t=s)):(za=t,t=s),t}function af(){var t,e,n,o;return t=za,"on"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(As)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function cf(){var t,e,n,o;return t=za,"join"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Ns)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function lf(){var t,e,n,o;return t=za,"outer"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Rs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function ff(){var t,e,n,o;return t=za,"values"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(ks)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function bf(){var t,e,n,o;return t=za,"using"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Us)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function pf(){var t,e,n,o;return t=za,"with"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(v)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function vf(){var t,e,n,o;return t=za,"by"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(d)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function df(){var t,e,n,o;return t=za,"asc"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(Hs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="ASC"):(za=t,t=s)):(za=t,t=s),t}function yf(){var t,e,n,o;return t=za,"desc"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Ys)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DESC"):(za=t,t=s)):(za=t,t=s),t}function wf(){var t,e,n,o;return t=za,"all"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(Bs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="ALL"):(za=t,t=s)):(za=t,t=s),t}function hf(){var t,e,n,o;return t=za,"distinct"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(qs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DISTINCT"):(za=t,t=s)):(za=t,t=s),t}function Lf(){var t,e,n,o;return t=za,"between"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Vs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="BETWEEN"):(za=t,t=s)):(za=t,t=s),t}function Cf(){var t,e,n,o;return t=za,"in"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(oe)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="IN"):(za=t,t=s)):(za=t,t=s),t}function mf(){var t,e,n,o;return t=za,"is"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(Xs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="IS"):(za=t,t=s)):(za=t,t=s),t}function Ef(){var t,e,n,o;return t=za,"like"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Ks)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="LIKE"):(za=t,t=s)):(za=t,t=s),t}function Af(){var t,e,n,o;return t=za,"exists"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Zs)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="EXISTS"):(za=t,t=s)):(za=t,t=s),t}function _f(){var t,e,n,o;return t=za,"not"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(Js)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="NOT"):(za=t,t=s)):(za=t,t=s),t}function Tf(){var t,e,n,o;return t=za,"and"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(ru)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="AND"):(za=t,t=s)):(za=t,t=s),t}function gf(){var t,e,n,o;return t=za,"or"===r.substr(za,2).toLowerCase()?(e=r.substr(za,2),za+=2):(e=s,0===ti&&ui(tu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="OR"):(za=t,t=s)):(za=t,t=s),t}function Sf(){var t,e,n,o;return t=za,"extract"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(iu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="EXTRACT"):(za=t,t=s)):(za=t,t=s),t}function If(){var t,e,n,o;return t=za,"case"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(lu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Nf(){var t,e,n,o;return t=za,"end"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(vu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?t=e=[e,n]:(za=t,t=s)):(za=t,t=s),t}function Rf(){var t,e,n,o;return t=za,"cast"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(du)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="CAST"):(za=t,t=s)):(za=t,t=s),t}function Of(){var t,e,n,o;return t=za,"binary"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(St)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="BINARY"):(za=t,t=s)):(za=t,t=s),t}function jf(){var t,e,n,o;return t=za,"char"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(hu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="CHAR"):(za=t,t=s)):(za=t,t=s),t}function xf(){var t,e,n,o;return t=za,"varchar"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Lu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="VARCHAR"):(za=t,t=s)):(za=t,t=s),t}function kf(){var t,e,n,o;return t=za,"numeric"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Cu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="NUMERIC"):(za=t,t=s)):(za=t,t=s),t}function Uf(){var t,e,n,o;return t=za,"decimal"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(mu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DECIMAL"):(za=t,t=s)):(za=t,t=s),t}function Mf(){var t,e,n,o;return t=za,"unsigned"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Au)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="UNSIGNED"):(za=t,t=s)):(za=t,t=s),t}function Df(){var t,e,n,o;return t=za,"int"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(_u)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="INT"):(za=t,t=s)):(za=t,t=s),t}function Pf(){var t,e,n,o;return t=za,"integer"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(gu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="INTEGER"):(za=t,t=s)):(za=t,t=s),t}function $f(){var t,e,n,o;return t=za,"smallint"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Iu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SMALLINT"):(za=t,t=s)):(za=t,t=s),t}function Gf(){var t,e,n,o;return t=za,"mediumint"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(Nu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MEDIUMINT"):(za=t,t=s)):(za=t,t=s),t}function Ff(){var t,e,n,o;return t=za,"tinyint"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Ru)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TINYINT"):(za=t,t=s)):(za=t,t=s),t}function Hf(){var t,e,n,o;return t=za,"bigint"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Uu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="BIGINT"):(za=t,t=s)):(za=t,t=s),t}function Yf(){var t,e,n,o;return t=za,"float"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(Du)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="FLOAT"):(za=t,t=s)):(za=t,t=s),t}function Wf(){var t,e,n,o;return t=za,"double"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(Pu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DOUBLE"):(za=t,t=s)):(za=t,t=s),t}function Bf(){var t,e,n,o;return t=za,"date"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Gn)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DATE"):(za=t,t=s)):(za=t,t=s),t}function qf(){var t,e,n,o;return t=za,"datetime"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui($u)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="DATETIME"):(za=t,t=s)):(za=t,t=s),t}function Vf(){var t,e,n,o;return t=za,"rows"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Gu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="ROWS"):(za=t,t=s)):(za=t,t=s),t}function Xf(){var t,e,n,o;return t=za,"time"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(eo)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TIME"):(za=t,t=s)):(za=t,t=s),t}function Kf(){var t,e,n,o;return t=za,"timestamp"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(Fu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TIMESTAMP"):(za=t,t=s)):(za=t,t=s),t}function Qf(){var t,e,n,o;return t=za,"year"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(so)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="YEAR"):(za=t,t=s)):(za=t,t=s),t}function zf(){var t,e,n,o;return t=za,"user"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Yu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="USER"):(za=t,t=s)):(za=t,t=s),t}function Zf(){var t,e,n,o;return t=za,"interval"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Bu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="INTERVAL"):(za=t,t=s)):(za=t,t=s),t}function Jf(){var t,e,n,o;return t=za,"current_timestamp"===r.substr(za,17).toLowerCase()?(e=r.substr(za,17),za+=17):(e=s,0===ti&&ui(Vu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="CURRENT_TIMESTAMP"):(za=t,t=s)):(za=t,t=s),t}function rb(){var t,e,n,o;return t=za,"current_user"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(Xu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="CURRENT_USER"):(za=t,t=s)):(za=t,t=s),t}function tb(){var t,e,n,o;return t=za,"view"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Vt)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="VIEW"):(za=t,t=s)):(za=t,t=s),t}function eb(){var t;return 64===r.charCodeAt(za)?(t="@",za++):(t=s,0===ti&&ui(lr)),t}function nb(){var t;return(t=function(){var t;return"@@"===r.substr(za,2)?(t="@@",za+=2):(t=s,0===ti&&ui(ca)),t}())===s&&(t=eb())===s&&(t=function(){var t;return 36===r.charCodeAt(za)?(t="$",za++):(t=s,0===ti&&ui(la)),t}()),t}function ob(){var t;return":="===r.substr(za,2)?(t=":=",za+=2):(t=s,0===ti&&ui(ba)),t}function sb(){var t;return 61===r.charCodeAt(za)?(t="=",za++):(t=s,0===ti&&ui(Ne)),t}function ub(){var t,e,n,o;return t=za,"add"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(va)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="ADD"):(za=t,t=s)):(za=t,t=s),t}function ab(){var t,e,n,o;return t=za,"column"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(da)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="COLUMN"):(za=t,t=s)):(za=t,t=s),t}function ib(){var t,e,n,o;return t=za,"index"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(dt)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="INDEX"):(za=t,t=s)):(za=t,t=s),t}function cb(){var t,e,n,o;return t=za,"key"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(ir)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="KEY"):(za=t,t=s)):(za=t,t=s),t}function lb(){var t,e,n,o;return t=za,"fulltext"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(wa)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="FULLTEXT"):(za=t,t=s)):(za=t,t=s),t}function fb(){var t,e,n,o;return t=za,"spatial"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(ha)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="SPATIAL"):(za=t,t=s)):(za=t,t=s),t}function bb(){var t,e,n,o;return t=za,"unique"===r.substr(za,6).toLowerCase()?(e=r.substr(za,6),za+=6):(e=s,0===ti&&ui(ar)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="UNIQUE"):(za=t,t=s)):(za=t,t=s),t}function pb(){var t,e,n,o;return t=za,"comment"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(La)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="COMMENT"):(za=t,t=s)):(za=t,t=s),t}function vb(){var t,e,n,o;return t=za,"references"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(ma)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="REFERENCES"):(za=t,t=s)):(za=t,t=s),t}function db(){var t;return 46===r.charCodeAt(za)?(t=".",za++):(t=s,0===ti&&ui(Yo)),t}function yb(){var t;return 44===r.charCodeAt(za)?(t=",",za++):(t=s,0===ti&&ui(Ia)),t}function wb(){var t;return 42===r.charCodeAt(za)?(t="*",za++):(t=s,0===ti&&ui(He)),t}function hb(){var t;return 40===r.charCodeAt(za)?(t="(",za++):(t=s,0===ti&&ui(ee)),t}function Lb(){var t;return 41===r.charCodeAt(za)?(t=")",za++):(t=s,0===ti&&ui(ne)),t}function Cb(){var t;return 59===r.charCodeAt(za)?(t=";",za++):(t=s,0===ti&&ui(Oa)),t}function mb(){var t;return(t=function(){var t;return"||"===r.substr(za,2)?(t="||",za+=2):(t=s,0===ti&&ui(Be)),t}())===s&&(t=function(){var t;return"&&"===r.substr(za,2)?(t="&&",za+=2):(t=s,0===ti&&ui(ja)),t}())===s&&(t=function(){var t,e,n,o;return t=za,"xor"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(xa)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="XOR"):(za=t,t=s)):(za=t,t=s),t}()),t}function Eb(){var r,t;for(r=[],(t=Sb())===s&&(t=_b());t!==s;)r.push(t),(t=Sb())===s&&(t=_b());return r}function Ab(){var r,t;if(r=[],(t=Sb())===s&&(t=_b()),t!==s)for(;t!==s;)r.push(t),(t=Sb())===s&&(t=_b());else r=s;return r}function _b(){var t;return(t=function(){var t,e,n,o,u,a;t=za,"/*"===r.substr(za,2)?(e="/*",za+=2):(e=s,0===ti&&ui(ka));if(e!==s){for(n=[],o=za,u=za,ti++,"*/"===r.substr(za,2)?(a="*/",za+=2):(a=s,0===ti&&ui(Ua)),ti--,a===s?u=void 0:(za=u,u=s),u!==s&&(a=gb())!==s?o=u=[u,a]:(za=o,o=s);o!==s;)n.push(o),o=za,u=za,ti++,"*/"===r.substr(za,2)?(a="*/",za+=2):(a=s,0===ti&&ui(Ua)),ti--,a===s?u=void 0:(za=u,u=s),u!==s&&(a=gb())!==s?o=u=[u,a]:(za=o,o=s);n!==s?("*/"===r.substr(za,2)?(o="*/",za+=2):(o=s,0===ti&&ui(Ua)),o!==s?t=e=[e,n,o]:(za=t,t=s)):(za=t,t=s)}else za=t,t=s;return t}())===s&&(t=function(){var t,e,n,o,u,a;t=za,"--"===r.substr(za,2)?(e="--",za+=2):(e=s,0===ti&&ui(Ma));if(e!==s){for(n=[],o=za,u=za,ti++,a=Ib(),ti--,a===s?u=void 0:(za=u,u=s),u!==s&&(a=gb())!==s?o=u=[u,a]:(za=o,o=s);o!==s;)n.push(o),o=za,u=za,ti++,a=Ib(),ti--,a===s?u=void 0:(za=u,u=s),u!==s&&(a=gb())!==s?o=u=[u,a]:(za=o,o=s);n!==s?t=e=[e,n]:(za=t,t=s)}else za=t,t=s;return t}())===s&&(t=function(){var t,e,n,o,u,a;t=za,35===r.charCodeAt(za)?(e="#",za++):(e=s,0===ti&&ui(Da));if(e!==s){for(n=[],o=za,u=za,ti++,a=Ib(),ti--,a===s?u=void 0:(za=u,u=s),u!==s&&(a=gb())!==s?o=u=[u,a]:(za=o,o=s);o!==s;)n.push(o),o=za,u=za,ti++,a=Ib(),ti--,a===s?u=void 0:(za=u,u=s),u!==s&&(a=gb())!==s?o=u=[u,a]:(za=o,o=s);n!==s?t=e=[e,n]:(za=t,t=s)}else za=t,t=s;return t}()),t}function Tb(){var r,t,e,n,o,u,a;return r=za,(t=pb())!==s&&Eb()!==s?((e=sb())===s&&(e=null),e!==s&&Eb()!==s&&(n=gl())!==s?(r,u=e,a=n,r=t={type:(o=t).toLowerCase(),keyword:o.toLowerCase(),symbol:u,value:a}):(za=r,r=s)):(za=r,r=s),r}function gb(){var t;return r.length>za?(t=r.charAt(za),za++):(t=s,0===ti&&ui(Pa)),t}function Sb(){var t;return $a.test(r.charAt(za))?(t=r.charAt(za),za++):(t=s,0===ti&&ui(Ga)),t}function Ib(){var t,e;if((t=function(){var t,e;t=za,ti++,r.length>za?(e=r.charAt(za),za++):(e=s,0===ti&&ui(Pa));ti--,e===s?t=void 0:(za=t,t=s);return t}())===s)if(t=[],Fo.test(r.charAt(za))?(e=r.charAt(za),za++):(e=s,0===ti&&ui(Ho)),e!==s)for(;e!==s;)t.push(e),Fo.test(r.charAt(za))?(e=r.charAt(za),za++):(e=s,0===ti&&ui(Ho));else t=s;return t}function Nb(){var t,e;return t=za,za,Jb=[],(!0?void 0:s)!==s&&Eb()!==s?((e=Rb())===s&&(e=function(){var t,e;t=za,function(){var t;return"return"===r.substr(za,6).toLowerCase()?(t=r.substr(za,6),za+=6):(t=s,0===ti&&ui(fa)),t}()!==s&&Eb()!==s&&(e=Ob())!==s?(t,t={type:"return",expr:e}):(za=t,t=s);return t}()),e!==s?(t,t={stmt:e,vars:Jb}):(za=t,t=s)):(za=t,t=s),t}function Rb(){var r,t,e,n;return r=za,(t=$b())===s&&(t=Gb()),t!==s&&Eb()!==s?((e=ob())===s&&(e=sb()),e!==s&&Eb()!==s&&(n=Ob())!==s?(r,r=t=Fa(t,e,n)):(za=r,r=s)):(za=r,r=s),r}function Ob(){var t;return(t=Bi())===s&&(t=function(){var r,t,e,n,o;r=za,(t=$b())!==s&&Eb()!==s&&(e=fc())!==s&&Eb()!==s&&(n=$b())!==s&&Eb()!==s&&(o=pc())!==s?(r,r=t={type:"join",ltable:t,rtable:n,op:e,on:o}):(za=r,r=s);return r}())===s&&(t=jb())===s&&(t=function(){var t,e;t=za,function(){var t;return 91===r.charCodeAt(za)?(t="[",za++):(t=s,0===ti&&ui(Na)),t}()!==s&&Eb()!==s&&(e=Pb())!==s&&Eb()!==s&&function(){var t;return 93===r.charCodeAt(za)?(t="]",za++):(t=s,0===ti&&ui(Ra)),t}()!==s?(t,t={type:"array",value:e}):(za=t,t=s);return t}()),t}function jb(){var r,t,e,n,o,u,a,i;if(r=za,(t=xb())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=Vc())!==s&&(a=Eb())!==s&&(i=xb())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=Vc())!==s&&(a=Eb())!==s&&(i=xb())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=Oe(t,e)):(za=r,r=s)}else za=r,r=s;return r}function xb(){var r,t,e,n,o,u,a,i;if(r=za,(t=kb())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=Kc())!==s&&(a=Eb())!==s&&(i=kb())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=Kc())!==s&&(a=Eb())!==s&&(i=kb())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=Oe(t,e)):(za=r,r=s)}else za=r,r=s;return r}function kb(){var r,t,e;return(r=Mb())===s&&(r=_l())===s&&(r=$b())===s&&(r=Zc())===s&&(r=Db())===s&&(r=ll())===s&&(r=za,hb()!==s&&Eb()!==s&&(t=jb())!==s&&Eb()!==s&&Lb()!==s?(r,(e=t).parentheses=!0,r=e):(za=r,r=s)),r}function Ub(){var r,t,e,n,o,u,a;return r=za,(t=ul())===s&&(t=tl()),t!==s?(e=za,(n=Eb())!==s&&(o=db())!==s&&(u=Eb())!==s?((a=ul())===s&&(a=tl()),a!==s?e=n=[n,o,u,a]:(za=e,e=s)):(za=e,e=s),e===s&&(e=null),e!==s?(r,r=t=function(r,t){let e=r;return null!==t&&(e=`${r}.${t[3]}`),e}(t,e)):(za=r,r=s)):(za=r,r=s),r}function Mb(){var r,t,e;return r=za,(t=Ub())!==s&&Eb()!==s&&hb()!==s&&Eb()!==s?((e=Pb())===s&&(e=null),e!==s&&Eb()!==s&&Lb()!==s?(r,r=t={type:"function",name:t,args:{type:"expr_list",value:e}}):(za=r,r=s)):(za=r,r=s),r}function Db(){var r,t;return r=za,(t=Ub())!==s&&(r,t={type:"function",name:t,args:null}),r=t}function Pb(){var r,t,e,n,o,u,a,i;if(r=za,(t=kb())!==s){for(e=[],n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=kb())!==s?n=o=[o,u,a,i]:(za=n,n=s);n!==s;)e.push(n),n=za,(o=Eb())!==s&&(u=yb())!==s&&(a=Eb())!==s&&(i=kb())!==s?n=o=[o,u,a,i]:(za=n,n=s);e!==s?(r,r=t=sr(t,e)):(za=r,r=s)}else za=r,r=s;return r}function $b(){var r,t,e,n,o;return r=za,(t=nb())!==s&&(e=Gb())!==s?(r,n=t,o=e,r=t={type:"var",...o,prefix:n}):(za=r,r=s),r}function Gb(){var t,e,n,o,u;return t=za,(e=ul())!==s&&(n=function(){var t,e,n,o,u;t=za,e=[],n=za,46===r.charCodeAt(za)?(o=".",za++):(o=s,0===ti&&ui(Yo));o!==s&&(u=ul())!==s?n=o=[o,u]:(za=n,n=s);for(;n!==s;)e.push(n),n=za,46===r.charCodeAt(za)?(o=".",za++):(o=s,0===ti&&ui(Yo)),o!==s&&(u=ul())!==s?n=o=[o,u]:(za=n,n=s);e!==s&&(t,e=function(r){const t=[];for(let e=0;e<r.length;e++)t.push(r[e][1]);return t}(e));return t=e}())!==s?(t,o=e,u=n,Jb.push(o),t=e={type:"var",name:o,members:u,prefix:null}):(za=t,t=s),t===s&&(t=za,(e=Rl())!==s&&(t,e={type:"var",name:e.value,members:[],quoted:null,prefix:null}),t=e),t}function Fb(){var t;return(t=Hb())===s&&(t=function(){var t,e,n,o,u,a,i,c,l,f,b,p;t=za,(e=kf())===s&&(e=Uf())===s&&(e=Df())===s&&(e=Pf())===s&&(e=$f())===s&&(e=Gf())===s&&(e=Ff())===s&&(e=Hf())===s&&(e=Yf())===s&&(e=Wf())===s&&(e=function(){var t,e,n,o;return t=za,"bit"===r.substr(za,3).toLowerCase()?(e=r.substr(za,3),za+=3):(e=s,0===ti&&ui(wu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="BIT"):(za=t,t=s)):(za=t,t=s),t}());if(e!==s)if((n=Eb())!==s)if((o=hb())!==s)if((u=Eb())!==s){if(a=[],$r.test(r.charAt(za))?(i=r.charAt(za),za++):(i=s,0===ti&&ui(Gr)),i!==s)for(;i!==s;)a.push(i),$r.test(r.charAt(za))?(i=r.charAt(za),za++):(i=s,0===ti&&ui(Gr));else a=s;if(a!==s)if((i=Eb())!==s){if(c=za,(l=yb())!==s)if((f=Eb())!==s){if(b=[],$r.test(r.charAt(za))?(p=r.charAt(za),za++):(p=s,0===ti&&ui(Gr)),p!==s)for(;p!==s;)b.push(p),$r.test(r.charAt(za))?(p=r.charAt(za),za++):(p=s,0===ti&&ui(Gr));else b=s;b!==s?c=l=[l,f,b]:(za=c,c=s)}else za=c,c=s;else za=c,c=s;c===s&&(c=null),c!==s&&(l=Eb())!==s&&(f=Lb())!==s&&(b=Eb())!==s?((p=Yb())===s&&(p=null),p!==s?(t,v=c,d=p,e={dataType:e,length:parseInt(a.join(""),10),scale:v&&parseInt(v[2].join(""),10),parentheses:!0,suffix:d},t=e):(za=t,t=s)):(za=t,t=s)}else za=t,t=s;else za=t,t=s}else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;var v,d;if(t===s){if(t=za,(e=kf())===s&&(e=Uf())===s&&(e=Df())===s&&(e=Pf())===s&&(e=$f())===s&&(e=Gf())===s&&(e=Ff())===s&&(e=Hf())===s&&(e=Yf())===s&&(e=Wf()),e!==s){if(n=[],$r.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(Gr)),o!==s)for(;o!==s;)n.push(o),$r.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(Gr));else n=s;n!==s&&(o=Eb())!==s?((u=Yb())===s&&(u=null),u!==s?(t,e=function(r,t,e){return{dataType:r,length:parseInt(t.join(""),10),suffix:e}}(e,n,u),t=e):(za=t,t=s)):(za=t,t=s)}else za=t,t=s;t===s&&(t=za,(e=kf())===s&&(e=Uf())===s&&(e=Df())===s&&(e=Pf())===s&&(e=$f())===s&&(e=Gf())===s&&(e=Ff())===s&&(e=Hf())===s&&(e=Yf())===s&&(e=Wf()),e!==s&&(n=Eb())!==s?((o=Yb())===s&&(o=null),o!==s&&(u=Eb())!==s?(t,e=function(r,t){return{dataType:r,suffix:t}}(e,o),t=e):(za=t,t=s)):(za=t,t=s))}return t}())===s&&(t=function(){var t,e,n,o;t=za,(e=Bf())===s&&(e=qf())===s&&(e=Xf())===s&&(e=Kf())===s&&(e=Qf());e!==s&&Eb()!==s&&hb()!==s&&Eb()!==s?(Xa.test(r.charAt(za))?(n=r.charAt(za),za++):(n=s,0===ti&&ui(Ka)),n!==s&&Eb()!==s&&Lb()!==s&&Eb()!==s?((o=Yb())===s&&(o=null),o!==s?(t,e={dataType:e,length:parseInt(n,10),parentheses:!0},t=e):(za=t,t=s)):(za=t,t=s)):(za=t,t=s);t===s&&(t=za,(e=Bf())===s&&(e=qf())===s&&(e=Xf())===s&&(e=Kf())===s&&(e=Qf()),e!==s&&(t,e=Va(e)),t=e);return t}())===s&&(t=function(){var t,e;t=za,(e=function(){var t,e,n,o;return t=za,"json"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Su)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="JSON"):(za=t,t=s)):(za=t,t=s),t}())!==s&&(t,e=Va(e));return t=e}())===s&&(t=function(){var t,e;t=za,(e=function(){var t,e,n,o;return t=za,"tinytext"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Ou)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TINYTEXT"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"text"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(ju)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="TEXT"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"mediumtext"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(xu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MEDIUMTEXT"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"longtext"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(ku)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="LONGTEXT"):(za=t,t=s)):(za=t,t=s),t}());e!==s&&(t,e=Qa(e));return t=e}())===s&&(t=function(){var t,e,n;t=za,(e=function(){var t,e,n,o;return t=za,"enum"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Mu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="ENUM"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=rf());e!==s&&Eb()!==s&&(n=Ic())!==s?(t,o=e,(u=n).parentheses=!0,t=e={dataType:o,expr:u}):(za=t,t=s);var o,u;return t}())===s&&(t=function(){var t,e;t=za,"boolean"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(Ha));e!==s&&(t,e={dataType:"BOOLEAN"});return t=e}())===s&&(t=function(){var t,e,n,o;t=za,(e=Of())===s&&(e=function(){var t,e,n,o;return t=za,"varbinary"===r.substr(za,9).toLowerCase()?(e=r.substr(za,9),za+=9):(e=s,0===ti&&ui(yu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="VARBINARY"):(za=t,t=s)):(za=t,t=s),t}());if(e!==s)if(Eb()!==s)if(hb()!==s)if(Eb()!==s){if(n=[],$r.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(Gr)),o!==s)for(;o!==s;)n.push(o),$r.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(Gr));else n=s;n!==s&&(o=Eb())!==s&&Lb()!==s?(t,e={dataType:e,length:parseInt(n.join(""),10)},t=e):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;t===s&&(t=za,(e=Of())!==s&&(t,e=Va(e)),t=e);return t}())===s&&(t=function(){var t,e;t=za,"blob"===r.substr(za,4).toLowerCase()?(e=r.substr(za,4),za+=4):(e=s,0===ti&&ui(Ya));e===s&&("tinyblob"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Wa)),e===s&&("mediumblob"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(Ba)),e===s&&("longblob"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(qa)))));e!==s&&(t,e={dataType:e.toUpperCase()});return t=e}())===s&&(t=function(){var t,e;t=za,(e=function(){var t,e,n,o;return t=za,"geometry"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(ta)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="GEOMETRY"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"point"===r.substr(za,5).toLowerCase()?(e=r.substr(za,5),za+=5):(e=s,0===ti&&ui(ea)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="POINT"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"linestring"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(na)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="LINESTRING"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"polygon"===r.substr(za,7).toLowerCase()?(e=r.substr(za,7),za+=7):(e=s,0===ti&&ui(oa)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="POLYGON"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"multipoint"===r.substr(za,10).toLowerCase()?(e=r.substr(za,10),za+=10):(e=s,0===ti&&ui(sa)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MULTIPOINT"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"multilinestring"===r.substr(za,15).toLowerCase()?(e=r.substr(za,15),za+=15):(e=s,0===ti&&ui(ua)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MULTILINESTRING"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"multipolygon"===r.substr(za,12).toLowerCase()?(e=r.substr(za,12),za+=12):(e=s,0===ti&&ui(aa)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="MULTIPOLYGON"):(za=t,t=s)):(za=t,t=s),t}())===s&&(e=function(){var t,e,n,o;return t=za,"geometrycollection"===r.substr(za,18).toLowerCase()?(e=r.substr(za,18),za+=18):(e=s,0===ti&&ui(ia)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="GEOMETRYCOLLECTION"):(za=t,t=s)):(za=t,t=s),t}());e!==s&&(t,e=Qa(e));return t=e}()),t}function Hb(){var t,e,n,o;if(t=za,(e=jf())===s&&(e=xf()),e!==s)if(Eb()!==s)if(hb()!==s)if(Eb()!==s){if(n=[],$r.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(Gr)),o!==s)for(;o!==s;)n.push(o),$r.test(r.charAt(za))?(o=r.charAt(za),za++):(o=s,0===ti&&ui(Gr));else n=s;n!==s&&(o=Eb())!==s&&Lb()!==s?(t,t=e={dataType:e,length:parseInt(n.join(""),10),parentheses:!0}):(za=t,t=s)}else za=t,t=s;else za=t,t=s;else za=t,t=s;else za=t,t=s;return t===s&&(t=za,(e=jf())!==s&&(t,e=Va(e)),(t=e)===s&&(t=za,(e=xf())!==s&&(t,e=Va(e)),t=e)),t}function Yb(){var t,e,n;return t=za,(e=Mf())===s&&(e=null),e!==s&&Eb()!==s?((n=function(){var t,e,n,o;return t=za,"zerofill"===r.substr(za,8).toLowerCase()?(e=r.substr(za,8),za+=8):(e=s,0===ti&&ui(Tu)),e!==s?(n=za,ti++,o=al(),ti--,o===s?n=void 0:(za=n,n=s),n!==s?(t,t=e="ZEROFILL"):(za=t,t=s)):(za=t,t=s),t}())===s&&(n=null),n!==s?(t,t=e=function(r,t){const e=[];return r&&e.push(r),t&&e.push(t),e}(e,n)):(za=t,t=s)):(za=t,t=s),t}const Wb={ALTER:!0,ALL:!0,ADD:!0,AND:!0,AS:!0,ASC:!0,BETWEEN:!0,BY:!0,BOOLEAN:!0,CALL:!0,CASCADE:!0,CASE:!0,CREATE:!0,CONTAINS:!0,CROSS:!0,CURRENT_DATE:!0,CURRENT_TIME:!0,CURRENT_TIMESTAMP:!0,CURRENT_USER:!0,DELETE:!0,DESC:!0,DISTINCT:!0,DROP:!0,ELSE:!0,END:!0,EXISTS:!0,EXPLAIN:!0,FALSE:!0,FOR:!0,FROM:!0,FULL:!0,GROUP:!0,HAVING:!0,IN:!0,INNER:!0,INSERT:!0,INTERSECT:!0,INTO:!0,IS:!0,JOIN:!0,JSON:!0,KEY:!0,LEFT:!0,LIKE:!0,LIMIT:!0,LOW_PRIORITY:!0,NATURAL:!0,MINUS:!0,NOT:!0,NULL:!0,ON:!0,OR:!0,ORDER:!0,OUTER:!0,RECURSIVE:!0,RENAME:!0,RIGHT:!0,READ:!0,SELECT:!0,SESSION_USER:!0,SET:!0,SHOW:!0,STATUS:!0,SYSTEM_USER:!0,TABLE:!0,THEN:!0,TRUE:!0,TRUNCATE:!0,UNION:!0,UPDATE:!0,USING:!0,VALUES:!0,WITH:!0,WHEN:!0,WHERE:!0,WRITE:!0,GLOBAL:!0,SESSION:!0,LOCAL:!0,PERSIST:!0,PERSIST_ONLY:!0},Bb={avg:!0,sum:!0,count:!0,max:!0,min:!0,group_concat:!0,std:!0,variance:!0,current_date:!0,current_time:!0,current_timestamp:!0,current_user:!0,user:!0,session_user:!0,system_user:!0};function qb(r,t){return{type:"unary_expr",operator:r,expr:t}}function Vb(r,t,e){return{type:"binary_expr",operator:r,left:t,right:e}}function Xb(r){const t=n(Number.MAX_SAFE_INTEGER);return!(n(r)<t)}function Kb(r,t,e=3){const n=[r];for(let r=0;r<t.length;r++)delete t[r][e].tableList,delete t[r][e].columnList,n.push(t[r][e]);return n}function Qb(r,t){let e=r;for(let r=0;r<t.length;r++)e=Vb(t[r][1],e,t[r][3]);return e}function zb(r){const t=ep[r];return t||(r||null)}function Zb(r){const t=new Set;for(let e of r.keys()){const r=e.split("::");if(!r){t.add(e);break}r&&r[1]&&(r[1]=zb(r[1])),t.add(r.join("::"))}return Array.from(t)}let Jb=[];const rp=new Set,tp=new Set,ep={};if((e=a())!==s&&za===r.length)return e;throw e!==s&&za<r.length&&ui({type:"end"}),ai(ri,Ja<r.length?r.charAt(Ja):null,Ja<r.length?si(Ja,Ja+1):si(Ja,Ja))}}},function(r,t,e){r.exports=e(3)},function(r,t){r.exports=require("big-integer")},function(r,t,e){"use strict";e.r(t),e.d(t,"Parser",(function(){return Ct})),e.d(t,"util",(function(){return n}));var n={};function o(r){return function(r){if(Array.isArray(r))return s(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,t){if(!r)return;if("string"==typeof r)return s(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return s(r,t)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function u(r){if(!r)return[];var t=r.keyword,e=r.type;return[t.toUpperCase(),pr(e)]}function a(r){if(r){var t=r.type,e=r.expr,n=r.symbol,s=t.toUpperCase(),a=[];switch(a.push(s),s){case"KEY_BLOCK_SIZE":n&&a.push(n),a.push(dr(e));break;case"BTREE":case"HASH":a.length=0,a.push.apply(a,o(u(r)));break;case"WITH PARSER":a.push(e);break;case"VISIBLE":case"INVISIBLE":break;case"COMMENT":a.shift(),a.push(Cr(r));break;case"DATA_COMPRESSION":a.push(n,pr(e.value),wr(e.on));break;default:a.push(n,dr(e))}return a.filter(vr).join(" ")}}function i(r){return r?r.map(a):[]}function c(r){var t=r.constraint_type,e=r.index_type,n=r.index_options,s=void 0===n?[]:n,a=r.definition,c=r.on,l=r.with,f=[];if(f.push.apply(f,o(u(e))),a&&a.length){var b="CHECK"===pr(t)?"(".concat(st(a[0]),")"):"(".concat(a.map((function(r){return st(r)})).join(", "),")");f.push(b)}return f.push(i(s).join(" ")),l&&f.push("WITH (".concat(i(l).join(", "),")")),c&&f.push("ON [".concat(c,"]")),f}function l(r){return function(r){if(Array.isArray(r))return f(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,t){if(!r)return;if("string"==typeof r)return f(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return f(r,t)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function b(r){if(r){var t=r.constraint,e=r.constraint_type,n=r.enforced,o=r.index,s=r.keyword,u=r.reference_definition,a=[],i=ar().database;a.push(pr(s)),a.push(fr(t));var f=pr(e);return"sqlite"===i&&"UNIQUE KEY"===f&&(f="UNIQUE"),a.push(f),a.push("sqlite"!==i&&fr(o)),a.push.apply(a,l(c(r))),a.push.apply(a,l(V(u))),a.push(pr(n)),a.filter(vr).join(" ")}}function p(r){if("string"==typeof r)return r;var t=r.window_specification;return"(".concat(function(r){var t=r.name,e=r.partitionby,n=r.orderby,o=r.window_frame_clause;return[t,at(e,"partition by"),at(n,"order by"),pr(o)].filter(vr).join(" ")}(t),")")}function v(r){var t=r.name,e=r.as_window_specification;return"".concat(t," AS ").concat(p(e))}function d(r){var t=r.args,e=r.name,n=r.consider_nulls,o=void 0===n?"":n,s=t?st(t).join(", "):"",u=function(r){switch(pr(r)){case"NTH_VALUE":case"LEAD":case"LAG":return!1;default:return!0}}(e);return[e,"(",s,!u&&")",o&&" ",o,u&&")"].filter(vr).join("")}function y(r){if(r){var t=r.as_window_specification,e=r.expr,n=r.keyword,o=r.type,s=r.parentheses,u=pr(o);if("WINDOW"===u)return"OVER ".concat(p(t));if("ON UPDATE"===u){var a="".concat(pr(o)," ").concat(pr(n)),i=st(e)||[];return s&&(a="".concat(a,"(").concat(i.join(", "),")")),a}throw new Error("unknown over type")}}function w(r){var t=r.arrows,e=void 0===t?[]:t,n=r.collate,o=r.target,s=r.expr,u=r.keyword,a=r.symbol,i=r.as,c=r.properties,l=void 0===c?[]:c,f=o.length,b=o.dataType,p=o.parentheses,v=o.quoted,d=o.scale,y=o.suffix,w="";null!=f&&(w=d?"".concat(f,", ").concat(d):f),p&&(w="(".concat(w,")")),y&&y.length&&(w+=" ".concat(y.join(" ")));var h=st(s),L="::",C="";return"as"===a&&(h="".concat(pr(u),"(").concat(h),C=")",L=" ".concat(a.toUpperCase()," ")),C+=e.map((function(r,t){return er(r,dr,l[t])})).join(" "),i&&(C+=" AS ".concat(fr(i))),n&&(C+=" ".concat(br(n).join(" "))),[h,L,v,b,v,function(r){if(!r||!r.array)return"";switch(r.array){case"one":return"[]";case"two":return"[][]"}}(o),w,C].filter(vr).join("")}function h(r){var t=r.args,e=r.name,n=r.args_parentheses,o=r.parentheses,s=r.over,u=r.collate,a=r.suffix,i=br(u).join(" "),c=y(s),l=st(a);if(!t)return[e,c].filter(vr).join(" ");var f=r.separator||", ";"TRIM"===pr(e)&&(f=" ");var b=[e];return b.push(!1===n?" ":"("),b.push(st(t).join(f)),!1!==n&&b.push(")"),b=[b.join(""),l].filter(vr).join(" "),[o?"(".concat(b,")"):b,i,c].filter(vr).join(" ")}function L(r){var t=r.operator||r.op,e=st(r.right),n=!1;if(Array.isArray(e)){switch(t){case"=":t="IN";break;case"!=":t="NOT IN";break;case"BETWEEN":case"NOT BETWEEN":n=!0,e="".concat(e[0]," AND ").concat(e[1])}n||(e="(".concat(e.join(", "),")"))}var o=r.right.escape||{},s=[st(r.left),t,e,pr(o.type),st(o.value)].filter(vr).join(" ");return r.parentheses?"(".concat(s,")"):s}function C(r){return function(r){if(Array.isArray(r))return m(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,t){if(!r)return;if("string"==typeof r)return m(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return m(r,t)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function E(r){return r?[pr(r.prefix),st(r.value),pr(r.suffix)]:[]}function A(r){return r?r.fetch?(e=(t=r).fetch,n=t.offset,[].concat(C(E(n)),C(E(e))).filter(vr).join(" ")):function(r){var t=r.seperator,e=r.value;return 1===e.length&&"offset"===t?nr("OFFSET",st(e[0])):nr("LIMIT",e.map(st).join("".concat("offset"===t?" ":"").concat(pr(t)," ")))}(r):"";var t,e,n}function _(r){if(r&&0!==r.length){var t=r[0].recursive?"RECURSIVE ":"",e=r.map((function(r){var t=r.name,e=r.stmt,n=r.columns,o=Array.isArray(n)?"(".concat(n.map(B).join(", "),")"):"";return"".concat("default"===t.type?fr(t.value):dr(t)).concat(o," AS (").concat(st(e),")")})).join(", ");return"WITH ".concat(t).concat(e)}}function T(r){if(r&&r.position){var t=r.keyword,e=r.expr,n=[],o=pr(t);switch(o){case"VAR":n.push(e.map(ot).join(", "));break;default:n.push(o,"string"==typeof e?fr(e):st(e))}return n.filter(vr).join(" ")}}function g(r){var t=r.as_struct_val,e=r.columns,n=r.distinct,o=r.for,s=r.from,u=r.for_sys_time_as_of,a=void 0===u?{}:u,i=r.locking_read,c=r.groupby,l=r.having,f=r.into,b=void 0===f?{}:f,p=r.limit,v=r.options,d=r.orderby,y=r.parentheses_symbol,w=r.qualify,h=r.top,L=r.window,C=r.with,m=r.where,E=[_(C),"SELECT",pr(t)];E.push(cr(h)),Array.isArray(v)&&E.push(v.join(" ")),E.push(function(r){if(r){if("string"==typeof r)return r;var t=r.type,e=r.columns,n=[pr(t)];return e&&n.push("(".concat(e.map(B).join(", "),")")),n.filter(vr).join(" ")}}(n),Z(e,s));var g=b.position,S="";g&&(S=er("INTO",T,b)),"column"===g&&E.push(S),E.push(er("FROM",F,s)),"from"===g&&E.push(S);var I=a||{},N=I.keyword,R=I.expr;E.push(er(N,st,R)),E.push(er("WHERE",st,m)),E.push(nr("GROUP BY",ut(c).join(", "))),E.push(er("HAVING",st,l)),E.push(er("QUALIFY",st,w)),E.push(er("WINDOW",st,L)),E.push(at(d,"order by")),E.push(A(p)),E.push(pr(i)),"end"===g&&E.push(S),E.push(function(r){if(r){var t=r.expr,e=r.keyword,n=[pr(r.type),pr(e)];return t?"".concat(n.join(" "),"(").concat(st(t),")"):n.join(" ")}}(o));var O=E.filter(vr).join(" ");return y?"(".concat(O,")"):O}function S(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=function(r,t){if(!r)return;if("string"==typeof r)return I(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return I(r,t)}(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,a=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return u=r.done,r},e:function(r){a=!0,s=r},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw s}}}}function I(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function N(r){if(!r||0===r.length)return"";var t,e=[],n=S(r);try{for(n.s();!(t=n.n()).done;){var o=t.value,s=o.table,u=o.column,a=o.value,i=[[s,u].filter(vr).map((function(r){return fr(r)})).join(".")],c="";a&&(c=st(a),i.push("=",c)),e.push(i.filter(vr).join(" "))}}catch(r){n.e(r)}finally{n.f()}return e.join(", ")}function R(r){if("select"===r.type)return g(r);var t=r.map(st);return"(".concat(t.join("), ("),")")}function O(r){if(!r)return"";var t=["PARTITION","("];if(Array.isArray(r))t.push(r.map(fr).join(", "));else{var e=r.value;t.push(e.map(st).join(", "))}return t.push(")"),t.filter(vr).join("")}function j(r){if(!r)return"";switch(r.type){case"column":return"(".concat(r.expr.map(B).join(", "),")")}}function x(r){var t=r.expr,e=r.keyword,n=t.type,o=[pr(e)];switch(n){case"origin":o.push(dr(t));break;case"update":o.push("UPDATE",er("SET",N,t.set),er("WHERE",st,t.where))}return o.filter(vr).join(" ")}function k(r){if(!r)return"";var t=r.action;return[j(r.target),x(t)].filter(vr).join(" ")}function U(r){var t=r.table,e=r.type,n=r.prefix,o=void 0===n?"into":n,s=r.columns,u=r.conflict,a=r.values,i=r.where,c=r.on_duplicate_update,l=r.partition,f=r.returning,b=r.set,p=c||{},v=p.keyword,d=p.set,y=[pr(e),pr(o),F(t),O(l)];return Array.isArray(s)&&y.push("(".concat(s.map(fr).join(", "),")")),y.push(er(Array.isArray(a)?"VALUES":"",R,a)),y.push(er("ON CONFLICT",k,u)),y.push(er("SET",N,b)),y.push(er("WHERE",st,i)),y.push(Er(f)),y.push(er(v,N,d)),y.filter(vr).join(" ")}function M(r){var t=r.expr,e=r.unit;return["INTERVAL",st(t),pr(e)].filter(vr).join(" ")}function D(r){var t=r.type,e=r.as,n=r.expr,o=r.with_offset;return["".concat(pr(t),"(").concat(n&&st(n)||"",")"),er("AS",fr,e),er(pr(o&&o.keyword),fr,o&&o.as)].filter(vr).join(" ")}function P(r){if(r)switch(r.type){case"pivot":case"unpivot":return function(r){var t=r.as,e=r.column,n=r.expr,o=r.in_expr,s=r.type,u=[st(n),"FOR",B(e),L(o)],a=["".concat(pr(s),"(").concat(u.join(" "),")")];return t&&a.push("AS",fr(t)),a.join(" ")}(r);default:return""}}function $(r){if(r){var t=r.keyword,e=r.expr,n=r.index,o=r.index_columns,s=r.parentheses,u=r.prefix,a=[];switch(t.toLowerCase()){case"forceseek":a.push(pr(t),"(".concat(fr(n)),"(".concat(o.map(st).filter(vr).join(", "),"))"));break;case"spatial_window_max_cells":a.push(pr(t),"=",st(e));break;case"index":a.push(pr(u),pr(t),s?"(".concat(e.map(fr).join(", "),")"):"= ".concat(fr(e)));break;default:a.push(st(e))}return a.filter(vr).join(" ")}}function G(r){if("UNNEST"===pr(r.type))return D(r);var t=r.table,e=r.db,n=r.as,o=r.expr,s=r.operator,u=r.prefix,a=r.schema,i=r.server,c=r.tablesample,l=r.table_hint,f=fr(i),b=fr(e),p=fr(a),v=t&&fr(t);if(o)switch(o.type){case"values":var d=o.parentheses,y=o.values,w=o.prefix,h=[d&&"(","",d&&")"],L=R(y);w&&(L=L.split("(").slice(1).map((function(r){return"".concat(pr(w),"(").concat(r)})).join("")),h[1]="VALUES ".concat(L),v=h.filter(vr).join("");break;case"tumble":v=function(r){if(!r)return"";var t=r.data,e=r.timecol,n=r.size;return["TABLE(TUMBLE(TABLE",[fr(t.db),fr(t.table)].filter(vr).join("."),"DESCRIPTOR(".concat(B(e),")"),"".concat(M(n),"))")].filter(vr).join(" ")}(o);break;default:v=st(o)}var C=[f,b,p,v=[pr(u),v].filter(vr).join(" ")].filter(vr).join(".");r.parentheses&&(C="(".concat(C,")"));var m=[C];if(c){var E=["TABLESAMPLE",st(c.expr),dr(c.repeatable)].filter(vr).join(" ");m.push(E)}return m.push(er("AS",fr,n),P(s)),l&&m.push(pr(l.keyword),"(".concat(l.expr.map($).filter(vr).join(", "),")")),m.filter(vr).join(" ")}function F(r){if(!r)return"";if(!Array.isArray(r)){var t=r.expr,e=r.parentheses,n=F(t);return e?"(".concat(n,")"):n}var o=r[0],s=[];if("dual"===o.type)return"DUAL";s.push(G(o));for(var u=1;u<r.length;++u){var a=r[u],i=a.on,c=a.using,l=a.join,f=[];f.push(l?" ".concat(pr(l)):","),f.push(G(a)),f.push(er("ON",st,i)),c&&f.push("USING (".concat(c.map(fr).join(", "),")")),s.push(f.filter(vr).join(" "))}return s.filter(vr).join("")}function H(r){var t=r.keyword,e=r.symbol,n=r.value,o=[t.toUpperCase()];e&&o.push(e);var s=n;switch(t){case"partition by":case"default collate":s=st(n);break;case"options":s="(".concat(n.map((function(r){return[r.keyword,r.symbol,st(r.value)].join(" ")})).join(", "),")");break;case"cluster by":s=n.map(st).join(", ")}return o.push(s),o.join(" ")}function Y(r){return function(r){if(Array.isArray(r))return W(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,t){if(!r)return;if("string"==typeof r)return W(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return W(r,t)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function B(r){var t=r.array_index,e=r.arrows,n=void 0===e?[]:e,o=r.as,s=r.collate,u=r.column,a=r.db,i=r.isDual,c=r.schema,l=r.table,f=r.parentheses,b=r.properties,p=r.suffix,v=r.order_by,d=r.subFields,y=void 0===d?[]:d,w="*"===u?"*":function(r,t){if("string"==typeof r)return fr(r,t);var e=r.expr,n=r.offset,o=r.suffix,s=n&&n.map((function(r){return["[",r.name,"".concat(r.name?"(":""),dr(r.value),"".concat(r.name?")":""),"]"].filter(vr).join("")})).join("");return[st(e),s,o].filter(vr).join("")}(u,i),h=[c,a,l].filter(vr).map((function(r){return"".concat(fr(r))})).join(".");h&&(w="".concat(h,".").concat(w)),t&&(w="".concat(w,"[").concat(dr(t.index),"]"),t.property&&(w="".concat(w,".").concat(dr(t.property))));var L=[w=[w].concat(Y(y)).join("."),er("AS",st,o),n.map((function(r,t){return er(r,dr,b[t])})).join(" ")];s&&L.push(br(s).join(" ")),L.push(pr(p)),L.push(pr(v));var C=L.filter(vr).join(" ");return f?"(".concat(C,")"):C}function q(r){var t=r||{},e=t.dataType,n=t.length,o=t.suffix,s=t.scale,u=t.expr,a=e;return null!=n&&(a+="(".concat([n,s].filter((function(r){return null!=r})).join(", "),")")),o&&o.length&&(a+=" ".concat(o.join(" "))),u&&(a+=st(u)),a}function V(r){var t=[];if(!r)return t;var e=r.definition,n=r.keyword,o=r.match,s=r.table,u=r.on_action;return t.push(pr(n)),t.push(F(s)),t.push(e&&"(".concat(e.map((function(r){return st(r)})).join(", "),")")),t.push(pr(o)),u.map((function(r){return t.push(pr(r.type),st(r.value))})),t.filter(vr)}function X(r){var t=r.column,e=r.collate,n=r.nulls,o=r.opclass,s=r.order_by;return[st("string"==typeof t?{type:"column_ref",table:r.table,column:t}:r),er(e&&e.type,fr,e&&e.value),o,pr(s),pr(n)].filter(vr).join(" ")}function K(r){var t=[],e=B(r.column),n=q(r.definition);t.push(e),t.push(n);var o=function(r){var t=[],e=r.nullable,n=r.character_set,o=r.check,s=r.comment,u=r.collate,a=r.storage,i=r.default_val,c=r.auto_increment,l=r.unique,f=r.primary_key,p=r.column_format,v=r.reference_definition;if(t.push(pr(e&&e.value)),i){var d=i.type,y=i.value;t.push(d.toUpperCase(),st(y))}var w=ar().database;return t.push(b(o)),t.push(_r(c),pr(f),pr(l),Cr(s)),t.push.apply(t,Y(br(n))),"sqlite"!==w&&t.push.apply(t,Y(br(u))),t.push.apply(t,Y(br(p))),t.push.apply(t,Y(br(a))),t.push.apply(t,Y(V(v))),t.filter(vr).join(" ")}(r);t.push(o);var s=function(r){if(r)return[pr(r.value),"(".concat(st(r.expr),")"),pr(r.storage_type)].filter(vr).join(" ")}(r.generated);return t.push(s),t.filter(vr).join(" ")}function Q(r){return r?["AS",/^(`?)[a-z_][0-9a-z_]*(`?)$/i.test(r)?fr(r):lr(r)].join(" "):""}function z(r,t){var e=r.expr,n=r.type;if("cast"===n)return w(r);t&&(e.isDual=t);var o=st(e),s=r.expr_list;if(s){var u=[o],a=s.map((function(r){return z(r,t)})).join(", ");return u.push([pr(n),n&&"(",a,n&&")"].filter(vr).join("")),u.filter(vr).join(" ")}return e.parentheses&&Reflect.has(e,"array_index")&&(o="(".concat(o,")")),e.array_index&&"column_ref"!==e.type&&(o="".concat(o,"[").concat(dr(e.array_index.index),"]")),[o,Q(r.as)].filter(vr).join(" ")}function Z(r,t){if(!r||"*"===r)return r;var e=function(r){var t=Array.isArray(r)&&r[0];return!(!t||"dual"!==t.type)}(t);return r.map((function(r){return z(r,e)})).join(", ")}function J(r){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}e.r(n),e.d(n,"arrayStructTypeToSQL",(function(){return Lr})),e.d(n,"autoIncrementToSQL",(function(){return _r})),e.d(n,"columnOrderListToSQL",(function(){return Tr})),e.d(n,"commonKeywordArgsToSQL",(function(){return Ar})),e.d(n,"commonOptionConnector",(function(){return er})),e.d(n,"connector",(function(){return nr})),e.d(n,"commonTypeValue",(function(){return br})),e.d(n,"commentToSQL",(function(){return Cr})),e.d(n,"createBinaryExpr",(function(){return sr})),e.d(n,"createValueExpr",(function(){return or})),e.d(n,"dataTypeToSQL",(function(){return hr})),e.d(n,"DEFAULT_OPT",(function(){return rr})),e.d(n,"escape",(function(){return ur})),e.d(n,"literalToSQL",(function(){return dr})),e.d(n,"columnIdentifierToSql",(function(){return lr})),e.d(n,"getParserOpt",(function(){return ar})),e.d(n,"identifierToSql",(function(){return fr})),e.d(n,"onPartitionsToSQL",(function(){return wr})),e.d(n,"replaceParams",(function(){return yr})),e.d(n,"returningToSQL",(function(){return Er})),e.d(n,"hasVal",(function(){return vr})),e.d(n,"setParserOpt",(function(){return ir})),e.d(n,"toUpper",(function(){return pr})),e.d(n,"topToSQL",(function(){return cr})),e.d(n,"triggerEventToSQL",(function(){return mr}));var rr={database:"mariadb",type:"table",parseOptions:{}},tr=rr;function er(r,t,e){if(e)return r?"".concat(r.toUpperCase()," ").concat(t(e)):t(e)}function nr(r,t){if(t)return"".concat(r.toUpperCase()," ").concat(t)}function or(r){var t=J(r);if(Array.isArray(r))return{type:"expr_list",value:r.map(or)};if(null===r)return{type:"null",value:null};switch(t){case"boolean":return{type:"bool",value:r};case"string":return{type:"string",value:r};case"number":return{type:"number",value:r};default:throw new Error('Cannot convert value "'.concat(t,'" to SQL'))}}function sr(r,t,e){var n={operator:r,type:"binary_expr"};return n.left=t.type?t:or(t),"BETWEEN"===r||"NOT BETWEEN"===r?(n.right={type:"expr_list",value:[or(e[0]),or(e[1])]},n):(n.right=e.type?e:or(e),n)}function ur(r){return r}function ar(){return tr}function ir(r){tr=r}function cr(r){if(r){var t=r.value,e=r.percent,n=r.parentheses?"(".concat(t,")"):t,o="TOP ".concat(n);return e?"".concat(o," ").concat(e.toUpperCase()):o}}function lr(r){var t=ar().database;if(r)switch(t&&t.toLowerCase()){case"postgresql":case"db2":case"snowflake":case"noql":return'"'.concat(r,'"');case"transactsql":return"[".concat(r,"]");case"mysql":case"mariadb":case"bigquery":default:return"`".concat(r,"`")}}function fr(r,t){var e=ar().database;if(!0===t)return"'".concat(r,"'");if(r){if("*"===r)return r;switch(e&&e.toLowerCase()){case"mysql":case"mariadb":case"sqlite":return"`".concat(r,"`");case"postgresql":case"snowflake":case"noql":return'"'.concat(r,'"');case"transactsql":return"[".concat(r,"]");case"bigquery":case"db2":return r;default:return"`".concat(r,"`")}}}function br(r){var t=[];if(!r)return t;var e=r.type,n=r.symbol,o=r.value;return t.push(e.toUpperCase()),n&&t.push(n),t.push(o.toUpperCase()),t}function pr(r){if(r)return r.toUpperCase()}function vr(r){return r}function dr(r){if(r){var t=r.prefix,e=r.type,n=r.parentheses,o=r.suffix,s=r.value,u="string"==typeof r?r:s;switch(e){case"backticks_quote_string":u="`".concat(s,"`");break;case"string":u="'".concat(s,"'");break;case"regex_string":u='r"'.concat(s,'"');break;case"hex_string":u="X'".concat(s,"'");break;case"full_hex_string":u="0x".concat(s);break;case"natural_string":u="N'".concat(s,"'");break;case"bit_string":u="b'".concat(s,"'");break;case"double_quote_string":u='"'.concat(s,'"');break;case"single_quote_string":u="'".concat(s,"'");break;case"boolean":case"bool":u=s?"TRUE":"FALSE";break;case"null":u="NULL";break;case"star":u="*";break;case"param":u="".concat(t||":").concat(s),t=null;break;case"origin":u=s.toUpperCase();break;case"date":case"datetime":case"time":case"timestamp":u="".concat(e.toUpperCase()," '").concat(s,"'");break;case"var_string":u="N'".concat(s,"'")}var a=[];return t&&a.push(pr(t)),a.push(u),o&&a.push("object"===J(o)&&o.collate?br(o.collate).join(" "):pr(o)),u=a.join(" "),n?"(".concat(u,")"):u}}function yr(r,t){return function r(t,e){return Object.keys(t).filter((function(r){var e=t[r];return Array.isArray(e)||"object"===J(e)&&null!==e})).forEach((function(n){var o=t[n];if("object"!==J(o)||"param"!==o.type)return r(o,e);if(void 0===e[o.value])throw new Error("no value for parameter :".concat(o.value," found"));return t[n]=or(e[o.value]),null})),t}(JSON.parse(JSON.stringify(r)),t)}function wr(r){var t=r.type,e=r.partitions;return[pr(t),"(".concat(e.map((function(r){if("range"!==r.type)return dr(r);var t=r.start,e=r.end,n=r.symbol;return"".concat(dr(t)," ").concat(pr(n)," ").concat(dr(e))})).join(", "),")")].join(" ")}function hr(r){var t=r.dataType,e=r.length,n=r.parentheses,o=r.scale,s=r.suffix,u="";return null!=e&&(u=o?"".concat(e,", ").concat(o):e),n&&(u="(".concat(u,")")),s&&s.length&&(u+=" ".concat(s.join(" "))),"".concat(t).concat(u)}function Lr(r){if(r){var t=r.dataType,e=r.definition,n=r.anglebracket,o=pr(t);if("ARRAY"!==o&&"STRUCT"!==o)return o;var s=e&&e.map((function(r){return[r.field_name,Lr(r.field_type)].filter(vr).join(" ")})).join(", ");return n?"".concat(o,"<").concat(s,">"):"".concat(o," ").concat(s)}}function Cr(r){if(r){var t=[],e=r.keyword,n=r.symbol,o=r.value;return t.push(e.toUpperCase()),n&&t.push(n),t.push(dr(o)),t.join(" ")}}function mr(r){return r.map((function(r){var t=r.keyword,e=r.args,n=[pr(t)];if(e){var o=e.keyword,s=e.columns;n.push(pr(o),s.map(B).join(", "))}return n.join(" ")})).join(" OR ")}function Er(r){return r?["RETURNING",r.columns.map(z).filter(vr).join(", ")].join(" "):""}function Ar(r){return r?[pr(r.keyword),pr(r.args)]:[]}function _r(r){if(r){if("string"==typeof r){var t=ar().database;switch(t&&t.toLowerCase()){case"sqlite":return"AUTOINCREMENT";default:return"AUTO_INCREMENT"}}var e=r.keyword,n=r.seed,o=r.increment,s=r.parentheses,u=pr(e);return s&&(u+="(".concat(dr(n),", ").concat(dr(o),")")),u}}function Tr(r){if(r)return r.map(X).filter(vr).join(", ")}function gr(r){var t=r.name,e=r.value;return["@".concat(t),"=",st(e)].filter(vr).join(" ")}function Sr(r){var t=r.left,e=r.right,n=r.symbol,o=r.keyword;t.keyword=o;var s=st(t),u=st(e);return"".concat(s," ").concat(n," ").concat(u)}function Ir(r){var t,e,n,o,s=r.keyword,u=r.suffix,a="";switch(pr(s)){case"BINLOG":e=(t=r).in,n=t.from,o=t.limit,a=[er("IN",dr,e&&e.right),er("FROM",F,n),A(o)].filter(vr).join(" ");break;case"CHARACTER":case"COLLATION":a=function(r){var t=r.expr;if(t)return"LIKE"===pr(t.op)?er("LIKE",dr,t.right):er("WHERE",st,t)}(r);break;case"COLUMNS":case"INDEXES":a=er("FROM",F,r.from);break;case"GRANTS":a=function(r){var t=r.for;if(t){var e=t.user,n=t.host,o=t.role_list,s="'".concat(e,"'");return n&&(s+="@'".concat(n,"'")),["FOR",s,o&&"USING",o&&o.map((function(r){return"'".concat(r,"'")})).join(", ")].filter(vr).join(" ")}}(r);break;case"CREATE":a=er("",G,r[u]);break;case"VAR":a=ot(r.var),s=""}return["SHOW",pr(s),pr(u),a].filter(vr).join(" ")}var Nr={alter:function(r){var t=r.keyword;switch(void 0===t?"table":t){case"aggregate":return function(r){var t=r.args,e=r.expr,n=r.keyword,o=r.name,s=r.type,u=t.expr,a=t.orderby;return[pr(s),pr(n),[[fr(o.schema),fr(o.name)].filter(vr).join("."),"(".concat(u.map(Zr).join(", ")).concat(a?[" ORDER","BY",a.map(Zr).join(", ")].join(" "):"",")")].filter(vr).join(""),zr(e)].filter(vr).join(" ")}(r);case"table":return function(r){var t=r.type,e=r.table,n=r.expr,o=void 0===n?[]:n,s=pr(t),u=F(e),a=o.map(st);return[s,"TABLE",u,a.join(", ")].filter(vr).join(" ")}(r);case"schema":return function(r){var t=r.expr,e=r.keyword,n=r.schema;return[pr(r.type),pr(e),fr(n),zr(t)].filter(vr).join(" ")}(r);case"domain":case"type":return function(r){var t=r.expr,e=r.keyword,n=r.name;return[pr(r.type),pr(e),[fr(n.schema),fr(n.name)].filter(vr).join("."),zr(t)].filter(vr).join(" ")}(r);case"function":return function(r){var t=r.args,e=r.expr,n=r.keyword,o=r.name;return[pr(r.type),pr(n),[[fr(o.schema),fr(o.name)].filter(vr).join("."),t&&"(".concat(t.expr?t.expr.map(Zr).join(", "):"",")")].filter(vr).join(""),zr(e)].filter(vr).join(" ")}(r);case"view":return function(r){var t=r.type,e=r.columns,n=r.attributes,o=r.select,s=r.view,u=r.with,a=pr(t),i=G(s),c=[a,"VIEW",i];e&&c.push("(".concat(e.map(B).join(", "),")"));n&&c.push("WITH ".concat(n.map(pr).join(", ")));c.push("AS",g(o)),u&&c.push(pr(u));return c.filter(vr).join(" ")}(r)}},analyze:function(r){var t=r.type,e=r.table;return[pr(t),G(e)].join(" ")},attach:function(r){var t=r.type,e=r.database,n=r.expr,o=r.as,s=r.schema;return[pr(t),pr(e),st(n),pr(o),fr(s)].filter(vr).join(" ")},create:function(r){var t=r.keyword,e="";switch(t.toLowerCase()){case"aggregate":e=function(r){var t=r.type,e=r.replace,n=r.keyword,o=r.name,s=r.args,u=r.options,a=[pr(t),pr(e),pr(n)],i=[fr(o.schema),o.name].filter(vr).join("."),c="".concat(s.expr.map(Zr).join(", ")).concat(s.orderby?[" ORDER","BY",s.orderby.map(Zr).join(", ")].join(" "):"");return a.push("".concat(i,"(").concat(c,")"),"(".concat(u.map(Qr).join(", "),")")),a.filter(vr).join(" ")}(r);break;case"table":e=function(r){var t=r.type,e=r.keyword,n=r.table,o=r.like,s=r.as,u=r.temporary,a=r.if_not_exists,i=r.create_definitions,c=r.table_options,l=r.ignore_replace,f=r.or_replace,b=r.query_expr,p=[pr(t),pr(f),pr(u),pr(e),pr(a),F(n)];if(o){var v=o.type,d=F(o.table);return p.push(pr(v),d),p.filter(vr).join(" ")}i&&p.push("(".concat(i.map(Vr).join(", "),")"));c&&p.push(c.map(H).join(" "));p.push(pr(l),pr(s)),b&&p.push(Rr(b));return p.filter(vr).join(" ")}(r);break;case"trigger":e="constraint"===r.resource?function(r){var t=r.constraint,e=r.constraint_kw,n=r.deferrable,o=r.events,s=r.execute,u=r.for_each,a=r.from,i=r.location,c=r.keyword,l=r.or,f=r.type,b=r.table,p=r.when,v=[pr(f),pr(l),pr(e),pr(c),fr(t),pr(i)],d=mr(o);v.push(d,"ON",G(b)),a&&v.push("FROM",G(a));v.push.apply(v,Wr(Ar(n)).concat(Wr(Ar(u)))),p&&v.push(pr(p.type),st(p.cond));return v.push(pr(s.keyword),h(s.expr)),v.filter(vr).join(" ")}(r):function(r){var t=r.definer,e=r.for_each,n=r.keyword,o=r.execute,s=r.type,u=r.table,a=r.if_not_exists,i=r.temporary,c=r.trigger,l=r.events,f=r.order,b=r.time,p=r.when,v=[pr(s),pr(i),t,pr(n),pr(a),G(c),pr(b),l.map((function(r){var t=[pr(r.keyword)],e=r.args;return e&&t.push(pr(e.keyword),e.columns.map(B).join(", ")),t.join(" ")})),"ON",G(u),pr(e&&e.keyword),pr(e&&e.args),f&&"".concat(pr(f.keyword)," ").concat(fr(f.trigger)),er("WHEN",st,p),pr(o.prefix)];switch(o.type){case"set":v.push(er("SET",N,o.expr));break;case"multiple":v.push(Or(o.expr.ast))}return v.push(pr(o.suffix)),v.filter(vr).join(" ")}(r);break;case"extension":e=function(r){var t=r.extension,e=r.from,n=r.if_not_exists,o=r.keyword,s=r.schema,u=r.type,a=r.with,i=r.version;return[pr(u),pr(o),pr(n),dr(t),pr(a),er("SCHEMA",dr,s),er("VERSION",dr,i),er("FROM",dr,e)].filter(vr).join(" ")}(r);break;case"function":e=function(r){var t=r.type,e=r.replace,n=r.keyword,o=r.name,s=r.args,u=r.returns,a=r.options,i=r.last,c=[pr(t),pr(e),pr(n)],l=[fr(o.schema),o.name].filter(vr).join("."),f=s.map(Zr).filter(vr).join(", ");return c.push("".concat(l,"(").concat(f,")"),function(r){var t=r.type,e=r.keyword,n=r.expr;return[pr(t),pr(e),Array.isArray(n)?"(".concat(n.map(K).join(", "),")"):Xr(n)].filter(vr).join(" ")}(u),a.map(Kr).join(" "),i),c.filter(vr).join(" ")}(r);break;case"index":e=function(r){var t=r.concurrently,e=r.filestream_on,n=r.keyword,o=r.include,s=r.index_columns,a=r.index_type,c=r.index_using,l=r.index,f=r.on,b=r.index_options,p=r.algorithm_option,v=r.lock_option,d=r.on_kw,y=r.table,w=r.tablespace,h=r.type,L=r.where,C=r.with,m=r.with_before_where,E=C&&"WITH (".concat(i(C).join(", "),")"),A=o&&"".concat(pr(o.keyword)," (").concat(o.columns.map((function(r){return fr(r)})).join(", "),")"),_=[pr(h),pr(a),pr(n),pr(t),fr(l),pr(d),G(y)].concat(Wr(u(c)),["(".concat(Tr(s),")"),A,i(b).join(" "),zr(p),zr(v),er("TABLESPACE",dr,w)]);m?_.push(E,er("WHERE",st,L)):_.push(er("WHERE",st,L),E);return _.push(er("ON",st,f),er("FILESTREAM_ON",dr,e)),_.filter(vr).join(" ")}(r);break;case"sequence":e=function(r){var t=r.type,e=r.keyword,n=r.sequence,o=r.temporary,s=r.if_not_exists,u=r.create_definitions,a=[pr(t),pr(o),pr(e),pr(s),F(n)];u&&a.push(u.map(Vr).join(" "));return a.filter(vr).join(" ")}(r);break;case"database":e=function(r){var t=r.type,e=r.keyword,n=r.database,o=r.if_not_exists,s=r.create_definitions,u=[pr(t),pr(e),pr(o),lr(n)];s&&u.push(s.map(H).join(" "));return u.filter(vr).join(" ")}(r);break;case"view":e=function(r){var t=r.algorithm,e=r.columns,n=r.definer,o=r.if_not_exists,s=r.keyword,u=r.recursive,a=r.replace,i=r.select,c=r.sql_security,l=r.temporary,f=r.type,b=r.view,p=r.with,v=r.with_options,d=b.db,y=b.view,w=[fr(d),fr(y)].filter(vr).join(".");return[pr(f),pr(a),pr(l),pr(u),t&&"ALGORITHM = ".concat(pr(t)),n,c&&"SQL SECURITY ".concat(pr(c)),pr(s),pr(o),w,e&&"(".concat(e.map(lr).join(", "),")"),v&&["WITH","(".concat(v.map((function(r){return br(r).join(" ")})).join(", "),")")].join(" "),"AS",Rr(i),pr(p)].filter(vr).join(" ")}(r);break;case"domain":e=function(r){var t=r.as,e=r.domain,n=r.type,o=r.keyword,s=r.target,u=r.create_definitions,a=[pr(n),pr(o),[fr(e.schema),fr(e.name)].filter(vr).join("."),pr(t),hr(s)];if(u&&u.length>0){var i,c=[],l=function(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=Br(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,a=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return u=r.done,r},e:function(r){a=!0,s=r},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw s}}}}(u);try{for(l.s();!(i=l.n()).done;){var f=i.value,p=f.type;switch(p){case"collate":c.push(br(f).join(" "));break;case"default":c.push(pr(p),st(f.value));break;case"constraint":c.push(b(f))}}}catch(r){l.e(r)}finally{l.f()}a.push(c.filter(vr).join(" "))}return a.filter(vr).join(" ")}(r);break;case"type":e=function(r){var t=r.as,e=r.create_definitions,n=r.keyword,o=r.name,s=r.resource,u=[pr(r.type),pr(n),[fr(o.schema),fr(o.name)].filter(vr).join("."),pr(t),pr(s)];if(e){var a=[];switch(s){case"enum":a.push(st(e))}u.push(a.filter(vr).join(" "))}return u.filter(vr).join(" ")}(r);break;case"user":e=function(r){var t=r.attribute,e=r.comment,n=r.default_role,o=r.if_not_exists,s=r.keyword,u=r.lock_option,a=r.password_options,i=r.require,c=r.resource_options,l=r.type,f=r.user.map((function(r){var t=r.user,e=r.auth_option,n=[Hr(t)];return e&&n.push(pr(e.keyword),e.auth_plugin,dr(e.value)),n.filter(vr).join(" ")})).join(", "),b=[pr(l),pr(s),pr(o),f];n&&b.push(pr(n.keyword),n.value.map(Hr).join(", "));b.push(er(i&&i.keyword,st,i&&i.value)),c&&b.push(pr(c.keyword),c.value.map((function(r){return st(r)})).join(" "));a&&a.forEach((function(r){return b.push(er(r.keyword,st,r.value))}));return b.push(dr(u),Cr(e),dr(t)),b.filter(vr).join(" ")}(r);break;default:throw new Error("unknown create resource ".concat(t))}return e},select:g,deallocate:function(r){var t=r.type,e=r.keyword,n=r.expr;return[pr(t),pr(e),st(n)].filter(vr).join(" ")},delete:function(r){var t=r.columns,e=r.from,n=r.table,o=r.where,s=r.orderby,u=r.with,a=r.limit,i=[_(u),"DELETE"],c=Z(t,e);return i.push(c),Array.isArray(n)&&(1===n.length&&!0===n[0].addition||i.push(F(n))),i.push(er("FROM",F,e)),i.push(er("WHERE",st,o)),i.push(at(s,"order by")),i.push(A(a)),i.filter(vr).join(" ")},exec:function(r){var t=r.keyword,e=r.module,n=r.parameters;return[pr(t),G(e),(n||[]).map(gr).filter(vr).join(", ")].filter(vr).join(" ")},execute:function(r){var t=r.type,e=r.name,n=r.args,o=[pr(t)],s=[e];n&&s.push("(".concat(st(n).join(", "),")"));return o.push(s.join("")),o.filter(vr).join(" ")},for:function(r){var t=r.type,e=r.label,n=r.target,o=r.query,s=r.stmts;return[e,pr(t),n,"IN",Or([o]),"LOOP",Or(s),"END LOOP",e].filter(vr).join(" ")},update:function(r){var t=r.from,e=r.table,n=r.set,o=r.where,s=r.orderby,u=r.with,a=r.limit,i=r.returning;return[_(u),"UPDATE",F(e),er("SET",N,n),er("FROM",F,t),er("WHERE",st,o),at(s,"order by"),A(a),Er(i)].filter(vr).join(" ")},if:function(r){var t=r.boolean_expr,e=r.else_expr,n=r.elseif_expr,o=r.if_expr,s=r.prefix,u=r.go,a=r.semicolons,i=r.suffix,c=[pr(r.type),st(t),dr(s),"".concat(Ur(o.ast||o)).concat(a[0]),pr(u)];n&&c.push(n.map((function(r){return[pr(r.type),st(r.boolean_expr),"THEN",Ur(r.then.ast||r.then),r.semicolon].filter(vr).join(" ")})).join(" "));e&&c.push("ELSE","".concat(Ur(e.ast||e)).concat(a[1]));return c.push(dr(i)),c.filter(vr).join(" ")},insert:U,drop:Gr,truncate:Gr,replace:U,declare:function(r){var t=r.type,e=r.declare,n=r.symbol,o=[pr(t)],s=e.map((function(r){var t=r.at,e=r.name,n=r.as,o=r.constant,s=r.datatype,u=r.not_null,a=r.prefix,i=r.definition,c=r.keyword,l=[[t,e].filter(vr).join(""),pr(n),pr(o)];switch(c){case"variable":l.push.apply(l,[q(s)].concat(Dr(br(r.collate)),[pr(u)])),i&&l.push(pr(i.keyword),st(i.value));break;case"cursor":l.push(pr(a));break;case"table":l.push(pr(a),"(".concat(i.map(Vr).join(", "),")"))}return l.filter(vr).join(" ")})).join("".concat(n," "));return o.push(s),o.join(" ")},use:function(r){var t=r.type,e=r.db,n=pr(t),o=fr(e);return"".concat(n," ").concat(o)},rename:function(r){var t=r.type,e=r.table,n=[],o="".concat(t&&t.toUpperCase()," TABLE");if(e){var s,u=Mr(e);try{for(u.s();!(s=u.n()).done;){var a=s.value.map(G);n.push(a.join(" TO "))}}catch(r){u.e(r)}finally{u.f()}}return"".concat(o," ").concat(n.join(", "))},call:function(r){var t=st(r.expr);return"".concat("CALL"," ").concat(t)},desc:function(r){var t=r.type,e=r.table,n=pr(t);return"".concat(n," ").concat(fr(e))},set:function(r){var t=r.expr,e=st(t);return"".concat("SET"," ").concat(e)},lock:Fr,unlock:Fr,show:Ir,grant:Yr,revoke:Yr,proc:function(r){var t=r.stmt;switch(t.type){case"assign":return Sr(t);case"return":return function(r){var t=r.type,e=r.expr;return[pr(t),st(e)].join(" ")}(t)}},raise:function(r){var t=r.type,e=r.level,n=r.raise,o=r.using,s=[pr(t),pr(e)];n&&s.push([dr(n.keyword),"format"===n.type&&n.expr.length>0&&","].filter(vr).join(""),n.expr.map((function(r){return st(r)})).join(", "));o&&s.push(pr(o.type),pr(o.option),o.symbol,o.expr.map((function(r){return st(r)})).join(", "));return s.filter(vr).join(" ")},transaction:function(r){return st(r.expr)}};function Rr(r){if(!r)return"";for(var t=Nr[r.type],e=r,n=e._parentheses,o=e._orderby,s=e._limit,u=[n&&"(",t(r)];r._next;){var a=Nr[r._next.type],i=pr(r.set_op);u.push(i,a(r._next)),r=r._next}return u.push(n&&")",at(o,"order by"),A(s)),u.filter(vr).join(" ")}function Or(r){for(var t=[],e=0,n=r.length;e<n;++e){var o=r[e]&&r[e].ast?r[e].ast:r[e],s=Rr(o);e===n-1&&"transaction"===o.type&&(s="".concat(s," ;")),t.push(s)}return t.join(" ; ")}var jr=["analyze","attach","select","deallocate","delete","exec","update","insert","drop","rename","truncate","call","desc","use","alter","set","create","lock","unlock","declare","show","replace","if","grant","revoke","proc","raise","execute","transaction"];function xr(r){var t=r&&r.ast?r.ast:r;if(!jr.includes(t.type))throw new Error("".concat(t.type," statements not supported at the moment"))}function kr(r){return Array.isArray(r)?(r.forEach(xr),Or(r)):(xr(r),Rr(r))}function Ur(r){return"go"===r.go?function r(t){if(!t||0===t.length)return"";var e=[kr(t.ast)];return t.go_next&&e.push(t.go.toUpperCase(),r(t.go_next)),e.filter((function(r){return r})).join(" ")}(r):kr(r)}function Mr(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=Pr(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,a=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return u=r.done,r},e:function(r){a=!0,s=r},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw s}}}}function Dr(r){return function(r){if(Array.isArray(r))return $r(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||Pr(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pr(r,t){if(r){if("string"==typeof r)return $r(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?$r(r,t):void 0}}function $r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Gr(r){var t=r.type,e=r.keyword,n=r.name,o=r.prefix,s=[pr(t),pr(e),pr(o)];switch(e){case"table":s.push(F(n));break;case"trigger":s.push([n[0].schema?"".concat(fr(n[0].schema),"."):"",fr(n[0].trigger)].filter(vr).join(""));break;case"database":case"schema":case"procedure":s.push(fr(n));break;case"view":s.push(F(n),r.options&&r.options.map(st).filter(vr).join(" "));break;case"index":s.push.apply(s,[B(n)].concat(Dr(r.table?["ON",G(r.table)]:[]),[r.options&&r.options.map(st).filter(vr).join(" ")]))}return s.filter(vr).join(" ")}function Fr(r){var t=r.type,e=r.keyword,n=r.tables,o=[t.toUpperCase(),pr(e)];if("UNLOCK"===t.toUpperCase())return o.join(" ");var s,u=[],a=Mr(n);try{var i=function(){var r=s.value,t=r.table,e=r.lock_type,n=[G(t)];if(e){n.push(["prefix","type","suffix"].map((function(r){return pr(e[r])})).filter(vr).join(" "))}u.push(n.join(" "))};for(a.s();!(s=a.n()).done;)i()}catch(r){a.e(r)}finally{a.f()}return o.push.apply(o,[u.join(", ")].concat(Dr(function(r){var t=r.lock_mode,e=r.nowait,n=[];if(t){var o=t.mode;n.push(o.toUpperCase())}return e&&n.push(e.toUpperCase()),n}(r)))),o.filter(vr).join(" ")}function Hr(r){var t=r.name,e=r.host,n=[dr(t)];return e&&n.push("@",dr(e)),n.join("")}function Yr(r){var t=r.type,e=r.grant_option_for,n=r.keyword,o=r.objects,s=r.on,u=r.to_from,a=r.user_or_roles,i=r.with,c=[pr(t),dr(e)],l=o.map((function(r){var t=r.priv,e=r.columns,n=[st(t)];return e&&n.push("(".concat(e.map(B).join(", "),")")),n.join(" ")})).join(", ");if(c.push(l),s)switch(c.push("ON"),n){case"priv":c.push(dr(s.object_type),s.priv_level.map((function(r){return[fr(r.prefix),fr(r.name)].filter(vr).join(".")})).join(", "));break;case"proxy":c.push(Hr(s))}return c.push(pr(u),a.map(Hr).join(", ")),c.push(dr(i)),c.filter(vr).join(" ")}function Wr(r){return function(r){if(Array.isArray(r))return qr(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||Br(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Br(r,t){if(r){if("string"==typeof r)return qr(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?qr(r,t):void 0}}function qr(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Vr(r){if(!r)return[];var t,e,n,s,u=r.resource;switch(u){case"column":return K(r);case"index":return e=[],n=(t=r).keyword,s=t.index,e.push(pr(n)),e.push(s),e.push.apply(e,o(c(t))),e.filter(vr).join(" ");case"constraint":return b(r);case"sequence":return[pr(r.prefix),st(r.value)].filter(vr).join(" ");default:throw new Error("unknown resource = ".concat(u," type"))}}function Xr(r){return r.dataType?hr(r):[fr(r.db),fr(r.schema),fr(r.table)].filter(vr).join(".")}function Kr(r){var t=r.type;switch(t){case"as":return[pr(t),r.symbol,Rr(r.declare),pr(r.begin),Or(r.expr),pr(r.end),r.symbol].filter(vr).join(" ");case"set":return[pr(t),r.parameter,pr(r.value&&r.value.prefix),r.value&&r.value.expr.map(st).join(", ")].filter(vr).join(" ");default:return st(r)}}function Qr(r){var t=r.type,e=r.symbol,n=r.value,o=[pr(t),e];switch(pr(t)){case"SFUNC":o.push([fr(n.schema),n.name].filter(vr).join("."));break;case"STYPE":case"MSTYPE":o.push(hr(n));break;default:o.push(st(n))}return o.filter(vr).join(" ")}function zr(r){if(!r)return"";var t=r.action,e=r.create_definitions,n=r.first_after,o=r.if_not_exists,s=r.keyword,u=r.old_column,a=r.prefix,i=r.resource,l=r.symbol,f="",b=[];switch(i){case"column":b=[K(r)];break;case"index":b=c(r),f=r[i];break;case"table":case"schema":f=fr(r[i]);break;case"aggregate":case"function":case"domain":case"type":f=fr(r[i]);break;case"algorithm":case"lock":case"table-option":f=[l,pr(r[i])].filter(vr).join(" ");break;case"constraint":f=fr(r[i]),b=[Vr(e)];break;case"key":f=fr(r[i]);break;default:f=[l,r[i]].filter((function(r){return null!==r})).join(" ")}return[pr(t),pr(s),pr(o),u&&B(u),pr(a),f&&f.trim(),b.filter(vr).join(" "),n&&"".concat(pr(n.keyword)," ").concat(B(n.column))].filter(vr).join(" ")}function Zr(r){var t=r.default&&[pr(r.default.keyword),st(r.default.value)].join(" ");return[pr(r.mode),r.name,hr(r.type),t].filter(vr).join(" ")}function Jr(r){return(Jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function rt(r){var t=r.expr_list;switch(pr(r.type)){case"STRUCT":return"(".concat(Z(t),")");case"ARRAY":return function(r){var t=r.array_path,e=r.brackets,n=r.expr_list,o=r.parentheses;if(!n)return"[".concat(Z(t),"]");var s=Array.isArray(n)?n.map((function(r){return"(".concat(Z(r),")")})).filter(vr).join(", "):st(n);return e?"[".concat(s,"]"):o?"(".concat(s,")"):s}(r);default:return""}}function tt(r){var t=r.definition,e=[pr(r.keyword)];return t&&"object"===Jr(t)&&(e.length=0,e.push(Lr(t))),e.push(rt(r)),e.filter(vr).join("")}function et(r){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var nt={alter:zr,aggr_func:function(r){var t=r.args,e=r.filter,n=r.over,o=r.within_group_orderby,s=st(t.expr),u=r.name,a=y(n);t.distinct&&(s=["DISTINCT",s].join(" ")),t.orderby&&(s="".concat(s," ").concat(at(t.orderby,"order by"))),t.separator&&(s=[s,pr(t.separator.keyword),dr(t.separator.value)].filter(vr).join(" "));var i=o?"WITHIN GROUP (".concat(at(o,"order by"),")"):"",c=e?"FILTER (WHERE ".concat(st(e.where),")"):"";return["".concat(u,"(").concat(s,")"),i,a,c].filter(vr).join(" ")},any_value:function(r){var t=r.args,e=r.type,n=r.over,o=t.expr,s=t.having,u="".concat(pr(e),"(").concat(st(o));return s&&(u="".concat(u," HAVING ").concat(pr(s.prefix)," ").concat(st(s.expr))),[u="".concat(u,")"),y(n)].filter(vr).join(" ")},window_func:function(r){var t=r.over;return[d(r),y(t)].filter(vr).join(" ")},array:tt,assign:Sr,binary_expr:L,case:function(r){var t=["CASE"],e=r.args,n=r.expr,o=r.parentheses;n&&t.push(st(n));for(var s=0,u=e.length;s<u;++s)t.push(e[s].type.toUpperCase()),e[s].cond&&(t.push(st(e[s].cond)),t.push("THEN")),t.push(st(e[s].result));return t.push("END"),o?"(".concat(t.join(" "),")"):t.join(" ")},cast:w,column_ref:B,column_definition:K,datatype:hr,extract:function(r){var t=r.args,e=r.type,n=t.field,o=t.cast_type,s=t.source,u=["".concat(pr(e),"(").concat(pr(n)),"FROM",pr(o),st(s)];return"".concat(u.filter(vr).join(" "),")")},flatten:function(r){var t=r.args,e=r.type,n=["input","path","outer","recursive","mode"].map((function(r){return function(r){if(!r)return"";var t=r.type,e=r.symbol,n=r.value;return[pr(t),e,st(n)].filter(vr).join(" ")}(t[r])})).filter(vr).join(", ");return"".concat(pr(e),"(").concat(n,")")},fulltext_search:function(r){var t=r.against,e=r.as,n=r.columns,o=r.match,s=r.mode;return[[pr(o),"(".concat(n.map((function(r){return B(r)})).join(", "),")")].join(" "),[pr(t),["(",st(r.expr),s&&" ".concat(dr(s)),")"].filter(vr).join("")].join(" "),Q(e)].filter(vr).join(" ")},function:h,insert:Rr,interval:M,json:function(r){var t=r.keyword,e=r.expr_list;return[pr(t),e.map((function(r){return st(r)})).join(", ")].join(" ")},show:Ir,struct:tt,tablefunc:function(r){var t=r.as,e=r.name,n=r.args;return["".concat(e,"(").concat(st(n).join(", "),")"),"AS",h(t)].join(" ")},tables:F,unnest:D,window:function(r){return r.expr.map(v).join(", ")}};function ot(r){var t=r.prefix,e=void 0===t?"@":t,n=r.name,o=r.members,s=r.keyword,u=r.quoted,a=r.suffix,i=[];s&&i.push(s);var c=o&&o.length>0?"".concat(n,".").concat(o.join(".")):n,l="".concat(e||"").concat(c);return a&&(l+=a),i.push(l),[u,i.join(" "),u].filter(vr).join("")}function st(r){if(r){var t=r;if(r.ast){var e=t.ast;Reflect.deleteProperty(t,e);for(var n=0,o=Object.keys(e);n<o.length;n++){var s=o[n];t[s]=e[s]}}return nt[t.type]?nt[t.type](t):dr(t)}}function ut(r){return r?r.map(st):[]}function at(r,t){if(!Array.isArray(r))return"";var e=[],n=pr(t);switch(n){case"ORDER BY":e=r.map((function(r){return[st(r.expr),r.type||"ASC",pr(r.nulls)].filter(vr).join(" ")}));break;case"PARTITION BY":default:e=r.map((function(r){return st(r.expr)}))}return nr(n,e.join(", "))}nt.var=ot,nt.expr_list=function(r){var t=ut(r.value);return r.parentheses?"(".concat(t.join(", "),")"):t},nt.select=function(r){var t="object"===et(r._next)?Rr(r):g(r);return r.parentheses?"(".concat(t,")"):t},nt.unary_expr=function(r){var t=r.operator,e=r.parentheses,n=r.expr,o="-"===t||"+"===t||"~"===t||"!"===t?"":" ",s="".concat(t).concat(o).concat(st(n));return e?"(".concat(s,")"):s};var it=e(0);function ct(r){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var lt,ft,bt,pt,vt=(lt={},ft="mariadb",bt=it.parse,pt=function(r,t){if("object"!=ct(r)||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!=ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(ft,"string"),(ft="symbol"==ct(pt)?pt:String(pt))in lt?Object.defineProperty(lt,ft,{value:bt,enumerable:!0,configurable:!0,writable:!0}):lt[ft]=bt,lt);function dt(r){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function yt(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=function(r,t){if(!r)return;if("string"==typeof r)return wt(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);"Object"===e&&r.constructor&&(e=r.constructor.name);if("Map"===e||"Set"===e)return Array.from(r);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return wt(r,t)}(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,a=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return u=r.done,r},e:function(r){a=!0,s=r},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw s}}}}function wt(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function ht(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,Lt(n.key),n)}}function Lt(r){var t=function(r,t){if("object"!=dt(r)||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,t||"default");if("object"!=dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}(r,"string");return"symbol"==dt(t)?t:String(t)}var Ct=function(){function r(){!function(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}var t,e,n;return t=r,(e=[{key:"astify",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr,e=this.parse(r,t);return e&&e.ast}},{key:"sqlify",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr;return ir(t),Ur(r)}},{key:"exprToSQL",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr;return ir(t),st(r)}},{key:"parse",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rr,e=t.database,n=void 0===e?"mariadb":e;ir(t);var o=n.toLowerCase();if(vt[o])return vt[o](r.trim(),t.parseOptions||rr.parseOptions);throw new Error("".concat(n," is not supported currently"))}},{key:"whiteListCheck",value:function(r,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rr;if(t&&0!==t.length){var n=e.type,o=void 0===n?"table":n;if(!this["".concat(o,"List")]||"function"!=typeof this["".concat(o,"List")])throw new Error("".concat(o," is not valid check mode"));var s,u=this["".concat(o,"List")].bind(this),a=u(r,e),i=!0,c="",l=yt(a);try{for(l.s();!(s=l.n()).done;){var f,b=s.value,p=!1,v=yt(t);try{for(v.s();!(f=v.n()).done;){var d=f.value,y=new RegExp(d,"i");if(y.test(b)){p=!0;break}}}catch(r){v.e(r)}finally{v.f()}if(!p){c=b,i=!1;break}}}catch(r){l.e(r)}finally{l.f()}if(!i)throw new Error("authority = '".concat(c,"' is required in ").concat(o," whiteList to execute SQL = '").concat(r,"'"))}}},{key:"tableList",value:function(r,t){var e=this.parse(r,t);return e&&e.tableList}},{key:"columnList",value:function(r,t){var e=this.parse(r,t);return e&&e.columnList}}])&&ht(t.prototype,e),n&&ht(t,n),Object.defineProperty(t,"prototype",{writable:!1}),r}();function mt(r){return(mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}"object"===("undefined"==typeof self?"undefined":mt(self))&&self&&(self.NodeSQLParser={Parser:Ct,util:n}),"undefined"==typeof global&&"object"===("undefined"==typeof window?"undefined":mt(window))&&window&&(window.global=window),"object"===("undefined"==typeof global?"undefined":mt(global))&&global&&global.window&&(global.window.NodeSQLParser={Parser:Ct,util:n})}]));
2
+ //# sourceMappingURL=mariadb.js.map