UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

17 lines (16 loc) 269 kB
var Qf=Object.create,Or=Object.defineProperty,Jf=Object.getPrototypeOf,Zf=Object.prototype.hasOwnProperty,Yf=Object.getOwnPropertyNames,ep=Object.getOwnPropertyDescriptor;var Ao=t=>Or(t,"__esModule",{value:!0});var I=(t,e)=>()=>(e||(e={exports:{}},t(e.exports,e)),e.exports),Co=(t,e)=>{for(var r in e)Or(t,r,{get:e[r],enumerable:!0})},tp=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Yf(e))!Zf.call(t,i)&&i!=="default"&&Or(t,i,{get:()=>e[i],enumerable:!(r=ep(e,i))||r.enumerable});return t},D=t=>tp(Ao(Or(t!=null?Qf(Jf(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Ho=I((it,No)=>{var ap=require("events").EventEmitter,sn=require("child_process").spawn,nt=require("path"),on=require("fs"),Ir=class{constructor(e,r){this.flags=e,this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=Po(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.description=r||"",this.defaultValue=void 0}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return lp(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}},Gt=class extends Error{constructor(e,r,i){super(i);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Kt=class extends ap{constructor(e){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._args=[],this.rawArgs=null,this._scriptPath=null,this._name=e||"",this._optionValues={},this._storeOptionsAsProperties=!0,this._storeOptionsAsPropertiesCalled=!1,this._passCommandToAction=!0,this._actionResults=[],this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._hasImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command"}command(e,r,i){let n=r,o=i;typeof n=="object"&&n!==null&&(o=n,n=null),o=o||{};let s=e.split(/ +/),a=this.createCommand(s.shift());return n&&(a.description(n),a._executableHandler=!0),o.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(o.noHelp||o.hidden),a._hasHelpOption=this._hasHelpOption,a._helpFlags=this._helpFlags,a._helpDescription=this._helpDescription,a._helpShortFlag=this._helpShortFlag,a._helpLongFlag=this._helpLongFlag,a._helpCommandName=this._helpCommandName,a._helpCommandnameAndArgs=this._helpCommandnameAndArgs,a._helpCommandDescription=this._helpCommandDescription,a._exitCallback=this._exitCallback,a._storeOptionsAsProperties=this._storeOptionsAsProperties,a._passCommandToAction=this._passCommandToAction,a._combineFlagAndOptionalValue=this._combineFlagAndOptionalValue,a._executableFile=o.executableFile||null,this.commands.push(a),a._parseExpectedArgs(s),a.parent=this,n?this:a}createCommand(e){return new Kt(e)}addCommand(e,r){if(!e._name)throw new Error("Command passed to .addCommand() must have a name");function i(n){n.forEach(o=>{if(o._executableHandler&&!o._executableFile)throw new Error(`Must specify executableFile for deeply nested executable: ${o.name()}`);i(o.commands)})}return i(e.commands),r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}arguments(e){return this._parseExpectedArgs(e.split(/ +/))}addHelpCommand(e,r){return e===!1?this._hasImplicitHelpCommand=!1:(this._hasImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=r||this._helpCommandDescription),this}_lazyHasImplicitHelpCommand(){return this._hasImplicitHelpCommand===void 0&&(this._hasImplicitHelpCommand=this.commands.length&&!this._actionHandler&&!this._findCommand("help")),this._hasImplicitHelpCommand}_parseExpectedArgs(e){if(!!e.length)return e.forEach(r=>{let i={required:!1,name:"",variadic:!1};switch(r[0]){case"<":i.required=!0,i.name=r.slice(1,-1);break;case"[":i.name=r.slice(1,-1);break}i.name.length>3&&i.name.slice(-3)==="..."&&(i.variadic=!0,i.name=i.name.slice(0,-3)),i.name&&this._args.push(i)}),this._args.forEach((r,i)=>{if(r.variadic&&i<this._args.length-1)throw new Error(`only the last argument can be variadic '${r.name}'`)}),this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new Gt(e,r,i)),process.exit(e)}action(e){let r=i=>{let n=this._args.length,o=i.slice(0,n);this._passCommandToAction?o[n]=this:o[n]=this.opts(),i.length>n&&o.push(i.slice(n));let s=e.apply(this,o),a=this;for(;a.parent;)a=a.parent;a._actionResults.push(s)};return this._actionHandler=r,this}_checkForOptionNameClash(e){if(!this._storeOptionsAsProperties||this._storeOptionsAsPropertiesCalled||e.name()==="help"||this._getOptionValue(e.attributeName())===void 0)return;let i=!0;if(e.negate){let n=e.long.replace(/^--no-/,"--");i=!this._findOption(n)}else if(e.long){let n=e.long.replace(/^--/,"--no-");i=!this._findOption(n)}if(i)throw new Error(`option '${e.name()}' clashes with existing property '${e.attributeName()}' on Command - call storeOptionsAsProperties(false) to store option values safely, - or call storeOptionsAsProperties(true) to suppress this check, - or change option name Read more on https://git.io/JJc0W`)}_optionEx(e,r,i,n,o){let s=new Ir(r,i),a=s.name(),l=s.attributeName();if(s.mandatory=!!e.mandatory,this._checkForOptionNameClash(s),typeof n!="function")if(n instanceof RegExp){let u=n;n=(c,h)=>{let f=u.exec(c);return f?f[0]:h}}else o=n,n=null;if(s.negate||s.optional||s.required||typeof o=="boolean"){if(s.negate){let u=s.long.replace(/^--no-/,"--");o=this._findOption(u)?this._getOptionValue(l):!0}o!==void 0&&(this._setOptionValue(l,o),s.defaultValue=o)}return this.options.push(s),this.on("option:"+a,u=>{let c=this._getOptionValue(l);u!==null&&n?u=n(u,c===void 0?o:c):u!==null&&s.variadic&&(c===o||!Array.isArray(c)?u=[u]:u=c.concat(u)),typeof c=="boolean"||typeof c=="undefined"?u==null?this._setOptionValue(l,s.negate?!1:o||!0):this._setOptionValue(l,u):u!==null&&this._setOptionValue(l,s.negate?!1:u)}),this}option(e,r,i,n){return this._optionEx({},e,r,i,n)}requiredOption(e,r,i,n){return this._optionEx({mandatory:!0},e,r,i,n)}combineFlagAndOptionalValue(e){return this._combineFlagAndOptionalValue=e===void 0||e,this}allowUnknownOption(e){return this._allowUnknownOption=e===void 0||e,this}storeOptionsAsProperties(e){if(this._storeOptionsAsPropertiesCalled=!0,this._storeOptionsAsProperties=e===void 0||e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}passCommandToAction(e){return this._passCommandToAction=e===void 0||e,this}_setOptionValue(e,r){this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r}_getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}parse(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");r=r||{},e===void 0&&(e=process.argv,process.versions&&process.versions.electron&&(r.from="electron")),this.rawArgs=e.slice();let i;switch(r.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":process.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._scriptPath&&process.mainModule&&(this._scriptPath=process.mainModule.filename),this._name=this._name||this._scriptPath&&nt.basename(this._scriptPath,nt.extname(this._scriptPath)),this._parseCommand([],i),this}parseAsync(e,r){return this.parse(e,r),Promise.all(this._actionResults).then(()=>this)}_executeSubCommand(e,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs"];this._checkForMissingMandatoryOptions();let o=this._scriptPath;!o&&process.mainModule&&(o=process.mainModule.filename);let s;try{let f=on.realpathSync(o);s=nt.dirname(f)}catch(f){s="."}let a=nt.basename(o,nt.extname(o))+"-"+e._name;e._executableFile&&(a=e._executableFile);let l=nt.join(s,a);on.existsSync(l)?a=l:n.forEach(f=>{on.existsSync(`${l}${f}`)&&(a=`${l}${f}`)}),i=n.includes(nt.extname(a));let u;process.platform!=="win32"?i?(r.unshift(a),r=Do(process.execArgv).concat(r),u=sn(process.argv[0],r,{stdio:"inherit"})):u=sn(a,r,{stdio:"inherit"}):(r.unshift(a),r=Do(process.execArgv).concat(r),u=sn(process.execPath,r,{stdio:"inherit"})),["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{process.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let h=this._exitCallback;h?u.on("close",()=>{h(new Gt(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):u.on("close",process.exit.bind(process)),u.on("error",f=>{if(f.code==="ENOENT"){let p=`'${a}' does not exist - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name`;throw new Error(p)}else if(f.code==="EACCES")throw new Error(`'${a}' not executable`);if(!h)process.exit(1);else{let p=new Gt(1,"commander.executeSubCommandAsync","(error)");p.nestedError=f,h(p)}}),this.runningCommand=u}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this._helpAndError(),n._executableHandler?this._executeSubCommand(n,r.concat(i)):n._parseCommand(r,i)}_parseCommand(e,r){let i=this.parseOptions(r);if(e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))this._dispatchSubcommand(e[0],e.slice(1),r);else if(this._lazyHasImplicitHelpCommand()&&e[0]===this._helpCommandName)e.length===1?this.help():this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);else if(this._defaultCommandName)Fo(this,r),this._dispatchSubcommand(this._defaultCommandName,e,r);else if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this._helpAndError(),Fo(this,i.unknown),this._checkForMissingMandatoryOptions(),i.unknown.length>0&&this.unknownOption(i.unknown[0]),this._actionHandler){let n=this.args.slice();this._args.forEach((o,s)=>{o.required&&n[s]==null?this.missingArgument(o.name):o.variadic&&(n[s]=n.splice(s))}),this._actionHandler(n),this.emit("command:"+this.name(),e,r)}else e.length?this._findCommand("*")?this._dispatchSubcommand("*",e,r):this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length&&this.unknownCommand():this.commands.length&&this._helpAndError()}_findCommand(e){if(!!e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach(r=>{r.mandatory&&e._getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})}parseOptions(e){let r=[],i=[],n=r,o=e.slice();function s(l){return l.length>1&&l[0]==="-"}let a=null;for(;o.length;){let l=o.shift();if(l==="--"){n===i&&n.push(l),n.push(...o);break}if(a&&!s(l)){this.emit(`option:${a.name()}`,l);continue}if(a=null,s(l)){let u=this._findOption(l);if(u){if(u.required){let c=o.shift();c===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,c)}else if(u.optional){let c=null;o.length>0&&!s(o[0])&&(c=o.shift()),this.emit(`option:${u.name()}`,c)}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let u=this._findOption(`-${l[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,l.slice(2)):(this.emit(`option:${u.name()}`),o.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let u=l.indexOf("="),c=this._findOption(l.slice(0,u));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,l.slice(u+1));continue}}l.length>1&&l[0]==="-"&&(n=i),n.push(l)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}missingArgument(e){let r=`error: missing required argument '${e}'`;console.error(r),this._exit(1,"commander.missingArgument",r)}optionMissingArgument(e,r){let i;r?i=`error: option '${e.flags}' argument missing, got '${r}'`:i=`error: option '${e.flags}' argument missing`,console.error(i),this._exit(1,"commander.optionMissingArgument",i)}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;console.error(r),this._exit(1,"commander.missingMandatoryOptionValue",r)}unknownOption(e){if(this._allowUnknownOption)return;let r=`error: unknown option '${e}'`;console.error(r),this._exit(1,"commander.unknownOption",r)}unknownCommand(){let e=[this.name()];for(let n=this.parent;n;n=n.parent)e.unshift(n.name());let r=e.join(" "),i=`error: unknown command '${this.args[0]}'.`+(this._hasHelpOption?` See '${r} ${this._helpLongFlag}'.`:"");console.error(i),this._exit(1,"commander.unknownCommand",i)}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=new Ir(r,i);return this._versionOptionName=n.attributeName(),this.options.push(n),this.on("option:"+n.name(),()=>{process.stdout.write(e+` `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,this._argsDescription=r,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this._args.map(i=>$o(i));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}prepareCommands(){let e=this.commands.filter(r=>!r._hidden).map(r=>{let i=r._args.map(n=>$o(n)).join(" ");return[r._name+(r._aliases[0]?"|"+r._aliases[0]:"")+(r.options.length?" [options]":"")+(i?" "+i:""),r._description]});return this._lazyHasImplicitHelpCommand()&&e.push([this._helpCommandnameAndArgs,this._helpCommandDescription]),e}largestCommandLength(){return this.prepareCommands().reduce((r,i)=>Math.max(r,i[0].length),0)}largestOptionLength(){let e=[].slice.call(this.options);return e.push({flags:this._helpFlags}),e.reduce((r,i)=>Math.max(r,i.flags.length),0)}largestArgLength(){return this._args.reduce((e,r)=>Math.max(e,r.name.length),0)}padWidth(){let e=this.largestOptionLength();return this._argsDescription&&this._args.length&&this.largestArgLength()>e&&(e=this.largestArgLength()),this.commands&&this.commands.length&&this.largestCommandLength()>e&&(e=this.largestCommandLength()),e}optionHelp(){let e=this.padWidth(),i=(process.stdout.columns||80)-e-4;function n(l,u){return an(l,e)+" "+Lo(u,i,e+2)}let o=this.options.map(l=>{let u=l.description+(!l.negate&&l.defaultValue!==void 0?" (default: "+JSON.stringify(l.defaultValue)+")":"");return n(l.flags,u)}),s=this._hasHelpOption&&this._helpShortFlag&&!this._findOption(this._helpShortFlag),a=this._hasHelpOption&&!this._findOption(this._helpLongFlag);if(s||a){let l=this._helpFlags;s?a||(l=this._helpShortFlag):l=this._helpLongFlag,o.push(n(l,this._helpDescription))}return o.join(` `)}commandHelp(){if(!this.commands.length&&!this._lazyHasImplicitHelpCommand())return"";let e=this.prepareCommands(),r=this.padWidth(),n=(process.stdout.columns||80)-r-4;return["Commands:",e.map(o=>{let s=o[1]?" "+o[1]:"";return(s?an(o[0],r):o[0])+Lo(s,n,r+2)}).join(` `).replace(/^/gm," "),""].join(` `)}helpInformation(){let e=[];if(this._description){e=[this._description,""];let l=this._argsDescription;if(l&&this._args.length){let u=this.padWidth(),h=(process.stdout.columns||80)-u-5;e.push("Arguments:"),this._args.forEach(f=>{e.push(" "+an(f.name,u)+" "+jo(l[f.name]||"",h,u+4))}),e.push("")}}let r=this._name;this._aliases[0]&&(r=r+"|"+this._aliases[0]);let i="";for(let l=this.parent;l;l=l.parent)i=l.name()+" "+i;let n=["Usage: "+i+r+" "+this.usage(),""],o=[],s=this.commandHelp();s&&(o=[s]);let a=[];return(this._hasHelpOption||this.options.length>0)&&(a=["Options:",""+this.optionHelp().replace(/^/gm," "),""]),n.concat(e).concat(a).concat(o).join(` `)}outputHelp(e){e||(e=i=>i);let r=e(this.helpInformation());if(typeof r!="string"&&!Buffer.isBuffer(r))throw new Error("outputHelp callback must return a string or a Buffer");process.stdout.write(r),this.emit(this._helpLongFlag)}helpOption(e,r){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=r||this._helpDescription;let i=Po(this._helpFlags);return this._helpShortFlag=i.shortFlag,this._helpLongFlag=i.longFlag,this}help(e){this.outputHelp(e),this._exit(process.exitCode||0,"commander.help","(outputHelp)")}_helpAndError(){this.outputHelp(),this._exit(1,"commander.help","(outputHelp)")}};it=No.exports=new Kt;it.program=it;it.Command=Kt;it.Option=Ir;it.CommanderError=Gt;function lp(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function an(t,e){let r=Math.max(0,e-t.length);return t+Array(r+1).join(" ")}function jo(t,e,r){let i=new RegExp(".{1,"+(e-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");return(t.match(i)||[]).map((o,s)=>(o.slice(-1)===` `&&(o=o.slice(0,o.length-1)),(s>0&&r?Array(r+1).join(" "):"")+o.trimRight())).join(` `)}function Lo(t,e,r){return t.match(/[\n]\s+/)||e<40?t:jo(t,e,r)}function Fo(t,e){t._hasHelpOption&&e.find(i=>i===t._helpLongFlag||i===t._helpShortFlag)&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function $o(t){let e=t.name+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}function Po(t){let e,r,i=t.split(/[ |,]+/);return i.length>1&&!/^[[<]/.test(i[1])&&(e=i.shift()),r=i.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}function Do(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?n=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],i=o[3],n=o[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}});var ln=I((exports,module)=>{var requireFoolWebpack=eval(`typeof require !== 'undefined' ? require : function (module) { throw new Error('Module " + module + " not found.') }`);module.exports=requireFoolWebpack});var Tr=I((y0,st)=>{var qo=ln(),Bo=function(t){return typeof t!="undefined"&&t.versions!=null&&t.versions.node!=null};st.exports.isNode=Bo;st.exports.platform=typeof process!="undefined"&&Bo(process)?"node":"browser";var zo=up("worker_threads");st.exports.isMainThread=st.exports.platform==="node"?(!zo||zo.isMainThread)&&!process.connected:typeof Window!="undefined";st.exports.cpus=st.exports.platform==="browser"?self.navigator.hardwareConcurrency:qo("os").cpus().length;function up(t){try{return qo(t)}catch(e){return null}}});var Mr=I((_0,Uo)=>{"use strict";function xe(t,e){var r=this;if(!(this instanceof xe))throw new SyntaxError("Constructor must be called with the new operator");if(typeof t!="function")throw new SyntaxError("Function parameter handler(resolve, reject) missing");var i=[],n=[];this.resolved=!1,this.rejected=!1,this.pending=!0;var o=function(l,u){i.push(l),n.push(u)};this.then=function(l,u){return new xe(function(c,h){var f=l?Wo(l,c,h):c,p=u?Wo(u,c,h):h;o(f,p)},r)};var s=function(l){return r.resolved=!0,r.rejected=!1,r.pending=!1,i.forEach(function(u){u(l)}),o=function(u,c){u(l)},s=a=function(){},r},a=function(l){return r.resolved=!1,r.rejected=!0,r.pending=!1,n.forEach(function(u){u(l)}),o=function(u,c){c(l)},s=a=function(){},r};this.cancel=function(){return e?e.cancel():a(new Vt),r},this.timeout=function(l){if(e)e.timeout(l);else{var u=setTimeout(function(){a(new Xt("Promise timed out after "+l+" ms"))},l);r.always(function(){clearTimeout(u)})}return r},t(function(l){s(l)},function(l){a(l)})}function Wo(t,e,r){return function(i){try{var n=t(i);n&&typeof n.then=="function"&&typeof n.catch=="function"?n.then(e,r):e(n)}catch(o){r(o)}}}xe.prototype.catch=function(t){return this.then(null,t)};xe.prototype.always=function(t){return this.then(t,t)};xe.all=function(t){return new xe(function(e,r){var i=t.length,n=[];i?t.forEach(function(o,s){o.then(function(a){n[s]=a,i--,i==0&&e(n)},function(a){i=0,r(a)})}):e(n)})};xe.defer=function(){var t={};return t.promise=new xe(function(e,r){t.resolve=e,t.reject=r}),t};function Vt(t){this.message=t||"promise cancelled",this.stack=new Error().stack}Vt.prototype=new Error;Vt.prototype.constructor=Error;Vt.prototype.name="CancellationError";xe.CancellationError=Vt;function Xt(t){this.message=t||"timeout exceeded",this.stack=new Error().stack}Xt.prototype=new Error;Xt.prototype.constructor=Error;Xt.prototype.name="TimeoutError";xe.TimeoutError=Xt;Uo.exports=xe});var Ko=I((w0,Go)=>{Go.exports=`!function(){var __webpack_exports__={};!function(){var exports=__webpack_exports__,__webpack_unused_export__;function _typeof(r){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}var requireFoolWebpack=eval("typeof require !== 'undefined' ? require : function (module) { throw new Error('Module \\" + module + \\" not found.') }"),TERMINATE_METHOD_ID="__workerpool-terminate__",worker={exit:function(){}},WorkerThreads,parentPort;if("undefined"!=typeof self&&"function"==typeof postMessage&&"function"==typeof addEventListener)worker.on=function(r,e){addEventListener(r,function(r){e(r.data)})},worker.send=function(r){postMessage(r)};else{if("undefined"==typeof process)throw new Error("Script must be executed as a worker");try{WorkerThreads=requireFoolWebpack("worker_threads")}catch(error){if("object"!==_typeof(error)||null===error||"MODULE_NOT_FOUND"!==error.code)throw error}WorkerThreads&&null!==WorkerThreads.parentPort?(parentPort=WorkerThreads.parentPort,worker.send=parentPort.postMessage.bind(parentPort),worker.on=parentPort.on.bind(parentPort)):(worker.on=process.on.bind(process),worker.send=process.send.bind(process),worker.on("disconnect",function(){process.exit(1)}),worker.exit=process.exit.bind(process))}function convertError(o){return Object.getOwnPropertyNames(o).reduce(function(r,e){return Object.defineProperty(r,e,{value:o[e],enumerable:!0})},{})}function isPromise(r){return r&&"function"==typeof r.then&&"function"==typeof r.catch}worker.methods={},worker.methods.run=function(r,e){r=new Function("return ("+r+").apply(null, arguments);");return r.apply(r,e)},worker.methods.methods=function(){return Object.keys(worker.methods)};var currentRequestId=null;worker.on("message",function(e){if(e===TERMINATE_METHOD_ID)return worker.exit(0);try{var r=worker.methods[e.method];if(!r)throw new Error('Unknown method "'+e.method+'"');currentRequestId=e.id;var o=r.apply(r,e.params);isPromise(o)?o.then(function(r){worker.send({id:e.id,result:r,error:null}),currentRequestId=null}).catch(function(r){worker.send({id:e.id,result:null,error:convertError(r)}),currentRequestId=null}):(worker.send({id:e.id,result:o,error:null}),currentRequestId=null)}catch(r){worker.send({id:e.id,result:null,error:convertError(r)})}}),worker.register=function(r){if(r)for(var e in r)r.hasOwnProperty(e)&&(worker.methods[e]=r[e]);worker.send("ready")},worker.emit=function(r){currentRequestId&&worker.send({id:currentRequestId,isEvent:!0,payload:r})},__webpack_unused_export__=worker.register,__webpack_unused_export__=worker.emit}()}();`});var Yo=I((v0,ot)=>{"use strict";var Nr=Mr(),Vo=Tr(),un=ln(),Xo="__workerpool-terminate__",cp=1e3;function Qo(){var t=cn();if(!t)throw new Error("WorkerPool: workerType = 'thread' is not supported, Node >= 11.7.0 required");return t}function Jo(){if(typeof Worker!="function"&&(typeof Worker!="object"||typeof Worker.prototype.constructor!="function"))throw new Error("WorkerPool: Web Workers not supported")}function cn(){try{return un("worker_threads")}catch(t){if(typeof t=="object"&&t!==null&&t.code==="MODULE_NOT_FOUND")return null;throw t}}function hp(){if(Vo.platform==="browser"){if(typeof Blob=="undefined")throw new Error("Blob not supported by the browser");if(!window.URL||typeof window.URL.createObjectURL!="function")throw new Error("URL.createObjectURL not supported by the browser");var t=new Blob([Ko()],{type:"text/javascript"});return window.URL.createObjectURL(t)}else return __dirname+"/worker.js"}function fp(t,e){if(e.workerType==="web")return Jo(),hn(t,Worker);if(e.workerType==="thread")return r=Qo(),fn(t,r);if(e.workerType==="process"||!e.workerType)return pn(t,Zo(e),un("child_process"));if(Vo.platform==="browser")return Jo(),hn(t,Worker);var r=cn();return r?fn(t,r):pn(t,Zo(e),un("child_process"))}function hn(t,e){var r=new e(t);return r.isBrowserWorker=!0,r.on=function(i,n){this.addEventListener(i,function(o){n(o.data)})},r.send=function(i){this.postMessage(i)},r}function fn(t,e){var r=new e.Worker(t,{stdout:!1,stderr:!1});return r.isWorkerThread=!0,r.send=function(i){this.postMessage(i)},r.kill=function(){return this.terminate(),!0},r.disconnect=function(){this.terminate()},r}function pn(t,e,r){var i=r.fork(t,e.forkArgs,e.forkOpts);return i.isChildProcess=!0,i}function Zo(t){t=t||{};var e=process.execArgv.join(" "),r=e.indexOf("--inspect")!==-1,i=e.indexOf("--debug-brk")!==-1,n=[];return r&&(n.push("--inspect="+t.debugPort),i&&n.push("--debug-brk")),process.execArgv.forEach(function(o){o.indexOf("--max-old-space-size")>-1&&n.push(o)}),Object.assign({},t,{forkArgs:t.forkArgs,forkOpts:Object.assign({},t.forkOpts,{execArgv:(t.forkOpts&&t.forkOpts.execArgv||[]).concat(n)})})}function pp(t){for(var e=new Error(""),r=Object.keys(t),i=0;i<r.length;i++)e[r[i]]=t[r[i]];return e}function xt(t,e){var r=this,i=e||{};this.script=t||hp(),this.worker=fp(this.script,i),this.debugPort=i.debugPort,t||(this.worker.ready=!0),this.requestQueue=[],this.worker.on("message",function(a){if(!r.terminated)if(typeof a=="string"&&a==="ready")r.worker.ready=!0,o();else{var l=a.id,u=r.processing[l];u!==void 0&&(a.isEvent?u.options&&typeof u.options.on=="function"&&u.options.on(a.payload):(delete r.processing[l],r.terminating===!0&&r.terminate(),a.error?u.resolver.reject(pp(a.error)):u.resolver.resolve(a.result)))}});function n(a){r.terminated=!0;for(var l in r.processing)r.processing[l]!==void 0&&r.processing[l].resolver.reject(a);r.processing=Object.create(null)}function o(){for(let a of r.requestQueue.splice(0))r.worker.send(a)}var s=this.worker;this.worker.on("error",n),this.worker.on("exit",function(a,l){var u=`Workerpool Worker terminated Unexpectedly `;u+=" exitCode: `"+a+"`\n",u+=" signalCode: `"+l+"`\n",u+=" workerpool.script: `"+r.script+"`\n",u+=" spawnArgs: `"+s.spawnargs+"`\n",u+=" spawnfile: `"+s.spawnfile+"`\n",u+=" stdout: `"+s.stdout+"`\n",u+=" stderr: `"+s.stderr+"`\n",n(new Error(u))}),this.processing=Object.create(null),this.terminating=!1,this.terminated=!1,this.terminationHandler=null,this.lastId=0}xt.prototype.methods=function(){return this.exec("methods")};xt.prototype.exec=function(t,e,r,i){r||(r=Nr.defer());var n=++this.lastId;this.processing[n]={id:n,resolver:r,options:i};var o={id:n,method:t,params:e};this.terminated?r.reject(new Error("Worker is terminated")):this.worker.ready?this.worker.send(o):this.requestQueue.push(o);var s=this;return r.promise.catch(function(a){if(a instanceof Nr.CancellationError||a instanceof Nr.TimeoutError)return delete s.processing[n],s.terminateAndNotify(!0).then(function(){throw a},function(l){throw l});throw a})};xt.prototype.busy=function(){return Object.keys(this.processing).length>0};xt.prototype.terminate=function(t,e){var r=this;if(t){for(var i in this.processing)this.processing[i]!==void 0&&this.processing[i].resolver.reject(new Error("Worker terminated"));this.processing=Object.create(null)}if(typeof e=="function"&&(this.terminationHandler=e),this.busy())this.terminating=!0;else{var n=function(s){if(r.terminated=!0,r.worker!=null&&r.worker.removeAllListeners&&r.worker.removeAllListeners("message"),r.worker=null,r.terminating=!1,r.terminationHandler)r.terminationHandler(s,r);else if(s)throw s};if(this.worker)if(typeof this.worker.kill=="function"){if(this.worker.killed){n(new Error("worker already killed!"));return}if(this.worker.isChildProcess){var o=setTimeout(function(){r.worker.kill()},cp);this.worker.once("exit",function(){clearTimeout(o),r.worker.killed=!0,n()}),this.worker.ready?this.worker.send(Xo):this.worker.requestQueue.push(Xo)}else this.worker.kill(),this.worker.killed=!0,n();return}else if(typeof this.worker.terminate=="function")this.worker.terminate(),this.worker.killed=!0;else throw new Error("Failed to terminate worker");n()}};xt.prototype.terminateAndNotify=function(t,e){var r=Nr.defer();return e&&(r.promise.timeout=e),this.terminate(t,function(i,n){i?r.reject(i):r.resolve(n)}),r.promise};ot.exports=xt;ot.exports._tryRequireWorkerThreads=cn;ot.exports._setupProcessWorker=pn;ot.exports._setupBrowserWorker=hn;ot.exports._setupWorkerThreadWorker=fn;ot.exports.ensureWorkerThreads=Qo});var ra=I((x0,ea)=>{"use strict";var ta=65535;ea.exports=mn;function mn(){this.ports=Object.create(null),this.length=0}mn.prototype.nextAvailableStartingAt=function(t){for(;this.ports[t]===!0;)t++;if(t>=ta)throw new Error("WorkerPool debug port limit reached: "+t+">= "+ta);return this.ports[t]=!0,this.length++,t};mn.prototype.releasePort=function(t){delete this.ports[t],this.length--}});var la=I((k0,ia)=>{var dn=Mr(),na=Yo(),mp=Tr(),dp=ra(),sa=new dp;function ke(t,e){typeof t=="string"?this.script=t||null:(this.script=null,e=t),this.workers=[],this.tasks=[],e=e||{},this.forkArgs=e.forkArgs||[],this.forkOpts=e.forkOpts||{},this.debugPortStart=e.debugPortStart||43210,this.nodeWorker=e.nodeWorker,this.workerType=e.workerType||e.nodeWorker||"auto",this.maxQueueSize=e.maxQueueSize||Infinity,e&&"maxWorkers"in e?(gp(e.maxWorkers),this.maxWorkers=e.maxWorkers):this.maxWorkers=Math.max((mp.cpus||4)-1,1),e&&"minWorkers"in e&&(e.minWorkers==="max"?this.minWorkers=this.maxWorkers:(bp(e.minWorkers),this.minWorkers=e.minWorkers,this.maxWorkers=Math.max(this.minWorkers,this.maxWorkers)),this._ensureMinWorkers()),this._boundNext=this._next.bind(this),this.workerType==="thread"&&na.ensureWorkerThreads()}ke.prototype.exec=function(t,e,r){if(e&&!Array.isArray(e))throw new TypeError('Array expected as argument "params"');if(typeof t=="string"){var i=dn.defer();if(this.tasks.length>=this.maxQueueSize)throw new Error("Max queue size of "+this.maxQueueSize+" reached");var n=this.tasks,o={method:t,params:e,resolver:i,timeout:null,options:r};n.push(o);var s=i.promise.timeout;return i.promise.timeout=function(l){return n.indexOf(o)!==-1?(o.timeout=l,i.promise):s.call(i.promise,l)},this._next(),i.promise}else{if(typeof t=="function")return this.exec("run",[String(t),e]);throw new TypeError('Function or string expected as argument "method"')}};ke.prototype.proxy=function(){if(arguments.length>0)throw new Error("No arguments expected");var t=this;return this.exec("methods").then(function(e){var r={};return e.forEach(function(i){r[i]=function(){return t.exec(i,Array.prototype.slice.call(arguments))}}),r})};ke.prototype._next=function(){if(this.tasks.length>0){var t=this._getWorker();if(t){var e=this,r=this.tasks.shift();if(r.resolver.promise.pending){var i=t.exec(r.method,r.params,r.resolver,r.options).then(e._boundNext).catch(function(){if(t.terminated)return e._removeWorker(t)}).then(function(){e._next()});typeof r.timeout=="number"&&i.timeout(r.timeout)}else e._next()}}};ke.prototype._getWorker=function(){for(var t=this.workers,e=0;e<t.length;e++){var r=t[e];if(r.busy()===!1)return r}return t.length<this.maxWorkers?(r=this._createWorkerHandler(),t.push(r),r):null};ke.prototype._removeWorker=function(t){return sa.releasePort(t.debugPort),this._removeWorkerFromList(t),this._ensureMinWorkers(),new dn(function(e,r){t.terminate(!1,function(i){i?r(i):e(t)})})};ke.prototype._removeWorkerFromList=function(t){var e=this.workers.indexOf(t);e!==-1&&this.workers.splice(e,1)};ke.prototype.terminate=function(t,e){this.tasks.forEach(function(s){s.resolver.reject(new Error("Pool terminated"))}),this.tasks.length=0;var r=function(s){this._removeWorkerFromList(s)},i=r.bind(this),n=[],o=this.workers.slice();return o.forEach(function(s){var a=s.terminateAndNotify(t,e).then(i);n.push(a)}),dn.all(n)};ke.prototype.stats=function(){var t=this.workers.length,e=this.workers.filter(function(r){return r.busy()}).length;return{totalWorkers:t,busyWorkers:e,idleWorkers:t-e,pendingTasks:this.tasks.length,activeTasks:e}};ke.prototype._ensureMinWorkers=function(){if(this.minWorkers)for(var t=this.workers.length;t<this.minWorkers;t++)this.workers.push(this._createWorkerHandler())};ke.prototype._createWorkerHandler=function(){return new na(this.script,{forkArgs:this.forkArgs,forkOpts:this.forkOpts,debugPort:sa.nextAvailableStartingAt(this.debugPortStart),workerType:this.workerType})};function gp(t){if(!oa(t)||!aa(t)||t<1)throw new TypeError("Option maxWorkers must be an integer number >= 1")}function bp(t){if(!oa(t)||!aa(t)||t<0)throw new TypeError("Option minWorkers must be an integer number >= 0")}function oa(t){return typeof t=="number"}function aa(t){return Math.round(t)==t}ia.exports=ke});var gn=I((exports,module)=>{var requireFoolWebpack=eval(`typeof require !== 'undefined' ? require : function (module) { throw new Error('Module " + module + " not found.') }`),TERMINATE_METHOD_ID="__workerpool-terminate__",worker={exit:function(){}};if(typeof self!="undefined"&&typeof postMessage=="function"&&typeof addEventListener=="function")worker.on=function(t,e){addEventListener(t,function(r){e(r.data)})},worker.send=function(t){postMessage(t)};else if(typeof process!="undefined"){try{WorkerThreads=requireFoolWebpack("worker_threads")}catch(t){if(!(typeof t=="object"&&t!==null&&t.code==="MODULE_NOT_FOUND"))throw t}WorkerThreads&&WorkerThreads.parentPort!==null?(parentPort=WorkerThreads.parentPort,worker.send=parentPort.postMessage.bind(parentPort),worker.on=parentPort.on.bind(parentPort)):(worker.on=process.on.bind(process),worker.send=process.send.bind(process),worker.on("disconnect",function(){process.exit(1)}),worker.exit=process.exit.bind(process))}else throw new Error("Script must be executed as a worker");var WorkerThreads,parentPort;function convertError(t){return Object.getOwnPropertyNames(t).reduce(function(e,r){return Object.defineProperty(e,r,{value:t[r],enumerable:!0})},{})}function isPromise(t){return t&&typeof t.then=="function"&&typeof t.catch=="function"}worker.methods={};worker.methods.run=function(e,r){var i=new Function("return ("+e+").apply(null, arguments);");return i.apply(i,r)};worker.methods.methods=function(){return Object.keys(worker.methods)};var currentRequestId=null;worker.on("message",function(t){if(t===TERMINATE_METHOD_ID)return worker.exit(0);try{var e=worker.methods[t.method];if(e){currentRequestId=t.id;var r=e.apply(e,t.params);isPromise(r)?r.then(function(i){worker.send({id:t.id,result:i,error:null}),currentRequestId=null}).catch(function(i){worker.send({id:t.id,result:null,error:convertError(i)}),currentRequestId=null}):(worker.send({id:t.id,result:r,error:null}),currentRequestId=null)}else throw new Error('Unknown method "'+t.method+'"')}catch(i){worker.send({id:t.id,result:null,error:convertError(i)})}});worker.register=function(t){if(t)for(var e in t)t.hasOwnProperty(e)&&(worker.methods[e]=t[e]);worker.send("ready")};worker.emit=function(t){currentRequestId&&worker.send({id:currentRequestId,isEvent:!0,payload:t})};typeof exports!="undefined"&&(exports.add=worker.register,exports.emit=worker.emit)});var yn=I(We=>{var bn=Tr();We.pool=function(e,r){var i=la();return new i(e,r)};We.worker=function(e){var r=gn();r.add(e)};We.workerEmit=function(e){var r=gn();r.emit(e)};We.Promise=Mr();We.platform=bn.platform;We.isMainThread=bn.isMainThread;We.cpus=bn.cpus});var jr=I(_e=>{"use strict";_e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;_e.find=(t,e)=>t.nodes.find(r=>r.type===e);_e.exceedsLimit=(t,e,r=1,i)=>i===!1||!_e.isInteger(t)||!_e.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=i;_e.escapeNode=(t,e=0,r)=>{let i=t.nodes[e];!i||(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};_e.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0==0?(t.invalid=!0,!0):!1;_e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0==0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;_e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;_e.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);_e.flatten=(...t)=>{let e=[],r=i=>{for(let n=0;n<i.length;n++){let o=i[n];Array.isArray(o)?r(o,e):o!==void 0&&e.push(o)}return e};return r(t),e}});var Lr=I((C0,ua)=>{"use strict";var ca=jr();ua.exports=(t,e={})=>{let r=(i,n={})=>{let o=e.escapeInvalid&&ca.isInvalidBrace(n),s=i.invalid===!0&&e.escapeInvalid===!0,a="";if(i.value)return(o||s)&&ca.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let l of i.nodes)a+=r(l);return a};return r(t)}});var fa=I((O0,ha)=>{"use strict";ha.exports=function(t){return typeof t=="number"?t-t==0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var va=I((R0,pa)=>{"use strict";var ma=fa(),at=(t,e,r)=>{if(ma(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(ma(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:!0,...r};typeof i.strictZeros=="boolean"&&(i.relaxZeros=i.strictZeros===!1);let n=String(i.relaxZeros),o=String(i.shorthand),s=String(i.capture),a=String(i.wrap),l=t+":"+e+"="+n+o+s+a;if(at.cache.hasOwnProperty(l))return at.cache[l].result;let u=Math.min(t,e),c=Math.max(t,e);if(Math.abs(u-c)===1){let y=t+"|"+e;return i.capture?`(${y})`:i.wrap===!1?y:`(?:${y})`}let h=ga(t)||ga(e),f={min:t,max:e,a:u,b:c},p=[],d=[];if(h&&(f.isPadded=h,f.maxLen=String(f.max).length),u<0){let y=c<0?Math.abs(c):1;d=da(y,Math.abs(u),f,i),u=f.a=0}return c>=0&&(p=da(u,c,f,i)),f.negatives=d,f.positives=p,f.result=kp(d,p,i),i.capture===!0?f.result=`(${f.result})`:i.wrap!==!1&&p.length+d.length>1&&(f.result=`(?:${f.result})`),at.cache[l]=f,f.result};function kp(t,e,r){let i=wn(t,e,"-",!1,r)||[],n=wn(e,t,"",!1,r)||[],o=wn(t,e,"-?",!0,r)||[];return i.concat(o).concat(n).join("|")}function Sp(t,e){let r=1,i=1,n=ba(t,r),o=new Set([e]);for(;t<=n&&n<=e;)o.add(n),r+=1,n=ba(t,r);for(n=ya(e+1,i)-1;t<n&&n<=e;)o.add(n),i+=1,n=ya(e+1,i)-1;return o=[...o],o.sort(Ep),o}function Op(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let i=Ap(t,e),n=i.length,o="",s=0;for(let a=0;a<n;a++){let[l,u]=i[a];l===u?o+=l:l!=="0"||u!=="9"?o+=Cp(l,u,r):s++}return s&&(o+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[s],digits:n}}function da(t,e,r,i){let n=Sp(t,e),o=[],s=t,a;for(let l=0;l<n.length;l++){let u=n[l],c=Op(String(s),String(u),i),h="";if(!r.isPadded&&a&&a.pattern===c.pattern){a.count.length>1&&a.count.pop(),a.count.push(c.count[0]),a.string=a.pattern+_a(a.count),s=u+1;continue}r.isPadded&&(h=Rp(u,r,i)),c.string=h+c.pattern+_a(c.count),o.push(c),s=u+1,a=c}return o}function wn(t,e,r,i,n){let o=[];for(let s of t){let{string:a}=s;!i&&!wa(e,"string",a)&&o.push(r+a),i&&wa(e,"string",a)&&o.push(r+a)}return o}function Ap(t,e){let r=[];for(let i=0;i<t.length;i++)r.push([t[i],e[i]]);return r}function Ep(t,e){return t>e?1:e>t?-1:0}function wa(t,e,r){return t.some(i=>i[e]===r)}function ba(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function ya(t,e){return t-t%Math.pow(10,e)}function _a(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function Cp(t,e,r){return`[${t}${e-t==1?"":"-"}${e}]`}function ga(t){return/^-?(0+)\d/.test(t)}function Rp(t,e,r){if(!e.isPadded)return t;let i=Math.abs(e.maxLen-String(t).length),n=r.relaxZeros!==!1;switch(i){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${i}}`:`0{${i}}`}}at.cache={};at.clearCache=()=>at.cache={};pa.exports=at});var kn=I((I0,xa)=>{"use strict";var Ip=require("util"),ka=va(),Ea=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Tp=t=>e=>t===!0?Number(e):String(e),vn=t=>typeof t=="number"||typeof t=="string"&&t!=="",Jt=t=>Number.isInteger(+t),xn=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},Mp=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,Np=(t,e,r)=>{if(e>0){let i=t[0]==="-"?"-":"";i&&(t=t.slice(1)),t=i+t.padStart(i?e-1:e,"0")}return r===!1?String(t):t},Sa=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},Pp=(t,e)=>{t.negatives.sort((s,a)=>s<a?-1:s>a?1:0),t.positives.sort((s,a)=>s<a?-1:s>a?1:0);let r=e.capture?"":"?:",i="",n="",o;return t.positives.length&&(i=t.positives.join("|")),t.negatives.length&&(n=`-(${r}${t.negatives.join("|")})`),i&&n?o=`${i}|${n}`:o=i||n,e.wrap?`(${r}${o})`:o},Aa=(t,e,r,i)=>{if(r)return ka(t,e,{wrap:!1,...i});let n=String.fromCharCode(t);if(t===e)return n;let o=String.fromCharCode(e);return`[${n}-${o}]`},Ca=(t,e,r)=>{if(Array.isArray(t)){let i=r.wrap===!0,n=r.capture?"":"?:";return i?`(${n}${t.join("|")})`:t.join("|")}return ka(t,e,r)},Oa=(...t)=>new RangeError("Invalid range arguments: "+Ip.inspect(...t)),Ra=(t,e,r)=>{if(r.strictRanges===!0)throw Oa([t,e]);return[]},jp=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},Lp=(t,e,r=1,i={})=>{let n=Number(t),o=Number(e);if(!Number.isInteger(n)||!Number.isInteger(o)){if(i.strictRanges===!0)throw Oa([t,e]);return[]}n===0&&(n=0),o===0&&(o=0);let s=n>o,a=String(t),l=String(e),u=String(r);r=Math.max(Math.abs(r),1);let c=xn(a)||xn(l)||xn(u),h=c?Math.max(a.length,l.length,u.length):0,f=c===!1&&Mp(t,e,i)===!1,p=i.transform||Tp(f);if(i.toRegex&&r===1)return Aa(Sa(t,h),Sa(e,h),!0,i);let d={negatives:[],positives:[]},y=x=>d[x<0?"negatives":"positives"].push(Math.abs(x)),_=[],m=0;for(;s?n>=o:n<=o;)i.toRegex===!0&&r>1?y(n):_.push(Np(p(n,m),h,f)),n=s?n-r:n+r,m++;return i.toRegex===!0?r>1?Pp(d,i):Ca(_,null,{wrap:!1,...i}):_},Fp=(t,e,r=1,i={})=>{if(!Jt(t)&&t.length>1||!Jt(e)&&e.length>1)return Ra(t,e,i);let n=i.transform||(f=>String.fromCharCode(f)),o=`${t}`.charCodeAt(0),s=`${e}`.charCodeAt(0),a=o>s,l=Math.min(o,s),u=Math.max(o,s);if(i.toRegex&&r===1)return Aa(l,u,!1,i);let c=[],h=0;for(;a?o>=s:o<=s;)c.push(n(o,h)),o=a?o-r:o+r,h++;return i.toRegex===!0?Ca(c,null,{wrap:!1,options:i}):c},Fr=(t,e,r,i={})=>{if(e==null&&vn(t))return[t];if(!vn(t)||!vn(e))return Ra(t,e,i);if(typeof r=="function")return Fr(t,e,1,{transform:r});if(Ea(r))return Fr(t,e,0,r);let n={...i};return n.capture===!0&&(n.wrap=!0),r=r||n.step||1,Jt(r)?Jt(t)&&Jt(e)?Lp(t,e,r,n):Fp(t,e,Math.max(Math.abs(r),1),n):r!=null&&!Ea(r)?jp(r,n):Fr(t,e,1,r)};xa.exports=Fr});var Ma=I((T0,Ia)=>{"use strict";var $p=kn(),Ta=jr(),Dp=(t,e={})=>{let r=(i,n={})=>{let o=Ta.isInvalidBrace(n),s=i.invalid===!0&&e.escapeInvalid===!0,a=o===!0||s===!0,l=e.escapeInvalid===!0?"\\":"",u="";if(i.isOpen===!0||i.isClose===!0)return l+i.value;if(i.type==="open")return a?l+i.value:"(";if(i.type==="close")return a?l+i.value:")";if(i.type==="comma")return i.prev.type==="comma"?"":a?i.value:"|";if(i.value)return i.value;if(i.nodes&&i.ranges>0){let c=Ta.reduce(i.nodes),h=$p(...c,{...e,wrap:!1,toRegex:!0});if(h.length!==0)return c.length>1&&h.length>1?`(${h})`:h}if(i.nodes)for(let c of i.nodes)u+=r(c,i);return u};return r(t)};Ia.exports=Dp});var ja=I((M0,Na)=>{"use strict";var Hp=kn(),Pa=Lr(),kt=jr(),lt=(t="",e="",r=!1)=>{let i=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?kt.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let o of n)i.push(lt(o,e,r));else for(let o of e)r===!0&&typeof o=="string"&&(o=`{${o}}`),i.push(Array.isArray(o)?lt(n,o,r):n+o);return kt.flatten(i)},qp=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,i=(n,o={})=>{n.queue=[];let s=o,a=o.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(n.invalid||n.dollar){a.push(lt(a.pop(),Pa(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){a.push(lt(a.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let h=kt.reduce(n.nodes);if(kt.exceedsLimit(...h,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=Hp(...h,e);f.length===0&&(f=Pa(n,e)),a.push(lt(a.pop(),f)),n.nodes=[];return}let l=kt.encloseBrace(n),u=n.queue,c=n;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,u=c.queue;for(let h=0;h<n.nodes.length;h++){let f=n.nodes[h];if(f.type==="comma"&&n.type==="brace"){h===1&&u.push(""),u.push("");continue}if(f.type==="close"){a.push(lt(a.pop(),u,l));continue}if(f.value&&f.type!=="open"){u.push(lt(u.pop(),f.value));continue}f.nodes&&i(f,n)}return u};return kt.flatten(i(t))};Na.exports=qp});var Fa=I((N0,La)=>{"use strict";La.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` `,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ba=I((P0,$a)=>{"use strict";var Bp=Lr(),{MAX_LENGTH:Da,CHAR_BACKSLASH:En,CHAR_BACKTICK:zp,CHAR_COMMA:Up,CHAR_DOT:Wp,CHAR_LEFT_PARENTHESES:Gp,CHAR_RIGHT_PARENTHESES:Kp,CHAR_LEFT_CURLY_BRACE:Vp,CHAR_RIGHT_CURLY_BRACE:Xp,CHAR_LEFT_SQUARE_BRACKET:Ha,CHAR_RIGHT_SQUARE_BRACKET:qa,CHAR_DOUBLE_QUOTE:Qp,CHAR_SINGLE_QUOTE:Jp,CHAR_NO_BREAK_SPACE:Zp,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Yp}=Fa(),em=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},i=typeof r.maxLength=="number"?Math.min(Da,r.maxLength):Da;if(t.length>i)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${i})`);let n={type:"root",input:t,nodes:[]},o=[n],s=n,a=n,l=0,u=t.length,c=0,h=0,f,p={},d=()=>t[c++],y=_=>{if(_.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&_.type==="text"){a.value+=_.value;return}return s.nodes.push(_),_.parent=s,_.prev=a,a=_,_};for(y({type:"bos"});c<u;)if(s=o[o.length-1],f=d(),!(f===Yp||f===Zp)){if(f===En){y({type:"text",value:(e.keepEscaping?f:"")+d()});continue}if(f===qa){y({type:"text",value:"\\"+f});continue}if(f===Ha){l++;let _=!0,m;for(;c<u&&(m=d());){if(f+=m,m===Ha){l++;continue}if(m===En){f+=d();continue}if(m===qa&&(l--,l===0))break}y({type:"text",value:f});continue}if(f===Gp){s=y({type:"paren",nodes:[]}),o.push(s),y({type:"text",value:f});continue}if(f===Kp){if(s.type!=="paren"){y({type:"text",value:f});continue}s=o.pop(),y({type:"text",value:f}),s=o[o.length-1];continue}if(f===Qp||f===Jp||f===zp){let _=f,m;for(e.keepQuotes!==!0&&(f="");c<u&&(m=d());){if(m===En){f+=m+d();continue}if(m===_){e.keepQuotes===!0&&(f+=m);break}f+=m}y({type:"text",value:f});continue}if(f===Vp){h++;let _=a.value&&a.value.slice(-1)==="$"||s.dollar===!0;s=y({type:"brace",open:!0,close:!1,dollar:_,depth:h,commas:0,ranges:0,nodes:[]}),o.push(s),y({type:"open",value:f});continue}if(f===Xp){if(s.type!=="brace"){y({type:"text",value:f});continue}let _="close";s=o.pop(),s.close=!0,y({type:_,value:f}),h--,s=o[o.length-1];continue}if(f===Up&&h>0){if(s.ranges>0){s.ranges=0;let _=s.nodes.shift();s.nodes=[_,{type:"text",value:Bp(s)}]}y({type:"comma",value:f}),s.commas++;continue}if(f===Wp&&h>0&&s.commas===0){let _=s.nodes;if(h===0||_.length===0){y({type:"text",value:f});continue}if(a.type==="dot"){if(s.range=[],a.value+=f,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){_.pop();let m=_[_.length-1];m.value+=a.value+f,a=m,s.ranges--;continue}y({type:"dot",value:f});continue}y({type:"text",value:f})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(x=>{x.nodes||(x.type==="open"&&(x.isOpen=!0),x.type==="close"&&(x.isClose=!0),x.nodes||(x.type="text"),x.invalid=!0)});let _=o[o.length-1],m=_.nodes.indexOf(s);_.nodes.splice(m,1,...s.nodes)}while(o.length>0);return y({type:"eos"}),n};$a.exports=em});var Wa=I((j0,za)=>{"use strict";var Ua=Lr(),tm=Ma(),rm=ja(),