UNPKG

jaydata

Version:

Cross-platform HTML5 data-management, JavaScript Language Query (JSLQ) support for OData, SQLite, WebSQL, IndexedDB, YQL and Facebook (packaged for Node.JS)

15 lines 536 kB
// JayData 1.5.10 // Dual licensed under MIT and GPL v2 // Copyright JayStack Technologies (http://jaydata.org/licensing) // // JayData is a standards-based, cross-platform Javascript library and a set of // practices to access and manipulate data from various online and offline sources. // // Credits: // Hajnalka Battancs, Dániel József, János Roden, László Horváth, Péter Nochta // Péter Zentai, Róbert Bónay, Szabolcs Czinege, Viktor Borza, Viktor Lázár, // Zoltán Gyebrovszki, Gábor Dolla // // More info: http://jaydata.org !function(){var require=function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var p=n[o]={exports:{}};t[o][0].call(p.exports,function(e){var n=t[o][1][e];return i(n?n:e)},p,p.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){!function(e,r){"object"==typeof n&&"undefined"!=typeof t?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r(e.acorn=e.acorn||{})}(this,function(e){"use strict";function t(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}}function n(e,n){return 65>e?36===e:91>e?!0:97>e?95===e:123>e?!0:65535>=e?e>=170&&S.test(String.fromCharCode(e)):n===!1?!1:t(e,P)}function r(e,n){return 48>e?36===e:58>e?!0:65>e?!1:91>e?!0:97>e?95===e:123>e?!0:65535>=e?e>=170&&_.test(String.fromCharCode(e)):n===!1?!1:t(e,P)||t(e,N)}function i(e,t){return new M(e,{beforeExpr:!0,binop:t})}function a(e,t){return void 0===t&&(t={}),t.keyword=e,O[e]=new M(e,t)}function o(e){return 10===e||13===e||8232===e||8233==e}function s(e){return"[object Array]"===Object.prototype.toString.call(e)}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){for(var n=1,r=0;;){G.lastIndex=r;var i=G.exec(e);if(!(i&&i.index<t))return new I(n,t-r);++n,r=i.index+i[0].length}}function p(e){var t={};for(var n in $)t[n]=e&&u(e,n)?e[n]:$[n];if(null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),s(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return s(t.onComment)&&(t.onComment=d(t,t.onComment)),t}function d(e,t){return function(n,r,i,a,o,s){var u={type:n?"Block":"Line",value:r,start:i,end:a};e.locations&&(u.loc=new B(this,o,s)),e.ranges&&(u.range=[i,a]),t.push(u)}}function c(e){return new RegExp("^("+e.replace(/ /g,"|")+")$")}function f(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}function y(e,t,n,r){try{return new RegExp(e,t)}catch(i){if(void 0!==n)throw i instanceof SyntaxError&&r.raise(n,"Error parsing regular expression: "+i.message),i}}function h(e){return 65535>=e?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(1023&e)+56320))}function m(e,t){return new R(t,e).parse()}function g(e,t,n){var r=new R(n,e,t);return r.nextToken(),r.parseExpression()}function v(e,t){return new R(t,e)}var x={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",7:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},E="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",b={5:E,6:E+" const class extends export import super"},T="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",C="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",S=new RegExp("["+T+"]"),_=new RegExp("["+T+C+"]");T=C=null;var P=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],N=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],M=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null},A={beforeExpr:!0},w={startsExpr:!0},O={},j={num:new M("num",w),regexp:new M("regexp",w),string:new M("string",w),name:new M("name",w),eof:new M("eof"),bracketL:new M("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new M("]"),braceL:new M("{",{beforeExpr:!0,startsExpr:!0}),braceR:new M("}"),parenL:new M("(",{beforeExpr:!0,startsExpr:!0}),parenR:new M(")"),comma:new M(",",A),semi:new M(";",A),colon:new M(":",A),dot:new M("."),question:new M("?",A),arrow:new M("=>",A),template:new M("template"),ellipsis:new M("...",A),backQuote:new M("`",w),dollarBraceL:new M("${",{beforeExpr:!0,startsExpr:!0}),eq:new M("=",{beforeExpr:!0,isAssign:!0}),assign:new M("_=",{beforeExpr:!0,isAssign:!0}),incDec:new M("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new M("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:i("||",1),logicalAND:i("&&",2),bitwiseOR:i("|",3),bitwiseXOR:i("^",4),bitwiseAND:i("&",5),equality:i("==/!=",6),relational:i("</>",7),bitShift:i("<</>>",8),plusMin:new M("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:i("%",10),star:i("*",10),slash:i("/",10),starstar:new M("**",{beforeExpr:!0}),_break:a("break"),_case:a("case",A),_catch:a("catch"),_continue:a("continue"),_debugger:a("debugger"),_default:a("default",A),_do:a("do",{isLoop:!0,beforeExpr:!0}),_else:a("else",A),_finally:a("finally"),_for:a("for",{isLoop:!0}),_function:a("function",w),_if:a("if"),_return:a("return",A),_switch:a("switch"),_throw:a("throw",A),_try:a("try"),_var:a("var"),_const:a("const"),_while:a("while",{isLoop:!0}),_with:a("with"),_new:a("new",{beforeExpr:!0,startsExpr:!0}),_this:a("this",w),_super:a("super",w),_class:a("class"),_extends:a("extends",A),_export:a("export"),_import:a("import"),_null:a("null",w),_true:a("true",w),_false:a("false",w),_in:a("in",{beforeExpr:!0,binop:7}),_instanceof:a("instanceof",{beforeExpr:!0,binop:7}),_typeof:a("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:a("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:a("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},D=/\r\n?|\n|\u2028|\u2029/,G=new RegExp(D.source,"g"),V=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,k=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,I=function(e,t){this.line=e,this.column=t};I.prototype.offset=function(e){return new I(this.line,this.column+e)};var B=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)},$={ecmaVersion:6,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}},L={},R=function(e,t,n){this.options=e=p(e),this.sourceFile=e.sourceFile,this.keywords=c(b[e.ecmaVersion>=6?6:5]);var r=e.allowReserved?"":x[e.ecmaVersion]+("module"==e.sourceType?" await":"");this.reservedWords=c(r);var i=(r?r+" ":"")+x.strict;this.reservedWordsStrict=c(i),this.reservedWordsStrictBind=c(i+" "+x.strictBind),this.input=String(t),this.containsEsc=!1,this.loadPlugins(e.plugins),n?(this.pos=n,this.lineStart=Math.max(0,this.input.lastIndexOf("\n",n)),this.curLine=this.input.slice(0,this.lineStart).split(D).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=j.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.strict=this.inModule="module"===e.sourceType,this.potentialArrowAt=-1,this.inFunction=this.inGenerator=!1,this.labels=[],0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2)};R.prototype.isKeyword=function(e){return this.keywords.test(e)},R.prototype.isReservedWord=function(e){return this.reservedWords.test(e)},R.prototype.extend=function(e,t){this[e]=t(this[e])},R.prototype.loadPlugins=function(e){var t=this;for(var n in e){var r=L[n];if(!r)throw new Error("Plugin '"+n+"' not found");r(t,e[n])}},R.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};var F=R.prototype;F.isUseStrict=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"use strict"===e.expression.raw.slice(1,-1)},F.eat=function(e){return this.type===e?(this.next(),!0):!1},F.isContextual=function(e){return this.type===j.name&&this.value===e},F.eatContextual=function(e){return this.value===e&&this.eat(j.name)},F.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},F.canInsertSemicolon=function(){return this.type===j.eof||this.type===j.braceR||D.test(this.input.slice(this.lastTokEnd,this.start))},F.insertSemicolon=function(){return this.canInsertSemicolon()?(this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0):void 0},F.semicolon=function(){this.eat(j.semi)||this.insertSemicolon()||this.unexpected()},F.afterTrailingComma=function(e){return this.type==e?(this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),this.next(),!0):void 0},F.expect=function(e){this.eat(e)||this.unexpected()},F.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var q=function(){this.shorthandAssign=0,this.trailingComma=0};F.checkPatternErrors=function(e,t){var n=e&&e.trailingComma;return t?void(n&&this.raise(n,"Comma is not permitted after the rest element")):!!n},F.checkExpressionErrors=function(e,t){var n=e&&e.shorthandAssign;return t?void(n&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns")):!!n};var U=R.prototype;U.parseTopLevel=function(e){var t=this,n=!0;for(e.body||(e.body=[]);this.type!==j.eof;){var r=t.parseStatement(!0,!0);e.body.push(r),n&&(t.isUseStrict(r)&&t.setStrict(!0),n=!1)}return this.next(),this.options.ecmaVersion>=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var Q={kind:"loop"},H={kind:"switch"};U.isLet=function(){if(this.type!==j.name||this.options.ecmaVersion<6||"let"!=this.value)return!1;k.lastIndex=this.pos;var e=k.exec(this.input),t=this.pos+e[0].length,i=this.input.charCodeAt(t);if(91===i||123==i)return!0;if(n(i,!0)){for(var a=t+1;r(this.input.charCodeAt(a),!0);++a);var o=this.input.slice(t,a);if(!this.isKeyword(o))return!0}return!1},U.parseStatement=function(e,t){var n,r=this.type,i=this.startNode();switch(this.isLet()&&(r=j._var,n="let"),r){case j._break:case j._continue:return this.parseBreakContinueStatement(i,r.keyword);case j._debugger:return this.parseDebuggerStatement(i);case j._do:return this.parseDoStatement(i);case j._for:return this.parseForStatement(i);case j._function:return!e&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i);case j._class:return e||this.unexpected(),this.parseClass(i,!0);case j._if:return this.parseIfStatement(i);case j._return:return this.parseReturnStatement(i);case j._switch:return this.parseSwitchStatement(i);case j._throw:return this.parseThrowStatement(i);case j._try:return this.parseTryStatement(i);case j._const:case j._var:return n=n||this.value,e||"var"==n||this.unexpected(),this.parseVarStatement(i,n);case j._while:return this.parseWhileStatement(i);case j._with:return this.parseWithStatement(i);case j.braceL:return this.parseBlock();case j.semi:return this.parseEmptyStatement(i);case j._export:case j._import:return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===j._import?this.parseImport(i):this.parseExport(i);default:var a=this.value,o=this.parseExpression();return r===j.name&&"Identifier"===o.type&&this.eat(j.colon)?this.parseLabeledStatement(i,a,o):this.parseExpressionStatement(i,o)}},U.parseBreakContinueStatement=function(e,t){var n=this,r="break"==t;this.next(),this.eat(j.semi)||this.insertSemicolon()?e.label=null:this.type!==j.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var a=n.labels[i];if(null==e.label||a.name===e.label.name){if(null!=a.kind&&(r||"loop"===a.kind))break;if(e.label&&r)break}}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")},U.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},U.parseDoStatement=function(e){return this.next(),this.labels.push(Q),e.body=this.parseStatement(!1),this.labels.pop(),this.expect(j._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(j.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},U.parseForStatement=function(e){if(this.next(),this.labels.push(Q),this.expect(j.parenL),this.type===j.semi)return this.parseFor(e,null);var t=this.isLet();if(this.type===j._var||this.type===j._const||t){var n=this.startNode(),r=t?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),!(this.type===j._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==n.declarations.length||"var"!==r&&n.declarations[0].init?this.parseFor(e,n):this.parseForIn(e,n)}var i=new q,a=this.parseExpression(!0,i);return this.type===j._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.checkPatternErrors(i,!0),this.toAssignable(a),this.checkLVal(a),this.parseForIn(e,a)):(this.checkExpressionErrors(i,!0),this.parseFor(e,a))},U.parseFunctionStatement=function(e){return this.next(),this.parseFunction(e,!0)},U.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!1),e.alternate=this.eat(j._else)?this.parseStatement(!1):null,this.finishNode(e,"IfStatement")},U.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(j.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},U.parseSwitchStatement=function(e){var t=this;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(j.braceL),this.labels.push(H);for(var n,r=!1;this.type!=j.braceR;)if(t.type===j._case||t.type===j._default){var i=t.type===j._case;n&&t.finishNode(n,"SwitchCase"),e.cases.push(n=t.startNode()),n.consequent=[],t.next(),i?n.test=t.parseExpression():(r&&t.raiseRecoverable(t.lastTokStart,"Multiple default clauses"),r=!0,n.test=null),t.expect(j.colon)}else n||t.unexpected(),n.consequent.push(t.parseStatement(!0));return n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},U.parseThrowStatement=function(e){return this.next(),D.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var J=[];U.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===j._catch){var t=this.startNode();this.next(),this.expect(j.parenL),t.param=this.parseBindingAtom(),this.checkLVal(t.param,!0),this.expect(j.parenR),t.body=this.parseBlock(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(j._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},U.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},U.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Q),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"WhileStatement")},U.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},U.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},U.parseLabeledStatement=function(e,t,n){for(var r=this,i=0;i<this.labels.length;++i)r.labels[i].name===t&&r.raise(n.start,"Label '"+t+"' is already declared");for(var a=this.type.isLoop?"loop":this.type===j._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var s=r.labels[o];if(s.statementStart!=e.start)break;s.statementStart=r.start,s.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(!0),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},U.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},U.parseBlock=function(e){var t,n=this,r=this.startNode(),i=!0;for(r.body=[],this.expect(j.braceL);!this.eat(j.braceR);){var a=n.parseStatement(!0);r.body.push(a),i&&e&&n.isUseStrict(a)&&(t=n.strict,n.setStrict(n.strict=!0)),i=!1}return t===!1&&this.setStrict(!1),this.finishNode(r,"BlockStatement")},U.parseFor=function(e,t){return e.init=t,this.expect(j.semi),e.test=this.type===j.semi?null:this.parseExpression(),this.expect(j.semi),e.update=this.type===j.parenR?null:this.parseExpression(),this.expect(j.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"ForStatement")},U.parseForIn=function(e,t){var n=this.type===j._in?"ForInStatement":"ForOfStatement";return this.next(),e.left=t,e.right=this.parseExpression(),this.expect(j.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,n)},U.parseVar=function(e,t,n){var r=this;for(e.declarations=[],e.kind=n;;){var i=r.startNode();if(r.parseVarId(i),r.eat(j.eq)?i.init=r.parseMaybeAssign(t):"const"!==n||r.type===j._in||r.options.ecmaVersion>=6&&r.isContextual("of")?"Identifier"==i.id.type||t&&(r.type===j._in||r.isContextual("of"))?i.init=null:r.raise(r.lastTokEnd,"Complex binding patterns require an initialization value"):r.unexpected(),e.declarations.push(r.finishNode(i,"VariableDeclarator")),!r.eat(j.comma))break}return e},U.parseVarId=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0)},U.parseFunction=function(e,t,n){this.initFunction(e),this.options.ecmaVersion>=6&&(e.generator=this.eat(j.star));var r=this.inGenerator;return this.inGenerator=e.generator,(t||this.type===j.name)&&(e.id=this.parseIdent()),this.parseFunctionParams(e),this.parseFunctionBody(e,n),this.inGenerator=r,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},U.parseFunctionParams=function(e){this.expect(j.parenL),e.params=this.parseBindingList(j.parenR,!1,!1,!0)},U.parseClass=function(e,t){var n=this;this.next(),this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(j.braceL);!this.eat(j.braceR);)if(!n.eat(j.semi)){var a=n.startNode(),o=n.eat(j.star),s=n.type===j.name&&"static"===n.value;n.parsePropertyName(a),a["static"]=s&&n.type!==j.parenL,a["static"]&&(o&&n.unexpected(),o=n.eat(j.star),n.parsePropertyName(a)),a.kind="method";var u=!1;if(!a.computed){var l=a.key;o||"Identifier"!==l.type||n.type===j.parenL||"get"!==l.name&&"set"!==l.name||(u=!0,a.kind=l.name,l=n.parsePropertyName(a)),!a["static"]&&("Identifier"===l.type&&"constructor"===l.name||"Literal"===l.type&&"constructor"===l.value)&&(i&&n.raise(l.start,"Duplicate constructor in the same class"),u&&n.raise(l.start,"Constructor can't have get/set modifier"),o&&n.raise(l.start,"Constructor can't be a generator"),a.kind="constructor",i=!0)}if(n.parseClassMethod(r,a,o),u){var p="get"===a.kind?0:1;if(a.value.params.length!==p){var d=a.value.start;"get"===a.kind?n.raiseRecoverable(d,"getter should have no params"):n.raiseRecoverable(d,"setter should have exactly one param")}"set"===a.kind&&"RestElement"===a.value.params[0].type&&n.raise(a.value.params[0].start,"Setter cannot use rest params")}}return e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},U.parseClassMethod=function(e,t,n){t.value=this.parseMethod(n),e.body.push(this.finishNode(t,"MethodDefinition"))},U.parseClassId=function(e,t){e.id=this.type===j.name?this.parseIdent():t?this.unexpected():null},U.parseClassSuper=function(e){e.superClass=this.eat(j._extends)?this.parseExprSubscripts():null},U.parseExport=function(e){var t=this;if(this.next(),this.eat(j.star))return this.expectContextual("from"),e.source=this.type===j.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(j._default)){var n=this.type==j.parenL,r=this.parseMaybeAssign(),i=!0;return n||"FunctionExpression"!=r.type&&"ClassExpression"!=r.type||(i=!1,r.id&&(r.type="FunctionExpression"==r.type?"FunctionDeclaration":"ClassDeclaration")),e.declaration=r,i&&this.semicolon(),this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(!0),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(),this.eatContextual("from"))e.source=this.type===j.string?this.parseExprAtom():this.unexpected();else{for(var a=0;a<e.specifiers.length;a++)(t.keywords.test(e.specifiers[a].local.name)||t.reservedWords.test(e.specifiers[a].local.name))&&t.unexpected(e.specifiers[a].local.start);e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},U.shouldParseExportStatement=function(){return this.type.keyword||this.isLet()},U.parseExportSpecifiers=function(){var e=this,t=[],n=!0;for(this.expect(j.braceL);!this.eat(j.braceR);){if(n)n=!1;else if(e.expect(j.comma),e.afterTrailingComma(j.braceR))break;var r=e.startNode();r.local=e.parseIdent(e.type===j._default),r.exported=e.eatContextual("as")?e.parseIdent(!0):r.local,t.push(e.finishNode(r,"ExportSpecifier"))}return t},U.parseImport=function(e){return this.next(),this.type===j.string?(e.specifiers=J,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===j.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},U.parseImportSpecifiers=function(){var e=this,t=[],n=!0;if(this.type===j.name){var r=this.startNode();if(r.local=this.parseIdent(),this.checkLVal(r.local,!0),t.push(this.finishNode(r,"ImportDefaultSpecifier")),!this.eat(j.comma))return t}if(this.type===j.star){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLVal(i.local,!0),t.push(this.finishNode(i,"ImportNamespaceSpecifier")),t}for(this.expect(j.braceL);!this.eat(j.braceR);){if(n)n=!1;else if(e.expect(j.comma),e.afterTrailingComma(j.braceR))break;var a=e.startNode();a.imported=e.parseIdent(!0),e.eatContextual("as")?a.local=e.parseIdent():(a.local=a.imported,e.isKeyword(a.local.name)&&e.unexpected(a.local.start),e.reservedWordsStrict.test(a.local.name)&&e.raise(a.local.start,"The keyword '"+a.local.name+"' is reserved")),e.checkLVal(a.local,!0),t.push(e.finishNode(a,"ImportSpecifier"))}return t};var K=R.prototype;K.toAssignable=function(e,t){var n=this;if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var r=0;r<e.properties.length;r++){var i=e.properties[r];"init"!==i.kind&&n.raise(i.key.start,"Object pattern can't contain getter or setter"),n.toAssignable(i.value,t)}break;case"ArrayExpression":e.type="ArrayPattern",this.toAssignableList(e.elements,t);break;case"AssignmentExpression":if("="!==e.operator){this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");break}e.type="AssignmentPattern",delete e.operator;case"AssignmentPattern":"YieldExpression"===e.right.type&&this.raise(e.right.start,"Yield expression cannot be a default value");break;case"ParenthesizedExpression":e.expression=this.toAssignable(e.expression,t);break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}return e},K.toAssignableList=function(e,t){var n=this,r=e.length;if(r){var i=e[r-1];if(i&&"RestElement"==i.type)--r;else if(i&&"SpreadElement"==i.type){i.type="RestElement";var a=i.argument;this.toAssignable(a,t),"Identifier"!==a.type&&"MemberExpression"!==a.type&&"ArrayPattern"!==a.type&&this.unexpected(a.start),--r}t&&i&&"RestElement"===i.type&&"Identifier"!==i.argument.type&&this.unexpected(i.argument.start)}for(var o=0;r>o;o++){var s=e[o];s&&n.toAssignable(s,t)}return e},K.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},K.parseRest=function(e){var t=this.startNode();return this.next(),e?t.argument=this.type===j.name?this.parseIdent():this.unexpected():t.argument=this.type===j.name||this.type===j.bracketL?this.parseBindingAtom():this.unexpected(),this.finishNode(t,"RestElement")},K.parseBindingAtom=function(){if(this.options.ecmaVersion<6)return this.parseIdent();switch(this.type){case j.name:return this.parseIdent();case j.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(j.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case j.braceL:return this.parseObj(!0);default:this.unexpected()}},K.parseBindingList=function(e,t,n,r){for(var i=this,a=[],o=!0;!this.eat(e);)if(o?o=!1:i.expect(j.comma),t&&i.type===j.comma)a.push(null);else{if(n&&i.afterTrailingComma(e))break;if(i.type===j.ellipsis){var s=i.parseRest(r);i.parseBindingListItem(s),a.push(s),i.type===j.comma&&i.raise(i.start,"Comma is not permitted after the rest element"),i.expect(e);break}var u=i.parseMaybeDefault(i.start,i.startLoc);i.parseBindingListItem(u),a.push(u)}return a},K.parseBindingListItem=function(e){return e},K.parseMaybeDefault=function(e,t,n){if(n=n||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(j.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},K.checkLVal=function(e,t,n){var r=this;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode"),n&&(u(n,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),n[e.name]=!0);break;case"MemberExpression":t&&this.raiseRecoverable(e.start,(t?"Binding":"Assigning to")+" member expression");break;case"ObjectPattern":for(var i=0;i<e.properties.length;i++)r.checkLVal(e.properties[i].value,t,n);break;case"ArrayPattern":for(var a=0;a<e.elements.length;a++){var o=e.elements[a];o&&r.checkLVal(o,t,n)}break;case"AssignmentPattern":this.checkLVal(e.left,t,n);break;case"RestElement":this.checkLVal(e.argument,t,n);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,n);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var z=R.prototype;z.checkPropClash=function(e,t){if(!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,r=e.key;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var i=e.kind;if(this.options.ecmaVersion>=6)return void("__proto__"===n&&"init"===i&&(t.proto&&this.raiseRecoverable(r.start,"Redefinition of __proto__ property"),t.proto=!0));n="$"+n;var a=t[n];if(a){var o="init"!==i;(!this.strict&&!o||!a[i])&&o^a.init||this.raiseRecoverable(r.start,"Redefinition of property")}else a=t[n]={init:!1,get:!1,set:!1};a[i]=!0}},z.parseExpression=function(e,t){var n=this,r=this.start,i=this.startLoc,a=this.parseMaybeAssign(e,t);if(this.type===j.comma){var o=this.startNodeAt(r,i);for(o.expressions=[a];this.eat(j.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return this.finishNode(o,"SequenceExpression")}return a},z.parseMaybeAssign=function(e,t,n){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var r=!1;t||(t=new q,r=!0);var i=this.start,a=this.startLoc;this.type!=j.parenL&&this.type!=j.name||(this.potentialArrowAt=this.start);var o=this.parseMaybeConditional(e,t);if(n&&(o=n.call(this,o,i,a)),this.type.isAssign){this.checkPatternErrors(t,!0),r||q.call(t);var s=this.startNodeAt(i,a);return s.operator=this.value,s.left=this.type===j.eq?this.toAssignable(o):o,t.shorthandAssign=0,this.checkLVal(o),this.next(),s.right=this.parseMaybeAssign(e),this.finishNode(s,"AssignmentExpression")}return r&&this.checkExpressionErrors(t,!0),o},z.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(j.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(j.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return i},z.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)?i:this.parseExprOp(i,n,r,-1,e)},z.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(null!=a&&(!i||this.type!==j._in)&&a>r){var o=this.type===j.logicalOR||this.type===j.logicalAND,s=this.value;this.next();var u=this.start,l=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1),u,l,a,i),d=this.buildBinary(t,n,e,p,s,o);return this.parseExprOp(d,t,n,r,i)}return e},z.buildBinary=function(e,t,n,r,i,a){var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?"LogicalExpression":"BinaryExpression"); },z.parseMaybeUnary=function(e,t){var n,r=this,i=this.start,a=this.startLoc;if(this.type.prefix){var o=this.startNode(),s=this.type===j.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),s?this.checkLVal(o.argument):this.strict&&"delete"===o.operator&&"Identifier"===o.argument.type?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):t=!0,n=this.finishNode(o,s?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var u=r.startNodeAt(i,a);u.operator=r.value,u.prefix=!1,u.argument=n,r.checkLVal(n),r.next(),n=r.finishNode(u,"UpdateExpression")}}return!t&&this.eat(j.starstar)?this.buildBinary(i,a,n,this.parseMaybeUnary(null,!1),"**",!1):n},z.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,r=this.parseExprAtom(e),i="ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);return this.checkExpressionErrors(e)||i?r:this.parseSubscripts(r,t,n)},z.parseSubscripts=function(e,t,n,r){for(var i=this;;)if(i.eat(j.dot)){var a=i.startNodeAt(t,n);a.object=e,a.property=i.parseIdent(!0),a.computed=!1,e=i.finishNode(a,"MemberExpression")}else if(i.eat(j.bracketL)){var o=i.startNodeAt(t,n);o.object=e,o.property=i.parseExpression(),o.computed=!0,i.expect(j.bracketR),e=i.finishNode(o,"MemberExpression")}else if(!r&&i.eat(j.parenL)){var s=i.startNodeAt(t,n);s.callee=e,s.arguments=i.parseExprList(j.parenR,!1),e=i.finishNode(s,"CallExpression")}else{if(i.type!==j.backQuote)return e;var u=i.startNodeAt(t,n);u.tag=e,u.quasi=i.parseTemplate(),e=i.finishNode(u,"TaggedTemplateExpression")}},z.parseExprAtom=function(e){var t,n=this.potentialArrowAt==this.start;switch(this.type){case j._super:this.inFunction||this.raise(this.start,"'super' outside of function or class");case j._this:var r=this.type===j._this?"ThisExpression":"Super";return t=this.startNode(),this.next(),this.finishNode(t,r);case j.name:var i=this.start,a=this.startLoc,o=this.parseIdent(this.type!==j.name);return n&&!this.canInsertSemicolon()&&this.eat(j.arrow)?this.parseArrowExpression(this.startNodeAt(i,a),[o]):o;case j.regexp:var s=this.value;return t=this.parseLiteral(s.value),t.regex={pattern:s.pattern,flags:s.flags},t;case j.num:case j.string:return this.parseLiteral(this.value);case j._null:case j._true:case j._false:return t=this.startNode(),t.value=this.type===j._null?null:this.type===j._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case j.parenL:return this.parseParenAndDistinguishExpression(n);case j.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(j.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case j.braceL:return this.parseObj(!1,e);case j._function:return t=this.startNode(),this.next(),this.parseFunction(t,!1);case j._class:return this.parseClass(this.startNode(),!1);case j._new:return this.parseNew();case j.backQuote:return this.parseTemplate();default:this.unexpected()}},z.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(t,"Literal")},z.parseParenExpression=function(){this.expect(j.parenL);var e=this.parseExpression();return this.expect(j.parenR),e},z.parseParenAndDistinguishExpression=function(e){var t,n=this,r=this.start,i=this.startLoc;if(this.options.ecmaVersion>=6){this.next();for(var a,o,s=this.start,u=this.startLoc,l=[],p=!0,d=new q;this.type!==j.parenR;){if(p?p=!1:n.expect(j.comma),n.type===j.ellipsis){a=n.start,l.push(n.parseParenItem(n.parseRest()));break}n.type!==j.parenL||o||(o=n.start),l.push(n.parseMaybeAssign(!1,d,n.parseParenItem))}var c=this.start,f=this.startLoc;if(this.expect(j.parenR),e&&!this.canInsertSemicolon()&&this.eat(j.arrow))return this.checkPatternErrors(d,!0),o&&this.unexpected(o),this.parseParenArrowList(r,i,l);l.length||this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(d,!0),l.length>1?(t=this.startNodeAt(s,u),t.expressions=l,this.finishNodeAt(t,"SequenceExpression",c,f)):t=l[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(r,i);return y.expression=t,this.finishNode(y,"ParenthesizedExpression")}return t},z.parseParenItem=function(e){return e},z.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var W=[];z.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(j.dot))return e.meta=t,e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty");var n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0),this.eat(j.parenL)?e.arguments=this.parseExprList(j.parenR,!1):e.arguments=W,this.finishNode(e,"NewExpression")},z.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),e.tail=this.type===j.backQuote,this.finishNode(e,"TemplateElement")},z.parseTemplate=function(){var e=this,t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement();for(t.quasis=[n];!n.tail;)e.expect(j.dollarBraceL),t.expressions.push(e.parseExpression()),e.expect(j.braceR),t.quasis.push(n=e.parseTemplateElement());return this.next(),this.finishNode(t,"TemplateLiteral")},z.parseObj=function(e,t){var n=this,r=this.startNode(),i=!0,a={};for(r.properties=[],this.next();!this.eat(j.braceR);){if(i)i=!1;else if(n.expect(j.comma),n.afterTrailingComma(j.braceR))break;var o,s,u,l=n.startNode();n.options.ecmaVersion>=6&&(l.method=!1,l.shorthand=!1,(e||t)&&(s=n.start,u=n.startLoc),e||(o=n.eat(j.star))),n.parsePropertyName(l),n.parsePropertyValue(l,e,o,s,u,t),n.checkPropClash(l,a),r.properties.push(n.finishNode(l,"Property"))}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},z.parsePropertyValue=function(e,t,n,r,i,a){if(this.eat(j.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===j.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n);else if(this.options.ecmaVersion>=5&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&this.type!=j.comma&&this.type!=j.braceR){(n||t)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var o="get"===e.kind?0:1;if(e.value.params.length!==o){var s=e.value.start;"get"===e.kind?this.raiseRecoverable(s,"getter should have no params"):this.raiseRecoverable(s,"setter should have exactly one param")}"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((this.keywords.test(e.key.name)||(this.strict?this.reservedWordsStrictBind:this.reservedWords).test(e.key.name)||this.inGenerator&&"yield"==e.key.name)&&this.raiseRecoverable(e.key.start,"'"+e.key.name+"' can not be used as shorthand property"),e.kind="init",t?e.value=this.parseMaybeDefault(r,i,e.key):this.type===j.eq&&a?(a.shorthandAssign||(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,i,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected()},z.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(j.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(j.bracketR),e.key;e.computed=!1}return e.key=this.type===j.num||this.type===j.string?this.parseExprAtom():this.parseIdent(!0)},z.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=!1,e.expression=!1)},z.parseMethod=function(e){var t=this.startNode(),n=this.inGenerator;return this.inGenerator=e,this.initFunction(t),this.expect(j.parenL),t.params=this.parseBindingList(j.parenR,!1,!1),this.options.ecmaVersion>=6&&(t.generator=e),this.parseFunctionBody(t,!1),this.inGenerator=n,this.finishNode(t,"FunctionExpression")},z.parseArrowExpression=function(e,t){var n=this.inGenerator;return this.inGenerator=!1,this.initFunction(e),e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0),this.inGenerator=n,this.finishNode(e,"ArrowFunctionExpression")},z.parseFunctionBody=function(e,t){var n=t&&this.type!==j.braceL;if(n)e.body=this.parseMaybeAssign(),e.expression=!0;else{var r=this.inFunction,i=this.labels;this.inFunction=!0,this.labels=[],e.body=this.parseBlock(!0),e.expression=!1,this.inFunction=r,this.labels=i}var a=!n&&e.body.body.length&&this.isUseStrict(e.body.body[0])?e.body.body[0]:null;if(this.strict||a){var o=this.strict;this.strict=!0,e.id&&this.checkLVal(e.id,!0),this.checkParams(e,a),this.strict=o}else t&&this.checkParams(e,a)},z.checkParams=function(e,t){for(var n=this,r={},i=0;i<e.params.length;i++)t&&n.options.ecmaVersion>=7&&"Identifier"!==e.params[i].type&&n.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"),n.checkLVal(e.params[i],!0,r)},z.parseExprList=function(e,t,n,r){for(var i=this,a=[],o=!0;!this.eat(e);){if(o)o=!1;else if(i.expect(j.comma),t&&i.afterTrailingComma(e))break;var s;n&&i.type===j.comma?s=null:i.type===j.ellipsis?(s=i.parseSpread(r),i.type===j.comma&&r&&!r.trailingComma&&(r.trailingComma=i.lastTokStart)):s=i.parseMaybeAssign(!1,r),a.push(s)}return a},z.parseIdent=function(e){var t=this.startNode();return e&&"never"==this.options.allowReserved&&(e=!1),this.type===j.name?(!e&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(this.value)&&(this.options.ecmaVersion>=6||-1==this.input.slice(this.start,this.end).indexOf("\\"))&&this.raiseRecoverable(this.start,"The keyword '"+this.value+"' is reserved"),!e&&this.inGenerator&&"yield"===this.value&&this.raiseRecoverable(this.start,"Can not use 'yield' as identifier inside a generator"),t.name=this.value):e&&this.type.keyword?t.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(t,"Identifier")},z.parseYield=function(){var e=this.startNode();return this.next(),this.type==j.semi||this.canInsertSemicolon()||this.type!=j.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(j.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")};var Y=R.prototype;Y.raise=function(e,t){var n=l(this.input,e);t+=" ("+n.line+":"+n.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},Y.raiseRecoverable=Y.raise,Y.curPosition=function(){return this.options.locations?new I(this.curLine,this.pos-this.lineStart):void 0};var X=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new B(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Z=R.prototype;Z.startNode=function(){return new X(this,this.start,this.startLoc)},Z.startNodeAt=function(e,t){return new X(this,e,t)},Z.finishNode=function(e,t){return f.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Z.finishNodeAt=function(e,t,n,r){return f.call(this,e,t,n,r)};var ee=function(e,t,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r},te={b_stat:new ee("{",!1),b_expr:new ee("{",!0),b_tmpl:new ee("${",!0),p_stat:new ee("(",!1),p_expr:new ee("(",!0),q_tmpl:new ee("`",!0,!0,function(e){return e.readTmplToken()}),f_expr:new ee("function",!0)},ne=R.prototype;ne.initialContext=function(){return[te.b_stat]},ne.braceIsBlock=function(e){if(e===j.colon){var t=this.curContext();if(t===te.b_stat||t===te.b_expr)return!t.isExpr}return e===j._return?D.test(this.input.slice(this.lastTokEnd,this.start)):e===j._else||e===j.semi||e===j.eof||e===j.parenR?!0:e==j.braceL?this.curContext()===te.b_stat:!this.exprAllowed},ne.updateContext=function(e){var t,n=this.type;n.keyword&&e==j.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},j.parenR.updateContext=j.braceR.updateContext=function(){if(1==this.context.length)return void(this.exprAllowed=!0);var e=this.context.pop();e===te.b_stat&&this.curContext()===te.f_expr?(this.context.pop(),this.exprAllowed=!1):e===te.b_tmpl?this.exprAllowed=!0:this.exprAllowed=!e.isExpr},j.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?te.b_stat:te.b_expr),this.exprAllowed=!0},j.dollarBraceL.updateContext=function(){this.context.push(te.b_tmpl),this.exprAllowed=!0},j.parenL.updateContext=function(e){var t=e===j._if||e===j._for||e===j._with||e===j._while;this.context.push(t?te.p_stat:te.p_expr),this.exprAllowed=!0},j.incDec.updateContext=function(){},j._function.updateContext=function(e){e.beforeExpr&&e!==j.semi&&e!==j._else&&(e!==j.colon&&e!==j.braceL||this.curContext()!==te.b_stat)&&this.context.push(te.f_expr),this.exprAllowed=!1},j.backQuote.updateContext=function(){this.curContext()===te.q_tmpl?this.context.pop():this.context.push(te.q_tmpl),this.exprAllowed=!1};var re=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new B(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},ie=R.prototype,ae="object"==typeof Packages&&"[object JavaPackage]"==Object.prototype.toString.call(Packages);ie.next=function(){this.options.onToken&&this.options.onToken(new re(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},ie.getToken=function(){return this.next(),new re(this)},"undefined"!=typeof Symbol&&(ie[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===j.eof,value:t}}}}),ie.setStrict=function(e){var t=this;if(this.strict=e,this.type===j.num||this.type===j.string){if(this.pos=this.start,this.options.locations)for(;this.pos<this.lineStart;)t.lineStart=t.input.lastIndexOf("\n",t.lineStart-2)+1,--t.curLine;this.nextToken()}},ie.curContext=function(){return this.context[this.context.length-1]},ie.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(j.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},ie.readToken=function(e){return n(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},ie.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(55295>=e||e>=57344)return e;var t=this.input.charCodeAt(this.pos+1);return(e<<10)+t-56613888},ie.skipBlockComment=function(){var e=this,t=this.options.onComment&&this.curPosition(),n=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(-1===r&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations){G.lastIndex=n;for(var i;(i=G.exec(this.input))&&i.index<this.pos;)++e.curLine,e.lineStart=i.index+i[0].length}this.options.onComment&&this.options.onComment(!0,this.input.slice(n+2,r),n,this.pos,t,this.curPosition())},ie.skipLineComment=function(e){for(var t=this,n=this.pos,r=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&10!==i&&13!==i&&8232!==i&&8233!==i;)++t.pos,i=t.input.charCodeAt(t.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(n+e,this.pos),n,this.pos,r,this.curPosition())},ie.skipSpace=function(){var e=this;e:for(;this.pos<this.input.length;){var t=e.input.charCodeAt(e.pos);switch(t){case 32:case 160:++e.pos;break;case 13:10===e.input.charCodeAt(e.pos+1)&&++e.pos;case 10:case 8232:case 8233:++e.pos,e.options.locations&&(++e.curLine,e.lineStart=e.pos);break;case 47:switch(e.input.charCodeAt(e.pos+1)){case 42:e.skipBlockComment();break;case 47:e.skipLineComment(2);break;default:break e}break;default:if(!(t>8&&14>t||t>=5760&&V.test(String.fromCharCode(t))))break e;++e.pos}}},ie.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},ie.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&57>=e)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(j.ellipsis)):(++this.pos,this.finishToken(j.dot))},ie.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(j.assign,2):this.finishOp(j.slash,1)},ie.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?j.star:j.modulo;return this.options.ecmaVersion>=7&&42===t&&(++n,r=j.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(j.assign,n+1):this.finishOp(r,n)},ie.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?j.logicalOR:j.logicalAND,2):61===t?this.finishOp(j.assign,2):this.finishOp(124===e?j.bitwiseOR:j.bitwiseAND,1)},ie.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(j.assign,2