Dynamic Templater

linkAmplenote Dynamic Templater Plugin Overview

The Amplenote Dynamic Templater Plugin allows users to build and insert dynamic templates seamlessly within Amplenote. With this plugin, you can expand date expressions, customize date formats, create note links, and automate template insertion based on your current context. This tool enhances productivity and streamlines your note-taking process.

Watch the Overview Video



☕ If the plugin is helpful to you, you can buy me a coffee!

linkFeatures

Dynamic Template Insertion: Build and insert templates dynamically at your current cursor position using the {= syntax, which mimics the native template support (@= or [[=).

Default Template Assignment: Assign default templates to specific tags or for new notes. These templates will be suggested when inserting a template with {=

Dynamic New Note Link/Button: Use a link/button to auto-create a new note with a dynamic template. This also supports expressions in the note name and specifying a template section to use.


Date and Math Expression Expansion: Automatically expand complex recognized date and math expressions within curly brackets, such as {tomorrow} or {1+8}

Supports Amplenote expressions listed here

Supports advanced expressions and compound expressions like:

{2 days before the Last Weekday of Four Months from Now at 5pm}

{2 Weeks after Friday}

{Thursday of Last Week}

Full list of supported expressions listed here: Evaluator Supported Date and Math Expressions

Task Start/Hide Dates: Apply dynamic start or hide dates to tasks using expressions like {start:expression} or {hide:expression}. Like {start:next Monday}.

Custom Date Formatting: Customize the format of dates using specifiers. For example, {"MM-dd-yyyy":tomorrow} expands to “09-27-2024”.

Dynamic Note Linking: Convert eligible text enclosed in double square brackets like [[daily-notes/{Next Monday}]] into links.

Auto-Creating Notes: Notes are created if they don't already exist. This can be suppressed with an optional prefix flag (?) or silent flag (_).

Display Name with Pipe Character (**|***): Use the pipe character to set an alias or display name for the link.

Nested Templates: You can link to and nest templates within each other with [[= ]] or {= }. You can also insert a subsection of a template.

Smart Indentation: Insert templates while maintaining the current indentation level within bullet, numbered, or task lists.

Note: This works as long as the template itself contains a list. Since headings and other content aren't indent-able those won't maintain current indentation.

Jot Suggestions: This functionality enhances the user experience in Jots mode.

linkKnown Issues

Jots seem to be more flaky in Amplenote than notes. The plugin suggestion does not appear consistently unless you type in the jot. And we have to use a workaround to insert the content until they fix the Plugin API, but it does work.

The plugin has more bloat than I want. It currently rebundles the date and js parsing libraries because Amplenote doesn't expose them. I'm working to see if we can change this and significantly reduce the plugin size.

linkUsage

linkImportant Usage Note

Certain convenience features of the plugin require dynamic templates to be tagged with a particular pre-set tag. By default, this tag is system/template, but it is a user-configurable setting under the plugin settings labeled Dynamic Template Tag. This is optional, most of the plugin functionality works without it.

linkInserting a Template

Type {= to insert default templates or {=Pick a template} to pull up a menu to select an available template

The plugin will automatically insert the template’s contents at the current cursor position.

linkCreating a Dynamic New Note Link

Two ways to create a dynamic new note link:

Use the {Templater: New Note Link} expression to bring up a form to generate the link.

Now when you have "new note" links as described in the Amplenote docs, there will be a "Dynamic Templater: Create" button that lets you create it while parsing the source note as a dynamic template.

linkTask Start/Hide Dates

To set a start date for a task, include {start:expression} in the task description.

To hide a task until a specific date, use {hide:expression}

linkCustom Date Formatting

Add a date format specifier to expressions for customized date formats. Here are all the date formats supported: date-fns Formats

Example: {"MM-dd-yyyy":tomorrow} expands to “09-27-2024”.

linkLinking Notes

Use double square brackets ([[ ]]) to create or link to notes. You can have date/math expressions in the link. You can also link to specific sections within a note by adding # followed by the section name.

By default, notes will be created if they do not exist, unless you add an optional flag (?) at the beginning of the note. The optional flag allows you to link to the note only if it exists, avoiding the creation of empty notes.

You can also use a silent flag (_) to surpress the link output completely if the note doesn't exist. It's a optional flag that doesn't output anything.

You can also use an alias to display a different name for the link by using the pipe character (|) at the end.

Examples:

[[daily-jots/{Next Sunday}]] links to (and creates, if necessary) a note tagged with "daily-jots" for next sunday.

[[?daily-jots/{Monday of last week}]] links to a note tagged with "daily-jots" for "Monday of last week" if it exists; otherwise, it will remain as plain text (e.g., [[daily-jots/September 9th, 2024]]). This allows you to create/link the note at a later time or remove it entirely using Amplenote's native interface.

[[Dynamic Note Name|Custom Display]] links to "Dynamic Note Name" but displays "Custom Display" as the clickable text.

[[{Tomorrow}#Section|Custom Display]] links to the "Section" of "Tomorrow" while showing "Custom Display" as the clickable text.

linkNested Templates

Use template links ([[= ]] or {= }, they are interchangeable) within your dynamic templates to nest other templates.

You can specify a subsection of a template to use for insertion with # or #>. The # includes the section header, and the #> only uses the section inner content.

Examples:

{=project/Projects} inserts the Projects note as a template

[[=project/Project Dashboard#Active Projects]] inserts the Active Projects section of the Projects note

[[=daily-templates/{"EEEE":Today}#>Tasks]] inserts the content under the tasks section of the template for the day of the week

linkAssigning Default Templates

For the default configuration:

Use the Tag Default Manager with the "Templater: Manage Defaults" menu under Cmd/Ctrl-O. Note: This opens a sidebar menu, which only works on desktop not mobile.

A global or tag default can also be set by going to the note and using the Templater: Set Default Template menu. (Menu won't appear if template isn't tagged with dynamic template tag)

At the tag level, you can make a template the default for a tag by tagging it with that tag and the Dynamic Template Tag. For example, a template could have both system/template and project tags to make it the default dynamic template for project notes.

Assign templates to tags to receive a Jot Suggestion when visiting that tag in Jots mode.

linkAuthor

Published by: lapluviosilla

Date: October 3rd, 2024

Last Updated: October 22nd, 2024

linkFeedback

If you have any questions, issues, or feedback, please feel free to reach out!

linkChangelog

October 22nd, 2024 -- Added nested templates and template section extraction features

October 19th, 2024 -- Fixed a couple bugs

October 14th, 2024 -- Added optional flag and display name feature for dynamic note linking

October 11th, 2024 -- Added note create link dynamic template support

October 10th, 2024 -- Added compound date expressions

linkDynamic Templater (1.1)

linkTable - Plugin Parameters:

name

Dynamic Templater

description

A plugin to make templates more powerful and dynamic

icon

auto_awesome_mosaic

instructions



Watch the Overview Video

View the README on Github
Features

- Dynamic Template Insertion: Build and insert templates dynamically at your current cursor position using the {= syntax, which mimics the native template support (@= or [[=).

- Default Template Assignment: Assign default templates to specific tags or for new notes. These templates will be suggested when inserting a template with {=

- Dynamic New Note Link/Button: Use a link/button to auto-create a new note with a dynamic template. This also supports expressions in the note name and specifying a template section to use.

- Date and Math Expression Expansion: Automatically expand complex recognized date and math expressions within curly brackets, such as {tomorrow} or {1+8}

- Supports Amplenote expressions listed here

- Supports advanced expressions and compound expressions like:

- {2 days before the Last Weekday of Four Months from Now at 5pm}

- {2 Weeks after Friday}

- {Thursday of Last Week}

- Full list of supported expressions listed here: Evaluator Supported Date and Math Expressions

- Task Start/Hide Dates: Apply dynamic start or hide dates to tasks using expressions like {start:expression} or {hide:expression}. Like {start:next Monday}.

- Custom Date Formatting: Customize the format of dates using specifiers. For example, {"MM-dd-yyyy":tomorrow} expands to “09-27-2024”.

- Dynamic Note Linking: Convert eligible text enclosed in double square brackets like [[daily-notes/{Next Monday}]] into links.

- Auto-Creating Notes: Notes are created if they don't already exist. This can be suppressed with an optional prefix flag (?) or silent flag (_).
- Display Name with Pipe Character (****|*****): Use the pipe character to set an alias or display name for the link.

- Nested Templates: You can link to and nest templates within each other with [[= ]] or {= }. You can also insert a subsection of a template.

- Smart Indentation: Insert templates while maintaining the current indentation level within bullet, numbered, or task lists.

- Note: This works as long as the template itself contains a list. Since headings and other content aren't indent-able those won't maintain current indentation.

- Jot Suggestions: This functionality enhances the user experience in Jots mode.

setting

Dynamic Template Tag (default: system/template)

setting

Global Default Template

setting

Tag Default Templates

linkCode Base:

Source Repo: https://github.com/lapluviosilla/amplenote-templater

(()=>{var Ze=Object.create,Ce=Object.defineProperty,et=Object.getOwnPropertyDescriptor,Se=Object.getOwnPropertyNames,tt=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty,it=(e,i)=>function(){return i||(0,e[Se(e)[0]])((i={exports:{}}).exports,i),i.exports},rt=(e,i,s,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of Se(i))!nt.call(e,l)&&l!==s&&Ce(e,l,{get:()=>i[l],enumerable:!(r=et(i,l))||r.enumerable});return e},st=(e,i,s)=>(s=e!=null?Ze(tt(e)):{},rt(i||!e||!e.__esModule?Ce(s,"default",{value:e,enumerable:!0}):s,e)),at=it({"node_modules/esprima/dist/esprima.js"(e,i){(function(r,l){typeof e=="object"&&typeof i=="object"?i.exports=l():typeof define=="function"&&define.amd?define([],l):typeof e=="object"?e.esprima=l():r.esprima=l()})(e,function(){return function(s){var r={};function l(u){if(r[u])return r[u].exports;var D=r[u]={exports:{},id:u,loaded:!1};return s[u].call(D.exports,D,D.exports,l),D.loaded=!0,D.exports}return l.m=s,l.c=r,l.p="",l(0)}([function(s,r,l){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=l(1),D=l(3),f=l(8),h=l(15);function C(d,t,n){var a=null,o=function(B,N){n&&n(B,N),a&&a.visit(B,N)},p=typeof n=="function"?o:null,x=!1;if(t){x=typeof t.comment=="boolean"&&t.comment;var S=typeof t.attachComment=="boolean"&&t.attachComment;(x||S)&&(a=new u.CommentHandler,a.attach=S,t.comment=!0,p=o)}var w=!1;t&&typeof t.sourceType=="string"&&(w=t.sourceType==="module");var F;t&&typeof t.jsx=="boolean"&&t.jsx?F=new D.JSXParser(d,t,p):F=new f.Parser(d,t,p);var b=w?F.parseModule():F.parseScript(),k=b;return x&&a&&(k.comments=a.comments),F.config.tokens&&(k.tokens=F.tokens),F.config.tolerant&&(k.errors=F.errorHandler.errors),k}r.parse=C;function y(d,t,n){var a=t||{};return a.sourceType="module",C(d,a,n)}r.parseModule=y;function v(d,t,n){var a=t||{};return a.sourceType="script",C(d,a,n)}r.parseScript=v;function c(d,t,n){var a=new h.Tokenizer(d,t),o;o=[];try{for(;;){var p=a.getNextToken();if(!p)break;n&&(p=n(p)),o.push(p)}}catch(x){a.errorHandler.tolerate(x)}return a.errorHandler.tolerant&&(o.errors=a.errors()),o}r.tokenize=c;var m=l(2);r.Syntax=m.Syntax,r.version="4.0.1"},function(s,r,l){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=l(2),D=function(){function f(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return f.prototype.insertInnerComments=function(h,C){if(h.type===u.Syntax.BlockStatement&&h.body.length===0){for(var y=[],v=this.leading.length-1;v>=0;--v){var c=this.leading[v];C.end.offset>=c.start&&(y.unshift(c.comment),this.leading.splice(v,1),this.trailing.splice(v,1))}y.length&&(h.innerComments=y)}},f.prototype.findTrailingComments=function(h){var C=[];if(this.trailing.length>0){for(var y=this.trailing.length-1;y>=0;--y){var v=this.trailing[y];v.start>=h.end.offset&&C.unshift(v.comment)}return this.trailing.length=0,C}var c=this.stack[this.stack.length-1];if(c&&c.node.trailingComments){var m=c.node.trailingComments[0];m&&m.range[0]>=h.end.offset&&(C=c.node.trailingComments,delete c.node.trailingComments)}return C},f.prototype.findLeadingComments=function(h){for(var C=[],y;this.stack.length>0;){var v=this.stack[this.stack.length-1];if(v&&v.start>=h.start.offset)y=v.node,this.stack.pop();else break}if(y){for(var c=y.leadingComments?y.leadingComments.length:0,m=c-1;m>=0;--m){var d=y.leadingComments[m];d.range[1]<=h.start.offset&&(C.unshift(d),y.leadingComments.splice(m,1))}return y.leadingComments&&y.leadingComments.length===0&&delete y.leadingComments,C}for(var m=this.leading.length-1;m>=0;--m){var v=this.leading[m];v.start<=h.start.offset&&(C.unshift(v.comment),this.leading.splice(m,1))}return C},f.prototype.visitNode=function(h,C){if(!(h.type===u.Syntax.Program&&h.body.length>0)){this.insertInnerComments(h,C);var y=this.findTrailingComments(C),v=this.findLeadingComments(C);v.length>0&&(h.leadingComments=v),y.length>0&&(h.trailingComments=y),this.stack.push({node:h,start:C.start.offset})}},f.prototype.visitComment=function(h,C){var y=h.type[0]==="L"?"Line":"Block",v={type:y,value:h.value};if(h.range&&(v.range=h.range),h.loc&&(v.loc=h.loc),this.comments.push(v),this.attach){var c={comment:{type:y,value:h.value,range:[C.start.offset,C.end.offset]},start:C.start.offset};h.loc&&(c.comment.loc=h.loc),h.type=y,this.leading.push(c),this.trailing.push(c)}},f.prototype.visit=function(h,C){h.type==="LineComment"?this.visitComment(h,C):h.type==="BlockComment"?this.visitComment(h,C):this.attach&&this.visitNode(h,C)},f}();r.CommentHandler=D},function(s,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(s,r,l){"use strict";var u=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)a.hasOwnProperty(o)&&(n[o]=a[o])};return function(n,a){t(n,a);function o(){this.constructor=n}n.prototype=a===null?Object.create(a):(o.prototype=a.prototype,new o)}}();Object.defineProperty(r,"__esModule",{value:!0});var D=l(4),f=l(5),h=l(6),C=l(7),y=l(8),v=l(13),c=l(14);v.TokenName[100]="JSXIdentifier",v.TokenName[101]="JSXText";function m(t){var n;switch(t.type){case h.JSXSyntax.JSXIdentifier:var a=t;n=a.name;break;case h.JSXSyntax.JSXNamespacedName:var o=t;n=m(o.namespace)+":"+m(o.name);break;case h.JSXSyntax.JSXMemberExpression:var p=t;n=m(p.object)+"."+m(p.property);break;default:break}return n}var d=function(t){u(n,t);function n(a,o,p){return t.call(this,a,o,p)||this}return n.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():t.prototype.parsePrimaryExpression.call(this)},n.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},n.prototype.finishJSX=function(){this.nextToken()},n.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},n.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},n.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},n.prototype.scanXHTMLEntity=function(a){for(var o="&",p=!0,x=!1,S=!1,w=!1;!this.scanner.eof()&&p&&!x;){var F=this.scanner.source[this.scanner.index];if(F===a)break;if(x=F===";",o+=F,++this.scanner.index,!x)switch(o.length){case 2:S=F==="#";break;case 3:S&&(w=F==="x",p=w||D.Character.isDecimalDigit(F.charCodeAt(0)),S=S&&!w);break;default:p=p&&!(S&&!D.Character.isDecimalDigit(F.charCodeAt(0))),p=p&&!(w&&!D.Character.isHexDigit(F.charCodeAt(0)));break}}if(p&&x&&o.length>2){var b=o.substr(1,o.length-2);S&&b.length>1?o=String.fromCharCode(parseInt(b.substr(1),10)):w&&b.length>2?o=String.fromCharCode(parseInt("0"+b.substr(1),16)):!S&&!w&&c.XHTMLEntities[b]&&(o=c.XHTMLEntities[b])}return o},n.prototype.lexJSX=function(){var a=this.scanner.source.charCodeAt(this.scanner.index);if(a===60||a===62||a===47||a===58||a===61||a===123||a===125){var o=this.scanner.source[this.scanner.index++];return{type:7,value:o,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(a===34||a===39){for(var p=this.scanner.index,x=this.scanner.source[this.scanner.index++],S="";!this.scanner.eof();){var w=this.scanner.source[this.scanner.index++];if(w===x)break;w==="&"?S+=this.scanXHTMLEntity(x):S+=w}return{type:8,value:S,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:p,end:this.scanner.index}}if(a===46){var F=this.scanner.source.charCodeAt(this.scanner.index+1),b=this.scanner.source.charCodeAt(this.scanner.index+2),o=F===46&&b===46?"...":".",p=this.scanner.index;return this.scanner.index+=o.length,{type:7,value:o,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:p,end:this.scanner.index}}if(a===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(D.Character.isIdentifierStart(a)&&a!==92){var p=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var w=this.scanner.source.charCodeAt(this.scanner.index);if(D.Character.isIdentifierPart(w)&&w!==92)++this.scanner.index;else if(w===45)++this.scanner.index;else break}var k=this.scanner.source.slice(p,this.scanner.index);return{type:100,value:k,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:p,end:this.scanner.index}}return this.scanner.lex()},n.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var a=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(a)),a},n.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var a=this.scanner.index,o="";!this.scanner.eof();){var p=this.scanner.source[this.scanner.index];if(p==="{"||p==="<")break;++this.scanner.index,o+=p,D.Character.isLineTerminator(p.charCodeAt(0))&&(++this.scanner.lineNumber,p==="\r"&&this.scanner.source[this.scanner.index]===`
`&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var x={type:101,value:o,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:a,end:this.scanner.index};return o.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(x)),x},n.prototype.peekJSXToken=function(){var a=this.scanner.saveState();this.scanner.scanComments();var o=this.lexJSX();return this.scanner.restoreState(a),o},n.prototype.expectJSX=function(a){var o=this.nextJSXToken();(o.type!==7||o.value!==a)&&this.throwUnexpectedToken(o)},n.prototype.matchJSX=function(a){var o=this.peekJSXToken();return o.type===7&&o.value===a},n.prototype.parseJSXIdentifier=function(){var a=this.createJSXNode(),o=this.nextJSXToken();return o.type!==100&&this.throwUnexpectedToken(o),this.finalize(a,new f.JSXIdentifier(o.value))},n.prototype.parseJSXElementName=function(){var a=this.createJSXNode(),o=this.parseJSXIdentifier();if(this.matchJSX(":")){var p=o;this.expectJSX(":");var x=this.parseJSXIdentifier();o=this.finalize(a,new f.JSXNamespacedName(p,x))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var S=o;this.expectJSX(".");var w=this.parseJSXIdentifier();o=this.finalize(a,new f.JSXMemberExpression(S,w))}return o},n.prototype.parseJSXAttributeName=function(){var a=this.createJSXNode(),o,p=this.parseJSXIdentifier();if(this.matchJSX(":")){var x=p;this.expectJSX(":");var S=this.parseJSXIdentifier();o=this.finalize(a,new f.JSXNamespacedName(x,S))}else o=p;return o},n.prototype.parseJSXStringLiteralAttribute=function(){var a=this.createJSXNode(),o=this.nextJSXToken();o.type!==8&&this.throwUnexpectedToken(o);var p=this.getTokenRaw(o);return this.finalize(a,new C.Literal(o.value,p))},n.prototype.parseJSXExpressionAttribute=function(){var a=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var o=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(a,new f.JSXExpressionContainer(o))},n.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},n.prototype.parseJSXNameValueAttribute=function(){var a=this.createJSXNode(),o=this.parseJSXAttributeName(),p=null;return this.matchJSX("=")&&(this.expectJSX("="),p=this.parseJSXAttributeValue()),this.finalize(a,new f.JSXAttribute(o,p))},n.prototype.parseJSXSpreadAttribute=function(){var a=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var o=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(a,new f.JSXSpreadAttribute(o))},n.prototype.parseJSXAttributes=function(){for(var a=[];!this.matchJSX("/")&&!this.matchJSX(">");){var o=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();a.push(o)}return a},n.prototype.parseJSXOpeningElement=function(){var a=this.createJSXNode();this.expectJSX("<");var o=this.parseJSXElementName(),p=this.parseJSXAttributes(),x=this.matchJSX("/");return x&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(a,new f.JSXOpeningElement(o,x,p))},n.prototype.parseJSXBoundaryElement=function(){var a=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var o=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(a,new f.JSXClosingElement(o))}var p=this.parseJSXElementName(),x=this.parseJSXAttributes(),S=this.matchJSX("/");return S&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(a,new f.JSXOpeningElement(p,S,x))},n.prototype.parseJSXEmptyExpression=function(){var a=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(a,new f.JSXEmptyExpression)},n.prototype.parseJSXExpressionContainer=function(){var a=this.createJSXNode();this.expectJSX("{");var o;return this.matchJSX("}")?(o=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),o=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(a,new f.JSXExpressionContainer(o))},n.prototype.parseJSXChildren=function(){for(var a=[];!this.scanner.eof();){var o=this.createJSXChildNode(),p=this.nextJSXText();if(p.start<p.end){var x=this.getTokenRaw(p),S=this.finalize(o,new f.JSXText(p.value,x));a.push(S)}if(this.scanner.source[this.scanner.index]==="{"){var w=this.parseJSXExpressionContainer();a.push(w)}else break}return a},n.prototype.parseComplexJSXElement=function(a){for(var o=[];!this.scanner.eof();){a.children=a.children.concat(this.parseJSXChildren());var p=this.createJSXChildNode(),x=this.parseJSXBoundaryElement();if(x.type===h.JSXSyntax.JSXOpeningElement){var S=x;if(S.selfClosing){var w=this.finalize(p,new f.JSXElement(S,[],null));a.children.push(w)}else o.push(a),a={node:p,opening:S,closing:null,children:[]}}if(x.type===h.JSXSyntax.JSXClosingElement){a.closing=x;var F=m(a.opening.name),b=m(a.closing.name);if(F!==b&&this.tolerateError("Expected corresponding JSX closing tag for %0",F),o.length>0){var w=this.finalize(a.node,new f.JSXElement(a.opening,a.children,a.closing));a=o[o.length-1],a.children.push(w),o.pop()}else break}}return a},n.prototype.parseJSXElement=function(){var a=this.createJSXNode(),o=this.parseJSXOpeningElement(),p=[],x=null;if(!o.selfClosing){var S=this.parseComplexJSXElement({node:a,opening:o,closing:x,children:p});p=S.children,x=S.closing}return this.finalize(a,new f.JSXElement(o,p,x))},n.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var a=this.parseJSXElement();return this.finishJSX(),a},n.prototype.isStartOfExpression=function(){return t.prototype.isStartOfExpression.call(this)||this.match("<")},n}(y.Parser);r.JSXParser=d},function(s,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};r.Character={fromCodePoint:function(u){return u<65536?String.fromCharCode(u):String.fromCharCode(55296+(u-65536>>10))+String.fromCharCode(56320+(u-65536&1023))},isWhiteSpace:function(u){return u===32||u===9||u===11||u===12||u===160||u>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(u)>=0},isLineTerminator:function(u){return u===10||u===13||u===8232||u===8233},isIdentifierStart:function(u){return u===36||u===95||u>=65&&u<=90||u>=97&&u<=122||u===92||u>=128&&l.NonAsciiIdentifierStart.test(r.Character.fromCodePoint(u))},isIdentifierPart:function(u){return u===36||u===95||u>=65&&u<=90||u>=97&&u<=122||u>=48&&u<=57||u===92||u>=128&&l.NonAsciiIdentifierPart.test(r.Character.fromCodePoint(u))},isDecimalDigit:function(u){return u>=48&&u<=57},isHexDigit:function(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102},isOctalDigit:function(u){return u>=48&&u<=55}}},function(s,r,l){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=l(6),D=function(){function a(o){this.type=u.JSXSyntax.JSXClosingElement,this.name=o}return a}();r.JSXClosingElement=D;var f=function(){function a(o,p,x){this.type=u.JSXSyntax.JSXElement,this.openingElement=o,this.children=p,this.closingElement=x}return a}();r.JSXElement=f;var h=function(){function a(){this.type=u.JSXSyntax.JSXEmptyExpression}return a}();r.JSXEmptyExpression=h;var C=function(){function a(o){this.type=u.JSXSyntax.JSXExpressionContainer,this.expression=o}return a}();r.JSXExpressionContainer=C;var y=function(){function a(o){this.type=u.JSXSyntax.JSXIdentifier,this.name=o}return a}();r.JSXIdentifier=y;var v=function(){function a(o,p){this.type=u.JSXSyntax.JSXMemberExpression,this.object=o,this.property=p}return a}();r.JSXMemberExpression=v;var c=function(){function a(o,p){this.type=u.JSXSyntax.JSXAttribute,this.name=o,this.value=p}return a}();r.JSXAttribute=c;var m=function(){function a(o,p){this.type=u.JSXSyntax.JSXNamespacedName,this.namespace=o,this.name=p}return a}();r.JSXNamespacedName=m;var d=function(){function a(o,p,x){this.type=u.JSXSyntax.JSXOpeningElement,this.name=o,this.selfClosing=p,this.attributes=x}return a}();r.JSXOpeningElement=d;var t=function(){function a(o){this.type=u.JSXSyntax.JSXSpreadAttribute,this.argument=o}return a}();r.JSXSpreadAttribute=t;var n=function(){function a(o,p){this.type=u.JSXSyntax.JSXText,this.value=o,this.raw=p}return a}();r.JSXText=n},function(s,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(s,r,l){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=l(2),D=function(){function g(E){this.type=u.Syntax.ArrayExpression,this.elements=E}return g}();r.ArrayExpression=D;var f=function(){function g(E){this.type=u.Syntax.ArrayPattern,this.elements=E}return g}();r.ArrayPattern=f;var h=function(){function g(E,A,T){this.type=u.Syntax.ArrowFunctionExpression,this.id=null,this.params=E,this.body=A,this.generator=!1,this.expression=T,this.async=!1}return g}();r.ArrowFunctionExpression=h;var C=function(){function g(E,A,T){this.type=u.Syntax.AssignmentExpression,this.operator=E,this.left=A,this.right=T}return g}();r.AssignmentExpression=C;var y=function(){function g(E,A){this.type=u.Syntax.AssignmentPattern,this.left=E,this.right=A}return g}();r.AssignmentPattern=y;var v=function(){function g(E,A,T){this.type=u.Syntax.ArrowFunctionExpression,this.id=null,this.params=E,this.body=A,this.generator=!1,this.expression=T,this.async=!0}return g}();r.AsyncArrowFunctionExpression=v;var c=function(){function g(E,A,T){this.type=u.Syntax.FunctionDeclaration,this.id=E,this.params=A,this.body=T,this.generator=!1,this.expression=!1,this.async=!0}return g}();r.AsyncFunctionDeclaration=c;var m=function(){function g(E,A,T){this.type=u.Syntax.FunctionExpression,this.id=E,this.params=A,this.body=T,this.generator=!1,this.expression=!1,this.async=!0}return g}();r.AsyncFunctionExpression=m;var d=function(){function g(E){this.type=u.Syntax.AwaitExpression,this.argument=E}return g}();r.AwaitExpression=d;var t=function(){function g(E,A,T){var R=E==="||"||E==="&&";this.type=R?u.Syntax.LogicalExpression:u.Syntax.BinaryExpression,this.operator=E,this.left=A,this.right=T}return g}();r.BinaryExpression=t;var n=function(){function g(E){this.type=u.Syntax.BlockStatement,this.body=E}return g}();r.BlockStatement=n;var a=function(){function g(E){this.type=u.Syntax.BreakStatement,this.label=E}return g}();r.BreakStatement=a;var o=function(){function g(E,A){this.type=u.Syntax.CallExpression,this.callee=E,this.arguments=A}return g}();r.CallExpression=o;var p=function(){function g(E,A){this.type=u.Syntax.CatchClause,this.param=E,this.body=A}return g}();r.CatchClause=p;var x=function(){function g(E){this.type=u.Syntax.ClassBody,this.body=E}return g}();r.ClassBody=x;var S=function(){function g(E,A,T){this.type=u.Syntax.ClassDeclaration,this.id=E,this.superClass=A,this.body=T}return g}();r.ClassDeclaration=S;var w=function(){function g(E,A,T){this.type=u.Syntax.ClassExpression,this.id=E,this.superClass=A,this.body=T}return g}();r.ClassExpression=w;var F=function(){function g(E,A){this.type=u.Syntax.MemberExpression,this.computed=!0,this.object=E,this.property=A}return g}();r.ComputedMemberExpression=F;var b=function(){function g(E,A,T){this.type=u.Syntax.ConditionalExpression,this.test=E,this.consequent=A,this.alternate=T}return g}();r.ConditionalExpression=b;var k=function(){function g(E){this.type=u.Syntax.ContinueStatement,this.label=E}return g}();r.ContinueStatement=k;var B=function(){function g(){this.type=u.Syntax.DebuggerStatement}return g}();r.DebuggerStatement=B;var N=function(){function g(E,A){this.type=u.Syntax.ExpressionStatement,this.expression=E,this.directive=A}return g}();r.Directive=N;var U=function(){function g(E,A){this.type=u.Syntax.DoWhileStatement,this.body=E,this.test=A}return g}();r.DoWhileStatement=U;var X=function(){function g(){this.type=u.Syntax.EmptyStatement}return g}();r.EmptyStatement=X;var K=function(){function g(E){this.type=u.Syntax.ExportAllDeclaration,this.source=E}return g}();r.ExportAllDeclaration=K;var ge=function(){function g(E){this.type=u.Syntax.ExportDefaultDeclaration,this.declaration=E}return g}();r.ExportDefaultDeclaration=ge;var di=function(){function g(E,A,T){this.type=u.Syntax.ExportNamedDeclaration,this.declaration=E,this.specifiers=A,this.source=T}return g}();r.ExportNamedDeclaration=di;var pi=function(){function g(E,A){this.type=u.Syntax.ExportSpecifier,this.exported=A,this.local=E}return g}();r.ExportSpecifier=pi;var fi=function(){function g(E){this.type=u.Syntax.ExpressionStatement,this.expression=E}return g}();r.ExpressionStatement=fi;var mi=function(){function g(E,A,T){this.type=u.Syntax.ForInStatement,this.left=E,this.right=A,this.body=T,this.each=!1}return g}();r.ForInStatement=mi;var Di=function(){function g(E,A,T){this.type=u.Syntax.ForOfStatement,this.left=E,this.right=A,this.body=T}return g}();r.ForOfStatement=Di;var xi=function(){function g(E,A,T,R){this.type=u.Syntax.ForStatement,this.init=E,this.test=A,this.update=T,this.body=R}return g}();r.ForStatement=xi;var yi=function(){function g(E,A,T,R){this.type=u.Syntax.FunctionDeclaration,this.id=E,this.params=A,this.body=T,this.generator=R,this.expression=!1,this.async=!1}return g}();r.FunctionDeclaration=yi;var vi=function(){function g(E,A,T,R){this.type=u.Syntax.FunctionExpression,this.id=E,this.params=A,this.body=T,this.generator=R,this.expression=!1,this.async=!1}return g}();r.FunctionExpression=vi;var gi=function(){function g(E){this.type=u.Syntax.Identifier,this.name=E}return g}();r.Identifier=gi;var Ei=function(){function g(E,A,T){this.type=u.Syntax.IfStatement,this.test=E,this.consequent=A,this.alternate=T}return g}();r.IfStatement=Ei;var Ci=function(){function g(E,A){this.type=u.Syntax.ImportDeclaration,this.specifiers=E,this.source=A}return g}();r.ImportDeclaration=Ci;var Si=function(){function g(E){this.type=u.Syntax.ImportDefaultSpecifier,this.local=E}return g}();r.ImportDefaultSpecifier=Si;var wi=function(){function g(E){this.type=u.Syntax.ImportNamespaceSpecifier,this.local=E}return g}();r.ImportNamespaceSpecifier=wi;var Ai=function(){function g(E,A){this.type=u.Syntax.ImportSpecifier,this.local=E,this.imported=A}return g}();r.ImportSpecifier=Ai;var Fi=function(){function g(E,A){this.type=u.Syntax.LabeledStatement,this.label=E,this.body=A}return g}();r.LabeledStatement=Fi;var bi=function(){function g(E,A){this.type=u.Syntax.Literal,this.value=E,this.raw=A}return g}();r.Literal=bi;var ki=function(){function g(E,A){this.type=u.Syntax.MetaProperty,this.meta=E,this.property=A}return g}();r.MetaProperty=ki;var Ti=function(){function g(E,A,T,R,Ee){this.type=u.Syntax.MethodDefinition,this.key=E,this.computed=A,this.value=T,this.kind=R,this.static=Ee}return g}();r.MethodDefinition=Ti;var Bi=function(){function g(E){this.type=u.Syntax.Program,this.body=E,this.sourceType="module"}return g}();r.Module=Bi;var Mi=function(){function g(E,A){this.type=u.Syntax.NewExpression,this.callee=E,this.arguments=A}return g}();r.NewExpression=Mi;var Ni=function(){function g(E){this.type=u.Syntax.ObjectExpression,this.properties=E}return g}();r.ObjectExpression=Ni;var Ii=function(){function g(E){this.type=u.Syntax.ObjectPattern,this.properties=E}return g}();r.ObjectPattern=Ii;var Pi=function(){function g(E,A,T,R,Ee,rr){this.type=u.Syntax.Property,this.key=A,this.computed=T,this.value=R,this.kind=E,this.method=Ee,this.shorthand=rr}return g}();r.Property=Pi;var Li=function(){function g(E,A,T,R){this.type=u.Syntax.Literal,this.value=E,this.raw=A,this.regex={pattern:T,flags:R}}return g}();r.RegexLiteral=Li;var Oi=function(){function g(E){this.type=u.Syntax.RestElement,this.argument=E}return g}();r.RestElement=Oi;var Ui=function(){function g(E){this.type=u.Syntax.ReturnStatement,this.argument=E}return g}();r.ReturnStatement=Ui;var Ji=function(){function g(E){this.type=u.Syntax.Program,this.body=E,this.sourceType="script"}return g}();r.Script=Ji;var Xi=function(){function g(E){this.type=u.Syntax.SequenceExpression,this.expressions=E}return g}();r.SequenceExpression=Xi;var Ri=function(){function g(E){this.type=u.Syntax.SpreadElement,this.argument=E}return g}();r.SpreadElement=Ri;var zi=function(){function g(E,A){this.type=u.Syntax.MemberExpression,this.computed=!1,this.object=E,this.property=A}return g}();r.StaticMemberExpression=zi;var Wi=function(){function g(){this.type=u.Syntax.Super}return g}();r.Super=Wi;var Yi=function(){function g(E,A){this.type=u.Syntax.SwitchCase,this.test=E,this.consequent=A}return g}();r.SwitchCase=Yi;var ji=function(){function g(E,A){this.type=u.Syntax.SwitchStatement,this.discriminant=E,this.cases=A}return g}();r.SwitchStatement=ji;var Hi=function(){function g(E,A){this.type=u.Syntax.TaggedTemplateExpression,this.tag=E,this.quasi=A}return g}();r.TaggedTemplateExpression=Hi;var Gi=function(){function g(E,A){this.type=u.Syntax.TemplateElement,this.value=E,this.tail=A}return g}();r.TemplateElement=Gi;var Ki=function(){function g(E,A){this.type=u.Syntax.TemplateLiteral,this.quasis=E,this.expressions=A}return g}();r.TemplateLiteral=Ki;var $i=function(){function g(){this.type=u.Syntax.ThisExpression}return g}();r.ThisExpression=$i;var Vi=function(){function g(E){this.type=u.Syntax.ThrowStatement,this.argument=E}return g}();r.ThrowStatement=Vi;var _i=function(){function g(E,A,T){this.type=u.Syntax.TryStatement,this.block=E,this.handler=A,this.finalizer=T}return g}();r.TryStatement=_i;var qi=function(){function g(E,A){this.type=u.Syntax.UnaryExpression,this.operator=E,this.argument=A,this.prefix=!0}return g}();r.UnaryExpression=qi;var Qi=function(){function g(E,A,T){this.type=u.Syntax.UpdateExpression,this.operator=E,this.argument=A,this.prefix=T}return g}();r.UpdateExpression=Qi;var Zi=function(){function g(E,A){this.type=u.Syntax.VariableDeclaration,this.declarations=E,this.kind=A}return g}();r.VariableDeclaration=Zi;var er=function(){function g(E,A){this.type=u.Syntax.VariableDeclarator,this.id=E,this.init=A}return g}();r.VariableDeclarator=er;var tr=function(){function g(E,A){this.type=u.Syntax.WhileStatement,this.test=E,this.body=A}return g}();r.WhileStatement=tr;var nr=function(){function g(E,A){this.type=u.Syntax.WithStatement,this.object=E,this.body=A}return g}();r.WithStatement=nr;var ir=function(){function g(E,A){this.type=u.Syntax.YieldExpression,this.argument=E,this.delegate=A}return g}();r.YieldExpression=ir},function(s,r,l){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=l(9),D=l(10),f=l(11),h=l(7),C=l(12),y=l(2),v=l(13),c="ArrowParameterPlaceHolder",m=function(){function d(t,n,a){n===void 0&&(n={}),this.config={range:typeof n.range=="boolean"&&n.range,loc:typeof n.loc=="boolean"&&n.loc,source:null,tokens:typeof n.tokens=="boolean"&&n.tokens,comment:typeof n.comment=="boolean"&&n.comment,tolerant:typeof n.tolerant=="boolean"&&n.tolerant},this.config.loc&&n.source&&n.source!==null&&(this.config.source=String(n.source)),this.delegate=a,this.errorHandler=new D.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new C.Scanner(t,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return d.prototype.throwError=function(t){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var o=Array.prototype.slice.call(arguments,1),p=t.replace(/%(\d)/g,function(F,b){return u.assert(b<o.length,"Message reference must be in range"),o[b]}),x=this.lastMarker.index,S=this.lastMarker.line,w=this.lastMarker.column+1;throw this.errorHandler.createError(x,S,w,p)},d.prototype.tolerateError=function(t){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var o=Array.prototype.slice.call(arguments,1),p=t.replace(/%(\d)/g,function(F,b){return u.assert(b<o.length,"Message reference must be in range"),o[b]}),x=this.lastMarker.index,S=this.scanner.lineNumber,w=this.lastMarker.column+1;this.errorHandler.tolerateError(x,S,w,p)},d.prototype.unexpectedTokenError=function(t,n){var a=n||f.Messages.UnexpectedToken,o;if(t?(n||(a=t.type===2?f.Messages.UnexpectedEOS:t.type===3?f.Messages.UnexpectedIdentifier:t.type===6?f.Messages.UnexpectedNumber:t.type===8?f.Messages.UnexpectedString:t.type===10?f.Messages.UnexpectedTemplate:f.Messages.UnexpectedToken,t.type===4&&(this.scanner.isFutureReservedWord(t.value)?a=f.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(t.value)&&(a=f.Messages.StrictReservedWord))),o=t.value):o="ILLEGAL",a=a.replace("%0",o),t&&typeof t.lineNumber=="number"){var p=t.start,x=t.lineNumber,S=this.lastMarker.index-this.lastMarker.column,w=t.start-S+1;return this.errorHandler.createError(p,x,w,a)}else{var p=this.lastMarker.index,x=this.lastMarker.line,w=this.lastMarker.column+1;return this.errorHandler.createError(p,x,w,a)}},d.prototype.throwUnexpectedToken=function(t,n){throw this.unexpectedTokenError(t,n)},d.prototype.tolerateUnexpectedToken=function(t,n){this.errorHandler.tolerate(this.unexpectedTokenError(t,n))},d.prototype.collectComments=function(){if(!this.config.comment)this.scanner.scanComments();else{var t=this.scanner.scanComments();if(t.length>0&&this.delegate)for(var n=0;n<t.length;++n){var a=t[n],o=void 0;o={type:a.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(a.slice[0],a.slice[1])},this.config.range&&(o.range=a.range),this.config.loc&&(o.loc=a.loc);var p={start:{line:a.loc.start.line,column:a.loc.start.column,offset:a.range[0]},end:{line:a.loc.end.line,column:a.loc.end.column,offset:a.range[1]}};this.delegate(o,p)}}},d.prototype.getTokenRaw=function(t){return this.scanner.source.slice(t.start,t.end)},d.prototype.convertToken=function(t){var n={type:v.TokenName[t.type],value:this.getTokenRaw(t)};if(this.config.range&&(n.range=[t.start,t.end]),this.config.loc&&(n.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),t.type===9){var a=t.pattern,o=t.flags;n.regex={pattern:a,flags:o}}return n},d.prototype.nextToken=function(){var t=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var n=this.scanner.lex();return this.hasLineTerminator=t.lineNumber!==n.lineNumber,n&&this.context.strict&&n.type===3&&this.scanner.isStrictModeReservedWord(n.value)&&(n.type=4),this.lookahead=n,this.config.tokens&&n.type!==2&&this.tokens.push(this.convertToken(n)),t},d.prototype.nextRegexToken=function(){this.collectComments();var t=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(t))),this.lookahead=t,this.nextToken(),t},d.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},d.prototype.startNode=function(t,n){n===void 0&&(n=0);var a=t.start-t.lineStart,o=t.lineNumber;return a<0&&(a+=n,o--),{index:t.start,line:o,column:a}},d.prototype.finalize=function(t,n){if(this.config.range&&(n.range=[t.index,this.lastMarker.index]),this.config.loc&&(n.loc={start:{line:t.line,column:t.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(n.loc.source=this.config.source)),this.delegate){var a={start:{line:t.line,column:t.column,offset:t.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(n,a)}return n},d.prototype.expect=function(t){var n=this.nextToken();(n.type!==7||n.value!==t)&&this.throwUnexpectedToken(n)},d.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var t=this.lookahead;t.type===7&&t.value===","?this.nextToken():t.type===7&&t.value===";"?(this.nextToken(),this.tolerateUnexpectedToken(t)):this.tolerateUnexpectedToken(t,f.Messages.UnexpectedToken)}else this.expect(",")},d.prototype.expectKeyword=function(t){var n=this.nextToken();(n.type!==4||n.value!==t)&&this.throwUnexpectedToken(n)},d.prototype.match=function(t){return this.lookahead.type===7&&this.lookahead.value===t},d.prototype.matchKeyword=function(t){return this.lookahead.type===4&&this.lookahead.value===t},d.prototype.matchContextualKeyword=function(t){return this.lookahead.type===3&&this.lookahead.value===t},d.prototype.matchAssign=function(){if(this.lookahead.type!==7)return!1;var t=this.lookahead.value;return t==="="||t==="*="||t==="**="||t==="/="||t==="%="||t==="+="||t==="-="||t==="<<="||t===">>="||t===">>>="||t==="&="||t==="^="||t==="|="},d.prototype.isolateCoverGrammar=function(t){var n=this.context.isBindingElement,a=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var p=t.call(this);return this.context.firstCoverInitializedNameError!==null&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=n,this.context.isAssignmentTarget=a,this.context.firstCoverInitializedNameError=o,p},d.prototype.inheritCoverGrammar=function(t){var n=this.context.isBindingElement,a=this.context.isAssignmentTarget,o=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var p=t.call(this);return this.context.isBindingElement=this.context.isBindingElement&&n,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&a,this.context.firstCoverInitializedNameError=o||this.context.firstCoverInitializedNameError,p},d.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type!==2&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},d.prototype.parsePrimaryExpression=function(){var t=this.createNode(),n,a,o;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&this.lookahead.value==="await"&&this.tolerateUnexpectedToken(this.lookahead),n=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(t,new h.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,f.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,a=this.nextToken(),o=this.getTokenRaw(a),n=this.finalize(t,new h.Literal(a.value,o));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,a=this.nextToken(),o=this.getTokenRaw(a),n=this.finalize(t,new h.Literal(a.value==="true",o));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,a=this.nextToken(),o=this.getTokenRaw(a),n=this.finalize(t,new h.Literal(null,o));break;case 10:n=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,n=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":n=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":n=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,a=this.nextRegexToken(),o=this.getTokenRaw(a),n=this.finalize(t,new h.RegexLiteral(a.regex,o,a.pattern,a.flags));break;default:n=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?n=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?n=this.finalize(t,new h.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?n=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),n=this.finalize(t,new h.ThisExpression)):this.matchKeyword("class")?n=this.parseClassExpression():n=this.throwUnexpectedToken(this.nextToken()));break;default:n=this.throwUnexpectedToken(this.nextToken())}return n},d.prototype.parseSpreadElement=function(){var t=this.createNode();this.expect("...");var n=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(t,new h.SpreadElement(n))},d.prototype.parseArrayInitializer=function(){var t=this.createNode(),n=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),n.push(null);else if(this.match("...")){var a=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),n.push(a)}else n.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(t,new h.ArrayExpression(n))},d.prototype.parsePropertyMethod=function(t){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var n=this.context.strict,a=this.context.allowStrictDirective;this.context.allowStrictDirective=t.simple;var o=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&t.firstRestricted&&this.tolerateUnexpectedToken(t.firstRestricted,t.message),this.context.strict&&t.stricted&&this.tolerateUnexpectedToken(t.stricted,t.message),this.context.strict=n,this.context.allowStrictDirective=a,o},d.prototype.parsePropertyMethodFunction=function(){var t=!1,n=this.createNode(),a=this.context.allowYield;this.context.allowYield=!0;var o=this.parseFormalParameters(),p=this.parsePropertyMethod(o);return this.context.allowYield=a,this.finalize(n,new h.FunctionExpression(null,o.params,p,t))},d.prototype.parsePropertyMethodAsyncFunction=function(){var t=this.createNode(),n=this.context.allowYield,a=this.context.await;this.context.allowYield=!1,this.context.await=!0;var o=this.parseFormalParameters(),p=this.parsePropertyMethod(o);return this.context.allowYield=n,this.context.await=a,this.finalize(t,new h.AsyncFunctionExpression(null,o.params,p))},d.prototype.parseObjectPropertyKey=function(){var t=this.createNode(),n=this.nextToken(),a;switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,f.Messages.StrictOctalLiteral);var o=this.getTokenRaw(n);a=this.finalize(t,new h.Literal(n.value,o));break;case 3:case 1:case 5:case 4:a=this.finalize(t,new h.Identifier(n.value));break;case 7:n.value==="["?(a=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):a=this.throwUnexpectedToken(n);break;default:a=this.throwUnexpectedToken(n)}return a},d.prototype.isPropertyKey=function(t,n){return t.type===y.Syntax.Identifier&&t.name===n||t.type===y.Syntax.Literal&&t.value===n},d.prototype.parseObjectProperty=function(t){var n=this.createNode(),a=this.lookahead,o,p=null,x=null,S=!1,w=!1,F=!1,b=!1;if(a.type===3){var k=a.value;this.nextToken(),S=this.match("["),b=!this.hasLineTerminator&&k==="async"&&!this.match(":")&&!this.match("(")&&!this.match("*")&&!this.match(","),p=b?this.parseObjectPropertyKey():this.finalize(n,new h.Identifier(k))}else this.match("*")?this.nextToken():(S=this.match("["),p=this.parseObjectPropertyKey());var B=this.qualifiedPropertyName(this.lookahead);if(a.type===3&&!b&&a.value==="get"&&B)o="get",S=this.match("["),p=this.parseObjectPropertyKey(),this.context.allowYield=!1,x=this.parseGetterMethod();else if(a.type===3&&!b&&a.value==="set"&&B)o="set",S=this.match("["),p=this.parseObjectPropertyKey(),x=this.parseSetterMethod();else if(a.type===7&&a.value==="*"&&B)o="init",S=this.match("["),p=this.parseObjectPropertyKey(),x=this.parseGeneratorMethod(),w=!0;else if(p||this.throwUnexpectedToken(this.lookahead),o="init",this.match(":")&&!b)!S&&this.isPropertyKey(p,"__proto__")&&(t.value&&this.tolerateError(f.Messages.DuplicateProtoProperty),t.value=!0),this.nextToken(),x=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))x=b?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),w=!0;else if(a.type===3){var k=this.finalize(n,new h.Identifier(a.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),F=!0;var N=this.isolateCoverGrammar(this.parseAssignmentExpression);x=this.finalize(n,new h.AssignmentPattern(k,N))}else F=!0,x=k}else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new h.Property(o,p,S,x,w,F))},d.prototype.parseObjectInitializer=function(){var t=this.createNode();this.expect("{");for(var n=[],a={value:!1};!this.match("}");)n.push(this.parseObjectProperty(a)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(t,new h.ObjectExpression(n))},d.prototype.parseTemplateHead=function(){u.assert(this.lookahead.head,"Template literal must start with a template head");var t=this.createNode(),n=this.nextToken(),a=n.value,o=n.cooked;return this.finalize(t,new h.TemplateElement({raw:a,cooked:o},n.tail))},d.prototype.parseTemplateElement=function(){this.lookahead.type!==10&&this.throwUnexpectedToken();var t=this.createNode(),n=this.nextToken(),a=n.value,o=n.cooked;return this.finalize(t,new h.TemplateElement({raw:a,cooked:o},n.tail))},d.prototype.parseTemplateLiteral=function(){var t=this.createNode(),n=[],a=[],o=this.parseTemplateHead();for(a.push(o);!o.tail;)n.push(this.parseExpression()),o=this.parseTemplateElement(),a.push(o);return this.finalize(t,new h.TemplateLiteral(a,n))},d.prototype.reinterpretExpressionAsPattern=function(t){switch(t.type){case y.Syntax.Identifier:case y.Syntax.MemberExpression:case y.Syntax.RestElement:case y.Syntax.AssignmentPattern:break;case y.Syntax.SpreadElement:t.type=y.Syntax.RestElement,this.reinterpretExpressionAsPattern(t.argument);break;case y.Syntax.ArrayExpression:t.type=y.Syntax.ArrayPattern;for(var n=0;n<t.elements.length;n++)t.elements[n]!==null&&this.reinterpretExpressionAsPattern(t.elements[n]);break;case y.Syntax.ObjectExpression:t.type=y.Syntax.ObjectPattern;for(var n=0;n<t.properties.length;n++)this.reinterpretExpressionAsPattern(t.properties[n].value);break;case y.Syntax.AssignmentExpression:t.type=y.Syntax.AssignmentPattern,delete t.operator,this.reinterpretExpressionAsPattern(t.left);break;default:break}},d.prototype.parseGroupExpression=function(){var t;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),t={type:c,params:[],async:!1};else{var n=this.lookahead,a=[];if(this.match("..."))t=this.parseRestElement(a),this.expect(")"),this.match("=>")||this.expect("=>"),t={type:c,params:[t],async:!1};else{var o=!1;if(this.context.isBindingElement=!0,t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var p=[];for(this.context.isAssignmentTarget=!1,p.push(t);this.lookahead.type!==2&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var x=0;x<p.length;x++)this.reinterpretExpressionAsPattern(p[x]);o=!0,t={type:c,params:p,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),p.push(this.parseRestElement(a)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var x=0;x<p.length;x++)this.reinterpretExpressionAsPattern(p[x]);o=!0,t={type:c,params:p,async:!1}}else p.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(o)break}o||(t=this.finalize(this.startNode(n),new h.SequenceExpression(p)))}if(!o){if(this.expect(")"),this.match("=>")&&(t.type===y.Syntax.Identifier&&t.name==="yield"&&(o=!0,t={type:c,params:[t],async:!1}),!o)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),t.type===y.Syntax.SequenceExpression)for(var x=0;x<t.expressions.length;x++)this.reinterpretExpressionAsPattern(t.expressions[x]);else this.reinterpretExpressionAsPattern(t);var S=t.type===y.Syntax.SequenceExpression?t.expressions:[t];t={type:c,params:S,async:!1}}this.context.isBindingElement=!1}}}return t},d.prototype.parseArguments=function(){this.expect("(");var t=[];if(!this.match(")"))for(;;){var n=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(t.push(n),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),t},d.prototype.isIdentifierName=function(t){return t.type===3||t.type===4||t.type===1||t.type===5},d.prototype.parseIdentifierName=function(){var t=this.createNode(),n=this.nextToken();return this.isIdentifierName(n)||this.throwUnexpectedToken(n),this.finalize(t,new h.Identifier(n.value))},d.prototype.parseNewExpression=function(){var t=this.createNode(),n=this.parseIdentifierName();u.assert(n.name==="new","New expression must start with `new`");var a;if(this.match("."))if(this.nextToken(),this.lookahead.type===3&&this.context.inFunctionBody&&this.lookahead.value==="target"){var o=this.parseIdentifierName();a=new h.MetaProperty(n,o)}else this.throwUnexpectedToken(this.lookahead);else{var p=this.isolateCoverGrammar(this.parseLeftHandSideExpression),x=this.match("(")?this.parseArguments():[];a=new h.NewExpression(p,x),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(t,a)},d.prototype.parseAsyncArgument=function(){var t=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,t},d.prototype.parseAsyncArguments=function(){this.expect("(");var t=[];if(!this.match(")"))for(;;){var n=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(t.push(n),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),t},d.prototype.parseLeftHandSideExpressionAllowCall=function(){var t=this.lookahead,n=this.matchContextualKeyword("async"),a=this.context.allowIn;this.context.allowIn=!0;var o;for(this.matchKeyword("super")&&this.context.inFunctionBody?(o=this.createNode(),this.nextToken(),o=this.finalize(o,new h.Super),!this.match("(")&&!this.match(".")&&!this.match("[")&&this.throwUnexpectedToken(this.lookahead)):o=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var p=this.parseIdentifierName();o=this.finalize(this.startNode(t),new h.StaticMemberExpression(o,p))}else if(this.match("(")){var x=n&&t.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var S=x?this.parseAsyncArguments():this.parseArguments();if(o=this.finalize(this.startNode(t),new h.CallExpression(o,S)),x&&this.match("=>")){for(var w=0;w<S.length;++w)this.reinterpretExpressionAsPattern(S[w]);o={type:c,params:S,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var p=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),o=this.finalize(this.startNode(t),new h.ComputedMemberExpression(o,p))}else if(this.lookahead.type===10&&this.lookahead.head){var F=this.parseTemplateLiteral();o=this.finalize(this.startNode(t),new h.TaggedTemplateExpression(o,F))}else break;return this.context.allowIn=a,o},d.prototype.parseSuper=function(){var t=this.createNode();return this.expectKeyword("super"),!this.match("[")&&!this.match(".")&&this.throwUnexpectedToken(this.lookahead),this.finalize(t,new h.Super)},d.prototype.parseLeftHandSideExpression=function(){u.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var t=this.startNode(this.lookahead),n=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var a=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),n=this.finalize(t,new h.ComputedMemberExpression(n,a))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var a=this.parseIdentifierName();n=this.finalize(t,new h.StaticMemberExpression(n,a))}else if(this.lookahead.type===10&&this.lookahead.head){var o=this.parseTemplateLiteral();n=this.finalize(t,new h.TaggedTemplateExpression(n,o))}else break;return n},d.prototype.parseUpdateExpression=function(){var t,n=this.lookahead;if(this.match("++")||this.match("--")){var a=this.startNode(n),o=this.nextToken();t=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&t.type===y.Syntax.Identifier&&this.scanner.isRestrictedWord(t.name)&&this.tolerateError(f.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(f.Messages.InvalidLHSInAssignment);var p=!0;t=this.finalize(a,new h.UpdateExpression(o.value,t,p)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(t=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&this.lookahead.type===7&&(this.match("++")||this.match("--"))){this.context.strict&&t.type===y.Syntax.Identifier&&this.scanner.isRestrictedWord(t.name)&&this.tolerateError(f.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(f.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var x=this.nextToken().value,p=!1;t=this.finalize(this.startNode(n),new h.UpdateExpression(x,t,p))}return t},d.prototype.parseAwaitExpression=function(){var t=this.createNode();this.nextToken();var n=this.parseUnaryExpression();return this.finalize(t,new h.AwaitExpression(n))},d.prototype.parseUnaryExpression=function(){var t;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var n=this.startNode(this.lookahead),a=this.nextToken();t=this.inheritCoverGrammar(this.parseUnaryExpression),t=this.finalize(n,new h.UnaryExpression(a.value,t)),this.context.strict&&t.operator==="delete"&&t.argument.type===y.Syntax.Identifier&&this.tolerateError(f.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else this.context.await&&this.matchContextualKeyword("await")?t=this.parseAwaitExpression():t=this.parseUpdateExpression();return t},d.prototype.parseExponentiationExpression=function(){var t=this.lookahead,n=this.inheritCoverGrammar(this.parseUnaryExpression);if(n.type!==y.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var a=n,o=this.isolateCoverGrammar(this.parseExponentiationExpression);n=this.finalize(this.startNode(t),new h.BinaryExpression("**",a,o))}return n},d.prototype.binaryPrecedence=function(t){var n=t.value,a;return t.type===7?a=this.operatorPrecedence[n]||0:t.type===4?a=n==="instanceof"||this.context.allowIn&&n==="in"?7:0:a=0,a},d.prototype.parseBinaryExpression=function(){var t=this.lookahead,n=this.inheritCoverGrammar(this.parseExponentiationExpression),a=this.lookahead,o=this.binaryPrecedence(a);if(o>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var p=[t,this.lookahead],x=n,S=this.isolateCoverGrammar(this.parseExponentiationExpression),w=[x,a.value,S],F=[o];o=this.binaryPrecedence(this.lookahead),!(o<=0);){for(;w.length>2&&o<=F[F.length-1];){S=w.pop();var b=w.pop();F.pop(),x=w.pop(),p.pop();var k=this.startNode(p[p.length-1]);w.push(this.finalize(k,new h.BinaryExpression(b,x,S)))}w.push(this.nextToken().value),F.push(o),p.push(this.lookahead),w.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var B=w.length-1;n=w[B];for(var N=p.pop();B>1;){var U=p.pop(),X=N&&N.lineStart,k=this.startNode(U,X),b=w[B-1];n=this.finalize(k,new h.BinaryExpression(b,w[B-2],n)),B-=2,N=U}}return n},d.prototype.parseConditionalExpression=function(){var t=this.lookahead,n=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var a=this.context.allowIn;this.context.allowIn=!0;var o=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=a,this.expect(":");var p=this.isolateCoverGrammar(this.parseAssignmentExpression);n=this.finalize(this.startNode(t),new h.ConditionalExpression(n,o,p)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return n},d.prototype.checkPatternParam=function(t,n){switch(n.type){case y.Syntax.Identifier:this.validateParam(t,n,n.name);break;case y.Syntax.RestElement:this.checkPatternParam(t,n.argument);break;case y.Syntax.AssignmentPattern:this.checkPatternParam(t,n.left);break;case y.Syntax.ArrayPattern:for(var a=0;a<n.elements.length;a++)n.elements[a]!==null&&this.checkPatternParam(t,n.elements[a]);break;case y.Syntax.ObjectPattern:for(var a=0;a<n.properties.length;a++)this.checkPatternParam(t,n.properties[a].value);break;default:break}t.simple=t.simple&&n instanceof h.Identifier},d.prototype.reinterpretAsCoverFormalsList=function(t){var n=[t],a,o=!1;switch(t.type){case y.Syntax.Identifier:break;case c:n=t.params,o=t.async;break;default:return null}a={simple:!0,paramSet:{}};for(var p=0;p<n.length;++p){var x=n[p];x.type===y.Syntax.AssignmentPattern?x.right.type===y.Syntax.YieldExpression&&(x.right.argument&&this.throwUnexpectedToken(this.lookahead),x.right.type=y.Syntax.Identifier,x.right.name="yield",delete x.right.argument,delete x.right.delegate):o&&x.type===y.Syntax.Identifier&&x.name==="await"&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(a,x),n[p]=x}if(this.context.strict||!this.context.allowYield)for(var p=0;p<n.length;++p){var x=n[p];x.type===y.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(a.message===f.Messages.StrictParamDupe){var S=this.context.strict?a.stricted:a.firstRestricted;this.throwUnexpectedToken(S,a.message)}return{simple:a.simple,params:n,stricted:a.stricted,firstRestricted:a.firstRestricted,message:a.message}},d.prototype.parseAssignmentExpression=function(){var t;if(!this.context.allowYield&&this.matchKeyword("yield"))t=this.parseYieldExpression();else{var n=this.lookahead,a=n;if(t=this.parseConditionalExpression(),a.type===3&&a.lineNumber===this.lookahead.lineNumber&&a.value==="async"&&(this.lookahead.type===3||this.matchKeyword("yield"))){var o=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(o),t={type:c,params:[o],async:!0}}if(t.type===c||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var p=t.async,x=this.reinterpretAsCoverFormalsList(t);if(x){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var S=this.context.strict,w=this.context.allowStrictDirective;this.context.allowStrictDirective=x.simple;var F=this.context.allowYield,b=this.context.await;this.context.allowYield=!0,this.context.await=p;var k=this.startNode(n);this.expect("=>");var B=void 0;if(this.match("{")){var N=this.context.allowIn;this.context.allowIn=!0,B=this.parseFunctionSourceElements(),this.context.allowIn=N}else B=this.isolateCoverGrammar(this.parseAssignmentExpression);var U=B.type!==y.Syntax.BlockStatement;this.context.strict&&x.firstRestricted&&this.throwUnexpectedToken(x.firstRestricted,x.message),this.context.strict&&x.stricted&&this.tolerateUnexpectedToken(x.stricted,x.message),t=p?this.finalize(k,new h.AsyncArrowFunctionExpression(x.params,B,U)):this.finalize(k,new h.ArrowFunctionExpression(x.params,B,U)),this.context.strict=S,this.context.allowStrictDirective=w,this.context.allowYield=F,this.context.await=b}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(f.Messages.InvalidLHSInAssignment),this.context.strict&&t.type===y.Syntax.Identifier){var X=t;this.scanner.isRestrictedWord(X.name)&&this.tolerateUnexpectedToken(a,f.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(X.name)&&this.tolerateUnexpectedToken(a,f.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(t):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),a=this.nextToken();var K=a.value,ge=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(n),new h.AssignmentExpression(K,t,ge)),this.context.firstCoverInitializedNameError=null}}return t},d.prototype.parseExpression=function(){var t=this.lookahead,n=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var a=[];for(a.push(n);this.lookahead.type!==2&&this.match(",");)this.nextToken(),a.push(this.isolateCoverGrammar(this.parseAssignmentExpression));n=this.finalize(this.startNode(t),new h.SequenceExpression(a))}return n},d.prototype.parseStatementListItem=function(){var t;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,f.Messages.IllegalExportDeclaration),t=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,f.Messages.IllegalImportDeclaration),t=this.parseImportDeclaration();break;case"const":t=this.parseLexicalDeclaration({inFor:!1});break;case"function":t=this.parseFunctionDeclaration();break;case"class":t=this.parseClassDeclaration();break;case"let":t=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:t=this.parseStatement();break}else t=this.parseStatement();return t},d.prototype.parseBlock=function(){var t=this.createNode();this.expect("{");for(var n=[];!this.match("}");)n.push(this.parseStatementListItem());return this.expect("}"),this.finalize(t,new h.BlockStatement(n))},d.prototype.parseLexicalBinding=function(t,n){var a=this.createNode(),o=[],p=this.parsePattern(o,t);this.context.strict&&p.type===y.Syntax.Identifier&&this.scanner.isRestrictedWord(p.name)&&this.tolerateError(f.Messages.StrictVarName);var x=null;return t==="const"?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),x=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(f.Messages.DeclarationMissingInitializer,"const")):(!n.inFor&&p.type!==y.Syntax.Identifier||this.match("="))&&(this.expect("="),x=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(a,new h.VariableDeclarator(p,x))},d.prototype.parseBindingList=function(t,n){for(var a=[this.parseLexicalBinding(t,n)];this.match(",");)this.nextToken(),a.push(this.parseLexicalBinding(t,n));return a},d.prototype.isLexicalDeclaration=function(){var t=this.scanner.saveState();this.scanner.scanComments();var n=this.scanner.lex();return this.scanner.restoreState(t),n.type===3||n.type===7&&n.value==="["||n.type===7&&n.value==="{"||n.type===4&&n.value==="let"||n.type===4&&n.value==="yield"},d.prototype.parseLexicalDeclaration=function(t){var n=this.createNode(),a=this.nextToken().value;u.assert(a==="let"||a==="const","Lexical declaration must be either let or const");var o=this.parseBindingList(a,t);return this.consumeSemicolon(),this.finalize(n,new h.VariableDeclaration(o,a))},d.prototype.parseBindingRestElement=function(t,n){var a=this.createNode();this.expect("...");var o=this.parsePattern(t,n);return this.finalize(a,new h.RestElement(o))},d.prototype.parseArrayPattern=function(t,n){var a=this.createNode();this.expect("[");for(var o=[];!this.match("]");)if(this.match(","))this.nextToken(),o.push(null);else{if(this.match("...")){o.push(this.parseBindingRestElement(t,n));break}else o.push(this.parsePatternWithDefault(t,n));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(a,new h.ArrayPattern(o))},d.prototype.parsePropertyPattern=function(t,n){var a=this.createNode(),o=!1,p=!1,x=!1,S,w;if(this.lookahead.type===3){var F=this.lookahead;S=this.parseVariableIdentifier();var b=this.finalize(a,new h.Identifier(F.value));if(this.match("=")){t.push(F),p=!0,this.nextToken();var k=this.parseAssignmentExpression();w=this.finalize(this.startNode(F),new h.AssignmentPattern(b,k))}else this.match(":")?(this.expect(":"),w=this.parsePatternWithDefault(t,n)):(t.push(F),p=!0,w=b)}else o=this.match("["),S=this.parseObjectPropertyKey(),this.expect(":"),w=this.parsePatternWithDefault(t,n);return this.finalize(a,new h.Property("init",S,o,w,x,p))},d.prototype.parseObjectPattern=function(t,n){var a=this.createNode(),o=[];for(this.expect("{");!this.match("}");)o.push(this.parsePropertyPattern(t,n)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(a,new h.ObjectPattern(o))},d.prototype.parsePattern=function(t,n){var a;return this.match("[")?a=this.parseArrayPattern(t,n):this.match("{")?a=this.parseObjectPattern(t,n):(this.matchKeyword("let")&&(n==="const"||n==="let")&&this.tolerateUnexpectedToken(this.lookahead,f.Messages.LetInLexicalBinding),t.push(this.lookahead),a=this.parseVariableIdentifier(n)),a},d.prototype.parsePatternWithDefault=function(t,n){var a=this.lookahead,o=this.parsePattern(t,n);if(this.match("=")){this.nextToken();var p=this.context.allowYield;this.context.allowYield=!0;var x=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=p,o=this.finalize(this.startNode(a),new h.AssignmentPattern(o,x))}return o},d.prototype.parseVariableIdentifier=function(t){var n=this.createNode(),a=this.nextToken();return a.type===4&&a.value==="yield"?this.context.strict?this.tolerateUnexpectedToken(a,f.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(a):a.type!==3?this.context.strict&&a.type===4&&this.scanner.isStrictModeReservedWord(a.value)?this.tolerateUnexpectedToken(a,f.Messages.StrictReservedWord):(this.context.strict||a.value!=="let"||t!=="var")&&this.throwUnexpectedToken(a):(this.context.isModule||this.context.await)&&a.type===3&&a.value==="await"&&this.tolerateUnexpectedToken(a),this.finalize(n,new h.Identifier(a.value))},d.prototype.parseVariableDeclaration=function(t){var n=this.createNode(),a=[],o=this.parsePattern(a,"var");this.context.strict&&o.type===y.Syntax.Identifier&&this.scanner.isRestrictedWord(o.name)&&this.tolerateError(f.Messages.StrictVarName);var p=null;return this.match("=")?(this.nextToken(),p=this.isolateCoverGrammar(this.parseAssignmentExpression)):o.type!==y.Syntax.Identifier&&!t.inFor&&this.expect("="),this.finalize(n,new h.VariableDeclarator(o,p))},d.prototype.parseVariableDeclarationList=function(t){var n={inFor:t.inFor},a=[];for(a.push(this.parseVariableDeclaration(n));this.match(",");)this.nextToken(),a.push(this.parseVariableDeclaration(n));return a},d.prototype.parseVariableStatement=function(){var t=this.createNode();this.expectKeyword("var");var n=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(t,new h.VariableDeclaration(n,"var"))},d.prototype.parseEmptyStatement=function(){var t=this.createNode();return this.expect(";"),this.finalize(t,new h.EmptyStatement)},d.prototype.parseExpressionStatement=function(){var t=this.createNode(),n=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new h.ExpressionStatement(n))},d.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(f.Messages.StrictFunction),this.parseStatement()},d.prototype.parseIfStatement=function(){var t=this.createNode(),n,a=null;this.expectKeyword("if"),this.expect("(");var o=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new h.EmptyStatement)):(this.expect(")"),n=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),a=this.parseIfClause())),this.finalize(t,new h.IfStatement(o,n,a))},d.prototype.parseDoWhileStatement=function(){var t=this.createNode();this.expectKeyword("do");var n=this.context.inIteration;this.context.inIteration=!0;var a=this.parseStatement();this.context.inIteration=n,this.expectKeyword("while"),this.expect("(");var o=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(t,new h.DoWhileStatement(a,o))},d.prototype.parseWhileStatement=function(){var t=this.createNode(),n;this.expectKeyword("while"),this.expect("(");var a=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new h.EmptyStatement);else{this.expect(")");var o=this.context.inIteration;this.context.inIteration=!0,n=this.parseStatement(),this.context.inIteration=o}return this.finalize(t,new h.WhileStatement(a,n))},d.prototype.parseForStatement=function(){var t=null,n=null,a=null,o=!0,p,x,S=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){t=this.createNode(),this.nextToken();var w=this.context.allowIn;this.context.allowIn=!1;var F=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=w,F.length===1&&this.matchKeyword("in")){var b=F[0];b.init&&(b.id.type===y.Syntax.ArrayPattern||b.id.type===y.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(f.Messages.ForInOfLoopInitializer,"for-in"),t=this.finalize(t,new h.VariableDeclaration(F,"var")),this.nextToken(),p=t,x=this.parseExpression(),t=null}else F.length===1&&F[0].init===null&&this.matchContextualKeyword("of")?(t=this.finalize(t,new h.VariableDeclaration(F,"var")),this.nextToken(),p=t,x=this.parseAssignmentExpression(),t=null,o=!1):(t=this.finalize(t,new h.VariableDeclaration(F,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){t=this.createNode();var k=this.nextToken().value;if(!this.context.strict&&this.lookahead.value==="in")t=this.finalize(t,new h.Identifier(k)),this.nextToken(),p=t,x=this.parseExpression(),t=null;else{var w=this.context.allowIn;this.context.allowIn=!1;var F=this.parseBindingList(k,{inFor:!0});this.context.allowIn=w,F.length===1&&F[0].init===null&&this.matchKeyword("in")?(t=this.finalize(t,new h.VariableDeclaration(F,k)),this.nextToken(),p=t,x=this.parseExpression(),t=null):F.length===1&&F[0].init===null&&this.matchContextualKeyword("of")?(t=this.finalize(t,new h.VariableDeclaration(F,k)),this.nextToken(),p=t,x=this.parseAssignmentExpression(),t=null,o=!1):(this.consumeSemicolon(),t=this.finalize(t,new h.VariableDeclaration(F,k)))}}else{var B=this.lookahead,w=this.context.allowIn;if(this.context.allowIn=!1,t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=w,this.matchKeyword("in"))(!this.context.isAssignmentTarget||t.type===y.Syntax.AssignmentExpression)&&this.tolerateError(f.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(t),p=t,x=this.parseExpression(),t=null;else if(this.matchContextualKeyword("of"))(!this.context.isAssignmentTarget||t.type===y.Syntax.AssignmentExpression)&&this.tolerateError(f.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(t),p=t,x=this.parseAssignmentExpression(),t=null,o=!1;else{if(this.match(",")){for(var N=[t];this.match(",");)this.nextToken(),N.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(B),new h.SequenceExpression(N))}this.expect(";")}}typeof p>"u"&&(this.match(";")||(n=this.parseExpression()),this.expect(";"),this.match(")")||(a=this.parseExpression()));var U;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),U=this.finalize(this.createNode(),new h.EmptyStatement);else{this.expect(")");var X=this.context.inIteration;this.context.inIteration=!0,U=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=X}return typeof p>"u"?this.finalize(S,new h.ForStatement(t,n,a,U)):o?this.finalize(S,new h.ForInStatement(p,x,U)):this.finalize(S,new h.ForOfStatement(p,x,U))},d.prototype.parseContinueStatement=function(){var t=this.createNode();this.expectKeyword("continue");var n=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var a=this.parseVariableIdentifier();n=a;var o="$"+a.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,o)||this.throwError(f.Messages.UnknownLabel,a.name)}return this.consumeSemicolon(),n===null&&!this.context.inIteration&&this.throwError(f.Messages.IllegalContinue),this.finalize(t,new h.ContinueStatement(n))},d.prototype.parseBreakStatement=function(){var t=this.createNode();this.expectKeyword("break");var n=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var a=this.parseVariableIdentifier(),o="$"+a.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,o)||this.throwError(f.Messages.UnknownLabel,a.name),n=a}return this.consumeSemicolon(),n===null&&!this.context.inIteration&&!this.context.inSwitch&&this.throwError(f.Messages.IllegalBreak),this.finalize(t,new h.BreakStatement(n))},d.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(f.Messages.IllegalReturn);var t=this.createNode();this.expectKeyword("return");var n=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&this.lookahead.type!==2||this.lookahead.type===8||this.lookahead.type===10,a=n?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(t,new h.ReturnStatement(a))},d.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(f.Messages.StrictModeWith);var t=this.createNode(),n;this.expectKeyword("with"),this.expect("(");var a=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new h.EmptyStatement)):(this.expect(")"),n=this.parseStatement()),this.finalize(t,new h.WithStatement(a,n))},d.prototype.parseSwitchCase=function(){var t=this.createNode(),n;this.matchKeyword("default")?(this.nextToken(),n=null):(this.expectKeyword("case"),n=this.parseExpression()),this.expect(":");for(var a=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)a.push(this.parseStatementListItem());return this.finalize(t,new h.SwitchCase(n,a))},d.prototype.parseSwitchStatement=function(){var t=this.createNode();this.expectKeyword("switch"),this.expect("(");var n=this.parseExpression();this.expect(")");var a=this.context.inSwitch;this.context.inSwitch=!0;var o=[],p=!1;for(this.expect("{");!this.match("}");){var x=this.parseSwitchCase();x.test===null&&(p&&this.throwError(f.Messages.MultipleDefaultsInSwitch),p=!0),o.push(x)}return this.expect("}"),this.context.inSwitch=a,this.finalize(t,new h.SwitchStatement(n,o))},d.prototype.parseLabelledStatement=function(){var t=this.createNode(),n=this.parseExpression(),a;if(n.type===y.Syntax.Identifier&&this.match(":")){this.nextToken();var o=n,p="$"+o.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,p)&&this.throwError(f.Messages.Redeclaration,"Label",o.name),this.context.labelSet[p]=!0;var x=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),x=this.parseClassDeclaration();else if(this.matchKeyword("function")){var S=this.lookahead,w=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(S,f.Messages.StrictFunction):w.generator&&this.tolerateUnexpectedToken(S,f.Messages.GeneratorInLegacyContext),x=w}else x=this.parseStatement();delete this.context.labelSet[p],a=new h.LabeledStatement(o,x)}else this.consumeSemicolon(),a=new h.ExpressionStatement(n);return this.finalize(t,a)},d.prototype.parseThrowStatement=function(){var t=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(f.Messages.NewlineAfterThrow);var n=this.parseExpression();return this.consumeSemicolon(),this.finalize(t,new h.ThrowStatement(n))},d.prototype.parseCatchClause=function(){var t=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var n=[],a=this.parsePattern(n),o={},p=0;p<n.length;p++){var x="$"+n[p].value;Object.prototype.hasOwnProperty.call(o,x)&&this.tolerateError(f.Messages.DuplicateBinding,n[p].value),o[x]=!0}this.context.strict&&a.type===y.Syntax.Identifier&&this.scanner.isRestrictedWord(a.name)&&this.tolerateError(f.Messages.StrictCatchVariable),this.expect(")");var S=this.parseBlock();return this.finalize(t,new h.CatchClause(a,S))},d.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},d.prototype.parseTryStatement=function(){var t=this.createNode();this.expectKeyword("try");var n=this.parseBlock(),a=this.matchKeyword("catch")?this.parseCatchClause():null,o=this.matchKeyword("finally")?this.parseFinallyClause():null;return!a&&!o&&this.throwError(f.Messages.NoCatchOrFinally),this.finalize(t,new h.TryStatement(n,a,o))},d.prototype.parseDebuggerStatement=function(){var t=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(t,new h.DebuggerStatement)},d.prototype.parseStatement=function(){var t;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:t=this.parseExpressionStatement();break;case 7:var n=this.lookahead.value;n==="{"?t=this.parseBlock():n==="("?t=this.parseExpressionStatement():n===";"?t=this.parseEmptyStatement():t=this.parseExpressionStatement();break;case 3:t=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":t=this.parseBreakStatement();break;case"continue":t=this.parseContinueStatement();break;case"debugger":t=this.parseDebuggerStatement();break;case"do":t=this.parseDoWhileStatement();break;case"for":t=this.parseForStatement();break;case"function":t=this.parseFunctionDeclaration();break;case"if":t=this.parseIfStatement();break;case"return":t=this.parseReturnStatement();break;case"switch":t=this.parseSwitchStatement();break;case"throw":t=this.parseThrowStatement();break;case"try":t=this.parseTryStatement();break;case"var":t=this.parseVariableStatement();break;case"while":t=this.parseWhileStatement();break;case"with":t=this.parseWithStatement();break;default:t=this.parseExpressionStatement();break}break;default:t=this.throwUnexpectedToken(this.lookahead)}return t},d.prototype.parseFunctionSourceElements=function(){var t=this.createNode();this.expect("{");var n=this.parseDirectivePrologues(),a=this.context.labelSet,o=this.context.inIteration,p=this.context.inSwitch,x=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;this.lookahead.type!==2&&!this.match("}");)n.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=a,this.context.inIteration=o,this.context.inSwitch=p,this.context.inFunctionBody=x,this.finalize(t,new h.BlockStatement(n))},d.prototype.validateParam=function(t,n,a){var o="$"+a;this.context.strict?(this.scanner.isRestrictedWord(a)&&(t.stricted=n,t.message=f.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(t.paramSet,o)&&(t.stricted=n,t.message=f.Messages.StrictParamDupe)):t.firstRestricted||(this.scanner.isRestrictedWord(a)?(t.firstRestricted=n,t.message=f.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(a)?(t.firstRestricted=n,t.message=f.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(t.paramSet,o)&&(t.stricted=n,t.message=f.Messages.StrictParamDupe)),typeof Object.defineProperty=="function"?Object.defineProperty(t.paramSet,o,{value:!0,enumerable:!0,writable:!0,configurable:!0}):t.paramSet[o]=!0},d.prototype.parseRestElement=function(t){var n=this.createNode();this.expect("...");var a=this.parsePattern(t);return this.match("=")&&this.throwError(f.Messages.DefaultRestParameter),this.match(")")||this.throwError(f.Messages.ParameterAfterRestParameter),this.finalize(n,new h.RestElement(a))},d.prototype.parseFormalParameter=function(t){for(var n=[],a=this.match("...")?this.parseRestElement(n):this.parsePatternWithDefault(n),o=0;o<n.length;o++)this.validateParam(t,n[o],n[o].value);t.simple=t.simple&&a instanceof h.Identifier,t.params.push(a)},d.prototype.parseFormalParameters=function(t){var n;if(n={simple:!0,params:[],firstRestricted:t},this.expect("("),!this.match(")"))for(n.paramSet={};this.lookahead.type!==2&&(this.parseFormalParameter(n),!(this.match(")")||(this.expect(","),this.match(")")))););return this.expect(")"),{simple:n.simple,params:n.params,stricted:n.stricted,firstRestricted:n.firstRestricted,message:n.message}},d.prototype.matchAsyncFunction=function(){var t=this.matchContextualKeyword("async");if(t){var n=this.scanner.saveState();this.scanner.scanComments();var a=this.scanner.lex();this.scanner.restoreState(n),t=n.lineNumber===a.lineNumber&&a.type===4&&a.value==="function"}return t},d.prototype.parseFunctionDeclaration=function(t){var n=this.createNode(),a=this.matchContextualKeyword("async");a&&this.nextToken(),this.expectKeyword("function");var o=a?!1:this.match("*");o&&this.nextToken();var p,x=null,S=null;if(!t||!this.match("(")){var w=this.lookahead;x=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(w.value)&&this.tolerateUnexpectedToken(w,f.Messages.StrictFunctionName):this.scanner.isRestrictedWord(w.value)?(S=w,p=f.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(w.value)&&(S=w,p=f.Messages.StrictReservedWord)}var F=this.context.await,b=this.context.allowYield;this.context.await=a,this.context.allowYield=!o;var k=this.parseFormalParameters(S),B=k.params,N=k.stricted;S=k.firstRestricted,k.message&&(p=k.message);var U=this.context.strict,X=this.context.allowStrictDirective;this.context.allowStrictDirective=k.simple;var K=this.parseFunctionSourceElements();return this.context.strict&&S&&this.throwUnexpectedToken(S,p),this.context.strict&&N&&this.tolerateUnexpectedToken(N,p),this.context.strict=U,this.context.allowStrictDirective=X,this.context.await=F,this.context.allowYield=b,a?this.finalize(n,new h.AsyncFunctionDeclaration(x,B,K)):this.finalize(n,new h.FunctionDeclaration(x,B,K,o))},d.prototype.parseFunctionExpression=function(){var t=this.createNode(),n=this.matchContextualKeyword("async");n&&this.nextToken(),this.expectKeyword("function");var a=n?!1:this.match("*");a&&this.nextToken();var o,p=null,x,S=this.context.await,w=this.context.allowYield;if(this.context.await=n,this.context.allowYield=!a,!this.match("(")){var F=this.lookahead;p=!this.context.strict&&!a&&this.matchKeyword("yield")?this.parseIdentifierName():this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(F.value)&&this.tolerateUnexpectedToken(F,f.Messages.StrictFunctionName):this.scanner.isRestrictedWord(F.value)?(x=F,o=f.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(F.value)&&(x=F,o=f.Messages.StrictReservedWord)}var b=this.parseFormalParameters(x),k=b.params,B=b.stricted;x=b.firstRestricted,b.message&&(o=b.message);var N=this.context.strict,U=this.context.allowStrictDirective;this.context.allowStrictDirective=b.simple;var X=this.parseFunctionSourceElements();return this.context.strict&&x&&this.throwUnexpectedToken(x,o),this.context.strict&&B&&this.tolerateUnexpectedToken(B,o),this.context.strict=N,this.context.allowStrictDirective=U,this.context.await=S,this.context.allowYield=w,n?this.finalize(t,new h.AsyncFunctionExpression(p,k,X)):this.finalize(t,new h.FunctionExpression(p,k,X,a))},d.prototype.parseDirective=function(){var t=this.lookahead,n=this.createNode(),a=this.parseExpression(),o=a.type===y.Syntax.Literal?this.getTokenRaw(t).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(n,o?new h.Directive(a,o):new h.ExpressionStatement(a))},d.prototype.parseDirectivePrologues=function(){for(var t=null,n=[];;){var a=this.lookahead;if(a.type!==8)break;var o=this.parseDirective();n.push(o);var p=o.directive;if(typeof p!="string")break;p==="use strict"?(this.context.strict=!0,t&&this.tolerateUnexpectedToken(t,f.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(a,f.Messages.IllegalLanguageModeDirective)):!t&&a.octal&&(t=a)}return n},d.prototype.qualifiedPropertyName=function(t){switch(t.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return t.value==="[";default:break}return!1},d.prototype.parseGetterMethod=function(){var t=this.createNode(),n=!1,a=this.context.allowYield;this.context.allowYield=!n;var o=this.parseFormalParameters();o.params.length>0&&this.tolerateError(f.Messages.BadGetterArity);var p=this.parsePropertyMethod(o);return this.context.allowYield=a,this.finalize(t,new h.FunctionExpression(null,o.params,p,n))},d.prototype.parseSetterMethod=function(){var t=this.createNode(),n=!1,a=this.context.allowYield;this.context.allowYield=!n;var o=this.parseFormalParameters();o.params.length!==1?this.tolerateError(f.Messages.BadSetterArity):o.params[0]instanceof h.RestElement&&this.tolerateError(f.Messages.BadSetterRestParameter);var p=this.parsePropertyMethod(o);return this.context.allowYield=a,this.finalize(t,new h.FunctionExpression(null,o.params,p,n))},d.prototype.parseGeneratorMethod=function(){var t=this.createNode(),n=!0,a=this.context.allowYield;this.context.allowYield=!0;var o=this.parseFormalParameters();this.context.allowYield=!1;var p=this.parsePropertyMethod(o);return this.context.allowYield=a,this.finalize(t,new h.FunctionExpression(null,o.params,p,n))},d.prototype.isStartOfExpression=function(){var t=!0,n=this.lookahead.value;switch(this.lookahead.type){case 7:t=n==="["||n==="("||n==="{"||n==="+"||n==="-"||n==="!"||n==="~"||n==="++"||n==="--"||n==="/"||n==="/=";break;case 4:t=n==="class"||n==="delete"||n==="function"||n==="let"||n==="new"||n==="super"||n==="this"||n==="typeof"||n==="void"||n==="yield";break;default:break}return t},d.prototype.parseYieldExpression=function(){var t=this.createNode();this.expectKeyword("yield");var n=null,a=!1;if(!this.hasLineTerminator){var o=this.context.allowYield;this.context.allowYield=!1,a=this.match("*"),a?(this.nextToken(),n=this.parseAssignmentExpression()):this.isStartOfExpression()&&(n=this.parseAssignmentExpression()),this.context.allowYield=o}return this.finalize(t,new h.YieldExpression(n,a))},d.prototype.parseClassElement=function(t){var n=this.lookahead,a=this.createNode(),o="",p=null,x=null,S=!1,w=!1,F=!1,b=!1;if(this.match("*"))this.nextToken();else{S=this.match("["),p=this.parseObjectPropertyKey();var k=p;if(k.name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(n=this.lookahead,F=!0,S=this.match("["),this.match("*")?this.nextToken():p=this.parseObjectPropertyKey()),n.type===3&&!this.hasLineTerminator&&n.value==="async"){var B=this.lookahead.value;B!==":"&&B!=="("&&B!=="*"&&(b=!0,n=this.lookahead,p=this.parseObjectPropertyKey(),n.type===3&&n.value==="constructor"&&this.tolerateUnexpectedToken(n,f.Messages.ConstructorIsAsync))}}var N=this.qualifiedPropertyName(this.lookahead);return n.type===3?n.value==="get"&&N?(o="get",S=this.match("["),p=this.parseObjectPropertyKey(),this.context.allowYield=!1,x=this.parseGetterMethod()):n.value==="set"&&N&&(o="set",S=this.match("["),p=this.parseObjectPropertyKey(),x=this.parseSetterMethod()):n.type===7&&n.value==="*"&&N&&(o="init",S=this.match("["),p=this.parseObjectPropertyKey(),x=this.parseGeneratorMethod(),w=!0),!o&&p&&this.match("(")&&(o="init",x=b?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),w=!0),o||this.throwUnexpectedToken(this.lookahead),o==="init"&&(o="method"),S||(F&&this.isPropertyKey(p,"prototype")&&this.throwUnexpectedToken(n,f.Messages.StaticPrototype),!F&&this.isPropertyKey(p,"constructor")&&((o!=="method"||!w||x&&x.generator)&&this.throwUnexpectedToken(n,f.Messages.ConstructorSpecialMethod),t.value?this.throwUnexpectedToken(n,f.Messages.DuplicateConstructor):t.value=!0,o="constructor")),this.finalize(a,new h.MethodDefinition(p,S,x,o,F))},d.prototype.parseClassElementList=function(){var t=[],n={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():t.push(this.parseClassElement(n));return this.expect("}"),t},d.prototype.parseClassBody=function(){var t=this.createNode(),n=this.parseClassElementList();return this.finalize(t,new h.ClassBody(n))},d.prototype.parseClassDeclaration=function(t){var n=this.createNode(),a=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var o=t&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),p=null;this.matchKeyword("extends")&&(this.nextToken(),p=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var x=this.parseClassBody();return this.context.strict=a,this.finalize(n,new h.ClassDeclaration(o,p,x))},d.prototype.parseClassExpression=function(){var t=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var a=this.lookahead.type===3?this.parseVariableIdentifier():null,o=null;this.matchKeyword("extends")&&(this.nextToken(),o=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var p=this.parseClassBody();return this.context.strict=n,this.finalize(t,new h.ClassExpression(a,o,p))},d.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var t=this.createNode(),n=this.parseDirectivePrologues();this.lookahead.type!==2;)n.push(this.parseStatementListItem());return this.finalize(t,new h.Module(n))},d.prototype.parseScript=function(){for(var t=this.createNode(),n=this.parseDirectivePrologues();this.lookahead.type!==2;)n.push(this.parseStatementListItem());return this.finalize(t,new h.Script(n))},d.prototype.parseModuleSpecifier=function(){var t=this.createNode();this.lookahead.type!==8&&this.throwError(f.Messages.InvalidModuleSpecifier);var n=this.nextToken(),a=this.getTokenRaw(n);return this.finalize(t,new h.Literal(n.value,a))},d.prototype.parseImportSpecifier=function(){var t=this.createNode(),n,a;return this.lookahead.type===3?(n=this.parseVariableIdentifier(),a=n,this.matchContextualKeyword("as")&&(this.nextToken(),a=this.parseVariableIdentifier())):(n=this.parseIdentifierName(),a=n,this.matchContextualKeyword("as")?(this.nextToken(),a=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(t,new h.ImportSpecifier(a,n))},d.prototype.parseNamedImports=function(){this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),t},d.prototype.parseImportDefaultSpecifier=function(){var t=this.createNode(),n=this.parseIdentifierName();return this.finalize(t,new h.ImportDefaultSpecifier(n))},d.prototype.parseImportNamespaceSpecifier=function(){var t=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(f.Messages.NoAsAfterImportNamespace),this.nextToken();var n=this.parseIdentifierName();return this.finalize(t,new h.ImportNamespaceSpecifier(n))},d.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(f.Messages.IllegalImportDeclaration);var t=this.createNode();this.expectKeyword("import");var n,a=[];if(this.lookahead.type===8)n=this.parseModuleSpecifier();else{if(this.match("{")?a=a.concat(this.parseNamedImports()):this.match("*")?a.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(a.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?a.push(this.parseImportNamespaceSpecifier()):this.match("{")?a=a.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var o=this.lookahead.value?f.Messages.UnexpectedToken:f.Messages.MissingFromClause;this.throwError(o,this.lookahead.value)}this.nextToken(),n=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new h.ImportDeclaration(a,n))},d.prototype.parseExportSpecifier=function(){var t=this.createNode(),n=this.parseIdentifierName(),a=n;return this.matchContextualKeyword("as")&&(this.nextToken(),a=this.parseIdentifierName()),this.finalize(t,new h.ExportSpecifier(n,a))},d.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(f.Messages.IllegalExportDeclaration);var t=this.createNode();this.expectKeyword("export");var n;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var a=this.parseFunctionDeclaration(!0);n=this.finalize(t,new h.ExportDefaultDeclaration(a))}else if(this.matchKeyword("class")){var a=this.parseClassDeclaration(!0);n=this.finalize(t,new h.ExportDefaultDeclaration(a))}else if(this.matchContextualKeyword("async")){var a=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();n=this.finalize(t,new h.ExportDefaultDeclaration(a))}else{this.matchContextualKeyword("from")&&this.throwError(f.Messages.UnexpectedToken,this.lookahead.value);var a=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),n=this.finalize(t,new h.ExportDefaultDeclaration(a))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var o=this.lookahead.value?f.Messages.UnexpectedToken:f.Messages.MissingFromClause;this.throwError(o,this.lookahead.value)}this.nextToken();var p=this.parseModuleSpecifier();this.consumeSemicolon(),n=this.finalize(t,new h.ExportAllDeclaration(p))}else if(this.lookahead.type===4){var a=void 0;switch(this.lookahead.value){case"let":case"const":a=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":a=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}n=this.finalize(t,new h.ExportNamedDeclaration(a,[],null))}else if(this.matchAsyncFunction()){var a=this.parseFunctionDeclaration();n=this.finalize(t,new h.ExportNamedDeclaration(a,[],null))}else{var x=[],S=null,w=!1;for(this.expect("{");!this.match("}");)w=w||this.matchKeyword("default"),x.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),S=this.parseModuleSpecifier(),this.consumeSemicolon();else if(w){var o=this.lookahead.value?f.Messages.UnexpectedToken:f.Messages.MissingFromClause;this.throwError(o,this.lookahead.value)}else this.consumeSemicolon();n=this.finalize(t,new h.ExportNamedDeclaration(null,x,S))}return n},d}();r.Parser=m},function(s,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function l(u,D){if(!u)throw new Error("ASSERT: "+D)}r.assert=l},function(s,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var l=function(){function u(){this.errors=[],this.tolerant=!1}return u.prototype.recordError=function(D){this.errors.push(D)},u.prototype.tolerate=function(D){if(this.tolerant)this.recordError(D);else throw D},u.prototype.constructError=function(D,f){var h=new Error(D);try{throw h}catch(C){Object.create&&Object.defineProperty&&(h=Object.create(C),Object.defineProperty(h,"column",{value:f}))}return h},u.prototype.createError=function(D,f,h,C){var y="Line "+f+": "+C,v=this.constructError(y,h);return v.index=D,v.lineNumber=f,v.description=C,v},u.prototype.throwError=function(D,f,h,C){throw this.createError(D,f,h,C)},u.prototype.tolerateError=function(D,f,h,C){var y=this.createError(D,f,h,C);if(this.tolerant)this.recordError(y);else throw y},u}();r.ErrorHandler=l},function(s,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(s,r,l){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=l(9),D=l(4),f=l(11);function h(v){return"0123456789abcdef".indexOf(v.toLowerCase())}function C(v){return"01234567".indexOf(v)}var y=function(){function v(c,m){this.source=c,this.errorHandler=m,this.trackComment=!1,this.isModule=!1,this.length=c.length,this.index=0,this.lineNumber=c.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return v.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},v.prototype.restoreState=function(c){this.index=c.index,this.lineNumber=c.lineNumber,this.lineStart=c.lineStart},v.prototype.eof=function(){return this.index>=this.length},v.prototype.throwUnexpectedToken=function(c){return c===void 0&&(c=f.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,c)},v.prototype.tolerateUnexpectedToken=function(c){c===void 0&&(c=f.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,c)},v.prototype.skipSingleLineComment=function(c){var m=[],d,t;for(this.trackComment&&(m=[],d=this.index-c,t={start:{line:this.lineNumber,column:this.index-this.lineStart-c},end:{}});!this.eof();){var n=this.source.charCodeAt(this.index);if(++this.index,D.Character.isLineTerminator(n)){if(this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart-1};var a={multiLine:!1,slice:[d+c,this.index-1],range:[d,this.index-1],loc:t};m.push(a)}return n===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,m}}if(this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var a={multiLine:!1,slice:[d+c,this.index],range:[d,this.index],loc:t};m.push(a)}return m},v.prototype.skipMultiLineComment=function(){var c=[],m,d;for(this.trackComment&&(c=[],m=this.index-2,d={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var t=this.source.charCodeAt(this.index);if(D.Character.isLineTerminator(t))t===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(t===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){d.end={line:this.lineNumber,column:this.index-this.lineStart};var n={multiLine:!0,slice:[m+2,this.index-2],range:[m,this.index],loc:d};c.push(n)}return c}++this.index}else++this.index}if(this.trackComment){d.end={line:this.lineNumber,column:this.index-this.lineStart};var n={multiLine:!0,slice:[m+2,this.index],range:[m,this.index],loc:d};c.push(n)}return this.tolerateUnexpectedToken(),c},v.prototype.scanComments=function(){var c;this.trackComment&&(c=[]);for(var m=this.index===0;!this.eof();){var d=this.source.charCodeAt(this.index);if(D.Character.isWhiteSpace(d))++this.index;else if(D.Character.isLineTerminator(d))++this.index,d===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,m=!0;else if(d===47)if(d=this.source.charCodeAt(this.index+1),d===47){this.index+=2;var t=this.skipSingleLineComment(2);this.trackComment&&(c=c.concat(t)),m=!0}else if(d===42){this.index+=2;var t=this.skipMultiLineComment();this.trackComment&&(c=c.concat(t))}else break;else if(m&&d===45)if(this.source.charCodeAt(this.index+1)===45&&this.source.charCodeAt(this.index+2)===62){this.index+=3;var t=this.skipSingleLineComment(3);this.trackComment&&(c=c.concat(t))}else break;else if(d===60&&!this.isModule)if(this.source.slice(this.index+1,this.index+4)==="!--"){this.index+=4;var t=this.skipSingleLineComment(4);this.trackComment&&(c=c.concat(t))}else break;else break}return c},v.prototype.isFutureReservedWord=function(c){switch(c){case"enum":case"export":case"import":case"super":return!0;default:return!1}},v.prototype.isStrictModeReservedWord=function(c){switch(c){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},v.prototype.isRestrictedWord=function(c){return c==="eval"||c==="arguments"},v.prototype.isKeyword=function(c){switch(c.length){case 2:return c==="if"||c==="in"||c==="do";case 3:return c==="var"||c==="for"||c==="new"||c==="try"||c==="let";case 4:return c==="this"||c==="else"||c==="case"||c==="void"||c==="with"||c==="enum";case 5:return c==="while"||c==="break"||c==="catch"||c==="throw"||c==="const"||c==="yield"||c==="class"||c==="super";case 6:return c==="return"||c==="typeof"||c==="delete"||c==="switch"||c==="export"||c==="import";case 7:return c==="default"||c==="finally"||c==="extends";case 8:return c==="function"||c==="continue"||c==="debugger";case 10:return c==="instanceof";default:return!1}},v.prototype.codePointAt=function(c){var m=this.source.charCodeAt(c);if(m>=55296&&m<=56319){var d=this.source.charCodeAt(c+1);if(d>=56320&&d<=57343){var t=m;m=(t-55296)*1024+d-56320+65536}}return m},v.prototype.scanHexEscape=function(c){for(var m=c==="u"?4:2,d=0,t=0;t<m;++t)if(!this.eof()&&D.Character.isHexDigit(this.source.charCodeAt(this.index)))d=d*16+h(this.source[this.index++]);else return null;return String.fromCharCode(d)},v.prototype.scanUnicodeCodePointEscape=function(){var c=this.source[this.index],m=0;for(c==="}"&&this.throwUnexpectedToken();!this.eof()&&(c=this.source[this.index++],!!D.Character.isHexDigit(c.charCodeAt(0)));)m=m*16+h(c);return(m>1114111||c!=="}")&&this.throwUnexpectedToken(),D.Character.fromCodePoint(m)},v.prototype.getIdentifier=function(){for(var c=this.index++;!this.eof();){var m=this.source.charCodeAt(this.index);if(m===92)return this.index=c,this.getComplexIdentifier();if(m>=55296&&m<57343)return this.index=c,this.getComplexIdentifier();if(D.Character.isIdentifierPart(m))++this.index;else break}return this.source.slice(c,this.index)},v.prototype.getComplexIdentifier=function(){var c=this.codePointAt(this.index),m=D.Character.fromCodePoint(c);this.index+=m.length;var d;for(c===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,d=this.scanUnicodeCodePointEscape()):(d=this.scanHexEscape("u"),(d===null||d==="\\"||!D.Character.isIdentifierStart(d.charCodeAt(0)))&&this.throwUnexpectedToken()),m=d);!this.eof()&&(c=this.codePointAt(this.index),!!D.Character.isIdentifierPart(c));)d=D.Character.fromCodePoint(c),m+=d,this.index+=d.length,c===92&&(m=m.substr(0,m.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,d=this.scanUnicodeCodePointEscape()):(d=this.scanHexEscape("u"),(d===null||d==="\\"||!D.Character.isIdentifierPart(d.charCodeAt(0)))&&this.throwUnexpectedToken()),m+=d);return m},v.prototype.octalToDecimal=function(c){var m=c!=="0",d=C(c);return!this.eof()&&D.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(m=!0,d=d*8+C(this.source[this.index++]),"0123".indexOf(c)>=0&&!this.eof()&&D.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(d=d*8+C(this.source[this.index++]))),{code:d,octal:m}},v.prototype.scanIdentifier=function(){var c,m=this.index,d=this.source.charCodeAt(m)===92?this.getComplexIdentifier():this.getIdentifier();if(d.length===1?c=3:this.isKeyword(d)?c=4:d==="null"?c=5:d==="true"||d==="false"?c=1:c=3,c!==3&&m+d.length!==this.index){var t=this.index;this.index=m,this.tolerateUnexpectedToken(f.Messages.InvalidEscapedReservedWord),this.index=t}return{type:c,value:d,lineNumber:this.lineNumber,lineStart:this.lineStart,start:m,end:this.index}},v.prototype.scanPunctuator=function(){var c=this.index,m=this.source[this.index];switch(m){case"(":case"{":m==="{"&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,this.source[this.index]==="."&&this.source[this.index+1]==="."&&(this.index+=2,m="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:m=this.source.substr(this.index,4),m===">>>="?this.index+=4:(m=m.substr(0,3),m==="==="||m==="!=="||m===">>>"||m==="<<="||m===">>="||m==="**="?this.index+=3:(m=m.substr(0,2),m==="&&"||m==="||"||m==="=="||m==="!="||m==="+="||m==="-="||m==="*="||m==="/="||m==="++"||m==="--"||m==="<<"||m===">>"||m==="&="||m==="|="||m==="^="||m==="%="||m==="<="||m===">="||m==="=>"||m==="**"?this.index+=2:(m=this.source[this.index],"<>=!+-*%&|^/".indexOf(m)>=0&&++this.index)))}return this.index===c&&this.throwUnexpectedToken(),{type:7,value:m,lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}},v.prototype.scanHexLiteral=function(c){for(var m="";!this.eof()&&D.Character.isHexDigit(this.source.charCodeAt(this.index));)m+=this.source[this.index++];return m.length===0&&this.throwUnexpectedToken(),D.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+m,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}},v.prototype.scanBinaryLiteral=function(c){for(var m="",d;!this.eof()&&(d=this.source[this.index],!(d!=="0"&&d!=="1"));)m+=this.source[this.index++];return m.length===0&&this.throwUnexpectedToken(),this.eof()||(d=this.source.charCodeAt(this.index),(D.Character.isIdentifierStart(d)||D.Character.isDecimalDigit(d))&&this.throwUnexpectedToken()),{type:6,value:parseInt(m,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}},v.prototype.scanOctalLiteral=function(c,m){var d="",t=!1;for(D.Character.isOctalDigit(c.charCodeAt(0))?(t=!0,d="0"+this.source[this.index++]):++this.index;!this.eof()&&D.Character.isOctalDigit(this.source.charCodeAt(this.index));)d+=this.source[this.index++];return!t&&d.length===0&&this.throwUnexpectedToken(),(D.Character.isIdentifierStart(this.source.charCodeAt(this.index))||D.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(d,8),octal:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:m,end:this.index}},v.prototype.isImplicitOctalLiteral=function(){for(var c=this.index+1;c<this.length;++c){var m=this.source[c];if(m==="8"||m==="9")return!1;if(!D.Character.isOctalDigit(m.charCodeAt(0)))return!0}return!0},v.prototype.scanNumericLiteral=function(){var c=this.index,m=this.source[c];u.assert(D.Character.isDecimalDigit(m.charCodeAt(0))||m===".","Numeric literal must start with a decimal digit or a decimal point");var d="";if(m!=="."){if(d=this.source[this.index++],m=this.source[this.index],d==="0"){if(m==="x"||m==="X")return++this.index,this.scanHexLiteral(c);if(m==="b"||m==="B")return++this.index,this.scanBinaryLiteral(c);if(m==="o"||m==="O")return this.scanOctalLiteral(m,c);if(m&&D.Character.isOctalDigit(m.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(m,c)}for(;D.Character.isDecimalDigit(this.source.charCodeAt(this.index));)d+=this.source[this.index++];m=this.source[this.index]}if(m==="."){for(d+=this.source[this.index++];D.Character.isDecimalDigit(this.source.charCodeAt(this.index));)d+=this.source[this.index++];m=this.source[this.index]}if(m==="e"||m==="E")if(d+=this.source[this.index++],m=this.source[this.index],(m==="+"||m==="-")&&(d+=this.source[this.index++]),D.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;D.Character.isDecimalDigit(this.source.charCodeAt(this.index));)d+=this.source[this.index++];else this.throwUnexpectedToken();return D.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(d),lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}},v.prototype.scanStringLiteral=function(){var c=this.index,m=this.source[c];u.assert(m==="'"||m==='"',"String literal must starts with a quote"),++this.index;for(var d=!1,t="";!this.eof();){var n=this.source[this.index++];if(n===m){m="";break}else if(n==="\\")if(n=this.source[this.index++],!n||!D.Character.isLineTerminator(n.charCodeAt(0)))switch(n){case"u":if(this.source[this.index]==="{")++this.index,t+=this.scanUnicodeCodePointEscape();else{var a=this.scanHexEscape(n);a===null&&this.throwUnexpectedToken(),t+=a}break;case"x":var o=this.scanHexEscape(n);o===null&&this.throwUnexpectedToken(f.Messages.InvalidHexEscapeSequence),t+=o;break;case"n":t+=`
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;case"8":case"9":t+=n,this.tolerateUnexpectedToken();break;default:if(n&&D.Character.isOctalDigit(n.charCodeAt(0))){var p=this.octalToDecimal(n);d=p.octal||d,t+=String.fromCharCode(p.code)}else t+=n;break}else++this.lineNumber,n==="\r"&&this.source[this.index]===`
`&&++this.index,this.lineStart=this.index;else{if(D.Character.isLineTerminator(n.charCodeAt(0)))break;t+=n}}return m!==""&&(this.index=c,this.throwUnexpectedToken()),{type:8,value:t,octal:d,lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}},v.prototype.scanTemplate=function(){var c="",m=!1,d=this.index,t=this.source[d]==="`",n=!1,a=2;for(++this.index;!this.eof();){var o=this.source[this.index++];if(o==="`"){a=1,n=!0,m=!0;break}else if(o==="$"){if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,m=!0;break}c+=o}else if(o==="\\")if(o=this.source[this.index++],D.Character.isLineTerminator(o.charCodeAt(0)))++this.lineNumber,o==="\r"&&this.source[this.index]===`
`&&++this.index,this.lineStart=this.index;else switch(o){case"n":c+=`
`;break;case"r":c+="\r";break;case"t":c+=" ";break;case"u":if(this.source[this.index]==="{")++this.index,c+=this.scanUnicodeCodePointEscape();else{var p=this.index,x=this.scanHexEscape(o);x!==null?c+=x:(this.index=p,c+=o)}break;case"x":var S=this.scanHexEscape(o);S===null&&this.throwUnexpectedToken(f.Messages.InvalidHexEscapeSequence),c+=S;break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="\v";break;default:o==="0"?(D.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(f.Messages.TemplateOctalLiteral),c+="\0"):D.Character.isOctalDigit(o.charCodeAt(0))?this.throwUnexpectedToken(f.Messages.TemplateOctalLiteral):c+=o;break}else D.Character.isLineTerminator(o.charCodeAt(0))?(++this.lineNumber,o==="\r"&&this.source[this.index]===`
`&&++this.index,this.lineStart=this.index,c+=`
`):c+=o}return m||this.throwUnexpectedToken(),t||this.curlyStack.pop(),{type:10,value:this.source.slice(d+1,this.index-a),cooked:c,head:t,tail:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:d,end:this.index}},v.prototype.testRegExp=function(c,m){var d="\uFFFF",t=c,n=this;m.indexOf("u")>=0&&(t=t.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(a,o,p){var x=parseInt(o||p,16);return x>1114111&&n.throwUnexpectedToken(f.Messages.InvalidRegExp),x<=65535?String.fromCharCode(x):d}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d));try{RegExp(t)}catch{this.throwUnexpectedToken(f.Messages.InvalidRegExp)}try{return new RegExp(c,m)}catch{return null}},v.prototype.scanRegExpBody=function(){var c=this.source[this.index];u.assert(c==="/","Regular expression literal must start with a slash");for(var m=this.source[this.index++],d=!1,t=!1;!this.eof();)if(c=this.source[this.index++],m+=c,c==="\\")c=this.source[this.index++],D.Character.isLineTerminator(c.charCodeAt(0))&&this.throwUnexpectedToken(f.Messages.UnterminatedRegExp),m+=c;else if(D.Character.isLineTerminator(c.charCodeAt(0)))this.throwUnexpectedToken(f.Messages.UnterminatedRegExp);else if(d)c==="]"&&(d=!1);else if(c==="/"){t=!0;break}else c==="["&&(d=!0);return t||this.throwUnexpectedToken(f.Messages.UnterminatedRegExp),m.substr(1,m.length-2)},v.prototype.scanRegExpFlags=function(){for(var c="",m="";!this.eof();){var d=this.source[this.index];if(!D.Character.isIdentifierPart(d.charCodeAt(0)))break;if(++this.index,d==="\\"&&!this.eof())if(d=this.source[this.index],d==="u"){++this.index;var t=this.index,n=this.scanHexEscape("u");if(n!==null)for(m+=n,c+="\\u";t<this.index;++t)c+=this.source[t];else this.index=t,m+="u",c+="\\u";this.tolerateUnexpectedToken()}else c+="\\",this.tolerateUnexpectedToken();else m+=d,c+=d}return m},v.prototype.scanRegExp=function(){var c=this.index,m=this.scanRegExpBody(),d=this.scanRegExpFlags(),t=this.testRegExp(m,d);return{type:9,value:"",pattern:m,flags:d,regex:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}},v.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var c=this.source.charCodeAt(this.index);return D.Character.isIdentifierStart(c)?this.scanIdentifier():c===40||c===41||c===59?this.scanPunctuator():c===39||c===34?this.scanStringLiteral():c===46?D.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():D.Character.isDecimalDigit(c)?this.scanNumericLiteral():c===96||c===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():c>=55296&&c<57343&&D.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},v}();r.Scanner=y},function(s,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.TokenName={},r.TokenName[1]="Boolean",r.TokenName[2]="<end>",r.TokenName[3]="Identifier",r.TokenName[4]="Keyword",r.TokenName[5]="Null",r.TokenName[6]="Numeric",r.TokenName[7]="Punctuator",r.TokenName[8]="String",r.TokenName[9]="RegularExpression",r.TokenName[10]="Template"},function(s,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(s,r,l){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=l(10),D=l(12),f=l(13),h=function(){function y(){this.values=[],this.curly=this.paren=-1}return y.prototype.beforeFunctionExpression=function(v){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(v)>=0},y.prototype.isRegexStart=function(){var v=this.values[this.values.length-1],c=v!==null;switch(v){case"this":case"]":c=!1;break;case")":var m=this.values[this.paren-1];c=m==="if"||m==="while"||m==="for"||m==="with";break;case"}":if(c=!1,this.values[this.curly-3]==="function"){var d=this.values[this.curly-4];c=d?!this.beforeFunctionExpression(d):!1}else if(this.values[this.curly-4]==="function"){var d=this.values[this.curly-5];c=d?!this.beforeFunctionExpression(d):!0}break;default:break}return c},y.prototype.push=function(v){v.type===7||v.type===4?(v.value==="{"?this.curly=this.values.length:v.value==="("&&(this.paren=this.values.length),this.values.push(v.value)):this.values.push(null)},y}(),C=function(){function y(v,c){this.errorHandler=new u.ErrorHandler,this.errorHandler.tolerant=c?typeof c.tolerant=="boolean"&&c.tolerant:!1,this.scanner=new D.Scanner(v,this.errorHandler),this.scanner.trackComment=c?typeof c.comment=="boolean"&&c.comment:!1,this.trackRange=c?typeof c.range=="boolean"&&c.range:!1,this.trackLoc=c?typeof c.loc=="boolean"&&c.loc:!1,this.buffer=[],this.reader=new h}return y.prototype.errors=function(){return this.errorHandler.errors},y.prototype.getNextToken=function(){if(this.buffer.length===0){var v=this.scanner.scanComments();if(this.scanner.trackComment)for(var c=0;c<v.length;++c){var m=v[c],d=this.scanner.source.slice(m.slice[0],m.slice[1]),t={type:m.multiLine?"BlockComment":"LineComment",value:d};this.trackRange&&(t.range=m.range),this.trackLoc&&(t.loc=m.loc),this.buffer.push(t)}if(!this.scanner.eof()){var n=void 0;this.trackLoc&&(n={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var a=this.scanner.source[this.scanner.index]==="/"&&this.reader.isRegexStart(),o=a?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(o);var p={type:f.TokenName[o.type],value:this.scanner.source.slice(o.start,o.end)};if(this.trackRange&&(p.range=[o.start,o.end]),this.trackLoc&&(n.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},p.loc=n),o.type===9){var x=o.pattern,S=o.flags;p.regex={pattern:x,flags:S}}this.buffer.push(p)}}return this.buffer.shift()},y}();r.Tokenizer=C}])})}}),ot=365.2425,ut=Math.pow(10,8)*24*60*60*1e3,sr=-ut,we=6048e5,ct=864e5,lt=6e4,ht=36e5,dt=3600,Ae=dt*24,ar=Ae*7,pt=Ae*ot,ft=pt/12,or=ft*3,Fe=Symbol.for("constructDateFrom");function O(e,i){return typeof e=="function"?e(i):e&&typeof e=="object"&&Fe in e?e[Fe](i):e instanceof Date?new e.constructor(i):new Date(i)}function I(e,i){return O(i||e,e)}function z(e,i,s){const r=I(e,s?.in);return isNaN(i)?O(s?.in||e,NaN):(i&&r.setDate(r.getDate()+i),r)}function te(e,i,s){const r=I(e,s?.in);if(isNaN(i))return O(s?.in||e,NaN);if(!i)return r;const l=r.getDate(),u=O(s?.in||e,r.getTime());u.setMonth(r.getMonth()+i+1,0);const D=u.getDate();return l>=D?u:(r.setFullYear(u.getFullYear(),u.getMonth(),l),r)}function be(e,i,s){return O(s?.in||e,+I(e)+i)}function ke(e,i,s){return be(e,i*ht,s)}var mt={};function $(){return mt}function V(e,i){const s=$(),r=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,l=I(e,i?.in),u=l.getDay(),D=(u<r?7:0)+u-r;return l.setDate(l.getDate()-D),l.setHours(0,0,0,0),l}function ne(e,i){return V(e,{...i,weekStartsOn:1})}function Te(e,i){const s=I(e,i?.in),r=s.getFullYear(),l=O(s,0);l.setFullYear(r+1,0,4),l.setHours(0,0,0,0);const u=ne(l),D=O(s,0);D.setFullYear(r,0,4),D.setHours(0,0,0,0);const f=ne(D);return s.getTime()>=u.getTime()?r+1:s.getTime()>=f.getTime()?r:r-1}function Be(e){const i=I(e),s=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return s.setUTCFullYear(i.getFullYear()),+e-+s}function Dt(e,...i){const s=O.bind(null,e||i.find(r=>typeof r=="object"));return i.map(s)}function Me(e,i){const s=I(e,i?.in);return s.setHours(0,0,0,0),s}function xt(e,i,s){const[r,l]=Dt(s?.in,e,i),u=Me(r),D=Me(l),f=+u-Be(u),h=+D-Be(D);return Math.round((f-h)/ct)}function yt(e,i){const s=Te(e,i),r=O(i?.in||e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),ne(r)}function Ne(e,i,s){const r=I(e,s?.in);return r.setTime(r.getTime()+i*lt),r}function Ie(e,i,s){return be(e,i*1e3,s)}function le(e,i,s){return z(e,i*7,s)}function he(e,i,s){return te(e,i*12,s)}function vt(e){return O(e,Date.now())}function gt(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Et(e){return!(!gt(e)&&typeof e!="number"||isNaN(+I(e)))}function de(e,i){const s=I(e,i?.in),r=s.getMonth();return s.setFullYear(s.getFullYear(),r+1,0),s.setHours(23,59,59,999),s}function Pe(e,i){const s=I(e,i?.in);return s.setDate(1),s.setHours(0,0,0,0),s}function Ct(e,i){const s=I(e,i?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function St(e,i){const s=$(),r=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,l=I(e,i?.in),u=l.getDay(),D=(u<r?-7:0)+6-(u-r);return l.setDate(l.getDate()+D),l.setHours(23,59,59,999),l}var wt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},At=(e,i,s)=>{let r;const l=wt[e];return typeof l=="string"?r=l:i===1?r=l.one:r=l.other.replace("{{count}}",i.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r};function pe(e){return(i={})=>{const s=i.width?String(i.width):e.defaultWidth;return e.formats[s]||e.formats[e.defaultWidth]}}var Ft={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Tt={date:pe({formats:Ft,defaultWidth:"full"}),time:pe({formats:bt,defaultWidth:"full"}),dateTime:pe({formats:kt,defaultWidth:"full"})},Bt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Mt=(e,i,s,r)=>Bt[e];function _(e){return(i,s)=>{const r=s?.context?String(s.context):"standalone";let l;if(r==="formatting"&&e.formattingValues){const D=e.defaultFormattingWidth||e.defaultWidth,f=s?.width?String(s.width):D;l=e.formattingValues[f]||e.formattingValues[D]}else{const D=e.defaultWidth,f=s?.width?String(s.width):e.defaultWidth;l=e.values[f]||e.values[D]}const u=e.argumentCallback?e.argumentCallback(i):i;return l[u]}}var Nt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},It={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Lt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ot={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ut={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Jt=(e,i)=>{const s=Number(e),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},Xt={ordinalNumber:Jt,era:_({values:Nt,defaultWidth:"wide"}),quarter:_({values:It,defaultWidth:"wide",argumentCallback:e=>e-1}),month:_({values:Pt,defaultWidth:"wide"}),day:_({values:Lt,defaultWidth:"wide"}),dayPeriod:_({values:Ot,defaultWidth:"wide",formattingValues:Ut,defaultFormattingWidth:"wide"})};function q(e){return(i,s={})=>{const r=s.width,l=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],u=i.match(l);if(!u)return null;const D=u[0],f=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],h=Array.isArray(f)?zt(f,v=>v.test(D)):Rt(f,v=>v.test(D));let C;C=e.valueCallback?e.valueCallback(h):h,C=s.valueCallback?s.valueCallback(C):C;const y=i.slice(D.length);return{value:C,rest:y}}}function Rt(e,i){for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&i(e[s]))return s}function zt(e,i){for(let s=0;s<e.length;s++)if(i(e[s]))return s}function Wt(e){return(i,s={})=>{const r=i.match(e.matchPattern);if(!r)return null;const l=r[0],u=i.match(e.parsePattern);if(!u)return null;let D=e.valueCallback?e.valueCallback(u[0]):u[0];D=s.valueCallback?s.valueCallback(D):D;const f=i.slice(l.length);return{value:D,rest:f}}}var Yt=/^(\d+)(th|st|nd|rd)?/i,jt=/\d+/i,Ht={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Gt={any:[/^b/i,/^(a|c)/i]},Kt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$t={any:[/1/i,/2/i,/3/i,/4/i]},Vt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},_t={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Qt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Zt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},en={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tn={ordinalNumber:Wt({matchPattern:Yt,parsePattern:jt,valueCallback:e=>parseInt(e,10)}),era:q({matchPatterns:Ht,defaultMatchWidth:"wide",parsePatterns:Gt,defaultParseWidth:"any"}),quarter:q({matchPatterns:Kt,defaultMatchWidth:"wide",parsePatterns:$t,defaultParseWidth:"any",valueCallback:e=>e+1}),month:q({matchPatterns:Vt,defaultMatchWidth:"wide",parsePatterns:_t,defaultParseWidth:"any"}),day:q({matchPatterns:qt,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),dayPeriod:q({matchPatterns:Zt,defaultMatchWidth:"any",parsePatterns:en,defaultParseWidth:"any"})},nn={code:"en-US",formatDistance:At,formatLong:Tt,formatRelative:Mt,localize:Xt,match:tn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rn(e,i){const s=I(e,i?.in);return xt(s,Ct(s))+1}function sn(e,i){const s=I(e,i?.in),r=+ne(s)-+yt(s);return Math.round(r/we)+1}function Le(e,i){const s=I(e,i?.in),r=s.getFullYear(),l=$(),u=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,D=O(i?.in||e,0);D.setFullYear(r+1,0,u),D.setHours(0,0,0,0);const f=V(D,i),h=O(i?.in||e,0);h.setFullYear(r,0,u),h.setHours(0,0,0,0);const C=V(h,i);return+s>=+f?r+1:+s>=+C?r:r-1}function an(e,i){const s=$(),r=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,l=Le(e,i),u=O(i?.in||e,0);return u.setFullYear(l,0,r),u.setHours(0,0,0,0),V(u,i)}function on(e,i){const s=I(e,i?.in),r=+V(s,i)-+an(s,i);return Math.round(r/we)+1}function M(e,i){const s=e<0?"-":"",r=Math.abs(e).toString().padStart(i,"0");return s+r}var W={y(e,i){const s=e.getFullYear(),r=s>0?s:1-s;return M(i==="yy"?r%100:r,i.length)},M(e,i){const s=e.getMonth();return i==="M"?String(s+1):M(s+1,2)},d(e,i){return M(e.getDate(),i.length)},a(e,i){const s=e.getHours()/12>=1?"pm":"am";switch(i){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(e,i){return M(e.getHours()%12||12,i.length)},H(e,i){return M(e.getHours(),i.length)},m(e,i){return M(e.getMinutes(),i.length)},s(e,i){return M(e.getSeconds(),i.length)},S(e,i){const s=i.length,r=e.getMilliseconds(),l=Math.trunc(r*Math.pow(10,s-3));return M(l,i.length)}},G={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Oe={G:function(e,i,s){const r=e.getFullYear()>0?1:0;switch(i){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})}},y:function(e,i,s){if(i==="yo"){const r=e.getFullYear(),l=r>0?r:1-r;return s.ordinalNumber(l,{unit:"year"})}return W.y(e,i)},Y:function(e,i,s,r){const l=Le(e,r),u=l>0?l:1-l;if(i==="YY"){const D=u%100;return M(D,2)}return i==="Yo"?s.ordinalNumber(u,{unit:"year"}):M(u,i.length)},R:function(e,i){const s=Te(e);return M(s,i.length)},u:function(e,i){const s=e.getFullYear();return M(s,i.length)},Q:function(e,i,s){const r=Math.ceil((e.getMonth()+1)/3);switch(i){case"Q":return String(r);case"QQ":return M(r,2);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,i,s){const r=Math.ceil((e.getMonth()+1)/3);switch(i){case"q":return String(r);case"qq":return M(r,2);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,i,s){const r=e.getMonth();switch(i){case"M":case"MM":return W.M(e,i);case"Mo":return s.ordinalNumber(r+1,{unit:"month"});case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})}},L:function(e,i,s){const r=e.getMonth();switch(i){case"L":return String(r+1);case"LL":return M(r+1,2);case"Lo":return s.ordinalNumber(r+1,{unit:"month"});case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})}},w:function(e,i,s,r){const l=on(e,r);return i==="wo"?s.ordinalNumber(l,{unit:"week"}):M(l,i.length)},I:function(e,i,s){const r=sn(e);return i==="Io"?s.ordinalNumber(r,{unit:"week"}):M(r,i.length)},d:function(e,i,s){return i==="do"?s.ordinalNumber(e.getDate(),{unit:"date"}):W.d(e,i)},D:function(e,i,s){const r=rn(e);return i==="Do"?s.ordinalNumber(r,{unit:"dayOfYear"}):M(r,i.length)},E:function(e,i,s){const r=e.getDay();switch(i){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})}},e:function(e,i,s,r){const l=e.getDay(),u=(l-r.weekStartsOn+8)%7||7;switch(i){case"e":return String(u);case"ee":return M(u,2);case"eo":return s.ordinalNumber(u,{unit:"day"});case"eee":return s.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(l,{width:"short",context:"formatting"});case"eeee":default:return s.day(l,{width:"wide",context:"formatting"})}},c:function(e,i,s,r){const l=e.getDay(),u=(l-r.weekStartsOn+8)%7||7;switch(i){case"c":return String(u);case"cc":return M(u,i.length);case"co":return s.ordinalNumber(u,{unit:"day"});case"ccc":return s.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(l,{width:"narrow",context:"standalone"});case"cccccc":return s.day(l,{width:"short",context:"standalone"});case"cccc":default:return s.day(l,{width:"wide",context:"standalone"})}},i:function(e,i,s){const r=e.getDay(),l=r===0?7:r;switch(i){case"i":return String(l);case"ii":return M(l,i.length);case"io":return s.ordinalNumber(l,{unit:"day"});case"iii":return s.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(r,{width:"short",context:"formatting"});case"iiii":default:return s.day(r,{width:"wide",context:"formatting"})}},a:function(e,i,s){const l=e.getHours()/12>=1?"pm":"am";switch(i){case"a":case"aa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,i,s){const r=e.getHours();let l;switch(r===12?l=G.noon:r===0?l=G.midnight:l=r/12>=1?"pm":"am",i){case"b":case"bb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,i,s){const r=e.getHours();let l;switch(r>=17?l=G.evening:r>=12?l=G.afternoon:r>=4?l=G.morning:l=G.night,i){case"B":case"BB":case"BBB":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,i,s){if(i==="ho"){let r=e.getHours()%12;return r===0&&(r=12),s.ordinalNumber(r,{unit:"hour"})}return W.h(e,i)},H:function(e,i,s){return i==="Ho"?s.ordinalNumber(e.getHours(),{unit:"hour"}):W.H(e,i)},K:function(e,i,s){const r=e.getHours()%12;return i==="Ko"?s.ordinalNumber(r,{unit:"hour"}):M(r,i.length)},k:function(e,i,s){let r=e.getHours();return r===0&&(r=24),i==="ko"?s.ordinalNumber(r,{unit:"hour"}):M(r,i.length)},m:function(e,i,s){return i==="mo"?s.ordinalNumber(e.getMinutes(),{unit:"minute"}):W.m(e,i)},s:function(e,i,s){return i==="so"?s.ordinalNumber(e.getSeconds(),{unit:"second"}):W.s(e,i)},S:function(e,i){return W.S(e,i)},X:function(e,i,s){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(i){case"X":return Je(r);case"XXXX":case"XX":return Y(r);case"XXXXX":case"XXX":default:return Y(r,":")}},x:function(e,i,s){const r=e.getTimezoneOffset();switch(i){case"x":return Je(r);case"xxxx":case"xx":return Y(r);case"xxxxx":case"xxx":default:return Y(r,":")}},O:function(e,i,s){const r=e.getTimezoneOffset();switch(i){case"O":case"OO":case"OOO":return"GMT"+Ue(r,":");case"OOOO":default:return"GMT"+Y(r,":")}},z:function(e,i,s){const r=e.getTimezoneOffset();switch(i){case"z":case"zz":case"zzz":return"GMT"+Ue(r,":");case"zzzz":default:return"GMT"+Y(r,":")}},t:function(e,i,s){const r=Math.trunc(+e/1e3);return M(r,i.length)},T:function(e,i,s){return M(+e,i.length)}};function Ue(e,i=""){const s=e>0?"-":"+",r=Math.abs(e),l=Math.trunc(r/60),u=r%60;return u===0?s+String(l):s+String(l)+i+M(u,2)}function Je(e,i){return e%60===0?(e>0?"-":"+")+M(Math.abs(e)/60,2):Y(e,i)}function Y(e,i=""){const s=e>0?"-":"+",r=Math.abs(e),l=M(Math.trunc(r/60),2),u=M(r%60,2);return s+l+i+u}var Xe=(e,i)=>{switch(e){case"P":return i.date({width:"short"});case"PP":return i.date({width:"medium"});case"PPP":return i.date({width:"long"});case"PPPP":default:return i.date({width:"full"})}},Re=(e,i)=>{switch(e){case"p":return i.time({width:"short"});case"pp":return i.time({width:"medium"});case"ppp":return i.time({width:"long"});case"pppp":default:return i.time({width:"full"})}},un=(e,i)=>{const s=e.match(/(P+)(p+)?/)||[],r=s[1],l=s[2];if(!l)return Xe(e,i);let u;switch(r){case"P":u=i.dateTime({width:"short"});break;case"PP":u=i.dateTime({width:"medium"});break;case"PPP":u=i.dateTime({width:"long"});break;case"PPPP":default:u=i.dateTime({width:"full"});break}return u.replace("{{date}}",Xe(r,i)).replace("{{time}}",Re(l,i))},cn={p:Re,P:un},ln=/^D+$/,hn=/^Y+$/,dn=["D","DD","YY","YYYY"];function pn(e){return ln.test(e)}function fn(e){return hn.test(e)}function mn(e,i,s){const r=Dn(e,i,s);if(console.warn(r),dn.includes(e))throw new RangeError(r)}function Dn(e,i,s){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${i}\`) for formatting ${r} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var xn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vn=/^'([^]*?)'?$/,gn=/''/g,En=/[a-zA-Z]/;function j(e,i,s){const r=$(),l=s?.locale??r.locale??nn,u=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,D=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,f=I(e,s?.in);if(!Et(f))throw new RangeError("Invalid time value");let h=i.match(yn).map(y=>{const v=y[0];if(v==="p"||v==="P"){const c=cn[v];return c(y,l.formatLong)}return y}).join("").match(xn).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const v=y[0];if(v==="'")return{isToken:!1,value:Cn(y)};if(Oe[v])return{isToken:!0,value:y};if(v.match(En))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:y}});l.localize.preprocessor&&(h=l.localize.preprocessor(f,h));const C={firstWeekContainsDate:u,weekStartsOn:D,locale:l};return h.map(y=>{if(!y.isToken)return y.value;const v=y.value;(!s?.useAdditionalWeekYearTokens&&fn(v)||!s?.useAdditionalDayOfYearTokens&&pn(v))&&mn(v,i,String(e));const c=Oe[v[0]];return c(f,v,l.localize,C)}).join("")}function Cn(e){const i=e.match(vn);return i?i[1].replace(gn,"'"):e}function Sn(e,i){const s=I(e,i?.in),r=s.getFullYear(),l=s.getMonth(),u=O(s,0);return u.setFullYear(r,l+1,0),u.setHours(0,0,0,0),u.getDate()}function Q(e,i,s){return z(e,-i,s)}function wn(e,i,s){const r=I(e,s?.in),l=r.getFullYear(),u=r.getDate(),D=O(s?.in||e,0);D.setFullYear(l,i,15),D.setHours(0,0,0,0);const f=Sn(D);return r.setMonth(i,Math.min(u,f)),r}function J(e,i,s){let r=I(e,s?.in);return isNaN(+r)?O(s?.in||e,NaN):(i.year!=null&&r.setFullYear(i.year),i.month!=null&&(r=wn(r,i.month)),i.date!=null&&r.setDate(i.date),i.hours!=null&&r.setHours(i.hours),i.minutes!=null&&r.setMinutes(i.minutes),i.seconds!=null&&r.setSeconds(i.seconds),i.milliseconds!=null&&r.setMilliseconds(i.milliseconds),r)}function An(e){const i=vt(e?.in),s=i.getFullYear(),r=i.getMonth(),l=i.getDate(),u=O(e?.in,0);return u.setFullYear(s,r,l+1),u.setHours(0,0,0,0),u}function Fn(e,i,s){return te(e,-i,s)}function bn(e,i,s){return ke(e,-i,s)}function kn(e,i,s){return Ne(e,-i,s)}function Tn(e,i,s){return Ie(e,-i,s)}function Bn(e,i,s){return le(e,-i,s)}function Mn(e,i,s){return he(e,-i,s)}var Nn=st(at(),1);function ie(e){const i=e.trim();if(!i.startsWith("{")||!i.endsWith("}"))return{type:"unhandled",result:null};let s=i.slice(1,-1).trim().replace("\\*","*");const r=s.match(/^"([^"]+)":(.+)$/);let l=null,u=s;r&&(l=r[1],u=r[2].trim());const D=re(u);if(D.success){let h=D.date;if(l){try{h=j(h,l)}catch{return{type:"unhandled",result:null}}return{type:"formattedDate",result:h}}return{type:D.type,result:h}}const f=Un(u);return f.success?{type:"math",result:f.value}:{type:"unhandled",result:null}}function re(e){const i=e.toLowerCase(),s=new Date,r=On(e,s);if(r)return{success:!0,type:"dateTime",date:r};const l=Ln(e,s);if(l)return{success:!0,type:"date",date:l};if(i==="today")return{success:!0,type:"date",date:L(s)};if(i==="tomorrow")return{success:!0,type:"date",date:L(z(s,1))};if(i==="yesterday")return{success:!0,type:"date",date:L(Q(s,1))};const u=In(e,s);if(u)return{success:!0,type:"date",date:u};const D=Pn(e,s);if(D)return{success:!0,type:jn(D)?"dateTime":"date",date:D};const f=ze(e,s);return f?{success:!0,type:"time",date:f}:{success:!1}}function In(e,i){const s=["january","february","march","april","may","june","july","august","september","october","november","december"],r=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],l=e.trim().toLowerCase();if(l==="the weekend"){const f=We(i,6);return L(f)}for(let f of s)if(l===f){const h=fe(f),C=new Date(i.getFullYear(),h,1);return L(C)}const u=e.match(/^(January|February|March|April|May|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(\d{1,2})(st|nd|rd|th)?$/i);if(u){const f=u[1],h=parseInt(u[2],10),C=fe(f);if(C!==-1){const y=new Date(i.getFullYear(),C,h);return L(y)}}const D=e.match(/^(end|beginning)\s+of\s+(January|February|March|April|May|June|July|August|September|October|November|December)$/i);if(D){const f=D[1].toLowerCase(),h=D[2],C=fe(h);if(C!==-1){let y=new Date(i.getFullYear(),C,1);return f==="end"?(y=de(y),y=J(y,{hours:23,minutes:59,seconds:59,milliseconds:999})):f==="beginning"&&(y=J(y,{hours:0,minutes:0,seconds:0,milliseconds:0})),y}}if(r.includes(l)){const f=Z(l),h=Wn(i,f);return L(h)}return null}function Pn(e,i){const s=e.trim().toLowerCase(),r=s.match(/^(monday|tuesday|wednesday|thursday|friday|saturday|sunday)\s+of\s+(last|next)\s+week$/i);if(r){const y=r[1].toLowerCase(),v=r[2].toLowerCase(),c=Z(y),m=J(i,{date:i.getDate()-i.getDay()}),d=v==="last"?Q(m,7):z(m,7),t=z(d,c);return L(t)}const l=s.match(/^(next|last)\s+(monday|tuesday|wednesday|thursday|friday|saturday|sunday)$/i);if(l){const y=l[1].toLowerCase(),v=l[2].toLowerCase(),c=Z(v);if(c!==-1){if(y==="next")return L(We(i,c));if(y==="last")return L(Yn(i,c))}}const u=s.match(/^(next|last)\s+(day|week|month|year|hour|minute|second)s?$/i);if(u){const y=u[1].toLowerCase(),v=u[2].toLowerCase();let c;return y==="next"?c=xe(i,1,v):y==="last"&&(c=H(i,1,v)),De(v)?c:L(c)}const D=s.match(/^(?:in\s+((?:-?\d+)|(?:\w+(?:[\s-]+\w+)*))\s+(day|week|month|year|hour|minute|second)s?|((?:-?\d+)|(?:\w+(?:[\s-]+\w+)*))\s+(day|week|month|year|hour|minute|second)s?\s+from\s+now)$/i);if(D){let y=D[1]||D[3],v=parseInt(y,10);if(isNaN(v)&&(v=me(y),isNaN(v)))return null;const c=(D[2]||D[4]).toLowerCase(),m=xe(i,v,c);return De(c)?m:L(m)}const f=s.match(/^(\d+|\w+)\s+(day|week|month|year|hour|minute|second)s?\s+ago$/i);if(f){const y=parseInt(f[1],10)||me(f[1]),v=f[2].toLowerCase();if(isNaN(y))return null;const c=H(i,y,v);return De(v)?c:L(c)}const h=s.match(/^(end|beginning)\s+of\s+(next|last|this)?\s*(day|week|month|year)$/i);if(h){const y=h[1].toLowerCase(),v=h[2]?h[2].toLowerCase():"this",c=h[3].toLowerCase();let m=new Date(i);if(v==="next"?(c==="day"&&(m=z(i,1)),c==="week"&&(m=le(i,1)),c==="month"&&(m=te(i,1)),c==="year"&&(m=he(i,1))):v==="last"&&(c==="day"&&(m=H(i,1,c)),c==="week"&&(m=H(i,1,c)),c==="month"&&(m=H(i,1,c)),c==="year"&&(m=H(i,1,c))),c==="day"||(c==="week"?m=J(m,{date:m.getDate()-m.getDay()}):c==="month"?m=J(m,{date:1}):c==="year"&&(m=J(m,{month:0,date:1}))),y==="end"){if(c==="day")return J(m,{hours:23,minutes:59,seconds:59,milliseconds:999});if(c==="week")return St(m);if(c==="month")return de(m);if(c==="year")return J(new Date(m.getFullYear(),11,31),{hours:23,minutes:59,seconds:59,milliseconds:999})}else if(y==="beginning"){if(c==="day"||c==="week")return L(m);if(c==="month")return Pe(m);if(c==="year")return L(m)}}const C=s.match(/^this\s+(day|week|month|year)$/i);if(C){const y=C[1].toLowerCase();let v=new Date(i);if(y==="day")return L(v);if(y==="week"){const c=J(v,{date:v.getDate()-v.getDay()}),m=z(c,6);return L(c)}if(y==="month")return Pe(v);if(y==="year")return new Date(v.getFullYear(),0,1)}return null}function Ln(e,i){const s=e.match(/^(\w+\s+\w+)\s+(before|after)\s+(?:the\s+)?(.*)$/i);if(s){const l=s[1].toLowerCase(),u=s[2].toLowerCase(),D=s[3].trim(),f=re(D);if(f.success){let h=parseInt(l.split(" ")[0],10);isNaN(h)&&(h=me(l.split(" ")[0]));const C=l.split(" ")[1];if(u==="after")return xe(f.date,h,C);if(u==="before")return H(f.date,h,C)}}const r=e.match(/^(first|second|third|fourth|fifth|last)\s+(weekday|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\s+of\s+(.*)$/i);if(r){const l=r[1].toLowerCase(),u=r[2].toLowerCase(),D=r[3].trim(),f=re(D);if(f.success){let h=f.date;const C=h.getMonth(),y={first:1,second:2,third:3,fourth:4,fifth:5};if(y[l]){const v=y[l];if(h=J(h,{date:1}),u==="weekday"){for(;h.getDay()===0||h.getDay()===6;)h=z(h,1);let c=1;for(;c<v;)if(h=z(h,1),h.getDay()!==0&&h.getDay()!==6&&c++,h.getMonth()!==C)return null}else{const c=Z(u);for(;h.getDay()!==c;)h=z(h,1);if(h=z(h,(v-1)*7),h.getMonth()!==C)return null}}else if(l==="last")if(h=J(h,{date:de(h).getDate()}),u==="weekday")for(;h.getDay()===0||h.getDay()===6;)h=Q(h,1);else{const v=Z(u);for(;h.getDay()!==v;)h=Q(h,1)}return L(h)}}return null}function ze(e,i){const s=e.trim().toLowerCase();if(s==="now")return new Date;const r=s.match(/^(\d{1,2})(:(\d{2}))?\s*(am|pm)?$/i);if(r){let l=parseInt(r[1],10);const u=r[3]?parseInt(r[3],10):0,D=r[4];return D&&(D.toLowerCase()==="pm"&&l<12&&(l+=12),D.toLowerCase()==="am"&&l===12&&(l=0)),J(i,{hours:l,minutes:u,seconds:0,milliseconds:0})}return null}function On(e,i){const s=e.match(/^(.+?)\s+(?:at\s+)?(\d{1,2}:\d{2}\s*(?:am|pm)?|\d{1,2}\s*(?:am|pm))$/i);if(s){const r=s[1].trim(),l=s[2].trim(),u=re(r);if(u.success){const D=ze(l,u.date);if(D)return J(D,{milliseconds:0})}}return null}function Un(e){try{const i=Nn.default.parseScript(e),s=se(i.body[0].expression);return typeof s=="number"?{success:!0,value:s}:{success:!1}}catch{return{success:!1}}}function se(e){switch(e.type){case"Literal":return e.value;case"BinaryExpression":const i=se(e.left),s=se(e.right);return Jn(e.operator,i,s);case"UnaryExpression":const r=se(e.argument);return Xn(e.operator,r);case"Identifier":return zn(e.name);case"CallExpression":return Rn(e);default:throw new Error("Unsupported expression")}}function Jn(e,i,s){switch(e){case"+":return i+s;case"-":return i-s;case"*":return i*s;case"/":return i/s;case"**":return Math.pow(i,s);case"%":return i%s;default:throw new Error("Unsupported operator")}}function Xn(e,i){switch(e){case"+":return+i;case"-":return-i;default:throw new Error("Unsupported unary operator")}}function Rn(e){if(e.callee.type==="Identifier"){const i=e.callee.name.toLowerCase();if(i==="pi")return Math.PI;if(i==="e")return Math.E}throw new Error("Unsupported function")}function zn(e){const i={pi:Math.PI,e:Math.E};if(i[e.toLowerCase()]!==void 0)return i[e.toLowerCase()];throw new Error("Unknown identifier")}function fe(e){const i=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],s=e.toLowerCase(),r=i.indexOf(s);return r===-1?-1:r>11?r-12:r}function Z(e){return["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].indexOf(e.toLowerCase())}function We(e,i){const s=new Date(e),r=s.getDay();let l=(i-r+7)%7;return l=l===0?7:l,s.setDate(s.getDate()+l),s}function Wn(e,i){const s=new Date(e);let l=s.getDay()-i;return s.setDate(s.getDate()-l),L(s)}function Yn(e,i){const s=new Date(e);return s.setDate(s.getDate()-((7+s.getDay()-i)%7||7)),s}function me(e){const i={zero:0,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90,a:1,an:1};if(i[e.toLowerCase()]!==void 0)return i[e.toLowerCase()];const s=e.toLowerCase().split(" ");let r=0;for(let l of s)if(i[l]!==void 0)r+=i[l];else return NaN;return r}function De(e){return e==="hour"||e==="minute"||e==="second"||e==="millisecond"}function L(e){return J(e,{hours:0,minutes:0,seconds:0,milliseconds:0})}function jn(e){const i=e.getHours(),s=e.getMinutes(),r=e.getSeconds(),l=e.getMilliseconds();return i>0||s>0||r>0||l||0}function xe(e,i,s){switch(s){case"day":case"days":return z(e,i);case"week":case"weeks":return le(e,i);case"month":case"months":return te(e,i);case"year":case"years":return he(e,i);case"hour":case"hours":return ke(e,i);case"minute":case"minutes":return Ne(e,i);case"second":case"seconds":return Ie(e,i);default:return null}}function H(e,i,s){switch(s){case"day":case"days":return Q(e,i);case"week":case"weeks":return Bn(e,i);case"month":case"months":return Fn(e,i);case"year":case"years":return Mn(e,i);case"hour":case"hours":return bn(e,i);case"minute":case"minutes":return kn(e,i);case"second":case"seconds":return Tn(e,i);default:return null}}function Hn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Gn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)).substring(0,4)}var Kn='<html><head><title>Manage Default Templates</title><style>body{font-family:sans-serif;margin:16px}table{width:100%;border-collapse:collapse}td,th{padding:8px;text-align:left}button{margin:4px;padding:8px 12px;font-size:14px;cursor:pointer}body{background-color:#fff;color:#000}th{background-color:#f2f2f2}td,th{border:1px solid #ccc}button{background-color:#e0e0e0;color:#000;border:1px solid #ccc}button:hover{background-color:#d5d5d5}@media (prefers-color-scheme:dark){body{background-color:#1e1e1e;color:#fff}th{background-color:#333}td,th{border:1px solid #444}button{background-color:#444;color:#fff;border:1px solid #555}button:hover{background-color:#555}}</style></head><body><h1>Manage Default Templates for Tags</h1><section id="globalTemplateSection"><p id="globalTemplateDisplay">No global default template set.</p><button id="setGlobalTemplateButton">Set</button> <button id="clearGlobalTemplateButton">Clear</button></section><table id="mappingsTable"><thead><tr><th>Tag</th><th>Template Note</th><th>Actions</th></tr></thead><tbody></tbody></table><button id="addMappingButton">Add Default</button><script>async function refreshMappings(){const e=await getMappings(),t=document.querySelector("#mappingsTable tbody");t.innerHTML="";for(const n in e){const a=e[n],l=document.createElement("tr"),i=document.createElement("td");i.textContent=n;const o=document.createElement("td");o.textContent=a.name||"(Note not found)";const p=document.createElement("td"),c=document.createElement("button");c.textContent="Edit",c.addEventListener("click",(()=>editMapping(n)));const d=document.createElement("button");d.textContent="Delete",d.addEventListener("click",(()=>deleteMapping(n))),p.appendChild(c),p.appendChild(d),l.appendChild(i),l.appendChild(o),l.appendChild(p),t.appendChild(l)}}async function getMappings(){return await window.callAmplenotePlugin("getMappings")||{}}async function addMapping(){await window.callAmplenotePlugin("addMapping")&&await refreshMappings()}async function editMapping(e){await window.callAmplenotePlugin("editMapping",e)&&await refreshMappings()}async function deleteMapping(e){const t=await window.callAmplenotePlugin("confirmDelete",e);console.log(t),-1==t&&(await window.callAmplenotePlugin("deleteMapping",e),await refreshMappings())}async function refreshGlobalTemplate(){const e=await window.callAmplenotePlugin("getGlobalTemplate"),t=document.getElementById("globalTemplateDisplay");e&&e.name?t.textContent="Current Global Template: "+e.name:t.textContent="No global default template set."}async function setGlobalTemplate(){await window.callAmplenotePlugin("setGlobalTemplate")&&await refreshGlobalTemplate()}async function clearGlobalTemplate(){await window.callAmplenotePlugin("clearGlobalTemplate"),await refreshGlobalTemplate()}async function refreshAll(){await refreshGlobalTemplate(),await refreshMappings()}document.getElementById("addMappingButton").addEventListener("click",addMapping),document.getElementById("setGlobalTemplateButton").addEventListener("click",setGlobalTemplate),document.getElementById("clearGlobalTemplateButton").addEventListener("click",clearGlobalTemplate),refreshAll()<\/script></body></html>',$n=class{constructor(){this.localStorageAvailable=this.checkLocalStorage(),this.memoryStorage={}}checkLocalStorage(){try{const e="__storage_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),!0}catch{return!1}}setItem(e,i,s){if(!(s instanceof Date))throw new Error("expiryDate must be a valid Date object.");const r={value:i,expiry:s.toISOString()},l=JSON.stringify(r);if(this.localStorageAvailable)try{window.localStorage.setItem(e,l)}catch(u){console.warn(`Failed to set item '${e}' in localStorage. Using memory storage.`,u),this.memoryStorage[e]=l}else this.memoryStorage[e]=l}getItem(e){let i;if(this.localStorageAvailable)try{i=window.localStorage.getItem(e)}catch(s){console.warn(`Failed to get item '${e}' from localStorage. Checking memory storage.`,s),i=this.memoryStorage[e]||null}else i=this.memoryStorage[e]||null;if(!i)return null;try{const s=JSON.parse(i),r=new Date,l=new Date(s.expiry);return r>=l?(this.removeItem(e),null):s.value}catch(s){return console.error(`Failed to parse item '${e}'. Removing it.`,s),this.removeItem(e),null}}removeItem(e){if(this.localStorageAvailable)try{window.localStorage.removeItem(e)}catch(i){console.warn(`Failed to remove item '${e}' from localStorage. Removing from memory storage.`,i),delete this.memoryStorage[e]}else delete this.memoryStorage[e]}clear(){if(this.localStorageAvailable)try{window.localStorage.clear()}catch(e){console.warn("Failed to clear localStorage. Clearing memory storage instead.",e),this.memoryStorage={}}else this.memoryStorage={}}},Vn=new $n,Ye=Vn;function _n(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function qn(e,i,s){const r=s.lastIndexOf("\\[\\[",e),l=s.indexOf("\\]\\]",e);return r!==-1&&l!==-1&&r<e&&l>=e+i}function Qn(e,i){const s=i.lastIndexOf(`
`,e)+1,r="- [ ]";return i.startsWith(r,s)}function ye(e){return ae(e)!=null}function ae(e){return/^\s*-\s/.test(e)?"bullet":/^\s*\d+\.\s/.test(e)?"number":/^\s*-\s\[ \]/.test(e)?"task":null}function Zn(e,i){const s=e.lastIndexOf(`
`,i),r=e.indexOf(`
`,i),l=r===-1?e.length:r;return e.substring(s+1,l)}function ei(e){const i=e.match(/^(\s*)/);return i?i[0]:""}function ti(e){return e.replace(/^\s*(\s*-\s\[ \]\s*|[-*]\s+|\d+\.\s+)/,"").trim()}function je(e){try{const s=new URL(e).searchParams.get("tag");return s?decodeURIComponent(s):null}catch(i){return console.error("Invalid URL provided:",i),null}}function He(e){try{const i=new URL(e);if(i.pathname!=="/notes/new")return null;const s=new URLSearchParams(i.search),r=s.get("source");if(!r)return null;const l=s.get("tags"),u=l?l.split(",").map(f=>f.trim()):null,D=s.get("name")?decodeURIComponent(s.get("name")):"";return{source:r,name:D,tags:u}}catch{return null}}function Ge(e,i,s=!1){const l=new RegExp(`^(#{1,6})\\s+${i}\\s*$`,"m").exec(e);if(!l)return"";const u=l[1].length,D=l.index,f=D+l[0].length,h=new RegExp(`(^#{1,${u}}\\s+.*$)|(^---+$)`,"m"),C=e.slice(f),y=h.exec(C);let v;return y?v=y.index:v=C.length,(s?e.slice(f,f+v):e.slice(D,f+v)).trim()}function Ke(e){const i=/\{([^}]+)\}/g;return e.replace(i,(s,r)=>{const l=ie(s);return l.type==="date"?j(l.result,"MMMM do, yyyy"):r})}function ni(e){const i=/\{([^}]+)\}/g;return e.replace(i,(s,r)=>{const l=ie(s);return l.type!=="unhandled"?$e(l):r})}function ii(e,i,s,r){const l=ie(e);if(l.type==="math"){const u=l.result;return s?u:ve(u,i,r)}else if(l.type==="date"||l.type==="dateTime"||l.type==="time"){const u=$e(l);return s?u:ve(u,i,r)}else return l.type==="formattedDate"?s?l.result:ve(l.result,i,r):e}function $e(e){return e.type==="dateTime"?e.result.getSeconds()>0?j(e.result,"MMMM do, yyyy 'at' HH:mm:ss"):j(e.result,"MMMM do, yyyy 'at' HH:mm"):e.type==="date"?j(e.result,"MMMM do, yyyy"):e.type==="time"?e.result.getSeconds()>0?j(e.result,"HH:mm:ss"):j(e.result,"HH:mm"):e.type==="math"?e.result.toString():e.type==="formattedDate"?e.result:null}function ve(e,i,s){const r=s.counter++;return s.content.push(`[^templater-${s.prefix}-${r}]: [${e}]()
${i}`),`[${e}][^templater-${s.prefix}-${r}]`}function ri(e){let i=null,s=e;const r=e.lastIndexOf("/");return r!==-1&&(i=e.substring(0,r),s=e.substring(r+1).trim()),{tag:i,noteName:s}}async function si(e,i,s){let r=s?await e.notes.find({name:i,tags:[s]}):await e.notes.find({name:i});return r||(r=await e.notes.create(i,s?[s]:[])),r}async function ai(e,i){const s=/\\\[\\\[(\??_?=?)?([^\]#|]+?)(?:#(>?)([^\]|]+))?(?:\\\|([^\]]+))?\\\]\\\]/g,r=/\{(=)([^\]#|]+?)(?:#(>?)([^\]|]+))?\}/g,l=[...i.matchAll(s),...i.matchAll(r)],u=[],D=[];for(const f of l){const h=f[0],C=f[1]==="?",y=f[1]==="_",v=f[1]==="=";let c=f[2];const m=f[3];let d=f[4];const t=f[5];c=Ke(c),d&&(d=Ke(d));const{tag:n,noteName:a}=ri(c);let o;if(C||v||y?o=n?await e.notes.find({name:a,tags:[n]}):await e.notes.find({name:a}):o=await si(e,a,n),!o&&C){const p=`[[${c}${d?"#"+d:""}]]`;i=i.replace(h,p);continue}if(!o&&y){i=i.replace(h,"");continue}if(!(!o&&v))if(v){let p=await o.content();d&&(p=Ge(p,d,m===">"));const{templateMarkdown:x,footnotes:S,newTaskUUIDs:w}=await _e(e,o.uuid,p);u.push(...w),D.push(...S),i=Ve(i,x,h);continue}else{let p=await o.url();d&&(p+=`#${encodeURIComponent(d.replace(/\s/g,"_"))}`);const S=`[${t||a+(d?"#"+d:"")}](${p})`;i=i.replace(h,S)}}return{markdown:i,linkedTemplateFootnotes:D,linkedTemplateTaskUUIDs:u}}function oi(e){const i=/- \[ \] [^\n]*<!--\s*({[^}]+})\s*-->/g;let s=e;const r=[];let l;for(;(l=i.exec(e))!==null;){const u=l[1],D=Hn(),f=u.replace(/"uuid":"[^"]+"/,`"uuid":"${D}"`);s=s.replace(u,f),r.push(D)}return{modifiedMarkdown:s,newUUIDs:r}}async function ui(e,i,s,r){const l=Date.now();for(;;){const u=await e.getTask(i);if(u)return u;if(Date.now()-l>s)return null;await new Promise(D=>setTimeout(D,r))}}async function ci(e,i){const s=i.map(async r=>{const l=await ui(e,r,5e3,100);if(!l){console.error(`Task with UUID ${r} could not be found.`);return}let u=l.content,D={};const f=/\{(start|hide):([^}]+)\}/g;let h=[],C;for(;(C=f.exec(u))!==null;)h.push(C);for(const y of h){const[v,c,m]=y,d=ie(`{${m}}`);if(!["date","dateTime","time"].includes(d.type))continue;const t=d.result,n=Math.floor(t.getTime()/1e3);c==="start"?D.startAt=n:c==="hide"&&(D.hideUntil=n),u=u.replace(v,m.trim()).trim()}await e.updateTask(l.uuid,{content:u,...D})});await Promise.all(s)}function li(e,i,s){const r=e.split(/\r?\n/);let l=[],u=s,D=0;const f=r.shift();if(ae(f)===s)l.push(ti(f));else if(ye(f))l.push(""),l.push(`${i}${f}`);else return`
`+e;let h=f.trim().endsWith("\\");for(const C of r){const y=ye(C),v=C.trim().endsWith("\\");if(C===""||h)l.push(C);else if(y)l.push(`${i}${C}`),u=ae(C);else{l.push(...r.slice(D));break}h=v,D++}return l.join(`
`)}function oe(e){return e.settings[P.DEFAULT_TEMPLATE]}async function ue(e,i){const s=e.settings[P.TAG_DEFAULTS]?JSON.parse(e.settings[P.TAG_DEFAULTS]):{};if(s[i])return await e.notes.find(s[i]);{const r=e.settings[P.TEMPLATE_TAG]||P.defaults.TEMPLATE_TAG;return(await e.notes.filter({tag:r})).find(D=>D.tags.includes(i))}}function ce(e){let i={};if(e.settings[P.TAG_DEFAULTS])try{i=JSON.parse(e.settings[P.TAG_DEFAULTS])}catch{i={}}return i}function hi(e,i,s){const r=e.settings[P.TAG_DEFAULTS]?JSON.parse(e.settings[P.TAG_DEFAULTS]):{};r[i]=s,e.setSetting(P.TAG_DEFAULTS,JSON.stringify(r))}function Ve(e,i,s){const r=e.indexOf(s);if(r===-1){console.error("Template Insert tag not found.");return}const l=Zn(e,r);if(ye(l)){const D=ei(l);i=li(i,D,ae(l))}return e.replace(s,i)}async function _e(e,i,s){const r={prefix:i.slice(0,8),counter:1,content:[]},l=/\{(?:(start|hide):)?([^}]+)\}/g;s=s.replace(l,(c,m,d,t,n)=>{const a=qn(t,c.length,n),o=Qn(t,n),p=a||o;return m&&o?c:ii(c,d,p,r)});const{markdown:u,linkedTemplateFootnotes:D,linkedTemplateTaskUUIDs:f}=await ai(e,s),{modifiedMarkdown:h,newUUIDs:C}=oi(u);s=h;const y=r.content.concat(D),v=f.concat(C);return{templateMarkdown:s,footnotes:y,newTaskUUIDs:v}}async function ee(e,i,s,{insertMode:r="smart",section:l=null,sectionInner:u=!1}={}){let D=await s.content();l&&l!==""&&(D=Ge(D,l,u));let{templateMarkdown:f,footnotes:h,newTaskUUIDs:C}=await _e(e,s.uuid,D);if(h.length>0&&(f+=`
 
`+h.join(`
`)),r==="smart"&&e.context&&e.context.replaceSelection){const y="<Templater-"+Gn()+">";if(!await e.context.replaceSelection(y))return f;const c=await i.content(),m=Ve(c,f,y);i.replaceContent(m)}else if(!(r==="context"&&e.context&&e.context.replaceSelection&&await e.context.replaceSelection(f)))if(r==="replace")i.replaceContent(f);else if(r==="insertByReplace"){const y=await i.content(),v=y==="\\"?"":`
`+y;i.replaceContent(f+v)}else i.insertContent(f);return ci(e,C),null}async function qe(e,i){const s=i.name?ni(i.name):null,r=await e.notes.create(s,i.tags),l=i.source?await e.notes.find(i.source):null;l&&await ee(e,r,l,{insertMode:"replace",section:i.section,sectionInner:i.sectionInner||!1});const u=await r.url();return e.navigate(u),r}var P=Object.freeze({TEMPLATE_TAG:"Dynamic Template Tag (default: system/template)",DEFAULT_TEMPLATE:"Global Default Template",TAG_DEFAULTS:"Tag Default Templates",defaults:{TEMPLATE_TAG:"system/template"}}),Qe={constants:{},appOption:{"Manage Defaults":{async run(e){await e.openSidebarEmbed(.75)}}},renderEmbed(e,...i){return Kn},async onEmbedCall(e,i,...s){if(i==="getGlobalTemplate"){const r=e.settings[P.DEFAULT_TEMPLATE];let l=null;if(r){const u=r,D=await e.findNote({uuid:u}),f=D?D.name:"(Note not found)";l={uuid:u,name:f}}return l}else if(i==="setGlobalTemplate"){const r=await e.prompt("Select Global Default Template Note",{inputs:[{label:"Template Note",type:"note"}]});if(r){const l=r;if(l&&l.uuid)return await e.setSetting(P.DEFAULT_TEMPLATE,l.uuid),!0}return!1}else{if(i==="clearGlobalTemplate")return await e.setSetting(P.DEFAULT_TEMPLATE,null),!0;if(i==="getMappings"){const r=ce(e),l={};for(const u in r){const D=r[u],f=await e.findNote({uuid:D}),h=f?f.name:"(Note not found)";l[u]={uuid:D,name:h}}return l}else if(i==="addMapping"){const r=await e.prompt("Select Tag and Template Note",{inputs:[{label:"Tag",type:"tags"},{label:"Template Note",type:"note"}]});if(r){const[l,u]=r;if(l&&u&&u.uuid){const D=ce(e);return D[l]=u.uuid,await e.setSetting(P.TAG_DEFAULTS,JSON.stringify(D)),!0}}return!1}else if(i==="editMapping"){const r=s[0],l=ce(e);if(l[r]){const u=await e.findNote({uuid:l[r]}),D=await e.prompt("Edit Template Note for Tag: "+r,{inputs:[{label:"Template Note",type:"note",value:u}]});if(D){const f=D;if(f&&f.uuid)return l[r]=f.uuid,await e.setSetting(P.TAG_DEFAULTS,JSON.stringify(l)),!0}}return!1}else if(i==="confirmDelete"){const r=s[0];return await e.alert(`Are you sure you want to delete the default template for tag "${r}"?`,{actions:[{label:"Cancel",value:1}],primaryAction:{label:"Delete"}})}else if(i==="deleteMapping"){const r=s[0],l=ce(e);return l[r]?(delete l[r],await e.setSetting(P.TAG_DEFAULTS,JSON.stringify(l)),!0):!1}}},linkOption:{Create:{check(e,i){return He(i.href)!==null},async run(e,i){const s=He(i.href);await qe(e,s)}},"Edit Link":{check(e,i){const s=new URL(i.href),r=s.hostname!==""?s.hostname===e.context.pluginUUID:s.pathname==="//"+e.context.pluginUUID;return s.protocol==="plugin:"&&r&&s.searchParams.get("action")==="create"},async run(e,i){const s=new URL(i.href),r=Object.fromEntries(s.searchParams.entries()),l=r.source?{uuid:r.source}:null,u=await e.prompt("Edit Dynamic New Note Link",{inputs:[{label:"Note Name (it can include date and math expressions)",type:"string",value:r.name},{label:"Note Tags",type:"tags",limit:100,value:r.tags},{label:"Template Note",type:"note",value:l},{label:"Convert to Note Link After Creation",type:"checkbox",value:!!r.convertToLink},{label:"Section",type:"string",value:r.section},{label:"Skip Section Header?",type:"checkbox",value:!!r.sectionInner}]});if(u){let[D,f,h,C,y,v]=u;h=h?h.uuid:null;let c=Object.entries({name:D,tags:f,source:h,section:y}).reduce((d,[t,n])=>(n&&n!==""?d[t]=n:delete d[t],d),r);y&&v?c.sectionInner=!0:delete c.sectionInner,C?c.convertToLink=!0:delete c.convertToLink;const m={action:"create",...c};s.search=new URLSearchParams(m).toString(),await e.context.updateLink({href:s.toString()})}}}},dailyJotOption:{"There's a default dynamic template for this tag":{async check(e,i){const s=je(e.context.url),r=s?await ue(e,s):oe(e),l=Ye.getItem("jotSuggestionGiven-"+s);return r&&l!=r.uuid?"Insert "+r.name:!1},async run(e,i){const s=je(e.context.url),r=s?await ue(e,s):oe(e);if(!r){console.warn("Daily Jot Insert: Template not found");return}Ye.setItem("jotSuggestionGiven-"+s,r.uuid,An());let l;return i.uuid===null?l=await e.notes.create(i.name,i.tags):l=await e.notes.find(i),ee(e,l,r,{insertMode:"insertByReplace"})}}},noteOption:{"Set as Default Template":{async check(e,i){return(await e.notes.find(i)).tags.includes(e.settings[P.TEMPLATE_TAG]||P.defaults.TEMPLATE_TAG)},run(e,i){e.setSetting(P.DEFAULT_TEMPLATE,i)}},"Set as Tag Template":{async check(e,i){return(await e.notes.find(i)).tags.includes(e.settings[P.TEMPLATE_TAG]||P.defaults.TEMPLATE_TAG)},async run(e,i){const s=await e.prompt("Pick a template",{inputs:[{type:"tags"}]});s&&hi(e,s,i)}}},insertText:{"Tag Default Template":{async check(e){const i=await e.notes.find(e.context.noteUUID),s=await ue(e,i.tags[0]);return s?"="+s.name:!1},async run(e){const i=await e.notes.find(e.context.noteUUID),s=await ue(e,i.tags[0]);if(s)return ee(e,i,s);console.warn("Template disappeared before we tried to insert")}},"Global Default Template":{async check(e){const i=oe(e);return i?"="+(await e.notes.find(i)).name:!1},async run(e){const i=await e.notes.find(e.context.noteUUID),s=await e.notes.find(oe(e));if(s)return ee(e,i,s);console.warn("Template disappeared before we tried to insert")}},"Pick Template":{check(e){return"=Pick Template"},async run(e){const i=await e.prompt("Pick a template",{inputs:[{type:"note"}]});if(!i||!i.uuid)return;const s=await e.notes.find(e.context.noteUUID),r=await e.notes.find(i.uuid);return ee(e,s,r)}},"New Note Link":{check(e){return"Templater: New Note Link"},async run(e){const i=await e.prompt("Create a Dynamic New Note Link",{inputs:[{label:"Link Title",type:"string"},{label:"Note Name (it can include date and math expressions)",type:"string"},{label:"Note Tags",type:"tags",limit:100},{label:"Dynamic Template Note",type:"note"},{label:"Convert to Note Link After Creation",type:"checkbox"}],actions:[{label:"Pick Section",icon:"subheader",value:"pick-section"}]}),[s,r,l,u,D,f]=i;if(i){let h,C;if(f==="pick-section"){const m=(await e.getNoteSections({uuid:u.uuid})).reduce((t,n)=>(n.heading&&!n.index&&t.push({label:`h${n.heading.level} ${n.heading.text}`,value:n.heading.text}),t),[]),d=await e.prompt("Pick a section",{inputs:[{label:"Section",type:"select",options:m},{label:"Skip Header? (Only insert inner content)",type:"checkbox"}]});if(!d)return null;[h,C]=d}const y={action:"create",name:r,source:u?u.uuid:""};l&&(y.tags=l),h&&h!==""&&(y.section=h),h&&C&&(y.sectionInner=!0),D&&(y.convertToLink=!0);const v=new URLSearchParams(y).toString();await e.context.replaceSelection(`[${s}](plugin://${e.context.pluginUUID}?${v})`)}return null}}},async linkTarget(e,i=null){if(!i)return;const s=new URLSearchParams(i),r=Object.fromEntries(s.entries());if(r.action==="create"){r.tags&&(r.tags=r.tags.split(",").map(u=>u.trim()));const l=await qe(e,r);if(l&&r.convertToLink){const u=await l.url(),D=await e.getNoteContent({uuid:e.context.noteUUID}),f=`plugin://${e.context.pluginUUID}?${i}`,h=new RegExp(`\\[[^\\[\\]]*\\]\\(${_n(f)}\\)`),C=D.replace(h,`[${l.name}](${u})`);await e.replaceNoteContent({uuid:e.context.noteUUID},C)}}}},ur=Qe;return Qe})()