@pdfme/ui 5.3.11-dev.8 → 5.3.11-dev.9
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.
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -9208,7 +9208,7 @@ function createNode(a) {
|
|
9208
9208
|
function resortChildren(a, s) {
|
9209
9209
|
a.children = a.children.sort((c, u) => {
|
9210
9210
|
var A, v;
|
9211
|
-
const d = s.get((A = c.schema) == null ? void 0 : A.name), p = s.get((v = u.schema) == null ? void 0 : v.name);
|
9211
|
+
const d = s.get(((A = c.schema) == null ? void 0 : A.name) ?? ""), p = s.get(((v = u.schema) == null ? void 0 : v.name) ?? "");
|
9212
9212
|
if (d === void 0 || p === void 0)
|
9213
9213
|
throw new Error("[@pdfme/common] order is not defined");
|
9214
9214
|
return d - p;
|
package/dist/index.umd.js
CHANGED
@@ -47,7 +47,7 @@ ERROR MESSAGE: ${p.message}
|
|
47
47
|
--------------------------`).join(`
|
48
48
|
`);throw Error(`[@pdfme/common] Invalid argument:
|
49
49
|
--------------------------
|
50
|
-
${d}`)}}if(a&&typeof a=="object"&&"template"in a&&"options"in a){const{template:c,options:u}=a;u&&u.font&&checkFont({font:u.font,template:c})}if(a&&typeof a=="object"&&"template"in a&&"plugins"in a){const{template:c,plugins:u}=a;u&&checkPlugins({plugins:u,template:c})}},checkInputs=a=>checkProps(a,Inputs),checkUIOptions=a=>checkProps(a,UIOptions),checkPreviewProps=a=>checkProps(a,PreviewProps),checkDesignerProps=a=>checkProps(a,DesignerProps),checkUIProps=a=>{typeof a=="object"&&a!==null&&"template"in a&&migrateTemplate(a.template),checkProps(a,UIProps)},checkTemplate=a=>{migrateTemplate(a),checkProps(a,Template)};class LayoutNode{constructor({width:s=0,height:c=0}={}){Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"padding",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),this.width=s,this.height=c}setIndex(s){this.index=s}setSchema(s){this.schema=s}setWidth(s){this.width=s}setHeight(s){this.height=s}setPadding(s){this.padding=s}setPosition(s){this.position=s}insertChild(s){const c=this.getChildCount();s.setIndex(c),this.children.splice(c,0,s)}getChildCount(){return this.children.length}getChild(s){return this.children[s]}}function createPage(a){const s=new LayoutNode({...a});return s.setPadding(a.padding),s}function createNode(a){const{position:s,width:c,height:u,schema:d}=a,p=new LayoutNode({width:c,height:u});return p.setPosition(s),p.setSchema(d),p}function resortChildren(a,s){a.children=a.children.sort((c,u)=>{var A,v;const d=s.get((A=c.schema)==null?void 0:A.name),p=s.get((v=u.schema)==null?void 0:v.name);if(d===void 0||p===void 0)throw new Error("[@pdfme/common] order is not defined");return d-p}).map((c,u)=>(c.setIndex(u),c))}async function createOnePage(a){const{basePdf:s,schemaPage:c,orderMap:u,input:d,options:p,_cache:A,getDynamicHeights:v}=a,b=createPage(s),g=[],x=cloneDeep$1(c).sort((m,C)=>m.position.y-C.position.y),y=new Map;for(const m of x){const{position:C,width:S}=m,w={schema:m,basePdf:s,options:p,_cache:A},I=(m.readOnly?m.content:d==null?void 0:d[m.name])||"",T=await v(I,w),$=T.reduce((E,B)=>E+B,0),P=m.height;$!==P&&y.set(C.y+P,$-P),T.forEach((E,B)=>{let R=m.position.y+T.reduce((M,k,D)=>D<B?M+k:M,0);for(const[M,k]of y.entries())M<=m.position.y&&(R+=k);const O=createNode({schema:m,position:{...C,y:R},width:S,height:E});g.push(R+E+s.padding[2]),b.insertChild(O)})}const f=Math.max(...g,s.height-s.padding[2]);return b.setHeight(f),resortChildren(b,u),b}function breakIntoPages(a){const{longPage:s,orderMap:c,basePdf:u}=a,d=[createPage(u)],[p,,A]=u.padding,v=[],b=y=>u.height-A-(y>0?p:0),g=(y,f)=>{var C;const m=y-f*(u.height-p-A);for(;d.length<=f;)d[f]||(d.push(createPage(u)),v.push({page:f,value:(m-p)*-1}));return m+(((C=v.find(S=>S.page===f))==null?void 0:C.value)||0)},x=s.children.sort((y,f)=>y.position.y-f.position.y);for(let y=0;y<x.length;y++){const{schema:f,position:m,height:C,width:S}=x[y],{y:w,x:I}=m;let T=Math.floor(w/b(d.length-1)),$=g(w,T);if($+C>u.height-A&&(T++,$=g(w,T)),!f)throw new Error("[@pdfme/common] schema is undefined");const P=createNode({schema:f,position:{x:I,y:$},width:S,height:C});d[T].insertChild(P)}return d.forEach(y=>resortChildren(y,c)),d}function createNewTemplate(a,s){const c={schemas:Array.from({length:a.length},()=>[]),basePdf:s},u=new Map;return cloneDeep$1(a).forEach((d,p)=>{d.children.forEach(A=>{const{schema:v}=A;if(!v)throw new Error("[@pdfme/common] schema is undefined");const b=v.name;u.has(b)||u.set(b,[]),u.get(b).push(A);const g=d.children.filter(y=>{var f;return((f=y.schema)==null?void 0:f.name)===b}),x=u.get(b).length-g.length;if(g.length>0){if(!g[0].schema)throw new Error("[@pdfme/common] schema is undefined");const y=g[0].schema,f=g.reduce((w,I)=>w+I.height,0),m=g[0].position;y.__bodyRange={start:Math.max(x-1,0),end:x+g.length-1},y.__isSplit=x>0;const C=Object.assign({},y,{position:m,height:f}),S=c.schemas[p].findIndex(w=>w.name===b);S!==-1?c.schemas[p][S]=C:c.schemas[p].push(C)}})}),c}const getDynamicTemplate=async a=>{const{template:s}=a;if(!isBlankPdf(s.basePdf))return s;const c=s.basePdf,u=[];for(const d of s.schemas){const p=new Map(d.map((b,g)=>[b.name,g])),A=await createOnePage({basePdf:c,schemaPage:d,orderMap:p,...a}),v=breakIntoPages({longPage:A,basePdf:c,orderMap:p});u.push(...v)}return createNewTemplate(u,s.basePdf)};var astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,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,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,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,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,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,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,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,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],nonASCIIidentifierChars="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",reservedWords={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",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords="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",keywords$1={5:ecma5AndLessKeywords,"5module":ecma5AndLessKeywords+" export import",6:ecma5AndLessKeywords+" const class extends export import super"},keywordRelationalOperator=/^in(stanceof)?$/,nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]"),nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");function isInAstralSet(a,s){for(var c=65536,u=0;u<s.length;u+=2){if(c+=s[u],c>a)return!1;if(c+=s[u+1],c>=a)return!0}return!1}function isIdentifierStart(a,s){return a<65?a===36:a<91?!0:a<97?a===95:a<123?!0:a<=65535?a>=170&&nonASCIIidentifierStart.test(String.fromCharCode(a)):s===!1?!1:isInAstralSet(a,astralIdentifierStartCodes)}function isIdentifierChar(a,s){return a<48?a===36:a<58?!0:a<65?!1:a<91?!0:a<97?a===95:a<123?!0:a<=65535?a>=170&&nonASCIIidentifier.test(String.fromCharCode(a)):s===!1?!1:isInAstralSet(a,astralIdentifierStartCodes)||isInAstralSet(a,astralIdentifierCodes)}var TokenType=function(s,c){c===void 0&&(c={}),this.label=s,this.keyword=c.keyword,this.beforeExpr=!!c.beforeExpr,this.startsExpr=!!c.startsExpr,this.isLoop=!!c.isLoop,this.isAssign=!!c.isAssign,this.prefix=!!c.prefix,this.postfix=!!c.postfix,this.binop=c.binop||null,this.updateContext=null};function binop(a,s){return new TokenType(a,{beforeExpr:!0,binop:s})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords={};function kw(a,s){return s===void 0&&(s={}),s.keyword=a,keywords[a]=new TokenType(a,s)}var types$1={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),privateId:new TokenType("privateId",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),questionDot:new TokenType("?."),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import",startsExpr),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak=/\r\n?|\n|\u2028|\u2029/,lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(a){return a===10||a===13||a===8232||a===8233}function nextLineBreak(a,s,c){c===void 0&&(c=a.length);for(var u=s;u<c;u++){var d=a.charCodeAt(u);if(isNewLine(d))return u<c-1&&d===13&&a.charCodeAt(u+1)===10?u+2:u+1}return-1}var nonASCIIwhitespace=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref$1=Object.prototype,hasOwnProperty$e=ref$1.hasOwnProperty,toString$1=ref$1.toString,hasOwn=Object.hasOwn||function(a,s){return hasOwnProperty$e.call(a,s)},isArray$3=Array.isArray||function(a){return toString$1.call(a)==="[object Array]"},regexpCache=Object.create(null);function wordsRegexp(a){return regexpCache[a]||(regexpCache[a]=new RegExp("^(?:"+a.replace(/ /g,"|")+")$"))}function codePointToString(a){return a<=65535?String.fromCharCode(a):(a-=65536,String.fromCharCode((a>>10)+55296,(a&1023)+56320))}var loneSurrogate=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Position=function(s,c){this.line=s,this.column=c};Position.prototype.offset=function(s){return new Position(this.line,this.column+s)};var SourceLocation=function(s,c,u){this.start=c,this.end=u,s.sourceFile!==null&&(this.source=s.sourceFile)};function getLineInfo(a,s){for(var c=1,u=0;;){var d=nextLineBreak(a,u,s);if(d<0)return new Position(c,s-u);++c,u=d}}var defaultOptions$1={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},warnedAboutEcmaVersion=!1;function getOptions(a){var s={};for(var c in defaultOptions$1)s[c]=a&&hasOwn(a,c)?a[c]:defaultOptions$1[c];if(s.ecmaVersion==="latest"?s.ecmaVersion=1e8:s.ecmaVersion==null?(!warnedAboutEcmaVersion&&typeof console=="object"&&console.warn&&(warnedAboutEcmaVersion=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
50
|
+
${d}`)}}if(a&&typeof a=="object"&&"template"in a&&"options"in a){const{template:c,options:u}=a;u&&u.font&&checkFont({font:u.font,template:c})}if(a&&typeof a=="object"&&"template"in a&&"plugins"in a){const{template:c,plugins:u}=a;u&&checkPlugins({plugins:u,template:c})}},checkInputs=a=>checkProps(a,Inputs),checkUIOptions=a=>checkProps(a,UIOptions),checkPreviewProps=a=>checkProps(a,PreviewProps),checkDesignerProps=a=>checkProps(a,DesignerProps),checkUIProps=a=>{typeof a=="object"&&a!==null&&"template"in a&&migrateTemplate(a.template),checkProps(a,UIProps)},checkTemplate=a=>{migrateTemplate(a),checkProps(a,Template)};class LayoutNode{constructor({width:s=0,height:c=0}={}){Object.defineProperty(this,"index",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"padding",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),this.width=s,this.height=c}setIndex(s){this.index=s}setSchema(s){this.schema=s}setWidth(s){this.width=s}setHeight(s){this.height=s}setPadding(s){this.padding=s}setPosition(s){this.position=s}insertChild(s){const c=this.getChildCount();s.setIndex(c),this.children.splice(c,0,s)}getChildCount(){return this.children.length}getChild(s){return this.children[s]}}function createPage(a){const s=new LayoutNode({...a});return s.setPadding(a.padding),s}function createNode(a){const{position:s,width:c,height:u,schema:d}=a,p=new LayoutNode({width:c,height:u});return p.setPosition(s),p.setSchema(d),p}function resortChildren(a,s){a.children=a.children.sort((c,u)=>{var A,v;const d=s.get(((A=c.schema)==null?void 0:A.name)??""),p=s.get(((v=u.schema)==null?void 0:v.name)??"");if(d===void 0||p===void 0)throw new Error("[@pdfme/common] order is not defined");return d-p}).map((c,u)=>(c.setIndex(u),c))}async function createOnePage(a){const{basePdf:s,schemaPage:c,orderMap:u,input:d,options:p,_cache:A,getDynamicHeights:v}=a,b=createPage(s),g=[],x=cloneDeep$1(c).sort((m,C)=>m.position.y-C.position.y),y=new Map;for(const m of x){const{position:C,width:S}=m,w={schema:m,basePdf:s,options:p,_cache:A},I=(m.readOnly?m.content:d==null?void 0:d[m.name])||"",T=await v(I,w),$=T.reduce((E,B)=>E+B,0),P=m.height;$!==P&&y.set(C.y+P,$-P),T.forEach((E,B)=>{let R=m.position.y+T.reduce((M,k,D)=>D<B?M+k:M,0);for(const[M,k]of y.entries())M<=m.position.y&&(R+=k);const O=createNode({schema:m,position:{...C,y:R},width:S,height:E});g.push(R+E+s.padding[2]),b.insertChild(O)})}const f=Math.max(...g,s.height-s.padding[2]);return b.setHeight(f),resortChildren(b,u),b}function breakIntoPages(a){const{longPage:s,orderMap:c,basePdf:u}=a,d=[createPage(u)],[p,,A]=u.padding,v=[],b=y=>u.height-A-(y>0?p:0),g=(y,f)=>{var C;const m=y-f*(u.height-p-A);for(;d.length<=f;)d[f]||(d.push(createPage(u)),v.push({page:f,value:(m-p)*-1}));return m+(((C=v.find(S=>S.page===f))==null?void 0:C.value)||0)},x=s.children.sort((y,f)=>y.position.y-f.position.y);for(let y=0;y<x.length;y++){const{schema:f,position:m,height:C,width:S}=x[y],{y:w,x:I}=m;let T=Math.floor(w/b(d.length-1)),$=g(w,T);if($+C>u.height-A&&(T++,$=g(w,T)),!f)throw new Error("[@pdfme/common] schema is undefined");const P=createNode({schema:f,position:{x:I,y:$},width:S,height:C});d[T].insertChild(P)}return d.forEach(y=>resortChildren(y,c)),d}function createNewTemplate(a,s){const c={schemas:Array.from({length:a.length},()=>[]),basePdf:s},u=new Map;return cloneDeep$1(a).forEach((d,p)=>{d.children.forEach(A=>{const{schema:v}=A;if(!v)throw new Error("[@pdfme/common] schema is undefined");const b=v.name;u.has(b)||u.set(b,[]),u.get(b).push(A);const g=d.children.filter(y=>{var f;return((f=y.schema)==null?void 0:f.name)===b}),x=u.get(b).length-g.length;if(g.length>0){if(!g[0].schema)throw new Error("[@pdfme/common] schema is undefined");const y=g[0].schema,f=g.reduce((w,I)=>w+I.height,0),m=g[0].position;y.__bodyRange={start:Math.max(x-1,0),end:x+g.length-1},y.__isSplit=x>0;const C=Object.assign({},y,{position:m,height:f}),S=c.schemas[p].findIndex(w=>w.name===b);S!==-1?c.schemas[p][S]=C:c.schemas[p].push(C)}})}),c}const getDynamicTemplate=async a=>{const{template:s}=a;if(!isBlankPdf(s.basePdf))return s;const c=s.basePdf,u=[];for(const d of s.schemas){const p=new Map(d.map((b,g)=>[b.name,g])),A=await createOnePage({basePdf:c,schemaPage:d,orderMap:p,...a}),v=breakIntoPages({longPage:A,basePdf:c,orderMap:p});u.push(...v)}return createNewTemplate(u,s.basePdf)};var astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,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,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,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,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,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,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,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,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,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,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],nonASCIIidentifierChars="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",reservedWords={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",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords="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",keywords$1={5:ecma5AndLessKeywords,"5module":ecma5AndLessKeywords+" export import",6:ecma5AndLessKeywords+" const class extends export import super"},keywordRelationalOperator=/^in(stanceof)?$/,nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]"),nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");function isInAstralSet(a,s){for(var c=65536,u=0;u<s.length;u+=2){if(c+=s[u],c>a)return!1;if(c+=s[u+1],c>=a)return!0}return!1}function isIdentifierStart(a,s){return a<65?a===36:a<91?!0:a<97?a===95:a<123?!0:a<=65535?a>=170&&nonASCIIidentifierStart.test(String.fromCharCode(a)):s===!1?!1:isInAstralSet(a,astralIdentifierStartCodes)}function isIdentifierChar(a,s){return a<48?a===36:a<58?!0:a<65?!1:a<91?!0:a<97?a===95:a<123?!0:a<=65535?a>=170&&nonASCIIidentifier.test(String.fromCharCode(a)):s===!1?!1:isInAstralSet(a,astralIdentifierStartCodes)||isInAstralSet(a,astralIdentifierCodes)}var TokenType=function(s,c){c===void 0&&(c={}),this.label=s,this.keyword=c.keyword,this.beforeExpr=!!c.beforeExpr,this.startsExpr=!!c.startsExpr,this.isLoop=!!c.isLoop,this.isAssign=!!c.isAssign,this.prefix=!!c.prefix,this.postfix=!!c.postfix,this.binop=c.binop||null,this.updateContext=null};function binop(a,s){return new TokenType(a,{beforeExpr:!0,binop:s})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords={};function kw(a,s){return s===void 0&&(s={}),s.keyword=a,keywords[a]=new TokenType(a,s)}var types$1={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),privateId:new TokenType("privateId",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),questionDot:new TokenType("?."),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import",startsExpr),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak=/\r\n?|\n|\u2028|\u2029/,lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(a){return a===10||a===13||a===8232||a===8233}function nextLineBreak(a,s,c){c===void 0&&(c=a.length);for(var u=s;u<c;u++){var d=a.charCodeAt(u);if(isNewLine(d))return u<c-1&&d===13&&a.charCodeAt(u+1)===10?u+2:u+1}return-1}var nonASCIIwhitespace=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref$1=Object.prototype,hasOwnProperty$e=ref$1.hasOwnProperty,toString$1=ref$1.toString,hasOwn=Object.hasOwn||function(a,s){return hasOwnProperty$e.call(a,s)},isArray$3=Array.isArray||function(a){return toString$1.call(a)==="[object Array]"},regexpCache=Object.create(null);function wordsRegexp(a){return regexpCache[a]||(regexpCache[a]=new RegExp("^(?:"+a.replace(/ /g,"|")+")$"))}function codePointToString(a){return a<=65535?String.fromCharCode(a):(a-=65536,String.fromCharCode((a>>10)+55296,(a&1023)+56320))}var loneSurrogate=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Position=function(s,c){this.line=s,this.column=c};Position.prototype.offset=function(s){return new Position(this.line,this.column+s)};var SourceLocation=function(s,c,u){this.start=c,this.end=u,s.sourceFile!==null&&(this.source=s.sourceFile)};function getLineInfo(a,s){for(var c=1,u=0;;){var d=nextLineBreak(a,u,s);if(d<0)return new Position(c,s-u);++c,u=d}}var defaultOptions$1={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},warnedAboutEcmaVersion=!1;function getOptions(a){var s={};for(var c in defaultOptions$1)s[c]=a&&hasOwn(a,c)?a[c]:defaultOptions$1[c];if(s.ecmaVersion==="latest"?s.ecmaVersion=1e8:s.ecmaVersion==null?(!warnedAboutEcmaVersion&&typeof console=="object"&&console.warn&&(warnedAboutEcmaVersion=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
51
51
|
Defaulting to 2020, but this will stop working in the future.`)),s.ecmaVersion=11):s.ecmaVersion>=2015&&(s.ecmaVersion-=2009),s.allowReserved==null&&(s.allowReserved=s.ecmaVersion<5),(!a||a.allowHashBang==null)&&(s.allowHashBang=s.ecmaVersion>=14),isArray$3(s.onToken)){var u=s.onToken;s.onToken=function(d){return u.push(d)}}return isArray$3(s.onComment)&&(s.onComment=pushComment(s,s.onComment)),s}function pushComment(a,s){return function(c,u,d,p,A,v){var b={type:c?"Block":"Line",value:u,start:d,end:p};a.locations&&(b.loc=new SourceLocation(this,A,v)),a.ranges&&(b.range=[d,p]),s.push(b)}}var SCOPE_TOP=1,SCOPE_FUNCTION=2,SCOPE_ASYNC=4,SCOPE_GENERATOR=8,SCOPE_ARROW=16,SCOPE_SIMPLE_CATCH=32,SCOPE_SUPER=64,SCOPE_DIRECT_SUPER=128,SCOPE_CLASS_STATIC_BLOCK=256,SCOPE_VAR=SCOPE_TOP|SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK;function functionFlags(a,s){return SCOPE_FUNCTION|(a?SCOPE_ASYNC:0)|(s?SCOPE_GENERATOR:0)}var BIND_NONE=0,BIND_VAR=1,BIND_LEXICAL=2,BIND_FUNCTION=3,BIND_SIMPLE_CATCH=4,BIND_OUTSIDE=5,Parser=function(s,c,u){this.options=s=getOptions(s),this.sourceFile=s.sourceFile,this.keywords=wordsRegexp(keywords$1[s.ecmaVersion>=6?6:s.sourceType==="module"?"5module":5]);var d="";s.allowReserved!==!0&&(d=reservedWords[s.ecmaVersion>=6?6:s.ecmaVersion===5?5:3],s.sourceType==="module"&&(d+=" await")),this.reservedWords=wordsRegexp(d);var p=(d?d+" ":"")+reservedWords.strict;this.reservedWordsStrict=wordsRegexp(p),this.reservedWordsStrictBind=wordsRegexp(p+" "+reservedWords.strictBind),this.input=String(c),this.containsEsc=!1,u?(this.pos=u,this.lineStart=this.input.lastIndexOf(`
|
52
52
|
`,u-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(lineBreak).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=types$1.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.inModule=s.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&s.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(SCOPE_TOP),this.regexpState=null,this.privateNameStack=[]},prototypeAccessors={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};Parser.prototype.parse=function(){var s=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(s)},prototypeAccessors.inFunction.get=function(){return(this.currentVarScope().flags&SCOPE_FUNCTION)>0},prototypeAccessors.inGenerator.get=function(){return(this.currentVarScope().flags&SCOPE_GENERATOR)>0&&!this.currentVarScope().inClassFieldInit},prototypeAccessors.inAsync.get=function(){return(this.currentVarScope().flags&SCOPE_ASYNC)>0&&!this.currentVarScope().inClassFieldInit},prototypeAccessors.canAwait.get=function(){for(var a=this.scopeStack.length-1;a>=0;a--){var s=this.scopeStack[a];if(s.inClassFieldInit||s.flags&SCOPE_CLASS_STATIC_BLOCK)return!1;if(s.flags&SCOPE_FUNCTION)return(s.flags&SCOPE_ASYNC)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},prototypeAccessors.allowSuper.get=function(){var a=this.currentThisScope(),s=a.flags,c=a.inClassFieldInit;return(s&SCOPE_SUPER)>0||c||this.options.allowSuperOutsideMethod},prototypeAccessors.allowDirectSuper.get=function(){return(this.currentThisScope().flags&SCOPE_DIRECT_SUPER)>0},prototypeAccessors.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},prototypeAccessors.allowNewDotTarget.get=function(){var a=this.currentThisScope(),s=a.flags,c=a.inClassFieldInit;return(s&(SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK))>0||c},prototypeAccessors.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&SCOPE_CLASS_STATIC_BLOCK)>0},Parser.extend=function(){for(var s=[],c=arguments.length;c--;)s[c]=arguments[c];for(var u=this,d=0;d<s.length;d++)u=s[d](u);return u},Parser.parse=function(s,c){return new this(c,s).parse()},Parser.parseExpressionAt=function(s,c,u){var d=new this(u,s,c);return d.nextToken(),d.parseExpression()},Parser.tokenizer=function(s,c){return new this(c,s)},Object.defineProperties(Parser.prototype,prototypeAccessors);var pp$9=Parser.prototype,literal=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;pp$9.strictDirective=function(a){if(this.options.ecmaVersion<5)return!1;for(;;){skipWhiteSpace.lastIndex=a,a+=skipWhiteSpace.exec(this.input)[0].length;var s=literal.exec(this.input.slice(a));if(!s)return!1;if((s[1]||s[2])==="use strict"){skipWhiteSpace.lastIndex=a+s[0].length;var c=skipWhiteSpace.exec(this.input),u=c.index+c[0].length,d=this.input.charAt(u);return d===";"||d==="}"||lineBreak.test(c[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(d)||d==="!"&&this.input.charAt(u+1)==="=")}a+=s[0].length,skipWhiteSpace.lastIndex=a,a+=skipWhiteSpace.exec(this.input)[0].length,this.input[a]===";"&&a++}},pp$9.eat=function(a){return this.type===a?(this.next(),!0):!1},pp$9.isContextual=function(a){return this.type===types$1.name&&this.value===a&&!this.containsEsc},pp$9.eatContextual=function(a){return this.isContextual(a)?(this.next(),!0):!1},pp$9.expectContextual=function(a){this.eatContextual(a)||this.unexpected()},pp$9.canInsertSemicolon=function(){return this.type===types$1.eof||this.type===types$1.braceR||lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},pp$9.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},pp$9.semicolon=function(){!this.eat(types$1.semi)&&!this.insertSemicolon()&&this.unexpected()},pp$9.afterTrailingComma=function(a,s){if(this.type===a)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),s||this.next(),!0},pp$9.expect=function(a){this.eat(a)||this.unexpected()},pp$9.unexpected=function(a){this.raise(a??this.start,"Unexpected token")};var DestructuringErrors=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};pp$9.checkPatternErrors=function(a,s){if(a){a.trailingComma>-1&&this.raiseRecoverable(a.trailingComma,"Comma is not permitted after the rest element");var c=s?a.parenthesizedAssign:a.parenthesizedBind;c>-1&&this.raiseRecoverable(c,s?"Assigning to rvalue":"Parenthesized pattern")}},pp$9.checkExpressionErrors=function(a,s){if(!a)return!1;var c=a.shorthandAssign,u=a.doubleProto;if(!s)return c>=0||u>=0;c>=0&&this.raise(c,"Shorthand property assignments are valid only in destructuring patterns"),u>=0&&this.raiseRecoverable(u,"Redefinition of __proto__ property")},pp$9.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},pp$9.isSimpleAssignTarget=function(a){return a.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(a.expression):a.type==="Identifier"||a.type==="MemberExpression"};var pp$8=Parser.prototype;pp$8.parseTopLevel=function(a){var s=Object.create(null);for(a.body||(a.body=[]);this.type!==types$1.eof;){var c=this.parseStatement(null,!0,s);a.body.push(c)}if(this.inModule)for(var u=0,d=Object.keys(this.undefinedExports);u<d.length;u+=1){var p=d[u];this.raiseRecoverable(this.undefinedExports[p].start,"Export '"+p+"' is not defined")}return this.adaptDirectivePrologue(a.body),this.next(),a.sourceType=this.options.sourceType,this.finishNode(a,"Program")};var loopLabel={kind:"loop"},switchLabel={kind:"switch"};pp$8.isLet=function(a){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;skipWhiteSpace.lastIndex=this.pos;var s=skipWhiteSpace.exec(this.input),c=this.pos+s[0].length,u=this.input.charCodeAt(c);if(u===91||u===92)return!0;if(a)return!1;if(u===123||u>55295&&u<56320)return!0;if(isIdentifierStart(u,!0)){for(var d=c+1;isIdentifierChar(u=this.input.charCodeAt(d),!0);)++d;if(u===92||u>55295&&u<56320)return!0;var p=this.input.slice(c,d);if(!keywordRelationalOperator.test(p))return!0}return!1},pp$8.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;skipWhiteSpace.lastIndex=this.pos;var a=skipWhiteSpace.exec(this.input),s=this.pos+a[0].length,c;return!lineBreak.test(this.input.slice(this.pos,s))&&this.input.slice(s,s+8)==="function"&&(s+8===this.input.length||!(isIdentifierChar(c=this.input.charCodeAt(s+8))||c>55295&&c<56320))},pp$8.parseStatement=function(a,s,c){var u=this.type,d=this.startNode(),p;switch(this.isLet(a)&&(u=types$1._var,p="let"),u){case types$1._break:case types$1._continue:return this.parseBreakContinueStatement(d,u.keyword);case types$1._debugger:return this.parseDebuggerStatement(d);case types$1._do:return this.parseDoStatement(d);case types$1._for:return this.parseForStatement(d);case types$1._function:return a&&(this.strict||a!=="if"&&a!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(d,!1,!a);case types$1._class:return a&&this.unexpected(),this.parseClass(d,!0);case types$1._if:return this.parseIfStatement(d);case types$1._return:return this.parseReturnStatement(d);case types$1._switch:return this.parseSwitchStatement(d);case types$1._throw:return this.parseThrowStatement(d);case types$1._try:return this.parseTryStatement(d);case types$1._const:case types$1._var:return p=p||this.value,a&&p!=="var"&&this.unexpected(),this.parseVarStatement(d,p);case types$1._while:return this.parseWhileStatement(d);case types$1._with:return this.parseWithStatement(d);case types$1.braceL:return this.parseBlock(!0,d);case types$1.semi:return this.parseEmptyStatement(d);case types$1._export:case types$1._import:if(this.options.ecmaVersion>10&&u===types$1._import){skipWhiteSpace.lastIndex=this.pos;var A=skipWhiteSpace.exec(this.input),v=this.pos+A[0].length,b=this.input.charCodeAt(v);if(b===40||b===46)return this.parseExpressionStatement(d,this.parseExpression())}return this.options.allowImportExportEverywhere||(s||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'")),u===types$1._import?this.parseImport(d):this.parseExport(d,c);default:if(this.isAsyncFunction())return a&&this.unexpected(),this.next(),this.parseFunctionStatement(d,!0,!a);var g=this.value,x=this.parseExpression();return u===types$1.name&&x.type==="Identifier"&&this.eat(types$1.colon)?this.parseLabeledStatement(d,g,x,a):this.parseExpressionStatement(d,x)}},pp$8.parseBreakContinueStatement=function(a,s){var c=s==="break";this.next(),this.eat(types$1.semi)||this.insertSemicolon()?a.label=null:this.type!==types$1.name?this.unexpected():(a.label=this.parseIdent(),this.semicolon());for(var u=0;u<this.labels.length;++u){var d=this.labels[u];if((a.label==null||d.name===a.label.name)&&(d.kind!=null&&(c||d.kind==="loop")||a.label&&c))break}return u===this.labels.length&&this.raise(a.start,"Unsyntactic "+s),this.finishNode(a,c?"BreakStatement":"ContinueStatement")},pp$8.parseDebuggerStatement=function(a){return this.next(),this.semicolon(),this.finishNode(a,"DebuggerStatement")},pp$8.parseDoStatement=function(a){return this.next(),this.labels.push(loopLabel),a.body=this.parseStatement("do"),this.labels.pop(),this.expect(types$1._while),a.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(types$1.semi):this.semicolon(),this.finishNode(a,"DoWhileStatement")},pp$8.parseForStatement=function(a){this.next();var s=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(loopLabel),this.enterScope(0),this.expect(types$1.parenL),this.type===types$1.semi)return s>-1&&this.unexpected(s),this.parseFor(a,null);var c=this.isLet();if(this.type===types$1._var||this.type===types$1._const||c){var u=this.startNode(),d=c?"let":this.value;return this.next(),this.parseVar(u,!0,d),this.finishNode(u,"VariableDeclaration"),(this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&u.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===types$1._in?s>-1&&this.unexpected(s):a.await=s>-1),this.parseForIn(a,u)):(s>-1&&this.unexpected(s),this.parseFor(a,u))}var p=this.isContextual("let"),A=!1,v=this.containsEsc,b=new DestructuringErrors,g=this.start,x=s>-1?this.parseExprSubscripts(b,"await"):this.parseExpression(!0,b);return this.type===types$1._in||(A=this.options.ecmaVersion>=6&&this.isContextual("of"))?(s>-1?(this.type===types$1._in&&this.unexpected(s),a.await=!0):A&&this.options.ecmaVersion>=8&&(x.start===g&&!v&&x.type==="Identifier"&&x.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(a.await=!1)),p&&A&&this.raise(x.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(x,!1,b),this.checkLValPattern(x),this.parseForIn(a,x)):(this.checkExpressionErrors(b,!0),s>-1&&this.unexpected(s),this.parseFor(a,x))},pp$8.parseFunctionStatement=function(a,s,c){return this.next(),this.parseFunction(a,FUNC_STATEMENT|(c?0:FUNC_HANGING_STATEMENT),!1,s)},pp$8.parseIfStatement=function(a){return this.next(),a.test=this.parseParenExpression(),a.consequent=this.parseStatement("if"),a.alternate=this.eat(types$1._else)?this.parseStatement("if"):null,this.finishNode(a,"IfStatement")},pp$8.parseReturnStatement=function(a){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(types$1.semi)||this.insertSemicolon()?a.argument=null:(a.argument=this.parseExpression(),this.semicolon()),this.finishNode(a,"ReturnStatement")},pp$8.parseSwitchStatement=function(a){this.next(),a.discriminant=this.parseParenExpression(),a.cases=[],this.expect(types$1.braceL),this.labels.push(switchLabel),this.enterScope(0);for(var s,c=!1;this.type!==types$1.braceR;)if(this.type===types$1._case||this.type===types$1._default){var u=this.type===types$1._case;s&&this.finishNode(s,"SwitchCase"),a.cases.push(s=this.startNode()),s.consequent=[],this.next(),u?s.test=this.parseExpression():(c&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),c=!0,s.test=null),this.expect(types$1.colon)}else s||this.unexpected(),s.consequent.push(this.parseStatement(null));return this.exitScope(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(a,"SwitchStatement")},pp$8.parseThrowStatement=function(a){return this.next(),lineBreak.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),a.argument=this.parseExpression(),this.semicolon(),this.finishNode(a,"ThrowStatement")};var empty$1=[];pp$8.parseCatchClauseParam=function(){var a=this.parseBindingAtom(),s=a.type==="Identifier";return this.enterScope(s?SCOPE_SIMPLE_CATCH:0),this.checkLValPattern(a,s?BIND_SIMPLE_CATCH:BIND_LEXICAL),this.expect(types$1.parenR),a},pp$8.parseTryStatement=function(a){if(this.next(),a.block=this.parseBlock(),a.handler=null,this.type===types$1._catch){var s=this.startNode();this.next(),this.eat(types$1.parenL)?s.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),s.param=null,this.enterScope(0)),s.body=this.parseBlock(!1),this.exitScope(),a.handler=this.finishNode(s,"CatchClause")}return a.finalizer=this.eat(types$1._finally)?this.parseBlock():null,!a.handler&&!a.finalizer&&this.raise(a.start,"Missing catch or finally clause"),this.finishNode(a,"TryStatement")},pp$8.parseVarStatement=function(a,s,c){return this.next(),this.parseVar(a,!1,s,c),this.semicolon(),this.finishNode(a,"VariableDeclaration")},pp$8.parseWhileStatement=function(a){return this.next(),a.test=this.parseParenExpression(),this.labels.push(loopLabel),a.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(a,"WhileStatement")},pp$8.parseWithStatement=function(a){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),a.object=this.parseParenExpression(),a.body=this.parseStatement("with"),this.finishNode(a,"WithStatement")},pp$8.parseEmptyStatement=function(a){return this.next(),this.finishNode(a,"EmptyStatement")},pp$8.parseLabeledStatement=function(a,s,c,u){for(var d=0,p=this.labels;d<p.length;d+=1){var A=p[d];A.name===s&&this.raise(c.start,"Label '"+s+"' is already declared")}for(var v=this.type.isLoop?"loop":this.type===types$1._switch?"switch":null,b=this.labels.length-1;b>=0;b--){var g=this.labels[b];if(g.statementStart===a.start)g.statementStart=this.start,g.kind=v;else break}return this.labels.push({name:s,kind:v,statementStart:this.start}),a.body=this.parseStatement(u?u.indexOf("label")===-1?u+"label":u:"label"),this.labels.pop(),a.label=c,this.finishNode(a,"LabeledStatement")},pp$8.parseExpressionStatement=function(a,s){return a.expression=s,this.semicolon(),this.finishNode(a,"ExpressionStatement")},pp$8.parseBlock=function(a,s,c){for(a===void 0&&(a=!0),s===void 0&&(s=this.startNode()),s.body=[],this.expect(types$1.braceL),a&&this.enterScope(0);this.type!==types$1.braceR;){var u=this.parseStatement(null);s.body.push(u)}return c&&(this.strict=!1),this.next(),a&&this.exitScope(),this.finishNode(s,"BlockStatement")},pp$8.parseFor=function(a,s){return a.init=s,this.expect(types$1.semi),a.test=this.type===types$1.semi?null:this.parseExpression(),this.expect(types$1.semi),a.update=this.type===types$1.parenR?null:this.parseExpression(),this.expect(types$1.parenR),a.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(a,"ForStatement")},pp$8.parseForIn=function(a,s){var c=this.type===types$1._in;return this.next(),s.type==="VariableDeclaration"&&s.declarations[0].init!=null&&(!c||this.options.ecmaVersion<8||this.strict||s.kind!=="var"||s.declarations[0].id.type!=="Identifier")&&this.raise(s.start,(c?"for-in":"for-of")+" loop variable declaration may not have an initializer"),a.left=s,a.right=c?this.parseExpression():this.parseMaybeAssign(),this.expect(types$1.parenR),a.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(a,c?"ForInStatement":"ForOfStatement")},pp$8.parseVar=function(a,s,c,u){for(a.declarations=[],a.kind=c;;){var d=this.startNode();if(this.parseVarId(d,c),this.eat(types$1.eq)?d.init=this.parseMaybeAssign(s):!u&&c==="const"&&!(this.type===types$1._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!u&&d.id.type!=="Identifier"&&!(s&&(this.type===types$1._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):d.init=null,a.declarations.push(this.finishNode(d,"VariableDeclarator")),!this.eat(types$1.comma))break}return a},pp$8.parseVarId=function(a,s){a.id=this.parseBindingAtom(),this.checkLValPattern(a.id,s==="var"?BIND_VAR:BIND_LEXICAL,!1)};var FUNC_STATEMENT=1,FUNC_HANGING_STATEMENT=2,FUNC_NULLABLE_ID=4;pp$8.parseFunction=function(a,s,c,u,d){this.initFunction(a),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!u)&&(this.type===types$1.star&&s&FUNC_HANGING_STATEMENT&&this.unexpected(),a.generator=this.eat(types$1.star)),this.options.ecmaVersion>=8&&(a.async=!!u),s&FUNC_STATEMENT&&(a.id=s&FUNC_NULLABLE_ID&&this.type!==types$1.name?null:this.parseIdent(),a.id&&!(s&FUNC_HANGING_STATEMENT)&&this.checkLValSimple(a.id,this.strict||a.generator||a.async?this.treatFunctionsAsVar?BIND_VAR:BIND_LEXICAL:BIND_FUNCTION));var p=this.yieldPos,A=this.awaitPos,v=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(functionFlags(a.async,a.generator)),s&FUNC_STATEMENT||(a.id=this.type===types$1.name?this.parseIdent():null),this.parseFunctionParams(a),this.parseFunctionBody(a,c,!1,d),this.yieldPos=p,this.awaitPos=A,this.awaitIdentPos=v,this.finishNode(a,s&FUNC_STATEMENT?"FunctionDeclaration":"FunctionExpression")},pp$8.parseFunctionParams=function(a){this.expect(types$1.parenL),a.params=this.parseBindingList(types$1.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},pp$8.parseClass=function(a,s){this.next();var c=this.strict;this.strict=!0,this.parseClassId(a,s),this.parseClassSuper(a);var u=this.enterClassBody(),d=this.startNode(),p=!1;for(d.body=[],this.expect(types$1.braceL);this.type!==types$1.braceR;){var A=this.parseClassElement(a.superClass!==null);A&&(d.body.push(A),A.type==="MethodDefinition"&&A.kind==="constructor"?(p&&this.raiseRecoverable(A.start,"Duplicate constructor in the same class"),p=!0):A.key&&A.key.type==="PrivateIdentifier"&&isPrivateNameConflicted(u,A)&&this.raiseRecoverable(A.key.start,"Identifier '#"+A.key.name+"' has already been declared"))}return this.strict=c,this.next(),a.body=this.finishNode(d,"ClassBody"),this.exitClassBody(),this.finishNode(a,s?"ClassDeclaration":"ClassExpression")},pp$8.parseClassElement=function(a){if(this.eat(types$1.semi))return null;var s=this.options.ecmaVersion,c=this.startNode(),u="",d=!1,p=!1,A="method",v=!1;if(this.eatContextual("static")){if(s>=13&&this.eat(types$1.braceL))return this.parseClassStaticBlock(c),c;this.isClassElementNameStart()||this.type===types$1.star?v=!0:u="static"}if(c.static=v,!u&&s>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===types$1.star)&&!this.canInsertSemicolon()?p=!0:u="async"),!u&&(s>=9||!p)&&this.eat(types$1.star)&&(d=!0),!u&&!p&&!d){var b=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?A=b:u=b)}if(u?(c.computed=!1,c.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),c.key.name=u,this.finishNode(c.key,"Identifier")):this.parseClassElementName(c),s<13||this.type===types$1.parenL||A!=="method"||d||p){var g=!c.static&&checkKeyName(c,"constructor"),x=g&&a;g&&A!=="method"&&this.raise(c.key.start,"Constructor can't have get/set modifier"),c.kind=g?"constructor":A,this.parseClassMethod(c,d,p,x)}else this.parseClassField(c);return c},pp$8.isClassElementNameStart=function(){return this.type===types$1.name||this.type===types$1.privateId||this.type===types$1.num||this.type===types$1.string||this.type===types$1.bracketL||this.type.keyword},pp$8.parseClassElementName=function(a){this.type===types$1.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),a.computed=!1,a.key=this.parsePrivateIdent()):this.parsePropertyName(a)},pp$8.parseClassMethod=function(a,s,c,u){var d=a.key;a.kind==="constructor"?(s&&this.raise(d.start,"Constructor can't be a generator"),c&&this.raise(d.start,"Constructor can't be an async method")):a.static&&checkKeyName(a,"prototype")&&this.raise(d.start,"Classes may not have a static property named prototype");var p=a.value=this.parseMethod(s,c,u);return a.kind==="get"&&p.params.length!==0&&this.raiseRecoverable(p.start,"getter should have no params"),a.kind==="set"&&p.params.length!==1&&this.raiseRecoverable(p.start,"setter should have exactly one param"),a.kind==="set"&&p.params[0].type==="RestElement"&&this.raiseRecoverable(p.params[0].start,"Setter cannot use rest params"),this.finishNode(a,"MethodDefinition")},pp$8.parseClassField=function(a){if(checkKeyName(a,"constructor")?this.raise(a.key.start,"Classes can't have a field named 'constructor'"):a.static&&checkKeyName(a,"prototype")&&this.raise(a.key.start,"Classes can't have a static field named 'prototype'"),this.eat(types$1.eq)){var s=this.currentThisScope(),c=s.inClassFieldInit;s.inClassFieldInit=!0,a.value=this.parseMaybeAssign(),s.inClassFieldInit=c}else a.value=null;return this.semicolon(),this.finishNode(a,"PropertyDefinition")},pp$8.parseClassStaticBlock=function(a){a.body=[];var s=this.labels;for(this.labels=[],this.enterScope(SCOPE_CLASS_STATIC_BLOCK|SCOPE_SUPER);this.type!==types$1.braceR;){var c=this.parseStatement(null);a.body.push(c)}return this.next(),this.exitScope(),this.labels=s,this.finishNode(a,"StaticBlock")},pp$8.parseClassId=function(a,s){this.type===types$1.name?(a.id=this.parseIdent(),s&&this.checkLValSimple(a.id,BIND_LEXICAL,!1)):(s===!0&&this.unexpected(),a.id=null)},pp$8.parseClassSuper=function(a){a.superClass=this.eat(types$1._extends)?this.parseExprSubscripts(null,!1):null},pp$8.enterClassBody=function(){var a={declared:Object.create(null),used:[]};return this.privateNameStack.push(a),a.declared},pp$8.exitClassBody=function(){var a=this.privateNameStack.pop(),s=a.declared,c=a.used;if(this.options.checkPrivateFields)for(var u=this.privateNameStack.length,d=u===0?null:this.privateNameStack[u-1],p=0;p<c.length;++p){var A=c[p];hasOwn(s,A.name)||(d?d.used.push(A):this.raiseRecoverable(A.start,"Private field '#"+A.name+"' must be declared in an enclosing class"))}};function isPrivateNameConflicted(a,s){var c=s.key.name,u=a[c],d="true";return s.type==="MethodDefinition"&&(s.kind==="get"||s.kind==="set")&&(d=(s.static?"s":"i")+s.kind),u==="iget"&&d==="iset"||u==="iset"&&d==="iget"||u==="sget"&&d==="sset"||u==="sset"&&d==="sget"?(a[c]="true",!1):u?!0:(a[c]=d,!1)}function checkKeyName(a,s){var c=a.computed,u=a.key;return!c&&(u.type==="Identifier"&&u.name===s||u.type==="Literal"&&u.value===s)}pp$8.parseExportAllDeclaration=function(a,s){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(a.exported=this.parseModuleExportName(),this.checkExport(s,a.exported,this.lastTokStart)):a.exported=null),this.expectContextual("from"),this.type!==types$1.string&&this.unexpected(),a.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(a.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(a,"ExportAllDeclaration")},pp$8.parseExport=function(a,s){if(this.next(),this.eat(types$1.star))return this.parseExportAllDeclaration(a,s);if(this.eat(types$1._default))return this.checkExport(s,"default",this.lastTokStart),a.declaration=this.parseExportDefaultDeclaration(),this.finishNode(a,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())a.declaration=this.parseExportDeclaration(a),a.declaration.type==="VariableDeclaration"?this.checkVariableExport(s,a.declaration.declarations):this.checkExport(s,a.declaration.id,a.declaration.id.start),a.specifiers=[],a.source=null;else{if(a.declaration=null,a.specifiers=this.parseExportSpecifiers(s),this.eatContextual("from"))this.type!==types$1.string&&this.unexpected(),a.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(a.attributes=this.parseWithClause());else{for(var c=0,u=a.specifiers;c<u.length;c+=1){var d=u[c];this.checkUnreserved(d.local),this.checkLocalExport(d.local),d.local.type==="Literal"&&this.raise(d.local.start,"A string literal cannot be used as an exported binding without `from`.")}a.source=null}this.semicolon()}return this.finishNode(a,"ExportNamedDeclaration")},pp$8.parseExportDeclaration=function(a){return this.parseStatement(null)},pp$8.parseExportDefaultDeclaration=function(){var a;if(this.type===types$1._function||(a=this.isAsyncFunction())){var s=this.startNode();return this.next(),a&&this.next(),this.parseFunction(s,FUNC_STATEMENT|FUNC_NULLABLE_ID,!1,a)}else if(this.type===types$1._class){var c=this.startNode();return this.parseClass(c,"nullableID")}else{var u=this.parseMaybeAssign();return this.semicolon(),u}},pp$8.checkExport=function(a,s,c){a&&(typeof s!="string"&&(s=s.type==="Identifier"?s.name:s.value),hasOwn(a,s)&&this.raiseRecoverable(c,"Duplicate export '"+s+"'"),a[s]=!0)},pp$8.checkPatternExport=function(a,s){var c=s.type;if(c==="Identifier")this.checkExport(a,s,s.start);else if(c==="ObjectPattern")for(var u=0,d=s.properties;u<d.length;u+=1){var p=d[u];this.checkPatternExport(a,p)}else if(c==="ArrayPattern")for(var A=0,v=s.elements;A<v.length;A+=1){var b=v[A];b&&this.checkPatternExport(a,b)}else c==="Property"?this.checkPatternExport(a,s.value):c==="AssignmentPattern"?this.checkPatternExport(a,s.left):c==="RestElement"&&this.checkPatternExport(a,s.argument)},pp$8.checkVariableExport=function(a,s){if(a)for(var c=0,u=s;c<u.length;c+=1){var d=u[c];this.checkPatternExport(a,d.id)}},pp$8.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},pp$8.parseExportSpecifier=function(a){var s=this.startNode();return s.local=this.parseModuleExportName(),s.exported=this.eatContextual("as")?this.parseModuleExportName():s.local,this.checkExport(a,s.exported,s.exported.start),this.finishNode(s,"ExportSpecifier")},pp$8.parseExportSpecifiers=function(a){var s=[],c=!0;for(this.expect(types$1.braceL);!this.eat(types$1.braceR);){if(c)c=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;s.push(this.parseExportSpecifier(a))}return s},pp$8.parseImport=function(a){return this.next(),this.type===types$1.string?(a.specifiers=empty$1,a.source=this.parseExprAtom()):(a.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),a.source=this.type===types$1.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(a.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(a,"ImportDeclaration")},pp$8.parseImportSpecifier=function(){var a=this.startNode();return a.imported=this.parseModuleExportName(),this.eatContextual("as")?a.local=this.parseIdent():(this.checkUnreserved(a.imported),a.local=a.imported),this.checkLValSimple(a.local,BIND_LEXICAL),this.finishNode(a,"ImportSpecifier")},pp$8.parseImportDefaultSpecifier=function(){var a=this.startNode();return a.local=this.parseIdent(),this.checkLValSimple(a.local,BIND_LEXICAL),this.finishNode(a,"ImportDefaultSpecifier")},pp$8.parseImportNamespaceSpecifier=function(){var a=this.startNode();return this.next(),this.expectContextual("as"),a.local=this.parseIdent(),this.checkLValSimple(a.local,BIND_LEXICAL),this.finishNode(a,"ImportNamespaceSpecifier")},pp$8.parseImportSpecifiers=function(){var a=[],s=!0;if(this.type===types$1.name&&(a.push(this.parseImportDefaultSpecifier()),!this.eat(types$1.comma)))return a;if(this.type===types$1.star)return a.push(this.parseImportNamespaceSpecifier()),a;for(this.expect(types$1.braceL);!this.eat(types$1.braceR);){if(s)s=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;a.push(this.parseImportSpecifier())}return a},pp$8.parseWithClause=function(){var a=[];if(!this.eat(types$1._with))return a;this.expect(types$1.braceL);for(var s={},c=!0;!this.eat(types$1.braceR);){if(c)c=!1;else if(this.expect(types$1.comma),this.afterTrailingComma(types$1.braceR))break;var u=this.parseImportAttribute(),d=u.key.type==="Identifier"?u.key.name:u.key.value;hasOwn(s,d)&&this.raiseRecoverable(u.key.start,"Duplicate attribute key '"+d+"'"),s[d]=!0,a.push(u)}return a},pp$8.parseImportAttribute=function(){var a=this.startNode();return a.key=this.type===types$1.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(types$1.colon),this.type!==types$1.string&&this.unexpected(),a.value=this.parseExprAtom(),this.finishNode(a,"ImportAttribute")},pp$8.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===types$1.string){var a=this.parseLiteral(this.value);return loneSurrogate.test(a.value)&&this.raise(a.start,"An export name cannot include a lone surrogate."),a}return this.parseIdent(!0)},pp$8.adaptDirectivePrologue=function(a){for(var s=0;s<a.length&&this.isDirectiveCandidate(a[s]);++s)a[s].directive=a[s].expression.raw.slice(1,-1)},pp$8.isDirectiveCandidate=function(a){return this.options.ecmaVersion>=5&&a.type==="ExpressionStatement"&&a.expression.type==="Literal"&&typeof a.expression.value=="string"&&(this.input[a.start]==='"'||this.input[a.start]==="'")};var pp$7=Parser.prototype;pp$7.toAssignable=function(a,s,c){if(this.options.ecmaVersion>=6&&a)switch(a.type){case"Identifier":this.inAsync&&a.name==="await"&&this.raise(a.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":a.type="ObjectPattern",c&&this.checkPatternErrors(c,!0);for(var u=0,d=a.properties;u<d.length;u+=1){var p=d[u];this.toAssignable(p,s),p.type==="RestElement"&&(p.argument.type==="ArrayPattern"||p.argument.type==="ObjectPattern")&&this.raise(p.argument.start,"Unexpected token")}break;case"Property":a.kind!=="init"&&this.raise(a.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(a.value,s);break;case"ArrayExpression":a.type="ArrayPattern",c&&this.checkPatternErrors(c,!0),this.toAssignableList(a.elements,s);break;case"SpreadElement":a.type="RestElement",this.toAssignable(a.argument,s),a.argument.type==="AssignmentPattern"&&this.raise(a.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":a.operator!=="="&&this.raise(a.left.end,"Only '=' operator can be used for specifying default value."),a.type="AssignmentPattern",delete a.operator,this.toAssignable(a.left,s);break;case"ParenthesizedExpression":this.toAssignable(a.expression,s,c);break;case"ChainExpression":this.raiseRecoverable(a.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!s)break;default:this.raise(a.start,"Assigning to rvalue")}else c&&this.checkPatternErrors(c,!0);return a},pp$7.toAssignableList=function(a,s){for(var c=a.length,u=0;u<c;u++){var d=a[u];d&&this.toAssignable(d,s)}if(c){var p=a[c-1];this.options.ecmaVersion===6&&s&&p&&p.type==="RestElement"&&p.argument.type!=="Identifier"&&this.unexpected(p.argument.start)}return a},pp$7.parseSpread=function(a){var s=this.startNode();return this.next(),s.argument=this.parseMaybeAssign(!1,a),this.finishNode(s,"SpreadElement")},pp$7.parseRestBinding=function(){var a=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==types$1.name&&this.unexpected(),a.argument=this.parseBindingAtom(),this.finishNode(a,"RestElement")},pp$7.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case types$1.bracketL:var a=this.startNode();return this.next(),a.elements=this.parseBindingList(types$1.bracketR,!0,!0),this.finishNode(a,"ArrayPattern");case types$1.braceL:return this.parseObj(!0)}return this.parseIdent()},pp$7.parseBindingList=function(a,s,c,u){for(var d=[],p=!0;!this.eat(a);)if(p?p=!1:this.expect(types$1.comma),s&&this.type===types$1.comma)d.push(null);else{if(c&&this.afterTrailingComma(a))break;if(this.type===types$1.ellipsis){var A=this.parseRestBinding();this.parseBindingListItem(A),d.push(A),this.type===types$1.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(a);break}else d.push(this.parseAssignableListItem(u))}return d},pp$7.parseAssignableListItem=function(a){var s=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(s),s},pp$7.parseBindingListItem=function(a){return a},pp$7.parseMaybeDefault=function(a,s,c){if(c=c||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(types$1.eq))return c;var u=this.startNodeAt(a,s);return u.left=c,u.right=this.parseMaybeAssign(),this.finishNode(u,"AssignmentPattern")},pp$7.checkLValSimple=function(a,s,c){s===void 0&&(s=BIND_NONE);var u=s!==BIND_NONE;switch(a.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(a.name)&&this.raiseRecoverable(a.start,(u?"Binding ":"Assigning to ")+a.name+" in strict mode"),u&&(s===BIND_LEXICAL&&a.name==="let"&&this.raiseRecoverable(a.start,"let is disallowed as a lexically bound name"),c&&(hasOwn(c,a.name)&&this.raiseRecoverable(a.start,"Argument name clash"),c[a.name]=!0),s!==BIND_OUTSIDE&&this.declareName(a.name,s,a.start));break;case"ChainExpression":this.raiseRecoverable(a.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":u&&this.raiseRecoverable(a.start,"Binding member expression");break;case"ParenthesizedExpression":return u&&this.raiseRecoverable(a.start,"Binding parenthesized expression"),this.checkLValSimple(a.expression,s,c);default:this.raise(a.start,(u?"Binding":"Assigning to")+" rvalue")}},pp$7.checkLValPattern=function(a,s,c){switch(s===void 0&&(s=BIND_NONE),a.type){case"ObjectPattern":for(var u=0,d=a.properties;u<d.length;u+=1){var p=d[u];this.checkLValInnerPattern(p,s,c)}break;case"ArrayPattern":for(var A=0,v=a.elements;A<v.length;A+=1){var b=v[A];b&&this.checkLValInnerPattern(b,s,c)}break;default:this.checkLValSimple(a,s,c)}},pp$7.checkLValInnerPattern=function(a,s,c){switch(s===void 0&&(s=BIND_NONE),a.type){case"Property":this.checkLValInnerPattern(a.value,s,c);break;case"AssignmentPattern":this.checkLValPattern(a.left,s,c);break;case"RestElement":this.checkLValPattern(a.argument,s,c);break;default:this.checkLValPattern(a,s,c)}};var TokContext=function(s,c,u,d,p){this.token=s,this.isExpr=!!c,this.preserveSpace=!!u,this.override=d,this.generator=!!p},types$2={b_stat:new TokContext("{",!1),b_expr:new TokContext("{",!0),b_tmpl:new TokContext("${",!1),p_stat:new TokContext("(",!1),p_expr:new TokContext("(",!0),q_tmpl:new TokContext("`",!0,!0,function(a){return a.tryReadTemplateToken()}),f_stat:new TokContext("function",!1),f_expr:new TokContext("function",!0),f_expr_gen:new TokContext("function",!0,!1,null,!0),f_gen:new TokContext("function",!1,!1,null,!0)},pp$6=Parser.prototype;pp$6.initialContext=function(){return[types$2.b_stat]},pp$6.curContext=function(){return this.context[this.context.length-1]},pp$6.braceIsBlock=function(a){var s=this.curContext();return s===types$2.f_expr||s===types$2.f_stat?!0:a===types$1.colon&&(s===types$2.b_stat||s===types$2.b_expr)?!s.isExpr:a===types$1._return||a===types$1.name&&this.exprAllowed?lineBreak.test(this.input.slice(this.lastTokEnd,this.start)):a===types$1._else||a===types$1.semi||a===types$1.eof||a===types$1.parenR||a===types$1.arrow?!0:a===types$1.braceL?s===types$2.b_stat:a===types$1._var||a===types$1._const||a===types$1.name?!1:!this.exprAllowed},pp$6.inGeneratorContext=function(){for(var a=this.context.length-1;a>=1;a--){var s=this.context[a];if(s.token==="function")return s.generator}return!1},pp$6.updateContext=function(a){var s,c=this.type;c.keyword&&a===types$1.dot?this.exprAllowed=!1:(s=c.updateContext)?s.call(this,a):this.exprAllowed=c.beforeExpr},pp$6.overrideContext=function(a){this.curContext()!==a&&(this.context[this.context.length-1]=a)},types$1.parenR.updateContext=types$1.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var a=this.context.pop();a===types$2.b_stat&&this.curContext().token==="function"&&(a=this.context.pop()),this.exprAllowed=!a.isExpr},types$1.braceL.updateContext=function(a){this.context.push(this.braceIsBlock(a)?types$2.b_stat:types$2.b_expr),this.exprAllowed=!0},types$1.dollarBraceL.updateContext=function(){this.context.push(types$2.b_tmpl),this.exprAllowed=!0},types$1.parenL.updateContext=function(a){var s=a===types$1._if||a===types$1._for||a===types$1._with||a===types$1._while;this.context.push(s?types$2.p_stat:types$2.p_expr),this.exprAllowed=!0},types$1.incDec.updateContext=function(){},types$1._function.updateContext=types$1._class.updateContext=function(a){a.beforeExpr&&a!==types$1._else&&!(a===types$1.semi&&this.curContext()!==types$2.p_stat)&&!(a===types$1._return&&lineBreak.test(this.input.slice(this.lastTokEnd,this.start)))&&!((a===types$1.colon||a===types$1.braceL)&&this.curContext()===types$2.b_stat)?this.context.push(types$2.f_expr):this.context.push(types$2.f_stat),this.exprAllowed=!1},types$1.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},types$1.backQuote.updateContext=function(){this.curContext()===types$2.q_tmpl?this.context.pop():this.context.push(types$2.q_tmpl),this.exprAllowed=!1},types$1.star.updateContext=function(a){if(a===types$1._function){var s=this.context.length-1;this.context[s]===types$2.f_expr?this.context[s]=types$2.f_expr_gen:this.context[s]=types$2.f_gen}this.exprAllowed=!0},types$1.name.updateContext=function(a){var s=!1;this.options.ecmaVersion>=6&&a!==types$1.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(s=!0),this.exprAllowed=s};var pp$5=Parser.prototype;pp$5.checkPropClash=function(a,s,c){if(!(this.options.ecmaVersion>=9&&a.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(a.computed||a.method||a.shorthand))){var u=a.key,d;switch(u.type){case"Identifier":d=u.name;break;case"Literal":d=String(u.value);break;default:return}var p=a.kind;if(this.options.ecmaVersion>=6){d==="__proto__"&&p==="init"&&(s.proto&&(c?c.doubleProto<0&&(c.doubleProto=u.start):this.raiseRecoverable(u.start,"Redefinition of __proto__ property")),s.proto=!0);return}d="$"+d;var A=s[d];if(A){var v;p==="init"?v=this.strict&&A.init||A.get||A.set:v=A.init||A[p],v&&this.raiseRecoverable(u.start,"Redefinition of property")}else A=s[d]={init:!1,get:!1,set:!1};A[p]=!0}},pp$5.parseExpression=function(a,s){var c=this.start,u=this.startLoc,d=this.parseMaybeAssign(a,s);if(this.type===types$1.comma){var p=this.startNodeAt(c,u);for(p.expressions=[d];this.eat(types$1.comma);)p.expressions.push(this.parseMaybeAssign(a,s));return this.finishNode(p,"SequenceExpression")}return d},pp$5.parseMaybeAssign=function(a,s,c){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(a);this.exprAllowed=!1}var u=!1,d=-1,p=-1,A=-1;s?(d=s.parenthesizedAssign,p=s.trailingComma,A=s.doubleProto,s.parenthesizedAssign=s.trailingComma=-1):(s=new DestructuringErrors,u=!0);var v=this.start,b=this.startLoc;(this.type===types$1.parenL||this.type===types$1.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=a==="await");var g=this.parseMaybeConditional(a,s);if(c&&(g=c.call(this,g,v,b)),this.type.isAssign){var x=this.startNodeAt(v,b);return x.operator=this.value,this.type===types$1.eq&&(g=this.toAssignable(g,!1,s)),u||(s.parenthesizedAssign=s.trailingComma=s.doubleProto=-1),s.shorthandAssign>=g.start&&(s.shorthandAssign=-1),this.type===types$1.eq?this.checkLValPattern(g):this.checkLValSimple(g),x.left=g,this.next(),x.right=this.parseMaybeAssign(a),A>-1&&(s.doubleProto=A),this.finishNode(x,"AssignmentExpression")}else u&&this.checkExpressionErrors(s,!0);return d>-1&&(s.parenthesizedAssign=d),p>-1&&(s.trailingComma=p),g},pp$5.parseMaybeConditional=function(a,s){var c=this.start,u=this.startLoc,d=this.parseExprOps(a,s);if(this.checkExpressionErrors(s))return d;if(this.eat(types$1.question)){var p=this.startNodeAt(c,u);return p.test=d,p.consequent=this.parseMaybeAssign(),this.expect(types$1.colon),p.alternate=this.parseMaybeAssign(a),this.finishNode(p,"ConditionalExpression")}return d},pp$5.parseExprOps=function(a,s){var c=this.start,u=this.startLoc,d=this.parseMaybeUnary(s,!1,!1,a);return this.checkExpressionErrors(s)||d.start===c&&d.type==="ArrowFunctionExpression"?d:this.parseExprOp(d,c,u,-1,a)},pp$5.parseExprOp=function(a,s,c,u,d){var p=this.type.binop;if(p!=null&&(!d||this.type!==types$1._in)&&p>u){var A=this.type===types$1.logicalOR||this.type===types$1.logicalAND,v=this.type===types$1.coalesce;v&&(p=types$1.logicalAND.binop);var b=this.value;this.next();var g=this.start,x=this.startLoc,y=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,d),g,x,p,d),f=this.buildBinary(s,c,a,y,b,A||v);return(A&&this.type===types$1.coalesce||v&&(this.type===types$1.logicalOR||this.type===types$1.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(f,s,c,u,d)}return a},pp$5.buildBinary=function(a,s,c,u,d,p){u.type==="PrivateIdentifier"&&this.raise(u.start,"Private identifier can only be left side of binary expression");var A=this.startNodeAt(a,s);return A.left=c,A.operator=d,A.right=u,this.finishNode(A,p?"LogicalExpression":"BinaryExpression")},pp$5.parseMaybeUnary=function(a,s,c,u){var d=this.start,p=this.startLoc,A;if(this.isContextual("await")&&this.canAwait)A=this.parseAwait(u),s=!0;else if(this.type.prefix){var v=this.startNode(),b=this.type===types$1.incDec;v.operator=this.value,v.prefix=!0,this.next(),v.argument=this.parseMaybeUnary(null,!0,b,u),this.checkExpressionErrors(a,!0),b?this.checkLValSimple(v.argument):this.strict&&v.operator==="delete"&&isLocalVariableAccess(v.argument)?this.raiseRecoverable(v.start,"Deleting local variable in strict mode"):v.operator==="delete"&&isPrivateFieldAccess(v.argument)?this.raiseRecoverable(v.start,"Private fields can not be deleted"):s=!0,A=this.finishNode(v,b?"UpdateExpression":"UnaryExpression")}else if(!s&&this.type===types$1.privateId)(u||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),A=this.parsePrivateIdent(),this.type!==types$1._in&&this.unexpected();else{if(A=this.parseExprSubscripts(a,u),this.checkExpressionErrors(a))return A;for(;this.type.postfix&&!this.canInsertSemicolon();){var g=this.startNodeAt(d,p);g.operator=this.value,g.prefix=!1,g.argument=A,this.checkLValSimple(A),this.next(),A=this.finishNode(g,"UpdateExpression")}}if(!c&&this.eat(types$1.starstar))if(s)this.unexpected(this.lastTokStart);else return this.buildBinary(d,p,A,this.parseMaybeUnary(null,!1,!1,u),"**",!1);else return A};function isLocalVariableAccess(a){return a.type==="Identifier"||a.type==="ParenthesizedExpression"&&isLocalVariableAccess(a.expression)}function isPrivateFieldAccess(a){return a.type==="MemberExpression"&&a.property.type==="PrivateIdentifier"||a.type==="ChainExpression"&&isPrivateFieldAccess(a.expression)||a.type==="ParenthesizedExpression"&&isPrivateFieldAccess(a.expression)}pp$5.parseExprSubscripts=function(a,s){var c=this.start,u=this.startLoc,d=this.parseExprAtom(a,s);if(d.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return d;var p=this.parseSubscripts(d,c,u,!1,s);return a&&p.type==="MemberExpression"&&(a.parenthesizedAssign>=p.start&&(a.parenthesizedAssign=-1),a.parenthesizedBind>=p.start&&(a.parenthesizedBind=-1),a.trailingComma>=p.start&&(a.trailingComma=-1)),p},pp$5.parseSubscripts=function(a,s,c,u,d){for(var p=this.options.ecmaVersion>=8&&a.type==="Identifier"&&a.name==="async"&&this.lastTokEnd===a.end&&!this.canInsertSemicolon()&&a.end-a.start===5&&this.potentialArrowAt===a.start,A=!1;;){var v=this.parseSubscript(a,s,c,u,p,A,d);if(v.optional&&(A=!0),v===a||v.type==="ArrowFunctionExpression"){if(A){var b=this.startNodeAt(s,c);b.expression=v,v=this.finishNode(b,"ChainExpression")}return v}a=v}},pp$5.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(types$1.arrow)},pp$5.parseSubscriptAsyncArrow=function(a,s,c,u){return this.parseArrowExpression(this.startNodeAt(a,s),c,!0,u)},pp$5.parseSubscript=function(a,s,c,u,d,p,A){var v=this.options.ecmaVersion>=11,b=v&&this.eat(types$1.questionDot);u&&b&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var g=this.eat(types$1.bracketL);if(g||b&&this.type!==types$1.parenL&&this.type!==types$1.backQuote||this.eat(types$1.dot)){var x=this.startNodeAt(s,c);x.object=a,g?(x.property=this.parseExpression(),this.expect(types$1.bracketR)):this.type===types$1.privateId&&a.type!=="Super"?x.property=this.parsePrivateIdent():x.property=this.parseIdent(this.options.allowReserved!=="never"),x.computed=!!g,v&&(x.optional=b),a=this.finishNode(x,"MemberExpression")}else if(!u&&this.eat(types$1.parenL)){var y=new DestructuringErrors,f=this.yieldPos,m=this.awaitPos,C=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var S=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,!1,y);if(d&&!b&&this.shouldParseAsyncArrow())return this.checkPatternErrors(y,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=f,this.awaitPos=m,this.awaitIdentPos=C,this.parseSubscriptAsyncArrow(s,c,S,A);this.checkExpressionErrors(y,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=C||this.awaitIdentPos;var w=this.startNodeAt(s,c);w.callee=a,w.arguments=S,v&&(w.optional=b),a=this.finishNode(w,"CallExpression")}else if(this.type===types$1.backQuote){(b||p)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var I=this.startNodeAt(s,c);I.tag=a,I.quasi=this.parseTemplate({isTagged:!0}),a=this.finishNode(I,"TaggedTemplateExpression")}return a},pp$5.parseExprAtom=function(a,s,c){this.type===types$1.slash&&this.readRegexp();var u,d=this.potentialArrowAt===this.start;switch(this.type){case types$1._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),u=this.startNode(),this.next(),this.type===types$1.parenL&&!this.allowDirectSuper&&this.raise(u.start,"super() call outside constructor of a subclass"),this.type!==types$1.dot&&this.type!==types$1.bracketL&&this.type!==types$1.parenL&&this.unexpected(),this.finishNode(u,"Super");case types$1._this:return u=this.startNode(),this.next(),this.finishNode(u,"ThisExpression");case types$1.name:var p=this.start,A=this.startLoc,v=this.containsEsc,b=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!v&&b.name==="async"&&!this.canInsertSemicolon()&&this.eat(types$1._function))return this.overrideContext(types$2.f_expr),this.parseFunction(this.startNodeAt(p,A),0,!1,!0,s);if(d&&!this.canInsertSemicolon()){if(this.eat(types$1.arrow))return this.parseArrowExpression(this.startNodeAt(p,A),[b],!1,s);if(this.options.ecmaVersion>=8&&b.name==="async"&&this.type===types$1.name&&!v&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return b=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(types$1.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(p,A),[b],!0,s)}return b;case types$1.regexp:var g=this.value;return u=this.parseLiteral(g.value),u.regex={pattern:g.pattern,flags:g.flags},u;case types$1.num:case types$1.string:return this.parseLiteral(this.value);case types$1._null:case types$1._true:case types$1._false:return u=this.startNode(),u.value=this.type===types$1._null?null:this.type===types$1._true,u.raw=this.type.keyword,this.next(),this.finishNode(u,"Literal");case types$1.parenL:var x=this.start,y=this.parseParenAndDistinguishExpression(d,s);return a&&(a.parenthesizedAssign<0&&!this.isSimpleAssignTarget(y)&&(a.parenthesizedAssign=x),a.parenthesizedBind<0&&(a.parenthesizedBind=x)),y;case types$1.bracketL:return u=this.startNode(),this.next(),u.elements=this.parseExprList(types$1.bracketR,!0,!0,a),this.finishNode(u,"ArrayExpression");case types$1.braceL:return this.overrideContext(types$2.b_expr),this.parseObj(!1,a);case types$1._function:return u=this.startNode(),this.next(),this.parseFunction(u,0);case types$1._class:return this.parseClass(this.startNode(),!1);case types$1._new:return this.parseNew();case types$1.backQuote:return this.parseTemplate();case types$1._import:return this.options.ecmaVersion>=11?this.parseExprImport(c):this.unexpected();default:return this.parseExprAtomDefault()}},pp$5.parseExprAtomDefault=function(){this.unexpected()},pp$5.parseExprImport=function(a){var s=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===types$1.parenL&&!a)return this.parseDynamicImport(s);if(this.type===types$1.dot){var c=this.startNodeAt(s.start,s.loc&&s.loc.start);return c.name="import",s.meta=this.finishNode(c,"Identifier"),this.parseImportMeta(s)}else this.unexpected()},pp$5.parseDynamicImport=function(a){if(this.next(),a.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(types$1.parenR)?a.options=null:(this.expect(types$1.comma),this.afterTrailingComma(types$1.parenR)?a.options=null:(a.options=this.parseMaybeAssign(),this.eat(types$1.parenR)||(this.expect(types$1.comma),this.afterTrailingComma(types$1.parenR)||this.unexpected())));else if(!this.eat(types$1.parenR)){var s=this.start;this.eat(types$1.comma)&&this.eat(types$1.parenR)?this.raiseRecoverable(s,"Trailing comma is not allowed in import()"):this.unexpected(s)}return this.finishNode(a,"ImportExpression")},pp$5.parseImportMeta=function(a){this.next();var s=this.containsEsc;return a.property=this.parseIdent(!0),a.property.name!=="meta"&&this.raiseRecoverable(a.property.start,"The only valid meta property for import is 'import.meta'"),s&&this.raiseRecoverable(a.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(a.start,"Cannot use 'import.meta' outside a module"),this.finishNode(a,"MetaProperty")},pp$5.parseLiteral=function(a){var s=this.startNode();return s.value=a,s.raw=this.input.slice(this.start,this.end),s.raw.charCodeAt(s.raw.length-1)===110&&(s.bigint=s.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(s,"Literal")},pp$5.parseParenExpression=function(){this.expect(types$1.parenL);var a=this.parseExpression();return this.expect(types$1.parenR),a},pp$5.shouldParseArrow=function(a){return!this.canInsertSemicolon()},pp$5.parseParenAndDistinguishExpression=function(a,s){var c=this.start,u=this.startLoc,d,p=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var A=this.start,v=this.startLoc,b=[],g=!0,x=!1,y=new DestructuringErrors,f=this.yieldPos,m=this.awaitPos,C;for(this.yieldPos=0,this.awaitPos=0;this.type!==types$1.parenR;)if(g?g=!1:this.expect(types$1.comma),p&&this.afterTrailingComma(types$1.parenR,!0)){x=!0;break}else if(this.type===types$1.ellipsis){C=this.start,b.push(this.parseParenItem(this.parseRestBinding())),this.type===types$1.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else b.push(this.parseMaybeAssign(!1,y,this.parseParenItem));var S=this.lastTokEnd,w=this.lastTokEndLoc;if(this.expect(types$1.parenR),a&&this.shouldParseArrow(b)&&this.eat(types$1.arrow))return this.checkPatternErrors(y,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=m,this.parseParenArrowList(c,u,b,s);(!b.length||x)&&this.unexpected(this.lastTokStart),C&&this.unexpected(C),this.checkExpressionErrors(y,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=m||this.awaitPos,b.length>1?(d=this.startNodeAt(A,v),d.expressions=b,this.finishNodeAt(d,"SequenceExpression",S,w)):d=b[0]}else d=this.parseParenExpression();if(this.options.preserveParens){var I=this.startNodeAt(c,u);return I.expression=d,this.finishNode(I,"ParenthesizedExpression")}else return d},pp$5.parseParenItem=function(a){return a},pp$5.parseParenArrowList=function(a,s,c,u){return this.parseArrowExpression(this.startNodeAt(a,s),c,!1,u)};var empty$2=[];pp$5.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var a=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===types$1.dot){var s=this.startNodeAt(a.start,a.loc&&a.loc.start);s.name="new",a.meta=this.finishNode(s,"Identifier"),this.next();var c=this.containsEsc;return a.property=this.parseIdent(!0),a.property.name!=="target"&&this.raiseRecoverable(a.property.start,"The only valid meta property for new is 'new.target'"),c&&this.raiseRecoverable(a.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(a.start,"'new.target' can only be used in functions and class static block"),this.finishNode(a,"MetaProperty")}var u=this.start,d=this.startLoc;return a.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),u,d,!0,!1),this.eat(types$1.parenL)?a.arguments=this.parseExprList(types$1.parenR,this.options.ecmaVersion>=8,!1):a.arguments=empty$2,this.finishNode(a,"NewExpression")},pp$5.parseTemplateElement=function(a){var s=a.isTagged,c=this.startNode();return this.type===types$1.invalidTemplate?(s||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),c.value={raw:this.value.replace(/\r\n?/g,`
|
53
53
|
`),cooked:null}):c.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|