UNPKG

peggy

Version:

Parser generator for JavaScript

8 lines (7 loc) 161 kB
// peggy 5.1.0 // // https://peggyjs.org/ // // Copyright (c) 2026- the Peggy authors // Licensed under the MIT License. function _array_like_to_array(u,e){if(e==null||e>u.length)e=u.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=u[t];return n}function _array_with_holes(u){if(Array.isArray(u))return u}function _array_without_holes(u){if(Array.isArray(u))return _array_like_to_array(u)}function _assert_this_initialized(u){if(u===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return u}function _call_super(u,e,t){e=_get_prototype_of(e);return _possible_constructor_return(u,_is_native_reflect_construct()?Reflect.construct(e,t||[],_get_prototype_of(u).constructor):e.apply(u,t))}function _class_call_check(u,e){if(!(u instanceof e)){throw new TypeError("Cannot call a class as a function")}}function _construct(u,e,t){if(_is_native_reflect_construct()){_construct=Reflect.construct}else{_construct=function u(u,e,t){var n=[null];n.push.apply(n,e);var r=Function.bind.apply(u,n);var o=new r;if(t)_set_prototype_of(o,t.prototype);return o}}return _construct.apply(null,arguments)}function _defineProperties(u,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(u,n.key,n)}}function _create_class(u,e,t){if(e)_defineProperties(u.prototype,e);if(t)_defineProperties(u,t);return u}function _define_property(u,e,t){if(e in u){Object.defineProperty(u,e,{value:t,enumerable:true,configurable:true,writable:true})}else{u[e]=t}return u}function _get(u,e,t){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get}else{_get=function u(u,e,t){var n=_super_prop_base(u,e);if(!n)return;var r=Object.getOwnPropertyDescriptor(n,e);if(r.get){return r.get.call(t||u)}return r.value}}return _get(u,e,t||u)}function _get_prototype_of(u){_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function u(u){return u.__proto__||Object.getPrototypeOf(u)};return _get_prototype_of(u)}function _inherits(u,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}u.prototype=Object.create(e&&e.prototype,{constructor:{value:u,writable:true,configurable:true}});if(e)_set_prototype_of(u,e)}function _instanceof(u,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](u)}else{return u instanceof e}}function _is_native_function(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function _iterable_to_array(u){if(typeof Symbol!=="undefined"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function _iterable_to_array_limit(u,e){var t=u==null?null:typeof Symbol!=="undefined"&&u[Symbol.iterator]||u["@@iterator"];if(t==null)return;var n=[];var r=true;var o=false;var a,i;try{for(t=t.call(u);!(r=(a=t.next()).done);r=true){n.push(a.value);if(e&&n.length===e)break}}catch(u){o=true;i=u}finally{try{if(!r&&t["return"]!=null)t["return"]()}finally{if(o)throw i}}return n}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(u){return Object.getOwnPropertyDescriptor(t,u).enumerable}))}n.forEach(function(e){_define_property(u,e,t[e])})}return u}function ownKeys(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(u);if(e){n=n.filter(function(e){return Object.getOwnPropertyDescriptor(u,e).enumerable})}t.push.apply(t,n)}return t}function _object_spread_props(u,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(u,Object.getOwnPropertyDescriptors(e))}else{ownKeys(Object(e)).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(e,t))})}return u}function _possible_constructor_return(u,e){if(e&&(_type_of(e)==="object"||typeof e==="function")){return e}return _assert_this_initialized(u)}function _set_prototype_of(u,e){_set_prototype_of=Object.setPrototypeOf||function u(u,e){u.__proto__=e;return u};return _set_prototype_of(u,e)}function _sliced_to_array(u,e){return _array_with_holes(u)||_iterable_to_array_limit(u,e)||_unsupported_iterable_to_array(u,e)||_non_iterable_rest()}function _super_prop_base(u,e){while(!Object.prototype.hasOwnProperty.call(u,e)){u=_get_prototype_of(u);if(u===null)break}return u}function _to_consumable_array(u){return _array_without_holes(u)||_iterable_to_array(u)||_unsupported_iterable_to_array(u)||_non_iterable_spread()}function _type_of(u){"@swc/helpers - typeof";return u&&typeof Symbol!=="undefined"&&u.constructor===Symbol?"symbol":typeof u}function _unsupported_iterable_to_array(u,e){if(!u)return;if(typeof u==="string")return _array_like_to_array(u,e);var t=Object.prototype.toString.call(u).slice(8,-1);if(t==="Object"&&u.constructor)t=u.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _array_like_to_array(u,e)}function _wrap_native_super(u){var e=typeof Map==="function"?new Map:undefined;_wrap_native_super=function u(u){if(u===null||!_is_native_function(u))return u;if(typeof u!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof e!=="undefined"){if(e.has(u))return e.get(u);e.set(u,t)}function t(){return _construct(u,arguments,_get_prototype_of(this).constructor)}t.prototype=Object.create(u.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}});return _set_prototype_of(t,u)};return _wrap_native_super(u)}function _is_native_reflect_construct(){try{var u=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(u){}return(_is_native_reflect_construct=function(){return!!u})()}(function(u,e){if((typeof exports==="undefined"?"undefined":_type_of(exports))=="object"&&(typeof module==="undefined"?"undefined":_type_of(module))<"u"){module.exports=e()}else if("function"==typeof define&&define.amd){define("peggy",e)}else{u["peggy"]=e()}})((typeof globalThis==="undefined"?"undefined":_type_of(globalThis))<"u"?globalThis:(typeof self==="undefined"?"undefined":_type_of(self))<"u"?self:this,function(){var exports={};var __exports=exports;var module={exports:exports};"use strict";var U=function u(u,e){return function(){return e||u((e={exports:{}}).exports,e),e.exports}};var Ve=U(function(u,e){"use strict";var t=/*#__PURE__*/function(){function u(e,t){_class_call_check(this,u);this.source=e,this.start=t}_create_class(u,[{key:"toString",value:function u(){return String(this.source)}},{key:"offset",value:function u(u){return{line:u.line+this.start.line-1,column:u.line===1?u.column+this.start.column-1:u.column,offset:u.offset+this.start.offset}}}],[{key:"offsetStart",value:function u(u){return u.source&&typeof u.source.offset=="function"?u.source.offset(u.start):u.start}},{key:"offsetEnd",value:function u(u){return u.source&&typeof u.source.offset=="function"?u.source.offset(u.end):u.end}}]);return u}();e.exports=t});var ft=U(function(u,e){"use strict";var t=Ve(),n=/*#__PURE__*/function(u){_inherits(e,u);function e(u,t,n){_class_call_check(this,e);var r;r=_call_super(this,e,[u]),r.name="GrammarError",r.location=t,n===void 0&&(n=[]),r.diagnostics=n,r.stage=null,r.problems=[["error",u,t,n]];return r}_create_class(e,[{key:"toString",value:function u(){var u=_get(_get_prototype_of(e.prototype),"toString",this).call(this);this.location&&(u+="\n at ",this.location.source!==void 0&&this.location.source!==null&&(u+="".concat(this.location.source,":")),u+="".concat(this.location.start.line,":").concat(this.location.start.column));var t=true,n=false,r=undefined;try{for(var o=this.diagnostics[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=a.value;u+="\n from ",i.location.source!==void 0&&i.location.source!==null&&(u+="".concat(i.location.source,":")),u+="".concat(i.location.start.line,":").concat(i.location.start.column,": ").concat(i.message)}}catch(u){n=true;r=u}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}return u}},{key:"format",value:function u(u){var e=u.map(function(u){var e=u.source,t=u.text;return{source:e,text:t!=null?String(t).split(/\r\n|\n|\r/g):[]}});function n(u,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";var o="",a=e.find(function(e){var t=e.source;return t===u.source}),i=u.start,c=t.offsetStart(u);if(a){var s=u.end,l=a.text[i.line-1],A=(i.line===s.line?s.column:l.length+1)-i.column||1;r&&(o+="\nnote: ".concat(r)),o+="\n --\x3e ".concat(u.source,":").concat(c.line,":").concat(c.column,"\n").concat("".padEnd(n)," |\n").concat(c.line.toString().padStart(n)," | ").concat(l,"\n").concat("".padEnd(n)," | ").concat("".padEnd(i.column-1)).concat("".padEnd(A,"^"))}else o+="\n at ".concat(u.source,":").concat(c.line,":").concat(c.column),r&&(o+=": ".concat(r));return o}function r(u,e,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];var a=-1/0;r?a=o.reduce(function(u,e){var n=e.location;return Math.max(u,t.offsetStart(n).line)},r.start.line):a=Math.max.apply(null,o.map(function(u){return u.location.start.line})),a=a.toString().length;var i="".concat(u,": ").concat(e);r&&(i+=n(r,a));var c=true,s=false,l=undefined;try{for(var A=o[Symbol.iterator](),F;!(c=(F=A.next()).done);c=true){var p=F.value;i+=n(p.location,a,p.message)}}catch(u){s=true;l=u}finally{try{if(!c&&A.return!=null){A.return()}}finally{if(s){throw l}}}return i}return this.problems.filter(function(u){return u[0]!=="info"}).map(function(u){return r.apply(void 0,_to_consumable_array(u))}).join("\n\n")}}]);return e}(_wrap_native_super(SyntaxError));e.exports=n});var K=U(function(u,e){"use strict";var t={build:function u(u){function e(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var o;return(o=u)[e.type].apply(o,[e].concat(_to_consumable_array(n)))}function t(){}function n(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return e.apply(void 0,[u.expression].concat(_to_consumable_array(n)))}function r(u){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++){r[o-1]=arguments[o]}t[u].forEach(function(u){return e.apply(void 0,[u].concat(_to_consumable_array(r)))})}}var o={grammar:function u(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var o=true,a=false,i=undefined;try{for(var c=u.imports[Symbol.iterator](),s;!(o=(s=c.next()).done);o=true){var l=s.value;e.apply(void 0,[l].concat(_to_consumable_array(n)))}}catch(u){a=true;i=u}finally{try{if(!o&&c.return!=null){c.return()}}finally{if(a){throw i}}}var A=true,F=false,p=undefined;if(u.topLevelInitializer)if(Array.isArray(u.topLevelInitializer))try{for(var f=u.topLevelInitializer[Symbol.iterator](),E;!(A=(E=f.next()).done);A=true){var C=E.value;e.apply(void 0,[C].concat(_to_consumable_array(n)))}}catch(u){F=true;p=u}finally{try{if(!A&&f.return!=null){f.return()}}finally{if(F){throw p}}}else e.apply(void 0,[u.topLevelInitializer].concat(_to_consumable_array(n)));var D=true,h=false,B=undefined;if(u.initializer)if(Array.isArray(u.initializer))try{for(var d=u.initializer[Symbol.iterator](),v;!(D=(v=d.next()).done);D=true){var g=v.value;e.apply(void 0,[g].concat(_to_consumable_array(n)))}}catch(u){h=true;B=u}finally{try{if(!D&&d.return!=null){d.return()}}finally{if(h){throw B}}}else e.apply(void 0,[u.initializer].concat(_to_consumable_array(n)));u.rules.forEach(function(u){return e.apply(void 0,[u].concat(_to_consumable_array(n)))})},grammar_import:t,top_level_initializer:t,initializer:t,rule:n,named:n,choice:r("alternatives"),action:n,sequence:r("elements"),labeled:n,text:n,simple_and:n,simple_not:n,optional:n,zero_or_more:n,one_or_more:n,repeated:function u(u){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return u.delimiter&&e.apply(void 0,[u.delimiter].concat(_to_consumable_array(n))),e.apply(void 0,[u.expression].concat(_to_consumable_array(n)))},group:n,semantic_and:t,semantic_not:t,rule_ref:t,library_ref:t,literal:t,class:t,any:t};return Object.keys(o).forEach(function(e){Object.prototype.hasOwnProperty.call(u,e)||(u[e]=o[e])}),e}};e.exports=t});var he=U(function(u,e){"use strict";var t=function u(u,e){if(!(u&&e))return u||e;var t=Array.isArray(u)?u:[u];return t.push(e),t};var n=K();var r={findRule:function u(u,e){for(var t=0;t<u.rules.length;t++)if(u.rules[t].name===e)return u.rules[t]},indexOfRule:function u(u,e){for(var t=0;t<u.rules.length;t++)if(u.rules[t].name===e)return t;return-1},alwaysConsumesOnSuccess:function u(u,e){function t(){return!0}function o(){return!1}var a=n.build({choice:function u(u){return u.alternatives.every(a)},sequence:function u(u){return u.elements.some(a)},simple_and:o,simple_not:o,optional:o,zero_or_more:o,repeated:function u(u){var e=u.min?u.min:u.max;return e.type!=="constant"||e.value===0?!1:!!(a(u.expression)||e.value>1&&u.delimiter&&a(u.delimiter))},semantic_and:o,semantic_not:o,rule_ref:function e(e){var t=r.findRule(u,e.name);return t?a(t):void 0},library_ref:o,literal:function u(u){return u.value!==""},class:t,any:t});return a(e)},combine:function u(u){return u.reduce(function(u,e){return u.topLevelInitializer=t(u.topLevelInitializer,e.topLevelInitializer),u.initializer=t(u.initializer,e.initializer),u.rules=u.rules.concat(e.rules),u})}};e.exports=r});var Xs=U(function(u,e){"use strict";var t=function u(u){var e=0;var t=true,n=false,r=undefined;try{for(var o=u.imports[Symbol.iterator](),a;!(t=(a=o.next()).done);t=true){var i=a.value;var c=true,s=false,l=undefined;try{for(var A=i.what[Symbol.iterator](),F;!(c=(F=A.next()).done);c=true){var p=F.value;var f=void 0;switch(p.type){case"import_binding_all":continue;case"import_binding_default":break;case"import_binding":f=p.binding;break;case"import_binding_rename":f=p.rename;break;default:throw new TypeError("Unknown binding type")}u.rules.push({type:"rule",name:p.binding,nameLocation:p.location,expression:{type:"library_ref",name:f,library:i.from.module,libraryNumber:e,location:p.location},location:i.from.location})}}catch(u){s=true;l=u}finally{try{if(!c&&A.return!=null){A.return()}}finally{if(s){throw l}}}e++}}catch(u){n=true;r=u}finally{try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}}};e.exports=t});var Ks=U(function(u,e){"use strict";var t=function u(u,e){var t=0;var n=true,r=false,o=undefined;try{for(var a=u.imports[Symbol.iterator](),i;!(n=(i=a.next()).done);n=true){var c=i.value;var s=true,l=false,A=undefined;try{for(var F=c.what[Symbol.iterator](),p;!(s=(p=F.next()).done);s=true){var f=p.value;if(f.type==="import_binding_all"&&f.binding===e)return t}}catch(u){l=true;A=u}finally{try{if(!s&&F.return!=null){F.return()}}finally{if(l){throw A}}}t++}}catch(u){r=true;o=u}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return-1};var n=function u(u,e,n){r.build({library_ref:function e(e){e.libraryNumber===-1&&(e.libraryNumber=t(u,e.library),e.libraryNumber===-1&&n.error('Unknown module "'.concat(e.library,'"'),e.location))}})(u)};var r=K();e.exports=n});var Ht=U(function(u,e){"use strict";var t={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,IF_LT:30,IF_GE:31,IF_LT_DYNAMIC:32,IF_GE_DYNAMIC:33,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_UNICODE_CLASS:42,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,LIBRARY_RULE:41,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29,SOURCE_MAP_PUSH:37,SOURCE_MAP_POP:38,SOURCE_MAP_LABEL_PUSH:39,SOURCE_MAP_LABEL_POP:40};e.exports=t});var tr=U(function(u,e){"use strict";var t=/*#__PURE__*/function(){function u(e){_class_call_check(this,u);this.options=_object_spread({stringify:String,convert:function u(u){return u}},e),this.items=[],this.offsets=Object.create(null)}_create_class(u,[{key:"add",value:function u(u){var e=this.options.convert(u);if(!e)return-1;var t=this.options.stringify(e),n=this.offsets[t];return n===void 0&&(n=this.items.push(e)-1,this.offsets[t]=n),n}},{key:"get",value:function u(u){return this.items[u]}},{key:"map",value:function u(u){return this.items.map(u)}}]);return u}();e.exports=t});var ht=U(function(u,e){"use strict";var t=function u(u){function e(u){return u.match=i}function t(u){return A(u.expression),u.match=a}function s(u){return u.match=A(u.expression)}function l(u,e){var t=u.length,n=0,r=0;for(var o=0;o<t;++o){var s=A(u[o]);s===a&&++n,s===c&&++r}return n===t?a:e?r===t?c:i:r>0?c:i}var A=n.build({rule:function u(u){var e,t=0;if(_type_of(u.match)>"u"){u.match=i;do if(e=u.match,u.match=A(u.expression),++t>6)throw new o("Infinity cycle detected when trying to evaluate node match result",u.location);while(e!==u.match)}return u.match},named:s,choice:function u(u){return u.match=l(u.alternatives,!0)},action:s,sequence:function u(u){return u.match=l(u.elements,!1)},labeled:s,text:s,simple_and:s,simple_not:function u(u){return u.match=-A(u.expression)},optional:t,zero_or_more:t,one_or_more:s,repeated:function u(u){var e=A(u.expression),t=u.delimiter?A(u.delimiter):c,n=u.min?u.min:u.max;return n.type!=="constant"||u.max.type!=="constant"?u.match=i:u.max.value===0||u.max.value!==null&&n.value>u.max.value?u.match=c:e===c?u.match=n.value===0?a:c:e===a?u.delimiter&&n.value>=2?u.match=t:u.match=a:u.delimiter&&n.value>=2?u.match=t===c?c:i:u.match=n.value===0?a:i},group:s,semantic_and:e,semantic_not:e,rule_ref:function e(e){var t=r.findRule(u,e.name);return t?e.match=A(t):i},library_ref:function u(){return 0},literal:function u(u){var e=u.value.length===0?a:i;return u.match=e},class:function u(u){var e=u.parts.length===0?c:i;return u.match=e},any:e});A(u)};var n=K(),r=he(),o=ft(),a=1,i=0,c=-1;t.ALWAYS_MATCH=a;t.SOMETIMES_MATCH=i;t.NEVER_MATCH=c;e.exports=t});var ir=U(function(u,e){"use strict";var t=function u(u,e){var t=new a,i=new a({stringify:JSON.stringify,convert:function u(u){return{value:u.parts,inverted:u.inverted,ignoreCase:u.ignoreCase,unicode:u.unicode}}}),A=new a({stringify:JSON.stringify}),F=new a,p=[],f=[];function E(u,e,t){var n={predicate:u,params:e,body:t.code,location:t.codeLocation},r=JSON.stringify(n),o=p.findIndex(function(u){return JSON.stringify(u)===r});return o===-1?p.push(n)-1:o}function C(u){return f.push(u)-1}function D(u){var e={};return Object.keys(u).forEach(function(t){e[t]=u[t]}),e}function h(u){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++){t[n-1]=arguments[n]}var r;return(r=u).concat.apply(r,_to_consumable_array(t))}function B(u,e,t,n){return u===c?t:u===l?n:e.concat([t.length,n.length],t,n)}function d(u,e){return u.concat([e.length],e)}function v(u,e,t,n){var o=Object.keys(t).map(function(u){return n-t[u]});return[r.CALL,u,e,o.length].concat(o)}function g(u,e,t){var n=u.match||0;return h([r.PUSH_CURR_POS],[r.SILENT_FAILS_ON],R(u,{sp:t.sp+1,env:D(t.env),action:null}),[r.SILENT_FAILS_OFF],B(e?-n:n,[e?r.IF_ERROR:r.IF_NOT_ERROR],h([r.POP],[e?r.POP:r.POP_CURR_POS],[r.PUSH_UNDEFINED]),h([r.POP],[e?r.POP_CURR_POS:r.POP],[r.PUSH_FAILED])))}function m(u,e,t){var n=E(!0,Object.keys(t.env),u);return h([r.UPDATE_SAVED_POS],v(n,0,t.env,t.sp),B(u.match||0,[r.IF],h([r.POP],e?[r.PUSH_FAILED]:[r.PUSH_UNDEFINED]),h([r.POP],e?[r.PUSH_UNDEFINED]:[r.PUSH_FAILED])))}function y(u){return d([r.WHILE_NOT_ERROR],h([r.APPEND],u))}function _(u){var e=u;return new Error('Unknown boundary type "'.concat(e.type,'" for the "repeated" node'))}function b(u,e,t,n){switch(u.type){case"constant":return{pre:[],post:[],sp:t};case"variable":return u.sp=n+t-e[u.value],{pre:[],post:[],sp:t};case"function":{u.sp=n;var o=E(!0,Object.keys(e),{code:u.value,codeLocation:u.codeLocation});return{pre:v(o,0,e,t),post:[r.NIP],sp:t+1}}default:throw _(u)}}function x(u,e){if(e.value!==null){var t=e.type==="constant"?[r.IF_GE,e.value]:[r.IF_GE_DYNAMIC,e.sp||0];return B(s,t,[r.PUSH_FAILED],u)}return u}function S(u,e){var t=e.type==="constant"?[r.IF_LT,e.value]:[r.IF_LT_DYNAMIC,e.sp||0];return h(u,B(s,t,[r.POP,r.POP_CURR_POS,r.PUSH_FAILED],[r.NIP]))}function P(u,e,t,n,o){return u?h([r.PUSH_CURR_POS],R(u,{sp:n.sp+o+1,env:D(n.env),action:null}),B(u.match||0,[r.IF_NOT_ERROR],h([r.POP],t,B(-e,[r.IF_ERROR],[r.POP,r.POP_CURR_POS,r.PUSH_FAILED],[r.NIP])),[r.NIP])):t}function w(u){return e&&e.output==="source-and-map"&&Object.keys(u).forEach(function(e){var t=u[e];u[e]=function(u){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++){n[o-1]=arguments[o]}var a=t.apply(void 0,[u].concat(_to_consumable_array(n)));return a===void 0||!u.location?a:h([r.SOURCE_MAP_PUSH,C(u.location)],a,[r.SOURCE_MAP_POP])}}),o.build(u)}var R=w({grammar:function u(u){u.rules.forEach(R),u.literals=t.items,u.classes=i.items,u.expectations=A.items,u.importedNames=F.items,u.functions=p,u.locations=f},rule:function u(u){u.bytecode=R(u.expression,{sp:-1,env:{},pluck:[],action:null})},named:function u(u,e){var t=u.match||0,n=t===c?-1:A.add({type:"rule",value:u.name});return h([r.SILENT_FAILS_ON],R(u.expression,e),[r.SILENT_FAILS_OFF],B(-t,[r.IF_ERROR],[r.FAIL,n],[]))},choice:function u(u,e){function t(u,e){var n=u[0].match||0,o=R(u[0],{sp:e.sp,env:D(e.env),action:null});return n===c?o:h(o,u.length>1?B(s,[r.IF_ERROR],h([r.POP],t(u.slice(1),e)),[]):[])}return t(u.alternatives,e)},action:function u(u,e){var t=D(e.env),n=u.expression.type!=="sequence"||u.expression.elements.length===0,o=R(u.expression,{sp:e.sp+(n?1:0),env:t,action:u}),a=u.expression.match||0,i=n&&a!==l?E(!1,Object.keys(t),u):-1;return n?h([r.PUSH_CURR_POS],o,B(a,[r.IF_NOT_ERROR],h([r.LOAD_SAVED_POS,1],v(i,1,t,e.sp+2)),[]),[r.NIP]):o},sequence:function u(u,e){function t(e,n){if(e.length>0){var o=u.elements.length-e.length+1;return h(R(e[0],{sp:n.sp,env:n.env,pluck:n.pluck,action:null}),B(e[0].match||0,[r.IF_NOT_ERROR],t(e.slice(1),{sp:n.sp+1,env:n.env,pluck:n.pluck,action:n.action}),h(o>1?[r.POP_N,o]:[r.POP],[r.POP_CURR_POS],[r.PUSH_FAILED])))}else{if(n.pluck&&n.pluck.length>0)return h([r.PLUCK,u.elements.length+1,n.pluck.length],n.pluck.map(function(u){return n.sp-u}));if(n.action){var a=E(!1,Object.keys(n.env),n.action);return h([r.LOAD_SAVED_POS,u.elements.length],v(a,u.elements.length+1,n.env,n.sp))}else return h([r.WRAP,u.elements.length],[r.NIP])}}return h([r.PUSH_CURR_POS],t(u.elements,{sp:e.sp+1,env:e.env,pluck:[],action:e.action}))},labeled:function u(u,n){var o=n.env,a=u.label,i=n.sp+1;a&&(o=D(n.env),n.env[a]=i),u.pick&&n.pluck.push(i);var c=R(u.expression,{sp:n.sp,env:o,action:null});return a&&u.labelLocation&&e&&e.output==="source-and-map"?h([r.SOURCE_MAP_LABEL_PUSH,i,t.add(a),C(u.labelLocation)],c,[r.SOURCE_MAP_LABEL_POP,i]):c},text:function u(u,e){return h([r.PUSH_CURR_POS],R(u.expression,{sp:e.sp+1,env:D(e.env),action:null}),B(u.match||0,[r.IF_NOT_ERROR],h([r.POP],[r.TEXT]),[r.NIP]))},simple_and:function u(u,e){return g(u.expression,!1,e)},simple_not:function u(u,e){return g(u.expression,!0,e)},optional:function u(u,e){return h(R(u.expression,{sp:e.sp,env:D(e.env),action:null}),B(-(u.expression.match||0),[r.IF_ERROR],h([r.POP],[r.PUSH_NULL]),[]))},zero_or_more:function u(u,e){var t=R(u.expression,{sp:e.sp+1,env:D(e.env),action:null});return h([r.PUSH_EMPTY_ARRAY],t,y(t),[r.POP])},one_or_more:function u(u,e){var t=R(u.expression,{sp:e.sp+1,env:D(e.env),action:null});return h([r.PUSH_EMPTY_ARRAY],t,B(u.expression.match||0,[r.IF_NOT_ERROR],h(y(t),[r.POP]),h([r.POP],[r.POP],[r.PUSH_FAILED])))},repeated:function u(u,e){var t=u.min?u.min:u.max,n=t.type!=="constant"||t.value>0,o=u.max.type!=="constant"&&u.max.value!==null,a=n?2:1,i=u.min?b(u.min,e.env,e.sp,2+(u.max.type==="function"?1:0)):{pre:[],post:[],sp:e.sp},c=b(u.max,e.env,i.sp,a),s=R(u.expression,{sp:c.sp+a,env:D(e.env),action:null}),l=u.delimiter!==null?R(u.expression,{sp:c.sp+a+1,env:D(e.env),action:null}):s,A=P(u.delimiter,u.expression.match||0,l,e,a),F=x(A,u.max),p=o?x(s,u.max):s,f=h(n?[r.PUSH_CURR_POS]:[],[r.PUSH_EMPTY_ARRAY],p,y(F),[r.POP]);return h(i.pre,c.pre,n?S(f,t):f,c.post,i.post)},group:function u(u,e){return R(u.expression,{sp:e.sp,env:D(e.env),action:null})},semantic_and:function u(u,e){return m(u,!1,e)},semantic_not:function u(u,e){return m(u,!0,e)},rule_ref:function e(e){return[r.RULE,n.indexOfRule(u,e.name)]},library_ref:function u(u){return[r.LIBRARY_RULE,u.libraryNumber,F.add(u.name)]},literal:function u(u){if(u.value.length>0){var e=u.match||0,n=e===s||e===c&&!u.ignoreCase?t.add(u.ignoreCase?u.value.toLowerCase():u.value):-1,o=e!==c?A.add({type:"literal",value:u.value,ignoreCase:u.ignoreCase}):-1;return B(e,u.ignoreCase?[r.MATCH_STRING_IC,n]:[r.MATCH_STRING,n],u.ignoreCase?[r.ACCEPT_N,u.value.length]:[r.ACCEPT_STRING,n],[r.FAIL,o])}return[r.PUSH_EMPTY_STRING]},class:function u(u){var e=u.match||0,t=e===s?i.add(u):-1,n=e!==c?A.add({type:"class",value:u.parts,inverted:u.inverted,ignoreCase:u.ignoreCase,unicode:u.unicode}):-1;return B(e,[u.unicode?r.MATCH_UNICODE_CLASS:r.MATCH_CHAR_CLASS,t],[r.ACCEPT_N,u.unicode?-1:1],[r.FAIL,n])},any:function u(u){var e=u.match||0,t=e!==c?A.add({type:"any"}):-1;return B(e,[r.MATCH_ANY],[r.ACCEPT_N,1],[r.FAIL,t])}});R(u)};var n=he(),r=Ht(),o=K(),a=tr(),i=ht(),c=i.ALWAYS_MATCH,s=i.SOMETIMES_MATCH,l=i.NEVER_MATCH;e.exports=t});var lr=U(function(u){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");u.encode=function(u){if(0<=u&&u<e.length)return e[u];throw new TypeError("Must be between 0 and 63: "+u)}});var pr=U(function(u){var e=function u(u){return u<0?(-u<<1)+1:(u<<1)+0};var t=lr(),n=5,r=1<<n,o=r-1,a=r;u.encode=function(u){var r="",i,c=e(u);do i=c&o,c>>>=n,c>0&&(i|=a),r+=t.encode(i);while(c>0);return r}});var mt=U(function(u){var e=function u(u,e,t){if(e in u)return u[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')};var t=function u(u){return u};var n=function u(u){return o(u)?"$"+u:u};var r=function u(u){return o(u)?u.slice(1):u};var o=function u(u){if(!u)return!1;var e=u.length;if(e<9||u.charCodeAt(e-1)!==95||u.charCodeAt(e-2)!==95||u.charCodeAt(e-3)!==111||u.charCodeAt(e-4)!==116||u.charCodeAt(e-5)!==111||u.charCodeAt(e-6)!==114||u.charCodeAt(e-7)!==112||u.charCodeAt(e-8)!==95||u.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(u.charCodeAt(t)!==36)return!1;return!0};var a=function u(u,e){return u===e?0:u===null?1:e===null?-1:u>e?1:-1};var i=function u(u,e){var t=u.generatedLine-e.generatedLine;return t!==0||(t=u.generatedColumn-e.generatedColumn,t!==0)||(t=a(u.source,e.source),t!==0)||(t=u.originalLine-e.originalLine,t!==0)||(t=u.originalColumn-e.originalColumn,t!==0)?t:a(u.name,e.name)};var c=function u(u){return function(e){var t=F(e),n=A(e),r=new URL(e,n);u(r);var o=r.toString();return t==="absolute"?o:t==="scheme-relative"?o.slice(h.length):t==="path-absolute"?o.slice(B.length):p(n,o)}};var s=function u(u,e){return new URL(u,e).toString()};var l=function u(u,e){var t=0;do{var n=u+t++;if(e.indexOf(n)===-1)return n}while(!0)};var A=function u(u){var e=u.split("..").length-1,t=l("p",u),n="".concat(B,"/");for(var r=0;r<e;r++)n+="".concat(t,"/");return n};var F=function u(u){return u[0]==="/"?u[1]==="/"?"scheme-relative":"path-absolute":d.test(u)?"absolute":"path-relative"};var p=function u(u,e){typeof u=="string"&&(u=new URL(u)),typeof e=="string"&&(e=new URL(e));var t=e.pathname.split("/"),n=u.pathname.split("/");for(n.length>0&&!n[n.length-1]&&n.pop();t.length>0&&n.length>0&&t[0]===n[0];)t.shift(),n.shift();return n.map(function(){return".."}).concat(t).join("/")+e.search+e.hash};var f=function u(u,e){var t=F(e),n=F(u);if(u=v(u),t==="absolute")return s(e,void 0);if(n==="absolute")return s(e,u);if(t==="scheme-relative")return g(e);if(n==="scheme-relative")return s(e,s(u,B)).slice(h.length);if(t==="path-absolute")return g(e);if(n==="path-absolute")return s(e,s(u,B)).slice(B.length);var r=A(e+u),o=s(e,s(u,r));return p(r,o)};var E=function u(u,e){var t=C(u,e);return typeof t=="string"?t:g(e)};var C=function u(u,e){if(F(u)!==F(e))return null;var t=A(u+e),n=new URL(u,t),r=new URL(e,t);try{new URL("",r.toString())}catch(u){return null}return r.protocol!==n.protocol||r.user!==n.user||r.password!==n.password||r.hostname!==n.hostname||r.port!==n.port?null:p(n,r)};u.getArg=e;var D=function(){return!("__proto__"in Object.create(null))}();u.toSetString=D?t:n;u.fromSetString=D?t:r;u.compareByGeneratedPositionsInflated=i;var h="http:",B="".concat(h,"//host");var d=/^[A-Za-z0-9\+\-\.]+:/;var v=c(function(u){u.pathname=u.pathname.replace(/\/?$/,"/")}),g=c(function(u){});u.normalize=g;u.join=f;u.relative=E});var yr=U(function(u){var e=/*#__PURE__*/function(){"use strict";function u(){_class_call_check(this,u);this._array=[],this._set=new Map}_create_class(u,[{key:"size",value:function u(){return this._set.size}},{key:"add",value:function u(u,e){var t=this.has(u),n=this._array.length;(!t||e)&&this._array.push(u),t||this._set.set(u,n)}},{key:"has",value:function u(u){return this._set.has(u)}},{key:"indexOf",value:function u(u){var e=this._set.get(u);if(e>=0)return e;throw new Error('"'+u+'" is not in the set.')}},{key:"at",value:function u(u){if(u>=0&&u<this._array.length)return this._array[u];throw new Error("No element indexed by "+u)}},{key:"toArray",value:function u(){return this._array.slice()}}],[{key:"fromArray",value:function e(e,t){var n=new u;for(var r=0,o=e.length;r<o;r++)n.add(e[r],t);return n}}]);return u}();u.ArraySet=e});var xr=U(function(u){var e=function u(u,e){var n=u.generatedLine,r=e.generatedLine,o=u.generatedColumn,a=e.generatedColumn;return r>n||r==n&&a>=o||t.compareByGeneratedPositionsInflated(u,e)<=0};var t=mt();var n=/*#__PURE__*/function(){"use strict";function u(){_class_call_check(this,u);this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}_create_class(u,[{key:"unsortedForEach",value:function u(u,e){this._array.forEach(u,e)}},{key:"add",value:function u(u){e(this._last,u)?(this._last=u,this._array.push(u)):(this._sorted=!1,this._array.push(u))}},{key:"toArray",value:function u(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}]);return u}();u.MappingList=n});var Jt=U(function(u){var e=pr(),t=mt(),n=yr().ArraySet,r=xr().MappingList,o=/*#__PURE__*/function(){"use strict";function u(e){_class_call_check(this,u);e||(e={}),this._file=t.getArg(e,"file",null),this._sourceRoot=t.getArg(e,"sourceRoot",null),this._skipValidation=t.getArg(e,"skipValidation",!1),this._sources=new n,this._names=new n,this._mappings=new r,this._sourcesContents=null}_create_class(u,[{key:"addMapping",value:function u(u){var e=t.getArg(u,"generated"),n=t.getArg(u,"original",null),r=t.getArg(u,"source",null),o=t.getArg(u,"name",null);this._skipValidation||this._validateMapping(e,n,r,o),r!=null&&(r=String(r),this._sources.has(r)||this._sources.add(r)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:n&&n.line,originalColumn:n&&n.column,source:r,name:o})}},{key:"setSourceContent",value:function u(u,e){var n=u;this._sourceRoot!=null&&(n=t.relative(this._sourceRoot,n)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[t.toSetString(n)]=e):this._sourcesContents&&(delete this._sourcesContents[t.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))}},{key:"applySourceMap",value:function u(u,e,r){var o=e;if(e==null){if(u.file==null)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');o=u.file}var a=this._sourceRoot;a!=null&&(o=t.relative(a,o));var i=this._mappings.toArray().length>0?new n:this._sources,c=new n;this._mappings.unsortedForEach(function(e){if(e.source===o&&e.originalLine!=null){var n=u.originalPositionFor({line:e.originalLine,column:e.originalColumn});n.source!=null&&(e.source=n.source,r!=null&&(e.source=t.join(r,e.source)),a!=null&&(e.source=t.relative(a,e.source)),e.originalLine=n.line,e.originalColumn=n.column,n.name!=null&&(e.name=n.name))}var s=e.source;s!=null&&!i.has(s)&&i.add(s);var l=e.name;l!=null&&!c.has(l)&&c.add(l)},this),this._sources=i,this._names=c,u.sources.forEach(function(e){var n=u.sourceContentFor(e);n!=null&&(r!=null&&(e=t.join(r,e)),a!=null&&(e=t.relative(a,e)),this.setSourceContent(e,n))},this)}},{key:"_validateMapping",value:function u(u,e,t,n){if(e&&typeof e.line!="number"&&typeof e.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(u&&"line"in u&&"column"in u&&u.line>0&&u.column>=0&&!e&&!t&&!n)){if(!(u&&"line"in u&&"column"in u&&e&&"line"in e&&"column"in e&&u.line>0&&u.column>=0&&e.line>0&&e.column>=0&&t))throw new Error("Invalid mapping: "+JSON.stringify({generated:u,source:t,original:e,name:n}))}}},{key:"_serializeMappings",value:function u(){var u=0,n=1,r=0,o=0,a=0,i=0,c="",s,l,A,F,p=this._mappings.toArray();for(var f=0,E=p.length;f<E;f++){if(l=p[f],s="",l.generatedLine!==n)for(u=0;l.generatedLine!==n;)s+=";",n++;else if(f>0){if(!t.compareByGeneratedPositionsInflated(l,p[f-1]))continue;s+=","}s+=e.encode(l.generatedColumn-u),u=l.generatedColumn,l.source!=null&&(F=this._sources.indexOf(l.source),s+=e.encode(F-i),i=F,s+=e.encode(l.originalLine-1-o),o=l.originalLine-1,s+=e.encode(l.originalColumn-r),r=l.originalColumn,l.name!=null&&(A=this._names.indexOf(l.name),s+=e.encode(A-a),a=A)),c+=s}return c}},{key:"_generateSourcesContent",value:function u(u,e){return u.map(function(u){if(!this._sourcesContents)return null;e!=null&&(u=t.relative(e,u));var n=t.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)}},{key:"toJSON",value:function u(){var u={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(u.file=this._file),this._sourceRoot!=null&&(u.sourceRoot=this._sourceRoot),this._sourcesContents&&(u.sourcesContent=this._generateSourcesContent(u.sources,u.sourceRoot)),u}},{key:"toString",value:function u(){return JSON.stringify(this.toJSON())}}],[{key:"fromSourceMap",value:function e(e){var n=e.sourceRoot,r=new u({file:e.file,sourceRoot:n});return e.eachMapping(function(u){var e={generated:{line:u.generatedLine,column:u.generatedColumn}};u.source!=null&&(e.source=u.source,n!=null&&(e.source=t.relative(n,e.source)),e.original={line:u.originalLine,column:u.originalColumn},u.name!=null&&(e.name=u.name)),r.addMapping(e)}),e.sources.forEach(function(u){var o=u;n!=null&&(o=t.relative(n,u)),r._sources.has(o)||r._sources.add(o);var a=e.sourceContentFor(u);a!=null&&r.setSourceContent(u,a)}),r}}]);return u}();o.prototype._version=3;u.SourceMapGenerator=o});var Ar=U(function(u){var e=Jt().SourceMapGenerator,t=mt(),n=/(\r?\n)/,r=10,o="$$$isSourceNode$$$",a=/*#__PURE__*/function(){"use strict";function u(e,t,n,r,a){_class_call_check(this,u);this.children=[],this.sourceContents={},this.line=e!==null&&e!==void 0?e:null,this.column=t!==null&&t!==void 0?t:null,this.source=n!==null&&n!==void 0?n:null,this.name=a!==null&&a!==void 0?a:null,this[o]=!0,r!=null&&this.add(r)}_create_class(u,[{key:"add",value:function u(u){if(Array.isArray(u))u.forEach(function(u){this.add(u)},this);else if(u[o]||typeof u=="string")u&&this.children.push(u);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this}},{key:"prepend",value:function u(u){if(Array.isArray(u))for(var e=u.length-1;e>=0;e--)this.prepend(u[e]);else if(u[o]||typeof u=="string")this.children.unshift(u);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+u);return this}},{key:"walk",value:function u(u){var e;for(var t=0,n=this.children.length;t<n;t++)e=this.children[t],e[o]?e.walk(u):e!==""&&u(e,{source:this.source,line:this.line,column:this.column,name:this.name})}},{key:"join",value:function u(u){var e,t,n=this.children.length;if(n>0){for(e=[],t=0;t<n-1;t++)e.push(this.children[t]),e.push(u);e.push(this.children[t]),this.children=e}return this}},{key:"replaceRight",value:function u(u,e){var t=this.children[this.children.length-1];return t[o]?t.replaceRight(u,e):typeof t=="string"?this.children[this.children.length-1]=t.replace(u,e):this.children.push("".replace(u,e)),this}},{key:"setSourceContent",value:function u(u,e){this.sourceContents[t.toSetString(u)]=e}},{key:"walkSourceContents",value:function u(u){for(var e=0,n=this.children.length;e<n;e++)this.children[e][o]&&this.children[e].walkSourceContents(u);var r=Object.keys(this.sourceContents);for(var a=0,i=r.length;a<i;a++)u(t.fromSetString(r[a]),this.sourceContents[r[a]])}},{key:"toString",value:function u(){var u="";return this.walk(function(e){u+=e}),u}},{key:"toStringWithSourceMap",value:function u(u){var t={code:"",line:1,column:0},n=new e(u),o=!1,a=null,i=null,c=null,s=null;return this.walk(function(u,e){t.code+=u,e.source!==null&&e.line!==null&&e.column!==null?((a!==e.source||i!==e.line||c!==e.column||s!==e.name)&&n.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:t.line,column:t.column},name:e.name}),a=e.source,i=e.line,c=e.column,s=e.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),a=null,o=!1);for(var l=0,A=u.length;l<A;l++)u.charCodeAt(l)===r?(t.line++,t.column=0,l+1===A?(a=null,o=!1):o&&n.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:t.line,column:t.column},name:e.name})):t.column++}),this.walkSourceContents(function(u,e){n.setSourceContent(u,e)}),{code:t.code,map:n}}}],[{key:"fromStringWithSourceMap",value:function e(e,r,o){var a=new u,i=e.split(n),c=0,s=function u(){var u=t(),e=t()||"";return u+e;function t(){return c<i.length?i[c++]:void 0}},l=1,A=0,F=null,p;return r.eachMapping(function(u){if(F!==null)if(l<u.generatedLine)f(F,s()),l++,A=0;else{p=i[c]||"";var e=p.substr(0,u.generatedColumn-A);i[c]=p.substr(u.generatedColumn-A),A=u.generatedColumn,f(F,e),F=u;return}for(;l<u.generatedLine;)a.add(s()),l++;A<u.generatedColumn&&(p=i[c]||"",a.add(p.substr(0,u.generatedColumn)),i[c]=p.substr(u.generatedColumn),A=u.generatedColumn),F=u},this),c<i.length&&(F&&f(F,s()),a.add(i.splice(c).join(""))),r.sources.forEach(function(u){var e=r.sourceContentFor(u);e!=null&&(o!=null&&(u=t.join(o,u)),a.setSourceContent(u,e))}),a;function f(e,n){if(e===null||e.source===void 0)a.add(n);else{var r=o?t.join(o,e.source):e.source;a.add(new u(e.originalLine,e.originalColumn,r,n,e.name))}}}}]);return u}();u.SourceNode=a});var Kt=U(function(u){u.SourceMapGenerator=Jt().SourceMapGenerator;u.SourceNode=Ar().SourceNode});var Rr=U(function(u,e){"use strict";var t=Kt(),n=t.SourceNode,r=Ve(),o=/*#__PURE__*/function(){function u(e,t,n,r){_class_call_check(this,u);this.sp=-1,this.maxSp=-1,this.varName=t,this.ruleName=e,this.type=n,this.bytecode=r,this.labels={},this.sourceMapStack=[]}_create_class(u,[{key:"name",value:function u(u){if(u<0)throw new RangeError("Rule '".concat(this.ruleName,"': The variable stack underflow: attempt to use a variable '").concat(this.varName,"<x>' at an index ").concat(u,".\nBytecode: ").concat(this.bytecode));return this.varName+u}},{key:"push",value:function e(e){++this.sp>this.maxSp&&(this.maxSp=this.sp);var t=this.labels[this.sp],r=[this.name(this.sp)," = ",e,";"];if(t)if(this.sourceMapStack.length){var o=u.sourceNode(t.location,r.splice(0,2),t.label),a=this.sourceMapPopInternal(),i=a.parts,c=a.location,s=c.start.offset<t.location.end.offset?{start:t.location.end,end:c.end,source:c.source}:c,l=u.sourceNode(s,r.concat("\n"));return this.sourceMapStack.push([i,i.length+1,c]),new n(null,null,t.location.source,[o,l])}else return u.sourceNode(t.location,r.concat("\n"));return r.join("")}},{key:"pop",value:function u(u){var e=this;return u!==void 0?(this.sp-=u,Array.from({length:u},function(u,t){return e.name(e.sp+1+t)})):this.name(this.sp--)}},{key:"top",value:function u(){return this.name(this.sp)}},{key:"index",value:function u(u){if(u<0)throw new RangeError("Rule '".concat(this.ruleName,"': The variable stack overflow: attempt to get a variable at a negative index ").concat(u,".\nBytecode: ").concat(this.bytecode));return this.name(this.sp-u)}},{key:"result",value:function u(){if(this.maxSp<0)throw new RangeError("Rule '".concat(this.ruleName,"': The variable stack is empty, can't get the result.\nBytecode: ").concat(this.bytecode));return this.name(0)}},{key:"defines",value:function u(){var u=this;return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},function(e,t){return u.name(t)}).join(", ")+";"}},{key:"checkedIf",value:function u(u,e,t){var n=this.sp,r=e();if(!t)return[r];var o=this.sp;this.sp=n;var a=t();if(o!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+u+": Branches of a condition can't move the stack pointer differently (before: "+n+", after then: "+o+", after else: "+this.sp+"). Bytecode: "+this.bytecode);return[r,a]}},{key:"checkedLoop",value:function u(u,e){var t=this.sp,n=e();if(t!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+u+": Body of a loop can't move the stack pointer (before: "+t+", after: "+this.sp+"). Bytecode: "+this.bytecode);return n}},{key:"sourceMapPush",value:function u(u,e){if(this.sourceMapStack.length){var t=this.sourceMapStack[this.sourceMapStack.length-1];t[2].start.offset===e.start.offset&&t[2].end.offset>e.end.offset&&(t[2]={start:e.end,end:t[2].end,source:t[2].source})}this.sourceMapStack.push([u,u.length,e])}},{key:"sourceMapPopInternal",value:function u(){var u=this.sourceMapStack.pop();if(!u)throw new RangeError("Rule '".concat(this.ruleName,"': Attempting to pop an empty source map stack.\nBytecode: ").concat(this.bytecode));var e=_sliced_to_array(u,3),t=e[0],o=e[1],a=e[2],i=t.splice(o).map(function(u){return _instanceof(u,n)?u:u+"\n"});if(i.length){var c=r.offsetStart(a);t.push(new n(c.line,c.column-1,String(a.source),i))}return{parts:t,location:a}}},{key:"sourceMapPop",value:function u(u){var e=this.sourceMapPopInternal(),t=e.location;if(this.sourceMapStack.length&&t.end.offset<this.sourceMapStack[this.sourceMapStack.length-1][2].end.offset){var n=this.sourceMapPopInternal(),r=n.parts,o=n.location,a=o.start.offset<t.end.offset?{start:t.end,end:o.end,source:o.source}:o;this.sourceMapStack.push([r,r.length+(u||0),a])}}}],[{key:"sourceNode",value:function u(u,e,t){var o=r.offsetStart(u);return new n(o.line,o.column?o.column-1:null,String(u.source),e,t)}}]);return u}();e.exports=o});var es=U(function(u){"use strict";u.version="5.1.0"});var Qe=U(function(u){"use strict";var e=function u(u){return u.codePointAt(0).toString(16).toUpperCase()};var t=function u(u){return(typeof u==="undefined"?"undefined":_type_of(u))=="object"?"\\\\".concat(u.value):u.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(RegExp("[\\u{10000}-\\u{10FFFF}]","gu"),function(u){return"\\u{".concat(e(u),"}")}).replace(/[\x00-\x0F]/g,function(u){return"\\x0"+e(u)}).replace(/[\x10-\x1F\x7F-\xFF]/g,function(u){return"\\x"+e(u)}).replace(/[\u0100-\u0FFF]/g,function(u){return"\\u0"+e(u)}).replace(/[\u1000-\uFFFF]/g,function(u){return"\\u"+e(u)})};var n=function u(u){return(typeof u==="undefined"?"undefined":_type_of(u))=="object"?"\\".concat(u.value):u.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+e(u)}).replace(/[\x10-\x1F\x7F-\xFF]/g,function(u){return"\\x"+e(u)}).replace(RegExp("[\\u{10000}-\\u{10FFFF}]","gu"),function(u){return"\\u{"+e(u)+"}"}).replace(/[\u0100-\u0FFF]/g,function(u){return"\\u0"+e(u)}).replace(/[\u1000-\uFFFF]/g,function(u){return"\\u"+e(u)})};var r=function u(u){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=u.length%3,n=u.length-t,r="";for(var o=0;o<n;o+=3)r+=e[u[o]>>2],r+=e[(u[o]&3)<<4|u[o+1]>>4],r+=e[(u[o+1]&15)<<2|u[o+2]>>6],r+=e[u[o+2]&63];return t===1?(r+=e[u[n]>>2],r+=e[(u[n]&3)<<4],r+="=="):t===2&&(r+=e[u[n]>>2],r+=e[(u[n]&3)<<4|u[n+1]>>4],r+=e[(u[n+1]&15)<<2],r+="="),r};var o=function u(u){var e=u[Symbol.iterator](),t=e.next();return t.done||!e.next().done?-1:t.value.codePointAt(0)};u.hex=e;u.stringEscape=t;u.regexpClassEscape=n;u.base64=r;u.codePointLen1=o});var ts=U(function(u,e){"use strict";var t=function u(u,e){e=e!==void 0?e:{};var t={},i=e.grammarSource,c={Grammar:tW,ImportsAndSource:tq},s=tW,l="import",A=";",F=",",p="*",f="as",E="{",C="}",D="from",h="=",B="/",d="@",v=":",g="|",m="..",y="(",_=")",b=".",x="\n",S="\r\n",P="/*",w="*/",R="//",O="\\",$="i",k='"',L="'",I="[",N="^",U="]",T="p",j="_",M="u",H="-",z="0",G="b",Y="f",V="n",W="r",q="t",J="v",X="x",K=/^[!$&]/,Z=/^[*-+?]/,Q=/^[!&]/,uu=/^[\0-\uD7FF\uE000-\uFFFF]/,ue=/^[\uD800-\uDBFF]/,ut=/^[\uDC00-\uDFFF]/,un=/^[\uD800-\uDFFF]/,ur=RegExp("^[\\t\\v-\\f \\u0020\\u00A0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000\\xA0\\uFEFF]","u"),uo=/^[\n\r\u2028\u2029]/,ua=/^[\r\u2028-\u2029]/,ui=RegExp("^[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\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\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\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\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088F\\u08A0-\\u08C9\\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\\u09FC\\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\\u0C5C-\\u0C5D\\u0C60-\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDC-\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\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-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5-\\u1CF6\\u1CFA\\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-\\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-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\