@parcel/utils
Version:
Blazing fast, zero configuration web application bundler
1,278 lines (1,249 loc) • 1.42 MB
JavaScript
var $8C1kk$path = require("path");
var $8C1kk$stream = require("stream");
var $8C1kk$parcelsourcemap = require("@parcel/source-map");
var $8C1kk$parcellogger = require("@parcel/logger");
var $8C1kk$crypto = require("crypto");
var $8C1kk$os = require("os");
var $8C1kk$util = require("util");
var $8C1kk$fs = require("fs");
var $8C1kk$events = require("events");
var $8C1kk$parcelcodeframe = require("@parcel/codeframe");
var $8C1kk$parcelmarkdownansi = require("@parcel/markdown-ansi");
var $8C1kk$chalk = require("chalk");
var $8C1kk$tty = require("tty");
var $8C1kk$assert = require("assert");
var $8C1kk$parceldiagnostic = require("@parcel/diagnostic");
var $8C1kk$url = require("url");
var $8C1kk$child_process = require("child_process");
var $8C1kk$buffer = require("buffer");
var $8C1kk$parcelhash = require("@parcel/hash");
var $8C1kk$http = require("http");
var $8C1kk$https = require("https");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
var $parcel$global =
typeof globalThis !== 'undefined'
? globalThis
: typeof self !== 'undefined'
? self
: typeof window !== 'undefined'
? window
: typeof global !== 'undefined'
? global
: {};
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
var $parcel$modules = {};
var $parcel$inits = {};
var parcelRequire = $parcel$global["parcelRequire0b48"];
if (parcelRequire == null) {
parcelRequire = function(id) {
if (id in $parcel$modules) {
return $parcel$modules[id].exports;
}
if (id in $parcel$inits) {
var init = $parcel$inits[id];
delete $parcel$inits[id];
var module = {id: id, exports: {}};
$parcel$modules[id] = module;
init.call(module.exports, module, module.exports);
return module.exports;
}
var err = new Error("Cannot find module '" + id + "'");
err.code = 'MODULE_NOT_FOUND';
throw err;
};
parcelRequire.register = function register(id, init) {
$parcel$inits[id] = init;
};
$parcel$global["parcelRequire0b48"] = parcelRequire;
}
parcelRequire.register("iGlOy", function(module, exports) {
/**
* Node.js module for Forge.
*
* @author Dave Longley
*
* Copyright 2011-2016 Digital Bazaar, Inc.
*/ module.exports = {
// default options
options: {
usePureJavaScript: false
}
};
});
parcelRequire.register("ai0Z9", function(module, exports) {
var $iGlOy = parcelRequire("iGlOy");
module.exports = $iGlOy.md = $iGlOy.md || {};
$iGlOy.md.algorithms = $iGlOy.md.algorithms || {};
});
parcelRequire.register("4997P", function(module, exports) {
"use strict";
var $2zM8v = parcelRequire("2zM8v");
var $lKEF0 = parcelRequire("lKEF0");
var $5MQDC = parcelRequire("5MQDC");
var $7XmS6 = parcelRequire("7XmS6");
const $304f14c7e435813f$var$isObject = (val)=>val && typeof val === "object" && !Array.isArray(val);
/**
* Creates a matcher function from one or more glob patterns. The
* returned function takes a string to match as its first argument,
* and returns true if the string is a match. The returned matcher
* function also takes a boolean as the second argument that, when true,
* returns an object with additional information.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch(glob[, options]);
*
* const isMatch = picomatch('*.!(*a)');
* console.log(isMatch('a.a')); //=> false
* console.log(isMatch('a.b')); //=> true
* ```
* @name picomatch
* @param {String|Array} `globs` One or more glob patterns.
* @param {Object=} `options`
* @return {Function=} Returns a matcher function.
* @api public
*/ const $304f14c7e435813f$var$picomatch = (glob, options, returnState = false)=>{
if (Array.isArray(glob)) {
const fns = glob.map((input)=>$304f14c7e435813f$var$picomatch(input, options, returnState));
const arrayMatcher = (str)=>{
for (const isMatch of fns){
const state = isMatch(str);
if (state) return state;
}
return false;
};
return arrayMatcher;
}
const isState = $304f14c7e435813f$var$isObject(glob) && glob.tokens && glob.input;
if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
const opts = options || {};
const posix = $5MQDC.isWindows(options);
const regex = isState ? $304f14c7e435813f$var$picomatch.compileRe(glob, options) : $304f14c7e435813f$var$picomatch.makeRe(glob, options, false, true);
const state1 = regex.state;
delete regex.state;
let isIgnored = ()=>false;
if (opts.ignore) {
const ignoreOpts = {
...options,
ignore: null,
onMatch: null,
onResult: null
};
isIgnored = $304f14c7e435813f$var$picomatch(opts.ignore, ignoreOpts, returnState);
}
const matcher = (input, returnObject = false)=>{
const { isMatch: isMatch , match: match , output: output } = $304f14c7e435813f$var$picomatch.test(input, regex, options, {
glob: glob,
posix: posix
});
const result = {
glob: glob,
state: state1,
regex: regex,
posix: posix,
input: input,
output: output,
match: match,
isMatch: isMatch
};
if (typeof opts.onResult === "function") opts.onResult(result);
if (isMatch === false) {
result.isMatch = false;
return returnObject ? result : false;
}
if (isIgnored(input)) {
if (typeof opts.onIgnore === "function") opts.onIgnore(result);
result.isMatch = false;
return returnObject ? result : false;
}
if (typeof opts.onMatch === "function") opts.onMatch(result);
return returnObject ? result : true;
};
if (returnState) matcher.state = state1;
return matcher;
};
/**
* Test `input` with the given `regex`. This is used by the main
* `picomatch()` function to test the input string.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.test(input, regex[, options]);
*
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
* ```
* @param {String} `input` String to test.
* @param {RegExp} `regex`
* @return {Object} Returns an object with matching info.
* @api public
*/ $304f14c7e435813f$var$picomatch.test = (input, regex, options, { glob: glob , posix: posix } = {})=>{
if (typeof input !== "string") throw new TypeError("Expected input to be a string");
if (input === "") return {
isMatch: false,
output: ""
};
const opts = options || {};
const format = opts.format || (posix ? $5MQDC.toPosixSlashes : null);
let match = input === glob;
let output = match && format ? format(input) : input;
if (match === false) {
output = format ? format(input) : input;
match = output === glob;
}
if (match === false || opts.capture === true) {
if (opts.matchBase === true || opts.basename === true) match = $304f14c7e435813f$var$picomatch.matchBase(input, regex, options, posix);
else match = regex.exec(output);
}
return {
isMatch: Boolean(match),
match: match,
output: output
};
};
/**
* Match the basename of a filepath.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.matchBase(input, glob[, options]);
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
* ```
* @param {String} `input` String to test.
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
* @return {Boolean}
* @api public
*/ $304f14c7e435813f$var$picomatch.matchBase = (input, glob, options, posix = $5MQDC.isWindows(options))=>{
const regex = glob instanceof RegExp ? glob : $304f14c7e435813f$var$picomatch.makeRe(glob, options);
return regex.test($8C1kk$path.basename(input));
};
/**
* Returns true if **any** of the given glob `patterns` match the specified `string`.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.isMatch(string, patterns[, options]);
*
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
* ```
* @param {String|Array} str The string to test.
* @param {String|Array} patterns One or more glob patterns to use for matching.
* @param {Object} [options] See available [options](#options).
* @return {Boolean} Returns true if any patterns match `str`
* @api public
*/ $304f14c7e435813f$var$picomatch.isMatch = (str, patterns, options)=>$304f14c7e435813f$var$picomatch(patterns, options)(str);
/**
* Parse a glob pattern to create the source string for a regular
* expression.
*
* ```js
* const picomatch = require('picomatch');
* const result = picomatch.parse(pattern[, options]);
* ```
* @param {String} `pattern`
* @param {Object} `options`
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
* @api public
*/ $304f14c7e435813f$var$picomatch.parse = (pattern, options)=>{
if (Array.isArray(pattern)) return pattern.map((p)=>$304f14c7e435813f$var$picomatch.parse(p, options));
return $lKEF0(pattern, {
...options,
fastpaths: false
});
};
/**
* Scan a glob pattern to separate the pattern into segments.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.scan(input[, options]);
*
* const result = picomatch.scan('!./foo/*.js');
* console.log(result);
* { prefix: '!./',
* input: '!./foo/*.js',
* start: 3,
* base: 'foo',
* glob: '*.js',
* isBrace: false,
* isBracket: false,
* isGlob: true,
* isExtglob: false,
* isGlobstar: false,
* negated: true }
* ```
* @param {String} `input` Glob pattern to scan.
* @param {Object} `options`
* @return {Object} Returns an object with
* @api public
*/ $304f14c7e435813f$var$picomatch.scan = (input, options)=>$2zM8v(input, options);
/**
* Compile a regular expression from the `state` object returned by the
* [parse()](#parse) method.
*
* @param {Object} `state`
* @param {Object} `options`
* @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
* @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
* @return {RegExp}
* @api public
*/ $304f14c7e435813f$var$picomatch.compileRe = (state, options, returnOutput = false, returnState = false)=>{
if (returnOutput === true) return state.output;
const opts = options || {};
const prepend = opts.contains ? "" : "^";
const append = opts.contains ? "" : "$";
let source = `${prepend}(?:${state.output})${append}`;
if (state && state.negated === true) source = `^(?!${source}).*$`;
const regex = $304f14c7e435813f$var$picomatch.toRegex(source, options);
if (returnState === true) regex.state = state;
return regex;
};
/**
* Create a regular expression from a parsed glob pattern.
*
* ```js
* const picomatch = require('picomatch');
* const state = picomatch.parse('*.js');
* // picomatch.compileRe(state[, options]);
*
* console.log(picomatch.compileRe(state));
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
* ```
* @param {String} `state` The object returned from the `.parse` method.
* @param {Object} `options`
* @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
* @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
* @return {RegExp} Returns a regex created from the given pattern.
* @api public
*/ $304f14c7e435813f$var$picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false)=>{
if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
let parsed = {
negated: false,
fastpaths: true
};
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = $lKEF0.fastpaths(input, options);
if (!parsed.output) parsed = $lKEF0(input, options);
return $304f14c7e435813f$var$picomatch.compileRe(parsed, options, returnOutput, returnState);
};
/**
* Create a regular expression from the given regex source string.
*
* ```js
* const picomatch = require('picomatch');
* // picomatch.toRegex(source[, options]);
*
* const { output } = picomatch.parse('*.js');
* console.log(picomatch.toRegex(output));
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
* ```
* @param {String} `source` Regular expression source string.
* @param {Object} `options`
* @return {RegExp}
* @api public
*/ $304f14c7e435813f$var$picomatch.toRegex = (source, options)=>{
try {
const opts = options || {};
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
} catch (err) {
if (options && options.debug === true) throw err;
return /$^/;
}
};
/**
* Picomatch constants.
* @return {Object}
*/ $304f14c7e435813f$var$picomatch.constants = $7XmS6;
/**
* Expose "picomatch"
*/ module.exports = $304f14c7e435813f$var$picomatch;
});
parcelRequire.register("2zM8v", function(module, exports) {
"use strict";
var $5MQDC = parcelRequire("5MQDC");
var $7XmS6 = parcelRequire("7XmS6");
var $1e0430853cfb927a$require$CHAR_ASTERISK = $7XmS6.CHAR_ASTERISK;
var $1e0430853cfb927a$require$CHAR_AT = $7XmS6.CHAR_AT;
var $1e0430853cfb927a$require$CHAR_BACKWARD_SLASH = $7XmS6.CHAR_BACKWARD_SLASH;
var $1e0430853cfb927a$require$CHAR_COMMA = $7XmS6.CHAR_COMMA;
var $1e0430853cfb927a$require$CHAR_DOT = $7XmS6.CHAR_DOT;
var $1e0430853cfb927a$require$CHAR_EXCLAMATION_MARK = $7XmS6.CHAR_EXCLAMATION_MARK;
var $1e0430853cfb927a$require$CHAR_FORWARD_SLASH = $7XmS6.CHAR_FORWARD_SLASH;
var $1e0430853cfb927a$require$CHAR_LEFT_CURLY_BRACE = $7XmS6.CHAR_LEFT_CURLY_BRACE;
var $1e0430853cfb927a$require$CHAR_LEFT_PARENTHESES = $7XmS6.CHAR_LEFT_PARENTHESES;
var $1e0430853cfb927a$require$CHAR_LEFT_SQUARE_BRACKET = $7XmS6.CHAR_LEFT_SQUARE_BRACKET;
var $1e0430853cfb927a$require$CHAR_PLUS = $7XmS6.CHAR_PLUS;
var $1e0430853cfb927a$require$CHAR_QUESTION_MARK = $7XmS6.CHAR_QUESTION_MARK;
var $1e0430853cfb927a$require$CHAR_RIGHT_CURLY_BRACE = $7XmS6.CHAR_RIGHT_CURLY_BRACE;
var $1e0430853cfb927a$require$CHAR_RIGHT_PARENTHESES = $7XmS6.CHAR_RIGHT_PARENTHESES;
var $1e0430853cfb927a$require$CHAR_RIGHT_SQUARE_BRACKET = $7XmS6.CHAR_RIGHT_SQUARE_BRACKET;
const $1e0430853cfb927a$var$isPathSeparator = (code)=>{
return code === $1e0430853cfb927a$require$CHAR_FORWARD_SLASH || code === $1e0430853cfb927a$require$CHAR_BACKWARD_SLASH;
};
const $1e0430853cfb927a$var$depth = (token)=>{
if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
};
/**
* Quickly scans a glob pattern and returns an object with a handful of
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
*
* ```js
* const pm = require('picomatch');
* console.log(pm.scan('foo/bar/*.js'));
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
* ```
* @param {String} `str`
* @param {Object} `options`
* @return {Object} Returns an object with tokens and regex source string.
* @api public
*/ const $1e0430853cfb927a$var$scan = (input, options)=>{
const opts = options || {};
const length = input.length - 1;
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
const slashes = [];
const tokens = [];
const parts = [];
let str = input;
let index = -1;
let start = 0;
let lastIndex = 0;
let isBrace = false;
let isBracket = false;
let isGlob = false;
let isExtglob = false;
let isGlobstar = false;
let braceEscaped = false;
let backslashes = false;
let negated = false;
let negatedExtglob = false;
let finished = false;
let braces = 0;
let prev;
let code;
let token = {
value: "",
depth: 0,
isGlob: false
};
const eos = ()=>index >= length;
const peek = ()=>str.charCodeAt(index + 1);
const advance = ()=>{
prev = code;
return str.charCodeAt(++index);
};
while(index < length){
code = advance();
let next;
if (code === $1e0430853cfb927a$require$CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
code = advance();
if (code === $1e0430853cfb927a$require$CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
continue;
}
if (braceEscaped === true || code === $1e0430853cfb927a$require$CHAR_LEFT_CURLY_BRACE) {
braces++;
while(eos() !== true && (code = advance())){
if (code === $1e0430853cfb927a$require$CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (code === $1e0430853cfb927a$require$CHAR_LEFT_CURLY_BRACE) {
braces++;
continue;
}
if (braceEscaped !== true && code === $1e0430853cfb927a$require$CHAR_DOT && (code = advance()) === $1e0430853cfb927a$require$CHAR_DOT) {
isBrace = token.isBrace = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) continue;
break;
}
if (braceEscaped !== true && code === $1e0430853cfb927a$require$CHAR_COMMA) {
isBrace = token.isBrace = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) continue;
break;
}
if (code === $1e0430853cfb927a$require$CHAR_RIGHT_CURLY_BRACE) {
braces--;
if (braces === 0) {
braceEscaped = false;
isBrace = token.isBrace = true;
finished = true;
break;
}
}
}
if (scanToEnd === true) continue;
break;
}
if (code === $1e0430853cfb927a$require$CHAR_FORWARD_SLASH) {
slashes.push(index);
tokens.push(token);
token = {
value: "",
depth: 0,
isGlob: false
};
if (finished === true) continue;
if (prev === $1e0430853cfb927a$require$CHAR_DOT && index === start + 1) {
start += 2;
continue;
}
lastIndex = index + 1;
continue;
}
if (opts.noext !== true) {
const isExtglobChar = code === $1e0430853cfb927a$require$CHAR_PLUS || code === $1e0430853cfb927a$require$CHAR_AT || code === $1e0430853cfb927a$require$CHAR_ASTERISK || code === $1e0430853cfb927a$require$CHAR_QUESTION_MARK || code === $1e0430853cfb927a$require$CHAR_EXCLAMATION_MARK;
if (isExtglobChar === true && peek() === $1e0430853cfb927a$require$CHAR_LEFT_PARENTHESES) {
isGlob = token.isGlob = true;
isExtglob = token.isExtglob = true;
finished = true;
if (code === $1e0430853cfb927a$require$CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
if (scanToEnd === true) {
while(eos() !== true && (code = advance())){
if (code === $1e0430853cfb927a$require$CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
code = advance();
continue;
}
if (code === $1e0430853cfb927a$require$CHAR_RIGHT_PARENTHESES) {
isGlob = token.isGlob = true;
finished = true;
break;
}
}
continue;
}
break;
}
}
if (code === $1e0430853cfb927a$require$CHAR_ASTERISK) {
if (prev === $1e0430853cfb927a$require$CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) continue;
break;
}
if (code === $1e0430853cfb927a$require$CHAR_QUESTION_MARK) {
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) continue;
break;
}
if (code === $1e0430853cfb927a$require$CHAR_LEFT_SQUARE_BRACKET) {
while(eos() !== true && (next = advance())){
if (next === $1e0430853cfb927a$require$CHAR_BACKWARD_SLASH) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (next === $1e0430853cfb927a$require$CHAR_RIGHT_SQUARE_BRACKET) {
isBracket = token.isBracket = true;
isGlob = token.isGlob = true;
finished = true;
break;
}
}
if (scanToEnd === true) continue;
break;
}
if (opts.nonegate !== true && code === $1e0430853cfb927a$require$CHAR_EXCLAMATION_MARK && index === start) {
negated = token.negated = true;
start++;
continue;
}
if (opts.noparen !== true && code === $1e0430853cfb927a$require$CHAR_LEFT_PARENTHESES) {
isGlob = token.isGlob = true;
if (scanToEnd === true) {
while(eos() !== true && (code = advance())){
if (code === $1e0430853cfb927a$require$CHAR_LEFT_PARENTHESES) {
backslashes = token.backslashes = true;
code = advance();
continue;
}
if (code === $1e0430853cfb927a$require$CHAR_RIGHT_PARENTHESES) {
finished = true;
break;
}
}
continue;
}
break;
}
if (isGlob === true) {
finished = true;
if (scanToEnd === true) continue;
break;
}
}
if (opts.noext === true) {
isExtglob = false;
isGlob = false;
}
let base = str;
let prefix = "";
let glob = "";
if (start > 0) {
prefix = str.slice(0, start);
str = str.slice(start);
lastIndex -= start;
}
if (base && isGlob === true && lastIndex > 0) {
base = str.slice(0, lastIndex);
glob = str.slice(lastIndex);
} else if (isGlob === true) {
base = "";
glob = str;
} else base = str;
if (base && base !== "" && base !== "/" && base !== str) {
if ($1e0430853cfb927a$var$isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
}
if (opts.unescape === true) {
if (glob) glob = $5MQDC.removeBackslashes(glob);
if (base && backslashes === true) base = $5MQDC.removeBackslashes(base);
}
const state = {
prefix: prefix,
input: input,
start: start,
base: base,
glob: glob,
isBrace: isBrace,
isBracket: isBracket,
isGlob: isGlob,
isExtglob: isExtglob,
isGlobstar: isGlobstar,
negated: negated,
negatedExtglob: negatedExtglob
};
if (opts.tokens === true) {
state.maxDepth = 0;
if (!$1e0430853cfb927a$var$isPathSeparator(code)) tokens.push(token);
state.tokens = tokens;
}
if (opts.parts === true || opts.tokens === true) {
let prevIndex;
for(let idx = 0; idx < slashes.length; idx++){
const n = prevIndex ? prevIndex + 1 : start;
const i = slashes[idx];
const value = input.slice(n, i);
if (opts.tokens) {
if (idx === 0 && start !== 0) {
tokens[idx].isPrefix = true;
tokens[idx].value = prefix;
} else tokens[idx].value = value;
$1e0430853cfb927a$var$depth(tokens[idx]);
state.maxDepth += tokens[idx].depth;
}
if (idx !== 0 || value !== "") parts.push(value);
prevIndex = i;
}
if (prevIndex && prevIndex + 1 < input.length) {
const value = input.slice(prevIndex + 1);
parts.push(value);
if (opts.tokens) {
tokens[tokens.length - 1].value = value;
$1e0430853cfb927a$var$depth(tokens[tokens.length - 1]);
state.maxDepth += tokens[tokens.length - 1].depth;
}
}
state.slashes = slashes;
state.parts = parts;
}
return state;
};
module.exports = $1e0430853cfb927a$var$scan;
});
parcelRequire.register("5MQDC", function(module, exports) {
$parcel$export(module.exports, "isObject", () => $436a44408af843d4$export$a6cdc56e425d0d0a, (v) => $436a44408af843d4$export$a6cdc56e425d0d0a = v);
$parcel$export(module.exports, "hasRegexChars", () => $436a44408af843d4$export$6540a013a39bb50d, (v) => $436a44408af843d4$export$6540a013a39bb50d = v);
$parcel$export(module.exports, "escapeRegex", () => $436a44408af843d4$export$104ed90cc1a13451, (v) => $436a44408af843d4$export$104ed90cc1a13451 = v);
$parcel$export(module.exports, "toPosixSlashes", () => $436a44408af843d4$export$e610e037975797ee, (v) => $436a44408af843d4$export$e610e037975797ee = v);
$parcel$export(module.exports, "removeBackslashes", () => $436a44408af843d4$export$f403de0a7ba7a743, (v) => $436a44408af843d4$export$f403de0a7ba7a743 = v);
$parcel$export(module.exports, "supportsLookbehinds", () => $436a44408af843d4$export$bcf709e5e3483cdb, (v) => $436a44408af843d4$export$bcf709e5e3483cdb = v);
$parcel$export(module.exports, "isWindows", () => $436a44408af843d4$export$f993c945890e93ba, (v) => $436a44408af843d4$export$f993c945890e93ba = v);
$parcel$export(module.exports, "escapeLast", () => $436a44408af843d4$export$13d0f4185f159c8, (v) => $436a44408af843d4$export$13d0f4185f159c8 = v);
$parcel$export(module.exports, "removePrefix", () => $436a44408af843d4$export$f2888183a34644d4, (v) => $436a44408af843d4$export$f2888183a34644d4 = v);
$parcel$export(module.exports, "wrapOutput", () => $436a44408af843d4$export$25bddda26836484b, (v) => $436a44408af843d4$export$25bddda26836484b = v);
var $436a44408af843d4$export$a6cdc56e425d0d0a;
var $436a44408af843d4$export$6540a013a39bb50d;
var $436a44408af843d4$export$a92319f7ab133839;
var $436a44408af843d4$export$104ed90cc1a13451;
var $436a44408af843d4$export$e610e037975797ee;
var $436a44408af843d4$export$f403de0a7ba7a743;
var $436a44408af843d4$export$bcf709e5e3483cdb;
var $436a44408af843d4$export$f993c945890e93ba;
var $436a44408af843d4$export$13d0f4185f159c8;
var $436a44408af843d4$export$f2888183a34644d4;
var $436a44408af843d4$export$25bddda26836484b;
"use strict";
const $436a44408af843d4$var$win32 = process.platform === "win32";
var $7XmS6 = parcelRequire("7XmS6");
var $436a44408af843d4$require$REGEX_BACKSLASH = $7XmS6.REGEX_BACKSLASH;
var $436a44408af843d4$require$REGEX_REMOVE_BACKSLASH = $7XmS6.REGEX_REMOVE_BACKSLASH;
var $436a44408af843d4$require$REGEX_SPECIAL_CHARS = $7XmS6.REGEX_SPECIAL_CHARS;
var $436a44408af843d4$require$REGEX_SPECIAL_CHARS_GLOBAL = $7XmS6.REGEX_SPECIAL_CHARS_GLOBAL;
$436a44408af843d4$export$a6cdc56e425d0d0a = (val)=>val !== null && typeof val === "object" && !Array.isArray(val);
$436a44408af843d4$export$6540a013a39bb50d = (str)=>$436a44408af843d4$require$REGEX_SPECIAL_CHARS.test(str);
$436a44408af843d4$export$a92319f7ab133839 = (str)=>str.length === 1 && $436a44408af843d4$export$6540a013a39bb50d(str);
$436a44408af843d4$export$104ed90cc1a13451 = (str)=>str.replace($436a44408af843d4$require$REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
$436a44408af843d4$export$e610e037975797ee = (str)=>str.replace($436a44408af843d4$require$REGEX_BACKSLASH, "/");
$436a44408af843d4$export$f403de0a7ba7a743 = (str)=>{
return str.replace($436a44408af843d4$require$REGEX_REMOVE_BACKSLASH, (match)=>{
return match === "\\" ? "" : match;
});
};
$436a44408af843d4$export$bcf709e5e3483cdb = ()=>{
const segs = process.version.slice(1).split(".").map(Number);
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) return true;
return false;
};
$436a44408af843d4$export$f993c945890e93ba = (options)=>{
if (options && typeof options.windows === "boolean") return options.windows;
return $436a44408af843d4$var$win32 === true || $8C1kk$path.sep === "\\";
};
$436a44408af843d4$export$13d0f4185f159c8 = (input, char, lastIdx)=>{
const idx = input.lastIndexOf(char, lastIdx);
if (idx === -1) return input;
if (input[idx - 1] === "\\") return $436a44408af843d4$export$13d0f4185f159c8(input, char, idx - 1);
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
};
$436a44408af843d4$export$f2888183a34644d4 = (input, state = {})=>{
let output = input;
if (output.startsWith("./")) {
output = output.slice(2);
state.prefix = "./";
}
return output;
};
$436a44408af843d4$export$25bddda26836484b = (input, state = {}, options = {})=>{
const prepend = options.contains ? "" : "^";
const append = options.contains ? "" : "$";
let output = `${prepend}(?:${input})${append}`;
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
return output;
};
});
parcelRequire.register("7XmS6", function(module, exports) {
"use strict";
const $017eb4c9ec326d4f$var$WIN_SLASH = "\\\\/";
const $017eb4c9ec326d4f$var$WIN_NO_SLASH = `[^${$017eb4c9ec326d4f$var$WIN_SLASH}]`;
/**
* Posix glob regex
*/ const $017eb4c9ec326d4f$var$DOT_LITERAL = "\\.";
const $017eb4c9ec326d4f$var$PLUS_LITERAL = "\\+";
const $017eb4c9ec326d4f$var$QMARK_LITERAL = "\\?";
const $017eb4c9ec326d4f$var$SLASH_LITERAL = "\\/";
const $017eb4c9ec326d4f$var$ONE_CHAR = "(?=.)";
const $017eb4c9ec326d4f$var$QMARK = "[^/]";
const $017eb4c9ec326d4f$var$END_ANCHOR = `(?:${$017eb4c9ec326d4f$var$SLASH_LITERAL}|$)`;
const $017eb4c9ec326d4f$var$START_ANCHOR = `(?:^|${$017eb4c9ec326d4f$var$SLASH_LITERAL})`;
const $017eb4c9ec326d4f$var$DOTS_SLASH = `${$017eb4c9ec326d4f$var$DOT_LITERAL}{1,2}${$017eb4c9ec326d4f$var$END_ANCHOR}`;
const $017eb4c9ec326d4f$var$NO_DOT = `(?!${$017eb4c9ec326d4f$var$DOT_LITERAL})`;
const $017eb4c9ec326d4f$var$NO_DOTS = `(?!${$017eb4c9ec326d4f$var$START_ANCHOR}${$017eb4c9ec326d4f$var$DOTS_SLASH})`;
const $017eb4c9ec326d4f$var$NO_DOT_SLASH = `(?!${$017eb4c9ec326d4f$var$DOT_LITERAL}{0,1}${$017eb4c9ec326d4f$var$END_ANCHOR})`;
const $017eb4c9ec326d4f$var$NO_DOTS_SLASH = `(?!${$017eb4c9ec326d4f$var$DOTS_SLASH})`;
const $017eb4c9ec326d4f$var$QMARK_NO_DOT = `[^.${$017eb4c9ec326d4f$var$SLASH_LITERAL}]`;
const $017eb4c9ec326d4f$var$STAR = `${$017eb4c9ec326d4f$var$QMARK}*?`;
const $017eb4c9ec326d4f$var$POSIX_CHARS = {
DOT_LITERAL: $017eb4c9ec326d4f$var$DOT_LITERAL,
PLUS_LITERAL: $017eb4c9ec326d4f$var$PLUS_LITERAL,
QMARK_LITERAL: $017eb4c9ec326d4f$var$QMARK_LITERAL,
SLASH_LITERAL: $017eb4c9ec326d4f$var$SLASH_LITERAL,
ONE_CHAR: $017eb4c9ec326d4f$var$ONE_CHAR,
QMARK: $017eb4c9ec326d4f$var$QMARK,
END_ANCHOR: $017eb4c9ec326d4f$var$END_ANCHOR,
DOTS_SLASH: $017eb4c9ec326d4f$var$DOTS_SLASH,
NO_DOT: $017eb4c9ec326d4f$var$NO_DOT,
NO_DOTS: $017eb4c9ec326d4f$var$NO_DOTS,
NO_DOT_SLASH: $017eb4c9ec326d4f$var$NO_DOT_SLASH,
NO_DOTS_SLASH: $017eb4c9ec326d4f$var$NO_DOTS_SLASH,
QMARK_NO_DOT: $017eb4c9ec326d4f$var$QMARK_NO_DOT,
STAR: $017eb4c9ec326d4f$var$STAR,
START_ANCHOR: $017eb4c9ec326d4f$var$START_ANCHOR
};
/**
* Windows glob regex
*/ const $017eb4c9ec326d4f$var$WINDOWS_CHARS = {
...$017eb4c9ec326d4f$var$POSIX_CHARS,
SLASH_LITERAL: `[${$017eb4c9ec326d4f$var$WIN_SLASH}]`,
QMARK: $017eb4c9ec326d4f$var$WIN_NO_SLASH,
STAR: `${$017eb4c9ec326d4f$var$WIN_NO_SLASH}*?`,
DOTS_SLASH: `${$017eb4c9ec326d4f$var$DOT_LITERAL}{1,2}(?:[${$017eb4c9ec326d4f$var$WIN_SLASH}]|$)`,
NO_DOT: `(?!${$017eb4c9ec326d4f$var$DOT_LITERAL})`,
NO_DOTS: `(?!(?:^|[${$017eb4c9ec326d4f$var$WIN_SLASH}])${$017eb4c9ec326d4f$var$DOT_LITERAL}{1,2}(?:[${$017eb4c9ec326d4f$var$WIN_SLASH}]|$))`,
NO_DOT_SLASH: `(?!${$017eb4c9ec326d4f$var$DOT_LITERAL}{0,1}(?:[${$017eb4c9ec326d4f$var$WIN_SLASH}]|$))`,
NO_DOTS_SLASH: `(?!${$017eb4c9ec326d4f$var$DOT_LITERAL}{1,2}(?:[${$017eb4c9ec326d4f$var$WIN_SLASH}]|$))`,
QMARK_NO_DOT: `[^.${$017eb4c9ec326d4f$var$WIN_SLASH}]`,
START_ANCHOR: `(?:^|[${$017eb4c9ec326d4f$var$WIN_SLASH}])`,
END_ANCHOR: `(?:[${$017eb4c9ec326d4f$var$WIN_SLASH}]|$)`
};
/**
* POSIX Bracket Regex
*/ const $017eb4c9ec326d4f$var$POSIX_REGEX_SOURCE = {
alnum: "a-zA-Z0-9",
alpha: "a-zA-Z",
ascii: "\\x00-\\x7F",
blank: " \\t",
cntrl: "\\x00-\\x1F\\x7F",
digit: "0-9",
graph: "\\x21-\\x7E",
lower: "a-z",
print: "\\x20-\\x7E ",
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
space: " \\t\\r\\n\\v\\f",
upper: "A-Z",
word: "A-Za-z0-9_",
xdigit: "A-Fa-f0-9"
};
module.exports = {
MAX_LENGTH: 65536,
POSIX_REGEX_SOURCE: $017eb4c9ec326d4f$var$POSIX_REGEX_SOURCE,
// regular expressions
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
// Replace globs with equivalent patterns to reduce parsing time.
REPLACEMENTS: {
"***": "*",
"**/**": "**",
"**/**/**": "**"
},
// Digits
CHAR_0: 48,
/* 0 */ CHAR_9: 57,
/* 9 */ // Alphabet chars.
CHAR_UPPERCASE_A: 65,
/* A */ CHAR_LOWERCASE_A: 97,
/* a */ CHAR_UPPERCASE_Z: 90,
/* Z */ CHAR_LOWERCASE_Z: 122,
/* z */ CHAR_LEFT_PARENTHESES: 40,
/* ( */ CHAR_RIGHT_PARENTHESES: 41,
/* ) */ CHAR_ASTERISK: 42,
/* * */ // Non-alphabetic chars.
CHAR_AMPERSAND: 38,
/* & */ CHAR_AT: 64,
/* @ */ CHAR_BACKWARD_SLASH: 92,
/* \ */ CHAR_CARRIAGE_RETURN: 13,
/* \r */ CHAR_CIRCUMFLEX_ACCENT: 94,
/* ^ */ CHAR_COLON: 58,
/* : */ CHAR_COMMA: 44,
/* , */ CHAR_DOT: 46,
/* . */ CHAR_DOUBLE_QUOTE: 34,
/* " */ CHAR_EQUAL: 61,
/* = */ CHAR_EXCLAMATION_MARK: 33,
/* ! */ CHAR_FORM_FEED: 12,
/* \f */ CHAR_FORWARD_SLASH: 47,
/* / */ CHAR_GRAVE_ACCENT: 96,
/* ` */ CHAR_HASH: 35,
/* # */ CHAR_HYPHEN_MINUS: 45,
/* - */ CHAR_LEFT_ANGLE_BRACKET: 60,
/* < */ CHAR_LEFT_CURLY_BRACE: 123,
/* { */ CHAR_LEFT_SQUARE_BRACKET: 91,
/* [ */ CHAR_LINE_FEED: 10,
/* \n */ CHAR_NO_BREAK_SPACE: 160,
/* \u00A0 */ CHAR_PERCENT: 37,
/* % */ CHAR_PLUS: 43,
/* + */ CHAR_QUESTION_MARK: 63,
/* ? */ CHAR_RIGHT_ANGLE_BRACKET: 62,
/* > */ CHAR_RIGHT_CURLY_BRACE: 125,
/* } */ CHAR_RIGHT_SQUARE_BRACKET: 93,
/* ] */ CHAR_SEMICOLON: 59,
/* ; */ CHAR_SINGLE_QUOTE: 39,
/* ' */ CHAR_SPACE: 32,
/* */ CHAR_TAB: 9,
/* \t */ CHAR_UNDERSCORE: 95,
/* _ */ CHAR_VERTICAL_LINE: 124,
/* | */ CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
/* \uFEFF */ SEP: $8C1kk$path.sep,
/**
* Create EXTGLOB_CHARS
*/ extglobChars (chars) {
return {
"!": {
type: "negate",
open: "(?:(?!(?:",
close: `))${chars.STAR})`
},
"?": {
type: "qmark",
open: "(?:",
close: ")?"
},
"+": {
type: "plus",
open: "(?:",
close: ")+"
},
"*": {
type: "star",
open: "(?:",
close: ")*"
},
"@": {
type: "at",
open: "(?:",
close: ")"
}
};
},
/**
* Create GLOB_CHARS
*/ globChars (win32) {
return win32 === true ? $017eb4c9ec326d4f$var$WINDOWS_CHARS : $017eb4c9ec326d4f$var$POSIX_CHARS;
}
};
});
parcelRequire.register("lKEF0", function(module, exports) {
"use strict";
var $7XmS6 = parcelRequire("7XmS6");
var $5MQDC = parcelRequire("5MQDC");
/**
* Constants
*/ const { MAX_LENGTH: $fd5d6f248e5b4a63$var$MAX_LENGTH , POSIX_REGEX_SOURCE: $fd5d6f248e5b4a63$var$POSIX_REGEX_SOURCE , REGEX_NON_SPECIAL_CHARS: $fd5d6f248e5b4a63$var$REGEX_NON_SPECIAL_CHARS , REGEX_SPECIAL_CHARS_BACKREF: $fd5d6f248e5b4a63$var$REGEX_SPECIAL_CHARS_BACKREF , REPLACEMENTS: $fd5d6f248e5b4a63$var$REPLACEMENTS } = $7XmS6;
/**
* Helpers
*/ const $fd5d6f248e5b4a63$var$expandRange = (args, options)=>{
if (typeof options.expandRange === "function") return options.expandRange(...args, options);
args.sort();
const value = `[${args.join("-")}]`;
try {
/* eslint-disable-next-line no-new */ new RegExp(value);
} catch (ex) {
return args.map((v)=>$5MQDC.escapeRegex(v)).join("..");
}
return value;
};
/**
* Create the message for a syntax error
*/ const $fd5d6f248e5b4a63$var$syntaxError = (type, char)=>{
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
};
/**
* Parse the given input string.
* @param {String} input
* @param {Object} options
* @return {Object}
*/ const $fd5d6f248e5b4a63$var$parse = (input, options)=>{
if (typeof input !== "string") throw new TypeError("Expected a string");
input = $fd5d6f248e5b4a63$var$REPLACEMENTS[input] || input;
const opts1 = {
...options
};
const max = typeof opts1.maxLength === "number" ? Math.min($fd5d6f248e5b4a63$var$MAX_LENGTH, opts1.maxLength) : $fd5d6f248e5b4a63$var$MAX_LENGTH;
let len = input.length;
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
const bos = {
type: "bos",
value: "",
output: opts1.prepend || ""
};
const tokens = [
bos
];
const capture = opts1.capture ? "" : "?:";
const win32 = $5MQDC.isWindows(options);
// create constants based on platform, for windows or posix
const PLATFORM_CHARS = $7XmS6.globChars(win32);
const EXTGLOB_CHARS = $7XmS6.extglobChars(PLATFORM_CHARS);
const { DOT_LITERAL: DOT_LITERAL , PLUS_LITERAL: PLUS_LITERAL , SLASH_LITERAL: SLASH_LITERAL , ONE_CHAR: ONE_CHAR , DOTS_SLASH: DOTS_SLASH , NO_DOT: NO_DOT , NO_DOT_SLASH: NO_DOT_SLASH , NO_DOTS_SLASH: NO_DOTS_SLASH , QMARK: QMARK , QMARK_NO_DOT: QMARK_NO_DOT , STAR: STAR , START_ANCHOR: START_ANCHOR } = PLATFORM_CHARS;
const globstar = (opts)=>{
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
};
const nodot = opts1.dot ? "" : NO_DOT;
const qmarkNoDot = opts1.dot ? QMARK : QMARK_NO_DOT;
let star = opts1.bash === true ? globstar(opts1) : STAR;
if (opts1.capture) star = `(${star})`;
// minimatch options support
if (typeof opts1.noext === "boolean") opts1.noextglob = opts1.noext;
const state = {
input: input,
index: -1,
start: 0,
dot: opts1.dot === true,
consumed: "",
output: "",
prefix: "",
backtrack: false,
negated: false,
brackets: 0,
braces: 0,
parens: 0,
quotes: 0,
globstar: false,
tokens: tokens
};
input = $5MQDC.removePrefix(input, state);
len = input.length;
const extglobs = [];
const braces = [];
const stack = [];
let prev = bos;
let value1;
/**
* Tokenizing helpers
*/ const eos = ()=>state.index === len - 1;
const peek = state.peek = (n = 1)=>input[state.index + n];
const advance = state.advance = ()=>input[++state.index] || "";
const remaining = ()=>input.slice(state.index + 1);
const consume = (value = "", num = 0)=>{
state.consumed += value;
state.index += num;
};
const append = (token)=>{
state.output += token.output != null ? token.output : token.value;
consume(token.value);
};
const negate = ()=>{
let count = 1;
while(peek() === "!" && (peek(2) !== "(" || peek(3) === "?")){
advance();
state.start++;
count++;
}
if (count % 2 === 0) return false;
state.negated = true;
state.start++;
return true;
};
const increment = (type)=>{
state[type]++;
stack.push(type);
};
const decrement = (type)=>{
state[type]--;
stack.pop();
};
/**
* Push tokens onto the tokens array. This helper speeds up
* tokenizing by 1) helping us avoid backtracking as much as possible,
* and 2) helping us avoid creating extra tokens when consecutive
* characters are plain text. This improves performance and simplifies
* lookbehinds.
*/ const push = (tok)=>{
if (prev.type === "globstar") {
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
state.output = state.output.slice(0, -prev.output.length);
prev.type = "star";
prev.value = "*";
prev.output = star;
state.output += prev.output;
}
}
if (extglobs.length && tok.type !== "paren") extglobs[extglobs.length - 1].inner += tok.value;
if (tok.value || tok.output) append(tok);
if (prev && prev.type === "text" && tok.type === "text") {
prev.value += tok.value;
prev.output = (prev.output || "") + tok.value;
return;
}
tok.prev = prev;
tokens.push(tok);
prev = tok;
};
const extglobOpen = (type, value)=>{
const token = {
...EXTGLOB_CHARS[value],
conditions: 1,
inner: ""
};
token.prev = prev;
token.parens = state.parens;
token.output = state.output;
const output = (opts1.capture ? "(" : "") + token.open;
increment("parens");
push({
type: type,
value: value,
output: state.output ? "" : ONE_CHAR
});
push({
type: "paren",
extglob: true,
value: advance(),
output: output
});
extglobs.push(token);
};
const extglobClose = (token)=>{
let output = token.close + (opts1.capture ? ")" : "");
let rest;
if (token.type === "negate") {
let extglobStar = star;
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) extglobStar = globstar(opts1);
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) output = token.close = `)$))${extglobStar}`;
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) output = token.close = `)${rest})${extglobStar})`;
if (token.prev.type === "bos") state.negatedExtglob = true;
}
push({
type: "paren",
extglob: true,
value: value1,
output: output
});
decrement("parens");
};
/**
* Fast paths
*/ if (opts1.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
let backslashes = false;
let output = input.replace($fd5d6f248e5b4a63$var$REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index)=>{
if (first === "\\") {
backslashes = true;
return m;
}
if (first === "?") {
if (esc) return esc + first + (rest ? QMARK.repeat(rest.length) : "");
if (index === 0) return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
return QMARK.repeat(chars.length);
}
if (first === ".") return DOT_LITERAL.repeat(chars.length);
if (first === "*") {
if (esc) return esc + first + (rest ? star : "");
return star;
}
return esc ? m : `\\${m}`;
});
if (backslashes === true) {
if (opts1.unescape === true) output = output.replace(/\\/g, "");
else output = output.replace(/\\+/g, (m)=>{
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
});
}
if (output === input && opts1.contains === true) {
state.output = input;
return state;
}
state.output = $5MQDC.wrapOutput(output, state, options);
return state;
}
/**
* Tokenize input until we reach end-of-string
*/ while(!eos()){
value1 = advance();
if (value1 === "\0") continue;
/**
* Escaped characters
*/ if (value1 === "\\") {
const next = peek();
if (next === "/" && opts1.bash !== true) continue;
if (next === "." || next === ";") continue;
if (!next) {
value1 += "\\";
push({
type: "text",
value: value1
});
continue;
}
// collapse slashes to reduce potential for exploits
const match = /^\\+/.exec(remaining());
let slashes = 0;
if (match && match[0].length > 2) {
slashes = match[0].length;
state.index += slashes;
if (slashes % 2 !== 0) value1 += "\\";
}
if (opts1.unescape === true) value1 = advance();
else value1 += advance();
if (state.brackets === 0) {
push({
type: "text",
value: value1
});
continue;
}
}
/**
* If we're inside a regex character class, continue
* until we reach the closing bracket.
*/ if (state.brackets > 0 && (value1 !== "]" || prev.value === "[" || prev.value === "[^")) {
if (opts1.posix !== false && value1 === ":") {
const inner = prev.value.slice(1);
if (inner.includes("[")) {
prev.posix = true;
if (inner.includes(":")) {
const idx = prev.value.lastIndexOf("[");
const pre = prev.value.slice(0, idx);
const rest = prev.value.slice(idx + 2);
const posix = $fd5d6f248e5b4a63$var$POSIX_REGEX_SOURCE[rest];
if (posix) {
prev.value = pre + posix;
state.backtrack = true;
advance();
if (!bos.output && tokens.indexOf(prev) === 1) bos.output = ONE_CHAR;
continue;
}
}
}
}
if (value1 === "[" && peek() !== ":" || value1 === "-" && peek() === "]") value1 = `\\${value1}`;
if (value1 === "]" && (prev.value === "[" || prev.value === "[^")) value1 = `\\${value1}`;
if (opts1.posix === true && value1 === "!" && prev.value === "[") value1 = "^";
prev.value += value1;
append({
value: value1
});
continue;
}
/**
* If we're inside a quoted string, continue
* until we reach the closing double quote.
*/ if (state.quotes === 1 && value1 !== '"') {
value1 = $5MQDC.escapeRegex(value1);
prev.value += value1;
append({
value: value1
});
continue;
}
/**
* Double quotes
*/ if (value1 === '"') {
state.quotes = state.quotes === 1 ? 0 : 1;
if (opts1.keepQuotes === true) push({
type: "text",
value: value1
});
continue;
}
/**
* Parentheses
*/ if (value1 === "(") {
increment("parens");
push({
type: "paren",
value: value1
});
continue;
}
if (value1 === ")") {
if (state.parens === 0 && opts1.strictBrackets === true) throw new SyntaxError($fd5d6f248e5b4a63$var$syntaxError("opening", "("));
const extglob = extglobs[extglobs.length - 1];
if (extglob && state.parens === extglob.parens + 1) {
extglobClose(extglobs.pop());
continue;
}
push({
type: "paren",
value: value1,
output: state.parens ? ")" : "\\)"
});
decrement("parens");
continue;
}
/*